From 20b327ae54e4dcbb359fd25e950e5fffed295c96 Mon Sep 17 00:00:00 2001 From: takeshita Date: Tue, 25 Nov 2025 10:39:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E5=8F=B3=E9=94=AE?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=98=BE=E7=A4=BA=E6=96=87=E6=9C=AC=E6=A1=86?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9B=E5=9B=BE=E5=B1=82=E6=8C=87=E6=8C=A5?= =?UTF-8?q?=E8=88=B1=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=B6=E4=B8=8D=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E5=8D=B7=E5=B8=98=E5=AF=B9=E6=AF=94=E9=80=89=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/assets/styles/global.css | 2 +- src/renderer/components/Tree/treeNode.js | 6 ++++-- src/renderer/components/Tree/treeSetting.js | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/renderer/assets/styles/global.css b/src/renderer/assets/styles/global.css index 9185709..4142210 100644 --- a/src/renderer/assets/styles/global.css +++ b/src/renderer/assets/styles/global.css @@ -273,7 +273,7 @@ img { } #custom-menu ul:nth-child(2){ - display: none; + /* display: none; */ } /* 提示 */ /* .el-message--info { diff --git a/src/renderer/components/Tree/treeNode.js b/src/renderer/components/Tree/treeNode.js index be58309..1dd757f 100644 --- a/src/renderer/components/Tree/treeNode.js +++ b/src/renderer/components/Tree/treeNode.js @@ -1180,14 +1180,16 @@ let cusNodeIcon = (node) => { * 渲染节点 * @param node */ -let cusRenderNode = (node, isFlyTo = true) => { +let cusRenderNode = (node, isFlyTo = true, isSelect = true) => { if (!_entityMap.has(node.source_id)) { let res = localStorage.getItem("defaultView"); console.log("++++++++++++", node); // if(node.is_show) nodeType[node.source_type].render(node, isFlyTo, () => {}); console.log("cusRenderNode1111111111111111111111111", node); - YJ.Global.splitScreen.setActiveId([node.source_id]); + if(isSelect) { + YJ.Global.splitScreen.setActiveId([node.source_id]); + } } }; let cusRenderNode2d = (node) => { diff --git a/src/renderer/components/Tree/treeSetting.js b/src/renderer/components/Tree/treeSetting.js index fc44ed7..9b86135 100644 --- a/src/renderer/components/Tree/treeSetting.js +++ b/src/renderer/components/Tree/treeSetting.js @@ -119,7 +119,7 @@ const tree = { node.source_type == "path" ) { if (!["pressModel", "terrainDig"].includes(node.source_type)) { - treeNodeOption.cusRenderNode(node, false); + treeNodeOption.cusRenderNode(node, false, false); } } } From 3ddba15ff2776c48c372054c9a402a3fd3cac409 Mon Sep 17 00:00:00 2001 From: takeshita Date: Tue, 25 Nov 2025 11:46:31 +0800 Subject: [PATCH 2/2] sdk --- static/sdk/YJEarth.min.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/sdk/YJEarth.min.js b/static/sdk/YJEarth.min.js index 875230c..588465a 100644 --- a/static/sdk/YJEarth.min.js +++ b/static/sdk/YJEarth.min.js @@ -1,4 +1,4 @@ -/*! update time: 2025/11/20 14:51:13*/!function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=22)}([function(t,e,i){var n=i(23)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(18);function o(t,e){for(var i=0;it.length)&&(e=t.length);for(var i=0,n=Array(e);it.length)&&(e=t.length);for(var i=0,n=Array(e);i>2]|=t[s]<>6,l[o++]=128|63&n):n<55296||n>=57344?(l[o++]=224|n>>12,l[o++]=128|n>>6&63,l[o++]=128|63&n):(n=65536+((1023&n)<<10|1023&t.charCodeAt(++s)),l[o++]=240|n>>18,l[o++]=128|n>>12&63,l[o++]=128|n>>6&63,l[o++]=128|63&n);else for(o=this.start;s>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(r[o>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=64?(this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[e>>2]|=EXTRA[3&e],e>=56&&(this.hashed||this.hash(),t[0]=t[16],t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.bytes<<3,t[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var t,e,i,n,o,s,a=this.blocks;this.first?e=((e=((t=((t=a[0]-680876937)<<7|t>>>25)-271733879<<0)^(i=((i=(-271733879^(n=((n=(-1732584194^2004318071&t)+a[1]-117830708)<<12|n>>>20)+t<<0)&(-271733879^t))+a[2]-1126478375)<<17|i>>>15)+n<<0)&(n^t))+a[3]-1316259209)<<22|e>>>10)+i<<0:(t=this.h0,e=this.h1,i=this.h2,e=((e+=((t=((t+=((n=this.h3)^e&(i^n))+a[0]-680876936)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[1]-389564586)<<12|n>>>20)+t<<0)&(t^e))+a[2]+606105819)<<17|i>>>15)+n<<0)&(n^t))+a[3]-1044525330)<<22|e>>>10)+i<<0),e=((e+=((t=((t+=(n^e&(i^n))+a[4]-176418897)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[5]+1200080426)<<12|n>>>20)+t<<0)&(t^e))+a[6]-1473231341)<<17|i>>>15)+n<<0)&(n^t))+a[7]-45705983)<<22|e>>>10)+i<<0,e=((e+=((t=((t+=(n^e&(i^n))+a[8]+1770035416)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[9]-1958414417)<<12|n>>>20)+t<<0)&(t^e))+a[10]-42063)<<17|i>>>15)+n<<0)&(n^t))+a[11]-1990404162)<<22|e>>>10)+i<<0,e=((e+=((t=((t+=(n^e&(i^n))+a[12]+1804603682)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[13]-40341101)<<12|n>>>20)+t<<0)&(t^e))+a[14]-1502002290)<<17|i>>>15)+n<<0)&(n^t))+a[15]+1236535329)<<22|e>>>10)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[1]-165796510)<<5|t>>>27)+e<<0)^e))+a[6]-1069501632)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[11]+643717713)<<14|i>>>18)+n<<0)^n))+a[0]-373897302)<<20|e>>>12)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[5]-701558691)<<5|t>>>27)+e<<0)^e))+a[10]+38016083)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[15]-660478335)<<14|i>>>18)+n<<0)^n))+a[4]-405537848)<<20|e>>>12)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[9]+568446438)<<5|t>>>27)+e<<0)^e))+a[14]-1019803690)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[3]-187363961)<<14|i>>>18)+n<<0)^n))+a[8]+1163531501)<<20|e>>>12)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[13]-1444681467)<<5|t>>>27)+e<<0)^e))+a[2]-51403784)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[7]+1735328473)<<14|i>>>18)+n<<0)^n))+a[12]-1926607734)<<20|e>>>12)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[5]-378558)<<4|t>>>28)+e<<0))+a[8]-2022574463)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[11]+1839030562)<<16|i>>>16)+n<<0))+a[14]-35309556)<<23|e>>>9)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[1]-1530992060)<<4|t>>>28)+e<<0))+a[4]+1272893353)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[7]-155497632)<<16|i>>>16)+n<<0))+a[10]-1094730640)<<23|e>>>9)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[13]+681279174)<<4|t>>>28)+e<<0))+a[0]-358537222)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[3]-722521979)<<16|i>>>16)+n<<0))+a[6]+76029189)<<23|e>>>9)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[9]-640364487)<<4|t>>>28)+e<<0))+a[12]-421815835)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[15]+530742520)<<16|i>>>16)+n<<0))+a[2]-995338651)<<23|e>>>9)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[0]-198630844)<<6|t>>>26)+e<<0)|~i))+a[7]+1126891415)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[14]-1416354905)<<15|i>>>17)+n<<0)|~t))+a[5]-57434055)<<21|e>>>11)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[12]+1700485571)<<6|t>>>26)+e<<0)|~i))+a[3]-1894986606)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[10]-1051523)<<15|i>>>17)+n<<0)|~t))+a[1]-2054922799)<<21|e>>>11)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[8]+1873313359)<<6|t>>>26)+e<<0)|~i))+a[15]-30611744)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[6]-1560198380)<<15|i>>>17)+n<<0)|~t))+a[13]+1309151649)<<21|e>>>11)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[4]-145523070)<<6|t>>>26)+e<<0)|~i))+a[11]-1120210379)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[2]+718787259)<<15|i>>>17)+n<<0)|~t))+a[9]-343485551)<<21|e>>>11)+i<<0,this.first?(this.h0=t+1732584193<<0,this.h1=e-271733879<<0,this.h2=i-1732584194<<0,this.h3=n+271733878<<0,this.first=!1):(this.h0=this.h0+t<<0,this.h1=this.h1+e<<0,this.h2=this.h2+i<<0,this.h3=this.h3+n<<0)},Md5.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,i=this.h2,n=this.h3;return HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,i=this.h2,n=this.h3;return[255&t,t>>8&255,t>>16&255,t>>24&255,255&e,e>>8&255,e>>16&255,e>>24&255,255&i,i>>8&255,i>>16&255,i>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(16),e=new Uint32Array(t);return e[0]=this.h0,e[1]=this.h1,e[2]=this.h2,e[3]=this.h3,t},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var t,e,i,n="",o=this.array(),s=0;s<15;)t=o[s++],e=o[s++],i=o[s++],n+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[63&(t<<4|e>>>4)]+BASE64_ENCODE_CHAR[63&(e<<2|i>>>6)]+BASE64_ENCODE_CHAR[63&i];return t=o[s],n+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[t<<4&63]+"=="};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}()}).call(this,__webpack_require__(31),__webpack_require__(32))},function(t,e,i){var n=i(5),o=i(15),s=i(34),a=i(35);function r(e){var i="function"==typeof Map?new Map:void 0;return t.exports=r=function(t){if(null===t||!s(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(t))return i.get(t);i.set(t,e)}function e(){return a(t,arguments,n(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),o(e,t)},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){t.exports=i(39)},function(t,e,i){var n=i(11).default;function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=o=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var e,i={},s=Object.prototype,a=s.hasOwnProperty,r=Object.defineProperty||function(t,e,i){t[e]=i.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",p=l.toStringTag||"@@toStringTag";function h(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(e){h=function(t,e,i){return t[e]=i}}function d(t,e,i,n){var o=e&&e.prototype instanceof b?e:b,s=Object.create(o.prototype),a=new N(n||[]);return r(s,"_invoke",{value:P(t,i,a)}),s}function m(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}i.wrap=d;var f="suspendedStart",v="executing",g="completed",y={};function b(){}function C(){}function w(){}var k={};h(k,c,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(B([])));_&&_!==s&&a.call(_,c)&&(k=_);var E=w.prototype=b.prototype=Object.create(k);function S(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function i(o,s,r,l){var c=m(t[o],t,s);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==n(p)&&a.call(p,"__await")?e.resolve(p.__await).then((function(t){i("next",t,r,l)}),(function(t){i("throw",t,r,l)})):e.resolve(p).then((function(t){u.value=t,r(u)}),(function(t){return i("throw",t,r,l)}))}l(c.arg)}var o;r(this,"_invoke",{value:function(t,n){function s(){return new e((function(e,o){i(t,n,e,o)}))}return o=o?o.then(s,s):s()}})}function P(t,i,n){var o=f;return function(s,a){if(o===v)throw Error("Generator is already running");if(o===g){if("throw"===s)throw a;return{value:e,done:!0}}for(n.method=s,n.arg=a;;){var r=n.delegate;if(r){var l=M(r,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=m(t,i,n);if("normal"===c.type){if(o=n.done?g:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.arg)}}}function M(t,i){var n=i.method,o=t.iterator[n];if(o===e)return i.delegate=null,"throw"===n&&t.iterator.return&&(i.method="return",i.arg=e,M(t,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var s=m(o,t.iterator,i.arg);if("throw"===s.type)return i.method="throw",i.arg=s.arg,i.delegate=null,y;var a=s.arg;return a?a.done?(i[t.resultName]=a.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,y):a:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function B(t){if(t||""===t){var i=t[c];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,s=function i(){for(;++o=0;--o){var s=this.tryEntries[o],r=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var l=a.call(s,"catchLoc"),c=a.call(s,"finallyLoc");if(l&&c){if(this.prev=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),T(i),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var o=n.arg;T(i)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:B(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),y}},i}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,o,s,a,r=[],l=!0,c=!1;try{if(s=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(r.push(n.value),r.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(c)throw o}}return r}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(11).default;t.exports=function(t,e){if("object"!=n(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var o=i.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(17);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){var i,n,o=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function r(t){if(i===setTimeout)return setTimeout(t,0);if((i===s||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:s}catch(t){i=s}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var l,c=[],u=!1,p=-1;function h(){u&&l&&(u=!1,l.length?c=l.concat(c):p=-1,c.length&&d())}function d(){if(!u){var t=r(h);u=!0;for(var e=c.length;e;){for(l=c,c=[];++p1)for(var i=1;i0&&void 0!==o[0]?o[0]:{},t.next=3,fetch((e.host||"")+"/yjearth4.0/api/v1/user/sign-in",{method:"post",body:JSON.stringify({username:e.username,password:e.password}),headers:{"Content-Type":"application/json"}});case 3:return i=t.sent,t.next=6,i.text();case 6:n=t.sent,0===(n=JSON.parse(n)).code&&(p(e.host),n.token?d(n.token):d(n.data.token));case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function p(t){localStorage.setItem(l,t||"")}function h(){return localStorage.getItem(l)||""}function d(t){localStorage.setItem(r,t)}function m(){return localStorage.getItem(r)}function f(){var t=document.querySelectorAll("script"),e="";return t.forEach((function(t){if(t.src.indexOf("YJEarth.min.js")>-1){var i=t.src.split("/");i.pop(),e=i.join("/")}})),e}var g=i(10),y=i.n(g),b=i(8),C=i.n(b),w=i(1),k=i.n(w),x=i(2),_=i.n(x);function E(t){document.addEventListener("keydown",M.bind(t),!1),document.addEventListener("keyup",O.bind(t),!1),t&&t.clock.onTick.addEventListener((function(){!function(t){if(!t||!t.scene||!t.scene.screenSpaceCameraController.enableTilt)return;var e=t.camera,i=t.scene.globe.ellipsoid.cartesianToCartographic(e.position).height,n=e.positionCartographic.height,o=i/20,s=o/5e5/Cesium.Math.toDegrees(e.pitch),a=n/100;S.moveForward&&(2==t.scene.mode?e.moveUp(a):e.rotate(e.right,-s));S.moveBackward&&(2==t.scene.mode?e.moveDown(a):e.rotate(e.right,s));S.moveLeft&&(2==t.scene.mode?e.moveLeft(a):e.rotate(e.up,-s));S.moveRight&&(2==t.scene.mode?e.moveRight(a):e.rotate(e.up,s));S.moveUp&&e.moveUp(o);S.moveDown&&e.moveDown(o);S.lookUp&&e.lookUp();S.lookDown&&e.lookDown();S.lookLeft&&e.lookLeft();S.lookRight&&e.lookRight();S.twistLeft&&e.twistLeft();S.twistRight&&e.twistRight();if(S.zoomIn){var r=i/2;r<1&&(r=0),e.zoomIn(r)}if(S.zoomOut){var l=i/2;i+i>=5e7&&(l=5e7-i),e.zoomOut(l)}}(t)}))}var S={moveForward:!1,moveBackward:!1,moveLeft:!1,moveRight:!1,moveUp:!1,moveDown:!1,lookUp:!1,lookDown:!1,lookLeft:!1,lookRight:!1,twistLeft:!1,twistRight:!1,zoomIn:!1,zoomOut:!1};function D(t){switch(t){case 87:return"moveForward";case 83:return"moveBackward";case 68:return"moveRight";case 65:return"moveLeft";case 81:return"moveUp";case 69:return"moveDown";case 38:return"lookUp";case 40:return"lookDown";case 37:return"lookLeft";case 39:return"lookRight";case 96:return"twistLeft";case 110:return"twistRight";case 107:return"zoomIn";case 109:return"zoomOut";default:return}}function M(t){var e;if("input"===(e=document.activeElement).tagName.toLowerCase()&&"checkbox"!==e.type||"textarea"===e.tagName.toLowerCase()||"textarea"===e.getAttribute("role"));else if(this.trackedEntity);else if(this._firstPersonView);else if(this._disableKeyboardEvent);else if(t.ctrlKey&&t.altKey){if("v"===t.key||"V"===t.key){var i=this.camera;this._CAMERA_SHORTCUT_VIEW={orientation:{heading:i.heading,pitch:i.pitch,roll:i.roll},position:{x:i.position.x,y:i.position.y,z:i.position.z}},localStorage.setItem("CAMERA_SHORTCUT_VIEW",JSON.stringify(this._CAMERA_SHORTCUT_VIEW))}if("f"===t.key||"F"===t.key){var n=localStorage.getItem("CAMERA_SHORTCUT_VIEW");this._CAMERA_SHORTCUT_VIEW=JSON.parse(n),this._CAMERA_SHORTCUT_VIEW&&this._CAMERA_SHORTCUT_VIEW.position&&this._CAMERA_SHORTCUT_VIEW.orientation&&this.camera.flyTo({destination:this._CAMERA_SHORTCUT_VIEW.position,orientation:this._CAMERA_SHORTCUT_VIEW.orientation})}}else{var o=D(t.keyCode);void 0!==o&&(S[o]=!0)}}function O(t){var e=D(t.keyCode);void 0!==e&&(S[e]=!1)}var T=i(11),N=i.n(T),B=i(6),L=i.n(B),A=i(20),j=i.n(A),I=[{name:"GCS_WGS_1984",epsg:"EPSG:4326",def:"+proj=longlat +datum=WGS84 +no_defs"},{name:"GCS_China_Geodetic_Coordinate_System_2000",epsg:"EPSG:4490",def:"+proj=longlat +ellps=GRS80 +no_defs"},{name:"WGS 84 / UTM zone 1N",epsg:"EPSG:32601",def:"+proj=utm +zone=1 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 2N",epsg:"EPSG:32602",def:"+proj=utm +zone=2 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 3N",epsg:"EPSG:32603",def:"+proj=utm +zone=3 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 4N",epsg:"EPSG:32604",def:"+proj=utm +zone=4 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 5N",epsg:"EPSG:32605",def:"+proj=utm +zone=5 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 6N",epsg:"EPSG:32606",def:"+proj=utm +zone=6 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 7N",epsg:"EPSG:32607",def:"+proj=utm +zone=7 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 8N",epsg:"EPSG:32608",def:"+proj=utm +zone=8 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 9N",epsg:"EPSG:32609",def:"+proj=utm +zone=9 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 10N",epsg:"EPSG:32610",def:"+proj=utm +zone=10 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 11N",epsg:"EPSG:32611",def:"+proj=utm +zone=11 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 12N",epsg:"EPSG:32612",def:"+proj=utm +zone=12 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 13N",epsg:"EPSG:32613",def:"+proj=utm +zone=13 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 14N",epsg:"EPSG:32614",def:"+proj=utm +zone=14 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 15N",epsg:"EPSG:32615",def:"+proj=utm +zone=15 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 16N",epsg:"EPSG:32616",def:"+proj=utm +zone=16 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 17N",epsg:"EPSG:32617",def:"+proj=utm +zone=17 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 18N",epsg:"EPSG:32618",def:"+proj=utm +zone=18 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 19N",epsg:"EPSG:32619",def:"+proj=utm +zone=19 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 20N",epsg:"EPSG:32620",def:"+proj=utm +zone=20 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 21N",epsg:"EPSG:32621",def:"+proj=utm +zone=21 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 22N",epsg:"EPSG:32622",def:"+proj=utm +zone=22 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 23N",epsg:"EPSG:32623",def:"+proj=utm +zone=23 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 24N",epsg:"EPSG:32624",def:"+proj=utm +zone=24 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 25N",epsg:"EPSG:32625",def:"+proj=utm +zone=25 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 26N",epsg:"EPSG:32626",def:"+proj=utm +zone=26 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 27N",epsg:"EPSG:32627",def:"+proj=utm +zone=27 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 28N",epsg:"EPSG:32628",def:"+proj=utm +zone=28 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 29N",epsg:"EPSG:32629",def:"+proj=utm +zone=29 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 30N",epsg:"EPSG:32630",def:"+proj=utm +zone=30 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 31N",epsg:"EPSG:32631",def:"+proj=utm +zone=31 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 32N",epsg:"EPSG:32632",def:"+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 33N",epsg:"EPSG:32633",def:"+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 34N",epsg:"EPSG:32634",def:"+proj=utm +zone=34 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 35N",epsg:"EPSG:32635",def:"+proj=utm +zone=35 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 36N",epsg:"EPSG:32636",def:"+proj=utm +zone=36 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 37N",epsg:"EPSG:32637",def:"+proj=utm +zone=37 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 38N",epsg:"EPSG:32638",def:"+proj=utm +zone=38 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 39N",epsg:"EPSG:32639",def:"+proj=utm +zone=39 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 40N",epsg:"EPSG:32640",def:"+proj=utm +zone=40 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 41N",epsg:"EPSG:32641",def:"+proj=utm +zone=41 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 42N",epsg:"EPSG:32642",def:"+proj=utm +zone=42 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 43N",epsg:"EPSG:32643",def:"+proj=utm +zone=43 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 44N",epsg:"EPSG:32644",def:"+proj=utm +zone=44 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 45N",epsg:"EPSG:32645",def:"+proj=utm +zone=45 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 46N",epsg:"EPSG:32646",def:"+proj=utm +zone=46 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 47N",epsg:"EPSG:32647",def:"+proj=utm +zone=47 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 48N",epsg:"EPSG:32648",def:"+proj=utm +zone=48 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 49N",epsg:"EPSG:32649",def:"+proj=utm +zone=49 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 50N",epsg:"EPSG:32650",def:"+proj=utm +zone=50 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 51N",epsg:"EPSG:32651",def:"+proj=utm +zone=51 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 52N",epsg:"EPSG:32652",def:"+proj=utm +zone=52 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 53N",epsg:"EPSG:32653",def:"+proj=utm +zone=53 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 54N",epsg:"EPSG:32654",def:"+proj=utm +zone=54 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 55N",epsg:"EPSG:32655",def:"+proj=utm +zone=55 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 56N",epsg:"EPSG:32656",def:"+proj=utm +zone=56 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 57N",epsg:"EPSG:32657",def:"+proj=utm +zone=57 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 58N",epsg:"EPSG:32658",def:"+proj=utm +zone=58 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 59N",epsg:"EPSG:32659",def:"+proj=utm +zone=59 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 60N",epsg:"EPSG:32660",def:"+proj=utm +zone=60 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 1S",epsg:"EPSG:32701",def:"+proj=utm +zone=1 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 2S",epsg:"EPSG:32702",def:"+proj=utm +zone=2 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 3S",epsg:"EPSG:32703",def:"+proj=utm +zone=3 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 4S",epsg:"EPSG:32704",def:"+proj=utm +zone=4 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 5S",epsg:"EPSG:32705",def:"+proj=utm +zone=5 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 6S",epsg:"EPSG:32706",def:"+proj=utm +zone=6 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 7S",epsg:"EPSG:32707",def:"+proj=utm +zone=7 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 8S",epsg:"EPSG:32708",def:"+proj=utm +zone=8 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 9S",epsg:"EPSG:32709",def:"+proj=utm +zone=9 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 10S",epsg:"EPSG:32710",def:"+proj=utm +zone=10 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 11S",epsg:"EPSG:32711",def:"+proj=utm +zone=11 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 12S",epsg:"EPSG:32712",def:"+proj=utm +zone=12 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 13S",epsg:"EPSG:32713",def:"+proj=utm +zone=13 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 14S",epsg:"EPSG:32714",def:"+proj=utm +zone=14 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 15S",epsg:"EPSG:32715",def:"+proj=utm +zone=15 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 16S",epsg:"EPSG:32716",def:"+proj=utm +zone=16 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 17S",epsg:"EPSG:32717",def:"+proj=utm +zone=17 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 18S",epsg:"EPSG:32718",def:"+proj=utm +zone=18 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 19S",epsg:"EPSG:32719",def:"+proj=utm +zone=19 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 20S",epsg:"EPSG:32720",def:"+proj=utm +zone=20 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 21S",epsg:"EPSG:32721",def:"+proj=utm +zone=21 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 22S",epsg:"EPSG:32722",def:"+proj=utm +zone=22 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 23S",epsg:"EPSG:32723",def:"+proj=utm +zone=23 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 24S",epsg:"EPSG:32724",def:"+proj=utm +zone=24 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 25S",epsg:"EPSG:32725",def:"+proj=utm +zone=25 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 26S",epsg:"EPSG:32726",def:"+proj=utm +zone=26 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 27S",epsg:"EPSG:32727",def:"+proj=utm +zone=27 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 28S",epsg:"EPSG:32728",def:"+proj=utm +zone=28 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 29S",epsg:"EPSG:32729",def:"+proj=utm +zone=29 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 30S",epsg:"EPSG:32730",def:"+proj=utm +zone=30 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 31S",epsg:"EPSG:32731",def:"+proj=utm +zone=31 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 32S",epsg:"EPSG:32732",def:"+proj=utm +zone=32 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 33S",epsg:"EPSG:32733",def:"+proj=utm +zone=33 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 34S",epsg:"EPSG:32734",def:"+proj=utm +zone=34 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 35S",epsg:"EPSG:32735",def:"+proj=utm +zone=35 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 36S",epsg:"EPSG:32736",def:"+proj=utm +zone=36 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 37S",epsg:"EPSG:32737",def:"+proj=utm +zone=37 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 38S",epsg:"EPSG:32738",def:"+proj=utm +zone=38 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 39S",epsg:"EPSG:32739",def:"+proj=utm +zone=39 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 40S",epsg:"EPSG:32740",def:"+proj=utm +zone=40 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 41S",epsg:"EPSG:32741",def:"+proj=utm +zone=41 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 42S",epsg:"EPSG:32742",def:"+proj=utm +zone=42 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 43S",epsg:"EPSG:32743",def:"+proj=utm +zone=43 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 44S",epsg:"EPSG:32744",def:"+proj=utm +zone=44 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 45S",epsg:"EPSG:32745",def:"+proj=utm +zone=45 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 46S",epsg:"EPSG:32746",def:"+proj=utm +zone=46 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 47S",epsg:"EPSG:32747",def:"+proj=utm +zone=47 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 48S",epsg:"EPSG:32748",def:"+proj=utm +zone=48 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 49S",epsg:"EPSG:32749",def:"+proj=utm +zone=49 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 50S",epsg:"EPSG:32750",def:"+proj=utm +zone=50 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 51S",epsg:"EPSG:32751",def:"+proj=utm +zone=51 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 52S",epsg:"EPSG:32752",def:"+proj=utm +zone=52 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 53S",epsg:"EPSG:32753",def:"+proj=utm +zone=53 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 54S",epsg:"EPSG:32754",def:"+proj=utm +zone=54 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 55S",epsg:"EPSG:32755",def:"+proj=utm +zone=55 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 56S",epsg:"EPSG:32756",def:"+proj=utm +zone=56 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 57S",epsg:"EPSG:32757",def:"+proj=utm +zone=57 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 58S",epsg:"EPSG:32758",def:"+proj=utm +zone=58 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 59S",epsg:"EPSG:32759",def:"+proj=utm +zone=59 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 60S",epsg:"EPSG:32760",def:"+proj=utm +zone=60 +south +datum=WGS84 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_13",epsg:"EPSG:4491",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_14",epsg:"EPSG:4492",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_15",epsg:"EPSG:4493",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_16",epsg:"EPSG:4494",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_17",epsg:"EPSG:4495",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_18",epsg:"EPSG:4496",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_19",epsg:"EPSG:4497",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_20",epsg:"EPSG:4498",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_21",epsg:"EPSG:4499",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_22",epsg:"EPSG:4500",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_23",epsg:"EPSG:4501",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_75E",epsg:"EPSG:4502",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_81E",epsg:"EPSG:4503",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_87E",epsg:"EPSG:4504",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_93E",epsg:"EPSG:4505",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_99E",epsg:"EPSG:4506",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_105E",epsg:"EPSG:4507",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_111E",epsg:"EPSG:4508",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_117E",epsg:"EPSG:4509",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_123E",epsg:"EPSG:4510",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_129E",epsg:"EPSG:4511",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_135E",epsg:"EPSG:4512",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_25",epsg:"EPSG:4513",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_26",epsg:"EPSG:4514",def:"+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_27",epsg:"EPSG:4515",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_28",epsg:"EPSG:4516",def:"+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_29",epsg:"EPSG:4517",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_30",epsg:"EPSG:4518",def:"+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_31",epsg:"EPSG:4519",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_32",epsg:"EPSG:4520",def:"+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_33",epsg:"EPSG:4521",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_34",epsg:"EPSG:4522",def:"+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_35",epsg:"EPSG:4523",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_36",epsg:"EPSG:4524",def:"+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_37",epsg:"EPSG:4525",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_38",epsg:"EPSG:4526",def:"+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_39",epsg:"EPSG:4527",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_40",epsg:"EPSG:4528",def:"+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_41",epsg:"EPSG:4529",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_42",epsg:"EPSG:4530",def:"+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_43",epsg:"EPSG:4531",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_44",epsg:"EPSG:4532",def:"+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_45",epsg:"EPSG:4533",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_75E",epsg:"EPSG:4534",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_78E",epsg:"EPSG:4535",def:"+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_81E",epsg:"EPSG:4536",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_84E",epsg:"EPSG:4537",def:"+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_87E",epsg:"EPSG:4538",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_90E",epsg:"EPSG:4539",def:"+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_93E",epsg:"EPSG:4540",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_96E",epsg:"EPSG:4541",def:"+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_99E",epsg:"EPSG:4542",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_102E",epsg:"EPSG:4543",def:"+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_105E",epsg:"EPSG:4544",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_108E",epsg:"EPSG:4545",def:"+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_111E",epsg:"EPSG:4546",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_114E",epsg:"EPSG:4547",def:"+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_117E",epsg:"EPSG:4548",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_120E",epsg:"EPSG:4549",def:"+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_123E",epsg:"EPSG:4550",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_126E",epsg:"EPSG:4551",def:"+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_129E",epsg:"EPSG:4552",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_132E",epsg:"EPSG:4553",def:"+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_135E",epsg:"EPSG:4554",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"}],R=function(){return _()((function t(){k()(this,t),this.name_map=new Map,this.epsg_map=new Map,this.initProj()}),[{key:"initProj",value:function(){var t=this;I.forEach((function(e){proj4.defs(e.epsg,e.def),t.name_map.set(e.name,e),t.epsg_map.set(e.epsg,e)}))}},{key:"convert",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n={points:[],code:0,message:""};if(!this.name_map.has(e)&&!this.epsg_map.has(e))return n.code=1,n.message="不支持的坐标系:"+e,n;if(!this.name_map.has(i)&&!this.epsg_map.has(i))return n.code=1,n.message="不支持的坐标系:"+i,n;var o=(this.name_map.get(e)||this.epsg_map.get(e)).epsg,s=(this.name_map.get(i)||this.epsg_map.get(i)).epsg,a=proj4.defs(o),r=proj4.defs(s);return t.forEach((function(t){var e=Number(t.x),i=Number(t.y),o=Number(t.z||0),s=proj4(a,r,[e,i]);n.points.push({x:Number(s[0].toFixed(10)),y:Number(s[1].toFixed(10)),z:o})})),n}},{key:"getAllProjection",value:function(){return Array.from(this.name_map.values())}},{key:"projectionIsExists",value:function(t){return this.name_map.has(t)||this.epsg_map.has(t)}},{key:"degreesToDMS",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function i(t){var e=t.toString(),i=e.indexOf(".");return-1!==i?e.length-i-1:0}function n(t){return Math.pow(10,t)}var o=!1;t<0&&(o=!0),t=Math.abs(t);var s=Math.floor(t),a=n(i(t)),r=Math.floor((t-s)*a*60)/a,l=Math.floor(r);o&&(s=-s);var c=n(i(r)),u=Math.floor((r-l)*c)/c*60;return e?s+"°"+Math.floor(1e4*r)/1e4+"'":s+"°"+l+"'"+Math.floor(100*u)/100+'"'}},{key:"dmsToDecimal",value:function(t,e){var i,n,o;if(e){var s=t.split("°"),a=s[1].split("'");i=s[0],n=a[0],console.log(i,n);var r=Math.pow(10,8),l=Number(i*r)+n*r/60;return Math.round(l)/r}var c=t.split("°"),u=c[1].split("'"),p=u[1].split('"');i=c[0],n=u[0],o=p[0],console.log(i,n,o);var h=Math.pow(10,8),d=Number(i*h)+n*h/60+o*h/3600;return Math.round(d)/h}}])}();function F(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function z(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];k()(this,t),this.container=e,this.options=z({},i),this.options.ismove=!0,!1===i.ismove&&(this.options.ismove=i.ismove),this.closeCallBack=i.closeCallBack,this._element={},this._element_style=void 0,this.only=n}),[{key:"init",value:(t=o()(a.a.mark((function t(){var e,i,n,o=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.only&&this.closeAll(),U.push(this),this.isDestroy=!1,this._element.body=document.createElement("div"),this._element.body.className="YJ-custom-base-dialog",this._element.body.style.top=this.options.top,this._element.body.style.bottom=this.options.bottom,this._element.body.style.left=this.options.left,this._element.body.style.right=this.options.right,this.container.appendChild(this._element.body),this._element.title=document.createElement("div"),this._element.title.className="title-box",this._element.title.innerHTML=''.concat(this.options.title||"","")+'',this._element.body.appendChild(this._element.title),t.next=16,document.createElement("div");case 16:return this._element.content=t.sent,this._element.content.className="content",this._element.body.appendChild(this._element.content),t.next=21,document.createElement("div");case 21:return this._element.foot=t.sent,this._element.foot.className="foot",this._element.foot.innerHTML='\n \n ',this._element.body.appendChild(this._element.foot),t.next=27,document.createElement("div");case 27:for((e=t.sent).style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.backdropFilter="blur(2px)",e.style.zIndex="-999999",this._element.body.appendChild(e),this._element.body.getElementsByClassName("close-box")[0].addEventListener("click",(function(){o.close()})),i=this._element.body.getElementsByClassName("close"),n=0;n=0;e--)t[e].dataset&&"YJ_style_dialog"===t[e].dataset.name&&document.getElementsByTagName("head")[0].removeChild(t[e]);this._element.body&&this._element.body.parentNode&&this.container.removeChild(this._element.body),this._element.body=null,this._element.title=null,this._element.content=null,this._element.foot=null,this._element_style=null,this.isDestroy=!0,this.closeCallBack&&(this.closeCallBack(),this.closeCallBack=null)}},{key:"closeAll",value:function(){for(var t=U.length-1;t>=0;t--)U[t].close(),U.splice(t,1)}},{key:"titleAppChild",value:function(t){this._element.title.appendChild(t)}},{key:"contentAppChild",value:function(t){this._element.content.appendChild(t)}},{key:"footAppChild",value:function(t,e){e?this._element.foot.insertBefore(t,e):this._element.foot.prepend(t)}},{key:"moveDiv",value:function(){var t=this,e=0,i=0,n=0,o=0,s=this._element.body,a=this;s.onmousedown=function(s){if("title-box"===s.toElement.className){var r=t._element.body.offsetHeight,l=t._element.body.offsetWidth;e=s.clientX,i=s.clientY;var c=window.getComputedStyle(t._element.body).left,u=window.getComputedStyle(t._element.body).top;n=1*c.substr(0,c.indexOf("px")),o=1*u.substr(0,u.indexOf("px"));var p=document.documentElement.clientHeight,h=document.documentElement.clientWidth;window.onmousemove=function(t){t.preventDefault();var s=t.clientX,c=t.clientY,u=s-(e-n),d=c-(i-o);u<0?u=0:u+l>h&&(u=h-l),d<=0?d=0:d+r>p&&(d=p-r),a._element.body.style.left=u+"px",a._element.body.style.top=d+"px",a._element.body.style.bottom="unset",a._element.body.style.right="unset"},document.onmouseup=function(t){window.onmousemove=null},window.ondragend=function(t){window.onmousemove=null}}},document.onmouseup=function(t){window.onmousemove=null},window.ondragend=function(t){window.onmousemove=null}}}]);var t}(),U=[],W=G,Y=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=null;return{that:Array.prototype.slice.call(t.querySelectorAll(e),0),stopPropagation:function(t){(t=t||window.event).stopPropagation?t.stopPropagation():t.cancelBubble=!0},hide:function(){Y(t,e).that.forEach((function(t){t.style.cssText+="display:none;"}))},show:function(i){void 0!==i?Y(t,e).that[i].style.cssText+="display:block;":Y(t,e).that.forEach((function(t){t.style.cssText+="display:block;"}))},legp_searchList:function(e){var i=[];return Y(t,"input[name="+e+"]").that.forEach((function(t){i.push(t.value)})),i},legp_search:function(o){var s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=Y(t,e).that[i];if(a){var r='
\n '.concat(s?'':''),'\n
\n
\n
');a.innerHTML=r,Y(t,".cy_datalist input").that[i].oninput=function(e){var s=this.value;if(Y(t,".cy_datalist dl").hide(),o.length>0){Y(t,".cy_datalist dl").show();var a=new RegExp(s),r=!1;Y(t,".cy_datalist dl").that[i].innerHTML="",o.forEach((function(e){a.test(e.name)&&(r=!0,Y(t,".cy_datalist dl").that[i].innerHTML+='
'+e.name+"
")})),r||(Y(t,".cy_datalist dl").that[i].innerHTML='
暂无数据
'),l()}},Y(t,".cy_datalist input").that[i].onclick=function(e){Y(t,".cy_datalist dl").hide();var i=1*e.srcElement.classList[1];i=i||0,"none"===Y(t,".cy_datalist dl").that[i].style.display&&(0==o.length?this.innerHTML="暂无数据":Y(t,".cy_datalist dl").show(i),Y(t,".cy_datalist dl").that[i].innerHTML="",o.forEach((function(e){Y(t,".cy_datalist dl").that[i].innerHTML+='
'+e.name+"
"})),l()),e.stopPropagation()},document.addEventListener("click",(function(){Y(t,".cy_datalist dl").hide()}))}function l(){Y(t,".cy_datalist dl dd").that.forEach((function(t){t.onclick=function(t){if(this&&this.attributes){var e=this.attributes.value.value;n=e,t.currentTarget.parentNode.previousElementSibling.value=e;var i=new Event("input",{bubbles:!0});t.currentTarget.parentNode.previousElementSibling.dispatchEvent(i)}}}))}},legp_searchActive:function(t){n=t}}},J=function(){var t=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d,m;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new R,H&&H.close&&(H.close(),H=null),t.next=4,new W(e.viewer._container,{title:"度分秒",left:"180px",top:"100px",closeCallBack:function(){i&&i()}});case 4:return H=t.sent,t.next=7,H.init();case 7:o='\n \n
\n
\n
\n 输入格式\n
\n
\n
\n
\n
\n \n

\n \n 例如116.6°, 39.9°\n

\n
\n
\n 经度\n \n
\n
\n 纬度\n \n
\n
\n \n \n \n \n
\n
\n
\n
\n \n

\n 度分\n 例如95°10.1702\', 49°12.4015\'\n

\n
\n
\n
\n 经度\n \n \n \n \n \n
\n
\n 纬度\n \n \n \n \n \n
\n
\n
\n \n \n \n \n
\n
\n
\n
\n \n

\n 度分秒\n 例如11°18\'54.37", 39°13\'46.57"\n

\n
\n
\n
\n 经度\n \n \n \n \n \n \n \n
\n
\n 纬度\n \n \n \n \n \n \n \n
\n
\n
\n \n \n \n \n
\n
\n
\n \n '),H._element.body.className=H._element.body.className+" proj-convert",(s=document.createElement("div")).style.width="460px",s.style.display="flex",s.style.flexDirection="column",s.innerHTML=o,H.contentAppChild(s),r=s.getElementsByClassName("item"),l=a.a.mark((function t(e){var i,o,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=r[e].getAttribute("data-type"),o=r[e].getElementsByClassName("convert")[0],l=r[e].getElementsByClassName("icon-copy-box")[0],(c=new ClipboardJS(l,{text:function(t){var n;switch(i){case 0:case"0":n=r[e].getElementsByClassName("lng")[0].value+"°,"+r[e].getElementsByClassName("lat")[0].value+"°";break;case 1:case"1":n=s.getElementsByClassName("lng-dm-d")[0].value+"°"+s.getElementsByClassName("lng-dm-m")[0].value+"',"+s.getElementsByClassName("lat-dm-d")[0].value+"°"+s.getElementsByClassName("lat-dm-m")[0].value+"'";break;case 2:case"2":n=s.getElementsByClassName("lng-dms-d")[0].value+"°"+s.getElementsByClassName("lng-dms-m")[0].value+"'"+s.getElementsByClassName("lng-dms-s")[0].value+'",'+s.getElementsByClassName("lat-dms-d")[0].value+"°"+s.getElementsByClassName("lat-dms-m")[0].value+"'"+s.getElementsByClassName("lat-dms-s")[0].value+'"'}return n}})).on("success",(function(t){window.ELEMENT&&window.ELEMENT.Message({message:"已复制到剪切板",type:"success",duration:1500})})),c.on("error",(function(t){window.ELEMENT&&window.ELEMENT.Message({message:"复制失败",type:"warning",duration:1500})})),o.addEventListener("click",(function(){var t,o,a,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_;switch(i){case 0:case"0":t=r[e].getElementsByClassName("lng")[0].value,o=r[e].getElementsByClassName("lat")[0].value,p=n.degreesToDMS(t,!0),h=n.degreesToDMS(o,!0),v=(f=p.split("°"))[1].split("'"),y=(g=h.split("°"))[1].split("'"),s.getElementsByClassName("lng-dm-d")[0].value=f[0],s.getElementsByClassName("lng-dm-m")[0].value=v[0],s.getElementsByClassName("lat-dm-d")[0].value=g[0],s.getElementsByClassName("lat-dm-m")[0].value=y[0],d=n.degreesToDMS(t),m=n.degreesToDMS(o),w=(C=(b=d.split("°"))[1].split("'"))[1].split('"'),_=(x=(k=m.split("°"))[1].split("'"))[1].split('"'),s.getElementsByClassName("lng-dms-d")[0].value=b[0],s.getElementsByClassName("lng-dms-m")[0].value=C[0],s.getElementsByClassName("lng-dms-s")[0].value=w[0],s.getElementsByClassName("lat-dms-d")[0].value=k[0],s.getElementsByClassName("lat-dms-m")[0].value=x[0],s.getElementsByClassName("lat-dms-s")[0].value=_[0];break;case 1:case"1":a=r[e].getElementsByClassName("lng-dm-d")[0].value,l=r[e].getElementsByClassName("lng-dm-m")[0].value,c=r[e].getElementsByClassName("lat-dm-d")[0].value,u=r[e].getElementsByClassName("lat-dm-m")[0].value,t=n.dmsToDecimal(a+"°"+l+"'",!0),o=n.dmsToDecimal(c+"°"+u+"'",!0),s.getElementsByClassName("lng")[0].value=t,s.getElementsByClassName("lat")[0].value=o,d=n.degreesToDMS(t),m=n.degreesToDMS(o),w=(C=(b=d.split("°"))[1].split("'"))[1].split('"'),_=(x=(k=m.split("°"))[1].split("'"))[1].split('"'),s.getElementsByClassName("lng-dms-d")[0].value=b[0],s.getElementsByClassName("lng-dms-m")[0].value=C[0],s.getElementsByClassName("lng-dms-s")[0].value=w[0],s.getElementsByClassName("lat-dms-d")[0].value=k[0],s.getElementsByClassName("lat-dms-m")[0].value=x[0],s.getElementsByClassName("lat-dms-s")[0].value=_[0];break;case 2:case"2":d=(a=r[e].getElementsByClassName("lng-dms-d")[0].value)+"°"+(l=r[e].getElementsByClassName("lng-dms-m")[0].value)+"'"+r[e].getElementsByClassName("lng-dms-s")[0].value+'"',m=(c=r[e].getElementsByClassName("lat-dms-d")[0].value)+"°"+(u=r[e].getElementsByClassName("lat-dms-m")[0].value)+"'"+r[e].getElementsByClassName("lat-dms-s")[0].value+'"',t=n.dmsToDecimal(d),o=n.dmsToDecimal(m),s.getElementsByClassName("lng")[0].value=t,s.getElementsByClassName("lat")[0].value=o,p=n.degreesToDMS(t,!0),h=n.degreesToDMS(o,!0),v=(f=p.split("°"))[1].split("'"),y=(g=h.split("°"))[1].split("'"),s.getElementsByClassName("lng-dm-d")[0].value=f[0],s.getElementsByClassName("lng-dm-m")[0].value=v[0],s.getElementsByClassName("lat-dm-d")[0].value=g[0],s.getElementsByClassName("lat-dm-m")[0].value=y[0]}window.ELEMENT&&window.ELEMENT.Message({message:"转换成功",type:"success",duration:1500});for(var E=0;ENumber(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}},{key:"mouse_right",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.RIGHT_CLICK)}},{key:"mouse_right_down",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.RIGHT_DOWN)}},{key:"mouse_right_up",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.RIGHT_UP)}},{key:"mouse_wheel",value:function(t){this.handler&&this.handler.setInputAction((function(){t()}),Cesium.ScreenSpaceEventType.WHEEL)}},{key:"getcartesian",value:function(t){var e=t.position||t.endPosition;t.position1&&t.position2&&(e={x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2});var i=this.viewer.scene.pickPosition(e);if(!i){for(var n=this.viewer.camera.getPickRay(e),o=this.viewer.scene.drillPickFromRay(n,10),s={},a=0;a0&&void 0!==arguments[0]?arguments[0]:"左键开始,右键结束",i=arguments.length>1?arguments[1]:void 0;k()(this,t),this.point=void 0,this.text=e,this.div=void 0,this.mouse_type=0,this.position=new Cesium.Cartesian3,this.viewer=i.viewer,this.create_tip(this.viewer)}),[{key:"set_text",value:function(t){this.div.getElementsByTagName("p")[0].innerText=t}},{key:"get_mouse_style",value:function(t){var e="";switch(t){case 1:e="move.png";break;default:e="arrow.png"}return"url(lib/img/"+e+"),auto"}},{key:"create_tip",value:function(t){this.create_tooltip()}},{key:"setPosition",value:function(t,e,i){this.position=t,this.move_tooltip(e,i)}},{key:"destroy",value:function(){this.viewer.entities.remove(this.point),this.remove_tooltip()}},{key:"create_tooltip",value:function(){var t=new fi;this.div=document.createElement("div");this.div.setAttribute("style","position: absolute;z-index: 777;color: #ec131a;left:10px;top:0px;pointer-events: none;");var e=document.createElement("p");e.style.margin="0px",e.style.padding="0px",e.innerText=this.text,this.div.appendChild(e);var i=document.createElement("div");i.style.width="12px",i.style.height="12px",i.style.background="url(".concat(t.getSourceRootPath()+"/img/point.png",") 100% 100% no-repeat"),i.style.backgroundSize="100% 100%",i.style.position="absolute",i.style.left="-36px",i.style.top="-4px",this.div.style.display="none",this.div.appendChild(i),t=null,document.querySelector("body").appendChild(this.div)}},{key:"style_tip",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t._element.style.cursor=this.get_mouse_style(e)}},{key:"remove_tooltip",value:function(){document.querySelector("body").contains(this.div)&&document.querySelector("body").removeChild(this.div)}},{key:"move_tooltip",value:function(t,e){var i=0,n=0;if(this.div.style.display="block",this.viewer&&this.viewer._element){var o=this.viewer._element.getElementsByClassName("cesium-widget")[0].getElementsByTagName("canvas")[0];i=o.getBoundingClientRect().top+window.scrollY,n=o.getBoundingClientRect().left+window.scrollX}this.div.style.left=t+30+n+"px",this.div.style.top=e+i+"px"}}])}(),K=function(){var t=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new fi,o=new R,V&&V.close&&(V.close(),V=null),t.next=5,new W(e.viewer._container,{title:"投影转换",left:"180px",top:"100px",closeCallBack:function(){i&&i()}});case 5:return V=t.sent,t.next=8,V.init();case 8:'\n \n
\n
\n
\n 源坐标\n \n
\n
\n
\n 椭圆基准\n
\n
\n
\n 经度(x)\n \n
\n
\n 纬度(y)\n \n
\n
\n
\n
\n \n
\n
\n
\n 目标坐标\n \n
\n
\n
\n 椭圆基准\n
\n
\n
\n 经度(x)\n \n
\n
\n 纬度(y)\n \n
\n
\n
\n
\n \n ',(l=document.createElement("div")).innerHTML='\n \n
\n
\n
\n 源坐标\n \n
\n
\n
\n 椭圆基准\n
\n
\n
\n 经度(x)\n \n
\n
\n 纬度(y)\n \n
\n
\n
\n
\n \n
\n
\n
\n 目标坐标\n \n
\n
\n
\n 椭圆基准\n
\n
\n
\n 经度(x)\n \n
\n
\n 纬度(y)\n \n
\n
\n
\n
\n \n ',V.contentAppChild(l),c=[],u=0,o.epsg_map.forEach((function(t,e){u++,c.push({name:"".concat(u,".  ").concat(e,"(").concat(t.name,")"),value:e})})),(p=Y(l.getElementsByClassName("left")[0],".datalist_left")).legp_search(c,!0),(h=Y(l.getElementsByClassName("right")[0],".datalist_right")).legp_search(c,!0),d=l.getElementsByClassName("pick")[0],m=l.getElementsByClassName("copy")[0],(f=l.getElementsByClassName("datalist_left")[0].getElementsByTagName("input")[0]).value=c[0].value,p.legp_searchActive(c[0].value),(v=l.getElementsByClassName("datalist_right")[0].getElementsByTagName("input")[0]).value=c[0].value,h.legp_searchActive(c[0].value),g=l.getElementsByClassName("convert")[0],y=l.getElementsByClassName("left-x")[0],b=l.getElementsByClassName("left-y")[0],C=l.getElementsByClassName("right-x")[0],w=l.getElementsByClassName("right-y")[0],d.addEventListener("click",(function(){s&&s.destroy(),r&&r.destroy(),s=new Z("左键选择起点坐标,右键取消",e),(r=new X(e)).mouse_move((function(t,e){s.setPosition(e,t.endPosition.x,t.endPosition.y)})),r.mouse_left((function(t,i){var a=n.cartesian3Towgs84(i,e.viewer);s&&s.destroy(),r&&r.destroy();var l=o.convert([{x:Number(a.lng),y:Number(a.lat)}],"EPSG:4326",f.value);0===l.code&&(y.value=l.points[0].x,b.value=l.points[0].y)})),r.mouse_right((function(t,e){s&&s.destroy(),r&&r.destroy()}))})),g.addEventListener("click",(function(){if(!y.value||!b.value)return C.value="",w.value="",void(window.ELEMENT&&window.ELEMENT.Message({message:"请输入源坐标",type:"warning",duration:1500}));var t=o.convert([{x:Number(y.value),y:Number(b.value)}],f.value,v.value);0===t.code?(C.value=t.points[0].x,w.value=t.points[0].y):window.ELEMENT&&window.ELEMENT.Message({message:t.message,type:"warning",duration:1500})})),new ClipboardJS(m,{text:function(t){if(C.value&&w.value){var e="".concat(C.value,",").concat(w.value);return e}C.value="",w.value="",window.ELEMENT&&window.ELEMENT.Message({message:"复制失败,目标坐标为空!",type:"warning",duration:1500})}}).on("success",(function(t){window.ELEMENT&&window.ELEMENT.Message({message:"已复制到剪切板",type:"success",duration:1500})}));case 36:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}(),$=function(){V&&V.close&&(V.close(),V=null)},Q=[new Map,new Map,new Map];Q[0].set("--color-sdk-base-rgb","0, 255, 255"),Q[0].set("--color-sdk-gradual","rgb(0, 255, 255) 6.25%, rgb(0, 200, 255) 100%"),Q[0].set("--color-sdk-bg-gradual","#00ffff33 0%, #00ffff00 100%"),Q[0].set("--color-sdk-text-shadow","rgba(20, 118, 255, 1)"),Q[1].set("--color-sdk-base-rgb","42, 200, 251"),Q[1].set("--color-sdk-gradual","rgb(42, 200, 251) 6.25%, rgb(42, 145, 251) 100%"),Q[1].set("--color-sdk-bg-gradual","#2ac8fb33 0%, #2ac8fb00 100%"),Q[1].set("--color-sdk-text-shadow","rgba(20, 63, 255, 1)"),Q[2].set("--color-sdk-base-rgb","187, 26, 41"),Q[2].set("--color-sdk-gradual","rgb(187, 26, 41) 6.25%, rgb(236, 20, 20) 100%"),Q[2].set("--color-sdk-bg-gradual","#bb1a2933 0%, #bb1a2900 100%"),Q[2].set("--color-sdk-text-shadow","rgba(246, 8, 30, 1)");var tt={};function et(t,e,i){if(t&&t.div_id){var n=ae().sdkD,o=document.getElementById(t.div_id).getElementsByClassName("cesium-viewer")[0],s=new fi;tt[t.div_id]||(tt[t.div_id]={}),tt[t.div_id].mousedown&&document.removeEventListener("mousedown",tt[t.div_id].mousedown),tt[t.div_id].click&&document.removeEventListener("click",tt[t.div_id].click),tt[t.div_id].callBack||(tt[t.div_id].callBack=i),t!==n&&tt[t.div_id].mouseRightMenuEvent&&tt[t.div_id].mouseRightMenuEvent.destroy();var a=document.getElementById("custom-menu");a&&o.removeChild(a),tt[t.div_id].status=e,e&&(tt[t.div_id].mousedown=function(t){if(!(t.target.parentNode&&"custom-menu"==t.target.parentNode.id||t.target.parentNode&&t.target.parentNode.parentNode&&"custom-menu"==t.target.parentNode.parentNode.id)){var e=document.getElementById("custom-menu");e&&o.removeChild(e)}},document.addEventListener("mousedown",tt[t.div_id].mousedown),tt[t.div_id].click=function(t){if(!(t.target.parentNode&&"custom-menu"==t.target.parentNode.id||t.target.parentNode&&t.target.parentNode.parentNode&&"custom-menu"==t.target.parentNode.parentNode.id)){var e=document.getElementById("custom-menu");e&&o.removeChild(e)}},document.addEventListener("click",tt[t.div_id].click),tt[t.div_id].mouseRightMenuEvent=new X(t),tt[t.div_id].mouseRightMenuEvent.mouse_right((function(e,i){if(!YJ.Measure.GetMeasureStatus()&&!t.viewer.trackedEntity){var n=t.viewer.entities.getById("svg-control-points_0");if(!n||!n.show){var a=document.getElementById("custom-menu");a&&o.removeChild(a);var r,l=function(e){var i=t.viewer.scene.pick(e.position);if(i)if(i.id){if(i.id.type&&"vector"===i.id.type&&i.id.parentId)return{parentId:i.id.parentId,id:i.id.id};if(i.id.id)return i.id.id;if("string"==typeof i.id)return i.id}else if(i.primitive&&i.primitive.id)return i.primitive.id}(e);"[object Object]"===Object.prototype.toString.call(l)&&(r=l.id,l=l.parentId);var c="",u=t.entityMap.get(l);if(!u&&l){var p=l.split("-");p.splice(p.length-1,1),l=p.join("-"),u=t.entityMap.get(l)}u&&u.picking&&(c='\n \n
    \n
  • 属性
  • \n
\n ');var h=s.cartesian3Towgs84(i,t.viewer);(a=document.createElement("div")).id="custom-menu",a.style.position="absolute",a.style.width="110px",a.style.backgroundColor="#00000085",a.style.color="#ffffff",a.style.padding="6px 0",a.style.boxShadow="4px 4px 4px 0px rgba(0, 0, 0, 0.8)",a.innerHTML='\n
    \n
  • 绕鼠标点旋转
  • \n
\n
    \n
  • 文本框
  • \n
\n '.concat(c,"\n "),o.appendChild(a);var d=e.position.x,m=e.position.y;e.position.x+a.offsetWidth>o.offsetWidth&&(d=e.position.x-a.offsetWidth),e.position.y+a.offsetHeight>o.offsetHeight&&(m=e.position.y-a.offsetHeight),a.style.left=d+"px",a.style.top=m+"px",a.addEventListener("contextmenu",(function(t){t.preventDefault()}));for(var f=a.getElementsByTagName("li"),v={},g=function(e){f[e].addEventListener("mouseover",(function(){f[e].style.backgroundColor="#5e5e5e"})),f[e].addEventListener("mouseout",(function(){f[e].style.backgroundColor="unset"})),f[e].addEventListener("click",(function(){var i="";switch(f[e].innerHTML){case"绕鼠标点旋转":v.position=h,i="rotateAround";break;case"属性":r?(v.id=r,v.parentId=u.options.id):v.id=u.options.id,i="attribute";break;case"文本框":v.position=h,i="textBox"}tt[t.div_id].callBack(i,v),o.removeChild(a)}))},y=0;y=0;l--){var c=Array.from(at.keys())[l],u=at.get(c);if(u&&u.that)if("PolygonObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var p=turf.point([a.lng,a.lat]),h=[],d=0;d=3){for(var f=u.that.computeAssemble(u.that.options.positions,!0),v=turf.point([a.lng,a.lat]),g=[],y=0;y=3){for(var C=turf.point([a.lng,a.lat]),w=u.that.computeAttackArrow(u.that.options.positions),k=[],x=0;x=5){for(var S=turf.point([a.lng,a.lat]),D=u.that.computePincerArrow(u.that.options.positions),P=[],M=0;M=0;l--){var c=Array.from(Ct.keys())[l],u=Ct.get(c);if(u&&u.that)if("PolygonObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var p=turf.point([a.lng,a.lat]),h=[],d=0;d=3){for(var f=u.that.computeAssemble(u.that.options.positions,!0),v=turf.point([a.lng,a.lat]),g=[],y=0;y=3){for(var C=turf.point([a.lng,a.lat]),w=u.that.computeAttackArrow(u.that.options.positions),k=[],x=0;x=5){for(var S=turf.point([a.lng,a.lat]),D=u.that.computePincerArrow(u.that.options.positions),P=[],M=0;M1&&void 0!==arguments[1]&&arguments[1];if(t){bt||(bt=new fi),(Pt=!!e)?Tt(t,Mt):Lt(t);var i=Ie();i&&(Pt?Tt(t,Mt):Lt(i));var n=ae().sdkD;n&&t!==n&&Ot(n,e)}}function Tt(t,e){Mt=e,Pt&&Bt(t);var i=Ie();return i&&Pt&&Bt(i),new Promise(function(){var t=o()(a.a.mark((function t(e,i){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:setTimeout((function(){e()}),1e3);case 1:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}())}function Nt(){return Pt}function Bt(t){Lt(t);var e,i,n=t.viewer.camera.positionCartographic,o={position:{lng:Cesium.Math.toDegrees(n.longitude),lat:Cesium.Math.toDegrees(n.latitude),alt:n.height}},s=t.viewer;switch(Mt){case"1:100万":o.position.alt=16e6;break;case"1:50万":o.position.alt=5e6;break;case"1:25万":o.position.alt=23e5;break;case"1:10万":o.position.alt=68e4;break;case"1:5万":o.position.alt=385e3;break;case"1:2.5万":o.position.alt=18e4;break;case"1:1万":o.position.alt=9e4;break;case"1:5000":o.position.alt=46e3}for(var a=0;au&&(u+=360),c={minLng:r,minLat:l,maxLng:u,maxLat:d},l<-88&&(l=-88),d>88&&(d=88),(c.maxLng-c.minLng)/n*((c.maxLat-c.minLat)/o)>7e3)c=null;else{for(var m=r;m<=u;m+=n){for(var f=[],v=[],g=l;Math.floor(1e9*g)/1e9<=d;g+=o/2)v.push([m,g]),f.push(Cesium.Cartesian3.fromDegrees(m,g,8848));88!=d&&d+o/2>=88&&f.push(Cesium.Cartesian3.fromDegrees(m,88,8848));var y=new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:f,width:1,vertexFormat:Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,arcType:Cesium.ArcType.RHUMB})});if(e.add(new Cesium.Primitive({geometryInstances:y,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.fromCssColorString("#fcfc00")})})})),md)break;var w=p(C.lng,C.lat,t);i.add({position:Cesium.Cartesian3.fromDegrees(C.lng,C.lat,8848),text:w,font:"16px Inter, sans-serif",fillColor:Cesium.Color.fromCssColorString("#fcfc00"),pixelOffset:new Cesium.Cartesian2(0,0),showBackground:!1,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,scale:1,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,8e7),scaleByDistance:s})}}for(var k=l;Math.floor(1e9*k)/1e9<=d;k+=o){for(var x=[],_=[],E=r;E<=u;E+=n/2)_.push([E,k]),x.push(Cesium.Cartesian3.fromDegrees(E,k,8848));var S=new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:x,width:1,vertexFormat:Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,arcType:Cesium.ArcType.RHUMB})});e.add(new Cesium.Primitive({geometryInstances:S,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.fromCssColorString("#fcfc00")})})}))}}}function p(t,e,i){var n,o;switch(i){case"1:100万":n=6,o=4;break;case"1:50万":n=3,o=2;break;case"1:25万":n=1.5,o=1;break;case"1:10万":n=.5,o=1/3;break;case"1:5万":n=.25,o=1/6;break;case"1:2.5万":n=.125,o=1/12;break;case"1:1万":n=.0625,o=1/24;break;case"1:5000":n=.03125,o=1/48}e=Math.max(-88,Math.min(88,e));var s,a=t,r=e=Math.abs(e),l=Math.floor(a/6+31),c="ABCDEFGHIJKLMNOPQRSTUV".charAt(Math.floor(r/4+1)-1),u={"1:100万":"","1:50万":"B","1:25万":"C","1:10万":"D","1:5万":"E","1:2.5万":"F","1:1万":"G","1:5000":"H"}[i];if(!u&&"1:100万"!==i)throw new Error("不支持的比例尺,请使用: 1:100万, 1:50万, 1:25万, 1:10万, 1:5万, 1:2.5万, 1:1万, 1:5000");s=c+l;var p=("000"+(Math.floor((4*Math.ceil(r/4)-r)/o)+1)).slice(-3),h=a-6*Math.floor(a/6),d=("000"+(Math.floor(h/n)+1)).slice(-3);switch(i){case"1:100万":return s;case"1:50万":case"1:25万":case"1:10万":case"1:5万":case"1:2.5万":case"1:1万":case"1:5000":break;default:throw new Error("不支持的比例尺")}return s+u+p+d}function h(){var t=s.camera.computeViewRectangle();if(2==s.scene.mode){var e=s.scene.canvas,i=new Cesium.Cartesian2(0,0),n=new Cesium.Cartesian2(e.clientWidth,e.clientHeight),o=s.scene.globe.ellipsoid,a=s.camera.pickEllipsoid(i,o),r=s.camera.pickEllipsoid(n,o);if(!a){var l=Cesium.SceneTransforms.wgs84ToWindowCoordinates(s.scene,{x:0,y:0,z:6356755});i.y=l.y+5,a=s.camera.pickEllipsoid(i,o)}if(!r){var c=Cesium.SceneTransforms.wgs84ToWindowCoordinates(s.scene,{x:0,y:0,z:-6356755});n.y=c.y-5,r=s.camera.pickEllipsoid(n,o)}var u=s.scene.globe.ellipsoid.cartesianToCartographic(a),p=s.scene.globe.ellipsoid.cartesianToCartographic(r);return t=(n.y-i.y)/(n.x-i.x)<=.49998752339363695?new Cesium.Rectangle(Cesium.Math.toRadians(-180),Cesium.Math.toRadians(-90),Cesium.Math.toRadians(180),Cesium.Math.toRadians(90)):new Cesium.Rectangle(u.longitude,p.latitude,p.longitude,u.latitude)}return t}e.postRenderEvent=function(){var i=t.viewer.camera.positionCartographic.height;switch(Mt){case"1:100万":o.position.alt=16e6;break;case"1:50万":o.position.alt=5e6;break;case"1:25万":o.position.alt=23e5;break;case"1:10万":o.position.alt=68e4;break;case"1:5万":o.position.alt=385e3;break;case"1:2.5万":o.position.alt=18e4;break;case"1:1万":o.position.alt=9e4;break;case"1:5000":o.position.alt=46e3}if(i>5*o.position.alt)return c=null,void e.removeAll();var n=!1,s=h();if(s){var a=Cesium.Math.toDegrees(s.west),r=Cesium.Math.toDegrees(s.south),p=Cesium.Math.toDegrees(s.east);a>p&&(p+=360),s={minLng:a,minLat:r,maxLng:p,maxLat:Cesium.Math.toDegrees(s.north)},c?(c.minLng>s.minLng||c.minLat>s.minLat||c.maxLng=50&&(u(Mt),n=!1):l=0}},o.complete=function(){s.scene.postRender.addEventListener(e.postRenderEvent)},Xe(t,o,.5)}function Lt(t){for(var e,i,n=t.viewer,o=0;o=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==g[2]&&g[2],s=g.length>3?g[3]:void 0,zt){t.next=6;break}return t.abrupt("return");case 6:if(r=zt.entityMap,l=Ft&&Ft.entityMap,!i){t.next=15;break}if((c=r.get(i))&&c.show){t.next=12;break}return t.abrupt("return");case 12:f(i,s),t.next=35;break;case 15:u=It(zt.entityMap),t.prev=16,u.s();case 18:if((p=u.n()).done){t.next=27;break}if(h=y()(p.value,2),d=h[0],(m=h[1])&&m.show){t.next=24;break}return t.abrupt("continue",25);case 24:f(d,s);case 25:t.next=18;break;case 27:t.next=32;break;case 29:t.prev=29,t.t0=t.catch(16),u.e(t.t0);case 32:return t.prev=32,u.f(),t.finish(32);case 35:if(!n){t.next=37;break}return t.abrupt("return");case 37:case"end":return t.stop()}}),t,null,[[16,29,32,35]])})))).apply(this,arguments)}function Qt(t,e){Ft.viewer.imageryLayers.addImageryProvider(t.imageryProvider,e)}function te(t,e,i){for(var n,o=0;o=0;l--){var c=Array.from(ue.keys())[l],u=ue.get(c);if(u&&u.that)if("PolygonObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var p=turf.point([a.lng,a.lat]),h=[],d=0;d=3){for(var f=u.that.computeAssemble(u.that.options.positions,!0),v=turf.point([a.lng,a.lat]),g=[],y=0;y=3){for(var C=turf.point([a.lng,a.lat]),w=u.that.computeAttackArrow(u.that.options.positions),k=[],x=0;x=5){for(var S=turf.point([a.lng,a.lat]),D=u.that.computePincerArrow(u.that.options.positions),P=[],M=0;M=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function be(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i=1;o--){for(s=!1,r=n.length-1;r>=1;r--)n[r].id&&i[r].id&&n[r].id===i[o].id&&(s=!0);s||re.viewer.scene.primitives.remove(i[o])}for(l=n.length-1;l>=1;l--){for(c=!1,u=i.length-1;u>=1;u--)n[l].id&&i[l].id&&n[l].id===i[u].id&&(c=!0,i[u].show=n[l].show,i[u].startColor=n[l].startColor,i[u].endColor=n[l].endColor,i[u].minimumSpeed=n[l].minimumSpeed,i[u].maximumSpeed=n[l].maximumSpeed,i[u].minimumParticleLife=n[l].minimumParticleLife,i[u].maximumParticleLife=n[l].maximumParticleLife,i[u].startScale=n[l].startScale,i[u].endScale=n[l].endScale,i[u].emissionRate=n[l].emissionRate,i[u].particleSize=n[l].particleSize,i[u].modelMatrix=n[l].modelMatrix);c||re.viewer.scene.primitives.add(n[l])}}case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ae(t,e,i){var n=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas);n.setInputAction((function(){ce=e}),Cesium.ScreenSpaceEventType.LEFT_DOWN),n.setInputAction((function(){ce=e}),Cesium.ScreenSpaceEventType.RIGHT_DOWN),n.setInputAction((function(){ce=e}),Cesium.ScreenSpaceEventType.WHEEL),we.push(n)}function je(){var t,e=this.sdks[ce];if(0===ce?t=this.sdks[1]:1===ce&&(t=this.sdks[0]),2===e.viewer.scene.mode)if(this.sdks[0].viewer.trackedEntity){var i=e.viewer.camera.positionCartographic.height;t.viewer.camera.lookAt(Cesium.Cartesian3.fromRadians(e.viewer.camera.positionCartographic.longitude,e.viewer.camera.positionCartographic.latitude,0),new Cesium.HeadingPitchRange(0,Cesium.Math.toRadians(-90),i))}else{this.sdks[1].viewer.trackedEntity&&(this.sdks[1].viewer.entities.remove(this.sdks[1].viewer.trackedEntity),this.sdks[1].viewer.trackedEntity=null);var n=this.tools.cartesian3Towgs84(Cesium.Cartesian3.fromRadians(e.viewer.camera.positionCartographic.longitude,e.viewer.camera.positionCartographic.latitude,e.viewer.camera.positionCartographic.height),e.viewer);t.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt)})}else{var o=e.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(e.viewer.canvas.clientWidth/2,e.viewer.canvas.clientHeight/(2-(90+e.viewer.camera.pitch/(Cesium.Math.PI/180))/110)));o||(o=e.viewer.camera.positionWC);var s=this.tools.cartesian3Towgs84(e.viewer.camera.positionWC,e.viewer).alt,a=this.tools.cartesian3Towgs84(o,e.viewer);t.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(a.lng,a.lat,s)})}}function Ie(){return re}function Re(){return le}function Fe(){re&&re.viewer.entities.add({show:!1,polygon:{hierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray([100,50,100.0001,50,100.0001,50.0001]))}})}function ze(){return{sdkP:le,sdkD:re}}function He(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ve(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ve(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ve(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==u[2]?u[2]:3,o=new fi(e),r=i.orientation,!i.position){t.next=13;break}if(0===i.position.alt||i.position.alt){t.next=8;break}return t.next=7,o.getClampToHeight(i.position);case 7:i.position.alt=t.sent;case 8:l=0,r||(l=500),s=Cesium.Cartesian3.fromDegrees(i.position.lng,i.position.lat,i.position.alt+l),t.next=15;break;case 13:c=o.cal_envelope(i.positions),s=new Cesium.Rectangle(Cesium.Math.toRadians(c[3][0]),Cesium.Math.toRadians(c[3][1]),Cesium.Math.toRadians(c[1][0]),Cesium.Math.toRadians(c[1][1]));case 15:ii(e),e.viewer.camera.flyTo({destination:s,duration:n,orientation:r,complete:i.complete});case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ke(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t&&t.viewer){var i=t.viewer;i.scene.screenSpaceCameraController.enableRotate=e,i.scene.screenSpaceCameraController.enableTranslate=e,i.scene.screenSpaceCameraController.enableZoom=e,i.scene.screenSpaceCameraController.enableTilt=e,i.scene.screenSpaceCameraController.enableLook=e}}function $e(t,e){if(t&&t.viewer){Je[t.viewer._element.className]||(Je[t.viewer._element.className]={}),Je[t.viewer._element.className].event&&Je[t.viewer._element.className].event.destroy();var i=new fi(t),n=t.viewer._element,s=t.proj,r=function(){switch(l){case"compass":var r=n.getElementsByClassName("compass")[0],c=n.getElementsByClassName("navigation-controls")[0];e[l]?(r&&(r.style.display="block"),c&&(c.style.display="flex")):(r&&(r.style.display="none"),c&&(c.style.display="none"));break;case"legend":var u=n.getElementsByClassName("distance-legend")[0];e[l]?u&&(u.parentNode.style.display="block"):u&&(u.parentNode.style.display="none");break;case"info":var p=n.getElementsByClassName("cesium-info")[0];if(e[l]){var h=function(){var e=o()(a.a.mark((function e(){var n,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Ge){e.next=2;break}return e.abrupt("return");case 2:n=i.cartesian3Towgs84(Ge,t.viewer),"EPSG:4326"===Ue?p.innerHTML="\n 经度:".concat(Number(n.lng.toFixed(6)),"° \n 纬度:").concat(Number(n.lat.toFixed(6)),"° \n 海拔高度:").concat(Number(n.alt.toFixed(2)),"米\n "):(o=s.convert([{x:n.lng,y:n.lat,z:n.alt}],"EPSG:4326",Ue),p.innerHTML="\n x:".concat(Number(o.points[0].x.toFixed(6)),'\n y:').concat(Number(o.points[0].y.toFixed(6)),'\n z:').concat(Number(o.points[0].z.toFixed(6)),"\n "));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();p?(h(),p.style.display="block"):((p=document.createElement("div")).className="cesium-info",p.style.position="absolute",p.style.bottom="32px",p.style.right="240px",p.style["font-size"]="14px",p.style["background-color"]="rgba(47,53,60,.8)",p.style.color="#fff",p.style.padding="4px 10px",p.style["border-radius"]="18px",p.innerHTML="EPSG:4326"===Ue?"\n 经度:-\n 纬度:-\n 海拔高度:-\n ":"\n x:-\n y:-\n z:-\n ",t.viewer._element.appendChild(p));var d=new X(t);Je[t.viewer._element.className].event=d;d.mouse_move((function(t,e){Ge=e,h()}))}else p&&(p.style.display="none");break;case"frame":e[l]?(t.viewer.scene.debugShowFramesPerSecond=!0,setTimeout((function(){var e=t.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0],i=e.getElementsByClassName("cesium-performanceDisplay-defaultContainer")[0];i&&e.appendChild(i)}),50)):t.viewer.scene.debugShowFramesPerSecond=!1}};for(var l in e)r()}}function Qe(t,e){e=e?"billboard_default_url_"+e:"billboard_default_url";var i=h();t.startsWith("http")||(t.includes(":")||i&&(t=new URL(t,i).href));localStorage.setItem(e,t)}function ti(t){return t=t?"billboard_default_url_"+t:"billboard_default_url",localStorage.getItem(t)}function ei(){return We}function ii(t){t&&t.viewer&&qe[t.viewer._element.className]&&(qe[t.viewer._element.className].animate&&TWEEN.remove(qe[t.viewer._element.className].animate),qe[t.viewer._element.className].event&&qe[t.viewer._element.className].event.destroy(),Ke(t,!0),t.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY))}function ni(t){if(t&&t.entityMap){var e,i=He(t.entityMap);try{for(i.s();!(e=i.n()).done;){var n=y()(e.value,2),o=(n[0],n[1]);"TrajectoryMotion"===o.type&&o.viewFollow&&(o.viewFollow=!1)}}catch(t){i.e(t)}finally{i.f()}}}function oi(t,e){if(t){var i,n=ae().sdkD;n&&t!==n&&oi(n,e);for(var o=0;o=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function di(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i-1){var i=t.src.split("/");i.pop(),e=i.join("/")}})),e}},{key:"cartesian3Towgs84",value:function(t,e){var i=e.scene.globe.ellipsoid,n=new Cesium.Cartesian3(t.x,t.y,t.z),o=i.cartesianToCartographic(n),s=Cesium.Math.toDegrees(o.latitude);return{lng:Cesium.Math.toDegrees(o.longitude),lat:s,alt:o.height<0?0:o.height}}},{key:"computeDistance",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_,E,S,D,P,M,O=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=O.length>0&&void 0!==O[0]?O[0]:[],i=O.length>1&&void 0!==O[1]?O[1]:2,n=O.length>2&&void 0!==O[2]?O[2]:"空间长度",!(e.length<2)){t.next=7;break}return t.abrupt("return",0);case 7:o=0,t.t0=n,t.next="空间长度"===t.t0?11:"投影长度"===t.t0?13:"地表长度"===t.t0?15:48;break;case 11:for(s=0;s20?g/20:g,y=this.chunkLine(e,m),b=[],y.forEach((function(t,e){0===e?b=L()(t.geometry.coordinates):b.push(t.geometry.coordinates[1])})),C=[],w=hi(b),t.prev=25,w.s();case 27:if((k=w.n()).done){t.next=37;break}return x=k.value,_=b.indexOf(x),t.next=32,this.sampleHeight({lng:x[0],lat:x[1],alt:0},_);case 32:(E=t.sent).position.alt=E.position.alt<0?0:E.position.alt,C.push(E);case 35:t.next=27;break;case 37:t.next=42;break;case 39:t.prev=39,t.t1=t.catch(25),w.e(t.t1);case 42:return t.prev=42,w.f(),t.finish(42);case 45:for(C.length,S=0;S0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t.length<2)return 0;var n=0;if(i){var o=[];t.forEach((function(t){o.push([t.lng,t.lat,t.alt])}));var s=turf.lineString(o);n=1e3*turf.length(s)}else for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:2;if(t.length<3)return 0;var i=[];t.forEach((function(t){i.push([t.lng,t.lat])})),i.push(i[0]);var n=turf.polygon([i]),o=turf.tesselate(n);return Number(turf.area(o).toFixed(e))}},{key:"computeSignedArea",value:function(t,e){for(var i=[],n=[],o=0;oc?l/10:c/10;var u=new Cesium.PolygonGeometry.fromPositions({positions:Cesium.Cartesian3.fromDegreesArray(i),vertexFormat:Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:s}),p=new Cesium.PolygonGeometry.createGeometry(u);if(!p||!p.attributes||!p.attributes.position)return 0;var h=p.indices,d=p.attributes.position.values;function m(e,i){var n=new Cesium.Cartesian3(d[3*i],d[3*i+1],d[3*i+2]);return t.scene.clampToHeight(n)||n}for(var f=0,v=0;v1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{steps:360};Number(e)<=0&&(e=.01);var n=[Number(t.lng),Number(t.lat)],o=turf.circle(n,e/1e3,i).geometry.coordinates[0],s=[];return o.forEach((function(t){s=s.concat(t)})),s}},{key:"createEllipse",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{granularity:.1,semiMinorAxis:10,semiMajorAxis:20,bearing:0,height:0};e.granularity||(e.granularity=.1),e.height||(e.height=0),e.semiMinorAxis||(e.semiMinorAxis=1e-5),e.semiMajorAxis||(e.semiMajorAxis=1e-5);var i=new Cesium.EllipseOutlineGeometry({center:Cesium.Cartesian3.fromDegrees(Number(t.lng),Number(t.lat)),semiMajorAxis:Number(e.semiMajorAxis),semiMinorAxis:Number(e.semiMinorAxis),height:Number(e.height),granularity:Cesium.Math.toRadians(e.granularity),rotation:Cesium.Math.toRadians(e.bearing)}),n=Cesium.EllipseOutlineGeometry.createGeometry(i);if(!n||!n.attributes||!n.attributes.position)return[];for(var o=n.attributes.position.values,s=[],a=0;a0&&void 0!==arguments[0]?arguments[0]:[],e=[];t.forEach((function(t){e.push(turf.point([t.lng,t.lat]))}));var i=turf.featureCollection(e),n=turf.center(i).geometry.coordinates;return{lng:n[0],lat:n[1]}}},{key:"computeMidpoint",value:function(t,e){var i=turf.point([t.lng,t.lat]),n=turf.point([e.lng,e.lat]),o=turf.midpoint(i,n).geometry.coordinates;return{lng:o[0],lat:o[1]}}},{key:"computeAttackArrow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.computeArrow(t,0)}},{key:"computePincerArrow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.computeArrow(t)}},{key:"computeArrow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(t.length<3)return[];for(var i,n=[],o=0;o0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.length<2)return[];t.length;var i=new Array;if(t.forEach((function(t){i.push([t.lng,t.lat])})),2===i.length){var n=P.PlotUtils.mid(i[0],i[1]),o=P.PlotUtils.distance(i[0],n)/.9,s=P.PlotUtils.getThirdPoint(i[0],n,P.Constants.HALF_PI,o,!0);i=[i[0],s,i[1]]}var a=P.PlotUtils.mid(i[0],i[2]);i.push(a,i[0],i[1]);for(var r=[],l=void 0,c=void 0,u=void 0,p=[],h=0;h0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.length<2)return[];var i=[t[0].lng,t[0].lat],n=[t[1].lng,t[1].lat];if(t[0].lng===t[1].lng&&t[0].lat===t[1].lat){if(e)return[t[0],t[0],t[0]];var o=Cesium.Cartesian3.fromDegrees(t[0].lng,t[0].lat);return[o,o,o]}for(var s,a=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:"#2ab0c2",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o="",s={7:10,8:3,9:4,10:4,11:4,12:2};switch(i&&(s[e+""]?i.polyline.width=i.polyline.oriWidth+s[e+""]:i.polyline.width=i.polyline.oriWidth),Number(e)){case 1:o=new Cesium.PolylineDashMaterialProperty({color:Cesium.Color.fromCssColorString(t),dashLength:10});break;case 2:o=new Cesium.PolylineGlowMaterialProperty({glowPower:.2,color:Cesium.Color.fromCssColorString(t)});break;case 3:o=new Cesium.PolylineFlowMaterialProperty({color:t,speed:n.rotate?n.speed:0-n.speed,rotate:n.rotate});break;case 4:o=new Cesium.PolylineFlowMultMaterialProperty({color:t,speed:n.rotate?n.speed:0-n.speed,rotate:n.rotate});break;case 5:case 6:var a,r=this;o=new Cesium.FlowDashedLineFlowMaterialProperty({color:t,uType:5==e?0:1,speed:n.rotate?n.speed:0-n.speed,space:n.space,scale:new Cesium.CallbackProperty((function(){if(r.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D){var t=i.polyline.positions.getValue();if(!Cesium.defined(t))return 1;for(var e=0,n=0;n0||0==e.speed?(n.width=s.width*(e.space+1),n.height=s.height,o.drawImage(s,s.width*(e.space/2),0)):(o.clearRect(0,0,n.width,n.height),n.width=s.width*(e.space+1),n.height=s.height,o.save(),o.translate(n.width/2,n.height/2),o.rotate(Math.PI),o.translate(-n.width/2,-n.height/2),o.drawImage(s,s.width*(e.space/2),0),o.restore());var a=0,r=0;i.polyline.material=new Cesium.LineTextureMaterialProperty({color:e.color,image:n,speed:e.speed,repeat:new Cesium.CallbackProperty((function(){if(t.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D){var o=i.polyline.positions.getValue(t.sdk.viewer.clock.currentTime);if(!Cesium.defined(o))return new Cesium.Cartesian2(1,1);for(var s=0,l=0;l700){var v=(u*=f/p/(e.space*(n.width/n.height*5)+1))/i.polyline.oriRepeat;i.polyline.oriSpeed=v,i.polyline.oriRepeatX=u,a=v,r=u,c=new Cesium.Cartesian2(u,v||1)}else c=new Cesium.Cartesian2(r||i.polyline.oriRepeatX,a||i.polyline.oriSpeed);return c}var g=Re(),y=g.viewer.entities.getById(t.options.id),b=y.polyline.positions.getValue(g.viewer.clock.currentTime);if(!Cesium.defined(b))return new Cesium.Cartesian2(1,1);for(var C=0,w=0;w700){var M=(x*=P/_/(e.space*(n.width/n.height*5)+1))/y.polyline.oriRepeat;y.polyline.oriSpeed=M,y.polyline.oriRepeatX=x,a=M,r=x,k=new Cesium.Cartesian2(x,M||1)}else k=new Cesium.Cartesian2(r||y.polyline.oriRepeatX,a||y.polyline.oriSpeed);return k}))});var l=t.getSceenLine(i,e,n);l&&(i.polyline.oriRepeat=l)}}},{key:"getSceenLine",value:function(t,e,i){var n=new Cesium.Cartesian2(0,this.sdk.viewer.canvas.clientHeight),o=new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth/2,this.sdk.viewer.canvas.clientHeight),s=this.sdk.viewer.camera.getPickRay(n),a=this.sdk.viewer.scene.globe.pick(s,this.sdk.viewer.scene),r=this.sdk.viewer.camera.getPickRay(o),l=this.sdk.viewer.scene.globe.pick(r,this.sdk.viewer.scene);if(a&&l){var c=Cesium.Cartesian3.distance(a,l)/t.polyline.width.getValue(),u=this.sdk.viewer.camera.positionCartographic.height,p=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),h=this.sdk.viewer.canvas.clientWidth,d=this.sdk.viewer.canvas.clientHeight,m=this.sdk.viewer.scene.camera.getPixelSize(p,h,d);return m>700?c*=m/u/(e.space*(i.width/i.height*5)+1):c=void 0,this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D?c:Re().viewer.entities.getById(this.options.id).polyline.oriRepeatX}}},{key:"create_arrow1_picture",value:function(t){var e=new fabric.Canvas("canvas");e.width=150,e.height=75;var i=t,n=new fabric.Polygon([{x:e.width,y:e.height/2},{x:e.width-35,y:e.height},{x:e.width-35,y:e.height-20},{x:e.width/2,y:e.height-20},{x:e.width/2,y:20},{x:e.width-35,y:20},{x:e.width-35,y:0}],{fill:i});return e.add(n),e.toDataURL()}},{key:"create_arrow2_picture",value:function(t){var e=new fabric.Canvas("canvas");e.width=75,e.height=75;var i=t,n=new fabric.Polygon([{x:e.width,y:e.height/2},{x:e.width-35,y:e.height},{x:e.width-35-40,y:e.height},{x:e.width-40,y:e.height/2},{x:e.width-35-40,y:0},{x:e.width-35,y:0}],{fill:i});return e.add(n),e.toDataURL()}},{key:"sampleHeightMostDetailed",value:function(t){var e=[];return t.forEach((function(t){e.push(new Cesium.Cartographic.fromDegrees(t.lng,t.lat))})),this.sdk.viewer.scene.sampleHeightMostDetailed(e)}},{key:"flyHome",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(pi(0),ii(this.sdk),ni(this.sdk),this.sdk.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE){var e=this.sdk.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE.destination,i=this.sdk.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE.orientation;this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.alt),orientation:{heading:Cesium.Math.toRadians(i.heading||0),pitch:Cesium.Math.toRadians(i.pitch||0),roll:Cesium.Math.toRadians(i.roll||0)},duration:t})}else this.sdk.viewer.camera.flyHome(t)}},{key:"setPickStatus",value:function(){}},{key:"create_point_buffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{steps:10},n=turf.point([Number(t.lng),Number(t.lat)]),o=turf.buffer(n,Number(e)/1e3,i);return o.geometry.coordinates}},{key:"create_line_buffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(1===t.length)return this.create_point_buffer(t[0],e);if(0===t.length)return!1;var i=[];t.forEach((function(t){i.push([Number(t.lng),Number(t.lat)])}));var n=turf.lineString(i),o=turf.buffer(n,Number(e)/1e3);return o.geometry.coordinates}},{key:"create_area_buffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(1===t.length)return this.create_point_buffer(t[0],e);if(0===t.length)return!1;if(2===t.length)return this.create_line_buffer(t,e);var i=[];t.forEach((function(t){i.push([Number(t.lng),Number(t.lat)])})),i.push(i[0]);var n=turf.polygon([i]),o=turf.buffer(n,Number(e)/1e3);return o.geometry.coordinates}},{key:"cal_envelope",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!(t.length<2)){var e=[];t.forEach((function(t){e.push(turf.point([t.lng,t.lat]))}));var i=turf.featureCollection(e);return turf.envelope(i).geometry.coordinates[0]}console.error("坐标数量不能少于2个")}},{key:"chunkLine",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if(t.length<2)return[];var i=[];t.forEach((function(t){i.push([t.lng,t.lat])}));var n=turf.lineString(i),o=turf.lineChunk(n,e/1e3),s=new Map;return o.features.forEach((function(t){t.geometry.coordinates.forEach((function(t){var e=t.join(","),i={lng:t[0],lat:t[1]};s.set(e,i)}))})),o.features}},{key:"billboardAnimation",value:function(t,e){var i=e.id,n=e.offset,o=void 0===n?10:n,s=(e.times,t.entities.getById(i));if(s){var a=Math.PI,r=a/60,l=0,c=this.cartesian3Towgs84(s.position.getValue(),t),u=setInterval((function(){l+=r;var t=o*Math.sin(l)+c.alt;l>a&&(l=0),s.position=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,t)}),30);setTimeout((function(){clearInterval(u),s.position=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt)}),3e3)}}},{key:"calSector",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:25,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:45,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:360,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=turf.point([t.lng,t.lat]),r=turf.sector(a,e/1e3,i,n,{steps:o}).geometry.coordinates,l=[];return r.forEach((function(t){t.forEach((function(t){var e;e=s?{lng:t[0],lat:t[1]}:Cesium.Cartesian3.fromDegrees(t[0],t[1]),l.push(e)}))})),l}},{key:"getClampToHeight",value:(t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=c.length>1&&void 0!==c[1]?c[1]:[],this.sdk&&this.sdk.viewer){t.next=3;break}return t.abrupt("return",0);case 3:return n=new Cesium.Cartesian3.fromDegrees(e.lng,e.lat),t.prev=4,t.next=7,this.sdk.viewer.scene.clampToHeight(n,i);case 7:if(t.t0=t.sent,t.t0){t.next=10;break}t.t0=n;case 10:o=t.t0,t.next=16;break;case 13:t.prev=13,t.t1=t.catch(4),o=n;case 16:return t.next=18,this.cartesian3Towgs84(o,this.sdk.viewer).alt;case 18:if(s=t.sent,r=0,t.prev=20,!this.sdk.viewer.scene.terrainProvider.availability){t.next=26;break}return t.next=24,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(e.lng,e.lat)]);case 24:(l=t.sent)[0].height&&(r=l[0].height);case 26:t.next=31;break;case 28:t.prev=28,t.t2=t.catch(20),r=0;case 31:if(!(s>r)){t.next=35;break}return t.abrupt("return",Number(s.toFixed(2)));case 35:return t.abrupt("return",Number(r.toFixed(2)));case 36:case"end":return t.stop()}}),t,this,[[4,13],[20,28]])}))),function(e){return t.apply(this,arguments)})},{key:"deepCopyObj",value:function(t){var e=null;if("object"==N()(t)&&null!==t)for(var i in e=t instanceof Array?[]:{},t)"earth"!=i&&"Dialog"!=i&&(e[i]=this.deepCopyObj(t[i]));else e=t;return e}},{key:"projConvert",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t?J(this.sdk,e):q()}},{key:"projectionConvert",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t?K(this.sdk,e):$()}},{key:"exportExcel",value:function(t){var e="";for(var i in t[0])e+=''.concat(i,"");e+="";for(var n,o='{rows}
',s=function(t,e){return t.replace(/{(\w+)}/g,(function(t,i){return e[i]}))},a="",r="",l=0;l",t[l])r+=s('{data}',{nameType:"String",data:t[l][c]});r+="",l>0&&l/6e4%1==0&&(a+=s(o,{rows:r,nameWS:"Sheet"+l}),r="",r+=e)}a+=s(o,{rows:r,nameWS:"Sheet"}),r="",n=s('Axel Richter{created}{worksheets}',{created:(new Date).getTime(),worksheets:a});var u,p=document.createElement("A");p.href="data:application/vnd.ms-excel;base64,"+(u=n,window.btoa(unescape(encodeURIComponent(u)))),p.download="矢量数据导出.xls",p.target="_blank",document.body.appendChild(p),p.click(),document.body.removeChild(p)}},{key:"decompressGzip",value:function(t){var e=pako.inflate(t);return(new TextDecoder).decode(e)}},{key:"cmykToRgb",value:function(t){var e=t.c,i=t.m,n=t.y,o=t.k,s={r:0,g:0,b:0};return s.c=e/100,s.m=i/100,s.y=n/100,s.k=o/100,s.r=1-Math.min(1,s.c*(1-s.k)+s.k),s.g=1-Math.min(1,s.m*(1-s.k)+s.k),s.b=1-Math.min(1,s.y*(1-s.k)+s.k),s.r=Math.round(255*s.r),s.g=Math.round(255*s.g),s.b=Math.round(255*s.b),"rgb(".concat(s.r,", ").concat(s.g,", ").concat(s.b,")")}},{key:"convertPxToRem",value:function(t,e){var i=parseFloat(getComputedStyle(document.documentElement).fontSize),n=[],o=[];if(e){n=document.getElementById(t.div_id).querySelectorAll(e);for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:[],e=t.length,i=0,n=0,o=0;o0&&i<0||n<0&&i>0)return!1;i=n}}return!0}},{key:"getDateTimeString",value:function(){var t=new Date,e=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0"),r=String(t.getMilliseconds()).padStart(3,"0");return"".concat(e).concat(i).concat(n).concat(o).concat(s).concat(a).concat(r)}},{key:"replaceHost",value:function(t,e){var i=t;if(!t||!e)return t;try{if(t.startsWith("http")){var n=/^[^@]+@/;n.test(t)&&(t=t.replace(n,"")),/^[a-z]+:\/\//i.test(t)||(t="http://"+t);var o=new URL(t),s=new URL(e),a=o.hostname,r=o.port;return a.startsWith("[")&&a.endsWith("]")&&(a=a.slice(1,-1)),"localhost"!==a&&"127.0.0.1"!==a||55110===parseInt(r,10)||(o.port=s.port,o.protocol=s.protocol,i=o.toString()),i}return t.includes(":")||this.options.host&&(i=new URL(t,this.options.host).href),i}catch(t){return i}}},{key:"message",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.type||"success",i=t.text||"",n=(t.duration,document.getElementById("YJ-custom-message"));n&&document.body.removeChild(n),n=document.createElement("div"),n.id="YJ-custom-message","success"==e?n.innerHTML='\n '.concat(i,"\n "):"warning"==e&&(n.innerHTML='\n '.concat(i,"\n ")),document.body.appendChild(n),n.classList.add(e)}}],[{key:"_md5",value:function(t){return j()(t).toUpperCase()}}]);var t,e,i}();function vi(t,e){var i=t.viewer;if(i)for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=t.color,this.duration=t.duration,this.fltr=t.fltr,this.image=t.image,this._time=(new Date).getTime()}Object.defineProperties(t.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},repeat:Cesium.createPropertyDescriptor("repeat"),color:Cesium.createPropertyDescriptor("color")}),t.prototype.getType=function(t){return"PolylineTrailLink"},t.prototype.getValue=function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrClonedDefault(this._color,t,Cesium.Color.BROWN,e.color),this.image?e.image=this.image:e.image=Cesium.Material.PolylineTrailLinkImage,this.duration&&(e.time=((new Date).getTime()-this._time)%this.duration/this.duration),!1===this.fltr?e.fltr=this.fltr:e.fltr=!0,e},t.prototype.equals=function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)},Cesium.PolylineTrailLinkMaterialProperty=t,Cesium.Material.PolylineTrailLinkType="PolylineTrailLink",Cesium.Material.PolylineTrailLinkImage=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#fa2020",e=512,i=32,n=new fabric.Canvas("canvas",{width:e,height:i}),o=new fabric.Rect({width:e,height:i}),s=new fabric.Gradient({type:"linear",gradientUnits:"pixels",coords:{x1:0,y1:0,x2:e,y2:0},colorStops:[{offset:.01,color:"rgba(246,241,241,0)"},{offset:1,color:t}]});return o.set("fill",s),n.add(o),n.toDataURL()}(),Cesium.Material.PolylineTrailLinkSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material =czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec4 colorImage = texture(image,vec2(fract(st.t - time), st.t));\n vec4 fragColor;\n fragColor.rgb = color.rgb / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.alpha = colorImage.a * color.a;\n material.diffuse = color.rgb/20.0;\n material.emission = fragColor.rgb;\n return material;\n }",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineTrailLinkType,{fabric:{type:Cesium.Material.PolylineTrailLinkType,uniforms:{color:new Cesium.Color(1,1,1,1),image:Cesium.Material.PolylineTrailLinkImage,time:0},source:Cesium.Material.PolylineTrailLinkSource},translucent:function(t){return!0}})}function bi(){var t,e,i,n,o,s,a,r;yi(),t=new fi,"undefined"!=typeof Cesium&&function(e){e.CustomMaterialSource=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(e.Color,e.defaultValue),o=Object.defineProperties,s=e.Event,a=e.createPropertyDescriptor,r=e.Property,l=e.Material,c=i.MaterialType||"wallType"+parseInt(1e3*Math.random()),u={color:new e.Color(1,1,1,1),image:i.image||t.getSourceRootPath()+"/img/material/arrow.png",time:i.time||0,repeat:new e.Cartesian2(100,100),fltr:!i.fltr&&!1!==i.fltr||i.fltr,is2D:!!i.is2D,isTranslucent:!i.isTranslucent&&!1!==i.isTranslucent||i.isTranslucent};if(this.code="",i.repeats)for(var p=e.Property.getValueOrDefault(i.repeats),h=0;h0&&void 0!==arguments[0]?arguments[0]:{};t=n(t,n.EMPTY_OBJECT),this._definitionChanged=new s,this._color=void 0,this._colorSubscription=void 0,this._repeat=void 0,this._repeats=void 0,this._repeatSubscription=void 0,this.image=t.image,this.is2D=!!t.is2D,this.color=new e.Color.fromCssColorString(t.color||"rgba(4,253,231,0.87)"),this.repeat=t.repeat,this.repeats=t.repeats,this.duration=t.duration||0===t.duration?t.duration:1e3,this.fltr=!t.fltr&&!1!==t.fltr||t.fltr,this._time=(new Date).getTime()}return o(d.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},repeat:e.createPropertyDescriptor("repeat"),color:a("color")}),d.prototype.getType=function(t){return c},d.prototype.getValue=function(t,i){if(e.defined(i)||(i={}),i.color=e.Property.getValueOrClonedDefault(this._color,t,e.Color.WHITE,i.color),i.time=this.duration?e.getTimestamp()%this.duration/this.duration:0,i.image=this.image,i.is2D=!!this.is2D,this.repeat&&(i.repeat=e.Property.getValueOrDefault(this.repeat)),this.repeats)for(var n=e.Property.getValueOrDefault(this.repeats),o=0;o0&&void 0!==arguments[0]?arguments[0]:{},i=(t.Color,t.defaultValue),n=Object.defineProperties,o=t.Event,s=t.createPropertyDescriptor,a=t.Property,r=t.Material,l=e.MaterialType||"wallType"+parseInt(1e3*Math.random());function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this.color=new t.Color.fromCssColorString(e.color||"rgba(4,253,231,0.87)")}return n(c.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:s("color")}),c.prototype.getType=function(t){return l},c.prototype.getValue=function(e,i){return t.defined(i)||(i={}),i.color=t.Property.getValueOrClonedDefault(this._color,e,t.Color.WHITE,i.color),i},c.prototype.equals=function(t){return this===t||t instanceof c&&a.equals(this._color,t._color)},r._materialCache.addMaterial(l,{fabric:{type:l,uniforms:{color:new t.Color(1,1,1,1)},source:"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.alpha = color.a;\n \n material.diffuse = color.rgb*0.0;\n material.emission = color.rgb;\n return material;\n }",components:{specular:1,diffuse:"vec3(0.0)"}},translucent:function(t){return!0}}),new c(e)}}(Cesium),function(){var t=new fi;"undefined"!=typeof Cesium&&function(e){e.CustomImageMaterialSource=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(e.Color,e.defaultValue),o=Object.defineProperties,s=e.Event,a=e.createPropertyDescriptor,r=e.Property,l=e.Material,c=i.MaterialType||"wallType"+parseInt(1e3*Math.random());function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=n(t,n.EMPTY_OBJECT),this._definitionChanged=new s,this._color=void 0,this._colorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.image=t.image,this.color=new e.Color.fromCssColorString(t.color||"rgba(4,253,231,0.87)"),this.repeat=t.repeat}return o(u.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},repeat:e.createPropertyDescriptor("repeat"),color:a("color")}),u.prototype.getType=function(t){return c},u.prototype.getValue=function(t,i){return e.defined(i)||(i={}),i.color=e.Property.getValueOrClonedDefault(this._color,t,e.Color.WHITE,i.color),i.image=this.image,i.repeat=e.Property.getValueOrDefault(this.repeat),i},u.prototype.equals=function(t){return this===t||t instanceof u&&r.equals(this._color,t._color)&&r.equals(this.repeat,t._repeat)},l._materialCache.addMaterial(c,{fabric:{type:c,uniforms:{color:new e.Color(1,1,1,1),image:i.image||t.getSourceRootPath()+"/img/material/arrow.png",repeat:new e.Cartesian2(100,100)},source:"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = repeat * materialInput.st;\n vec4 colorImage = texture(image, st);\n \n material.diffuse = colorImage.rgb * 0.0;\n material.emission = colorImage.rgb * 0.3;\n return material;\n }"}}),new u(i)}}(Cesium)}(),i=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._color=void 0,this._duration=void 0,this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.duration=e.duration||10,this.lineBackAlpha=e.lineBackAlpha||.05}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.FlowLineMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.duration=Cesium.Property.getValueOrDefault(this._duration,t,10,e.duration),e.lineBackAlpha=this.lineBackAlpha,e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._duration,e.duration)&&Cesium.Property.equals(this.lineBackAlpha,e.lineBackAlpha)}}])}(),Object.defineProperties(i.prototype,{color:Cesium.createPropertyDescriptor("color"),duration:Cesium.createPropertyDescriptor("duration"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha")}),Cesium.FlowLineMaterialProperty=i,Cesium.Material.FlowLineMaterialProperty="FlowLineMaterialProperty",Cesium.Material.FlowLineMaterialType="FlowLineMaterialType",Cesium.Material.FlowLineMaterialSource="\n uniform vec4 color;\n uniform float duration;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n //生成默认的基础材质\n czm_material material = czm_getDefaultMaterial(materialInput);\n //获取st(uv)\n vec2 st = materialInput.st;\n //获取当前帧数,10秒内变化0-1\n float time = fract(czm_frameNumber / (60.0*duration));\n //长度1/10\n time = time * (1.0 + 0.1);\n //平滑过渡函数\n float alpha = smoothstep(time-0.1,time,st.s) * step(-time,-st.s);\n //光带轨迹(不会完全透明)\n alpha += lineBackAlpha;\n material.alpha = alpha;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.FlowLineMaterialType,{fabric:{type:Cesium.Material.FlowLineMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),duration:10,lineBackAlpha:.05},source:Cesium.Material.FlowLineMaterialSource},translucent:function(t){return!0}}),n=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._color=void 0,this._speed=void 0,this._rotate=void 0,this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.speed=null!=e.speed?e.speed:1,this.lineBackAlpha=e.lineBackAlpha||.05,this.rotate=e.rotate}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.PolylineFlowMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.rotate=Cesium.Property.getValueOrDefault(this._rotate,t,!0,e.rotate),e.lineBackAlpha=this.lineBackAlpha,e.frameTime=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._speed,e.speed)&&Cesium.Property.equals(this.lineBackAlpha,e.lineBackAlpha)}}])}(),Object.defineProperties(n.prototype,{color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),rotate:Cesium.createPropertyDescriptor("rotate"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha")}),Cesium.PolylineFlowMaterialProperty=n,Cesium.Material.PolylineFlowMaterialProperty="PolylineFlowMaterialProperty",Cesium.Material.PolylineFlowMaterialType="PolylineFlowMaterialType",Cesium.Material.PolylineFlowMaterialSource="\n uniform vec4 color;\n uniform float speed;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n //生成默认的基础材质\n czm_material material = czm_getDefaultMaterial(materialInput);\n //获取st(uv)\n vec2 st = materialInput.st;\n //获取当前帧数,10秒内变化0-1\n // float time = fract(czm_frameNumber * speed / 60.0);\n // float time = fract(abs(speed) * czm_frameNumber * 0.01);\n float time = fract(frameTime / 1000.0 / abs(speed));\n //长度1/10\n // time = time * (1.0 + 0.1);\n float staticAlpha = rotate?smoothstep(0.0,1.0, 1.0-st.s) * step(-1.0,-(1.0-st.s)):smoothstep(0.0,1.0, st.s) * step(-1.0,-st.s);\n\n //平滑过渡函数\n float alpha1 = smoothstep(time-0.1,time,1.0-st.s) * step(-time,- (1.0-st.s));\n float alpha2 = smoothstep(time-0.1,time,st.s) * step(-time,- st.s);\n float alpha =(speed== 0.0)? staticAlpha:(speed < 0.0)?alpha2:alpha1;\n //光带轨迹(不会完全透明)\n alpha += lineBackAlpha;\n material.alpha = alpha;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineFlowMaterialType,{fabric:{type:Cesium.Material.PolylineFlowMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),speed:.1,rotate:!0,frameTime:Cesium.getTimestamp(),lineBackAlpha:.05},source:Cesium.Material.PolylineFlowMaterialSource},translucent:function(t){return!0}}),o=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._color=void 0,this._speed=void 0,this._rotate=void 0,this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.speed=null!=e.speed?e.speed:1,this.lineBackAlpha=e.lineBackAlpha||.05,this.rotate=e.rotate}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.PolylineFlowMultMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.rotate=Cesium.Property.getValueOrDefault(this._rotate,t,!0,e.rotate),e.lineBackAlpha=this.lineBackAlpha,e.frameTime=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._speed,e.speed)&&Cesium.Property.equals(this._rotate,e.rotate)&&Cesium.Property.equals(this.lineBackAlpha,e.lineBackAlpha)}}])}(),Object.defineProperties(o.prototype,{color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),rotate:Cesium.createPropertyDescriptor("rotate"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha")}),Cesium.PolylineFlowMultMaterialProperty=o,Cesium.Material.PolylineFlowMultMaterialProperty="PolylineFlowMultMaterialProperty",Cesium.Material.PolylineFlowMultMaterialType="PolylineFlowMultMaterialType",Cesium.Material.PolylineFlowMaterialSource="\n uniform vec4 color;\n uniform float speed;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n\n // 基础时间轴(控制主光带)\n float baseTime = fract(czm_frameNumber * speed / 60.0) * 1.1;\n\n // 高频时间轴(控制高光点)\n // float highlightTime = fract(czm_frameNumber * speed * 3.0 / 60.0);\n // float highlightTime = fract(abs(speed) * czm_frameNumber * 0.01);\n float highlightTime = fract(frameTime / 1000.0 / abs(speed));\n float highlightSpacing = 0.3; // 高光点间隔\n\n // 主光带透明度计算\n float mainAlpha = smoothstep(baseTime-0.1, baseTime, st.s) * step(-baseTime, -st.s);\n\n // 多高光点计算(3个周期性光斑)\n float highlight11 = smoothstep(highlightTime-0.05, highlightTime, st.s) *\n step(-highlightTime, -st.s) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(st.s - highlightTime)));\n\n float highlight21 = smoothstep(highlightTime+highlightSpacing-0.05,\n highlightTime+highlightSpacing, st.s) *\n step(-(highlightTime+highlightSpacing), -st.s) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(st.s - (highlightTime+highlightSpacing))));\n\n float highlight31 = smoothstep(highlightTime+2.0*highlightSpacing-0.05,\n highlightTime+2.0*highlightSpacing, st.s) *\n step(-(highlightTime+2.0*highlightSpacing), -st.s) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(st.s - (highlightTime+2.0*highlightSpacing))));\n\n\n float highlight12 = smoothstep(highlightTime-0.05, highlightTime, 1.0 - st.s) *\n step(-highlightTime, -(1.0-st.s)) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(1.0 - st.s - highlightTime)));\n\n float highlight22 = smoothstep(highlightTime+highlightSpacing-0.05,\n highlightTime+highlightSpacing, 1.0 - st.s) *\n step(-(highlightTime+highlightSpacing),-(1.0 - st.s)) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(1.0-st.s - (highlightTime+highlightSpacing))));\n\n float highlight32 = smoothstep(highlightTime+2.0*highlightSpacing-0.05,\n highlightTime+2.0*highlightSpacing, 1.0 - st.s) *\n step(-(highlightTime+2.0*highlightSpacing), -(1.0-st.s)) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(1.0 - st.s - (highlightTime+2.0*highlightSpacing))));\n\n\n float highlight1 = !rotate?highlight11:highlight12;\n float highlight2 = !rotate?highlight21:highlight22;\n float highlight3 = !rotate?highlight31:highlight32;\n // 合并效果\n // material.alpha = mainAlpha * 0.7 +\n // (highlight1 + highlight2 + highlight3) * 0.5 +\n // lineBackAlpha;\n material.alpha = (highlight1 + highlight2 + highlight3) * 0.5 +\n lineBackAlpha;\n material.diffuse = color.rgb; // 高光区变亮\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineFlowMultMaterialType,{fabric:{type:Cesium.Material.PolylineFlowMultMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),speed:.1,rotate:!0,frameTime:Cesium.getTimestamp(),lineBackAlpha:.05},source:Cesium.Material.PolylineFlowMaterialSource},translucent:function(t){return!0}}),s=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._color=void 0,this._speed=void 0,this._uType=void 0,this._space=void 0,this._dashSize=void 0,this._scale=void 0,this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.speed=null!=e.speed?e.speed:1,this.space=e.space||0,this.dashSize=e.dashSize||.03,this.uType=void 0===e.uType?1:e.uType,this.lineBackAlpha=e.lineBackAlpha||.05,this.scale=e.scale||1}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.FlowDashedLineMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.space=Cesium.Property.getValueOrDefault(this._space,t,10,e.space),e.dashSize=Cesium.Property.getValueOrDefault(this._dashSize,t,10,e.dashSize),e.uType=Cesium.Property.getValueOrDefault(this._uType,t,1,e.uType),e.scale=Cesium.Property.getValueOrDefault(this._scale,t,1,e.scale),e.lineBackAlpha=this.lineBackAlpha,e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._speed,e.speed)&&Cesium.Property.equals(this._uType,e.uType)&&Cesium.Property.equals(this._lineBackAlpha,e.lineBackAlpha)&&Cesium.Property.equals(this._scale,e.scale)}}])}(),Object.defineProperties(s.prototype,{color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),space:Cesium.createPropertyDescriptor("space"),dashSize:Cesium.createPropertyDescriptor("dashSize"),uType:Cesium.createPropertyDescriptor("uType"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha"),scale:Cesium.createPropertyDescriptor("scale")}),Cesium.FlowDashedLineFlowMaterialProperty=s,Cesium.Material.FlowDashedLineFlowMaterialProperty="FlowDashedLineFlowMaterialProperty",Cesium.Material.FlowDashedLineMaterialType="FlowDashedLineMaterialType",Cesium.Material.FlowDashedLineMaterialSource="\n uniform vec4 color;\n uniform float speed;\n // uniform int uType;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n\n float dashSize = 0.1;\n float gapSize = space;\n // speed现在表示完成一次完整动画循环的秒数\n float progress = speed==0.0 ? 0.0 : fract(frameNumber / 1000.0 / speed * scale);\n float pattern = fract(st.x / dashSize * (1.0 + gapSize) + progress / dashSize * (1.0 + gapSize));\n float dash1 = step(0.0, pattern) - step(1.0/(1.0 + gapSize), pattern);\n float dash2 = smoothstep(0.0, 0.2, pattern) -\n smoothstep(1.0/(1.0 + gapSize),\n 1.0/(1.0 + gapSize) + 0.2,\n pattern);\n float dash = (float(uType) != 1.0)?dash1:dash2;\n material.alpha = dash;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.FlowDashedLineMaterialType,{fabric:{type:Cesium.Material.FlowDashedLineMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),speed:1,space:0,scale:1,dashSize:.03,frameNumber:Cesium.getTimestamp(),uType:1,lineBackAlpha:.05},source:Cesium.Material.FlowDashedLineMaterialSource},translucent:function(t){return!0}}),a=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._image=void 0,this._color=void 0,this._speed=void 0,this._repeat=void 0,this.image=e.image||"",this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.speed=null!=e.speed?e.speed:1,this.repeat=e.repeat||new Cesium.Cartesian2(1,1)}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.LineTextureMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.image=Cesium.Property.getValueOrDefault(this._image,t,"",e.image),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,1,e.speed),e.repeat=Cesium.Property.getValueOrDefault(this._repeat,t,new Cesium.Cartesian2(1,1),e.repeat),e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._image,e._image)&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._imageW,e._imageW)&&Cesium.Property.equals(this._speed,e._speed)}}])}(),Object.defineProperties(a.prototype,{image:Cesium.createPropertyDescriptor("image"),color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),repeat:Cesium.createPropertyDescriptor("repeat")}),Cesium.LineTextureMaterialProperty=a,Cesium.Material.LineTextureMaterialProperty="LineTextureMaterialProperty",Cesium.Material.LineTextureMaterialType="LineTextureMaterialType",Cesium.Material.LineTextureMaterialSource="\n uniform vec4 color;\n uniform sampler2D image;\n uniform float speed;\n // uniform float repeat;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n st.s *= repeat.x; // 关键:通过repeat控制纹理密度\n // vec4 colorImage = texture2D(image, vec2(fract(st.s + speed*czm_frameNumber* 0.01), st.t));\n vec4 colorImage = speed==0.0?texture2D(image, vec2(fract(st.s), st.t)):texture2D(image, vec2(fract(st.s + frameNumber / 1000.0 / speed * repeat.x / repeat.y ), st.t));\n material.alpha = colorImage.a * color.a;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.LineTextureMaterialType,{fabric:{type:Cesium.Material.LineTextureMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),image:"",repeat:new Cesium.Cartesian2(1,1),speed:1,frameNumber:Cesium.getTimestamp(),uTime:1},source:Cesium.Material.LineTextureMaterialSource},translucent:function(t){return!0}}),r=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._image=void 0,this._repeat=void 0,this._stRotation=void 0,this._repeatLength=void 0,this.image=e.image||"",this.repeat=e.repeat||1,this.stRotation=e.stRotation||0}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.RoadTextureMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.image=Cesium.Property.getValueOrDefault(this._image,t,"",e.image),e.repeat=Cesium.Property.getValueOrDefault(this._repeat,t,1,e.repeat),e.stRotation=Cesium.Property.getValueOrDefault(this._stRotation,t,0,e.stRotation),console.log(e,"result"),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._image,e._image)&&Cesium.Property.equals(this._repeat,e._repeat)&&Cesium.Property.equals(this._stRotation,e._stRotation)}}])}(),Object.defineProperties(r.prototype,{image:Cesium.createPropertyDescriptor("image"),repeat:Cesium.createPropertyDescriptor("repeat"),repeatLength:Cesium.createPropertyDescriptor("stRotation")}),Cesium.RoadTextureMaterialProperty=r,Cesium.Material.RoadTextureMaterialProperty="RoadTextureMaterialProperty",Cesium.Material.RoadTextureMaterialType="RoadTextureMaterialType",Cesium.Material.RoadTextureMaterialSource="\n uniform sampler2D image;\n uniform float repeat;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n st.s *= repeat;\n mat2 rot = mat2(cos(stRotation), -sin(stRotation), sin(stRotation), cos(stRotation));\n vec2 newSt = rot * (st - 0.5) + 0.5;\n\n vec4 colorImage = texture2D(image, newSt);\n material.diffuse = colorImage.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.RoadTextureMaterialType,{fabric:{type:Cesium.Material.RoadTextureMaterialType,uniforms:{image:"",repeat:1,stRotation:0},source:Cesium.Material.RoadTextureMaterialSource},translucent:function(t){return!0}})}var Ci=function(){return _()((function t(e,i){k()(this,t),this.dom=e,this.playerUrl=i.url,this.init()}),[{key:"init",value:function(){this.flvPlayer=flvjs.createPlayer({type:"flv",url:this.playerUrl,isLive:!0,hasAudio:!1,hasVideo:!0},{enableWorker:!0,enableStashBuffer:!1,stashInitialSize:128}),this.flvPlayer.attachMediaElement(this.dom),this.flvPlayer.load()}},{key:"on",value:function(t,e,i){this.flvPlayer.on(flvjs[t][e],i)}},{key:"destroy",value:function(){this.flvPlayer.destroy(),this.flvPlayer=null}}])}(),wi=function(){return _()((function t(e,i){k()(this,t),this.dom=e,this.url=i.url,this.init()}),[{key:"init",value:function(){this.player=new Jessibuca({container:this.dom,decoder:this.getSourceRootPath()+"/3rdparty/jessibuca/decoder.js",timeout:30,heartTimeout:30,heartTimeoutReplay:!1,loadingTimeout:30,loadingTimeoutReplay:!1,wasmDecodeErrorReplay:!1,videoBuffer:.2,isResize:!1,text:"",loadingText:"",useMSE:!1,debug:!0,showBandwidth:!1,operateBtns:{fullscreen:!1,screenshot:!1,play:!1,audio:!1,recorder:!1},forceNoOffscreen:!1,isNotMute:!1}),this.player.play(this.url)}},{key:"on",value:function(t,e){this.player.on(t,e)}},{key:"destroy",value:function(){this.player.destroy(),this.player=null}},{key:"getSourceRootPath",value:function(){var t=document.querySelectorAll("script"),e="";return t.forEach((function(t){if(t.src&&t.src.indexOf("YJEarth.min.js")>-1){var i=t.src.split("/");i.pop(),e=i.join("/")}})),e}}])}();function ki(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function xi(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var _i=/^[og]\s*(.+)?/,Ei=/^mtllib /,Si=/^usemtl /,Di=/^usemap /,Pi=/\s+/,Mi={red:1,green:1,blue:1,alpha:1};function Oi(){var t={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(t,e){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=!1!==e);var i=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:!1!==e,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(t,e){var i=this._finalize(!1);i&&(i.inherited||i.groupCount<=0)&&this.materials.splice(i.index,1);var n={index:this.materials.length,name:t||"",mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:"",smooth:void 0!==i?i.smooth:this.smooth,groupStart:void 0!==i?i.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(t){var e={index:"number"==typeof t?t:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return e.clone=this.clone.bind(e),e}};return this.materials.push(n),n},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(var i=this.materials.length-1;i>=0;i--)this.materials[i].groupCount<=0&&this.materials.splice(i,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}},i&&i.name&&"function"==typeof i.clone){var n=i.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(t,e){var i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},parseNormalIndex:function(t,e){var i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},parseUVIndex:function(t,e){var i=parseInt(t,10);return 2*(i>=0?i-1:i+e/2)},addVertex:function(t,e,i){var n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[i+0],n[i+1],n[i+2])},addVertexPoint:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addVertexLine:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addNormal:function(t,e,i){var n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[i+0],n[i+1],n[i+2])},addFaceNormal:function(t,e,i){console.warn("addFaceNormal")},addColor:function(t,e,i){var n=this.colors,o=this.object.geometry.colors;void 0!==n[t]&&o.push(n[t+0],n[t+1],n[t+2]),void 0!==n[e]&&o.push(n[e+0],n[e+1],n[e+2]),void 0!==n[i]&&o.push(n[i+0],n[i+1],n[i+2])},addUV:function(t,e,i){var n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[i+0],n[i+1])},addDefaultUV:function(){var t=this.object.geometry.uvs;t.push(0,0),t.push(0,0),t.push(0,0)},addUVLine:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])},addFace:function(t,e,i,n,o,s,a,r,l){var c=this.vertices.length,u=this.parseVertexIndex(t,c),p=this.parseVertexIndex(e,c),h=this.parseVertexIndex(i,c);if(this.addVertex(u,p,h),this.addColor(u,p,h),void 0!==a&&""!==a){var d=this.normals.length;u=this.parseNormalIndex(a,d),p=this.parseNormalIndex(r,d),h=this.parseNormalIndex(l,d),this.addNormal(u,p,h)}else this.addFaceNormal(u,p,h);if(void 0!==n&&""!==n){var m=this.uvs.length;u=this.parseUVIndex(n,m),p=this.parseUVIndex(o,m),h=this.parseUVIndex(s,m),this.addUV(u,p,h),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(t){this.object.geometry.type="Points";for(var e=this.vertices.length,i=0,n=t.length;i=7?(Cesium.Color.fromBytes(parseFloat(u[4]),parseFloat(u[5]),parseFloat(u[6]),1,Mi),n.colors.push(Mi.red,Mi.green,Mi.blue)):n.colors.push(void 0,void 0,void 0);break;case"vn":n.normals.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3]));break;case"vt":n.uvs.push(parseFloat(u[1]),parseFloat(u[2]))}}else if("f"===c){for(var p=l.slice(1).trim().split(Pi),h=[],d=0,m=p.length;d0){var v=f.split("/");h.push(v)}}for(var g=h[0],y=1,b=h.length-1;y1){var M=s[1].trim().toLowerCase();n.object.smooth="0"!==M&&"off"!==M}else n.object.smooth=!0;var O=n.object.currentMaterial();O&&(O.smooth=n.object.smooth)}else{if("\0"===l)continue;console.warn('Unexpected line: "'+l+'"')}}}n.finalize();var T=new Ai(this.context,this.hls,this.videoId,this.host,i);if(!0===!(1===n.objects.length&&0===n.objects[0].geometry.vertices.length))for(var N=0,B=n.objects.length;N0&&(d=!0),i.colors.length>0&&(m=!0),!0===i.hasUVIndices&&(f=!0),d&&(u+="attribute vec3 normal;\n",u+="varying vec3 v_normal;\n",p+="varying vec3 v_normal;\n",h+="v_normal = normal;\n"),m&&(u+="attribute vec3 color;\n",u+="varying vec2 v_color;\n",p+="varying vec2 v_color;\n",h+="v_color = color;\n"),f&&(u+="attribute vec2 uv;\n",u+="varying vec2 v_uv;\n",p+="varying vec2 v_uv;\n",h+="v_uv = uv;\n"),u+="\n void main() {\n gl_Position = czm_modelViewProjection * vec4(position, 1.);\n ".concat(h,"\n }\n "),p+="\n\t\tuniform sampler2D colorTexture;\n void main() {\n\t\t\t vec4 color = texture2D(colorTexture, v_uv);\n\t\t\t\t\t\tgl_FragColor = color;\n }\n ",this.program=Cesium.ShaderProgram.fromCache({context:e,vertexShaderSource:u,fragmentShaderSource:p}),this.uniformMap={};var v=this;c.then((function(t){for(var e=function(){var e=t[i].diffusemap;r.uniformMap.colorTexture=function(){return e}},i=0;i0){o++;var a=Cesium.Buffer.createVertexBuffer({context:e,typedArray:Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT,i.normals),usage:Cesium.BufferUsage.STATIC_DRAW});n.push({index:o,enabled:!0,vertexBuffer:a,componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1})}if(i.colors.length>0){o++;var r=Cesium.Buffer.createVertexBuffer({context:e,typedArray:Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT,i.colors),usage:Cesium.BufferUsage.STATIC_DRAW});n.push({index:o,enabled:!0,vertexBuffer:r,componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1})}if(!0===i.hasUVIndices){o++;var l=Cesium.Buffer.createVertexBuffer({context:e,typedArray:Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT,i.uvs),usage:Cesium.BufferUsage.STATIC_DRAW});n.push({index:o,enabled:!0,vertexBuffer:l,componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:2,normalize:!1})}var c=new Cesium.VertexArray({context:e,attributes:n}),u=Cesium.RenderState.fromCache({cull:{enabled:!1},depthMask:!0,depthTest:{enabled:!0}});this.drawCommand=new Cesium.DrawCommand({owner:this,primitiveType:Cesium.PrimitiveType.TRIANGLES,vertexArray:c,renderState:u,pass:Cesium.Pass.OPAQUE})}),[{key:"setMaterial",value:function(t){this.material=t,t.setCommand(this.drawCommand)}},{key:"update",value:function(t){Cesium.defined(this.material)&&this.material.ready&&t.commandList.push(this.drawCommand)}},{key:"updateVideo",value:function(t,e,i){var n=!1;if(Cesium.defined(this.material)&&this.material.ready)if(i.computeVisibility(this.drawCommand.boundingVolume)>=0&&this.material.ready){var o=t.distanceToBoundingSphere(this.drawCommand.boundingVolume),s=e.width,a=e.height;o>=20&&o<100?(s=e.width/2,a=e.height/2):o>=100&&(s=e.width/10,a=e.height/10),n=!0,this.material.updateColorTexture(e,Math.floor(s),Math.floor(a))}else n=!1;this.lastState=n}}])}(),Li=new WeakMap,Ai=function(){return _()((function t(e,i,n,o,s){k()(this,t),ki(this,Li,!0),this.context=e,this.videoId=n,this.host=o,this._modelMatrix=Cesium.Matrix4.IDENTITY,this.parent=null,this.children=[],this.video={dom:null,playing:!1,timeupdate:!1,width:0,height:0,tracks:null},this.time=0,this.name=s}),[{key:"show",get:function(){return e=this,(t=Li).get(xi(t,e));var t,e},set:function(t){var e,i,n;"boolean"==typeof t?(i=this,n=t,(e=Li).set(xi(e,i),n),t?this.video.player&&this.video.player.getVueInstance().play():this.video.player&&this.video.player.getVueInstance().pause()):console.error("参数必须为boolean")}},{key:"requestVideoResource",value:function(){var t=this,e="",i=(e=this.host.endsWith("yjearth4.0")?this.host:this.host+"/yjearth4.0")+"/videoFusion/"+this.videoId;return fetch(i,{method:"get",headers:{"Content-Type":"application/json"}}).then(function(){var i=o()(a.a.mark((function i(n){var s;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,n.text();case 2:if(s=i.sent,s=JSON.parse(s),![0,200].includes(s.code)){i.next=13;break}if(!s.data.deviceCode.length){i.next=9;break}return i.abrupt("return",fetch(e+"/videoFusion/vide/stream",{method:"post",body:JSON.stringify({type:"flv",deviceCode:s.data.deviceCode}),headers:{"Content-Type":"application/json"}}).then(function(){var e=o()(a.a.mark((function e(i){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.text();case 2:if(n=e.sent,n=JSON.parse(n),![0,200].includes(n.code)){e.next=9;break}return n.data.url.length?(t.video.player.url=n.data.url,t.setFlvVideo(n.data.url)):console.warn("地址不存在"),e.abrupt("return");case 9:return console.warn(n.msg||n.message),e.abrupt("return");case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 9:console.warn("设备不存在");case 10:return i.abrupt("return");case 13:return console.warn(s.msg||s.message),i.abrupt("return");case 15:case"end":return i.stop()}}),i)})));return function(t){return i.apply(this,arguments)}}())}},{key:"modelMatrix",get:function(){return this._modelMatrix},set:function(t){this._modelMatrix=t.clone(),this.updateModelMatrix()}},{key:"updateModelMatrix",value:function(){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{};k()(this,t);var n,o,s,a,r,l=this,c={el:i.el,size:"mini",isLog:!1,disabled:i.disabled||!1,alpha:!1,clickDefineColor:p,hasClear:!0,openPickerAni:"opacity",defaultColor:i.defaultColor,pickerInputChange:v,startMainCallback:function(t){l.colorPicker&&(l.colorPicker.picker.style.opacity=0),setTimeout((function(){u()}),0)}};function u(){if(l.colorPicker&&l.colorPicker.picker){var t=!1,e=l.colorPicker.box,c=l.colorPicker.picker,u=e.getBoundingClientRect().x,m=e.getBoundingClientRect().y,g=0;c.style.left=u+"px",c.style.minWidth="325px";var y=c.getElementsByClassName("ew-alpha-slider-bar")[0];y&&(y.parentNode.style.width="16px",y.parentNode.removeChild(y));var b=document.createElement("div");b.className="icon-pen-box",b.innerHTML='',b.style.display="none",b.style.cursor="unset";var C=l.colorPicker.pickerInput;C.parentNode.insertBefore(b,C),C.style.width="188px",C.style.display="none";var w=document.createElement("div"),k=document.createElement("div");k.className="row",k.style.margin="6px 0 0 0",k.innerHTML='\n
R
\n
G
\n
B
\n
\n ';var x=document.createElement("div");x.className="row",x.innerHTML='\n
\n \n
\n
\n \n
\n
\n \n
\n ',w.appendChild(k),w.appendChild(x);var _=x.getElementsByTagName("input");_[0].style.width="72px",_[1].style.width="72px",_[2].style.width="72px",n=_[0],o=_[1],s=_[2];var E=c.getElementsByClassName("ew-color-dropbtns")[0];if(c.insertBefore(w,E),n.addEventListener("blur",(function(t){var e=t.target.value;(t.target.value||"undefined"!==t.target.dataset.null&&""!==t.target.dataset.null&&!Boolean(t.target.dataset.null))&&(e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&eNumber(t.target.max)&&(e=Number(t.target.max)),t.target.min&&eNumber(t.target.max)&&(e=Number(t.target.max)),t.target.min&&eR\n
G
\n
B
\n
A
\n
\n ',x.appendChild(S),a.addEventListener("blur",(function(t){var e=t.target.value;(t.target.value||"undefined"!==t.target.dataset.null&&""!==t.target.dataset.null&&!Boolean(t.target.dataset.null))&&(e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e',B.className="yj-pre-collect-color add";var L=document.createElement("div");L.innerHTML='',L.className="yj-pre-collect-color subtract";var A=L.getElementsByClassName("icon-minus")[0],j=L.getElementsByClassName("icon-confirm")[0];N.appendChild(B),N.appendChild(L);var I=[],R=function(t){var e=document.createElement("div");e.className="yj-pre-collect-color",e.setAttribute("tabindex","0"),e.setAttribute("color-box-id",l.colorPicker.uid);var i=document.createElement("div");i.className="yj-pre-define-color-item",e.appendChild(i),i.className="yj-pre-define-color-item";var n=Cesium.Color.fromCssColorString(M[t]).toCssHexString();i.style.backgroundColor=n,i.addEventListener("click",(function(t){l.colorPicker.updateColor(t),e.className="yj-pre-collect-color yj-pre-collect-color-active",p(n)})),e.addEventListener("blur",(function(t){e.className="yj-pre-collect-color"}));var o=document.createElement("div");o.className="yj-pre-define-color-item subtract-btn",o.innerHTML='',o.style.display="none",e.appendChild(o),N.appendChild(e),o.addEventListener("click",(function(){delete M[t],localStorage.setItem("custom-color",JSON.stringify(M)),N.removeChild(e)})),I.push(o)};for(var F in M)R(F);B.addEventListener("click",(function(){if(t){t=!1;for(var e=0;ewindow.innerHeight?c.style.top=m-g+"px":c.style.top=m+e.offsetHeight+4+"px",l.colorPicker.pancelTop=parseFloat(c.style.top)-2,v(Cesium.Color.fromCssColorString(l.colorPicker.config.defaultColor||"#ffffff").toCssHexString())}}function p(t){if(a){var e=Cesium.Color.fromCssColorString(t);a.value=parseInt(100*Number(e.alpha.toFixed(2)))/100}}function h(t){var e,i,n,o=t.a,s=Math.round(t.h),a=Math.round(255*t.s/100),r=Math.round(255*t.b/100);if(0===a)e=i=n=r;else{var l=(255-a)*r/255,c=s%60*(r-l)/60;360===s?(e=r,i=n=0):s<60?(e=r,i=l+c,n=l):s<120?(e=r-c,i=r,n=l):s<180?(e=l,i=r,n=l+c):s<240?(e=l,i=r-c,n=r):s<300?(e=l+c,i=l,n=r):s<360?(e=r,i=l,n=r-c):e=i=n=0}return"rgba("+Math.round(e)+","+Math.round(i)+","+Math.round(n)+","+o+")"}function d(t){var e={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"};if(/rgba?/.test(t)){var i=t.replace(/rgba?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n="";return i[3],i.map((function(t,i){i<=2&&(n+=function(t){t=Math.min(Math.round(t),255);var i=Math.floor(t/16),n=t%16;return""+(e[i]||i)+(e[n]||n)}(t))})),"#"+n}}function m(t,e){var i=t.toLowerCase(),n=t.length,o=[];i=Cesium.Color.fromCssColorString(i).toCssHexString().substring(0,7);if(t&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(i)){if(4===n){for(var s="#",a=1;a=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Vi(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),Wi(this,Ji,void 0),this.div_id=e,this.entityMap=new Map,this._entityZIndex=0,this.viewer=null,this.options=Ui({},i),ui(ci()),this.proj=new R,this.clickTextDom=void 0,this.isLeftClick=!1,this.init(),Ri()}),[{key:"addIncetance",value:function(t,e){this.entityMap.set(t+"",e)}},{key:"getIncetance",value:function(t){return this.entityMap.get(t+"")}},{key:"removeIncetance",value:function(t){this.entityMap.delete(t),function(t){at.delete(t)}(this),function(t){rt.delete(t)}(this),function(t){lt.delete(t)}(this),se(this,t)}},{key:"setDefaultView",value:function(t){t?(this.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE={destination:t.destination||{},orientation:t.orientation||{}},ii(this),ni(this),this.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(t.destination.lng,t.destination.lat,t.destination.alt),orientation:{heading:Cesium.Math.toRadians(t.orientation.heading||0),pitch:Cesium.Math.toRadians(t.orientation.pitch||0),roll:Cesium.Math.toRadians(t.orientation.roll||0)},duration:0})):(this.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE=void 0,Cesium.Camera.DEFAULT_VIEW_RECTANGLE=Cesium.Rectangle.fromDegrees(89.5,10.4,110.4,61.2),this.viewer.camera.setView({destination:Cesium.Camera.DEFAULT_VIEW_RECTANGLE}))}},{key:"init",value:function(){var t=this,e=new Cesium.Ellipsoid(6378137,6378137,6356752.314140356),i=new Cesium.GeographicProjection(e),n=this;this.options={imageryProvider:new Cesium.TileMapServiceImageryProvider({url:Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII")}),baseLayerPicker:!1,geocoder:!1,animation:!1,fullscreenButton:!1,navigationHelpButton:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,shouldAnimate:!0,mapProjection:i},Number(Cesium.VERSION.split(".")[1])>=107?this.options.baseLayer=Cesium.ImageryLayer.fromProviderAsync(Cesium.TileMapServiceImageryProvider.fromUrl(Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"))):this.options.imageryProvider=new Cesium.TileMapServiceImageryProvider({url:Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII")}),this.options.contextOptions={webgl:{depth:!0,stencil:!0,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,failIfMajorPerformanceCaveat:!0},requestWebgl2:!0},Cesium.RequestScheduler.maximumRequests=500,this.viewer=new Cesium.Viewer(this.div_id,this.options),this.viewer.scene.imageryLayers._layers[0].notes="default-base-map",this.viewer._shadows=this.viewer.shadows,this.viewer.scene.screenSpaceCameraController.maximumZoomDistance=5e7,this.viewer.scene.globe.translucency.enabled=!0;var o=new fi;this.viewer.scene.skyBox=new Cesium.SkyBox({sources:{negativeX:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_mx.jpg",negativeY:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_my.jpg",negativeZ:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_mz.jpg",positiveX:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_px.jpg",positiveY:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_py.jpg",positiveZ:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_pz.jpg"}}),bi();for(var s=[{name:"思源黑体",value:"SourceHanSansTi",url:o.getSourceRootPath()+"/custom/fonts/SourceHanSansCN-Medium.otf",format:"opentype"},{name:"庞门正道标题体",value:"PMZDBTTi",url:o.getSourceRootPath()+"/custom/fonts/PangMenZhengDaoBiaoTiTi-1.ttf",format:"truetype"},{name:"数黑体",value:"AlimamaShuHeiTi",url:o.getSourceRootPath()+"/custom/fonts/AlimamaShuHeiTi-Bold.ttf",format:"truetype"}],a=0;a=1e3?(i.billboard.scale=1.5,i.label.pixelOffset=new Cesium.Cartesian2(-28,-46)):t.length>=100?(i.billboard.scale=1.25,i.label.pixelOffset=new Cesium.Cartesian2(-21,-40)):t.length>=50?(i.billboard.scale=1.1,i.label.pixelOffset=new Cesium.Cartesian2(-16,-36)):t.length>=40?(i.billboard.scale=1.05,i.label.pixelOffset=new Cesium.Cartesian2(-16,-34)):t.length>=30?(i.billboard.scale=1,i.label.pixelOffset=new Cesium.Cartesian2(-16,-32)):t.length>=20?(i.billboard.scale=.95,i.label.pixelOffset=new Cesium.Cartesian2(-16,-30)):t.length>=10?(i.billboard.scale=.9,i.label.pixelOffset=new Cesium.Cartesian2(-16,-28)):(i.billboard.scale=.8,i.label.pixelOffset=new Cesium.Cartesian2(-11,-25))}));var n=t.clustering.pixelRange;t.clustering.pixelRange=0,t.clustering.pixelRange=n}();var a={pixelRange:15,minimumClusterSize:2};function r(e){Cesium.knockout.getObservable(a,e).subscribe((function(i){t.clustering[e]=i}))}Cesium.knockout.track(a),r("pixelRange"),r("minimumClusterSize")}))}(this.viewer),E(this.viewer);Cesium.viewerCesiumNavigationMixin(this.viewer,{resetTooltip:"重置视图",zoomInTitle:"缩小",zoomOutTitle:"放大"});function l(t){var e=t.indexOf("px");return Number(t.slice(0,e))}setTimeout((function(){var e=document.getElementsByClassName("compass-outer-ring")[0],i=document.getElementsByClassName("navigation-controls")[0];e.addEventListener("mousedown",(function(){ii(t),ni(t)})),i.addEventListener("mousedown",(function(){ii(t),ni(t)}))}),0),this.viewer.imageryLayers.layerAdded.addEventListener((function(){for(var e=0;e-1;i--){var o=l(e[i].style.left),s=l(e[i].style.top),a=1*e[i].clientWidth,r=1*e[i].clientHeight,c=t.position.x,u=t.position.y;if(c>o&&cs&&u1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),this.sdk=e,this.primitives={building:[],unit:[],dth:[]},this.options=Zi({},i),this.options.host=this.options.host||h(),this.temporaryDth=[],this.dth={},this.PickBuildingEvent=new Cesium.Event,this.initEvents(),this.activeBuilding}),[{key:"PickCallback",value:function(t,e){this.PickBuildingEvent.addEventListener(e,t)}},{key:"initEvents",value:function(){var t=this;new Cesium.ScreenSpaceEventHandler(this.sdk.viewer.scene.canvas).setInputAction((function(e){if(!YJ.Measure.GetMeasureStatus()&&t.isActivate){var i=t.sdk.viewer.scene.pick(e.position);if(i){if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&("yj-dth-dth"==i.id.type||"yj-dth-highlight"==i.id.type))return void t.getIDBypickFeature(i);if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&"yj-dth-unit"==i.id.type)return t.highlightPrimitive&&t.sdk.viewer.scene.primitives.remove(t.highlightPrimitive),void t.handlePickEvent(i.id)}t.highlightPrimitive&&t.sdk.viewer.scene.primitives.remove(t.highlightPrimitive);var n=t.sdk.viewer.scene.pickPosition(e.position);if(n){var o=Cesium.Cartographic.fromCartesian(n),s=[Cesium.Math.toDegrees(o.longitude),Cesium.Math.toDegrees(o.latitude)];t.queryByPoint(s,o.height)}}}),Cesium.ScreenSpaceEventType.LEFT_CLICK);var e=this.sdk.viewer.entities.getOrCreateEntity("yj-dth-cover-label");e.show=!1;var i,n=0,o=this;function s(t){var i=o.sdk.viewer.scene.pick(t.endPosition);if(i){var n="";if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&("yj-dth-dth"===i.id.type||"yj-dth-highlight"===i.id.type))n=i.id.build_info.name+" - "+i.id.unit_info.name+" - "+i.id.room_num;else if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&"yj-dth-unit"===i.id.type)i.id.build_info.name&&(n=i.id.build_info.name+" - "+i.id.name);else{if(!(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&"yj-dth-build"===i.id.type))return i.primitive&&i.primitive.id&&i.primitive.id.id&&"yj-dth-cover-label"===i.primitive.id.id?void(e.position=o.sdk.viewer.scene.pickPosition(t.endPosition)):void(e.show=!1);i.id.name&&(n=i.id.name)}n&&(e.position=o.sdk.viewer.scene.pickPosition(t.endPosition),e.label=new Cesium.LabelGraphics({text:n,font:"20px Helvetica",pixelOffset:{x:0,y:-30},fillColor:Cesium.Color.fromCssColorString("#ffffff"),outlineColor:Cesium.Color.BLACK,outlineWidth:1,showBackground:!0,backgroundColor:Cesium.Color.fromCssColorString("#000000").withAlpha(.8),style:Cesium.LabelStyle.FILL_AND_OUTLINE,disableDepthTestDistance:Number.POSITIVE_INFINITY}),e.show=!0)}}new Cesium.ScreenSpaceEventHandler(this.sdk.viewer.scene.canvas).setInputAction((function(t){if(!YJ.Measure.GetMeasureStatus())try{var e=Date.now();if(e-n<100)return clearTimeout(i),void(i=setTimeout((function(){s(t)}),100));clearTimeout(i),n=e,s(t)}catch(t){}}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}},{key:"queryByUserInfo",value:function(t){this.queryByPoint([t.position.lng,t.position.lat],t.position.alt,t.id)}},{key:"queryByPoint",value:(s=o()(a.a.mark((function t(e){var i,n,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="",i=this.options.host.endsWith("yjearth4.0")?this.options.host+"/api/v1/dth/build/query_by_point":this.options.host+"/yjearth4.0/api/v1/dth/build/query_by_point",i+="?point="+JSON.stringify({lng:e[0],lat:e[1]}),t.next=5,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 5:if(200!==(n=t.sent).status){t.next=11;break}return t.next=9,n.json();case 9:200===(o=t.sent).code||0===o.code?this.processQueryByPointResults(o.data):window.ELEMENT&&window.ELEMENT.Message({message:o.msg||o.message,type:"warning",duration:1500});case 11:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"processQueryByPointResults",value:(n=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=p.length>2&&void 0!==p[2]?p[2]:{heading:0,pitch:-90,roll:0},e.build_info&&this.handlePickEvent(e),this.clearAllDthPrimitive(),this.clearAllUnitPrimitive(),this.activeBuilding&&(this.clearBuildingPrimitive(this.activeBuilding),this.activeBuilding=null),!e.build_info){t.next=26;break}if(o=JSON.parse(e.build_info.range),e.dan_yuan.length>0)for(s=0;s0?this.addDthPrimitive(e.dan_yuan[s].children,e.build_info,e.dan_yuan[s]):this.addUnitPrimitive([e.dan_yuan[s]],e.build_info,e.dan_yuan[s]);else this.activeBuilding=e.build_info.ID||e.build_info.id,this.addBuildingPrimitive([e.build_info]);if(!i){t.next=26;break}if(e.info&&e.info.dan_yuan&&(o=JSON.parse(e.info.dan_yuan.range)),!e.info||!e.info.hu){t.next=25;break}for(o=JSON.parse(e.info.hu.range),r=0;r=0;e--)if(t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.ID||t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.id){this.sdk.viewer.scene.primitives.remove(this.primitives.building[e]),this.primitives.building.splice(e,1);break}}},{key:"clearAllBuildingPrimitive",value:function(){for(var t=this.primitives.building.length-1;t>=0;t--)this.sdk.viewer.scene.primitives.remove(this.primitives.building[t]);this.primitives.building=[]}},{key:"addUnitPrimitive",value:(e=o()(a.a.mark((function t(e,i,n){var o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(o=0;o=0;e--)if(t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.ID||t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.id){this.sdk.viewer.scene.primitives.remove(this.primitives.unit[e]),this.primitives.unit.splice(e,1);break}}},{key:"clearAllUnitPrimitive",value:function(){for(var t=this.primitives.unit.length-1;t>=0;t--)this.sdk.viewer.scene.primitives.remove(this.primitives.unit[t]);this.primitives.unit=[]}},{key:"addDthPrimitive",value:function(t,e,i){for(var n=0;n=0;e--)t!==this.primitives.dth[e]._primitiveOptions.geometryInstances[0].id.ID&&t!==this.primitives.dth[e]._primitiveOptions.geometryInstances[0].id.id||(this.sdk.viewer.scene.primitives.remove(this.primitives.dth[e]),this.primitives.dth.splice(e,1))}},{key:"clearAllDthPrimitive",value:function(){this.highlightPrimitive&&this.sdk.viewer.scene.primitives.remove(this.highlightPrimitive);for(var t=this.primitives.dth.length-1;t>=0;t--)this.sdk.viewer.scene.primitives.remove(this.primitives.dth[t]);this.primitives.dth=[]}},{key:"getIDBypickFeature",value:function(t){this.clickHighlightPrimitive&&(this.clickHighlightPrimitive.show=!0),this.highlightPrimitive&&this.sdk.viewer.scene.primitives.remove(this.highlightPrimitive),this.highlightPrimitive=this.sdk.viewer.scene.primitives.add(new Cesium.ClassificationPrimitive({geometryInstances:new Cesium.GeometryInstance({id:Zi(Zi({},t.id),{},{type:"yj-dth-highlight"}),geometry:t.primitive._primitiveOptions.geometryInstances[0].geometry,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("#ff9800").withAlpha(.8)),show:new Cesium.ShowGeometryInstanceAttribute(!0)}}),classificationType:Cesium.ClassificationType.CESIUM_3D_TILE})),this.highlightPrimitive.readyPromise.then((function(){t.primitive.show=!1})),this.clickHighlightPrimitive=t.primitive;var e=t.id.range;"string"==typeof t.id.range&&(e=JSON.parse(t.id.range)),this.getHilightArea(e),this.handlePickEvent(t.id)}},{key:"handlePickEvent",value:function(t){this.PickBuildingEvent.raiseEvent(t)}},{key:"getHilightArea",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=[];t.forEach((function(t){i.push([t.lng,t.lat])})),i.push(i[0]);var n=turf.polygon([i]),o=turf.buffer(n,Number(e)/1e3);return o.geometry.coordinates}},{key:"flyTo",value:(t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=u.length>1&&void 0!==u[1]?u[1]:{heading:0,pitch:-90,roll:0},n=new YJ.Tools(this.sdk),o=0,s=[],r=0;case 5:if(!(r更新高程',s.style.width="auto",s.addEventListener("click",(function(){p.options.updateHeightCallBack()})),o.appendChild(s)),this.options.secondaryEditCallBack&&((r=document.createElement("button")).className="secondaryEdit",r.innerHTML='二次编辑',this.options.updateHeightCallBack&&(r.style.marginLeft="10px"),o.appendChild(r),r.addEventListener("click",(function(){p.options.secondaryEditCallBack&&p.options.secondaryEditCallBack()}))),this.options.translationalCallBack&&((l=document.createElement("button")).className="translational",l.innerHTML='平移',(this.options.updateHeightCallBack||this.options.secondaryEditCallBack)&&(l.style.marginLeft="10px"),o.appendChild(l),l.addEventListener("click",(function(){p.options.translationalCallBack&&p.options.translationalCallBack()})))),this.options.addFootElm)for(c=0;c=0;i--)for(var n in this.info.attribute)if(e[i].value===n){this.info.attribute[n].disabled&&(e[i].disabled=!0);break}}}]);var i}(W);function ln(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function cn(t){for(var e=1;e=3?(h.width=r.width/l*2,h.height=r.height/l*2,d.drawImage(r,0,0,h.width,h.height),p.src=h.toDataURL("image/jpeg",.95)):p.src=s}else p.src=s;p.onload=function(){if(!m){var o=cn({},y),s=JSON.parse(JSON.stringify(C)),r=cn({},w),l=cn({},b);l.width=b.width/j.width*p.width;var h=v/j.width*p.width,d=h;if(l.show&&f&&f.complete&&(d+=l.width),a.width=p.width+2*d,a.height=p.height+2*d,u.clearRect(0,0,a.width,a.height),u.rect(0,0,a.width,a.height),u.fillStyle="#ffffff",u.fill(),u.drawImage(p,d,d,p.width,p.height),o.show){var g=o.text,k=Math.max(5,o.height*p.height*.5);u.font="".concat(k,"px serif"),u.fillStyle=o.bgColor||"#5d5d5d",u.fillRect(d,d,a.width-2*d,o.height*p.height),u.fillStyle=o.color||"white",u.textAlign="center",u.textBaseline="middle",u.fillText(g,a.width/2,o.height*p.height/2+d)}for(var x=function(t){if(s[t].show)if("text"in s[t])u.font="".concat(p.height*s[t].height,"px serif"),u.fillStyle=s[t].color||"white",u.textAlign="left",u.textBaseline="bottom",s[t].width=u.measureText(s[t].text).width/p.height,u.fillText(s[t].text,p.width*s[t].x+d,p.height*s[t].y+d);else if("url"in s[t])if(C[t].svg&&C[t].svg.complete)u.drawImage(C[t].svg,p.width*s[t].x+d,p.height*s[t].y+d,p.height*s[t].width,p.height*s[t].height);else{var e=new Image;e.src=un.getSourceRootPath()+s[t].url,e.onload=function(){s[t].svg=e,u.drawImage(e,p.width*s[t].x+d,p.height*s[t].y+d,p.height*s[t].width,p.height*s[t].height)}}},_=0;_=1e3&&(D="㎞",O=Math.round(O/1e3));var B=S;u.beginPath(),u.moveTo(E,B),u.lineTo(E+r.width,B),u.strokeStyle=r.color,u.lineWidth=.01*r.width,u.stroke();for(var L=0,A=0;A<=r.cell;A++)L=E+A*M,u.beginPath(),u.moveTo(L,B-.1*r.width),u.lineTo(L,B),u.strokeStyle=r.color,u.lineWidth=.01*r.width,u.stroke(),u.font="".concat(P,"px Arial"),u.fillStyle=r.color,u.textAlign="center",u.textBaseline="bottom",u.fillText(A*O,L,B-.1*r.width);u.font="".concat(P,"px Arial"),u.fillStyle=r.color,u.textAlign="left",u.textBaseline="bottom",u.fillText(D,L+1.2*P,B-.1*r.width)}if(l.show&&f&&f.complete&&(R(u,f,h,h,l.width,"top",1),R(u,f,a.width-l.width-h,h,l.width,"right",1),R(u,f,a.width-l.width-h,a.height-l.width-h,l.width,"bottom",1),R(u,f,h,a.height-l.width-h,l.width,"left",1)),"export"===t){var I=i.contentWindow;I&&"function"==typeof I.print?(I.addEventListener("afterprint",(function(){document.body.removeChild(i)})),I.print()):console.error("打印失败,请手动保存截图")}else a.toBlob((function(t){var e=URL.createObjectURL(t),i=document.createElement("a");i.href=e,i.download="高清出图-".concat(Ct(),".png"),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(e)}),"image/png",.95);c=!1,W.innerHTML="打印",J.innerHTML="保存"}function R(t,e,i,n,o,s){var r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;switch(t.save(),t.translate(i+o/2,n+o/2),s){case"right":t.rotate(Math.PI/2);break;case"bottom":t.rotate(Math.PI);break;case"left":t.rotate(3*Math.PI/2)}t.beginPath(),t.moveTo(-o*r/2,-o/2),"top"===s||"bottom"===s?(t.lineTo(a.width-2*h-o/2,-o/2),t.lineTo(a.width-2*(h+o)+o/2,o/2)):(t.lineTo(a.height-2*h-o/2,-o/2),t.lineTo(a.height-2*(h+o)+o/2,o/2)),t.lineTo(o*r/2,o/2),t.closePath(),t.clip();var c,u=e.width/e.height*o;t.drawImage(e,-o/2,-o/2,u,o),c="top"===s||"bottom"===s?Math.ceil((a.width-2*h-2*l.width)/l.width):Math.ceil((a.height-2*h-2*l.width)/l.width),c++;for(var p=1;p<=c;p++)t.drawImage(e,-o/2+u*p,-o/2,u,o);t.restore()}}},Ct=function(){var t=new Date,e=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0"),r=String(t.getMilliseconds()).padStart(3,"0");return"".concat(e).concat(i).concat(n).concat(o).concat(s).concat(a).concat(r)},bt=function(){if(n){var t=Cesium.Math.toDegrees(n.west),e=Cesium.Math.toDegrees(n.east),i=Cesium.Math.toDegrees(n.north),o=(Cesium.Math.toDegrees(n.south),turf.point([t,i])),s=turf.point([e,i]),a=turf.distance(o,s,{units:"kilometers"});d=1e3*a/j.width}},yt=function(t){var e=v;b.show&&f&&f.complete&&(e+=b.width);var i=.005*L.height;if(A.strokeStyle="red",A.lineWidth=.002*L.height,"text"in t)A.strokeRect(j.width*t.x+e,j.height*t.y+e-j.height*t.height,j.height*t.width,j.height*t.height);else if("url"in t)A.strokeRect(j.width*t.x+e,j.height*t.y+e,j.height*t.width,j.height*t.height);else if(t===w)return void A.strokeRect(j.width*t.x+e-.2*w.width,j.height*t.y+e-t.height-.5*w.height,t.width+.6*w.width,t.height+w.height);var n=ft(t,e);A.fillStyle="red",n.forEach((function(t){A.beginPath(),A.arc(t.x,t.y,i,0,2*Math.PI),A.fill()}))},gt=function(t,e,i,n,o,s){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;switch(t.save(),t.translate(i+o/2,n+o/2),s){case"right":t.rotate(Math.PI/2);break;case"bottom":t.rotate(Math.PI);break;case"left":t.rotate(3*Math.PI/2)}t.beginPath(),t.moveTo(-o*a/2,-o/2),"top"===s||"bottom"===s?(t.lineTo(L.width-2*v-o/2,-o/2),t.lineTo(L.width-2*(v+o)+o/2,o/2)):(t.lineTo(L.height-2*v-o/2,-o/2),t.lineTo(L.height-2*(v+o)+o/2,o/2)),t.lineTo(o*a/2,o/2),t.closePath(),t.clip();var r,l=e.width/e.height*o;t.drawImage(e,-o/2,-o/2,l,o),r="top"===s||"bottom"===s?Math.ceil((L.width-2*v-2*b.width)/b.width):Math.ceil((L.height-2*v-2*b.width)/b.width),r++;for(var c=1;c<=r;c++)t.drawImage(e,-o/2+l*c,-o/2,l,o);t.restore()},vt=function(){if(!m){var t=v;if(b.show&&f&&f.complete&&(t+=b.width),L.width=j.width+2*t,L.height=j.height+2*t,A.clearRect(0,0,L.width,L.height),A.rect(0,0,L.width,L.height),A.fillStyle="#ffffff",A.fill(),A.drawImage(j,t,t,j.width,j.height),y.show){var e=y.text,i=Math.max(5,y.height*j.height*.5);A.font="".concat(i,"px serif"),A.fillStyle=y.bgColor||"#5d5d5d",A.fillRect(t,t,L.width-2*t,y.height*j.height),A.fillStyle=y.color||"white",A.textAlign="center",A.textBaseline="middle",A.fillText(e,L.width/2,y.height*j.height/2+t)}for(var n=function(e){if(C[e].show)if("text"in C[e])A.font="".concat(j.height*C[e].height,"px serif"),A.fillStyle=C[e].color||"white",A.textAlign="left",A.textBaseline="bottom",C[e].width=A.measureText(C[e].text).width/j.height,A.fillText(C[e].text,j.width*C[e].x+t,j.height*C[e].y+t),C[e].isSelected&&yt(C[e]);else if("url"in C[e])if(C[e].svg&&C[e].svg.complete)A.drawImage(C[e].svg,j.width*C[e].x+t,j.height*C[e].y+t,j.height*C[e].width,j.height*C[e].height),C[e].isSelected&&yt(C[e]);else{var i=new Image;i.src=un.getSourceRootPath()+C[e].url,i.onload=function(){C[e].svg=i,A.drawImage(i,j.width*C[e].x+t,j.height*C[e].y+t,j.height*C[e].width,j.height*C[e].height),C[e].isSelected&&yt(C[e])}}},o=0;o=1e3&&(l="㎞",p=Math.round(p/1e3));var k=r;A.beginPath(),A.moveTo(a,k),A.lineTo(a+w.width,k),A.strokeStyle=w.color,A.lineWidth=.01*w.width,A.stroke();for(var x=0,_=0;_<=w.cell;_++)x=a+_*u,A.beginPath(),A.moveTo(x,k-.1*w.width),A.lineTo(x,k),A.strokeStyle=w.color,A.lineWidth=.01*w.width,A.stroke(),A.font="".concat(c,"px Arial"),A.fillStyle=w.color,A.textAlign="center",A.textBaseline="bottom",A.fillText(_*p,x,k-.1*w.width);A.font="".concat(c,"px Arial"),A.fillStyle=w.color,A.textAlign="left",A.textBaseline="bottom",A.fillText(l,x+1.2*c,k-.1*w.width),w.isSelected&&yt(w)}b.show&&f&&f.complete&&(gt(A,f,v,v,b.width,"top",1),gt(A,f,L.width-b.width-v,v,b.width,"right",1),gt(A,f,L.width-b.width-v,L.height-b.width-v,b.width,"bottom",1),gt(A,f,v,L.height-b.width-v,b.width,"left",1))}},ft=function(t,e){var i=t.x*j.width+e,n=t.y*j.height+e,o=t.width*j.height,s=t.height*j.height;return"text"in t?[{x:i,y:n-s},{x:i+o,y:n-s},{x:i,y:n},{x:i+o,y:n}]:[{x:i,y:n},{x:i+o,y:n},{x:i,y:n+s},{x:i+o,y:n+s}]},mt=function(t){var e,i=L.getBoundingClientRect(),n=i.width,o=i.height,s=L.width,a=L.height,r=(n-s*(e=s/a>n/o?n/s:o/a))/2;return(t.clientX-i.left-r)/e},dt=function(t){var e,i=L.getBoundingClientRect(),n=i.width,o=i.height,s=L.width,a=L.height,r=(e=s/a>n/o?n/s:o/a,(o-a*e)/2);return(t.clientY-i.top-r)/e},K=function(t){var e,i;if(b.color=t||"#000000",new YJColorPicker({el:x.getElementsByClassName("border-color")[0],size:"mini",alpha:!1,defaultColor:b.color,disabled:!1,openPickerAni:"opacity",sure:function(t){K(t)},clear:function(){K("rgba(0,0,0,1)")}}),t){e=g.replace(/fill="[^"]+"/g,'fill="'.concat(t,'"'))}else e=g;i="data:image/svg+xml;base64,"+btoa(Array.from((new TextEncoder).encode(e),(function(t){return String.fromCharCode(t)})).join("")),(f=new Image).setAttribute("crossOrigin","anonymous"),f.src=i,f.onload=function(){b.show&&vt()}},Z=function(t){b.url=t,b.url&&((f=new Image).setAttribute("crossOrigin","anonymous"),b.url.endsWith("svg")?fetch(un.getSourceRootPath()+b.url).then(function(){var t=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.ok){t.next=5;break}return t.next=3,e.text();case 3:g=t.sent,K(b.color);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()):(f.src=un.getSourceRootPath()+b.url,f.onload=function(){b.show&&vt()}))},X=function(t){h=t,u=[{name:"模板一",value:"模板一",id:"1",margin:.03,title:{text:"标题一",height:.05,bgColor:"#5d5d5d",color:"#ffffff",show:!0},border:{show:!1,url:"/custom/img/map-border1.svg",width:.01,color:""},plottingScale:{cell:2,color:"#ffffff",show:!0,isSelected:!1,x:.87,y:.97},data:[{text:"",x:.02,y:.93,isSelected:!1,show:!0,color:"#ffffff",height:.03},{text:"",x:.02,y:.97,isSelected:!1,show:!0,color:"#ffffff",height:.03},{x:.02,y:.1,show:!1,isSelected:!1,url:"/custom/img/icon-compass1.svg",width:.1,height:.1}]},{name:"模板二",value:"模板二",id:"2",margin:.03,border:{show:!0,url:"/custom/img/map-border2.svg",width:.01},title:{text:"标题二",height:.05,bgColor:"#5d5d5d",color:"#ffffff",show:!0},plottingScale:{cell:2,color:"#ffffff",show:!0,isSelected:!1,x:.02,y:.97},data:[{text:"",x:.88,y:.93,isSelected:!1,show:!0,color:"#ffffff",height:.03},{text:"",x:.87,y:.97,isSelected:!1,show:!0,color:"#ffffff",height:.03},{x:.91,y:.1,show:!0,isSelected:!1,url:"/custom/img/icon-compass4.svg",width:.1,height:.1}]}];for(var e=0;e\n
\n
图件信息
\n
\n
\n 模板\n
\n
\n
\n
\n
\n 标题\n \n \n
\n
\n
\n
\n 制图日期\n \n \n
\n
\n
\n
\n 制图单位\n \n \n
\n
\n
\n
\n 图框\n
\n
\n \n
\n
\n
\n
\n
地图要素
\n
\n
\n 指北针\n \n
\n
\n '.concat(function(){for(var t="",e=0;e\n \n \n
')}return t}(),'\n
\n
\n
\n
\n
\n
\n 比例尺\n \n
\n
\n \n \n
\n
\n\n
\n
\n '),p.contentAppChild(x),_=x.getElementsByClassName("left")[0],E=x.getElementsByClassName("right")[0],S=_.getElementsByClassName("title-input")[0],D=_.getElementsByClassName("title-checkbox")[0],P=_.getElementsByClassName("unit-input")[0],M=_.getElementsByClassName("unit-checkbox")[0],O=_.getElementsByClassName("compass-checkbox")[0],T=_.getElementsByClassName("compass-radio"),N=_.getElementsByClassName("plotting-scale-checkbox")[0],B=_.getElementsByClassName("map-border-checkbox")[0],L=document.createElement("canvas"),A=L.getContext("2d"),E.appendChild(L),(j=new Image).src=i,j.onload=function(){m=!1,bt(),X(h)},S.value=y.text,D.checked=y.show,S.addEventListener("input",(function(){y.text=this.value,j.complete&&vt()})),D.addEventListener("change",(function(){y.show=this.checked,j.complete&&vt()})),P.value=C[1].text,M.checked=C[1].show,P.addEventListener("input",(function(){C[1].text=this.value,j&&j.complete&&vt()})),M.addEventListener("change",(function(){C[1].show=this.checked,j&&j.complete&&vt()})),O.checked=C[2].show,O.addEventListener("change",(function(){C[2].show=this.checked,j&&j.complete&&vt()})),I=a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:T[e].addEventListener("change",(function(){this.checked&&(C[2].svg=null,C[2].url=k[e],j&&j.complete&&vt())}));case 1:case"end":return t.stop()}}),t)})),R=0;case 59:if(!(R打印',J.innerHTML='保存',wt("export"))})),J.addEventListener("click",(function(){c||(c=!0,W.innerHTML='打印',J.innerHTML='保存',wt("save"))}));var t=x.getElementsByClassName("print-date")[0];(z=x.getElementsByClassName("print-date-checkbox")[0]).checked=C[0].show,z.addEventListener("change",(function(){C[0].show=this.checked,j.complete&&vt()})),F=jeDate(t,{format:"YYYY-MM-DD",isinitVal:!0,isClear:!1,donefun:function(t){C[0].text=t.val,j.complete&&vt()}}),C[0].text?F.setValue(C[0].text):(F.nowBtn&&F.nowBtn(),C[0].text=F.getValue(),vt());var e=Y(p._element.content.getElementsByClassName("template-box")[0],".template");if(e){e.legp_search(u);for(var i=p._element.content.getElementsByClassName("template")[0].getElementsByTagName("input")[0],n=0;n'),value:"/custom/img/map-border1.svg",key:0},{name:''),value:"/custom/img/map-border2.svg",key:1},{name:''),value:"/custom/img/map-border3.svg",key:2},{name:''),value:"/custom/img/map-border4.svg",key:3},{name:''),value:"/custom/img/map-border5.svg",key:4},{name:''),value:"/custom/img/map-border6.svg",key:5}];if(V=Y(p._element.content.getElementsByClassName("map-border-box")[0],".map-border")){V.legp_search(o),(G=document.createElement("span")).className="icon icon-active",G.style.width="calc(100% - 40px)",G.style.height="calc(100% - 12px)",G.style.position="absolute",G.style.top="6px",G.style.left="10px",G.style.pointerEvents="none",G.style.backgroundImage="url(".concat(un.getSourceRootPath()+b.url,")"),G.style.backgroundSize="auto 100%",G.style.backgroundRepeat="repeat-x",p._element.content.getElementsByClassName("map-border")[0].getElementsByClassName("cy_datalist")[0].appendChild(G),(H=p._element.content.getElementsByClassName("map-border")[0].getElementsByTagName("input")[0]).style.fontSize=0,H.style.color="transparent";for(var s=0;s=y.height*j.height+n-Q&&i<=y.height*j.height+n+Q){$=!0;for(var o=0;o=t.x-s&&e<=t.x+s&&i>=t.y-s&&i<=t.y+s&&(it=!0,et=!1,nt=n,ot=e,st=i,ut=tt.width*j.height,pt=tt.height*j.height,"text"in tt&&(ut=tt.width*j.height,ht=tt.height))}))}if(!it){for(var a=0;a=0;r--)if(C[r].show){if("text"in C[r]&&e>=j.width*C[r].x+n&&e<=j.width*C[r].x+n+j.height*C[r].width&&i>=j.height*C[r].y+n-j.height*C[r].height&&i<=j.height*C[r].y+n){tt=C[r],C[r].isSelected=!0,et=!0,ot=e,st=i,at=j.height*C[r].y-j.height*C[r].height,rt=j.width*C[r].x+j.height*C[r].width,lt=j.width*C[r].x+n,ct=j.height*C[r].y+n,vt();break}if("url"in C[r]&&C[r].svg&&C[r].svg.complete&&C[r].show&&e>=j.width*C[r].x+n&&e<=j.width*C[r].x+n+j.height*C[r].width&&i>=j.height*C[r].y+n&&i<=j.height*C[r].y+n+j.height*C[r].height){tt=C[r],C[r].isSelected=!0,et=!0,ot=e,st=i,at=j.height*C[r].y+j.height*C[r].height,rt=j.width*C[r].x+j.height*C[r].width,lt=j.width*C[r].x+n,ct=j.height*C[r].y+n,vt();break}}w.show&&e>=j.width*w.x+n-.2*w.width&&e<=j.width*w.x+n-.2*w.width+w.width+.6*w.width&&i>=j.height*w.y+n-w.height-.5*w.height&&i<=j.height*w.y+n-.5*w.height+w.height&&(tt=w,w.isSelected=!0,et=!0,ot=e,st=i,at=j.height*w.y+n+w.height,rt=j.width*w.x+n+w.width,lt=j.width*w.x+n,ct=j.height*w.y+n,vt()),tt||vt()}})),L.addEventListener("mousemove",(function(t){var e=v;b.show&&f&&f.complete&&(e+=b.width);var i=mt(t),n=dt(t);if(!(i<0||n<0||i>L.width||n>L.height)){if(y.show){var o=v;b.show&&f&&f.complete&&(o+=b.width),n>=y.height*j.height+o-Q&&n<=y.height*j.height+o+Q?L.style.cursor="n-resize":L.style.cursor="default",$&&(y.height=Math.min(Math.max(n-o,30)/j.height,1),vt())}if(et){var s=i-ot,a=n-st;tt.x=(lt+s-e)/j.width,tt.y=(ct+a-e)/j.height,vt()}if(it){var r,l=i-ot,c=n-st;switch(nt){case 0:"text"in tt?(r=(ut-l)/ut,tt.height=Math.max(10/j.height,ht*r),tt.x=(rt-tt.width*j.height)/j.width):"url"in tt&&(tt.x=(rt-tt.width*j.height)/j.width,tt.y=(at-tt.height*j.height)/j.height,tt.width=Math.max(10,ut-l)/j.height,tt.height=Math.max(10,pt-c)/j.height);break;case 1:"text"in tt?(r=(ut+l)/ut,tt.height=Math.max(10/j.height,ht*r)):"url"in tt&&(tt.width=Math.max(10,ut+l)/j.height,tt.height=Math.max(10,pt-c)/j.height,tt.y=(at-tt.height*j.height)/j.height);break;case 2:"text"in tt?(r=(ut-l)/ut,tt.height=Math.max(10/j.height,ht*r),tt.x=(rt-tt.width*j.height)/j.width,tt.y=(at+tt.height*j.height)/j.height):"url"in tt&&(tt.x=(rt-tt.width*j.height)/j.width,tt.width=Math.max(10,ut-l)/j.height,tt.height=Math.max(10,pt+c)/j.height);break;case 3:"text"in tt?(r=(ut+l)/ut,tt.height=Math.max(10/j.height,ht*r),tt.y=(at+tt.height*j.height)/j.height):"url"in tt&&(tt.width=Math.max(10,ut+l)/j.height,tt.height=Math.max(10,pt+c)/j.height)}vt()}}})),document.addEventListener("mouseup",(function(){$=!1;b.show&&f&&f.complete&&b.width;for(var t=0;t1&&void 0!==o[1]?o[1]:function(){},n=e.viewer.canvas.toDataURL(),i&&i(n);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function fn(){return(fn=o()(a.a.mark((function t(e){var i,n,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,x,E,S,D=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(v=function(){setTimeout((function(){f.getElementsByClassName("canvas-width-span")[0].innerHTML=e.viewer.canvas.width,f.getElementsByClassName("canvas-height-span")[0].innerHTML=e.viewer.canvas.height,f.getElementsByClassName("output-width")[0].innerHTML=e.viewer.canvas.width*r,f.getElementsByClassName("output-height")[0].innerHTML=e.viewer.canvas.height*r}),500)},D.length>1&&void 0!==D[1]?D[1]:{},D.length>2&&void 0!==D[2]?D[2]:function(){},e){t.next=5;break}return t.abrupt("return");case 5:return qt(),Ee(e),dn&&(dn.close(),dn=null),i=e.viewer.scene.screenSpaceCameraController.enableTranslate,n=e.viewer.scene.screenSpaceCameraController.enableTilt,s=e.viewer.scene.screenSpaceCameraController.enableLook,r=1,m=new fi,t.next=15,new rn(e,{},{title:"高清出图",left:"180px",top:"100px",confirmCallBack:function(t){d&&(d.desist(),d=null),c&&(c.style.width="0%"),p&&(p.style.left="0%"),u&&(u.style.width="0%"),h&&(h.innerHTML="0%"),d=new S},closeCallBack:function(){e.viewer.scene.screenSpaceCameraController.enableTranslate=i,e.viewer.scene.screenSpaceCameraController.enableTilt=n,e.viewer.scene.screenSpaceCameraController.enableLook=s,e.viewer._element.getElementsByClassName("compass")[0].style.pointerEvents="auto",d&&(d.desist(),d=null),window.removeEventListener("resize",v),dn=void 0}});case 15:for((dn=t.sent)._element.body.className=dn._element.body.className+" screenShotHD",(f=document.createElement("div")).innerHTML='\n \n
\n
\n
\n 当前窗口长宽:'.concat(e.viewer.canvas.width,'*').concat(e.viewer.canvas.height,'像素\n
\n
\n
\n
\n 图片大小\n
\n 倍窗口\n
\n
\n
\n
\n 输出图片长宽:').concat(e.viewer.canvas.width*r,'*').concat(e.viewer.canvas.height*r,'像素\n
\n
\n
\n
\n 输出进度\n
\n
\n
\n
\n
\n
\n
\n 0%\n 100%\n
0%
\n
\n \n
\n
\n
\n
\n \n '),dn.contentAppChild(f),e.viewer.scene.screenSpaceCameraController.enableTranslate=!1,e.viewer.scene.screenSpaceCameraController.enableTilt=!1,e.viewer.scene.screenSpaceCameraController.enableLook=!1,e.viewer._element.getElementsByClassName("compass")[0].style.pointerEvents="none",window.addEventListener("resize",v),(g=e.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(e.viewer.canvas.clientWidth/2,e.viewer.canvas.clientHeight/2)))||(g=e.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(e.viewer.canvas.clientWidth/2,e.viewer.canvas.clientHeight/(2-(90+e.viewer.camera.pitch/(Cesium.Math.PI/180))/110))))||(g=e.viewer.camera.position),y=m.cartesian3Towgs84(e.viewer.camera.position,e.viewer).alt,b=m.cartesian3Towgs84(g,e.viewer),e.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(b.lng,b.lat,y),orientation:{heading:0,pitch:Cesium.Math.toRadians(-90),roll:0},duration:1}),C=[],w=1;w<=10;w++)C.push({name:w,value:w});c=document.getElementsByClassName("progress-input")[0],u=document.getElementsByClassName("range-process")[0],p=f.getElementsByClassName("range-node-active")[0],h=f.getElementsByClassName("range-node-active-text")[0],(x=Y(dn._element.content.getElementsByClassName("scale-box")[0],".scale"))&&(x.legp_search(C),E=dn._element.content.getElementsByClassName("scale")[0].getElementsByTagName("input")[0],r=C[0].value,x.legp_searchActive(C[0].value),E.value=C[0].value,E.addEventListener("input",(function(){for(var t=0;tg.maximumLevel&&(f=g.maximumLevel),f=y;J--)for(var q=x;q>=m;q--)Y.push({x:q,y:J});var X={count:0},Z=0,K=-1,$={count:0},Q=0;function tt(){$.count=0,Q=0;for(var t=30*++K;t<30*(K+1);t++){if(t>=Y.length)return;et(t)}}function et(t){if(c.state)try{var e=Y[t].x;e<0&&(e+=d);var i,n=new Image;n.setAttribute("crossOrigin","anonymous"),n.onload=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:P.drawImage(n,256*(Y[t].x-m)-parseFloat(H.toFixed(0)),256*(Y[t].y-y)-parseFloat(V.toFixed(0)),256,256),v++,X.count++,$.count++;case 4:case"end":return e.stop()}}),e)}))),n.onerror=function(){v++,X.count++,$.count++},i=-1!==g.url.indexOf("{x}")&&-1!==g.url.indexOf("{y}")&&-1!==g.url.indexOf("{z}")?g.url.replace(/\{x\}/g,e).replace(/\{y\}/g,Y[t].y).replace(/\{z\}/g,f):-1!==g.url.indexOf("{TileMatrix}")&&-1!==g.url.indexOf("{TileRow}")&&-1!==g.url.indexOf("{TileCol}")?g.url.replace(/\{TileCol\}/g,e).replace(/\{TileRow\}/g,Y[t].y).replace(/\{TileMatrix\}/g,f):g._layer&&g._style&&g._tileMatrixSetID&&g._format?g.url+"&tilematrix=".concat(f,"&layer=").concat(g._layer,"&style=").concat(g._style,"&tilerow=").concat(W,"&tilecol=").concat(e,"&tilematrixset=").concat(g._tileMatrixSetID,"&format=").concat(g._format):g.url+"tile/".concat(f,"/").concat(Y[t].y,"/").concat(e),n.src=i}catch(t){v++,X.count++,$.count++}}Object.defineProperty($,"count",{get:function(){return Q},set:function(t){(Q=t)>=30&&tt()}}),Object.defineProperty(X,"count",{get:function(){return Z},set:function(o){Z=o,C[i].value=v/S*E;var s=0;for(var a in C)s+=C[a].value;if(u.style.width=.99*s+"%",p.style.left=.99*s+"%",h.innerHTML=Math.floor(.99*s*100)/100+"%",Z===(x-m+1)*(_-y+1)){var l=D.getContext("2d"),d=D.cloneNode(!0),f=d.getContext("2d"),g=l.getImageData(0,0,D.width,D.height);if(f.putImageData(g,0,0),D.width=e.viewer.canvas.width*r,D.height=e.viewer.canvas.height*r,l.drawImage(d,0,0,D.width,D.height),n){if(n.getContext("2d").drawImage(D,0,0),k!=w){var P=i+=1;return void t(P,n)}var M=n.toDataURL("image/jpeg",.95),O=document.createElement("canvas"),T=O.getContext("2d");O.width=n.width/r,O.height=n.height/r,T.drawImage(n,0,0,O.width,O.height),hn(e,O.toDataURL("image/jpeg",.95),b,M),u.style.width="100%",p.style.left="100%",h.innerHTML="100%",c.state=!1}else{if(k!=w){var N=i+=1;return void t(N,D)}var B=D.toDataURL("image/jpeg",.95),L=document.createElement("canvas"),A=L.getContext("2d");L.width=D.width/r,L.height=D.height/r,A.drawImage(D,0,0,L.width,L.height),hn(e,L.toDataURL("image/jpeg",.95),b,B),u.style.width="100%",p.style.left="100%",h.innerHTML="100%",c.state=!1}}}}),g._readyError?X.count=(x-m+1)*(_-y+1):tt()}if(g._readyError)return C[i]={value:E},void x();g.readyPromise.then((function(){x()})).catch((function(t){g._readyError=!0,C[i]={value:E},x()}))}(0)}},{key:"desist",value:function(){this.state=!1}}])}();case 39:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var vn=i(13),gn=i.n(vn);function yn(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return bn(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?bn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function bn(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);iNumber(t.target.max)&&(e=Number(t.target.max)),t.target.min&&eNumber(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i0&&e[o].addEventListener(t,(function(e){for(var i=0;i\n
'+s[c].getAttribute("label")+"
\n \n ",r=r+'
'+s[c].innerHTML+"
",l++}}a+="",r+="";var m=document.createElement("div");"string"==typeof e&&m.setAttribute("id",e),m.setAttribute("class","DIV-cy-tabs"),m.innerHTML=a+r,o.parentNode.insertBefore(m,o),o.parentNode.removeChild(o);for(var f=m.getElementsByClassName("DIV-cy-tab-pane-title-p"),v=0;v1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=this;this.title=i,this.objectId=t,document.body.getElementsByClassName("richText-box")[0]&&document.body.removeChild(this.richTextBox),this.editor=null;var r='\n
\n
\n
\n

'.concat(i,'

\n \n
\n
\n
\n \n
\n ');this.richTextBox.innerHTML=r,document.body.appendChild(this.richTextBox);var l=window.wangEditor,c=l.createEditor,u=l.createToolbar,p={placeholder:"请输入正文...",MENU_CONF:{uploadImage:{fieldName:"file",server:this.uploadImageServer,customUpload:function(t,e){return o()(a.a.mark((function i(){var n;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,s.upload(t);case 2:n=i.sent,e((s.host=s.host||h())+"/"+n);case 4:case"end":return i.stop()}}),i)})))()}},uploadVideo:{server:this.uploadVideoServer,allowedFileTypes:["video/mp4","video/mp3","video/ogg","video/webm","video/avi"],customUpload:function(t,e){return o()(a.a.mark((function i(){var n;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,s.upload(t);case 2:n=i.sent,e((s.host=s.host||h())+"/"+n);case 4:case"end":return i.stop()}}),i)})))()}}},onChange:function(t){t.getHtml()}};this.editor=c({selector:"#editor-container",html:"


",config:p,mode:"default"});var d={excludeKeys:["emotion","insertImage","insertVideo"]};u({editor:this.editor,selector:"#toolbar-container",config:d,mode:"default"});this.editor.on("fullScreen",(function(){console.log("fullScreen")})),this.editor.setHtml(n);var m=this.richTextBox.getElementsByClassName("close")[0],f=this.richTextBox.getElementsByClassName("primary")[0],v=this.richTextBox.getElementsByClassName("cancel")[0];m.addEventListener("click",(function(){e.close()})),f.addEventListener("click",(function(){var t=e.editor.getHtml();e.primaryCallBack(t),e.close()})),v.addEventListener("click",(function(){e.close()}))}},{key:"close",value:function(){document.body.getElementsByClassName("richText-box")[0]&&document.body.removeChild(this.richTextBox),this.editor=null}},{key:"upload",value:(t=o()(a.a.mark((function t(e){var i,n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="",this.host=this.host||h(),i=this.host.endsWith("yjearth4.0")?this.host+"/api/v1/richText/upload":this.host+"/yjearth4.0/api/v1/richText/upload",(n=new FormData).append("file",e),t.next=7,fetch(i,{method:"post",body:n,headers:{token:m(),Authorization:"Bearer "+m()}});case 7:if(200!==(o=t.sent).status){t.next=14;break}return t.next=11,o.json();case 11:if(200!==(s=t.sent).code&&0!==s.code){t.next=14;break}return t.abrupt("return",s.data.url);case 14:case"end":return t.stop()}}),t,this)}))),function(e){return t.apply(this,arguments)})},{key:"customUploadVideo",get:function(){return En(Dn,this)},set:function(t){_n(Dn,this,t)}},{key:"customUploadContent",get:function(){return En(Pn,this)},set:function(t){_n(Pn,this,t)}},{key:"primaryCallBack",get:function(){return En(Mn,this)},set:function(t){_n(Mn,this,t)}}]);var t}());function Tn(t,e,i,n,o){var s=Math.ceil(e/i)||1;!function i(){var a,r="
  • 1
  • ",l="
  • ").concat(s,"
  • "),c="
  • ...
  • ",u="
  • ...
  • ",p="
    共 ".concat(e," 条
    ");if(a="
  • ",s<=6)for(var h=1;h<=s;h++)a+="
  • ").concat(h,"
  • ");else if(n<=4){for(var d=1;d<=5;d++)a+="
  • ").concat(d,"
  • ");a+=u,a+=l}else if(n>s-3){a+=r,a+=c;for(var m=s-4;m<=s;m++)a+="
  • ").concat(m,"
  • ")}else{a+=r,a+=c;for(var f=n-1;f<=n+1;f++)a+="
  • ").concat(f,"
  • ");a+=u,a+=l}a+="
  • ",a+=p,t.innerHTML=a,t.querySelector("li[pagenumber='"+n+"']").classList.add("active"),t.querySelectorAll("li[pagenumber]").forEach((function(e){e.onclick=function(){n=Number(this.innerHTML),t.querySelector("li[pagenumber='"+n+"']").classList.add("active"),a="",i(),o&&o(n)}})),t.getElementsByClassName("btnPrev")[0].addEventListener("click",(function(){n>1&&(n--,a="",i(),o&&o(n))})),t.getElementsByClassName("btnNext")[0].addEventListener("click",(function(){n10&&(n-=10,a="",i(),o&&o(n))})));var g=t.getElementsByClassName("btnGoRight")[0];g&&(g.addEventListener("mouseenter",(function(){this.innerHTML=">"})),g.addEventListener("mouseleave",(function(){this.innerHTML="..."})),g.addEventListener("click",(function(){n0){Tn(o,e.data.total,5,1,(function(e){t.cameraSelect(e)})),s.getElementsByClassName("table-empty")[0].style.display="none",r.style.display="inline-flex";for(var l=[],c=function(n){var o='\n
    \n
    \n \n 绑定\n
    \n
    ').concat(e.data.list[n].cameraName,'
    \n
    ').concat(i[e.data.list[n].type],'
    \n
    ').concat(e.data.list[n].ip,'
    \n
    ').concat(e.data.list[n].port,'
    \n
    ').concat(e.data.list[n].userName,'
    \n
    ').concat(e.data.list[n].passWord||e.data.list[n].password,"
    \n
    "),s=document.createRange().createContextualFragment(o),a=s.querySelector('input[type="checkbox"]');l.push(a),a.addEventListener("change",(function(){if(a.checked){t.attributeCamera=[],t.attributeCamera.push(e.data.list[n]);for(var i=0;i=0;i--){for(var n=!1,o=0;o0){Tn(n,e.data.total,5,1,(function(e){t.ISCSelect(e)})),o.getElementsByClassName("table-empty")[0].style.display="none",a.style.display="flex";for(var r=function(i){var n='\n
    \n
    \n \n 绑定\n
    \n
    ').concat(e.data.list[i].name,'
    \n
    ').concat(e.data.list[i].status?"在线":"离线","
    \n
    "),o=document.createRange().createContextualFragment(n),s=o.querySelector('input[type="checkbox"]');s.addEventListener("change",(function(){if(s.checked)t.attributeISC.push(e.data.list[i]);else{var n=t.attributeISC.filter((function(t){return"ID"in e.data.list[i]?t.ID!==e.data.list[i].ID:t.id!==e.data.list[i].id}));t.attributeISC=n}})),a.appendChild(o);for(var r=0;r0){t._allGoodsList=e.data.list;for(var o=t.attributeGoods.length-1;o>=0;o--){for(var a=!1,r=0;r\n
    ').concat(e.data.list[i].name,'
    \n
    \n '),s=document.createRange().createContextualFragment(o),a=s.querySelector('input[type="number"]');a.value=0;for(var r=0;r=0;r--)if("ID"in e.data.list[i]){if(e.data.list[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e.data.list[i]&&e.data.list[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e.data.list[i].name,cnt:o};"ID"in e.data.list[i]?l.ID=e.data.list[i].ID:"id"in e.data.list[i]&&(l.id=e.data.list[i].id),t.attributeGoods.push(Bn({},l))}})),a.addEventListener("input",(function(n){if(n.data&&isNaN(Number(n.data)))"."!=n.data&&(a.value=Number(a.value));else{var o=Number(n.target.value);n.target.max&&o>Number(n.target.max)&&(o=Number(n.target.max)),n.target.min&&o=0;r--)if("ID"in e.data.list[i]){if(e.data.list[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e.data.list[i]&&e.data.list[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e.data.list[i].name,cnt:o};"ID"in e.data.list[i]?l.ID=e.data.list[i].ID:"id"in e.data.list[i]&&(l.id=e.data.list[i].id),t.attributeGoods.push(Bn({},l))}}})),n.appendChild(s)},c=0;c0){n.getElementsByClassName("table-empty")[0].style.display="none",o.style.display="block",o.style.maxHeight="150px";for(var s=function(i){var n='\n
    \n
    \n '.concat(i+1,'\n
    \n
    ').concat(e[i].name,'
    \n
    \n
    '),s=document.createRange().createContextualFragment(n),a=s.querySelector('input[type="number"]');a.value=0;for(var r=0;r=0;r--)if("ID"in e[i]){if(e[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e[i]&&e[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e[i].name,cnt:o};"ID"in e[i]?l.ID=e[i].ID:"id"in e[i]&&(l.id=e[i].id),t.attributeGoods.push(Bn({},l))}})),a.addEventListener("input",(function(n){if(n.data&&isNaN(Number(n.data)))"."!=n.data&&(a.value=Number(a.value));else{var o=Number(n.target.value);n.target.max&&o>Number(n.target.max)&&(o=Number(n.target.max)),n.target.min&&o=0;r--)if("ID"in e[i]){if(e[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e[i]&&e[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e[i].name,cnt:o};"ID"in e[i]?l.ID=e[i].ID:"id"in e[i]&&(l.id=e[i].id),t.attributeGoods.push(Bn({},l))}}})),o.appendChild(s)},a=0;a\n
    \n
    \n 内容类型\n
    \n
    \n
    \n
    \n
    \n
    \n 编辑内容\n \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n 编辑内容\n \n \n
    \n
    \n
    \n
    \n
    \n
    \n
    操作
    \n
    设备名称
    \n
    设备类型
    \n
    设备IP
    \n
    设备端口
    \n
    用户名
    \n
    密码
    \n
    \n
    \n \n
    \n
    \n

    暂无数据

    \n
    \n
    \n
    \n
    \n
      \n
      \n
      \n
      \n \x3c!--
      \n
      \n 编辑内容\n \n \n
      \n
      --\x3e\n
      \n
      \n
      \n
      \n
      操作
      \n
      设备名称
      \n
      设备状态
      \n
      \n
      \n \n
      \n
      \n

      暂无数据

      \n
      \n
      \n
      \n
      \n
        \n
        \n
        \n
        \n
        \n 添加链接\n
        \n \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        名称
        \n
        链接
        \n
        操作
        \n
        \n
        \n
        \n
        \n
        \n
        \n

        暂无数据

        \n
        \n
        \n
        \n
        \n
        \n 添加链接\n
        \n \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        名称
        \n
        链接
        \n
        操作
        \n
        \n
        \n
        \n
        \n
        \n
        \n

        暂无数据

        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n 编辑内容\n \n \n
        \n
        \n
        \n
        \n
        \n
        序号
        \n
        名称
        \n
        数量
        \n
        \n
        \n \n
        \n
        \n

        暂无数据

        \n
        \n
        \n
        \n
        \n '}function An(t){return'\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n

        WGS84坐标

        \n
        \n
        \n
        \n 经度\n \n
        \n
        \n
        \n
        \n 纬度\n \n
        \n
        \n
        \n
        \n 海拔高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        转换坐标选择\n
        \n
        \n
        \n
        \n
        \n X轴:\n \n
        \n
        \n
        \n
        \n Y轴:\n \n
        \n
        \n
        \n
        \n Z轴:\n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(Ln(t),'\n \n \n
        \n
        \n 高度模式\n
        \n
        \n
        \n 高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n
        \n \n 小数格式\n
        \n
        \n
        \n
        \n \n 度分格式\n
        \n
        \n
        \n
        \n \n 度分秒格式\n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n 经度\n \n
        \n
        \n
        \n
        \n
        \n
        \n 纬度\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n 经度\n \n \n \n \n \n
        \n
        \n 纬度\n \n \n \n \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n 经度\n \n \n \n \n \n \n \n
        \n
        \n 纬度\n \n \n \n \n \n \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n

        图标设置

        \n
        \n
        \n 显隐\n \n
        \n
        \n 图标\n
        \n \n
        \n
        \n
        \n 默认图标\n
        \n \n
        \n
        \n
        \n 图标倍数\n
        \n \n \n \n
        \n
        \n
        \n
        \n
        \n

        文字设置

        \n
        \n
        \n 显隐\n \n
        \n
        \n 字体选择\n
        \n
        \n
        \n 文字大小\n
        \n \n px\n \n
        \n
        \n
        \n 文字颜色\n
        \n
        \n
        \n
        \n
        \n \x3c!-- \n
        \n
        \n
        \n 扩散\n \n
        \n
        \n 半径\n \n
        \n
        \n 时间\n \n
        \n
        \n 颜色\n
        \n
        \n
        \n
        \n
        \n 雷达\n \n
        \n
        \n 半径\n \n
        \n
        \n 时间\n \n
        \n
        \n 颜色\n
        \n
        \n
        \n
        \n
        --\x3e\n \n \n
        \n 指令\n \n \x3c!-- --\x3e\n
        \n
        \n \n \n\x3c!-- --\x3e\n\x3c!--
        --\x3e\n\x3c!--
        --\x3e\n\x3c!--
        --\x3e\n\x3c!-- 设置操作点--\x3e\n\x3c!-- --\x3e\n\x3c!-- --\x3e\n\x3c!--
        --\x3e\n\x3c!--
        --\x3e\n\x3c!--
        --\x3e\n\x3c!--
        --\x3e\n \n \n \n ')}function jn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function In(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),Fn(i=Rn(this,e,[t,n]),Gn,void 0),Fn(i,Un,void 0),t&&t.viewer?(i.sdk=t,i.viewer=t.viewer,i.options=In({},n),i.options.id=n.id||i.randomString(),i.entity=null,i.clickCallBack=null,i.rightClickCallBack=null,i.picking=!0,i.options.host=i.options.host||h(),i.setDefaultValue(),i):tn()(i)}return sn()(e,t),_()(e,[{key:"showView",get:function(){return Hn(Gn,this)},set:function(t){var e=ze().sdkD;if(!e)return zn(Gn,this,t),void(this.entity&&(this.entity._showView=t));this.sdk!==e?(Hn(Gn,this)||this.show)&&(this.sdk!==e?(zn(Gn,this,2!=t&&3!=t?0:t),this.isShowView=!0,Hn(Gn,this)?this.show=2!=t:this.show=!0):zn(Gn,this,0)):zn(Gn,this,0)}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t,this.label&&(this.label.text=t),this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;if(this.isShowView&&e||(this.options.show=t,this.originalOptions&&(this.originalOptions.show=t)),this.entity&&(this.entity._showView=this.showView),"layer"==this.type&&this.entity&&(this.entity._objectState=this.options.show),this.showView&&3!=this.showView&&e?(this.entity&&(this.entity.show=!1),this.options.label&&this.options.label.show&&this.label&&(this.label.show=!1)):(this.entity&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&this.label&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=this.options.show),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this.isShowView=!1,"layer"==this.type&&e){var i=e.viewer.imageryLayers._layers[this.layerIndex],n=this.entity;if(!i)return;n._objectState?(n._showView&&2!=n._showView||(i.show=!0),3==n._showView&&(i.show=!1)):i.show=this.options.show}}else console.error("参数必须为boolean")}},{key:"attributeSelect",get:function(){return[{name:"富文本",value:"富文本",key:"richText"},{name:"链接",value:"链接",key:"link"}]}},{key:"display",value:function(){this.show=!0}},{key:"hide",value:function(){this.show=!1}},{key:"flicker",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500,i=arguments.length>1?arguments[1]:void 0;this.flickerAnimate&&TWEEN.remove(this.flickerAnimate),this.flickerAnimate=new TWEEN.Tween({degree:1}).to({degree:0},e/2).easing(TWEEN.Easing.Linear.None).repeat(i||0===i?2*i-1:1/0).yoyo(!0).onUpdate(function(){var e=o()(a.a.mark((function e(i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.sdk.viewer){e.next=3;break}return TWEEN.remove(t.flickerAnimate),e.abrupt("return");case 3:t.show&&(1===i.degree&&(t.entity&&(t.entity.show=!0),t.labelShow&&t.label&&(t.label.show=!0),t.text&&t.text&&(t.text.show=!0)),0===i.degree&&(t.entity&&(t.entity.show=!1),t.labelShow&&t.label&&(t.label.show=!1),t.text&&t.text&&(t.text.show=!1)));case 4:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).onComplete((function(e){TWEEN.remove(t.flickerAnimate),t.flickerAnimate=void 0})).start()}},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.length>0&&void 0!==u[0]?u[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position&&"[object Object]"===Object.prototype.toString.call(this.options.position)?l=In({},this.options.position):this.options.positions?l=In({},this.options.positions[0]):this.options.line&&this.options.line.positions?l=In({},this.options.line.positions[0]):this.options.center?l=In({},this.options.center):this.options.start?l=In({},this.options.start):this.geojson?(c=turf.bbox(this.geojson),l={lng:c[0],lat:c[1]}):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=26;break;case 25:this.sdk.viewer.flyTo(this.entity,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sdk.removeIncetance(this.options.id);case 2:this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id);case 6:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"onClick",get:function(){return this.clickCallBack},set:function(t){if(t&&"function"!=typeof t)console.error("val:",t,"不是一个function");else{var e=ae().sdkD,i=ze().sdkD;e&&this.sdk===e?null==this.clickCallBack&&this.options&&this.options.id&&function(t,e,i){Ct.set(t,{callback:e,that:i})}(this.options.id,this.leftClickCB,this):i&&this.sdk===i?null==this.clickCallBack&&this.options&&this.options.id&&function(t,e,i){ue.set(t,{callback:e,that:i})}(this.options.id,this.leftClickCB,this):null==this.clickCallBack&&this.options&&this.options.id&&dt(this.options.id,this.leftClickCB,this),this.clickCallBack=t}}},{key:"onRightClick",get:function(){return this.rightClickCallBack},set:function(t){if(t&&"function"!=typeof t)console.error("val:",t,"不是一个function");else{var e=ae().sdkD,i=ze().sdkD;e&&this.sdk===e?null==this.rightClickCallBack&&this.entity&&this.entity.id&&function(t,e,i){wt.set(t,{callback:e,that:i})}(this.entity.id,this.rightClickCB,this):i&&this.sdk===i?null==this.clickCallBack&&this.options&&this.options.id&&function(t,e,i){pe.set(t,{callback:e,that:i})}(this.options.id,this.leftClickCB,this):null==this.rightClickCallBack&&this.entity&&this.entity.id&&mt(this.entity.id,this.rightClickCB,this),this.rightClickCallBack=t}}},{key:"onMouseMove",get:function(){return this.mouseMoveCallBack},set:function(t){if(t&&"function"!=typeof t)console.error("val:",t,"不是一个function");else{var e=ae().sdkD,i=ze().sdkD;e&&this.sdk===e?null==this.mouseMoveCallBack&&this.entity&&this.entity.id&&function(t,e,i){kt.set(t,{callback:e,that:i})}(this.entity.id,this.mouseMoveCB,this):i&&this.sdk===i?null==this.clickCallBack&&this.options&&this.options.id&&function(t,e,i){he.set(t,{callback:e,that:i})}(this.options.id,this.leftClickCB,this):null==this.mouseMoveCallBack&&this.entity&&this.entity.id&&ft(this.entity.id,this.mouseMoveCB,this),this.mouseMoveCallBack=t}}},{key:"customView",get:function(){return this.options.customView}},{key:"setCustomView",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=4;break}this.options.customView=e,t.next=16;break;case 4:if(i=this.sdk.viewer.camera,n=this.cartesian3Towgs84(i.position,this.sdk.viewer),o={lng:0,lat:0},s=In({},n),this.options.position&&"[object Object]"===Object.prototype.toString.call(this.options.position)?o=In({},this.options.position):this.options.positions?o=In({},this.options.positions[0]):this.options.line&&this.options.line.positions?o=In({},this.options.line.positions[0]):this.options.center?o=In({},this.options.center):this.options.start?o=In({},this.options.start):this.geojson?(r=turf.bbox(this.geojson),o={lng:r[0],lat:r[1]}):(this.options.hasOwnProperty("lng")&&(o.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(o.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(o.alt=this.options.alt)),o.hasOwnProperty("alt")){t.next=13;break}return t.next=12,this.getClampToHeight(o);case 12:o.alt=t.sent;case 13:s={lng:n.lng-o.lng,lat:n.lat-o.lat,alt:n.alt-o.alt},this.options.customView={orientation:{heading:Cesium.Math.toDegrees(i.heading),pitch:Cesium.Math.toDegrees(i.pitch),roll:Cesium.Math.toDegrees(i.roll)},relativePosition:s},this.originalOptions&&(this.originalOptions.customView=this.options.customView);case 16:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"resetCustomView",value:function(){this.options.customView=void 0}},{key:"edit",value:function(){}},{key:"leftClickCB",value:function(t,e,i,n){n.clickCallBack&&"function"==typeof n.clickCallBack&&n.clickCallBack(t,e,i)}},{key:"rightClickCB",value:function(t,e,i,n){n.rightClickCallBack&&"function"==typeof n.rightClickCallBack&&n.rightClickCallBack(t,e,i)}},{key:"mouseMoveCB",value:function(t,e,i,n){n.mouseMoveCallBack&&"function"==typeof n.mouseMoveCallBack&&n.mouseMoveCallBack(t,e,i)}},{key:"getGuid",value:function(){return Cesium.createGuid()}},{key:"setDefaultValue",value:function(){var t,e,i;this.options.id=null!==(t=this.options.id)&&void 0!==t?t:this.getGuid(),this.options.show=null===(e=this.options.show)||void 0===e||e,this.options.name=null!==(i=this.options.name)&&void 0!==i?i:"未命名对象"}},{key:"start",value:function(){}},{key:"end",value:function(){}}]);var i,n,s}(fi);function Yn(t){return'\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n 透明度\n \n
        \n
        \n
        \n \n
        \n
        \n
        \n 经度\n \n
        \n
        \n 波纹层数\n
        \n \n \n
        \n
        \n
        \n
        \n
        \n 纬度\n \n
        \n
        \n 扩散速度\n
        \n \n \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 半径单位\n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(Ln(t),'\n \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体选择\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ','\n
        \n
        \n
        \n
        \n \n ')}var Jn=[{name:"黑体",value:"黑体",font:"SimHei",key:"0"},{name:"思源黑体",value:"思源黑体",font:"SourceHanSansTi",key:"1"},{name:"庞门正道标题体",value:"庞门正道标题体",font:"PMZDBTTi",key:"2"},{name:"数黑体",value:"数黑体",font:"AlimamaShuHeiTi",key:"3"}];function qn(){return Jn}function Xn(t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;k()(this,e),$n(i=Kn(this,e,[t,n]),eo,void 0),$n(i,io,document.createElement("canvas")),$n(i,no,document.createElement("canvas")),i.model=o,i.options.near=n.near||0===n.near?n.near:2e3,i.options.far=n.far||0===n.far?n.far:1e5,i.options.scaleByDistance=n.scaleByDistance||!1,i.options.show=!n.show&&!1!==n.show||n.show,i.options.text=n.text;for(var s=i.options.text.split("\n"),a=0;a40&&(s[a]=s[a].slice(0,40-s[a].length));return s.length>10&&s.splice(10-s.length),i.options.text=s.join("\n"),i.options.fontFamily=n.fontFamily||0,i.font=Xn(i.options.fontFamily)||"SimHei",i.options.fontSize=n.fontSize||20,i.options.lineWidth=n.lineWidth||4,i.options.lineColor=n.lineColor||"#00ffff80",i.options.color=n.color||"#ffffff",i.options.ground=!n.ground&&!1!==n.ground||n.ground,i.options.pixelOffset=n.pixelOffset||0===n.pixelOffset?n.pixelOffset:20,i.options.backgroundColor=n.backgroundColor||["#00ffff80","#00ffff80"],i.event=new X(i.sdk),i.entity,i.create(i.options.position),i.picking=!0,i}return sn()(e,t),_()(e,[{key:"create",value:(i=o()(a.a.mark((function t(){var e,i,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this,this.options.position[2]||0===this.options.position[2]){t.next=5;break}return t.next=4,this.getClampToHeight({lng:this.options.position[0],lat:this.options.position[1]});case 4:this.options.position[2]=t.sent;case 5:this.originalOptions=so(this.options),i=this.options.id+"-label",(n=this.sdk.viewer.entities.getById(i))&&this.sdk.viewer.entities.remove(n),this.entity=this.sdk.viewer.entities.add({show:this.options.show,id:this.options.id+"-label",position:new Cesium.CallbackProperty((function(){if(e.model){if(e.model.isMove){var t=e.model.customScale.x;e.model.customScale.y>t&&(t=e.model.customScale.y),e.model.customScale.z>t&&(t=e.model.customScale.z);for(var i=Cesium.Cartesian3.fromDegrees(e.options.position[0],e.options.position[1],e.options.position[2]+2*(e.model.originalBoundingSphereRadius||1)*(t||.01)),n=Cesium.Cartesian3.fromDegrees(e.options.position[0],e.options.position[1],e.options.position[2]-2*(e.model.originalBoundingSphereRadius||1)*(t||.01)),o=Cesium.Cartesian3.subtract(n,i,new Cesium.Cartesian3),s=Cesium.Cartesian3.normalize(o,o),a=new Cesium.Ray(i,s),r=e.viewer.scene.drillPickFromRay(a,5),l=0;li&&(i=this.model.customScale.y),this.model.customScale.z>i&&(i=this.model.customScale.z);for(var n=this.cartesian3Towgs84(this.model.position,this.sdk.viewer),o=Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt+2*(this.model.originalBoundingSphereRadius||1)*(i||.01)),s=Cesium.Ellipsoid.WGS84.geodeticSurfaceNormal(o),a=Cesium.Cartesian3.normalize(s,s),r=Cesium.Cartesian3.multiplyByScalar(a,-1,new Cesium.Cartesian3),l=new Cesium.Ray(o,r),c=this.viewer.scene.drillPickFromRay(l,5),u=0;u40&&(e[i]=e[i].slice(0,40-e[i].length));e.length>10&&e.splice(10-e.length),this.options.text=e.join("\n"),this.entity&&this.updateBillboardImage()}},{key:"color",get:function(){return this.options.color},set:function(t){this.options.color=t,this.entity&&(this.entity.billboard.image=this.getcanvas())}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(t){this.options.scaleByDistance=t,this.entity&&(this.options.scaleByDistance?(this.entity.billboard.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.billboard.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0)):(this.entity.billboard.scaleByDistance=void 0,this.entity.billboard.pixelOffsetScaleByDistance=void 0))}},{key:"near",get:function(){return this.options.near},set:function(t){var e=t;e>this.far&&(e=this.far),this.options.near=e,this.entity&&(this.options.scaleByDistance?(this.entity.billboard.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.billboard.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0)):(this.entity.billboard.scaleByDistance=void 0,this.entity.billboard.pixelOffsetScaleByDistance=void 0))}},{key:"far",get:function(){return this.options.far},set:function(t){var e=t;ei&&(i=a),n+=this.options.fontSize}n=n+20+5*(e.length-1),(i+=30)0&&void 0!==arguments[0]?arguments[0]:{},e=null;if("object"==N()(t)&&null!==t)for(var i in e=t instanceof Array?[]:{},t)e[i]=so(t[i]);else e=t;return e},ao=function(){return _()((function t(e){k()(this,t),t.prototype.hasOwnProperty("color")||Object.defineProperties(t.prototype,{color:Cesium.createPropertyDescriptor("color")}),t.prototype.hasOwnProperty("speed")||Object.defineProperties(t.prototype,{speed:Cesium.createPropertyDescriptor("speed")}),t.prototype.hasOwnProperty("transparency")||Object.defineProperties(t.prototype,{transparency:Cesium.createPropertyDescriptor("transparency")}),t.prototype.hasOwnProperty("count")||Object.defineProperties(t.prototype,{count:Cesium.createPropertyDescriptor("count")}),t.prototype.hasOwnProperty("gradient")||Object.defineProperties(t.prototype,{gradient:Cesium.createPropertyDescriptor("gradient")}),this._definitionChanged=new Cesium.Event,this._speed=void 0,this.id=e.id,this.color=e.color||new Cesium.Color(1,1,1,1),this.colors=e.colors||{},this.speed=e.speed,this.transparency=e.transparency,this.count=e.count,this.gradient=e.gradient;var i="",n=[];for(var o in this.colors)Object.hasOwnProperty.call(this.colors,o)&&n.push(o);n.sort((function(t,e){return e-t}));for(var s=0;s 0.0){\n if(disNum < perDis){\n bl = 1.0 - disNum / perDis;\n }\n else if(disNum - perDis < perDis){\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = pow(bl,(1.0 + 10.0 * (1.0 - gradient))) * transparency;\n }\n }\n }\n }\n return material;\n }\n "),this._CircleRippleMaterialType="CircleRippleMaterialType"+this.id,Cesium.Material._materialCache.addMaterial(this._CircleRippleMaterialType,{fabric:{type:this._CircleRippleMaterialType,uniforms:{color:new Cesium.Color(1,0,0,1),speed:3,transparency:1,count:4,gradient:.2,frameNumber:Cesium.getTimestamp()},source:this._source},translucent:function(t){return!0}})}),[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return this._CircleRippleMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.transparency=this.transparency,e.count=this.count,e.gradient=this.gradient,e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(t){return this===t||t instanceof CircleRippleMaterialProperty&&Cesium.Property.equals(this._color,t._color)&&Cesium.Property.equals(this._speed,t._speed)&&Cesium.Property.equals(this.count,t.count)&&Cesium.Property.equals(this.transparency,t.transparency)&&Cesium.Property.equals(this.gradient,t.gradient)}}])}();function ro(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function lo(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function uo(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,e),(i=po(this,e,[t,n])).options.lng=n.lng,i.options.lat=n.lat,i.options.color=n.color||"#1FA8E3",i.options.transparency=n.transparency||0===n.transparency?n.transparency:1,i.options.transparency>1&&(i.options.transparency=1),i.options.speed=n.speed||0===n.speed?n.speed:5,i.options.count=n.count||0===n.count?n.count:3,n.count||0===n.count?(i.options.count=n.count,n.count>99&&(i.options.count=99)):i.options.count=3,i.options.circle=n.circle||[{radius:10}];for(var s=0;s999999&&(i.options.circle[s].radius=999999);i.options.show=!n.show&&!1!==n.show||n.show,i.event=new X(i.sdk),i.options.positionEditin=!1,n.label=n.label||{},i._elms={},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",i.options.attribute=n.attribute||{},i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.ISC=i.options.attribute.ISC||{},i.options.attribute.ISC.content=i.options.attribute.ISC.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText";for(var a=0,r=0;ra&&(a=Number(i.options.circle[r].radius));return i._radius=a,i.Dialog=o,i._EventBinding=new wn,i.sdk.addIncetance(i.options.id,i),e.create(i),i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"CircleDiffuse"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;this.isShowView&&e||(this.options.show=t),this.showView&&3!=this.showView&&e?(this.entity.show=!1,this.options.label.show&&(this.label.show=!1)):(this.entity.show=this.options.show,this.options.label.show&&(this.label.show=this.options.show)),this.isShowView=!1,Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t)}else console.error("参数必须为boolean")}},{key:"positionEditing",get:function(){return this.options.positionEditing},set:function(t){var e=this;this.sdk&&this.sdk.viewer&&this.entity&&(this.options.positionEditing=t,!0===t?(this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.lastOptions={lng:this.options.lng,lat:this.options.lat},this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=t.lng,e.lat=t.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1}}))}))):(setTimeout((function(){e.picking=!0}),500),this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){}))),this.tip&&this.tip.destroy(),this.lastOptions&&(this.lng=this.lastOptions.lng,this.lat=this.lastOptions.lat),this.lastOptions=void 0))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t,this.label.position=[t,this.lat],this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t,this.label.position=[this.lng,t],this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"radius",get:function(){return this._radius}},{key:"circle",get:function(){return this.options.circle},set:function(t){console.log(t),this.options.circle=t||[{radius:10}];for(var e=0;e999999&&(this.options.circle[e].radius=999999);this._createCircleElm()}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t,e.create(this),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t}))}},{key:"transparency",get:function(){return this.options.transparency},set:function(t){this.options.transparency=t>1?1:t,e.create(this),this._elms.transparency&&this._elms.transparency.forEach((function(e){e.value=t}))}},{key:"count",get:function(){return this.options.count},set:function(t){this.options.count=t>99?99:t,e.create(this),this._elms.count&&this._elms.count.forEach((function(e){e.value=t}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){var e=ze().sdkD;this.options.label.show=t,!this.show||this.showView&&3!=this.showView&&e?this.label.show=!1:this.label.show=t,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
        '+this.options.attribute.link.content[s].url+'
        \n
        \n \n \n
        \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
        '+this.options.attribute.vr.content[s].url+'
        \n
        \n \n \n
        \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0&&void 0!==u[0]?u[0]:{},pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=lo({},this.options.position):this.options.positions?l=lo({},this.options.positions[0]):this.options.start?l=lo({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=27;break;case 23:return t.next=25,this.getClampToHeight({lng:this.options.lng,lat:this.options.lat});case 25:c=t.sent,this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,6*this.radius+c),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},duration:1});case 27:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"edit",value:(s=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=28;break}return t.next=6,new rn(this.sdk,this.options,{title:"扩散光波属性",left:"180px",top:"100px",confirmCallBack:function(t){c.name=c.name.trim(),c.name||(c.name="未命名对象"),c.options.label.position={lng:c.label.position[0],lat:c.label.position[1],alt:c.label.position[2]},c.originalOptions=c.deepCopyObj(c.options),c._DialogObject.close(),c.Dialog.confirmCallBack&&c.Dialog.confirmCallBack(c.originalOptions),Pe(c.sdk,c.options.id),se(c.sdk,c.options.id)},resetCallBack:function(){c.reset(),c.Dialog.resetCallBack&&c.Dialog.resetCallBack()},removeCallBack:function(){c.Dialog.removeCallBack&&c.Dialog.removeCallBack()},closeCallBack:function(){c.reset(),c.positionEditing=!1,c.Dialog.closeCallBack&&c.Dialog.closeCallBack()},showCallBack:function(t){c.options.show=t,c.originalOptions.show=t,c.show=t,c.Dialog.showCallBack&&c.Dialog.showCallBack()},translationalCallBack:function(){c.positionEditing=!c.positionEditing}},!0);case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" circle-ciffuse",(i=document.createElement("div")).innerHTML=Yn(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,this._createCircleElm(),new kn("circle-diffuse-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelColor=t},clear:function(){c.labelColor="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelLineColor=t},clear:function(){c.labelLineColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelBackgroundColorStart=t},clear:function(){c.labelBackgroundColorStart="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelBackgroundColorEnd=t},clear:function(){c.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),l=i.getElementsByTagName("*"),this._EventBinding.on(this,l),this._elms=this._EventBinding.element,this._elms.labelColor=[n],this._elms.labelLineColor=[o],this._elms.labelBackgroundColorStart=[s],this._elms.labelBackgroundColorEnd=[r],setTimeout((function(){c.attributeLink=c.options.attribute.link.content,c.attributeVr=c.options.attribute.vr.content,c.ISCSelect&&c.ISCSelect(),c.goodsSelect&&c.goodsSelect(),c.cameraSelect&&c.cameraSelect();var t=Y(c._DialogObject._element.content.getElementsByClassName("input-radius-unit-box")[0],".input-radius-unit");if(t){t.legp_search([{name:"米",value:"米"},{name:"千米",value:"千米"}]);var e=c._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0];e.value="米",e.addEventListener("input",(function(){var t=c._DialogObject._element.content.getElementsByClassName("circle-content-box")[0].getElementsByClassName("input-number");switch(e.value){case"米":for(var i=0;it&&(t=Number(this.options.circle[i].radius));this._radius=t,e.create(this)}}},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.label&&this.label.remove(),this.entity&&this.sdk.viewer.entities.remove(this.entity),this.entity2&&this.sdk.viewer.entities.remove(this.entity2),this.entity=null,this.entity2=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=10,this.sdk.removeIncetance(this.options.id);case 10:return t.next=12,Pe(this.sdk,this.options.id);case 12:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"_createCircleElm",value:function(){var t=this;if(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content){var i=this._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0],n=i?i.value:"米",o=this._DialogObject._element.content.getElementsByClassName("circle-content-box")[0];o.innerHTML="";for(var s=function(i){var s=document.createElement("div");s.className="row";var a="",r='';0===i&&i===t.options.circle.length-1&&(r=""),i===t.options.circle.length-1&&(a=''),s.innerHTML='\n
        \n 半径\n
        \n \n '.concat("米"===n?"m":"km",'\n \n
        \n
        \n
        \n
        \n 扩散颜色\n
        \n
        \n ').concat(a,"\n ").concat(r,"\n
        \n ");var l=s.getElementsByClassName("input")[0];l.value=t.options.circle[i].radius/("米"===n?1:1e3),l.addEventListener("input",(function(n){var o=t._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(n.target.value||0===n.target.value){var s=n.target.value;if(s=Number(s),"."!=n.data&&("-"!=n.data||n.target.value)&&(!n.target.max&&!n.target.min||s<=Number(n.target.max)/("米"===o?1:1e3)&&s>=Number(n.target.min))){s="米"===o?Math.floor(100*s)/100:Math.floor(1e5*s)/1e5,t.options.circle[i].radius=s*("米"===o?1:1e3);for(var a=0,r=0;ra&&(a=Number(t.options.circle[r].radius));t._radius=a,e.create(t)}}})),l.addEventListener("blur",(function(n){var o=t._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(n.target.value||0===n.target.value){var s=n.target.value;s=Number(s),n.target.max&&s>Number(n.target.max)/("米"===o?1:1e3)&&(s=Number(n.target.max)/("米"===o?1:1e3)),n.target.min&&sa&&(a=Number(t.options.circle[r].radius));t._radius=a,l.value=s,e.create(t)}}));new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!1,defaultColor:t.options.circle[i].color||t.options.color,disabled:!1,openPickerAni:"opacity",sure:function(n){t.options.circle[i].color=n,e.create(t)},clear:function(){t.options.circle[i].color="rgba(255,255,255,1)",e.create(t)}});var c=s.getElementsByClassName("circle-minus")[0];c&&c.addEventListener("click",(function(){t.options.circle.splice(i,1);for(var n=0,o=0;on&&(n=Number(t.options.circle[o].radius));t._radius=n,e.create(t),t._createCircleElm()}));var u=s.getElementsByClassName("circle-add")[0];u&&u.addEventListener("click",(function(){t.options.circle.push({radius:0,color:"rgba(255,255,255,1)"});for(var i=0,n=0;ni&&(i=Number(t.options.circle[n].radius));t._radius=i,e.create(t),t._createCircleElm()})),o.appendChild(s)},a=0;a0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}}],[{key:"create",value:function(t){for(var i={},n=0;n\n
        \n
        \n
        \n 名称\n \n
        \n
        \n 扫描颜色\n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 经度\n \n
        \n
        \n 扫描半径\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n 纬度\n \n
        \n
        \n 扫描速度\n \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(Ln(t),'\n \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体选择\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ','\n
        \n
        \n
        \n
        \n \n ')}function fo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function vo(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=bo(this,e,[t,n])).options.lng=n.lng,i.options.lat=n.lat,i.options.color=n.color||"#FFEB3B",i.options.radius=n.radius||10,i.options.radius>999999&&(i.options.radius=999999),i.options.speed=n.speed||0===n.speed?n.speed:20,i.options.show=!n.show&&!1!==n.show||n.show,i.event=new X(i.sdk),i.options.positionEditin=!1,n.label=n.label||{},i._elms={},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",i.options.attribute=n.attribute||{},i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera=i.options.attribute.camera.content||[],i.options.attribute.ISC=i.options.attribute.ISC||{},i.options.attribute.ISC.content=i.options.attribute.ISC.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.Dialog=o,i._EventBinding=new wn,i.sdk.addIncetance(i.options.id,i),e.create(i),i}return sn()(e,t),_()(e,[{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;this.isShowView&&e||(this.options.show=t),this.showView&&3!=this.showView&&e?(this.entity.show=!1,this.options.label.show&&this.label&&(this.label.show=!1)):(this.entity.show=this.options.show,this.options.label.show&&this.label&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"positionEditing",get:function(){return this.options.positionEditing},set:function(t){var e=this;!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity&&(this.options.positionEditing=t,!0===t?(this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.lastOptions={lng:this.options.lng,lat:this.options.lat},this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=t.lng,e.lat=t.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1}}))}))):(setTimeout((function(){e.picking=!0}),500),this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),this.lastOptions&&(this.lng=this.lastOptions.lng,this.lat=this.lastOptions.lat),this.lastOptions=void 0))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t,this.label.position=[t,this.lat],this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t,this.label.position=[this.lng,t],this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"radius",get:function(){return this.options.radius},set:function(t){var e=Number(t.toFixed(2));(e>999999&&(e=999999),e<.1&&(e=.1),this.options.radius=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content)&&("千米"===this._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value&&(e=Number((e/1e3).toFixed(5))));this._elms.radius&&this._elms.radius.forEach((function(t){t.value=e}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t,this.changeMaterial(),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t}))}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.changeMaterial(),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){var e=ze().sdkD;this.options.label.show=t,!this.show||this.showView&&3!=this.showView&&e?this.label.show=!1:this.label.show=t,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
        '+this.options.attribute.link.content[s].url+'
        \n
        \n \n \n
        \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
        '+this.options.attribute.vr.content[s].url+'
        \n
        \n \n \n
        \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0&&void 0!==u[0]?u[0]:{},pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=vo({},this.options.position):this.options.positions?l=vo({},this.options.positions[0]):this.options.start?l=vo({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=27;break;case 23:return t.next=25,this.getClampToHeight({lng:this.options.lng,lat:this.options.lat});case 25:c=t.sent,this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,6*this.options.radius+c),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},duration:1});case 27:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"edit",value:(s=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=34;break}return t.next=6,new rn(this.sdk,this.options,{title:"雷达光波属性",left:"180px",top:"100px",confirmCallBack:function(t){p.name=p.name.trim(),p.name||(p.name="未命名对象"),p.options.label.position={lng:p.label.position[0],lat:p.label.position[1],alt:p.label.position[2]},p.originalOptions=p.deepCopyObj(p.options),p._DialogObject.close(),p.Dialog.confirmCallBack&&p.Dialog.confirmCallBack(p.originalOptions),Pe(p.sdk,p.options.id),se(p.sdk,p.options.id)},resetCallBack:function(){p.reset(),p.Dialog.resetCallBack&&p.Dialog.resetCallBack()},removeCallBack:function(){p.Dialog.removeCallBack&&p.Dialog.removeCallBack()},closeCallBack:function(){p.reset(),p.positionEditing=!1,p.Dialog.closeCallBack&&p.Dialog.closeCallBack()},showCallBack:function(t){p.options.show=t,p.originalOptions.show=t,p.show=t,p.Dialog.showCallBack&&p.Dialog.showCallBack()},translationalCallBack:function(){p.positionEditing=!p.positionEditing}},!0);case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" radar-scan",(i=document.createElement("div")).innerHTML=mo(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,new kn("radar-scan-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){p.color=t},clear:function(){p.color="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelColor=t},clear:function(){p.labelColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelLineColor=t},clear:function(){p.labelLineColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelBackgroundColorStart=t},clear:function(){p.labelBackgroundColorStart="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelBackgroundColorEnd=t},clear:function(){p.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),c=i.getElementsByTagName("*"),this._EventBinding.on(this,c),this._elms=this._EventBinding.element,this._elms.color=[n],this._elms.labelColor=[o],this._elms.labelLineColor=[s],this._elms.labelBackgroundColorStart=[r],this._elms.labelBackgroundColorEnd=[l],(u=this._DialogObject._element.content.getElementsByClassName("input-radius")[0].getElementsByTagName("input")[0]).value=this.options.radius,this._elms.radius=[u],u.addEventListener("input",(function(t){var e=p._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(t.target.value||0===t.target.value){var i=t.target.value;i=Number(i),"."==t.data||"-"==t.data&&!t.target.value||(!t.target.max&&!t.target.min||i<=Number(t.target.max)/("米"===e?1:1e3)&&i>=Number(t.target.min))&&(p.radius=i*("米"===e?1:1e3))}})),u.addEventListener("blur",(function(t){var e=p._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(t.target.value||0===t.target.value){var i=t.target.value;i=Number(i),t.target.max&&i>Number(t.target.max)/("米"===e?1:1e3)&&(i=Number(t.target.max)/("米"===e?1:1e3)),t.target.min&&i0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}}],[{key:"create",value:function(t){var i=function(t){if(/^#/.test(t)){var e=t.replace("#",""),i=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),o=parseInt(e.substring(4,6),16),s=parseInt(e.substring(6,8),16);s||0===s?s/=255:s=1,t="rgba(".concat(i,",").concat(n,",").concat(o,",").concat(s,")")}var a=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);return a?[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),a[4]?parseFloat(a[4]):1]:null}(t.options.color),n="rgba(".concat(i[0],",").concat(i[1],",").concat(i[2],",1)");t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(t.options.lng,t.options.lat)}),!1),name:"雷达扫描",ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(){return t.options.radius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(){return t.options.radius}),!1),material:new Cesium.RadarScanMaterialProperty({color:Cesium.Color.fromCssColorString(n),transparency:i[3],speed:t.options.speed}),zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,"cesium-viewer 2d"===t.sdk.viewer._element.className&&(t.entity.ellipse.height=1),e.createLabel(t),Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){var i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getClampToHeight({lng:e.options.lng,lat:e.options.lat});case 2:i=t.sent,e.options.label.position||(e.options.label.position={lng:e.options.lng,lat:e.options.lat,alt:i}),e.label=new oo(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:!0});case 5:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"createBy2D",value:function(t){t.entity=new Cesium.EntityCollection;var i=0,n=r(t.options,t.options.radius,i),o=(new Date).getTime();t.viewer.clock.onTick.addEventListener((function(){var e=(new Date).getTime(),s=t.options.duration?360/t.options.duration:0,a=(e-o)*s;o=e,i+=a,n=r(t.options,t.options.radius,i)}));var s=t.sdk.viewer.entities.add({show:t.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){var e=t.createCircle({lng:t.options.lng,lat:t.options.lat},t.options.radius);return Cesium.Cartesian3.fromDegreesArray(e)}),!1),width:2,material:Cesium.Color.fromCssColorString(t.options.color),clampToGround:!0}}),a=t.sdk.viewer.entities.add({show:t.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArray(n)}),!1),width:2,material:Cesium.Color.fromCssColorString(t.options.color),clampToGround:!0}});function r(t,e,i){var n=t.lng,o=t.lat,s=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(n,o,0)),a=e*Math.cos(i*Math.PI/180),r=e*Math.sin(i*Math.PI/180),l=Cesium.Cartesian3.fromElements(a,r,0),c=Cesium.Matrix4.multiplyByPoint(s,l,new Cesium.Cartesian3),u=Cesium.Cartographic.fromCartesian(c);return[n,o,Cesium.Math.toDegrees(u.longitude),Cesium.Math.toDegrees(u.latitude)]}t.entity.add(s),t.entity.add(a),t.sdk.viewer.entities.add(t.entity),e.createLabel(t),Pe(t.sdk,t.options.id)}}]);var i,n,s,r}(Wn);function wo(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return ko(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?ko(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function ko(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function s(t,e){var i=Cesium.Cartesian3.distance(e.camera.positionWC,t.position.getValue()),n=t.billboard.scaleByDistance?t.billboard.scaleByDistance.getValue():void 0;if(!n)return 1;var o=n.near,s=n.nearValue,a=n.far,r=n.farValue;if(i<=o)return s;if(i>=a)return r;var l=(i-o)/(a-o);return Cesium.Math.lerp(s,r,l)}return k()(this,e),So(i=Eo(this,e,[t,n]),Oo,null),So(i,To,null),So(i,No,0),i.options.near=n.near||0===n.near?n.near:2e3,i.options.far=n.far||0===n.far?n.far:1e5,i.options.scaleByDistance=!n.scaleByDistance&&!1!==n.scaleByDistance||n.scaleByDistance,i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:3,i.options.billboard=n.billboard=n.billboard||{},i.options.billboard.isSelect=n.billboard.isSelect||!1,i.options.billboard.show=!n.billboard.show&&!1!==n.billboard.show||n.billboard.show,i.options.billboard.image=n.billboard.image||ti(n.billboard.defaultImage)||i.getSourceRootPath()+"/img/A-ablu-blank.png",i.options.billboard.defaultImage=n.billboard.defaultImage,i.options.billboard.scale=n.billboard.scale||0===n.billboard.scale?n.billboard.scale:3,n.label=n.label||{},i.options.label=n.label||{},i.options.label.text=n.label.text||i.options.name,i.options.name=i.options.label.text,i.options.label.show=!n.label.show&&!1!==n.label.show||n.label.show,i.options.label.fontFamily=n.label.fontFamily||0,i.options.label.fontSize=n.label.fontSize||39,i.options.label.color=n.label.color||"#00ffff",i.options.positions=n.positions=n.positions||{},i.options.positions.lng=Number(Number(n.positions.lng||0).toFixed(8)),i.options.positions.lat=Number(Number(n.positions.lat||0).toFixed(8)),i.options.positions.alt=Number(Number(n.positions.alt||0).toFixed(2)),Po(No,i,i.options.positions.alt),i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.rtmp=i.options.attribute.rtmp||{},i.options.attribute.rtmp.content=i.options.attribute.rtmp.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.ISC=i.options.attribute.ISC||{},i.options.attribute.ISC.content=i.options.attribute.ISC.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.options.coordinate=n.coordinate||"",i.options.attributeBoxState=n.attributeBoxState||!1,i.operate={},i._elms={},i.previous={positions:_o({},i.options.positions)},i.options.attributePos=n.attributePos||{x:60,y:60,width:200,height:120},i.entity,i._proj=i.sdk.proj,Po(To,i,(function(){i.attributeElm&&(i.attributeElm.style.pointerEvents="unset"),i.sdk&&i.sdk.viewer&&i.sdk.viewer._element&&(i.sdk.viewer._element.onmousemove=null),document.removeEventListener("mouseup",Do(To,i)),document.removeEventListener("mouseleave",Do(To,i))})),Po(Oo,i,(function(){var t=Cesium.Cartesian3.fromDegrees(i.options.positions.lng,i.options.positions.lat,Do(No,i));if(i.attributeElm&&i.entity){var e=i.sdk.viewer.scene.cartesianToCanvasCoordinates(t),n=i.entity.label.pixelOffset.getValue();if(e){var o,a,r,l,c,u=s(i.entity,i.sdk.viewer.scene),p=(i.entity.billboard.height.getValue()*(i.options.billboard.scale||0)+i.options.label.fontSize)*(1-u*u),h=!1,d=i.attributeElm.getElementsByClassName("billboard-attribute-box-line")[0],m=i.attributeElm.getElementsByClassName("left-top")[0],f=i.attributeElm.getElementsByClassName("right-top")[0];i.attributeElm.style.left=(e.x+i.options.attributePos.x).toFixed(0)+"px",i.attributeElm.style.top=(e.y+n.y-(i.options.label.show?i.options.label.fontSize/2:-i.options.label.fontSize/2)-i.attributeElm.offsetHeight-i.options.attributePos.y+p).toFixed(0)+"px",i.attributeElm.style.width=i.options.attributePos.width+"px",i.attributeElm.style.height=i.options.attributePos.height+"px",d.style.zIndex="-1",i.options.attributePos.x<-i.options.attributePos.width/2?(h=!0,d.style.left="unset",d.style.right="0",m.style.display="block",f.style.display="none"):(d.style.left="0",d.style.right="unset",m.style.display="none",f.style.display="block"),h?(l=i.attributeElm.offsetWidth+i.options.attributePos.x,c=i.options.attributePos.y?i.options.attributePos.y:0):(l=i.options.attributePos.x,c=i.options.attributePos.y?i.options.attributePos.y:0),o=Math.sqrt(l*l+c*c).toFixed(2),a=Math.atan(l/c),r=parseFloat((180*a/Math.PI).toFixed(2)),i.options.attributePos.y<0&&(r+=180),d.style.height=o+"px",d.style.transform="rotate("+r+"deg)"}}})),i.sdk.addIncetance(i.options.id,i),e.create(i),i.picking=!0,i.Dialog=o,i._EventBinding=new wn,i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"BillboardObject"}},{key:"selectBillboard",value:function(){var t=this;this.sdk.viewer.screenSpaceEventHandler.setInputAction((function(e){var i=t.sdk.viewer.scene.pick(e.position);Cesium.defined(i)&&i.id&&"airportBillboard"===i.id.id?t.entity.billboard&&(t.entity.billboard.color=Cesium.Color.YELLOW):t.entity.billboard&&(t.entity.billboard.color=Cesium.Color.WHITE)}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}},{key:"attributeSelect",get:function(){return[{name:"富文本",value:"富文本",key:"richText"},{name:"链接",value:"链接",key:"link"},{name:"rtmp",value:"rtmp",key:"rtmp"},{name:"IP摄像头",value:"IP摄像头",key:"camera"},{name:"全景图",value:"全景图",key:"vr"},{name:"物资",value:"物资",key:"goods"}]}},{key:"show",get:function(){return this.options.show},set:function(t){this.isShowView||(this.options.show=t,this.originalOptions.show=t),this.showView&&3!=this.showView?(this.entity&&(this.entity.show=!1),document.addEventListener("mouseup",Do(To,this)),document.addEventListener("mouseleave",Do(To,this)),this.attributeElm&&(this.sdk.viewer._element.removeChild(this.attributeElm),this.attributeElm=null),this.sdk.viewer.scene.postRender.removeEventListener(Do(Oo,this))):(this.entity&&(this.entity.show=this.options.show),this.attributeBoxState&&this.options.show?this.attributeBoxState=this.options.show:(document.addEventListener("mouseup",Do(To,this)),document.addEventListener("mouseleave",Do(To,this)),this.attributeElm&&(this.sdk.viewer._element.removeChild(this.attributeElm),this.attributeElm=null),this.sdk.viewer.scene.postRender.removeEventListener(Do(Oo,this)))),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=this.options.show),this.isShowView=!1}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var e,i=this;this.options.heightMode=t||0==t?t:3;var n,o="";switch(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(n=this._DialogObject._element.content.getElementsByClassName("alt-box")[0]),this.options.heightMode){case"0":case 0:n&&(n.className="input-number input-number-unit-1 alt-box"),this._elms.height&&(this._elms.height.style.display="flex"),e=Cesium.HeightReference.NONE,o="海拔高度";break;case"1":case 1:n&&(n.className="input-number input-number-unit-1 alt-box"),this._elms.height&&(this._elms.height.style.display="flex"),e=Cesium.HeightReference.NONE,o="相对地表";break;case"2":case 2:n&&(n.className="input-number input-number-unit-1 alt-box disabled"),o="依附地表",n&&(n.className="input-number input-number-unit-1 alt-box disabled"),o="依附地表",e=Cesium.HeightReference.CLAMP_TO_GROUND,this._elms.height&&(this._elms.height.style.display="none");break;case"3":case 3:n&&(n.className="input-number input-number-unit-1 alt-box disabled"),this._elms.height&&(this._elms.height.style.display="none"),e=Cesium.HeightReference.NONE,o="依附模型"}this.entity&&(this.entity.billboard.heightReference=e,this.entity.label.heightReference=e,e==Cesium.HeightReference.CLAMP_TO_GROUND?this.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.positions.lng,this.options.positions.lat)]).then((function(t){Po(No,i,t[0].height)})):Po(No,this,0):Po(No,this,this.options.positions.alt)),this._elms.heightMode&&(this._elms.heightMode.value=o)}},{key:"labelText",get:function(){return this.options.label.text},set:function(t){this.options.label.text=t,this.options.name=t,this.entity&&(this.entity.label.text=t+""),this._elms.labelText&&this._elms.labelText.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.positions.lng},set:function(t){this.options.positions.lng=Number(Number(t).toFixed(8)),this.renewPoint(),this.coordinate=this.options.coordinate,this._projConvert&&this._projConvert(),this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.positions.lat},set:function(t){this.options.positions.lat=Number(Number(t).toFixed(8)),this.renewPoint(),this.coordinate=this.options.coordinate,this._projConvert&&this._projConvert(),this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.positions.alt},set:function(t){var e=this;if(this.options.positions.alt=Number(Number(t).toFixed(2)),Po(No,this,this.options.positions.alt),this.renewPoint(),this.coordinate=this.options.coordinate,this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.positions.alt})),this._elms.height){var i=this._elms.height.getElementsByClassName("height")[0];if(i)switch(this._elms.heightMode.value){case"海拔高度":i.value=this.options.positions.alt;break;case"相对地表":this.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.positions.lng,this.options.positions.lat)]).then((function(t){i.value=Number((e.options.positions.alt-t[0].height).toFixed(2))})):i.value=Number(Number(this.options.positions.alt).toFixed(2));break;case"依附地表":case"依附地表":break;case"依附模型":this.updateHeight()}}}},{key:"near",get:function(){return this.options.near},set:function(t){var e=t;e>this.far&&(e=this.far),this.options.near=e,this.renewPoint(),this._elms.near&&this._elms.near.forEach((function(t){t.value=e}))}},{key:"far",get:function(){return this.options.far},set:function(t){var e=t;e=e._frameImages.length-1?0:r+1,t}),!1)),e.entity.billboard.height=new Cesium.CallbackProperty((function(){return a}),!1),e.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return e.options.billboard.show?new Cesium.Cartesian2(0,-a*e.options.billboard.scale-e.options.label.fontSize/2-5):new Cesium.Cartesian2(0,-e.options.label.fontSize/2-5)}),!1)}}))}else{var l=new Image;l.src=i;var c=36,u=document.createElement("canvas");l.onload=function(){var t=l.width/l.height;l.width=100,l.height=100/t;var i=l.width,n=l.height,o=u.getContext("2d",{willReadFrequently:!0});u.width=i,u.height=n,o.drawImage(l,0,0,i,n),c=n*(31/i),e.entity.billboard.imgWidth=i,e.entity.billboard.imgHeight=n,e.entity&&(e.entity.billboard.image=u),e.entity.billboard.height=new Cesium.CallbackProperty((function(){return c}),!1),e.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return e.options.billboard.show?new Cesium.Cartesian2(0,-c*e.options.billboard.scale-e.options.label.fontSize/2-5):new Cesium.Cartesian2(0,-e.options.label.fontSize/2-5)}),!1),c=n*(31/i)},l.onerror=function(t){u.width=0,u.height=0,c=0,e.entity.billboard.imgWidth=0,e.entity.billboard.imgHeight=0,e.entity&&(e.entity.billboard.image=u),e.entity.billboard.height=new Cesium.CallbackProperty((function(){return 0}),!1),e.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return new Cesium.Cartesian2(0,0)}),!1),c=36}}}},{key:"billboardScale",get:function(){return this.options.billboard.scale},set:function(t){this.options.billboard.scale=t,this.renewPoint(),this._elms.billboardScale&&this._elms.billboardScale.forEach((function(e){e.value=t}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.entity&&(this.entity.label.show=t),this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.value=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.renewPoint();var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.renewPoint(),this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t||"#00ffff",this.renewPoint(),this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.label.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(0,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
        '+this.options.attribute.link.content[s].url+'
        \n
        \n \n \n
        \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
        '+this.options.attribute.vr.content[s].url+'
        \n
        \n \n \n
        \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
        '+this.options.attribute.rtmp.content[s].url+'
        \n
        \n \n \n
        \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={rtmpEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.rtmp.content;case 2:e.attributeRtmp=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-rtmp")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.rtmp.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.rtmp.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0&&void 0!==m[0]&&m[0],i=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=41;break}return t.next=7,new rn(this.sdk,this.options,{title:"点属性",left:"180px",top:"100px",confirmCallBack:function(t){d.labelText=d.labelText.trim(),d.labelText||(d.labelText="未命名对象"),d.originalOptions=d.deepCopyObj(d.options),d.previous={positions:_o({},d.options.positions)},d._DialogObject.close();var e=d.deepCopyObj(d.options);e.host="",d.Dialog.confirmCallBack&&d.Dialog.confirmCallBack(e),Pe(d.sdk,d.options.id),se(d.sdk,d.options.id)},resetCallBack:function(){d.reset(),d.Dialog.resetCallBack&&d.Dialog.resetCallBack()},removeCallBack:function(){d.Dialog.removeCallBack&&d.Dialog.removeCallBack()},closeCallBack:function(){d.positionEditing=!1,setTimeout((function(){d.reset(),d.Dialog.closeCallBack&&d.Dialog.closeCallBack()}),0)},showCallBack:function(t){d.show=t,d.Dialog.showCallBack&&d.Dialog.showCallBack()},translationalCallBack:function(){d.positionEditing=!d.positionEditing},updateHeightCallBack:function(){d.updateHeight()}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" billboard-object",(n=document.createElement("div")).innerHTML=An(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,new kn("point-object-edit-tabs",void 0,this.sdk),s=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){d.labelColor=t},clear:function(){d.labelColor="rgba(255,255,255,1)"}}),r=n.getElementsByTagName("*"),this._EventBinding.on(this,r),this._elms=this._EventBinding.element,this._elms.labelColor=[s],setTimeout(o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,m,f,v,g,b,C,w,k,x,_,E,S,D,P,M,O;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(d.attributeLink=d.options.attribute.link.content,d.attributeVr=d.options.attribute.vr.content,d.attributeRtmp=d.options.attribute.rtmp.content,d.cameraSelect&&d.cameraSelect(),d.ISCSelect&&d.ISCSelect(),d.goodsSelect&&d.goodsSelect(),(e=document.createElement("div")).className="col",e.style.flex="0 0 110px",e.innerHTML='\n 属性框\n \n ',d._DialogObject._element.content.getElementsByClassName("attribute")[0].getElementsByClassName("row")[0].appendChild(e),(i=e.getElementsByClassName("btn-switch")[0]).checked=d.attributeBoxState,i.addEventListener("change",(function(t){d.attributeBoxState=i.checked})),n=d.attributeSelect,!(o=d._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0])){t.next=31;break}(s=Y(o,".attribute-select")).legp_search(n),r=d._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],l=0;case 22:if(!(l=0)){t.next=24;break}if(!v[g].position){t.next=21;break}return f=v[g],t.abrupt("break",24);case 21:g--,t.next=17;break;case 24:return f&&f.position&&(i=this.cartesian3Towgs84(f.position,this.sdk.viewer).alt),t.prev=25,t.next=28,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.positions.lng,this.options.positions.lat)]);case 28:b=t.sent,t.next=33;break;case 31:t.prev=31,t.t0=t.catch(25);case 33:if((void 0===i||i0&&void 0!==w[0]?w[0]:{},pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=26;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=_o({},this.options.position):this.options.positions?l=_o({},this.options.positions):this.options.center?l=_o({},this.options.center):this.options.start?l=_o({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=19;break}c=[],u=wo(this.sdk.entityMap);try{for(u.s();!(p=u.n()).done;)(h=y()(p.value,2))[0],"RadarScanStereoscopic"===(d=h[1]).type&&d.entity&&c.push(d.entity)}catch(t){u.e(t)}finally{u.f()}return t.next=18,this.getClampToHeight(l,c);case 18:l.alt=t.sent;case 19:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=33;break;case 26:m=[],f=wo(this.sdk.entityMap);try{for(f.s();!(v=f.n()).done;)(g=y()(v.value,2))[0],"RadarScanStereoscopic"===(b=g[1]).type&&b.entity&&m.push(b.entity)}catch(t){f.e(t)}finally{f.f()}return t.next=31,this.getClampToHeight(this.options.positions,m);case 31:C=t.sent,this.sdk.viewer.camera.flyTo({orientation:e.orientation,destination:Cesium.Cartesian3.fromDegrees(this.options.positions.lng,this.options.positions.lat,C+(e.height||500))});case 33:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"setPosition",value:function(t){this.options.positions.lng=t.position.lng,this.options.positions.lat=t.position.lat,this.options.positions.alt=t.position.alt,this.renewPoint()}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,this.event&&this.event.destroy(),this.event=new X(this.sdk),!0===t){this.picking=!1,this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.previous={positions:_o({},this.options.positions)};var i=function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.alt=n.alt,e.previous={positions:_o({},e.options.positions)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.entity.position=new Cesium.CallbackProperty((function(){return i}),!1),e.positionEditing=!1};this.event.mouse_move((function(t,i){e.entity.position=new Cesium.CallbackProperty((function(){return i}),!1),e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left(i),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,n){var o=new Date;e.event.gesture_pinck_end((function(){var s=new Date;t.position1.x,t.position2.x,t.position1.y,t.position2.y;s-o>=500?e.positionEditing=!1:i(0,n)}))}))}else this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){})),this.event.destroy(),this.event=null),this.tip&&this.tip.destroy(),this.lng=this.previous.positions.lng,this.lat=this.previous.positions.lat,this.alt=this.previous.positions.alt,this.renewPoint()}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.positions.lng,this.options.positions.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}},{key:"setCustomView",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=4;break}this.options.customView=e,t.next=19;break;case 4:if(i=this.sdk.viewer.camera,n=this.cartesian3Towgs84(i.position,this.sdk.viewer),o={lng:0,lat:0},s=_o({},n),this.options.positions?o=_o({},this.options.positions):(this.options.hasOwnProperty("lng")&&(o.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(o.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(o.alt=this.options.alt)),o.hasOwnProperty("alt")){t.next=16;break}r=[],l=wo(this.sdk.entityMap);try{for(l.s();!(c=l.n()).done;)(u=y()(c.value,2))[0],"RadarScanStereoscopic"===(p=u[1]).type&&p.entity&&r.push(p.entity)}catch(t){l.e(t)}finally{l.f()}return t.next=15,this.getClampToHeight(o,r);case 15:o.alt=t.sent;case 16:s={lng:n.lng-o.lng,lat:n.lat-o.lat,alt:n.alt-o.alt},this.options.customView={orientation:{heading:Cesium.Math.toDegrees(i.heading),pitch:Cesium.Math.toDegrees(i.pitch),roll:Cesium.Math.toDegrees(i.roll)},relativePosition:s},this.originalOptions&&(this.originalOptions.customView=this.options.customView);case 19:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"attributeBoxState",get:function(){return this.options.attributeBoxState},set:function(t){var e=this;if(t=!!t,this.options.attributeBoxState=t,document.addEventListener("mouseup",Do(To,this)),document.addEventListener("mouseleave",Do(To,this)),this.attributeElm&&(this.sdk.viewer._element.removeChild(this.attributeElm),this.attributeElm=null),this.sdk.viewer.scene.postRender.removeEventListener(Do(Oo,this)),t&&this.sdk&&this.sdk.viewer&&this.sdk.viewer._element&&this.show){var i=document.createElement("div");this.attributeElm=i,i.className="billboard-attribute-box",i.style.top="0px",i.style.left="0px",i.style.width=0,i.style.height=0,Gt&&(i.style.display="none"),this.sdk.viewer._element.appendChild(i);for(var n="",o="",s="",a=0;a');if(this.options.attribute.goods&&this.options.attribute.goods.content&&this.options.attribute.goods.content.length>0){o+='\n
        \n
        \n
        \n
        序号
        \n
        名称
        \n
        数量
        \n
        \n
        \n
        \n ';for(var r=0;r\n
        '.concat(r+1,'
        \n
        ').concat(this.options.attribute.goods.content[r].name,'
        \n
        ').concat(this.options.attribute.goods.content[r].cnt,"
        \n
        ");o+="
        "}this.options.richTextContent&&(s='\n '.concat(this.options.richTextContent,"\n "));var l='\n \n \n ';if(l+=n||o||s?'\n \n '.concat(s,"\n ").concat(o,"\n ").concat(n,'\n \n
        '):'

        暂无属性信息

        ',i.innerHTML=l,i.getElementsByClassName("tabs")[0])new kn(i.getElementsByClassName("tabs")[0],void 0,this.sdk);for(var c=i.getElementsByTagName("img"),u=0;u=t._frameImages.length-1?0:r+1,e}),!1),vi(t.sdk,t.entity),t.attributeBoxState&&(t.attributeBoxState=!0))}}))}else{var h=new Image;switch(h.src=c||t.getSourceRootPath()+"/img/A-ablu-blank.png",t.options.heightMode){case 2:case"2":i=Cesium.HeightReference.CLAMP_TO_GROUND}e=document.createElement("canvas"),h.onload=function(){var i=h.width/h.height;h.width=100,h.height=100/i;var o=h.width,s=h.height,a=e.getContext("2d",{willReadFrequently:!0});e.width=o,e.height=s,a.drawImage(h,0,0,o,s),n=s*(31/o),t.entity&&(t.entity.billboard.imgWidth=o,t.entity.billboard.imgHeight=s,t.entity.billboard.image=e,vi(t.sdk,t.entity),t.attributeBoxState&&(t.attributeBoxState=!0))},h.onerror=function(i){e.width=0,e.height=0,n=0,t.entity&&(t.entity.billboard.imgWidth=0,t.entity.billboard.imgHeight=0,t.entity.billboard.image=e,vi(t.sdk,t.entity),t.attributeBoxState&&(t.attributeBoxState=!0))}}t.entity=new Cesium.Entity({show:t.options.show,id:t.options.id,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),billboard:{image:a?new Cesium.CallbackProperty((function(){var e=t._frameImages[r];return r=r>=t._frameImages.length-1?0:r+1,e}),!1):e,scale:t.options.billboard.scale,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:Number.POSITIVE_INFINITY}),!1),heightReference:i,color:t.options.billboard.show?void 0:new Cesium.Color(1,1,1,0),width:31,height:new Cesium.CallbackProperty((function(){return n}),!1),verticalOrigin:Cesium.VerticalOrigin.BOTTOM},label:{show:t.options.label.show,text:t.options.label.text,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:Number.POSITIVE_INFINITY}),!1),heightReference:i,font:t.options.label.fontSize+"px "+l,fillColor:Cesium.Color.fromCssColorString(t.options.label.color),pixelOffset:new Cesium.CallbackProperty((function(){return t.options.billboard.show?new Cesium.Cartesian2(0,-n*t.options.billboard.scale-t.options.label.fontSize/2-5):new Cesium.Cartesian2(0,-t.options.label.fontSize/2-5)}),!1),outlineColor:Cesium.Color.BLACK,outlineWidth:1,style:Cesium.LabelStyle.FILL_AND_OUTLINE}}),t.entity.billboard.imgWidth=31,t.entity.billboard.imgHeight=36,t.entity.position=Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),3==t.options.heightMode&&t.updateHeight(),t.renewPoint(),Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id),t.options.billboard.isSelect&&t.selectBillboard()}}]);var i,n,s,r,l}(Wn);function Lo(t){return'\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n 投影面积:\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(Ln(t),'\n \n \n
        \n
        \n 高度模式\n
        \n
        \n
        \n Z值统一增加\n
        \n \n m\n \n
        \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        经度(X)
        \n
        纬度(Y)
        \n
        高度(Z)
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n 面颜色\n
        \n
        \n
        \n 描边颜色\n
        \n
        \n
        \n 描边宽度\n
        \n \n px\n \n
        \n
        \n
        \n
        \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体选择\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ','\n
        \n
        \n
        \n
        \n \n ')}function Ao(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function jo(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ro(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),(i=Fo(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"rgba(255, 0, 0, 0.5)",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.positions=n.positions||[],i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",i.entity,i.event=new X(i.sdk),i.operate={},i._elms={},i.Dialog=o,i.nodePoints=[],n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",!i.options.positions||i.options.positions.length<3)i._error="多边形最少需要三个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{if(!i.options.height&&0!==i.options.height){for(var s=i.options.positions[0].alt,a=1;athis.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
        '+this.options.attribute.link.content[s].url+'
        \n
        \n \n \n
        \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
        '+this.options.attribute.vr.content[s].url+'
        \n
        \n \n \n
        \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c'.concat(i+1,'\n
        \n
        \n
        \n ');var s=o.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.positions[i].lng.toFixed(8),s.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.positions[i].lng.toFixed(8);var l=o.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.positions[i].lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.positions[i].lat.toFixed(8);var p=o.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),s.addEventListener("dblclick",(function(){s.innerHTML="",r.value=Number(n.options.positions[i].lng.toFixed(8)),s.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.positions[i].lng.toFixed(8)),s.innerHTML="",s.appendChild(a)})),r.addEventListener("input",(function(){n.options.positions[i].lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.positions[i].lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.positions[i].lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.positions[i].lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.positions[i].lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.positions[i].lat.toFixed(8),n.height=n.height})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(h),n._elms.altInput.push(d),t.appendChild(o)},o=0;o0&&void 0!==v[0]?v[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=jo({},this.options.position):this.options.positions?l=jo({},this.options.positions[0]):this.options.center?l=jo({},this.options.center):this.options.start?l=jo({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=51;break;case 25:c=[],t.t0=this.heightMode,t.next=0===t.t0||"0"===t.t0?29:1===t.t0||"1"===t.t0?31:2===t.t0||"2"===t.t0?33:35;break;case 29:case 31:return u=!1,t.abrupt("break",35);case 33:return u=!0,t.abrupt("break",35);case 35:if(!u){t.next=48;break}p=0;case 37:if(!(p=500?i.positionEditing=!1:y(0,e)}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(n.positions)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(n.positions),[n.positions[0],n.positions[1]])}),!1)}else{this.previous?this.positions=L()(this.previous.positions):this.previous={positions:L()(this.positions)},this.sdk&&this.sdk.viewer&&this.label&&this.label.entity||(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.destroy()),this.tip&&this.tip.destroy();for(var b=[[]],C=0;C0?new Cesium.PolygonHierarchy(m):new Cesium.PolygonHierarchy(o)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return m.length>0?[].concat(m,[m[0],m[1]]):[].concat(L()(o),[o[0],o[1]])}),!1)}},{key:"renewPositions",value:function(){var t=this;if(!this._error){for(var e=!1,i=[],n=this.options.positions,o=0;o0&&void 0!==h[0]?h[0]:{domid:"",x:10,y:10}).x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10,i=[[]],n=0;nNumber(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i1&&void 0!==arguments[1]?arguments[1]:function(){};t.positionEditing=!1,setTimeout((function(){var i=L()(t.options.positions);if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var n,s,r=function(){var e=o()(a.a.mark((function e(){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=L()(t.sdk.viewer.entities.values),n=0;case 2:if(!(n=3?[].concat(L()(l),[l[0],l[1],l[2]]):l}),!1);var m=L()(t.sdk.viewer.entities.values);if(t.options.positions.length<3)t.getClampToHeight({lng:t.options.positions[0].lng,lat:t.options.positions[0].lat},m).then((function(e){t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,e]}));else{for(var f=[[]],v=0;v=500?d():h(o,i)}))})),r()}),200)}}),50)}},{key:"closeNodeEdit",value:function(t){if(t.sdk&&t.sdk.viewer){YJ.Measure.SetMeasureStatus(!1),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e\n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(Ln(t),'\n \n \n
        \n
        \n 高度模式\n
        \n
        \n
        \n Z值统一增加\n
        \n \n m\n \n
        \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        经度(X)
        \n
        纬度(Y)
        \n
        高度(Z)
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n 线条颜色\n
        \n
        \n
        \n 线条宽度\n
        \n \n px\n \n
        \n
        \n
        \n 线条形式\n
        \n
        \n
        \n
        \n
        \n 首尾相连\n \n
        \n
        \n 线段圆滑\n \n
        \n
        \n
        \n
        \n
        \n
        \n 线段缓冲\n \n
        \n
        \n 缓冲宽度\n
        \n \n m\n \n
        \n
        \n
        \n 缓冲颜色\n
        \n
        \n
        \n
        \n
        \n 首尾反向\n \n
        \n
        \n 流动速率\n
        \n \n \n
        \n
        \n
        \n 线条间距\n
        \n \n \n \n
        \n
        \n
        \n
        \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体选择\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ','\n
        \n \x3c!-- --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!-- 指令--\x3e\n \x3c!-- --\x3e\n \x3c!-- --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!-- --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!-- 设置操作点--\x3e\n \x3c!-- --\x3e\n \x3c!-- --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n
        \n
        \n
        \n \n ')}function Vo(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Go(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Go(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Go(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);iNumber(e.target.max)&&(i=Number(e.target.max),e.target.value=i),e.target.min&&i1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),this.sdk=e,this.viwer=this.sdk.viewer,this.options=i,this.options.position=i.position||{},this.options.rotate=i.rotate||{},this.options.position.lng=this.options.position.lng||0,this.options.position.lat=this.options.position.lat||0,this.options.position.alt=this.options.position.alt||0,this.options.rotate.x=this.options.rotate.x||0,this.options.rotate.y=this.options.rotate.y||0,this.options.rotate.z=this.options.rotate.z||0,this.activeAxis,this.activeCircle,this.activeModelParam,this.origin,this.rayX,this.rayY,this.rayZ,this.arrow={},this.activeState,this.coordArrows=[],this.coordCircles=[],this.MapEvent=new X(this.sdk)}),[{key:"position",get:function(){return this.options.position},set:function(t){this.options.position=t,this.againArrow(),this.againCircle()}},{key:"rotate",get:function(){return this.options.rotate},set:function(t){this.options.rotate=t}},{key:"initParam",value:function(){return this._params={tx:this.options.position.lng,ty:this.options.position.lat,tz:this.options.position.alt,rx:this.options.rotate.x,ry:this.options.rotate.y,rz:this.options.rotate.z},Jo(Jo({},this.options.position),this.options.rotate)}},{key:"editTranslational",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:w=function(t){if(e.activeAxis){var i=t.startPosition.y-t.endPosition.y,n={x:t.endPosition.x-y.x,y:t.endPosition.y-y.y},o=r.camera.getPickRay(n),s=r.scene.globe.pick(o,r.scene),a=new Cesium.Cartesian3,l=Cesium.Transforms.eastNorthUpToFixedFrame(r.camera.position);Cesium.Matrix4.inverse(l,l),Cesium.Matrix4.multiplyByPoint(l,s,a),Cesium.Cartesian3.normalize(a,a);var c=e.initParam(),u=90+Cesium.Math.toDegrees(Math.asin(a.z)),p=Cesium.Cartographic.fromCartesian(r.camera.position).height,h=e.activeModelParam.alt,d=p/Math.cos(Cesium.Math.toRadians(u));new Cesium.EllipsoidGeodesic(Cesium.Cartographic.fromCartesian(s),Cesium.Cartographic.fromCartesian(r.camera.position)),s=Cesium.Ray.getPoint(o,d*(1-h/p));var m=Cesium.Cartographic.fromCartesian(s),f=Cesium.Math.toDegrees(m.longitude),v=Cesium.Math.toDegrees(m.latitude);switch(e.activeAxis._name){case"model_edit_xAxis":e._params.tx=f,e._params.ty=e.activeModelParam.lat,e._params.tz=h,e.origin=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt);var g=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng-.001,c.lat,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),k=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat-.001,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),x=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);e.rayX=new Cesium.Ray(e.origin,g),e.rayY=new Cesium.Ray(e.origin,k),e.rayZ=new Cesium.Ray(e.origin,x);break;case"model_edit_yAxis":e._params.tx=e.activeModelParam.lng,e._params.ty=v,e._params.tz=h,e.origin=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt);var _=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng-.001,c.lat,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),E=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat-.001,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),S=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);e.rayX=new Cesium.Ray(e.origin,_),e.rayY=new Cesium.Ray(e.origin,E),e.rayZ=new Cesium.Ray(e.origin,S);break;case"model_edit_zAxis":e.activeModelParam.alt+=Cesium.Cartesian3.distance(r.camera.position,Cesium.Cartesian3.fromDegrees(e.options.position.lng,e.options.position.lat,e.options.position.alt))/4300*i*3,e._params.tx=e.activeModelParam.lng,e._params.ty=e.activeModelParam.lat,e._params.tz=e.activeModelParam.alt,e.origin=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,e.activeModelParam.alt);var D=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng-.001,c.lat,e.activeModelParam.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),P=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat-.001,e.activeModelParam.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),M=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat,e.activeModelParam.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);e.rayX=new Cesium.Ray(e.origin,D),e.rayY=new Cesium.Ray(e.origin,P),e.rayZ=new Cesium.Ray(e.origin,M)}e.updateModel(e._params.tx,e._params.ty,e._params.tz,e._params.rx,e._params.ry,e._params.rz),e.againArrow()}else{var O=Date.now();if(O-b<100)return clearTimeout(C),void(C=setTimeout((function(){w(t)}),100));clearTimeout(C),b=O;for(var T=e.coordArrows,N=0;N=0;L--){var A=B[L];if(A&&A.primitive&&A.id)switch(A.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return void(A.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}}},this.destroy(),this.activeState="translational",this.MapEvent=new X(this.sdk),e=this,i=this.initParam(),n=i.lng,o=i.lat,s=i.alt,r=this.viwer,this.origin=Cesium.Cartesian3.fromDegrees(n,o,s),l=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n-.001,o,s),new Cesium.Cartesian3),new Cesium.Cartesian3),c=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n,o-.001,s),new Cesium.Cartesian3),new Cesium.Cartesian3),u=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n,o,s-1),new Cesium.Cartesian3),new Cesium.Cartesian3),this.rayX=new Cesium.Ray(this.origin,l),this.rayY=new Cesium.Ray(this.origin,c),this.rayZ=new Cesium.Ray(this.origin,u),this.arrow.positionX=Cesium.Ray.getPoint(this.rayX,0),this.arrow.positionY=Cesium.Ray.getPoint(this.rayY,0),this.arrow.positionZ=Cesium.Ray.getPoint(this.rayZ,0),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(n,o,s)),h=r.camera.position,d=Cesium.Cartesian3.distance(h,this.origin),m=d/15,Cesium.Matrix4.multiplyByScale(p,new Cesium.Cartesian3(m,m,m),p),f=this.createAxisArrow("model_edit_xAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(1,0,0)],p,Cesium.Color.RED),v=this.createAxisArrow("model_edit_yAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(0,1,0)],p,Cesium.Color.LIME),g=this.createAxisArrow("model_edit_zAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(0,0,1)],p,Cesium.Color.BLUE),this.viwer.scene.primitives.add(f),this.viwer.scene.primitives.add(v),this.viwer.scene.primitives.add(g),this.againArrow(),this.viwer.camera.percentageChanged=.001,this.viwer.camera.changed.addEventListener(this.againArrow,{_that:this}),y={x:0,y:0},b=0,this.MapEvent.mouse_move((function(t,e){w(t)})),this.MapEvent.mouse_left_down((function(t,i){var n=r.scene.cartesianToCanvasCoordinates(k.origin);y.x=t.position.x-Math.floor(n.x),y.y=t.position.y-Math.floor(n.y);for(var o=r.scene.drillPick(t.position,10),s=o.length-1;s>=0;s--){var a=o[s];if(a&&a.primitive&&a.primitive._name)if(e.activeAxis)e.activeAxis=null,e.activeModelParam=null,e.controllerCallBack;else switch(a.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return r.scene.screenSpaceCameraController.enableRotate=!1,e.activeAxis=a.primitive,e.activeModelParam=e.initParam(),void(a.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}})),this.MapEvent.mouse_left_up((function(t){r.scene.screenSpaceCameraController.enableRotate=!0;for(var i=0;i360&&(r._params.rx=1),r._params.rx<0&&(r._params.rx=360),Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(r._params.rx)),r._params.ry-=i,r._params.ry>360&&(r._params.ry=1),r._params.ry<0&&(r._params.ry=360),r._params.rz-=n,r._params.rz>360&&(r._params.rz=1),r._params.rz<0&&(r._params.rz=360),r.updateModel(r._params.tx,r._params.ty,r._params.tz,r._params.rx,r._params.ry,r._params.rz)}else{var c=Date.now();if(c-D<100)return clearTimeout(P),void(P=setTimeout((function(){M(t)}),100));clearTimeout(P),D=c;for(var u=s.coordCircles,p=0;p3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this._params.tx=t=parseFloat(parseFloat(t).toFixed(8)),this._params.ty=e=parseFloat(parseFloat(e).toFixed(8)),this._params.tz=i=parseFloat(parseFloat(i).toFixed(2)),this._params.rx=n=parseFloat(n),this._params.ry=o=parseFloat(o),this._params.rz=s=parseFloat(s),this.options.position.lng=t,this.options.position.lat=e,this.options.position.alt=i,this.options.rotate={x:n,y:o,z:s},this.controllerCallBack}},{key:"controllerCallBack",get:function(){this._controllerCallBack&&this._controllerCallBack(this.options,!this.activeAxis)},set:function(t){this._controllerCallBack=t}},{key:"createAxisArrow",value:function(t,e,i,n){var o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,width:20}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:n}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return o._name=t,this.coordArrows.push(o),o}},{key:"createAxisCircular",value:function(t,e,i,n){var o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.EllipseGeometry({center:{x:1,y:1,z:1},semiMinorAxis:5e5,semiMajorAxis:1e6,rotation:Cesium.Math.PI_OVER_FOUR,vertexFormat:Cesium.VertexFormat.POSITION_AND_ST})}),releaseGeometryInstances:!1,appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.YELLOW}}})}),modelMatrix:i});return o._name=t,this.coordArrows.push(o),o}},{key:"createAxisSphere",value:function(t,e,i,n,o){var s=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,width:5}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineColorAppearance({translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return s._radius=o,s._name=t,this.coordCircles.push(s),s}},{key:"removeCoordArrows",value:function(){for(var t=0;t=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Zo(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),ts(i=Qo(this,e,[t,n]),ns,void 0),i.options.name=n.name||"未命名对象",i.options.width=n.width||0===n.width?n.width:3,i.options.color=n.color||"#ff0000",i.options.type=n.type?Number(n.type):0,i.options["nose-to-tail"]=n["nose-to-tail"]||!1,i.options.smooth=n.smooth||!1,i.options.extend=n.extend||!1,i.options.rotate=!n.rotate&&!1!==n.rotate||n.rotate,i.options.space=n.space||1,i.options.speed=n.speed||10,i.options.dashSize=n.dashSize||.03,i.options["length-unit"]=n["length-unit"]||"米",i.options["fit-length-unit"]=n["fit-length-unit"]||"米",i.options["words-name"]=n["words-name"]||"空间长度",i.options["extend-width"]=n["extend-width"]||0===n["extend-width"]?n["extend-width"]:10,i.options["extend-color"]=n["extend-color"]||"rgba(255,255,80,0.3)",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i._elms=[],n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.operate={},i.nodePoints=[],i.unitNum=0,i.inputSpeed=n.speed&&100*Math.pow(n.speed,-1)||10,i.Dialog=o,!i.options.positions||i.options.positions.length<2)i._error="线段最少需要两个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{for(var s=0;s2)switch(t){case"米":this.length=this.noseToTail?this.options.fitLengthByMeter:this.options.lengthByMeter;break;case"千米":this.length=this.noseToTail?(this.options.fitLengthByMeter/1e3).toFixed(5):(this.options.lengthByMeter/1e3).toFixed(5);break;default:this.length=this.noseToTail?this.options.fitLengthByMeter:this.options.lengthByMeter}else{var e=this.noseToTail?this.options.fitLengthByMeter:this.options.lengthByMeter;this.lengthUnit=e>1e3||1e3==e?"千米":"米"}}},{key:"wordsName",get:function(){return this.options["words-name"]},set:function(t){this.options["words-name"]=t,this._elms.wordsName&&this._elms.wordsName.forEach((function(e){e.value=t}));var e=this;if(this.noseToTail)this.renewPositions(this.options.positions);else this.computeDistance(this.options.positions,2,t).then((function(t){e.options.lengthByMeter=t,e.lengthUnit=e.options["length-unit"]}))}},{key:"fitLengthUnit",get:function(){return this.options["fit-length-unit"]},set:function(t){if(this.options["fit-length-unit"]=t,this._elms.fitLengthUnit&&this._elms.fitLengthUnit.forEach((function(e){e.value=t})),this.options.fitLengthByMeter)switch(t){case"米":this.fitLength=this.options.fitLengthByMeter;break;case"千米":this.fitLength=Number((this.options.fitLengthByMeter/1e3).toFixed(5));break;default:this.fitLength=this.options.fitLengthByMeter}}},{key:"lineWidth",get:function(){return this.options.width},set:function(t){var e=this;this.options.width=t||0==t?t:3,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(t){t.value=e.options.width})),this.entity&&this.entity.polyline&&(this.entity.polyline.width=this.entity.polyline.width+t-this.entity.polyline.oriWidth,this.entity.polyline.oriWidth=this.options.width)}},{key:"lineType",get:function(){return this.options.type},set:function(t){var e=this,i=[{name:'实线',value:"实线",key:0,icon:"line"},{name:'虚线',value:"虚线",key:1,icon:"dash-line"},{name:'泛光',value:"泛光",key:2,icon:"light-line"},{name:'尾迹光线',value:"尾迹光线",key:3,icon:"tail-line"},{name:'多尾迹光线',value:"多尾迹光线",key:4,icon:"mult-tail-line"},{name:'流动虚线1',value:"流动虚线1",key:5,icon:"flow-dash-line1"},{name:'流动虚线2',value:"流动虚线2",key:6,icon:"flow-dash-line2"},{name:'流动箭头1',value:"流动箭头1",key:7,icon:"pic-line1"},{name:'流动箭头2',value:"流动箭头2",key:8,icon:"pic-line2"},{name:'流动箭头3',value:"流动箭头3",key:9,icon:"pic-line3"},{name:'流动箭头4',value:"流动箭头4",key:10,icon:"pic-line4"},{name:'流动箭头5',value:"流动箭头5",key:11,icon:"pic-line5"},{name:'流动箭头6',value:"流动箭头6",key:12,icon:"pic-line6"}];this.options.type=Number(t);for(var n=function(n){if(i[n].key===Number(t))return e._elms.lineType&&e._elms.lineType.forEach((function(t){t.value=i[n].value,2this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
        '+this.options.attribute.link.content[s].url+'
        \n
        \n \n \n
        \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
        '+this.options.attribute.vr.content[s].url+'
        \n
        \n \n \n
        \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c700?c*=m/u/(e.space*(i.width/i.height*5)+1):c=void 0,this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D?c:Re().viewer.entities.getById(this.options.id).polyline.oriRepeatX}}},{key:"edit",value:(l=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=32;break}return o=function(t){"2"!==t&&2!==t||(2实线',value:"实线",key:0,icon:"line"},{name:'虚线',value:"虚线",key:1,icon:"dash-line"},{name:'泛光',value:"泛光",key:2,icon:"light-line"},{name:'尾迹光线',value:"尾迹光线",key:3,icon:"tail-line"},{name:'多尾迹光线',value:"多尾迹光线",key:4,icon:"mult-tail-line"},{name:'流动虚线1',value:"流动虚线1",key:5,icon:"flow-dash-line1"},{name:'流动虚线2',value:"流动虚线2",key:6,icon:"flow-dash-line2"},{name:'流动箭头1',value:"流动箭头1",key:7,icon:"pic-line1"},{name:'流动箭头2',value:"流动箭头2",key:8,icon:"pic-line2"},{name:'流动箭头3',value:"流动箭头3",key:9,icon:"pic-line3"},{name:'流动箭头4',value:"流动箭头4",key:10,icon:"pic-line4"},{name:'流动箭头5',value:"流动箭头5",key:11,icon:"pic-line5"},{name:'流动箭头6',value:"流动箭头6",key:12,icon:"pic-line6"}],C=Y(d._DialogObject._element.content.getElementsByClassName("input-select-line-type-box")[0],".input-select-line-type");if(C){C.legp_search(b);var w=document.createElement("i");w.className="icon icon-active",d._DialogObject._element.content.getElementsByClassName("input-select-line-type")[0].getElementsByClassName("cy_datalist")[0].appendChild(w);var k=d._DialogObject._element.content.getElementsByClassName("input-select-line-type")[0].getElementsByTagName("input")[0];d._elms.lineType=[k];for(var x=0;x'.concat(t+1,'\n
        \n
        \n
        \n ');var n=i.getElementsByClassName("lng")[0],o=document.createElement("span");o.innerHTML=d.options.positions[t].lng.toFixed(8),n.appendChild(o);var s=document.createElement("input");s.className="input",s.type="number",s.title="",s.min=-180,s.max=180,s.value=d.options.positions[t].lng.toFixed(8);var a=i.getElementsByClassName("lat")[0],r=document.createElement("span");r.innerHTML=d.options.positions[t].lat.toFixed(8),a.appendChild(r);var l=document.createElement("input");l.className="input",l.type="number",l.title="",l.min=-90,l.max=90,l.value=d.options.positions[t].lat.toFixed(8);var c=i.getElementsByClassName("alt")[0],u=document.createElement("span");u.innerHTML=d.options.positions[t].alt.toFixed(2),c.appendChild(u);var p=document.createElement("input");p.className="input",p.type="number",p.title="",p.min=-9999999,p.max=999999999,p.value=d.options.positions[t].alt.toFixed(2),n.addEventListener("dblclick",(function(){n.innerHTML="",s.value=Number(d.options.positions[t].lng.toFixed(8)),n.appendChild(s),s.focus(),d.positionEditing=!1,e.closeNodeEdit(d)})),s.addEventListener("blur",(function(){s.value=Number(d.options.positions[t].lng.toFixed(8)),n.innerHTML="",n.appendChild(o)})),s.addEventListener("input",(function(){d.options.positions[t].lng=Number(Number(s.value).toFixed(8)),o.innerHTML=d.options.positions[t].lng.toFixed(8);var e=d.renewPositions(d.options.positions);d.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),d.label.position=[d.options.positions[0].lng,d.options.positions[0].lat,e[2]]})),a.addEventListener("dblclick",(function(){a.innerHTML="",l.value=Number(d.options.positions[t].lat.toFixed(8)),a.appendChild(l),l.focus(),d.positionEditing=!1,e.closeNodeEdit(d)})),l.addEventListener("blur",(function(){l.value=Number(d.options.positions[t].lat.toFixed(8)),a.innerHTML="",a.appendChild(r)})),l.addEventListener("input",(function(){d.options.positions[t].lat=Number(Number(l.value).toFixed(8)),r.innerHTML=d.options.positions[t].lat.toFixed(8);var e=d.renewPositions(d.options.positions);d.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),d.label.position=[d.options.positions[0].lng,d.options.positions[0].lat,e[2]]})),c.addEventListener("dblclick",(function(){2!=d.heightMode&&(c.innerHTML="",p.value=Number(d.options.positions[t].alt.toFixed(2)),c.appendChild(p),p.focus(),d.positionEditing=!1,e.closeNodeEdit(d))})),p.addEventListener("blur",(function(){p.value=Number(d.options.positions[t].alt.toFixed(2)),c.innerHTML="",c.appendChild(u)})),p.addEventListener("input",(function(){d.options.positions[t].alt=Number(Number(p.value).toFixed(2)),u.innerHTML=d.options.positions[t].alt.toFixed(2);var e=d.renewPositions(d.options.positions);d.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),d.label.position=[d.options.positions[0].lng,d.options.positions[0].lat,e[2]]})),d._elms.lng.push(o),d._elms.lngInput.push(s),d._elms.lat.push(r),d._elms.latInput.push(l),d._elms.alt.push(u),d._elms.altInput.push(p),T.appendChild(i)},B=0;B0&&void 0!==y[0]?y[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=$o({},this.options.position):this.options.positions?l=$o({},this.options.positions[0]):this.options.center?l=$o({},this.options.center):this.options.start?l=$o({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=43;break;case 25:c=[],t.t0=this.options.heightMode,t.next="0"===t.t0||0===t.t0?29:"1"===t.t0||1===t.t0?31:"2"===t.t0||2===t.t0?36:41;break;case 29:for(p=0;p=500?(i.event.mouse_move((function(){})),i.event.mouse_left((function(){})),i.event.mouse_right((function(){})),i.positionEditing=!1):leftEvent(s,e)}))})),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return l.length>0?l:n}),!1)}else{this.sdk&&this.sdk.viewer&&this.label&&this.label.entity||(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.destroy()),this.tip&&this.tip.destroy();var c=this.renewPositions(this.options.positions);switch(this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(c),this.renewPolygon(c),this.heightMode){case 0:case"0":case 1:case"1":this.label.position=[this.options.positions[0].lng,this.options.positions[0].lat,c[2]],this.options.label.position={lng:this.options.positions[0].lng,lat:this.options.positions[0].lat,alt:c[2]}}}}},{key:"setDIV",value:function(){var t,e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};i.x=i.x||0===i.x?i.x:10,i.y=i.y||0===i.y?i.y:10;for(var n=[],o=0;o0&&void 0!==arguments[0]?arguments[0]:[],e=new Cesium.EntityCollection;if(t.forEach((function(t){(t instanceof Bo||t instanceof zo||t instanceof ho||t instanceof os)&&e.add(t.entity)})),e.values.length){var i=Cesium.exportKml({entities:e});i.then((function(t){ss(t.kml,(new Date).getTime()+".kml")}))}else console.error("允许导出为kml的对象为空")},rs={yingguangse:new Map,gonganlan:new Map,hong:new Map};rs.yingguangse.set("--color-sdk-base","#00ffff"),rs.yingguangse.set("--color-sdk-auxiliary","#004242"),rs.yingguangse.set("--color-sdk-auxiliary-public","#ffffff"),rs.yingguangse.set("--color-sdk-warning-0","#1BF8C3"),rs.yingguangse.set("--color-sdk-warning-1","#F16C55"),rs.yingguangse.set("--color-sdk-warning-2","#FFA145"),rs.yingguangse.set("--color-sdk-warning-3","#FFDF53"),rs.yingguangse.set("--color-sdk-text-head","#FFFFFF"),rs.yingguangse.set("--color-sdk-text-head-1","#E6F7FF"),rs.yingguangse.set("--color-sdk-text-head-2","#ADF1FF"),rs.yingguangse.set("--color-sdk-gradual","#00ffff 6.25%, #00ffff 100%"),rs.yingguangse.set("--color-sdk-bg-gradual","#00ffff33 0%, #00ffff00 100%");var ls,cs,us,ps=null,hs=0,ds=0,ms=function(){var t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return b=function(t){var i=u.getElementsByClassName("tr");i.length>0&&(i[i.length-1].querySelector("input[name='time']").disabled=void 0);var n=u.getElementsByClassName("tr active")[0];n&&(n.className="tr");var o=document.createElement("div");o.className="tr active",o.innerHTML='\n
        视点'.concat(d+1,'
        \n
        \n \n
        \n
        \n
        \n '),o.addEventListener("click",(function(t){if(t.target.parentNode===o){var e=u.getElementsByClassName("tr active")[0];e&&(e.className="tr"),o.className="tr active";for(var n=0;ne+1?(l--,i[l-1].className="tr active"):l==e+1&&(i.length==e&&(l-=1),0!=i.length&&(i[l-1].className="tr active")),i.length>0){var n=i[i.length-1].querySelector("input[name='time']");n.disabled="disabled",n.value=0}break}})),c.addEventListener("input",(function(e){t.duration=Number(c.value),t.duration<0&&(t.duration=0)})),c.addEventListener("blur",(function(){c.value=Number(Number(c.value).toFixed(2)),c.value<0&&(c.value=0)})),u.insertBefore(o,i[l]),l++,i[i.length-1].querySelector("input[name='time']").disabled="disabled"},i=C.length>1&&void 0!==C[1]?C[1]:{},n=C.length>2&&void 0!==C[2]?C[2]:{},o=i.name||"漫游路径",i.points||(i.points=[]),i.repeat&&(hs=Number(i.repeat)),s=e.viewer,r=new fi(e),l=0,ps&&ps.close&&(ps.close(),ps=null),t.next=12,new W(s._container,{title:"飞行漫游",left:"180px",top:"100px",closeCallBack:function(){gs({viewer:s})}});case 12:return ps=t.sent,t.next=15,ps.init();case 15:for((c=document.createElement("div")).className="fly-roam",c.innerHTML='\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 设置总时长\n
        \n \n 秒(s)\n \n
        \n \n
        \n
        \n \n 是否循环播放\n
        \n
        \n
        \n \n
        \n
        \n
        \n \n
        \n
        \n \n
        \n
        \n \n
        \n
        \n \n
        \n
        \n
        \n
        \n
        \n
        序号
        \n
        时长(s)
        \n
        操作
        \n
        \n
        \n
        \n
        \n
        \n

        暂无数据

        \n
        \n
        \n
        \n
        \n \n ',ps.contentAppChild(c),c.getElementsByTagName("*"),u=c.getElementsByClassName("table-body")[0],p=c.getElementsByClassName("table-empty")[0],h={set:function(t,e,i){return t[e]=i,t.length>0?p.style.display="none":p.style.display="flex",!0}},d=0,m=new Proxy([],h),d=0;d0&&vs(e,m,0)})),c.getElementsByClassName("add-point")[0].addEventListener("click",(function(){var t={duration:0,position:r.cartesian3Towgs84(s.camera.position,s),orientation:{heading:s.camera.heading,pitch:s.camera.pitch,roll:s.camera.roll}};m.splice(l,0,t),b(t),d++})),c.getElementsByClassName("modify-point")[0].addEventListener("click",(function(){if(l){var t=r.cartesian3Towgs84(s.camera.position,s);m[l-1].position=t,m[l-1].orientation={heading:s.camera.heading,pitch:s.camera.pitch,roll:s.camera.roll},r.message({text:"操作成功"})}})),g=c.querySelector("input[name='totalTime']"),c.getElementsByClassName("set-total-time-btn")[0].addEventListener("click",(function(){if(m.length>0){for(var t=u.getElementsByClassName("tr"),e=Number((Number(g.value)/(t.length-1)).toFixed(2)),i=0;i1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;ls&&ls.destroy(),(ls=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas)).setInputAction((function(e){gs(t)}),Cesium.ScreenSpaceEventType.RIGHT_CLICK);var s,r=t.viewer;r.camera.cancelFlight(),ii(t),ni(t),r.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(e[i].position.lng,e[i].position.lat,e[i].position.alt),orientation:e[i].orientation,duration:n?e[i-1].duration:.5,maximumHeight:e[i].position.alt,complete:(s=o()(a.a.mark((function n(){return a.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:++i<=e.length-1?fs(t,e,i,!0):ds&&e.length>1?(ds--,fs(t,e,0)):ls&&ls.destroy();case 3:case"end":return n.stop()}}),n)}))),function(){return s.apply(this,arguments)}),easingFunction:n?Cesium.EasingFunction.LINEAR_NONE:Cesium.EasingFunction.EXPONENTIAL_OUT})},vs=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;ds=hs,fs(t,e,i,n)},gs=function(t){t&&t.viewer&&t.viewer.camera.cancelFlight(),ls&&ls.destroy()},ys=null,bs=null,Cs=null,ws=null,ks="uniform sampler2D colorTexture;//输入的场景渲染照片\n varying vec2 v_textureCoordinates;\n uniform float tiltAngle;\n uniform float rainSize;\n uniform float rainWidth;\n uniform float rainSpeed;\n\n float hash(float x){\n return fract(sin(x*133.3)*13.13);\n }\n void main(void){\n float time = czm_frameNumber / rainSpeed;\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 c=vec3(.6,.7,.8);\n float a= tiltAngle;\n float si=sin(a),co=cos(a);\n uv*=mat2(co,-si,si,co);\n uv*=length(uv+vec2(0,4.9))*rainSize+1.;\n float v=1.-sin(hash(floor(uv.x*rainWidth))*2.);\n float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;\n c*=v*b; //屏幕上雨的颜色\n gl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(c,1), 0.5); //将雨和三维场景融合\n }",xs="uniform sampler2D colorTexture;\n varying vec2 v_textureCoordinates;\n uniform float snowSize;\n uniform float snowSpeed;\n \n float snow(vec2 uv,float scale)\n {\n float time = czm_frameNumber / snowSpeed;\n float w=smoothstep(1.,0.,-uv.y*(scale/10.));if(w<.1)return 0.;\n uv+=time/scale;uv.y+=time*2./scale;uv.x+=sin(uv.y+time*.5)/scale;\n uv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.,d;\n p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;d=length(p);k=min(d,k);\n k=smoothstep(0.,k,sin(f.x+f.y)*0.01*snowSize);\n return k*w;\n }\n void main(void){\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 finalColor=vec3(0);\n //float c=smoothstep(1.,0.3,clamp(uv.y*.3+.8,0.,.75));\n float c = 0.0;\n c+=snow(uv,30.)*.0;\n c+=snow(uv,20.)*.0;\n c+=snow(uv,15.)*.0;\n c+=snow(uv,10.);\n c+=snow(uv,8.);\n c+=snow(uv,6.);\n c+=snow(uv,5.);\n finalColor=(vec3(c));\n gl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.5);\n }\n ",_s="\n uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n uniform float visibility;\n uniform vec4 fogColor;\n varying vec2 v_textureCoordinates;\n void main(void)\n {\n vec4 origcolor = texture2D(colorTexture, v_textureCoordinates);\n float depth = czm_readDepth(depthTexture, v_textureCoordinates);\n vec4 depthcolor = texture2D(depthTexture, v_textureCoordinates);\n float f = visibility * (depthcolor.r - 0.3) / 0.2;\n if (f < 0.0) f = 0.0;\n else if (f > 1.0) f = 1.0;\n gl_FragColor = mix(origcolor, fogColor, f);\n }\n ";var Es,Ss,Ds,Ps,Ms,Os,Ts,Ns={},Bs=void 0,Ls=void 0,As=!1,js={};function Is(){if(this.sdk&&this.sdk.viewer){(Ls=this.sdk.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth/2,this.sdk.viewer.canvas.clientHeight/(2-(90+this.sdk.viewer.camera.pitch/(Cesium.Math.PI/180))/110))))||(Ls=this.sdk.viewer.camera.position);var t=cs.cartesian3Towgs84(this.sdk.viewer.camera.position,this.sdk.viewer).alt,e=cs.cartesian3Towgs84(Ls,this.sdk.viewer);t>9e6&&(t=9e6),t<4e5?(this.entity.billboard.show=!0,this.entity.rectangle.show=!1):(this.entity.billboard.show=!1,this.entity.rectangle.show=!0),Bs=new Cesium.Rectangle(Cesium.Math.toRadians(e.lng-t/12e4),Cesium.Math.toRadians(e.lat-t/28e4),Cesium.Math.toRadians(e.lng+t/12e4),Cesium.Math.toRadians(e.lat+t/28e4))}}function Rs(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var Fs,zs,Hs=null,Vs=null,Gs=null,Us=null,Ws=!1,Ys=10,Js="#ffd000",qs=!0,Xs=2.5,Zs="#43cf7c",Ks=!0,$s=1.8,Qs="#ff0000",ta=!1,ea=1,ia="#64b6d9",na=!1,oa=1,sa="#d084d1";function aa(){if(zs){var t=zs.viewer.camera.positionCartographic;Cesium.Math.toDegrees(t.height)<1e6?zs.viewer.scene.globe.material||!0!==Ws||la(zs):ca(zs)}}function ra(){return(ra=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(m=function(t){var e=t.target.value;return(t.target.value||"undefined"!==t.target.dataset.null&&""!==t.target.dataset.null&&!Boolean(t.target.dataset.null))&&(e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e\n
        \n
        \n
        \n 等高线\n \n
        \n
        \n
        \n \n
        \n
        \n
        \n 等高距\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n 选中线颜色\n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 计曲线\n \n
        \n
        \n 计曲线颜色\n
        \n
        \n
        \n 计曲线宽度\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 首曲线\n \n
        \n
        \n 首曲线颜色\n
        \n
        \n
        \n 首曲线宽度\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 间曲线\n \n
        \n
        \n 间曲线颜色\n
        \n
        \n
        \n 间曲线宽度\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 助曲线\n \n
        \n
        \n 助曲线颜色\n
        \n
        \n
        \n 助曲线宽度\n
        \n \n px\n \n
        \n
        \n
        \n
        \n ',Hs.contentAppChild(i),e.viewer.scene.postRender.removeEventListener(aa),e.viewer.scene.postRender.addEventListener(aa),(n=i.getElementsByClassName("show")[0]).checked=Ws,n.addEventListener("change",(function(t){if(t.target.checked){if(Ws=!0,e.viewer.camera.positionCartographic.height>16360){var i=e.viewer.camera.positionCartographic,n={position:{lng:Cesium.Math.toDegrees(i.longitude),lat:Cesium.Math.toDegrees(i.latitude),alt:16360}};Xe(e,n,.5)}la(e)}else Ws=!1,ca(e)})),(o=i.getElementsByClassName("equal-height-distance")[0]).value=Ys,o.addEventListener("blur",(function(t){var e=m(t);Ys=e,o.value=e,Vs&&(Vs.uniforms.spacing=5*Ys)})),new zi({el:i.getElementsByClassName("active-color")[0],size:"mini",alpha:!0,defaultColor:Js,disabled:!1,openPickerAni:"opacity",sure:function(t){Js=t,Vs&&(Vs.uniforms.activeColor=Cesium.Color.fromCssColorString(Js))},clear:function(){Js="rgba(255,255,255,1)",Vs&&(Vs.uniforms.activeColor=Cesium.Color.fromCssColorString(Js))}}),(s=i.getElementsByClassName("index-contour-switch")[0]).checked=qs,s.addEventListener("change",(function(t){qs=t.target.checked,Vs&&(Vs.uniforms.indexContourShow=qs)})),new zi({el:i.getElementsByClassName("index-contour-color")[0],size:"mini",alpha:!0,defaultColor:Zs,disabled:!1,openPickerAni:"opacity",sure:function(t){Zs=t,Vs&&(Vs.uniforms.indexContourColor=Cesium.Color.fromCssColorString(Zs))},clear:function(){Zs="rgba(255,255,255,1)",Vs&&(Vs.uniforms.indexContourColor=Cesium.Color.fromCssColorString(Zs))}}),(r=i.getElementsByClassName("index-contour-width")[0]).value=Xs,r.addEventListener("blur",(function(t){var e=m(t);Xs=e,r.value=e,Vs&&(Vs.uniforms.indexContourWidth=Xs)})),(l=i.getElementsByClassName("intermediate-contour-switch")[0]).checked=Ks,l.addEventListener("change",(function(t){Ks=t.target.checked,Vs&&(Vs.uniforms.intermediateContourShow=Ks)})),new zi({el:i.getElementsByClassName("intermediate-contour-color")[0],size:"mini",alpha:!0,defaultColor:Qs,disabled:!1,openPickerAni:"opacity",sure:function(t){Qs=t,Vs&&(Vs.uniforms.intermediateContourColor=Cesium.Color.fromCssColorString(Qs))},clear:function(){Qs="rgba(255,255,255,1)",Vs&&(Vs.uniforms.intermediateContourColor=Cesium.Color.fromCssColorString(Qs))}}),(c=i.getElementsByClassName("intermediate-contour-width")[0]).value=$s,c.addEventListener("blur",(function(t){var e=m(t);$s=e,c.value=e,Vs&&(Vs.uniforms.intermediateContourWidth=$s)})),(u=i.getElementsByClassName("halfInterval-contour-switch")[0]).checked=ta,u.addEventListener("change",(function(t){ta=t.target.checked,Vs&&(Vs.uniforms.halfIntervalContourShow=ta)})),new zi({el:i.getElementsByClassName("halfInterval-contour-color")[0],size:"mini",alpha:!0,defaultColor:ia,disabled:!1,openPickerAni:"opacity",sure:function(t){ia=t,Vs&&(Vs.uniforms.halfIntervalContourColor=Cesium.Color.fromCssColorString(ia))},clear:function(){ia="rgba(255,255,255,1)",Vs&&(Vs.uniforms.halfIntervalContourColor=Cesium.Color.fromCssColorString(ia))}}),(p=i.getElementsByClassName("halfInterval-contour-width")[0]).value=ea,p.addEventListener("blur",(function(t){var e=m(t);ea=e,p.value=e,Vs&&(Vs.uniforms.halfIntervalContourWidth=ea)})),(h=i.getElementsByClassName("supplementary-contour-switch")[0]).checked=na,h.addEventListener("change",(function(t){na=t.target.checked,Vs&&(Vs.uniforms.supplementaryContourShow=na)})),new zi({el:i.getElementsByClassName("supplementary-contour-color")[0],size:"mini",alpha:!0,defaultColor:sa,disabled:!1,openPickerAni:"opacity",sure:function(t){sa=t,Vs&&(Vs.uniforms.supplementaryContourColor=Cesium.Color.fromCssColorString(sa))},clear:function(){sa="rgba(255,255,255,1)",Vs&&(Vs.uniforms.supplementaryContourColor=Cesium.Color.fromCssColorString(sa))}}),(d=i.getElementsByClassName("supplementary-contour-width")[0]).value=oa,d.addEventListener("blur",(function(t){var e=m(t);oa=e,d.value=e,Vs&&(Vs.uniforms.supplementaryContourWidth=oa)}));case 50:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function la(t){var e=t.viewer.camera.positionCartographic;Cesium.Math.toDegrees(e.height)>1e6||(Gs&&Gs.destroy(),t.viewer.container.getElementsByClassName("YJ-customize-active-height-elm")[0]||t.viewer.container.appendChild(Us),(Gs=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas)).setInputAction((function(e){var i=t.viewer.scene.pickPosition(e.endPosition);if(i){var n=0,o=0;if(t.viewer&&t.viewer._element){var s=t.viewer._element.getElementsByClassName("cesium-widget")[0].getElementsByTagName("canvas")[0];n=s.getBoundingClientRect().top+window.scrollY,o=s.getBoundingClientRect().left+window.scrollX}Us.style.left=e.endPosition.x-50+o+"px",Us.style.top=e.endPosition.y-40+n+"px",Us.style.display="block";var a=Fs.cartesian3Towgs84(i,t.viewer),r=Math.floor(a.alt/Vs.uniforms.spacing)*Vs.uniforms.spacing,l=a.alt-r,c=Vs.uniforms.spacing/(Vs.uniforms.secondaryLinesCount+1),u=Math.floor(l/c)*c+r;a.alt<0&&(a.alt=0),a.alt-u>c/2&&(u+=c),Vs.uniforms.mouseHeight=a.alt,Vs.uniforms.mousePosition=i,Us.innerHTML="".concat(u.toFixed(0))}else Us.style.display="none"}),Cesium.ScreenSpaceEventType.MOUSE_MOVE),t.viewer.scene.globe.material=Vs)}function ca(t){Gs&&(Gs.destroy(),Gs=null),t.viewer.container.getElementsByClassName("YJ-customize-active-height-elm")[0]&&(Us.style.display="none",t.viewer.container.removeChild(Us)),t.viewer.scene.globe.material=null}function ua(){Cesium.Material._materialCache._materials.ElevationContour.fabric.source="\nuniform vec4 activeColor; // 选中颜色\nuniform float spacing; // 等高距\n\n// 计曲线\nuniform bool indexContourShow;\nuniform float indexContourWidth;\nuniform vec4 indexContourColor;\n// 首曲线\nuniform bool intermediateContourShow;\nuniform float intermediateContourWidth;\nuniform vec4 intermediateContourColor;\n// 间曲线\nuniform bool halfIntervalContourShow;\nuniform float halfIntervalContourWidth;\nuniform vec4 halfIntervalContourColor;\n// 助曲线\nuniform bool supplementaryContourShow;\nuniform float supplementaryContourWidth;\nuniform vec4 supplementaryContourColor;\n\nuniform float mouseHeight;\n\nuniform float secondaryLinesCount; // 0=无次线, 1=1条次线, 2=2条次线...\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n // 主等高线计算\n float distanceToMainContour = mod(materialInput.height, spacing);\n \n // 抗锯齿计算\n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n float dxc = abs(dFdx(materialInput.height));\n float dyc = abs(dFdy(materialInput.height));\n float dFMain = max(dxc, dyc) * czm_pixelRatio * indexContourWidth;\n#else\n float dFMain = czm_pixelRatio * indexContourWidth;\n#endif\n\n bool isMainContour = distanceToMainContour < dFMain;\n bool isSecondaryContour = false;\n float dFSecondary = 0.0;\n float secondarySpacing = 0.0;\n bool isHalfInterval = false;\n bool isIntermediate= false;\n\n // 计算当前高度所属的等高线高度\n float mainContourHeight = floor(materialInput.height / spacing) * spacing;\n float secondaryContourHeight = floor(materialInput.height / spacing * (secondaryLinesCount + 1.0)) * spacing / (secondaryLinesCount + 1.0);\n \n // 计算次线在两条主等高线之间的相对位置\n float relativeHeight = materialInput.height - mainContourHeight;\n float normalizedPosition = relativeHeight / spacing;\n \n // 计算次线索引(从主等高线开始计数)\n float lineIndex = floor(normalizedPosition * (secondaryLinesCount + 1.0));\n\n // 只有当存在次线时才计算次线\n if(secondaryLinesCount > 0.0) {\n float secondaryLinesWidth = supplementaryContourWidth;\n secondarySpacing = spacing / (secondaryLinesCount + 1.0);\n float distanceToSecondaryContour = mod(materialInput.height, secondarySpacing);\n \n // 确保次线不会与主线重叠\n float minDistanceToMain = min(distanceToMainContour, spacing - distanceToMainContour);\n bool notCloseToMain = minDistanceToMain > dFMain * 2.0; // 2倍线宽缓冲\n\n\n if (lineIndex > 0.0 && lineIndex < secondaryLinesCount) {\n // 使用mod函数检查余数是否接近0(考虑浮点数精度问题)\n isHalfInterval = abs(mod(lineIndex, 2.0)) < 0.01;\n if(isHalfInterval) {\n secondaryLinesWidth = halfIntervalContourWidth;\n }\n // 使用mod函数检查余数是否接近0(考虑浮点数精度问题)\n isIntermediate = abs(mod(lineIndex, 4.0)) < 0.01;\n if(isIntermediate) {\n secondaryLinesWidth = intermediateContourWidth;\n }\n }\n\n\n\n\n\n\n\n\n \n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n dFSecondary = max(dxc, dyc) * czm_pixelRatio * secondaryLinesWidth;\n#else\n dFSecondary = czm_pixelRatio * secondaryLinesWidth;\n#endif\n\n isSecondaryContour = (distanceToSecondaryContour < dFSecondary) && notCloseToMain;\n }\n\n // 高亮判断\n bool shouldHighlight = false;\n if(isMainContour && abs(mainContourHeight - mouseHeight) < 0.5 * (spacing/(secondaryLinesCount+1.0))) {\n shouldHighlight = true;\n } else if(isSecondaryContour && abs(secondaryContourHeight - mouseHeight) < 0.5 * (spacing/(secondaryLinesCount+1.0))) {\n shouldHighlight = true;\n }\n\n // 颜色输出\n vec4 outColor;\n if(shouldHighlight) {\n outColor = czm_gammaCorrect(vec4(activeColor.rgb, activeColor.a));\n } else if(isMainContour) {\n float a = indexContourColor.a;\n if(!indexContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(indexContourColor.rgb, a));\n } else if(isSecondaryContour) {\n float a = supplementaryContourColor.a;\n if(!supplementaryContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(supplementaryContourColor.rgb, a));\n if(isHalfInterval) {\n float a = halfIntervalContourColor.a;\n if(!halfIntervalContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(halfIntervalContourColor.rgb, a));\n }\n if(isIntermediate) {\n float a = intermediateContourColor.a;\n if(!intermediateContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(intermediateContourColor.rgb, a));\n }\n } else {\n outColor = vec4(0.0);\n }\n\n if(materialInput.height<0.0) {\n outColor = vec4(0.0);\n }\n\n material.diffuse = outColor.rgb;\n material.alpha = outColor.a;\n return material;\n}\n",Vs=new Cesium.Material({fabric:{type:"ElevationContour",uniforms:{spacing:50,activeColor:Cesium.Color.fromCssColorString(Js),mouseHeight:-1e5,mousePosition:new Cesium.Cartesian3(0,0,0),secondaryLinesCount:19,cameraHeight:0,indexContourShow:qs,indexContourWidth:Xs,indexContourColor:Cesium.Color.fromCssColorString(Zs),intermediateContourShow:Ks,intermediateContourWidth:$s,intermediateContourColor:Cesium.Color.fromCssColorString(Qs),halfIntervalContourShow:ta,halfIntervalContourWidth:ea,halfIntervalContourColor:Cesium.Color.fromCssColorString(ia),supplementaryContourShow:na,supplementaryContourWidth:oa,supplementaryContourColor:Cesium.Color.fromCssColorString(sa)}}})}function pa(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function ha(t,e,i){return t.set(ma(t,e),i),i}function da(t,e){return t.get(ma(t,e))}function ma(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}(Us=document.createElement("div")).className="YJ-customize-active-height-elm",Us.style.position="absolute",Us.style.left="10px",Us.style.top="10px",Us.style.width="100px",Us.style.textAlign="center",Us.style.pointerEvents="none",Us.style.color="#ff0000",Us.style.display="none";var fa=new WeakMap,va=new WeakMap,ga=function(){return _()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;k()(this,t),pa(this,fa,null),pa(this,va,{bgimg:null,img1:null,img2:null,img3:null,img4:null}),this.sdk=e,this.options=i,this.data={},this._webSocketCallback=n,this._tools=new fi(this.sdk),this.requestResource()}),[{key:"requestResource",value:function(){var t=this;this.options.host=this.options.host||h();var e;e=this.options.host+"/yjearth4.0/api/v1/gps/state",this.reconnecting=new ReconnectingWebSocket("ws://"+e,[],{maxReconnectAttempts:8}),this.reconnecting.onopen=function(e){t.reconnecting.onmessage=function(){var e=o()(a.a.mark((function e(i){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.data=JSON.parse(i.data),!t.data||!t.data.rmc){e.next=7;break}return e.next=4,t._tools.getClampToHeight(t.data.rmc);case 4:n=e.sent,t.position=new Cesium.Cartesian3.fromDegrees(t.data.rmc.lng,t.data.rmc.lat,n),t.create();case 7:t._webSocketCallback&&t._webSocketCallback(t.data);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}}},{key:"create",value:function(){var t=this;if(this.getcanvas(),this.data&&this.data.rmc&&!this.entity){this.entity=new Cesium.CustomDataSource,this.sdk.viewer.dataSources.add(this.entity);var e=new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.position}),!1),billboard:{image:this._tools.getSourceRootPath()+"/img/locate2.png",scale:1,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:1e8}),!1),width:31,height:36,pixelOffset:new Cesium.Cartesian2(0,-15)}}),i=new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.position}),!1),billboard:{image:new Cesium.CallbackProperty((function(){return t.lableCanvas})),scale:1,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:1e8}),!1),width:220,height:140,pixelOffset:new Cesium.Cartesian2(0,-110)}});this.entity.entities.add(e),this.entity.entities.add(i)}}},{key:"loaded",value:function(t){var e;Object.defineProperty(this,"data",{get:function(){return e},set:function(i){e=i,t&&(t(),t=void 0)}})}},{key:"getcanvas",value:function(){var t=this,e=[{images:this._tools.getSourceRootPath()+"/img/bubble/lng.png",text:"经度:"+parseFloat(this.data.rmc.lng.toFixed(10))},{images:this._tools.getSourceRootPath()+"/img/bubble/lat.png",text:"纬度:"+parseFloat(this.data.rmc.lat.toFixed(10))},{images:this._tools.getSourceRootPath()+"/img/bubble/h.png",text:"海拔:"+parseFloat(this.data.rmc.alt.toFixed(10))},{images:this._tools.getSourceRootPath()+"/img/bubble/satellite.png",text:"卫星:"+this.data.satellites||!1}];if(da(fa,this)){var i=da(fa,this).getContext("2d");i.clearRect(0,0,da(fa,this).width,da(fa,this).height),i.drawImage(da(va,this).bgimg,0,0,da(fa,this).width,da(fa,this).height);var n=0;e.forEach((function(o,s){i.drawImage(da(va,t)["img"+(s+1)],12,12+26*s),i.fillStyle="#fff",i.font="16px Arial",i.fillText(o.text,44,28+26*s),++n===e.length&&(t.lableCanvas=da(fa,t).toDataURL())}))}else{ha(fa,this,document.createElement("canvas"));var o=da(fa,this).getContext("2d");da(fa,this).width=220,da(fa,this).height=140;var s=new Image;da(va,this).bgimg=s,s.src=this._tools.getSourceRootPath()+"/img/bubble/bubble.png";var a=0;s.onload=function(){o.drawImage(s,0,0,da(fa,t).width,da(fa,t).height),e.forEach((function(i,n){var s=new Image;da(va,t)["img"+(n+1)]=s,s.src=i.images,s.onload=function(){o.drawImage(s,12,12+26*n),o.fillStyle="#fff",o.font="16px Arial",o.fillText(i.text,44,28+26*n),++a===e.length&&(t.lableCanvas=da(fa,t).toDataURL())}}))}}}},{key:"flyTo",value:(t=o()(a.a.mark((function t(){var e,i,n=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=n.length>0&&void 0!==n[0]?n[0]:{},!this.data||!this.data.rmc){t.next=9;break}return t.next=4,this._tools.getClampToHeight(this.data.rmc);case 4:i=t.sent,pi(0),ii(this.sdk),ni(this.sdk),this.sdk.viewer.camera.flyTo({orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},destination:Cesium.Cartesian3.fromDegrees(this.data.rmc.lng,this.data.rmc.lat,i+(e.height||500))});case 9:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})},{key:"remove",value:function(){ha(fa,this,null),ha(va,this,{}),this.reconnecting&&this.reconnecting.close(),this.sdk.viewer.dataSources.remove(this.entity),this.entity=null}},{key:"flicker",value:function(){}}]);var t}();var ya=i(9),ba=i.n(ya);function Ca(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var wa=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return k()(this,e),(i=Ca(this,e,[t,n])).viewer=t.viewer,i.entityHasCreated=!1,i.event=null,i.tip=null,i.points_ids=[],i.color=n.color||"rgba(185,14,14,0.58)",i._is2D=o,i._sdk2D=Ie(),i}return sn()(e,t),_()(e,[{key:"create_point",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.viewer,i=this.randomString();return e.entities.add(new Cesium.Entity({id:i,position:t,billboard:{image:this.getSourceRootPath()+"/img/point.png",color:Cesium.Color.WHITE.withAlpha(.99)}})),i}},{key:"remove_entity",value:function(t){this.viewer.entities.removeById(t),!this._is2D&&this._sdk2D&&this._sdk2D.viewer&&this._sdk2D.viewer.entities&&this._sdk2D.viewer.entities.removeById(t)}},{key:"start",value:function(){}},{key:"end",value:function(){var t=this;YJ.Measure.SetMeasureStatus(!1),this.entityHasCreated=!1,this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy(),this.tip&&this.tip.destroy(),this.points_ids.forEach((function(e){t.remove_entity(e)}))}}])}(fi);function ka(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function xa(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=_a(this,e,[t,n])).color=n.color||"rgba(255,0,0,0.5)",i.polygonHasCreated=!1,i}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l;this.polygonHasCreated=!1,(i=e,n="start",o=this,s=3,a=ba()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var c=[],u=[];this.event.mouse_left((function(t,i){if("2D"!==l){if(l="3D",r.positions=c.concat(xa({},i)),r.tip.setPosition(i,t.position.x,t.position.y),!r.polygonHasCreated){var n=e.create_polygon(r);r.points_ids.push(n)}c.push(i),u.push(r.cartesian3Towgs84(i,r.viewer)),r.points_ids.push(r.create_point(i))}})),this.event.mouse_right((function(e,i){"2D"!==l&&(t(null,u),r.end())})),this.event.mouse_move((function(t,e){"2D"!==l&&(r.positions=c.concat(xa({},e)),r.tip.setPosition(e,t.endPosition.x,t.endPosition.y))})),this.event.mouse_right_keyboard_ctrl((function(t,e){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop(),r.positions=c.concat(cartesian))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)t(null,u),r.end();else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),!r.polygonHasCreated){var s=e.create_polygon(r);r.points_ids.push(s)}c.push(n),u.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n)),r.positions=c.concat(n)}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(t,i){if("3D"!==l){if(l="2D",r.positions=c.concat(xa({},i)),r.tip.setPosition(i,t.position.x+r.viewer.canvas.width,t.position.y),!r.polygonHasCreated){var n=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(n)}c.push(i),u.push(r.cartesian3Towgs84(i,r.viewer)),r.points_ids.push(r.create_point(i,r._sdk2D.viewer))}})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(t(null,u),r.end())})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(r.positions=c.concat(xa({},e)),r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y))})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop(),r.positions=c.concat(cartesian))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)t(null,u),r.end();else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),!r.polygonHasCreated){var s=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(s)}c.push(n),u.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),r.positions=c.concat(n)}}))}})))}}}],[{key:"create_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.polygonHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(t.positions)})),material:Cesium.Color.fromCssColorString(t.color),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(e){return t.positions.concat(t.positions[0])})),width:3,material:Cesium.Color.fromCssColorString(t.color).withAlpha(1),clampToGround:!0,zIndex:99999999}})),i}}])}(wa),Sa=function(){return _()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,t),this.sdk=e,this.viewer=e.viewer,this.height=i.height||70,this.maxHeigh=-1e6,this.precision=i.precision||125,this.Dialog=n,this.result={allArea:"",cutArea:"",cutVolume:"",fillArea:"",fillVolume:"",noArea:""},this.entities=[],this.Draw=new Ea(this.sdk),YJ.Analysis.AnalysesResults.push(this),t.EditBox(this)}),[{key:"create",value:function(){var t=this;this.clean(),this.Draw.start((function(e,i){if(!i||i.length<3){return console.warn("最少需要三个坐标!"),void(window.ELEMENT&&window.ELEMENT.Message({message:"最少需要三个坐标!",type:"warning",duration:1500}))}for(var n=[],o=0;othis.maxHeigh&&(this.maxHeigh=o),{heightPos:Cesium.Cartesian3.fromRadians(n.longitude,n.latitude,o),noHeightPos:Cesium.Cartesian3.fromRadians(n.longitude,n.latitude,0),height:o}}},{key:"clean",value:function(){this.Draw&&this.Draw.end();for(var t=0;t\n
        \n
        \n
        \n 绘制分析区域\n \n
        \n
        \n
        \n \n
        \n
        \n
        \n 基准高度\n
        \n \n m\n \n
        \n
        \n
        \n 精度\n
        \n \n \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 总分析面积:\n 0\n \n
        \n
        \n 无须填挖面积:\n 0\n \n
        \n
        \n
        \n
        \n 填方面积:\n 0\n \n
        \n
        \n 挖方面积:\n 0\n \n
        \n
        \n
        \n
        \n 填方体积:\n 0\n \n
        \n
        \n 挖方体积:\n 0\n \n
        \n
        \n
        \n \n ',e._DialogObject.contentAppChild(i),e._DialogObject._element.body.className=e._DialogObject._element.body.className+" cut-fill",(n=i.querySelector("input[name='height']")).value=e.height,n.addEventListener("blur",(function(t){var i=t.target.value;"."==t.data||"-"==t.data&&!t.target.value||(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&iNumber(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Pa(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),Oa(i=Ma(this,e,[t,n]),Ba,!1),i.sdk=t,i.options={},i.options.name=n.name,i.options.risingSpeed=1,i.options.minWaterLevel=0,i.options.maxWaterLevel=0,i.options.waterVolume=0,i.currentWaterLaver,i.color="#00d9ff66",i.Dialog=o,i.Draw=new Ea(i.sdk),i.positions,i.status=!0,i.area=0,i._elms={},YJ.Analysis.AnalysesResults.push(i),e.EditBox(i),i}return sn()(e,t),_()(e,[{key:"move",value:function(){var t=this;this.TweenAnimate&&TWEEN.remove(this.TweenAnimate),Ta(Ba,this,!1);var e=this._DialogObject._element.body,i=e.getElementsByClassName("pause")[0],n=e.getElementsByClassName("start")[0],s=(this.options.maxWaterLevel-this.options.minWaterLevel)/this.options.risingSpeed*1e3;this.TweenAnimate=new TWEEN.Tween({waterLevel:this.options.minWaterLevel}).to({waterLevel:this.options.maxWaterLevel},s).delay(this.delay).easing(TWEEN.Easing.Linear.None).onUpdate(function(){var e=o()(a.a.mark((function e(i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.currentWaterLaver=i.waterLevel;case 1:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).onComplete((function(){n.style.display="flex",i.style.display="none"})).start(),n.style.display="none",i.style.display="flex"}},{key:"restart",value:function(){var t=this;this.currentWaterLaver=this.options.minWaterLevel,Ta(Ba,this,!1);var e=!1;this.TweenAnimate&&(e=this.TweenAnimate._isPaused,TWEEN.remove(this.TweenAnimate));var i=(this.options.maxWaterLevel-this.options.minWaterLevel)/this.options.risingSpeed*1e3;this.TweenAnimate=new TWEEN.Tween({waterLevel:this.options.minWaterLevel}).to({waterLevel:this.options.maxWaterLevel},i).delay(this.delay).easing(TWEEN.Easing.Linear.None).onUpdate(function(){var e=o()(a.a.mark((function e(i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.currentWaterLaver=i.waterLevel;case 1:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).start(),e&&this.pause()}},{key:"start",value:function(){var t,e;this.TweenAnimate&&(e=this,(t=Ba).get(Na(t,e))?this.move():this.TweenAnimate._isPlaying?this.TweenAnimate.resume():this.TweenAnimate.start())}},{key:"pause",value:function(){this.TweenAnimate&&this.TweenAnimate.pause()}},{key:"calculateVolumeHeight",value:function(){that.options.maxWaterLevel}},{key:"flyTo",value:function(){if(this.positions&&0!==this.positions.length){ii(this.sdk),ni(this.sdk);for(var t=[],e=0;ei[o].alt&&(t.options.minWaterLevel=i[o].alt),n.push(i[o].lng,i[o].lat);var s=Cesium.Cartesian3.fromDegreesArray(n);t.currentWaterLaver=t.options.minWaterLevel,t.entity=t.sdk.viewer.entities.add({polygon:{hierarchy:new Cesium.PolygonHierarchy(s),height:new Cesium.CallbackProperty((function(){return t.options.minWaterLevel}),!1),extrudedHeight:new Cesium.CallbackProperty((function(){return t.currentWaterLaver}),!1),material:Cesium.Color.fromCssColorString(t.color)}}),t.area=t.computeArea(i),t.TweenAnimate&&(TWEEN.remove(t.TweenAnimate),t.TweenAnimate=null);var a=t._DialogObject._element.body,r=a.getElementsByClassName("pause")[0];a.getElementsByClassName("start")[0].style.display="flex",r.style.display="none"}))}},{key:"EditBox",value:(i=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new W(i.sdk.viewer._container,{title:"淹没分析",left:"180px",top:"100px",closeCallBack:function(){i.destroy(),i.Dialog.closeCallBack&&i.Dialog.closeCallBack()}});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" submerge",(n=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 水量\n
        \n \n \n \n
        \n
        \n
        \n 最小水位\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n 水面面积\n
        \n \n \n \n
        \n
        \n
        \n 最大水位\n
        \n \n m\n \n
        \n
        \n
        \n
        \n \n
        \n
        \n 上升速度\n
        \n
        \n
        \n \n
        \n \n m/s\n \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n \n \n \n \n \n \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        序号
        \n
        经度
        \n
        纬度
        \n
        高程
        \n
        \n
        \n
        \n
        \n
        \n
        \n

        暂无数据

        \n
        \n
        \n \n ',i._DialogObject.contentAppChild(n),(o=document.createElement("button")).className="el-button",o.innerHTML="暂停",o.style.width="80px",n.getElementsByClassName("draw")[0].addEventListener("click",(function(){e.create(i)})),n.getElementsByClassName("analog")[0].addEventListener("click",(function(){i.move()})),n.getElementsByClassName("flyto")[0].addEventListener("click",(function(){i.flyTo()})),n.getElementsByClassName("reset")[0].addEventListener("click",(function(){i.restart()})),s=n.getElementsByClassName("pause")[0],r=n.getElementsByClassName("start")[0],s.addEventListener("click",(function(){i.pause(),s.style.display="none",r.style.display="flex"})),r.addEventListener("click",(function(){i.start(),r.style.display="none",s.style.display="flex"})),(l=n.querySelectorAll("input[name='risingSpeed']"))[0].value=i.options.risingSpeed,l[1].value=i.options.risingSpeed,l[0].addEventListener("input",(function(t){Ta(Ba,i,!0),i.options.risingSpeed=Number(t.target.value)})),l[1].addEventListener("input",(function(t){if("."!=t.data){Ta(Ba,i,!0);var e=Number(t.target.value),n=Number(l[0].max),o=Number(l[0].min);i.options.risingSpeed=e>n?n:e999999999&&(e=999999999),e<0&&(e=0),i.options.minWaterLevel=Math.floor(1e4*e)/1e4,i.options.maxWaterLevel=i.options.minWaterLevel+i.waterLevel}})),Object.defineProperty(i.options,"minWaterLevel",{get:function(){return Number(c.value)},set:function(t){c.value=Math.floor(1e4*Number(t))/1e4}}),(u=n.querySelector("input[name='maxWaterLevel']")).value=i.options.maxWaterLevel,u.addEventListener("input",(function(t){if("."!=t.data){Ta(Ba,i,!0);var e=Number(t.target.value);e>999999999&&(e=999999999),e<0&&(e=0),e99999999999999&&(e=99999999999999),e<0&&(e=0),i.options.waterVolume=Math.floor(1e4*e)/1e4,i.area&&(i.waterLevel=Number((i.options.waterVolume/i.area).toFixed(4)),i.options.maxWaterLevel=i.options.minWaterLevel+i.waterLevel)}})),Object.defineProperty(i.options,"waterVolume",{get:function(){return Number(p.value)},set:function(t){p.value=t}}),(h=n.getElementsByClassName("area")[0]).value=i.area,Object.defineProperty(i,"area",{get:function(){return Number(h.value)},set:function(t){h.value=t,i.waterLevel=Number((i.options.waterVolume/i.area).toFixed(4)),i.options.maxWaterLevel=i.options.minWaterLevel+i.waterLevel}}),d=n.getElementsByClassName("table-body")[0],m=n.getElementsByClassName("table-empty")[0],Object.defineProperty(i,"positions",{get:function(){return i._positions},set:function(t){if(t&&t.length>0){m.style.display="none";for(var e="",i=0;i\n
        '.concat(i+1,'
        \n
        ').concat(Number(t[i].lng.toFixed(10)),'
        \n
        ').concat(Number(t[i].lat.toFixed(10)),'
        \n
        ').concat(Number(t[i].alt.toFixed(4)),"
        \n ");d.innerHTML=e}else d.innerHTML="",m.style.display="flex"}});case 51:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=Da(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type&&(i=Number(i)),t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=Ia(this,e,[t,n])).viewer=t.viewer,i.options={},i.options.viewPosition=n.viewPosition,i.options.viewPositionEnd=n.viewPositionEnd,i.options.horizontalViewAngle=n.horizontalViewAngle||0===n.horizontalViewAngle?n.horizontalViewAngle:90,i.options.verticalViewAngle=n.verticalViewAngle||0===n.verticalViewAngle?n.verticalViewAngle:60,i.options.visibleAreaColor=n.visibleAreaColor||"#008000",i.options.invisibleAreaColor=n.invisibleAreaColor||"#FF0000",i._elms={},i.viewPointHeight=n.viewPointHeight,i.ids=[],i.Dialog=o,i._EventBinding=new wn,i.html=null,YJ.Analysis.AnalysesResults.push(i),e.edit(i),i}return sn()(e,t),_()(e,[{key:"viewPointHeight",get:function(){return this.options.viewPointHeight},set:function(t){var e=Math.floor(10*Number(t))/10;isNaN(e)&&(e=1.8),e<0&&(e=0),this.options.viewPointHeight=e,this._elms.viewPointHeight&&this._elms.viewPointHeight.forEach((function(t){t.value=e}))}},{key:"viewPosition",get:function(){return this.options.viewPosition},set:function(t){this.options.viewPosition=t,this.ids[0]&&(this.viewer.entities.getById(this.ids[0]).position=new Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt)),this.update()}},{key:"viewPositionEnd",get:function(){return this.options.viewPositionEnd},set:function(t){this.options.viewPositionEnd=t,this.ids[1]&&(this.viewer.entities.getById(this.ids[1]).position=new Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt)),this.update()}},{key:"horizontalViewAngle",get:function(){return this.options.horizontalViewAngle},set:function(t){if(this.options.horizontalViewAngle=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content){var e=this._DialogObject._element.content;e.querySelector("input[name='horizontalViewAngle']").value=t,e.getElementsByClassName("range-node-active")[0].getElementsByClassName("range-node-active-text")[0].innerHTML=t+"°",e.getElementsByClassName("range-process")[0].style.width=t/180*100+"%"}this.update()}},{key:"visibleAreaColor",get:function(){return this.options.visibleAreaColor},set:function(t){this.options.visibleAreaColor=t,this.update()}},{key:"invisibleAreaColor",get:function(){return this.options.invisibleAreaColor},set:function(t){this.options.invisibleAreaColor=t,this.update()}},{key:"verticalViewAngle",get:function(){return this.options.verticalViewAngle},set:function(t){this.options.verticalViewAngle=t,this.update()}},{key:"viewDistance",get:function(){var t=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),e=Cesium.Cartesian3.fromDegrees(this.options.viewPositionEnd.lng,this.options.viewPositionEnd.lat,this.options.viewPositionEnd.alt);return Cesium.Cartesian3.distance(t,e)}},{key:"viewHeading",get:function(){var t,e,i,n,o=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),s=Cesium.Cartesian3.fromDegrees(this.options.viewPositionEnd.lng,this.options.viewPositionEnd.lat,this.options.viewPositionEnd.alt);return t=o,e=s,i=new Cesium.Cartesian3,n=Cesium.Transforms.eastNorthUpToFixedFrame(t),Cesium.Matrix4.inverse(n,n),Cesium.Matrix4.multiplyByPoint(n,e,i),Cesium.Cartesian3.normalize(i,i),Cesium.Math.toDegrees(Math.atan2(i.x,i.y))}},{key:"viewPitch",get:function(){var t,e,i,n,o=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),s=Cesium.Cartesian3.fromDegrees(this.options.viewPositionEnd.lng,this.options.viewPositionEnd.lat,this.options.viewPositionEnd.alt);return t=o,e=s,i=new Cesium.Cartesian3,n=Cesium.Transforms.eastNorthUpToFixedFrame(t),Cesium.Matrix4.inverse(n,n),Cesium.Matrix4.multiplyByPoint(n,e,i),Cesium.Cartesian3.normalize(i,i),Cesium.Math.toDegrees(Math.asin(i.z))}},{key:"add",value:function(){this.createLightCamera(),this.createShadowMap(),this.createPostStage(),this.drawSketch(),e.getcanvas(this)}},{key:"update",value:function(){this.clear(),this.add()}},{key:"clear",value:function(){YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=null,this.event=null,this.sketch&&(this.viewer.entities.removeById(this.sketch.id),this.sketch=null),this.frustumOutline&&(this.viewer.entities.removeById(this.frustumOutline.id),this.frustumOutline=null),this.postStage&&(this.viewer.scene.postProcessStages.remove(this.postStage),this.postStage=null)}},{key:"destroy",value:function(){var t=this;this.clear(),this.editevent&&this.editevent.destroy(),this.ControllerObject&&this.ControllerObject.destroy(),this.ids.forEach((function(e){t.viewer.entities.removeById(e)})),this.ids=[],this.viewBillboardPrimitive&&this.viewer.scene.primitives.remove(this.viewBillboardPrimitive),this.viewBillboardPrimitive=null,this.options.viewPosition=null,this.options.viewPositionEnd=null,YJ.Measure.SetMeasureStatus(!1),this._originalShadowMap&&(this.viewer.scene.shadowMap=this._originalShadowMap,this._originalShadowMap=null),this.viewer.shadows=this.viewer._shadows}},{key:"nodeEdit",value:function(){var t,e=this;YJ.Measure.GetMeasureStatus()?console.log("上一次测量未结束"):(this.editevent&&this.editevent.destroy(),this.ids.forEach((function(t){e.viewer.entities.getById(t).show=!0})),YJ.Measure.SetMeasureStatus(!0),this.editevent=new X(this.sdk),this.editevent.mouse_left((function(i,n){var o=e.viewer.scene.pick(i.position);o&&o.id&&o.id.id&&-1!=e.ids.indexOf(o.id.id)&&(!t||t.id!=o.id.id)&&(t=o.id,e.viewer.entities.getById(e.ids[0]).position=new Cesium.Cartesian3.fromDegrees(e.viewPosition.lng,e.viewPosition.lat,e.viewPosition.alt),e.viewer.entities.getById(e.ids[1]).position=new Cesium.Cartesian3.fromDegrees(e.viewPositionEnd.lng,e.viewPositionEnd.lat,e.viewPositionEnd.alt),e.ControllerObject&&e.ControllerObject.destroy(),e.ControllerObject=new qo(e.sdk,{position:ja({},e.cartesian3Towgs84(t.position._value,e.sdk.viewer))}),e.ControllerObject.controllerCallBack=function(i,n){i.position.alt<0&&(i.position.alt=0),t.position=new Cesium.Cartesian3.fromDegrees(i.position.lng,i.position.lat,i.position.alt),n&&(0==e.ids.indexOf(o.id.id)?e.viewPosition=i.position:e.viewPositionEnd=i.position,YJ.Measure.SetMeasureStatus(!0))},e.ControllerObject.editTranslational())})),this.editevent.mouse_right((function(i,n){YJ.Measure.SetMeasureStatus(!1),e.editevent&&e.editevent.destroy(),e.ControllerObject&&e.ControllerObject.destroy(),e.ids.forEach((function(t){e.viewer.entities.getById(t).show=!1})),t=null})),this.editevent.mouse_move((function(t,e){})),this.editevent.gesture_pinck_start((function(i,n){var o=new Date;e.editevent.gesture_pinck_end((function(){new Date-o>=500&&(YJ.Measure.SetMeasureStatus(!1),e.editevent&&e.editevent.destroy(),e.ControllerObject&&e.ControllerObject.destroy(),e.ids.forEach((function(t){e.viewer.entities.getById(t).show=!1})),t=null)}))})))}},{key:"createLightCamera",value:function(){if(this.options.viewPosition){this.lightCamera=new Cesium.Camera(this.viewer.scene),this.lightCamera.position=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),this.lightCamera.frustum.near=.001*this.viewDistance,this.lightCamera.frustum.far=this.viewDistance;var t=Cesium.Math.toRadians(this.horizontalViewAngle),e=Cesium.Math.toRadians(this.verticalViewAngle),i=this.viewDistance*Math.tan(t/2)*2/(this.viewDistance*Math.tan(e/2)*2);this.lightCamera.frustum.aspectRatio=i,this.lightCamera.frustum.fov=t>e?t:e,this.lightCamera.setView({destination:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:{heading:Cesium.Math.toRadians(this.viewHeading||0),pitch:Cesium.Math.toRadians(this.viewPitch||0),roll:0}})}}},{key:"createShadowMap",value:function(){this.shadowMap=new Cesium.ShadowMap({context:this.viewer.scene.context,lightCamera:this.lightCamera,enabled:!0,isPointLight:!0,pointLightRadius:this.viewDistance,cascadesEnabled:!1,size:2048,softShadows:!0,normalOffset:!1,fromLightSource:!1}),this._originalShadowMap||(this._originalShadowMap=this.viewer.scene.shadowMap),this.viewer.scene.shadowMap=this.shadowMap}},{key:"createPostStage",value:function(){var t=this;Number(Cesium.VERSION.split(".")[1])>=102&&gn()("fs");var e=new Cesium.PostProcessStage({fragmentShader:"\n #define USE_CUBE_MAP_SHADOW true\n uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n varying vec2 v_textureCoordinates;\n uniform mat4 camera_projection_matrix;\n uniform mat4 camera_view_matrix;\n uniform samplerCube shadowMap_textureCube;\n uniform mat4 shadowMap_matrix;\n uniform vec4 shadowMap_lightPositionEC;\n uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness;\n uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth;\n uniform float helsing_viewDistance;\n uniform vec4 helsing_visibleAreaColor;\n uniform vec4 helsing_invisibleAreaColor;\n\n struct zx_shadowParameters\n {\n vec3 texCoords;\n float depthBias;\n float depth;\n float nDotL;\n vec2 texelStepSize;\n float normalShadingSmooth;\n float darkness;\n };\n\n float czm_shadowVisibility(samplerCube shadowMap, zx_shadowParameters shadowParameters)\n {\n float depthBias = shadowParameters.depthBias;\n float depth = shadowParameters.depth;\n float nDotL = shadowParameters.nDotL;\n float normalShadingSmooth = shadowParameters.normalShadingSmooth;\n float darkness = shadowParameters.darkness;\n vec3 uvw = shadowParameters.texCoords;\n depth -= depthBias;\n float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\n return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n }\n\n vec4 getPositionEC(){\n return czm_windowToEyeCoordinates(gl_FragCoord);\n }\n\n vec3 getNormalEC(){\n return vec3(1.);\n }\n\n vec4 toEye(in vec2 uv,in float depth){\n vec2 xy=vec2((uv.x*2.-1.),(uv.y*2.-1.));\n vec4 posInCamera=czm_inverseProjection*vec4(xy,depth,1.);\n posInCamera=posInCamera/posInCamera.w;\n return posInCamera;\n }\n\n vec3 pointProjectOnPlane(in vec3 planeNormal,in vec3 planeOrigin,in vec3 point){\n vec3 v01=point-planeOrigin;\n float d=dot(planeNormal,v01);\n return(point-planeNormal*d);\n }\n\n float getDepth(in vec4 depth){\n float z_window=czm_unpackDepth(depth);\n z_window=czm_reverseLogDepth(z_window);\n float n_range=czm_depthRange.near;\n float f_range=czm_depthRange.far;\n return(2.*z_window-n_range-f_range)/(f_range-n_range);\n }\n\n float shadow(in vec4 positionEC){\n vec3 normalEC=getNormalEC();\n zx_shadowParameters shadowParameters;\n shadowParameters.texelStepSize=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;\n shadowParameters.depthBias=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;\n shadowParameters.normalShadingSmooth=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;\n shadowParameters.darkness=shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;\n vec3 directionEC=positionEC.xyz-shadowMap_lightPositionEC.xyz;\n float distance=length(directionEC);\n directionEC=normalize(directionEC);\n float radius=shadowMap_lightPositionEC.w;\n if(distance>radius)\n {\n return 2.0;\n }\n vec3 directionWC=czm_inverseViewRotation*directionEC;\n shadowParameters.depth=distance/radius-0.0003;\n shadowParameters.nDotL=clamp(dot(normalEC,-directionEC),0.,1.);\n shadowParameters.texCoords=directionWC;\n float visibility=czm_shadowVisibility(shadowMap_textureCube,shadowParameters);\n return visibility;\n }\n\n bool visible(in vec4 result)\n {\n result.x/=result.w;\n result.y/=result.w;\n result.z/=result.w;\n return result.x>=-1.&&result.x<=1.\n &&result.y>=-1.&&result.y<=1.\n &&result.z>=-1.&&result.z<=1.;\n }\n\n void main(){\n // 釉色 = 结构二维(颜色纹理, 纹理坐标)\n gl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n // 深度 = 获取深度(结构二维(深度纹理, 纹理坐标))\n float depth = getDepth(texture2D(depthTexture, v_textureCoordinates));\n // 视角 = (纹理坐标, 深度)\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n // 世界坐标\n vec4 wordPos = czm_inverseView * viewPos;\n // 虚拟相机中坐标\n vec4 vcPos = camera_view_matrix * wordPos;\n float near = .001 * helsing_viewDistance;\n float dis = length(vcPos.xyz);\n if(dis > near && dis < helsing_viewDistance){\n // 透视投影\n vec4 posInEye = camera_projection_matrix * vcPos;\n // 可视区颜色\n // vec4 helsing_visibleAreaColor=vec4(0.,1.,0.,.5);\n // vec4 helsing_invisibleAreaColor=vec4(1.,0.,0.,.5);\n if(visible(posInEye)){\n float vis = shadow(viewPos);\n if(vis > 0.3){\n gl_FragColor = mix(gl_FragColor,helsing_visibleAreaColor,.5);\n } else{\n gl_FragColor = mix(gl_FragColor,helsing_invisibleAreaColor,.5);\n }\n }\n }\n }",uniforms:{shadowMap_textureCube:function(){return t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState")),Reflect.get(t.shadowMap,"_shadowMapTexture")},shadowMap_matrix:function(){return t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState")),Reflect.get(t.shadowMap,"_shadowMapMatrix")},shadowMap_lightPositionEC:function(){return t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState")),Reflect.get(t.shadowMap,"_lightPositionEC")},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState"));var e=t.shadowMap._pointBias;return Cesium.Cartesian4.fromElements(e.normalOffsetScale,t.shadowMap._distance,t.shadowMap.maximumDistance,0,new Cesium.Cartesian4)},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState"));var e=t.shadowMap._pointBias,i=new Cesium.Cartesian2;return i.x=1/t.shadowMap._textureSize.x,i.y=1/t.shadowMap._textureSize.y,Cesium.Cartesian4.fromElements(i.x,i.y,e.depthBias,e.normalShadingSmooth,new Cesium.Cartesian4)},camera_projection_matrix:this.lightCamera.frustum.projectionMatrix,camera_view_matrix:this.lightCamera.viewMatrix,helsing_viewDistance:function(){return t.viewDistance},helsing_visibleAreaColor:Cesium.Color.fromCssColorString(this.visibleAreaColor),helsing_invisibleAreaColor:Cesium.Color.fromCssColorString(this.invisibleAreaColor)}});this.postStage=this.viewer.scene.postProcessStages.add(e)}},{key:"drawFrustumOutline",value:function(){var t=new Cesium.Cartesian3,e=new Cesium.Matrix3,i=new Cesium.Quaternion,n=(this.lightCamera.positionWC,this.lightCamera.directionWC),o=this.lightCamera.upWC,s=this.lightCamera.rightWC;s=Cesium.Cartesian3.negate(s,t);var a=e;Cesium.Matrix3.setColumn(a,0,s,a),Cesium.Matrix3.setColumn(a,1,o,a),Cesium.Matrix3.setColumn(a,2,n,a);var r=Cesium.Quaternion.fromRotationMatrix(a,i),l=new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({frustum:this.lightCamera.frustum,origin:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:r}),id:Math.random().toString(36).substr(2),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOWGREEN),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});this.frustumOutline=this.viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:[l],appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!1})}))}},{key:"drawSketch",value:function(){this.sketch=this.viewer.entities.add({name:"sketch",position:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),Cesium.HeadingPitchRoll.fromDegrees(this.viewHeading-90,this.viewPitch,0)),ellipsoid:{radii:new Cesium.Cartesian3(this.viewDistance,this.viewDistance,this.viewDistance),minimumClock:Cesium.Math.toRadians(-this.horizontalViewAngle/2),maximumClock:Cesium.Math.toRadians(this.horizontalViewAngle/2),minimumCone:Cesium.Math.toRadians(90-this.verticalViewAngle/2),maximumCone:Cesium.Math.toRadians(90+this.verticalViewAngle/2),fill:!1,outline:!0,subdivisions:256,stackPartitions:64,slicePartitions:64,outlineColor:Cesium.Color.YELLOWGREEN}}),this.frustumOutline=this.viewer.entities.add({name:"sketch",position:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),Cesium.HeadingPitchRoll.fromDegrees(this.viewHeading-90,this.viewPitch,0)),ellipsoid:{radii:new Cesium.Cartesian3(this.viewDistance,this.viewDistance,this.viewDistance),innerRadii:new Cesium.Cartesian3(1e-4,1e-4,1e-4),minimumClock:Cesium.Math.toRadians(-this.horizontalViewAngle/2),maximumClock:Cesium.Math.toRadians(this.horizontalViewAngle/2),minimumCone:Cesium.Math.toRadians(90-this.verticalViewAngle/2),maximumCone:Cesium.Math.toRadians(90+this.verticalViewAngle/2),fill:!1,outline:!0,subdivisions:256,stackPartitions:1,slicePartitions:1,outlineColor:Cesium.Color.YELLOWGREEN}})}}],[{key:"create",value:function(t){t.destroy();var i=0;function n(){t.ids.forEach((function(e){t.viewer.entities.getById(e).show=!1})),YJ.Measure.SetMeasureStatus(!1),t.tip.destroy(),t.event.destroy(),t.tip=null,t.event=null}YJ.Measure.GetMeasureStatus()?console.log("上一次测量未结束"):(t.event=new X(t.sdk),t.tip=new Z("左键选择观测点位置,右键取消",t.sdk),YJ.Measure.SetMeasureStatus(!0),t.event.mouse_left((function(o,s){t.viewPosition||(t.options.viewPosition=t.cartesian3Towgs84(s,t.viewer),t.ids.push(e.create_point(t,s)),t.tip.set_text("左键选择最远观测点位置,右键取消")),2===++i&&(t.options.viewPositionEnd=t.cartesian3Towgs84(s,t.viewer),t.ids.push(e.create_point(t,s)),n(),t.update())})),t.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right((function(e,i){t.ids.forEach((function(e){t.viewer.entities.removeById(e)})),t.ids=[],n()})),t.event.gesture_pinck_start((function(e,i){var o=new Date;t.event.gesture_pinck_end((function(){new Date-o>=500&&(t.ids.forEach((function(e){t.viewer.entities.removeById(e)})),t.ids=[],n())}))})))}},{key:"create_point",value:function(t,e){var i=t.randomString(),n=t.cartesian3Towgs84(e,t.viewer),o={id:i,position:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}};return t.viewer.entities.add(new Cesium.Entity(o)),i}},{key:"edit",value:(i=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new W(i.sdk.viewer._container,{title:"可视域分析",left:"180px",top:"100px",closeCallBack:function(){i.Dialog.closeCallBack&&i.Dialog.closeCallBack(),YJ.Measure.SetMeasureStatus(!1),i.editevent&&i.editevent.destroy(),i.ControllerObject&&i.ControllerObject.destroy(),i.ids.forEach((function(t){i.viewer.entities.removeById(t)}))}});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" view-shed",(n=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 位置拾取(起点、终点)\n \n
        \n
        \n
        \n \n
        \n
        \n
        \n 视点高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n
        \n 视域夹角\n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n 45°\n 90°\n 135°\n 180°\n
        \n
        \n \n
        \n
        \n
        \n
        \n \n ',i._DialogObject.contentAppChild(n),i._DialogObject._element.body.getElementsByClassName("edit")[0].addEventListener("click",(function(){i.nodeEdit()})),(o=document.createElement("button")).innerHTML="绘制",o.addEventListener("click",(function(){e.create(i)})),i._DialogObject.footAppChild(o),i.html=n,s=n.getElementsByTagName("*"),i._EventBinding.on(i,s),i._elms=i._EventBinding.element,(r=n.querySelector("input[name='horizontalViewAngle']")).value=i.options.horizontalViewAngle,l=n.getElementsByClassName("range-node-active")[0],c=l.getElementsByClassName("range-node-active-text")[0],u=n.getElementsByClassName("range-process")[0],p=i.horizontalViewAngle/180*100,l.style.left=p+"%",u.style.width=p+"%",c.innerHTML=i.horizontalViewAngle+"°",r.addEventListener("input",(function(){var t=r.value/180*100;l.style.left=t+"%",u.style.width=t+"%",c.innerHTML=r.value+"°"})),r.addEventListener("change",(function(){clearTimeout(h),h=setTimeout((function(){i.horizontalViewAngle=r.value}),300)}));case 31:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"getcanvas",value:function(t){if(t.viewPosition){t.viewBillboardPrimitive&&(t.viewer.scene.primitives.remove(t.viewBillboardPrimitive),t.viewBillboardPrimitive=null);var e=document.createElement("canvas"),i=e.getContext("2d");e.width=220,e.height=180,e.style.background="#000000";var n=new Image,o=[{images:t.getSourceRootPath()+"/img/bubble/lng.png",text:"经度:"+parseFloat(t.viewPosition.lng.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/lat.png",text:"纬度:"+parseFloat(t.viewPosition.lat.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/h.png",text:"高度:"+Number((parseFloat(t.viewPosition.alt.toFixed(2))+Number(t.viewPointHeight)).toFixed(2))+" m"},{images:t.getSourceRootPath()+"/img/bubble/heading.png",text:"偏航角:"+parseFloat(t.viewHeading.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/pitch.png",text:"俯仰角:"+parseFloat(t.viewPitch.toFixed(10))+"°"}];n.src=t.getSourceRootPath()+"/img/bubble/bubble.png";var s=0;n.onload=function(){i.drawImage(n,0,0,e.width,e.height),o.forEach((function(n,a){var r=new Image;r.src=n.images,r.onload=function(){i.drawImage(r,12,12+26*a),i.fillStyle="#fff",i.font="12px Arial",i.fillText(n.text,44,28+26*a),++s===o.length&&(t.viewBillboardPrimitive&&t.viewer.scene.primitives.remove(t.viewBillboardPrimitive),t.viewBillboardPrimitive=t.viewer.scene.primitives.add(new Cesium.BillboardCollection),t.viewBillboardPrimitive.add({position:Cesium.Cartesian3.fromDegrees(t.viewPosition.lng,t.viewPosition.lat,t.viewPosition.alt+t.viewPointHeight),image:e,width:200,height:180,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}))}}))}}}}]);var i}(fi);function Fa(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return za(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?za(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function za(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),Va(i=Ha(this,e,[t,n]),Wa,new Map),i.viewer=t.viewer,i.options={},i.options.visibleAreaColor=n.visibleAreaColor||"#008000",i.options.invisibleAreaColor=n.invisibleAreaColor||"#FF0000",i.ids=[],i.primitives=[],i.viewpointPrimitive=null,i._elms={},i.precision=n.precision,i.viewPointHeight=n.viewPointHeight,i.Dialog=o,i._EventBinding=new wn,i.html=null,YJ.Analysis.AnalysesResults.push(i),e.edit(i),i}return sn()(e,t),_()(e,[{key:"viewPointHeight",get:function(){return this.options.viewPointHeight},set:function(t){var e=Math.floor(10*Number(t))/10;isNaN(e)&&(e=1.8),e<0&&(e=0),this.options.viewPointHeight=e,this._elms.viewPointHeight&&this._elms.viewPointHeight.forEach((function(t){t.value=e}))}},{key:"precision",get:function(){return this.options.precision},set:function(t){var e=Math.floor(Number(t));isNaN(e)?e=20:e<1&&(e=1),this.options.precision=e,this._elms.precision&&this._elms.precision.forEach((function(t){t.value=e}))}},{key:"analyse",value:function(){var t=this,i=[this.center.lng,this.center.lat],n=this.radius/1e3,o=turf.circle(i,n,{steps:180,units:"kilometers",properties:{foo:"bar"}});this.viewpointPrimitive||(this.viewpointPrimitive=this.viewer.scene.primitives.add(new Cesium.PointPrimitiveCollection)),this.viewBillboardPrimitive||(this.viewBillboardPrimitive=this.viewer.scene.primitives.add(new Cesium.BillboardCollection));for(var s=[],a=n/this.precision,r=1;r=s.length){var e=Ga(Wa,t).get(f);e&&clearInterval(e.event)}else!function(t){for(var e=[],n=t,o=0;o.01&&Math.abs(b.position.y-f.y)>.01&&Math.abs(b.position.z-f.z)>.01&&(w=Cesium.Color.RED);var k=new Cesium.GroundPolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArray([].concat(L()(a),L()(r),L()(l),L()(c),L()(a))),width:2}),x=new Cesium.GeometryInstance({geometry:k,name:"ViewershedPolygon",attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(w),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});e.push(x)}m.primitives.push(m.viewer.scene.primitives.add(new Cesium.GroundPolylinePrimitive({geometryInstances:e,appearance:new Cesium.PolylineColorAppearance})))}(d),d+=1}),0);Ga(Wa,this).set(f,{event:v})}},{key:"destroy",value:function(){var t,e,i,n,o=Fa(Ga(Wa,this));try{for(o.s();!(t=o.n()).done;){var s=y()(t.value,2),a=(s[0],s[1]);clearInterval(a.event)}}catch(t){o.e(t)}finally{o.f()}e=Wa,i=this,n=new Map,e.set(Ua(e,i),n);for(var r=0;r\n
        \n
        \n
        \n 视点高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n 采样精度\n \n
        \n
        \n
        \n ',i._DialogObject.contentAppChild(n),(o=document.createElement("button")).innerHTML="绘制",o.addEventListener("click",(function(){i.viewer.terrainProvider.availability?e.create(i):window.ELEMENT&&window.ELEMENT.Message({message:"未加载地形数据!",type:"warning",duration:1500})})),i._DialogObject.footAppChild(o),s=n.getElementsByTagName("*"),i._EventBinding.on(i,s),i._elms=i._EventBinding.element;case 17:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"getcanvas",value:function(t){var e=document.createElement("canvas"),i=e.getContext("2d");e.width=220,e.height=140,e.style.background="#000000";var n=new Image,s=[{images:t.getSourceRootPath()+"/img/bubble/lng.png",text:"经度:"+parseFloat(t.center.lng.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/lat.png",text:"纬度:"+parseFloat(t.center.lat.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/h.png",text:"视高:"+t.viewPointHeight+" m"},{images:t.getSourceRootPath()+"/img/bubble/radius.png",text:"半径:"+t.radius+" m"}];n.src=t.getSourceRootPath()+"/img/bubble/bubble.png";var r=0;return new Promise(function(){var t=o()(a.a.mark((function t(o,l){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n.onload=function(){i.drawImage(n,0,0,e.width,e.height),s.forEach((function(t,n){var a=new Image;a.src=t.images,a.onload=function(){i.drawImage(a,12,12+26*n),i.fillStyle="#fff",i.font="12px Arial",i.fillText(t.text,44,28+26*n),++r===s.length&&o(e)}}))};case 1:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}())}}]);var i}(fi);function Ja(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function qa(t){for(var e=1;e35?35:200*t;this.arrowWidth=i<15?15:i;this.viewer;this.Draw.start((function(i,n){if(!n||n.length<=2)window.ELEMENT&&window.ELEMENT.Message({message:"至少拥有三个坐标位置!",type:"warning",duration:1500});else{for(var o=[],s=1e4,a=1e4,r=-1e4,l=-1e3,c=0;cr?p:r,l=h>l?h:l}o.push(o[0]);var d=[s,a,r,l],m=turf.polygon([o]),f=turf.squareGrid(d,t,{mask:m});e.createEllipse(f)}}))}},{key:"createNew4Num",value:function(t){var e=this,i=t;this.Draw.start((function(t,n){if(!n||n.length<=2)console.warn("至少拥有三个坐标位置!");else{for(var o=[],s=1e4,a=1e4,r=-1e4,l=-1e3,c=0;cr?p:r,l=h>l?h:l}o.push(o[0]);var d=[s,a,r,l],m=r-s,f=l-a;f=f>m?f:m;var v=turf.polygon([o]),g=turf.area(v);g>5e12?i-=25:g>1e12?i-=20:g>5e11?i-=15:g>1e11?i-=10:g>6e10&&(i-=5);var y=f/i,b=2e3*y>35?35:2e3*y;e.arrowWidth=b<15?15:b;var C=turf.squareGrid(d,y,{units:"degrees",mask:v});e.createEllipse(C)}}))}},{key:"createEllipse",value:function(t){for(var e=[],i=0;i0&&function t(i){Cesium.sampleTerrainMostDetailed(h.viewer.scene.terrainProvider,i).then((function(i){m++;var n=e.slice(m*d,(m+1)*d);n.length>0&&t(n);var o=[],s=i.reduce((function(t,e,i,n){var s=10*i,a=s+10,r=n.slice(s,a);return 0!=r.length&&(o[i]=r),o}),[]);h.calculateSlope(s)}))}(f)}},{key:"createPolygonInsrance",value:function(t,e,i){for(var n=[],o=1;o0?[Cesium.Cartographic.toCartesian(s),Cesium.Cartographic.toCartesian(a)]:[Cesium.Cartographic.toCartesian(a),Cesium.Cartographic.toCartesian(s)];return new Cesium.GeometryInstance({id:{type:"SlopeAspect",value:o},geometry:new Cesium.GroundPolylineGeometry({positions:r,width:this.arrowWidth}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE.withAlpha(.6)),show:new Cesium.ShowGeometryInstanceAttribute(!0)}})}},{key:"calculateSlope",value:function(t){for(var e=this,i=[],n=[],o=0;or&&(r=u,l=c)}var p=new Cesium.Cartographic(a.longitude,a.latitude,0),h=new Cesium.Cartographic(s[l].longitude,s[l].latitude,0),d=Cesium.Cartesian3.distance(Cesium.Cartographic.toCartesian(p),Cesium.Cartographic.toCartesian(h)),m=Math.abs(r/d),f=this.calculateSlopeColor(m,.4),v=this.createPolygonInsrance(s,f,m);n.push(v);var g=l>4?s[l-4]:s[l+4],y=s[l],b=this.createArrowInstance(y,a,g,r,m);i.push(b)}var C=this.viewer.scene.primitives.add(new Cesium.GroundPrimitive({geometryInstances:n,appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,closed:!1})})),w=this.viewer.scene.primitives.add(new Cesium.GroundPolylinePrimitive({geometryInstances:i,appearance:new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"PolylineArrow",uniforms:{color:new Cesium.Color(1,1,0,.8)}}})})}));this.result.push(w,C),this.event=new X(this.sdk);var k=function(t,i){var n=document.getElementById("SlopeAspect-box");n||((n=document.createElement("div")).id="SlopeAspect-box",n.style.pointerEvents="none",n.style.display="none",n.style.position="absolute",n.style.background="#333333",n.style.color="#fff",n.style.color="#fff",n.style.padding="5px",n.style.fontSize="12px",n.style.borderRadius="5px",n.style.transform="translate(-50%, -10px)",n.innerHTML='\n
        坡度:
        \n \n ',document.body.appendChild(n));var o=n.getElementsByClassName("value")[0],s=qa({},t.position),a=e.sdk.viewer.scene.pick(s);if(a&&a.id&&a.id.type&&"SlopeAspect"===a.id.type){var r=0,l=0;if(e.sdk.viewer&&e.sdk.viewer._element){var c=e.sdk.viewer._element.getElementsByClassName("cesium-widget")[0].getElementsByTagName("canvas")[0];r=c.getBoundingClientRect().top+window.scrollY,l=c.getBoundingClientRect().left+window.scrollX}n.style.display="block",n.style.left=s.x+2+l+"px",n.style.top=s.y-20+r+"px",o.innerHTML="坡度:"+Number(Cesium.Math.toDegrees(a.id.value||0).toFixed(2))+"°"}else n.style.display="none"};this.event.mouse_move((function(t,e){var i={position:qa({},t.endPosition)};k(i)})),this.event.mouse_left(k),this._camera={position:this.sdk.viewer.camera.position,heading:this.sdk.viewer.camera.heading,pitch:this.sdk.viewer.camera.pitch,roll:this.sdk.viewer.camera.roll},this.sdk.viewer.scene.preRender.addEventListener(this._watchEvent,this)}},{key:"_watchEvent",value:function(){if(this._camera.position.x.toFixed(8)!==this.sdk.viewer.camera.position.x.toFixed(8)||this._camera.position.y.toFixed(8)!==this.sdk.viewer.camera.position.y.toFixed(8)||this._camera.position.z.toFixed(8)!==this.sdk.viewer.camera.position.z.toFixed(8)||this._camera.heading.toFixed(8)!==this.sdk.viewer.camera.heading.toFixed(8)||this._camera.pitch.toFixed(8)!==this.sdk.viewer.camera.pitch.toFixed(8)||this._camera.roll.toFixed(8)!==this.sdk.viewer.camera.roll.toFixed(8)){var t=document.getElementById("SlopeAspect-box");t&&(t.style.display="none")}this._camera={position:this.sdk.viewer.camera.position,heading:this.sdk.viewer.camera.heading,pitch:this.sdk.viewer.camera.pitch,roll:this.sdk.viewer.camera.roll}}},{key:"calculateSlopeColor",value:function(t,e){return t<.00872686779075879?"rgba(85,182,43,"+e+")":t<.03492076949174773?"rgba(135,211,43,"+e+")":t<.08748866352592401?"rgba(204,244,44,"+e+")":t<.2679491924311227?"rgba(245,233,44,"+e+")":t<.7002075382097097?"rgba(255,138,43,"+e+")":t<1.4281480067421144?"rgba(255,84,43,"+e+")":"rgba(255,32,43,"+e+")"}},{key:"destroy",value:function(){var t=this;this.result&&this.result.forEach((function(e){t.viewer.scene.primitives.remove(e)})),this.result=[],this.sdk.viewer.scene.preRender.removeEventListener(this._watchEvent,this)}}])}(fi);function Ka(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var $a=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),window.addEventListener("resize",(function(){i.echartsObject&&i.echartsObject.resize()})),(i=Ka(this,e,[t])).viewer=t.viewer,i.Dialog=n,YJ.Analysis.AnalysesResults.push(i),e.create(i),i}return sn()(e,t),_()(e,[{key:"clean",value:function(){this.end(),this._currentId=null,this.entityHasCreated=!1,this.polyline&&this.viewer.entities.remove(this.polyline),this.tipEntity&&this.viewer.entities.remove(this.tipEntity),this.polyline=null,this.tipEntity=null}},{key:"destroy",value:function(){this.clean(),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null)}}],[{key:"create",value:function(t){var i=this;this._currentId=Cesium.createGuid();var n=this._currentId;if(t.clean(),YJ.Measure.GetMeasureStatus())console.warn("上一次测量未结束");else{YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("左键确定,右键取消",t.sdk),t.event=new X(t.sdk),t.positions=[],t.points_ids=[];var s=[];t.event.mouse_left(function(){var r=o()(a.a.mark((function o(r,l){var c;return a.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:try{t.entityHasCreated||e.create_polyline(t),s.push(l),t.points_ids.push(t.create_point(l)),2==s.length&&(t.end(),c=[],s.forEach((function(e){c.push(t.cartesian3Towgs84(e,t.viewer))})),e.interPoints(t).then((function(o){i._currentId&&i._currentId===n&&(t._DialogObject?e.initEcharts(t,o):e.edit(t,o))})))}catch(t){console.log(t)}case 1:case"end":return o.stop()}}),o)})));return function(t,e){return r.apply(this,arguments)}}()),t.event.mouse_right((function(e,i){s=[],t.clean()})),t.event.mouse_move((function(e,i){t.positions=s.concat(i),t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500){s=[],t.end()}}))}))}}},{key:"create_polyline",value:function(t){t.entityHasCreated=!0;var e=t.randomString();return t.polyline=t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),width:5,material:Cesium.Color.fromCssColorString(t.color),clampToGround:!0,zIndex:99999999}})),e}},{key:"interPoints",value:(n=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_,E,S,D,P;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(i=e.viewer,n=e.positions,o=[],s=[],r=0;rb&&(b=y),(C=parseInt(b/2))>150&&(C=150),C<2&&(C=2),w=f/(C-1),k=0;case 24:if(!(k\n
        \n ',i._DialogObject.contentAppChild(o),(s=document.createElement("button")).innerHTML='重新绘制',s.style.width="auto",s.addEventListener("click",(function(){e.create(i),e.initEcharts(i)})),i._DialogObject.footAppChild(s),e.initEcharts(i,n);case 16:case"end":return t.stop()}}),t)}))),function(t,e){return i.apply(this,arguments)})},{key:"initEcharts",value:function(t,e){var i,n=[],o=[],s=e;if(s){for(var a=s[s.length-1].distance,r=Math.ceil(a),l=0;l高度:"+n[1]+"m
        坐标:"+i[0].toFixed(5)+","+i[1].toFixed(5)}},grid:{top:40,bottom:20,left:55,right:30},calculable:!0,xAxis:[{type:"value",max:r,scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],yAxis:[{type:"value",scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],series:[{name:"ProfileLine",type:"line",data:n,smooth:!0,itemStyle:{normal:{color:"#39FDA1"}},lineStyle:{normal:{width:3,color:{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"rgba(85,254,139,1)"},{offset:.5,color:"rgba(7,252,202,1)"},{offset:1,color:"rgba(14,245,210,1)"}],globalCoord:!1}}},areaStyle:{normal:{color:new echarts.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgba(102,153,255,1)"},{offset:.8,color:"rgba(102,153,255,0.08)"},{offset:1,color:"rgba(9,173,208,0.15)"}],!1),shadowColor:"rgba(14,245,210,1)",shadowBlur:20}},markPoint:{data:[{type:"max",name:"最高点",label:{color:"#ffffff"}},{type:"min",name:"最低点",label:{color:"#ffffff"}}]}}]}}else{var m=t._DialogObject._element.content.getElementsByClassName("profile-echarts")[0];t.echartsObject=echarts.init(m),i={tooltip:{trigger:"axis",textStyle:{align:"left"}},grid:{top:40,bottom:20,left:55,right:30},calculable:!0,xAxis:[{type:"value",scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],yAxis:[{type:"value",scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],series:[{name:"ProfileLine",type:"line",data:[],smooth:!0,itemStyle:{normal:{color:"#39FDA1"}},lineStyle:{normal:{width:3,color:{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"rgba(85,254,139,1)"},{offset:.5,color:"rgba(7,252,202,1)"},{offset:1,color:"rgba(14,245,210,1)"}],globalCoord:!1}}},areaStyle:{normal:{color:new echarts.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgba(102,153,255,1)"},{offset:.8,color:"rgba(102,153,255,0.08)"},{offset:1,color:"rgba(9,173,208,0.15)"}],!1),shadowColor:"rgba(14,245,210,1)",shadowBlur:20}},markPoint:{data:[{type:"max",name:"最高点",label:{color:"#ffffff"}},{type:"min",name:"最低点",label:{color:"#ffffff"}}]}}]}}t.echartsObject.setOption(i)}}]);var i,n}(wa);function Qa(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var tr=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=Qa(this,e,[t,n])).viewer=t.viewer,i.resultObject={viewPoint:void 0,targetPoints:[],targetPoint:void 0,objectExclude:[],entities:[]},i.options={},i._elms={},i.viewPointHeight=n.viewPointHeight,i.Dialog=o,i._EventBinding=new wn,YJ.Analysis.AnalysesResults.push(i),e.edit(i),i}return sn()(e,t),_()(e,[{key:"viewPointHeight",get:function(){return this.options.viewPointHeight},set:function(t){var e=Math.floor(10*Number(t))/10;isNaN(e)&&(e=1.8),e<0&&(e=0),this.options.viewPointHeight=e,this._elms.viewPointHeight&&this._elms.viewPointHeight.forEach((function(t){t.value=e}))}},{key:"destroy",value:function(){var t=this;this.resultObject.entities.forEach((function(e){t.viewer.entities.remove(e)})),this.resultObject={viewPoint:void 0,targetPoints:[],targetPoint:void 0,objectExclude:[],entities:[]},this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=null,this.event=null,YJ.Measure.SetMeasureStatus(!1)}}],[{key:"create",value:function(t){if(YJ.Measure.GetMeasureStatus())console.log("上一次测量未结束");else{t._DialogObject&&t._DialogObject.close&&(t._DialogObject.close(),t._DialogObject=null),t.event=new X(t.sdk),t.tip=new Z("左键点击创建视角起点",t.sdk),YJ.Measure.SetMeasureStatus(!0);t.event.mouse_left(function(){var i=o()(a.a.mark((function i(n,o){var s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(t.tip.set_text("左键创建视角终点,右键结束通视分析"),t.resultObject.viewPoint){i.next=16;break}if(s=t.cartesian3Towgs84(o,t.viewer),!t.sdk.viewer.terrainProvider.availability){i.next=7;break}return i.next=6,Cesium.sampleTerrainMostDetailed(t.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(s.lng,s.lat)]);case 6:r=i.sent;case 7:r&&r[0].height>s.alt&&(s.alt=r[0].height),s.alt=s.alt+t.viewPointHeight,l=Cesium.Cartesian3.fromDegrees(s.lng,s.lat,s.alt),t.resultObject.viewPoint=l,c=t.viewer.entities.add({position:l,point:{color:Cesium.Color.YELLOW,pixelSize:5}}),t.resultObject.objectExclude.push(c),t.resultObject.entities.push(c),i.next=33;break;case 16:t.resultObject.targetPoint=o,u=t.viewer.entities.add({position:o,point:{color:Cesium.Color.YELLOW,pixelSize:5}}),t.resultObject.objectExclude.push(u),t.resultObject.entities.push(u),p=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.resultObject.targetPoint,t.resultObject.viewPoint,new Cesium.Cartesian3),new Cesium.Cartesian3),h=new Cesium.Ray(t.resultObject.viewPoint,p),d=t.viewer.scene.drillPickFromRay(h),m={},f=0;case 25:if(!(fg?(b=t.viewer.entities.add({polyline:{positions:[t.resultObject.viewPoint,m.position],material:Cesium.Color.GREEN,width:3,zIndex:99999999}}),t.resultObject.entities.push(b),C=t.viewer.entities.add({polyline:{positions:[m.position,t.resultObject.targetPoint],material:Cesium.Color.RED,width:3,zIndex:99999999}}),t.resultObject.entities.push(C),t.resultObject.targetPoints.push({targetPoint:o,visual:!1,distance:[v,g,y]})):(w=t.viewer.entities.add({polyline:{positions:[t.resultObject.viewPoint,t.resultObject.targetPoint],material:Cesium.Color.GREEN,width:3,zIndex:99999999}}),t.resultObject.entities.push(w),t.resultObject.targetPoints.push({targetPoint:o,visual:!0,distance:[v,g,y]})));case 33:case"end":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}()),t.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right((function(t,e){i()})),t.event.gesture_pinck_start((function(e,n){var o=new Date;t.event.gesture_pinck_end((function(){new Date-o>=500&&i()}))}))}function i(){YJ.Measure.SetMeasureStatus(!1),t.tip.destroy(),t.event.destroy(),t.tip=null,t.event=null}}},{key:"edit",value:(i=o()(a.a.mark((function t(i){var n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new W(i.sdk.viewer._container,{title:"多点视线分析",left:"180px",top:"100px",closeCallBack:function(){i.Dialog.closeCallBack&&i.Dialog.closeCallBack(),YJ.Measure.SetMeasureStatus(!1)}});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" visibility",(n=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 视点高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n ',i._DialogObject.contentAppChild(n),(o=document.createElement("button")).innerHTML="绘制",o.addEventListener("click",(function(){e.create(i)})),i._DialogObject.footAppChild(o),s=n.getElementsByTagName("*"),i._EventBinding.on(i,s),i._elms=i._EventBinding.element;case 17:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"distance",value:function(t,e){var i=Cesium.Cartographic.fromCartesian(t),n=Cesium.Cartographic.fromCartesian(e),o=new Cesium.EllipsoidGeodesic;o.setEndPoints(i,n);var s=o.surfaceDistance;return s=Math.sqrt(Math.pow(s,2)+Math.pow(n.height-i.height,2))}}]);var i}(fi),er=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),this.viewer=e.viewer;var n=this.viewer.terrainProvider.availability;if(!n)return this.error="未加载地形数据!",window.ELEMENT&&window.ELEMENT.Message({message:"未加载地形数据!",type:"warning",duration:1500}),void console.warn(this.error);this.positions=i.positions,this.interfaceNum=i.interfaceNum||25,this.colorFill=i.colorFill||["#8CEA00","#B7FF4A","#FFFF37","#FFE66F","#FFD1A4","#FFCBB3","#FFBD9D","#FFAD86","#FF9D6F","#FF8F59","#FF8040","#FF5809","#F75000","#D94600","#BB3D00","#A23400","#842B00","#642100","#4D0000","#2F0000"],this.countorLineList=Cesium.defaultValue(i.countorLineList,[]),YJ.Analysis.AnalysesResults.push(this),this.createNewLine()}return _()(t,[{key:"type",get:function(){return"ContourAnalysis"}},{key:"createNewLine",value:function(){t.interpolatePoint(this)}},{key:"getObjectIndex",value:function(t,e){for(var i=0;ie)return i}},{key:"clear",value:function(t){if(t){this.viewer.dataSources.remove(t);var e=this.countorLineList.indexOf(t);this.countorLineList.splice(e,1)}}},{key:"destroy",value:function(){var t=this;this.countorLineList.forEach((function(e){t.viewer.dataSources.remove(e)})),this.countorLineList=[]}}],[{key:"interpolatePoint",value:function(t){for(var e=t.positions,i=[],n={minX:360,maxX:-360,minY:180,maxY:-180},o=0;o2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=or(this,e,[t,o])).viewer=t.viewer,n.tiles3d=i,n.options=nr({},o),n.options.regionsType=n.options.regionsType||!1,YJ.Analysis.SectionResults.push(n),n.Planes=[],e.start(n),n}return sn()(e,t),_()(e,[{key:"regionsType",get:function(){return this.options.regionsType},set:function(t){this.options.regionsType=t,this.Planes.length>0&&(this.Planes=[],e.planeCollection(this))}},{key:"destroy",value:function(){this.Planes=[],this.tiles3d.clippingPlanes&&(this.tiles3d.clippingPlanes.enabled=!1,this.tiles3d.clippingPlanes.removeAll())}}],[{key:"start",value:function(t){var i=t.options.positions||[];if(!t.isConvex(i))return window.ELEMENT&&window.ELEMENT.Message({message:"不支持凹多边形",type:"warning",duration:1500}),void console.log("不支持凹多边形");t.inverseTransform=function(t){var e,i=t.root.transform;e=i&&i.equals(Cesium.Matrix4.IDENTITY)||!i?Cesium.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center):Cesium.Matrix4.fromArray(t.root.transform);return Cesium.Matrix4.inverseTransformation(e,new Cesium.Matrix4)}(t.tiles3d),t.Planes=[];var n=[];if(i.length>0){for(var o=0;o=0;n--)0===n?t.Planes.push(a(e[n],e[e.length-1],t.inverseTransform)):t.Planes.push(a(e[n],e[n-1],t.inverseTransform));if(t.tiles3d.clippingPlanes){t.tiles3d.clippingPlanes.removeAll();for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:{};k()(this,e),(i=ar(this,e,[t])).viewer=t.viewer,i.options=n||{},i.options.height=i.options.height||0===i.options.height?i.options.height:10,i.options.show=!i.options.show&&!1!==i.options.show||i.options.show,i.bottomImg=i.getSourceRootPath()+"/img/excavationregion_top.jpg",i.wallImg=i.getSourceRootPath()+"/img/excavationregion_side.jpg",i.splitNum=Cesium.defaultValue(n.splitNum,50),i.Draw=new Ea(i.sdk),i.bottomMaterial=Cesium.Material.fromType("Color",{color:Cesium.Color.fromAlpha(Cesium.Color.fromCssColorString("#735d4f"))}),i.wallMaterial=Cesium.Material.fromType("Color",{color:Cesium.Color.fromAlpha(Cesium.Color.fromCssColorString("#976b4e"))});var o=new Image,s=new Image;return o.src=i.bottomImg,s.src=i.wallImg,o.crossOrigin="Anonymous",s.crossOrigin="Anonymous",o.onload=function(){var t=document.createElement("canvas");t.width=o.width,t.height=o.height,t.getContext("2d").drawImage(o,0,0,o.width,o.height);var e=t.toDataURL("image/jpg");i.bottomMaterial=new Cesium.Material({fabric:{type:"Image",uniforms:{image:e}}}),i.bottomSurface&&(i.bottomSurface.appearance.material=i.bottomMaterial)},s.onload=function(){var t=document.createElement("canvas");t.width=s.width,t.height=s.height,t.getContext("2d").drawImage(s,0,0,s.width,s.height);var e=t.toDataURL("image/jpg");i.wallMaterial=new Cesium.Material({fabric:{type:"Image",uniforms:{image:e}}}),i.wellWall&&(i.wellWall.appearance.material=i.wallMaterial)},i.init(),i}return sn()(e,t),_()(e,[{key:"show",get:function(){return this.options.show},set:function(t){this.options.show=t,this.switchExcavate(t)}},{key:"height",get:function(){return this.options.height},set:function(t){this.options.height=t}},{key:"init",value:function(){e.edit(this,!0)}},{key:"startCreate",value:function(){var t=this;this.Draw.start((function(e,i){if(i&&!(i.length<=2))return t.isConvex(i)?void t.updateData(i):(window.ELEMENT&&window.ELEMENT.Message({message:"不支持凹多边形",type:"warning",duration:1500}),void console.log("不支持凹多边形"));window.ELEMENT&&window.ELEMENT.Message({message:"至少拥有三个坐标位置!",type:"warning",duration:1500})}))}},{key:"updateData",value:function(t){var e=this.viewer;this.clear();for(var i=[],n=[],o=0;o=0;t--)this.viewer.scene.primitives.remove(rr[t]);rr=[],this.Draw&&this.Draw.end()}},{key:"destroy",value:function(){this.clear()}},{key:"prepareWell",value:function(t){for(var e=t.length,i=this.excavateMinHeight-this.height,n=[],o=[],s=[],a=0;a\n
        \n
        \n
        \n 挖掘高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 绘制开挖区域\n \n
        \n
        \n 清除开挖区域\n \n
        \n
        \n
        \n ',e._DialogObject.contentAppChild(n),n.getElementsByClassName("start-excavation")[0].addEventListener("click",(function(){e.startCreate()})),n.getElementsByClassName("clean-excavation")[0].addEventListener("click",(function(){e.clear()})),(o=n.querySelector("input[name='height']")).value=e.height,o.addEventListener("change",(function(t){var i=t.target.value;(i=Number(i))<.01&&(i=.01,t.target.value=i,e.height=i)})),o.addEventListener("blur",(function(t){var i=t.target.value;i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),i<.01&&(i=.01),t.target.value=i,e.height=i})),t.next=22;break;case 21:e._DialogObject&&e._DialogObject.close&&(e._DialogObject.close(),e._DialogObject=null);case 22:case"end":return t.stop()}}),t)}))),function(t,e){return i.apply(this,arguments)})}]);var i}(fi);function cr(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ur(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(k()(this,e),n=pr(this,e,[t]),C()(n,"getUniqueArray",(function(t){return t.filter((function(t,e,i){return i.indexOf(t,0)===e}))})),!i||!n.sdk||!n.sdk.viewer)return tn()(n);if(n.options=ur({},o),n.options.id=o.id||n.randomString(),n.options.name=o.name||"压平面",n.options.positions=o.positions||[],n.options.show=!o.show&&!1!==o.show||o.show,n.tileset=i,n.Dialog=s,!n.options.height&&0!==n.options.height){for(var a=n.options.positions[0].alt,r=0;rn.options.positions[r].alt&&(a=n.options.positions[r].alt);n.options.height=a}return hr[n.tileset.id]?hr[n.tileset.id].push(ur({},n.options)):hr[n.tileset.id]=[ur({},n.options)],n.center=i.boundingSphere.center.clone(),n.center84=n.cartesian3Towgs84(n.center,n.sdk.viewer),n.matrix=Cesium.Transforms.eastNorthUpToFixedFrame(n.center.clone()),n.localMatrix=Cesium.Matrix4.inverse(n.matrix,new Cesium.Matrix4),n.addFlat(),n}return sn()(e,t),_()(e,[{key:"show",get:function(){return this.options.show},set:function(t){this.options.show=t;for(var e=0;e= max(p1[1], p2[1])){\n continue;\n }\n float x = p1[0] + ((point[1] - p1[1]) * (p2[0] - p1[0])) / (p2[1] - p1[1]);\n if(x > point[0]){\n nCross++;\n }\n }\n return int(mod(float(nCross), float(2))) == 1;\n }\n ")})),n}},{key:"updateShader",value:function(t,e){var i=new Cesium.CustomShader({uniforms:{u_tileset_localToWorldMatrix:{type:Cesium.UniformType.MAT4,value:this.matrix},u_tileset_worldToLocalMatrix:{type:Cesium.UniformType.MAT4,value:this.localMatrix},u_flatHeight:{type:Cesium.UniformType.FLOAT,value:this.flatHeight}},vertexShaderText:"\n // 所有isPointInPolygon函数\n ".concat(t,"\n void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput){\n vec3 modelMC = vsInput.attributes.positionMC;\n vec4 model_local_position = vec4(modelMC.x, modelMC.y, modelMC.z, 1.0);\n vec4 tileset_local_position = u_tileset_worldToLocalMatrix * czm_model * model_local_position;\n vec2 position2D = vec2(tileset_local_position.x,tileset_local_position.y);\n float ground_z = 0.0;\n // 多个多边形区域\n ").concat(e,"\n }")});this.tileset.customShader=i,this.sdk.viewer.scene.requestRender()}},{key:"cartesiansToLocal",value:function(t){for(var e=[],i=0;i\n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n 压平高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n ',this._DialogObject.contentAppChild(i),(n=i.getElementsByClassName("input-name")[0]).value=this.options.name,n.addEventListener("input",(function(){r.name=n.value})),(o=i.getElementsByClassName("flat-height")[0]).value=this.options.height,o.addEventListener("input",(function(){r.height=Number(o.value),r.addFlat()})),(s=document.createElement("button")).className="btn",s.innerHTML="确认",this._DialogObject.footAppChild(s),s.addEventListener("click",(function(){r.options.name||(r.options.name="压平面"),r.originalOptions=r.deepCopyObj(r.options),r._DialogObject.close(),r.Dialog.confirmCallBack&&r.Dialog.confirmCallBack(r.options)})),t.next=24;break;case 23:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 24:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"reset",value:function(){this.options=this.deepCopyObj(this.originalOptions),this.name=this.options.name,this.height=this.options.height,this.addFlat()}},{key:"flatEdit",value:function(t){if(t){for(var e=that.options.positions,i=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:{text:"左键开始,右键结束;"};return k()(this,e),(i=vr(this,e,[t,n])).options=fr({},n),i.event=new X(t),i.tip=new Z(n.text,t),i.viewer=t.viewer,i.defaultColor="rgba(246,49,49,0.55)",i.ids=[],YJ.Measure.Measures.push(i),i._isDestroy=!1,i}return sn()(e,t),_()(e,[{key:"start",value:function(){this.setPickStatus(!1),YJ.Measure.SetMeasureStatus(!0)}},{key:"destroy",value:function(){var t=this;this._isDestroy=!0,this.end(),this.ids.forEach((function(e){t.remove_entity(e)}))}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=null,this.event=null}},{key:"create_point",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.randomString(),n=this.cartesian3Towgs84(t,this.viewer);return this.viewer.entities.add(new Cesium.Entity({id:i,position:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt),billboard:{show:e,image:this.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}})),i}},{key:"remove_entity",value:function(t){this.viewer.entities.removeById(t)}}])}(fi);function yr(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return br(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?br(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function br(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Cr(this,e,[t,n])).options.color=i.options.color||"#00ffff",i.start_id="",i.end_id="",i.polyline_id="",i.clampPositions=[],i}return sn()(e,t),_()(e,[{key:"clampToGroundMeasure",value:(r=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],this.ids.forEach((function(t,e){var i=d.viewer.entities.getById(t).position.getValue();n.push(d.cartesian3Towgs84(i,d.viewer))})),o=this.chunkLine(n,e),s=[],o.forEach((function(t,e){0===e?s=L()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),r=s.length,l=yr(s),t.prev=7,l.s();case 9:if((c=l.n()).done){t.next=18;break}return u=c.value,p=s.indexOf(u),t.next=14,this.getHeight({lng:u[0],lat:u[1],alt:0},p,r);case 14:h=t.sent,i(null,h);case 16:t.next=9;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(7),l.e(t.t0);case 23:return t.prev=23,l.f(),t.finish(23);case 26:case"end":return t.stop()}}),t,this,[[7,20,23,26]])}))),function(t,e){return r.apply(this,arguments)})},{key:"computeDisByTowPoint",value:(s=o()(a.a.mark((function t(i,n){var s,r,l,c,u=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=this.computeDistance2([i,n]),r=10,l=function(t){if(!u._isDestroy){var i=u.getLabel("贴地距离:"+Number(t).toFixed(2)+"米");i.pixelOffset=new Cesium.Cartesian2(0,-32),u.ids.push(e.create_point(Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt),{label:i},u))}},c=function(){var t=o()(a.a.mark((function t(e){var o,s,r,c,p,h,d,m,f,v;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=u.chunkLine([i,n],e),s=[],o.forEach((function(t,e){0===e?s=L()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),r=[],c=yr(s),t.prev=5,c.s();case 7:if((p=c.n()).done){t.next=16;break}return h=p.value,d=s.indexOf(h),t.next=12,u.sampleHeight({lng:h[0],lat:h[1],alt:0},d);case 12:m=t.sent,r.push(m);case 14:t.next=7;break;case 16:t.next=21;break;case 18:t.prev=18,t.t0=t.catch(5),c.e(t.t0);case 21:return t.prev=21,c.f(),t.finish(21);case 24:f=0,v=r.length-1,r.forEach((function(t,e){if(e!==v){var i=u.computeDistance2([t.position,r[e+1].position]),n=Math.abs(t.position.alt-r[e+1].position.alt),o=Math.sqrt(i*i+n*n);f+=o}})),l(f);case 28:case"end":return t.stop()}}),t,null,[[5,18,21,24]])})));return function(e){return t.apply(this,arguments)}}(),!(s>2)){t.next=10;break}return r=s/20,t.next=8,c(r);case 8:t.next=17;break;case 10:if(!(s<1)){t.next=14;break}l(s),t.next=17;break;case 14:return r=1,t.next=17,c(r);case 17:case"end":return t.stop()}}),t,this)}))),function(t,e){return s.apply(this,arguments)})},{key:"sampleHeight",value:(n=o()(a.a.mark((function t(e,i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getClampToHeight(e,L()(this.sdk.viewer.entities.values));case 2:return n=t.sent,e.alt=n,t.abrupt("return",{position:e,index:i});case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"getHeight",value:(i=o()(a.a.mark((function t(e,i,n){var o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:if(o=t.sent,e.alt=o[0].height,this.clampPositions.push({position:e,index:i}),n!==this.clampPositions.length){t.next=8;break}return s=this.startCompute(),t.abrupt("return",{total:n,current:this.clampPositions.length,total_length:s});case 8:return t.abrupt("return",{total:n,current:this.clampPositions.length});case 9:case"end":return t.stop()}}),t,this)}))),function(t,e,n){return i.apply(this,arguments)})},{key:"startCompute",value:function(){var t=this;this.clampPositions.sort((function(t,e){return t.index=500?n():i(a,o)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polyline_id,this.end_id,this.start_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),wr(e,"destroy",this,3)([])}},{key:"end",value:function(){wr(e,"end",this,3)([])}}],[{key:"createPolyline",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:3,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),dashLength:20}),zIndex:99999999}})),e}},{key:"create_point",value:function(t,e,i){var n=e.label,o=e.image,s=void 0===o?"point.png":o,a=e.width,r=e.height,l=i.randomString(),c=i.cartesian3Towgs84(t,i.viewer);return n&&(n.pixelOffset=new Cesium.Cartesian2(0,-(r||32))),i.viewer.entities.add(new Cesium.Entity({id:l,label:n,position:Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt),billboard:{image:i.getSourceRootPath()+"/img/"+s,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:a,height:r}})),l}}]);var i,n,s,r}(gr);function xr(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return _r(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_r(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function _r(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Er(this,e,[t,n])).options.color=i.options.color||"#00ffff",i.start_id="",i.end_id="",i.polyline_id="",i.clampPositions=[],i}return sn()(e,t),_()(e,[{key:"clampToGroundMeasure",value:(s=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],this.ids.forEach((function(t,e){var i=d.viewer.entities.getById(t).position.getValue();n.push(d.cartesian3Towgs84(i,d.viewer))})),o=this.chunkLine(n,e),s=[],o.forEach((function(t,e){0===e?s=L()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),r=s.length,l=xr(s),t.prev=7,l.s();case 9:if((c=l.n()).done){t.next=18;break}return u=c.value,p=s.indexOf(u),t.next=14,this.getHeight({lng:u[0],lat:u[1],alt:0},p,r);case 14:h=t.sent,i(null,h);case 16:t.next=9;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(7),l.e(t.t0);case 23:return t.prev=23,l.f(),t.finish(23);case 26:case"end":return t.stop()}}),t,this,[[7,20,23,26]])}))),function(t,e){return s.apply(this,arguments)})},{key:"sampleHeight",value:(n=o()(a.a.mark((function t(e,i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:return n=t.sent,e.alt=n[0].height,t.abrupt("return",{position:e,index:i});case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"getHeight",value:(i=o()(a.a.mark((function t(e,i,n){var o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:if(o=t.sent,e.alt=o[0].height,this.clampPositions.push({position:e,index:i}),n!==this.clampPositions.length){t.next=8;break}return s=this.startCompute(),t.abrupt("return",{total:n,current:this.clampPositions.length,total_length:s});case 8:return t.abrupt("return",{total:n,current:this.clampPositions.length});case 9:case"end":return t.stop()}}),t,this)}))),function(t,e,n){return i.apply(this,arguments)})},{key:"startCompute",value:function(){var t=this;this.clampPositions.sort((function(t,e){return t.index=500?n():i(a,o)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polyline_id,this.end_id,this.start_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),Sr(e,"destroy",this,3)([])}},{key:"end",value:function(){Sr(e,"end",this,3)([])}}],[{key:"createPolyline",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:3,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),dashLength:20})},zIndex:99999999})),e}},{key:"create_point",value:function(t,e,i){var n=e.label,o=e.image,s=void 0===o?"point.png":o,a=e.width,r=e.height,l=i.randomString(),c=i.cartesian3Towgs84(t,i.viewer);return n&&(n.pixelOffset=new Cesium.Cartesian2(0,-(r||32))),i.viewer.entities.add(new Cesium.Entity({id:l,label:n,position:Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt),billboard:{image:i.getSourceRootPath()+"/img/"+s,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:a,height:r}})),l}}]);var i,n,s}(gr);function Pr(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Mr(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Mr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Mr(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Or(this,e,[t,n])).options.color=i.options.color||"#00ffff",i.start_id="",i.end_id="",i.polyline_id="",i.clampPositions=[],i.event=new X(t),i}return sn()(e,t),_()(e,[{key:"clampToGroundMeasure",value:(s=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],this.ids.forEach((function(t,e){var i=d.viewer.entities.getById(t).position.getValue();n.push(d.cartesian3Towgs84(i,d.viewer))})),o=this.chunkLine(n,e),s=[],o.forEach((function(t,e){0===e?s=L()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),r=s.length,l=Pr(s),t.prev=7,l.s();case 9:if((c=l.n()).done){t.next=18;break}return u=c.value,p=s.indexOf(u),t.next=14,this.getHeight({lng:u[0],lat:u[1],alt:0},p,r);case 14:h=t.sent,i(null,h);case 16:t.next=9;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(7),l.e(t.t0);case 23:return t.prev=23,l.f(),t.finish(23);case 26:case"end":return t.stop()}}),t,this,[[7,20,23,26]])}))),function(t,e){return s.apply(this,arguments)})},{key:"sampleHeight",value:(n=o()(a.a.mark((function t(e,i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:return n=t.sent,e.alt=n[0].height,t.abrupt("return",{position:e,index:i});case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"getHeight",value:(i=o()(a.a.mark((function t(e,i,n){var o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:if(o=t.sent,e.alt=o[0].height,this.clampPositions.push({position:e,index:i}),n!==this.clampPositions.length){t.next=8;break}return s=this.startCompute(),t.abrupt("return",{total:n,current:this.clampPositions.length,total_length:s});case 8:return t.abrupt("return",{total:n,current:this.clampPositions.length});case 9:case"end":return t.stop()}}),t,this)}))),function(t,e,n){return i.apply(this,arguments)})},{key:"startCompute",value:function(){var t=this;this.clampPositions.sort((function(t,e){return t.index=500?n(0,o):i(a,o)}))}))}}},{key:"computeAngle",value:function(t,i){var n=this.computeDistance2([t,i]),o=Math.abs(t.alt-i.alt),s=n/Math.sqrt(n*n+o*o),a=Math.acos(s),r=this.radiansToDegrees(a),l=this.getLabel("坡度:"+r.toFixed(2)+"°");l.pixelOffset=new Cesium.Cartesian2(0,-32),this.ids.push(e.create_point(Cesium.Cartesian3.fromDegrees(i.lng,i.lat,i.alt),{label:l},this))}},{key:"destroy",value:function(){var t=this;[this.polyline_id,this.end_id,this.start_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),Tr(e,"destroy",this,3)([])}},{key:"end",value:function(){Tr(e,"end",this,3)([])}}],[{key:"createPolyline",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:3,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),dashLength:20}),zIndex:99999999}})),e}},{key:"create_point",value:function(t,e,i){var n=e.label,o=e.image,s=void 0===o?"point.png":o,a=e.width,r=e.height,l=i.randomString(),c=i.cartesian3Towgs84(t,i.viewer);return n&&(n.pixelOffset=new Cesium.Cartesian2(0,-(r||32))),i.viewer.entities.add(new Cesium.Entity({id:l,label:n,position:Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt),billboard:{image:i.getSourceRootPath()+"/img/"+s,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:a,height:r}})),l}}]);var i,n,s}(gr);function Br(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Lr(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Ar(this,e,[t,n])).options.lineColor="#ffdf53",i.polygon_id="",i}return sn()(e,t),_()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){jr(e,"start",this,3)([]),this.ids=[],this.positions=[],this.text="",this.center=new Cesium.Cartesian3,this.cachePositions=[];var i,n=0,o=0,s=function(s,a){0===t.ids.length&&(t.polygon_id=e.create_polygon(t)),t.cachePositions.push(Lr({},a)),t.ids.push(t.create_point(Lr({},a),!1));var r=t.cartesian3Towgs84(Lr({},a),t.viewer);if(r.alt>n&&(n=r.alt),t.positions=t.cachePositions.concat(Lr({},a)),t.tip.setPosition(Lr({},a),s.position.x,s.position.y),t.positions.length>2){var l=[];t.positions.forEach((function(e){var i=t.cartesian3Towgs84(e,t.viewer);l.push({lng:i.lng,lat:i.lat})}));var c=t.computeCenter(l),u=t.computeArea(l);o=u,t.center=new Cesium.Cartesian3.fromDegrees(c.lng,c.lat,n),i=t.center,t.text="投影面积:"+u+" ㎡"}};this.event.mouse_left(s),this.event.mouse_move((function(e,i){if(t.tip.setPosition(Lr({},i),e.endPosition.x,e.endPosition.y),t.positions=t.cachePositions.concat(Lr({},i)),t.positions.length>2){var o=[];t.positions.forEach((function(e){var i=t.cartesian3Towgs84(e,t.viewer);o.push({lng:i.lng,lat:i.lat})}));var s=t.computeCenter(o),a=t.computeArea(o);t.center=new Cesium.Cartesian3.fromDegrees(s.lng,s.lat,n),t.text="投影面积:"+a+" ㎡"}})),this.event.mouse_right((function(e,n){if(t.positions=t.cachePositions,t.center=i,t.positions.length<3){t.text="";console.warn("面积计算至少需要三个坐标!"),window.ELEMENT&&window.ELEMENT.Message({message:"面积计算至少需要三个坐标!",type:"warning",duration:1500}),t.destroy()}else t.text="投影面积:"+o+" ㎡";t.end()})),this.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?(t.positions=t.cachePositions,t.end()):s(o,i)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polygon_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),jr(e,"destroy",this,3)([])}},{key:"end",value:function(){jr(e,"end",this,3)([])}}],[{key:"create_polygon",value:function(t){var e=t.randomString();new Cesium.NearFarScalar(2e3,1,1e5,0),t.viewer.entities.add(new Cesium.Entity({id:e,label:{text:new Cesium.CallbackProperty((function(){return t.text}),!1),font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#ffffff"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM},position:new Cesium.CallbackProperty((function(){return t.center}),!1),polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(t.positions)}),!1),material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions.length?t.positions.concat(t.positions[0]):t.positions}),!1),width:2,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.lineColor||t.defaultColor),dashLength:20}),clampToGround:!0,zIndex:99999999}}));return e}}])}(gr);function Rr(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Fr(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=zr(this,e,[t,n])).options.lineColor="#ffdf53",i.polygon_id="",i}return sn()(e,t),_()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){Hr(e,"start",this,3)([]),this.ids=[],this.positions=[],this.text="",this.center=new Cesium.Cartesian3,this.cachePositions=[];var i=0,n=function(n,o){0===t.ids.length&&(t.polygon_id=e.create_polygon(t)),t.cachePositions.push(Fr({},o)),t.ids.push(t.create_point(Fr({},o),!1));var s=t.cartesian3Towgs84(Fr({},o),t.viewer);s.alt>i&&(i=s.alt),t.positions=t.cachePositions.concat(Fr({},o)),t.tip.setPosition(Fr({},o),n.position.x,n.position.y)},o=function(e,n){if(t.positions=t.cachePositions,t.positions.length>2){var o=[];t.positions.forEach((function(e){var i=t.cartesian3Towgs84(e,t.viewer);o.push({lng:i.lng,lat:i.lat})})),setTimeout((function(){var e=t.computeCenter(o),n=t.computeSignedArea(t.viewer,o);t.center=new Cesium.Cartesian3.fromDegrees(e.lng,e.lat,i),t.text="贴地面积:"+n+" ㎡"}),0)}else{console.warn("面积计算至少需要三个坐标!"),window.ELEMENT&&window.ELEMENT.Message({message:"面积计算至少需要三个坐标!",type:"warning",duration:1500}),t.destroy()}t.end()};this.event.mouse_left(n),this.event.mouse_move((function(e,i){t.tip.setPosition(Fr({},i),e.endPosition.x,e.endPosition.y),t.positions=t.cachePositions.concat(Fr({},i))})),this.event.mouse_right(o),this.event.gesture_pinck_start((function(e,i){var s=new Date,a={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-s>=500?o():n(a,i)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polygon_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),Hr(e,"destroy",this,3)([])}},{key:"end",value:function(){Hr(e,"end",this,3)([])}}],[{key:"create_polygon",value:function(t){var e=t.randomString();new Cesium.NearFarScalar(2e3,1,1e5,0),t.viewer.entities.add(new Cesium.Entity({id:e,label:{text:new Cesium.CallbackProperty((function(){return t.text}),!1),font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#ffffff"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM},position:new Cesium.CallbackProperty((function(){return t.center}),!1),polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(t.positions)}),!1),material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions.length?t.positions.concat(t.positions[0]):t.positions}),!1),width:2,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.lineColor||t.defaultColor),dashLength:20}),clampToGround:!0,zIndex:99999999}}));return e}}])}(gr);function Gr(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Ur(t,e,i,n){var o=ba()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Wr=function(t){function e(t){return k()(this,e),Gr(this,e,[t])}return sn()(e,t),_()(e,[{key:"cal_center",value:function(t){var e=this.cartesian3Towgs84(t[0],this.viewer),i=this.cartesian3Towgs84(t[1],this.viewer),n=this.computeCenter([e,i]);return Cesium.Cartesian3.fromDegrees(n.lng,n.lat,(e.alt+i.alt)/2)}},{key:"cal_distance",value:function(t){var e=this.cartesian3Towgs84(t[0],this.viewer),i=this.cartesian3Towgs84(t[1],this.viewer),n=this.computeDistance2([e,i]);return e.alt=e.alt.toFixed(2),i.alt=i.alt.toFixed(2),e.alt===i.alt?n:0===Number(n)?Math.abs(e.alt-i.alt).toFixed(2):Math.sqrt(n*n+Math.pow(Math.abs(e.alt-i.alt).toFixed(2),2)).toFixed(2)}},{key:"createPolyline",value:function(t){var e=this,i=this.id_map.get(t);this.viewer.entities.add(new Cesium.Entity({id:t,position:new Cesium.CallbackProperty((function(){return 2===i.positions.length?e.cal_center(i.positions):Cesium.Cartesian3()}),!1),label:{text:new Cesium.CallbackProperty((function(){return 2===i.positions.length?e.cal_distance(i.positions)+"米":"0米"}),!1),scale:1,fillColor:Cesium.Color.RED,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(0,-10),disableDepthTestDistance:Number.POSITIVE_INFINITY},polyline:{positions:new Cesium.CallbackProperty((function(){return i.positions}),!1),width:2,material:Cesium.Color.YELLOW,zIndex:99999999}})),this.ids.push(t)}},{key:"create_angle_label",value:function(t,e,i,n){var o=this,s=new Cesium.Entity({id:i,position:new Cesium.CallbackProperty((function(){return 2===t.length?o.cal_point(t,e):Cesium.Cartesian3()})),label:{text:new Cesium.CallbackProperty((function(){return 2===t.length?o.cal_angle(t,e,n)+"°":"0°"}),!1),scale:1,fillColor:Cesium.Color.RED,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(15,-10)}});this.viewer.entities.add(s)}},{key:"cal_point",value:function(t,e){for(var i=0;i=500?t.end():r(o,i)}))}))}}},{key:"end",value:function(){Ur(e,"end",this,3)([])}},{key:"destroy",value:function(){Ur(e,"destroy",this,3)([])}}])}(gr);function Yr(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Jr(t,e,i,n){var o=ba()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var qr=function(t){function e(t){var i;return k()(this,e),(i=Yr(this,e,[t,{text:""}])).defaultColor="#f11515",i.locationID=i.randomString(),i.position=new Cesium.Cartesian3,i.text="",i}return sn()(e,t),_()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){Jr(e,"start",this,3)([]),this.cache_id=e.create_point(this),e.createLocation(this);var i=function(e,i){t.position=i;var n=t.viewer.entities.getById(t.locationID);n&&(n.show=!0);var o=t.cartesian3Towgs84(i,t.viewer),s=li();if("EPSG:4326"===s)t.text="经度:".concat(Number(o.lng.toFixed(8)),"\n纬度:").concat(Number(o.lat.toFixed(8)),"\n海拔:").concat(Number(o.alt.toFixed(2)));else{var a=t.convert([{x:o.lng,y:o.lat,z:o.alt}],"EPSG:4326",s);t.text="x:".concat(Number(a.points[0].x.toFixed(8)),"\ny:").concat(Number(a.points[0].y.toFixed(8)),"\nz:").concat(Number(a.points[0].z.toFixed(2)))}t.end()};this.event.mouse_left(i),this.event.mouse_right((function(e,i){t.destroy(),t.end()})),this.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y);var n=t.viewer.entities.getById(t.locationID);n&&(n.show=!0),t.position=i;var o=t.cartesian3Towgs84(i,t.viewer),s=li();if("EPSG:4326"===s)t.text="经度:".concat(Number(o.lng.toFixed(8)),"\n纬度:").concat(Number(o.lat.toFixed(8)),"\n海拔:").concat(Number(o.alt.toFixed(2)));else{var a=t.convert([{x:o.lng,y:o.lat,z:o.alt}],"EPSG:4326",s);t.text="x:".concat(Number(a.points[0].x.toFixed(8)),"\ny:").concat(Number(a.points[0].y.toFixed(8)),"\nz:").concat(Number(a.points[0].z.toFixed(2)))}})),this.event.gesture_pinck_start((function(e,n){var o=new Date;e.position1.x,e.position2.x,e.position1.y,e.position2.y;t.event.gesture_pinck_end((function(){new Date-o>=500?(t.destroy(),t.end()):i(0,n)}))}))}}},{key:"destroy",value:function(){this.remove_entity(this.locationID),this.remove_entity(this.cache_id),Jr(e,"destroy",this,3)([])}},{key:"end",value:function(){Jr(e,"end",this,3)([])}}],[{key:"createLocation",value:function(t){t.viewer.entities.add(new Cesium.Entity({id:t.locationID,show:!1,position:new Cesium.CallbackProperty((function(){return t.position}),!1),label:{text:new Cesium.CallbackProperty((function(){return t.text}),!1),font:"22px Microsoft YaHei",fillColor:new Cesium.Color.fromCssColorString(t.defaultColor),style:Cesium.LabelStyle.FILL_AND_OUTLINE,horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,pixelOffset:new Cesium.Cartesian2(-100,-50)},billboard:{image:t.getSourceRootPath()+"/img/location.png",color:Cesium.Color.fromCssColorString("rgba(255,255,255,0.99)"),disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,width:48,height:48}}))}},{key:"create_point",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,position:new Cesium.CallbackProperty((function(){return t.position}),!1),billboard:C()({image:t.getSourceRootPath()+"/img/point.png",color:Cesium.Color.fromCssColorString("rgba(255,255,255,0.99)"),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY},"color",Cesium.Color.WHITE.withAlpha(.99))})),e}}])}(gr);function Xr(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Zr(t,e,i,n){var o=ba()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Kr=function(t){function e(t){return k()(this,e),Xr(this,e,[t,{text:"左键开始,右键取消"}])}return sn()(e,t),_()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){Zr(e,"start",this,3)([]),this.positions=[],this.position=new Cesium.Cartesian3,this.height=0,this.text="",this.circleRadius=0;var i=0;this.firstpoint=null;var n=function(n,o){if(null===t.firstpoint&&(t.positions.push(o),t.firstpoint=t.cartesian3Towgs84(o,t.viewer),t.ids.push(e.create_polygon(t)),t.ids.push(e.create_point(t,o))),i++,t.tip.setPosition(o,n.position.x,n.position.y),2===i){if(t.firstpoint){var s=t.cartesian3Towgs84(o,t.viewer);t.positions[1]=Cesium.Cartesian3.fromDegrees(t.firstpoint.lng,t.firstpoint.lat,s.alt),t.positions[2]=o,t.position=t.positions[1],t.circleRadius=t.computeDistance2([t.firstpoint,s]),t.height=Number((s.alt-t.firstpoint.alt).toFixed(2)),t.text="相对高度:"+t.height+" 米",t.tip.set_text("左键完成,右键取消;半径:"+t.circleRadius+" 米")}t.ids.push(e.create_point(t,o,{label:{text:"半径:"+t.circleRadius+" 米"}})),t.end()}};this.event.mouse_left(n),this.event.mouse_move((function(e,i){if(t.tip.setPosition(i,e.endPosition.x,e.endPosition.y),t.firstpoint){var n=t.cartesian3Towgs84(i,t.viewer);t.positions[1]=Cesium.Cartesian3.fromDegrees(t.firstpoint.lng,t.firstpoint.lat,n.alt),t.positions[2]=i,t.position=t.positions[1],t.circleRadius=t.computeDistance2([t.firstpoint,n]),t.height=Number((n.alt-t.firstpoint.alt).toFixed(2)),t.text="相对高度:"+t.height+" 米",t.tip.set_text("左键完成,右键取消;半径:"+t.circleRadius+" 米")}})),this.event.mouse_right((function(e,i){t.end(),t.destroy()})),this.event.gesture_pinck_start((function(e,i){var o=new Date,s={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-o>=500?(t.end(),t.destroy()):n(s,i)}))}))}}},{key:"end",value:function(){Zr(e,"end",this,3)([])}},{key:"destroy",value:function(){Zr(e,"destroy",this,3)([])}}],[{key:"create_polygon",value:function(t){var e=t.randomString();t.viewer.entities.add(new Cesium.Entity({id:e,billboard:{image:t.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)},position:new Cesium.CallbackProperty((function(){return t.position}),!1),label:{text:new Cesium.CallbackProperty((function(){return t.text}),!1),scale:1,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(0,-15),disableDepthTestDistance:Number.POSITIVE_INFINITY},polyline:{positions:new Cesium.CallbackProperty((function(e){return t.positions}),!1),width:2,material:Cesium.Color.YELLOW,zIndex:99999999},ellipse:{height:new Cesium.CallbackProperty((function(){return t.height+t.firstpoint.alt}),!1),semiMinorAxis:new Cesium.CallbackProperty((function(e){return t.circleRadius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(e){return t.circleRadius}),!1),material:new Cesium.Color.fromCssColorString(t.defaultColor)}}));return e}},{key:"create_point",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.randomString(),o=t.cartesian3Towgs84(e,t.viewer),s={id:n,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}};return i.label&&(s.label={text:i.label.text,scale:1,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(0,-15)}),t.viewer.entities.add(new Cesium.Entity(s)),n}}])}(gr);function $r(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Qr(t,e,i,n){var o=ba()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var tl=function(t){function e(t){var i;return k()(this,e),(i=$r(this,e,[t,{text:"左键开始,右键取消"}])).cachePositions=[],i.positions=[],i.arcPositions=[],i.line_id="",i.label_id="",i.arc_id="",i.bearing=0,i}return sn()(e,t),_()(e,[{key:"createPolyline",value:function(){var t=this,e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999}})),e}},{key:"end",value:function(){Qr(e,"end",this,3)([])}},{key:"destroy",value:function(){var t=this;Qr(e,"destroy",this,3)([]),[this.line_id,this.label_id,this.arc_id].forEach((function(e){e&&t.remove_entity(e)}))}},{key:"cancel",value:function(){this.end(),this.destroy()}},{key:"caculateAngle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=this.cartesian3Towgs84(t[0],this.viewer),i=this.cartesian3Towgs84(t[1],this.viewer),n=this.cartesian3Towgs84(t[2],this.viewer),o=turf.point([e.lng,e.lat]),s=turf.point([i.lng,i.lat]),a=turf.point([n.lng,n.lat]),r={units:"kilometers"},l=turf.rhumbDistance(o,s,r),c=turf.rhumbDistance(a,s,r),u=l;l>c&&(u=c);var p=turf.rhumbBearing(o,s),h=turf.rhumbBearing(a,s),d=Math.abs((p-h+360)%360);this.bearing=d>180?360-d:d,this.bearing=this.bearing.toFixed(2);var m=p-180,f=h-180,v=turf.lineArc(s,u/3,f,m);d>180&&(v=turf.lineArc(s,u/3,m,f));for(var g=[],y=0;y2&&t.caculateAngle([t.positions[0],t.positions[1],t.positions[2]])})),this.event.mouse_right((function(e,i){t.cancel()})),this.event.gesture_pinck_start((function(e,n){var o=new Date,s={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-o>=500?t.cancel():i(s,n)}))}))}}}])}(gr);function el(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function il(t,e,i,n){var o=ba()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var nl=function(t){function e(t){var i;return k()(this,e),(i=el(this,e,[t,{text:"左键开始,右键取消"}])).cachePositions=[],i.positions=[],i.arcPositions=[],i.line_id="",i.label_id="",i.arc_id="",i.bearing=0,i}return sn()(e,t),_()(e,[{key:"createPolyline",value:function(){var t=this,e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999}})),e}},{key:"end",value:function(){il(e,"end",this,3)([])}},{key:"destroy",value:function(){var t=this;il(e,"destroy",this,3)([]),[this.line_id,this.label_id,this.arc_id].forEach((function(e){e&&t.remove_entity(e)}))}},{key:"cancel",value:function(){this.end(),this.destroy()}},{key:"caculateAngle",value:function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=this.cartesian3Towgs84(t[1],this.viewer),i=this.cartesian3Towgs84(t[0],this.viewer),n=turf.point([e.lng,e.lat]),o=turf.point([i.lng,i.lat]),s=this.rhumbBearing(i,e);this.bearing=(180+s).toFixed(2);for(var a=turf.rhumbDistance(n,o,{units:"kilometers"}),r=turf.lineArc(n,a/3,0,this.bearing),l=[],c=0;c2&&t.caculateAngle([t.positions[0],t.positions[1]],[t.positions[2],t.positions[1]]),!(t.ids.length>=2)){e.next=9;break}return t.end(),e.abrupt("return");case 9:if(t.ids.push(t.create_point(n)),t.ids.push(t.create_point(n)),2!==t.ids.length){e.next=20;break}return t.label_id=Cesium.createGuid(),t.arc_id=Cesium.createGuid(),d=t.cartesian3Towgs84(n,t.viewer),e.next=17,t.sampleHeightMostDetailed([d]);case 17:m=e.sent,t.viewer.entities.add({id:t.arc_id,polyline:{positions:new Cesium.CallbackProperty((function(){return t.arcPositions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999}}),t.viewer.entities.add({id:t.label_id,position:Cesium.Cartesian3.fromDegrees(d.lng,d.lat,(m[0].height||0)+.1),label:{text:new Cesium.CallbackProperty((function(){return"方位夹角:"+t.bearing+"°"}),!1),font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#f1e605"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}});case 20:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}();this.event.mouse_left(i),this.event.mouse_move((function(e,i){if(t.tip.setPosition(i,e.endPosition.x,e.endPosition.y),t.cachePositions.length){var n;t.positions=t.cachePositions.concat(i);var o=t.cartesian3Towgs84(i,t.viewer),s=t.cartesian3Towgs84(t.positions[1],t.viewer),a=turf.point([s.lng,s.lat]),r=turf.point([o.lng,o.lat]),l={units:"kilometers"},c=turf.rhumbDistance(a,r,l),u=turf.destination(a,c,0,l);t.positions[0]=(n=Cesium.Cartesian3).fromDegrees.apply(n,L()(u.geometry.coordinates))}t.positions.length>2&&t.caculateAngle([t.positions[0],t.positions[1]],[t.positions[2],t.positions[1]])})),this.event.mouse_right((function(e,i){t.cancel()})),this.event.gesture_pinck_start((function(e,n){var o=new Date,s={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-o>=500?t.cancel():i(s,n)}))}))}}}])}(gr);function ol(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var sl=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,e),(i=ol(this,e,[t,n])).options.curve=n.curve||!1;var o=Number(n.number);return isNaN(o)?i.options.number=1/0:i.options.number=o<2?2:o,i}return sn()(e,t),_()(e,[{key:"smoothHandle",value:function(t){if(t.length>1){for(var e=[],i=[],n=0;n=r.options.number){var s,a=[];if(c.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))})),r.options.curve){var u=r.smoothHandle(c);s=[];for(var p=0;p1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(cartesian))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500){var s,a=[];if(c.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))})),r.options.curve){var l=r.smoothHandle(c);s=[];for(var u=0;u1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(cartesian))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500){var s,a=[];if(c.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))})),r.options.curve){var l=r.smoothHandle(c);s=[];for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.entityHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polyline:{positions:new Cesium.CallbackProperty((function(){return t.options.curve?t.smoothHandle(t.positions):t.positions}),!1),width:5,material:Cesium.Color.fromCssColorString(t.color),clampToGround:!0,zIndex:99999999}})),i}}])}(wa);function al(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function rl(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=ll(this,e,[t,n])).polygonHasCreated=!1,i.rectObject=[],i}return sn()(e,t),_()(e,[{key:"computedLastPoint",value:function(t){var e=t[0],i=t[1],n=Cesium.Cartesian3.subtract(i,e,new Cesium.Cartesian3),o=Cesium.Cartesian3.subtract(t[2],e,new Cesium.Cartesian3),s=Cesium.Cartesian3.dot(o,n)/Cesium.Cartesian3.magnitudeSquared(n),a=Cesium.Cartesian3.multiplyByScalar(n,s,new Cesium.Cartesian3),r=Cesium.Cartesian3.add(e,a,new Cesium.Cartesian3),l=Cesium.Cartesian3.distance(t[2],r),c=Cesium.Cartesian3.subtract(t[2],r,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(c,c);var u=Cesium.Cartesian3.multiplyByScalar(c,l,new Cesium.Cartesian3),p=Cesium.Cartesian3.add(i,u,new Cesium.Cartesian3),h=Cesium.Cartesian3.add(e,u,new Cesium.Cartesian3);return[rl({},p),rl({},h)]}},{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l;this.polygonHasCreated=!1,(i=e,n="start",o=this,s=3,a=ba()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new X(this.sdk);var c=0;this.positions=[],this.positionsLine=[],this.points_ids=[];var u=[],p=[];this.event.mouse_left((function(i,n){if("2D"!==l){if(l="3D",c++,r.positions=u.concat(rl({},n)),r.tip.setPosition(n,i.position.x,i.position.y),!r.polygonHasCreated){var o=e.create_polygon(r);r.points_ids.push(o)}u.push(n),p.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n)),3==c&&(r.end(),t(null,r.rectObject))}})),this.event.mouse_right((function(e,i){"2D"!==l&&(r.end(),t("取消",""))})),this.event.mouse_move((function(t,e){if("2D"!==l&&(r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),2==c)){var i=JSON.parse(JSON.stringify(u)),n=i.concat(rl({},e)),o=r.computedLastPoint(n);i=i.concat(o),r.positions=i;var s=i.map((function(t){return r.cartesian3Towgs84(t,r.viewer)}));r.rectObject=s}})),this.event.mouse_right_keyboard_ctrl((function(t,e){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),u.pop(),p.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),u.pop(),p.pop(),r.positions=u.concat(cartesian))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)t(null,p),r.end();else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),!r.polygonHasCreated){var s=e.create_polygon(r);r.points_ids.push(s)}u.push(n),p.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n)),r.positions=u.concat(n)}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(i,n){if("3D"!==l){if(l="2D",c++,r.positions=u.concat(rl({},n)),r.tip.setPosition(n,i.position.x+r.viewer.canvas.width,i.position.y),!r.polygonHasCreated){var o=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(o)}u.push(n),p.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),3==c&&(r.end(),t(null,r.rectObject))}})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(r.end(),t("取消",""))})),this.event2D.mouse_move((function(t,e){if("3D"!==l&&(r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y),2==c)){var i=JSON.parse(JSON.stringify(u)),n=i.concat(rl({},e)),o=r.computedLastPoint(n);i=i.concat(o),r.positions=i;var s=i.map((function(t){return r.cartesian3Towgs84(t,r.viewer)}));r.rectObject=s}})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),u.pop(),p.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),u.pop(),p.pop(),r.positions=u.concat(cartesian))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)t(null,p),r.end();else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),!r.polygonHasCreated){var s=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(s)}u.push(n),p.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),r.positions=u.concat(n)}}))}})))}}}],[{key:"create_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.polygonHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(t.positions)})),material:Cesium.Color.fromCssColorString(t.color),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(e){return t.positions.concat(t.positions[0])})),width:2,material:Cesium.Color.fromCssColorString("#c1c505").withAlpha(.5),clampToGround:!0,zIndex:99999999}})),i}}])}(wa);function ul(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var pl=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return k()(this,e),ul(this,e,[t,i,n])}return sn()(e,t),_()(e,[{key:"start",value:function(t){var e=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var i=void 0;YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键结束;",this.sdk),this.event=new X(this.sdk),this.event.mouse_left((function(n,o){e.end();var s=e.cartesian3Towgs84(i||o,e.viewer);t(null,s,Cesium)})),this.event.mouse_right((function(i,n){e.end(),t(!1)})),this.event.mouse_move((function(t,n){i=n,e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.gesture_pinck_start((function(n,o){var s=new Date;e.event.gesture_pinck_end((function(){if(new Date-s>=500)e.end(),t(!1);else{e.end();var n=e.cartesian3Towgs84(i||o,e.viewer);t(null,n)}}))})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(n,o){e.end();var s=e.cartesian3Towgs84(i||o,e.viewer);t(null,s,Cesium)})),this.event2D.mouse_right((function(i,n){e.end(),t(!1)})),this.event2D.mouse_move((function(t,n){i=n,e.tip.setPosition(n,t.endPosition.x+e.viewer.canvas.width,t.endPosition.y)})),this.event2D.gesture_pinck_start((function(n,o){var s=new Date;e.event2D.gesture_pinck_end((function(){if(new Date-s>=500)e.end(),t(!1);else{e.end();var n=e.cartesian3Towgs84(i||o,e.viewer);t(null,n)}}))})))}}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy(),this.tip&&this.tip.destroy()}}])}(wa);function hl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var dl=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),hl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l,c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g.viewer;t.entities.add(new Cesium.Entity({id:g.circle_id,position:new Cesium.CallbackProperty((function(t){if(v){var e=g.computeMidpoint(f,v);return Cesium.Cartesian3.fromDegrees(e.lng,e.lat,v.alt)}return Cesium.Cartesian3()}),!1),label:{text:new Cesium.CallbackProperty((function(t){return d>1e3?"半径:"+(d/1e3).toFixed(2)+" 公里":"半径:"+d+" 米"}),!1),font:"20px Microsoft YaHei",disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,fillColor:Cesium.Color.fromCssColorString("#f5ce0a"),style:Cesium.LabelStyle.FILL_AND_OUTLINE},polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(t){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(m))}),!1),material:Cesium.Color.fromCssColorString(g.color),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(t){return p}),!1),width:2,material:Cesium.Color.fromCssColorString("#c1c505").withAlpha(.5),clampToGround:!0,zIndex:99999999}}))};(i=e,n="start",o=this,s=3,a=ba()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键开始,右键取消",this.sdk),this.event=new X(this.sdk);var u=0;this.circle_id=this.randomString();var p=[],h=[],d=1,m=[],f={},v=null;this.event.mouse_left((function(e,i){"2D"!==l&&(l="3D",r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i),f=r.cartesian3Towgs84(i,r.viewer),m=r.createCircle(f,.01),h.push(i),c()),2===u&&(p=h.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),t(null,{center:f,radius:Number(d)})))})),this.event.mouse_right((function(e,i){"2D"!==l&&(r.end(),t(!1))})),this.event.mouse_move((function(t,e){"2D"!==l&&(r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),u&&(p=h.concat(e),v=r.cartesian3Towgs84(e,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d)))})),this.event.gesture_pinck_start((function(e,i){if("2D"!==l){var n=new Date;r.event.gesture_pinck_end((function(){new Date-n>=500?(r.end(),t(!1)):(r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i),f=r.cartesian3Towgs84(i,r.viewer),h.push(i),c(),r.tip.setPosition(i,(e.position1.x+e.position2.x)/2,(e.position1.y+e.position2.y)/2)),2===u&&(p=h.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),t(null,{center:f,radius:Number(d)})))}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,i){"3D"!==l&&(l="2D",r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i,r._sdk2D.viewer),f=r.cartesian3Towgs84(i,r.viewer),m=r.createCircle(f,.01),h.push(i),c(r._sdk2D.viewer)),2===u&&(p=h.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),t(null,{center:f,radius:Number(d)})))})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(r.end(),t(!1))})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y),u&&(p=h.concat(e),v=r.cartesian3Towgs84(e,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d)))})),this.event2D.gesture_pinck_start((function(e,i){if("3D"!==l){var n=new Date;r.event2D.gesture_pinck_end((function(){new Date-n>=500?(r.end(),t(!1)):(r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i,r._sdk2D.viewer),f=r.cartesian3Towgs84(i,r.viewer),h.push(i),c(r._sdk2D.viewer),r.tip.setPosition(i,(e.position1.x+e.position2.x)/2+r.viewer.canvas.width,(e.position1.y+e.position2.y)/2)),2===u&&(p=h.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),t(null,{center:f,radius:Number(d)})))}))}})));var g=this}}},{key:"end",value:function(){this.remove_entity(this.circle_id),this.remove_entity(this.point_id),YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy()}}])}(wa);function ml(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var fl=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),ml(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l,c=function(){var t=Cesium.Cartesian3.fromDegrees(m[0].lng,m[0].lat),e=Cesium.Cartesian3.fromDegrees(m[1].lng,m[1].lat),i=Cesium.Cartesian3.fromDegrees(m[2].lng,m[2].lat);if(1===p){g=Cesium.Cartesian3.distance(t,e),f=(v=g)/2;var n={x:h.lng,y:h.lat},o={x:m[1].lng,y:m[1].lat},s=Math.PI/180,a=n.y*s,r=o.y*s,l=n.x*s,c=o.x*s,u=Math.sin(c-l)*Math.cos(r),d=Math.cos(a)*Math.sin(r)-Math.sin(a)*Math.cos(r)*Math.cos(c-l),C=Math.atan2(u,d)%(2*Math.PI);b=450-(180*C/Math.PI<0?360+180*C/Math.PI:180*C/Math.PI)}if(2===p){Cesium.Cartesian3.distance(t,i),y=Cesium.Cartesian3.distance(e,i);var w=turf.point([m[0].lng,m[0].lat]),k=turf.point([m[1].lng,m[1].lat]),x=turf.point([m[2].lng,m[2].lat]),_=turf.rhumbBearing(w,k),E=turf.rhumbBearing(k,x),S=Math.abs(_-E),D=S>180?360-S:S;D=180-D,f=y*Math.sin(Cesium.Math.toRadians(D))}},u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:C.viewer;t.entities.add(new Cesium.Entity({id:C.elliptic_id,position:Cesium.Cartesian3.fromDegrees(h.lng,h.lat),ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(t){return f}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(t){return v}),!1),granularity:Cesium.Math.toRadians(.1),rotation:new Cesium.CallbackProperty((function(t){return Cesium.Math.toRadians(b)}),!1),material:Cesium.Color.fromCssColorString(C.color),zIndex:99999999}}))};(i=e,n="start",o=this,s=3,a=ba()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),this.entity_ids=[],YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键开始,右键取消",this.sdk),this.event=new X(this.sdk);var p=0;this.elliptic_id=this.randomString();var h,d=[],m=[],f=0,v=0,g=0,y=0,b=0;this.event.mouse_left((function(e,i){if("2D"!==l){if(l="3D",r.tip.set_text("再次左键,完成绘制;右键取消"),p++,r.points_ids.push(r.create_point(i)),d.push(i),1===p){d=[i,i,i];var n=r.cartesian3Towgs84(i,r.viewer);h=n,m=[n,n,n],c(),u()}if(2===p){d[1]=i,d[2]=i;var o=r.cartesian3Towgs84(i,r.viewer);m[1]=o,m[2]=o}p>=3&&(r.end(),t(null,{center:h,bearing:b,semiMajorAxis:v,semiMinorAxis:f}))}})),this.event.mouse_right((function(e,i){"2D"!==l&&(r.end(),t(!1))})),this.event.mouse_move((function(t,e){"2D"!==l&&(r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),d[p]=e,m[p]=r.cartesian3Towgs84(e,r.viewer),0!==p&&c())})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,i){if("3D"!==l){if(l="2D",r.tip.set_text("再次左键,完成绘制;右键取消"),p++,r.points_ids.push(r.create_point(i,r._sdk2D.viewer)),d.push(i),1===p){d=[i,i,i];var n=r.cartesian3Towgs84(i,r.viewer);h=n,m=[n,n,n],c(),u(r._sdk2D.viewer)}if(2===p){d[1]=i,d[2]=i;var o=r.cartesian3Towgs84(i,r.viewer);m[1]=o,m[2]=o}p>=3&&(r.end(),t(null,{center:h,bearing:b,semiMajorAxis:v,semiMinorAxis:f}))}})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(r.end(),t(!1))})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y),d[p]=e,m[p]=r.cartesian3Towgs84(e,r.viewer),0!==p&&c())})));var C=this}}},{key:"end",value:function(){var t=this;this.remove_entity(this.elliptic_id),this.points_ids.forEach((function(e){t.remove_entity(e)})),YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy()}}])}(wa);function vl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var gl=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),vl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l;(i=e,n="start",o=this,s=3,a=ba()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var c=[],u=!1;this.event.mouse_left((function(t,i){if("2D"!==l){l="3D";var n=r.cartesian3Towgs84(i,r.viewer),o=c[c.length-1];if(!o||o.lng!==n.lng||o.lat!==n.lat){if(!r.entityHasCreated){var s=e.create_arrow_polygon(r);r.points_ids.push(s)}r.points_ids.push(r.create_point(i)),c.push(n),u=!1}}})),this.event.mouse_right((function(e,i){if("2D"!==l){var n=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){n.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),u&&r.positions.pop(),t(null,r.positions,n)}})),this.event.mouse_move((function(t,e){"2D"!==l&&(u=!0,r.positions=c.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x,t.endPosition.y))})),this.event.mouse_right_keyboard_ctrl((function(t,e){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500){var s=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,r.positions,s)}else{if(!r.entityHasCreated){var a=e.create_arrow_polygon(r);r.points_ids.push(a)}r.points_ids.push(r.create_point(n)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2)}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(t,i){if("3D"!==l){if(l="2D",!r.entityHasCreated){var n=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(n)}r.points_ids.push(r.create_point(i,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(i,r.viewer)),u=!1}})),this.event2D.mouse_right((function(e,i){if("3D"!==l){var n=[];if(r.points_ids.length>2)r.event2D.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){n.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),u&&r.positions.pop(),t(null,r.positions,n)}})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(u=!0,r.positions=c.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y))})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500){var s=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,r.positions,s)}else{if(!r.entityHasCreated){var a=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(a)}r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2)}}))}})))}}}],[{key:"create_arrow_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.entityHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){for(var i=t.computeAttackArrow(t.positions),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),yl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l;(i=e,n="start",o=this,s=3,a=ba()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键取消;CTRL+右键撤销",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var c=[];this.event.mouse_left((function(i,n){if("2D"!==l){if(l="3D",!r.entityHasCreated){var o=e.create_arrow_polygon(r);r.points_ids.push(o)}if(r.points_ids.push(r.create_point(n)),c.push(r.cartesian3Towgs84(n,r.viewer)),5===c.length){var s=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,c,s)}}})),this.event.mouse_right((function(e,i){"2D"!==l&&(r.end(),t("取消绘制"))})),this.event.mouse_move((function(t,e){"2D"!==l&&(r.positions=c.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x,t.endPosition.y))})),this.event.mouse_right_keyboard_ctrl((function(t,e){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(r.cartesian3Towgs84(cartesian,r.viewer)))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)r.end(),t("取消绘制");else{if(!r.entityHasCreated){var s=e.create_arrow_polygon(r);r.points_ids.push(s)}if(r.points_ids.push(r.create_point(n)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),5===c.length){var a=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,c,a)}}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(i,n){if("3D"!==l){if(l="2D",!r.entityHasCreated){var o=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(o)}if(r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(n,r.viewer)),5===c.length){var s=[];if(r.points_ids.length>2)r.event2D.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,c,s)}}})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(r.end(),t("取消绘制"))})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(r.positions=c.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y))})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(r.cartesian3Towgs84(cartesian,r.viewer)))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)r.end(),t("取消绘制");else{if(!r.entityHasCreated){var s=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(s)}if(r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),5===c.length){var a=[];if(r.points_ids.length>2)r.event2D.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,c,a)}}}))}})))}}}],[{key:"create_arrow_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.entityHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){for(var i=t.computePincerArrow(t.positions),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Cl(this,e,[t,n])).points=null,i.polygonHasCreated=!1,i}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var n;wl(e,"start",this,3)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键取消;",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var o=[];this.anchorpoints=[],this.event.mouse_left((function(e,s){if("2D"!==n&&(n="3D",s&&i.anchorpoints[0]!==s)){i.anchorpoints.push(s);var a=i.cartesian3Towgs84(s,i.viewer);if(a.lng=Number(a.lng.toFixed(8)),a.lat=Number(a.lat.toFixed(8)),(!o[0]||a.lng!==o[0].lng||a.lat!==o[0].lat)&&(o.push(a),i.positions.push(a),i.points_ids.push(i.create_point(s)),2===i.points_ids.length)){var r=[o[0],o[1]];t(null,r),i.end()}}})),this.event.mouse_move((function(t,o){if("2D"!==n&&(i.tip.setPosition(o,t.endPosition.x,t.endPosition.y),o&&0!==i.points_ids.length)){var s=i.cartesian3Towgs84(o,i.viewer);i.positions=[i.positions[0],s],1!==i.points_ids.length||Cesium.defined(i.arrowPolygon)||(i.arrowPolygon=e.polygon(i))}})),this.event.mouse_right((function(e,o){"2D"!==n&&(t(null),i.end())})),this.event.gesture_pinck_start((function(s,a){if("2D"!==n){var r=new Date;i.event.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),t(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),t(null,i.positions),i.end();else{if(!a||Cesium.defined(i.arrowPolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.arrowPolygon=e.polygon(i),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a))}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,s){if("3D"!==n&&(n="2D",s&&i.anchorpoints[0]!==s)){i.anchorpoints.push(s);var a=i.cartesian3Towgs84(s,i.viewer);if(a.lng=Number(a.lng.toFixed(8)),a.lat=Number(a.lat.toFixed(8)),(!o[0]||a.lng!==o[0].lng||a.lat!==o[0].lat)&&(o.push(a),i.positions.push(a),i.points_ids.push(i.create_point(s,i._sdk2D.viewer)),2===i.points_ids.length)){var r=[o[0],o[1]];t(null,r),i.end()}}})),this.event2D.mouse_move((function(t,o){if("3D"!==n&&(i.tip.setPosition(o,t.endPosition.x+i.viewer.canvas.width,t.endPosition.y),o&&0!==i.points_ids.length)){var s=i.cartesian3Towgs84(o,i.viewer);i.positions=[i.positions[0],s],1!==i.points_ids.length||Cesium.defined(i.arrowPolygon)||(i.arrowPolygon=e.polygon(i,i._sdk2D.viewer))}})),this.event2D.mouse_right((function(e,o){"3D"!==n&&(t(null),i.end())})),this.event2D.gesture_pinck_start((function(s,a){if("3D"!==n){var r=new Date;i.event2D.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),t(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),t(null,i.positions),i.end();else{if(!a||Cesium.defined(i.arrowPolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2+i.viewer.canvas.width,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.arrowPolygon=e.polygon(i,i._sdk2D.viewer),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a,i._sdk2D.viewer))}}))}})))}}},{key:"end",value:function(){wl(e,"end",this,3)([]),this.viewer.entities.remove(this.arrowPolygon),!this._is2D&&this._sdk2D&&this._sdk2D.viewer.entities.remove(this.arrowPolygon)}}],[{key:"polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer,i=t.randomString();return e.entities.add(new Cesium.Entity({name:"ArrowPolygon",id:i,polygon:{hierarchy:new Cesium.CallbackProperty((function(e){for(var i=t.computeStraightArrow(t.positions),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=xl(this,e,[t,n])).rhumb=n.rhumb,i.polygonHasCreated=!1,i.rect=[],i.rectObj=[],i.entity=null,i}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this,l=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var c;(i=e,n="start",o=this,s=3,a=ba()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键取消",l.sdk),this.event=new X(l.sdk),this.positions=[],this.points_ids=[];var u=0,p=null,h=null;this.event.mouse_left((function(i,n){if("2D"!==c){c="3D",u++;var o=r.cartesian3Towgs84(n,r.viewer);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var s=e.create_polygon(r);r.points_ids.push(s),p=o}2==u&&(h=o,r.end(),t(null,l.rectObj,[p,h]))}})),this.event.mouse_right((function(e,i){"2D"!==c&&(r.end(),t("取消",""))})),this.event.mouse_move((function(t,e){if("2D"!==c&&(r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),1==u)){var i=r.cartesian3Towgs84(e,r.viewer);r.calrect(p,i)}})),this.event.gesture_pinck_start((function(i,n){if("2D"!==c){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)t("取消",""),r.end();else{r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),u++;var s=r.cartesian3Towgs84(n);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var a=e.create_polygon(r);r.points_ids.push(a),p=s}2==u&&(r.calrect(p,s),h=s,r.end(),t(null,l.rectObj,[p,h]))}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(i,n){if("3D"!==c){c="2D",u++;var o=r.cartesian3Towgs84(n,r.viewer);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var s=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(s),p=o}2==u&&(h=o,r.end(),t(null,l.rectObj,[p,h]))}})),this.event2D.mouse_right((function(e,i){"3D"!==c&&(r.end(),t("取消",""))})),this.event2D.mouse_move((function(t,e){if("3D"!==c&&(r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y),1==u)){var i=r.cartesian3Towgs84(e,r.viewer);r.calrect(p,i)}})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==c){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)t("取消",""),r.end();else{r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),u++;var s=r.cartesian3Towgs84(n);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var a=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(a),p=s}2==u&&(r.calrect(p,s),h=s,r.end(),t(null,l.rectObj,[p,h]))}}))}})))}}},{key:"calrect",value:function(t,e){var i,n=[],o=[],s=[];if(n.push([t.lng,t.lat,t.alt],[e.lng,e.lat,e.alt]),2===n.length){var a=turf.lineString(n),r=turf.bbox(a);i=turf.bboxPolygon(r)}i&&(i.geometry.coordinates[0].forEach((function(e){o.push(e[0]),o.push(e[1]);var i={lng:e[0],lat:e[1],alt:t.alt};s.push(i)})),this.rect=[].concat(o),this.rectObj=[].concat(s),this.rectObj.pop())}}],[{key:"create_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer,i=t.randomString();return e.entities.add(this.entity=new Cesium.Entity({id:i,polygon:{hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(t.rect))}),!1),material:Cesium.Color.fromCssColorString(t.color),arcType:t.rhumb?Cesium.ArcType.RHUMB:Cesium.ArcType.GEODESIC,zIndex:99999999}})),i}}])}(wa);function El(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Sl(t,e,i,n){var o=ba()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Dl=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=El(this,e,[t,n])).points=null,i.polygonHasCreated=!1,i}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var n;Sl(e,"start",this,3)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键取消;",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var o=[];this.anchorpoints=[],this.event.mouse_left((function(e,s){if("2D"!==n&&(n="3D",s&&(3===i.anchorpoints.length?i.anchorpoints[1]=s:i.anchorpoints.push(s),o.push(i.cartesian3Towgs84(s,i.viewer)),i.points_ids.push(i.create_point(s)),3===i.points_ids.length))){var a=[o[0],o[2],o[1]];t(null,a),i.end()}})),this.event.mouse_move((function(t,s){if("2D"!==n&&(i.tip.setPosition(s,t.endPosition.x,t.endPosition.y),s&&0!==i.points_ids.length))if(o.length>1?i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer),o[1]]:i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer)],1!==i.points_ids.length||Cesium.defined(i.assemblePolygon)||(i.assemblePolygon=e.polygon(i)),i.anchorpoints.length>=2){if(1===i.points_ids.length){var a=new Array;i.positions.forEach((function(t){a.push([t.lng,t.lat])}));var r=P.PlotUtils.mid(a[0],a[1]),l=P.PlotUtils.distance(a[0],r)/.9,c=P.PlotUtils.getThirdPoint(a[0],r,P.Constants.HALF_PI,l,!0);i.positions=[i.positions[0],{lng:c[0],lat:c[1]},i.positions[1]]}i.anchorpoints[1]=s}else i.anchorpoints.push(s)})),this.event.mouse_right((function(e,o){"2D"!==n&&(t(null),i.end())})),this.event.gesture_pinck_start((function(s,a){if("2D"!==n){var r=new Date;i.event.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),t(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),t(null,i.positions),i.end();else{if(!a||Cesium.defined(i.assemblePolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.assemblePolygon=e.polygon(i),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a))}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,s){if("3D"!==n&&(n="2D",s&&(3===i.anchorpoints.length?i.anchorpoints[1]=s:i.anchorpoints.push(s),o.push(i.cartesian3Towgs84(s,i.viewer)),i.points_ids.push(i.create_point(s,i._sdk2D.viewer)),3===i.points_ids.length))){var a=[o[0],o[2],o[1]];t(null,a),i.end()}})),this.event2D.mouse_move((function(t,s){if("3D"!==n&&(i.tip.setPosition(s,t.endPosition.x+i.viewer.canvas.width,t.endPosition.y),s&&0!==i.points_ids.length))if(o.length>1?i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer),o[1]]:i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer)],1!==i.points_ids.length||Cesium.defined(i.assemblePolygon)||(i.assemblePolygon=e.polygon(i,i._sdk2D.viewer)),i.anchorpoints.length>=2){if(1===i.points_ids.length){var a=new Array;i.positions.forEach((function(t){a.push([t.lng,t.lat])}));var r=P.PlotUtils.mid(a[0],a[1]),l=P.PlotUtils.distance(a[0],r)/.9,c=P.PlotUtils.getThirdPoint(a[0],r,P.Constants.HALF_PI,l,!0);i.positions=[i.positions[0],{lng:c[0],lat:c[1]},i.positions[1]]}i.anchorpoints[1]=s}else i.anchorpoints.push(s)})),this.event2D.mouse_right((function(e,o){"3D"!==n&&(t(null),i.end())})),this.event2D.gesture_pinck_start((function(s,a){if("3D"!==n){var r=new Date;i.event2D.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),t(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),t(null,i.positions),i.end();else{if(!a||Cesium.defined(i.assemblePolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2+i.viewer.canvas.width,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.assemblePolygon=e.polygon(i,i._sdk2D.viewer),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a,i._sdk2D.viewer))}}))}})))}}},{key:"end",value:function(){Sl(e,"end",this,3)([]),this.viewer.entities.remove(this.assemblePolygon),!this._is2D&&this._sdk2D&&this._sdk2D.viewer.entities.remove(this.assemblePolygon)}},{key:"calculateVector",value:function(t,e,i){var n,o,s,a,r,l;e||(e=Math.PI/2),i||(i=1);var c=Math.sqrt(t.x*t.x+t.y*t.y);if(0==t.y)n=o=c*i*Math.cos(e)/t.x,t.x>0?a=-(s=Math.sqrt(i*i-n*n)):t.x<0&&(s=-(a=Math.sqrt(i*i-n*n))),r={x:n,y:s},l={x:o,y:a};else{var u=-t.x/t.y,p=i*c*Math.cos(e)/t.y,h=1+u*u,d=2*u*p,m=p*p-i*i;s=u*(n=(-d-Math.sqrt(d*d-4*h*m))/(2*h))+p,a=u*(o=(-d+Math.sqrt(d*d-4*h*m))/(2*h))+p,t.y>=0?(r={x:n,y:s},l={x:o,y:a}):t.y<0&&(r={x:o,y:a},l={x:n,y:s})}return[r,l]}},{key:"createCloseCardinal",value:function(t){if(null==t||t.length<3)return t;var e=t[0];t.push(e);for(var i=t,n=[],o=.4,s=i.length-1,a=0;a<=s-1;a++){var r=void 0,l=void 0,c=void 0;a==s-1?(r=i[s-1],l=i[0],c=i[1]):(r=i[a],l=i[a+1],c=i[a+2]);var u={x:void 0,y:void 0},p={x:void 0,y:void 0},h={x:l.x-r.x,y:l.y-r.y},d={x:c.x-l.x,y:c.y-l.y},m=Math.sqrt(h.x*h.x+h.y*h.y),f=Math.sqrt(d.x*d.x+d.y*d.y),v={x:h.x/m,y:h.y/m},g={x:d.x/f,y:d.y/f},y={x:v.x+g.x,y:v.y+g.y},b=Math.sqrt(y.x*y.x+y.y*y.y),C={x:y.x/b,y:y.y/b},w=(v.x*g.x+v.y*g.y)/1;Math.abs(1-w)<.005?(u.x=l.x-g.x*m*o,u.y=l.y-g.y*m*o,p.x=l.x+v.x*f*o,p.y=l.y+v.y*f*o):(u.x=l.x-C.x*m*o,u.y=l.y-C.y*m*o,p.x=l.x+C.x*f*o,p.y=l.y+C.y*f*o),a==s-1?(n[0]=l,n[1]=p,n[3*(s-2)+2+3]=u,n[3*(s-2)+2+4]=i[s]):(n[3*a+2+0]=u,n[3*a+2+1]=l,n[3*a+2+2]=p)}return n}},{key:"calculatePointsFBZ3",value:function(t,e){e||(e=20);var i=[],n=.05;e>0&&(n=1/e);for(var o=0;o=t.length&&i.push(s)}return i}}],[{key:"polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer,i=t.randomString();return e.entities.add(new Cesium.Entity({name:"AssemblePolygon",id:i,polygon:{hierarchy:new Cesium.CallbackProperty((function(e){for(var i=t.computeAssemble(t.positions),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),Pl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r,l=this,c=this;YJ.Measure.GetMeasureStatus()?t("上一次测量未结束"):((n=e,o="start",s=this,a=3,r=ba()(nn()(1&a?n.prototype:n),o,s),2&a&&"function"==typeof r?function(t){return r.apply(s,t)}:r)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确认,右键取消",c.sdk),this.event=new X(c.sdk),this._sector_id=null,this._positions=[],this.points_ids=[],this.radius_points=[],this._entities_sector=[],this._radius=0,this._startAngle=0,this._endAngle=0,this.event.mouse_left((function(e,n){if("2D"!==i&&(i="3D",l._positions.length<3?(l.points_ids.push(l.create_point(n)),l._positions.push(l.cartesian3Towgs84(n,l.viewer))):(l.end(),t(null,{center:l._positions[0],radius:l._radius,startAngle:l._startAngle,endAngle:l._endAngle})),2===l._positions.length&&(l.radius_points.push(n),l._radius=l.computeDistance2([l._positions[0],l._positions[1]])),1===l._positions.length)){l.radius_points.push(n);var o=l.createRadiusLine();l.points_ids.push(o)}})),this.event.mouse_move((function(t,e){if("2D"!==i){if(l.tip.setPosition(e,t.endPosition.x,t.endPosition.y),1===l._positions.length){l.radius_points[1]=e;var n=l.cartesian3Towgs84(e,l.viewer);l._radius=l.computeDistance2([l._positions[0],n])}if(!(l._positions.length<2)&&(2==l._positions.length&&l._positions.push(l.cartesian3Towgs84(e,l.viewer)),3==l._positions.length)){l._positions.pop(),l._positions.push(l.cartesian3Towgs84(e,l.viewer)),Cesium.defined(l._sector_id)||(l._sector_id=l.createsector(),l.points_ids.push(l._sector_id));var o=c.calculateAangle(c._positions);c._startAngle=o.angle1,c._endAngle=o.angle2}}})),this.event.mouse_right((function(e,n){"2D"!==i&&(l.end(),t(null))})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,n){if("3D"!==i&&(i="2D",l._positions.length<3?(l.points_ids.push(l.create_point(n,l._sdk2D.viewer)),l._positions.push(l.cartesian3Towgs84(n,l.viewer))):(l.end(),t(null,{center:l._positions[0],radius:l._radius,startAngle:l._startAngle,endAngle:l._endAngle})),2===l._positions.length)){var o=l.cartesian3Towgs84(n,l.viewer);l._radius=l.computeDistance2([l._positions[0],o])}})),this.event2D.mouse_move((function(t,e){if("3D"!==i&&(l.tip.setPosition(e,t.endPosition.x+l.viewer.canvas.width,t.endPosition.y),!(l._positions.length<2)&&(2==l._positions.length&&l._positions.push(l.cartesian3Towgs84(e,l.viewer)),3==l._positions.length))){l._positions.pop(),l._positions.push(l.cartesian3Towgs84(e,l.viewer)),Cesium.defined(l._sector_id)||(l._sector_id=l.createsector(l._sdk2D.viewer),l.points_ids.push(l._sector_id));var n=c.calculateAangle(c._positions);c._startAngle=n.angle1,c._endAngle=n.angle2}})),this.event2D.mouse_right((function(e,n){"3D"!==i&&(l.end(),t(null))}))))}},{key:"createsector",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.viewer,e=this,i=new Cesium.CallbackProperty((function(){var t=e.calSector(e._positions[0],e._radius,e._startAngle,e._endAngle);return new Cesium.PolygonHierarchy(t)})),n=e.randomString(),o=t.entities.add({id:n,position:Cesium.Cartesian3.fromDegrees(e._positions[0].lng,e._positions[0].lat),polygon:{hierarchy:i,show:!0,fill:!0,clampToGround:!0,material:Cesium.Color.fromCssColorString(e.color),zIndex:99999999}});return e._entities_sector.push(o),n}},{key:"createRadiusLine",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.viewer,i=this,n=i.randomString(),o=e.entities.add({id:n,position:new Cesium.CallbackProperty((function(t){var e=i._positions[0],n=i.radius_points[1]?i.cartesian3Towgs84(i.radius_points[1],i.viewer):i._positions[0],o=i.computeMidpoint(e,n);return Cesium.Cartesian3.fromDegrees(o.lng,o.lat,n.alt)}),!1),polyline:{positions:new Cesium.CallbackProperty((function(t){return i.radius_points}),!1),width:2,material:Cesium.Color.fromCssColorString("#c1c505").withAlpha(.5),clampToGround:!0,zIndex:999999999},label:{text:new Cesium.CallbackProperty((function(e){return t._radius>1e3?"半径:"+(t._radius/1e3).toFixed(2)+" 公里":"半径:"+t._radius+" 米"}),!1),font:"20px Microsoft YaHei",disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,fillColor:Cesium.Color.fromCssColorString("#f5ce0a"),style:Cesium.LabelStyle.FILL_AND_OUTLINE}});return i._entities_sector.push(o),n}},{key:"cartesianToLatlng",value:function(t){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),i=Cesium.Math.toDegrees(e.latitude);return[Cesium.Math.toDegrees(e.longitude),i]}},{key:"lonLatToMercator",value:function(t){var e=t[0],i=t[1],n=20037508.34*e/180,o=Math.log(Math.tan((90+i)*Math.PI/360))/(Math.PI/180);return[n,o=20037508.34*o/180]}},{key:"WebMercator2lonLat",value:function(t){var e=t[0]/20037508.34*180,i=t[1]/20037508.34*180;return[e,180/Math.PI*(2*Math.atan(Math.exp(i*Math.PI/180))-Math.PI/2)]}},{key:"calculateAangle",value:function(t){function e(t,e){var i=Math.PI/180,n=t.y*i,o=e.y*i,s=t.x*i,a=e.x*i,r=Math.sin(a-s)*Math.cos(o),l=Math.cos(n)*Math.sin(o)-Math.sin(n)*Math.cos(o)*Math.cos(a-s),c=Math.atan2(r,l)%(2*Math.PI);return 360-(450-(180*c/Math.PI<0?360+180*c/Math.PI:180*c/Math.PI)-90)%360}var i=t[0],n=t[1],o=t[2],s={x:i.lng,y:i.lat},a={x:n.lng,y:n.lat},r={x:o.lng,y:o.lat};return{angle1:e(s,a),angle2:e(s,r)}}}])}(wa),Ol=52.35987755982988,Tl=3.141592653589793,Nl=.006693421622965943,Bl=function(){return _()((function t(){k()(this,t)}),null,[{key:"BD09ToGCJ02",value:function(t,e){var i=+t-.0065,n=+e-.006,o=Math.sqrt(i*i+n*n)-2e-5*Math.sin(n*Ol),s=Math.atan2(n,i)-3e-6*Math.cos(i*Ol);return[o*Math.cos(s),o*Math.sin(s)]}},{key:"GCJ02ToBD09",value:function(t,e){e=+e,t=+t;var i=Math.sqrt(t*t+e*e)+2e-5*Math.sin(e*Ol),n=Math.atan2(e,t)+3e-6*Math.cos(t*Ol);return[i*Math.cos(n)+.0065,i*Math.sin(n)+.006]}},{key:"WGS84ToGCJ02",value:function(t,e){if(e=+e,t=+t,this.out_of_china(t,e))return[t,e];var i=this.delta(t,e);return[t+i[0],e+i[1]]}},{key:"GCJ02ToWGS84",value:function(t,e){if(e=+e,t=+t,this.out_of_china(t,e))return[t,e];var i=this.delta(t,e);return[2*t-(t+i[0]),2*e-(e+i[1])]}},{key:"delta",value:function(t,e){var i=this.transformLng(t-105,e-35),n=this.transformLat(t-105,e-35),o=e/180*Tl,s=Math.sin(o);s=1-Nl*s*s;var a=Math.sqrt(s);return[i=180*i/(6378245/a*Math.cos(o)*Tl),n=180*n/(6378245*(1-Nl)/(s*a)*Tl)]}},{key:"transformLng",value:function(t,e){var i=300+(t=+t)+2*(e=+e)+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return i+=2*(20*Math.sin(6*t*Tl)+20*Math.sin(2*t*Tl))/3,i+=2*(20*Math.sin(t*Tl)+40*Math.sin(t/3*Tl))/3,i+=2*(150*Math.sin(t/12*Tl)+300*Math.sin(t/30*Tl))/3}},{key:"transformLat",value:function(t,e){var i=2*(t=+t)-100+3*(e=+e)+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return i+=2*(20*Math.sin(6*t*Tl)+20*Math.sin(2*t*Tl))/3,i+=2*(20*Math.sin(e*Tl)+40*Math.sin(e/3*Tl))/3,i+=2*(160*Math.sin(e/12*Tl)+320*Math.sin(e*Tl/30))/3}},{key:"out_of_china",value:function(t,e){return e=+e,!((t=+t)>73.66&&t<135.05&&e>3.86&&e<53.55)}}])}();function Ll(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Al=function(t){function e(t,i){var n;return k()(this,e),(n=Ll(this,e,[t,i])).sdk.addIncetance(n.options.id,n),n.options.show&&Kt(0,n.options.id),n}return sn()(e,t),_()(e,[{key:"setDefaultValue",value:function(){var t,i,n,o,s;(t=e,i="setDefaultValue",n=this,o=3,s=ba()(nn()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),this.options.host=this.options.host||h()}},{key:"requestResource",value:function(){var t="";return t=this.options.host.endsWith("yjearth4.0")?this.options.host+"/data/service/load-compact-service":this.options.host+"/yjearth4.0/data/service/load-compact-service",fetch(t,{method:"post",body:JSON.stringify({source_id:this.options.id}),headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}})}}])}(Wn);function jl(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Il(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Rl(this,e,[t,i])).options.name=i.name||"未命名对象",n.Dialog=o,n._elms={},n}return sn()(e,t),_()(e,[{key:"setDefaultValue",value:function(){var t,i;Fl(e,"setDefaultValue",this,3)([]),this.options.alpha=null!==(t=this.options.alpha)&&void 0!==t?t:1,this.options.brightness=null!==(i=this.options.brightness)&&void 0!==i?i:1}},{key:"layerIndex",get:function(){return this.entity?this.entity._layerIndex:void 0}},{key:"layer_index",get:function(){return this.entity?this.entity._layerIndex:void 0}},{key:"brightness",get:function(){return this.options.brightness},set:function(t){this.options.brightness=t,this.entity.brightness=t}},{key:"alpha",get:function(){return this.options.alpha},set:function(t){Number(t)>1&&(t=1),Number(t)<0&&(t=0),this.entity.alpha=t,this.options.alpha=t,this._elms.alpha&&this._elms.alpha.forEach((function(e){e.value=t}))}},{key:"layerRaise",value:function(t){this.sdk.viewer.imageryLayers.raise(this.entity);for(var e=0;e0&&void 0!==l[0]&&l[0],!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(e={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Il({},this.options.position):this.options.positions?r=Il({},this.options.positions[0]):this.options.center?r=Il({},this.options.center):this.options.start?r=Il({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),r.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(r);case 17:r.alt=t.sent;case 18:i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e}),t.next=26;break;case 25:this.sdk.viewer.flyTo(this.entity);case 26:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"amapMercatorTilingScheme",value:function(t){return new(function(t){function e(t){var i;k()(this,e),i=Rl(this,e,[t]);var n=new Cesium.WebMercatorProjection;return i._projection.project=function(t,e){return e=Bl.WGS84ToGCJ02(Cesium.Math.toDegrees(t.longitude),Cesium.Math.toDegrees(t.latitude)),e=n.project(new Cesium.Cartographic(Cesium.Math.toRadians(e[0]),Cesium.Math.toRadians(e[1]))),new Cesium.Cartesian2(e.x,e.y)},i._projection.unproject=function(t,e){var i=n.unproject(t);return e=Bl.GCJ02ToWGS84(Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude)),new Cesium.Cartographic(Cesium.Math.toRadians(e[0]),Cesium.Math.toRadians(e[1]))},i}return sn()(e,t),_()(e)}(Cesium.WebMercatorTilingScheme))(t)}},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s=this,r=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r.length>0&&void 0!==r[0]&&r[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),t.next=5,new rn(this.sdk,this.options,{title:"底图属性",left:"180px",top:"100px",confirmCallBack:function(t){s.name=s.name.trim(),s.name||(s.name="未命名对象"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),se(s.sdk,s.options.id);var e=Ie();if(e&&e!=s.sdk)for(var i=0;i\n
        \n
        \n
        \n 名称:\n \n
        \n
        \n
        \n
        \n 透明度:\n \n
        \n
        \n
        \n ',e.innerHTML=i,n=e.getElementsByClassName("name")[0],o=e.getElementsByClassName("alpha")[0],n.value=this.name,o.value=this.alpha,n.addEventListener("input",(function(){s.name=n.value})),o.addEventListener("input",(function(){s.alpha=o.value})),this._DialogObject.contentAppChild(e),this._elms.name=[n],this._elms.alpha=[o];case 19:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"reset",value:function(){(this.entity||this._DialogObject)&&(this.options=this.deepCopyObj(this.originalOptions),this.name=this.options.name,this.alpha=this.options.alpha,this.brightness=this.options.brightness)}},{key:"flicker",value:function(){}}]);var i,n}(Al);function Hl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Vl=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),Hl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"type",get:function(){return"layer"}},{key:"createArcGis",value:(i=o()(a.a.mark((function t(e){var i,n,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=6;break}return t.next=3,Cesium.ArcGisMapServerImageryProvider.fromUrl(e);case 3:i=t.sent,t.next=7;break;case 6:i=new Cesium.ArcGisMapServerImageryProvider({url:e});case 7:for(this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(i,this.options.layer_index):this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(i),this.entity._id=this.options.id,n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),Yl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"type",get:function(){return"layer"}},{key:"createGD",value:function(t){var e=new Cesium.UrlTemplateImageryProvider({url:t,minimumLevel:3,maximumLevel:18,tilingScheme:this.amapMercatorTilingScheme()});this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(e,this.options.layer_index):this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(e),this.entity._id=this.options.id;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Yl(this,e,[t,n])).createGD("https://webst02.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8"),i}return sn()(e,t),_()(e)}(Jl),Xl=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Yl(this,e,[t,n])).createGD("https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}"),i}return sn()(e,t),_()(e)}(Jl),Zl=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Yl(this,e,[t,n])).createGD("https://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}"),i}return sn()(e,t),_()(e)}(Jl);function Kl(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return $l(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?$l(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function $l(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i=107)){t.next=19;break}return t.next=14,Cesium.Cesium3DTileset.fromUrl(n,r);case 14:l=t.sent,this.entity=l,this.entity.imageBasedLighting.luminanceAtZenith=.1,t.next=25;break;case 19:return r.url=n,l=new Cesium.Cesium3DTileset(r),t.next=23,l.readyPromise;case 23:this.entity=t.sent,this.entity.imageBasedLighting.luminanceAtZenith=.1;case 25:return t.next=27,this.loadSceneTree(n);case 27:if(c=function(t){if(t._contents)for(var e=0;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function cc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),dc(i=hc(this,e,[t,n]),gc,void 0),i.picking=!1,i.Dialog=o,i._elms={},i._EventBinding=new wn,i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"tileset"}},{key:"on",value:function(){return this.add()}},{key:"name",get:function(){return this.newData.name},set:function(t){this.newData.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"height",get:function(){return this.newData.height},set:function(t){this.newData.height=t,this.options.position.alt=t,this._elms.height&&this._elms.height.forEach((function(e){e.value=t})),this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch)}},{key:"accuracy",get:function(){return this.newData.accuracy},set:function(t){var e=this;this.newData.accuracy=Number(t.toFixed(1)),this.newData.accuracy<.1&&(this.newData.accuracy=.1),this.entity&&(this.entity.maximumScreenSpaceError=32/this.newData.accuracy),this._elms.accuracy&&this._elms.accuracy.forEach((function(t){t.value=e.newData.accuracy}))}},{key:"lng",get:function(){return this.newData.lng},set:function(t){this.newData.lng=t,this.options.position.lng=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch)}},{key:"lat",get:function(){return this.newData.lat},set:function(t){this.newData.lat=t,this.options.position.lat=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch)}},{key:"roll",get:function(){return this.newData.roll},set:function(t){this.newData.roll=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale)}},{key:"heading",get:function(){return this.newData.heading},set:function(t){this.newData.heading=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale)}},{key:"pitch",get:function(){return this.newData.pitch},set:function(t){this.newData.pitch=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale)}},{key:"transparency",get:function(){return this.newData.transparency},set:function(t){if(this.newData){this.newData.transparency=Number(t),this._elms.transparency&&this._elms.transparency.forEach((function(e){e.value=t}));var e=this.newData.transparency;this.entity.style=new Cesium.Cesium3DTileStyle({color:{conditions:[["Boolean(${SIZE})","${COLOR} * color('rgba(255,255,255)', "+e+")"],["true","color('rgba(255,255,255,"+e+")')"]]},show:!0})}}},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o=this,s=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=s.length>0&&void 0!==s[0]&&s[0],this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=21;break}return this._element_style=document.createElement("style"),this._element_style.type="text/css",this._element_style.setAttribute("data-name","YJ_style_dialog"),this._element_style.innerHTML="\n .YJ-custom-base-dialog>.content {\n width: 420px;\n }\n .YJ-custom-base-dialog>.content .row .label {\n flex: 0 0 45px;\n }\n",t.next=11,new rn(this.sdk,this.newData,{title:"倾斜模型属性",left:"180px",top:"100px",confirmCallBack:function(t){o.oldData.name=o.newData.name,o.oldData.height=o.newData.height,o.oldData.lng=o.newData.lng,o.oldData.lat=o.newData.lat,o.oldData.transparency=o.newData.transparency,o.oldData.scale=o.newData.scale,o.oldData.roll=o.newData.roll,o.oldData.heading=o.newData.heading,o.oldData.pitch=o.newData.pitch,o.oldData.type=o.type,o.oldData.accuracy=o.newData.accuracy,o._DialogObject.close(),o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(pc(pc({},o.oldData),{},{type:o.type})),se(o.sdk,o.oldData.id)},resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()},closeCallBack:function(){o.reset(),o.positionEditing&&(o.positionEditing=!1),o.rotationEditing&&(o.rotationEditing=!1),o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(t){o.newData.show=t,o.entity&&(o.entity.show=t),o.Dialog.showCallBack&&o.Dialog.showCallBack()},rotateCallBack:function(){o.rotationEditing?o.rotationEditing=!1:o.rotationEditing=!0,o.tileset.root.transform||window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"该模型不支持移动和旋转!",type:"warning",duration:1500}))},translationalCallBack:function(){o.positionEditing?o.positionEditing=!1:o.positionEditing=!0,o.tileset.root.transform||window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"该模型不支持移动和旋转!",type:"warning",duration:1500}))}},!0);case 11:this._DialogObject=t.sent,document.getElementsByTagName("head")[0].appendChild(this._element_style),(i=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n \n
        \n
        \n
        \n 高度\n
        \n \n m\n \n
        \n
        \n
        \n 精度\n
        \n \n \n \n
        \n
        \n
        \n
        \n
        \n 透视\n \n
        \n
        \n
        \n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,t.next=21;break;case 21:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"updateModel",value:function(t,e,i){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;if(this.tileset.root.transform){if(!(!t&&0!==t||!e&&0!==e||!i&&0!==i)){var l=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(s)),u=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(a)),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),h=Cesium.Matrix4.fromRotationTranslation(l),d=Cesium.Matrix4.fromRotationTranslation(c),m=Cesium.Matrix4.fromRotationTranslation(u),f=new Cesium.Matrix4;Cesium.Matrix4.multiply(p,h,f),Cesium.Matrix4.multiply(f,d,f),Cesium.Matrix4.multiply(f,m,f);var v=Cesium.Matrix4.fromUniformScale(r);Cesium.Matrix4.multiply(f,v,this.entity._root.transform),this.editObj.activeAxis||(this.editObj.position={lng:t,lat:e,alt:i}),this.editObj.activeCircle||(this.editObj.rotate={x:o,y:s,z:a}),this.editObj&&this.editObj.update(),clearTimeout(fc(gc,this)),mc(gc,this,setTimeout((function(){clearTimeout(fc(gc,n));var t,e=n.cartesian3Towgs84(n.entity.boundingSphere.center,n.sdk.viewer),i=turf.circle([e.lng,e.lat],n.entity.boundingSphere.radius/1e3,{steps:360,units:"kilometers"}),o=lc(n.sdk.entityMap);try{for(o.s();!(t=o.n()).done;){var s=y()(t.value,2),a=(s[0],s[1]);if("BillboardObject"===a.type&&3==a.heightMode){var r=turf.point([a.lng,a.lat]);turf.booleanPointInPolygon(r,i)&&a.updateHeight()}else a.label&&(a.label.show=a.label.show)}}catch(t){o.e(t)}finally{o.f()}}),300))}}else console.warn("该模型不支持移动和旋转!")}},{key:"reset",value:function(){this.editObj.destroy(),this.entity&&(this.transparency=this.oldData.transparency,this.name=this.oldData.name,this.height=this.oldData.height,this.lng=this.oldData.lng,this.lat=this.oldData.lat,this.roll=this.oldData.roll,this.heading=this.oldData.heading,this.pitch=this.oldData.pitch,this.scale=this.oldData.scale,this.accuracy=this.oldData.accuracy,this.entity.style=new Cesium.Cesium3DTileStyle({color:{conditions:[["Boolean(${SIZE})","${COLOR} * color('rgba(255,255,255)', "+this.transparency+")"],["true","color('rgba(255,255,255,"+this.transparency+")')"]]},show:!0}))}}]);var i}(rc);function bc(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Cc(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Cc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Cc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),_c(i=xc(this,e,[t,n]),Pc,void 0),i.picking=!1,i.features=n.features||[],i.exportStateArray=[],i.Dialog=o,i._elms={},i._EventBinding=new wn,i.Dialog.exportState=function(t){i.exportState(t)},i.Dialog.exportProperty=function(t){i.exportProperty(i.exportStateArray)},i.features=new Map,i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"bim"}},{key:"name",get:function(){return this.newData.name},set:function(t){this.newData.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.newData.lng},set:function(t){this.newData.lng=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.newData.lat},set:function(t){this.newData.lat=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"height",get:function(){return this.newData.height},set:function(t){this.newData.height=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.height&&this._elms.height.forEach((function(e){e.value=t}))}},{key:"roll",get:function(){return this.newData.roll},set:function(t){this.newData.roll=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.roll&&this._elms.roll.forEach((function(e){e.value=t}))}},{key:"heading",get:function(){return this.newData.heading},set:function(t){this.newData.heading=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.heading&&this._elms.heading.forEach((function(e){e.value=t}))}},{key:"pitch",get:function(){return this.newData.pitch},set:function(t){this.newData.pitch=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.pitch&&this._elms.pitch.forEach((function(e){e.value=t}))}},{key:"scale",get:function(){return this.newData.scale},set:function(t){this.newData.scale=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.scale&&this._elms.scale.forEach((function(e){e.value=t}))}},{key:"loadSceneTree",value:(r=o()(a.a.mark((function t(e){var i,n=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(i=e.split("/"))[i.length-1]="scenetree.json",t.next=4,Cesium.Resource.fetchJson({url:i.join("/")}).then((function(t){n.scenetree=t;var e=function(t){t.forEach((function(t){n.features.has(t.id)?n.features.get(t.id).sphere=t.sphere:n.features.set(t.id,{sphere:t.sphere}),t.children&&e(t.children)}))};e(t.scenes[0].children)}));case 4:case"end":return t.stop()}}),t)}))),function(t){return r.apply(this,arguments)})},{key:"edit",value:(s=o()(a.a.mark((function t(e){var i,n,o=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=16;break}return t.next=6,new rn(this.sdk,this.newData,{title:"BIM模型属性",left:"180px",top:"100px",resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},confirmCallBack:function(t){o.name=o.name.trim(),o.name||(o.name="未命名对象"),o.oldData.name=o.newData.name,o.oldData.height=o.newData.height,o.oldData.lng=o.newData.lng,o.oldData.lat=o.newData.lat,o.oldData.scale=o.newData.scale,o.oldData.roll=o.newData.roll,o.oldData.heading=o.newData.heading,o.oldData.pitch=o.newData.pitch,o._DialogObject.close();var e=new Map;o.features.forEach((function(t,i){var n=kc({},t);delete n.features,e.set(i,n)})),o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(kc(kc({},o.oldData),{},{features:e,type:o.type})),se(o.sdk,o.oldData.id)},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()},closeCallBack:function(){o.reset(),o.editObj.destroy(),o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(t){o.newData.show=t,o.entity&&(o.entity.show=t),o.Dialog.showCallBack&&o.Dialog.showCallBack()},rotateCallBack:function(){o.rotationEditing?o.rotationEditing=!1:o.rotationEditing=!0},translationalCallBack:function(){o.positionEditing?o.positionEditing=!1:o.positionEditing=!0}});case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" tileset-bim",(i=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 经度\n \n
        \n
        \n x轴\n \n
        \n
        \n
        \n
        \n 纬度\n \n
        \n
        \n y轴\n \n
        \n
        \n
        \n
        \n 高度\n
        \n \n m\n \n
        \n
        \n
        \n z轴\n \n
        \n
        \n
        \n
        \n 大小\n \n
        \n \n \n
        \n \n
        \n
        \n
        \n \n
        \n
        \n

        BIM属性导出选项

        \n
        \n
        \n
        \n
        \n
        \n \n 修建中\n
        \n
        \n \n 未完成\n
        \n
        \n \n 已完成\n
        \n
        \n
        \n \n
        \n
        \n \n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,t.next=17;break;case 16:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"featureEdit",value:(n=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d,m=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this,this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=46;break}o=function(t){var e='
        \n
        \n \n \n \n \n
        \n
        '),i=document.createElement("div");i.innerHTML=e;var s=i.getElementsByClassName("property-item")[0],a=s.querySelector("input[name='key']"),l=s.querySelector("input[name='value']"),c=s.getElementsByClassName("add")[0],p=s.getElementsByClassName("delete")[0];a.addEventListener("input",(function(e){t.key=e.target.value})),l.addEventListener("input",(function(e){t.value=e.target.value})),c.addEventListener("click",(function(){var t={id:n.randomString(),key:"点击此处可编辑",value:""};r.descriptions.push(t),o(t)})),p.addEventListener("click",(function(e){for(var i=0;i.content {\n width: 440px;\n }\n .YJ-custom-base-dialog>.content .row .label {\n flex: 0 0 110px;\n }\n .col:first-child {\n margin-right: 10px;\n }\n .col:last-child {\n margin-left: 10px;\n }\n .YJ-custom-base-dialog>.content .divide {\n position: relative;\n display: flex;\n align-items: center;\n margin: 20px 0;\n }\n .YJ-custom-base-dialog>.content .divide .line{\n height: 1px;\n background: #ddd;\n flex: 1;\n }\n .YJ-custom-base-dialog>.content .divide p{\n margin: 0 10px;\n }\n .YJ-custom-base-dialog>.content .property .property-item .btn{\n font-size: 24px;\n line-height: 20px;\n padding: 2px 0;\n }\n .YJ-custom-base-dialog>.content .property .property-item .input_lable {\n flex: 0 0 115px;\n border: none;\n margin-right: 15px;\n text-align: right;\n }\n .YJ-custom-base-dialog>.content .property .property-item:first-child .delete{\n display: none\n }\n .YJ-custom-base-dialog>.content .property .property-item .add{\n display: none;\n }\n .YJ-custom-base-dialog>.content .property .property-item:last-child .add{\n display: inline-block;\n }\n",t.next=24,new W(this.sdk.viewer._container,{title:this.oldData.name+"-----设置状态",left:"calc(50% - 200px)",top:"calc(50% - 200px)",closeCallBack:function(){m.Dialog.closeCallBack&&m.Dialog.closeCallBack()}});case 24:return this._DialogObject=t.sent,t.next=27,this._DialogObject.init();case 27:for(document.getElementsByTagName("head")[0].appendChild(this._element_style),(l=document.createElement("div")).innerHTML='\n
        \n
        \n 构件名称\n \n
        \n
        \n
        \n
        \n 选择状态\n \n
        \n
        \n
        \n
        \n

        自定义属性

        \n
        \n
        \n
        \n
        \n ',l.querySelector("input[name='name']").value=s,(c=l.querySelector("select[name='state-select']")).value=r.state,c.addEventListener("change",(function(t){switch(r.state=t.target.value,r.state){case"0":r.stateCH="";break;case"1":r.stateCH="已完成";break;case"2":r.stateCH="未完成";break;case"3":r.stateCH="修建中"}})),u=l.getElementsByClassName("property")[0],p=0;p3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;if(!this.tileset.root.transform)return window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"该模型不支持移动和旋转!",type:"warning",duration:1500})),void console.warn("该模型不支持移动和旋转!");if(!(!t&&0!==t||!e&&0!==e||!i&&0!==i)){var l=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(s)),u=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(a)),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),h=Cesium.Matrix4.fromRotationTranslation(l),d=Cesium.Matrix4.fromRotationTranslation(c),m=Cesium.Matrix4.fromRotationTranslation(u),f=new Cesium.Matrix4;Cesium.Matrix4.multiply(p,h,f),Cesium.Matrix4.multiply(f,d,f),Cesium.Matrix4.multiply(f,m,f);var v=Cesium.Matrix4.fromUniformScale(r);Cesium.Matrix4.multiply(f,v,this.entity._root.transform),this.editObj.activeAxis||(this.editObj.position={lng:t,lat:e,alt:i}),this.editObj.activeCircle||(this.editObj.rotate={x:o,y:s,z:a}),this.editObj&&this.editObj.update(),clearTimeout(Sc(Pc,this)),Ec(Pc,this,setTimeout((function(){clearTimeout(Sc(Pc,n));var t,e=n.cartesian3Towgs84(n.entity.boundingSphere.center,n.sdk.viewer),i=turf.circle([e.lng,e.lat],n.entity.boundingSphere.radius/1e3,{steps:360,units:"kilometers"}),o=bc(n.sdk.entityMap);try{for(o.s();!(t=o.n()).done;){var s=y()(t.value,2),a=(s[0],s[1]);if("BillboardObject"===a.type&&3==a.heightMode){var r=turf.point([a.lng,a.lat]);turf.booleanPointInPolygon(r,i)&&a.updateHeight()}else a.label&&(a.label.show=a.label.show)}}catch(t){o.e(t)}finally{o.f()}}),300))}}},{key:"getScenetree",value:function(){return this.scenetree}},{key:"featureColor",value:function(t,e){if(this.features.has(t)){var i=this.features.get(t).features;for(var n in i)i[n].content._model&&(i[n].color=Cesium.Color.fromCssColorString(e)),i[n].customColor=Cesium.Color.fromCssColorString(e);this.features.get(t).customColor=Cesium.Color.fromCssColorString(e)}}},{key:"getFeatureColor",value:function(t){if(this.features.has(t)){if(this.features.get(t).customColor)return this.features.get(t).customColor;var e=this.features.get(t).features;for(var i in e)if(e[i].content._model)return e[i].customColor||e[i].color}}},{key:"featureShow",value:function(t,e){if(this.features.has(t)){var i=this.features.get(t).features;for(var n in i)i[n].content._model&&(i[n].show=e),i[n].customShow=e;this.features.get(t).customShow=e}}},{key:"featureFlyto",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.features.has(e)?(i=this.features.get(e).sphere,n=new Cesium.Cartesian3(i[0],i[1],i[2]),o=this.entity._root.originalTransform,o=Cesium.Matrix4.inverse(o,new Cesium.Matrix4),s=this.entity._root.transform,r=Cesium.Matrix4.multiply(s,o,new Cesium.Matrix4),l=Cesium.Matrix4.multiplyByPoint(r,n,new Cesium.Cartesian3),c=this.cartesian3Towgs84(l,this.sdk.viewer),u=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt+i[3]),pi(0),ii(this.sdk),ni(this.sdk),this.sdk.viewer.camera.flyTo({destination:u}),this.features.forEach((function(t,i){if(i===e){var n=p.getFeatureColor(e);if(p.features.has(e)&&n){var o=p.features.get(e).features;for(var s in o)o[s].content._model&&(o[s].color=n),o[s].customAlpha=1;p.features.get(e).customAlpha=1}}else{var a=p.getFeatureColor(i);if(p.features.has(i)&&a){var r=p.features.get(i).features;for(var l in r)r[l].content._model&&(r[l].color=Cesium.Color.fromCssColorString("rgba(".concat(Cesium.Color.floatToByte(a.red),",").concat(Cesium.Color.floatToByte(a.green),",").concat(Cesium.Color.floatToByte(a.blue),",").concat(.2*a.alpha,")"))),r[l].customAlpha=.2*a.alpha;p.features.get(i).customAlpha=.2*a.alpha}}}))):this.features.forEach((function(t,e){var i=p.features.get(e).features,n=p.getFeatureColor(e);if(n){for(var o in i)i[o].content._model&&(i[o].color=n),i[o].customAlpha=1;p.features.get(e).customAlpha=.2*n.alpha}}));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"exportProperty",value:function(t){if(0!==this.exportStateArray.length){for(var e,i=["name","","","","","","","","","","","","stateCH","descriptions"],n='{rows}
        ',o=function(t,e){return t.replace(/{(\w+)}/g,(function(t,i){return e[i]}))},s="",a="",r="",l=0;l构件名称体积墩全高H墩身高h底部高程承台宽承台长承台高桩径桩长结构材质完成情况自定义属性'),r+="",i){if(Array.isArray(this.features[l][i[u]])){var p="";for(var h in this.features[l][i[u]])p+="".concat(this.features[l][i[u]][h].key+":"+this.features[l][i[u]][h].value," ");s={nameType:"String",data:p}}else s={nameType:"String",data:this.features[l][i[u]]||"0"};r+=o('{data}',s)}r+="",l>0&&l/6e4%1==0&&(a+=o(n,s={rows:r,nameWS:"Sheet"+l}),r="",r+='构件名称体积墩全高H墩身高h底部高程承台宽承台长承台高桩径桩长结构材质完成情况自定义属性')}a+=o(n,s={rows:r,nameWS:"Sheet"}),r="",e=o('Axel Richter{created}{worksheets}',s={created:(new Date).getTime(),worksheets:a});var d,m=document.createElement("A");m.href="data:application/vnd.ms-excel;base64,"+(d=e,window.btoa(unescape(encodeURIComponent(d)))),m.download=this.oldData.name+"--构件属性.xls",m.target="_blank",document.body.appendChild(m),m.click(),document.body.removeChild(m)}else window.ELEMENT&&window.ELEMENT.Message({message:"未选择属性导出选项!",type:"warning",duration:1500})}},{key:"exportState",value:function(t){var e=t.target.getElementsByTagName("input")[0];if(e.checked=!e.checked,e.checked)this.exportStateArray.push(e.value),this.exportStateArray=Array.from(new Set(this.exportStateArray));else for(var i=0;i\n
        \n
        \n
        \n 名称\n \n
        \n
        \n 颜色\n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 经度\n \n
        \n
        \n 最大比例\n
        \n \n \n \n
        \n
        \n
        \n
        \n
        \n 纬度\n \n
        \n
        \n 最小像素\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 高度\n
        \n \n m\n \n
        \n
        \n
        \n 固定大小\n \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(Ln(t),'\n \n \n
        \n
        \n

        旋转

        \n
        \n
        \n
        \n x 轴\n \n
        \n \n °\n \n
        \n
        \n
        \n
        \n
        \n y 轴\n \n
        \n \n °\n \n
        \n
        \n
        \n
        \n
        \n z 轴\n \n
        \n \n °\n \n
        \n
        \n
        \n \n
        \n
        \n 缩放\n
        \n \n 是否等比例缩放\n
        \n
        \n
        \n \n \n
        \n

        高度

        \n
        \n
        \n
        \n 高度\n \n
        \n \n m\n \n
        \n
        \n
        \n \n
        \n
        \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体选择\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ','\n
        \n
        \n
        \n
        \n \n ')}function Tc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Nc(t){for(var e=1;e=0;L--){var A=B[L];if(A&&A.primitive&&A.id)switch(A.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return void(A.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}}}(t)})),this.MapEvent.mouse_left_down((function(i){var n=a.scene.cartesianToCanvasCoordinates(t.origin);g.x=i.position.x-Math.floor(n.x),g.y=i.position.y-Math.floor(n.y);for(var o=a.scene.drillPick(i.position,10),s=o.length-1;s>=0;s--){var r=o[s];if(r&&r.primitive&&r.primitive._name)if(e.activeAxis)e.activeAxis=null,e.activeModelParam=null,e.controllerCallBack;else switch(r.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return a.scene.screenSpaceCameraController.enableRotate=!1,e.activeAxis=r.primitive,e.activeModelParam=e.initParam(),void(r.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}})),this.MapEvent.mouse_left_up((function(t){a.scene.screenSpaceCameraController.enableRotate=!0;for(var i=0;i360&&(o._params.rx=1),o._params.rx<0&&(o._params.rx=360);Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o._params.rx));o._params.ry-=r,o._params.ry>360&&(o._params.ry=1),o._params.ry<0&&(o._params.ry=360);Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(o._params.ry));o._params.rz-=l,o._params.rz>360&&(o._params.rz=1),o._params.rz<0&&(o._params.rz=360),o.updateModel(o._params.tx,o._params.ty,o._params.tz,o._params.rx,o._params.ry,o._params.rz)}else{var p=Date.now();if(p-x<100)return clearTimeout(k),void(k=setTimeout((function(){t(e)}),100));clearTimeout(k),x=p;for(var h=o.coordCircles,d=0;d3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this._params.tx=t=parseFloat(parseFloat(t).toFixed(8)),this._params.ty=e=parseFloat(parseFloat(e).toFixed(8)),this._params.tz=i=parseFloat(parseFloat(i).toFixed(2)),this._params.rx=n=parseFloat(n),this._params.ry=o=parseFloat(o),this._params.rz=s=parseFloat(s),this.model.position=new Cesium.Cartesian3.fromDegrees(t,e,i),this.model.rotate={x:n,y:o,z:s};var a=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(n)),r=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(o)),l=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(s)),c=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),u=Cesium.Matrix4.fromRotationTranslation(a),p=Cesium.Matrix4.fromRotationTranslation(r),h=Cesium.Matrix4.fromRotationTranslation(l),d=new Cesium.Matrix4;Cesium.Matrix4.multiply(c,u,d),Cesium.Matrix4.multiply(d,p,d),Cesium.Matrix4.multiply(d,h,this.model.modelMatrix),this.transformCallBack}},{key:"transformCallBack",get:function(){this._transformCallBack&&this._transformCallBack(this._params)},set:function(t){this._transformCallBack=t}},{key:"createAxisArrow",value:function(t,e,i,n){var o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,width:20}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:n}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return o._name=t,this.coordArrows.push(o),o}},{key:"createAxisSphere",value:function(t,e,i,n,o){var s=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,width:5}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineColorAppearance({translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return s._radius=o,s._name=t,this.coordCircles.push(s),s}},{key:"removeCoordArrows",value:function(){for(var t=0;t=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ic(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),Vc(i=zc(this,e,[t,n,o={}]),Yc,null),n.position?n.position.lng||0===n.position.lng?n.position.lat||0===n.position.lat?(i.options.earth&&delete i.options.earth,i.picking=!0,i.options.name=n.name||"未命名对象",i.options.color=n.color||"#ffffff","number"==typeof n.scale?(i.options.scale={},i.options.scale.x=n.scale,i.options.scale.y=n.scale,i.options.scale.z=n.scale):(i.options.scale=n.scale||{},i.options.scale.x=i.options.scale.x||0===i.options.scale.x?i.options.scale.x:1,i.options.scale.y=i.options.scale.y||0===i.options.scale.y?i.options.scale.y:1,i.options.scale.z=i.options.scale.z||0===i.options.scale.z?i.options.scale.z:1),i.options.url=n.url,i.options.maximumScale=n.maximumScale||0===n.maximumScale?n.maximumScale:100,i.options.minimumPixelSize=n.minimumPixelSize||0===n.minimumPixelSize?n.minimumPixelSize:60,i.options.position=n.position=n.position||{},i.options.position={lng:n.position.lng,lat:n.position.lat,alt:n.position.alt},i.options.scaleByDistance=!n.scaleByDistance&&!1!==n.scaleByDistance||n.scaleByDistance,i.options.rotate=n.rotate=n.rotate||{},i.options.rotate.x=n.rotate.x||0,i.options.rotate.y=n.rotate.y||0,i.options.rotate.z=n.rotate.z||0,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera=i.options.attribute.camera.content||[],i.options.attribute.ISC=i.options.attribute.ISC||{},i.options.attribute.ISC.content=i.options.attribute.ISC.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i._elms={},i.entity={id:i.options.id},i.positionCallBack=null,i.rotationCallback=null,i.onClickCallback=null,i._DialogObject=null,i.Dialog=o,i._EventBinding=new wn,i.on(),i):(console.warn("lat is required!"),tn()(i)):(console.warn("lng is required!"),tn()(i)):(console.warn("position is required!"),tn()(i))}return sn()(e,t),_()(e,[{key:"type",get:function(){return"glb"}},{key:"loadModel",value:(l=o()(a.a.mark((function t(e){var i,n,o,s=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Pe(this.sdk,this.options.id),this.sdk&&this.sdk.viewer&&this.sdk.viewer.scene){t.next=3;break}return t.abrupt("return");case 3:if(e=this.replaceHost(e,this.options.host),this.originalOptions=this.deepCopyObj(this.options),i={id:this.options.id,url:e,show:this.options.show,maximumScale:this.options.scaleByDistance?void 0:this.options.maximumScale,minimumPixelSize:this.options.scaleByDistance?void 0:this.options.minimumPixelSize},!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=13;break}return t.next=10,Cesium.Model.fromGltfAsync(i);case 10:this.entity=t.sent,t.next=16;break;case 13:return t.next=15,Cesium.Model.fromGltf(i);case 15:this.entity=t.sent;case 16:return this.entity.imageBasedLighting.luminanceAtZenith=.6,this.entity.color=Cesium.Color.fromCssColorString(this.options.color),t.next=20,this.sdk.viewer.scene.primitives.add(this.entity);case 20:n=Cesium.Cartographic.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n),this.entity.position=o,this.entity.rotate=Fc({},this.options.rotate),this.entity.customScale=this.options.scale,this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),Number(Cesium.VERSION.split(".")[1])>=107?(this.entity.readyEvent.addEventListener((function(){s.entity.originalBoundingSphereRadius=s.entity.boundingSphere.radius,s.editObj=new Bc(s.sdk,s.entity),s.editObj.transformCallBack=s.rotationEditingCallBack,s.updateModel(s.options.position.lng,s.options.position.lat,s.options.position.alt,s.options.rotate.x,s.options.rotate.y,s.options.rotate.z,s.options.scale),s.label||(s.label=new oo(s.sdk,{id:s.options.id,show:!!s.options.show&&s.options.label.show,position:[s.options.position.lng,s.options.position.lat,s.options.position.alt],text:s.options.name,fontSize:s.options.label.fontSize,fontFamily:s.options.label.fontFamily?s.options.label.fontFamily:0,color:s.options.label.color,pixelOffset:s.options.label.pixelOffset,backgroundColor:s.options.label.backgroundColor,lineColor:s.options.label.lineColor,lineWidth:s.options.label.lineWidth,scaleByDistance:s.options.label.scaleByDistance,near:s.options.label.near,far:s.options.label.far},s.entity)),s.entity.isMove=!0,clearTimeout(Uc(Yc,s)),Gc(Yc,s,setTimeout((function(){s.entity&&(s.entity.isMove=!1)}),500))})),this.activeAnimate=this.options.activeAnimate,this.modelAnimations=this.entity.loader.components.animations):this.entity.readyPromise.then((function(t){s.entity.originalBoundingSphereRadius=s.entity.boundingSphere.radius,s.editObj=new Bc(s.sdk,s.entity),s.editObj.transformCallBack=s.rotationEditingCallBack,s.updateModel(s.options.position.lng,s.options.position.lat,s.options.position.alt,s.options.rotate.x,s.options.rotate.y,s.options.rotate.z,s.options.scale),s.label||(s.label=new oo(s.sdk,{id:s.options.id,show:!!s.options.show&&s.options.label.show,position:[s.options.position.lng,s.options.position.lat,s.options.position.alt],text:s.options.name,fontSize:s.options.label.fontSize,fontFamily:s.options.label.fontFamily?s.options.label.fontFamily:0,color:s.options.label.color,pixelOffset:s.options.label.pixelOffset,backgroundColor:s.options.label.backgroundColor,lineColor:s.options.label.lineColor,lineWidth:s.options.label.lineWidth,scaleByDistance:s.options.label.scaleByDistance,near:s.options.label.near,far:s.options.label.far,ground:!1},s.entity)),s.entity.isMove=!0,clearTimeout(Uc(Yc,s)),Gc(Yc,s,setTimeout((function(){s.entity&&(s.entity.isMove=!1)}),500)),s.activeAnimate=s.options.activeAnimate,s.modelAnimations=s.entity.loader.components.animations})),se(this.sdk,this.options.id);case 28:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"getModelAnimations",value:(r=o()(a.a.mark((function t(){var e=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,i){Number(Cesium.VERSION.split(".")[1])>=107?e.entity.readyEvent.addEventListener((function(){e.modelAnimations=e.entity.loader.components.animations,t(e.modelAnimations)})):e.entity.readyPromise.then((function(i){e.modelAnimations=e.entity.loader.components.animations,t(e.modelAnimations)}))})));case 1:case"end":return t.stop()}}),t)}))),function(){return r.apply(this,arguments)})},{key:"remove",value:function(){Hc(e,"remove",this,3)([]),this.label&&this.label.remove(),this.positionEditing=!1,this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=22;break}if(e={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Fc({},this.options.position):this.options.positions?r=Fc({},this.options.positions[0]):this.options.center?r=Fc({},this.options.center):this.options.start?r=Fc({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),r.hasOwnProperty("alt")){t.next=15;break}return t.next=14,this.getClampToHeight(r);case 14:r.alt=t.sent;case 15:i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e}),t.next=23;break;case 22:Number(Cesium.VERSION.split(".")[1])>=107?this.entity.ready&&(l=new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt),this.entity.originalBoundingSphereRadius*this.options.scale.z*2),this.sdk.viewer.camera.flyToBoundingSphere(l)):this.entity.readyPromise.then((function(){var t=new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(c.options.position.lng,c.options.position.lat,c.options.position.alt),(c.entity.originalBoundingSphereRadius||c.entity.boundingSphere.radius)*c.options.scale.z*2);c.sdk.viewer.camera.flyToBoundingSphere(t)}));case 23:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"on",value:function(){return this.add()}},{key:"setDefaultValue",value:function(){Hc(e,"setDefaultValue",this,3)([]),this.options.host=this.options.host||h(),this.options.url=this.options.url||""}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.entity.color=Cesium.Color.fromCssColorString(t),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"lng",get:function(){return this.options.position.lng},set:function(t){this.options.position={lng:t,lat:this.options.position.lat,alt:this.options.position.alt},this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label&&(this.label.position=[this.options.position.lng,this.options.position.lat,this.options.position.alt]),this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.position.lat},set:function(t){this.options.position={lng:this.options.position.lng,lat:t,alt:this.options.position.alt},this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label&&(this.label.position=[this.options.position.lng,this.options.position.lat,this.options.position.alt]),this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.position.alt},set:function(t){this.options.position={lng:this.options.position.lng,lat:this.options.position.lat,alt:t},this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label&&(this.label.position=[Number(this.options.position.lng),Number(this.options.position.lat),Number(this.options.position.alt)]),this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"maximumScale",get:function(){return this.options.maximumScale},set:function(t){this.options.maximumScale=t,this.entity.maximumScale=this.scaleByDistance?void 0:t,this._elms.maximumScale&&this._elms.maximumScale.forEach((function(e){e.value=t}))}},{key:"minimumPixelSize",get:function(){return this.options.minimumPixelSize},set:function(t){this.options.minimumPixelSize=t,this.entity.minimumPixelSize=this.scaleByDistance?void 0:this.options.minimumPixelSize,this._elms.minimumPixelSize&&this._elms.minimumPixelSize.forEach((function(e){e.value=t}))}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(t){this.options.scaleByDistance=t,this.entity.maximumScale=t?void 0:this.maximumScale,this.entity.minimumPixelSize=t?void 0:this.options.minimumPixelSize,this._elms.scaleByDistance&&this._elms.scaleByDistance.forEach((function(e){e.checked=t}))}},{key:"rotateX",get:function(){return this.options.rotate.x},set:function(t){this.options.rotate.x=t,this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateX&&this._elms.rotateX.forEach((function(e){e.value=t}))}},{key:"rotateY",get:function(){return this.options.rotate.y},set:function(t){this.options.rotate.y=t,this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateY&&this._elms.rotateY.forEach((function(e){e.value=t}))}},{key:"rotateZ",get:function(){return this.options.rotate.z},set:function(t){this.options.rotate.z=t,this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateZ&&this._elms.rotateZ.forEach((function(e){e.value=t}))}},{key:"scaleX",get:function(){return this.options.scale.x},set:function(t){var e=this;this.options.scale.x=Number(Number(t).toFixed(2)),this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.scaleX&&this._elms.scaleX.forEach((function(t){t.value=e.options.scale.x}))}},{key:"scaleY",get:function(){return this.options.scale.y},set:function(t){var e=this;this.options.scale.y=Number(Number(t).toFixed(2)),this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.scaleY&&this._elms.scaleY.forEach((function(t){t.value=e.options.scale.y}))}},{key:"scaleZ",get:function(){return this.options.scale.z},set:function(t){var e=this;this.options.scale.z=Number(Number(t).toFixed(2)),this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.scaleZ&&this._elms.scaleZ.forEach((function(t){t.value=e.options.scale.z}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show&&!this.showView||3==this.showView?this.label&&(this.label.show=t):this.label&&(this.label.show=!1),this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label&&(this.label.color=t),this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label&&(this.label.fontSize=t),this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label&&(this.label.scaleByDistance=t),this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
        '+this.options.attribute.link.content[s].url+'
        \n
        \n \n \n
        \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
        '+this.options.attribute.vr.content[s].url+'
        \n
        \n \n \n
        \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0))for(var e=0;e0&&void 0!==v[0]&&v[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=46;break}return i=!1,this.scaleX===this.scaleY&&this.scaleX===this.scaleZ&&(i=!0),t.next=9,new rn(this.sdk,this.originalOptions,{title:"模型属性",left:"180px",top:"100px",confirmCallBack:function(t){f.name=f.options.name||"未命名对象",f.originalOptions=f.deepCopyObj(f.options),f._DialogObject.close();var e=f.deepCopyObj(f.options);e.host="",f.Dialog.confirmCallBack&&f.Dialog.confirmCallBack(e),Pe(f.sdk,f.options.id),se(f.sdk,f.options.id)},resetCallBack:function(){f.reset(),f.Dialog.resetCallBack&&f.Dialog.resetCallBack()},removeCallBack:function(){f.Dialog.removeCallBack&&f.Dialog.removeCallBack()},closeCallBack:function(){f.reset(),f.positionEditing=!1,f.editObj&&f.editObj.destroy(),f.Dialog.closeCallBack&&f.Dialog.closeCallBack()},showCallBack:function(t){f.show=t,f.Dialog.showCallBack&&f.Dialog.showCallBack()},translationalCallBack:function(){f.positionEditing?f.positionEditing=!1:f.positionEditing=!0}},!0);case 9:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" model",(n=document.createElement("div")).innerHTML=Oc(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,new kn("model-edit-tabs",void 0,this.sdk),o=this._DialogObject._element.content.getElementsByClassName("checkbox-box")[0].querySelector("input"),s=this._DialogObject._element.content.getElementsByClassName("equal")[0],r=this._DialogObject._element.content.getElementsByClassName("no-equal")[0],o.checked=i,o.addEventListener("change",(function(t){(i=t.target.checked)?(s.style.display="flex",r.style.display="none",f.scaleY=f.scaleX,f.scaleZ=f.scaleX):(s.style.display="none",r.style.display="flex")})),(l=s.getElementsByTagName("input"))[0].value=this.scaleX,l[1].value=this.scaleX,l[0].addEventListener("input",(function(t){f.scaleX=t.target.value,f.scaleY=t.target.value,f.scaleZ=t.target.value})),l[1].addEventListener("input",(function(t){f.scaleX=t.target.value,f.scaleY=t.target.value,f.scaleZ=t.target.value})),i?(s.style.display="flex",r.style.display="none"):(s.style.display="none",r.style.display="flex"),c=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){f.color=t},clear:function(){f.color="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelColor=t},clear:function(){f.labelColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelLineColor=t},clear:function(){f.labelLineColor="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelBackgroundColorStart=t},clear:function(){f.labelBackgroundColorStart="rgba(255,255,255,1)"}}),d=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelBackgroundColorEnd=t},clear:function(){f.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),m=n.getElementsByTagName("*"),this._EventBinding.on(this,m),this._elms=this._EventBinding.element,this._elms.color=[c],this._elms.labelColor=[u],this._elms.labelLineColor=[p],this._elms.labelBackgroundColorStart=[h],this._elms.labelBackgroundColorEnd=[d],this._elms.scaleX.push(l[0],l[1]),setTimeout((function(){f.attributeLink=f.options.attribute.link.content,f.attributeVr=f.options.attribute.vr.content,f.ISCSelect&&f.ISCSelect(),f.goodsSelect&&f.goodsSelect(),f.cameraSelect&&f.cameraSelect();var t=f.attributeSelect,e=f._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=f._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],o=0;o3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6?arguments[6]:void 0;t=parseFloat(t),e=parseFloat(e),i=parseFloat(parseFloat(i).toFixed(2)),o=parseFloat(o),s=parseFloat(s),a=parseFloat(a),r.x=parseFloat(r.x),r.y=parseFloat(r.y),r.z=parseFloat(r.z),this.entity.position=new Cesium.Cartesian3.fromDegrees(t,e,i),this.entity.rotate={x:o,y:s,z:a},this.entity.customScale=r;var l=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(s)),u=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(a)),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),h=Cesium.Matrix4.fromRotationTranslation(l),d=Cesium.Matrix4.fromRotationTranslation(c),m=Cesium.Matrix4.fromRotationTranslation(u),f=new Cesium.Matrix4;Cesium.Matrix4.multiply(p,h,f),Cesium.Matrix4.multiply(f,d,f),Cesium.Matrix4.multiply(f,m,this.entity.modelMatrix);var v=r.x,g=r.y,y=r.z;0===v&&(v=1e-5),0===g&&(g=1e-5),0===y&&(y=1e-5),Cesium.Matrix4.multiplyByScale(this.entity.modelMatrix,new Cesium.Cartesian3(v,g,y),this.entity.modelMatrix),this.entity.minimumPixelSize=this.scaleByDistance?void 0:this.options.minimumPixelSize,this.editObj&&this.editObj.update(),this.entity.isMove=!0,clearTimeout(Uc(Yc,this)),Gc(Yc,this,setTimeout((function(){n.entity&&(n.entity.isMove=!1)}),500))}},{key:"reset",value:function(){if(this.entity)try{this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lng=this.originalOptions.position.lng,this.lat=this.originalOptions.position.lat,this.alt=this.originalOptions.position.alt,this.maximumScale=this.originalOptions.maximumScale,this.minimumPixelSize=this.originalOptions.minimumPixelSize,this.scaleByDistance=this.originalOptions.scaleByDistance,this.rotateX=this.originalOptions.rotate.x,this.rotateY=this.originalOptions.rotate.y,this.rotateZ=this.originalOptions.rotate.z,this.scaleX=this.originalOptions.scale.x,this.scaleY=this.originalOptions.scale.y,this.scaleZ=this.originalOptions.scale.z,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.attributeISC=this.options.attribute.ISC.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect()}catch(t){}}}]);var i,n,s,r,l}(Ac);function qc(t){return'\n
        \n
        \n 名称\n \n
        \n
        \n 颜色\n
        \n
        \n
        \n
        \n
        \n 经度\n \n
        \n
        \n 最大比例\n \n
        \n
        \n
        \n
        \n 纬度\n \n
        \n
        \n 最小像素\n \n
        \n
        \n
        \n
        \n 高度\n \n
        \n
        \n 视野缩放\n \n
        \n
        \n
        \n \n \n '.concat(Ln(t),'\n \n \n
        \n
        \n
        \n x轴\n \n \n
        \n
        \n
        \n
        \n y轴\n \n \n
        \n
        \n
        \n
        \n z轴\n \n \n
        \n
        \n
        \n
        \n 高度\n \n \n
        \n
        \n
        \n
        \n 缩放\n \n \n
        \n
        \n
        \n
        \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体选择\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ',"\n
        \n
        \n
        \n ")}function Xc(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Zc(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Zc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Zc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=Qc(this,e,[t,n,o={}])).picking=!0,i.options.name=n.name||"未命名对象",i.options.color=n.color||"#ffffff",i.options.scale=n.scale||0===n.scale?n.scale:1,i.options.url=n.url,i.options.maximumScale=n.maximumScale||0===n.maximumScale?n.maximumScale:100,i.options.minimumPixelSize=n.minimumPixelSize||0===n.minimumPixelSize?n.minimumPixelSize:60,i.options.positions=n.positions||[],i.options.type=n.type||0,i.options.interval=n.interval||0===n.interval?n.interval:1,i.options.quantity=n.quantity,i.options.scaleByDistance=!n.scaleByDistance&&!1!==n.scaleByDistance||n.scaleByDistance,i.options.rotate=n.rotate=n.rotate||{},i.options.rotate.x=n.rotate.x||0,i.options.rotate.y=n.rotate.y||0,i.options.rotate.z=n.rotate.z||0,i.options.label=n.label=n.label||{},i.options.label.show=!(!n.label.show&&!1!==n.label.show)&&n.label.show,i.options.label.fontSize=n.label.fontSize||20,i.options.label.color=n.label.color||"#ffffff",i.options.label.near=n.label.near||0===n.label.near?n.label.near:2e3,i.options.label.far=n.label.far||0===n.label.far?n.label.far:1e5,i.options.label.scaleByDistance=n.label.scaleByDistance||!1,i.options.label.backgroundColor=n.label.backgroundColor||["#42c6ef","#42c6ef"],i.options.line=n.line=n.line||{},i.options.line.width=n.line.width||2,i.options.line.length=n.line.length||20,i.options.line.color=n.line.color||"#fff000",i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||[],i.options.attributeType=n.attributeType||"richText",i.ModelPositions=[],i._elms={},i.positionCallBack=null,i.rotationCallback=null,i.onClickCallback=null,i._DialogObject=null,i._element_style=null,i.ControllerObject=new qo(i.sdk),i.ControllerObject.controllerCallBack=function(t){i.lng=t.position.lng,i.lat=t.position.lat,i.alt=t.position.alt},i.Dialog=o,i._EventBinding=new wn,i.on(),i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"glb"}},{key:"loadModel",value:(s=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(v=function(t){return new Worker("data:,(".concat(t.toString(),")(").concat(JSON.stringify(m),")"))},f=function(t){var e=t.type,i=t.interval,n=t.positions,o=t.optionsPositions,s=t.quantity,a=t.turfUrl;importScripts(a);var r=[];switch(e){case 1:var l=turf.lineString(n[0]),c=turf.lineChunk(l,i/1e3,{units:"kilometers"});r.push({lng:c.features[0].geometry.coordinates[0][0],lat:c.features[0].geometry.coordinates[0][1]});for(var p=0;pthis.options.height&&(o=this.options.positions[s].alt);n[0].length>2?(n[0].push([this.options.positions[0].lng,this.options.positions[0].lat]),r=turf.polygon(n),l=turf.pointOnFeature(r),this.center={lng:l.geometry.coordinates[0],lat:l.geometry.coordinates[1]}):2==n[0].length?this.center={lng:(this.options.positions[0].lng+this.options.positions[1].lng)/2,lat:(this.options.positions[0].lat+this.options.positions[1].lat)/2}:this.center={lng:this.options.positions[0].lng,lat:this.options.positions[0].lat},c=[],this.options.height||0===this.options.height||(this.options.height=o),p=document.scripts,h="",d=0;case 14:if(!(dthis.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
        '+this.options.attribute.link.content[s].url+'
        \n
        \n \n \n
        \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0&&void 0!==p[0]&&p[0],this.originalOptions=this.deepCopyObj(this.options),this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=36;break}return this._element_style=document.createElement("style"),this._element_style.type="text/css",this._element_style.setAttribute("data-name","YJ_style_dialog"),this._element_style.innerHTML="\n .YJ-custom-base-dialog>.content {\n width: 600px;\n }\n .YJ-custom-base-dialog>.content>div>.row .col {\n margin: 0 10px;\n }\n .YJ-custom-base-dialog>.content>div>.row .col:first-child {\n margin-left: 0;\n }\n .YJ-custom-base-dialog>.content>div>.row .col:last-child {\n margin-right: 0;\n }\n .YJ-custom-base-dialog>.content>div>.row .label {\n flex: 0 0 74px;\n }\n .YJ-custom-base-dialog>.content .DIV-cy-tab-content-pane .input-select {\n width: 100px;\n }\n",t.next=12,new rn(this.sdk,this.originalOptions,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(t){u.name=u.options.name||"未命名对象",u.originalOptions=u.deepCopyObj(u.options),u._DialogObject.close(),u.Dialog.confirmCallBack&&u.Dialog.confirmCallBack(u.originalOptions)},resetCallBack:function(){u.reset(),u.Dialog.resetCallBack&&u.Dialog.resetCallBack()},removeCallBack:function(){u.Dialog.removeCallBack&&u.Dialog.removeCallBack()},closeCallBack:function(){u.reset(),u.positionEditing=!1,u.ControllerObject&&u.ControllerObject.destroy(),u.Dialog.closeCallBack&&u.Dialog.closeCallBack()},showCallBack:function(t){u.show=t,u.Dialog.showCallBack&&u.Dialog.showCallBack()},translationalCallBack:function(){u.positionEditing?u.positionEditing=!1:u.positionEditing=!0}},!0);case 12:this._DialogObject=t.sent,document.getElementsByTagName("head")[0].appendChild(this._element_style),(i=document.createElement("div")).innerHTML=qc(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera,new kn("model-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){u.color=t},clear:function(){u.color="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("label_color")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){u.labelColor=t},clear:function(){u.labelColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("line_color")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){u.lineColor=t},clear:function(){u.lineColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){u.labelBackgroundColorStart=t},clear:function(){u.labelBackgroundColorStart="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){u.labelBackgroundColorEnd=t},clear:function(){u.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),c=i.getElementsByTagName("*"),this._EventBinding.on(this,c),this._elms=this._EventBinding.element,this._elms.color=[n],this._elms.labelColor=[o],this._elms.lineColor=[s],this._elms.labelBackgroundColorStart=[r],this._elms.labelBackgroundColorEnd=[l],setTimeout((function(){u.attributeLink=u.options.attribute.link.content,u.cameraSelect&&u.cameraSelect();var t=u.attributeSelect,e=u._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=u._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],o=0;o3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6?arguments[6]:void 0;t=parseFloat(t),e=parseFloat(e),i=parseFloat(i),n=parseFloat(n),o=parseFloat(o),s=parseFloat(s),a=parseFloat(a),this.entity.rotate={x:n,y:o,z:s};var r=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(n)),l=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(s)),u=new Cesium.Cartesian3.fromDegrees(t,e,i);Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(u.x-this.entity._center.x,u.y-this.entity._center.y,u.z-this.entity._center.z)),Cesium.Matrix4.fromRotationTranslation(r),Cesium.Matrix4.fromRotationTranslation(l),Cesium.Matrix4.fromRotationTranslation(c),new Cesium.Matrix4;Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(u.x-this.entity._center.x,u.y-this.entity._center.y,u.z-this.entity._center.z),this.entity.modelMatrix),this.ControllerObject.update(),this.entity.position=new Cesium.Cartesian3.fromDegrees(t,e,i)}},{key:"updateModelRotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;t=parseFloat(t),e=parseFloat(e),i=parseFloat(i),n=parseFloat(n),this.sdk.viewer.scene.primitives.remove(this.entity);var o=this.options.url;if(!o.startsWith("http")&&!o.includes(":")&&this.options.host){var s=new URL(o,this.options.host);o=s.href}for(var a=[],r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=ou(this,e,[t,n])).object={},i.options.host=i.options.host||h(),i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"layer"}},{key:"on",value:function(){return this.add()}},{key:"add",value:(n=o()(a.a.mark((function t(){var e,i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.requestResource();case 2:return e=t.sent,t.next=5,e.text();case 5:if(i=t.sent,i=JSON.parse(i),![0,200].includes(i.code)){t.next=11;break}return t.abrupt("return",this.loadLayer(i.data));case 11:return t.abrupt("return",new Promise((function(t,e){e(i.msg||i.message)})));case 12:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"loadLayer",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.object=nu({},e),i="",this.object.url.startsWith("http")?i=this.object.url:this.options.host?(n=new URL(this.object.url,this.options.host),i=n.href):i=this.object.url,o={url:i,mimmumLevel:this.object.minimumLevel,maximumLevel:this.object.maximumLevel,rectangle:new Cesium.Rectangle(Cesium.Math.toRadians(this.object.west),Cesium.Math.toRadians(this.object.south),Cesium.Math.toRadians(this.object.east),Cesium.Math.toRadians(this.object.north))},t.t0=this.object.scheme_name,t.next="amapMercatorTilingScheme"===t.t0?7:""===t.t0?9:10;break;case 7:return o.tilingScheme=this.amapMercatorTilingScheme(),t.abrupt("break",12);case 9:return t.abrupt("break",12);case 10:return o.tilingScheme=new Cesium[this.object.scheme_name],t.abrupt("break",12);case 12:t.t1=this.object.load_method,t.next="tms"===t.t1?15:"xyz"===t.t1?24:"wmts"===t.t1?26:28;break;case 15:if(this.object.url.endsWith("tilemapresource.xml")&&((r=this.object.url.split("/")).pop(),l=r.join("/"),o.url=l),!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=22;break}return t.next=19,Cesium.TileMapServiceImageryProvider.fromUrl(o.url,o);case 19:s=t.sent,t.next=23;break;case 22:s=new Cesium.TileMapServiceImageryProvider(o);case 23:return t.abrupt("break",30);case 24:return s=new Cesium.UrlTemplateImageryProvider(o),t.abrupt("break",30);case 26:return s=new Cesium.WebMapTileServiceImageryProvider(o),t.abrupt("break",30);case 28:return s=new Cesium.UrlTemplateImageryProvider(o),t.abrupt("break",30);case 30:if(this.sdk&&this.sdk.viewer){t.next=32;break}return t.abrupt("return");case 32:for(this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(s,this.options.layer_index):this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(s),this.entity._id=this.options.id,c=0;c1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=au(this,e,[t,n])).loadLayer(),i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"layer"}},{key:"loadLayer",value:function(t){var e,i={url:this.options.url,mimmumLevel:this.options.minimumLevel||0,maximumLevel:this.options.maximumLevel||20,subdomains:["0","1","2","3","4","5","6","7"]};e=new Cesium.UrlTemplateImageryProvider(i),this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(e,this.options.layer_index):this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(e),this.entity._id=this.options.id;for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function pu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return k()(this,e),du(i=hu(this,e,[t,n]),gu,void 0),i.object=JSON.parse(JSON.stringify(o)),i.object.west||(i.object.west=40),i.object.south||(i.object.south=30),i.object.east||(i.object.east=160),i.object.north||(i.object.north=50),i.show=i.options.show,i._elms={},i.Dialog=s,i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"terrain"}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"show",get:function(){return!(this.sdk.viewer.scene.terrainProvider instanceof Cesium.EllipsoidTerrainProvider)},set:function(t){t?this.open():this.close()}},{key:"open",value:(r=o()(a.a.mark((function t(){var e,i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.options.url){t.next=4;break}return t.abrupt("return",this.loadTerrain({url:this.options.url}));case 4:return t.next=6,this.requestResource();case 6:return e=t.sent,t.next=9,e.text();case 9:if(i=t.sent,i=JSON.parse(i),![0,200].includes(i.code)){t.next=19;break}if(!i.data.url.length){t.next=16;break}return t.abrupt("return",this.loadTerrain(i.data));case 16:return t.abrupt("return",new Promise((function(t,e){e("资源不存在")})));case 17:t.next=20;break;case 19:return t.abrupt("return",new Promise((function(t,e){e(i.msg||i.message)})));case 20:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"close",value:function(){var t=this;this.sdk.viewer.scene.terrainProvider=new Cesium.EllipsoidTerrainProvider({});for(var e=0;e=107)){t.next=9;break}return t.next=6,Cesium.CesiumTerrainProvider.fromUrl(n);case 6:this.terrainProvider=t.sent,t.next=10;break;case 9:this.terrainProvider=new Cesium.CesiumTerrainProvider({url:n});case 10:if(this.sdk&&this.sdk.viewer){t.next=12;break}return t.abrupt("return");case 12:this.sdk.viewer.terrainProvider=this.terrainProvider,clearTimeout(fu(gu,this)),mu(gu,this,setTimeout((function(){clearTimeout(fu(gu,s)),s.terrainProvider.readyPromise.then((function(){var t,e=uu(s.sdk.entityMap);try{for(e.s();!(t=e.n()).done;){var i=y()(t.value,2),n=(i[0],i[1]);"BillboardObject"!==n.type||1!=n.heightMode&&3!=n.heightMode?n.label&&(n.label.show=n.label.show):n.updateHeight()}}catch(t){e.e(t)}finally{e.f()}}))}),1e3)),se(this.sdk,this.options.id);case 16:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"remove",value:function(){this.close()}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.length>0&&void 0!==u[0]?u[0]:3,!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=cu({},this.options.position):this.options.positions?l=cu({},this.options.positions[0]):this.options.center?l=cu({},this.options.center):this.options.start?l=cu({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i,duration:e}),t.next=27;break;case 25:c=new Cesium.Rectangle(Cesium.Math.toRadians(this.object.west),Cesium.Math.toRadians(this.object.south),Cesium.Math.toRadians(this.object.east),Cesium.Math.toRadians(this.object.north)),this.sdk.viewer.camera.flyTo({destination:c,duration:e});case 27:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"setDefaultValue",value:function(){var t,i,n,o,s;(t=e,i="setDefaultValue",n=this,o=3,s=ba()(nn()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),this.options.host=this.options.host||h(),this.options.url=this.options.url||""}},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o=this,s=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s.length>0&&void 0!==s[0]&&s[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),t.next=5,new rn(this.sdk,this.options,{title:"地形属性",left:"180px",top:"100px",confirmCallBack:function(t){o.name=o.name.trim(),o.name||(o.name="未命名对象"),o.originalOptions=o.deepCopyObj(o.options),o._DialogObject.close();var e=o.deepCopyObj(o.options);e.host="",o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(e)},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()}},!0);case 5:this._DialogObject=t.sent,(e=document.createElement("div")).style.width="300px",i='\n \n
        \n
        \n
        \n 名称:\n \n
        \n
        \n
        \n ',e.innerHTML=i,(n=e.getElementsByClassName("name")[0]).value=this.name,n.addEventListener("input",(function(){o.name=n.value})),this._DialogObject.contentAppChild(e),this._elms.name=[n];case 15:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}]);var i,n,s,r}(Al);function bu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Cu(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Cu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Cu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Eu(this,e,[t,i])).options.url=i.url,n.options.startColor=i.startColor||"#ff0000",n.options.endColor=i.endColor||"#fff000",n.options.startScale=i.startScale||.5,n.options.endScale=i.endScale||2,n.options.minimumParticleLife=i.minimumParticleLife||1,n.options.maximumParticleLife=i.maximumParticleLife||2,n.options.minimumSpeed=i.minimumSpeed||1,n.options.maximumSpeed=i.maximumSpeed||30,n.options.emissionRate=i.emissionRate||60,n.options.particleSize=i.particleSize||10,n.options.show=!1!==i.show,n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n._elms={},n.previous={positions:{lng:n.options.lng,lat:n.options.lat,alt:n.options.alt}},n.Dialog=o,n.event=new X(n.sdk),n}return sn()(e,t),_()(e,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;this.isShowView&&e||(this.options.show=t),this.showView&&3!=this.showView&&e?(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=!1),this.options.label&&this.options.label.show&&(this.label.show=!1)):(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.originalOptions=this.deepCopyObj(this.options),e=this.sdk.viewer.scene,i=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),n=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(i),o=Cesium.Transforms.eastNorthUpToFixedFrame(n),Cesium.Matrix4.multiplyByScale(o,new Cesium.Cartesian3(1,1,1),o),s=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=e.primitives.add(new Cesium.ParticleSystem({show:!(s>=1e7)&&this.options.show,image:this.options.url||this.getSourceRootPath()+"/img/particlesystem/smoke.png",startColor:Cesium.Color.fromCssColorString(this.options.startColor),endColor:Cesium.Color.fromCssColorString(this.options.endColor),startScale:this.options.startScale,endScale:this.options.endScale,minimumParticleLife:this.options.minimumParticleLife,maximumParticleLife:this.options.maximumParticleLife,minimumSpeed:this.options.minimumSpeed,maximumSpeed:this.options.maximumSpeed,minimumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),maximumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),sizeInMeters:!0,emissionRate:this.options.emissionRate,lifetime:.5,loop:!0,emitter:new Cesium.ConeEmitter(Cesium.Math.toRadians(30)),modelMatrix:o,updateCallback:function(t){t._billboard.id=r.options.id}})),this.particleSystem.id=this.options.id,this.entity=this.particleSystem,this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},Pe(this.sdk,this.options.id),this.options.show&&Kt(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(r.entity&&r.show){var t=r.sdk.viewer.camera.positionCartographic.height;r.entity.show=!(t>=1e7)}}));case 14:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=_u({},this.options.position):this.options.positions?l=_u({},this.options.positions[0]):this.options.center?l=_u({},this.options.center):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=26;break;case 25:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,this.options.alt+500),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(t){var e=this;this.options.startColor=t,this.particleSystem.startColor=Cesium.Color.fromCssColorString(t),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.startColor=t},clear:function(){e.startColor="rgba(255,255,255,1)"}});e._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(t){var e=this;this.options.endColor=t,this.particleSystem.endColor=Cesium.Color.fromCssColorString(t),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.endColor=t},clear:function(){e.endColor="rgba(255,255,255,1)"}});e._elms.endColor[n]=o}))}},{key:"minimumSpeed",get:function(){return this.options.minimumSpeed},set:function(t){this.options.minimumSpeed=t,this.particleSystem.minimumSpeed=t,this._elms.minimumSpeed&&this._elms.minimumSpeed.forEach((function(e){e.value=t}))}},{key:"maximumSpeed",get:function(){return this.options.maximumSpeed},set:function(t){this.options.maximumSpeed=t,this.particleSystem.maximumSpeed=t,this._elms.maximumSpeed&&this._elms.maximumSpeed.forEach((function(e){e.value=t}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(t){this.options.minimumParticleLife=t,this.particleSystem.minimumParticleLife=t,this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(e){e.value=t}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(t){this.options.maximumParticleLife=t,this.particleSystem.maximumParticleLife=t,this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(e){e.value=t}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(t){this.options.startScale=t,this.particleSystem.startScale=t,this._elms.startScale&&this._elms.startScale.forEach((function(e){e.value=t}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(t){this.options.endScale=t,this.particleSystem.endScale=t,this._elms.endScale&&this._elms.endScale.forEach((function(e){e.value=t}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(t){this.options.emissionRate=t,this.particleSystem.emissionRate=t,this._elms.emissionRate&&this._elms.emissionRate.forEach((function(e){e.value=t}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(t){this.options.particleSize=t,this.particleSystem.minimumImageSize=new Cesium.Cartesian2(t,t),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(t,t),this._elms.particleSize&&this._elms.particleSize.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.alt},set:function(t){this.options.alt=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"edit",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r=this,l=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l.length>0&&void 0!==l[0]&&l[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=21;break}return t.next=7,new rn(this.sdk,this.originalOptions,{title:"火焰属性",left:"180px",top:"100px",confirmCallBack:function(t){r.name=r.name.trim(),r.name||(r.name="未命名对象"),r.originalOptions=r.deepCopyObj(r.options),r._DialogObject.close(),r.Dialog.confirmCallBack&&r.Dialog.confirmCallBack(r.originalOptions),Pe(r.sdk,r.options.id),se(r.sdk,r.options.id)},resetCallBack:function(){r.reset(),r.Dialog.resetCallBack&&r.Dialog.resetCallBack()},removeCallBack:function(){r.Dialog.removeCallBack&&r.Dialog.removeCallBack()},closeCallBack:function(){r.reset(),r.positionEditing=!1,r.Dialog.closeCallBack&&r.Dialog.closeCallBack()},showCallBack:function(t){r.show=t,r.Dialog.showCallBack&&r.Dialog.showCallBack()},translationalCallBack:function(){r.positionEditing=!r.positionEditing}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(i=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 经度\n \n
        \n
        \n 纬度\n \n
        \n
        \n
        \n
        \n 高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n 起始颜色\n
        \n
        \n
        \n 结束颜色\n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n 最小初速度\n \n
        \n
        \n
        \n
        \n 最大初速度\n \n
        \n
        \n
        \n
        \n
        \n
        \n 最小存在时间\n \n
        \n
        \n
        \n
        \n 最大存在时间\n \n
        \n
        \n
        \n
        \n
        \n
        \n 起始比例\n \n
        \n
        \n
        \n
        \n 结束比例\n \n
        \n
        \n
        \n
        \n
        \n
        \n 发射速率(个/秒)\n \n
        \n
        \n
        \n
        \n 尺寸(像素)\n \n
        \n
        \n
        \n
        \n \n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.startColor=t},clear:function(){r.startColor="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.endColor=t},clear:function(){r.endColor="rgba(255,255,255,1)"}}),s=i.getElementsByTagName("*"),ku.on(this,s),this._elms=ku.element,this._elms.startColor=[n],this._elms.endColor=[o],t.next=21;break;case 21:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.startColor=this.originalOptions.startColor,this.endColor=this.originalOptions.endColor,this.minimumSpeed=this.originalOptions.minimumSpeed,this.maximumSpeed=this.originalOptions.maximumSpeed,this.minimumParticleLife=this.originalOptions.minimumParticleLife,this.maximumParticleLife=this.originalOptions.maximumParticleLife,this.startScale=this.originalOptions.startScale,this.endScale=this.originalOptions.endScale,this.emissionRate=this.originalOptions.emissionRate,this.particleSize=this.originalOptions.particleSize,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.alt=this.originalOptions.alt,function(t){Le.apply(this,arguments)}(this.entity))}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Su(e,"remove",this,3)([]),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,!0===t){var i;this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:_u({},this.entity.position)},this.event.mouse_move((function(t,n){i=t.endPosition;var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(e.options.lng,e.options.lat,e.options.alt),a=e.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);e.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),e._elms.lng&&e._elms.lng.forEach((function(t){t.value=e.options.lng})),e._elms.lat&&e._elms.lat.forEach((function(t){t.value=e.options.lat})),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.alt})),e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,n){if(!i||i.x!==t.position.x||i.y!==t.position.y-2){var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt}e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:_u({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.lng=t.lng,e.options.lat=t.lat,e.options.alt=t.alt,e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:_u({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))}else{if(this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){}))),this.tip&&this.tip.destroy(),!this.sdk||!this.sdk.viewer||!this.entity)return;this.options.lng=this.entity.position.lng,this.options.lat=this.entity.position.lat,this.options.alt=this.entity.position.alt;var n=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e.options.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e.options.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.alt}))}}},{key:"flicker",value:function(){}}]);var i,n,s,r}(Wn);function Pu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Mu(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Mu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Mu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Lu(this,e,[t,i])).options.url=i.url,n.options.startColor=i.startColor||"#00000000",n.options.endColor=i.endColor||"#0000001a",n.options.startScale=i.startScale||.1,n.options.endScale=i.endScale||10,n.options.minimumParticleLife=i.minimumParticleLife||6,n.options.maximumParticleLife=i.maximumParticleLife||7,n.options.minimumSpeed=i.minimumSpeed||10,n.options.maximumSpeed=i.maximumSpeed||15,n.options.emissionRate=i.emissionRate||28,n.options.particleSize=i.particleSize||2,n.options.show=!1!==i.show,n._elms={},n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n.previous={positions:{lng:n.options.lng,lat:n.options.lat,alt:n.options.alt}},n.Dialog=o,n.event=new X(n.sdk),n}return sn()(e,t),_()(e,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;this.isShowView&&e||(this.options.show=t),this.showView&&3!=this.showView&&e?(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=!1),this.options.label&&this.options.label.show&&(this.label.show=!1)):(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.originalOptions=this.deepCopyObj(this.options),e=this.sdk.viewer.scene,i=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),n=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(i),o=Cesium.Transforms.eastNorthUpToFixedFrame(n),Cesium.Matrix4.multiplyByScale(o,new Cesium.Cartesian3(1,1,1),o),s=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=e.primitives.add(new Cesium.ParticleSystem({show:!(s>=1e7)&&this.options.show,image:this.options.url||this.getSourceRootPath()+"/img/particlesystem/smoke.png",startColor:Cesium.Color.fromCssColorString(this.options.startColor),endColor:Cesium.Color.fromCssColorString(this.options.endColor),startScale:this.options.startScale,endScale:this.options.endScale,minimumParticleLife:this.options.minimumParticleLife,maximumParticleLife:this.options.maximumParticleLife,minimumSpeed:this.options.minimumSpeed,maximumSpeed:this.options.maximumSpeed,minimumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),maximumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),sizeInMeters:!0,emissionRate:this.options.emissionRate,lifetime:.5,loop:!0,emitter:new Cesium.CircleEmitter(.2),performance:!1,modelMatrix:o,updateCallback:function(t){t._billboard.id=r.options.id}})),this.particleSystem.id=this.options.id,this.entity=this.particleSystem,this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},Pe(this.sdk,this.options.id),this.options.show&&Kt(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(r.entity&&r.show){var t=r.sdk.viewer.camera.positionCartographic.height;r.entity.show=!(t>=1e7)}}));case 14:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Bu({},this.options.position):this.options.positions?l=Bu({},this.options.positions[0]):this.options.center?l=Bu({},this.options.center):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=26;break;case 25:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,this.options.alt+500),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(t){var e=this;this.options.startColor=t,this.particleSystem.startColor=Cesium.Color.fromCssColorString(t),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.startColor=t},clear:function(){e.startColor="rgba(255,255,255,1)"}});e._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(t){var e=this;this.options.endColor=t,this.particleSystem.endColor=Cesium.Color.fromCssColorString(t),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.endColor=t},clear:function(){e.endColor="rgba(255,255,255,1)"}});e._elms.endColor[n]=o}))}},{key:"minimumSpeed",get:function(){return this.options.minimumSpeed},set:function(t){this.options.minimumSpeed=t,this.particleSystem.minimumSpeed=t,this._elms.minimumSpeed&&this._elms.minimumSpeed.forEach((function(e){e.value=t}))}},{key:"maximumSpeed",get:function(){return this.options.maximumSpeed},set:function(t){this.options.maximumSpeed=t,this.particleSystem.maximumSpeed=t,this._elms.maximumSpeed&&this._elms.maximumSpeed.forEach((function(e){e.value=t}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(t){this.options.minimumParticleLife=t,this.particleSystem.minimumParticleLife=t,this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(e){e.value=t}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(t){this.options.maximumParticleLife=t,this.particleSystem.maximumParticleLife=t,this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(e){e.value=t}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(t){this.options.startScale=t,this.particleSystem.startScale=t,this._elms.startScale&&this._elms.startScale.forEach((function(e){e.value=t}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(t){this.options.endScale=t,this.particleSystem.endScale=t,this._elms.endScale&&this._elms.endScale.forEach((function(e){e.value=t}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(t){this.options.emissionRate=t,this.particleSystem.emissionRate=t,this._elms.emissionRate&&this._elms.emissionRate.forEach((function(e){e.value=t}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(t){this.options.particleSize=t,this.particleSystem.minimumImageSize=new Cesium.Cartesian2(t,t),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(t,t),this._elms.particleSize&&this._elms.particleSize.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.alt},set:function(t){this.options.alt=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"edit",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r=this,l=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l.length>0&&void 0!==l[0]&&l[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=21;break}return t.next=7,new rn(this.sdk,this.originalOptions,{title:"烟雾属性",left:"180px",top:"100px",confirmCallBack:function(t){r.name=r.name.trim(),r.name||(r.name="未命名对象"),r.originalOptions=r.deepCopyObj(r.options),r._DialogObject.close(),r.Dialog.confirmCallBack&&r.Dialog.confirmCallBack(r.originalOptions),Pe(r.sdk,r.options.id),se(r.sdk,r.options.id)},resetCallBack:function(){r.reset(),r.Dialog.resetCallBack&&r.Dialog.resetCallBack()},removeCallBack:function(){r.Dialog.removeCallBack&&r.Dialog.removeCallBack()},closeCallBack:function(){r.reset(),r.positionEditing=!1,r.Dialog.closeCallBack&&r.Dialog.closeCallBack()},showCallBack:function(t){r.show=t,r.Dialog.showCallBack&&r.Dialog.showCallBack()},translationalCallBack:function(){r.positionEditing=!r.positionEditing}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(i=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 经度\n \n
        \n
        \n 纬度\n \n
        \n
        \n
        \n
        \n 高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n 起始颜色\n
        \n
        \n
        \n 结束颜色\n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n 最小初速度\n \n
        \n
        \n
        \n
        \n 最大初速度\n \n
        \n
        \n
        \n
        \n
        \n
        \n 最小存在时间\n \n
        \n
        \n
        \n
        \n 最大存在时间\n \n
        \n
        \n
        \n
        \n
        \n
        \n 起始比例\n \n
        \n
        \n
        \n
        \n 结束比例\n \n
        \n
        \n
        \n
        \n
        \n
        \n 发射速率(个/秒)\n \n
        \n
        \n
        \n
        \n 尺寸(像素)\n \n
        \n
        \n
        \n
        \n \n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.startColor=t},clear:function(){r.startColor="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.endColor=t},clear:function(){r.endColor="rgba(255,255,255,1)"}}),s=i.getElementsByTagName("*"),Tu.on(this,s),this._elms=Tu.element,this._elms.startColor=[n],this._elms.endColor=[o],t.next=21;break;case 21:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.startColor=this.originalOptions.startColor,this.endColor=this.originalOptions.endColor,this.minimumSpeed=this.originalOptions.minimumSpeed,this.maximumSpeed=this.originalOptions.maximumSpeed,this.minimumParticleLife=this.originalOptions.minimumParticleLife,this.maximumParticleLife=this.originalOptions.maximumParticleLife,this.startScale=this.originalOptions.startScale,this.endScale=this.originalOptions.endScale,this.emissionRate=this.originalOptions.emissionRate,this.particleSize=this.originalOptions.particleSize,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.alt=this.originalOptions.alt)}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Au(e,"remove",this,3)([]),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,!0===t){var i;this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:Bu({},this.entity.position)},this.event.mouse_move((function(t,n){i=t.endPosition;var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(e.options.lng,e.options.lat,e.options.alt),a=e.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);e.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),e._elms.lng&&e._elms.lng.forEach((function(t){t.value=e.options.lng})),e._elms.lat&&e._elms.lat.forEach((function(t){t.value=e.options.lat})),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.alt})),e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,n){if(!i||i.x!==t.position.x||i.y!==t.position.y-2){var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt}e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Bu({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.lng=t.lng,e.options.lat=t.lat,e.options.alt=t.alt,e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Bu({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))}else{if(this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),!this.sdk||!this.sdk.viewer||!this.entity)return;this.options.lng=this.entity.position.lng,this.options.lat=this.entity.position.lat,this.options.alt=this.entity.position.alt;var n=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e.options.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e.options.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.alt}))}}},{key:"flicker",value:function(){}}]);var i,n,s,r}(Wn);function Iu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ru(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ru(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ru(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Gu(this,e,[t,i])).options.url=i.url,n.options.startColor=i.startColor||"#c1f7f24d",n.options.endColor=i.endColor||"#ffffff00",n.options.startScale=i.startScale||1,n.options.endScale=i.endScale||20,n.options.minimumParticleLife=i.minimumParticleLife||6,n.options.maximumParticleLife=i.maximumParticleLife||7,n.options.minimumSpeed=i.minimumSpeed||9,n.options.maximumSpeed=i.maximumSpeed||9.5,n.options.emissionRate=i.emissionRate||20,n.options.particleSize=i.particleSize||.5,n.options.show=!1!==i.show,n._elms={},n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n.previous={positions:{lng:n.options.lng,lat:n.options.lat,alt:n.options.alt}},n.Dialog=o,n.event=new X(n.sdk),n}return sn()(e,t),_()(e,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;this.isShowView&&e||(this.options.show=t),this.showView&&3!=this.showView&&e?(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=!1),this.options.label&&this.options.label.show&&(this.label.show=!1)):(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:p=function(){var t=Cesium.HeadingPitchRoll.fromDegrees(0,0,0),e=new Cesium.TranslationRotationScale;//!!!发射粒子的方向 + */!function(){"use strict";var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD=__webpack_require__(33),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t){return function(e){return new Md5(!0).update(e)[t]()}},createMethod=function(){var t=createOutputMethod("hex");NODE_JS&&(t=nodeWrap(t)),t.create=function(){return new Md5},t.update=function(e){return t.create().update(e)};for(var e=0;e>2]|=t[s]<>6,l[o++]=128|63&n):n<55296||n>=57344?(l[o++]=224|n>>12,l[o++]=128|n>>6&63,l[o++]=128|63&n):(n=65536+((1023&n)<<10|1023&t.charCodeAt(++s)),l[o++]=240|n>>18,l[o++]=128|n>>12&63,l[o++]=128|n>>6&63,l[o++]=128|63&n);else for(o=this.start;s>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(r[o>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=64?(this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[e>>2]|=EXTRA[3&e],e>=56&&(this.hashed||this.hash(),t[0]=t[16],t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.bytes<<3,t[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var t,e,i,n,o,s,a=this.blocks;this.first?e=((e=((t=((t=a[0]-680876937)<<7|t>>>25)-271733879<<0)^(i=((i=(-271733879^(n=((n=(-1732584194^2004318071&t)+a[1]-117830708)<<12|n>>>20)+t<<0)&(-271733879^t))+a[2]-1126478375)<<17|i>>>15)+n<<0)&(n^t))+a[3]-1316259209)<<22|e>>>10)+i<<0:(t=this.h0,e=this.h1,i=this.h2,e=((e+=((t=((t+=((n=this.h3)^e&(i^n))+a[0]-680876936)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[1]-389564586)<<12|n>>>20)+t<<0)&(t^e))+a[2]+606105819)<<17|i>>>15)+n<<0)&(n^t))+a[3]-1044525330)<<22|e>>>10)+i<<0),e=((e+=((t=((t+=(n^e&(i^n))+a[4]-176418897)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[5]+1200080426)<<12|n>>>20)+t<<0)&(t^e))+a[6]-1473231341)<<17|i>>>15)+n<<0)&(n^t))+a[7]-45705983)<<22|e>>>10)+i<<0,e=((e+=((t=((t+=(n^e&(i^n))+a[8]+1770035416)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[9]-1958414417)<<12|n>>>20)+t<<0)&(t^e))+a[10]-42063)<<17|i>>>15)+n<<0)&(n^t))+a[11]-1990404162)<<22|e>>>10)+i<<0,e=((e+=((t=((t+=(n^e&(i^n))+a[12]+1804603682)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[13]-40341101)<<12|n>>>20)+t<<0)&(t^e))+a[14]-1502002290)<<17|i>>>15)+n<<0)&(n^t))+a[15]+1236535329)<<22|e>>>10)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[1]-165796510)<<5|t>>>27)+e<<0)^e))+a[6]-1069501632)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[11]+643717713)<<14|i>>>18)+n<<0)^n))+a[0]-373897302)<<20|e>>>12)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[5]-701558691)<<5|t>>>27)+e<<0)^e))+a[10]+38016083)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[15]-660478335)<<14|i>>>18)+n<<0)^n))+a[4]-405537848)<<20|e>>>12)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[9]+568446438)<<5|t>>>27)+e<<0)^e))+a[14]-1019803690)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[3]-187363961)<<14|i>>>18)+n<<0)^n))+a[8]+1163531501)<<20|e>>>12)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[13]-1444681467)<<5|t>>>27)+e<<0)^e))+a[2]-51403784)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[7]+1735328473)<<14|i>>>18)+n<<0)^n))+a[12]-1926607734)<<20|e>>>12)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[5]-378558)<<4|t>>>28)+e<<0))+a[8]-2022574463)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[11]+1839030562)<<16|i>>>16)+n<<0))+a[14]-35309556)<<23|e>>>9)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[1]-1530992060)<<4|t>>>28)+e<<0))+a[4]+1272893353)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[7]-155497632)<<16|i>>>16)+n<<0))+a[10]-1094730640)<<23|e>>>9)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[13]+681279174)<<4|t>>>28)+e<<0))+a[0]-358537222)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[3]-722521979)<<16|i>>>16)+n<<0))+a[6]+76029189)<<23|e>>>9)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[9]-640364487)<<4|t>>>28)+e<<0))+a[12]-421815835)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[15]+530742520)<<16|i>>>16)+n<<0))+a[2]-995338651)<<23|e>>>9)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[0]-198630844)<<6|t>>>26)+e<<0)|~i))+a[7]+1126891415)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[14]-1416354905)<<15|i>>>17)+n<<0)|~t))+a[5]-57434055)<<21|e>>>11)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[12]+1700485571)<<6|t>>>26)+e<<0)|~i))+a[3]-1894986606)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[10]-1051523)<<15|i>>>17)+n<<0)|~t))+a[1]-2054922799)<<21|e>>>11)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[8]+1873313359)<<6|t>>>26)+e<<0)|~i))+a[15]-30611744)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[6]-1560198380)<<15|i>>>17)+n<<0)|~t))+a[13]+1309151649)<<21|e>>>11)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[4]-145523070)<<6|t>>>26)+e<<0)|~i))+a[11]-1120210379)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[2]+718787259)<<15|i>>>17)+n<<0)|~t))+a[9]-343485551)<<21|e>>>11)+i<<0,this.first?(this.h0=t+1732584193<<0,this.h1=e-271733879<<0,this.h2=i-1732584194<<0,this.h3=n+271733878<<0,this.first=!1):(this.h0=this.h0+t<<0,this.h1=this.h1+e<<0,this.h2=this.h2+i<<0,this.h3=this.h3+n<<0)},Md5.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,i=this.h2,n=this.h3;return HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,i=this.h2,n=this.h3;return[255&t,t>>8&255,t>>16&255,t>>24&255,255&e,e>>8&255,e>>16&255,e>>24&255,255&i,i>>8&255,i>>16&255,i>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(16),e=new Uint32Array(t);return e[0]=this.h0,e[1]=this.h1,e[2]=this.h2,e[3]=this.h3,t},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var t,e,i,n="",o=this.array(),s=0;s<15;)t=o[s++],e=o[s++],i=o[s++],n+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[63&(t<<4|e>>>4)]+BASE64_ENCODE_CHAR[63&(e<<2|i>>>6)]+BASE64_ENCODE_CHAR[63&i];return t=o[s],n+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[t<<4&63]+"=="};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}()}).call(this,__webpack_require__(31),__webpack_require__(32))},function(t,e,i){var n=i(5),o=i(15),s=i(34),a=i(35);function r(e){var i="function"==typeof Map?new Map:void 0;return t.exports=r=function(t){if(null===t||!s(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(t))return i.get(t);i.set(t,e)}function e(){return a(t,arguments,n(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),o(e,t)},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){t.exports=i(39)},function(t,e,i){var n=i(11).default;function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=o=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var e,i={},s=Object.prototype,a=s.hasOwnProperty,r=Object.defineProperty||function(t,e,i){t[e]=i.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",p=l.toStringTag||"@@toStringTag";function h(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(e){h=function(t,e,i){return t[e]=i}}function d(t,e,i,n){var o=e&&e.prototype instanceof b?e:b,s=Object.create(o.prototype),a=new N(n||[]);return r(s,"_invoke",{value:P(t,i,a)}),s}function m(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}i.wrap=d;var f="suspendedStart",v="executing",g="completed",y={};function b(){}function C(){}function w(){}var k={};h(k,c,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(B([])));_&&_!==s&&a.call(_,c)&&(k=_);var E=w.prototype=b.prototype=Object.create(k);function S(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function i(o,s,r,l){var c=m(t[o],t,s);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==n(p)&&a.call(p,"__await")?e.resolve(p.__await).then((function(t){i("next",t,r,l)}),(function(t){i("throw",t,r,l)})):e.resolve(p).then((function(t){u.value=t,r(u)}),(function(t){return i("throw",t,r,l)}))}l(c.arg)}var o;r(this,"_invoke",{value:function(t,n){function s(){return new e((function(e,o){i(t,n,e,o)}))}return o=o?o.then(s,s):s()}})}function P(t,i,n){var o=f;return function(s,a){if(o===v)throw Error("Generator is already running");if(o===g){if("throw"===s)throw a;return{value:e,done:!0}}for(n.method=s,n.arg=a;;){var r=n.delegate;if(r){var l=M(r,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=m(t,i,n);if("normal"===c.type){if(o=n.done?g:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.arg)}}}function M(t,i){var n=i.method,o=t.iterator[n];if(o===e)return i.delegate=null,"throw"===n&&t.iterator.return&&(i.method="return",i.arg=e,M(t,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var s=m(o,t.iterator,i.arg);if("throw"===s.type)return i.method="throw",i.arg=s.arg,i.delegate=null,y;var a=s.arg;return a?a.done?(i[t.resultName]=a.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,y):a:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function B(t){if(t||""===t){var i=t[c];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,s=function i(){for(;++o=0;--o){var s=this.tryEntries[o],r=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var l=a.call(s,"catchLoc"),c=a.call(s,"finallyLoc");if(l&&c){if(this.prev=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),T(i),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var o=n.arg;T(i)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:B(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),y}},i}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,o,s,a,r=[],l=!0,c=!1;try{if(s=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(r.push(n.value),r.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(c)throw o}}return r}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(11).default;t.exports=function(t,e){if("object"!=n(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var o=i.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(17);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){var i,n,o=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function r(t){if(i===setTimeout)return setTimeout(t,0);if((i===s||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:s}catch(t){i=s}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var l,c=[],u=!1,p=-1;function h(){u&&l&&(u=!1,l.length?c=l.concat(c):p=-1,c.length&&d())}function d(){if(!u){var t=r(h);u=!0;for(var e=c.length;e;){for(l=c,c=[];++p1)for(var i=1;i0&&void 0!==o[0]?o[0]:{},t.next=3,fetch((e.host||"")+"/yjearth4.0/api/v1/user/sign-in",{method:"post",body:JSON.stringify({username:e.username,password:e.password}),headers:{"Content-Type":"application/json"}});case 3:return i=t.sent,t.next=6,i.text();case 6:n=t.sent,0===(n=JSON.parse(n)).code&&(p(e.host),n.token?d(n.token):d(n.data.token));case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function p(t){localStorage.setItem(l,t||"")}function h(){return localStorage.getItem(l)||""}function d(t){localStorage.setItem(r,t)}function m(){return localStorage.getItem(r)}function f(){var t=document.querySelectorAll("script"),e="";return t.forEach((function(t){if(t.src.indexOf("YJEarth.min.js")>-1){var i=t.src.split("/");i.pop(),e=i.join("/")}})),e}var g=i(10),y=i.n(g),b=i(8),C=i.n(b),w=i(1),k=i.n(w),x=i(2),_=i.n(x);function E(t){document.addEventListener("keydown",M.bind(t),!1),document.addEventListener("keyup",O.bind(t),!1),t&&t.clock.onTick.addEventListener((function(){!function(t){if(!t||!t.scene||!t.scene.screenSpaceCameraController.enableTilt)return;var e=t.camera,i=t.scene.globe.ellipsoid.cartesianToCartographic(e.position).height,n=e.positionCartographic.height,o=i/20,s=o/5e5/Cesium.Math.toDegrees(e.pitch),a=n/100;S.moveForward&&(2==t.scene.mode?e.moveUp(a):e.rotate(e.right,-s));S.moveBackward&&(2==t.scene.mode?e.moveDown(a):e.rotate(e.right,s));S.moveLeft&&(2==t.scene.mode?e.moveLeft(a):e.rotate(e.up,-s));S.moveRight&&(2==t.scene.mode?e.moveRight(a):e.rotate(e.up,s));S.moveUp&&e.moveUp(o);S.moveDown&&e.moveDown(o);S.lookUp&&e.lookUp();S.lookDown&&e.lookDown();S.lookLeft&&e.lookLeft();S.lookRight&&e.lookRight();S.twistLeft&&e.twistLeft();S.twistRight&&e.twistRight();if(S.zoomIn){var r=i/2;r<1&&(r=0),e.zoomIn(r)}if(S.zoomOut){var l=i/2;i+i>=5e7&&(l=5e7-i),e.zoomOut(l)}}(t)}))}var S={moveForward:!1,moveBackward:!1,moveLeft:!1,moveRight:!1,moveUp:!1,moveDown:!1,lookUp:!1,lookDown:!1,lookLeft:!1,lookRight:!1,twistLeft:!1,twistRight:!1,zoomIn:!1,zoomOut:!1};function D(t){switch(t){case 87:return"moveForward";case 83:return"moveBackward";case 68:return"moveRight";case 65:return"moveLeft";case 81:return"moveUp";case 69:return"moveDown";case 38:return"lookUp";case 40:return"lookDown";case 37:return"lookLeft";case 39:return"lookRight";case 96:return"twistLeft";case 110:return"twistRight";case 107:return"zoomIn";case 109:return"zoomOut";default:return}}function M(t){var e;if("input"===(e=document.activeElement).tagName.toLowerCase()&&"checkbox"!==e.type||"textarea"===e.tagName.toLowerCase()||"textarea"===e.getAttribute("role"));else if(this.trackedEntity);else if(this._firstPersonView);else if(this._disableKeyboardEvent);else if(t.ctrlKey&&t.altKey){if("v"===t.key||"V"===t.key){var i=this.camera;this._CAMERA_SHORTCUT_VIEW={orientation:{heading:i.heading,pitch:i.pitch,roll:i.roll},position:{x:i.position.x,y:i.position.y,z:i.position.z}},localStorage.setItem("CAMERA_SHORTCUT_VIEW",JSON.stringify(this._CAMERA_SHORTCUT_VIEW))}if("f"===t.key||"F"===t.key){var n=localStorage.getItem("CAMERA_SHORTCUT_VIEW");this._CAMERA_SHORTCUT_VIEW=JSON.parse(n),this._CAMERA_SHORTCUT_VIEW&&this._CAMERA_SHORTCUT_VIEW.position&&this._CAMERA_SHORTCUT_VIEW.orientation&&this.camera.flyTo({destination:this._CAMERA_SHORTCUT_VIEW.position,orientation:this._CAMERA_SHORTCUT_VIEW.orientation})}}else{var o=D(t.keyCode);void 0!==o&&(S[o]=!0)}}function O(t){var e=D(t.keyCode);void 0!==e&&(S[e]=!1)}var T=i(11),N=i.n(T),B=i(6),L=i.n(B),A=i(20),j=i.n(A),I=[{name:"GCS_WGS_1984",epsg:"EPSG:4326",def:"+proj=longlat +datum=WGS84 +no_defs"},{name:"GCS_China_Geodetic_Coordinate_System_2000",epsg:"EPSG:4490",def:"+proj=longlat +ellps=GRS80 +no_defs"},{name:"WGS 84 / UTM zone 1N",epsg:"EPSG:32601",def:"+proj=utm +zone=1 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 2N",epsg:"EPSG:32602",def:"+proj=utm +zone=2 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 3N",epsg:"EPSG:32603",def:"+proj=utm +zone=3 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 4N",epsg:"EPSG:32604",def:"+proj=utm +zone=4 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 5N",epsg:"EPSG:32605",def:"+proj=utm +zone=5 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 6N",epsg:"EPSG:32606",def:"+proj=utm +zone=6 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 7N",epsg:"EPSG:32607",def:"+proj=utm +zone=7 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 8N",epsg:"EPSG:32608",def:"+proj=utm +zone=8 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 9N",epsg:"EPSG:32609",def:"+proj=utm +zone=9 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 10N",epsg:"EPSG:32610",def:"+proj=utm +zone=10 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 11N",epsg:"EPSG:32611",def:"+proj=utm +zone=11 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 12N",epsg:"EPSG:32612",def:"+proj=utm +zone=12 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 13N",epsg:"EPSG:32613",def:"+proj=utm +zone=13 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 14N",epsg:"EPSG:32614",def:"+proj=utm +zone=14 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 15N",epsg:"EPSG:32615",def:"+proj=utm +zone=15 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 16N",epsg:"EPSG:32616",def:"+proj=utm +zone=16 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 17N",epsg:"EPSG:32617",def:"+proj=utm +zone=17 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 18N",epsg:"EPSG:32618",def:"+proj=utm +zone=18 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 19N",epsg:"EPSG:32619",def:"+proj=utm +zone=19 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 20N",epsg:"EPSG:32620",def:"+proj=utm +zone=20 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 21N",epsg:"EPSG:32621",def:"+proj=utm +zone=21 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 22N",epsg:"EPSG:32622",def:"+proj=utm +zone=22 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 23N",epsg:"EPSG:32623",def:"+proj=utm +zone=23 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 24N",epsg:"EPSG:32624",def:"+proj=utm +zone=24 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 25N",epsg:"EPSG:32625",def:"+proj=utm +zone=25 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 26N",epsg:"EPSG:32626",def:"+proj=utm +zone=26 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 27N",epsg:"EPSG:32627",def:"+proj=utm +zone=27 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 28N",epsg:"EPSG:32628",def:"+proj=utm +zone=28 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 29N",epsg:"EPSG:32629",def:"+proj=utm +zone=29 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 30N",epsg:"EPSG:32630",def:"+proj=utm +zone=30 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 31N",epsg:"EPSG:32631",def:"+proj=utm +zone=31 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 32N",epsg:"EPSG:32632",def:"+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 33N",epsg:"EPSG:32633",def:"+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 34N",epsg:"EPSG:32634",def:"+proj=utm +zone=34 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 35N",epsg:"EPSG:32635",def:"+proj=utm +zone=35 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 36N",epsg:"EPSG:32636",def:"+proj=utm +zone=36 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 37N",epsg:"EPSG:32637",def:"+proj=utm +zone=37 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 38N",epsg:"EPSG:32638",def:"+proj=utm +zone=38 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 39N",epsg:"EPSG:32639",def:"+proj=utm +zone=39 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 40N",epsg:"EPSG:32640",def:"+proj=utm +zone=40 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 41N",epsg:"EPSG:32641",def:"+proj=utm +zone=41 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 42N",epsg:"EPSG:32642",def:"+proj=utm +zone=42 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 43N",epsg:"EPSG:32643",def:"+proj=utm +zone=43 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 44N",epsg:"EPSG:32644",def:"+proj=utm +zone=44 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 45N",epsg:"EPSG:32645",def:"+proj=utm +zone=45 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 46N",epsg:"EPSG:32646",def:"+proj=utm +zone=46 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 47N",epsg:"EPSG:32647",def:"+proj=utm +zone=47 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 48N",epsg:"EPSG:32648",def:"+proj=utm +zone=48 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 49N",epsg:"EPSG:32649",def:"+proj=utm +zone=49 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 50N",epsg:"EPSG:32650",def:"+proj=utm +zone=50 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 51N",epsg:"EPSG:32651",def:"+proj=utm +zone=51 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 52N",epsg:"EPSG:32652",def:"+proj=utm +zone=52 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 53N",epsg:"EPSG:32653",def:"+proj=utm +zone=53 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 54N",epsg:"EPSG:32654",def:"+proj=utm +zone=54 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 55N",epsg:"EPSG:32655",def:"+proj=utm +zone=55 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 56N",epsg:"EPSG:32656",def:"+proj=utm +zone=56 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 57N",epsg:"EPSG:32657",def:"+proj=utm +zone=57 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 58N",epsg:"EPSG:32658",def:"+proj=utm +zone=58 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 59N",epsg:"EPSG:32659",def:"+proj=utm +zone=59 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 60N",epsg:"EPSG:32660",def:"+proj=utm +zone=60 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 1S",epsg:"EPSG:32701",def:"+proj=utm +zone=1 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 2S",epsg:"EPSG:32702",def:"+proj=utm +zone=2 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 3S",epsg:"EPSG:32703",def:"+proj=utm +zone=3 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 4S",epsg:"EPSG:32704",def:"+proj=utm +zone=4 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 5S",epsg:"EPSG:32705",def:"+proj=utm +zone=5 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 6S",epsg:"EPSG:32706",def:"+proj=utm +zone=6 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 7S",epsg:"EPSG:32707",def:"+proj=utm +zone=7 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 8S",epsg:"EPSG:32708",def:"+proj=utm +zone=8 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 9S",epsg:"EPSG:32709",def:"+proj=utm +zone=9 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 10S",epsg:"EPSG:32710",def:"+proj=utm +zone=10 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 11S",epsg:"EPSG:32711",def:"+proj=utm +zone=11 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 12S",epsg:"EPSG:32712",def:"+proj=utm +zone=12 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 13S",epsg:"EPSG:32713",def:"+proj=utm +zone=13 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 14S",epsg:"EPSG:32714",def:"+proj=utm +zone=14 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 15S",epsg:"EPSG:32715",def:"+proj=utm +zone=15 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 16S",epsg:"EPSG:32716",def:"+proj=utm +zone=16 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 17S",epsg:"EPSG:32717",def:"+proj=utm +zone=17 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 18S",epsg:"EPSG:32718",def:"+proj=utm +zone=18 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 19S",epsg:"EPSG:32719",def:"+proj=utm +zone=19 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 20S",epsg:"EPSG:32720",def:"+proj=utm +zone=20 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 21S",epsg:"EPSG:32721",def:"+proj=utm +zone=21 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 22S",epsg:"EPSG:32722",def:"+proj=utm +zone=22 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 23S",epsg:"EPSG:32723",def:"+proj=utm +zone=23 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 24S",epsg:"EPSG:32724",def:"+proj=utm +zone=24 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 25S",epsg:"EPSG:32725",def:"+proj=utm +zone=25 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 26S",epsg:"EPSG:32726",def:"+proj=utm +zone=26 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 27S",epsg:"EPSG:32727",def:"+proj=utm +zone=27 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 28S",epsg:"EPSG:32728",def:"+proj=utm +zone=28 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 29S",epsg:"EPSG:32729",def:"+proj=utm +zone=29 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 30S",epsg:"EPSG:32730",def:"+proj=utm +zone=30 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 31S",epsg:"EPSG:32731",def:"+proj=utm +zone=31 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 32S",epsg:"EPSG:32732",def:"+proj=utm +zone=32 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 33S",epsg:"EPSG:32733",def:"+proj=utm +zone=33 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 34S",epsg:"EPSG:32734",def:"+proj=utm +zone=34 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 35S",epsg:"EPSG:32735",def:"+proj=utm +zone=35 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 36S",epsg:"EPSG:32736",def:"+proj=utm +zone=36 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 37S",epsg:"EPSG:32737",def:"+proj=utm +zone=37 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 38S",epsg:"EPSG:32738",def:"+proj=utm +zone=38 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 39S",epsg:"EPSG:32739",def:"+proj=utm +zone=39 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 40S",epsg:"EPSG:32740",def:"+proj=utm +zone=40 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 41S",epsg:"EPSG:32741",def:"+proj=utm +zone=41 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 42S",epsg:"EPSG:32742",def:"+proj=utm +zone=42 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 43S",epsg:"EPSG:32743",def:"+proj=utm +zone=43 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 44S",epsg:"EPSG:32744",def:"+proj=utm +zone=44 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 45S",epsg:"EPSG:32745",def:"+proj=utm +zone=45 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 46S",epsg:"EPSG:32746",def:"+proj=utm +zone=46 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 47S",epsg:"EPSG:32747",def:"+proj=utm +zone=47 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 48S",epsg:"EPSG:32748",def:"+proj=utm +zone=48 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 49S",epsg:"EPSG:32749",def:"+proj=utm +zone=49 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 50S",epsg:"EPSG:32750",def:"+proj=utm +zone=50 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 51S",epsg:"EPSG:32751",def:"+proj=utm +zone=51 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 52S",epsg:"EPSG:32752",def:"+proj=utm +zone=52 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 53S",epsg:"EPSG:32753",def:"+proj=utm +zone=53 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 54S",epsg:"EPSG:32754",def:"+proj=utm +zone=54 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 55S",epsg:"EPSG:32755",def:"+proj=utm +zone=55 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 56S",epsg:"EPSG:32756",def:"+proj=utm +zone=56 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 57S",epsg:"EPSG:32757",def:"+proj=utm +zone=57 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 58S",epsg:"EPSG:32758",def:"+proj=utm +zone=58 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 59S",epsg:"EPSG:32759",def:"+proj=utm +zone=59 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 60S",epsg:"EPSG:32760",def:"+proj=utm +zone=60 +south +datum=WGS84 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_13",epsg:"EPSG:4491",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_14",epsg:"EPSG:4492",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_15",epsg:"EPSG:4493",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_16",epsg:"EPSG:4494",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_17",epsg:"EPSG:4495",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_18",epsg:"EPSG:4496",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_19",epsg:"EPSG:4497",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_20",epsg:"EPSG:4498",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_21",epsg:"EPSG:4499",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_22",epsg:"EPSG:4500",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_23",epsg:"EPSG:4501",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_75E",epsg:"EPSG:4502",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_81E",epsg:"EPSG:4503",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_87E",epsg:"EPSG:4504",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_93E",epsg:"EPSG:4505",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_99E",epsg:"EPSG:4506",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_105E",epsg:"EPSG:4507",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_111E",epsg:"EPSG:4508",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_117E",epsg:"EPSG:4509",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_123E",epsg:"EPSG:4510",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_129E",epsg:"EPSG:4511",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_135E",epsg:"EPSG:4512",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_25",epsg:"EPSG:4513",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_26",epsg:"EPSG:4514",def:"+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_27",epsg:"EPSG:4515",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_28",epsg:"EPSG:4516",def:"+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_29",epsg:"EPSG:4517",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_30",epsg:"EPSG:4518",def:"+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_31",epsg:"EPSG:4519",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_32",epsg:"EPSG:4520",def:"+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_33",epsg:"EPSG:4521",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_34",epsg:"EPSG:4522",def:"+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_35",epsg:"EPSG:4523",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_36",epsg:"EPSG:4524",def:"+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_37",epsg:"EPSG:4525",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_38",epsg:"EPSG:4526",def:"+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_39",epsg:"EPSG:4527",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_40",epsg:"EPSG:4528",def:"+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_41",epsg:"EPSG:4529",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_42",epsg:"EPSG:4530",def:"+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_43",epsg:"EPSG:4531",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_44",epsg:"EPSG:4532",def:"+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_45",epsg:"EPSG:4533",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_75E",epsg:"EPSG:4534",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_78E",epsg:"EPSG:4535",def:"+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_81E",epsg:"EPSG:4536",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_84E",epsg:"EPSG:4537",def:"+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_87E",epsg:"EPSG:4538",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_90E",epsg:"EPSG:4539",def:"+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_93E",epsg:"EPSG:4540",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_96E",epsg:"EPSG:4541",def:"+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_99E",epsg:"EPSG:4542",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_102E",epsg:"EPSG:4543",def:"+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_105E",epsg:"EPSG:4544",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_108E",epsg:"EPSG:4545",def:"+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_111E",epsg:"EPSG:4546",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_114E",epsg:"EPSG:4547",def:"+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_117E",epsg:"EPSG:4548",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_120E",epsg:"EPSG:4549",def:"+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_123E",epsg:"EPSG:4550",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_126E",epsg:"EPSG:4551",def:"+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_129E",epsg:"EPSG:4552",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_132E",epsg:"EPSG:4553",def:"+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_135E",epsg:"EPSG:4554",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"}],R=function(){return _()((function t(){k()(this,t),this.name_map=new Map,this.epsg_map=new Map,this.initProj()}),[{key:"initProj",value:function(){var t=this;I.forEach((function(e){proj4.defs(e.epsg,e.def),t.name_map.set(e.name,e),t.epsg_map.set(e.epsg,e)}))}},{key:"convert",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n={points:[],code:0,message:""};if(!this.name_map.has(e)&&!this.epsg_map.has(e))return n.code=1,n.message="不支持的坐标系:"+e,n;if(!this.name_map.has(i)&&!this.epsg_map.has(i))return n.code=1,n.message="不支持的坐标系:"+i,n;var o=(this.name_map.get(e)||this.epsg_map.get(e)).epsg,s=(this.name_map.get(i)||this.epsg_map.get(i)).epsg,a=proj4.defs(o),r=proj4.defs(s);return t.forEach((function(t){var e=Number(t.x),i=Number(t.y),o=Number(t.z||0),s=proj4(a,r,[e,i]);n.points.push({x:Number(s[0].toFixed(10)),y:Number(s[1].toFixed(10)),z:o})})),n}},{key:"getAllProjection",value:function(){return Array.from(this.name_map.values())}},{key:"projectionIsExists",value:function(t){return this.name_map.has(t)||this.epsg_map.has(t)}},{key:"degreesToDMS",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function i(t){var e=t.toString(),i=e.indexOf(".");return-1!==i?e.length-i-1:0}function n(t){return Math.pow(10,t)}var o=!1;t<0&&(o=!0),t=Math.abs(t);var s=Math.floor(t),a=n(i(t)),r=Math.floor((t-s)*a*60)/a,l=Math.floor(r);o&&(s=-s);var c=n(i(r)),u=Math.floor((r-l)*c)/c*60;return e?s+"°"+Math.floor(1e4*r)/1e4+"'":s+"°"+l+"'"+Math.floor(100*u)/100+'"'}},{key:"dmsToDecimal",value:function(t,e){var i,n,o;if(e){var s=t.split("°"),a=s[1].split("'");i=s[0],n=a[0],console.log(i,n);var r=Math.pow(10,8),l=Number(i*r)+n*r/60;return Math.round(l)/r}var c=t.split("°"),u=c[1].split("'"),p=u[1].split('"');i=c[0],n=u[0],o=p[0],console.log(i,n,o);var h=Math.pow(10,8),d=Number(i*h)+n*h/60+o*h/3600;return Math.round(d)/h}}])}();function F(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function z(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];k()(this,t),this.container=e,this.options=z({},i),this.options.ismove=!0,!1===i.ismove&&(this.options.ismove=i.ismove),this.closeCallBack=i.closeCallBack,this._element={},this._element_style=void 0,this.only=n}),[{key:"init",value:(t=o()(a.a.mark((function t(){var e,i,n,o=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.only&&this.closeAll(),U.push(this),this.isDestroy=!1,this._element.body=document.createElement("div"),this._element.body.className="YJ-custom-base-dialog",this._element.body.style.top=this.options.top,this._element.body.style.bottom=this.options.bottom,this._element.body.style.left=this.options.left,this._element.body.style.right=this.options.right,this.container.appendChild(this._element.body),this._element.title=document.createElement("div"),this._element.title.className="title-box",this._element.title.innerHTML=''.concat(this.options.title||"","")+'',this._element.body.appendChild(this._element.title),t.next=16,document.createElement("div");case 16:return this._element.content=t.sent,this._element.content.className="content",this._element.body.appendChild(this._element.content),t.next=21,document.createElement("div");case 21:return this._element.foot=t.sent,this._element.foot.className="foot",this._element.foot.innerHTML='\n \n ',this._element.body.appendChild(this._element.foot),t.next=27,document.createElement("div");case 27:for((e=t.sent).style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.backdropFilter="blur(2px)",e.style.zIndex="-999999",this._element.body.appendChild(e),this._element.body.getElementsByClassName("close-box")[0].addEventListener("click",(function(){o.close()})),i=this._element.body.getElementsByClassName("close"),n=0;n=0;e--)t[e].dataset&&"YJ_style_dialog"===t[e].dataset.name&&document.getElementsByTagName("head")[0].removeChild(t[e]);this._element.body&&this._element.body.parentNode&&this.container.removeChild(this._element.body),this._element.body=null,this._element.title=null,this._element.content=null,this._element.foot=null,this._element_style=null,this.isDestroy=!0,this.closeCallBack&&(this.closeCallBack(),this.closeCallBack=null)}},{key:"closeAll",value:function(){for(var t=U.length-1;t>=0;t--)U[t].close(),U.splice(t,1)}},{key:"titleAppChild",value:function(t){this._element.title.appendChild(t)}},{key:"contentAppChild",value:function(t){this._element.content.appendChild(t)}},{key:"footAppChild",value:function(t,e){e?this._element.foot.insertBefore(t,e):this._element.foot.prepend(t)}},{key:"moveDiv",value:function(){var t=this,e=0,i=0,n=0,o=0,s=this._element.body,a=this;s.onmousedown=function(s){if("title-box"===s.toElement.className){var r=t._element.body.offsetHeight,l=t._element.body.offsetWidth;e=s.clientX,i=s.clientY;var c=window.getComputedStyle(t._element.body).left,u=window.getComputedStyle(t._element.body).top;n=1*c.substr(0,c.indexOf("px")),o=1*u.substr(0,u.indexOf("px"));var p=document.documentElement.clientHeight,h=document.documentElement.clientWidth;window.onmousemove=function(t){t.preventDefault();var s=t.clientX,c=t.clientY,u=s-(e-n),d=c-(i-o);u<0?u=0:u+l>h&&(u=h-l),d<=0?d=0:d+r>p&&(d=p-r),a._element.body.style.left=u+"px",a._element.body.style.top=d+"px",a._element.body.style.bottom="unset",a._element.body.style.right="unset"},document.onmouseup=function(t){window.onmousemove=null},window.ondragend=function(t){window.onmousemove=null}}},document.onmouseup=function(t){window.onmousemove=null},window.ondragend=function(t){window.onmousemove=null}}}]);var t}(),U=[],W=G,Y=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=null;return{that:Array.prototype.slice.call(t.querySelectorAll(e),0),stopPropagation:function(t){(t=t||window.event).stopPropagation?t.stopPropagation():t.cancelBubble=!0},hide:function(){Y(t,e).that.forEach((function(t){t.style.cssText+="display:none;"}))},show:function(i){void 0!==i?Y(t,e).that[i].style.cssText+="display:block;":Y(t,e).that.forEach((function(t){t.style.cssText+="display:block;"}))},legp_searchList:function(e){var i=[];return Y(t,"input[name="+e+"]").that.forEach((function(t){i.push(t.value)})),i},legp_search:function(o){var s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=Y(t,e).that[i];if(a){var r='
        \n '.concat(s?'':''),'\n
        \n
        \n
        ');a.innerHTML=r,Y(t,".cy_datalist input").that[i].oninput=function(e){var s=this.value;if(Y(t,".cy_datalist dl").hide(),o.length>0){Y(t,".cy_datalist dl").show();var a=new RegExp(s),r=!1;Y(t,".cy_datalist dl").that[i].innerHTML="",o.forEach((function(e){a.test(e.name)&&(r=!0,Y(t,".cy_datalist dl").that[i].innerHTML+='
        '+e.name+"
        ")})),r||(Y(t,".cy_datalist dl").that[i].innerHTML='
        暂无数据
        '),l()}},Y(t,".cy_datalist input").that[i].onclick=function(e){Y(t,".cy_datalist dl").hide();var i=1*e.srcElement.classList[1];i=i||0,"none"===Y(t,".cy_datalist dl").that[i].style.display&&(0==o.length?this.innerHTML="暂无数据":Y(t,".cy_datalist dl").show(i),Y(t,".cy_datalist dl").that[i].innerHTML="",o.forEach((function(e){Y(t,".cy_datalist dl").that[i].innerHTML+='
        '+e.name+"
        "})),l()),e.stopPropagation()},document.addEventListener("click",(function(){Y(t,".cy_datalist dl").hide()}))}function l(){Y(t,".cy_datalist dl dd").that.forEach((function(t){t.onclick=function(t){if(this&&this.attributes){var e=this.attributes.value.value;n=e,t.currentTarget.parentNode.previousElementSibling.value=e;var i=new Event("input",{bubbles:!0});t.currentTarget.parentNode.previousElementSibling.dispatchEvent(i)}}}))}},legp_searchActive:function(t){n=t}}},J=function(){var t=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d,m;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new R,H&&H.close&&(H.close(),H=null),t.next=4,new W(e.viewer._container,{title:"度分秒",left:"180px",top:"100px",closeCallBack:function(){i&&i()}});case 4:return H=t.sent,t.next=7,H.init();case 7:o='\n \n
        \n
        \n
        \n 输入格式\n
        \n
        \n
        \n
        \n
        \n \n

        \n \n 例如116.6°, 39.9°\n

        \n
        \n
        \n 经度\n \n
        \n
        \n 纬度\n \n
        \n
        \n \n \n \n \n
        \n
        \n
        \n
        \n \n

        \n 度分\n 例如95°10.1702\', 49°12.4015\'\n

        \n
        \n
        \n
        \n 经度\n \n \n \n \n \n
        \n
        \n 纬度\n \n \n \n \n \n
        \n
        \n
        \n \n \n \n \n
        \n
        \n
        \n
        \n \n

        \n 度分秒\n 例如11°18\'54.37", 39°13\'46.57"\n

        \n
        \n
        \n
        \n 经度\n \n \n \n \n \n \n \n
        \n
        \n 纬度\n \n \n \n \n \n \n \n
        \n
        \n
        \n \n \n \n \n
        \n
        \n
        \n \n '),H._element.body.className=H._element.body.className+" proj-convert",(s=document.createElement("div")).style.width="460px",s.style.display="flex",s.style.flexDirection="column",s.innerHTML=o,H.contentAppChild(s),r=s.getElementsByClassName("item"),l=a.a.mark((function t(e){var i,o,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=r[e].getAttribute("data-type"),o=r[e].getElementsByClassName("convert")[0],l=r[e].getElementsByClassName("icon-copy-box")[0],(c=new ClipboardJS(l,{text:function(t){var n;switch(i){case 0:case"0":n=r[e].getElementsByClassName("lng")[0].value+"°,"+r[e].getElementsByClassName("lat")[0].value+"°";break;case 1:case"1":n=s.getElementsByClassName("lng-dm-d")[0].value+"°"+s.getElementsByClassName("lng-dm-m")[0].value+"',"+s.getElementsByClassName("lat-dm-d")[0].value+"°"+s.getElementsByClassName("lat-dm-m")[0].value+"'";break;case 2:case"2":n=s.getElementsByClassName("lng-dms-d")[0].value+"°"+s.getElementsByClassName("lng-dms-m")[0].value+"'"+s.getElementsByClassName("lng-dms-s")[0].value+'",'+s.getElementsByClassName("lat-dms-d")[0].value+"°"+s.getElementsByClassName("lat-dms-m")[0].value+"'"+s.getElementsByClassName("lat-dms-s")[0].value+'"'}return n}})).on("success",(function(t){window.ELEMENT&&window.ELEMENT.Message({message:"已复制到剪切板",type:"success",duration:1500})})),c.on("error",(function(t){window.ELEMENT&&window.ELEMENT.Message({message:"复制失败",type:"warning",duration:1500})})),o.addEventListener("click",(function(){var t,o,a,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_;switch(i){case 0:case"0":t=r[e].getElementsByClassName("lng")[0].value,o=r[e].getElementsByClassName("lat")[0].value,p=n.degreesToDMS(t,!0),h=n.degreesToDMS(o,!0),v=(f=p.split("°"))[1].split("'"),y=(g=h.split("°"))[1].split("'"),s.getElementsByClassName("lng-dm-d")[0].value=f[0],s.getElementsByClassName("lng-dm-m")[0].value=v[0],s.getElementsByClassName("lat-dm-d")[0].value=g[0],s.getElementsByClassName("lat-dm-m")[0].value=y[0],d=n.degreesToDMS(t),m=n.degreesToDMS(o),w=(C=(b=d.split("°"))[1].split("'"))[1].split('"'),_=(x=(k=m.split("°"))[1].split("'"))[1].split('"'),s.getElementsByClassName("lng-dms-d")[0].value=b[0],s.getElementsByClassName("lng-dms-m")[0].value=C[0],s.getElementsByClassName("lng-dms-s")[0].value=w[0],s.getElementsByClassName("lat-dms-d")[0].value=k[0],s.getElementsByClassName("lat-dms-m")[0].value=x[0],s.getElementsByClassName("lat-dms-s")[0].value=_[0];break;case 1:case"1":a=r[e].getElementsByClassName("lng-dm-d")[0].value,l=r[e].getElementsByClassName("lng-dm-m")[0].value,c=r[e].getElementsByClassName("lat-dm-d")[0].value,u=r[e].getElementsByClassName("lat-dm-m")[0].value,t=n.dmsToDecimal(a+"°"+l+"'",!0),o=n.dmsToDecimal(c+"°"+u+"'",!0),s.getElementsByClassName("lng")[0].value=t,s.getElementsByClassName("lat")[0].value=o,d=n.degreesToDMS(t),m=n.degreesToDMS(o),w=(C=(b=d.split("°"))[1].split("'"))[1].split('"'),_=(x=(k=m.split("°"))[1].split("'"))[1].split('"'),s.getElementsByClassName("lng-dms-d")[0].value=b[0],s.getElementsByClassName("lng-dms-m")[0].value=C[0],s.getElementsByClassName("lng-dms-s")[0].value=w[0],s.getElementsByClassName("lat-dms-d")[0].value=k[0],s.getElementsByClassName("lat-dms-m")[0].value=x[0],s.getElementsByClassName("lat-dms-s")[0].value=_[0];break;case 2:case"2":d=(a=r[e].getElementsByClassName("lng-dms-d")[0].value)+"°"+(l=r[e].getElementsByClassName("lng-dms-m")[0].value)+"'"+r[e].getElementsByClassName("lng-dms-s")[0].value+'"',m=(c=r[e].getElementsByClassName("lat-dms-d")[0].value)+"°"+(u=r[e].getElementsByClassName("lat-dms-m")[0].value)+"'"+r[e].getElementsByClassName("lat-dms-s")[0].value+'"',t=n.dmsToDecimal(d),o=n.dmsToDecimal(m),s.getElementsByClassName("lng")[0].value=t,s.getElementsByClassName("lat")[0].value=o,p=n.degreesToDMS(t,!0),h=n.degreesToDMS(o,!0),v=(f=p.split("°"))[1].split("'"),y=(g=h.split("°"))[1].split("'"),s.getElementsByClassName("lng-dm-d")[0].value=f[0],s.getElementsByClassName("lng-dm-m")[0].value=v[0],s.getElementsByClassName("lat-dm-d")[0].value=g[0],s.getElementsByClassName("lat-dm-m")[0].value=y[0]}window.ELEMENT&&window.ELEMENT.Message({message:"转换成功",type:"success",duration:1500});for(var E=0;ENumber(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}},{key:"mouse_right",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.RIGHT_CLICK)}},{key:"mouse_right_down",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.RIGHT_DOWN)}},{key:"mouse_right_up",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.RIGHT_UP)}},{key:"mouse_wheel",value:function(t){this.handler&&this.handler.setInputAction((function(){t()}),Cesium.ScreenSpaceEventType.WHEEL)}},{key:"getcartesian",value:function(t){var e=t.position||t.endPosition;t.position1&&t.position2&&(e={x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2});var i=this.viewer.scene.pickPosition(e);if(!i){for(var n=this.viewer.camera.getPickRay(e),o=this.viewer.scene.drillPickFromRay(n,10),s={},a=0;a0&&void 0!==arguments[0]?arguments[0]:"左键开始,右键结束",i=arguments.length>1?arguments[1]:void 0;k()(this,t),this.point=void 0,this.text=e,this.div=void 0,this.mouse_type=0,this.position=new Cesium.Cartesian3,this.viewer=i.viewer,this.create_tip(this.viewer)}),[{key:"set_text",value:function(t){this.div.getElementsByTagName("p")[0].innerText=t}},{key:"get_mouse_style",value:function(t){var e="";switch(t){case 1:e="move.png";break;default:e="arrow.png"}return"url(lib/img/"+e+"),auto"}},{key:"create_tip",value:function(t){this.create_tooltip()}},{key:"setPosition",value:function(t,e,i){this.position=t,this.move_tooltip(e,i)}},{key:"destroy",value:function(){this.viewer.entities.remove(this.point),this.remove_tooltip()}},{key:"create_tooltip",value:function(){var t=new fi;this.div=document.createElement("div");this.div.setAttribute("style","position: absolute;z-index: 777;color: #ec131a;left:10px;top:0px;pointer-events: none;");var e=document.createElement("p");e.style.margin="0px",e.style.padding="0px",e.innerText=this.text,this.div.appendChild(e);var i=document.createElement("div");i.style.width="12px",i.style.height="12px",i.style.background="url(".concat(t.getSourceRootPath()+"/img/point.png",") 100% 100% no-repeat"),i.style.backgroundSize="100% 100%",i.style.position="absolute",i.style.left="-36px",i.style.top="-4px",this.div.style.display="none",this.div.appendChild(i),t=null,document.querySelector("body").appendChild(this.div)}},{key:"style_tip",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t._element.style.cursor=this.get_mouse_style(e)}},{key:"remove_tooltip",value:function(){document.querySelector("body").contains(this.div)&&document.querySelector("body").removeChild(this.div)}},{key:"move_tooltip",value:function(t,e){var i=0,n=0;if(this.div.style.display="block",this.viewer&&this.viewer._element){var o=this.viewer._element.getElementsByClassName("cesium-widget")[0].getElementsByTagName("canvas")[0];i=o.getBoundingClientRect().top+window.scrollY,n=o.getBoundingClientRect().left+window.scrollX}this.div.style.left=t+30+n+"px",this.div.style.top=e+i+"px"}}])}(),K=function(){var t=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new fi,o=new R,V&&V.close&&(V.close(),V=null),t.next=5,new W(e.viewer._container,{title:"投影转换",left:"180px",top:"100px",closeCallBack:function(){i&&i()}});case 5:return V=t.sent,t.next=8,V.init();case 8:'\n \n
        \n
        \n
        \n 源坐标\n \n
        \n
        \n
        \n 椭圆基准\n
        \n
        \n
        \n 经度(x)\n \n
        \n
        \n 纬度(y)\n \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 目标坐标\n \n
        \n
        \n
        \n 椭圆基准\n
        \n
        \n
        \n 经度(x)\n \n
        \n
        \n 纬度(y)\n \n
        \n
        \n
        \n
        \n \n ',(l=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 源坐标\n \n
        \n
        \n
        \n 椭圆基准\n
        \n
        \n
        \n 经度(x)\n \n
        \n
        \n 纬度(y)\n \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 目标坐标\n \n
        \n
        \n
        \n 椭圆基准\n
        \n
        \n
        \n 经度(x)\n \n
        \n
        \n 纬度(y)\n \n
        \n
        \n
        \n
        \n \n ',V.contentAppChild(l),c=[],u=0,o.epsg_map.forEach((function(t,e){u++,c.push({name:"".concat(u,".  ").concat(e,"(").concat(t.name,")"),value:e})})),(p=Y(l.getElementsByClassName("left")[0],".datalist_left")).legp_search(c,!0),(h=Y(l.getElementsByClassName("right")[0],".datalist_right")).legp_search(c,!0),d=l.getElementsByClassName("pick")[0],m=l.getElementsByClassName("copy")[0],(f=l.getElementsByClassName("datalist_left")[0].getElementsByTagName("input")[0]).value=c[0].value,p.legp_searchActive(c[0].value),(v=l.getElementsByClassName("datalist_right")[0].getElementsByTagName("input")[0]).value=c[0].value,h.legp_searchActive(c[0].value),g=l.getElementsByClassName("convert")[0],y=l.getElementsByClassName("left-x")[0],b=l.getElementsByClassName("left-y")[0],C=l.getElementsByClassName("right-x")[0],w=l.getElementsByClassName("right-y")[0],d.addEventListener("click",(function(){s&&s.destroy(),r&&r.destroy(),s=new Z("左键选择起点坐标,右键取消",e),(r=new X(e)).mouse_move((function(t,e){s.setPosition(e,t.endPosition.x,t.endPosition.y)})),r.mouse_left((function(t,i){var a=n.cartesian3Towgs84(i,e.viewer);s&&s.destroy(),r&&r.destroy();var l=o.convert([{x:Number(a.lng),y:Number(a.lat)}],"EPSG:4326",f.value);0===l.code&&(y.value=l.points[0].x,b.value=l.points[0].y)})),r.mouse_right((function(t,e){s&&s.destroy(),r&&r.destroy()}))})),g.addEventListener("click",(function(){if(!y.value||!b.value)return C.value="",w.value="",void(window.ELEMENT&&window.ELEMENT.Message({message:"请输入源坐标",type:"warning",duration:1500}));var t=o.convert([{x:Number(y.value),y:Number(b.value)}],f.value,v.value);0===t.code?(C.value=t.points[0].x,w.value=t.points[0].y):window.ELEMENT&&window.ELEMENT.Message({message:t.message,type:"warning",duration:1500})})),new ClipboardJS(m,{text:function(t){if(C.value&&w.value){var e="".concat(C.value,",").concat(w.value);return e}C.value="",w.value="",window.ELEMENT&&window.ELEMENT.Message({message:"复制失败,目标坐标为空!",type:"warning",duration:1500})}}).on("success",(function(t){window.ELEMENT&&window.ELEMENT.Message({message:"已复制到剪切板",type:"success",duration:1500})}));case 36:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}(),$=function(){V&&V.close&&(V.close(),V=null)},Q=[new Map,new Map,new Map];Q[0].set("--color-sdk-base-rgb","0, 255, 255"),Q[0].set("--color-sdk-gradual","rgb(0, 255, 255) 6.25%, rgb(0, 200, 255) 100%"),Q[0].set("--color-sdk-bg-gradual","#00ffff33 0%, #00ffff00 100%"),Q[0].set("--color-sdk-text-shadow","rgba(20, 118, 255, 1)"),Q[1].set("--color-sdk-base-rgb","42, 200, 251"),Q[1].set("--color-sdk-gradual","rgb(42, 200, 251) 6.25%, rgb(42, 145, 251) 100%"),Q[1].set("--color-sdk-bg-gradual","#2ac8fb33 0%, #2ac8fb00 100%"),Q[1].set("--color-sdk-text-shadow","rgba(20, 63, 255, 1)"),Q[2].set("--color-sdk-base-rgb","187, 26, 41"),Q[2].set("--color-sdk-gradual","rgb(187, 26, 41) 6.25%, rgb(236, 20, 20) 100%"),Q[2].set("--color-sdk-bg-gradual","#bb1a2933 0%, #bb1a2900 100%"),Q[2].set("--color-sdk-text-shadow","rgba(246, 8, 30, 1)");var tt={};function et(t,e,i){if(t&&t.div_id){var n=ae().sdkD,o=document.getElementById(t.div_id).getElementsByClassName("cesium-viewer")[0],s=new fi;tt[t.div_id]||(tt[t.div_id]={}),tt[t.div_id].mousedown&&document.removeEventListener("mousedown",tt[t.div_id].mousedown),tt[t.div_id].click&&document.removeEventListener("click",tt[t.div_id].click),tt[t.div_id].callBack||(tt[t.div_id].callBack=i),t!==n&&tt[t.div_id].mouseRightMenuEvent&&tt[t.div_id].mouseRightMenuEvent.destroy();var a=document.getElementById("custom-menu");a&&o.removeChild(a),tt[t.div_id].status=e,e&&(tt[t.div_id].mousedown=function(t){if(!(t.target.parentNode&&"custom-menu"==t.target.parentNode.id||t.target.parentNode&&t.target.parentNode.parentNode&&"custom-menu"==t.target.parentNode.parentNode.id)){var e=document.getElementById("custom-menu");e&&o.removeChild(e)}},document.addEventListener("mousedown",tt[t.div_id].mousedown),tt[t.div_id].click=function(t){if(!(t.target.parentNode&&"custom-menu"==t.target.parentNode.id||t.target.parentNode&&t.target.parentNode.parentNode&&"custom-menu"==t.target.parentNode.parentNode.id)){var e=document.getElementById("custom-menu");e&&o.removeChild(e)}},document.addEventListener("click",tt[t.div_id].click),tt[t.div_id].mouseRightMenuEvent=new X(t),tt[t.div_id].mouseRightMenuEvent.mouse_right((function(e,i){if(!YJ.Measure.GetMeasureStatus()&&!t.viewer.trackedEntity){var n=t.viewer.entities.getById("svg-control-points_0");if(!n||!n.show){var a=document.getElementById("custom-menu");a&&o.removeChild(a);var r,l=function(e){var i=t.viewer.scene.pick(e.position);if(i)if(i.id){if(i.id.type&&"vector"===i.id.type&&i.id.parentId)return{parentId:i.id.parentId,id:i.id.id};if(i.id.id)return i.id.id;if("string"==typeof i.id)return i.id}else if(i.primitive&&i.primitive.id)return i.primitive.id}(e);"[object Object]"===Object.prototype.toString.call(l)&&(r=l.id,l=l.parentId);var c="",u=t.entityMap.get(l);if(!u&&l){var p=l.split("-");p.splice(p.length-1,1),l=p.join("-"),u=t.entityMap.get(l)}u&&u.picking&&(c='\n \n
          \n
        • 属性
        • \n
        \n ');var h=s.cartesian3Towgs84(i,t.viewer);(a=document.createElement("div")).id="custom-menu",a.style.position="absolute",a.style.width="110px",a.style.backgroundColor="#00000085",a.style.color="#ffffff",a.style.padding="6px 0",a.style.boxShadow="4px 4px 4px 0px rgba(0, 0, 0, 0.8)",a.innerHTML='\n
          \n
        • 绕鼠标点旋转
        • \n
        \n
          \n
        • 文本框
        • \n
        \n '.concat(c,"\n "),o.appendChild(a);var d=e.position.x,m=e.position.y;e.position.x+a.offsetWidth>o.offsetWidth&&(d=e.position.x-a.offsetWidth),e.position.y+a.offsetHeight>o.offsetHeight&&(m=e.position.y-a.offsetHeight),a.style.left=d+"px",a.style.top=m+"px",a.addEventListener("contextmenu",(function(t){t.preventDefault()}));for(var f=a.getElementsByTagName("li"),v={},g=function(e){f[e].addEventListener("mouseover",(function(){f[e].style.backgroundColor="#5e5e5e"})),f[e].addEventListener("mouseout",(function(){f[e].style.backgroundColor="unset"})),f[e].addEventListener("click",(function(){var i="";switch(f[e].innerHTML){case"绕鼠标点旋转":v.position=h,i="rotateAround";break;case"属性":r?(v.id=r,v.parentId=u.options.id):v.id=u.options.id,i="attribute";break;case"文本框":v.position=h,i="textBox"}tt[t.div_id].callBack(i,v),o.removeChild(a)}))},y=0;y=0;l--){var c=Array.from(at.keys())[l],u=at.get(c);if(u&&u.that)if("PolygonObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var p=turf.point([a.lng,a.lat]),h=[],d=0;d=3){for(var f=u.that.computeAssemble(u.that.options.positions,!0),v=turf.point([a.lng,a.lat]),g=[],y=0;y=3){for(var C=turf.point([a.lng,a.lat]),w=u.that.computeAttackArrow(u.that.options.positions),k=[],x=0;x=5){for(var S=turf.point([a.lng,a.lat]),D=u.that.computePincerArrow(u.that.options.positions),P=[],M=0;M=0;l--){var c=Array.from(Ct.keys())[l],u=Ct.get(c);if(u&&u.that)if("PolygonObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var p=turf.point([a.lng,a.lat]),h=[],d=0;d=3){for(var f=u.that.computeAssemble(u.that.options.positions,!0),v=turf.point([a.lng,a.lat]),g=[],y=0;y=3){for(var C=turf.point([a.lng,a.lat]),w=u.that.computeAttackArrow(u.that.options.positions),k=[],x=0;x=5){for(var S=turf.point([a.lng,a.lat]),D=u.that.computePincerArrow(u.that.options.positions),P=[],M=0;M1&&void 0!==arguments[1]&&arguments[1];if(t){bt||(bt=new fi),(Pt=!!e)?Tt(t,Mt):Lt(t);var i=Ie();i&&(Pt?Tt(t,Mt):Lt(i));var n=ae().sdkD;n&&t!==n&&Ot(n,e)}}function Tt(t,e){Mt=e,Pt&&Bt(t);var i=Ie();return i&&Pt&&Bt(i),new Promise(function(){var t=o()(a.a.mark((function t(e,i){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:setTimeout((function(){e()}),1e3);case 1:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}())}function Nt(){return Pt}function Bt(t){Lt(t);var e,i,n=t.viewer.camera.positionCartographic,o={position:{lng:Cesium.Math.toDegrees(n.longitude),lat:Cesium.Math.toDegrees(n.latitude),alt:n.height}},s=t.viewer;switch(Mt){case"1:100万":o.position.alt=16e6;break;case"1:50万":o.position.alt=5e6;break;case"1:25万":o.position.alt=23e5;break;case"1:10万":o.position.alt=68e4;break;case"1:5万":o.position.alt=385e3;break;case"1:2.5万":o.position.alt=18e4;break;case"1:1万":o.position.alt=9e4;break;case"1:5000":o.position.alt=46e3}for(var a=0;au&&(u+=360),c={minLng:r,minLat:l,maxLng:u,maxLat:d},l<-88&&(l=-88),d>88&&(d=88),(c.maxLng-c.minLng)/n*((c.maxLat-c.minLat)/o)>7e3)c=null;else{for(var m=r;m<=u;m+=n){for(var f=[],v=[],g=l;Math.floor(1e9*g)/1e9<=d;g+=o/2)v.push([m,g]),f.push(Cesium.Cartesian3.fromDegrees(m,g,8848));88!=d&&d+o/2>=88&&f.push(Cesium.Cartesian3.fromDegrees(m,88,8848));var y=new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:f,width:1,vertexFormat:Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,arcType:Cesium.ArcType.RHUMB})});if(e.add(new Cesium.Primitive({geometryInstances:y,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.fromCssColorString("#fcfc00")})})})),md)break;var w=p(C.lng,C.lat,t);i.add({position:Cesium.Cartesian3.fromDegrees(C.lng,C.lat,8848),text:w,font:"16px Inter, sans-serif",fillColor:Cesium.Color.fromCssColorString("#fcfc00"),pixelOffset:new Cesium.Cartesian2(0,0),showBackground:!1,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,scale:1,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,8e7),scaleByDistance:s})}}for(var k=l;Math.floor(1e9*k)/1e9<=d;k+=o){for(var x=[],_=[],E=r;E<=u;E+=n/2)_.push([E,k]),x.push(Cesium.Cartesian3.fromDegrees(E,k,8848));var S=new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:x,width:1,vertexFormat:Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,arcType:Cesium.ArcType.RHUMB})});e.add(new Cesium.Primitive({geometryInstances:S,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.fromCssColorString("#fcfc00")})})}))}}}function p(t,e,i){var n,o;switch(i){case"1:100万":n=6,o=4;break;case"1:50万":n=3,o=2;break;case"1:25万":n=1.5,o=1;break;case"1:10万":n=.5,o=1/3;break;case"1:5万":n=.25,o=1/6;break;case"1:2.5万":n=.125,o=1/12;break;case"1:1万":n=.0625,o=1/24;break;case"1:5000":n=.03125,o=1/48}e=Math.max(-88,Math.min(88,e));var s,a=t,r=e=Math.abs(e),l=Math.floor(a/6+31),c="ABCDEFGHIJKLMNOPQRSTUV".charAt(Math.floor(r/4+1)-1),u={"1:100万":"","1:50万":"B","1:25万":"C","1:10万":"D","1:5万":"E","1:2.5万":"F","1:1万":"G","1:5000":"H"}[i];if(!u&&"1:100万"!==i)throw new Error("不支持的比例尺,请使用: 1:100万, 1:50万, 1:25万, 1:10万, 1:5万, 1:2.5万, 1:1万, 1:5000");s=c+l;var p=("000"+(Math.floor((4*Math.ceil(r/4)-r)/o)+1)).slice(-3),h=a-6*Math.floor(a/6),d=("000"+(Math.floor(h/n)+1)).slice(-3);switch(i){case"1:100万":return s;case"1:50万":case"1:25万":case"1:10万":case"1:5万":case"1:2.5万":case"1:1万":case"1:5000":break;default:throw new Error("不支持的比例尺")}return s+u+p+d}function h(){var t=s.camera.computeViewRectangle();if(2==s.scene.mode){var e=s.scene.canvas,i=new Cesium.Cartesian2(0,0),n=new Cesium.Cartesian2(e.clientWidth,e.clientHeight),o=s.scene.globe.ellipsoid,a=s.camera.pickEllipsoid(i,o),r=s.camera.pickEllipsoid(n,o);if(!a){var l=Cesium.SceneTransforms.wgs84ToWindowCoordinates(s.scene,{x:0,y:0,z:6356755});i.y=l.y+5,a=s.camera.pickEllipsoid(i,o)}if(!r){var c=Cesium.SceneTransforms.wgs84ToWindowCoordinates(s.scene,{x:0,y:0,z:-6356755});n.y=c.y-5,r=s.camera.pickEllipsoid(n,o)}var u=s.scene.globe.ellipsoid.cartesianToCartographic(a),p=s.scene.globe.ellipsoid.cartesianToCartographic(r);return t=(n.y-i.y)/(n.x-i.x)<=.49998752339363695?new Cesium.Rectangle(Cesium.Math.toRadians(-180),Cesium.Math.toRadians(-90),Cesium.Math.toRadians(180),Cesium.Math.toRadians(90)):new Cesium.Rectangle(u.longitude,p.latitude,p.longitude,u.latitude)}return t}e.postRenderEvent=function(){var i=t.viewer.camera.positionCartographic.height;switch(Mt){case"1:100万":o.position.alt=16e6;break;case"1:50万":o.position.alt=5e6;break;case"1:25万":o.position.alt=23e5;break;case"1:10万":o.position.alt=68e4;break;case"1:5万":o.position.alt=385e3;break;case"1:2.5万":o.position.alt=18e4;break;case"1:1万":o.position.alt=9e4;break;case"1:5000":o.position.alt=46e3}if(i>5*o.position.alt)return c=null,void e.removeAll();var n=!1,s=h();if(s){var a=Cesium.Math.toDegrees(s.west),r=Cesium.Math.toDegrees(s.south),p=Cesium.Math.toDegrees(s.east);a>p&&(p+=360),s={minLng:a,minLat:r,maxLng:p,maxLat:Cesium.Math.toDegrees(s.north)},c?(c.minLng>s.minLng||c.minLat>s.minLat||c.maxLng=50&&(u(Mt),n=!1):l=0}},o.complete=function(){s.scene.postRender.addEventListener(e.postRenderEvent)},Xe(t,o,.5)}function Lt(t){for(var e,i,n=t.viewer,o=0;o=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==g[2]&&g[2],s=g.length>3?g[3]:void 0,zt){t.next=6;break}return t.abrupt("return");case 6:if(r=zt.entityMap,l=Ft&&Ft.entityMap,!i){t.next=15;break}if((c=r.get(i))&&c.show){t.next=12;break}return t.abrupt("return");case 12:f(i,s),t.next=35;break;case 15:u=It(zt.entityMap),t.prev=16,u.s();case 18:if((p=u.n()).done){t.next=27;break}if(h=y()(p.value,2),d=h[0],(m=h[1])&&m.show){t.next=24;break}return t.abrupt("continue",25);case 24:f(d,s);case 25:t.next=18;break;case 27:t.next=32;break;case 29:t.prev=29,t.t0=t.catch(16),u.e(t.t0);case 32:return t.prev=32,u.f(),t.finish(32);case 35:if(!n){t.next=37;break}return t.abrupt("return");case 37:case"end":return t.stop()}}),t,null,[[16,29,32,35]])})))).apply(this,arguments)}function Qt(t,e){Ft.viewer.imageryLayers.addImageryProvider(t.imageryProvider,e)}function te(t,e,i){for(var n,o=0;o=0;l--){var c=Array.from(ue.keys())[l],u=ue.get(c);if(u&&u.that)if("PolygonObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var p=turf.point([a.lng,a.lat]),h=[],d=0;d=3){for(var f=u.that.computeAssemble(u.that.options.positions,!0),v=turf.point([a.lng,a.lat]),g=[],y=0;y=3){for(var C=turf.point([a.lng,a.lat]),w=u.that.computeAttackArrow(u.that.options.positions),k=[],x=0;x=5){for(var S=turf.point([a.lng,a.lat]),D=u.that.computePincerArrow(u.that.options.positions),P=[],M=0;M=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function be(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i=1;o--){for(s=!1,r=n.length-1;r>=1;r--)n[r].id&&i[r].id&&n[r].id===i[o].id&&(s=!0);s||re.viewer.scene.primitives.remove(i[o])}for(l=n.length-1;l>=1;l--){for(c=!1,u=i.length-1;u>=1;u--)n[l].id&&i[l].id&&n[l].id===i[u].id&&(c=!0,i[u].show=n[l].show,i[u].startColor=n[l].startColor,i[u].endColor=n[l].endColor,i[u].minimumSpeed=n[l].minimumSpeed,i[u].maximumSpeed=n[l].maximumSpeed,i[u].minimumParticleLife=n[l].minimumParticleLife,i[u].maximumParticleLife=n[l].maximumParticleLife,i[u].startScale=n[l].startScale,i[u].endScale=n[l].endScale,i[u].emissionRate=n[l].emissionRate,i[u].particleSize=n[l].particleSize,i[u].modelMatrix=n[l].modelMatrix);c||re.viewer.scene.primitives.add(n[l])}}case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ae(t,e,i){var n=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas);n.setInputAction((function(){ce=e}),Cesium.ScreenSpaceEventType.LEFT_DOWN),n.setInputAction((function(){ce=e}),Cesium.ScreenSpaceEventType.RIGHT_DOWN),n.setInputAction((function(){ce=e}),Cesium.ScreenSpaceEventType.WHEEL),we.push(n)}function je(){var t,e=this.sdks[ce];if(0===ce?t=this.sdks[1]:1===ce&&(t=this.sdks[0]),2===e.viewer.scene.mode)if(this.sdks[0].viewer.trackedEntity){var i=e.viewer.camera.positionCartographic.height;t.viewer.camera.lookAt(Cesium.Cartesian3.fromRadians(e.viewer.camera.positionCartographic.longitude,e.viewer.camera.positionCartographic.latitude,0),new Cesium.HeadingPitchRange(0,Cesium.Math.toRadians(-90),i))}else{this.sdks[1].viewer.trackedEntity&&(this.sdks[1].viewer.entities.remove(this.sdks[1].viewer.trackedEntity),this.sdks[1].viewer.trackedEntity=null);var n=this.tools.cartesian3Towgs84(Cesium.Cartesian3.fromRadians(e.viewer.camera.positionCartographic.longitude,e.viewer.camera.positionCartographic.latitude,e.viewer.camera.positionCartographic.height),e.viewer);t.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt)})}else{var o=e.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(e.viewer.canvas.clientWidth/2,e.viewer.canvas.clientHeight/(2-(90+e.viewer.camera.pitch/(Cesium.Math.PI/180))/110)));o||(o=e.viewer.camera.positionWC);var s=this.tools.cartesian3Towgs84(e.viewer.camera.positionWC,e.viewer).alt,a=this.tools.cartesian3Towgs84(o,e.viewer);t.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(a.lng,a.lat,s)})}}function Ie(){return re}function Re(){return le}function Fe(){re&&re.viewer.entities.add({show:!1,polygon:{hierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray([100,50,100.0001,50,100.0001,50.0001]))}})}function ze(){return{sdkP:le,sdkD:re}}function He(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ve(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ve(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ve(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==u[2]?u[2]:3,o=new fi(e),r=i.orientation,!i.position){t.next=13;break}if(0===i.position.alt||i.position.alt){t.next=8;break}return t.next=7,o.getClampToHeight(i.position);case 7:i.position.alt=t.sent;case 8:l=0,r||(l=500),s=Cesium.Cartesian3.fromDegrees(i.position.lng,i.position.lat,i.position.alt+l),t.next=15;break;case 13:c=o.cal_envelope(i.positions),s=new Cesium.Rectangle(Cesium.Math.toRadians(c[3][0]),Cesium.Math.toRadians(c[3][1]),Cesium.Math.toRadians(c[1][0]),Cesium.Math.toRadians(c[1][1]));case 15:ii(e),e.viewer.camera.flyTo({destination:s,duration:n,orientation:r,complete:i.complete});case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ke(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t&&t.viewer){var i=t.viewer;i.scene.screenSpaceCameraController.enableRotate=e,i.scene.screenSpaceCameraController.enableTranslate=e,i.scene.screenSpaceCameraController.enableZoom=e,i.scene.screenSpaceCameraController.enableTilt=e,i.scene.screenSpaceCameraController.enableLook=e}}function $e(t,e){if(t&&t.viewer){Je[t.viewer._element.className]||(Je[t.viewer._element.className]={}),Je[t.viewer._element.className].event&&Je[t.viewer._element.className].event.destroy();var i=new fi(t),n=t.viewer._element,s=t.proj,r=function(){switch(l){case"compass":var r=n.getElementsByClassName("compass")[0],c=n.getElementsByClassName("navigation-controls")[0];e[l]?(r&&(r.style.display="block"),c&&(c.style.display="flex")):(r&&(r.style.display="none"),c&&(c.style.display="none"));break;case"legend":var u=n.getElementsByClassName("distance-legend")[0];e[l]?u&&(u.parentNode.style.display="block"):u&&(u.parentNode.style.display="none");break;case"info":var p=n.getElementsByClassName("cesium-info")[0];if(e[l]){var h=function(){var e=o()(a.a.mark((function e(){var n,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Ge){e.next=2;break}return e.abrupt("return");case 2:n=i.cartesian3Towgs84(Ge,t.viewer),"EPSG:4326"===Ue?p.innerHTML="\n 经度:".concat(Number(n.lng.toFixed(6)),"° \n 纬度:").concat(Number(n.lat.toFixed(6)),"° \n 海拔高度:").concat(Number(n.alt.toFixed(2)),"米\n "):(o=s.convert([{x:n.lng,y:n.lat,z:n.alt}],"EPSG:4326",Ue),p.innerHTML="\n x:".concat(Number(o.points[0].x.toFixed(6)),'\n y:').concat(Number(o.points[0].y.toFixed(6)),'\n z:').concat(Number(o.points[0].z.toFixed(6)),"\n "));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();p?(h(),p.style.display="block"):((p=document.createElement("div")).className="cesium-info",p.style.position="absolute",p.style.bottom="32px",p.style.right="240px",p.style["font-size"]="14px",p.style["background-color"]="rgba(47,53,60,.8)",p.style.color="#fff",p.style.padding="4px 10px",p.style["border-radius"]="18px",p.innerHTML="EPSG:4326"===Ue?"\n 经度:-\n 纬度:-\n 海拔高度:-\n ":"\n x:-\n y:-\n z:-\n ",t.viewer._element.appendChild(p));var d=new X(t);Je[t.viewer._element.className].event=d;d.mouse_move((function(t,e){Ge=e,h()}))}else p&&(p.style.display="none");break;case"frame":e[l]?(t.viewer.scene.debugShowFramesPerSecond=!0,setTimeout((function(){var e=t.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0],i=e.getElementsByClassName("cesium-performanceDisplay-defaultContainer")[0];i&&e.appendChild(i)}),50)):t.viewer.scene.debugShowFramesPerSecond=!1}};for(var l in e)r()}}function Qe(t,e){e=e?"billboard_default_url_"+e:"billboard_default_url";var i=h();t.startsWith("http")||(t.includes(":")||i&&(t=new URL(t,i).href));localStorage.setItem(e,t)}function ti(t){return t=t?"billboard_default_url_"+t:"billboard_default_url",localStorage.getItem(t)}function ei(){return We}function ii(t){t&&t.viewer&&qe[t.viewer._element.className]&&(qe[t.viewer._element.className].animate&&TWEEN.remove(qe[t.viewer._element.className].animate),qe[t.viewer._element.className].event&&qe[t.viewer._element.className].event.destroy(),Ke(t,!0),t.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY))}function ni(t){if(t&&t.entityMap){var e,i=He(t.entityMap);try{for(i.s();!(e=i.n()).done;){var n=y()(e.value,2),o=(n[0],n[1]);"TrajectoryMotion"===o.type&&o.viewFollow&&(o.viewFollow=!1)}}catch(t){i.e(t)}finally{i.f()}}}function oi(t,e){if(t){var i,n=ae().sdkD;n&&t!==n&&oi(n,e);for(var o=0;o=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function di(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i-1){var i=t.src.split("/");i.pop(),e=i.join("/")}})),e}},{key:"cartesian3Towgs84",value:function(t,e){var i=e.scene.globe.ellipsoid,n=new Cesium.Cartesian3(t.x,t.y,t.z),o=i.cartesianToCartographic(n),s=Cesium.Math.toDegrees(o.latitude);return{lng:Cesium.Math.toDegrees(o.longitude),lat:s,alt:o.height<0?0:o.height}}},{key:"computeDistance",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_,E,S,D,P,M,O=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=O.length>0&&void 0!==O[0]?O[0]:[],i=O.length>1&&void 0!==O[1]?O[1]:2,n=O.length>2&&void 0!==O[2]?O[2]:"空间长度",!(e.length<2)){t.next=7;break}return t.abrupt("return",0);case 7:o=0,t.t0=n,t.next="空间长度"===t.t0?11:"投影长度"===t.t0?13:"地表长度"===t.t0?15:48;break;case 11:for(s=0;s20?g/20:g,y=this.chunkLine(e,m),b=[],y.forEach((function(t,e){0===e?b=L()(t.geometry.coordinates):b.push(t.geometry.coordinates[1])})),C=[],w=hi(b),t.prev=25,w.s();case 27:if((k=w.n()).done){t.next=37;break}return x=k.value,_=b.indexOf(x),t.next=32,this.sampleHeight({lng:x[0],lat:x[1],alt:0},_);case 32:(E=t.sent).position.alt=E.position.alt<0?0:E.position.alt,C.push(E);case 35:t.next=27;break;case 37:t.next=42;break;case 39:t.prev=39,t.t1=t.catch(25),w.e(t.t1);case 42:return t.prev=42,w.f(),t.finish(42);case 45:for(C.length,S=0;S0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t.length<2)return 0;var n=0;if(i){var o=[];t.forEach((function(t){o.push([t.lng,t.lat,t.alt])}));var s=turf.lineString(o);n=1e3*turf.length(s)}else for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:2;if(t.length<3)return 0;var i=[];t.forEach((function(t){i.push([t.lng,t.lat])})),i.push(i[0]);var n=turf.polygon([i]),o=turf.tesselate(n);return Number(turf.area(o).toFixed(e))}},{key:"computeSignedArea",value:function(t,e){for(var i=[],n=[],o=0;oc?l/10:c/10;var u=new Cesium.PolygonGeometry.fromPositions({positions:Cesium.Cartesian3.fromDegreesArray(i),vertexFormat:Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:s}),p=new Cesium.PolygonGeometry.createGeometry(u);if(!p||!p.attributes||!p.attributes.position)return 0;var h=p.indices,d=p.attributes.position.values;function m(e,i){var n=new Cesium.Cartesian3(d[3*i],d[3*i+1],d[3*i+2]);return t.scene.clampToHeight(n)||n}for(var f=0,v=0;v1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{steps:360};Number(e)<=0&&(e=.01);var n=[Number(t.lng),Number(t.lat)],o=turf.circle(n,e/1e3,i).geometry.coordinates[0],s=[];return o.forEach((function(t){s=s.concat(t)})),s}},{key:"createEllipse",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{granularity:.1,semiMinorAxis:10,semiMajorAxis:20,bearing:0,height:0};e.granularity||(e.granularity=.1),e.height||(e.height=0),e.semiMinorAxis||(e.semiMinorAxis=1e-5),e.semiMajorAxis||(e.semiMajorAxis=1e-5);var i=new Cesium.EllipseOutlineGeometry({center:Cesium.Cartesian3.fromDegrees(Number(t.lng),Number(t.lat)),semiMajorAxis:Number(e.semiMajorAxis),semiMinorAxis:Number(e.semiMinorAxis),height:Number(e.height),granularity:Cesium.Math.toRadians(e.granularity),rotation:Cesium.Math.toRadians(e.bearing)}),n=Cesium.EllipseOutlineGeometry.createGeometry(i);if(!n||!n.attributes||!n.attributes.position)return[];for(var o=n.attributes.position.values,s=[],a=0;a0&&void 0!==arguments[0]?arguments[0]:[],e=[];t.forEach((function(t){e.push(turf.point([t.lng,t.lat]))}));var i=turf.featureCollection(e),n=turf.center(i).geometry.coordinates;return{lng:n[0],lat:n[1]}}},{key:"computeMidpoint",value:function(t,e){var i=turf.point([t.lng,t.lat]),n=turf.point([e.lng,e.lat]),o=turf.midpoint(i,n).geometry.coordinates;return{lng:o[0],lat:o[1]}}},{key:"computeAttackArrow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.computeArrow(t,0)}},{key:"computePincerArrow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.computeArrow(t)}},{key:"computeArrow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(t.length<3)return[];for(var i,n=[],o=0;o0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.length<2)return[];t.length;var i=new Array;if(t.forEach((function(t){i.push([t.lng,t.lat])})),2===i.length){var n=P.PlotUtils.mid(i[0],i[1]),o=P.PlotUtils.distance(i[0],n)/.9,s=P.PlotUtils.getThirdPoint(i[0],n,P.Constants.HALF_PI,o,!0);i=[i[0],s,i[1]]}var a=P.PlotUtils.mid(i[0],i[2]);i.push(a,i[0],i[1]);for(var r=[],l=void 0,c=void 0,u=void 0,p=[],h=0;h0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.length<2)return[];var i=[t[0].lng,t[0].lat],n=[t[1].lng,t[1].lat];if(t[0].lng===t[1].lng&&t[0].lat===t[1].lat){if(e)return[t[0],t[0],t[0]];var o=Cesium.Cartesian3.fromDegrees(t[0].lng,t[0].lat);return[o,o,o]}for(var s,a=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:"#2ab0c2",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o="",s={7:10,8:3,9:4,10:4,11:4,12:2};switch(i&&(s[e+""]?i.polyline.width=i.polyline.oriWidth+s[e+""]:i.polyline.width=i.polyline.oriWidth),Number(e)){case 1:o=new Cesium.PolylineDashMaterialProperty({color:Cesium.Color.fromCssColorString(t),dashLength:10});break;case 2:o=new Cesium.PolylineGlowMaterialProperty({glowPower:.2,color:Cesium.Color.fromCssColorString(t)});break;case 3:o=new Cesium.PolylineFlowMaterialProperty({color:t,speed:n.rotate?n.speed:0-n.speed,rotate:n.rotate});break;case 4:o=new Cesium.PolylineFlowMultMaterialProperty({color:t,speed:n.rotate?n.speed:0-n.speed,rotate:n.rotate});break;case 5:case 6:var a,r=this;o=new Cesium.FlowDashedLineFlowMaterialProperty({color:t,uType:5==e?0:1,speed:n.rotate?n.speed:0-n.speed,space:n.space,scale:new Cesium.CallbackProperty((function(){if(r.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D){var t=i.polyline.positions.getValue();if(!Cesium.defined(t))return 1;for(var e=0,n=0;n0||0==e.speed?(n.width=s.width*(e.space+1),n.height=s.height,o.drawImage(s,s.width*(e.space/2),0)):(o.clearRect(0,0,n.width,n.height),n.width=s.width*(e.space+1),n.height=s.height,o.save(),o.translate(n.width/2,n.height/2),o.rotate(Math.PI),o.translate(-n.width/2,-n.height/2),o.drawImage(s,s.width*(e.space/2),0),o.restore());var a=0,r=0;i.polyline.material=new Cesium.LineTextureMaterialProperty({color:e.color,image:n,speed:e.speed,repeat:new Cesium.CallbackProperty((function(){if(t.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D){var o=i.polyline.positions.getValue(t.sdk.viewer.clock.currentTime);if(!Cesium.defined(o))return new Cesium.Cartesian2(1,1);for(var s=0,l=0;l700){var v=(u*=f/p/(e.space*(n.width/n.height*5)+1))/i.polyline.oriRepeat;i.polyline.oriSpeed=v,i.polyline.oriRepeatX=u,a=v,r=u,c=new Cesium.Cartesian2(u,v||1)}else c=new Cesium.Cartesian2(r||i.polyline.oriRepeatX,a||i.polyline.oriSpeed);return c}var g=Re(),y=g.viewer.entities.getById(t.options.id),b=y.polyline.positions.getValue(g.viewer.clock.currentTime);if(!Cesium.defined(b))return new Cesium.Cartesian2(1,1);for(var C=0,w=0;w700){var M=(x*=P/_/(e.space*(n.width/n.height*5)+1))/y.polyline.oriRepeat;y.polyline.oriSpeed=M,y.polyline.oriRepeatX=x,a=M,r=x,k=new Cesium.Cartesian2(x,M||1)}else k=new Cesium.Cartesian2(r||y.polyline.oriRepeatX,a||y.polyline.oriSpeed);return k}))});var l=t.getSceenLine(i,e,n);l&&(i.polyline.oriRepeat=l)}}},{key:"getSceenLine",value:function(t,e,i){var n=new Cesium.Cartesian2(0,this.sdk.viewer.canvas.clientHeight),o=new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth/2,this.sdk.viewer.canvas.clientHeight),s=this.sdk.viewer.camera.getPickRay(n),a=this.sdk.viewer.scene.globe.pick(s,this.sdk.viewer.scene),r=this.sdk.viewer.camera.getPickRay(o),l=this.sdk.viewer.scene.globe.pick(r,this.sdk.viewer.scene);if(a&&l){var c=Cesium.Cartesian3.distance(a,l)/t.polyline.width.getValue(),u=this.sdk.viewer.camera.positionCartographic.height,p=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),h=this.sdk.viewer.canvas.clientWidth,d=this.sdk.viewer.canvas.clientHeight,m=this.sdk.viewer.scene.camera.getPixelSize(p,h,d);return m>700?c*=m/u/(e.space*(i.width/i.height*5)+1):c=void 0,this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D?c:Re().viewer.entities.getById(this.options.id).polyline.oriRepeatX}}},{key:"create_arrow1_picture",value:function(t){var e=new fabric.Canvas("canvas");e.width=150,e.height=75;var i=t,n=new fabric.Polygon([{x:e.width,y:e.height/2},{x:e.width-35,y:e.height},{x:e.width-35,y:e.height-20},{x:e.width/2,y:e.height-20},{x:e.width/2,y:20},{x:e.width-35,y:20},{x:e.width-35,y:0}],{fill:i});return e.add(n),e.toDataURL()}},{key:"create_arrow2_picture",value:function(t){var e=new fabric.Canvas("canvas");e.width=75,e.height=75;var i=t,n=new fabric.Polygon([{x:e.width,y:e.height/2},{x:e.width-35,y:e.height},{x:e.width-35-40,y:e.height},{x:e.width-40,y:e.height/2},{x:e.width-35-40,y:0},{x:e.width-35,y:0}],{fill:i});return e.add(n),e.toDataURL()}},{key:"sampleHeightMostDetailed",value:function(t){var e=[];return t.forEach((function(t){e.push(new Cesium.Cartographic.fromDegrees(t.lng,t.lat))})),this.sdk.viewer.scene.sampleHeightMostDetailed(e)}},{key:"flyHome",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(pi(0),ii(this.sdk),ni(this.sdk),this.sdk.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE){var e=this.sdk.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE.destination,i=this.sdk.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE.orientation;this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.alt),orientation:{heading:Cesium.Math.toRadians(i.heading||0),pitch:Cesium.Math.toRadians(i.pitch||0),roll:Cesium.Math.toRadians(i.roll||0)},duration:t})}else this.sdk.viewer.camera.flyHome(t)}},{key:"setPickStatus",value:function(){}},{key:"create_point_buffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{steps:10},n=turf.point([Number(t.lng),Number(t.lat)]),o=turf.buffer(n,Number(e)/1e3,i);return o.geometry.coordinates}},{key:"create_line_buffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(1===t.length)return this.create_point_buffer(t[0],e);if(0===t.length)return!1;var i=[];t.forEach((function(t){i.push([Number(t.lng),Number(t.lat)])}));var n=turf.lineString(i),o=turf.buffer(n,Number(e)/1e3);return o.geometry.coordinates}},{key:"create_area_buffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(1===t.length)return this.create_point_buffer(t[0],e);if(0===t.length)return!1;if(2===t.length)return this.create_line_buffer(t,e);var i=[];t.forEach((function(t){i.push([Number(t.lng),Number(t.lat)])})),i.push(i[0]);var n=turf.polygon([i]),o=turf.buffer(n,Number(e)/1e3);return o.geometry.coordinates}},{key:"cal_envelope",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!(t.length<2)){var e=[];t.forEach((function(t){e.push(turf.point([t.lng,t.lat]))}));var i=turf.featureCollection(e);return turf.envelope(i).geometry.coordinates[0]}console.error("坐标数量不能少于2个")}},{key:"chunkLine",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if(t.length<2)return[];var i=[];t.forEach((function(t){i.push([t.lng,t.lat])}));var n=turf.lineString(i),o=turf.lineChunk(n,e/1e3),s=new Map;return o.features.forEach((function(t){t.geometry.coordinates.forEach((function(t){var e=t.join(","),i={lng:t[0],lat:t[1]};s.set(e,i)}))})),o.features}},{key:"billboardAnimation",value:function(t,e){var i=e.id,n=e.offset,o=void 0===n?10:n,s=(e.times,t.entities.getById(i));if(s){var a=Math.PI,r=a/60,l=0,c=this.cartesian3Towgs84(s.position.getValue(),t),u=setInterval((function(){l+=r;var t=o*Math.sin(l)+c.alt;l>a&&(l=0),s.position=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,t)}),30);setTimeout((function(){clearInterval(u),s.position=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt)}),3e3)}}},{key:"calSector",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:25,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:45,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:360,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=turf.point([t.lng,t.lat]),r=turf.sector(a,e/1e3,i,n,{steps:o}).geometry.coordinates,l=[];return r.forEach((function(t){t.forEach((function(t){var e;e=s?{lng:t[0],lat:t[1]}:Cesium.Cartesian3.fromDegrees(t[0],t[1]),l.push(e)}))})),l}},{key:"getClampToHeight",value:(t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=c.length>1&&void 0!==c[1]?c[1]:[],this.sdk&&this.sdk.viewer){t.next=3;break}return t.abrupt("return",0);case 3:return n=new Cesium.Cartesian3.fromDegrees(e.lng,e.lat),t.prev=4,t.next=7,this.sdk.viewer.scene.clampToHeight(n,i);case 7:if(t.t0=t.sent,t.t0){t.next=10;break}t.t0=n;case 10:o=t.t0,t.next=16;break;case 13:t.prev=13,t.t1=t.catch(4),o=n;case 16:return t.next=18,this.cartesian3Towgs84(o,this.sdk.viewer).alt;case 18:if(s=t.sent,r=0,t.prev=20,!this.sdk.viewer.scene.terrainProvider.availability){t.next=26;break}return t.next=24,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(e.lng,e.lat)]);case 24:(l=t.sent)[0].height&&(r=l[0].height);case 26:t.next=31;break;case 28:t.prev=28,t.t2=t.catch(20),r=0;case 31:if(!(s>r)){t.next=35;break}return t.abrupt("return",Number(s.toFixed(2)));case 35:return t.abrupt("return",Number(r.toFixed(2)));case 36:case"end":return t.stop()}}),t,this,[[4,13],[20,28]])}))),function(e){return t.apply(this,arguments)})},{key:"deepCopyObj",value:function(t){var e=null;if("object"==N()(t)&&null!==t)for(var i in e=t instanceof Array?[]:{},t)"earth"!=i&&"Dialog"!=i&&(e[i]=this.deepCopyObj(t[i]));else e=t;return e}},{key:"projConvert",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t?J(this.sdk,e):q()}},{key:"projectionConvert",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t?K(this.sdk,e):$()}},{key:"exportExcel",value:function(t){var e="";for(var i in t[0])e+=''.concat(i,"");e+="";for(var n,o='{rows}
        ',s=function(t,e){return t.replace(/{(\w+)}/g,(function(t,i){return e[i]}))},a="",r="",l=0;l",t[l])r+=s('{data}',{nameType:"String",data:t[l][c]});r+="",l>0&&l/6e4%1==0&&(a+=s(o,{rows:r,nameWS:"Sheet"+l}),r="",r+=e)}a+=s(o,{rows:r,nameWS:"Sheet"}),r="",n=s('Axel Richter{created}{worksheets}',{created:(new Date).getTime(),worksheets:a});var u,p=document.createElement("A");p.href="data:application/vnd.ms-excel;base64,"+(u=n,window.btoa(unescape(encodeURIComponent(u)))),p.download="矢量数据导出.xls",p.target="_blank",document.body.appendChild(p),p.click(),document.body.removeChild(p)}},{key:"decompressGzip",value:function(t){var e=pako.inflate(t);return(new TextDecoder).decode(e)}},{key:"cmykToRgb",value:function(t){var e=t.c,i=t.m,n=t.y,o=t.k,s={r:0,g:0,b:0};return s.c=e/100,s.m=i/100,s.y=n/100,s.k=o/100,s.r=1-Math.min(1,s.c*(1-s.k)+s.k),s.g=1-Math.min(1,s.m*(1-s.k)+s.k),s.b=1-Math.min(1,s.y*(1-s.k)+s.k),s.r=Math.round(255*s.r),s.g=Math.round(255*s.g),s.b=Math.round(255*s.b),"rgb(".concat(s.r,", ").concat(s.g,", ").concat(s.b,")")}},{key:"convertPxToRem",value:function(t,e){var i=parseFloat(getComputedStyle(document.documentElement).fontSize),n=[],o=[];if(e){n=document.getElementById(t.div_id).querySelectorAll(e);for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:[],e=t.length,i=0,n=0,o=0;o0&&i<0||n<0&&i>0)return!1;i=n}}return!0}},{key:"getDateTimeString",value:function(){var t=new Date,e=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0"),r=String(t.getMilliseconds()).padStart(3,"0");return"".concat(e).concat(i).concat(n).concat(o).concat(s).concat(a).concat(r)}},{key:"replaceHost",value:function(t,e){var i=t;if(!t||!e)return t;try{if(t.startsWith("http")){var n=/^[^@]+@/;n.test(t)&&(t=t.replace(n,"")),/^[a-z]+:\/\//i.test(t)||(t="http://"+t);var o=new URL(t),s=new URL(e),a=o.hostname,r=o.port;return a.startsWith("[")&&a.endsWith("]")&&(a=a.slice(1,-1)),"localhost"!==a&&"127.0.0.1"!==a||55110===parseInt(r,10)||(o.port=s.port,o.protocol=s.protocol,i=o.toString()),i}return t.includes(":")||this.options.host&&(i=new URL(t,this.options.host).href),i}catch(t){return i}}},{key:"message",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.type||"success",i=t.text||"",n=(t.duration,document.getElementById("YJ-custom-message"));n&&document.body.removeChild(n),n=document.createElement("div"),n.id="YJ-custom-message","success"==e?n.innerHTML='\n '.concat(i,"\n "):"warning"==e&&(n.innerHTML='\n '.concat(i,"\n ")),document.body.appendChild(n),n.classList.add(e)}}],[{key:"_md5",value:function(t){return j()(t).toUpperCase()}}]);var t,e,i}();function vi(t,e){var i=t.viewer;if(i)for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=t.color,this.duration=t.duration,this.fltr=t.fltr,this.image=t.image,this._time=(new Date).getTime()}Object.defineProperties(t.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},repeat:Cesium.createPropertyDescriptor("repeat"),color:Cesium.createPropertyDescriptor("color")}),t.prototype.getType=function(t){return"PolylineTrailLink"},t.prototype.getValue=function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrClonedDefault(this._color,t,Cesium.Color.BROWN,e.color),this.image?e.image=this.image:e.image=Cesium.Material.PolylineTrailLinkImage,this.duration&&(e.time=((new Date).getTime()-this._time)%this.duration/this.duration),!1===this.fltr?e.fltr=this.fltr:e.fltr=!0,e},t.prototype.equals=function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)},Cesium.PolylineTrailLinkMaterialProperty=t,Cesium.Material.PolylineTrailLinkType="PolylineTrailLink",Cesium.Material.PolylineTrailLinkImage=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#fa2020",e=512,i=32,n=new fabric.Canvas("canvas",{width:e,height:i}),o=new fabric.Rect({width:e,height:i}),s=new fabric.Gradient({type:"linear",gradientUnits:"pixels",coords:{x1:0,y1:0,x2:e,y2:0},colorStops:[{offset:.01,color:"rgba(246,241,241,0)"},{offset:1,color:t}]});return o.set("fill",s),n.add(o),n.toDataURL()}(),Cesium.Material.PolylineTrailLinkSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material =czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec4 colorImage = texture(image,vec2(fract(st.t - time), st.t));\n vec4 fragColor;\n fragColor.rgb = color.rgb / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.alpha = colorImage.a * color.a;\n material.diffuse = color.rgb/20.0;\n material.emission = fragColor.rgb;\n return material;\n }",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineTrailLinkType,{fabric:{type:Cesium.Material.PolylineTrailLinkType,uniforms:{color:new Cesium.Color(1,1,1,1),image:Cesium.Material.PolylineTrailLinkImage,time:0},source:Cesium.Material.PolylineTrailLinkSource},translucent:function(t){return!0}})}function bi(){var t,e,i,n,o,s,a,r;yi(),t=new fi,"undefined"!=typeof Cesium&&function(e){e.CustomMaterialSource=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(e.Color,e.defaultValue),o=Object.defineProperties,s=e.Event,a=e.createPropertyDescriptor,r=e.Property,l=e.Material,c=i.MaterialType||"wallType"+parseInt(1e3*Math.random()),u={color:new e.Color(1,1,1,1),image:i.image||t.getSourceRootPath()+"/img/material/arrow.png",time:i.time||0,repeat:new e.Cartesian2(100,100),fltr:!i.fltr&&!1!==i.fltr||i.fltr,is2D:!!i.is2D,isTranslucent:!i.isTranslucent&&!1!==i.isTranslucent||i.isTranslucent};if(this.code="",i.repeats)for(var p=e.Property.getValueOrDefault(i.repeats),h=0;h0&&void 0!==arguments[0]?arguments[0]:{};t=n(t,n.EMPTY_OBJECT),this._definitionChanged=new s,this._color=void 0,this._colorSubscription=void 0,this._repeat=void 0,this._repeats=void 0,this._repeatSubscription=void 0,this.image=t.image,this.is2D=!!t.is2D,this.color=new e.Color.fromCssColorString(t.color||"rgba(4,253,231,0.87)"),this.repeat=t.repeat,this.repeats=t.repeats,this.duration=t.duration||0===t.duration?t.duration:1e3,this.fltr=!t.fltr&&!1!==t.fltr||t.fltr,this._time=(new Date).getTime()}return o(d.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},repeat:e.createPropertyDescriptor("repeat"),color:a("color")}),d.prototype.getType=function(t){return c},d.prototype.getValue=function(t,i){if(e.defined(i)||(i={}),i.color=e.Property.getValueOrClonedDefault(this._color,t,e.Color.WHITE,i.color),i.time=this.duration?e.getTimestamp()%this.duration/this.duration:0,i.image=this.image,i.is2D=!!this.is2D,this.repeat&&(i.repeat=e.Property.getValueOrDefault(this.repeat)),this.repeats)for(var n=e.Property.getValueOrDefault(this.repeats),o=0;o0&&void 0!==arguments[0]?arguments[0]:{},i=(t.Color,t.defaultValue),n=Object.defineProperties,o=t.Event,s=t.createPropertyDescriptor,a=t.Property,r=t.Material,l=e.MaterialType||"wallType"+parseInt(1e3*Math.random());function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this.color=new t.Color.fromCssColorString(e.color||"rgba(4,253,231,0.87)")}return n(c.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:s("color")}),c.prototype.getType=function(t){return l},c.prototype.getValue=function(e,i){return t.defined(i)||(i={}),i.color=t.Property.getValueOrClonedDefault(this._color,e,t.Color.WHITE,i.color),i},c.prototype.equals=function(t){return this===t||t instanceof c&&a.equals(this._color,t._color)},r._materialCache.addMaterial(l,{fabric:{type:l,uniforms:{color:new t.Color(1,1,1,1)},source:"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.alpha = color.a;\n \n material.diffuse = color.rgb*0.0;\n material.emission = color.rgb;\n return material;\n }",components:{specular:1,diffuse:"vec3(0.0)"}},translucent:function(t){return!0}}),new c(e)}}(Cesium),function(){var t=new fi;"undefined"!=typeof Cesium&&function(e){e.CustomImageMaterialSource=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(e.Color,e.defaultValue),o=Object.defineProperties,s=e.Event,a=e.createPropertyDescriptor,r=e.Property,l=e.Material,c=i.MaterialType||"wallType"+parseInt(1e3*Math.random());function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=n(t,n.EMPTY_OBJECT),this._definitionChanged=new s,this._color=void 0,this._colorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.image=t.image,this.color=new e.Color.fromCssColorString(t.color||"rgba(4,253,231,0.87)"),this.repeat=t.repeat}return o(u.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},repeat:e.createPropertyDescriptor("repeat"),color:a("color")}),u.prototype.getType=function(t){return c},u.prototype.getValue=function(t,i){return e.defined(i)||(i={}),i.color=e.Property.getValueOrClonedDefault(this._color,t,e.Color.WHITE,i.color),i.image=this.image,i.repeat=e.Property.getValueOrDefault(this.repeat),i},u.prototype.equals=function(t){return this===t||t instanceof u&&r.equals(this._color,t._color)&&r.equals(this.repeat,t._repeat)},l._materialCache.addMaterial(c,{fabric:{type:c,uniforms:{color:new e.Color(1,1,1,1),image:i.image||t.getSourceRootPath()+"/img/material/arrow.png",repeat:new e.Cartesian2(100,100)},source:"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = repeat * materialInput.st;\n vec4 colorImage = texture(image, st);\n \n material.diffuse = colorImage.rgb * 0.0;\n material.emission = colorImage.rgb * 0.3;\n return material;\n }"}}),new u(i)}}(Cesium)}(),i=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._color=void 0,this._duration=void 0,this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.duration=e.duration||10,this.lineBackAlpha=e.lineBackAlpha||.05}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.FlowLineMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.duration=Cesium.Property.getValueOrDefault(this._duration,t,10,e.duration),e.lineBackAlpha=this.lineBackAlpha,e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._duration,e.duration)&&Cesium.Property.equals(this.lineBackAlpha,e.lineBackAlpha)}}])}(),Object.defineProperties(i.prototype,{color:Cesium.createPropertyDescriptor("color"),duration:Cesium.createPropertyDescriptor("duration"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha")}),Cesium.FlowLineMaterialProperty=i,Cesium.Material.FlowLineMaterialProperty="FlowLineMaterialProperty",Cesium.Material.FlowLineMaterialType="FlowLineMaterialType",Cesium.Material.FlowLineMaterialSource="\n uniform vec4 color;\n uniform float duration;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n //生成默认的基础材质\n czm_material material = czm_getDefaultMaterial(materialInput);\n //获取st(uv)\n vec2 st = materialInput.st;\n //获取当前帧数,10秒内变化0-1\n float time = fract(czm_frameNumber / (60.0*duration));\n //长度1/10\n time = time * (1.0 + 0.1);\n //平滑过渡函数\n float alpha = smoothstep(time-0.1,time,st.s) * step(-time,-st.s);\n //光带轨迹(不会完全透明)\n alpha += lineBackAlpha;\n material.alpha = alpha;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.FlowLineMaterialType,{fabric:{type:Cesium.Material.FlowLineMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),duration:10,lineBackAlpha:.05},source:Cesium.Material.FlowLineMaterialSource},translucent:function(t){return!0}}),n=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._color=void 0,this._speed=void 0,this._rotate=void 0,this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.speed=null!=e.speed?e.speed:1,this.lineBackAlpha=e.lineBackAlpha||.05,this.rotate=e.rotate}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.PolylineFlowMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.rotate=Cesium.Property.getValueOrDefault(this._rotate,t,!0,e.rotate),e.lineBackAlpha=this.lineBackAlpha,e.frameTime=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._speed,e.speed)&&Cesium.Property.equals(this.lineBackAlpha,e.lineBackAlpha)}}])}(),Object.defineProperties(n.prototype,{color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),rotate:Cesium.createPropertyDescriptor("rotate"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha")}),Cesium.PolylineFlowMaterialProperty=n,Cesium.Material.PolylineFlowMaterialProperty="PolylineFlowMaterialProperty",Cesium.Material.PolylineFlowMaterialType="PolylineFlowMaterialType",Cesium.Material.PolylineFlowMaterialSource="\n uniform vec4 color;\n uniform float speed;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n //生成默认的基础材质\n czm_material material = czm_getDefaultMaterial(materialInput);\n //获取st(uv)\n vec2 st = materialInput.st;\n //获取当前帧数,10秒内变化0-1\n // float time = fract(czm_frameNumber * speed / 60.0);\n // float time = fract(abs(speed) * czm_frameNumber * 0.01);\n float time = fract(frameTime / 1000.0 / abs(speed));\n //长度1/10\n // time = time * (1.0 + 0.1);\n float staticAlpha = rotate?smoothstep(0.0,1.0, 1.0-st.s) * step(-1.0,-(1.0-st.s)):smoothstep(0.0,1.0, st.s) * step(-1.0,-st.s);\n\n //平滑过渡函数\n float alpha1 = smoothstep(time-0.1,time,1.0-st.s) * step(-time,- (1.0-st.s));\n float alpha2 = smoothstep(time-0.1,time,st.s) * step(-time,- st.s);\n float alpha =(speed== 0.0)? staticAlpha:(speed < 0.0)?alpha2:alpha1;\n //光带轨迹(不会完全透明)\n alpha += lineBackAlpha;\n material.alpha = alpha;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineFlowMaterialType,{fabric:{type:Cesium.Material.PolylineFlowMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),speed:.1,rotate:!0,frameTime:Cesium.getTimestamp(),lineBackAlpha:.05},source:Cesium.Material.PolylineFlowMaterialSource},translucent:function(t){return!0}}),o=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._color=void 0,this._speed=void 0,this._rotate=void 0,this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.speed=null!=e.speed?e.speed:1,this.lineBackAlpha=e.lineBackAlpha||.05,this.rotate=e.rotate}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.PolylineFlowMultMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.rotate=Cesium.Property.getValueOrDefault(this._rotate,t,!0,e.rotate),e.lineBackAlpha=this.lineBackAlpha,e.frameTime=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._speed,e.speed)&&Cesium.Property.equals(this._rotate,e.rotate)&&Cesium.Property.equals(this.lineBackAlpha,e.lineBackAlpha)}}])}(),Object.defineProperties(o.prototype,{color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),rotate:Cesium.createPropertyDescriptor("rotate"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha")}),Cesium.PolylineFlowMultMaterialProperty=o,Cesium.Material.PolylineFlowMultMaterialProperty="PolylineFlowMultMaterialProperty",Cesium.Material.PolylineFlowMultMaterialType="PolylineFlowMultMaterialType",Cesium.Material.PolylineFlowMaterialSource="\n uniform vec4 color;\n uniform float speed;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n\n // 基础时间轴(控制主光带)\n float baseTime = fract(czm_frameNumber * speed / 60.0) * 1.1;\n\n // 高频时间轴(控制高光点)\n // float highlightTime = fract(czm_frameNumber * speed * 3.0 / 60.0);\n // float highlightTime = fract(abs(speed) * czm_frameNumber * 0.01);\n float highlightTime = fract(frameTime / 1000.0 / abs(speed));\n float highlightSpacing = 0.3; // 高光点间隔\n\n // 主光带透明度计算\n float mainAlpha = smoothstep(baseTime-0.1, baseTime, st.s) * step(-baseTime, -st.s);\n\n // 多高光点计算(3个周期性光斑)\n float highlight11 = smoothstep(highlightTime-0.05, highlightTime, st.s) *\n step(-highlightTime, -st.s) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(st.s - highlightTime)));\n\n float highlight21 = smoothstep(highlightTime+highlightSpacing-0.05,\n highlightTime+highlightSpacing, st.s) *\n step(-(highlightTime+highlightSpacing), -st.s) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(st.s - (highlightTime+highlightSpacing))));\n\n float highlight31 = smoothstep(highlightTime+2.0*highlightSpacing-0.05,\n highlightTime+2.0*highlightSpacing, st.s) *\n step(-(highlightTime+2.0*highlightSpacing), -st.s) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(st.s - (highlightTime+2.0*highlightSpacing))));\n\n\n float highlight12 = smoothstep(highlightTime-0.05, highlightTime, 1.0 - st.s) *\n step(-highlightTime, -(1.0-st.s)) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(1.0 - st.s - highlightTime)));\n\n float highlight22 = smoothstep(highlightTime+highlightSpacing-0.05,\n highlightTime+highlightSpacing, 1.0 - st.s) *\n step(-(highlightTime+highlightSpacing),-(1.0 - st.s)) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(1.0-st.s - (highlightTime+highlightSpacing))));\n\n float highlight32 = smoothstep(highlightTime+2.0*highlightSpacing-0.05,\n highlightTime+2.0*highlightSpacing, 1.0 - st.s) *\n step(-(highlightTime+2.0*highlightSpacing), -(1.0-st.s)) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(1.0 - st.s - (highlightTime+2.0*highlightSpacing))));\n\n\n float highlight1 = !rotate?highlight11:highlight12;\n float highlight2 = !rotate?highlight21:highlight22;\n float highlight3 = !rotate?highlight31:highlight32;\n // 合并效果\n // material.alpha = mainAlpha * 0.7 +\n // (highlight1 + highlight2 + highlight3) * 0.5 +\n // lineBackAlpha;\n material.alpha = (highlight1 + highlight2 + highlight3) * 0.5 +\n lineBackAlpha;\n material.diffuse = color.rgb; // 高光区变亮\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineFlowMultMaterialType,{fabric:{type:Cesium.Material.PolylineFlowMultMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),speed:.1,rotate:!0,frameTime:Cesium.getTimestamp(),lineBackAlpha:.05},source:Cesium.Material.PolylineFlowMaterialSource},translucent:function(t){return!0}}),s=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._color=void 0,this._speed=void 0,this._uType=void 0,this._space=void 0,this._dashSize=void 0,this._scale=void 0,this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.speed=null!=e.speed?e.speed:1,this.space=e.space||0,this.dashSize=e.dashSize||.03,this.uType=void 0===e.uType?1:e.uType,this.lineBackAlpha=e.lineBackAlpha||.05,this.scale=e.scale||1}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.FlowDashedLineMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.space=Cesium.Property.getValueOrDefault(this._space,t,10,e.space),e.dashSize=Cesium.Property.getValueOrDefault(this._dashSize,t,10,e.dashSize),e.uType=Cesium.Property.getValueOrDefault(this._uType,t,1,e.uType),e.scale=Cesium.Property.getValueOrDefault(this._scale,t,1,e.scale),e.lineBackAlpha=this.lineBackAlpha,e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._speed,e.speed)&&Cesium.Property.equals(this._uType,e.uType)&&Cesium.Property.equals(this._lineBackAlpha,e.lineBackAlpha)&&Cesium.Property.equals(this._scale,e.scale)}}])}(),Object.defineProperties(s.prototype,{color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),space:Cesium.createPropertyDescriptor("space"),dashSize:Cesium.createPropertyDescriptor("dashSize"),uType:Cesium.createPropertyDescriptor("uType"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha"),scale:Cesium.createPropertyDescriptor("scale")}),Cesium.FlowDashedLineFlowMaterialProperty=s,Cesium.Material.FlowDashedLineFlowMaterialProperty="FlowDashedLineFlowMaterialProperty",Cesium.Material.FlowDashedLineMaterialType="FlowDashedLineMaterialType",Cesium.Material.FlowDashedLineMaterialSource="\n uniform vec4 color;\n uniform float speed;\n // uniform int uType;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n\n float dashSize = 0.1;\n float gapSize = space;\n // speed现在表示完成一次完整动画循环的秒数\n float progress = speed==0.0 ? 0.0 : fract(frameNumber / 1000.0 / speed * scale);\n float pattern = fract(st.x / dashSize * (1.0 + gapSize) + progress / dashSize * (1.0 + gapSize));\n float dash1 = step(0.0, pattern) - step(1.0/(1.0 + gapSize), pattern);\n float dash2 = smoothstep(0.0, 0.2, pattern) -\n smoothstep(1.0/(1.0 + gapSize),\n 1.0/(1.0 + gapSize) + 0.2,\n pattern);\n float dash = (float(uType) != 1.0)?dash1:dash2;\n material.alpha = dash;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.FlowDashedLineMaterialType,{fabric:{type:Cesium.Material.FlowDashedLineMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),speed:1,space:0,scale:1,dashSize:.03,frameNumber:Cesium.getTimestamp(),uType:1,lineBackAlpha:.05},source:Cesium.Material.FlowDashedLineMaterialSource},translucent:function(t){return!0}}),a=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._image=void 0,this._color=void 0,this._speed=void 0,this._repeat=void 0,this.image=e.image||"",this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.speed=null!=e.speed?e.speed:1,this.repeat=e.repeat||new Cesium.Cartesian2(1,1)}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.LineTextureMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.image=Cesium.Property.getValueOrDefault(this._image,t,"",e.image),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,1,e.speed),e.repeat=Cesium.Property.getValueOrDefault(this._repeat,t,new Cesium.Cartesian2(1,1),e.repeat),e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._image,e._image)&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._imageW,e._imageW)&&Cesium.Property.equals(this._speed,e._speed)}}])}(),Object.defineProperties(a.prototype,{image:Cesium.createPropertyDescriptor("image"),color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),repeat:Cesium.createPropertyDescriptor("repeat")}),Cesium.LineTextureMaterialProperty=a,Cesium.Material.LineTextureMaterialProperty="LineTextureMaterialProperty",Cesium.Material.LineTextureMaterialType="LineTextureMaterialType",Cesium.Material.LineTextureMaterialSource="\n uniform vec4 color;\n uniform sampler2D image;\n uniform float speed;\n // uniform float repeat;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n st.s *= repeat.x; // 关键:通过repeat控制纹理密度\n // vec4 colorImage = texture2D(image, vec2(fract(st.s + speed*czm_frameNumber* 0.01), st.t));\n vec4 colorImage = speed==0.0?texture2D(image, vec2(fract(st.s), st.t)):texture2D(image, vec2(fract(st.s + frameNumber / 1000.0 / speed * repeat.x / repeat.y ), st.t));\n material.alpha = colorImage.a * color.a;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.LineTextureMaterialType,{fabric:{type:Cesium.Material.LineTextureMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),image:"",repeat:new Cesium.Cartesian2(1,1),speed:1,frameNumber:Cesium.getTimestamp(),uTime:1},source:Cesium.Material.LineTextureMaterialSource},translucent:function(t){return!0}}),r=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._image=void 0,this._repeat=void 0,this._stRotation=void 0,this._repeatLength=void 0,this.image=e.image||"",this.repeat=e.repeat||1,this.stRotation=e.stRotation||0}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.RoadTextureMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.image=Cesium.Property.getValueOrDefault(this._image,t,"",e.image),e.repeat=Cesium.Property.getValueOrDefault(this._repeat,t,1,e.repeat),e.stRotation=Cesium.Property.getValueOrDefault(this._stRotation,t,0,e.stRotation),console.log(e,"result"),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._image,e._image)&&Cesium.Property.equals(this._repeat,e._repeat)&&Cesium.Property.equals(this._stRotation,e._stRotation)}}])}(),Object.defineProperties(r.prototype,{image:Cesium.createPropertyDescriptor("image"),repeat:Cesium.createPropertyDescriptor("repeat"),repeatLength:Cesium.createPropertyDescriptor("stRotation")}),Cesium.RoadTextureMaterialProperty=r,Cesium.Material.RoadTextureMaterialProperty="RoadTextureMaterialProperty",Cesium.Material.RoadTextureMaterialType="RoadTextureMaterialType",Cesium.Material.RoadTextureMaterialSource="\n uniform sampler2D image;\n uniform float repeat;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n st.s *= repeat;\n mat2 rot = mat2(cos(stRotation), -sin(stRotation), sin(stRotation), cos(stRotation));\n vec2 newSt = rot * (st - 0.5) + 0.5;\n\n vec4 colorImage = texture2D(image, newSt);\n material.diffuse = colorImage.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.RoadTextureMaterialType,{fabric:{type:Cesium.Material.RoadTextureMaterialType,uniforms:{image:"",repeat:1,stRotation:0},source:Cesium.Material.RoadTextureMaterialSource},translucent:function(t){return!0}})}var Ci=function(){return _()((function t(e,i){k()(this,t),this.dom=e,this.playerUrl=i.url,this.init()}),[{key:"init",value:function(){this.flvPlayer=flvjs.createPlayer({type:"flv",url:this.playerUrl,isLive:!0,hasAudio:!1,hasVideo:!0},{enableWorker:!0,enableStashBuffer:!1,stashInitialSize:128}),this.flvPlayer.attachMediaElement(this.dom),this.flvPlayer.load()}},{key:"on",value:function(t,e,i){this.flvPlayer.on(flvjs[t][e],i)}},{key:"destroy",value:function(){this.flvPlayer.destroy(),this.flvPlayer=null}}])}(),wi=function(){return _()((function t(e,i){k()(this,t),this.dom=e,this.url=i.url,this.init()}),[{key:"init",value:function(){this.player=new Jessibuca({container:this.dom,decoder:this.getSourceRootPath()+"/3rdparty/jessibuca/decoder.js",timeout:30,heartTimeout:30,heartTimeoutReplay:!1,loadingTimeout:30,loadingTimeoutReplay:!1,wasmDecodeErrorReplay:!1,videoBuffer:.2,isResize:!1,text:"",loadingText:"",useMSE:!1,debug:!0,showBandwidth:!1,operateBtns:{fullscreen:!1,screenshot:!1,play:!1,audio:!1,recorder:!1},forceNoOffscreen:!1,isNotMute:!1}),this.player.play(this.url)}},{key:"on",value:function(t,e){this.player.on(t,e)}},{key:"destroy",value:function(){this.player.destroy(),this.player=null}},{key:"getSourceRootPath",value:function(){var t=document.querySelectorAll("script"),e="";return t.forEach((function(t){if(t.src&&t.src.indexOf("YJEarth.min.js")>-1){var i=t.src.split("/");i.pop(),e=i.join("/")}})),e}}])}();function ki(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function xi(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var _i=/^[og]\s*(.+)?/,Ei=/^mtllib /,Si=/^usemtl /,Di=/^usemap /,Pi=/\s+/,Mi={red:1,green:1,blue:1,alpha:1};function Oi(){var t={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(t,e){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=!1!==e);var i=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:!1!==e,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(t,e){var i=this._finalize(!1);i&&(i.inherited||i.groupCount<=0)&&this.materials.splice(i.index,1);var n={index:this.materials.length,name:t||"",mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:"",smooth:void 0!==i?i.smooth:this.smooth,groupStart:void 0!==i?i.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(t){var e={index:"number"==typeof t?t:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return e.clone=this.clone.bind(e),e}};return this.materials.push(n),n},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(var i=this.materials.length-1;i>=0;i--)this.materials[i].groupCount<=0&&this.materials.splice(i,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}},i&&i.name&&"function"==typeof i.clone){var n=i.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(t,e){var i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},parseNormalIndex:function(t,e){var i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},parseUVIndex:function(t,e){var i=parseInt(t,10);return 2*(i>=0?i-1:i+e/2)},addVertex:function(t,e,i){var n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[i+0],n[i+1],n[i+2])},addVertexPoint:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addVertexLine:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addNormal:function(t,e,i){var n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[i+0],n[i+1],n[i+2])},addFaceNormal:function(t,e,i){console.warn("addFaceNormal")},addColor:function(t,e,i){var n=this.colors,o=this.object.geometry.colors;void 0!==n[t]&&o.push(n[t+0],n[t+1],n[t+2]),void 0!==n[e]&&o.push(n[e+0],n[e+1],n[e+2]),void 0!==n[i]&&o.push(n[i+0],n[i+1],n[i+2])},addUV:function(t,e,i){var n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[i+0],n[i+1])},addDefaultUV:function(){var t=this.object.geometry.uvs;t.push(0,0),t.push(0,0),t.push(0,0)},addUVLine:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])},addFace:function(t,e,i,n,o,s,a,r,l){var c=this.vertices.length,u=this.parseVertexIndex(t,c),p=this.parseVertexIndex(e,c),h=this.parseVertexIndex(i,c);if(this.addVertex(u,p,h),this.addColor(u,p,h),void 0!==a&&""!==a){var d=this.normals.length;u=this.parseNormalIndex(a,d),p=this.parseNormalIndex(r,d),h=this.parseNormalIndex(l,d),this.addNormal(u,p,h)}else this.addFaceNormal(u,p,h);if(void 0!==n&&""!==n){var m=this.uvs.length;u=this.parseUVIndex(n,m),p=this.parseUVIndex(o,m),h=this.parseUVIndex(s,m),this.addUV(u,p,h),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(t){this.object.geometry.type="Points";for(var e=this.vertices.length,i=0,n=t.length;i=7?(Cesium.Color.fromBytes(parseFloat(u[4]),parseFloat(u[5]),parseFloat(u[6]),1,Mi),n.colors.push(Mi.red,Mi.green,Mi.blue)):n.colors.push(void 0,void 0,void 0);break;case"vn":n.normals.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3]));break;case"vt":n.uvs.push(parseFloat(u[1]),parseFloat(u[2]))}}else if("f"===c){for(var p=l.slice(1).trim().split(Pi),h=[],d=0,m=p.length;d0){var v=f.split("/");h.push(v)}}for(var g=h[0],y=1,b=h.length-1;y1){var M=s[1].trim().toLowerCase();n.object.smooth="0"!==M&&"off"!==M}else n.object.smooth=!0;var O=n.object.currentMaterial();O&&(O.smooth=n.object.smooth)}else{if("\0"===l)continue;console.warn('Unexpected line: "'+l+'"')}}}n.finalize();var T=new Ai(this.context,this.hls,this.videoId,this.host,i);if(!0===!(1===n.objects.length&&0===n.objects[0].geometry.vertices.length))for(var N=0,B=n.objects.length;N0&&(d=!0),i.colors.length>0&&(m=!0),!0===i.hasUVIndices&&(f=!0),d&&(u+="attribute vec3 normal;\n",u+="varying vec3 v_normal;\n",p+="varying vec3 v_normal;\n",h+="v_normal = normal;\n"),m&&(u+="attribute vec3 color;\n",u+="varying vec2 v_color;\n",p+="varying vec2 v_color;\n",h+="v_color = color;\n"),f&&(u+="attribute vec2 uv;\n",u+="varying vec2 v_uv;\n",p+="varying vec2 v_uv;\n",h+="v_uv = uv;\n"),u+="\n void main() {\n gl_Position = czm_modelViewProjection * vec4(position, 1.);\n ".concat(h,"\n }\n "),p+="\n\t\tuniform sampler2D colorTexture;\n void main() {\n\t\t\t vec4 color = texture2D(colorTexture, v_uv);\n\t\t\t\t\t\tgl_FragColor = color;\n }\n ",this.program=Cesium.ShaderProgram.fromCache({context:e,vertexShaderSource:u,fragmentShaderSource:p}),this.uniformMap={};var v=this;c.then((function(t){for(var e=function(){var e=t[i].diffusemap;r.uniformMap.colorTexture=function(){return e}},i=0;i0){o++;var a=Cesium.Buffer.createVertexBuffer({context:e,typedArray:Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT,i.normals),usage:Cesium.BufferUsage.STATIC_DRAW});n.push({index:o,enabled:!0,vertexBuffer:a,componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1})}if(i.colors.length>0){o++;var r=Cesium.Buffer.createVertexBuffer({context:e,typedArray:Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT,i.colors),usage:Cesium.BufferUsage.STATIC_DRAW});n.push({index:o,enabled:!0,vertexBuffer:r,componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1})}if(!0===i.hasUVIndices){o++;var l=Cesium.Buffer.createVertexBuffer({context:e,typedArray:Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT,i.uvs),usage:Cesium.BufferUsage.STATIC_DRAW});n.push({index:o,enabled:!0,vertexBuffer:l,componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:2,normalize:!1})}var c=new Cesium.VertexArray({context:e,attributes:n}),u=Cesium.RenderState.fromCache({cull:{enabled:!1},depthMask:!0,depthTest:{enabled:!0}});this.drawCommand=new Cesium.DrawCommand({owner:this,primitiveType:Cesium.PrimitiveType.TRIANGLES,vertexArray:c,renderState:u,pass:Cesium.Pass.OPAQUE})}),[{key:"setMaterial",value:function(t){this.material=t,t.setCommand(this.drawCommand)}},{key:"update",value:function(t){Cesium.defined(this.material)&&this.material.ready&&t.commandList.push(this.drawCommand)}},{key:"updateVideo",value:function(t,e,i){var n=!1;if(Cesium.defined(this.material)&&this.material.ready)if(i.computeVisibility(this.drawCommand.boundingVolume)>=0&&this.material.ready){var o=t.distanceToBoundingSphere(this.drawCommand.boundingVolume),s=e.width,a=e.height;o>=20&&o<100?(s=e.width/2,a=e.height/2):o>=100&&(s=e.width/10,a=e.height/10),n=!0,this.material.updateColorTexture(e,Math.floor(s),Math.floor(a))}else n=!1;this.lastState=n}}])}(),Li=new WeakMap,Ai=function(){return _()((function t(e,i,n,o,s){k()(this,t),ki(this,Li,!0),this.context=e,this.videoId=n,this.host=o,this._modelMatrix=Cesium.Matrix4.IDENTITY,this.parent=null,this.children=[],this.video={dom:null,playing:!1,timeupdate:!1,width:0,height:0,tracks:null},this.time=0,this.name=s}),[{key:"show",get:function(){return e=this,(t=Li).get(xi(t,e));var t,e},set:function(t){var e,i,n;"boolean"==typeof t?(i=this,n=t,(e=Li).set(xi(e,i),n),t?this.video.player&&this.video.player.getVueInstance().play():this.video.player&&this.video.player.getVueInstance().pause()):console.error("参数必须为boolean")}},{key:"requestVideoResource",value:function(){var t=this,e="",i=(e=this.host.endsWith("yjearth4.0")?this.host:this.host+"/yjearth4.0")+"/videoFusion/"+this.videoId;return fetch(i,{method:"get",headers:{"Content-Type":"application/json"}}).then(function(){var i=o()(a.a.mark((function i(n){var s;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,n.text();case 2:if(s=i.sent,s=JSON.parse(s),![0,200].includes(s.code)){i.next=13;break}if(!s.data.deviceCode.length){i.next=9;break}return i.abrupt("return",fetch(e+"/videoFusion/vide/stream",{method:"post",body:JSON.stringify({type:"flv",deviceCode:s.data.deviceCode}),headers:{"Content-Type":"application/json"}}).then(function(){var e=o()(a.a.mark((function e(i){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.text();case 2:if(n=e.sent,n=JSON.parse(n),![0,200].includes(n.code)){e.next=9;break}return n.data.url.length?(t.video.player.url=n.data.url,t.setFlvVideo(n.data.url)):console.warn("地址不存在"),e.abrupt("return");case 9:return console.warn(n.msg||n.message),e.abrupt("return");case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 9:console.warn("设备不存在");case 10:return i.abrupt("return");case 13:return console.warn(s.msg||s.message),i.abrupt("return");case 15:case"end":return i.stop()}}),i)})));return function(t){return i.apply(this,arguments)}}())}},{key:"modelMatrix",get:function(){return this._modelMatrix},set:function(t){this._modelMatrix=t.clone(),this.updateModelMatrix()}},{key:"updateModelMatrix",value:function(){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{};k()(this,t);var n,o,s,a,r,l=this,c={el:i.el,size:"mini",isLog:!1,disabled:i.disabled||!1,alpha:!1,clickDefineColor:p,hasClear:!0,openPickerAni:"opacity",defaultColor:i.defaultColor,pickerInputChange:v,startMainCallback:function(t){l.colorPicker&&(l.colorPicker.picker.style.opacity=0),setTimeout((function(){u()}),0)}};function u(){if(l.colorPicker&&l.colorPicker.picker){var t=!1,e=l.colorPicker.box,c=l.colorPicker.picker,u=e.getBoundingClientRect().x,m=e.getBoundingClientRect().y,g=0;c.style.left=u+"px",c.style.minWidth="325px";var y=c.getElementsByClassName("ew-alpha-slider-bar")[0];y&&(y.parentNode.style.width="16px",y.parentNode.removeChild(y));var b=document.createElement("div");b.className="icon-pen-box",b.innerHTML='',b.style.display="none",b.style.cursor="unset";var C=l.colorPicker.pickerInput;C.parentNode.insertBefore(b,C),C.style.width="188px",C.style.display="none";var w=document.createElement("div"),k=document.createElement("div");k.className="row",k.style.margin="6px 0 0 0",k.innerHTML='\n
        R
        \n
        G
        \n
        B
        \n
        \n ';var x=document.createElement("div");x.className="row",x.innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n
        \n ',w.appendChild(k),w.appendChild(x);var _=x.getElementsByTagName("input");_[0].style.width="72px",_[1].style.width="72px",_[2].style.width="72px",n=_[0],o=_[1],s=_[2];var E=c.getElementsByClassName("ew-color-dropbtns")[0];if(c.insertBefore(w,E),n.addEventListener("blur",(function(t){var e=t.target.value;(t.target.value||"undefined"!==t.target.dataset.null&&""!==t.target.dataset.null&&!Boolean(t.target.dataset.null))&&(e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&eNumber(t.target.max)&&(e=Number(t.target.max)),t.target.min&&eNumber(t.target.max)&&(e=Number(t.target.max)),t.target.min&&eR\n
        G
        \n
        B
        \n
        A
        \n
        \n ',x.appendChild(S),a.addEventListener("blur",(function(t){var e=t.target.value;(t.target.value||"undefined"!==t.target.dataset.null&&""!==t.target.dataset.null&&!Boolean(t.target.dataset.null))&&(e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e',B.className="yj-pre-collect-color add";var L=document.createElement("div");L.innerHTML='',L.className="yj-pre-collect-color subtract";var A=L.getElementsByClassName("icon-minus")[0],j=L.getElementsByClassName("icon-confirm")[0];N.appendChild(B),N.appendChild(L);var I=[],R=function(t){var e=document.createElement("div");e.className="yj-pre-collect-color",e.setAttribute("tabindex","0"),e.setAttribute("color-box-id",l.colorPicker.uid);var i=document.createElement("div");i.className="yj-pre-define-color-item",e.appendChild(i),i.className="yj-pre-define-color-item";var n=Cesium.Color.fromCssColorString(M[t]).toCssHexString();i.style.backgroundColor=n,i.addEventListener("click",(function(t){l.colorPicker.updateColor(t),e.className="yj-pre-collect-color yj-pre-collect-color-active",p(n)})),e.addEventListener("blur",(function(t){e.className="yj-pre-collect-color"}));var o=document.createElement("div");o.className="yj-pre-define-color-item subtract-btn",o.innerHTML='',o.style.display="none",e.appendChild(o),N.appendChild(e),o.addEventListener("click",(function(){delete M[t],localStorage.setItem("custom-color",JSON.stringify(M)),N.removeChild(e)})),I.push(o)};for(var F in M)R(F);B.addEventListener("click",(function(){if(t){t=!1;for(var e=0;ewindow.innerHeight?c.style.top=m-g+"px":c.style.top=m+e.offsetHeight+4+"px",l.colorPicker.pancelTop=parseFloat(c.style.top)-2,v(Cesium.Color.fromCssColorString(l.colorPicker.config.defaultColor||"#ffffff").toCssHexString())}}function p(t){if(a){var e=Cesium.Color.fromCssColorString(t);a.value=parseInt(100*Number(e.alpha.toFixed(2)))/100}}function h(t){var e,i,n,o=t.a,s=Math.round(t.h),a=Math.round(255*t.s/100),r=Math.round(255*t.b/100);if(0===a)e=i=n=r;else{var l=(255-a)*r/255,c=s%60*(r-l)/60;360===s?(e=r,i=n=0):s<60?(e=r,i=l+c,n=l):s<120?(e=r-c,i=r,n=l):s<180?(e=l,i=r,n=l+c):s<240?(e=l,i=r-c,n=r):s<300?(e=l+c,i=l,n=r):s<360?(e=r,i=l,n=r-c):e=i=n=0}return"rgba("+Math.round(e)+","+Math.round(i)+","+Math.round(n)+","+o+")"}function d(t){var e={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"};if(/rgba?/.test(t)){var i=t.replace(/rgba?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n="";return i[3],i.map((function(t,i){i<=2&&(n+=function(t){t=Math.min(Math.round(t),255);var i=Math.floor(t/16),n=t%16;return""+(e[i]||i)+(e[n]||n)}(t))})),"#"+n}}function m(t,e){var i=t.toLowerCase(),n=t.length,o=[];i=Cesium.Color.fromCssColorString(i).toCssHexString().substring(0,7);if(t&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(i)){if(4===n){for(var s="#",a=1;a=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Vi(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),Wi(this,Ji,void 0),this.div_id=e,this.entityMap=new Map,this._entityZIndex=0,this.viewer=null,this.options=Ui({},i),ui(ci()),this.proj=new R,this.clickTextDom=void 0,this.isLeftClick=!1,this.init(),Ri()}),[{key:"addIncetance",value:function(t,e){this.entityMap.set(t+"",e)}},{key:"getIncetance",value:function(t){return this.entityMap.get(t+"")}},{key:"removeIncetance",value:function(t){this.entityMap.delete(t),function(t){at.delete(t)}(this),function(t){rt.delete(t)}(this),function(t){lt.delete(t)}(this),se(this,t)}},{key:"setDefaultView",value:function(t){t?(this.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE={destination:t.destination||{},orientation:t.orientation||{}},ii(this),ni(this),this.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(t.destination.lng,t.destination.lat,t.destination.alt),orientation:{heading:Cesium.Math.toRadians(t.orientation.heading||0),pitch:Cesium.Math.toRadians(t.orientation.pitch||0),roll:Cesium.Math.toRadians(t.orientation.roll||0)},duration:0})):(this.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE=void 0,Cesium.Camera.DEFAULT_VIEW_RECTANGLE=Cesium.Rectangle.fromDegrees(89.5,10.4,110.4,61.2),this.viewer.camera.setView({destination:Cesium.Camera.DEFAULT_VIEW_RECTANGLE}))}},{key:"init",value:function(){var t=this,e=new Cesium.Ellipsoid(6378137,6378137,6356752.314140356),i=new Cesium.GeographicProjection(e),n=this;this.options={imageryProvider:new Cesium.TileMapServiceImageryProvider({url:Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII")}),baseLayerPicker:!1,geocoder:!1,animation:!1,fullscreenButton:!1,navigationHelpButton:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,shouldAnimate:!0,mapProjection:i},Number(Cesium.VERSION.split(".")[1])>=107?this.options.baseLayer=Cesium.ImageryLayer.fromProviderAsync(Cesium.TileMapServiceImageryProvider.fromUrl(Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"))):this.options.imageryProvider=new Cesium.TileMapServiceImageryProvider({url:Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII")}),this.options.contextOptions={webgl:{depth:!0,stencil:!0,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,failIfMajorPerformanceCaveat:!0},requestWebgl2:!0},Cesium.RequestScheduler.maximumRequests=500,this.viewer=new Cesium.Viewer(this.div_id,this.options),this.viewer.scene.imageryLayers._layers[0].notes="default-base-map",this.viewer._shadows=this.viewer.shadows,this.viewer.scene.screenSpaceCameraController.maximumZoomDistance=5e7,this.viewer.scene.globe.translucency.enabled=!0;var o=new fi;this.viewer.scene.skyBox=new Cesium.SkyBox({sources:{negativeX:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_mx.jpg",negativeY:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_my.jpg",negativeZ:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_mz.jpg",positiveX:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_px.jpg",positiveY:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_py.jpg",positiveZ:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_pz.jpg"}}),bi();for(var s=[{name:"思源黑体",value:"SourceHanSansTi",url:o.getSourceRootPath()+"/custom/fonts/SourceHanSansCN-Medium.otf",format:"opentype"},{name:"庞门正道标题体",value:"PMZDBTTi",url:o.getSourceRootPath()+"/custom/fonts/PangMenZhengDaoBiaoTiTi-1.ttf",format:"truetype"},{name:"数黑体",value:"AlimamaShuHeiTi",url:o.getSourceRootPath()+"/custom/fonts/AlimamaShuHeiTi-Bold.ttf",format:"truetype"}],a=0;a=1e3?(i.billboard.scale=1.5,i.label.pixelOffset=new Cesium.Cartesian2(-28,-46)):t.length>=100?(i.billboard.scale=1.25,i.label.pixelOffset=new Cesium.Cartesian2(-21,-40)):t.length>=50?(i.billboard.scale=1.1,i.label.pixelOffset=new Cesium.Cartesian2(-16,-36)):t.length>=40?(i.billboard.scale=1.05,i.label.pixelOffset=new Cesium.Cartesian2(-16,-34)):t.length>=30?(i.billboard.scale=1,i.label.pixelOffset=new Cesium.Cartesian2(-16,-32)):t.length>=20?(i.billboard.scale=.95,i.label.pixelOffset=new Cesium.Cartesian2(-16,-30)):t.length>=10?(i.billboard.scale=.9,i.label.pixelOffset=new Cesium.Cartesian2(-16,-28)):(i.billboard.scale=.8,i.label.pixelOffset=new Cesium.Cartesian2(-11,-25))}));var n=t.clustering.pixelRange;t.clustering.pixelRange=0,t.clustering.pixelRange=n}();var a={pixelRange:15,minimumClusterSize:2};function r(e){Cesium.knockout.getObservable(a,e).subscribe((function(i){t.clustering[e]=i}))}Cesium.knockout.track(a),r("pixelRange"),r("minimumClusterSize")}))}(this.viewer),E(this.viewer);Cesium.viewerCesiumNavigationMixin(this.viewer,{resetTooltip:"重置视图",zoomInTitle:"缩小",zoomOutTitle:"放大"});function l(t){var e=t.indexOf("px");return Number(t.slice(0,e))}setTimeout((function(){var e=document.getElementsByClassName("compass-outer-ring")[0],i=document.getElementsByClassName("navigation-controls")[0];e.addEventListener("mousedown",(function(){ii(t),ni(t)})),i.addEventListener("mousedown",(function(){ii(t),ni(t)}))}),0),this.viewer.imageryLayers.layerAdded.addEventListener((function(){for(var e=0;e-1;i--){var o=l(e[i].style.left),s=l(e[i].style.top),a=1*e[i].clientWidth,r=1*e[i].clientHeight,c=t.position.x,u=t.position.y;if(c>o&&cs&&u1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),this.sdk=e,this.primitives={building:[],unit:[],dth:[]},this.options=Zi({},i),this.options.host=this.options.host||h(),this.temporaryDth=[],this.dth={},this.PickBuildingEvent=new Cesium.Event,this.initEvents(),this.activeBuilding}),[{key:"PickCallback",value:function(t,e){this.PickBuildingEvent.addEventListener(e,t)}},{key:"initEvents",value:function(){var t=this;new Cesium.ScreenSpaceEventHandler(this.sdk.viewer.scene.canvas).setInputAction((function(e){if(!YJ.Measure.GetMeasureStatus()&&t.isActivate){var i=t.sdk.viewer.scene.pick(e.position);if(i){if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&("yj-dth-dth"==i.id.type||"yj-dth-highlight"==i.id.type))return void t.getIDBypickFeature(i);if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&"yj-dth-unit"==i.id.type)return t.highlightPrimitive&&t.sdk.viewer.scene.primitives.remove(t.highlightPrimitive),void t.handlePickEvent(i.id)}t.highlightPrimitive&&t.sdk.viewer.scene.primitives.remove(t.highlightPrimitive);var n=t.sdk.viewer.scene.pickPosition(e.position);if(n){var o=Cesium.Cartographic.fromCartesian(n),s=[Cesium.Math.toDegrees(o.longitude),Cesium.Math.toDegrees(o.latitude)];t.queryByPoint(s,o.height)}}}),Cesium.ScreenSpaceEventType.LEFT_CLICK);var e=this.sdk.viewer.entities.getOrCreateEntity("yj-dth-cover-label");e.show=!1;var i,n=0,o=this;function s(t){var i=o.sdk.viewer.scene.pick(t.endPosition);if(i){var n="";if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&("yj-dth-dth"===i.id.type||"yj-dth-highlight"===i.id.type))n=i.id.build_info.name+" - "+i.id.unit_info.name+" - "+i.id.room_num;else if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&"yj-dth-unit"===i.id.type)i.id.build_info.name&&(n=i.id.build_info.name+" - "+i.id.name);else{if(!(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&"yj-dth-build"===i.id.type))return i.primitive&&i.primitive.id&&i.primitive.id.id&&"yj-dth-cover-label"===i.primitive.id.id?void(e.position=o.sdk.viewer.scene.pickPosition(t.endPosition)):void(e.show=!1);i.id.name&&(n=i.id.name)}n&&(e.position=o.sdk.viewer.scene.pickPosition(t.endPosition),e.label=new Cesium.LabelGraphics({text:n,font:"20px Helvetica",pixelOffset:{x:0,y:-30},fillColor:Cesium.Color.fromCssColorString("#ffffff"),outlineColor:Cesium.Color.BLACK,outlineWidth:1,showBackground:!0,backgroundColor:Cesium.Color.fromCssColorString("#000000").withAlpha(.8),style:Cesium.LabelStyle.FILL_AND_OUTLINE,disableDepthTestDistance:Number.POSITIVE_INFINITY}),e.show=!0)}}new Cesium.ScreenSpaceEventHandler(this.sdk.viewer.scene.canvas).setInputAction((function(t){if(!YJ.Measure.GetMeasureStatus())try{var e=Date.now();if(e-n<100)return clearTimeout(i),void(i=setTimeout((function(){s(t)}),100));clearTimeout(i),n=e,s(t)}catch(t){}}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}},{key:"queryByUserInfo",value:function(t){this.queryByPoint([t.position.lng,t.position.lat],t.position.alt,t.id)}},{key:"queryByPoint",value:(s=o()(a.a.mark((function t(e){var i,n,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="",i=this.options.host.endsWith("yjearth4.0")?this.options.host+"/api/v1/dth/build/query_by_point":this.options.host+"/yjearth4.0/api/v1/dth/build/query_by_point",i+="?point="+JSON.stringify({lng:e[0],lat:e[1]}),t.next=5,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 5:if(200!==(n=t.sent).status){t.next=11;break}return t.next=9,n.json();case 9:200===(o=t.sent).code||0===o.code?this.processQueryByPointResults(o.data):window.ELEMENT&&window.ELEMENT.Message({message:o.msg||o.message,type:"warning",duration:1500});case 11:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"processQueryByPointResults",value:(n=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=p.length>2&&void 0!==p[2]?p[2]:{heading:0,pitch:-90,roll:0},e.build_info&&this.handlePickEvent(e),this.clearAllDthPrimitive(),this.clearAllUnitPrimitive(),this.activeBuilding&&(this.clearBuildingPrimitive(this.activeBuilding),this.activeBuilding=null),!e.build_info){t.next=26;break}if(o=JSON.parse(e.build_info.range),e.dan_yuan.length>0)for(s=0;s0?this.addDthPrimitive(e.dan_yuan[s].children,e.build_info,e.dan_yuan[s]):this.addUnitPrimitive([e.dan_yuan[s]],e.build_info,e.dan_yuan[s]);else this.activeBuilding=e.build_info.ID||e.build_info.id,this.addBuildingPrimitive([e.build_info]);if(!i){t.next=26;break}if(e.info&&e.info.dan_yuan&&(o=JSON.parse(e.info.dan_yuan.range)),!e.info||!e.info.hu){t.next=25;break}for(o=JSON.parse(e.info.hu.range),r=0;r=0;e--)if(t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.ID||t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.id){this.sdk.viewer.scene.primitives.remove(this.primitives.building[e]),this.primitives.building.splice(e,1);break}}},{key:"clearAllBuildingPrimitive",value:function(){for(var t=this.primitives.building.length-1;t>=0;t--)this.sdk.viewer.scene.primitives.remove(this.primitives.building[t]);this.primitives.building=[]}},{key:"addUnitPrimitive",value:(e=o()(a.a.mark((function t(e,i,n){var o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(o=0;o=0;e--)if(t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.ID||t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.id){this.sdk.viewer.scene.primitives.remove(this.primitives.unit[e]),this.primitives.unit.splice(e,1);break}}},{key:"clearAllUnitPrimitive",value:function(){for(var t=this.primitives.unit.length-1;t>=0;t--)this.sdk.viewer.scene.primitives.remove(this.primitives.unit[t]);this.primitives.unit=[]}},{key:"addDthPrimitive",value:function(t,e,i){for(var n=0;n=0;e--)t!==this.primitives.dth[e]._primitiveOptions.geometryInstances[0].id.ID&&t!==this.primitives.dth[e]._primitiveOptions.geometryInstances[0].id.id||(this.sdk.viewer.scene.primitives.remove(this.primitives.dth[e]),this.primitives.dth.splice(e,1))}},{key:"clearAllDthPrimitive",value:function(){this.highlightPrimitive&&this.sdk.viewer.scene.primitives.remove(this.highlightPrimitive);for(var t=this.primitives.dth.length-1;t>=0;t--)this.sdk.viewer.scene.primitives.remove(this.primitives.dth[t]);this.primitives.dth=[]}},{key:"getIDBypickFeature",value:function(t){this.clickHighlightPrimitive&&(this.clickHighlightPrimitive.show=!0),this.highlightPrimitive&&this.sdk.viewer.scene.primitives.remove(this.highlightPrimitive),this.highlightPrimitive=this.sdk.viewer.scene.primitives.add(new Cesium.ClassificationPrimitive({geometryInstances:new Cesium.GeometryInstance({id:Zi(Zi({},t.id),{},{type:"yj-dth-highlight"}),geometry:t.primitive._primitiveOptions.geometryInstances[0].geometry,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("#ff9800").withAlpha(.8)),show:new Cesium.ShowGeometryInstanceAttribute(!0)}}),classificationType:Cesium.ClassificationType.CESIUM_3D_TILE})),this.highlightPrimitive.readyPromise.then((function(){t.primitive.show=!1})),this.clickHighlightPrimitive=t.primitive;var e=t.id.range;"string"==typeof t.id.range&&(e=JSON.parse(t.id.range)),this.getHilightArea(e),this.handlePickEvent(t.id)}},{key:"handlePickEvent",value:function(t){this.PickBuildingEvent.raiseEvent(t)}},{key:"getHilightArea",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=[];t.forEach((function(t){i.push([t.lng,t.lat])})),i.push(i[0]);var n=turf.polygon([i]),o=turf.buffer(n,Number(e)/1e3);return o.geometry.coordinates}},{key:"flyTo",value:(t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=u.length>1&&void 0!==u[1]?u[1]:{heading:0,pitch:-90,roll:0},n=new YJ.Tools(this.sdk),o=0,s=[],r=0;case 5:if(!(r更新高程',s.style.width="auto",s.addEventListener("click",(function(){p.options.updateHeightCallBack()})),o.appendChild(s)),this.options.secondaryEditCallBack&&((r=document.createElement("button")).className="secondaryEdit",r.innerHTML='二次编辑',this.options.updateHeightCallBack&&(r.style.marginLeft="10px"),o.appendChild(r),r.addEventListener("click",(function(){p.options.secondaryEditCallBack&&p.options.secondaryEditCallBack()}))),this.options.translationalCallBack&&((l=document.createElement("button")).className="translational",l.innerHTML='平移',(this.options.updateHeightCallBack||this.options.secondaryEditCallBack)&&(l.style.marginLeft="10px"),o.appendChild(l),l.addEventListener("click",(function(){p.options.translationalCallBack&&p.options.translationalCallBack()})))),this.options.addFootElm)for(c=0;c=0;i--)for(var n in this.info.attribute)if(e[i].value===n){this.info.attribute[n].disabled&&(e[i].disabled=!0);break}}}]);var i}(W);function ln(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function cn(t){for(var e=1;e=3?(h.width=r.width/l*2,h.height=r.height/l*2,d.drawImage(r,0,0,h.width,h.height),p.src=h.toDataURL("image/jpeg",.95)):p.src=s}else p.src=s;p.onload=function(){if(!m){var o=cn({},y),s=JSON.parse(JSON.stringify(C)),r=cn({},w),l=cn({},b);l.width=b.width/j.width*p.width;var h=v/j.width*p.width,d=h;if(l.show&&f&&f.complete&&(d+=l.width),a.width=p.width+2*d,a.height=p.height+2*d,u.clearRect(0,0,a.width,a.height),u.rect(0,0,a.width,a.height),u.fillStyle="#ffffff",u.fill(),u.drawImage(p,d,d,p.width,p.height),o.show){var g=o.text,k=Math.max(5,o.height*p.height*.5);u.font="".concat(k,"px serif"),u.fillStyle=o.bgColor||"#5d5d5d",u.fillRect(d,d,a.width-2*d,o.height*p.height),u.fillStyle=o.color||"white",u.textAlign="center",u.textBaseline="middle",u.fillText(g,a.width/2,o.height*p.height/2+d)}for(var x=function(t){if(s[t].show)if("text"in s[t])u.font="".concat(p.height*s[t].height,"px serif"),u.fillStyle=s[t].color||"white",u.textAlign="left",u.textBaseline="bottom",s[t].width=u.measureText(s[t].text).width/p.height,u.fillText(s[t].text,p.width*s[t].x+d,p.height*s[t].y+d);else if("url"in s[t])if(C[t].svg&&C[t].svg.complete)u.drawImage(C[t].svg,p.width*s[t].x+d,p.height*s[t].y+d,p.height*s[t].width,p.height*s[t].height);else{var e=new Image;e.src=un.getSourceRootPath()+s[t].url,e.onload=function(){s[t].svg=e,u.drawImage(e,p.width*s[t].x+d,p.height*s[t].y+d,p.height*s[t].width,p.height*s[t].height)}}},_=0;_=1e3&&(D="㎞",O=Math.round(O/1e3));var B=S;u.beginPath(),u.moveTo(E,B),u.lineTo(E+r.width,B),u.strokeStyle=r.color,u.lineWidth=.01*r.width,u.stroke();for(var L=0,A=0;A<=r.cell;A++)L=E+A*M,u.beginPath(),u.moveTo(L,B-.1*r.width),u.lineTo(L,B),u.strokeStyle=r.color,u.lineWidth=.01*r.width,u.stroke(),u.font="".concat(P,"px Arial"),u.fillStyle=r.color,u.textAlign="center",u.textBaseline="bottom",u.fillText(A*O,L,B-.1*r.width);u.font="".concat(P,"px Arial"),u.fillStyle=r.color,u.textAlign="left",u.textBaseline="bottom",u.fillText(D,L+1.2*P,B-.1*r.width)}if(l.show&&f&&f.complete&&(R(u,f,h,h,l.width,"top",1),R(u,f,a.width-l.width-h,h,l.width,"right",1),R(u,f,a.width-l.width-h,a.height-l.width-h,l.width,"bottom",1),R(u,f,h,a.height-l.width-h,l.width,"left",1)),"export"===t){var I=i.contentWindow;I&&"function"==typeof I.print?(I.addEventListener("afterprint",(function(){document.body.removeChild(i)})),I.print()):console.error("打印失败,请手动保存截图")}else a.toBlob((function(t){var e=URL.createObjectURL(t),i=document.createElement("a");i.href=e,i.download="高清出图-".concat(Ct(),".png"),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(e)}),"image/png",.95);c=!1,W.innerHTML="打印",J.innerHTML="保存"}function R(t,e,i,n,o,s){var r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;switch(t.save(),t.translate(i+o/2,n+o/2),s){case"right":t.rotate(Math.PI/2);break;case"bottom":t.rotate(Math.PI);break;case"left":t.rotate(3*Math.PI/2)}t.beginPath(),t.moveTo(-o*r/2,-o/2),"top"===s||"bottom"===s?(t.lineTo(a.width-2*h-o/2,-o/2),t.lineTo(a.width-2*(h+o)+o/2,o/2)):(t.lineTo(a.height-2*h-o/2,-o/2),t.lineTo(a.height-2*(h+o)+o/2,o/2)),t.lineTo(o*r/2,o/2),t.closePath(),t.clip();var c,u=e.width/e.height*o;t.drawImage(e,-o/2,-o/2,u,o),c="top"===s||"bottom"===s?Math.ceil((a.width-2*h-2*l.width)/l.width):Math.ceil((a.height-2*h-2*l.width)/l.width),c++;for(var p=1;p<=c;p++)t.drawImage(e,-o/2+u*p,-o/2,u,o);t.restore()}}},Ct=function(){var t=new Date,e=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0"),r=String(t.getMilliseconds()).padStart(3,"0");return"".concat(e).concat(i).concat(n).concat(o).concat(s).concat(a).concat(r)},bt=function(){if(n){var t=Cesium.Math.toDegrees(n.west),e=Cesium.Math.toDegrees(n.east),i=Cesium.Math.toDegrees(n.north),o=(Cesium.Math.toDegrees(n.south),turf.point([t,i])),s=turf.point([e,i]),a=turf.distance(o,s,{units:"kilometers"});d=1e3*a/j.width}},yt=function(t){var e=v;b.show&&f&&f.complete&&(e+=b.width);var i=.005*L.height;if(A.strokeStyle="red",A.lineWidth=.002*L.height,"text"in t)A.strokeRect(j.width*t.x+e,j.height*t.y+e-j.height*t.height,j.height*t.width,j.height*t.height);else if("url"in t)A.strokeRect(j.width*t.x+e,j.height*t.y+e,j.height*t.width,j.height*t.height);else if(t===w)return void A.strokeRect(j.width*t.x+e-.2*w.width,j.height*t.y+e-t.height-.5*w.height,t.width+.6*w.width,t.height+w.height);var n=ft(t,e);A.fillStyle="red",n.forEach((function(t){A.beginPath(),A.arc(t.x,t.y,i,0,2*Math.PI),A.fill()}))},gt=function(t,e,i,n,o,s){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;switch(t.save(),t.translate(i+o/2,n+o/2),s){case"right":t.rotate(Math.PI/2);break;case"bottom":t.rotate(Math.PI);break;case"left":t.rotate(3*Math.PI/2)}t.beginPath(),t.moveTo(-o*a/2,-o/2),"top"===s||"bottom"===s?(t.lineTo(L.width-2*v-o/2,-o/2),t.lineTo(L.width-2*(v+o)+o/2,o/2)):(t.lineTo(L.height-2*v-o/2,-o/2),t.lineTo(L.height-2*(v+o)+o/2,o/2)),t.lineTo(o*a/2,o/2),t.closePath(),t.clip();var r,l=e.width/e.height*o;t.drawImage(e,-o/2,-o/2,l,o),r="top"===s||"bottom"===s?Math.ceil((L.width-2*v-2*b.width)/b.width):Math.ceil((L.height-2*v-2*b.width)/b.width),r++;for(var c=1;c<=r;c++)t.drawImage(e,-o/2+l*c,-o/2,l,o);t.restore()},vt=function(){if(!m){var t=v;if(b.show&&f&&f.complete&&(t+=b.width),L.width=j.width+2*t,L.height=j.height+2*t,A.clearRect(0,0,L.width,L.height),A.rect(0,0,L.width,L.height),A.fillStyle="#ffffff",A.fill(),A.drawImage(j,t,t,j.width,j.height),y.show){var e=y.text,i=Math.max(5,y.height*j.height*.5);A.font="".concat(i,"px serif"),A.fillStyle=y.bgColor||"#5d5d5d",A.fillRect(t,t,L.width-2*t,y.height*j.height),A.fillStyle=y.color||"white",A.textAlign="center",A.textBaseline="middle",A.fillText(e,L.width/2,y.height*j.height/2+t)}for(var n=function(e){if(C[e].show)if("text"in C[e])A.font="".concat(j.height*C[e].height,"px serif"),A.fillStyle=C[e].color||"white",A.textAlign="left",A.textBaseline="bottom",C[e].width=A.measureText(C[e].text).width/j.height,A.fillText(C[e].text,j.width*C[e].x+t,j.height*C[e].y+t),C[e].isSelected&&yt(C[e]);else if("url"in C[e])if(C[e].svg&&C[e].svg.complete)A.drawImage(C[e].svg,j.width*C[e].x+t,j.height*C[e].y+t,j.height*C[e].width,j.height*C[e].height),C[e].isSelected&&yt(C[e]);else{var i=new Image;i.src=un.getSourceRootPath()+C[e].url,i.onload=function(){C[e].svg=i,A.drawImage(i,j.width*C[e].x+t,j.height*C[e].y+t,j.height*C[e].width,j.height*C[e].height),C[e].isSelected&&yt(C[e])}}},o=0;o=1e3&&(l="㎞",p=Math.round(p/1e3));var k=r;A.beginPath(),A.moveTo(a,k),A.lineTo(a+w.width,k),A.strokeStyle=w.color,A.lineWidth=.01*w.width,A.stroke();for(var x=0,_=0;_<=w.cell;_++)x=a+_*u,A.beginPath(),A.moveTo(x,k-.1*w.width),A.lineTo(x,k),A.strokeStyle=w.color,A.lineWidth=.01*w.width,A.stroke(),A.font="".concat(c,"px Arial"),A.fillStyle=w.color,A.textAlign="center",A.textBaseline="bottom",A.fillText(_*p,x,k-.1*w.width);A.font="".concat(c,"px Arial"),A.fillStyle=w.color,A.textAlign="left",A.textBaseline="bottom",A.fillText(l,x+1.2*c,k-.1*w.width),w.isSelected&&yt(w)}b.show&&f&&f.complete&&(gt(A,f,v,v,b.width,"top",1),gt(A,f,L.width-b.width-v,v,b.width,"right",1),gt(A,f,L.width-b.width-v,L.height-b.width-v,b.width,"bottom",1),gt(A,f,v,L.height-b.width-v,b.width,"left",1))}},ft=function(t,e){var i=t.x*j.width+e,n=t.y*j.height+e,o=t.width*j.height,s=t.height*j.height;return"text"in t?[{x:i,y:n-s},{x:i+o,y:n-s},{x:i,y:n},{x:i+o,y:n}]:[{x:i,y:n},{x:i+o,y:n},{x:i,y:n+s},{x:i+o,y:n+s}]},mt=function(t){var e,i=L.getBoundingClientRect(),n=i.width,o=i.height,s=L.width,a=L.height,r=(n-s*(e=s/a>n/o?n/s:o/a))/2;return(t.clientX-i.left-r)/e},dt=function(t){var e,i=L.getBoundingClientRect(),n=i.width,o=i.height,s=L.width,a=L.height,r=(e=s/a>n/o?n/s:o/a,(o-a*e)/2);return(t.clientY-i.top-r)/e},K=function(t){var e,i;if(b.color=t||"#000000",new YJColorPicker({el:x.getElementsByClassName("border-color")[0],size:"mini",alpha:!1,defaultColor:b.color,disabled:!1,openPickerAni:"opacity",sure:function(t){K(t)},clear:function(){K("rgba(0,0,0,1)")}}),t){e=g.replace(/fill="[^"]+"/g,'fill="'.concat(t,'"'))}else e=g;i="data:image/svg+xml;base64,"+btoa(Array.from((new TextEncoder).encode(e),(function(t){return String.fromCharCode(t)})).join("")),(f=new Image).setAttribute("crossOrigin","anonymous"),f.src=i,f.onload=function(){b.show&&vt()}},Z=function(t){b.url=t,b.url&&((f=new Image).setAttribute("crossOrigin","anonymous"),b.url.endsWith("svg")?fetch(un.getSourceRootPath()+b.url).then(function(){var t=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.ok){t.next=5;break}return t.next=3,e.text();case 3:g=t.sent,K(b.color);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()):(f.src=un.getSourceRootPath()+b.url,f.onload=function(){b.show&&vt()}))},X=function(t){h=t,u=[{name:"模板一",value:"模板一",id:"1",margin:.03,title:{text:"标题一",height:.05,bgColor:"#5d5d5d",color:"#ffffff",show:!0},border:{show:!1,url:"/custom/img/map-border1.svg",width:.01,color:""},plottingScale:{cell:2,color:"#ffffff",show:!0,isSelected:!1,x:.87,y:.97},data:[{text:"",x:.02,y:.93,isSelected:!1,show:!0,color:"#ffffff",height:.03},{text:"",x:.02,y:.97,isSelected:!1,show:!0,color:"#ffffff",height:.03},{x:.02,y:.1,show:!1,isSelected:!1,url:"/custom/img/icon-compass1.svg",width:.1,height:.1}]},{name:"模板二",value:"模板二",id:"2",margin:.03,border:{show:!0,url:"/custom/img/map-border2.svg",width:.01},title:{text:"标题二",height:.05,bgColor:"#5d5d5d",color:"#ffffff",show:!0},plottingScale:{cell:2,color:"#ffffff",show:!0,isSelected:!1,x:.02,y:.97},data:[{text:"",x:.88,y:.93,isSelected:!1,show:!0,color:"#ffffff",height:.03},{text:"",x:.87,y:.97,isSelected:!1,show:!0,color:"#ffffff",height:.03},{x:.91,y:.1,show:!0,isSelected:!1,url:"/custom/img/icon-compass4.svg",width:.1,height:.1}]}];for(var e=0;e\n
        \n
        图件信息
        \n
        \n
        \n 模板\n
        \n
        \n
        \n
        \n
        \n 标题\n \n \n
        \n
        \n
        \n
        \n 制图日期\n \n \n
        \n
        \n
        \n
        \n 制图单位\n \n \n
        \n
        \n
        \n
        \n 图框\n
        \n
        \n \n
        \n
        \n
        \n
        \n
        地图要素
        \n
        \n
        \n 指北针\n \n
        \n
        \n '.concat(function(){for(var t="",e=0;e\n \n \n
        ')}return t}(),'\n
        \n
        \n
        \n
        \n
        \n
        \n 比例尺\n \n
        \n
        \n \n \n
        \n
        \n\n
        \n
        \n '),p.contentAppChild(x),_=x.getElementsByClassName("left")[0],E=x.getElementsByClassName("right")[0],S=_.getElementsByClassName("title-input")[0],D=_.getElementsByClassName("title-checkbox")[0],P=_.getElementsByClassName("unit-input")[0],M=_.getElementsByClassName("unit-checkbox")[0],O=_.getElementsByClassName("compass-checkbox")[0],T=_.getElementsByClassName("compass-radio"),N=_.getElementsByClassName("plotting-scale-checkbox")[0],B=_.getElementsByClassName("map-border-checkbox")[0],L=document.createElement("canvas"),A=L.getContext("2d"),E.appendChild(L),(j=new Image).src=i,j.onload=function(){m=!1,bt(),X(h)},S.value=y.text,D.checked=y.show,S.addEventListener("input",(function(){y.text=this.value,j.complete&&vt()})),D.addEventListener("change",(function(){y.show=this.checked,j.complete&&vt()})),P.value=C[1].text,M.checked=C[1].show,P.addEventListener("input",(function(){C[1].text=this.value,j&&j.complete&&vt()})),M.addEventListener("change",(function(){C[1].show=this.checked,j&&j.complete&&vt()})),O.checked=C[2].show,O.addEventListener("change",(function(){C[2].show=this.checked,j&&j.complete&&vt()})),I=a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:T[e].addEventListener("change",(function(){this.checked&&(C[2].svg=null,C[2].url=k[e],j&&j.complete&&vt())}));case 1:case"end":return t.stop()}}),t)})),R=0;case 59:if(!(R打印',J.innerHTML='保存',wt("export"))})),J.addEventListener("click",(function(){c||(c=!0,W.innerHTML='打印',J.innerHTML='保存',wt("save"))}));var t=x.getElementsByClassName("print-date")[0];(z=x.getElementsByClassName("print-date-checkbox")[0]).checked=C[0].show,z.addEventListener("change",(function(){C[0].show=this.checked,j.complete&&vt()})),F=jeDate(t,{format:"YYYY-MM-DD",isinitVal:!0,isClear:!1,donefun:function(t){C[0].text=t.val,j.complete&&vt()}}),C[0].text?F.setValue(C[0].text):(F.nowBtn&&F.nowBtn(),C[0].text=F.getValue(),vt());var e=Y(p._element.content.getElementsByClassName("template-box")[0],".template");if(e){e.legp_search(u);for(var i=p._element.content.getElementsByClassName("template")[0].getElementsByTagName("input")[0],n=0;n'),value:"/custom/img/map-border1.svg",key:0},{name:''),value:"/custom/img/map-border2.svg",key:1},{name:''),value:"/custom/img/map-border3.svg",key:2},{name:''),value:"/custom/img/map-border4.svg",key:3},{name:''),value:"/custom/img/map-border5.svg",key:4},{name:''),value:"/custom/img/map-border6.svg",key:5}];if(V=Y(p._element.content.getElementsByClassName("map-border-box")[0],".map-border")){V.legp_search(o),(G=document.createElement("span")).className="icon icon-active",G.style.width="calc(100% - 40px)",G.style.height="calc(100% - 12px)",G.style.position="absolute",G.style.top="6px",G.style.left="10px",G.style.pointerEvents="none",G.style.backgroundImage="url(".concat(un.getSourceRootPath()+b.url,")"),G.style.backgroundSize="auto 100%",G.style.backgroundRepeat="repeat-x",p._element.content.getElementsByClassName("map-border")[0].getElementsByClassName("cy_datalist")[0].appendChild(G),(H=p._element.content.getElementsByClassName("map-border")[0].getElementsByTagName("input")[0]).style.fontSize=0,H.style.color="transparent";for(var s=0;s=y.height*j.height+n-Q&&i<=y.height*j.height+n+Q){$=!0;for(var o=0;o=t.x-s&&e<=t.x+s&&i>=t.y-s&&i<=t.y+s&&(it=!0,et=!1,nt=n,ot=e,st=i,ut=tt.width*j.height,pt=tt.height*j.height,"text"in tt&&(ut=tt.width*j.height,ht=tt.height))}))}if(!it){for(var a=0;a=0;r--)if(C[r].show){if("text"in C[r]&&e>=j.width*C[r].x+n&&e<=j.width*C[r].x+n+j.height*C[r].width&&i>=j.height*C[r].y+n-j.height*C[r].height&&i<=j.height*C[r].y+n){tt=C[r],C[r].isSelected=!0,et=!0,ot=e,st=i,at=j.height*C[r].y-j.height*C[r].height,rt=j.width*C[r].x+j.height*C[r].width,lt=j.width*C[r].x+n,ct=j.height*C[r].y+n,vt();break}if("url"in C[r]&&C[r].svg&&C[r].svg.complete&&C[r].show&&e>=j.width*C[r].x+n&&e<=j.width*C[r].x+n+j.height*C[r].width&&i>=j.height*C[r].y+n&&i<=j.height*C[r].y+n+j.height*C[r].height){tt=C[r],C[r].isSelected=!0,et=!0,ot=e,st=i,at=j.height*C[r].y+j.height*C[r].height,rt=j.width*C[r].x+j.height*C[r].width,lt=j.width*C[r].x+n,ct=j.height*C[r].y+n,vt();break}}w.show&&e>=j.width*w.x+n-.2*w.width&&e<=j.width*w.x+n-.2*w.width+w.width+.6*w.width&&i>=j.height*w.y+n-w.height-.5*w.height&&i<=j.height*w.y+n-.5*w.height+w.height&&(tt=w,w.isSelected=!0,et=!0,ot=e,st=i,at=j.height*w.y+n+w.height,rt=j.width*w.x+n+w.width,lt=j.width*w.x+n,ct=j.height*w.y+n,vt()),tt||vt()}})),L.addEventListener("mousemove",(function(t){var e=v;b.show&&f&&f.complete&&(e+=b.width);var i=mt(t),n=dt(t);if(!(i<0||n<0||i>L.width||n>L.height)){if(y.show){var o=v;b.show&&f&&f.complete&&(o+=b.width),n>=y.height*j.height+o-Q&&n<=y.height*j.height+o+Q?L.style.cursor="n-resize":L.style.cursor="default",$&&(y.height=Math.min(Math.max(n-o,30)/j.height,1),vt())}if(et){var s=i-ot,a=n-st;tt.x=(lt+s-e)/j.width,tt.y=(ct+a-e)/j.height,vt()}if(it){var r,l=i-ot,c=n-st;switch(nt){case 0:"text"in tt?(r=(ut-l)/ut,tt.height=Math.max(10/j.height,ht*r),tt.x=(rt-tt.width*j.height)/j.width):"url"in tt&&(tt.x=(rt-tt.width*j.height)/j.width,tt.y=(at-tt.height*j.height)/j.height,tt.width=Math.max(10,ut-l)/j.height,tt.height=Math.max(10,pt-c)/j.height);break;case 1:"text"in tt?(r=(ut+l)/ut,tt.height=Math.max(10/j.height,ht*r)):"url"in tt&&(tt.width=Math.max(10,ut+l)/j.height,tt.height=Math.max(10,pt-c)/j.height,tt.y=(at-tt.height*j.height)/j.height);break;case 2:"text"in tt?(r=(ut-l)/ut,tt.height=Math.max(10/j.height,ht*r),tt.x=(rt-tt.width*j.height)/j.width,tt.y=(at+tt.height*j.height)/j.height):"url"in tt&&(tt.x=(rt-tt.width*j.height)/j.width,tt.width=Math.max(10,ut-l)/j.height,tt.height=Math.max(10,pt+c)/j.height);break;case 3:"text"in tt?(r=(ut+l)/ut,tt.height=Math.max(10/j.height,ht*r),tt.y=(at+tt.height*j.height)/j.height):"url"in tt&&(tt.width=Math.max(10,ut+l)/j.height,tt.height=Math.max(10,pt+c)/j.height)}vt()}}})),document.addEventListener("mouseup",(function(){$=!1;b.show&&f&&f.complete&&b.width;for(var t=0;t1&&void 0!==o[1]?o[1]:function(){},n=e.viewer.canvas.toDataURL(),i&&i(n);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function fn(){return(fn=o()(a.a.mark((function t(e){var i,n,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,x,E,S,D=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(v=function(){setTimeout((function(){f.getElementsByClassName("canvas-width-span")[0].innerHTML=e.viewer.canvas.width,f.getElementsByClassName("canvas-height-span")[0].innerHTML=e.viewer.canvas.height,f.getElementsByClassName("output-width")[0].innerHTML=e.viewer.canvas.width*r,f.getElementsByClassName("output-height")[0].innerHTML=e.viewer.canvas.height*r}),500)},D.length>1&&void 0!==D[1]?D[1]:{},D.length>2&&void 0!==D[2]?D[2]:function(){},e){t.next=5;break}return t.abrupt("return");case 5:return qt(),Ee(e),dn&&(dn.close(),dn=null),i=e.viewer.scene.screenSpaceCameraController.enableTranslate,n=e.viewer.scene.screenSpaceCameraController.enableTilt,s=e.viewer.scene.screenSpaceCameraController.enableLook,r=1,m=new fi,t.next=15,new rn(e,{},{title:"高清出图",left:"180px",top:"100px",confirmCallBack:function(t){d&&(d.desist(),d=null),c&&(c.style.width="0%"),p&&(p.style.left="0%"),u&&(u.style.width="0%"),h&&(h.innerHTML="0%"),d=new S},closeCallBack:function(){e.viewer.scene.screenSpaceCameraController.enableTranslate=i,e.viewer.scene.screenSpaceCameraController.enableTilt=n,e.viewer.scene.screenSpaceCameraController.enableLook=s,e.viewer._element.getElementsByClassName("compass")[0].style.pointerEvents="auto",d&&(d.desist(),d=null),window.removeEventListener("resize",v),dn=void 0}});case 15:for((dn=t.sent)._element.body.className=dn._element.body.className+" screenShotHD",(f=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 当前窗口长宽:'.concat(e.viewer.canvas.width,'*').concat(e.viewer.canvas.height,'像素\n
        \n
        \n
        \n
        \n 图片大小\n
        \n 倍窗口\n
        \n
        \n
        \n
        \n 输出图片长宽:').concat(e.viewer.canvas.width*r,'*').concat(e.viewer.canvas.height*r,'像素\n
        \n
        \n
        \n
        \n 输出进度\n
        \n
        \n
        \n
        \n
        \n
        \n
        \n 0%\n 100%\n
        0%
        \n
        \n \n
        \n
        \n
        \n
        \n \n '),dn.contentAppChild(f),e.viewer.scene.screenSpaceCameraController.enableTranslate=!1,e.viewer.scene.screenSpaceCameraController.enableTilt=!1,e.viewer.scene.screenSpaceCameraController.enableLook=!1,e.viewer._element.getElementsByClassName("compass")[0].style.pointerEvents="none",window.addEventListener("resize",v),(g=e.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(e.viewer.canvas.clientWidth/2,e.viewer.canvas.clientHeight/2)))||(g=e.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(e.viewer.canvas.clientWidth/2,e.viewer.canvas.clientHeight/(2-(90+e.viewer.camera.pitch/(Cesium.Math.PI/180))/110))))||(g=e.viewer.camera.position),y=m.cartesian3Towgs84(e.viewer.camera.position,e.viewer).alt,b=m.cartesian3Towgs84(g,e.viewer),e.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(b.lng,b.lat,y),orientation:{heading:0,pitch:Cesium.Math.toRadians(-90),roll:0},duration:1}),C=[],w=1;w<=10;w++)C.push({name:w,value:w});c=document.getElementsByClassName("progress-input")[0],u=document.getElementsByClassName("range-process")[0],p=f.getElementsByClassName("range-node-active")[0],h=f.getElementsByClassName("range-node-active-text")[0],(x=Y(dn._element.content.getElementsByClassName("scale-box")[0],".scale"))&&(x.legp_search(C),E=dn._element.content.getElementsByClassName("scale")[0].getElementsByTagName("input")[0],r=C[0].value,x.legp_searchActive(C[0].value),E.value=C[0].value,E.addEventListener("input",(function(){for(var t=0;tg.maximumLevel&&(f=g.maximumLevel),f=y;J--)for(var q=x;q>=m;q--)Y.push({x:q,y:J});var X={count:0},Z=0,K=-1,$={count:0},Q=0;function tt(){$.count=0,Q=0;for(var t=30*++K;t<30*(K+1);t++){if(t>=Y.length)return;et(t)}}function et(t){if(c.state)try{var e=Y[t].x;e<0&&(e+=d);var i,n=new Image;n.setAttribute("crossOrigin","anonymous"),n.onload=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:P.drawImage(n,256*(Y[t].x-m)-parseFloat(H.toFixed(0)),256*(Y[t].y-y)-parseFloat(V.toFixed(0)),256,256),v++,X.count++,$.count++;case 4:case"end":return e.stop()}}),e)}))),n.onerror=function(){v++,X.count++,$.count++},i=-1!==g.url.indexOf("{x}")&&-1!==g.url.indexOf("{y}")&&-1!==g.url.indexOf("{z}")?g.url.replace(/\{x\}/g,e).replace(/\{y\}/g,Y[t].y).replace(/\{z\}/g,f):-1!==g.url.indexOf("{TileMatrix}")&&-1!==g.url.indexOf("{TileRow}")&&-1!==g.url.indexOf("{TileCol}")?g.url.replace(/\{TileCol\}/g,e).replace(/\{TileRow\}/g,Y[t].y).replace(/\{TileMatrix\}/g,f):g._layer&&g._style&&g._tileMatrixSetID&&g._format?g.url+"&tilematrix=".concat(f,"&layer=").concat(g._layer,"&style=").concat(g._style,"&tilerow=").concat(W,"&tilecol=").concat(e,"&tilematrixset=").concat(g._tileMatrixSetID,"&format=").concat(g._format):g.url+"tile/".concat(f,"/").concat(Y[t].y,"/").concat(e),n.src=i}catch(t){v++,X.count++,$.count++}}Object.defineProperty($,"count",{get:function(){return Q},set:function(t){(Q=t)>=30&&tt()}}),Object.defineProperty(X,"count",{get:function(){return Z},set:function(o){Z=o,C[i].value=v/S*E;var s=0;for(var a in C)s+=C[a].value;if(u.style.width=.99*s+"%",p.style.left=.99*s+"%",h.innerHTML=Math.floor(.99*s*100)/100+"%",Z===(x-m+1)*(_-y+1)){var l=D.getContext("2d"),d=D.cloneNode(!0),f=d.getContext("2d"),g=l.getImageData(0,0,D.width,D.height);if(f.putImageData(g,0,0),D.width=e.viewer.canvas.width*r,D.height=e.viewer.canvas.height*r,l.drawImage(d,0,0,D.width,D.height),n){if(n.getContext("2d").drawImage(D,0,0),k!=w){var P=i+=1;return void t(P,n)}var M=n.toDataURL("image/jpeg",.95),O=document.createElement("canvas"),T=O.getContext("2d");O.width=n.width/r,O.height=n.height/r,T.drawImage(n,0,0,O.width,O.height),hn(e,O.toDataURL("image/jpeg",.95),b,M),u.style.width="100%",p.style.left="100%",h.innerHTML="100%",c.state=!1}else{if(k!=w){var N=i+=1;return void t(N,D)}var B=D.toDataURL("image/jpeg",.95),L=document.createElement("canvas"),A=L.getContext("2d");L.width=D.width/r,L.height=D.height/r,A.drawImage(D,0,0,L.width,L.height),hn(e,L.toDataURL("image/jpeg",.95),b,B),u.style.width="100%",p.style.left="100%",h.innerHTML="100%",c.state=!1}}}}),g._readyError?X.count=(x-m+1)*(_-y+1):tt()}if(g._readyError)return C[i]={value:E},void x();g.readyPromise.then((function(){x()})).catch((function(t){g._readyError=!0,C[i]={value:E},x()}))}(0)}},{key:"desist",value:function(){this.state=!1}}])}();case 39:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var vn=i(13),gn=i.n(vn);function yn(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return bn(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?bn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function bn(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);iNumber(t.target.max)&&(e=Number(t.target.max)),t.target.min&&eNumber(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i0&&e[o].addEventListener(t,(function(e){for(var i=0;i\n
        '+s[c].getAttribute("label")+"
        \n \n ",r=r+'
        '+s[c].innerHTML+"
        ",l++}}a+="",r+="";var m=document.createElement("div");"string"==typeof e&&m.setAttribute("id",e),m.setAttribute("class","DIV-cy-tabs"),m.innerHTML=a+r,o.parentNode.insertBefore(m,o),o.parentNode.removeChild(o);for(var f=m.getElementsByClassName("DIV-cy-tab-pane-title-p"),v=0;v1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=this;this.title=i,this.objectId=t,document.body.getElementsByClassName("richText-box")[0]&&document.body.removeChild(this.richTextBox),this.editor=null;var r='\n
        \n
        \n
        \n

        '.concat(i,'

        \n \n
        \n
        \n
        \n \n
        \n ');this.richTextBox.innerHTML=r,document.body.appendChild(this.richTextBox);var l=window.wangEditor,c=l.createEditor,u=l.createToolbar,p={placeholder:"请输入正文...",MENU_CONF:{uploadImage:{fieldName:"file",server:this.uploadImageServer,customUpload:function(t,e){return o()(a.a.mark((function i(){var n;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,s.upload(t);case 2:n=i.sent,e((s.host=s.host||h())+"/"+n);case 4:case"end":return i.stop()}}),i)})))()}},uploadVideo:{server:this.uploadVideoServer,allowedFileTypes:["video/mp4","video/mp3","video/ogg","video/webm","video/avi"],customUpload:function(t,e){return o()(a.a.mark((function i(){var n;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,s.upload(t);case 2:n=i.sent,e((s.host=s.host||h())+"/"+n);case 4:case"end":return i.stop()}}),i)})))()}}},onChange:function(t){t.getHtml()}};this.editor=c({selector:"#editor-container",html:"


        ",config:p,mode:"default"});var d={excludeKeys:["emotion","insertImage","insertVideo"]};u({editor:this.editor,selector:"#toolbar-container",config:d,mode:"default"});this.editor.on("fullScreen",(function(){console.log("fullScreen")})),this.editor.setHtml(n);var m=this.richTextBox.getElementsByClassName("close")[0],f=this.richTextBox.getElementsByClassName("primary")[0],v=this.richTextBox.getElementsByClassName("cancel")[0];m.addEventListener("click",(function(){e.close()})),f.addEventListener("click",(function(){var t=e.editor.getHtml();e.primaryCallBack(t),e.close()})),v.addEventListener("click",(function(){e.close()}))}},{key:"close",value:function(){document.body.getElementsByClassName("richText-box")[0]&&document.body.removeChild(this.richTextBox),this.editor=null}},{key:"upload",value:(t=o()(a.a.mark((function t(e){var i,n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="",this.host=this.host||h(),i=this.host.endsWith("yjearth4.0")?this.host+"/api/v1/richText/upload":this.host+"/yjearth4.0/api/v1/richText/upload",(n=new FormData).append("file",e),t.next=7,fetch(i,{method:"post",body:n,headers:{token:m(),Authorization:"Bearer "+m()}});case 7:if(200!==(o=t.sent).status){t.next=14;break}return t.next=11,o.json();case 11:if(200!==(s=t.sent).code&&0!==s.code){t.next=14;break}return t.abrupt("return",s.data.url);case 14:case"end":return t.stop()}}),t,this)}))),function(e){return t.apply(this,arguments)})},{key:"customUploadVideo",get:function(){return En(Dn,this)},set:function(t){_n(Dn,this,t)}},{key:"customUploadContent",get:function(){return En(Pn,this)},set:function(t){_n(Pn,this,t)}},{key:"primaryCallBack",get:function(){return En(Mn,this)},set:function(t){_n(Mn,this,t)}}]);var t}());function Tn(t,e,i,n,o){var s=Math.ceil(e/i)||1;!function i(){var a,r="
      • 1
      • ",l="
      • ").concat(s,"
      • "),c="
      • ...
      • ",u="
      • ...
      • ",p="
        共 ".concat(e," 条
        ");if(a="
      • ",s<=6)for(var h=1;h<=s;h++)a+="
      • ").concat(h,"
      • ");else if(n<=4){for(var d=1;d<=5;d++)a+="
      • ").concat(d,"
      • ");a+=u,a+=l}else if(n>s-3){a+=r,a+=c;for(var m=s-4;m<=s;m++)a+="
      • ").concat(m,"
      • ")}else{a+=r,a+=c;for(var f=n-1;f<=n+1;f++)a+="
      • ").concat(f,"
      • ");a+=u,a+=l}a+="
      • ",a+=p,t.innerHTML=a,t.querySelector("li[pagenumber='"+n+"']").classList.add("active"),t.querySelectorAll("li[pagenumber]").forEach((function(e){e.onclick=function(){n=Number(this.innerHTML),t.querySelector("li[pagenumber='"+n+"']").classList.add("active"),a="",i(),o&&o(n)}})),t.getElementsByClassName("btnPrev")[0].addEventListener("click",(function(){n>1&&(n--,a="",i(),o&&o(n))})),t.getElementsByClassName("btnNext")[0].addEventListener("click",(function(){n10&&(n-=10,a="",i(),o&&o(n))})));var g=t.getElementsByClassName("btnGoRight")[0];g&&(g.addEventListener("mouseenter",(function(){this.innerHTML=">"})),g.addEventListener("mouseleave",(function(){this.innerHTML="..."})),g.addEventListener("click",(function(){n0){Tn(o,e.data.total,5,1,(function(e){t.cameraSelect(e)})),s.getElementsByClassName("table-empty")[0].style.display="none",r.style.display="inline-flex";for(var l=[],c=function(n){var o='\n
        \n
        \n \n 绑定\n
        \n
        ').concat(e.data.list[n].cameraName,'
        \n
        ').concat(i[e.data.list[n].type],'
        \n
        ').concat(e.data.list[n].ip,'
        \n
        ').concat(e.data.list[n].port,'
        \n
        ').concat(e.data.list[n].userName,'
        \n
        ').concat(e.data.list[n].passWord||e.data.list[n].password,"
        \n
        "),s=document.createRange().createContextualFragment(o),a=s.querySelector('input[type="checkbox"]');l.push(a),a.addEventListener("change",(function(){if(a.checked){t.attributeCamera=[],t.attributeCamera.push(e.data.list[n]);for(var i=0;i=0;i--){for(var n=!1,o=0;o0){Tn(n,e.data.total,5,1,(function(e){t.ISCSelect(e)})),o.getElementsByClassName("table-empty")[0].style.display="none",a.style.display="flex";for(var r=function(i){var n='\n
        \n
        \n \n 绑定\n
        \n
        ').concat(e.data.list[i].name,'
        \n
        ').concat(e.data.list[i].status?"在线":"离线","
        \n
        "),o=document.createRange().createContextualFragment(n),s=o.querySelector('input[type="checkbox"]');s.addEventListener("change",(function(){if(s.checked)t.attributeISC.push(e.data.list[i]);else{var n=t.attributeISC.filter((function(t){return"ID"in e.data.list[i]?t.ID!==e.data.list[i].ID:t.id!==e.data.list[i].id}));t.attributeISC=n}})),a.appendChild(o);for(var r=0;r0){t._allGoodsList=e.data.list;for(var o=t.attributeGoods.length-1;o>=0;o--){for(var a=!1,r=0;r\n
        ').concat(e.data.list[i].name,'
        \n
        \n '),s=document.createRange().createContextualFragment(o),a=s.querySelector('input[type="number"]');a.value=0;for(var r=0;r=0;r--)if("ID"in e.data.list[i]){if(e.data.list[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e.data.list[i]&&e.data.list[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e.data.list[i].name,cnt:o};"ID"in e.data.list[i]?l.ID=e.data.list[i].ID:"id"in e.data.list[i]&&(l.id=e.data.list[i].id),t.attributeGoods.push(Bn({},l))}})),a.addEventListener("input",(function(n){if(n.data&&isNaN(Number(n.data)))"."!=n.data&&(a.value=Number(a.value));else{var o=Number(n.target.value);n.target.max&&o>Number(n.target.max)&&(o=Number(n.target.max)),n.target.min&&o=0;r--)if("ID"in e.data.list[i]){if(e.data.list[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e.data.list[i]&&e.data.list[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e.data.list[i].name,cnt:o};"ID"in e.data.list[i]?l.ID=e.data.list[i].ID:"id"in e.data.list[i]&&(l.id=e.data.list[i].id),t.attributeGoods.push(Bn({},l))}}})),n.appendChild(s)},c=0;c0){n.getElementsByClassName("table-empty")[0].style.display="none",o.style.display="block",o.style.maxHeight="150px";for(var s=function(i){var n='\n
        \n
        \n '.concat(i+1,'\n
        \n
        ').concat(e[i].name,'
        \n
        \n
        '),s=document.createRange().createContextualFragment(n),a=s.querySelector('input[type="number"]');a.value=0;for(var r=0;r=0;r--)if("ID"in e[i]){if(e[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e[i]&&e[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e[i].name,cnt:o};"ID"in e[i]?l.ID=e[i].ID:"id"in e[i]&&(l.id=e[i].id),t.attributeGoods.push(Bn({},l))}})),a.addEventListener("input",(function(n){if(n.data&&isNaN(Number(n.data)))"."!=n.data&&(a.value=Number(a.value));else{var o=Number(n.target.value);n.target.max&&o>Number(n.target.max)&&(o=Number(n.target.max)),n.target.min&&o=0;r--)if("ID"in e[i]){if(e[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e[i]&&e[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e[i].name,cnt:o};"ID"in e[i]?l.ID=e[i].ID:"id"in e[i]&&(l.id=e[i].id),t.attributeGoods.push(Bn({},l))}}})),o.appendChild(s)},a=0;a\n
        \n
        \n 内容类型\n
        \n
        \n
        \n
        \n
        \n
        \n 编辑内容\n \n
        \n
        \n
        \n \n \n
        \n
        \n
        \n 编辑内容\n \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        操作
        \n
        设备名称
        \n
        设备类型
        \n
        设备IP
        \n
        设备端口
        \n
        用户名
        \n
        密码
        \n
        \n
        \n \n
        \n
        \n

        暂无数据

        \n
        \n
        \n
        \n
        \n
          \n
          \n
          \n
          \n \x3c!--
          \n
          \n 编辑内容\n \n \n
          \n
          --\x3e\n
          \n
          \n
          \n
          \n
          操作
          \n
          设备名称
          \n
          设备状态
          \n
          \n
          \n \n
          \n
          \n

          暂无数据

          \n
          \n
          \n
          \n
          \n
            \n
            \n
            \n
            \n
            \n 添加链接\n
            \n \n \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            名称
            \n
            链接
            \n
            操作
            \n
            \n
            \n
            \n
            \n
            \n
            \n

            暂无数据

            \n
            \n
            \n
            \n
            \n
            \n 添加链接\n
            \n \n \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            名称
            \n
            链接
            \n
            操作
            \n
            \n
            \n
            \n
            \n
            \n
            \n

            暂无数据

            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n 编辑内容\n \n \n
            \n
            \n
            \n
            \n
            \n
            序号
            \n
            名称
            \n
            数量
            \n
            \n
            \n \n
            \n
            \n

            暂无数据

            \n
            \n
            \n
            \n
            \n '}function An(t){return'\n \n
            \n
            \n
            \n 名称\n \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n
            \n

            WGS84坐标

            \n
            \n
            \n
            \n 经度\n \n
            \n
            \n
            \n
            \n 纬度\n \n
            \n
            \n
            \n
            \n 海拔高度\n
            \n \n m\n \n
            \n
            \n
            \n
            \n
            \n
            \n
            转换坐标选择\n
            \n
            \n
            \n
            \n
            \n X轴:\n \n
            \n
            \n
            \n
            \n Y轴:\n \n
            \n
            \n
            \n
            \n Z轴:\n \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n 视野缩放\n \n
            \n
            \n 最近距离\n
            \n \n m\n \n
            \n
            \n
            \n 最远距离\n
            \n \n m\n \n
            \n
            \n
            \n
            \n
            \n \n \n '.concat(Ln(t),'\n \n \n
            \n
            \n 高度模式\n
            \n
            \n
            \n 高度\n
            \n \n m\n \n
            \n
            \n
            \n
            \n
            \n
            \n \n 小数格式\n
            \n
            \n
            \n
            \n \n 度分格式\n
            \n
            \n
            \n
            \n \n 度分秒格式\n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n 经度\n \n
            \n
            \n
            \n
            \n
            \n
            \n 纬度\n \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n 经度\n \n \n \n \n \n
            \n
            \n 纬度\n \n \n \n \n \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n 经度\n \n \n \n \n \n \n \n
            \n
            \n 纬度\n \n \n \n \n \n \n \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n \n
            \n

            图标设置

            \n
            \n
            \n 显隐\n \n
            \n
            \n 图标\n
            \n \n
            \n
            \n
            \n 默认图标\n
            \n \n
            \n
            \n
            \n 图标倍数\n
            \n \n \n \n
            \n
            \n
            \n
            \n
            \n

            文字设置

            \n
            \n
            \n 显隐\n \n
            \n
            \n 字体选择\n
            \n
            \n
            \n 文字大小\n
            \n \n px\n \n
            \n
            \n
            \n 文字颜色\n
            \n
            \n
            \n
            \n
            \n \x3c!-- \n
            \n
            \n
            \n 扩散\n \n
            \n
            \n 半径\n \n
            \n
            \n 时间\n \n
            \n
            \n 颜色\n
            \n
            \n
            \n
            \n
            \n 雷达\n \n
            \n
            \n 半径\n \n
            \n
            \n 时间\n \n
            \n
            \n 颜色\n
            \n
            \n
            \n
            \n
            --\x3e\n \n
            \n
            \n
            \n 指令\n \n \x3c!-- --\x3e\n
            \n
            \n
            \n
            \n\x3c!-- --\x3e\n\x3c!--
            --\x3e\n\x3c!--
            --\x3e\n\x3c!--
            --\x3e\n\x3c!-- 设置操作点--\x3e\n\x3c!-- --\x3e\n\x3c!-- --\x3e\n\x3c!--
            --\x3e\n\x3c!--
            --\x3e\n\x3c!--
            --\x3e\n\x3c!--
            --\x3e\n
            \n
            \n \n ')}function jn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function In(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),Fn(i=Rn(this,e,[t,n]),Gn,void 0),Fn(i,Un,void 0),t&&t.viewer?(i.sdk=t,i.viewer=t.viewer,i.options=In({},n),i.options.id=n.id||i.randomString(),i.entity=null,i.clickCallBack=null,i.rightClickCallBack=null,i.picking=!0,i.options.host=i.options.host||h(),i.setDefaultValue(),i):tn()(i)}return sn()(e,t),_()(e,[{key:"showView",get:function(){return Hn(Gn,this)},set:function(t){var e=ze().sdkD;if(!e)return zn(Gn,this,t),void(this.entity&&(this.entity._showView=t));this.sdk!==e?(Hn(Gn,this)||this.show)&&(this.sdk!==e?(zn(Gn,this,2!=t&&3!=t?0:t),this.isShowView=!0,Hn(Gn,this)?this.show=2!=t:this.show=!0):zn(Gn,this,0)):zn(Gn,this,0)}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t,this.label&&(this.label.text=t),this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;if(this.isShowView&&e||(this.options.show=t,this.originalOptions&&(this.originalOptions.show=t)),this.entity&&(this.entity._showView=this.showView),"layer"==this.type&&this.entity&&(this.entity._objectState=this.options.show),this.showView&&3!=this.showView&&e?(this.entity&&(this.entity.show=!1),this.options.label&&this.options.label.show&&this.label&&(this.label.show=!1)):(this.entity&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&this.label&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=this.options.show),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this.isShowView=!1,"layer"==this.type&&e){var i=e.viewer.imageryLayers._layers[this.layerIndex],n=this.entity;if(!i)return;n._objectState?(n._showView&&2!=n._showView||(i.show=!0),3==n._showView&&(i.show=!1)):i.show=this.options.show}}else console.error("参数必须为boolean")}},{key:"attributeSelect",get:function(){return[{name:"富文本",value:"富文本",key:"richText"},{name:"链接",value:"链接",key:"link"}]}},{key:"display",value:function(){this.show=!0}},{key:"hide",value:function(){this.show=!1}},{key:"flicker",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500,i=arguments.length>1?arguments[1]:void 0;this.flickerAnimate&&TWEEN.remove(this.flickerAnimate),this.flickerAnimate=new TWEEN.Tween({degree:1}).to({degree:0},e/2).easing(TWEEN.Easing.Linear.None).repeat(i||0===i?2*i-1:1/0).yoyo(!0).onUpdate(function(){var e=o()(a.a.mark((function e(i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.sdk.viewer){e.next=3;break}return TWEEN.remove(t.flickerAnimate),e.abrupt("return");case 3:t.show&&(1===i.degree&&(t.entity&&(t.entity.show=!0),t.labelShow&&t.label&&(t.label.show=!0),t.text&&t.text&&(t.text.show=!0)),0===i.degree&&(t.entity&&(t.entity.show=!1),t.labelShow&&t.label&&(t.label.show=!1),t.text&&t.text&&(t.text.show=!1)));case 4:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).onComplete((function(e){TWEEN.remove(t.flickerAnimate),t.flickerAnimate=void 0})).start()}},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.length>0&&void 0!==u[0]?u[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position&&"[object Object]"===Object.prototype.toString.call(this.options.position)?l=In({},this.options.position):this.options.positions?l=In({},this.options.positions[0]):this.options.line&&this.options.line.positions?l=In({},this.options.line.positions[0]):this.options.center?l=In({},this.options.center):this.options.start?l=In({},this.options.start):this.geojson?(c=turf.bbox(this.geojson),l={lng:c[0],lat:c[1]}):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=26;break;case 25:this.sdk.viewer.flyTo(this.entity,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sdk.removeIncetance(this.options.id);case 2:this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id);case 6:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"onClick",get:function(){return this.clickCallBack},set:function(t){if(t&&"function"!=typeof t)console.error("val:",t,"不是一个function");else{var e=ae().sdkD,i=ze().sdkD;e&&this.sdk===e?null==this.clickCallBack&&this.options&&this.options.id&&function(t,e,i){Ct.set(t,{callback:e,that:i})}(this.options.id,this.leftClickCB,this):i&&this.sdk===i?null==this.clickCallBack&&this.options&&this.options.id&&function(t,e,i){ue.set(t,{callback:e,that:i})}(this.options.id,this.leftClickCB,this):null==this.clickCallBack&&this.options&&this.options.id&&dt(this.options.id,this.leftClickCB,this),this.clickCallBack=t}}},{key:"onRightClick",get:function(){return this.rightClickCallBack},set:function(t){if(t&&"function"!=typeof t)console.error("val:",t,"不是一个function");else{var e=ae().sdkD,i=ze().sdkD;e&&this.sdk===e?null==this.rightClickCallBack&&this.entity&&this.entity.id&&function(t,e,i){wt.set(t,{callback:e,that:i})}(this.entity.id,this.rightClickCB,this):i&&this.sdk===i?null==this.clickCallBack&&this.options&&this.options.id&&function(t,e,i){pe.set(t,{callback:e,that:i})}(this.options.id,this.leftClickCB,this):null==this.rightClickCallBack&&this.entity&&this.entity.id&&mt(this.entity.id,this.rightClickCB,this),this.rightClickCallBack=t}}},{key:"onMouseMove",get:function(){return this.mouseMoveCallBack},set:function(t){if(t&&"function"!=typeof t)console.error("val:",t,"不是一个function");else{var e=ae().sdkD,i=ze().sdkD;e&&this.sdk===e?null==this.mouseMoveCallBack&&this.entity&&this.entity.id&&function(t,e,i){kt.set(t,{callback:e,that:i})}(this.entity.id,this.mouseMoveCB,this):i&&this.sdk===i?null==this.clickCallBack&&this.options&&this.options.id&&function(t,e,i){he.set(t,{callback:e,that:i})}(this.options.id,this.leftClickCB,this):null==this.mouseMoveCallBack&&this.entity&&this.entity.id&&ft(this.entity.id,this.mouseMoveCB,this),this.mouseMoveCallBack=t}}},{key:"customView",get:function(){return this.options.customView}},{key:"setCustomView",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=4;break}this.options.customView=e,t.next=16;break;case 4:if(i=this.sdk.viewer.camera,n=this.cartesian3Towgs84(i.position,this.sdk.viewer),o={lng:0,lat:0},s=In({},n),this.options.position&&"[object Object]"===Object.prototype.toString.call(this.options.position)?o=In({},this.options.position):this.options.positions?o=In({},this.options.positions[0]):this.options.line&&this.options.line.positions?o=In({},this.options.line.positions[0]):this.options.center?o=In({},this.options.center):this.options.start?o=In({},this.options.start):this.geojson?(r=turf.bbox(this.geojson),o={lng:r[0],lat:r[1]}):(this.options.hasOwnProperty("lng")&&(o.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(o.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(o.alt=this.options.alt)),o.hasOwnProperty("alt")){t.next=13;break}return t.next=12,this.getClampToHeight(o);case 12:o.alt=t.sent;case 13:s={lng:n.lng-o.lng,lat:n.lat-o.lat,alt:n.alt-o.alt},this.options.customView={orientation:{heading:Cesium.Math.toDegrees(i.heading),pitch:Cesium.Math.toDegrees(i.pitch),roll:Cesium.Math.toDegrees(i.roll)},relativePosition:s},this.originalOptions&&(this.originalOptions.customView=this.options.customView);case 16:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"resetCustomView",value:function(){this.options.customView=void 0}},{key:"edit",value:function(){}},{key:"leftClickCB",value:function(t,e,i,n){n.clickCallBack&&"function"==typeof n.clickCallBack&&n.clickCallBack(t,e,i)}},{key:"rightClickCB",value:function(t,e,i,n){n.rightClickCallBack&&"function"==typeof n.rightClickCallBack&&n.rightClickCallBack(t,e,i)}},{key:"mouseMoveCB",value:function(t,e,i,n){n.mouseMoveCallBack&&"function"==typeof n.mouseMoveCallBack&&n.mouseMoveCallBack(t,e,i)}},{key:"getGuid",value:function(){return Cesium.createGuid()}},{key:"setDefaultValue",value:function(){var t,e,i;this.options.id=null!==(t=this.options.id)&&void 0!==t?t:this.getGuid(),this.options.show=null===(e=this.options.show)||void 0===e||e,this.options.name=null!==(i=this.options.name)&&void 0!==i?i:"未命名对象"}},{key:"start",value:function(){}},{key:"end",value:function(){}}]);var i,n,s}(fi);function Yn(t){return'\n \n
            \n
            \n
            \n 名称\n \n
            \n
            \n 透明度\n \n
            \n
            \n
            \n \n
            \n
            \n
            \n 经度\n \n
            \n
            \n 波纹层数\n
            \n \n \n
            \n
            \n
            \n
            \n
            \n 纬度\n \n
            \n
            \n 扩散速度\n
            \n \n \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n 半径单位\n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n \n \n
            \n
            \n
            \n
            \n
            \n \n \n '.concat(Ln(t),'\n \n \n ').concat('\n
            \n
            \n 标注开关\n \n
            \n
            \n
            \n
            \n 字体颜色\n
            \n
            \n
            \n 字体选择\n
            \n
            \n
            \n 字体大小\n
            \n \n px\n \n
            \n
            \n
            \n
            \n
            \n 视野缩放\n \n
            \n
            \n 最近距离\n
            \n \n m\n \n
            \n
            \n
            \n 最远距离\n
            \n \n m\n \n
            \n
            \n
            \n ','\n
            \n \n ').concat('\n
            \n
            \n 引线颜色\n
            \n
            \n
            \n 背景颜色\n
            \n
            \n
            \n
            \n
            \n
            \n 引线宽度\n
            \n \n px\n \n
            \n
            \n
            \n 引线长度\n
            \n \n px\n \n
            \n
            \n
            \n ','\n
            \n
            \n
            \n
            \n \n ')}var Jn=[{name:"黑体",value:"黑体",font:"SimHei",key:"0"},{name:"思源黑体",value:"思源黑体",font:"SourceHanSansTi",key:"1"},{name:"庞门正道标题体",value:"庞门正道标题体",font:"PMZDBTTi",key:"2"},{name:"数黑体",value:"数黑体",font:"AlimamaShuHeiTi",key:"3"}];function qn(){return Jn}function Xn(t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;k()(this,e),$n(i=Kn(this,e,[t,n]),eo,void 0),$n(i,io,document.createElement("canvas")),$n(i,no,document.createElement("canvas")),i.model=o,i.options.near=n.near||0===n.near?n.near:2e3,i.options.far=n.far||0===n.far?n.far:1e5,i.options.scaleByDistance=n.scaleByDistance||!1,i.options.show=!n.show&&!1!==n.show||n.show,i.options.text=n.text;for(var s=i.options.text.split("\n"),a=0;a40&&(s[a]=s[a].slice(0,40-s[a].length));return s.length>10&&s.splice(10-s.length),i.options.text=s.join("\n"),i.options.fontFamily=n.fontFamily||0,i.font=Xn(i.options.fontFamily)||"SimHei",i.options.fontSize=n.fontSize||20,i.options.lineWidth=n.lineWidth||4,i.options.lineColor=n.lineColor||"#00ffff80",i.options.color=n.color||"#ffffff",i.options.ground=!n.ground&&!1!==n.ground||n.ground,i.options.pixelOffset=n.pixelOffset||0===n.pixelOffset?n.pixelOffset:20,i.options.backgroundColor=n.backgroundColor||["#00ffff80","#00ffff80"],i.event=new X(i.sdk),i.entity,i.create(i.options.position),i.picking=!0,i}return sn()(e,t),_()(e,[{key:"create",value:(i=o()(a.a.mark((function t(){var e,i,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this,this.options.position[2]||0===this.options.position[2]){t.next=5;break}return t.next=4,this.getClampToHeight({lng:this.options.position[0],lat:this.options.position[1]});case 4:this.options.position[2]=t.sent;case 5:this.originalOptions=so(this.options),i=this.options.id+"-label",(n=this.sdk.viewer.entities.getById(i))&&this.sdk.viewer.entities.remove(n),this.entity=this.sdk.viewer.entities.add({show:this.options.show,id:this.options.id+"-label",position:new Cesium.CallbackProperty((function(){if(e.model){if(e.model.isMove){var t=e.model.customScale.x;e.model.customScale.y>t&&(t=e.model.customScale.y),e.model.customScale.z>t&&(t=e.model.customScale.z);for(var i=Cesium.Cartesian3.fromDegrees(e.options.position[0],e.options.position[1],e.options.position[2]+2*(e.model.originalBoundingSphereRadius||1)*(t||.01)),n=Cesium.Cartesian3.fromDegrees(e.options.position[0],e.options.position[1],e.options.position[2]-2*(e.model.originalBoundingSphereRadius||1)*(t||.01)),o=Cesium.Cartesian3.subtract(n,i,new Cesium.Cartesian3),s=Cesium.Cartesian3.normalize(o,o),a=new Cesium.Ray(i,s),r=e.viewer.scene.drillPickFromRay(a,5),l=0;li&&(i=this.model.customScale.y),this.model.customScale.z>i&&(i=this.model.customScale.z);for(var n=this.cartesian3Towgs84(this.model.position,this.sdk.viewer),o=Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt+2*(this.model.originalBoundingSphereRadius||1)*(i||.01)),s=Cesium.Ellipsoid.WGS84.geodeticSurfaceNormal(o),a=Cesium.Cartesian3.normalize(s,s),r=Cesium.Cartesian3.multiplyByScalar(a,-1,new Cesium.Cartesian3),l=new Cesium.Ray(o,r),c=this.viewer.scene.drillPickFromRay(l,5),u=0;u40&&(e[i]=e[i].slice(0,40-e[i].length));e.length>10&&e.splice(10-e.length),this.options.text=e.join("\n"),this.entity&&this.updateBillboardImage()}},{key:"color",get:function(){return this.options.color},set:function(t){this.options.color=t,this.entity&&(this.entity.billboard.image=this.getcanvas())}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(t){this.options.scaleByDistance=t,this.entity&&(this.options.scaleByDistance?(this.entity.billboard.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.billboard.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0)):(this.entity.billboard.scaleByDistance=void 0,this.entity.billboard.pixelOffsetScaleByDistance=void 0))}},{key:"near",get:function(){return this.options.near},set:function(t){var e=t;e>this.far&&(e=this.far),this.options.near=e,this.entity&&(this.options.scaleByDistance?(this.entity.billboard.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.billboard.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0)):(this.entity.billboard.scaleByDistance=void 0,this.entity.billboard.pixelOffsetScaleByDistance=void 0))}},{key:"far",get:function(){return this.options.far},set:function(t){var e=t;ei&&(i=a),n+=this.options.fontSize}n=n+20+5*(e.length-1),(i+=30)0&&void 0!==arguments[0]?arguments[0]:{},e=null;if("object"==N()(t)&&null!==t)for(var i in e=t instanceof Array?[]:{},t)e[i]=so(t[i]);else e=t;return e},ao=function(){return _()((function t(e){k()(this,t),t.prototype.hasOwnProperty("color")||Object.defineProperties(t.prototype,{color:Cesium.createPropertyDescriptor("color")}),t.prototype.hasOwnProperty("speed")||Object.defineProperties(t.prototype,{speed:Cesium.createPropertyDescriptor("speed")}),t.prototype.hasOwnProperty("transparency")||Object.defineProperties(t.prototype,{transparency:Cesium.createPropertyDescriptor("transparency")}),t.prototype.hasOwnProperty("count")||Object.defineProperties(t.prototype,{count:Cesium.createPropertyDescriptor("count")}),t.prototype.hasOwnProperty("gradient")||Object.defineProperties(t.prototype,{gradient:Cesium.createPropertyDescriptor("gradient")}),this._definitionChanged=new Cesium.Event,this._speed=void 0,this.id=e.id,this.color=e.color||new Cesium.Color(1,1,1,1),this.colors=e.colors||{},this.speed=e.speed,this.transparency=e.transparency,this.count=e.count,this.gradient=e.gradient;var i="",n=[];for(var o in this.colors)Object.hasOwnProperty.call(this.colors,o)&&n.push(o);n.sort((function(t,e){return e-t}));for(var s=0;s 0.0){\n if(disNum < perDis){\n bl = 1.0 - disNum / perDis;\n }\n else if(disNum - perDis < perDis){\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = pow(bl,(1.0 + 10.0 * (1.0 - gradient))) * transparency;\n }\n }\n }\n }\n return material;\n }\n "),this._CircleRippleMaterialType="CircleRippleMaterialType"+this.id,Cesium.Material._materialCache.addMaterial(this._CircleRippleMaterialType,{fabric:{type:this._CircleRippleMaterialType,uniforms:{color:new Cesium.Color(1,0,0,1),speed:3,transparency:1,count:4,gradient:.2,frameNumber:Cesium.getTimestamp()},source:this._source},translucent:function(t){return!0}})}),[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return this._CircleRippleMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.transparency=this.transparency,e.count=this.count,e.gradient=this.gradient,e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(t){return this===t||t instanceof CircleRippleMaterialProperty&&Cesium.Property.equals(this._color,t._color)&&Cesium.Property.equals(this._speed,t._speed)&&Cesium.Property.equals(this.count,t.count)&&Cesium.Property.equals(this.transparency,t.transparency)&&Cesium.Property.equals(this.gradient,t.gradient)}}])}();function ro(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function lo(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function uo(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,e),(i=po(this,e,[t,n])).options.lng=n.lng,i.options.lat=n.lat,i.options.color=n.color||"#1FA8E3",i.options.transparency=n.transparency||0===n.transparency?n.transparency:1,i.options.transparency>1&&(i.options.transparency=1),i.options.speed=n.speed||0===n.speed?n.speed:5,i.options.count=n.count||0===n.count?n.count:3,n.count||0===n.count?(i.options.count=n.count,n.count>99&&(i.options.count=99)):i.options.count=3,i.options.circle=n.circle||[{radius:10}];for(var s=0;s999999&&(i.options.circle[s].radius=999999);i.options.show=!n.show&&!1!==n.show||n.show,i.event=new X(i.sdk),i.options.positionEditin=!1,n.label=n.label||{},i._elms={},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",i.options.attribute=n.attribute||{},i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.ISC=i.options.attribute.ISC||{},i.options.attribute.ISC.content=i.options.attribute.ISC.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText";for(var a=0,r=0;ra&&(a=Number(i.options.circle[r].radius));return i._radius=a,i.Dialog=o,i._EventBinding=new wn,i.sdk.addIncetance(i.options.id,i),e.create(i),i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"CircleDiffuse"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;this.isShowView&&e||(this.options.show=t),this.showView&&3!=this.showView&&e?(this.entity.show=!1,this.options.label.show&&(this.label.show=!1)):(this.entity.show=this.options.show,this.options.label.show&&(this.label.show=this.options.show)),this.isShowView=!1,Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t)}else console.error("参数必须为boolean")}},{key:"positionEditing",get:function(){return this.options.positionEditing},set:function(t){var e=this;this.sdk&&this.sdk.viewer&&this.entity&&(this.options.positionEditing=t,!0===t?(this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.lastOptions={lng:this.options.lng,lat:this.options.lat},this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=t.lng,e.lat=t.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1}}))}))):(setTimeout((function(){e.picking=!0}),500),this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){}))),this.tip&&this.tip.destroy(),this.lastOptions&&(this.lng=this.lastOptions.lng,this.lat=this.lastOptions.lat),this.lastOptions=void 0))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t,this.label.position=[t,this.lat],this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t,this.label.position=[this.lng,t],this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"radius",get:function(){return this._radius}},{key:"circle",get:function(){return this.options.circle},set:function(t){console.log(t),this.options.circle=t||[{radius:10}];for(var e=0;e999999&&(this.options.circle[e].radius=999999);this._createCircleElm()}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t,e.create(this),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t}))}},{key:"transparency",get:function(){return this.options.transparency},set:function(t){this.options.transparency=t>1?1:t,e.create(this),this._elms.transparency&&this._elms.transparency.forEach((function(e){e.value=t}))}},{key:"count",get:function(){return this.options.count},set:function(t){this.options.count=t>99?99:t,e.create(this),this._elms.count&&this._elms.count.forEach((function(e){e.value=t}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){var e=ze().sdkD;this.options.label.show=t,!this.show||this.showView&&3!=this.showView&&e?this.label.show=!1:this.label.show=t,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
            '+this.options.attribute.link.content[s].url+'
            \n
            \n \n \n
            \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
            \n \n
            \n
            \n \n
            \n
            \n \n \n
            ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
            '+this.options.attribute.vr.content[s].url+'
            \n
            \n \n \n
            \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
            \n \n
            \n
            \n \n
            \n
            \n \n \n
            ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0&&void 0!==u[0]?u[0]:{},pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=lo({},this.options.position):this.options.positions?l=lo({},this.options.positions[0]):this.options.start?l=lo({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=27;break;case 23:return t.next=25,this.getClampToHeight({lng:this.options.lng,lat:this.options.lat});case 25:c=t.sent,this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,6*this.radius+c),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},duration:1});case 27:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"edit",value:(s=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=28;break}return t.next=6,new rn(this.sdk,this.options,{title:"扩散光波属性",left:"180px",top:"100px",confirmCallBack:function(t){c.name=c.name.trim(),c.name||(c.name="未命名对象"),c.options.label.position={lng:c.label.position[0],lat:c.label.position[1],alt:c.label.position[2]},c.originalOptions=c.deepCopyObj(c.options),c._DialogObject.close(),c.Dialog.confirmCallBack&&c.Dialog.confirmCallBack(c.originalOptions),Pe(c.sdk,c.options.id),se(c.sdk,c.options.id)},resetCallBack:function(){c.reset(),c.Dialog.resetCallBack&&c.Dialog.resetCallBack()},removeCallBack:function(){c.Dialog.removeCallBack&&c.Dialog.removeCallBack()},closeCallBack:function(){c.reset(),c.positionEditing=!1,c.Dialog.closeCallBack&&c.Dialog.closeCallBack()},showCallBack:function(t){c.options.show=t,c.originalOptions.show=t,c.show=t,c.Dialog.showCallBack&&c.Dialog.showCallBack()},translationalCallBack:function(){c.positionEditing=!c.positionEditing}},!0);case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" circle-ciffuse",(i=document.createElement("div")).innerHTML=Yn(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,this._createCircleElm(),new kn("circle-diffuse-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelColor=t},clear:function(){c.labelColor="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelLineColor=t},clear:function(){c.labelLineColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelBackgroundColorStart=t},clear:function(){c.labelBackgroundColorStart="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelBackgroundColorEnd=t},clear:function(){c.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),l=i.getElementsByTagName("*"),this._EventBinding.on(this,l),this._elms=this._EventBinding.element,this._elms.labelColor=[n],this._elms.labelLineColor=[o],this._elms.labelBackgroundColorStart=[s],this._elms.labelBackgroundColorEnd=[r],setTimeout((function(){c.attributeLink=c.options.attribute.link.content,c.attributeVr=c.options.attribute.vr.content,c.ISCSelect&&c.ISCSelect(),c.goodsSelect&&c.goodsSelect(),c.cameraSelect&&c.cameraSelect();var t=Y(c._DialogObject._element.content.getElementsByClassName("input-radius-unit-box")[0],".input-radius-unit");if(t){t.legp_search([{name:"米",value:"米"},{name:"千米",value:"千米"}]);var e=c._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0];e.value="米",e.addEventListener("input",(function(){var t=c._DialogObject._element.content.getElementsByClassName("circle-content-box")[0].getElementsByClassName("input-number");switch(e.value){case"米":for(var i=0;it&&(t=Number(this.options.circle[i].radius));this._radius=t,e.create(this)}}},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.label&&this.label.remove(),this.entity&&this.sdk.viewer.entities.remove(this.entity),this.entity2&&this.sdk.viewer.entities.remove(this.entity2),this.entity=null,this.entity2=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=10,this.sdk.removeIncetance(this.options.id);case 10:return t.next=12,Pe(this.sdk,this.options.id);case 12:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"_createCircleElm",value:function(){var t=this;if(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content){var i=this._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0],n=i?i.value:"米",o=this._DialogObject._element.content.getElementsByClassName("circle-content-box")[0];o.innerHTML="";for(var s=function(i){var s=document.createElement("div");s.className="row";var a="",r='';0===i&&i===t.options.circle.length-1&&(r=""),i===t.options.circle.length-1&&(a=''),s.innerHTML='\n
            \n 半径\n
            \n \n '.concat("米"===n?"m":"km",'\n \n
            \n
            \n
            \n
            \n 扩散颜色\n
            \n
            \n ').concat(a,"\n ").concat(r,"\n
            \n ");var l=s.getElementsByClassName("input")[0];l.value=t.options.circle[i].radius/("米"===n?1:1e3),l.addEventListener("input",(function(n){var o=t._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(n.target.value||0===n.target.value){var s=n.target.value;if(s=Number(s),"."!=n.data&&("-"!=n.data||n.target.value)&&(!n.target.max&&!n.target.min||s<=Number(n.target.max)/("米"===o?1:1e3)&&s>=Number(n.target.min))){s="米"===o?Math.floor(100*s)/100:Math.floor(1e5*s)/1e5,t.options.circle[i].radius=s*("米"===o?1:1e3);for(var a=0,r=0;ra&&(a=Number(t.options.circle[r].radius));t._radius=a,e.create(t)}}})),l.addEventListener("blur",(function(n){var o=t._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(n.target.value||0===n.target.value){var s=n.target.value;s=Number(s),n.target.max&&s>Number(n.target.max)/("米"===o?1:1e3)&&(s=Number(n.target.max)/("米"===o?1:1e3)),n.target.min&&sa&&(a=Number(t.options.circle[r].radius));t._radius=a,l.value=s,e.create(t)}}));new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!1,defaultColor:t.options.circle[i].color||t.options.color,disabled:!1,openPickerAni:"opacity",sure:function(n){t.options.circle[i].color=n,e.create(t)},clear:function(){t.options.circle[i].color="rgba(255,255,255,1)",e.create(t)}});var c=s.getElementsByClassName("circle-minus")[0];c&&c.addEventListener("click",(function(){t.options.circle.splice(i,1);for(var n=0,o=0;on&&(n=Number(t.options.circle[o].radius));t._radius=n,e.create(t),t._createCircleElm()}));var u=s.getElementsByClassName("circle-add")[0];u&&u.addEventListener("click",(function(){t.options.circle.push({radius:0,color:"rgba(255,255,255,1)"});for(var i=0,n=0;ni&&(i=Number(t.options.circle[n].radius));t._radius=i,e.create(t),t._createCircleElm()})),o.appendChild(s)},a=0;a0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}}],[{key:"create",value:function(t){for(var i={},n=0;n\n
            \n
            \n
            \n 名称\n \n
            \n
            \n 扫描颜色\n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n 经度\n \n
            \n
            \n 扫描半径\n
            \n \n m\n \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n 纬度\n \n
            \n
            \n 扫描速度\n \n
            \n
            \n
            \n
            \n
            \n \n \n '.concat(Ln(t),'\n \n \n ').concat('\n
            \n
            \n 标注开关\n \n
            \n
            \n
            \n
            \n 字体颜色\n
            \n
            \n
            \n 字体选择\n
            \n
            \n
            \n 字体大小\n
            \n \n px\n \n
            \n
            \n
            \n
            \n
            \n 视野缩放\n \n
            \n
            \n 最近距离\n
            \n \n m\n \n
            \n
            \n
            \n 最远距离\n
            \n \n m\n \n
            \n
            \n
            \n ','\n
            \n \n ').concat('\n
            \n
            \n 引线颜色\n
            \n
            \n
            \n 背景颜色\n
            \n
            \n
            \n
            \n
            \n
            \n 引线宽度\n
            \n \n px\n \n
            \n
            \n
            \n 引线长度\n
            \n \n px\n \n
            \n
            \n
            \n ','\n
            \n
            \n
            \n
            \n \n ')}function fo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function vo(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=bo(this,e,[t,n])).options.lng=n.lng,i.options.lat=n.lat,i.options.color=n.color||"#FFEB3B",i.options.radius=n.radius||10,i.options.radius>999999&&(i.options.radius=999999),i.options.speed=n.speed||0===n.speed?n.speed:20,i.options.show=!n.show&&!1!==n.show||n.show,i.event=new X(i.sdk),i.options.positionEditin=!1,n.label=n.label||{},i._elms={},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",i.options.attribute=n.attribute||{},i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera=i.options.attribute.camera.content||[],i.options.attribute.ISC=i.options.attribute.ISC||{},i.options.attribute.ISC.content=i.options.attribute.ISC.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.Dialog=o,i._EventBinding=new wn,i.sdk.addIncetance(i.options.id,i),e.create(i),i}return sn()(e,t),_()(e,[{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;this.isShowView&&e||(this.options.show=t),this.showView&&3!=this.showView&&e?(this.entity.show=!1,this.options.label.show&&this.label&&(this.label.show=!1)):(this.entity.show=this.options.show,this.options.label.show&&this.label&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"positionEditing",get:function(){return this.options.positionEditing},set:function(t){var e=this;!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity&&(this.options.positionEditing=t,!0===t?(this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.lastOptions={lng:this.options.lng,lat:this.options.lat},this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=t.lng,e.lat=t.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1}}))}))):(setTimeout((function(){e.picking=!0}),500),this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),this.lastOptions&&(this.lng=this.lastOptions.lng,this.lat=this.lastOptions.lat),this.lastOptions=void 0))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t,this.label.position=[t,this.lat],this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t,this.label.position=[this.lng,t],this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"radius",get:function(){return this.options.radius},set:function(t){var e=Number(t.toFixed(2));(e>999999&&(e=999999),e<.1&&(e=.1),this.options.radius=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content)&&("千米"===this._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value&&(e=Number((e/1e3).toFixed(5))));this._elms.radius&&this._elms.radius.forEach((function(t){t.value=e}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t,this.changeMaterial(),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t}))}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.changeMaterial(),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){var e=ze().sdkD;this.options.label.show=t,!this.show||this.showView&&3!=this.showView&&e?this.label.show=!1:this.label.show=t,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
            '+this.options.attribute.link.content[s].url+'
            \n
            \n \n \n
            \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
            \n \n
            \n
            \n \n
            \n
            \n \n \n
            ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
            '+this.options.attribute.vr.content[s].url+'
            \n
            \n \n \n
            \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
            \n \n
            \n
            \n \n
            \n
            \n \n \n
            ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0&&void 0!==u[0]?u[0]:{},pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=vo({},this.options.position):this.options.positions?l=vo({},this.options.positions[0]):this.options.start?l=vo({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=27;break;case 23:return t.next=25,this.getClampToHeight({lng:this.options.lng,lat:this.options.lat});case 25:c=t.sent,this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,6*this.options.radius+c),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},duration:1});case 27:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"edit",value:(s=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=34;break}return t.next=6,new rn(this.sdk,this.options,{title:"雷达光波属性",left:"180px",top:"100px",confirmCallBack:function(t){p.name=p.name.trim(),p.name||(p.name="未命名对象"),p.options.label.position={lng:p.label.position[0],lat:p.label.position[1],alt:p.label.position[2]},p.originalOptions=p.deepCopyObj(p.options),p._DialogObject.close(),p.Dialog.confirmCallBack&&p.Dialog.confirmCallBack(p.originalOptions),Pe(p.sdk,p.options.id),se(p.sdk,p.options.id)},resetCallBack:function(){p.reset(),p.Dialog.resetCallBack&&p.Dialog.resetCallBack()},removeCallBack:function(){p.Dialog.removeCallBack&&p.Dialog.removeCallBack()},closeCallBack:function(){p.reset(),p.positionEditing=!1,p.Dialog.closeCallBack&&p.Dialog.closeCallBack()},showCallBack:function(t){p.options.show=t,p.originalOptions.show=t,p.show=t,p.Dialog.showCallBack&&p.Dialog.showCallBack()},translationalCallBack:function(){p.positionEditing=!p.positionEditing}},!0);case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" radar-scan",(i=document.createElement("div")).innerHTML=mo(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,new kn("radar-scan-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){p.color=t},clear:function(){p.color="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelColor=t},clear:function(){p.labelColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelLineColor=t},clear:function(){p.labelLineColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelBackgroundColorStart=t},clear:function(){p.labelBackgroundColorStart="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelBackgroundColorEnd=t},clear:function(){p.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),c=i.getElementsByTagName("*"),this._EventBinding.on(this,c),this._elms=this._EventBinding.element,this._elms.color=[n],this._elms.labelColor=[o],this._elms.labelLineColor=[s],this._elms.labelBackgroundColorStart=[r],this._elms.labelBackgroundColorEnd=[l],(u=this._DialogObject._element.content.getElementsByClassName("input-radius")[0].getElementsByTagName("input")[0]).value=this.options.radius,this._elms.radius=[u],u.addEventListener("input",(function(t){var e=p._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(t.target.value||0===t.target.value){var i=t.target.value;i=Number(i),"."==t.data||"-"==t.data&&!t.target.value||(!t.target.max&&!t.target.min||i<=Number(t.target.max)/("米"===e?1:1e3)&&i>=Number(t.target.min))&&(p.radius=i*("米"===e?1:1e3))}})),u.addEventListener("blur",(function(t){var e=p._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(t.target.value||0===t.target.value){var i=t.target.value;i=Number(i),t.target.max&&i>Number(t.target.max)/("米"===e?1:1e3)&&(i=Number(t.target.max)/("米"===e?1:1e3)),t.target.min&&i0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}}],[{key:"create",value:function(t){var i=function(t){if(/^#/.test(t)){var e=t.replace("#",""),i=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),o=parseInt(e.substring(4,6),16),s=parseInt(e.substring(6,8),16);s||0===s?s/=255:s=1,t="rgba(".concat(i,",").concat(n,",").concat(o,",").concat(s,")")}var a=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);return a?[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),a[4]?parseFloat(a[4]):1]:null}(t.options.color),n="rgba(".concat(i[0],",").concat(i[1],",").concat(i[2],",1)");t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(t.options.lng,t.options.lat)}),!1),name:"雷达扫描",ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(){return t.options.radius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(){return t.options.radius}),!1),material:new Cesium.RadarScanMaterialProperty({color:Cesium.Color.fromCssColorString(n),transparency:i[3],speed:t.options.speed}),zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,"cesium-viewer 2d"===t.sdk.viewer._element.className&&(t.entity.ellipse.height=1),e.createLabel(t),Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){var i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getClampToHeight({lng:e.options.lng,lat:e.options.lat});case 2:i=t.sent,e.options.label.position||(e.options.label.position={lng:e.options.lng,lat:e.options.lat,alt:i}),e.label=new oo(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:!0});case 5:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"createBy2D",value:function(t){t.entity=new Cesium.EntityCollection;var i=0,n=r(t.options,t.options.radius,i),o=(new Date).getTime();t.viewer.clock.onTick.addEventListener((function(){var e=(new Date).getTime(),s=t.options.duration?360/t.options.duration:0,a=(e-o)*s;o=e,i+=a,n=r(t.options,t.options.radius,i)}));var s=t.sdk.viewer.entities.add({show:t.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){var e=t.createCircle({lng:t.options.lng,lat:t.options.lat},t.options.radius);return Cesium.Cartesian3.fromDegreesArray(e)}),!1),width:2,material:Cesium.Color.fromCssColorString(t.options.color),clampToGround:!0}}),a=t.sdk.viewer.entities.add({show:t.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArray(n)}),!1),width:2,material:Cesium.Color.fromCssColorString(t.options.color),clampToGround:!0}});function r(t,e,i){var n=t.lng,o=t.lat,s=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(n,o,0)),a=e*Math.cos(i*Math.PI/180),r=e*Math.sin(i*Math.PI/180),l=Cesium.Cartesian3.fromElements(a,r,0),c=Cesium.Matrix4.multiplyByPoint(s,l,new Cesium.Cartesian3),u=Cesium.Cartographic.fromCartesian(c);return[n,o,Cesium.Math.toDegrees(u.longitude),Cesium.Math.toDegrees(u.latitude)]}t.entity.add(s),t.entity.add(a),t.sdk.viewer.entities.add(t.entity),e.createLabel(t),Pe(t.sdk,t.options.id)}}]);var i,n,s,r}(Wn);function wo(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return ko(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?ko(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function ko(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function s(t,e){var i=Cesium.Cartesian3.distance(e.camera.positionWC,t.position.getValue()),n=t.billboard.scaleByDistance?t.billboard.scaleByDistance.getValue():void 0;if(!n)return 1;var o=n.near,s=n.nearValue,a=n.far,r=n.farValue;if(i<=o)return s;if(i>=a)return r;var l=(i-o)/(a-o);return Cesium.Math.lerp(s,r,l)}return k()(this,e),So(i=Eo(this,e,[t,n]),Oo,null),So(i,To,null),So(i,No,0),i.options.near=n.near||0===n.near?n.near:2e3,i.options.far=n.far||0===n.far?n.far:1e5,i.options.scaleByDistance=!n.scaleByDistance&&!1!==n.scaleByDistance||n.scaleByDistance,i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:3,i.options.billboard=n.billboard=n.billboard||{},i.options.billboard.isSelect=n.billboard.isSelect||!1,i.options.billboard.show=!n.billboard.show&&!1!==n.billboard.show||n.billboard.show,i.options.billboard.image=n.billboard.image||ti(n.billboard.defaultImage)||i.getSourceRootPath()+"/img/A-ablu-blank.png",i.options.billboard.defaultImage=n.billboard.defaultImage,i.options.billboard.scale=n.billboard.scale||0===n.billboard.scale?n.billboard.scale:3,n.label=n.label||{},i.options.label=n.label||{},i.options.label.text=n.label.text||i.options.name,i.options.name=i.options.label.text,i.options.label.show=!n.label.show&&!1!==n.label.show||n.label.show,i.options.label.fontFamily=n.label.fontFamily||0,i.options.label.fontSize=n.label.fontSize||39,i.options.label.color=n.label.color||"#00ffff",i.options.positions=n.positions=n.positions||{},i.options.positions.lng=Number(Number(n.positions.lng||0).toFixed(8)),i.options.positions.lat=Number(Number(n.positions.lat||0).toFixed(8)),i.options.positions.alt=Number(Number(n.positions.alt||0).toFixed(2)),Po(No,i,i.options.positions.alt),i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.rtmp=i.options.attribute.rtmp||{},i.options.attribute.rtmp.content=i.options.attribute.rtmp.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.ISC=i.options.attribute.ISC||{},i.options.attribute.ISC.content=i.options.attribute.ISC.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.options.coordinate=n.coordinate||"",i.options.attributeBoxState=n.attributeBoxState||!1,i.operate={},i._elms={},i.previous={positions:_o({},i.options.positions)},i.options.attributePos=n.attributePos||{x:60,y:60,width:200,height:120},i.entity,i._proj=i.sdk.proj,Po(To,i,(function(){i.attributeElm&&(i.attributeElm.style.pointerEvents="unset"),i.sdk&&i.sdk.viewer&&i.sdk.viewer._element&&(i.sdk.viewer._element.onmousemove=null),document.removeEventListener("mouseup",Do(To,i)),document.removeEventListener("mouseleave",Do(To,i))})),Po(Oo,i,(function(){var t=Cesium.Cartesian3.fromDegrees(i.options.positions.lng,i.options.positions.lat,Do(No,i));if(i.attributeElm&&i.entity){var e=i.sdk.viewer.scene.cartesianToCanvasCoordinates(t),n=i.entity.label.pixelOffset.getValue();if(e){var o,a,r,l,c,u=s(i.entity,i.sdk.viewer.scene),p=(i.entity.billboard.height.getValue()*(i.options.billboard.scale||0)+i.options.label.fontSize)*(1-u*u),h=!1,d=i.attributeElm.getElementsByClassName("billboard-attribute-box-line")[0],m=i.attributeElm.getElementsByClassName("left-top")[0],f=i.attributeElm.getElementsByClassName("right-top")[0];i.attributeElm.style.left=(e.x+i.options.attributePos.x).toFixed(0)+"px",i.attributeElm.style.top=(e.y+n.y-(i.options.label.show?i.options.label.fontSize/2:-i.options.label.fontSize/2)-i.attributeElm.offsetHeight-i.options.attributePos.y+p).toFixed(0)+"px",i.attributeElm.style.width=i.options.attributePos.width+"px",i.attributeElm.style.height=i.options.attributePos.height+"px",d.style.zIndex="-1",i.options.attributePos.x<-i.options.attributePos.width/2?(h=!0,d.style.left="unset",d.style.right="0",m.style.display="block",f.style.display="none"):(d.style.left="0",d.style.right="unset",m.style.display="none",f.style.display="block"),h?(l=i.attributeElm.offsetWidth+i.options.attributePos.x,c=i.options.attributePos.y?i.options.attributePos.y:0):(l=i.options.attributePos.x,c=i.options.attributePos.y?i.options.attributePos.y:0),o=Math.sqrt(l*l+c*c).toFixed(2),a=Math.atan(l/c),r=parseFloat((180*a/Math.PI).toFixed(2)),i.options.attributePos.y<0&&(r+=180),d.style.height=o+"px",d.style.transform="rotate("+r+"deg)"}}})),i.sdk.addIncetance(i.options.id,i),e.create(i),i.picking=!0,i.Dialog=o,i._EventBinding=new wn,i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"BillboardObject"}},{key:"selectBillboard",value:function(){var t=this;this.sdk.viewer.screenSpaceEventHandler.setInputAction((function(e){var i=t.sdk.viewer.scene.pick(e.position);Cesium.defined(i)&&i.id&&"airportBillboard"===i.id.id?t.entity.billboard&&(t.entity.billboard.color=Cesium.Color.YELLOW):t.entity.billboard&&(t.entity.billboard.color=Cesium.Color.WHITE)}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}},{key:"attributeSelect",get:function(){return[{name:"富文本",value:"富文本",key:"richText"},{name:"链接",value:"链接",key:"link"},{name:"rtmp",value:"rtmp",key:"rtmp"},{name:"IP摄像头",value:"IP摄像头",key:"camera"},{name:"全景图",value:"全景图",key:"vr"},{name:"物资",value:"物资",key:"goods"}]}},{key:"show",get:function(){return this.options.show},set:function(t){this.isShowView||(this.options.show=t,this.originalOptions.show=t),this.showView&&3!=this.showView?(this.entity&&(this.entity.show=!1),document.addEventListener("mouseup",Do(To,this)),document.addEventListener("mouseleave",Do(To,this)),this.attributeElm&&(this.sdk.viewer._element.removeChild(this.attributeElm),this.attributeElm=null),this.sdk.viewer.scene.postRender.removeEventListener(Do(Oo,this))):(this.entity&&(this.entity.show=this.options.show),this.attributeBoxState&&this.options.show?this.attributeBoxState=this.options.show:(document.addEventListener("mouseup",Do(To,this)),document.addEventListener("mouseleave",Do(To,this)),this.attributeElm&&(this.sdk.viewer._element.removeChild(this.attributeElm),this.attributeElm=null),this.sdk.viewer.scene.postRender.removeEventListener(Do(Oo,this)))),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=this.options.show),this.isShowView=!1}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var e,i=this;this.options.heightMode=t||0==t?t:3;var n,o="";switch(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(n=this._DialogObject._element.content.getElementsByClassName("alt-box")[0]),this.options.heightMode){case"0":case 0:n&&(n.className="input-number input-number-unit-1 alt-box"),this._elms.height&&(this._elms.height.style.display="flex"),e=Cesium.HeightReference.NONE,o="海拔高度";break;case"1":case 1:n&&(n.className="input-number input-number-unit-1 alt-box"),this._elms.height&&(this._elms.height.style.display="flex"),e=Cesium.HeightReference.NONE,o="相对地表";break;case"2":case 2:n&&(n.className="input-number input-number-unit-1 alt-box disabled"),o="依附地表",n&&(n.className="input-number input-number-unit-1 alt-box disabled"),o="依附地表",e=Cesium.HeightReference.CLAMP_TO_GROUND,this._elms.height&&(this._elms.height.style.display="none");break;case"3":case 3:n&&(n.className="input-number input-number-unit-1 alt-box disabled"),this._elms.height&&(this._elms.height.style.display="none"),e=Cesium.HeightReference.NONE,o="依附模型"}this.entity&&(this.entity.billboard.heightReference=e,this.entity.label.heightReference=e,e==Cesium.HeightReference.CLAMP_TO_GROUND?this.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.positions.lng,this.options.positions.lat)]).then((function(t){Po(No,i,t[0].height)})):Po(No,this,0):Po(No,this,this.options.positions.alt)),this._elms.heightMode&&(this._elms.heightMode.value=o)}},{key:"labelText",get:function(){return this.options.label.text},set:function(t){this.options.label.text=t,this.options.name=t,this.entity&&(this.entity.label.text=t+""),this._elms.labelText&&this._elms.labelText.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.positions.lng},set:function(t){this.options.positions.lng=Number(Number(t).toFixed(8)),this.renewPoint(),this.coordinate=this.options.coordinate,this._projConvert&&this._projConvert(),this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.positions.lat},set:function(t){this.options.positions.lat=Number(Number(t).toFixed(8)),this.renewPoint(),this.coordinate=this.options.coordinate,this._projConvert&&this._projConvert(),this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.positions.alt},set:function(t){var e=this;if(this.options.positions.alt=Number(Number(t).toFixed(2)),Po(No,this,this.options.positions.alt),this.renewPoint(),this.coordinate=this.options.coordinate,this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.positions.alt})),this._elms.height){var i=this._elms.height.getElementsByClassName("height")[0];if(i)switch(this._elms.heightMode.value){case"海拔高度":i.value=this.options.positions.alt;break;case"相对地表":this.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.positions.lng,this.options.positions.lat)]).then((function(t){i.value=Number((e.options.positions.alt-t[0].height).toFixed(2))})):i.value=Number(Number(this.options.positions.alt).toFixed(2));break;case"依附地表":case"依附地表":break;case"依附模型":this.updateHeight()}}}},{key:"near",get:function(){return this.options.near},set:function(t){var e=t;e>this.far&&(e=this.far),this.options.near=e,this.renewPoint(),this._elms.near&&this._elms.near.forEach((function(t){t.value=e}))}},{key:"far",get:function(){return this.options.far},set:function(t){var e=t;e=e._frameImages.length-1?0:r+1,t}),!1)),e.entity.billboard.height=new Cesium.CallbackProperty((function(){return a}),!1),e.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return e.options.billboard.show?new Cesium.Cartesian2(0,-a*e.options.billboard.scale-e.options.label.fontSize/2-5):new Cesium.Cartesian2(0,-e.options.label.fontSize/2-5)}),!1)}}))}else{var l=new Image;l.src=i;var c=36,u=document.createElement("canvas");l.onload=function(){var t=l.width/l.height;l.width=100,l.height=100/t;var i=l.width,n=l.height,o=u.getContext("2d",{willReadFrequently:!0});u.width=i,u.height=n,o.drawImage(l,0,0,i,n),c=n*(31/i),e.entity.billboard.imgWidth=i,e.entity.billboard.imgHeight=n,e.entity&&(e.entity.billboard.image=u),e.entity.billboard.height=new Cesium.CallbackProperty((function(){return c}),!1),e.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return e.options.billboard.show?new Cesium.Cartesian2(0,-c*e.options.billboard.scale-e.options.label.fontSize/2-5):new Cesium.Cartesian2(0,-e.options.label.fontSize/2-5)}),!1),c=n*(31/i)},l.onerror=function(t){u.width=0,u.height=0,c=0,e.entity.billboard.imgWidth=0,e.entity.billboard.imgHeight=0,e.entity&&(e.entity.billboard.image=u),e.entity.billboard.height=new Cesium.CallbackProperty((function(){return 0}),!1),e.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return new Cesium.Cartesian2(0,0)}),!1),c=36}}}},{key:"billboardScale",get:function(){return this.options.billboard.scale},set:function(t){this.options.billboard.scale=t,this.renewPoint(),this._elms.billboardScale&&this._elms.billboardScale.forEach((function(e){e.value=t}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.entity&&(this.entity.label.show=t),this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.value=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.renewPoint();var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.renewPoint(),this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t||"#00ffff",this.renewPoint(),this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.label.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(0,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
            '+this.options.attribute.link.content[s].url+'
            \n
            \n \n \n
            \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
            \n \n
            \n
            \n \n
            \n
            \n \n \n
            ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
            '+this.options.attribute.vr.content[s].url+'
            \n
            \n \n \n
            \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
            \n \n
            \n
            \n \n
            \n
            \n \n \n
            ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
            '+this.options.attribute.rtmp.content[s].url+'
            \n
            \n \n \n
            \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={rtmpEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.rtmp.content;case 2:e.attributeRtmp=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-rtmp")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
            \n \n
            \n
            \n \n
            \n
            \n \n \n
            ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.rtmp.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.rtmp.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0&&void 0!==m[0]&&m[0],i=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=41;break}return t.next=7,new rn(this.sdk,this.options,{title:"点属性",left:"180px",top:"100px",confirmCallBack:function(t){d.labelText=d.labelText.trim(),d.labelText||(d.labelText="未命名对象"),d.originalOptions=d.deepCopyObj(d.options),d.previous={positions:_o({},d.options.positions)},d._DialogObject.close();var e=d.deepCopyObj(d.options);e.host="",d.Dialog.confirmCallBack&&d.Dialog.confirmCallBack(e),Pe(d.sdk,d.options.id),se(d.sdk,d.options.id)},resetCallBack:function(){d.reset(),d.Dialog.resetCallBack&&d.Dialog.resetCallBack()},removeCallBack:function(){d.Dialog.removeCallBack&&d.Dialog.removeCallBack()},closeCallBack:function(){d.positionEditing=!1,setTimeout((function(){d.reset(),d.Dialog.closeCallBack&&d.Dialog.closeCallBack()}),0)},showCallBack:function(t){d.show=t,d.Dialog.showCallBack&&d.Dialog.showCallBack()},translationalCallBack:function(){d.positionEditing=!d.positionEditing},updateHeightCallBack:function(){d.updateHeight()}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" billboard-object",(n=document.createElement("div")).innerHTML=An(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,new kn("point-object-edit-tabs",void 0,this.sdk),s=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){d.labelColor=t},clear:function(){d.labelColor="rgba(255,255,255,1)"}}),r=n.getElementsByTagName("*"),this._EventBinding.on(this,r),this._elms=this._EventBinding.element,this._elms.labelColor=[s],setTimeout(o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,m,f,v,g,b,C,w,k,x,_,E,S,D,P,M,O;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(d.attributeLink=d.options.attribute.link.content,d.attributeVr=d.options.attribute.vr.content,d.attributeRtmp=d.options.attribute.rtmp.content,d.cameraSelect&&d.cameraSelect(),d.ISCSelect&&d.ISCSelect(),d.goodsSelect&&d.goodsSelect(),(e=document.createElement("div")).className="col",e.style.flex="0 0 110px",e.innerHTML='\n 属性框\n \n ',d._DialogObject._element.content.getElementsByClassName("attribute")[0].getElementsByClassName("row")[0].appendChild(e),(i=e.getElementsByClassName("btn-switch")[0]).checked=d.attributeBoxState,i.addEventListener("change",(function(t){d.attributeBoxState=i.checked})),n=d.attributeSelect,!(o=d._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0])){t.next=31;break}(s=Y(o,".attribute-select")).legp_search(n),r=d._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],l=0;case 22:if(!(l=0)){t.next=24;break}if(!v[g].position){t.next=21;break}return f=v[g],t.abrupt("break",24);case 21:g--,t.next=17;break;case 24:return f&&f.position&&(i=this.cartesian3Towgs84(f.position,this.sdk.viewer).alt),t.prev=25,t.next=28,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.positions.lng,this.options.positions.lat)]);case 28:b=t.sent,t.next=33;break;case 31:t.prev=31,t.t0=t.catch(25);case 33:if((void 0===i||i0&&void 0!==w[0]?w[0]:{},pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=26;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=_o({},this.options.position):this.options.positions?l=_o({},this.options.positions):this.options.center?l=_o({},this.options.center):this.options.start?l=_o({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=19;break}c=[],u=wo(this.sdk.entityMap);try{for(u.s();!(p=u.n()).done;)(h=y()(p.value,2))[0],"RadarScanStereoscopic"===(d=h[1]).type&&d.entity&&c.push(d.entity)}catch(t){u.e(t)}finally{u.f()}return t.next=18,this.getClampToHeight(l,c);case 18:l.alt=t.sent;case 19:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=33;break;case 26:m=[],f=wo(this.sdk.entityMap);try{for(f.s();!(v=f.n()).done;)(g=y()(v.value,2))[0],"RadarScanStereoscopic"===(b=g[1]).type&&b.entity&&m.push(b.entity)}catch(t){f.e(t)}finally{f.f()}return t.next=31,this.getClampToHeight(this.options.positions,m);case 31:C=t.sent,this.sdk.viewer.camera.flyTo({orientation:e.orientation,destination:Cesium.Cartesian3.fromDegrees(this.options.positions.lng,this.options.positions.lat,C+(e.height||500))});case 33:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"setPosition",value:function(t){this.options.positions.lng=t.position.lng,this.options.positions.lat=t.position.lat,this.options.positions.alt=t.position.alt,this.renewPoint()}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,this.event&&this.event.destroy(),this.event=new X(this.sdk),!0===t){this.picking=!1,this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.previous={positions:_o({},this.options.positions)};var i=function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.alt=n.alt,e.previous={positions:_o({},e.options.positions)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.entity.position=new Cesium.CallbackProperty((function(){return i}),!1),e.positionEditing=!1};this.event.mouse_move((function(t,i){e.entity.position=new Cesium.CallbackProperty((function(){return i}),!1),e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left(i),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,n){var o=new Date;e.event.gesture_pinck_end((function(){var s=new Date;t.position1.x,t.position2.x,t.position1.y,t.position2.y;s-o>=500?e.positionEditing=!1:i(0,n)}))}))}else this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){})),this.event.destroy(),this.event=null),this.tip&&this.tip.destroy(),this.lng=this.previous.positions.lng,this.lat=this.previous.positions.lat,this.alt=this.previous.positions.alt,this.renewPoint()}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.positions.lng,this.options.positions.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}},{key:"setCustomView",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=4;break}this.options.customView=e,t.next=19;break;case 4:if(i=this.sdk.viewer.camera,n=this.cartesian3Towgs84(i.position,this.sdk.viewer),o={lng:0,lat:0},s=_o({},n),this.options.positions?o=_o({},this.options.positions):(this.options.hasOwnProperty("lng")&&(o.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(o.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(o.alt=this.options.alt)),o.hasOwnProperty("alt")){t.next=16;break}r=[],l=wo(this.sdk.entityMap);try{for(l.s();!(c=l.n()).done;)(u=y()(c.value,2))[0],"RadarScanStereoscopic"===(p=u[1]).type&&p.entity&&r.push(p.entity)}catch(t){l.e(t)}finally{l.f()}return t.next=15,this.getClampToHeight(o,r);case 15:o.alt=t.sent;case 16:s={lng:n.lng-o.lng,lat:n.lat-o.lat,alt:n.alt-o.alt},this.options.customView={orientation:{heading:Cesium.Math.toDegrees(i.heading),pitch:Cesium.Math.toDegrees(i.pitch),roll:Cesium.Math.toDegrees(i.roll)},relativePosition:s},this.originalOptions&&(this.originalOptions.customView=this.options.customView);case 19:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"attributeBoxState",get:function(){return this.options.attributeBoxState},set:function(t){var e=this;if(t=!!t,this.options.attributeBoxState=t,document.addEventListener("mouseup",Do(To,this)),document.addEventListener("mouseleave",Do(To,this)),this.attributeElm&&(this.sdk.viewer._element.removeChild(this.attributeElm),this.attributeElm=null),this.sdk.viewer.scene.postRender.removeEventListener(Do(Oo,this)),t&&this.sdk&&this.sdk.viewer&&this.sdk.viewer._element&&this.show){var i=document.createElement("div");this.attributeElm=i,i.className="billboard-attribute-box",i.style.top="0px",i.style.left="0px",i.style.width=0,i.style.height=0,Gt&&(i.style.display="none"),this.sdk.viewer._element.appendChild(i);for(var n="",o="",s="",a=0;a'):n+='')}if(this.options.attribute.goods&&this.options.attribute.goods.content&&this.options.attribute.goods.content.length>0){o+='\n
            \n
            \n
            \n
            序号
            \n
            名称
            \n
            数量
            \n
            \n
            \n
            \n ';for(var l=0;l\n
            '.concat(l+1,'
            \n
            ').concat(this.options.attribute.goods.content[l].name,'
            \n
            ').concat(this.options.attribute.goods.content[l].cnt,"
            \n
            ");o+="
            "}this.options.richTextContent&&(s='\n '.concat(this.options.richTextContent,"\n "));var c='\n \n \n ';if(c+=n||o||s?'\n \n '.concat(s,"\n ").concat(o,"\n ").concat(n,'\n \n
            '):'

            暂无属性信息

            ',i.innerHTML=c,i.getElementsByClassName("tabs")[0])new kn(i.getElementsByClassName("tabs")[0],void 0,this.sdk);for(var u=i.getElementsByTagName("img"),p=0;p=t._frameImages.length-1?0:r+1,e}),!1),vi(t.sdk,t.entity),t.attributeBoxState&&(t.attributeBoxState=!0))}}))}else{var h=new Image;switch(h.src=c||t.getSourceRootPath()+"/img/A-ablu-blank.png",t.options.heightMode){case 2:case"2":i=Cesium.HeightReference.CLAMP_TO_GROUND}e=document.createElement("canvas"),h.onload=function(){var i=h.width/h.height;h.width=100,h.height=100/i;var o=h.width,s=h.height,a=e.getContext("2d",{willReadFrequently:!0});e.width=o,e.height=s,a.drawImage(h,0,0,o,s),n=s*(31/o),t.entity&&(t.entity.billboard.imgWidth=o,t.entity.billboard.imgHeight=s,t.entity.billboard.image=e,vi(t.sdk,t.entity),t.attributeBoxState&&(t.attributeBoxState=!0))},h.onerror=function(i){e.width=0,e.height=0,n=0,t.entity&&(t.entity.billboard.imgWidth=0,t.entity.billboard.imgHeight=0,t.entity.billboard.image=e,vi(t.sdk,t.entity),t.attributeBoxState&&(t.attributeBoxState=!0))}}t.entity=new Cesium.Entity({show:t.options.show,id:t.options.id,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),billboard:{image:a?new Cesium.CallbackProperty((function(){var e=t._frameImages[r];return r=r>=t._frameImages.length-1?0:r+1,e}),!1):e,scale:t.options.billboard.scale,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:Number.POSITIVE_INFINITY}),!1),heightReference:i,color:t.options.billboard.show?void 0:new Cesium.Color(1,1,1,0),width:31,height:new Cesium.CallbackProperty((function(){return n}),!1),verticalOrigin:Cesium.VerticalOrigin.BOTTOM},label:{show:t.options.label.show,text:t.options.label.text,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:Number.POSITIVE_INFINITY}),!1),heightReference:i,font:t.options.label.fontSize+"px "+l,fillColor:Cesium.Color.fromCssColorString(t.options.label.color),pixelOffset:new Cesium.CallbackProperty((function(){return t.options.billboard.show?new Cesium.Cartesian2(0,-n*t.options.billboard.scale-t.options.label.fontSize/2-5):new Cesium.Cartesian2(0,-t.options.label.fontSize/2-5)}),!1),outlineColor:Cesium.Color.BLACK,outlineWidth:1,style:Cesium.LabelStyle.FILL_AND_OUTLINE}}),t.entity.billboard.imgWidth=31,t.entity.billboard.imgHeight=36,t.entity.position=Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),3==t.options.heightMode&&t.updateHeight(),t.renewPoint(),Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id),t.options.billboard.isSelect&&t.selectBillboard()}}]);var i,n,s,r,l}(Wn);function Lo(t){return'\n \n
            \n
            \n
            \n 名称\n \n
            \n
            \n
            \n
            \n 投影面积:\n \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n \n \n '.concat(Ln(t),'\n \n \n
            \n
            \n 高度模式\n
            \n
            \n
            \n Z值统一增加\n
            \n \n m\n \n
            \n \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            经度(X)
            \n
            纬度(Y)
            \n
            高度(Z)
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n 面颜色\n
            \n
            \n
            \n 描边颜色\n
            \n
            \n
            \n 描边宽度\n
            \n \n px\n \n
            \n
            \n
            \n
            \n \n ').concat('\n
            \n
            \n 标注开关\n \n
            \n
            \n
            \n
            \n 字体颜色\n
            \n
            \n
            \n 字体选择\n
            \n
            \n
            \n 字体大小\n
            \n \n px\n \n
            \n
            \n
            \n
            \n
            \n 视野缩放\n \n
            \n
            \n 最近距离\n
            \n \n m\n \n
            \n
            \n
            \n 最远距离\n
            \n \n m\n \n
            \n
            \n
            \n ','\n
            \n \n ').concat('\n
            \n
            \n 引线颜色\n
            \n
            \n
            \n 背景颜色\n
            \n
            \n
            \n
            \n
            \n
            \n 引线宽度\n
            \n \n px\n \n
            \n
            \n
            \n 引线长度\n
            \n \n px\n \n
            \n
            \n
            \n ','\n
            \n
            \n
            \n
            \n \n ')}function Ao(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function jo(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ro(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),(i=Fo(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"rgba(255, 0, 0, 0.5)",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.positions=n.positions||[],i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",i.entity,i.event=new X(i.sdk),i.operate={},i._elms={},i.Dialog=o,i.nodePoints=[],n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",!i.options.positions||i.options.positions.length<3)i._error="多边形最少需要三个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{if(!i.options.height&&0!==i.options.height){for(var s=i.options.positions[0].alt,a=1;athis.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
            '+this.options.attribute.link.content[s].url+'
            \n
            \n \n \n
            \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
            \n \n
            \n
            \n \n
            \n
            \n \n \n
            ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
            '+this.options.attribute.vr.content[s].url+'
            \n
            \n \n \n
            \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
            \n \n
            \n
            \n \n
            \n
            \n \n \n
            ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c'.concat(i+1,'\n
            \n
            \n
            \n ');var s=o.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.positions[i].lng.toFixed(8),s.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.positions[i].lng.toFixed(8);var l=o.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.positions[i].lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.positions[i].lat.toFixed(8);var p=o.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),s.addEventListener("dblclick",(function(){s.innerHTML="",r.value=Number(n.options.positions[i].lng.toFixed(8)),s.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.positions[i].lng.toFixed(8)),s.innerHTML="",s.appendChild(a)})),r.addEventListener("input",(function(){n.options.positions[i].lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.positions[i].lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.positions[i].lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.positions[i].lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.positions[i].lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.positions[i].lat.toFixed(8),n.height=n.height})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(h),n._elms.altInput.push(d),t.appendChild(o)},o=0;o0&&void 0!==v[0]?v[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=jo({},this.options.position):this.options.positions?l=jo({},this.options.positions[0]):this.options.center?l=jo({},this.options.center):this.options.start?l=jo({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=51;break;case 25:c=[],t.t0=this.heightMode,t.next=0===t.t0||"0"===t.t0?29:1===t.t0||"1"===t.t0?31:2===t.t0||"2"===t.t0?33:35;break;case 29:case 31:return u=!1,t.abrupt("break",35);case 33:return u=!0,t.abrupt("break",35);case 35:if(!u){t.next=48;break}p=0;case 37:if(!(p=500?i.positionEditing=!1:y(0,e)}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(n.positions)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(n.positions),[n.positions[0],n.positions[1]])}),!1)}else{this.previous?this.positions=L()(this.previous.positions):this.previous={positions:L()(this.positions)},this.sdk&&this.sdk.viewer&&this.label&&this.label.entity||(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.destroy()),this.tip&&this.tip.destroy();for(var b=[[]],C=0;C0?new Cesium.PolygonHierarchy(m):new Cesium.PolygonHierarchy(o)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return m.length>0?[].concat(m,[m[0],m[1]]):[].concat(L()(o),[o[0],o[1]])}),!1)}},{key:"renewPositions",value:function(){var t=this;if(!this._error){for(var e=!1,i=[],n=this.options.positions,o=0;o0&&void 0!==h[0]?h[0]:{domid:"",x:10,y:10}).x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10,i=[[]],n=0;nNumber(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i1&&void 0!==arguments[1]?arguments[1]:function(){};t.positionEditing=!1,setTimeout((function(){var i=L()(t.options.positions);if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var n,s,r=function(){var e=o()(a.a.mark((function e(){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=L()(t.sdk.viewer.entities.values),n=0;case 2:if(!(n=3?[].concat(L()(l),[l[0],l[1],l[2]]):l}),!1);var m=L()(t.sdk.viewer.entities.values);if(t.options.positions.length<3)t.getClampToHeight({lng:t.options.positions[0].lng,lat:t.options.positions[0].lat},m).then((function(e){t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,e]}));else{for(var f=[[]],v=0;v=500?d():h(o,i)}))})),r()}),200)}}),50)}},{key:"closeNodeEdit",value:function(t){if(t.sdk&&t.sdk.viewer){YJ.Measure.SetMeasureStatus(!1),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e\n
            \n
            \n
            \n 名称\n \n
            \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n \n \n '.concat(Ln(t),'\n \n \n
            \n
            \n 高度模式\n
            \n
            \n
            \n Z值统一增加\n
            \n \n m\n \n
            \n \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            经度(X)
            \n
            纬度(Y)
            \n
            高度(Z)
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n 线条颜色\n
            \n
            \n
            \n 线条宽度\n
            \n \n px\n \n
            \n
            \n
            \n 线条形式\n
            \n
            \n
            \n
            \n
            \n 首尾相连\n \n
            \n
            \n 线段圆滑\n \n
            \n
            \n
            \n
            \n
            \n
            \n 线段缓冲\n \n
            \n
            \n 缓冲宽度\n
            \n \n m\n \n
            \n
            \n
            \n 缓冲颜色\n
            \n
            \n
            \n
            \n
            \n 首尾反向\n \n
            \n
            \n 流动速率\n
            \n \n \n
            \n
            \n
            \n 线条间距\n
            \n \n \n \n
            \n
            \n
            \n
            \n \n ').concat('\n
            \n
            \n 标注开关\n \n
            \n
            \n
            \n
            \n 字体颜色\n
            \n
            \n
            \n 字体选择\n
            \n
            \n
            \n 字体大小\n
            \n \n px\n \n
            \n
            \n
            \n
            \n
            \n 视野缩放\n \n
            \n
            \n 最近距离\n
            \n \n m\n \n
            \n
            \n
            \n 最远距离\n
            \n \n m\n \n
            \n
            \n
            \n ','\n
            \n \n ').concat('\n
            \n
            \n 引线颜色\n
            \n
            \n
            \n 背景颜色\n
            \n
            \n
            \n
            \n
            \n
            \n 引线宽度\n
            \n \n px\n \n
            \n
            \n
            \n 引线长度\n
            \n \n px\n \n
            \n
            \n
            \n ','\n
            \n \x3c!-- --\x3e\n \x3c!--
            --\x3e\n \x3c!--
            --\x3e\n \x3c!--
            --\x3e\n \x3c!-- 指令--\x3e\n \x3c!-- --\x3e\n \x3c!-- --\x3e\n \x3c!--
            --\x3e\n \x3c!--
            --\x3e\n \x3c!--
            --\x3e\n \x3c!--
            --\x3e\n \x3c!-- --\x3e\n \x3c!--
            --\x3e\n \x3c!--
            --\x3e\n \x3c!--
            --\x3e\n \x3c!-- 设置操作点--\x3e\n \x3c!-- --\x3e\n \x3c!-- --\x3e\n \x3c!--
            --\x3e\n \x3c!--
            --\x3e\n \x3c!--
            --\x3e\n \x3c!--
            --\x3e\n
            \n
            \n
            \n \n ')}function Vo(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Go(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Go(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Go(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);iNumber(e.target.max)&&(i=Number(e.target.max),e.target.value=i),e.target.min&&i1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),this.sdk=e,this.viwer=this.sdk.viewer,this.options=i,this.options.position=i.position||{},this.options.rotate=i.rotate||{},this.options.position.lng=this.options.position.lng||0,this.options.position.lat=this.options.position.lat||0,this.options.position.alt=this.options.position.alt||0,this.options.rotate.x=this.options.rotate.x||0,this.options.rotate.y=this.options.rotate.y||0,this.options.rotate.z=this.options.rotate.z||0,this.activeAxis,this.activeCircle,this.activeModelParam,this.origin,this.rayX,this.rayY,this.rayZ,this.arrow={},this.activeState,this.coordArrows=[],this.coordCircles=[],this.MapEvent=new X(this.sdk)}),[{key:"position",get:function(){return this.options.position},set:function(t){this.options.position=t,this.againArrow(),this.againCircle()}},{key:"rotate",get:function(){return this.options.rotate},set:function(t){this.options.rotate=t}},{key:"initParam",value:function(){return this._params={tx:this.options.position.lng,ty:this.options.position.lat,tz:this.options.position.alt,rx:this.options.rotate.x,ry:this.options.rotate.y,rz:this.options.rotate.z},Jo(Jo({},this.options.position),this.options.rotate)}},{key:"editTranslational",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:w=function(t){if(e.activeAxis){var i=t.startPosition.y-t.endPosition.y,n={x:t.endPosition.x-y.x,y:t.endPosition.y-y.y},o=r.camera.getPickRay(n),s=r.scene.globe.pick(o,r.scene),a=new Cesium.Cartesian3,l=Cesium.Transforms.eastNorthUpToFixedFrame(r.camera.position);Cesium.Matrix4.inverse(l,l),Cesium.Matrix4.multiplyByPoint(l,s,a),Cesium.Cartesian3.normalize(a,a);var c=e.initParam(),u=90+Cesium.Math.toDegrees(Math.asin(a.z)),p=Cesium.Cartographic.fromCartesian(r.camera.position).height,h=e.activeModelParam.alt,d=p/Math.cos(Cesium.Math.toRadians(u));new Cesium.EllipsoidGeodesic(Cesium.Cartographic.fromCartesian(s),Cesium.Cartographic.fromCartesian(r.camera.position)),s=Cesium.Ray.getPoint(o,d*(1-h/p));var m=Cesium.Cartographic.fromCartesian(s),f=Cesium.Math.toDegrees(m.longitude),v=Cesium.Math.toDegrees(m.latitude);switch(e.activeAxis._name){case"model_edit_xAxis":e._params.tx=f,e._params.ty=e.activeModelParam.lat,e._params.tz=h,e.origin=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt);var g=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng-.001,c.lat,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),k=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat-.001,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),x=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);e.rayX=new Cesium.Ray(e.origin,g),e.rayY=new Cesium.Ray(e.origin,k),e.rayZ=new Cesium.Ray(e.origin,x);break;case"model_edit_yAxis":e._params.tx=e.activeModelParam.lng,e._params.ty=v,e._params.tz=h,e.origin=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt);var _=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng-.001,c.lat,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),E=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat-.001,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),S=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);e.rayX=new Cesium.Ray(e.origin,_),e.rayY=new Cesium.Ray(e.origin,E),e.rayZ=new Cesium.Ray(e.origin,S);break;case"model_edit_zAxis":e.activeModelParam.alt+=Cesium.Cartesian3.distance(r.camera.position,Cesium.Cartesian3.fromDegrees(e.options.position.lng,e.options.position.lat,e.options.position.alt))/4300*i*3,e._params.tx=e.activeModelParam.lng,e._params.ty=e.activeModelParam.lat,e._params.tz=e.activeModelParam.alt,e.origin=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,e.activeModelParam.alt);var D=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng-.001,c.lat,e.activeModelParam.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),P=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat-.001,e.activeModelParam.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),M=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat,e.activeModelParam.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);e.rayX=new Cesium.Ray(e.origin,D),e.rayY=new Cesium.Ray(e.origin,P),e.rayZ=new Cesium.Ray(e.origin,M)}e.updateModel(e._params.tx,e._params.ty,e._params.tz,e._params.rx,e._params.ry,e._params.rz),e.againArrow()}else{var O=Date.now();if(O-b<100)return clearTimeout(C),void(C=setTimeout((function(){w(t)}),100));clearTimeout(C),b=O;for(var T=e.coordArrows,N=0;N=0;L--){var A=B[L];if(A&&A.primitive&&A.id)switch(A.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return void(A.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}}},this.destroy(),this.activeState="translational",this.MapEvent=new X(this.sdk),e=this,i=this.initParam(),n=i.lng,o=i.lat,s=i.alt,r=this.viwer,this.origin=Cesium.Cartesian3.fromDegrees(n,o,s),l=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n-.001,o,s),new Cesium.Cartesian3),new Cesium.Cartesian3),c=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n,o-.001,s),new Cesium.Cartesian3),new Cesium.Cartesian3),u=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n,o,s-1),new Cesium.Cartesian3),new Cesium.Cartesian3),this.rayX=new Cesium.Ray(this.origin,l),this.rayY=new Cesium.Ray(this.origin,c),this.rayZ=new Cesium.Ray(this.origin,u),this.arrow.positionX=Cesium.Ray.getPoint(this.rayX,0),this.arrow.positionY=Cesium.Ray.getPoint(this.rayY,0),this.arrow.positionZ=Cesium.Ray.getPoint(this.rayZ,0),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(n,o,s)),h=r.camera.position,d=Cesium.Cartesian3.distance(h,this.origin),m=d/15,Cesium.Matrix4.multiplyByScale(p,new Cesium.Cartesian3(m,m,m),p),f=this.createAxisArrow("model_edit_xAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(1,0,0)],p,Cesium.Color.RED),v=this.createAxisArrow("model_edit_yAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(0,1,0)],p,Cesium.Color.LIME),g=this.createAxisArrow("model_edit_zAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(0,0,1)],p,Cesium.Color.BLUE),this.viwer.scene.primitives.add(f),this.viwer.scene.primitives.add(v),this.viwer.scene.primitives.add(g),this.againArrow(),this.viwer.camera.percentageChanged=.001,this.viwer.camera.changed.addEventListener(this.againArrow,{_that:this}),y={x:0,y:0},b=0,this.MapEvent.mouse_move((function(t,e){w(t)})),this.MapEvent.mouse_left_down((function(t,i){var n=r.scene.cartesianToCanvasCoordinates(k.origin);y.x=t.position.x-Math.floor(n.x),y.y=t.position.y-Math.floor(n.y);for(var o=r.scene.drillPick(t.position,10),s=o.length-1;s>=0;s--){var a=o[s];if(a&&a.primitive&&a.primitive._name)if(e.activeAxis)e.activeAxis=null,e.activeModelParam=null,e.controllerCallBack;else switch(a.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return r.scene.screenSpaceCameraController.enableRotate=!1,e.activeAxis=a.primitive,e.activeModelParam=e.initParam(),void(a.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}})),this.MapEvent.mouse_left_up((function(t){r.scene.screenSpaceCameraController.enableRotate=!0;for(var i=0;i360&&(r._params.rx=1),r._params.rx<0&&(r._params.rx=360),Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(r._params.rx)),r._params.ry-=i,r._params.ry>360&&(r._params.ry=1),r._params.ry<0&&(r._params.ry=360),r._params.rz-=n,r._params.rz>360&&(r._params.rz=1),r._params.rz<0&&(r._params.rz=360),r.updateModel(r._params.tx,r._params.ty,r._params.tz,r._params.rx,r._params.ry,r._params.rz)}else{var c=Date.now();if(c-D<100)return clearTimeout(P),void(P=setTimeout((function(){M(t)}),100));clearTimeout(P),D=c;for(var u=s.coordCircles,p=0;p3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this._params.tx=t=parseFloat(parseFloat(t).toFixed(8)),this._params.ty=e=parseFloat(parseFloat(e).toFixed(8)),this._params.tz=i=parseFloat(parseFloat(i).toFixed(2)),this._params.rx=n=parseFloat(n),this._params.ry=o=parseFloat(o),this._params.rz=s=parseFloat(s),this.options.position.lng=t,this.options.position.lat=e,this.options.position.alt=i,this.options.rotate={x:n,y:o,z:s},this.controllerCallBack}},{key:"controllerCallBack",get:function(){this._controllerCallBack&&this._controllerCallBack(this.options,!this.activeAxis)},set:function(t){this._controllerCallBack=t}},{key:"createAxisArrow",value:function(t,e,i,n){var o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,width:20}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:n}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return o._name=t,this.coordArrows.push(o),o}},{key:"createAxisCircular",value:function(t,e,i,n){var o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.EllipseGeometry({center:{x:1,y:1,z:1},semiMinorAxis:5e5,semiMajorAxis:1e6,rotation:Cesium.Math.PI_OVER_FOUR,vertexFormat:Cesium.VertexFormat.POSITION_AND_ST})}),releaseGeometryInstances:!1,appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.YELLOW}}})}),modelMatrix:i});return o._name=t,this.coordArrows.push(o),o}},{key:"createAxisSphere",value:function(t,e,i,n,o){var s=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,width:5}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineColorAppearance({translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return s._radius=o,s._name=t,this.coordCircles.push(s),s}},{key:"removeCoordArrows",value:function(){for(var t=0;t=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Zo(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),ts(i=Qo(this,e,[t,n]),ns,void 0),i.options.name=n.name||"未命名对象",i.options.width=n.width||0===n.width?n.width:3,i.options.color=n.color||"#ff0000",i.options.type=n.type?Number(n.type):0,i.options["nose-to-tail"]=n["nose-to-tail"]||!1,i.options.smooth=n.smooth||!1,i.options.extend=n.extend||!1,i.options.rotate=!n.rotate&&!1!==n.rotate||n.rotate,i.options.space=n.space||1,i.options.speed=n.speed||10,i.options.dashSize=n.dashSize||.03,i.options["length-unit"]=n["length-unit"]||"米",i.options["fit-length-unit"]=n["fit-length-unit"]||"米",i.options["words-name"]=n["words-name"]||"空间长度",i.options["extend-width"]=n["extend-width"]||0===n["extend-width"]?n["extend-width"]:10,i.options["extend-color"]=n["extend-color"]||"rgba(255,255,80,0.3)",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i._elms=[],n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.operate={},i.nodePoints=[],i.unitNum=0,i.inputSpeed=n.speed&&100*Math.pow(n.speed,-1)||10,i.Dialog=o,!i.options.positions||i.options.positions.length<2)i._error="线段最少需要两个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{for(var s=0;s2)switch(t){case"米":this.length=this.noseToTail?this.options.fitLengthByMeter:this.options.lengthByMeter;break;case"千米":this.length=this.noseToTail?(this.options.fitLengthByMeter/1e3).toFixed(5):(this.options.lengthByMeter/1e3).toFixed(5);break;default:this.length=this.noseToTail?this.options.fitLengthByMeter:this.options.lengthByMeter}else{var e=this.noseToTail?this.options.fitLengthByMeter:this.options.lengthByMeter;this.lengthUnit=e>1e3||1e3==e?"千米":"米"}}},{key:"wordsName",get:function(){return this.options["words-name"]},set:function(t){this.options["words-name"]=t,this._elms.wordsName&&this._elms.wordsName.forEach((function(e){e.value=t}));var e=this;if(this.noseToTail)this.renewPositions(this.options.positions);else this.computeDistance(this.options.positions,2,t).then((function(t){e.options.lengthByMeter=t,e.lengthUnit=e.options["length-unit"]}))}},{key:"fitLengthUnit",get:function(){return this.options["fit-length-unit"]},set:function(t){if(this.options["fit-length-unit"]=t,this._elms.fitLengthUnit&&this._elms.fitLengthUnit.forEach((function(e){e.value=t})),this.options.fitLengthByMeter)switch(t){case"米":this.fitLength=this.options.fitLengthByMeter;break;case"千米":this.fitLength=Number((this.options.fitLengthByMeter/1e3).toFixed(5));break;default:this.fitLength=this.options.fitLengthByMeter}}},{key:"lineWidth",get:function(){return this.options.width},set:function(t){var e=this;this.options.width=t||0==t?t:3,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(t){t.value=e.options.width})),this.entity&&this.entity.polyline&&(this.entity.polyline.width=this.entity.polyline.width+t-this.entity.polyline.oriWidth,this.entity.polyline.oriWidth=this.options.width)}},{key:"lineType",get:function(){return this.options.type},set:function(t){var e=this,i=[{name:'实线',value:"实线",key:0,icon:"line"},{name:'虚线',value:"虚线",key:1,icon:"dash-line"},{name:'泛光',value:"泛光",key:2,icon:"light-line"},{name:'尾迹光线',value:"尾迹光线",key:3,icon:"tail-line"},{name:'多尾迹光线',value:"多尾迹光线",key:4,icon:"mult-tail-line"},{name:'流动虚线1',value:"流动虚线1",key:5,icon:"flow-dash-line1"},{name:'流动虚线2',value:"流动虚线2",key:6,icon:"flow-dash-line2"},{name:'流动箭头1',value:"流动箭头1",key:7,icon:"pic-line1"},{name:'流动箭头2',value:"流动箭头2",key:8,icon:"pic-line2"},{name:'流动箭头3',value:"流动箭头3",key:9,icon:"pic-line3"},{name:'流动箭头4',value:"流动箭头4",key:10,icon:"pic-line4"},{name:'流动箭头5',value:"流动箭头5",key:11,icon:"pic-line5"},{name:'流动箭头6',value:"流动箭头6",key:12,icon:"pic-line6"}];this.options.type=Number(t);for(var n=function(n){if(i[n].key===Number(t))return e._elms.lineType&&e._elms.lineType.forEach((function(t){t.value=i[n].value,2this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
            '+this.options.attribute.link.content[s].url+'
            \n
            \n \n \n
            \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
            \n \n
            \n
            \n \n
            \n
            \n \n \n
            ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
            '+this.options.attribute.vr.content[s].url+'
            \n
            \n \n \n
            \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
            \n \n
            \n
            \n \n
            \n
            \n \n \n
            ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c700?c*=m/u/(e.space*(i.width/i.height*5)+1):c=void 0,this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D?c:Re().viewer.entities.getById(this.options.id).polyline.oriRepeatX}}},{key:"edit",value:(l=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=32;break}return o=function(t){"2"!==t&&2!==t||(2实线',value:"实线",key:0,icon:"line"},{name:'虚线',value:"虚线",key:1,icon:"dash-line"},{name:'泛光',value:"泛光",key:2,icon:"light-line"},{name:'尾迹光线',value:"尾迹光线",key:3,icon:"tail-line"},{name:'多尾迹光线',value:"多尾迹光线",key:4,icon:"mult-tail-line"},{name:'流动虚线1',value:"流动虚线1",key:5,icon:"flow-dash-line1"},{name:'流动虚线2',value:"流动虚线2",key:6,icon:"flow-dash-line2"},{name:'流动箭头1',value:"流动箭头1",key:7,icon:"pic-line1"},{name:'流动箭头2',value:"流动箭头2",key:8,icon:"pic-line2"},{name:'流动箭头3',value:"流动箭头3",key:9,icon:"pic-line3"},{name:'流动箭头4',value:"流动箭头4",key:10,icon:"pic-line4"},{name:'流动箭头5',value:"流动箭头5",key:11,icon:"pic-line5"},{name:'流动箭头6',value:"流动箭头6",key:12,icon:"pic-line6"}],C=Y(d._DialogObject._element.content.getElementsByClassName("input-select-line-type-box")[0],".input-select-line-type");if(C){C.legp_search(b);var w=document.createElement("i");w.className="icon icon-active",d._DialogObject._element.content.getElementsByClassName("input-select-line-type")[0].getElementsByClassName("cy_datalist")[0].appendChild(w);var k=d._DialogObject._element.content.getElementsByClassName("input-select-line-type")[0].getElementsByTagName("input")[0];d._elms.lineType=[k];for(var x=0;x'.concat(t+1,'\n
            \n
            \n
            \n ');var n=i.getElementsByClassName("lng")[0],o=document.createElement("span");o.innerHTML=d.options.positions[t].lng.toFixed(8),n.appendChild(o);var s=document.createElement("input");s.className="input",s.type="number",s.title="",s.min=-180,s.max=180,s.value=d.options.positions[t].lng.toFixed(8);var a=i.getElementsByClassName("lat")[0],r=document.createElement("span");r.innerHTML=d.options.positions[t].lat.toFixed(8),a.appendChild(r);var l=document.createElement("input");l.className="input",l.type="number",l.title="",l.min=-90,l.max=90,l.value=d.options.positions[t].lat.toFixed(8);var c=i.getElementsByClassName("alt")[0],u=document.createElement("span");u.innerHTML=d.options.positions[t].alt.toFixed(2),c.appendChild(u);var p=document.createElement("input");p.className="input",p.type="number",p.title="",p.min=-9999999,p.max=999999999,p.value=d.options.positions[t].alt.toFixed(2),n.addEventListener("dblclick",(function(){n.innerHTML="",s.value=Number(d.options.positions[t].lng.toFixed(8)),n.appendChild(s),s.focus(),d.positionEditing=!1,e.closeNodeEdit(d)})),s.addEventListener("blur",(function(){s.value=Number(d.options.positions[t].lng.toFixed(8)),n.innerHTML="",n.appendChild(o)})),s.addEventListener("input",(function(){d.options.positions[t].lng=Number(Number(s.value).toFixed(8)),o.innerHTML=d.options.positions[t].lng.toFixed(8);var e=d.renewPositions(d.options.positions);d.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),d.label.position=[d.options.positions[0].lng,d.options.positions[0].lat,e[2]]})),a.addEventListener("dblclick",(function(){a.innerHTML="",l.value=Number(d.options.positions[t].lat.toFixed(8)),a.appendChild(l),l.focus(),d.positionEditing=!1,e.closeNodeEdit(d)})),l.addEventListener("blur",(function(){l.value=Number(d.options.positions[t].lat.toFixed(8)),a.innerHTML="",a.appendChild(r)})),l.addEventListener("input",(function(){d.options.positions[t].lat=Number(Number(l.value).toFixed(8)),r.innerHTML=d.options.positions[t].lat.toFixed(8);var e=d.renewPositions(d.options.positions);d.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),d.label.position=[d.options.positions[0].lng,d.options.positions[0].lat,e[2]]})),c.addEventListener("dblclick",(function(){2!=d.heightMode&&(c.innerHTML="",p.value=Number(d.options.positions[t].alt.toFixed(2)),c.appendChild(p),p.focus(),d.positionEditing=!1,e.closeNodeEdit(d))})),p.addEventListener("blur",(function(){p.value=Number(d.options.positions[t].alt.toFixed(2)),c.innerHTML="",c.appendChild(u)})),p.addEventListener("input",(function(){d.options.positions[t].alt=Number(Number(p.value).toFixed(2)),u.innerHTML=d.options.positions[t].alt.toFixed(2);var e=d.renewPositions(d.options.positions);d.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),d.label.position=[d.options.positions[0].lng,d.options.positions[0].lat,e[2]]})),d._elms.lng.push(o),d._elms.lngInput.push(s),d._elms.lat.push(r),d._elms.latInput.push(l),d._elms.alt.push(u),d._elms.altInput.push(p),T.appendChild(i)},B=0;B0&&void 0!==y[0]?y[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=$o({},this.options.position):this.options.positions?l=$o({},this.options.positions[0]):this.options.center?l=$o({},this.options.center):this.options.start?l=$o({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=43;break;case 25:c=[],t.t0=this.options.heightMode,t.next="0"===t.t0||0===t.t0?29:"1"===t.t0||1===t.t0?31:"2"===t.t0||2===t.t0?36:41;break;case 29:for(p=0;p=500?(i.event.mouse_move((function(){})),i.event.mouse_left((function(){})),i.event.mouse_right((function(){})),i.positionEditing=!1):leftEvent(s,e)}))})),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return l.length>0?l:n}),!1)}else{this.sdk&&this.sdk.viewer&&this.label&&this.label.entity||(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.destroy()),this.tip&&this.tip.destroy();var c=this.renewPositions(this.options.positions);switch(this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(c),this.renewPolygon(c),this.heightMode){case 0:case"0":case 1:case"1":this.label.position=[this.options.positions[0].lng,this.options.positions[0].lat,c[2]],this.options.label.position={lng:this.options.positions[0].lng,lat:this.options.positions[0].lat,alt:c[2]}}}}},{key:"setDIV",value:function(){var t,e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};i.x=i.x||0===i.x?i.x:10,i.y=i.y||0===i.y?i.y:10;for(var n=[],o=0;o0&&void 0!==arguments[0]?arguments[0]:[],e=new Cesium.EntityCollection;if(t.forEach((function(t){(t instanceof Bo||t instanceof zo||t instanceof ho||t instanceof os)&&e.add(t.entity)})),e.values.length){var i=Cesium.exportKml({entities:e});i.then((function(t){ss(t.kml,(new Date).getTime()+".kml")}))}else console.error("允许导出为kml的对象为空")},rs={yingguangse:new Map,gonganlan:new Map,hong:new Map};rs.yingguangse.set("--color-sdk-base","#00ffff"),rs.yingguangse.set("--color-sdk-auxiliary","#004242"),rs.yingguangse.set("--color-sdk-auxiliary-public","#ffffff"),rs.yingguangse.set("--color-sdk-warning-0","#1BF8C3"),rs.yingguangse.set("--color-sdk-warning-1","#F16C55"),rs.yingguangse.set("--color-sdk-warning-2","#FFA145"),rs.yingguangse.set("--color-sdk-warning-3","#FFDF53"),rs.yingguangse.set("--color-sdk-text-head","#FFFFFF"),rs.yingguangse.set("--color-sdk-text-head-1","#E6F7FF"),rs.yingguangse.set("--color-sdk-text-head-2","#ADF1FF"),rs.yingguangse.set("--color-sdk-gradual","#00ffff 6.25%, #00ffff 100%"),rs.yingguangse.set("--color-sdk-bg-gradual","#00ffff33 0%, #00ffff00 100%");var ls,cs,us,ps=null,hs=0,ds=0,ms=function(){var t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return b=function(t){var i=u.getElementsByClassName("tr");i.length>0&&(i[i.length-1].querySelector("input[name='time']").disabled=void 0);var n=u.getElementsByClassName("tr active")[0];n&&(n.className="tr");var o=document.createElement("div");o.className="tr active",o.innerHTML='\n
            视点'.concat(d+1,'
            \n
            \n \n
            \n
            \n
            \n '),o.addEventListener("click",(function(t){if(t.target.parentNode===o){var e=u.getElementsByClassName("tr active")[0];e&&(e.className="tr"),o.className="tr active";for(var n=0;ne+1?(l--,i[l-1].className="tr active"):l==e+1&&(i.length==e&&(l-=1),0!=i.length&&(i[l-1].className="tr active")),i.length>0){var n=i[i.length-1].querySelector("input[name='time']");n.disabled="disabled",n.value=0}break}})),c.addEventListener("input",(function(e){t.duration=Number(c.value),t.duration<0&&(t.duration=0)})),c.addEventListener("blur",(function(){c.value=Number(Number(c.value).toFixed(2)),c.value<0&&(c.value=0)})),u.insertBefore(o,i[l]),l++,i[i.length-1].querySelector("input[name='time']").disabled="disabled"},i=C.length>1&&void 0!==C[1]?C[1]:{},n=C.length>2&&void 0!==C[2]?C[2]:{},o=i.name||"漫游路径",i.points||(i.points=[]),i.repeat&&(hs=Number(i.repeat)),s=e.viewer,r=new fi(e),l=0,ps&&ps.close&&(ps.close(),ps=null),t.next=12,new W(s._container,{title:"飞行漫游",left:"180px",top:"100px",closeCallBack:function(){gs({viewer:s})}});case 12:return ps=t.sent,t.next=15,ps.init();case 15:for((c=document.createElement("div")).className="fly-roam",c.innerHTML='\n \n
            \n
            \n
            \n 名称\n \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n 设置总时长\n
            \n \n 秒(s)\n \n
            \n \n
            \n
            \n \n 是否循环播放\n
            \n
            \n
            \n \n
            \n
            \n
            \n \n
            \n
            \n \n
            \n
            \n \n
            \n
            \n \n
            \n
            \n
            \n
            \n
            \n
            序号
            \n
            时长(s)
            \n
            操作
            \n
            \n
            \n
            \n
            \n
            \n

            暂无数据

            \n
            \n
            \n
            \n
            \n \n ',ps.contentAppChild(c),c.getElementsByTagName("*"),u=c.getElementsByClassName("table-body")[0],p=c.getElementsByClassName("table-empty")[0],h={set:function(t,e,i){return t[e]=i,t.length>0?p.style.display="none":p.style.display="flex",!0}},d=0,m=new Proxy([],h),d=0;d0&&vs(e,m,0)})),c.getElementsByClassName("add-point")[0].addEventListener("click",(function(){var t={duration:0,position:r.cartesian3Towgs84(s.camera.position,s),orientation:{heading:s.camera.heading,pitch:s.camera.pitch,roll:s.camera.roll}};m.splice(l,0,t),b(t),d++})),c.getElementsByClassName("modify-point")[0].addEventListener("click",(function(){if(l){var t=r.cartesian3Towgs84(s.camera.position,s);m[l-1].position=t,m[l-1].orientation={heading:s.camera.heading,pitch:s.camera.pitch,roll:s.camera.roll},r.message({text:"操作成功"})}})),g=c.querySelector("input[name='totalTime']"),c.getElementsByClassName("set-total-time-btn")[0].addEventListener("click",(function(){if(m.length>0){for(var t=u.getElementsByClassName("tr"),e=Number((Number(g.value)/(t.length-1)).toFixed(2)),i=0;i1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;ls&&ls.destroy(),(ls=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas)).setInputAction((function(e){gs(t)}),Cesium.ScreenSpaceEventType.RIGHT_CLICK);var s,r=t.viewer;r.camera.cancelFlight(),ii(t),ni(t),r.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(e[i].position.lng,e[i].position.lat,e[i].position.alt),orientation:e[i].orientation,duration:n?e[i-1].duration:.5,maximumHeight:e[i].position.alt,complete:(s=o()(a.a.mark((function n(){return a.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:++i<=e.length-1?fs(t,e,i,!0):ds&&e.length>1?(ds--,fs(t,e,0)):ls&&ls.destroy();case 3:case"end":return n.stop()}}),n)}))),function(){return s.apply(this,arguments)}),easingFunction:n?Cesium.EasingFunction.LINEAR_NONE:Cesium.EasingFunction.EXPONENTIAL_OUT})},vs=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;ds=hs,fs(t,e,i,n)},gs=function(t){t&&t.viewer&&t.viewer.camera.cancelFlight(),ls&&ls.destroy()},ys=null,bs=null,Cs=null,ws=null,ks="uniform sampler2D colorTexture;//输入的场景渲染照片\n varying vec2 v_textureCoordinates;\n uniform float tiltAngle;\n uniform float rainSize;\n uniform float rainWidth;\n uniform float rainSpeed;\n\n float hash(float x){\n return fract(sin(x*133.3)*13.13);\n }\n void main(void){\n float time = czm_frameNumber / rainSpeed;\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 c=vec3(.6,.7,.8);\n float a= tiltAngle;\n float si=sin(a),co=cos(a);\n uv*=mat2(co,-si,si,co);\n uv*=length(uv+vec2(0,4.9))*rainSize+1.;\n float v=1.-sin(hash(floor(uv.x*rainWidth))*2.);\n float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;\n c*=v*b; //屏幕上雨的颜色\n gl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(c,1), 0.5); //将雨和三维场景融合\n }",xs="uniform sampler2D colorTexture;\n varying vec2 v_textureCoordinates;\n uniform float snowSize;\n uniform float snowSpeed;\n \n float snow(vec2 uv,float scale)\n {\n float time = czm_frameNumber / snowSpeed;\n float w=smoothstep(1.,0.,-uv.y*(scale/10.));if(w<.1)return 0.;\n uv+=time/scale;uv.y+=time*2./scale;uv.x+=sin(uv.y+time*.5)/scale;\n uv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.,d;\n p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;d=length(p);k=min(d,k);\n k=smoothstep(0.,k,sin(f.x+f.y)*0.01*snowSize);\n return k*w;\n }\n void main(void){\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 finalColor=vec3(0);\n //float c=smoothstep(1.,0.3,clamp(uv.y*.3+.8,0.,.75));\n float c = 0.0;\n c+=snow(uv,30.)*.0;\n c+=snow(uv,20.)*.0;\n c+=snow(uv,15.)*.0;\n c+=snow(uv,10.);\n c+=snow(uv,8.);\n c+=snow(uv,6.);\n c+=snow(uv,5.);\n finalColor=(vec3(c));\n gl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.5);\n }\n ",_s="\n uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n uniform float visibility;\n uniform vec4 fogColor;\n varying vec2 v_textureCoordinates;\n void main(void)\n {\n vec4 origcolor = texture2D(colorTexture, v_textureCoordinates);\n float depth = czm_readDepth(depthTexture, v_textureCoordinates);\n vec4 depthcolor = texture2D(depthTexture, v_textureCoordinates);\n float f = visibility * (depthcolor.r - 0.3) / 0.2;\n if (f < 0.0) f = 0.0;\n else if (f > 1.0) f = 1.0;\n gl_FragColor = mix(origcolor, fogColor, f);\n }\n ";var Es,Ss,Ds,Ps,Ms,Os,Ts,Ns={},Bs=void 0,Ls=void 0,As=!1,js={};function Is(){if(this.sdk&&this.sdk.viewer){(Ls=this.sdk.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth/2,this.sdk.viewer.canvas.clientHeight/(2-(90+this.sdk.viewer.camera.pitch/(Cesium.Math.PI/180))/110))))||(Ls=this.sdk.viewer.camera.position);var t=cs.cartesian3Towgs84(this.sdk.viewer.camera.position,this.sdk.viewer).alt,e=cs.cartesian3Towgs84(Ls,this.sdk.viewer);t>9e6&&(t=9e6),t<4e5?(this.entity.billboard.show=!0,this.entity.rectangle.show=!1):(this.entity.billboard.show=!1,this.entity.rectangle.show=!0),Bs=new Cesium.Rectangle(Cesium.Math.toRadians(e.lng-t/12e4),Cesium.Math.toRadians(e.lat-t/28e4),Cesium.Math.toRadians(e.lng+t/12e4),Cesium.Math.toRadians(e.lat+t/28e4))}}function Rs(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var Fs,zs,Hs=null,Vs=null,Gs=null,Us=null,Ws=!1,Ys=10,Js="#ffd000",qs=!0,Xs=2.5,Zs="#43cf7c",Ks=!0,$s=1.8,Qs="#ff0000",ta=!1,ea=1,ia="#64b6d9",na=!1,oa=1,sa="#d084d1";function aa(){if(zs){var t=zs.viewer.camera.positionCartographic;Cesium.Math.toDegrees(t.height)<1e6?zs.viewer.scene.globe.material||!0!==Ws||la(zs):ca(zs)}}function ra(){return(ra=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(m=function(t){var e=t.target.value;return(t.target.value||"undefined"!==t.target.dataset.null&&""!==t.target.dataset.null&&!Boolean(t.target.dataset.null))&&(e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e\n
            \n
            \n
            \n 等高线\n \n
            \n
            \n
            \n \n
            \n
            \n
            \n 等高距\n
            \n \n m\n \n
            \n
            \n
            \n
            \n
            \n 选中线颜色\n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n 计曲线\n \n
            \n
            \n 计曲线颜色\n
            \n
            \n
            \n 计曲线宽度\n
            \n \n px\n \n
            \n
            \n
            \n
            \n
            \n 首曲线\n \n
            \n
            \n 首曲线颜色\n
            \n
            \n
            \n 首曲线宽度\n
            \n \n px\n \n
            \n
            \n
            \n
            \n
            \n 间曲线\n \n
            \n
            \n 间曲线颜色\n
            \n
            \n
            \n 间曲线宽度\n
            \n \n px\n \n
            \n
            \n
            \n
            \n
            \n 助曲线\n \n
            \n
            \n 助曲线颜色\n
            \n
            \n
            \n 助曲线宽度\n
            \n \n px\n \n
            \n
            \n
            \n
            \n ',Hs.contentAppChild(i),e.viewer.scene.postRender.removeEventListener(aa),e.viewer.scene.postRender.addEventListener(aa),(n=i.getElementsByClassName("show")[0]).checked=Ws,n.addEventListener("change",(function(t){if(t.target.checked){if(Ws=!0,e.viewer.camera.positionCartographic.height>16360){var i=e.viewer.camera.positionCartographic,n={position:{lng:Cesium.Math.toDegrees(i.longitude),lat:Cesium.Math.toDegrees(i.latitude),alt:16360}};Xe(e,n,.5)}la(e)}else Ws=!1,ca(e)})),(o=i.getElementsByClassName("equal-height-distance")[0]).value=Ys,o.addEventListener("blur",(function(t){var e=m(t);Ys=e,o.value=e,Vs&&(Vs.uniforms.spacing=5*Ys)})),new zi({el:i.getElementsByClassName("active-color")[0],size:"mini",alpha:!0,defaultColor:Js,disabled:!1,openPickerAni:"opacity",sure:function(t){Js=t,Vs&&(Vs.uniforms.activeColor=Cesium.Color.fromCssColorString(Js))},clear:function(){Js="rgba(255,255,255,1)",Vs&&(Vs.uniforms.activeColor=Cesium.Color.fromCssColorString(Js))}}),(s=i.getElementsByClassName("index-contour-switch")[0]).checked=qs,s.addEventListener("change",(function(t){qs=t.target.checked,Vs&&(Vs.uniforms.indexContourShow=qs)})),new zi({el:i.getElementsByClassName("index-contour-color")[0],size:"mini",alpha:!0,defaultColor:Zs,disabled:!1,openPickerAni:"opacity",sure:function(t){Zs=t,Vs&&(Vs.uniforms.indexContourColor=Cesium.Color.fromCssColorString(Zs))},clear:function(){Zs="rgba(255,255,255,1)",Vs&&(Vs.uniforms.indexContourColor=Cesium.Color.fromCssColorString(Zs))}}),(r=i.getElementsByClassName("index-contour-width")[0]).value=Xs,r.addEventListener("blur",(function(t){var e=m(t);Xs=e,r.value=e,Vs&&(Vs.uniforms.indexContourWidth=Xs)})),(l=i.getElementsByClassName("intermediate-contour-switch")[0]).checked=Ks,l.addEventListener("change",(function(t){Ks=t.target.checked,Vs&&(Vs.uniforms.intermediateContourShow=Ks)})),new zi({el:i.getElementsByClassName("intermediate-contour-color")[0],size:"mini",alpha:!0,defaultColor:Qs,disabled:!1,openPickerAni:"opacity",sure:function(t){Qs=t,Vs&&(Vs.uniforms.intermediateContourColor=Cesium.Color.fromCssColorString(Qs))},clear:function(){Qs="rgba(255,255,255,1)",Vs&&(Vs.uniforms.intermediateContourColor=Cesium.Color.fromCssColorString(Qs))}}),(c=i.getElementsByClassName("intermediate-contour-width")[0]).value=$s,c.addEventListener("blur",(function(t){var e=m(t);$s=e,c.value=e,Vs&&(Vs.uniforms.intermediateContourWidth=$s)})),(u=i.getElementsByClassName("halfInterval-contour-switch")[0]).checked=ta,u.addEventListener("change",(function(t){ta=t.target.checked,Vs&&(Vs.uniforms.halfIntervalContourShow=ta)})),new zi({el:i.getElementsByClassName("halfInterval-contour-color")[0],size:"mini",alpha:!0,defaultColor:ia,disabled:!1,openPickerAni:"opacity",sure:function(t){ia=t,Vs&&(Vs.uniforms.halfIntervalContourColor=Cesium.Color.fromCssColorString(ia))},clear:function(){ia="rgba(255,255,255,1)",Vs&&(Vs.uniforms.halfIntervalContourColor=Cesium.Color.fromCssColorString(ia))}}),(p=i.getElementsByClassName("halfInterval-contour-width")[0]).value=ea,p.addEventListener("blur",(function(t){var e=m(t);ea=e,p.value=e,Vs&&(Vs.uniforms.halfIntervalContourWidth=ea)})),(h=i.getElementsByClassName("supplementary-contour-switch")[0]).checked=na,h.addEventListener("change",(function(t){na=t.target.checked,Vs&&(Vs.uniforms.supplementaryContourShow=na)})),new zi({el:i.getElementsByClassName("supplementary-contour-color")[0],size:"mini",alpha:!0,defaultColor:sa,disabled:!1,openPickerAni:"opacity",sure:function(t){sa=t,Vs&&(Vs.uniforms.supplementaryContourColor=Cesium.Color.fromCssColorString(sa))},clear:function(){sa="rgba(255,255,255,1)",Vs&&(Vs.uniforms.supplementaryContourColor=Cesium.Color.fromCssColorString(sa))}}),(d=i.getElementsByClassName("supplementary-contour-width")[0]).value=oa,d.addEventListener("blur",(function(t){var e=m(t);oa=e,d.value=e,Vs&&(Vs.uniforms.supplementaryContourWidth=oa)}));case 50:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function la(t){var e=t.viewer.camera.positionCartographic;Cesium.Math.toDegrees(e.height)>1e6||(Gs&&Gs.destroy(),t.viewer.container.getElementsByClassName("YJ-customize-active-height-elm")[0]||t.viewer.container.appendChild(Us),(Gs=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas)).setInputAction((function(e){var i=t.viewer.scene.pickPosition(e.endPosition);if(i){var n=0,o=0;if(t.viewer&&t.viewer._element){var s=t.viewer._element.getElementsByClassName("cesium-widget")[0].getElementsByTagName("canvas")[0];n=s.getBoundingClientRect().top+window.scrollY,o=s.getBoundingClientRect().left+window.scrollX}Us.style.left=e.endPosition.x-50+o+"px",Us.style.top=e.endPosition.y-40+n+"px",Us.style.display="block";var a=Fs.cartesian3Towgs84(i,t.viewer),r=Math.floor(a.alt/Vs.uniforms.spacing)*Vs.uniforms.spacing,l=a.alt-r,c=Vs.uniforms.spacing/(Vs.uniforms.secondaryLinesCount+1),u=Math.floor(l/c)*c+r;a.alt<0&&(a.alt=0),a.alt-u>c/2&&(u+=c),Vs.uniforms.mouseHeight=a.alt,Vs.uniforms.mousePosition=i,Us.innerHTML="".concat(u.toFixed(0))}else Us.style.display="none"}),Cesium.ScreenSpaceEventType.MOUSE_MOVE),t.viewer.scene.globe.material=Vs)}function ca(t){Gs&&(Gs.destroy(),Gs=null),t.viewer.container.getElementsByClassName("YJ-customize-active-height-elm")[0]&&(Us.style.display="none",t.viewer.container.removeChild(Us)),t.viewer.scene.globe.material=null}function ua(){Cesium.Material._materialCache._materials.ElevationContour.fabric.source="\nuniform vec4 activeColor; // 选中颜色\nuniform float spacing; // 等高距\n\n// 计曲线\nuniform bool indexContourShow;\nuniform float indexContourWidth;\nuniform vec4 indexContourColor;\n// 首曲线\nuniform bool intermediateContourShow;\nuniform float intermediateContourWidth;\nuniform vec4 intermediateContourColor;\n// 间曲线\nuniform bool halfIntervalContourShow;\nuniform float halfIntervalContourWidth;\nuniform vec4 halfIntervalContourColor;\n// 助曲线\nuniform bool supplementaryContourShow;\nuniform float supplementaryContourWidth;\nuniform vec4 supplementaryContourColor;\n\nuniform float mouseHeight;\n\nuniform float secondaryLinesCount; // 0=无次线, 1=1条次线, 2=2条次线...\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n // 主等高线计算\n float distanceToMainContour = mod(materialInput.height, spacing);\n \n // 抗锯齿计算\n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n float dxc = abs(dFdx(materialInput.height));\n float dyc = abs(dFdy(materialInput.height));\n float dFMain = max(dxc, dyc) * czm_pixelRatio * indexContourWidth;\n#else\n float dFMain = czm_pixelRatio * indexContourWidth;\n#endif\n\n bool isMainContour = distanceToMainContour < dFMain;\n bool isSecondaryContour = false;\n float dFSecondary = 0.0;\n float secondarySpacing = 0.0;\n bool isHalfInterval = false;\n bool isIntermediate= false;\n\n // 计算当前高度所属的等高线高度\n float mainContourHeight = floor(materialInput.height / spacing) * spacing;\n float secondaryContourHeight = floor(materialInput.height / spacing * (secondaryLinesCount + 1.0)) * spacing / (secondaryLinesCount + 1.0);\n \n // 计算次线在两条主等高线之间的相对位置\n float relativeHeight = materialInput.height - mainContourHeight;\n float normalizedPosition = relativeHeight / spacing;\n \n // 计算次线索引(从主等高线开始计数)\n float lineIndex = floor(normalizedPosition * (secondaryLinesCount + 1.0));\n\n // 只有当存在次线时才计算次线\n if(secondaryLinesCount > 0.0) {\n float secondaryLinesWidth = supplementaryContourWidth;\n secondarySpacing = spacing / (secondaryLinesCount + 1.0);\n float distanceToSecondaryContour = mod(materialInput.height, secondarySpacing);\n \n // 确保次线不会与主线重叠\n float minDistanceToMain = min(distanceToMainContour, spacing - distanceToMainContour);\n bool notCloseToMain = minDistanceToMain > dFMain * 2.0; // 2倍线宽缓冲\n\n\n if (lineIndex > 0.0 && lineIndex < secondaryLinesCount) {\n // 使用mod函数检查余数是否接近0(考虑浮点数精度问题)\n isHalfInterval = abs(mod(lineIndex, 2.0)) < 0.01;\n if(isHalfInterval) {\n secondaryLinesWidth = halfIntervalContourWidth;\n }\n // 使用mod函数检查余数是否接近0(考虑浮点数精度问题)\n isIntermediate = abs(mod(lineIndex, 4.0)) < 0.01;\n if(isIntermediate) {\n secondaryLinesWidth = intermediateContourWidth;\n }\n }\n\n\n\n\n\n\n\n\n \n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n dFSecondary = max(dxc, dyc) * czm_pixelRatio * secondaryLinesWidth;\n#else\n dFSecondary = czm_pixelRatio * secondaryLinesWidth;\n#endif\n\n isSecondaryContour = (distanceToSecondaryContour < dFSecondary) && notCloseToMain;\n }\n\n // 高亮判断\n bool shouldHighlight = false;\n if(isMainContour && abs(mainContourHeight - mouseHeight) < 0.5 * (spacing/(secondaryLinesCount+1.0))) {\n shouldHighlight = true;\n } else if(isSecondaryContour && abs(secondaryContourHeight - mouseHeight) < 0.5 * (spacing/(secondaryLinesCount+1.0))) {\n shouldHighlight = true;\n }\n\n // 颜色输出\n vec4 outColor;\n if(shouldHighlight) {\n outColor = czm_gammaCorrect(vec4(activeColor.rgb, activeColor.a));\n } else if(isMainContour) {\n float a = indexContourColor.a;\n if(!indexContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(indexContourColor.rgb, a));\n } else if(isSecondaryContour) {\n float a = supplementaryContourColor.a;\n if(!supplementaryContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(supplementaryContourColor.rgb, a));\n if(isHalfInterval) {\n float a = halfIntervalContourColor.a;\n if(!halfIntervalContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(halfIntervalContourColor.rgb, a));\n }\n if(isIntermediate) {\n float a = intermediateContourColor.a;\n if(!intermediateContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(intermediateContourColor.rgb, a));\n }\n } else {\n outColor = vec4(0.0);\n }\n\n if(materialInput.height<0.0) {\n outColor = vec4(0.0);\n }\n\n material.diffuse = outColor.rgb;\n material.alpha = outColor.a;\n return material;\n}\n",Vs=new Cesium.Material({fabric:{type:"ElevationContour",uniforms:{spacing:50,activeColor:Cesium.Color.fromCssColorString(Js),mouseHeight:-1e5,mousePosition:new Cesium.Cartesian3(0,0,0),secondaryLinesCount:19,cameraHeight:0,indexContourShow:qs,indexContourWidth:Xs,indexContourColor:Cesium.Color.fromCssColorString(Zs),intermediateContourShow:Ks,intermediateContourWidth:$s,intermediateContourColor:Cesium.Color.fromCssColorString(Qs),halfIntervalContourShow:ta,halfIntervalContourWidth:ea,halfIntervalContourColor:Cesium.Color.fromCssColorString(ia),supplementaryContourShow:na,supplementaryContourWidth:oa,supplementaryContourColor:Cesium.Color.fromCssColorString(sa)}}})}function pa(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function ha(t,e,i){return t.set(ma(t,e),i),i}function da(t,e){return t.get(ma(t,e))}function ma(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}(Us=document.createElement("div")).className="YJ-customize-active-height-elm",Us.style.position="absolute",Us.style.left="10px",Us.style.top="10px",Us.style.width="100px",Us.style.textAlign="center",Us.style.pointerEvents="none",Us.style.color="#ff0000",Us.style.display="none";var fa=new WeakMap,va=new WeakMap,ga=function(){return _()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;k()(this,t),pa(this,fa,null),pa(this,va,{bgimg:null,img1:null,img2:null,img3:null,img4:null}),this.sdk=e,this.options=i,this.data={},this._webSocketCallback=n,this._tools=new fi(this.sdk),this.requestResource()}),[{key:"requestResource",value:function(){var t=this;this.options.host=this.options.host||h();var e;e=this.options.host+"/yjearth4.0/api/v1/gps/state",this.reconnecting=new ReconnectingWebSocket("ws://"+e,[],{maxReconnectAttempts:8}),this.reconnecting.onopen=function(e){t.reconnecting.onmessage=function(){var e=o()(a.a.mark((function e(i){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.data=JSON.parse(i.data),!t.data||!t.data.rmc){e.next=7;break}return e.next=4,t._tools.getClampToHeight(t.data.rmc);case 4:n=e.sent,t.position=new Cesium.Cartesian3.fromDegrees(t.data.rmc.lng,t.data.rmc.lat,n),t.create();case 7:t._webSocketCallback&&t._webSocketCallback(t.data);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}}},{key:"create",value:function(){var t=this;if(this.getcanvas(),this.data&&this.data.rmc&&!this.entity){this.entity=new Cesium.CustomDataSource,this.sdk.viewer.dataSources.add(this.entity);var e=new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.position}),!1),billboard:{image:this._tools.getSourceRootPath()+"/img/locate2.png",scale:1,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:1e8}),!1),width:31,height:36,pixelOffset:new Cesium.Cartesian2(0,-15)}}),i=new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.position}),!1),billboard:{image:new Cesium.CallbackProperty((function(){return t.lableCanvas})),scale:1,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:1e8}),!1),width:220,height:140,pixelOffset:new Cesium.Cartesian2(0,-110)}});this.entity.entities.add(e),this.entity.entities.add(i)}}},{key:"loaded",value:function(t){var e;Object.defineProperty(this,"data",{get:function(){return e},set:function(i){e=i,t&&(t(),t=void 0)}})}},{key:"getcanvas",value:function(){var t=this,e=[{images:this._tools.getSourceRootPath()+"/img/bubble/lng.png",text:"经度:"+parseFloat(this.data.rmc.lng.toFixed(10))},{images:this._tools.getSourceRootPath()+"/img/bubble/lat.png",text:"纬度:"+parseFloat(this.data.rmc.lat.toFixed(10))},{images:this._tools.getSourceRootPath()+"/img/bubble/h.png",text:"海拔:"+parseFloat(this.data.rmc.alt.toFixed(10))},{images:this._tools.getSourceRootPath()+"/img/bubble/satellite.png",text:"卫星:"+this.data.satellites||!1}];if(da(fa,this)){var i=da(fa,this).getContext("2d");i.clearRect(0,0,da(fa,this).width,da(fa,this).height),i.drawImage(da(va,this).bgimg,0,0,da(fa,this).width,da(fa,this).height);var n=0;e.forEach((function(o,s){i.drawImage(da(va,t)["img"+(s+1)],12,12+26*s),i.fillStyle="#fff",i.font="16px Arial",i.fillText(o.text,44,28+26*s),++n===e.length&&(t.lableCanvas=da(fa,t).toDataURL())}))}else{ha(fa,this,document.createElement("canvas"));var o=da(fa,this).getContext("2d");da(fa,this).width=220,da(fa,this).height=140;var s=new Image;da(va,this).bgimg=s,s.src=this._tools.getSourceRootPath()+"/img/bubble/bubble.png";var a=0;s.onload=function(){o.drawImage(s,0,0,da(fa,t).width,da(fa,t).height),e.forEach((function(i,n){var s=new Image;da(va,t)["img"+(n+1)]=s,s.src=i.images,s.onload=function(){o.drawImage(s,12,12+26*n),o.fillStyle="#fff",o.font="16px Arial",o.fillText(i.text,44,28+26*n),++a===e.length&&(t.lableCanvas=da(fa,t).toDataURL())}}))}}}},{key:"flyTo",value:(t=o()(a.a.mark((function t(){var e,i,n=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=n.length>0&&void 0!==n[0]?n[0]:{},!this.data||!this.data.rmc){t.next=9;break}return t.next=4,this._tools.getClampToHeight(this.data.rmc);case 4:i=t.sent,pi(0),ii(this.sdk),ni(this.sdk),this.sdk.viewer.camera.flyTo({orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},destination:Cesium.Cartesian3.fromDegrees(this.data.rmc.lng,this.data.rmc.lat,i+(e.height||500))});case 9:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})},{key:"remove",value:function(){ha(fa,this,null),ha(va,this,{}),this.reconnecting&&this.reconnecting.close(),this.sdk.viewer.dataSources.remove(this.entity),this.entity=null}},{key:"flicker",value:function(){}}]);var t}();var ya=i(9),ba=i.n(ya);function Ca(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var wa=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return k()(this,e),(i=Ca(this,e,[t,n])).viewer=t.viewer,i.entityHasCreated=!1,i.event=null,i.tip=null,i.points_ids=[],i.color=n.color||"rgba(185,14,14,0.58)",i._is2D=o,i._sdk2D=Ie(),i}return sn()(e,t),_()(e,[{key:"create_point",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.viewer,i=this.randomString();return e.entities.add(new Cesium.Entity({id:i,position:t,billboard:{image:this.getSourceRootPath()+"/img/point.png",color:Cesium.Color.WHITE.withAlpha(.99)}})),i}},{key:"remove_entity",value:function(t){this.viewer.entities.removeById(t),!this._is2D&&this._sdk2D&&this._sdk2D.viewer&&this._sdk2D.viewer.entities&&this._sdk2D.viewer.entities.removeById(t)}},{key:"start",value:function(){}},{key:"end",value:function(){var t=this;YJ.Measure.SetMeasureStatus(!1),this.entityHasCreated=!1,this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy(),this.tip&&this.tip.destroy(),this.points_ids.forEach((function(e){t.remove_entity(e)}))}}])}(fi);function ka(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function xa(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=_a(this,e,[t,n])).color=n.color||"rgba(255,0,0,0.5)",i.polygonHasCreated=!1,i}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l;this.polygonHasCreated=!1,(i=e,n="start",o=this,s=3,a=ba()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var c=[],u=[];this.event.mouse_left((function(t,i){if("2D"!==l){if(l="3D",r.positions=c.concat(xa({},i)),r.tip.setPosition(i,t.position.x,t.position.y),!r.polygonHasCreated){var n=e.create_polygon(r);r.points_ids.push(n)}c.push(i),u.push(r.cartesian3Towgs84(i,r.viewer)),r.points_ids.push(r.create_point(i))}})),this.event.mouse_right((function(e,i){"2D"!==l&&(t(null,u),r.end())})),this.event.mouse_move((function(t,e){"2D"!==l&&(r.positions=c.concat(xa({},e)),r.tip.setPosition(e,t.endPosition.x,t.endPosition.y))})),this.event.mouse_right_keyboard_ctrl((function(t,e){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop(),r.positions=c.concat(cartesian))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)t(null,u),r.end();else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),!r.polygonHasCreated){var s=e.create_polygon(r);r.points_ids.push(s)}c.push(n),u.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n)),r.positions=c.concat(n)}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(t,i){if("3D"!==l){if(l="2D",r.positions=c.concat(xa({},i)),r.tip.setPosition(i,t.position.x+r.viewer.canvas.width,t.position.y),!r.polygonHasCreated){var n=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(n)}c.push(i),u.push(r.cartesian3Towgs84(i,r.viewer)),r.points_ids.push(r.create_point(i,r._sdk2D.viewer))}})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(t(null,u),r.end())})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(r.positions=c.concat(xa({},e)),r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y))})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop(),r.positions=c.concat(cartesian))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)t(null,u),r.end();else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),!r.polygonHasCreated){var s=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(s)}c.push(n),u.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),r.positions=c.concat(n)}}))}})))}}}],[{key:"create_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.polygonHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(t.positions)})),material:Cesium.Color.fromCssColorString(t.color),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(e){return t.positions.concat(t.positions[0])})),width:3,material:Cesium.Color.fromCssColorString(t.color).withAlpha(1),clampToGround:!0,zIndex:99999999}})),i}}])}(wa),Sa=function(){return _()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,t),this.sdk=e,this.viewer=e.viewer,this.height=i.height||70,this.maxHeigh=-1e6,this.precision=i.precision||125,this.Dialog=n,this.result={allArea:"",cutArea:"",cutVolume:"",fillArea:"",fillVolume:"",noArea:""},this.entities=[],this.Draw=new Ea(this.sdk),YJ.Analysis.AnalysesResults.push(this),t.EditBox(this)}),[{key:"create",value:function(){var t=this;this.clean(),this.Draw.start((function(e,i){if(!i||i.length<3){return console.warn("最少需要三个坐标!"),void(window.ELEMENT&&window.ELEMENT.Message({message:"最少需要三个坐标!",type:"warning",duration:1500}))}for(var n=[],o=0;othis.maxHeigh&&(this.maxHeigh=o),{heightPos:Cesium.Cartesian3.fromRadians(n.longitude,n.latitude,o),noHeightPos:Cesium.Cartesian3.fromRadians(n.longitude,n.latitude,0),height:o}}},{key:"clean",value:function(){this.Draw&&this.Draw.end();for(var t=0;t\n
            \n
            \n
            \n 绘制分析区域\n \n
            \n
            \n
            \n \n
            \n
            \n
            \n 基准高度\n
            \n \n m\n \n
            \n
            \n
            \n 精度\n
            \n \n \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n 总分析面积:\n 0\n \n
            \n
            \n 无须填挖面积:\n 0\n \n
            \n
            \n
            \n
            \n 填方面积:\n 0\n \n
            \n
            \n 挖方面积:\n 0\n \n
            \n
            \n
            \n
            \n 填方体积:\n 0\n \n
            \n
            \n 挖方体积:\n 0\n \n
            \n
            \n
            \n \n ',e._DialogObject.contentAppChild(i),e._DialogObject._element.body.className=e._DialogObject._element.body.className+" cut-fill",(n=i.querySelector("input[name='height']")).value=e.height,n.addEventListener("blur",(function(t){var i=t.target.value;"."==t.data||"-"==t.data&&!t.target.value||(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&iNumber(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Pa(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),Oa(i=Ma(this,e,[t,n]),Ba,!1),i.sdk=t,i.options={},i.options.name=n.name,i.options.risingSpeed=1,i.options.minWaterLevel=0,i.options.maxWaterLevel=0,i.options.waterVolume=0,i.currentWaterLaver,i.color="#00d9ff66",i.Dialog=o,i.Draw=new Ea(i.sdk),i.positions,i.status=!0,i.area=0,i._elms={},YJ.Analysis.AnalysesResults.push(i),e.EditBox(i),i}return sn()(e,t),_()(e,[{key:"move",value:function(){var t=this;this.TweenAnimate&&TWEEN.remove(this.TweenAnimate),Ta(Ba,this,!1);var e=this._DialogObject._element.body,i=e.getElementsByClassName("pause")[0],n=e.getElementsByClassName("start")[0],s=(this.options.maxWaterLevel-this.options.minWaterLevel)/this.options.risingSpeed*1e3;this.TweenAnimate=new TWEEN.Tween({waterLevel:this.options.minWaterLevel}).to({waterLevel:this.options.maxWaterLevel},s).delay(this.delay).easing(TWEEN.Easing.Linear.None).onUpdate(function(){var e=o()(a.a.mark((function e(i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.currentWaterLaver=i.waterLevel;case 1:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).onComplete((function(){n.style.display="flex",i.style.display="none"})).start(),n.style.display="none",i.style.display="flex"}},{key:"restart",value:function(){var t=this;this.currentWaterLaver=this.options.minWaterLevel,Ta(Ba,this,!1);var e=!1;this.TweenAnimate&&(e=this.TweenAnimate._isPaused,TWEEN.remove(this.TweenAnimate));var i=(this.options.maxWaterLevel-this.options.minWaterLevel)/this.options.risingSpeed*1e3;this.TweenAnimate=new TWEEN.Tween({waterLevel:this.options.minWaterLevel}).to({waterLevel:this.options.maxWaterLevel},i).delay(this.delay).easing(TWEEN.Easing.Linear.None).onUpdate(function(){var e=o()(a.a.mark((function e(i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.currentWaterLaver=i.waterLevel;case 1:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).start(),e&&this.pause()}},{key:"start",value:function(){var t,e;this.TweenAnimate&&(e=this,(t=Ba).get(Na(t,e))?this.move():this.TweenAnimate._isPlaying?this.TweenAnimate.resume():this.TweenAnimate.start())}},{key:"pause",value:function(){this.TweenAnimate&&this.TweenAnimate.pause()}},{key:"calculateVolumeHeight",value:function(){that.options.maxWaterLevel}},{key:"flyTo",value:function(){if(this.positions&&0!==this.positions.length){ii(this.sdk),ni(this.sdk);for(var t=[],e=0;ei[o].alt&&(t.options.minWaterLevel=i[o].alt),n.push(i[o].lng,i[o].lat);var s=Cesium.Cartesian3.fromDegreesArray(n);t.currentWaterLaver=t.options.minWaterLevel,t.entity=t.sdk.viewer.entities.add({polygon:{hierarchy:new Cesium.PolygonHierarchy(s),height:new Cesium.CallbackProperty((function(){return t.options.minWaterLevel}),!1),extrudedHeight:new Cesium.CallbackProperty((function(){return t.currentWaterLaver}),!1),material:Cesium.Color.fromCssColorString(t.color)}}),t.area=t.computeArea(i),t.TweenAnimate&&(TWEEN.remove(t.TweenAnimate),t.TweenAnimate=null);var a=t._DialogObject._element.body,r=a.getElementsByClassName("pause")[0];a.getElementsByClassName("start")[0].style.display="flex",r.style.display="none"}))}},{key:"EditBox",value:(i=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new W(i.sdk.viewer._container,{title:"淹没分析",left:"180px",top:"100px",closeCallBack:function(){i.destroy(),i.Dialog.closeCallBack&&i.Dialog.closeCallBack()}});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" submerge",(n=document.createElement("div")).innerHTML='\n \n
            \n
            \n
            \n 水量\n
            \n \n \n \n
            \n
            \n
            \n 最小水位\n
            \n \n m\n \n
            \n
            \n
            \n
            \n
            \n 水面面积\n
            \n \n \n \n
            \n
            \n
            \n 最大水位\n
            \n \n m\n \n
            \n
            \n
            \n
            \n \n
            \n
            \n 上升速度\n
            \n
            \n
            \n \n
            \n \n m/s\n \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n \n \n \n \n \n \n
            \n
            \n
            \n \n
            \n
            \n
            \n
            序号
            \n
            经度
            \n
            纬度
            \n
            高程
            \n
            \n
            \n
            \n
            \n
            \n
            \n

            暂无数据

            \n
            \n
            \n \n ',i._DialogObject.contentAppChild(n),(o=document.createElement("button")).className="el-button",o.innerHTML="暂停",o.style.width="80px",n.getElementsByClassName("draw")[0].addEventListener("click",(function(){e.create(i)})),n.getElementsByClassName("analog")[0].addEventListener("click",(function(){i.move()})),n.getElementsByClassName("flyto")[0].addEventListener("click",(function(){i.flyTo()})),n.getElementsByClassName("reset")[0].addEventListener("click",(function(){i.restart()})),s=n.getElementsByClassName("pause")[0],r=n.getElementsByClassName("start")[0],s.addEventListener("click",(function(){i.pause(),s.style.display="none",r.style.display="flex"})),r.addEventListener("click",(function(){i.start(),r.style.display="none",s.style.display="flex"})),(l=n.querySelectorAll("input[name='risingSpeed']"))[0].value=i.options.risingSpeed,l[1].value=i.options.risingSpeed,l[0].addEventListener("input",(function(t){Ta(Ba,i,!0),i.options.risingSpeed=Number(t.target.value)})),l[1].addEventListener("input",(function(t){if("."!=t.data){Ta(Ba,i,!0);var e=Number(t.target.value),n=Number(l[0].max),o=Number(l[0].min);i.options.risingSpeed=e>n?n:e999999999&&(e=999999999),e<0&&(e=0),i.options.minWaterLevel=Math.floor(1e4*e)/1e4,i.options.maxWaterLevel=i.options.minWaterLevel+i.waterLevel}})),Object.defineProperty(i.options,"minWaterLevel",{get:function(){return Number(c.value)},set:function(t){c.value=Math.floor(1e4*Number(t))/1e4}}),(u=n.querySelector("input[name='maxWaterLevel']")).value=i.options.maxWaterLevel,u.addEventListener("input",(function(t){if("."!=t.data){Ta(Ba,i,!0);var e=Number(t.target.value);e>999999999&&(e=999999999),e<0&&(e=0),e99999999999999&&(e=99999999999999),e<0&&(e=0),i.options.waterVolume=Math.floor(1e4*e)/1e4,i.area&&(i.waterLevel=Number((i.options.waterVolume/i.area).toFixed(4)),i.options.maxWaterLevel=i.options.minWaterLevel+i.waterLevel)}})),Object.defineProperty(i.options,"waterVolume",{get:function(){return Number(p.value)},set:function(t){p.value=t}}),(h=n.getElementsByClassName("area")[0]).value=i.area,Object.defineProperty(i,"area",{get:function(){return Number(h.value)},set:function(t){h.value=t,i.waterLevel=Number((i.options.waterVolume/i.area).toFixed(4)),i.options.maxWaterLevel=i.options.minWaterLevel+i.waterLevel}}),d=n.getElementsByClassName("table-body")[0],m=n.getElementsByClassName("table-empty")[0],Object.defineProperty(i,"positions",{get:function(){return i._positions},set:function(t){if(t&&t.length>0){m.style.display="none";for(var e="",i=0;i\n
            '.concat(i+1,'
            \n
            ').concat(Number(t[i].lng.toFixed(10)),'
            \n
            ').concat(Number(t[i].lat.toFixed(10)),'
            \n
            ').concat(Number(t[i].alt.toFixed(4)),"
            \n ");d.innerHTML=e}else d.innerHTML="",m.style.display="flex"}});case 51:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=Da(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type&&(i=Number(i)),t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=Ia(this,e,[t,n])).viewer=t.viewer,i.options={},i.options.viewPosition=n.viewPosition,i.options.viewPositionEnd=n.viewPositionEnd,i.options.horizontalViewAngle=n.horizontalViewAngle||0===n.horizontalViewAngle?n.horizontalViewAngle:90,i.options.verticalViewAngle=n.verticalViewAngle||0===n.verticalViewAngle?n.verticalViewAngle:60,i.options.visibleAreaColor=n.visibleAreaColor||"#008000",i.options.invisibleAreaColor=n.invisibleAreaColor||"#FF0000",i._elms={},i.viewPointHeight=n.viewPointHeight,i.ids=[],i.Dialog=o,i._EventBinding=new wn,i.html=null,YJ.Analysis.AnalysesResults.push(i),e.edit(i),i}return sn()(e,t),_()(e,[{key:"viewPointHeight",get:function(){return this.options.viewPointHeight},set:function(t){var e=Math.floor(10*Number(t))/10;isNaN(e)&&(e=1.8),e<0&&(e=0),this.options.viewPointHeight=e,this._elms.viewPointHeight&&this._elms.viewPointHeight.forEach((function(t){t.value=e}))}},{key:"viewPosition",get:function(){return this.options.viewPosition},set:function(t){this.options.viewPosition=t,this.ids[0]&&(this.viewer.entities.getById(this.ids[0]).position=new Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt)),this.update()}},{key:"viewPositionEnd",get:function(){return this.options.viewPositionEnd},set:function(t){this.options.viewPositionEnd=t,this.ids[1]&&(this.viewer.entities.getById(this.ids[1]).position=new Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt)),this.update()}},{key:"horizontalViewAngle",get:function(){return this.options.horizontalViewAngle},set:function(t){if(this.options.horizontalViewAngle=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content){var e=this._DialogObject._element.content;e.querySelector("input[name='horizontalViewAngle']").value=t,e.getElementsByClassName("range-node-active")[0].getElementsByClassName("range-node-active-text")[0].innerHTML=t+"°",e.getElementsByClassName("range-process")[0].style.width=t/180*100+"%"}this.update()}},{key:"visibleAreaColor",get:function(){return this.options.visibleAreaColor},set:function(t){this.options.visibleAreaColor=t,this.update()}},{key:"invisibleAreaColor",get:function(){return this.options.invisibleAreaColor},set:function(t){this.options.invisibleAreaColor=t,this.update()}},{key:"verticalViewAngle",get:function(){return this.options.verticalViewAngle},set:function(t){this.options.verticalViewAngle=t,this.update()}},{key:"viewDistance",get:function(){var t=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),e=Cesium.Cartesian3.fromDegrees(this.options.viewPositionEnd.lng,this.options.viewPositionEnd.lat,this.options.viewPositionEnd.alt);return Cesium.Cartesian3.distance(t,e)}},{key:"viewHeading",get:function(){var t,e,i,n,o=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),s=Cesium.Cartesian3.fromDegrees(this.options.viewPositionEnd.lng,this.options.viewPositionEnd.lat,this.options.viewPositionEnd.alt);return t=o,e=s,i=new Cesium.Cartesian3,n=Cesium.Transforms.eastNorthUpToFixedFrame(t),Cesium.Matrix4.inverse(n,n),Cesium.Matrix4.multiplyByPoint(n,e,i),Cesium.Cartesian3.normalize(i,i),Cesium.Math.toDegrees(Math.atan2(i.x,i.y))}},{key:"viewPitch",get:function(){var t,e,i,n,o=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),s=Cesium.Cartesian3.fromDegrees(this.options.viewPositionEnd.lng,this.options.viewPositionEnd.lat,this.options.viewPositionEnd.alt);return t=o,e=s,i=new Cesium.Cartesian3,n=Cesium.Transforms.eastNorthUpToFixedFrame(t),Cesium.Matrix4.inverse(n,n),Cesium.Matrix4.multiplyByPoint(n,e,i),Cesium.Cartesian3.normalize(i,i),Cesium.Math.toDegrees(Math.asin(i.z))}},{key:"add",value:function(){this.createLightCamera(),this.createShadowMap(),this.createPostStage(),this.drawSketch(),e.getcanvas(this)}},{key:"update",value:function(){this.clear(),this.add()}},{key:"clear",value:function(){YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=null,this.event=null,this.sketch&&(this.viewer.entities.removeById(this.sketch.id),this.sketch=null),this.frustumOutline&&(this.viewer.entities.removeById(this.frustumOutline.id),this.frustumOutline=null),this.postStage&&(this.viewer.scene.postProcessStages.remove(this.postStage),this.postStage=null)}},{key:"destroy",value:function(){var t=this;this.clear(),this.editevent&&this.editevent.destroy(),this.ControllerObject&&this.ControllerObject.destroy(),this.ids.forEach((function(e){t.viewer.entities.removeById(e)})),this.ids=[],this.viewBillboardPrimitive&&this.viewer.scene.primitives.remove(this.viewBillboardPrimitive),this.viewBillboardPrimitive=null,this.options.viewPosition=null,this.options.viewPositionEnd=null,YJ.Measure.SetMeasureStatus(!1),this._originalShadowMap&&(this.viewer.scene.shadowMap=this._originalShadowMap,this._originalShadowMap=null),this.viewer.shadows=this.viewer._shadows}},{key:"nodeEdit",value:function(){var t,e=this;YJ.Measure.GetMeasureStatus()?console.log("上一次测量未结束"):(this.editevent&&this.editevent.destroy(),this.ids.forEach((function(t){e.viewer.entities.getById(t).show=!0})),YJ.Measure.SetMeasureStatus(!0),this.editevent=new X(this.sdk),this.editevent.mouse_left((function(i,n){var o=e.viewer.scene.pick(i.position);o&&o.id&&o.id.id&&-1!=e.ids.indexOf(o.id.id)&&(!t||t.id!=o.id.id)&&(t=o.id,e.viewer.entities.getById(e.ids[0]).position=new Cesium.Cartesian3.fromDegrees(e.viewPosition.lng,e.viewPosition.lat,e.viewPosition.alt),e.viewer.entities.getById(e.ids[1]).position=new Cesium.Cartesian3.fromDegrees(e.viewPositionEnd.lng,e.viewPositionEnd.lat,e.viewPositionEnd.alt),e.ControllerObject&&e.ControllerObject.destroy(),e.ControllerObject=new qo(e.sdk,{position:ja({},e.cartesian3Towgs84(t.position._value,e.sdk.viewer))}),e.ControllerObject.controllerCallBack=function(i,n){i.position.alt<0&&(i.position.alt=0),t.position=new Cesium.Cartesian3.fromDegrees(i.position.lng,i.position.lat,i.position.alt),n&&(0==e.ids.indexOf(o.id.id)?e.viewPosition=i.position:e.viewPositionEnd=i.position,YJ.Measure.SetMeasureStatus(!0))},e.ControllerObject.editTranslational())})),this.editevent.mouse_right((function(i,n){YJ.Measure.SetMeasureStatus(!1),e.editevent&&e.editevent.destroy(),e.ControllerObject&&e.ControllerObject.destroy(),e.ids.forEach((function(t){e.viewer.entities.getById(t).show=!1})),t=null})),this.editevent.mouse_move((function(t,e){})),this.editevent.gesture_pinck_start((function(i,n){var o=new Date;e.editevent.gesture_pinck_end((function(){new Date-o>=500&&(YJ.Measure.SetMeasureStatus(!1),e.editevent&&e.editevent.destroy(),e.ControllerObject&&e.ControllerObject.destroy(),e.ids.forEach((function(t){e.viewer.entities.getById(t).show=!1})),t=null)}))})))}},{key:"createLightCamera",value:function(){if(this.options.viewPosition){this.lightCamera=new Cesium.Camera(this.viewer.scene),this.lightCamera.position=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),this.lightCamera.frustum.near=.001*this.viewDistance,this.lightCamera.frustum.far=this.viewDistance;var t=Cesium.Math.toRadians(this.horizontalViewAngle),e=Cesium.Math.toRadians(this.verticalViewAngle),i=this.viewDistance*Math.tan(t/2)*2/(this.viewDistance*Math.tan(e/2)*2);this.lightCamera.frustum.aspectRatio=i,this.lightCamera.frustum.fov=t>e?t:e,this.lightCamera.setView({destination:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:{heading:Cesium.Math.toRadians(this.viewHeading||0),pitch:Cesium.Math.toRadians(this.viewPitch||0),roll:0}})}}},{key:"createShadowMap",value:function(){this.shadowMap=new Cesium.ShadowMap({context:this.viewer.scene.context,lightCamera:this.lightCamera,enabled:!0,isPointLight:!0,pointLightRadius:this.viewDistance,cascadesEnabled:!1,size:2048,softShadows:!0,normalOffset:!1,fromLightSource:!1}),this._originalShadowMap||(this._originalShadowMap=this.viewer.scene.shadowMap),this.viewer.scene.shadowMap=this.shadowMap}},{key:"createPostStage",value:function(){var t=this;Number(Cesium.VERSION.split(".")[1])>=102&&gn()("fs");var e=new Cesium.PostProcessStage({fragmentShader:"\n #define USE_CUBE_MAP_SHADOW true\n uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n varying vec2 v_textureCoordinates;\n uniform mat4 camera_projection_matrix;\n uniform mat4 camera_view_matrix;\n uniform samplerCube shadowMap_textureCube;\n uniform mat4 shadowMap_matrix;\n uniform vec4 shadowMap_lightPositionEC;\n uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness;\n uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth;\n uniform float helsing_viewDistance;\n uniform vec4 helsing_visibleAreaColor;\n uniform vec4 helsing_invisibleAreaColor;\n\n struct zx_shadowParameters\n {\n vec3 texCoords;\n float depthBias;\n float depth;\n float nDotL;\n vec2 texelStepSize;\n float normalShadingSmooth;\n float darkness;\n };\n\n float czm_shadowVisibility(samplerCube shadowMap, zx_shadowParameters shadowParameters)\n {\n float depthBias = shadowParameters.depthBias;\n float depth = shadowParameters.depth;\n float nDotL = shadowParameters.nDotL;\n float normalShadingSmooth = shadowParameters.normalShadingSmooth;\n float darkness = shadowParameters.darkness;\n vec3 uvw = shadowParameters.texCoords;\n depth -= depthBias;\n float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\n return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n }\n\n vec4 getPositionEC(){\n return czm_windowToEyeCoordinates(gl_FragCoord);\n }\n\n vec3 getNormalEC(){\n return vec3(1.);\n }\n\n vec4 toEye(in vec2 uv,in float depth){\n vec2 xy=vec2((uv.x*2.-1.),(uv.y*2.-1.));\n vec4 posInCamera=czm_inverseProjection*vec4(xy,depth,1.);\n posInCamera=posInCamera/posInCamera.w;\n return posInCamera;\n }\n\n vec3 pointProjectOnPlane(in vec3 planeNormal,in vec3 planeOrigin,in vec3 point){\n vec3 v01=point-planeOrigin;\n float d=dot(planeNormal,v01);\n return(point-planeNormal*d);\n }\n\n float getDepth(in vec4 depth){\n float z_window=czm_unpackDepth(depth);\n z_window=czm_reverseLogDepth(z_window);\n float n_range=czm_depthRange.near;\n float f_range=czm_depthRange.far;\n return(2.*z_window-n_range-f_range)/(f_range-n_range);\n }\n\n float shadow(in vec4 positionEC){\n vec3 normalEC=getNormalEC();\n zx_shadowParameters shadowParameters;\n shadowParameters.texelStepSize=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;\n shadowParameters.depthBias=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;\n shadowParameters.normalShadingSmooth=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;\n shadowParameters.darkness=shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;\n vec3 directionEC=positionEC.xyz-shadowMap_lightPositionEC.xyz;\n float distance=length(directionEC);\n directionEC=normalize(directionEC);\n float radius=shadowMap_lightPositionEC.w;\n if(distance>radius)\n {\n return 2.0;\n }\n vec3 directionWC=czm_inverseViewRotation*directionEC;\n shadowParameters.depth=distance/radius-0.0003;\n shadowParameters.nDotL=clamp(dot(normalEC,-directionEC),0.,1.);\n shadowParameters.texCoords=directionWC;\n float visibility=czm_shadowVisibility(shadowMap_textureCube,shadowParameters);\n return visibility;\n }\n\n bool visible(in vec4 result)\n {\n result.x/=result.w;\n result.y/=result.w;\n result.z/=result.w;\n return result.x>=-1.&&result.x<=1.\n &&result.y>=-1.&&result.y<=1.\n &&result.z>=-1.&&result.z<=1.;\n }\n\n void main(){\n // 釉色 = 结构二维(颜色纹理, 纹理坐标)\n gl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n // 深度 = 获取深度(结构二维(深度纹理, 纹理坐标))\n float depth = getDepth(texture2D(depthTexture, v_textureCoordinates));\n // 视角 = (纹理坐标, 深度)\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n // 世界坐标\n vec4 wordPos = czm_inverseView * viewPos;\n // 虚拟相机中坐标\n vec4 vcPos = camera_view_matrix * wordPos;\n float near = .001 * helsing_viewDistance;\n float dis = length(vcPos.xyz);\n if(dis > near && dis < helsing_viewDistance){\n // 透视投影\n vec4 posInEye = camera_projection_matrix * vcPos;\n // 可视区颜色\n // vec4 helsing_visibleAreaColor=vec4(0.,1.,0.,.5);\n // vec4 helsing_invisibleAreaColor=vec4(1.,0.,0.,.5);\n if(visible(posInEye)){\n float vis = shadow(viewPos);\n if(vis > 0.3){\n gl_FragColor = mix(gl_FragColor,helsing_visibleAreaColor,.5);\n } else{\n gl_FragColor = mix(gl_FragColor,helsing_invisibleAreaColor,.5);\n }\n }\n }\n }",uniforms:{shadowMap_textureCube:function(){return t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState")),Reflect.get(t.shadowMap,"_shadowMapTexture")},shadowMap_matrix:function(){return t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState")),Reflect.get(t.shadowMap,"_shadowMapMatrix")},shadowMap_lightPositionEC:function(){return t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState")),Reflect.get(t.shadowMap,"_lightPositionEC")},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState"));var e=t.shadowMap._pointBias;return Cesium.Cartesian4.fromElements(e.normalOffsetScale,t.shadowMap._distance,t.shadowMap.maximumDistance,0,new Cesium.Cartesian4)},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState"));var e=t.shadowMap._pointBias,i=new Cesium.Cartesian2;return i.x=1/t.shadowMap._textureSize.x,i.y=1/t.shadowMap._textureSize.y,Cesium.Cartesian4.fromElements(i.x,i.y,e.depthBias,e.normalShadingSmooth,new Cesium.Cartesian4)},camera_projection_matrix:this.lightCamera.frustum.projectionMatrix,camera_view_matrix:this.lightCamera.viewMatrix,helsing_viewDistance:function(){return t.viewDistance},helsing_visibleAreaColor:Cesium.Color.fromCssColorString(this.visibleAreaColor),helsing_invisibleAreaColor:Cesium.Color.fromCssColorString(this.invisibleAreaColor)}});this.postStage=this.viewer.scene.postProcessStages.add(e)}},{key:"drawFrustumOutline",value:function(){var t=new Cesium.Cartesian3,e=new Cesium.Matrix3,i=new Cesium.Quaternion,n=(this.lightCamera.positionWC,this.lightCamera.directionWC),o=this.lightCamera.upWC,s=this.lightCamera.rightWC;s=Cesium.Cartesian3.negate(s,t);var a=e;Cesium.Matrix3.setColumn(a,0,s,a),Cesium.Matrix3.setColumn(a,1,o,a),Cesium.Matrix3.setColumn(a,2,n,a);var r=Cesium.Quaternion.fromRotationMatrix(a,i),l=new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({frustum:this.lightCamera.frustum,origin:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:r}),id:Math.random().toString(36).substr(2),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOWGREEN),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});this.frustumOutline=this.viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:[l],appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!1})}))}},{key:"drawSketch",value:function(){this.sketch=this.viewer.entities.add({name:"sketch",position:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),Cesium.HeadingPitchRoll.fromDegrees(this.viewHeading-90,this.viewPitch,0)),ellipsoid:{radii:new Cesium.Cartesian3(this.viewDistance,this.viewDistance,this.viewDistance),minimumClock:Cesium.Math.toRadians(-this.horizontalViewAngle/2),maximumClock:Cesium.Math.toRadians(this.horizontalViewAngle/2),minimumCone:Cesium.Math.toRadians(90-this.verticalViewAngle/2),maximumCone:Cesium.Math.toRadians(90+this.verticalViewAngle/2),fill:!1,outline:!0,subdivisions:256,stackPartitions:64,slicePartitions:64,outlineColor:Cesium.Color.YELLOWGREEN}}),this.frustumOutline=this.viewer.entities.add({name:"sketch",position:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),Cesium.HeadingPitchRoll.fromDegrees(this.viewHeading-90,this.viewPitch,0)),ellipsoid:{radii:new Cesium.Cartesian3(this.viewDistance,this.viewDistance,this.viewDistance),innerRadii:new Cesium.Cartesian3(1e-4,1e-4,1e-4),minimumClock:Cesium.Math.toRadians(-this.horizontalViewAngle/2),maximumClock:Cesium.Math.toRadians(this.horizontalViewAngle/2),minimumCone:Cesium.Math.toRadians(90-this.verticalViewAngle/2),maximumCone:Cesium.Math.toRadians(90+this.verticalViewAngle/2),fill:!1,outline:!0,subdivisions:256,stackPartitions:1,slicePartitions:1,outlineColor:Cesium.Color.YELLOWGREEN}})}}],[{key:"create",value:function(t){t.destroy();var i=0;function n(){t.ids.forEach((function(e){t.viewer.entities.getById(e).show=!1})),YJ.Measure.SetMeasureStatus(!1),t.tip.destroy(),t.event.destroy(),t.tip=null,t.event=null}YJ.Measure.GetMeasureStatus()?console.log("上一次测量未结束"):(t.event=new X(t.sdk),t.tip=new Z("左键选择观测点位置,右键取消",t.sdk),YJ.Measure.SetMeasureStatus(!0),t.event.mouse_left((function(o,s){t.viewPosition||(t.options.viewPosition=t.cartesian3Towgs84(s,t.viewer),t.ids.push(e.create_point(t,s)),t.tip.set_text("左键选择最远观测点位置,右键取消")),2===++i&&(t.options.viewPositionEnd=t.cartesian3Towgs84(s,t.viewer),t.ids.push(e.create_point(t,s)),n(),t.update())})),t.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right((function(e,i){t.ids.forEach((function(e){t.viewer.entities.removeById(e)})),t.ids=[],n()})),t.event.gesture_pinck_start((function(e,i){var o=new Date;t.event.gesture_pinck_end((function(){new Date-o>=500&&(t.ids.forEach((function(e){t.viewer.entities.removeById(e)})),t.ids=[],n())}))})))}},{key:"create_point",value:function(t,e){var i=t.randomString(),n=t.cartesian3Towgs84(e,t.viewer),o={id:i,position:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}};return t.viewer.entities.add(new Cesium.Entity(o)),i}},{key:"edit",value:(i=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new W(i.sdk.viewer._container,{title:"可视域分析",left:"180px",top:"100px",closeCallBack:function(){i.Dialog.closeCallBack&&i.Dialog.closeCallBack(),YJ.Measure.SetMeasureStatus(!1),i.editevent&&i.editevent.destroy(),i.ControllerObject&&i.ControllerObject.destroy(),i.ids.forEach((function(t){i.viewer.entities.removeById(t)}))}});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" view-shed",(n=document.createElement("div")).innerHTML='\n \n
            \n
            \n
            \n 位置拾取(起点、终点)\n \n
            \n
            \n
            \n \n
            \n
            \n
            \n 视点高度\n
            \n \n m\n \n
            \n
            \n
            \n
            \n
            \n
            \n 视域夹角\n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n \n 45°\n 90°\n 135°\n 180°\n
            \n
            \n \n
            \n
            \n
            \n
            \n \n ',i._DialogObject.contentAppChild(n),i._DialogObject._element.body.getElementsByClassName("edit")[0].addEventListener("click",(function(){i.nodeEdit()})),(o=document.createElement("button")).innerHTML="绘制",o.addEventListener("click",(function(){e.create(i)})),i._DialogObject.footAppChild(o),i.html=n,s=n.getElementsByTagName("*"),i._EventBinding.on(i,s),i._elms=i._EventBinding.element,(r=n.querySelector("input[name='horizontalViewAngle']")).value=i.options.horizontalViewAngle,l=n.getElementsByClassName("range-node-active")[0],c=l.getElementsByClassName("range-node-active-text")[0],u=n.getElementsByClassName("range-process")[0],p=i.horizontalViewAngle/180*100,l.style.left=p+"%",u.style.width=p+"%",c.innerHTML=i.horizontalViewAngle+"°",r.addEventListener("input",(function(){var t=r.value/180*100;l.style.left=t+"%",u.style.width=t+"%",c.innerHTML=r.value+"°"})),r.addEventListener("change",(function(){clearTimeout(h),h=setTimeout((function(){i.horizontalViewAngle=r.value}),300)}));case 31:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"getcanvas",value:function(t){if(t.viewPosition){t.viewBillboardPrimitive&&(t.viewer.scene.primitives.remove(t.viewBillboardPrimitive),t.viewBillboardPrimitive=null);var e=document.createElement("canvas"),i=e.getContext("2d");e.width=220,e.height=180,e.style.background="#000000";var n=new Image,o=[{images:t.getSourceRootPath()+"/img/bubble/lng.png",text:"经度:"+parseFloat(t.viewPosition.lng.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/lat.png",text:"纬度:"+parseFloat(t.viewPosition.lat.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/h.png",text:"高度:"+Number((parseFloat(t.viewPosition.alt.toFixed(2))+Number(t.viewPointHeight)).toFixed(2))+" m"},{images:t.getSourceRootPath()+"/img/bubble/heading.png",text:"偏航角:"+parseFloat(t.viewHeading.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/pitch.png",text:"俯仰角:"+parseFloat(t.viewPitch.toFixed(10))+"°"}];n.src=t.getSourceRootPath()+"/img/bubble/bubble.png";var s=0;n.onload=function(){i.drawImage(n,0,0,e.width,e.height),o.forEach((function(n,a){var r=new Image;r.src=n.images,r.onload=function(){i.drawImage(r,12,12+26*a),i.fillStyle="#fff",i.font="12px Arial",i.fillText(n.text,44,28+26*a),++s===o.length&&(t.viewBillboardPrimitive&&t.viewer.scene.primitives.remove(t.viewBillboardPrimitive),t.viewBillboardPrimitive=t.viewer.scene.primitives.add(new Cesium.BillboardCollection),t.viewBillboardPrimitive.add({position:Cesium.Cartesian3.fromDegrees(t.viewPosition.lng,t.viewPosition.lat,t.viewPosition.alt+t.viewPointHeight),image:e,width:200,height:180,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}))}}))}}}}]);var i}(fi);function Fa(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return za(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?za(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function za(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),Va(i=Ha(this,e,[t,n]),Wa,new Map),i.viewer=t.viewer,i.options={},i.options.visibleAreaColor=n.visibleAreaColor||"#008000",i.options.invisibleAreaColor=n.invisibleAreaColor||"#FF0000",i.ids=[],i.primitives=[],i.viewpointPrimitive=null,i._elms={},i.precision=n.precision,i.viewPointHeight=n.viewPointHeight,i.Dialog=o,i._EventBinding=new wn,i.html=null,YJ.Analysis.AnalysesResults.push(i),e.edit(i),i}return sn()(e,t),_()(e,[{key:"viewPointHeight",get:function(){return this.options.viewPointHeight},set:function(t){var e=Math.floor(10*Number(t))/10;isNaN(e)&&(e=1.8),e<0&&(e=0),this.options.viewPointHeight=e,this._elms.viewPointHeight&&this._elms.viewPointHeight.forEach((function(t){t.value=e}))}},{key:"precision",get:function(){return this.options.precision},set:function(t){var e=Math.floor(Number(t));isNaN(e)?e=20:e<1&&(e=1),this.options.precision=e,this._elms.precision&&this._elms.precision.forEach((function(t){t.value=e}))}},{key:"analyse",value:function(){var t=this,i=[this.center.lng,this.center.lat],n=this.radius/1e3,o=turf.circle(i,n,{steps:180,units:"kilometers",properties:{foo:"bar"}});this.viewpointPrimitive||(this.viewpointPrimitive=this.viewer.scene.primitives.add(new Cesium.PointPrimitiveCollection)),this.viewBillboardPrimitive||(this.viewBillboardPrimitive=this.viewer.scene.primitives.add(new Cesium.BillboardCollection));for(var s=[],a=n/this.precision,r=1;r=s.length){var e=Ga(Wa,t).get(f);e&&clearInterval(e.event)}else!function(t){for(var e=[],n=t,o=0;o.01&&Math.abs(b.position.y-f.y)>.01&&Math.abs(b.position.z-f.z)>.01&&(w=Cesium.Color.RED);var k=new Cesium.GroundPolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArray([].concat(L()(a),L()(r),L()(l),L()(c),L()(a))),width:2}),x=new Cesium.GeometryInstance({geometry:k,name:"ViewershedPolygon",attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(w),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});e.push(x)}m.primitives.push(m.viewer.scene.primitives.add(new Cesium.GroundPolylinePrimitive({geometryInstances:e,appearance:new Cesium.PolylineColorAppearance})))}(d),d+=1}),0);Ga(Wa,this).set(f,{event:v})}},{key:"destroy",value:function(){var t,e,i,n,o=Fa(Ga(Wa,this));try{for(o.s();!(t=o.n()).done;){var s=y()(t.value,2),a=(s[0],s[1]);clearInterval(a.event)}}catch(t){o.e(t)}finally{o.f()}e=Wa,i=this,n=new Map,e.set(Ua(e,i),n);for(var r=0;r\n
            \n
            \n
            \n 视点高度\n
            \n \n m\n \n
            \n
            \n
            \n
            \n
            \n 采样精度\n \n
            \n
            \n
            \n ',i._DialogObject.contentAppChild(n),(o=document.createElement("button")).innerHTML="绘制",o.addEventListener("click",(function(){i.viewer.terrainProvider.availability?e.create(i):window.ELEMENT&&window.ELEMENT.Message({message:"未加载地形数据!",type:"warning",duration:1500})})),i._DialogObject.footAppChild(o),s=n.getElementsByTagName("*"),i._EventBinding.on(i,s),i._elms=i._EventBinding.element;case 17:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"getcanvas",value:function(t){var e=document.createElement("canvas"),i=e.getContext("2d");e.width=220,e.height=140,e.style.background="#000000";var n=new Image,s=[{images:t.getSourceRootPath()+"/img/bubble/lng.png",text:"经度:"+parseFloat(t.center.lng.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/lat.png",text:"纬度:"+parseFloat(t.center.lat.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/h.png",text:"视高:"+t.viewPointHeight+" m"},{images:t.getSourceRootPath()+"/img/bubble/radius.png",text:"半径:"+t.radius+" m"}];n.src=t.getSourceRootPath()+"/img/bubble/bubble.png";var r=0;return new Promise(function(){var t=o()(a.a.mark((function t(o,l){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n.onload=function(){i.drawImage(n,0,0,e.width,e.height),s.forEach((function(t,n){var a=new Image;a.src=t.images,a.onload=function(){i.drawImage(a,12,12+26*n),i.fillStyle="#fff",i.font="12px Arial",i.fillText(t.text,44,28+26*n),++r===s.length&&o(e)}}))};case 1:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}())}}]);var i}(fi);function Ja(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function qa(t){for(var e=1;e35?35:200*t;this.arrowWidth=i<15?15:i;this.viewer;this.Draw.start((function(i,n){if(!n||n.length<=2)window.ELEMENT&&window.ELEMENT.Message({message:"至少拥有三个坐标位置!",type:"warning",duration:1500});else{for(var o=[],s=1e4,a=1e4,r=-1e4,l=-1e3,c=0;cr?p:r,l=h>l?h:l}o.push(o[0]);var d=[s,a,r,l],m=turf.polygon([o]),f=turf.squareGrid(d,t,{mask:m});e.createEllipse(f)}}))}},{key:"createNew4Num",value:function(t){var e=this,i=t;this.Draw.start((function(t,n){if(!n||n.length<=2)console.warn("至少拥有三个坐标位置!");else{for(var o=[],s=1e4,a=1e4,r=-1e4,l=-1e3,c=0;cr?p:r,l=h>l?h:l}o.push(o[0]);var d=[s,a,r,l],m=r-s,f=l-a;f=f>m?f:m;var v=turf.polygon([o]),g=turf.area(v);g>5e12?i-=25:g>1e12?i-=20:g>5e11?i-=15:g>1e11?i-=10:g>6e10&&(i-=5);var y=f/i,b=2e3*y>35?35:2e3*y;e.arrowWidth=b<15?15:b;var C=turf.squareGrid(d,y,{units:"degrees",mask:v});e.createEllipse(C)}}))}},{key:"createEllipse",value:function(t){for(var e=[],i=0;i0&&function t(i){Cesium.sampleTerrainMostDetailed(h.viewer.scene.terrainProvider,i).then((function(i){m++;var n=e.slice(m*d,(m+1)*d);n.length>0&&t(n);var o=[],s=i.reduce((function(t,e,i,n){var s=10*i,a=s+10,r=n.slice(s,a);return 0!=r.length&&(o[i]=r),o}),[]);h.calculateSlope(s)}))}(f)}},{key:"createPolygonInsrance",value:function(t,e,i){for(var n=[],o=1;o0?[Cesium.Cartographic.toCartesian(s),Cesium.Cartographic.toCartesian(a)]:[Cesium.Cartographic.toCartesian(a),Cesium.Cartographic.toCartesian(s)];return new Cesium.GeometryInstance({id:{type:"SlopeAspect",value:o},geometry:new Cesium.GroundPolylineGeometry({positions:r,width:this.arrowWidth}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE.withAlpha(.6)),show:new Cesium.ShowGeometryInstanceAttribute(!0)}})}},{key:"calculateSlope",value:function(t){for(var e=this,i=[],n=[],o=0;or&&(r=u,l=c)}var p=new Cesium.Cartographic(a.longitude,a.latitude,0),h=new Cesium.Cartographic(s[l].longitude,s[l].latitude,0),d=Cesium.Cartesian3.distance(Cesium.Cartographic.toCartesian(p),Cesium.Cartographic.toCartesian(h)),m=Math.abs(r/d),f=this.calculateSlopeColor(m,.4),v=this.createPolygonInsrance(s,f,m);n.push(v);var g=l>4?s[l-4]:s[l+4],y=s[l],b=this.createArrowInstance(y,a,g,r,m);i.push(b)}var C=this.viewer.scene.primitives.add(new Cesium.GroundPrimitive({geometryInstances:n,appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,closed:!1})})),w=this.viewer.scene.primitives.add(new Cesium.GroundPolylinePrimitive({geometryInstances:i,appearance:new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"PolylineArrow",uniforms:{color:new Cesium.Color(1,1,0,.8)}}})})}));this.result.push(w,C),this.event=new X(this.sdk);var k=function(t,i){var n=document.getElementById("SlopeAspect-box");n||((n=document.createElement("div")).id="SlopeAspect-box",n.style.pointerEvents="none",n.style.display="none",n.style.position="absolute",n.style.background="#333333",n.style.color="#fff",n.style.color="#fff",n.style.padding="5px",n.style.fontSize="12px",n.style.borderRadius="5px",n.style.transform="translate(-50%, -10px)",n.innerHTML='\n
            坡度:
            \n \n ',document.body.appendChild(n));var o=n.getElementsByClassName("value")[0],s=qa({},t.position),a=e.sdk.viewer.scene.pick(s);if(a&&a.id&&a.id.type&&"SlopeAspect"===a.id.type){var r=0,l=0;if(e.sdk.viewer&&e.sdk.viewer._element){var c=e.sdk.viewer._element.getElementsByClassName("cesium-widget")[0].getElementsByTagName("canvas")[0];r=c.getBoundingClientRect().top+window.scrollY,l=c.getBoundingClientRect().left+window.scrollX}n.style.display="block",n.style.left=s.x+2+l+"px",n.style.top=s.y-20+r+"px",o.innerHTML="坡度:"+Number(Cesium.Math.toDegrees(a.id.value||0).toFixed(2))+"°"}else n.style.display="none"};this.event.mouse_move((function(t,e){var i={position:qa({},t.endPosition)};k(i)})),this.event.mouse_left(k),this._camera={position:this.sdk.viewer.camera.position,heading:this.sdk.viewer.camera.heading,pitch:this.sdk.viewer.camera.pitch,roll:this.sdk.viewer.camera.roll},this.sdk.viewer.scene.preRender.addEventListener(this._watchEvent,this)}},{key:"_watchEvent",value:function(){if(this._camera.position.x.toFixed(8)!==this.sdk.viewer.camera.position.x.toFixed(8)||this._camera.position.y.toFixed(8)!==this.sdk.viewer.camera.position.y.toFixed(8)||this._camera.position.z.toFixed(8)!==this.sdk.viewer.camera.position.z.toFixed(8)||this._camera.heading.toFixed(8)!==this.sdk.viewer.camera.heading.toFixed(8)||this._camera.pitch.toFixed(8)!==this.sdk.viewer.camera.pitch.toFixed(8)||this._camera.roll.toFixed(8)!==this.sdk.viewer.camera.roll.toFixed(8)){var t=document.getElementById("SlopeAspect-box");t&&(t.style.display="none")}this._camera={position:this.sdk.viewer.camera.position,heading:this.sdk.viewer.camera.heading,pitch:this.sdk.viewer.camera.pitch,roll:this.sdk.viewer.camera.roll}}},{key:"calculateSlopeColor",value:function(t,e){return t<.00872686779075879?"rgba(85,182,43,"+e+")":t<.03492076949174773?"rgba(135,211,43,"+e+")":t<.08748866352592401?"rgba(204,244,44,"+e+")":t<.2679491924311227?"rgba(245,233,44,"+e+")":t<.7002075382097097?"rgba(255,138,43,"+e+")":t<1.4281480067421144?"rgba(255,84,43,"+e+")":"rgba(255,32,43,"+e+")"}},{key:"destroy",value:function(){var t=this;this.result&&this.result.forEach((function(e){t.viewer.scene.primitives.remove(e)})),this.result=[],this.sdk.viewer.scene.preRender.removeEventListener(this._watchEvent,this)}}])}(fi);function Ka(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var $a=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),window.addEventListener("resize",(function(){i.echartsObject&&i.echartsObject.resize()})),(i=Ka(this,e,[t])).viewer=t.viewer,i.Dialog=n,YJ.Analysis.AnalysesResults.push(i),e.create(i),i}return sn()(e,t),_()(e,[{key:"clean",value:function(){this.end(),this._currentId=null,this.entityHasCreated=!1,this.polyline&&this.viewer.entities.remove(this.polyline),this.tipEntity&&this.viewer.entities.remove(this.tipEntity),this.polyline=null,this.tipEntity=null}},{key:"destroy",value:function(){this.clean(),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null)}}],[{key:"create",value:function(t){var i=this;this._currentId=Cesium.createGuid();var n=this._currentId;if(t.clean(),YJ.Measure.GetMeasureStatus())console.warn("上一次测量未结束");else{YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("左键确定,右键取消",t.sdk),t.event=new X(t.sdk),t.positions=[],t.points_ids=[];var s=[];t.event.mouse_left(function(){var r=o()(a.a.mark((function o(r,l){var c;return a.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:try{t.entityHasCreated||e.create_polyline(t),s.push(l),t.points_ids.push(t.create_point(l)),2==s.length&&(t.end(),c=[],s.forEach((function(e){c.push(t.cartesian3Towgs84(e,t.viewer))})),e.interPoints(t).then((function(o){i._currentId&&i._currentId===n&&(t._DialogObject?e.initEcharts(t,o):e.edit(t,o))})))}catch(t){console.log(t)}case 1:case"end":return o.stop()}}),o)})));return function(t,e){return r.apply(this,arguments)}}()),t.event.mouse_right((function(e,i){s=[],t.clean()})),t.event.mouse_move((function(e,i){t.positions=s.concat(i),t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500){s=[],t.end()}}))}))}}},{key:"create_polyline",value:function(t){t.entityHasCreated=!0;var e=t.randomString();return t.polyline=t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),width:5,material:Cesium.Color.fromCssColorString(t.color),clampToGround:!0,zIndex:99999999}})),e}},{key:"interPoints",value:(n=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_,E,S,D,P;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(i=e.viewer,n=e.positions,o=[],s=[],r=0;rb&&(b=y),(C=parseInt(b/2))>150&&(C=150),C<2&&(C=2),w=f/(C-1),k=0;case 24:if(!(k\n
            \n ',i._DialogObject.contentAppChild(o),(s=document.createElement("button")).innerHTML='重新绘制',s.style.width="auto",s.addEventListener("click",(function(){e.create(i),e.initEcharts(i)})),i._DialogObject.footAppChild(s),e.initEcharts(i,n);case 16:case"end":return t.stop()}}),t)}))),function(t,e){return i.apply(this,arguments)})},{key:"initEcharts",value:function(t,e){var i,n=[],o=[],s=e;if(s){for(var a=s[s.length-1].distance,r=Math.ceil(a),l=0;l高度:"+n[1]+"m
            坐标:"+i[0].toFixed(5)+","+i[1].toFixed(5)}},grid:{top:40,bottom:20,left:55,right:30},calculable:!0,xAxis:[{type:"value",max:r,scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],yAxis:[{type:"value",scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],series:[{name:"ProfileLine",type:"line",data:n,smooth:!0,itemStyle:{normal:{color:"#39FDA1"}},lineStyle:{normal:{width:3,color:{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"rgba(85,254,139,1)"},{offset:.5,color:"rgba(7,252,202,1)"},{offset:1,color:"rgba(14,245,210,1)"}],globalCoord:!1}}},areaStyle:{normal:{color:new echarts.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgba(102,153,255,1)"},{offset:.8,color:"rgba(102,153,255,0.08)"},{offset:1,color:"rgba(9,173,208,0.15)"}],!1),shadowColor:"rgba(14,245,210,1)",shadowBlur:20}},markPoint:{data:[{type:"max",name:"最高点",label:{color:"#ffffff"}},{type:"min",name:"最低点",label:{color:"#ffffff"}}]}}]}}else{var m=t._DialogObject._element.content.getElementsByClassName("profile-echarts")[0];t.echartsObject=echarts.init(m),i={tooltip:{trigger:"axis",textStyle:{align:"left"}},grid:{top:40,bottom:20,left:55,right:30},calculable:!0,xAxis:[{type:"value",scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],yAxis:[{type:"value",scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],series:[{name:"ProfileLine",type:"line",data:[],smooth:!0,itemStyle:{normal:{color:"#39FDA1"}},lineStyle:{normal:{width:3,color:{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"rgba(85,254,139,1)"},{offset:.5,color:"rgba(7,252,202,1)"},{offset:1,color:"rgba(14,245,210,1)"}],globalCoord:!1}}},areaStyle:{normal:{color:new echarts.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgba(102,153,255,1)"},{offset:.8,color:"rgba(102,153,255,0.08)"},{offset:1,color:"rgba(9,173,208,0.15)"}],!1),shadowColor:"rgba(14,245,210,1)",shadowBlur:20}},markPoint:{data:[{type:"max",name:"最高点",label:{color:"#ffffff"}},{type:"min",name:"最低点",label:{color:"#ffffff"}}]}}]}}t.echartsObject.setOption(i)}}]);var i,n}(wa);function Qa(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var tr=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=Qa(this,e,[t,n])).viewer=t.viewer,i.resultObject={viewPoint:void 0,targetPoints:[],targetPoint:void 0,objectExclude:[],entities:[]},i.options={},i._elms={},i.viewPointHeight=n.viewPointHeight,i.Dialog=o,i._EventBinding=new wn,YJ.Analysis.AnalysesResults.push(i),e.edit(i),i}return sn()(e,t),_()(e,[{key:"viewPointHeight",get:function(){return this.options.viewPointHeight},set:function(t){var e=Math.floor(10*Number(t))/10;isNaN(e)&&(e=1.8),e<0&&(e=0),this.options.viewPointHeight=e,this._elms.viewPointHeight&&this._elms.viewPointHeight.forEach((function(t){t.value=e}))}},{key:"destroy",value:function(){var t=this;this.resultObject.entities.forEach((function(e){t.viewer.entities.remove(e)})),this.resultObject={viewPoint:void 0,targetPoints:[],targetPoint:void 0,objectExclude:[],entities:[]},this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=null,this.event=null,YJ.Measure.SetMeasureStatus(!1)}}],[{key:"create",value:function(t){if(YJ.Measure.GetMeasureStatus())console.log("上一次测量未结束");else{t._DialogObject&&t._DialogObject.close&&(t._DialogObject.close(),t._DialogObject=null),t.event=new X(t.sdk),t.tip=new Z("左键点击创建视角起点",t.sdk),YJ.Measure.SetMeasureStatus(!0);t.event.mouse_left(function(){var i=o()(a.a.mark((function i(n,o){var s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(t.tip.set_text("左键创建视角终点,右键结束通视分析"),t.resultObject.viewPoint){i.next=16;break}if(s=t.cartesian3Towgs84(o,t.viewer),!t.sdk.viewer.terrainProvider.availability){i.next=7;break}return i.next=6,Cesium.sampleTerrainMostDetailed(t.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(s.lng,s.lat)]);case 6:r=i.sent;case 7:r&&r[0].height>s.alt&&(s.alt=r[0].height),s.alt=s.alt+t.viewPointHeight,l=Cesium.Cartesian3.fromDegrees(s.lng,s.lat,s.alt),t.resultObject.viewPoint=l,c=t.viewer.entities.add({position:l,point:{color:Cesium.Color.YELLOW,pixelSize:5}}),t.resultObject.objectExclude.push(c),t.resultObject.entities.push(c),i.next=33;break;case 16:t.resultObject.targetPoint=o,u=t.viewer.entities.add({position:o,point:{color:Cesium.Color.YELLOW,pixelSize:5}}),t.resultObject.objectExclude.push(u),t.resultObject.entities.push(u),p=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.resultObject.targetPoint,t.resultObject.viewPoint,new Cesium.Cartesian3),new Cesium.Cartesian3),h=new Cesium.Ray(t.resultObject.viewPoint,p),d=t.viewer.scene.drillPickFromRay(h),m={},f=0;case 25:if(!(fg?(b=t.viewer.entities.add({polyline:{positions:[t.resultObject.viewPoint,m.position],material:Cesium.Color.GREEN,width:3,zIndex:99999999}}),t.resultObject.entities.push(b),C=t.viewer.entities.add({polyline:{positions:[m.position,t.resultObject.targetPoint],material:Cesium.Color.RED,width:3,zIndex:99999999}}),t.resultObject.entities.push(C),t.resultObject.targetPoints.push({targetPoint:o,visual:!1,distance:[v,g,y]})):(w=t.viewer.entities.add({polyline:{positions:[t.resultObject.viewPoint,t.resultObject.targetPoint],material:Cesium.Color.GREEN,width:3,zIndex:99999999}}),t.resultObject.entities.push(w),t.resultObject.targetPoints.push({targetPoint:o,visual:!0,distance:[v,g,y]})));case 33:case"end":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}()),t.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right((function(t,e){i()})),t.event.gesture_pinck_start((function(e,n){var o=new Date;t.event.gesture_pinck_end((function(){new Date-o>=500&&i()}))}))}function i(){YJ.Measure.SetMeasureStatus(!1),t.tip.destroy(),t.event.destroy(),t.tip=null,t.event=null}}},{key:"edit",value:(i=o()(a.a.mark((function t(i){var n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new W(i.sdk.viewer._container,{title:"多点视线分析",left:"180px",top:"100px",closeCallBack:function(){i.Dialog.closeCallBack&&i.Dialog.closeCallBack(),YJ.Measure.SetMeasureStatus(!1)}});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" visibility",(n=document.createElement("div")).innerHTML='\n \n
            \n
            \n
            \n 视点高度\n
            \n \n m\n \n
            \n
            \n
            \n
            \n ',i._DialogObject.contentAppChild(n),(o=document.createElement("button")).innerHTML="绘制",o.addEventListener("click",(function(){e.create(i)})),i._DialogObject.footAppChild(o),s=n.getElementsByTagName("*"),i._EventBinding.on(i,s),i._elms=i._EventBinding.element;case 17:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"distance",value:function(t,e){var i=Cesium.Cartographic.fromCartesian(t),n=Cesium.Cartographic.fromCartesian(e),o=new Cesium.EllipsoidGeodesic;o.setEndPoints(i,n);var s=o.surfaceDistance;return s=Math.sqrt(Math.pow(s,2)+Math.pow(n.height-i.height,2))}}]);var i}(fi),er=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),this.viewer=e.viewer;var n=this.viewer.terrainProvider.availability;if(!n)return this.error="未加载地形数据!",window.ELEMENT&&window.ELEMENT.Message({message:"未加载地形数据!",type:"warning",duration:1500}),void console.warn(this.error);this.positions=i.positions,this.interfaceNum=i.interfaceNum||25,this.colorFill=i.colorFill||["#8CEA00","#B7FF4A","#FFFF37","#FFE66F","#FFD1A4","#FFCBB3","#FFBD9D","#FFAD86","#FF9D6F","#FF8F59","#FF8040","#FF5809","#F75000","#D94600","#BB3D00","#A23400","#842B00","#642100","#4D0000","#2F0000"],this.countorLineList=Cesium.defaultValue(i.countorLineList,[]),YJ.Analysis.AnalysesResults.push(this),this.createNewLine()}return _()(t,[{key:"type",get:function(){return"ContourAnalysis"}},{key:"createNewLine",value:function(){t.interpolatePoint(this)}},{key:"getObjectIndex",value:function(t,e){for(var i=0;ie)return i}},{key:"clear",value:function(t){if(t){this.viewer.dataSources.remove(t);var e=this.countorLineList.indexOf(t);this.countorLineList.splice(e,1)}}},{key:"destroy",value:function(){var t=this;this.countorLineList.forEach((function(e){t.viewer.dataSources.remove(e)})),this.countorLineList=[]}}],[{key:"interpolatePoint",value:function(t){for(var e=t.positions,i=[],n={minX:360,maxX:-360,minY:180,maxY:-180},o=0;o2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=or(this,e,[t,o])).viewer=t.viewer,n.tiles3d=i,n.options=nr({},o),n.options.regionsType=n.options.regionsType||!1,YJ.Analysis.SectionResults.push(n),n.Planes=[],e.start(n),n}return sn()(e,t),_()(e,[{key:"regionsType",get:function(){return this.options.regionsType},set:function(t){this.options.regionsType=t,this.Planes.length>0&&(this.Planes=[],e.planeCollection(this))}},{key:"destroy",value:function(){this.Planes=[],this.tiles3d.clippingPlanes&&(this.tiles3d.clippingPlanes.enabled=!1,this.tiles3d.clippingPlanes.removeAll())}}],[{key:"start",value:function(t){var i=t.options.positions||[];if(!t.isConvex(i))return window.ELEMENT&&window.ELEMENT.Message({message:"不支持凹多边形",type:"warning",duration:1500}),void console.log("不支持凹多边形");t.inverseTransform=function(t){var e,i=t.root.transform;e=i&&i.equals(Cesium.Matrix4.IDENTITY)||!i?Cesium.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center):Cesium.Matrix4.fromArray(t.root.transform);return Cesium.Matrix4.inverseTransformation(e,new Cesium.Matrix4)}(t.tiles3d),t.Planes=[];var n=[];if(i.length>0){for(var o=0;o=0;n--)0===n?t.Planes.push(a(e[n],e[e.length-1],t.inverseTransform)):t.Planes.push(a(e[n],e[n-1],t.inverseTransform));if(t.tiles3d.clippingPlanes){t.tiles3d.clippingPlanes.removeAll();for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:{};k()(this,e),(i=ar(this,e,[t])).viewer=t.viewer,i.options=n||{},i.options.height=i.options.height||0===i.options.height?i.options.height:10,i.options.show=!i.options.show&&!1!==i.options.show||i.options.show,i.bottomImg=i.getSourceRootPath()+"/img/excavationregion_top.jpg",i.wallImg=i.getSourceRootPath()+"/img/excavationregion_side.jpg",i.splitNum=Cesium.defaultValue(n.splitNum,50),i.Draw=new Ea(i.sdk),i.bottomMaterial=Cesium.Material.fromType("Color",{color:Cesium.Color.fromAlpha(Cesium.Color.fromCssColorString("#735d4f"))}),i.wallMaterial=Cesium.Material.fromType("Color",{color:Cesium.Color.fromAlpha(Cesium.Color.fromCssColorString("#976b4e"))});var o=new Image,s=new Image;return o.src=i.bottomImg,s.src=i.wallImg,o.crossOrigin="Anonymous",s.crossOrigin="Anonymous",o.onload=function(){var t=document.createElement("canvas");t.width=o.width,t.height=o.height,t.getContext("2d").drawImage(o,0,0,o.width,o.height);var e=t.toDataURL("image/jpg");i.bottomMaterial=new Cesium.Material({fabric:{type:"Image",uniforms:{image:e}}}),i.bottomSurface&&(i.bottomSurface.appearance.material=i.bottomMaterial)},s.onload=function(){var t=document.createElement("canvas");t.width=s.width,t.height=s.height,t.getContext("2d").drawImage(s,0,0,s.width,s.height);var e=t.toDataURL("image/jpg");i.wallMaterial=new Cesium.Material({fabric:{type:"Image",uniforms:{image:e}}}),i.wellWall&&(i.wellWall.appearance.material=i.wallMaterial)},i.init(),i}return sn()(e,t),_()(e,[{key:"show",get:function(){return this.options.show},set:function(t){this.options.show=t,this.switchExcavate(t)}},{key:"height",get:function(){return this.options.height},set:function(t){this.options.height=t}},{key:"init",value:function(){e.edit(this,!0)}},{key:"startCreate",value:function(){var t=this;this.Draw.start((function(e,i){if(i&&!(i.length<=2))return t.isConvex(i)?void t.updateData(i):(window.ELEMENT&&window.ELEMENT.Message({message:"不支持凹多边形",type:"warning",duration:1500}),void console.log("不支持凹多边形"));window.ELEMENT&&window.ELEMENT.Message({message:"至少拥有三个坐标位置!",type:"warning",duration:1500})}))}},{key:"updateData",value:function(t){var e=this.viewer;this.clear();for(var i=[],n=[],o=0;o=0;t--)this.viewer.scene.primitives.remove(rr[t]);rr=[],this.Draw&&this.Draw.end()}},{key:"destroy",value:function(){this.clear()}},{key:"prepareWell",value:function(t){for(var e=t.length,i=this.excavateMinHeight-this.height,n=[],o=[],s=[],a=0;a\n
            \n
            \n
            \n 挖掘高度\n
            \n \n m\n \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n 绘制开挖区域\n \n
            \n
            \n 清除开挖区域\n \n
            \n
            \n
            \n ',e._DialogObject.contentAppChild(n),n.getElementsByClassName("start-excavation")[0].addEventListener("click",(function(){e.startCreate()})),n.getElementsByClassName("clean-excavation")[0].addEventListener("click",(function(){e.clear()})),(o=n.querySelector("input[name='height']")).value=e.height,o.addEventListener("change",(function(t){var i=t.target.value;(i=Number(i))<.01&&(i=.01,t.target.value=i,e.height=i)})),o.addEventListener("blur",(function(t){var i=t.target.value;i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),i<.01&&(i=.01),t.target.value=i,e.height=i})),t.next=22;break;case 21:e._DialogObject&&e._DialogObject.close&&(e._DialogObject.close(),e._DialogObject=null);case 22:case"end":return t.stop()}}),t)}))),function(t,e){return i.apply(this,arguments)})}]);var i}(fi);function cr(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ur(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(k()(this,e),n=pr(this,e,[t]),C()(n,"getUniqueArray",(function(t){return t.filter((function(t,e,i){return i.indexOf(t,0)===e}))})),!i||!n.sdk||!n.sdk.viewer)return tn()(n);if(n.options=ur({},o),n.options.id=o.id||n.randomString(),n.options.name=o.name||"压平面",n.options.positions=o.positions||[],n.options.show=!o.show&&!1!==o.show||o.show,n.tileset=i,n.Dialog=s,!n.options.height&&0!==n.options.height){for(var a=n.options.positions[0].alt,r=0;rn.options.positions[r].alt&&(a=n.options.positions[r].alt);n.options.height=a}return hr[n.tileset.id]?hr[n.tileset.id].push(ur({},n.options)):hr[n.tileset.id]=[ur({},n.options)],n.center=i.boundingSphere.center.clone(),n.center84=n.cartesian3Towgs84(n.center,n.sdk.viewer),n.matrix=Cesium.Transforms.eastNorthUpToFixedFrame(n.center.clone()),n.localMatrix=Cesium.Matrix4.inverse(n.matrix,new Cesium.Matrix4),n.addFlat(),n}return sn()(e,t),_()(e,[{key:"show",get:function(){return this.options.show},set:function(t){this.options.show=t;for(var e=0;e= max(p1[1], p2[1])){\n continue;\n }\n float x = p1[0] + ((point[1] - p1[1]) * (p2[0] - p1[0])) / (p2[1] - p1[1]);\n if(x > point[0]){\n nCross++;\n }\n }\n return int(mod(float(nCross), float(2))) == 1;\n }\n ")})),n}},{key:"updateShader",value:function(t,e){var i=new Cesium.CustomShader({uniforms:{u_tileset_localToWorldMatrix:{type:Cesium.UniformType.MAT4,value:this.matrix},u_tileset_worldToLocalMatrix:{type:Cesium.UniformType.MAT4,value:this.localMatrix},u_flatHeight:{type:Cesium.UniformType.FLOAT,value:this.flatHeight}},vertexShaderText:"\n // 所有isPointInPolygon函数\n ".concat(t,"\n void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput){\n vec3 modelMC = vsInput.attributes.positionMC;\n vec4 model_local_position = vec4(modelMC.x, modelMC.y, modelMC.z, 1.0);\n vec4 tileset_local_position = u_tileset_worldToLocalMatrix * czm_model * model_local_position;\n vec2 position2D = vec2(tileset_local_position.x,tileset_local_position.y);\n float ground_z = 0.0;\n // 多个多边形区域\n ").concat(e,"\n }")});this.tileset.customShader=i,this.sdk.viewer.scene.requestRender()}},{key:"cartesiansToLocal",value:function(t){for(var e=[],i=0;i\n
            \n
            \n
            \n 名称\n \n
            \n
            \n
            \n
            \n 压平高度\n
            \n \n m\n \n
            \n
            \n
            \n
            \n ',this._DialogObject.contentAppChild(i),(n=i.getElementsByClassName("input-name")[0]).value=this.options.name,n.addEventListener("input",(function(){r.name=n.value})),(o=i.getElementsByClassName("flat-height")[0]).value=this.options.height,o.addEventListener("input",(function(){r.height=Number(o.value),r.addFlat()})),(s=document.createElement("button")).className="btn",s.innerHTML="确认",this._DialogObject.footAppChild(s),s.addEventListener("click",(function(){r.options.name||(r.options.name="压平面"),r.originalOptions=r.deepCopyObj(r.options),r._DialogObject.close(),r.Dialog.confirmCallBack&&r.Dialog.confirmCallBack(r.options)})),t.next=24;break;case 23:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 24:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"reset",value:function(){this.options=this.deepCopyObj(this.originalOptions),this.name=this.options.name,this.height=this.options.height,this.addFlat()}},{key:"flatEdit",value:function(t){if(t){for(var e=that.options.positions,i=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:{text:"左键开始,右键结束;"};return k()(this,e),(i=vr(this,e,[t,n])).options=fr({},n),i.event=new X(t),i.tip=new Z(n.text,t),i.viewer=t.viewer,i.defaultColor="rgba(246,49,49,0.55)",i.ids=[],YJ.Measure.Measures.push(i),i._isDestroy=!1,i}return sn()(e,t),_()(e,[{key:"start",value:function(){this.setPickStatus(!1),YJ.Measure.SetMeasureStatus(!0)}},{key:"destroy",value:function(){var t=this;this._isDestroy=!0,this.end(),this.ids.forEach((function(e){t.remove_entity(e)}))}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=null,this.event=null}},{key:"create_point",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.randomString(),n=this.cartesian3Towgs84(t,this.viewer);return this.viewer.entities.add(new Cesium.Entity({id:i,position:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt),billboard:{show:e,image:this.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}})),i}},{key:"remove_entity",value:function(t){this.viewer.entities.removeById(t)}}])}(fi);function yr(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return br(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?br(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function br(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Cr(this,e,[t,n])).options.color=i.options.color||"#00ffff",i.start_id="",i.end_id="",i.polyline_id="",i.clampPositions=[],i}return sn()(e,t),_()(e,[{key:"clampToGroundMeasure",value:(r=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],this.ids.forEach((function(t,e){var i=d.viewer.entities.getById(t).position.getValue();n.push(d.cartesian3Towgs84(i,d.viewer))})),o=this.chunkLine(n,e),s=[],o.forEach((function(t,e){0===e?s=L()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),r=s.length,l=yr(s),t.prev=7,l.s();case 9:if((c=l.n()).done){t.next=18;break}return u=c.value,p=s.indexOf(u),t.next=14,this.getHeight({lng:u[0],lat:u[1],alt:0},p,r);case 14:h=t.sent,i(null,h);case 16:t.next=9;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(7),l.e(t.t0);case 23:return t.prev=23,l.f(),t.finish(23);case 26:case"end":return t.stop()}}),t,this,[[7,20,23,26]])}))),function(t,e){return r.apply(this,arguments)})},{key:"computeDisByTowPoint",value:(s=o()(a.a.mark((function t(i,n){var s,r,l,c,u=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=this.computeDistance2([i,n]),r=10,l=function(t){if(!u._isDestroy){var i=u.getLabel("贴地距离:"+Number(t).toFixed(2)+"米");i.pixelOffset=new Cesium.Cartesian2(0,-32),u.ids.push(e.create_point(Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt),{label:i},u))}},c=function(){var t=o()(a.a.mark((function t(e){var o,s,r,c,p,h,d,m,f,v;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=u.chunkLine([i,n],e),s=[],o.forEach((function(t,e){0===e?s=L()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),r=[],c=yr(s),t.prev=5,c.s();case 7:if((p=c.n()).done){t.next=16;break}return h=p.value,d=s.indexOf(h),t.next=12,u.sampleHeight({lng:h[0],lat:h[1],alt:0},d);case 12:m=t.sent,r.push(m);case 14:t.next=7;break;case 16:t.next=21;break;case 18:t.prev=18,t.t0=t.catch(5),c.e(t.t0);case 21:return t.prev=21,c.f(),t.finish(21);case 24:f=0,v=r.length-1,r.forEach((function(t,e){if(e!==v){var i=u.computeDistance2([t.position,r[e+1].position]),n=Math.abs(t.position.alt-r[e+1].position.alt),o=Math.sqrt(i*i+n*n);f+=o}})),l(f);case 28:case"end":return t.stop()}}),t,null,[[5,18,21,24]])})));return function(e){return t.apply(this,arguments)}}(),!(s>2)){t.next=10;break}return r=s/20,t.next=8,c(r);case 8:t.next=17;break;case 10:if(!(s<1)){t.next=14;break}l(s),t.next=17;break;case 14:return r=1,t.next=17,c(r);case 17:case"end":return t.stop()}}),t,this)}))),function(t,e){return s.apply(this,arguments)})},{key:"sampleHeight",value:(n=o()(a.a.mark((function t(e,i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getClampToHeight(e,L()(this.sdk.viewer.entities.values));case 2:return n=t.sent,e.alt=n,t.abrupt("return",{position:e,index:i});case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"getHeight",value:(i=o()(a.a.mark((function t(e,i,n){var o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:if(o=t.sent,e.alt=o[0].height,this.clampPositions.push({position:e,index:i}),n!==this.clampPositions.length){t.next=8;break}return s=this.startCompute(),t.abrupt("return",{total:n,current:this.clampPositions.length,total_length:s});case 8:return t.abrupt("return",{total:n,current:this.clampPositions.length});case 9:case"end":return t.stop()}}),t,this)}))),function(t,e,n){return i.apply(this,arguments)})},{key:"startCompute",value:function(){var t=this;this.clampPositions.sort((function(t,e){return t.index=500?n():i(a,o)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polyline_id,this.end_id,this.start_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),wr(e,"destroy",this,3)([])}},{key:"end",value:function(){wr(e,"end",this,3)([])}}],[{key:"createPolyline",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:3,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),dashLength:20}),zIndex:99999999}})),e}},{key:"create_point",value:function(t,e,i){var n=e.label,o=e.image,s=void 0===o?"point.png":o,a=e.width,r=e.height,l=i.randomString(),c=i.cartesian3Towgs84(t,i.viewer);return n&&(n.pixelOffset=new Cesium.Cartesian2(0,-(r||32))),i.viewer.entities.add(new Cesium.Entity({id:l,label:n,position:Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt),billboard:{image:i.getSourceRootPath()+"/img/"+s,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:a,height:r}})),l}}]);var i,n,s,r}(gr);function xr(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return _r(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_r(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function _r(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Er(this,e,[t,n])).options.color=i.options.color||"#00ffff",i.start_id="",i.end_id="",i.polyline_id="",i.clampPositions=[],i}return sn()(e,t),_()(e,[{key:"clampToGroundMeasure",value:(s=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],this.ids.forEach((function(t,e){var i=d.viewer.entities.getById(t).position.getValue();n.push(d.cartesian3Towgs84(i,d.viewer))})),o=this.chunkLine(n,e),s=[],o.forEach((function(t,e){0===e?s=L()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),r=s.length,l=xr(s),t.prev=7,l.s();case 9:if((c=l.n()).done){t.next=18;break}return u=c.value,p=s.indexOf(u),t.next=14,this.getHeight({lng:u[0],lat:u[1],alt:0},p,r);case 14:h=t.sent,i(null,h);case 16:t.next=9;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(7),l.e(t.t0);case 23:return t.prev=23,l.f(),t.finish(23);case 26:case"end":return t.stop()}}),t,this,[[7,20,23,26]])}))),function(t,e){return s.apply(this,arguments)})},{key:"sampleHeight",value:(n=o()(a.a.mark((function t(e,i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:return n=t.sent,e.alt=n[0].height,t.abrupt("return",{position:e,index:i});case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"getHeight",value:(i=o()(a.a.mark((function t(e,i,n){var o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:if(o=t.sent,e.alt=o[0].height,this.clampPositions.push({position:e,index:i}),n!==this.clampPositions.length){t.next=8;break}return s=this.startCompute(),t.abrupt("return",{total:n,current:this.clampPositions.length,total_length:s});case 8:return t.abrupt("return",{total:n,current:this.clampPositions.length});case 9:case"end":return t.stop()}}),t,this)}))),function(t,e,n){return i.apply(this,arguments)})},{key:"startCompute",value:function(){var t=this;this.clampPositions.sort((function(t,e){return t.index=500?n():i(a,o)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polyline_id,this.end_id,this.start_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),Sr(e,"destroy",this,3)([])}},{key:"end",value:function(){Sr(e,"end",this,3)([])}}],[{key:"createPolyline",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:3,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),dashLength:20})},zIndex:99999999})),e}},{key:"create_point",value:function(t,e,i){var n=e.label,o=e.image,s=void 0===o?"point.png":o,a=e.width,r=e.height,l=i.randomString(),c=i.cartesian3Towgs84(t,i.viewer);return n&&(n.pixelOffset=new Cesium.Cartesian2(0,-(r||32))),i.viewer.entities.add(new Cesium.Entity({id:l,label:n,position:Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt),billboard:{image:i.getSourceRootPath()+"/img/"+s,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:a,height:r}})),l}}]);var i,n,s}(gr);function Pr(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Mr(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Mr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Mr(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Or(this,e,[t,n])).options.color=i.options.color||"#00ffff",i.start_id="",i.end_id="",i.polyline_id="",i.clampPositions=[],i.event=new X(t),i}return sn()(e,t),_()(e,[{key:"clampToGroundMeasure",value:(s=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],this.ids.forEach((function(t,e){var i=d.viewer.entities.getById(t).position.getValue();n.push(d.cartesian3Towgs84(i,d.viewer))})),o=this.chunkLine(n,e),s=[],o.forEach((function(t,e){0===e?s=L()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),r=s.length,l=Pr(s),t.prev=7,l.s();case 9:if((c=l.n()).done){t.next=18;break}return u=c.value,p=s.indexOf(u),t.next=14,this.getHeight({lng:u[0],lat:u[1],alt:0},p,r);case 14:h=t.sent,i(null,h);case 16:t.next=9;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(7),l.e(t.t0);case 23:return t.prev=23,l.f(),t.finish(23);case 26:case"end":return t.stop()}}),t,this,[[7,20,23,26]])}))),function(t,e){return s.apply(this,arguments)})},{key:"sampleHeight",value:(n=o()(a.a.mark((function t(e,i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:return n=t.sent,e.alt=n[0].height,t.abrupt("return",{position:e,index:i});case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"getHeight",value:(i=o()(a.a.mark((function t(e,i,n){var o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:if(o=t.sent,e.alt=o[0].height,this.clampPositions.push({position:e,index:i}),n!==this.clampPositions.length){t.next=8;break}return s=this.startCompute(),t.abrupt("return",{total:n,current:this.clampPositions.length,total_length:s});case 8:return t.abrupt("return",{total:n,current:this.clampPositions.length});case 9:case"end":return t.stop()}}),t,this)}))),function(t,e,n){return i.apply(this,arguments)})},{key:"startCompute",value:function(){var t=this;this.clampPositions.sort((function(t,e){return t.index=500?n(0,o):i(a,o)}))}))}}},{key:"computeAngle",value:function(t,i){var n=this.computeDistance2([t,i]),o=Math.abs(t.alt-i.alt),s=n/Math.sqrt(n*n+o*o),a=Math.acos(s),r=this.radiansToDegrees(a),l=this.getLabel("坡度:"+r.toFixed(2)+"°");l.pixelOffset=new Cesium.Cartesian2(0,-32),this.ids.push(e.create_point(Cesium.Cartesian3.fromDegrees(i.lng,i.lat,i.alt),{label:l},this))}},{key:"destroy",value:function(){var t=this;[this.polyline_id,this.end_id,this.start_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),Tr(e,"destroy",this,3)([])}},{key:"end",value:function(){Tr(e,"end",this,3)([])}}],[{key:"createPolyline",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:3,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),dashLength:20}),zIndex:99999999}})),e}},{key:"create_point",value:function(t,e,i){var n=e.label,o=e.image,s=void 0===o?"point.png":o,a=e.width,r=e.height,l=i.randomString(),c=i.cartesian3Towgs84(t,i.viewer);return n&&(n.pixelOffset=new Cesium.Cartesian2(0,-(r||32))),i.viewer.entities.add(new Cesium.Entity({id:l,label:n,position:Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt),billboard:{image:i.getSourceRootPath()+"/img/"+s,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:a,height:r}})),l}}]);var i,n,s}(gr);function Br(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Lr(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Ar(this,e,[t,n])).options.lineColor="#ffdf53",i.polygon_id="",i}return sn()(e,t),_()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){jr(e,"start",this,3)([]),this.ids=[],this.positions=[],this.text="",this.center=new Cesium.Cartesian3,this.cachePositions=[];var i,n=0,o=0,s=function(s,a){0===t.ids.length&&(t.polygon_id=e.create_polygon(t)),t.cachePositions.push(Lr({},a)),t.ids.push(t.create_point(Lr({},a),!1));var r=t.cartesian3Towgs84(Lr({},a),t.viewer);if(r.alt>n&&(n=r.alt),t.positions=t.cachePositions.concat(Lr({},a)),t.tip.setPosition(Lr({},a),s.position.x,s.position.y),t.positions.length>2){var l=[];t.positions.forEach((function(e){var i=t.cartesian3Towgs84(e,t.viewer);l.push({lng:i.lng,lat:i.lat})}));var c=t.computeCenter(l),u=t.computeArea(l);o=u,t.center=new Cesium.Cartesian3.fromDegrees(c.lng,c.lat,n),i=t.center,t.text="投影面积:"+u+" ㎡"}};this.event.mouse_left(s),this.event.mouse_move((function(e,i){if(t.tip.setPosition(Lr({},i),e.endPosition.x,e.endPosition.y),t.positions=t.cachePositions.concat(Lr({},i)),t.positions.length>2){var o=[];t.positions.forEach((function(e){var i=t.cartesian3Towgs84(e,t.viewer);o.push({lng:i.lng,lat:i.lat})}));var s=t.computeCenter(o),a=t.computeArea(o);t.center=new Cesium.Cartesian3.fromDegrees(s.lng,s.lat,n),t.text="投影面积:"+a+" ㎡"}})),this.event.mouse_right((function(e,n){if(t.positions=t.cachePositions,t.center=i,t.positions.length<3){t.text="";console.warn("面积计算至少需要三个坐标!"),window.ELEMENT&&window.ELEMENT.Message({message:"面积计算至少需要三个坐标!",type:"warning",duration:1500}),t.destroy()}else t.text="投影面积:"+o+" ㎡";t.end()})),this.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?(t.positions=t.cachePositions,t.end()):s(o,i)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polygon_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),jr(e,"destroy",this,3)([])}},{key:"end",value:function(){jr(e,"end",this,3)([])}}],[{key:"create_polygon",value:function(t){var e=t.randomString();new Cesium.NearFarScalar(2e3,1,1e5,0),t.viewer.entities.add(new Cesium.Entity({id:e,label:{text:new Cesium.CallbackProperty((function(){return t.text}),!1),font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#ffffff"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM},position:new Cesium.CallbackProperty((function(){return t.center}),!1),polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(t.positions)}),!1),material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions.length?t.positions.concat(t.positions[0]):t.positions}),!1),width:2,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.lineColor||t.defaultColor),dashLength:20}),clampToGround:!0,zIndex:99999999}}));return e}}])}(gr);function Rr(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Fr(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=zr(this,e,[t,n])).options.lineColor="#ffdf53",i.polygon_id="",i}return sn()(e,t),_()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){Hr(e,"start",this,3)([]),this.ids=[],this.positions=[],this.text="",this.center=new Cesium.Cartesian3,this.cachePositions=[];var i=0,n=function(n,o){0===t.ids.length&&(t.polygon_id=e.create_polygon(t)),t.cachePositions.push(Fr({},o)),t.ids.push(t.create_point(Fr({},o),!1));var s=t.cartesian3Towgs84(Fr({},o),t.viewer);s.alt>i&&(i=s.alt),t.positions=t.cachePositions.concat(Fr({},o)),t.tip.setPosition(Fr({},o),n.position.x,n.position.y)},o=function(e,n){if(t.positions=t.cachePositions,t.positions.length>2){var o=[];t.positions.forEach((function(e){var i=t.cartesian3Towgs84(e,t.viewer);o.push({lng:i.lng,lat:i.lat})})),setTimeout((function(){var e=t.computeCenter(o),n=t.computeSignedArea(t.viewer,o);t.center=new Cesium.Cartesian3.fromDegrees(e.lng,e.lat,i),t.text="贴地面积:"+n+" ㎡"}),0)}else{console.warn("面积计算至少需要三个坐标!"),window.ELEMENT&&window.ELEMENT.Message({message:"面积计算至少需要三个坐标!",type:"warning",duration:1500}),t.destroy()}t.end()};this.event.mouse_left(n),this.event.mouse_move((function(e,i){t.tip.setPosition(Fr({},i),e.endPosition.x,e.endPosition.y),t.positions=t.cachePositions.concat(Fr({},i))})),this.event.mouse_right(o),this.event.gesture_pinck_start((function(e,i){var s=new Date,a={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-s>=500?o():n(a,i)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polygon_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),Hr(e,"destroy",this,3)([])}},{key:"end",value:function(){Hr(e,"end",this,3)([])}}],[{key:"create_polygon",value:function(t){var e=t.randomString();new Cesium.NearFarScalar(2e3,1,1e5,0),t.viewer.entities.add(new Cesium.Entity({id:e,label:{text:new Cesium.CallbackProperty((function(){return t.text}),!1),font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#ffffff"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM},position:new Cesium.CallbackProperty((function(){return t.center}),!1),polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(t.positions)}),!1),material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions.length?t.positions.concat(t.positions[0]):t.positions}),!1),width:2,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.lineColor||t.defaultColor),dashLength:20}),clampToGround:!0,zIndex:99999999}}));return e}}])}(gr);function Gr(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Ur(t,e,i,n){var o=ba()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Wr=function(t){function e(t){return k()(this,e),Gr(this,e,[t])}return sn()(e,t),_()(e,[{key:"cal_center",value:function(t){var e=this.cartesian3Towgs84(t[0],this.viewer),i=this.cartesian3Towgs84(t[1],this.viewer),n=this.computeCenter([e,i]);return Cesium.Cartesian3.fromDegrees(n.lng,n.lat,(e.alt+i.alt)/2)}},{key:"cal_distance",value:function(t){var e=this.cartesian3Towgs84(t[0],this.viewer),i=this.cartesian3Towgs84(t[1],this.viewer),n=this.computeDistance2([e,i]);return e.alt=e.alt.toFixed(2),i.alt=i.alt.toFixed(2),e.alt===i.alt?n:0===Number(n)?Math.abs(e.alt-i.alt).toFixed(2):Math.sqrt(n*n+Math.pow(Math.abs(e.alt-i.alt).toFixed(2),2)).toFixed(2)}},{key:"createPolyline",value:function(t){var e=this,i=this.id_map.get(t);this.viewer.entities.add(new Cesium.Entity({id:t,position:new Cesium.CallbackProperty((function(){return 2===i.positions.length?e.cal_center(i.positions):Cesium.Cartesian3()}),!1),label:{text:new Cesium.CallbackProperty((function(){return 2===i.positions.length?e.cal_distance(i.positions)+"米":"0米"}),!1),scale:1,fillColor:Cesium.Color.RED,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(0,-10),disableDepthTestDistance:Number.POSITIVE_INFINITY},polyline:{positions:new Cesium.CallbackProperty((function(){return i.positions}),!1),width:2,material:Cesium.Color.YELLOW,zIndex:99999999}})),this.ids.push(t)}},{key:"create_angle_label",value:function(t,e,i,n){var o=this,s=new Cesium.Entity({id:i,position:new Cesium.CallbackProperty((function(){return 2===t.length?o.cal_point(t,e):Cesium.Cartesian3()})),label:{text:new Cesium.CallbackProperty((function(){return 2===t.length?o.cal_angle(t,e,n)+"°":"0°"}),!1),scale:1,fillColor:Cesium.Color.RED,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(15,-10)}});this.viewer.entities.add(s)}},{key:"cal_point",value:function(t,e){for(var i=0;i=500?t.end():r(o,i)}))}))}}},{key:"end",value:function(){Ur(e,"end",this,3)([])}},{key:"destroy",value:function(){Ur(e,"destroy",this,3)([])}}])}(gr);function Yr(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Jr(t,e,i,n){var o=ba()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var qr=function(t){function e(t){var i;return k()(this,e),(i=Yr(this,e,[t,{text:""}])).defaultColor="#f11515",i.locationID=i.randomString(),i.position=new Cesium.Cartesian3,i.text="",i}return sn()(e,t),_()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){Jr(e,"start",this,3)([]),this.cache_id=e.create_point(this),e.createLocation(this);var i=function(e,i){t.position=i;var n=t.viewer.entities.getById(t.locationID);n&&(n.show=!0);var o=t.cartesian3Towgs84(i,t.viewer),s=li();if("EPSG:4326"===s)t.text="经度:".concat(Number(o.lng.toFixed(8)),"\n纬度:").concat(Number(o.lat.toFixed(8)),"\n海拔:").concat(Number(o.alt.toFixed(2)));else{var a=t.convert([{x:o.lng,y:o.lat,z:o.alt}],"EPSG:4326",s);t.text="x:".concat(Number(a.points[0].x.toFixed(8)),"\ny:").concat(Number(a.points[0].y.toFixed(8)),"\nz:").concat(Number(a.points[0].z.toFixed(2)))}t.end()};this.event.mouse_left(i),this.event.mouse_right((function(e,i){t.destroy(),t.end()})),this.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y);var n=t.viewer.entities.getById(t.locationID);n&&(n.show=!0),t.position=i;var o=t.cartesian3Towgs84(i,t.viewer),s=li();if("EPSG:4326"===s)t.text="经度:".concat(Number(o.lng.toFixed(8)),"\n纬度:").concat(Number(o.lat.toFixed(8)),"\n海拔:").concat(Number(o.alt.toFixed(2)));else{var a=t.convert([{x:o.lng,y:o.lat,z:o.alt}],"EPSG:4326",s);t.text="x:".concat(Number(a.points[0].x.toFixed(8)),"\ny:").concat(Number(a.points[0].y.toFixed(8)),"\nz:").concat(Number(a.points[0].z.toFixed(2)))}})),this.event.gesture_pinck_start((function(e,n){var o=new Date;e.position1.x,e.position2.x,e.position1.y,e.position2.y;t.event.gesture_pinck_end((function(){new Date-o>=500?(t.destroy(),t.end()):i(0,n)}))}))}}},{key:"destroy",value:function(){this.remove_entity(this.locationID),this.remove_entity(this.cache_id),Jr(e,"destroy",this,3)([])}},{key:"end",value:function(){Jr(e,"end",this,3)([])}}],[{key:"createLocation",value:function(t){t.viewer.entities.add(new Cesium.Entity({id:t.locationID,show:!1,position:new Cesium.CallbackProperty((function(){return t.position}),!1),label:{text:new Cesium.CallbackProperty((function(){return t.text}),!1),font:"22px Microsoft YaHei",fillColor:new Cesium.Color.fromCssColorString(t.defaultColor),style:Cesium.LabelStyle.FILL_AND_OUTLINE,horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,pixelOffset:new Cesium.Cartesian2(-100,-50)},billboard:{image:t.getSourceRootPath()+"/img/location.png",color:Cesium.Color.fromCssColorString("rgba(255,255,255,0.99)"),disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,width:48,height:48}}))}},{key:"create_point",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,position:new Cesium.CallbackProperty((function(){return t.position}),!1),billboard:C()({image:t.getSourceRootPath()+"/img/point.png",color:Cesium.Color.fromCssColorString("rgba(255,255,255,0.99)"),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY},"color",Cesium.Color.WHITE.withAlpha(.99))})),e}}])}(gr);function Xr(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Zr(t,e,i,n){var o=ba()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Kr=function(t){function e(t){return k()(this,e),Xr(this,e,[t,{text:"左键开始,右键取消"}])}return sn()(e,t),_()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){Zr(e,"start",this,3)([]),this.positions=[],this.position=new Cesium.Cartesian3,this.height=0,this.text="",this.circleRadius=0;var i=0;this.firstpoint=null;var n=function(n,o){if(null===t.firstpoint&&(t.positions.push(o),t.firstpoint=t.cartesian3Towgs84(o,t.viewer),t.ids.push(e.create_polygon(t)),t.ids.push(e.create_point(t,o))),i++,t.tip.setPosition(o,n.position.x,n.position.y),2===i){if(t.firstpoint){var s=t.cartesian3Towgs84(o,t.viewer);t.positions[1]=Cesium.Cartesian3.fromDegrees(t.firstpoint.lng,t.firstpoint.lat,s.alt),t.positions[2]=o,t.position=t.positions[1],t.circleRadius=t.computeDistance2([t.firstpoint,s]),t.height=Number((s.alt-t.firstpoint.alt).toFixed(2)),t.text="相对高度:"+t.height+" 米",t.tip.set_text("左键完成,右键取消;半径:"+t.circleRadius+" 米")}t.ids.push(e.create_point(t,o,{label:{text:"半径:"+t.circleRadius+" 米"}})),t.end()}};this.event.mouse_left(n),this.event.mouse_move((function(e,i){if(t.tip.setPosition(i,e.endPosition.x,e.endPosition.y),t.firstpoint){var n=t.cartesian3Towgs84(i,t.viewer);t.positions[1]=Cesium.Cartesian3.fromDegrees(t.firstpoint.lng,t.firstpoint.lat,n.alt),t.positions[2]=i,t.position=t.positions[1],t.circleRadius=t.computeDistance2([t.firstpoint,n]),t.height=Number((n.alt-t.firstpoint.alt).toFixed(2)),t.text="相对高度:"+t.height+" 米",t.tip.set_text("左键完成,右键取消;半径:"+t.circleRadius+" 米")}})),this.event.mouse_right((function(e,i){t.end(),t.destroy()})),this.event.gesture_pinck_start((function(e,i){var o=new Date,s={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-o>=500?(t.end(),t.destroy()):n(s,i)}))}))}}},{key:"end",value:function(){Zr(e,"end",this,3)([])}},{key:"destroy",value:function(){Zr(e,"destroy",this,3)([])}}],[{key:"create_polygon",value:function(t){var e=t.randomString();t.viewer.entities.add(new Cesium.Entity({id:e,billboard:{image:t.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)},position:new Cesium.CallbackProperty((function(){return t.position}),!1),label:{text:new Cesium.CallbackProperty((function(){return t.text}),!1),scale:1,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(0,-15),disableDepthTestDistance:Number.POSITIVE_INFINITY},polyline:{positions:new Cesium.CallbackProperty((function(e){return t.positions}),!1),width:2,material:Cesium.Color.YELLOW,zIndex:99999999},ellipse:{height:new Cesium.CallbackProperty((function(){return t.height+t.firstpoint.alt}),!1),semiMinorAxis:new Cesium.CallbackProperty((function(e){return t.circleRadius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(e){return t.circleRadius}),!1),material:new Cesium.Color.fromCssColorString(t.defaultColor)}}));return e}},{key:"create_point",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.randomString(),o=t.cartesian3Towgs84(e,t.viewer),s={id:n,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}};return i.label&&(s.label={text:i.label.text,scale:1,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(0,-15)}),t.viewer.entities.add(new Cesium.Entity(s)),n}}])}(gr);function $r(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Qr(t,e,i,n){var o=ba()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var tl=function(t){function e(t){var i;return k()(this,e),(i=$r(this,e,[t,{text:"左键开始,右键取消"}])).cachePositions=[],i.positions=[],i.arcPositions=[],i.line_id="",i.label_id="",i.arc_id="",i.bearing=0,i}return sn()(e,t),_()(e,[{key:"createPolyline",value:function(){var t=this,e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999}})),e}},{key:"end",value:function(){Qr(e,"end",this,3)([])}},{key:"destroy",value:function(){var t=this;Qr(e,"destroy",this,3)([]),[this.line_id,this.label_id,this.arc_id].forEach((function(e){e&&t.remove_entity(e)}))}},{key:"cancel",value:function(){this.end(),this.destroy()}},{key:"caculateAngle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=this.cartesian3Towgs84(t[0],this.viewer),i=this.cartesian3Towgs84(t[1],this.viewer),n=this.cartesian3Towgs84(t[2],this.viewer),o=turf.point([e.lng,e.lat]),s=turf.point([i.lng,i.lat]),a=turf.point([n.lng,n.lat]),r={units:"kilometers"},l=turf.rhumbDistance(o,s,r),c=turf.rhumbDistance(a,s,r),u=l;l>c&&(u=c);var p=turf.rhumbBearing(o,s),h=turf.rhumbBearing(a,s),d=Math.abs((p-h+360)%360);this.bearing=d>180?360-d:d,this.bearing=this.bearing.toFixed(2);var m=p-180,f=h-180,v=turf.lineArc(s,u/3,f,m);d>180&&(v=turf.lineArc(s,u/3,m,f));for(var g=[],y=0;y2&&t.caculateAngle([t.positions[0],t.positions[1],t.positions[2]])})),this.event.mouse_right((function(e,i){t.cancel()})),this.event.gesture_pinck_start((function(e,n){var o=new Date,s={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-o>=500?t.cancel():i(s,n)}))}))}}}])}(gr);function el(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function il(t,e,i,n){var o=ba()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var nl=function(t){function e(t){var i;return k()(this,e),(i=el(this,e,[t,{text:"左键开始,右键取消"}])).cachePositions=[],i.positions=[],i.arcPositions=[],i.line_id="",i.label_id="",i.arc_id="",i.bearing=0,i}return sn()(e,t),_()(e,[{key:"createPolyline",value:function(){var t=this,e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999}})),e}},{key:"end",value:function(){il(e,"end",this,3)([])}},{key:"destroy",value:function(){var t=this;il(e,"destroy",this,3)([]),[this.line_id,this.label_id,this.arc_id].forEach((function(e){e&&t.remove_entity(e)}))}},{key:"cancel",value:function(){this.end(),this.destroy()}},{key:"caculateAngle",value:function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=this.cartesian3Towgs84(t[1],this.viewer),i=this.cartesian3Towgs84(t[0],this.viewer),n=turf.point([e.lng,e.lat]),o=turf.point([i.lng,i.lat]),s=this.rhumbBearing(i,e);this.bearing=(180+s).toFixed(2);for(var a=turf.rhumbDistance(n,o,{units:"kilometers"}),r=turf.lineArc(n,a/3,0,this.bearing),l=[],c=0;c2&&t.caculateAngle([t.positions[0],t.positions[1]],[t.positions[2],t.positions[1]]),!(t.ids.length>=2)){e.next=9;break}return t.end(),e.abrupt("return");case 9:if(t.ids.push(t.create_point(n)),t.ids.push(t.create_point(n)),2!==t.ids.length){e.next=20;break}return t.label_id=Cesium.createGuid(),t.arc_id=Cesium.createGuid(),d=t.cartesian3Towgs84(n,t.viewer),e.next=17,t.sampleHeightMostDetailed([d]);case 17:m=e.sent,t.viewer.entities.add({id:t.arc_id,polyline:{positions:new Cesium.CallbackProperty((function(){return t.arcPositions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999}}),t.viewer.entities.add({id:t.label_id,position:Cesium.Cartesian3.fromDegrees(d.lng,d.lat,(m[0].height||0)+.1),label:{text:new Cesium.CallbackProperty((function(){return"方位夹角:"+t.bearing+"°"}),!1),font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#f1e605"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}});case 20:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}();this.event.mouse_left(i),this.event.mouse_move((function(e,i){if(t.tip.setPosition(i,e.endPosition.x,e.endPosition.y),t.cachePositions.length){var n;t.positions=t.cachePositions.concat(i);var o=t.cartesian3Towgs84(i,t.viewer),s=t.cartesian3Towgs84(t.positions[1],t.viewer),a=turf.point([s.lng,s.lat]),r=turf.point([o.lng,o.lat]),l={units:"kilometers"},c=turf.rhumbDistance(a,r,l),u=turf.destination(a,c,0,l);t.positions[0]=(n=Cesium.Cartesian3).fromDegrees.apply(n,L()(u.geometry.coordinates))}t.positions.length>2&&t.caculateAngle([t.positions[0],t.positions[1]],[t.positions[2],t.positions[1]])})),this.event.mouse_right((function(e,i){t.cancel()})),this.event.gesture_pinck_start((function(e,n){var o=new Date,s={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-o>=500?t.cancel():i(s,n)}))}))}}}])}(gr);function ol(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var sl=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,e),(i=ol(this,e,[t,n])).options.curve=n.curve||!1;var o=Number(n.number);return isNaN(o)?i.options.number=1/0:i.options.number=o<2?2:o,i}return sn()(e,t),_()(e,[{key:"smoothHandle",value:function(t){if(t.length>1){for(var e=[],i=[],n=0;n=r.options.number){var s,a=[];if(c.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))})),r.options.curve){var u=r.smoothHandle(c);s=[];for(var p=0;p1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(cartesian))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500){var s,a=[];if(c.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))})),r.options.curve){var l=r.smoothHandle(c);s=[];for(var u=0;u1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(cartesian))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500){var s,a=[];if(c.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))})),r.options.curve){var l=r.smoothHandle(c);s=[];for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.entityHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polyline:{positions:new Cesium.CallbackProperty((function(){return t.options.curve?t.smoothHandle(t.positions):t.positions}),!1),width:5,material:Cesium.Color.fromCssColorString(t.color),clampToGround:!0,zIndex:99999999}})),i}}])}(wa);function al(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function rl(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=ll(this,e,[t,n])).polygonHasCreated=!1,i.rectObject=[],i}return sn()(e,t),_()(e,[{key:"computedLastPoint",value:function(t){var e=t[0],i=t[1],n=Cesium.Cartesian3.subtract(i,e,new Cesium.Cartesian3),o=Cesium.Cartesian3.subtract(t[2],e,new Cesium.Cartesian3),s=Cesium.Cartesian3.dot(o,n)/Cesium.Cartesian3.magnitudeSquared(n),a=Cesium.Cartesian3.multiplyByScalar(n,s,new Cesium.Cartesian3),r=Cesium.Cartesian3.add(e,a,new Cesium.Cartesian3),l=Cesium.Cartesian3.distance(t[2],r),c=Cesium.Cartesian3.subtract(t[2],r,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(c,c);var u=Cesium.Cartesian3.multiplyByScalar(c,l,new Cesium.Cartesian3),p=Cesium.Cartesian3.add(i,u,new Cesium.Cartesian3),h=Cesium.Cartesian3.add(e,u,new Cesium.Cartesian3);return[rl({},p),rl({},h)]}},{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l;this.polygonHasCreated=!1,(i=e,n="start",o=this,s=3,a=ba()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new X(this.sdk);var c=0;this.positions=[],this.positionsLine=[],this.points_ids=[];var u=[],p=[];this.event.mouse_left((function(i,n){if("2D"!==l){if(l="3D",c++,r.positions=u.concat(rl({},n)),r.tip.setPosition(n,i.position.x,i.position.y),!r.polygonHasCreated){var o=e.create_polygon(r);r.points_ids.push(o)}u.push(n),p.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n)),3==c&&(r.end(),t(null,r.rectObject))}})),this.event.mouse_right((function(e,i){"2D"!==l&&(r.end(),t("取消",""))})),this.event.mouse_move((function(t,e){if("2D"!==l&&(r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),2==c)){var i=JSON.parse(JSON.stringify(u)),n=i.concat(rl({},e)),o=r.computedLastPoint(n);i=i.concat(o),r.positions=i;var s=i.map((function(t){return r.cartesian3Towgs84(t,r.viewer)}));r.rectObject=s}})),this.event.mouse_right_keyboard_ctrl((function(t,e){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),u.pop(),p.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),u.pop(),p.pop(),r.positions=u.concat(cartesian))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)t(null,p),r.end();else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),!r.polygonHasCreated){var s=e.create_polygon(r);r.points_ids.push(s)}u.push(n),p.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n)),r.positions=u.concat(n)}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(i,n){if("3D"!==l){if(l="2D",c++,r.positions=u.concat(rl({},n)),r.tip.setPosition(n,i.position.x+r.viewer.canvas.width,i.position.y),!r.polygonHasCreated){var o=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(o)}u.push(n),p.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),3==c&&(r.end(),t(null,r.rectObject))}})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(r.end(),t("取消",""))})),this.event2D.mouse_move((function(t,e){if("3D"!==l&&(r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y),2==c)){var i=JSON.parse(JSON.stringify(u)),n=i.concat(rl({},e)),o=r.computedLastPoint(n);i=i.concat(o),r.positions=i;var s=i.map((function(t){return r.cartesian3Towgs84(t,r.viewer)}));r.rectObject=s}})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),u.pop(),p.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),u.pop(),p.pop(),r.positions=u.concat(cartesian))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)t(null,p),r.end();else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),!r.polygonHasCreated){var s=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(s)}u.push(n),p.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),r.positions=u.concat(n)}}))}})))}}}],[{key:"create_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.polygonHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(t.positions)})),material:Cesium.Color.fromCssColorString(t.color),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(e){return t.positions.concat(t.positions[0])})),width:2,material:Cesium.Color.fromCssColorString("#c1c505").withAlpha(.5),clampToGround:!0,zIndex:99999999}})),i}}])}(wa);function ul(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var pl=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return k()(this,e),ul(this,e,[t,i,n])}return sn()(e,t),_()(e,[{key:"start",value:function(t){var e=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var i=void 0;YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键结束;",this.sdk),this.event=new X(this.sdk),this.event.mouse_left((function(n,o){e.end();var s=e.cartesian3Towgs84(i||o,e.viewer);t(null,s,Cesium)})),this.event.mouse_right((function(i,n){e.end(),t(!1)})),this.event.mouse_move((function(t,n){i=n,e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.gesture_pinck_start((function(n,o){var s=new Date;e.event.gesture_pinck_end((function(){if(new Date-s>=500)e.end(),t(!1);else{e.end();var n=e.cartesian3Towgs84(i||o,e.viewer);t(null,n)}}))})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(n,o){e.end();var s=e.cartesian3Towgs84(i||o,e.viewer);t(null,s,Cesium)})),this.event2D.mouse_right((function(i,n){e.end(),t(!1)})),this.event2D.mouse_move((function(t,n){i=n,e.tip.setPosition(n,t.endPosition.x+e.viewer.canvas.width,t.endPosition.y)})),this.event2D.gesture_pinck_start((function(n,o){var s=new Date;e.event2D.gesture_pinck_end((function(){if(new Date-s>=500)e.end(),t(!1);else{e.end();var n=e.cartesian3Towgs84(i||o,e.viewer);t(null,n)}}))})))}}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy(),this.tip&&this.tip.destroy()}}])}(wa);function hl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var dl=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),hl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l,c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g.viewer;t.entities.add(new Cesium.Entity({id:g.circle_id,position:new Cesium.CallbackProperty((function(t){if(v){var e=g.computeMidpoint(f,v);return Cesium.Cartesian3.fromDegrees(e.lng,e.lat,v.alt)}return Cesium.Cartesian3()}),!1),label:{text:new Cesium.CallbackProperty((function(t){return d>1e3?"半径:"+(d/1e3).toFixed(2)+" 公里":"半径:"+d+" 米"}),!1),font:"20px Microsoft YaHei",disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,fillColor:Cesium.Color.fromCssColorString("#f5ce0a"),style:Cesium.LabelStyle.FILL_AND_OUTLINE},polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(t){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(m))}),!1),material:Cesium.Color.fromCssColorString(g.color),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(t){return p}),!1),width:2,material:Cesium.Color.fromCssColorString("#c1c505").withAlpha(.5),clampToGround:!0,zIndex:99999999}}))};(i=e,n="start",o=this,s=3,a=ba()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键开始,右键取消",this.sdk),this.event=new X(this.sdk);var u=0;this.circle_id=this.randomString();var p=[],h=[],d=1,m=[],f={},v=null;this.event.mouse_left((function(e,i){"2D"!==l&&(l="3D",r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i),f=r.cartesian3Towgs84(i,r.viewer),m=r.createCircle(f,.01),h.push(i),c()),2===u&&(p=h.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),t(null,{center:f,radius:Number(d)})))})),this.event.mouse_right((function(e,i){"2D"!==l&&(r.end(),t(!1))})),this.event.mouse_move((function(t,e){"2D"!==l&&(r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),u&&(p=h.concat(e),v=r.cartesian3Towgs84(e,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d)))})),this.event.gesture_pinck_start((function(e,i){if("2D"!==l){var n=new Date;r.event.gesture_pinck_end((function(){new Date-n>=500?(r.end(),t(!1)):(r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i),f=r.cartesian3Towgs84(i,r.viewer),h.push(i),c(),r.tip.setPosition(i,(e.position1.x+e.position2.x)/2,(e.position1.y+e.position2.y)/2)),2===u&&(p=h.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),t(null,{center:f,radius:Number(d)})))}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,i){"3D"!==l&&(l="2D",r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i,r._sdk2D.viewer),f=r.cartesian3Towgs84(i,r.viewer),m=r.createCircle(f,.01),h.push(i),c(r._sdk2D.viewer)),2===u&&(p=h.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),t(null,{center:f,radius:Number(d)})))})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(r.end(),t(!1))})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y),u&&(p=h.concat(e),v=r.cartesian3Towgs84(e,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d)))})),this.event2D.gesture_pinck_start((function(e,i){if("3D"!==l){var n=new Date;r.event2D.gesture_pinck_end((function(){new Date-n>=500?(r.end(),t(!1)):(r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i,r._sdk2D.viewer),f=r.cartesian3Towgs84(i,r.viewer),h.push(i),c(r._sdk2D.viewer),r.tip.setPosition(i,(e.position1.x+e.position2.x)/2+r.viewer.canvas.width,(e.position1.y+e.position2.y)/2)),2===u&&(p=h.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),t(null,{center:f,radius:Number(d)})))}))}})));var g=this}}},{key:"end",value:function(){this.remove_entity(this.circle_id),this.remove_entity(this.point_id),YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy()}}])}(wa);function ml(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var fl=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),ml(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l,c=function(){var t=Cesium.Cartesian3.fromDegrees(m[0].lng,m[0].lat),e=Cesium.Cartesian3.fromDegrees(m[1].lng,m[1].lat),i=Cesium.Cartesian3.fromDegrees(m[2].lng,m[2].lat);if(1===p){g=Cesium.Cartesian3.distance(t,e),f=(v=g)/2;var n={x:h.lng,y:h.lat},o={x:m[1].lng,y:m[1].lat},s=Math.PI/180,a=n.y*s,r=o.y*s,l=n.x*s,c=o.x*s,u=Math.sin(c-l)*Math.cos(r),d=Math.cos(a)*Math.sin(r)-Math.sin(a)*Math.cos(r)*Math.cos(c-l),C=Math.atan2(u,d)%(2*Math.PI);b=450-(180*C/Math.PI<0?360+180*C/Math.PI:180*C/Math.PI)}if(2===p){Cesium.Cartesian3.distance(t,i),y=Cesium.Cartesian3.distance(e,i);var w=turf.point([m[0].lng,m[0].lat]),k=turf.point([m[1].lng,m[1].lat]),x=turf.point([m[2].lng,m[2].lat]),_=turf.rhumbBearing(w,k),E=turf.rhumbBearing(k,x),S=Math.abs(_-E),D=S>180?360-S:S;D=180-D,f=y*Math.sin(Cesium.Math.toRadians(D))}},u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:C.viewer;t.entities.add(new Cesium.Entity({id:C.elliptic_id,position:Cesium.Cartesian3.fromDegrees(h.lng,h.lat),ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(t){return f}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(t){return v}),!1),granularity:Cesium.Math.toRadians(.1),rotation:new Cesium.CallbackProperty((function(t){return Cesium.Math.toRadians(b)}),!1),material:Cesium.Color.fromCssColorString(C.color),zIndex:99999999}}))};(i=e,n="start",o=this,s=3,a=ba()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),this.entity_ids=[],YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键开始,右键取消",this.sdk),this.event=new X(this.sdk);var p=0;this.elliptic_id=this.randomString();var h,d=[],m=[],f=0,v=0,g=0,y=0,b=0;this.event.mouse_left((function(e,i){if("2D"!==l){if(l="3D",r.tip.set_text("再次左键,完成绘制;右键取消"),p++,r.points_ids.push(r.create_point(i)),d.push(i),1===p){d=[i,i,i];var n=r.cartesian3Towgs84(i,r.viewer);h=n,m=[n,n,n],c(),u()}if(2===p){d[1]=i,d[2]=i;var o=r.cartesian3Towgs84(i,r.viewer);m[1]=o,m[2]=o}p>=3&&(r.end(),t(null,{center:h,bearing:b,semiMajorAxis:v,semiMinorAxis:f}))}})),this.event.mouse_right((function(e,i){"2D"!==l&&(r.end(),t(!1))})),this.event.mouse_move((function(t,e){"2D"!==l&&(r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),d[p]=e,m[p]=r.cartesian3Towgs84(e,r.viewer),0!==p&&c())})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,i){if("3D"!==l){if(l="2D",r.tip.set_text("再次左键,完成绘制;右键取消"),p++,r.points_ids.push(r.create_point(i,r._sdk2D.viewer)),d.push(i),1===p){d=[i,i,i];var n=r.cartesian3Towgs84(i,r.viewer);h=n,m=[n,n,n],c(),u(r._sdk2D.viewer)}if(2===p){d[1]=i,d[2]=i;var o=r.cartesian3Towgs84(i,r.viewer);m[1]=o,m[2]=o}p>=3&&(r.end(),t(null,{center:h,bearing:b,semiMajorAxis:v,semiMinorAxis:f}))}})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(r.end(),t(!1))})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y),d[p]=e,m[p]=r.cartesian3Towgs84(e,r.viewer),0!==p&&c())})));var C=this}}},{key:"end",value:function(){var t=this;this.remove_entity(this.elliptic_id),this.points_ids.forEach((function(e){t.remove_entity(e)})),YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy()}}])}(wa);function vl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var gl=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),vl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l;(i=e,n="start",o=this,s=3,a=ba()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var c=[],u=!1;this.event.mouse_left((function(t,i){if("2D"!==l){l="3D";var n=r.cartesian3Towgs84(i,r.viewer),o=c[c.length-1];if(!o||o.lng!==n.lng||o.lat!==n.lat){if(!r.entityHasCreated){var s=e.create_arrow_polygon(r);r.points_ids.push(s)}r.points_ids.push(r.create_point(i)),c.push(n),u=!1}}})),this.event.mouse_right((function(e,i){if("2D"!==l){var n=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){n.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),u&&r.positions.pop(),t(null,r.positions,n)}})),this.event.mouse_move((function(t,e){"2D"!==l&&(u=!0,r.positions=c.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x,t.endPosition.y))})),this.event.mouse_right_keyboard_ctrl((function(t,e){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500){var s=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,r.positions,s)}else{if(!r.entityHasCreated){var a=e.create_arrow_polygon(r);r.points_ids.push(a)}r.points_ids.push(r.create_point(n)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2)}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(t,i){if("3D"!==l){if(l="2D",!r.entityHasCreated){var n=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(n)}r.points_ids.push(r.create_point(i,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(i,r.viewer)),u=!1}})),this.event2D.mouse_right((function(e,i){if("3D"!==l){var n=[];if(r.points_ids.length>2)r.event2D.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){n.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),u&&r.positions.pop(),t(null,r.positions,n)}})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(u=!0,r.positions=c.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y))})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500){var s=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,r.positions,s)}else{if(!r.entityHasCreated){var a=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(a)}r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2)}}))}})))}}}],[{key:"create_arrow_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.entityHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){for(var i=t.computeAttackArrow(t.positions),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),yl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l;(i=e,n="start",o=this,s=3,a=ba()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键取消;CTRL+右键撤销",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var c=[];this.event.mouse_left((function(i,n){if("2D"!==l){if(l="3D",!r.entityHasCreated){var o=e.create_arrow_polygon(r);r.points_ids.push(o)}if(r.points_ids.push(r.create_point(n)),c.push(r.cartesian3Towgs84(n,r.viewer)),5===c.length){var s=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,c,s)}}})),this.event.mouse_right((function(e,i){"2D"!==l&&(r.end(),t("取消绘制"))})),this.event.mouse_move((function(t,e){"2D"!==l&&(r.positions=c.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x,t.endPosition.y))})),this.event.mouse_right_keyboard_ctrl((function(t,e){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(r.cartesian3Towgs84(cartesian,r.viewer)))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)r.end(),t("取消绘制");else{if(!r.entityHasCreated){var s=e.create_arrow_polygon(r);r.points_ids.push(s)}if(r.points_ids.push(r.create_point(n)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),5===c.length){var a=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,c,a)}}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(i,n){if("3D"!==l){if(l="2D",!r.entityHasCreated){var o=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(o)}if(r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(n,r.viewer)),5===c.length){var s=[];if(r.points_ids.length>2)r.event2D.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,c,s)}}})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(r.end(),t("取消绘制"))})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(r.positions=c.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y))})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(r.cartesian3Towgs84(cartesian,r.viewer)))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)r.end(),t("取消绘制");else{if(!r.entityHasCreated){var s=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(s)}if(r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),5===c.length){var a=[];if(r.points_ids.length>2)r.event2D.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,c,a)}}}))}})))}}}],[{key:"create_arrow_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.entityHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){for(var i=t.computePincerArrow(t.positions),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Cl(this,e,[t,n])).points=null,i.polygonHasCreated=!1,i}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var n;wl(e,"start",this,3)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键取消;",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var o=[];this.anchorpoints=[],this.event.mouse_left((function(e,s){if("2D"!==n&&(n="3D",s&&i.anchorpoints[0]!==s)){i.anchorpoints.push(s);var a=i.cartesian3Towgs84(s,i.viewer);if(a.lng=Number(a.lng.toFixed(8)),a.lat=Number(a.lat.toFixed(8)),(!o[0]||a.lng!==o[0].lng||a.lat!==o[0].lat)&&(o.push(a),i.positions.push(a),i.points_ids.push(i.create_point(s)),2===i.points_ids.length)){var r=[o[0],o[1]];t(null,r),i.end()}}})),this.event.mouse_move((function(t,o){if("2D"!==n&&(i.tip.setPosition(o,t.endPosition.x,t.endPosition.y),o&&0!==i.points_ids.length)){var s=i.cartesian3Towgs84(o,i.viewer);i.positions=[i.positions[0],s],1!==i.points_ids.length||Cesium.defined(i.arrowPolygon)||(i.arrowPolygon=e.polygon(i))}})),this.event.mouse_right((function(e,o){"2D"!==n&&(t(null),i.end())})),this.event.gesture_pinck_start((function(s,a){if("2D"!==n){var r=new Date;i.event.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),t(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),t(null,i.positions),i.end();else{if(!a||Cesium.defined(i.arrowPolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.arrowPolygon=e.polygon(i),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a))}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,s){if("3D"!==n&&(n="2D",s&&i.anchorpoints[0]!==s)){i.anchorpoints.push(s);var a=i.cartesian3Towgs84(s,i.viewer);if(a.lng=Number(a.lng.toFixed(8)),a.lat=Number(a.lat.toFixed(8)),(!o[0]||a.lng!==o[0].lng||a.lat!==o[0].lat)&&(o.push(a),i.positions.push(a),i.points_ids.push(i.create_point(s,i._sdk2D.viewer)),2===i.points_ids.length)){var r=[o[0],o[1]];t(null,r),i.end()}}})),this.event2D.mouse_move((function(t,o){if("3D"!==n&&(i.tip.setPosition(o,t.endPosition.x+i.viewer.canvas.width,t.endPosition.y),o&&0!==i.points_ids.length)){var s=i.cartesian3Towgs84(o,i.viewer);i.positions=[i.positions[0],s],1!==i.points_ids.length||Cesium.defined(i.arrowPolygon)||(i.arrowPolygon=e.polygon(i,i._sdk2D.viewer))}})),this.event2D.mouse_right((function(e,o){"3D"!==n&&(t(null),i.end())})),this.event2D.gesture_pinck_start((function(s,a){if("3D"!==n){var r=new Date;i.event2D.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),t(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),t(null,i.positions),i.end();else{if(!a||Cesium.defined(i.arrowPolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2+i.viewer.canvas.width,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.arrowPolygon=e.polygon(i,i._sdk2D.viewer),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a,i._sdk2D.viewer))}}))}})))}}},{key:"end",value:function(){wl(e,"end",this,3)([]),this.viewer.entities.remove(this.arrowPolygon),!this._is2D&&this._sdk2D&&this._sdk2D.viewer.entities.remove(this.arrowPolygon)}}],[{key:"polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer,i=t.randomString();return e.entities.add(new Cesium.Entity({name:"ArrowPolygon",id:i,polygon:{hierarchy:new Cesium.CallbackProperty((function(e){for(var i=t.computeStraightArrow(t.positions),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=xl(this,e,[t,n])).rhumb=n.rhumb,i.polygonHasCreated=!1,i.rect=[],i.rectObj=[],i.entity=null,i}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this,l=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var c;(i=e,n="start",o=this,s=3,a=ba()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键取消",l.sdk),this.event=new X(l.sdk),this.positions=[],this.points_ids=[];var u=0,p=null,h=null;this.event.mouse_left((function(i,n){if("2D"!==c){c="3D",u++;var o=r.cartesian3Towgs84(n,r.viewer);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var s=e.create_polygon(r);r.points_ids.push(s),p=o}2==u&&(h=o,r.end(),t(null,l.rectObj,[p,h]))}})),this.event.mouse_right((function(e,i){"2D"!==c&&(r.end(),t("取消",""))})),this.event.mouse_move((function(t,e){if("2D"!==c&&(r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),1==u)){var i=r.cartesian3Towgs84(e,r.viewer);r.calrect(p,i)}})),this.event.gesture_pinck_start((function(i,n){if("2D"!==c){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)t("取消",""),r.end();else{r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),u++;var s=r.cartesian3Towgs84(n);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var a=e.create_polygon(r);r.points_ids.push(a),p=s}2==u&&(r.calrect(p,s),h=s,r.end(),t(null,l.rectObj,[p,h]))}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(i,n){if("3D"!==c){c="2D",u++;var o=r.cartesian3Towgs84(n,r.viewer);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var s=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(s),p=o}2==u&&(h=o,r.end(),t(null,l.rectObj,[p,h]))}})),this.event2D.mouse_right((function(e,i){"3D"!==c&&(r.end(),t("取消",""))})),this.event2D.mouse_move((function(t,e){if("3D"!==c&&(r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y),1==u)){var i=r.cartesian3Towgs84(e,r.viewer);r.calrect(p,i)}})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==c){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)t("取消",""),r.end();else{r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),u++;var s=r.cartesian3Towgs84(n);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var a=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(a),p=s}2==u&&(r.calrect(p,s),h=s,r.end(),t(null,l.rectObj,[p,h]))}}))}})))}}},{key:"calrect",value:function(t,e){var i,n=[],o=[],s=[];if(n.push([t.lng,t.lat,t.alt],[e.lng,e.lat,e.alt]),2===n.length){var a=turf.lineString(n),r=turf.bbox(a);i=turf.bboxPolygon(r)}i&&(i.geometry.coordinates[0].forEach((function(e){o.push(e[0]),o.push(e[1]);var i={lng:e[0],lat:e[1],alt:t.alt};s.push(i)})),this.rect=[].concat(o),this.rectObj=[].concat(s),this.rectObj.pop())}}],[{key:"create_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer,i=t.randomString();return e.entities.add(this.entity=new Cesium.Entity({id:i,polygon:{hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(t.rect))}),!1),material:Cesium.Color.fromCssColorString(t.color),arcType:t.rhumb?Cesium.ArcType.RHUMB:Cesium.ArcType.GEODESIC,zIndex:99999999}})),i}}])}(wa);function El(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Sl(t,e,i,n){var o=ba()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Dl=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=El(this,e,[t,n])).points=null,i.polygonHasCreated=!1,i}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var n;Sl(e,"start",this,3)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键取消;",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var o=[];this.anchorpoints=[],this.event.mouse_left((function(e,s){if("2D"!==n&&(n="3D",s&&(3===i.anchorpoints.length?i.anchorpoints[1]=s:i.anchorpoints.push(s),o.push(i.cartesian3Towgs84(s,i.viewer)),i.points_ids.push(i.create_point(s)),3===i.points_ids.length))){var a=[o[0],o[2],o[1]];t(null,a),i.end()}})),this.event.mouse_move((function(t,s){if("2D"!==n&&(i.tip.setPosition(s,t.endPosition.x,t.endPosition.y),s&&0!==i.points_ids.length))if(o.length>1?i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer),o[1]]:i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer)],1!==i.points_ids.length||Cesium.defined(i.assemblePolygon)||(i.assemblePolygon=e.polygon(i)),i.anchorpoints.length>=2){if(1===i.points_ids.length){var a=new Array;i.positions.forEach((function(t){a.push([t.lng,t.lat])}));var r=P.PlotUtils.mid(a[0],a[1]),l=P.PlotUtils.distance(a[0],r)/.9,c=P.PlotUtils.getThirdPoint(a[0],r,P.Constants.HALF_PI,l,!0);i.positions=[i.positions[0],{lng:c[0],lat:c[1]},i.positions[1]]}i.anchorpoints[1]=s}else i.anchorpoints.push(s)})),this.event.mouse_right((function(e,o){"2D"!==n&&(t(null),i.end())})),this.event.gesture_pinck_start((function(s,a){if("2D"!==n){var r=new Date;i.event.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),t(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),t(null,i.positions),i.end();else{if(!a||Cesium.defined(i.assemblePolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.assemblePolygon=e.polygon(i),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a))}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,s){if("3D"!==n&&(n="2D",s&&(3===i.anchorpoints.length?i.anchorpoints[1]=s:i.anchorpoints.push(s),o.push(i.cartesian3Towgs84(s,i.viewer)),i.points_ids.push(i.create_point(s,i._sdk2D.viewer)),3===i.points_ids.length))){var a=[o[0],o[2],o[1]];t(null,a),i.end()}})),this.event2D.mouse_move((function(t,s){if("3D"!==n&&(i.tip.setPosition(s,t.endPosition.x+i.viewer.canvas.width,t.endPosition.y),s&&0!==i.points_ids.length))if(o.length>1?i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer),o[1]]:i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer)],1!==i.points_ids.length||Cesium.defined(i.assemblePolygon)||(i.assemblePolygon=e.polygon(i,i._sdk2D.viewer)),i.anchorpoints.length>=2){if(1===i.points_ids.length){var a=new Array;i.positions.forEach((function(t){a.push([t.lng,t.lat])}));var r=P.PlotUtils.mid(a[0],a[1]),l=P.PlotUtils.distance(a[0],r)/.9,c=P.PlotUtils.getThirdPoint(a[0],r,P.Constants.HALF_PI,l,!0);i.positions=[i.positions[0],{lng:c[0],lat:c[1]},i.positions[1]]}i.anchorpoints[1]=s}else i.anchorpoints.push(s)})),this.event2D.mouse_right((function(e,o){"3D"!==n&&(t(null),i.end())})),this.event2D.gesture_pinck_start((function(s,a){if("3D"!==n){var r=new Date;i.event2D.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),t(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),t(null,i.positions),i.end();else{if(!a||Cesium.defined(i.assemblePolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2+i.viewer.canvas.width,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.assemblePolygon=e.polygon(i,i._sdk2D.viewer),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a,i._sdk2D.viewer))}}))}})))}}},{key:"end",value:function(){Sl(e,"end",this,3)([]),this.viewer.entities.remove(this.assemblePolygon),!this._is2D&&this._sdk2D&&this._sdk2D.viewer.entities.remove(this.assemblePolygon)}},{key:"calculateVector",value:function(t,e,i){var n,o,s,a,r,l;e||(e=Math.PI/2),i||(i=1);var c=Math.sqrt(t.x*t.x+t.y*t.y);if(0==t.y)n=o=c*i*Math.cos(e)/t.x,t.x>0?a=-(s=Math.sqrt(i*i-n*n)):t.x<0&&(s=-(a=Math.sqrt(i*i-n*n))),r={x:n,y:s},l={x:o,y:a};else{var u=-t.x/t.y,p=i*c*Math.cos(e)/t.y,h=1+u*u,d=2*u*p,m=p*p-i*i;s=u*(n=(-d-Math.sqrt(d*d-4*h*m))/(2*h))+p,a=u*(o=(-d+Math.sqrt(d*d-4*h*m))/(2*h))+p,t.y>=0?(r={x:n,y:s},l={x:o,y:a}):t.y<0&&(r={x:o,y:a},l={x:n,y:s})}return[r,l]}},{key:"createCloseCardinal",value:function(t){if(null==t||t.length<3)return t;var e=t[0];t.push(e);for(var i=t,n=[],o=.4,s=i.length-1,a=0;a<=s-1;a++){var r=void 0,l=void 0,c=void 0;a==s-1?(r=i[s-1],l=i[0],c=i[1]):(r=i[a],l=i[a+1],c=i[a+2]);var u={x:void 0,y:void 0},p={x:void 0,y:void 0},h={x:l.x-r.x,y:l.y-r.y},d={x:c.x-l.x,y:c.y-l.y},m=Math.sqrt(h.x*h.x+h.y*h.y),f=Math.sqrt(d.x*d.x+d.y*d.y),v={x:h.x/m,y:h.y/m},g={x:d.x/f,y:d.y/f},y={x:v.x+g.x,y:v.y+g.y},b=Math.sqrt(y.x*y.x+y.y*y.y),C={x:y.x/b,y:y.y/b},w=(v.x*g.x+v.y*g.y)/1;Math.abs(1-w)<.005?(u.x=l.x-g.x*m*o,u.y=l.y-g.y*m*o,p.x=l.x+v.x*f*o,p.y=l.y+v.y*f*o):(u.x=l.x-C.x*m*o,u.y=l.y-C.y*m*o,p.x=l.x+C.x*f*o,p.y=l.y+C.y*f*o),a==s-1?(n[0]=l,n[1]=p,n[3*(s-2)+2+3]=u,n[3*(s-2)+2+4]=i[s]):(n[3*a+2+0]=u,n[3*a+2+1]=l,n[3*a+2+2]=p)}return n}},{key:"calculatePointsFBZ3",value:function(t,e){e||(e=20);var i=[],n=.05;e>0&&(n=1/e);for(var o=0;o=t.length&&i.push(s)}return i}}],[{key:"polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer,i=t.randomString();return e.entities.add(new Cesium.Entity({name:"AssemblePolygon",id:i,polygon:{hierarchy:new Cesium.CallbackProperty((function(e){for(var i=t.computeAssemble(t.positions),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),Pl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r,l=this,c=this;YJ.Measure.GetMeasureStatus()?t("上一次测量未结束"):((n=e,o="start",s=this,a=3,r=ba()(nn()(1&a?n.prototype:n),o,s),2&a&&"function"==typeof r?function(t){return r.apply(s,t)}:r)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确认,右键取消",c.sdk),this.event=new X(c.sdk),this._sector_id=null,this._positions=[],this.points_ids=[],this.radius_points=[],this._entities_sector=[],this._radius=0,this._startAngle=0,this._endAngle=0,this.event.mouse_left((function(e,n){if("2D"!==i&&(i="3D",l._positions.length<3?(l.points_ids.push(l.create_point(n)),l._positions.push(l.cartesian3Towgs84(n,l.viewer))):(l.end(),t(null,{center:l._positions[0],radius:l._radius,startAngle:l._startAngle,endAngle:l._endAngle})),2===l._positions.length&&(l.radius_points.push(n),l._radius=l.computeDistance2([l._positions[0],l._positions[1]])),1===l._positions.length)){l.radius_points.push(n);var o=l.createRadiusLine();l.points_ids.push(o)}})),this.event.mouse_move((function(t,e){if("2D"!==i){if(l.tip.setPosition(e,t.endPosition.x,t.endPosition.y),1===l._positions.length){l.radius_points[1]=e;var n=l.cartesian3Towgs84(e,l.viewer);l._radius=l.computeDistance2([l._positions[0],n])}if(!(l._positions.length<2)&&(2==l._positions.length&&l._positions.push(l.cartesian3Towgs84(e,l.viewer)),3==l._positions.length)){l._positions.pop(),l._positions.push(l.cartesian3Towgs84(e,l.viewer)),Cesium.defined(l._sector_id)||(l._sector_id=l.createsector(),l.points_ids.push(l._sector_id));var o=c.calculateAangle(c._positions);c._startAngle=o.angle1,c._endAngle=o.angle2}}})),this.event.mouse_right((function(e,n){"2D"!==i&&(l.end(),t(null))})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,n){if("3D"!==i&&(i="2D",l._positions.length<3?(l.points_ids.push(l.create_point(n,l._sdk2D.viewer)),l._positions.push(l.cartesian3Towgs84(n,l.viewer))):(l.end(),t(null,{center:l._positions[0],radius:l._radius,startAngle:l._startAngle,endAngle:l._endAngle})),2===l._positions.length)){var o=l.cartesian3Towgs84(n,l.viewer);l._radius=l.computeDistance2([l._positions[0],o])}})),this.event2D.mouse_move((function(t,e){if("3D"!==i&&(l.tip.setPosition(e,t.endPosition.x+l.viewer.canvas.width,t.endPosition.y),!(l._positions.length<2)&&(2==l._positions.length&&l._positions.push(l.cartesian3Towgs84(e,l.viewer)),3==l._positions.length))){l._positions.pop(),l._positions.push(l.cartesian3Towgs84(e,l.viewer)),Cesium.defined(l._sector_id)||(l._sector_id=l.createsector(l._sdk2D.viewer),l.points_ids.push(l._sector_id));var n=c.calculateAangle(c._positions);c._startAngle=n.angle1,c._endAngle=n.angle2}})),this.event2D.mouse_right((function(e,n){"3D"!==i&&(l.end(),t(null))}))))}},{key:"createsector",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.viewer,e=this,i=new Cesium.CallbackProperty((function(){var t=e.calSector(e._positions[0],e._radius,e._startAngle,e._endAngle);return new Cesium.PolygonHierarchy(t)})),n=e.randomString(),o=t.entities.add({id:n,position:Cesium.Cartesian3.fromDegrees(e._positions[0].lng,e._positions[0].lat),polygon:{hierarchy:i,show:!0,fill:!0,clampToGround:!0,material:Cesium.Color.fromCssColorString(e.color),zIndex:99999999}});return e._entities_sector.push(o),n}},{key:"createRadiusLine",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.viewer,i=this,n=i.randomString(),o=e.entities.add({id:n,position:new Cesium.CallbackProperty((function(t){var e=i._positions[0],n=i.radius_points[1]?i.cartesian3Towgs84(i.radius_points[1],i.viewer):i._positions[0],o=i.computeMidpoint(e,n);return Cesium.Cartesian3.fromDegrees(o.lng,o.lat,n.alt)}),!1),polyline:{positions:new Cesium.CallbackProperty((function(t){return i.radius_points}),!1),width:2,material:Cesium.Color.fromCssColorString("#c1c505").withAlpha(.5),clampToGround:!0,zIndex:999999999},label:{text:new Cesium.CallbackProperty((function(e){return t._radius>1e3?"半径:"+(t._radius/1e3).toFixed(2)+" 公里":"半径:"+t._radius+" 米"}),!1),font:"20px Microsoft YaHei",disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,fillColor:Cesium.Color.fromCssColorString("#f5ce0a"),style:Cesium.LabelStyle.FILL_AND_OUTLINE}});return i._entities_sector.push(o),n}},{key:"cartesianToLatlng",value:function(t){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),i=Cesium.Math.toDegrees(e.latitude);return[Cesium.Math.toDegrees(e.longitude),i]}},{key:"lonLatToMercator",value:function(t){var e=t[0],i=t[1],n=20037508.34*e/180,o=Math.log(Math.tan((90+i)*Math.PI/360))/(Math.PI/180);return[n,o=20037508.34*o/180]}},{key:"WebMercator2lonLat",value:function(t){var e=t[0]/20037508.34*180,i=t[1]/20037508.34*180;return[e,180/Math.PI*(2*Math.atan(Math.exp(i*Math.PI/180))-Math.PI/2)]}},{key:"calculateAangle",value:function(t){function e(t,e){var i=Math.PI/180,n=t.y*i,o=e.y*i,s=t.x*i,a=e.x*i,r=Math.sin(a-s)*Math.cos(o),l=Math.cos(n)*Math.sin(o)-Math.sin(n)*Math.cos(o)*Math.cos(a-s),c=Math.atan2(r,l)%(2*Math.PI);return 360-(450-(180*c/Math.PI<0?360+180*c/Math.PI:180*c/Math.PI)-90)%360}var i=t[0],n=t[1],o=t[2],s={x:i.lng,y:i.lat},a={x:n.lng,y:n.lat},r={x:o.lng,y:o.lat};return{angle1:e(s,a),angle2:e(s,r)}}}])}(wa),Ol=52.35987755982988,Tl=3.141592653589793,Nl=.006693421622965943,Bl=function(){return _()((function t(){k()(this,t)}),null,[{key:"BD09ToGCJ02",value:function(t,e){var i=+t-.0065,n=+e-.006,o=Math.sqrt(i*i+n*n)-2e-5*Math.sin(n*Ol),s=Math.atan2(n,i)-3e-6*Math.cos(i*Ol);return[o*Math.cos(s),o*Math.sin(s)]}},{key:"GCJ02ToBD09",value:function(t,e){e=+e,t=+t;var i=Math.sqrt(t*t+e*e)+2e-5*Math.sin(e*Ol),n=Math.atan2(e,t)+3e-6*Math.cos(t*Ol);return[i*Math.cos(n)+.0065,i*Math.sin(n)+.006]}},{key:"WGS84ToGCJ02",value:function(t,e){if(e=+e,t=+t,this.out_of_china(t,e))return[t,e];var i=this.delta(t,e);return[t+i[0],e+i[1]]}},{key:"GCJ02ToWGS84",value:function(t,e){if(e=+e,t=+t,this.out_of_china(t,e))return[t,e];var i=this.delta(t,e);return[2*t-(t+i[0]),2*e-(e+i[1])]}},{key:"delta",value:function(t,e){var i=this.transformLng(t-105,e-35),n=this.transformLat(t-105,e-35),o=e/180*Tl,s=Math.sin(o);s=1-Nl*s*s;var a=Math.sqrt(s);return[i=180*i/(6378245/a*Math.cos(o)*Tl),n=180*n/(6378245*(1-Nl)/(s*a)*Tl)]}},{key:"transformLng",value:function(t,e){var i=300+(t=+t)+2*(e=+e)+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return i+=2*(20*Math.sin(6*t*Tl)+20*Math.sin(2*t*Tl))/3,i+=2*(20*Math.sin(t*Tl)+40*Math.sin(t/3*Tl))/3,i+=2*(150*Math.sin(t/12*Tl)+300*Math.sin(t/30*Tl))/3}},{key:"transformLat",value:function(t,e){var i=2*(t=+t)-100+3*(e=+e)+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return i+=2*(20*Math.sin(6*t*Tl)+20*Math.sin(2*t*Tl))/3,i+=2*(20*Math.sin(e*Tl)+40*Math.sin(e/3*Tl))/3,i+=2*(160*Math.sin(e/12*Tl)+320*Math.sin(e*Tl/30))/3}},{key:"out_of_china",value:function(t,e){return e=+e,!((t=+t)>73.66&&t<135.05&&e>3.86&&e<53.55)}}])}();function Ll(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Al=function(t){function e(t,i){var n;return k()(this,e),(n=Ll(this,e,[t,i])).sdk.addIncetance(n.options.id,n),n.options.show&&Kt(0,n.options.id),n}return sn()(e,t),_()(e,[{key:"setDefaultValue",value:function(){var t,i,n,o,s;(t=e,i="setDefaultValue",n=this,o=3,s=ba()(nn()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),this.options.host=this.options.host||h()}},{key:"requestResource",value:function(){var t="";return t=this.options.host.endsWith("yjearth4.0")?this.options.host+"/data/service/load-compact-service":this.options.host+"/yjearth4.0/data/service/load-compact-service",fetch(t,{method:"post",body:JSON.stringify({source_id:this.options.id}),headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}})}}])}(Wn);function jl(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Il(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Rl(this,e,[t,i])).options.name=i.name||"未命名对象",n.Dialog=o,n._elms={},n}return sn()(e,t),_()(e,[{key:"setDefaultValue",value:function(){var t,i;Fl(e,"setDefaultValue",this,3)([]),this.options.alpha=null!==(t=this.options.alpha)&&void 0!==t?t:1,this.options.brightness=null!==(i=this.options.brightness)&&void 0!==i?i:1}},{key:"layerIndex",get:function(){return this.entity?this.entity._layerIndex:void 0}},{key:"layer_index",get:function(){return this.entity?this.entity._layerIndex:void 0}},{key:"brightness",get:function(){return this.options.brightness},set:function(t){this.options.brightness=t,this.entity.brightness=t}},{key:"alpha",get:function(){return this.options.alpha},set:function(t){Number(t)>1&&(t=1),Number(t)<0&&(t=0),this.entity.alpha=t,this.options.alpha=t,this._elms.alpha&&this._elms.alpha.forEach((function(e){e.value=t}))}},{key:"layerRaise",value:function(t){this.sdk.viewer.imageryLayers.raise(this.entity);for(var e=0;e0&&void 0!==l[0]&&l[0],!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(e={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Il({},this.options.position):this.options.positions?r=Il({},this.options.positions[0]):this.options.center?r=Il({},this.options.center):this.options.start?r=Il({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),r.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(r);case 17:r.alt=t.sent;case 18:i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e}),t.next=26;break;case 25:this.sdk.viewer.flyTo(this.entity);case 26:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"amapMercatorTilingScheme",value:function(t){return new(function(t){function e(t){var i;k()(this,e),i=Rl(this,e,[t]);var n=new Cesium.WebMercatorProjection;return i._projection.project=function(t,e){return e=Bl.WGS84ToGCJ02(Cesium.Math.toDegrees(t.longitude),Cesium.Math.toDegrees(t.latitude)),e=n.project(new Cesium.Cartographic(Cesium.Math.toRadians(e[0]),Cesium.Math.toRadians(e[1]))),new Cesium.Cartesian2(e.x,e.y)},i._projection.unproject=function(t,e){var i=n.unproject(t);return e=Bl.GCJ02ToWGS84(Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude)),new Cesium.Cartographic(Cesium.Math.toRadians(e[0]),Cesium.Math.toRadians(e[1]))},i}return sn()(e,t),_()(e)}(Cesium.WebMercatorTilingScheme))(t)}},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s=this,r=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r.length>0&&void 0!==r[0]&&r[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),t.next=5,new rn(this.sdk,this.options,{title:"底图属性",left:"180px",top:"100px",confirmCallBack:function(t){s.name=s.name.trim(),s.name||(s.name="未命名对象"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),se(s.sdk,s.options.id);var e=Ie();if(e&&e!=s.sdk)for(var i=0;i\n
            \n
            \n
            \n 名称:\n \n
            \n
            \n
            \n
            \n 透明度:\n \n
            \n
            \n
            \n ',e.innerHTML=i,n=e.getElementsByClassName("name")[0],o=e.getElementsByClassName("alpha")[0],n.value=this.name,o.value=this.alpha,n.addEventListener("input",(function(){s.name=n.value})),o.addEventListener("input",(function(){s.alpha=o.value})),this._DialogObject.contentAppChild(e),this._elms.name=[n],this._elms.alpha=[o];case 19:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"reset",value:function(){(this.entity||this._DialogObject)&&(this.options=this.deepCopyObj(this.originalOptions),this.name=this.options.name,this.alpha=this.options.alpha,this.brightness=this.options.brightness)}},{key:"flicker",value:function(){}}]);var i,n}(Al);function Hl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Vl=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),Hl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"type",get:function(){return"layer"}},{key:"createArcGis",value:(i=o()(a.a.mark((function t(e){var i,n,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=6;break}return t.next=3,Cesium.ArcGisMapServerImageryProvider.fromUrl(e);case 3:i=t.sent,t.next=7;break;case 6:i=new Cesium.ArcGisMapServerImageryProvider({url:e});case 7:for(this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(i,this.options.layer_index):this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(i),this.entity._id=this.options.id,n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),Yl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"type",get:function(){return"layer"}},{key:"createGD",value:function(t){var e=new Cesium.UrlTemplateImageryProvider({url:t,minimumLevel:3,maximumLevel:18,tilingScheme:this.amapMercatorTilingScheme()});this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(e,this.options.layer_index):this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(e),this.entity._id=this.options.id;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Yl(this,e,[t,n])).createGD("https://webst02.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8"),i}return sn()(e,t),_()(e)}(Jl),Xl=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Yl(this,e,[t,n])).createGD("https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}"),i}return sn()(e,t),_()(e)}(Jl),Zl=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Yl(this,e,[t,n])).createGD("https://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}"),i}return sn()(e,t),_()(e)}(Jl);function Kl(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return $l(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?$l(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function $l(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i=107)){t.next=19;break}return t.next=14,Cesium.Cesium3DTileset.fromUrl(n,r);case 14:l=t.sent,this.entity=l,this.entity.imageBasedLighting.luminanceAtZenith=.1,t.next=25;break;case 19:return r.url=n,l=new Cesium.Cesium3DTileset(r),t.next=23,l.readyPromise;case 23:this.entity=t.sent,this.entity.imageBasedLighting.luminanceAtZenith=.1;case 25:return t.next=27,this.loadSceneTree(n);case 27:if(c=function(t){if(t._contents)for(var e=0;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function cc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),dc(i=hc(this,e,[t,n]),gc,void 0),i.picking=!1,i.Dialog=o,i._elms={},i._EventBinding=new wn,i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"tileset"}},{key:"on",value:function(){return this.add()}},{key:"name",get:function(){return this.newData.name},set:function(t){this.newData.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"height",get:function(){return this.newData.height},set:function(t){this.newData.height=t,this.options.position.alt=t,this._elms.height&&this._elms.height.forEach((function(e){e.value=t})),this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch)}},{key:"accuracy",get:function(){return this.newData.accuracy},set:function(t){var e=this;this.newData.accuracy=Number(t.toFixed(1)),this.newData.accuracy<.1&&(this.newData.accuracy=.1),this.entity&&(this.entity.maximumScreenSpaceError=32/this.newData.accuracy),this._elms.accuracy&&this._elms.accuracy.forEach((function(t){t.value=e.newData.accuracy}))}},{key:"lng",get:function(){return this.newData.lng},set:function(t){this.newData.lng=t,this.options.position.lng=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch)}},{key:"lat",get:function(){return this.newData.lat},set:function(t){this.newData.lat=t,this.options.position.lat=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch)}},{key:"roll",get:function(){return this.newData.roll},set:function(t){this.newData.roll=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale)}},{key:"heading",get:function(){return this.newData.heading},set:function(t){this.newData.heading=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale)}},{key:"pitch",get:function(){return this.newData.pitch},set:function(t){this.newData.pitch=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale)}},{key:"transparency",get:function(){return this.newData.transparency},set:function(t){if(this.newData){this.newData.transparency=Number(t),this._elms.transparency&&this._elms.transparency.forEach((function(e){e.value=t}));var e=this.newData.transparency;this.entity.style=new Cesium.Cesium3DTileStyle({color:{conditions:[["Boolean(${SIZE})","${COLOR} * color('rgba(255,255,255)', "+e+")"],["true","color('rgba(255,255,255,"+e+")')"]]},show:!0})}}},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o=this,s=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=s.length>0&&void 0!==s[0]&&s[0],this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=21;break}return this._element_style=document.createElement("style"),this._element_style.type="text/css",this._element_style.setAttribute("data-name","YJ_style_dialog"),this._element_style.innerHTML="\n .YJ-custom-base-dialog>.content {\n width: 420px;\n }\n .YJ-custom-base-dialog>.content .row .label {\n flex: 0 0 45px;\n }\n",t.next=11,new rn(this.sdk,this.newData,{title:"倾斜模型属性",left:"180px",top:"100px",confirmCallBack:function(t){o.oldData.name=o.newData.name,o.oldData.height=o.newData.height,o.oldData.lng=o.newData.lng,o.oldData.lat=o.newData.lat,o.oldData.transparency=o.newData.transparency,o.oldData.scale=o.newData.scale,o.oldData.roll=o.newData.roll,o.oldData.heading=o.newData.heading,o.oldData.pitch=o.newData.pitch,o.oldData.type=o.type,o.oldData.accuracy=o.newData.accuracy,o._DialogObject.close(),o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(pc(pc({},o.oldData),{},{type:o.type})),se(o.sdk,o.oldData.id)},resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()},closeCallBack:function(){o.reset(),o.positionEditing&&(o.positionEditing=!1),o.rotationEditing&&(o.rotationEditing=!1),o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(t){o.newData.show=t,o.entity&&(o.entity.show=t),o.Dialog.showCallBack&&o.Dialog.showCallBack()},rotateCallBack:function(){o.rotationEditing?o.rotationEditing=!1:o.rotationEditing=!0,o.tileset.root.transform||window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"该模型不支持移动和旋转!",type:"warning",duration:1500}))},translationalCallBack:function(){o.positionEditing?o.positionEditing=!1:o.positionEditing=!0,o.tileset.root.transform||window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"该模型不支持移动和旋转!",type:"warning",duration:1500}))}},!0);case 11:this._DialogObject=t.sent,document.getElementsByTagName("head")[0].appendChild(this._element_style),(i=document.createElement("div")).innerHTML='\n \n
            \n
            \n
            \n 名称\n \n
            \n
            \n
            \n \n
            \n
            \n
            \n 高度\n
            \n \n m\n \n
            \n
            \n
            \n 精度\n
            \n \n \n \n
            \n
            \n
            \n
            \n
            \n 透视\n \n
            \n
            \n
            \n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,t.next=21;break;case 21:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"updateModel",value:function(t,e,i){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;if(this.tileset.root.transform){if(!(!t&&0!==t||!e&&0!==e||!i&&0!==i)){var l=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(s)),u=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(a)),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),h=Cesium.Matrix4.fromRotationTranslation(l),d=Cesium.Matrix4.fromRotationTranslation(c),m=Cesium.Matrix4.fromRotationTranslation(u),f=new Cesium.Matrix4;Cesium.Matrix4.multiply(p,h,f),Cesium.Matrix4.multiply(f,d,f),Cesium.Matrix4.multiply(f,m,f);var v=Cesium.Matrix4.fromUniformScale(r);Cesium.Matrix4.multiply(f,v,this.entity._root.transform),this.editObj.activeAxis||(this.editObj.position={lng:t,lat:e,alt:i}),this.editObj.activeCircle||(this.editObj.rotate={x:o,y:s,z:a}),this.editObj&&this.editObj.update(),clearTimeout(fc(gc,this)),mc(gc,this,setTimeout((function(){clearTimeout(fc(gc,n));var t,e=n.cartesian3Towgs84(n.entity.boundingSphere.center,n.sdk.viewer),i=turf.circle([e.lng,e.lat],n.entity.boundingSphere.radius/1e3,{steps:360,units:"kilometers"}),o=lc(n.sdk.entityMap);try{for(o.s();!(t=o.n()).done;){var s=y()(t.value,2),a=(s[0],s[1]);if("BillboardObject"===a.type&&3==a.heightMode){var r=turf.point([a.lng,a.lat]);turf.booleanPointInPolygon(r,i)&&a.updateHeight()}else a.label&&(a.label.show=a.label.show)}}catch(t){o.e(t)}finally{o.f()}}),300))}}else console.warn("该模型不支持移动和旋转!")}},{key:"reset",value:function(){this.editObj.destroy(),this.entity&&(this.transparency=this.oldData.transparency,this.name=this.oldData.name,this.height=this.oldData.height,this.lng=this.oldData.lng,this.lat=this.oldData.lat,this.roll=this.oldData.roll,this.heading=this.oldData.heading,this.pitch=this.oldData.pitch,this.scale=this.oldData.scale,this.accuracy=this.oldData.accuracy,this.entity.style=new Cesium.Cesium3DTileStyle({color:{conditions:[["Boolean(${SIZE})","${COLOR} * color('rgba(255,255,255)', "+this.transparency+")"],["true","color('rgba(255,255,255,"+this.transparency+")')"]]},show:!0}))}}]);var i}(rc);function bc(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Cc(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Cc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Cc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),_c(i=xc(this,e,[t,n]),Pc,void 0),i.picking=!1,i.features=n.features||[],i.exportStateArray=[],i.Dialog=o,i._elms={},i._EventBinding=new wn,i.Dialog.exportState=function(t){i.exportState(t)},i.Dialog.exportProperty=function(t){i.exportProperty(i.exportStateArray)},i.features=new Map,i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"bim"}},{key:"name",get:function(){return this.newData.name},set:function(t){this.newData.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.newData.lng},set:function(t){this.newData.lng=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.newData.lat},set:function(t){this.newData.lat=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"height",get:function(){return this.newData.height},set:function(t){this.newData.height=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.height&&this._elms.height.forEach((function(e){e.value=t}))}},{key:"roll",get:function(){return this.newData.roll},set:function(t){this.newData.roll=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.roll&&this._elms.roll.forEach((function(e){e.value=t}))}},{key:"heading",get:function(){return this.newData.heading},set:function(t){this.newData.heading=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.heading&&this._elms.heading.forEach((function(e){e.value=t}))}},{key:"pitch",get:function(){return this.newData.pitch},set:function(t){this.newData.pitch=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.pitch&&this._elms.pitch.forEach((function(e){e.value=t}))}},{key:"scale",get:function(){return this.newData.scale},set:function(t){this.newData.scale=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.scale&&this._elms.scale.forEach((function(e){e.value=t}))}},{key:"loadSceneTree",value:(r=o()(a.a.mark((function t(e){var i,n=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(i=e.split("/"))[i.length-1]="scenetree.json",t.next=4,Cesium.Resource.fetchJson({url:i.join("/")}).then((function(t){n.scenetree=t;var e=function(t){t.forEach((function(t){n.features.has(t.id)?n.features.get(t.id).sphere=t.sphere:n.features.set(t.id,{sphere:t.sphere}),t.children&&e(t.children)}))};e(t.scenes[0].children)}));case 4:case"end":return t.stop()}}),t)}))),function(t){return r.apply(this,arguments)})},{key:"edit",value:(s=o()(a.a.mark((function t(e){var i,n,o=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=16;break}return t.next=6,new rn(this.sdk,this.newData,{title:"BIM模型属性",left:"180px",top:"100px",resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},confirmCallBack:function(t){o.name=o.name.trim(),o.name||(o.name="未命名对象"),o.oldData.name=o.newData.name,o.oldData.height=o.newData.height,o.oldData.lng=o.newData.lng,o.oldData.lat=o.newData.lat,o.oldData.scale=o.newData.scale,o.oldData.roll=o.newData.roll,o.oldData.heading=o.newData.heading,o.oldData.pitch=o.newData.pitch,o._DialogObject.close();var e=new Map;o.features.forEach((function(t,i){var n=kc({},t);delete n.features,e.set(i,n)})),o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(kc(kc({},o.oldData),{},{features:e,type:o.type})),se(o.sdk,o.oldData.id)},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()},closeCallBack:function(){o.reset(),o.editObj.destroy(),o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(t){o.newData.show=t,o.entity&&(o.entity.show=t),o.Dialog.showCallBack&&o.Dialog.showCallBack()},rotateCallBack:function(){o.rotationEditing?o.rotationEditing=!1:o.rotationEditing=!0},translationalCallBack:function(){o.positionEditing?o.positionEditing=!1:o.positionEditing=!0}});case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" tileset-bim",(i=document.createElement("div")).innerHTML='\n \n
            \n
            \n
            \n 名称\n \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n 经度\n \n
            \n
            \n x轴\n \n
            \n
            \n
            \n
            \n 纬度\n \n
            \n
            \n y轴\n \n
            \n
            \n
            \n
            \n 高度\n
            \n \n m\n \n
            \n
            \n
            \n z轴\n \n
            \n
            \n
            \n
            \n 大小\n \n
            \n \n \n
            \n \n
            \n
            \n
            \n \n
            \n
            \n

            BIM属性导出选项

            \n
            \n
            \n
            \n
            \n
            \n \n 修建中\n
            \n
            \n \n 未完成\n
            \n
            \n \n 已完成\n
            \n
            \n
            \n \n
            \n
            \n \n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,t.next=17;break;case 16:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"featureEdit",value:(n=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d,m=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this,this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=46;break}o=function(t){var e='
            \n
            \n \n \n \n \n
            \n
            '),i=document.createElement("div");i.innerHTML=e;var s=i.getElementsByClassName("property-item")[0],a=s.querySelector("input[name='key']"),l=s.querySelector("input[name='value']"),c=s.getElementsByClassName("add")[0],p=s.getElementsByClassName("delete")[0];a.addEventListener("input",(function(e){t.key=e.target.value})),l.addEventListener("input",(function(e){t.value=e.target.value})),c.addEventListener("click",(function(){var t={id:n.randomString(),key:"点击此处可编辑",value:""};r.descriptions.push(t),o(t)})),p.addEventListener("click",(function(e){for(var i=0;i.content {\n width: 440px;\n }\n .YJ-custom-base-dialog>.content .row .label {\n flex: 0 0 110px;\n }\n .col:first-child {\n margin-right: 10px;\n }\n .col:last-child {\n margin-left: 10px;\n }\n .YJ-custom-base-dialog>.content .divide {\n position: relative;\n display: flex;\n align-items: center;\n margin: 20px 0;\n }\n .YJ-custom-base-dialog>.content .divide .line{\n height: 1px;\n background: #ddd;\n flex: 1;\n }\n .YJ-custom-base-dialog>.content .divide p{\n margin: 0 10px;\n }\n .YJ-custom-base-dialog>.content .property .property-item .btn{\n font-size: 24px;\n line-height: 20px;\n padding: 2px 0;\n }\n .YJ-custom-base-dialog>.content .property .property-item .input_lable {\n flex: 0 0 115px;\n border: none;\n margin-right: 15px;\n text-align: right;\n }\n .YJ-custom-base-dialog>.content .property .property-item:first-child .delete{\n display: none\n }\n .YJ-custom-base-dialog>.content .property .property-item .add{\n display: none;\n }\n .YJ-custom-base-dialog>.content .property .property-item:last-child .add{\n display: inline-block;\n }\n",t.next=24,new W(this.sdk.viewer._container,{title:this.oldData.name+"-----设置状态",left:"calc(50% - 200px)",top:"calc(50% - 200px)",closeCallBack:function(){m.Dialog.closeCallBack&&m.Dialog.closeCallBack()}});case 24:return this._DialogObject=t.sent,t.next=27,this._DialogObject.init();case 27:for(document.getElementsByTagName("head")[0].appendChild(this._element_style),(l=document.createElement("div")).innerHTML='\n
            \n
            \n 构件名称\n \n
            \n
            \n
            \n
            \n 选择状态\n \n
            \n
            \n
            \n
            \n

            自定义属性

            \n
            \n
            \n
            \n
            \n ',l.querySelector("input[name='name']").value=s,(c=l.querySelector("select[name='state-select']")).value=r.state,c.addEventListener("change",(function(t){switch(r.state=t.target.value,r.state){case"0":r.stateCH="";break;case"1":r.stateCH="已完成";break;case"2":r.stateCH="未完成";break;case"3":r.stateCH="修建中"}})),u=l.getElementsByClassName("property")[0],p=0;p3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;if(!this.tileset.root.transform)return window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"该模型不支持移动和旋转!",type:"warning",duration:1500})),void console.warn("该模型不支持移动和旋转!");if(!(!t&&0!==t||!e&&0!==e||!i&&0!==i)){var l=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(s)),u=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(a)),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),h=Cesium.Matrix4.fromRotationTranslation(l),d=Cesium.Matrix4.fromRotationTranslation(c),m=Cesium.Matrix4.fromRotationTranslation(u),f=new Cesium.Matrix4;Cesium.Matrix4.multiply(p,h,f),Cesium.Matrix4.multiply(f,d,f),Cesium.Matrix4.multiply(f,m,f);var v=Cesium.Matrix4.fromUniformScale(r);Cesium.Matrix4.multiply(f,v,this.entity._root.transform),this.editObj.activeAxis||(this.editObj.position={lng:t,lat:e,alt:i}),this.editObj.activeCircle||(this.editObj.rotate={x:o,y:s,z:a}),this.editObj&&this.editObj.update(),clearTimeout(Sc(Pc,this)),Ec(Pc,this,setTimeout((function(){clearTimeout(Sc(Pc,n));var t,e=n.cartesian3Towgs84(n.entity.boundingSphere.center,n.sdk.viewer),i=turf.circle([e.lng,e.lat],n.entity.boundingSphere.radius/1e3,{steps:360,units:"kilometers"}),o=bc(n.sdk.entityMap);try{for(o.s();!(t=o.n()).done;){var s=y()(t.value,2),a=(s[0],s[1]);if("BillboardObject"===a.type&&3==a.heightMode){var r=turf.point([a.lng,a.lat]);turf.booleanPointInPolygon(r,i)&&a.updateHeight()}else a.label&&(a.label.show=a.label.show)}}catch(t){o.e(t)}finally{o.f()}}),300))}}},{key:"getScenetree",value:function(){return this.scenetree}},{key:"featureColor",value:function(t,e){if(this.features.has(t)){var i=this.features.get(t).features;for(var n in i)i[n].content._model&&(i[n].color=Cesium.Color.fromCssColorString(e)),i[n].customColor=Cesium.Color.fromCssColorString(e);this.features.get(t).customColor=Cesium.Color.fromCssColorString(e)}}},{key:"getFeatureColor",value:function(t){if(this.features.has(t)){if(this.features.get(t).customColor)return this.features.get(t).customColor;var e=this.features.get(t).features;for(var i in e)if(e[i].content._model)return e[i].customColor||e[i].color}}},{key:"featureShow",value:function(t,e){if(this.features.has(t)){var i=this.features.get(t).features;for(var n in i)i[n].content._model&&(i[n].show=e),i[n].customShow=e;this.features.get(t).customShow=e}}},{key:"featureFlyto",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.features.has(e)?(i=this.features.get(e).sphere,n=new Cesium.Cartesian3(i[0],i[1],i[2]),o=this.entity._root.originalTransform,o=Cesium.Matrix4.inverse(o,new Cesium.Matrix4),s=this.entity._root.transform,r=Cesium.Matrix4.multiply(s,o,new Cesium.Matrix4),l=Cesium.Matrix4.multiplyByPoint(r,n,new Cesium.Cartesian3),c=this.cartesian3Towgs84(l,this.sdk.viewer),u=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt+i[3]),pi(0),ii(this.sdk),ni(this.sdk),this.sdk.viewer.camera.flyTo({destination:u}),this.features.forEach((function(t,i){if(i===e){var n=p.getFeatureColor(e);if(p.features.has(e)&&n){var o=p.features.get(e).features;for(var s in o)o[s].content._model&&(o[s].color=n),o[s].customAlpha=1;p.features.get(e).customAlpha=1}}else{var a=p.getFeatureColor(i);if(p.features.has(i)&&a){var r=p.features.get(i).features;for(var l in r)r[l].content._model&&(r[l].color=Cesium.Color.fromCssColorString("rgba(".concat(Cesium.Color.floatToByte(a.red),",").concat(Cesium.Color.floatToByte(a.green),",").concat(Cesium.Color.floatToByte(a.blue),",").concat(.2*a.alpha,")"))),r[l].customAlpha=.2*a.alpha;p.features.get(i).customAlpha=.2*a.alpha}}}))):this.features.forEach((function(t,e){var i=p.features.get(e).features,n=p.getFeatureColor(e);if(n){for(var o in i)i[o].content._model&&(i[o].color=n),i[o].customAlpha=1;p.features.get(e).customAlpha=.2*n.alpha}}));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"exportProperty",value:function(t){if(0!==this.exportStateArray.length){for(var e,i=["name","","","","","","","","","","","","stateCH","descriptions"],n='{rows}
            ',o=function(t,e){return t.replace(/{(\w+)}/g,(function(t,i){return e[i]}))},s="",a="",r="",l=0;l构件名称体积墩全高H墩身高h底部高程承台宽承台长承台高桩径桩长结构材质完成情况自定义属性'),r+="",i){if(Array.isArray(this.features[l][i[u]])){var p="";for(var h in this.features[l][i[u]])p+="".concat(this.features[l][i[u]][h].key+":"+this.features[l][i[u]][h].value," ");s={nameType:"String",data:p}}else s={nameType:"String",data:this.features[l][i[u]]||"0"};r+=o('{data}',s)}r+="",l>0&&l/6e4%1==0&&(a+=o(n,s={rows:r,nameWS:"Sheet"+l}),r="",r+='构件名称体积墩全高H墩身高h底部高程承台宽承台长承台高桩径桩长结构材质完成情况自定义属性')}a+=o(n,s={rows:r,nameWS:"Sheet"}),r="",e=o('Axel Richter{created}{worksheets}',s={created:(new Date).getTime(),worksheets:a});var d,m=document.createElement("A");m.href="data:application/vnd.ms-excel;base64,"+(d=e,window.btoa(unescape(encodeURIComponent(d)))),m.download=this.oldData.name+"--构件属性.xls",m.target="_blank",document.body.appendChild(m),m.click(),document.body.removeChild(m)}else window.ELEMENT&&window.ELEMENT.Message({message:"未选择属性导出选项!",type:"warning",duration:1500})}},{key:"exportState",value:function(t){var e=t.target.getElementsByTagName("input")[0];if(e.checked=!e.checked,e.checked)this.exportStateArray.push(e.value),this.exportStateArray=Array.from(new Set(this.exportStateArray));else for(var i=0;i\n
            \n
            \n
            \n 名称\n \n
            \n
            \n 颜色\n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n 经度\n \n
            \n
            \n 最大比例\n
            \n \n \n \n
            \n
            \n
            \n
            \n
            \n 纬度\n \n
            \n
            \n 最小像素\n
            \n \n px\n \n
            \n
            \n
            \n
            \n
            \n 高度\n
            \n \n m\n \n
            \n
            \n
            \n 固定大小\n \n
            \n
            \n
            \n
            \n
            \n \n \n '.concat(Ln(t),'\n \n \n
            \n
            \n

            旋转

            \n
            \n
            \n
            \n x 轴\n \n
            \n \n °\n \n
            \n
            \n
            \n
            \n
            \n y 轴\n \n
            \n \n °\n \n
            \n
            \n
            \n
            \n
            \n z 轴\n \n
            \n \n °\n \n
            \n
            \n
            \n \n
            \n
            \n 缩放\n
            \n \n 是否等比例缩放\n
            \n
            \n
            \n \n \n
            \n

            高度

            \n
            \n
            \n
            \n 高度\n \n
            \n \n m\n \n
            \n
            \n
            \n \n
            \n
            \n \n ').concat('\n
            \n
            \n 标注开关\n \n
            \n
            \n
            \n
            \n 字体颜色\n
            \n
            \n
            \n 字体选择\n
            \n
            \n
            \n 字体大小\n
            \n \n px\n \n
            \n
            \n
            \n
            \n
            \n 视野缩放\n \n
            \n
            \n 最近距离\n
            \n \n m\n \n
            \n
            \n
            \n 最远距离\n
            \n \n m\n \n
            \n
            \n
            \n ','\n
            \n \n ').concat('\n
            \n
            \n 引线颜色\n
            \n
            \n
            \n 背景颜色\n
            \n
            \n
            \n
            \n
            \n
            \n 引线宽度\n
            \n \n px\n \n
            \n
            \n
            \n 引线长度\n
            \n \n px\n \n
            \n
            \n
            \n ','\n
            \n
            \n
            \n
            \n \n ')}function Tc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Nc(t){for(var e=1;e=0;L--){var A=B[L];if(A&&A.primitive&&A.id)switch(A.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return void(A.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}}}(t)})),this.MapEvent.mouse_left_down((function(i){var n=a.scene.cartesianToCanvasCoordinates(t.origin);g.x=i.position.x-Math.floor(n.x),g.y=i.position.y-Math.floor(n.y);for(var o=a.scene.drillPick(i.position,10),s=o.length-1;s>=0;s--){var r=o[s];if(r&&r.primitive&&r.primitive._name)if(e.activeAxis)e.activeAxis=null,e.activeModelParam=null,e.controllerCallBack;else switch(r.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return a.scene.screenSpaceCameraController.enableRotate=!1,e.activeAxis=r.primitive,e.activeModelParam=e.initParam(),void(r.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}})),this.MapEvent.mouse_left_up((function(t){a.scene.screenSpaceCameraController.enableRotate=!0;for(var i=0;i360&&(o._params.rx=1),o._params.rx<0&&(o._params.rx=360);Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o._params.rx));o._params.ry-=r,o._params.ry>360&&(o._params.ry=1),o._params.ry<0&&(o._params.ry=360);Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(o._params.ry));o._params.rz-=l,o._params.rz>360&&(o._params.rz=1),o._params.rz<0&&(o._params.rz=360),o.updateModel(o._params.tx,o._params.ty,o._params.tz,o._params.rx,o._params.ry,o._params.rz)}else{var p=Date.now();if(p-x<100)return clearTimeout(k),void(k=setTimeout((function(){t(e)}),100));clearTimeout(k),x=p;for(var h=o.coordCircles,d=0;d3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this._params.tx=t=parseFloat(parseFloat(t).toFixed(8)),this._params.ty=e=parseFloat(parseFloat(e).toFixed(8)),this._params.tz=i=parseFloat(parseFloat(i).toFixed(2)),this._params.rx=n=parseFloat(n),this._params.ry=o=parseFloat(o),this._params.rz=s=parseFloat(s),this.model.position=new Cesium.Cartesian3.fromDegrees(t,e,i),this.model.rotate={x:n,y:o,z:s};var a=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(n)),r=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(o)),l=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(s)),c=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),u=Cesium.Matrix4.fromRotationTranslation(a),p=Cesium.Matrix4.fromRotationTranslation(r),h=Cesium.Matrix4.fromRotationTranslation(l),d=new Cesium.Matrix4;Cesium.Matrix4.multiply(c,u,d),Cesium.Matrix4.multiply(d,p,d),Cesium.Matrix4.multiply(d,h,this.model.modelMatrix),this.transformCallBack}},{key:"transformCallBack",get:function(){this._transformCallBack&&this._transformCallBack(this._params)},set:function(t){this._transformCallBack=t}},{key:"createAxisArrow",value:function(t,e,i,n){var o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,width:20}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:n}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return o._name=t,this.coordArrows.push(o),o}},{key:"createAxisSphere",value:function(t,e,i,n,o){var s=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,width:5}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineColorAppearance({translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return s._radius=o,s._name=t,this.coordCircles.push(s),s}},{key:"removeCoordArrows",value:function(){for(var t=0;t=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ic(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),Vc(i=zc(this,e,[t,n,o={}]),Yc,null),n.position?n.position.lng||0===n.position.lng?n.position.lat||0===n.position.lat?(i.options.earth&&delete i.options.earth,i.picking=!0,i.options.name=n.name||"未命名对象",i.options.color=n.color||"#ffffff","number"==typeof n.scale?(i.options.scale={},i.options.scale.x=n.scale,i.options.scale.y=n.scale,i.options.scale.z=n.scale):(i.options.scale=n.scale||{},i.options.scale.x=i.options.scale.x||0===i.options.scale.x?i.options.scale.x:1,i.options.scale.y=i.options.scale.y||0===i.options.scale.y?i.options.scale.y:1,i.options.scale.z=i.options.scale.z||0===i.options.scale.z?i.options.scale.z:1),i.options.url=n.url,i.options.maximumScale=n.maximumScale||0===n.maximumScale?n.maximumScale:100,i.options.minimumPixelSize=n.minimumPixelSize||0===n.minimumPixelSize?n.minimumPixelSize:60,i.options.position=n.position=n.position||{},i.options.position={lng:n.position.lng,lat:n.position.lat,alt:n.position.alt},i.options.scaleByDistance=!n.scaleByDistance&&!1!==n.scaleByDistance||n.scaleByDistance,i.options.rotate=n.rotate=n.rotate||{},i.options.rotate.x=n.rotate.x||0,i.options.rotate.y=n.rotate.y||0,i.options.rotate.z=n.rotate.z||0,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera=i.options.attribute.camera.content||[],i.options.attribute.ISC=i.options.attribute.ISC||{},i.options.attribute.ISC.content=i.options.attribute.ISC.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i._elms={},i.entity={id:i.options.id},i.positionCallBack=null,i.rotationCallback=null,i.onClickCallback=null,i._DialogObject=null,i.Dialog=o,i._EventBinding=new wn,i.on(),i):(console.warn("lat is required!"),tn()(i)):(console.warn("lng is required!"),tn()(i)):(console.warn("position is required!"),tn()(i))}return sn()(e,t),_()(e,[{key:"type",get:function(){return"glb"}},{key:"loadModel",value:(l=o()(a.a.mark((function t(e){var i,n,o,s=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Pe(this.sdk,this.options.id),this.sdk&&this.sdk.viewer&&this.sdk.viewer.scene){t.next=3;break}return t.abrupt("return");case 3:if(e=this.replaceHost(e,this.options.host),this.originalOptions=this.deepCopyObj(this.options),i={id:this.options.id,url:e,show:this.options.show,maximumScale:this.options.scaleByDistance?void 0:this.options.maximumScale,minimumPixelSize:this.options.scaleByDistance?void 0:this.options.minimumPixelSize},!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=13;break}return t.next=10,Cesium.Model.fromGltfAsync(i);case 10:this.entity=t.sent,t.next=16;break;case 13:return t.next=15,Cesium.Model.fromGltf(i);case 15:this.entity=t.sent;case 16:return this.entity.imageBasedLighting.luminanceAtZenith=.6,this.entity.color=Cesium.Color.fromCssColorString(this.options.color),t.next=20,this.sdk.viewer.scene.primitives.add(this.entity);case 20:n=Cesium.Cartographic.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n),this.entity.position=o,this.entity.rotate=Fc({},this.options.rotate),this.entity.customScale=this.options.scale,this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),Number(Cesium.VERSION.split(".")[1])>=107?(this.entity.readyEvent.addEventListener((function(){s.entity.originalBoundingSphereRadius=s.entity.boundingSphere.radius,s.editObj=new Bc(s.sdk,s.entity),s.editObj.transformCallBack=s.rotationEditingCallBack,s.updateModel(s.options.position.lng,s.options.position.lat,s.options.position.alt,s.options.rotate.x,s.options.rotate.y,s.options.rotate.z,s.options.scale),s.label||(s.label=new oo(s.sdk,{id:s.options.id,show:!!s.options.show&&s.options.label.show,position:[s.options.position.lng,s.options.position.lat,s.options.position.alt],text:s.options.name,fontSize:s.options.label.fontSize,fontFamily:s.options.label.fontFamily?s.options.label.fontFamily:0,color:s.options.label.color,pixelOffset:s.options.label.pixelOffset,backgroundColor:s.options.label.backgroundColor,lineColor:s.options.label.lineColor,lineWidth:s.options.label.lineWidth,scaleByDistance:s.options.label.scaleByDistance,near:s.options.label.near,far:s.options.label.far},s.entity)),s.entity.isMove=!0,clearTimeout(Uc(Yc,s)),Gc(Yc,s,setTimeout((function(){s.entity&&(s.entity.isMove=!1)}),500))})),this.activeAnimate=this.options.activeAnimate,this.modelAnimations=this.entity.loader.components.animations):this.entity.readyPromise.then((function(t){s.entity.originalBoundingSphereRadius=s.entity.boundingSphere.radius,s.editObj=new Bc(s.sdk,s.entity),s.editObj.transformCallBack=s.rotationEditingCallBack,s.updateModel(s.options.position.lng,s.options.position.lat,s.options.position.alt,s.options.rotate.x,s.options.rotate.y,s.options.rotate.z,s.options.scale),s.label||(s.label=new oo(s.sdk,{id:s.options.id,show:!!s.options.show&&s.options.label.show,position:[s.options.position.lng,s.options.position.lat,s.options.position.alt],text:s.options.name,fontSize:s.options.label.fontSize,fontFamily:s.options.label.fontFamily?s.options.label.fontFamily:0,color:s.options.label.color,pixelOffset:s.options.label.pixelOffset,backgroundColor:s.options.label.backgroundColor,lineColor:s.options.label.lineColor,lineWidth:s.options.label.lineWidth,scaleByDistance:s.options.label.scaleByDistance,near:s.options.label.near,far:s.options.label.far,ground:!1},s.entity)),s.entity.isMove=!0,clearTimeout(Uc(Yc,s)),Gc(Yc,s,setTimeout((function(){s.entity&&(s.entity.isMove=!1)}),500)),s.activeAnimate=s.options.activeAnimate,s.modelAnimations=s.entity.loader.components.animations})),se(this.sdk,this.options.id);case 28:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"getModelAnimations",value:(r=o()(a.a.mark((function t(){var e=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,i){Number(Cesium.VERSION.split(".")[1])>=107?e.entity.readyEvent.addEventListener((function(){e.modelAnimations=e.entity.loader.components.animations,t(e.modelAnimations)})):e.entity.readyPromise.then((function(i){e.modelAnimations=e.entity.loader.components.animations,t(e.modelAnimations)}))})));case 1:case"end":return t.stop()}}),t)}))),function(){return r.apply(this,arguments)})},{key:"remove",value:function(){Hc(e,"remove",this,3)([]),this.label&&this.label.remove(),this.positionEditing=!1,this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=22;break}if(e={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Fc({},this.options.position):this.options.positions?r=Fc({},this.options.positions[0]):this.options.center?r=Fc({},this.options.center):this.options.start?r=Fc({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),r.hasOwnProperty("alt")){t.next=15;break}return t.next=14,this.getClampToHeight(r);case 14:r.alt=t.sent;case 15:i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e}),t.next=23;break;case 22:Number(Cesium.VERSION.split(".")[1])>=107?this.entity.ready&&(l=new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt),this.entity.originalBoundingSphereRadius*this.options.scale.z*2),this.sdk.viewer.camera.flyToBoundingSphere(l)):this.entity.readyPromise.then((function(){var t=new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(c.options.position.lng,c.options.position.lat,c.options.position.alt),(c.entity.originalBoundingSphereRadius||c.entity.boundingSphere.radius)*c.options.scale.z*2);c.sdk.viewer.camera.flyToBoundingSphere(t)}));case 23:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"on",value:function(){return this.add()}},{key:"setDefaultValue",value:function(){Hc(e,"setDefaultValue",this,3)([]),this.options.host=this.options.host||h(),this.options.url=this.options.url||""}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.entity.color=Cesium.Color.fromCssColorString(t),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"lng",get:function(){return this.options.position.lng},set:function(t){this.options.position={lng:t,lat:this.options.position.lat,alt:this.options.position.alt},this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label&&(this.label.position=[this.options.position.lng,this.options.position.lat,this.options.position.alt]),this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.position.lat},set:function(t){this.options.position={lng:this.options.position.lng,lat:t,alt:this.options.position.alt},this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label&&(this.label.position=[this.options.position.lng,this.options.position.lat,this.options.position.alt]),this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.position.alt},set:function(t){this.options.position={lng:this.options.position.lng,lat:this.options.position.lat,alt:t},this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label&&(this.label.position=[Number(this.options.position.lng),Number(this.options.position.lat),Number(this.options.position.alt)]),this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"maximumScale",get:function(){return this.options.maximumScale},set:function(t){this.options.maximumScale=t,this.entity.maximumScale=this.scaleByDistance?void 0:t,this._elms.maximumScale&&this._elms.maximumScale.forEach((function(e){e.value=t}))}},{key:"minimumPixelSize",get:function(){return this.options.minimumPixelSize},set:function(t){this.options.minimumPixelSize=t,this.entity.minimumPixelSize=this.scaleByDistance?void 0:this.options.minimumPixelSize,this._elms.minimumPixelSize&&this._elms.minimumPixelSize.forEach((function(e){e.value=t}))}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(t){this.options.scaleByDistance=t,this.entity.maximumScale=t?void 0:this.maximumScale,this.entity.minimumPixelSize=t?void 0:this.options.minimumPixelSize,this._elms.scaleByDistance&&this._elms.scaleByDistance.forEach((function(e){e.checked=t}))}},{key:"rotateX",get:function(){return this.options.rotate.x},set:function(t){this.options.rotate.x=t,this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateX&&this._elms.rotateX.forEach((function(e){e.value=t}))}},{key:"rotateY",get:function(){return this.options.rotate.y},set:function(t){this.options.rotate.y=t,this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateY&&this._elms.rotateY.forEach((function(e){e.value=t}))}},{key:"rotateZ",get:function(){return this.options.rotate.z},set:function(t){this.options.rotate.z=t,this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateZ&&this._elms.rotateZ.forEach((function(e){e.value=t}))}},{key:"scaleX",get:function(){return this.options.scale.x},set:function(t){var e=this;this.options.scale.x=Number(Number(t).toFixed(2)),this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.scaleX&&this._elms.scaleX.forEach((function(t){t.value=e.options.scale.x}))}},{key:"scaleY",get:function(){return this.options.scale.y},set:function(t){var e=this;this.options.scale.y=Number(Number(t).toFixed(2)),this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.scaleY&&this._elms.scaleY.forEach((function(t){t.value=e.options.scale.y}))}},{key:"scaleZ",get:function(){return this.options.scale.z},set:function(t){var e=this;this.options.scale.z=Number(Number(t).toFixed(2)),this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.scaleZ&&this._elms.scaleZ.forEach((function(t){t.value=e.options.scale.z}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show&&!this.showView||3==this.showView?this.label&&(this.label.show=t):this.label&&(this.label.show=!1),this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label&&(this.label.color=t),this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label&&(this.label.fontSize=t),this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label&&(this.label.scaleByDistance=t),this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
            '+this.options.attribute.link.content[s].url+'
            \n
            \n \n \n
            \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
            \n \n
            \n
            \n \n
            \n
            \n \n \n
            ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
            '+this.options.attribute.vr.content[s].url+'
            \n
            \n \n \n
            \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
            \n \n
            \n
            \n \n
            \n
            \n \n \n
            ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0))for(var e=0;e0&&void 0!==v[0]&&v[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=46;break}return i=!1,this.scaleX===this.scaleY&&this.scaleX===this.scaleZ&&(i=!0),t.next=9,new rn(this.sdk,this.originalOptions,{title:"模型属性",left:"180px",top:"100px",confirmCallBack:function(t){f.name=f.options.name||"未命名对象",f.originalOptions=f.deepCopyObj(f.options),f._DialogObject.close();var e=f.deepCopyObj(f.options);e.host="",f.Dialog.confirmCallBack&&f.Dialog.confirmCallBack(e),Pe(f.sdk,f.options.id),se(f.sdk,f.options.id)},resetCallBack:function(){f.reset(),f.Dialog.resetCallBack&&f.Dialog.resetCallBack()},removeCallBack:function(){f.Dialog.removeCallBack&&f.Dialog.removeCallBack()},closeCallBack:function(){f.reset(),f.positionEditing=!1,f.editObj&&f.editObj.destroy(),f.Dialog.closeCallBack&&f.Dialog.closeCallBack()},showCallBack:function(t){f.show=t,f.Dialog.showCallBack&&f.Dialog.showCallBack()},translationalCallBack:function(){f.positionEditing?f.positionEditing=!1:f.positionEditing=!0}},!0);case 9:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" model",(n=document.createElement("div")).innerHTML=Oc(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,new kn("model-edit-tabs",void 0,this.sdk),o=this._DialogObject._element.content.getElementsByClassName("checkbox-box")[0].querySelector("input"),s=this._DialogObject._element.content.getElementsByClassName("equal")[0],r=this._DialogObject._element.content.getElementsByClassName("no-equal")[0],o.checked=i,o.addEventListener("change",(function(t){(i=t.target.checked)?(s.style.display="flex",r.style.display="none",f.scaleY=f.scaleX,f.scaleZ=f.scaleX):(s.style.display="none",r.style.display="flex")})),(l=s.getElementsByTagName("input"))[0].value=this.scaleX,l[1].value=this.scaleX,l[0].addEventListener("input",(function(t){f.scaleX=t.target.value,f.scaleY=t.target.value,f.scaleZ=t.target.value})),l[1].addEventListener("input",(function(t){f.scaleX=t.target.value,f.scaleY=t.target.value,f.scaleZ=t.target.value})),i?(s.style.display="flex",r.style.display="none"):(s.style.display="none",r.style.display="flex"),c=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){f.color=t},clear:function(){f.color="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelColor=t},clear:function(){f.labelColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelLineColor=t},clear:function(){f.labelLineColor="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelBackgroundColorStart=t},clear:function(){f.labelBackgroundColorStart="rgba(255,255,255,1)"}}),d=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelBackgroundColorEnd=t},clear:function(){f.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),m=n.getElementsByTagName("*"),this._EventBinding.on(this,m),this._elms=this._EventBinding.element,this._elms.color=[c],this._elms.labelColor=[u],this._elms.labelLineColor=[p],this._elms.labelBackgroundColorStart=[h],this._elms.labelBackgroundColorEnd=[d],this._elms.scaleX.push(l[0],l[1]),setTimeout((function(){f.attributeLink=f.options.attribute.link.content,f.attributeVr=f.options.attribute.vr.content,f.ISCSelect&&f.ISCSelect(),f.goodsSelect&&f.goodsSelect(),f.cameraSelect&&f.cameraSelect();var t=f.attributeSelect,e=f._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=f._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],o=0;o3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6?arguments[6]:void 0;t=parseFloat(t),e=parseFloat(e),i=parseFloat(parseFloat(i).toFixed(2)),o=parseFloat(o),s=parseFloat(s),a=parseFloat(a),r.x=parseFloat(r.x),r.y=parseFloat(r.y),r.z=parseFloat(r.z),this.entity.position=new Cesium.Cartesian3.fromDegrees(t,e,i),this.entity.rotate={x:o,y:s,z:a},this.entity.customScale=r;var l=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(s)),u=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(a)),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),h=Cesium.Matrix4.fromRotationTranslation(l),d=Cesium.Matrix4.fromRotationTranslation(c),m=Cesium.Matrix4.fromRotationTranslation(u),f=new Cesium.Matrix4;Cesium.Matrix4.multiply(p,h,f),Cesium.Matrix4.multiply(f,d,f),Cesium.Matrix4.multiply(f,m,this.entity.modelMatrix);var v=r.x,g=r.y,y=r.z;0===v&&(v=1e-5),0===g&&(g=1e-5),0===y&&(y=1e-5),Cesium.Matrix4.multiplyByScale(this.entity.modelMatrix,new Cesium.Cartesian3(v,g,y),this.entity.modelMatrix),this.entity.minimumPixelSize=this.scaleByDistance?void 0:this.options.minimumPixelSize,this.editObj&&this.editObj.update(),this.entity.isMove=!0,clearTimeout(Uc(Yc,this)),Gc(Yc,this,setTimeout((function(){n.entity&&(n.entity.isMove=!1)}),500))}},{key:"reset",value:function(){if(this.entity)try{this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lng=this.originalOptions.position.lng,this.lat=this.originalOptions.position.lat,this.alt=this.originalOptions.position.alt,this.maximumScale=this.originalOptions.maximumScale,this.minimumPixelSize=this.originalOptions.minimumPixelSize,this.scaleByDistance=this.originalOptions.scaleByDistance,this.rotateX=this.originalOptions.rotate.x,this.rotateY=this.originalOptions.rotate.y,this.rotateZ=this.originalOptions.rotate.z,this.scaleX=this.originalOptions.scale.x,this.scaleY=this.originalOptions.scale.y,this.scaleZ=this.originalOptions.scale.z,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.attributeISC=this.options.attribute.ISC.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect()}catch(t){}}}]);var i,n,s,r,l}(Ac);function qc(t){return'\n
            \n
            \n 名称\n \n
            \n
            \n 颜色\n
            \n
            \n
            \n
            \n
            \n 经度\n \n
            \n
            \n 最大比例\n \n
            \n
            \n
            \n
            \n 纬度\n \n
            \n
            \n 最小像素\n \n
            \n
            \n
            \n
            \n 高度\n \n
            \n
            \n 视野缩放\n \n
            \n
            \n
            \n \n \n '.concat(Ln(t),'\n \n \n
            \n
            \n
            \n x轴\n \n \n
            \n
            \n
            \n
            \n y轴\n \n \n
            \n
            \n
            \n
            \n z轴\n \n \n
            \n
            \n
            \n
            \n 高度\n \n \n
            \n
            \n
            \n
            \n 缩放\n \n \n
            \n
            \n
            \n
            \n \n ').concat('\n
            \n
            \n 标注开关\n \n
            \n
            \n
            \n
            \n 字体颜色\n
            \n
            \n
            \n 字体选择\n
            \n
            \n
            \n 字体大小\n
            \n \n px\n \n
            \n
            \n
            \n
            \n
            \n 视野缩放\n \n
            \n
            \n 最近距离\n
            \n \n m\n \n
            \n
            \n
            \n 最远距离\n
            \n \n m\n \n
            \n
            \n
            \n ','\n
            \n \n ').concat('\n
            \n
            \n 引线颜色\n
            \n
            \n
            \n 背景颜色\n
            \n
            \n
            \n
            \n
            \n
            \n 引线宽度\n
            \n \n px\n \n
            \n
            \n
            \n 引线长度\n
            \n \n px\n \n
            \n
            \n
            \n ',"\n
            \n
            \n
            \n ")}function Xc(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Zc(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Zc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Zc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=Qc(this,e,[t,n,o={}])).picking=!0,i.options.name=n.name||"未命名对象",i.options.color=n.color||"#ffffff",i.options.scale=n.scale||0===n.scale?n.scale:1,i.options.url=n.url,i.options.maximumScale=n.maximumScale||0===n.maximumScale?n.maximumScale:100,i.options.minimumPixelSize=n.minimumPixelSize||0===n.minimumPixelSize?n.minimumPixelSize:60,i.options.positions=n.positions||[],i.options.type=n.type||0,i.options.interval=n.interval||0===n.interval?n.interval:1,i.options.quantity=n.quantity,i.options.scaleByDistance=!n.scaleByDistance&&!1!==n.scaleByDistance||n.scaleByDistance,i.options.rotate=n.rotate=n.rotate||{},i.options.rotate.x=n.rotate.x||0,i.options.rotate.y=n.rotate.y||0,i.options.rotate.z=n.rotate.z||0,i.options.label=n.label=n.label||{},i.options.label.show=!(!n.label.show&&!1!==n.label.show)&&n.label.show,i.options.label.fontSize=n.label.fontSize||20,i.options.label.color=n.label.color||"#ffffff",i.options.label.near=n.label.near||0===n.label.near?n.label.near:2e3,i.options.label.far=n.label.far||0===n.label.far?n.label.far:1e5,i.options.label.scaleByDistance=n.label.scaleByDistance||!1,i.options.label.backgroundColor=n.label.backgroundColor||["#42c6ef","#42c6ef"],i.options.line=n.line=n.line||{},i.options.line.width=n.line.width||2,i.options.line.length=n.line.length||20,i.options.line.color=n.line.color||"#fff000",i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||[],i.options.attributeType=n.attributeType||"richText",i.ModelPositions=[],i._elms={},i.positionCallBack=null,i.rotationCallback=null,i.onClickCallback=null,i._DialogObject=null,i._element_style=null,i.ControllerObject=new qo(i.sdk),i.ControllerObject.controllerCallBack=function(t){i.lng=t.position.lng,i.lat=t.position.lat,i.alt=t.position.alt},i.Dialog=o,i._EventBinding=new wn,i.on(),i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"glb"}},{key:"loadModel",value:(s=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(v=function(t){return new Worker("data:,(".concat(t.toString(),")(").concat(JSON.stringify(m),")"))},f=function(t){var e=t.type,i=t.interval,n=t.positions,o=t.optionsPositions,s=t.quantity,a=t.turfUrl;importScripts(a);var r=[];switch(e){case 1:var l=turf.lineString(n[0]),c=turf.lineChunk(l,i/1e3,{units:"kilometers"});r.push({lng:c.features[0].geometry.coordinates[0][0],lat:c.features[0].geometry.coordinates[0][1]});for(var p=0;pthis.options.height&&(o=this.options.positions[s].alt);n[0].length>2?(n[0].push([this.options.positions[0].lng,this.options.positions[0].lat]),r=turf.polygon(n),l=turf.pointOnFeature(r),this.center={lng:l.geometry.coordinates[0],lat:l.geometry.coordinates[1]}):2==n[0].length?this.center={lng:(this.options.positions[0].lng+this.options.positions[1].lng)/2,lat:(this.options.positions[0].lat+this.options.positions[1].lat)/2}:this.center={lng:this.options.positions[0].lng,lat:this.options.positions[0].lat},c=[],this.options.height||0===this.options.height||(this.options.height=o),p=document.scripts,h="",d=0;case 14:if(!(dthis.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
            '+this.options.attribute.link.content[s].url+'
            \n
            \n \n \n
            \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
            \n \n
            \n
            \n \n
            \n
            \n \n \n
            ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0&&void 0!==p[0]&&p[0],this.originalOptions=this.deepCopyObj(this.options),this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=36;break}return this._element_style=document.createElement("style"),this._element_style.type="text/css",this._element_style.setAttribute("data-name","YJ_style_dialog"),this._element_style.innerHTML="\n .YJ-custom-base-dialog>.content {\n width: 600px;\n }\n .YJ-custom-base-dialog>.content>div>.row .col {\n margin: 0 10px;\n }\n .YJ-custom-base-dialog>.content>div>.row .col:first-child {\n margin-left: 0;\n }\n .YJ-custom-base-dialog>.content>div>.row .col:last-child {\n margin-right: 0;\n }\n .YJ-custom-base-dialog>.content>div>.row .label {\n flex: 0 0 74px;\n }\n .YJ-custom-base-dialog>.content .DIV-cy-tab-content-pane .input-select {\n width: 100px;\n }\n",t.next=12,new rn(this.sdk,this.originalOptions,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(t){u.name=u.options.name||"未命名对象",u.originalOptions=u.deepCopyObj(u.options),u._DialogObject.close(),u.Dialog.confirmCallBack&&u.Dialog.confirmCallBack(u.originalOptions)},resetCallBack:function(){u.reset(),u.Dialog.resetCallBack&&u.Dialog.resetCallBack()},removeCallBack:function(){u.Dialog.removeCallBack&&u.Dialog.removeCallBack()},closeCallBack:function(){u.reset(),u.positionEditing=!1,u.ControllerObject&&u.ControllerObject.destroy(),u.Dialog.closeCallBack&&u.Dialog.closeCallBack()},showCallBack:function(t){u.show=t,u.Dialog.showCallBack&&u.Dialog.showCallBack()},translationalCallBack:function(){u.positionEditing?u.positionEditing=!1:u.positionEditing=!0}},!0);case 12:this._DialogObject=t.sent,document.getElementsByTagName("head")[0].appendChild(this._element_style),(i=document.createElement("div")).innerHTML=qc(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera,new kn("model-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){u.color=t},clear:function(){u.color="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("label_color")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){u.labelColor=t},clear:function(){u.labelColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("line_color")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){u.lineColor=t},clear:function(){u.lineColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){u.labelBackgroundColorStart=t},clear:function(){u.labelBackgroundColorStart="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){u.labelBackgroundColorEnd=t},clear:function(){u.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),c=i.getElementsByTagName("*"),this._EventBinding.on(this,c),this._elms=this._EventBinding.element,this._elms.color=[n],this._elms.labelColor=[o],this._elms.lineColor=[s],this._elms.labelBackgroundColorStart=[r],this._elms.labelBackgroundColorEnd=[l],setTimeout((function(){u.attributeLink=u.options.attribute.link.content,u.cameraSelect&&u.cameraSelect();var t=u.attributeSelect,e=u._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=u._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],o=0;o3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6?arguments[6]:void 0;t=parseFloat(t),e=parseFloat(e),i=parseFloat(i),n=parseFloat(n),o=parseFloat(o),s=parseFloat(s),a=parseFloat(a),this.entity.rotate={x:n,y:o,z:s};var r=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(n)),l=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(s)),u=new Cesium.Cartesian3.fromDegrees(t,e,i);Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(u.x-this.entity._center.x,u.y-this.entity._center.y,u.z-this.entity._center.z)),Cesium.Matrix4.fromRotationTranslation(r),Cesium.Matrix4.fromRotationTranslation(l),Cesium.Matrix4.fromRotationTranslation(c),new Cesium.Matrix4;Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(u.x-this.entity._center.x,u.y-this.entity._center.y,u.z-this.entity._center.z),this.entity.modelMatrix),this.ControllerObject.update(),this.entity.position=new Cesium.Cartesian3.fromDegrees(t,e,i)}},{key:"updateModelRotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;t=parseFloat(t),e=parseFloat(e),i=parseFloat(i),n=parseFloat(n),this.sdk.viewer.scene.primitives.remove(this.entity);var o=this.options.url;if(!o.startsWith("http")&&!o.includes(":")&&this.options.host){var s=new URL(o,this.options.host);o=s.href}for(var a=[],r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=ou(this,e,[t,n])).object={},i.options.host=i.options.host||h(),i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"layer"}},{key:"on",value:function(){return this.add()}},{key:"add",value:(n=o()(a.a.mark((function t(){var e,i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.requestResource();case 2:return e=t.sent,t.next=5,e.text();case 5:if(i=t.sent,i=JSON.parse(i),![0,200].includes(i.code)){t.next=11;break}return t.abrupt("return",this.loadLayer(i.data));case 11:return t.abrupt("return",new Promise((function(t,e){e(i.msg||i.message)})));case 12:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"loadLayer",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.object=nu({},e),i="",this.object.url.startsWith("http")?i=this.object.url:this.options.host?(n=new URL(this.object.url,this.options.host),i=n.href):i=this.object.url,o={url:i,mimmumLevel:this.object.minimumLevel,maximumLevel:this.object.maximumLevel,rectangle:new Cesium.Rectangle(Cesium.Math.toRadians(this.object.west),Cesium.Math.toRadians(this.object.south),Cesium.Math.toRadians(this.object.east),Cesium.Math.toRadians(this.object.north))},t.t0=this.object.scheme_name,t.next="amapMercatorTilingScheme"===t.t0?7:""===t.t0?9:10;break;case 7:return o.tilingScheme=this.amapMercatorTilingScheme(),t.abrupt("break",12);case 9:return t.abrupt("break",12);case 10:return o.tilingScheme=new Cesium[this.object.scheme_name],t.abrupt("break",12);case 12:t.t1=this.object.load_method,t.next="tms"===t.t1?15:"xyz"===t.t1?24:"wmts"===t.t1?26:28;break;case 15:if(this.object.url.endsWith("tilemapresource.xml")&&((r=this.object.url.split("/")).pop(),l=r.join("/"),o.url=l),!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=22;break}return t.next=19,Cesium.TileMapServiceImageryProvider.fromUrl(o.url,o);case 19:s=t.sent,t.next=23;break;case 22:s=new Cesium.TileMapServiceImageryProvider(o);case 23:return t.abrupt("break",30);case 24:return s=new Cesium.UrlTemplateImageryProvider(o),t.abrupt("break",30);case 26:return s=new Cesium.WebMapTileServiceImageryProvider(o),t.abrupt("break",30);case 28:return s=new Cesium.UrlTemplateImageryProvider(o),t.abrupt("break",30);case 30:if(this.sdk&&this.sdk.viewer){t.next=32;break}return t.abrupt("return");case 32:for(this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(s,this.options.layer_index):this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(s),this.entity._id=this.options.id,c=0;c1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=au(this,e,[t,n])).loadLayer(),i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"layer"}},{key:"loadLayer",value:function(t){var e,i={url:this.options.url,mimmumLevel:this.options.minimumLevel||0,maximumLevel:this.options.maximumLevel||20,subdomains:["0","1","2","3","4","5","6","7"]};e=new Cesium.UrlTemplateImageryProvider(i),this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(e,this.options.layer_index):this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(e),this.entity._id=this.options.id;for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function pu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return k()(this,e),du(i=hu(this,e,[t,n]),gu,void 0),i.object=JSON.parse(JSON.stringify(o)),i.object.west||(i.object.west=40),i.object.south||(i.object.south=30),i.object.east||(i.object.east=160),i.object.north||(i.object.north=50),i.show=i.options.show,i._elms={},i.Dialog=s,i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"terrain"}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"show",get:function(){return!(this.sdk.viewer.scene.terrainProvider instanceof Cesium.EllipsoidTerrainProvider)},set:function(t){t?this.open():this.close()}},{key:"open",value:(r=o()(a.a.mark((function t(){var e,i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.options.url){t.next=4;break}return t.abrupt("return",this.loadTerrain({url:this.options.url}));case 4:return t.next=6,this.requestResource();case 6:return e=t.sent,t.next=9,e.text();case 9:if(i=t.sent,i=JSON.parse(i),![0,200].includes(i.code)){t.next=19;break}if(!i.data.url.length){t.next=16;break}return t.abrupt("return",this.loadTerrain(i.data));case 16:return t.abrupt("return",new Promise((function(t,e){e("资源不存在")})));case 17:t.next=20;break;case 19:return t.abrupt("return",new Promise((function(t,e){e(i.msg||i.message)})));case 20:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"close",value:function(){var t=this;this.sdk.viewer.scene.terrainProvider=new Cesium.EllipsoidTerrainProvider({});for(var e=0;e=107)){t.next=9;break}return t.next=6,Cesium.CesiumTerrainProvider.fromUrl(n);case 6:this.terrainProvider=t.sent,t.next=10;break;case 9:this.terrainProvider=new Cesium.CesiumTerrainProvider({url:n});case 10:if(this.sdk&&this.sdk.viewer){t.next=12;break}return t.abrupt("return");case 12:this.sdk.viewer.terrainProvider=this.terrainProvider,clearTimeout(fu(gu,this)),mu(gu,this,setTimeout((function(){clearTimeout(fu(gu,s)),s.terrainProvider.readyPromise.then((function(){var t,e=uu(s.sdk.entityMap);try{for(e.s();!(t=e.n()).done;){var i=y()(t.value,2),n=(i[0],i[1]);"BillboardObject"!==n.type||1!=n.heightMode&&3!=n.heightMode?n.label&&(n.label.show=n.label.show):n.updateHeight()}}catch(t){e.e(t)}finally{e.f()}}))}),1e3)),se(this.sdk,this.options.id);case 16:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"remove",value:function(){this.close()}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.length>0&&void 0!==u[0]?u[0]:3,!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=cu({},this.options.position):this.options.positions?l=cu({},this.options.positions[0]):this.options.center?l=cu({},this.options.center):this.options.start?l=cu({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i,duration:e}),t.next=27;break;case 25:c=new Cesium.Rectangle(Cesium.Math.toRadians(this.object.west),Cesium.Math.toRadians(this.object.south),Cesium.Math.toRadians(this.object.east),Cesium.Math.toRadians(this.object.north)),this.sdk.viewer.camera.flyTo({destination:c,duration:e});case 27:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"setDefaultValue",value:function(){var t,i,n,o,s;(t=e,i="setDefaultValue",n=this,o=3,s=ba()(nn()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),this.options.host=this.options.host||h(),this.options.url=this.options.url||""}},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o=this,s=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s.length>0&&void 0!==s[0]&&s[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),t.next=5,new rn(this.sdk,this.options,{title:"地形属性",left:"180px",top:"100px",confirmCallBack:function(t){o.name=o.name.trim(),o.name||(o.name="未命名对象"),o.originalOptions=o.deepCopyObj(o.options),o._DialogObject.close();var e=o.deepCopyObj(o.options);e.host="",o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(e)},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()}},!0);case 5:this._DialogObject=t.sent,(e=document.createElement("div")).style.width="300px",i='\n \n
            \n
            \n
            \n 名称:\n \n
            \n
            \n
            \n ',e.innerHTML=i,(n=e.getElementsByClassName("name")[0]).value=this.name,n.addEventListener("input",(function(){o.name=n.value})),this._DialogObject.contentAppChild(e),this._elms.name=[n];case 15:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}]);var i,n,s,r}(Al);function bu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Cu(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Cu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Cu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Eu(this,e,[t,i])).options.url=i.url,n.options.startColor=i.startColor||"#ff0000",n.options.endColor=i.endColor||"#fff000",n.options.startScale=i.startScale||.5,n.options.endScale=i.endScale||2,n.options.minimumParticleLife=i.minimumParticleLife||1,n.options.maximumParticleLife=i.maximumParticleLife||2,n.options.minimumSpeed=i.minimumSpeed||1,n.options.maximumSpeed=i.maximumSpeed||30,n.options.emissionRate=i.emissionRate||60,n.options.particleSize=i.particleSize||10,n.options.show=!1!==i.show,n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n._elms={},n.previous={positions:{lng:n.options.lng,lat:n.options.lat,alt:n.options.alt}},n.Dialog=o,n.event=new X(n.sdk),n}return sn()(e,t),_()(e,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;this.isShowView&&e||(this.options.show=t),this.showView&&3!=this.showView&&e?(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=!1),this.options.label&&this.options.label.show&&(this.label.show=!1)):(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.originalOptions=this.deepCopyObj(this.options),e=this.sdk.viewer.scene,i=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),n=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(i),o=Cesium.Transforms.eastNorthUpToFixedFrame(n),Cesium.Matrix4.multiplyByScale(o,new Cesium.Cartesian3(1,1,1),o),s=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=e.primitives.add(new Cesium.ParticleSystem({show:!(s>=1e7)&&this.options.show,image:this.options.url||this.getSourceRootPath()+"/img/particlesystem/smoke.png",startColor:Cesium.Color.fromCssColorString(this.options.startColor),endColor:Cesium.Color.fromCssColorString(this.options.endColor),startScale:this.options.startScale,endScale:this.options.endScale,minimumParticleLife:this.options.minimumParticleLife,maximumParticleLife:this.options.maximumParticleLife,minimumSpeed:this.options.minimumSpeed,maximumSpeed:this.options.maximumSpeed,minimumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),maximumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),sizeInMeters:!0,emissionRate:this.options.emissionRate,lifetime:.5,loop:!0,emitter:new Cesium.ConeEmitter(Cesium.Math.toRadians(30)),modelMatrix:o,updateCallback:function(t){t._billboard.id=r.options.id}})),this.particleSystem.id=this.options.id,this.entity=this.particleSystem,this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},Pe(this.sdk,this.options.id),this.options.show&&Kt(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(r.entity&&r.show){var t=r.sdk.viewer.camera.positionCartographic.height;r.entity.show=!(t>=1e7)}}));case 14:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=_u({},this.options.position):this.options.positions?l=_u({},this.options.positions[0]):this.options.center?l=_u({},this.options.center):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=26;break;case 25:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,this.options.alt+500),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(t){var e=this;this.options.startColor=t,this.particleSystem.startColor=Cesium.Color.fromCssColorString(t),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.startColor=t},clear:function(){e.startColor="rgba(255,255,255,1)"}});e._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(t){var e=this;this.options.endColor=t,this.particleSystem.endColor=Cesium.Color.fromCssColorString(t),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.endColor=t},clear:function(){e.endColor="rgba(255,255,255,1)"}});e._elms.endColor[n]=o}))}},{key:"minimumSpeed",get:function(){return this.options.minimumSpeed},set:function(t){this.options.minimumSpeed=t,this.particleSystem.minimumSpeed=t,this._elms.minimumSpeed&&this._elms.minimumSpeed.forEach((function(e){e.value=t}))}},{key:"maximumSpeed",get:function(){return this.options.maximumSpeed},set:function(t){this.options.maximumSpeed=t,this.particleSystem.maximumSpeed=t,this._elms.maximumSpeed&&this._elms.maximumSpeed.forEach((function(e){e.value=t}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(t){this.options.minimumParticleLife=t,this.particleSystem.minimumParticleLife=t,this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(e){e.value=t}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(t){this.options.maximumParticleLife=t,this.particleSystem.maximumParticleLife=t,this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(e){e.value=t}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(t){this.options.startScale=t,this.particleSystem.startScale=t,this._elms.startScale&&this._elms.startScale.forEach((function(e){e.value=t}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(t){this.options.endScale=t,this.particleSystem.endScale=t,this._elms.endScale&&this._elms.endScale.forEach((function(e){e.value=t}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(t){this.options.emissionRate=t,this.particleSystem.emissionRate=t,this._elms.emissionRate&&this._elms.emissionRate.forEach((function(e){e.value=t}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(t){this.options.particleSize=t,this.particleSystem.minimumImageSize=new Cesium.Cartesian2(t,t),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(t,t),this._elms.particleSize&&this._elms.particleSize.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.alt},set:function(t){this.options.alt=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"edit",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r=this,l=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l.length>0&&void 0!==l[0]&&l[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=21;break}return t.next=7,new rn(this.sdk,this.originalOptions,{title:"火焰属性",left:"180px",top:"100px",confirmCallBack:function(t){r.name=r.name.trim(),r.name||(r.name="未命名对象"),r.originalOptions=r.deepCopyObj(r.options),r._DialogObject.close(),r.Dialog.confirmCallBack&&r.Dialog.confirmCallBack(r.originalOptions),Pe(r.sdk,r.options.id),se(r.sdk,r.options.id)},resetCallBack:function(){r.reset(),r.Dialog.resetCallBack&&r.Dialog.resetCallBack()},removeCallBack:function(){r.Dialog.removeCallBack&&r.Dialog.removeCallBack()},closeCallBack:function(){r.reset(),r.positionEditing=!1,r.Dialog.closeCallBack&&r.Dialog.closeCallBack()},showCallBack:function(t){r.show=t,r.Dialog.showCallBack&&r.Dialog.showCallBack()},translationalCallBack:function(){r.positionEditing=!r.positionEditing}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(i=document.createElement("div")).innerHTML='\n \n
            \n
            \n
            \n 名称\n \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n 经度\n \n
            \n
            \n 纬度\n \n
            \n
            \n
            \n
            \n 高度\n
            \n \n m\n \n
            \n
            \n
            \n
            \n
            \n 起始颜色\n
            \n
            \n
            \n 结束颜色\n
            \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n
            \n 最小初速度\n \n
            \n
            \n
            \n
            \n 最大初速度\n \n
            \n
            \n
            \n
            \n
            \n
            \n 最小存在时间\n \n
            \n
            \n
            \n
            \n 最大存在时间\n \n
            \n
            \n
            \n
            \n
            \n
            \n 起始比例\n \n
            \n
            \n
            \n
            \n 结束比例\n \n
            \n
            \n
            \n
            \n
            \n
            \n 发射速率(个/秒)\n \n
            \n
            \n
            \n
            \n 尺寸(像素)\n \n
            \n
            \n
            \n
            \n \n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.startColor=t},clear:function(){r.startColor="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.endColor=t},clear:function(){r.endColor="rgba(255,255,255,1)"}}),s=i.getElementsByTagName("*"),ku.on(this,s),this._elms=ku.element,this._elms.startColor=[n],this._elms.endColor=[o],t.next=21;break;case 21:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.startColor=this.originalOptions.startColor,this.endColor=this.originalOptions.endColor,this.minimumSpeed=this.originalOptions.minimumSpeed,this.maximumSpeed=this.originalOptions.maximumSpeed,this.minimumParticleLife=this.originalOptions.minimumParticleLife,this.maximumParticleLife=this.originalOptions.maximumParticleLife,this.startScale=this.originalOptions.startScale,this.endScale=this.originalOptions.endScale,this.emissionRate=this.originalOptions.emissionRate,this.particleSize=this.originalOptions.particleSize,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.alt=this.originalOptions.alt,function(t){Le.apply(this,arguments)}(this.entity))}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Su(e,"remove",this,3)([]),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,!0===t){var i;this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:_u({},this.entity.position)},this.event.mouse_move((function(t,n){i=t.endPosition;var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(e.options.lng,e.options.lat,e.options.alt),a=e.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);e.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),e._elms.lng&&e._elms.lng.forEach((function(t){t.value=e.options.lng})),e._elms.lat&&e._elms.lat.forEach((function(t){t.value=e.options.lat})),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.alt})),e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,n){if(!i||i.x!==t.position.x||i.y!==t.position.y-2){var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt}e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:_u({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.lng=t.lng,e.options.lat=t.lat,e.options.alt=t.alt,e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:_u({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))}else{if(this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){}))),this.tip&&this.tip.destroy(),!this.sdk||!this.sdk.viewer||!this.entity)return;this.options.lng=this.entity.position.lng,this.options.lat=this.entity.position.lat,this.options.alt=this.entity.position.alt;var n=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e.options.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e.options.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.alt}))}}},{key:"flicker",value:function(){}}]);var i,n,s,r}(Wn);function Pu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Mu(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Mu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Mu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Lu(this,e,[t,i])).options.url=i.url,n.options.startColor=i.startColor||"#00000000",n.options.endColor=i.endColor||"#0000001a",n.options.startScale=i.startScale||.1,n.options.endScale=i.endScale||10,n.options.minimumParticleLife=i.minimumParticleLife||6,n.options.maximumParticleLife=i.maximumParticleLife||7,n.options.minimumSpeed=i.minimumSpeed||10,n.options.maximumSpeed=i.maximumSpeed||15,n.options.emissionRate=i.emissionRate||28,n.options.particleSize=i.particleSize||2,n.options.show=!1!==i.show,n._elms={},n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n.previous={positions:{lng:n.options.lng,lat:n.options.lat,alt:n.options.alt}},n.Dialog=o,n.event=new X(n.sdk),n}return sn()(e,t),_()(e,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;this.isShowView&&e||(this.options.show=t),this.showView&&3!=this.showView&&e?(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=!1),this.options.label&&this.options.label.show&&(this.label.show=!1)):(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.originalOptions=this.deepCopyObj(this.options),e=this.sdk.viewer.scene,i=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),n=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(i),o=Cesium.Transforms.eastNorthUpToFixedFrame(n),Cesium.Matrix4.multiplyByScale(o,new Cesium.Cartesian3(1,1,1),o),s=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=e.primitives.add(new Cesium.ParticleSystem({show:!(s>=1e7)&&this.options.show,image:this.options.url||this.getSourceRootPath()+"/img/particlesystem/smoke.png",startColor:Cesium.Color.fromCssColorString(this.options.startColor),endColor:Cesium.Color.fromCssColorString(this.options.endColor),startScale:this.options.startScale,endScale:this.options.endScale,minimumParticleLife:this.options.minimumParticleLife,maximumParticleLife:this.options.maximumParticleLife,minimumSpeed:this.options.minimumSpeed,maximumSpeed:this.options.maximumSpeed,minimumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),maximumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),sizeInMeters:!0,emissionRate:this.options.emissionRate,lifetime:.5,loop:!0,emitter:new Cesium.CircleEmitter(.2),performance:!1,modelMatrix:o,updateCallback:function(t){t._billboard.id=r.options.id}})),this.particleSystem.id=this.options.id,this.entity=this.particleSystem,this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},Pe(this.sdk,this.options.id),this.options.show&&Kt(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(r.entity&&r.show){var t=r.sdk.viewer.camera.positionCartographic.height;r.entity.show=!(t>=1e7)}}));case 14:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Bu({},this.options.position):this.options.positions?l=Bu({},this.options.positions[0]):this.options.center?l=Bu({},this.options.center):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=26;break;case 25:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,this.options.alt+500),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(t){var e=this;this.options.startColor=t,this.particleSystem.startColor=Cesium.Color.fromCssColorString(t),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.startColor=t},clear:function(){e.startColor="rgba(255,255,255,1)"}});e._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(t){var e=this;this.options.endColor=t,this.particleSystem.endColor=Cesium.Color.fromCssColorString(t),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.endColor=t},clear:function(){e.endColor="rgba(255,255,255,1)"}});e._elms.endColor[n]=o}))}},{key:"minimumSpeed",get:function(){return this.options.minimumSpeed},set:function(t){this.options.minimumSpeed=t,this.particleSystem.minimumSpeed=t,this._elms.minimumSpeed&&this._elms.minimumSpeed.forEach((function(e){e.value=t}))}},{key:"maximumSpeed",get:function(){return this.options.maximumSpeed},set:function(t){this.options.maximumSpeed=t,this.particleSystem.maximumSpeed=t,this._elms.maximumSpeed&&this._elms.maximumSpeed.forEach((function(e){e.value=t}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(t){this.options.minimumParticleLife=t,this.particleSystem.minimumParticleLife=t,this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(e){e.value=t}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(t){this.options.maximumParticleLife=t,this.particleSystem.maximumParticleLife=t,this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(e){e.value=t}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(t){this.options.startScale=t,this.particleSystem.startScale=t,this._elms.startScale&&this._elms.startScale.forEach((function(e){e.value=t}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(t){this.options.endScale=t,this.particleSystem.endScale=t,this._elms.endScale&&this._elms.endScale.forEach((function(e){e.value=t}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(t){this.options.emissionRate=t,this.particleSystem.emissionRate=t,this._elms.emissionRate&&this._elms.emissionRate.forEach((function(e){e.value=t}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(t){this.options.particleSize=t,this.particleSystem.minimumImageSize=new Cesium.Cartesian2(t,t),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(t,t),this._elms.particleSize&&this._elms.particleSize.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.alt},set:function(t){this.options.alt=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"edit",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r=this,l=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l.length>0&&void 0!==l[0]&&l[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=21;break}return t.next=7,new rn(this.sdk,this.originalOptions,{title:"烟雾属性",left:"180px",top:"100px",confirmCallBack:function(t){r.name=r.name.trim(),r.name||(r.name="未命名对象"),r.originalOptions=r.deepCopyObj(r.options),r._DialogObject.close(),r.Dialog.confirmCallBack&&r.Dialog.confirmCallBack(r.originalOptions),Pe(r.sdk,r.options.id),se(r.sdk,r.options.id)},resetCallBack:function(){r.reset(),r.Dialog.resetCallBack&&r.Dialog.resetCallBack()},removeCallBack:function(){r.Dialog.removeCallBack&&r.Dialog.removeCallBack()},closeCallBack:function(){r.reset(),r.positionEditing=!1,r.Dialog.closeCallBack&&r.Dialog.closeCallBack()},showCallBack:function(t){r.show=t,r.Dialog.showCallBack&&r.Dialog.showCallBack()},translationalCallBack:function(){r.positionEditing=!r.positionEditing}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(i=document.createElement("div")).innerHTML='\n \n
            \n
            \n
            \n 名称\n \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n 经度\n \n
            \n
            \n 纬度\n \n
            \n
            \n
            \n
            \n 高度\n
            \n \n m\n \n
            \n
            \n
            \n
            \n
            \n 起始颜色\n
            \n
            \n
            \n 结束颜色\n
            \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n
            \n 最小初速度\n \n
            \n
            \n
            \n
            \n 最大初速度\n \n
            \n
            \n
            \n
            \n
            \n
            \n 最小存在时间\n \n
            \n
            \n
            \n
            \n 最大存在时间\n \n
            \n
            \n
            \n
            \n
            \n
            \n 起始比例\n \n
            \n
            \n
            \n
            \n 结束比例\n \n
            \n
            \n
            \n
            \n
            \n
            \n 发射速率(个/秒)\n \n
            \n
            \n
            \n
            \n 尺寸(像素)\n \n
            \n
            \n
            \n
            \n \n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.startColor=t},clear:function(){r.startColor="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.endColor=t},clear:function(){r.endColor="rgba(255,255,255,1)"}}),s=i.getElementsByTagName("*"),Tu.on(this,s),this._elms=Tu.element,this._elms.startColor=[n],this._elms.endColor=[o],t.next=21;break;case 21:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.startColor=this.originalOptions.startColor,this.endColor=this.originalOptions.endColor,this.minimumSpeed=this.originalOptions.minimumSpeed,this.maximumSpeed=this.originalOptions.maximumSpeed,this.minimumParticleLife=this.originalOptions.minimumParticleLife,this.maximumParticleLife=this.originalOptions.maximumParticleLife,this.startScale=this.originalOptions.startScale,this.endScale=this.originalOptions.endScale,this.emissionRate=this.originalOptions.emissionRate,this.particleSize=this.originalOptions.particleSize,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.alt=this.originalOptions.alt)}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Au(e,"remove",this,3)([]),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,!0===t){var i;this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:Bu({},this.entity.position)},this.event.mouse_move((function(t,n){i=t.endPosition;var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(e.options.lng,e.options.lat,e.options.alt),a=e.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);e.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),e._elms.lng&&e._elms.lng.forEach((function(t){t.value=e.options.lng})),e._elms.lat&&e._elms.lat.forEach((function(t){t.value=e.options.lat})),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.alt})),e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,n){if(!i||i.x!==t.position.x||i.y!==t.position.y-2){var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt}e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Bu({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.lng=t.lng,e.options.lat=t.lat,e.options.alt=t.alt,e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Bu({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))}else{if(this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),!this.sdk||!this.sdk.viewer||!this.entity)return;this.options.lng=this.entity.position.lng,this.options.lat=this.entity.position.lat,this.options.alt=this.entity.position.alt;var n=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e.options.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e.options.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.alt}))}}},{key:"flicker",value:function(){}}]);var i,n,s,r}(Wn);function Iu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ru(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ru(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ru(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Gu(this,e,[t,i])).options.url=i.url,n.options.startColor=i.startColor||"#c1f7f24d",n.options.endColor=i.endColor||"#ffffff00",n.options.startScale=i.startScale||1,n.options.endScale=i.endScale||20,n.options.minimumParticleLife=i.minimumParticleLife||6,n.options.maximumParticleLife=i.maximumParticleLife||7,n.options.minimumSpeed=i.minimumSpeed||9,n.options.maximumSpeed=i.maximumSpeed||9.5,n.options.emissionRate=i.emissionRate||20,n.options.particleSize=i.particleSize||.5,n.options.show=!1!==i.show,n._elms={},n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n.previous={positions:{lng:n.options.lng,lat:n.options.lat,alt:n.options.alt}},n.Dialog=o,n.event=new X(n.sdk),n}return sn()(e,t),_()(e,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;this.isShowView&&e||(this.options.show=t),this.showView&&3!=this.showView&&e?(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=!1),this.options.label&&this.options.label.show&&(this.label.show=!1)):(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:p=function(){var t=Cesium.HeadingPitchRoll.fromDegrees(0,0,0),e=new Cesium.TranslationRotationScale;//!!!发射粒子的方向 return e.translation=Cesium.Cartesian3.fromElements(0,0,0),e.rotation=Cesium.Quaternion.fromHeadingPitchRoll(t),Cesium.Matrix4.fromTranslationRotationScale(e)},u=function(t,i){t._billboard.id=e.options.id;var n=t.position;Cesium.Cartesian3.normalize(n,l),Cesium.Cartesian3.multiplyByScalar(l,c*i,l),t.velocity=Cesium.Cartesian3.add(t.velocity,l,t.velocity)},e=this,this.originalOptions=this.deepCopyObj(this.options),i=this.sdk.viewer.scene,new Cesium.Cartesian3,n=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n),s=Cesium.Transforms.eastNorthUpToFixedFrame(o),Cesium.Matrix4.multiplyByScale(s,new Cesium.Cartesian3(1,1,1),s),r=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=i.primitives.add(new Cesium.ParticleSystem({show:!(r>=1e7)&&this.options.show,image:this.options.url||this.getSourceRootPath()+"/img/particlesystem/fountain.png",startColor:Cesium.Color.fromCssColorString(this.options.startColor),endColor:Cesium.Color.fromCssColorString(this.options.endColor),startScale:this.options.startScale,endScale:this.options.endScale,minimumParticleLife:this.options.minimumParticleLife,maximumParticleLife:this.options.maximumParticleLife,minimumSpeed:this.options.minimumSpeed,maximumSpeed:this.options.maximumSpeed,lifetime:.5,imageSize:new Cesium.Cartesian2(this.options.particleSize,2*this.options.particleSize),sizeInMeters:!0,emissionRate:this.options.emissionRate,loop:!0,emitter:new Cesium.ConeEmitter(Cesium.Math.toRadians(.2)),modelMatrix:s,emitterModelMatrix:p(),updateCallback:u})),l=new Cesium.Cartesian3,c=-3.5,this.particleSystem.id=this.options.id,this.entity=this.particleSystem,this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},Pe(this.sdk,this.options.id),this.options.show&&Kt(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(h.entity&&h.show){var t=h.sdk.viewer.camera.positionCartographic.height;h.entity.show=!(t>=1e7)}}));case 21:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Vu({},this.options.position):this.options.positions?l=Vu({},this.options.positions[0]):this.options.center?l=Vu({},this.options.center):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=26;break;case 25:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,this.options.alt+500),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(t){var e=this;this.options.startColor=t,this.particleSystem.startColor=Cesium.Color.fromCssColorString(t),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.startColor=t},clear:function(){e.startColor="rgba(255,255,255,1)"}});e._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(t){var e=this;this.options.endColor=t,this.particleSystem.endColor=Cesium.Color.fromCssColorString(t),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.endColor=t},clear:function(){e.endColor="rgba(255,255,255,1)"}});e._elms.endColor[n]=o}))}},{key:"minimumSpeed",get:function(){return this.options.minimumSpeed},set:function(t){this.options.minimumSpeed=t,this.particleSystem.minimumSpeed=t,this._elms.minimumSpeed&&this._elms.minimumSpeed.forEach((function(e){e.value=t}))}},{key:"maximumSpeed",get:function(){return this.options.maximumSpeed},set:function(t){this.options.maximumSpeed=t,this.particleSystem.maximumSpeed=t,this._elms.maximumSpeed&&this._elms.maximumSpeed.forEach((function(e){e.value=t}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(t){this.options.minimumParticleLife=Number(t),this.particleSystem.minimumParticleLife=Number(t),this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(e){e.value=Number(t)}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(t){this.options.maximumParticleLife=Number(t),this.particleSystem.maximumParticleLife=Number(t),this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(e){e.value=Number(t)}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(t){this.options.startScale=t,this.particleSystem.startScale=t,this._elms.startScale&&this._elms.startScale.forEach((function(e){e.value=t}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(t){this.options.endScale=t,this.particleSystem.endScale=t,this._elms.endScale&&this._elms.endScale.forEach((function(e){e.value=t}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(t){this.options.emissionRate=t,this.particleSystem.emissionRate=t,this._elms.emissionRate&&this._elms.emissionRate.forEach((function(e){e.value=t}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(t){this.options.particleSize=t,this.particleSystem.minimumImageSize=new Cesium.Cartesian2(t,t),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(t,t),this._elms.particleSize&&this._elms.particleSize.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.alt},set:function(t){this.options.alt=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"edit",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r=this,l=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l.length>0&&void 0!==l[0]&&l[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=21;break}return t.next=7,new rn(this.sdk,this.originalOptions,{title:"喷泉属性",left:"180px",top:"100px",confirmCallBack:function(t){r.name=r.name.trim(),r.name||(r.name="未命名对象"),r.originalOptions=r.deepCopyObj(r.options),r._DialogObject.close(),r.Dialog.confirmCallBack&&r.Dialog.confirmCallBack(r.originalOptions),Pe(r.sdk,r.options.id),se(r.sdk,r.options.id)},resetCallBack:function(){r.reset(),r.Dialog.resetCallBack&&r.Dialog.resetCallBack()},removeCallBack:function(){r.Dialog.removeCallBack&&r.Dialog.removeCallBack()},closeCallBack:function(){r.reset(),r.positionEditing=!1,r.Dialog.closeCallBack&&r.Dialog.closeCallBack()},showCallBack:function(t){r.show=t,r.Dialog.showCallBack&&r.Dialog.showCallBack()},translationalCallBack:function(){r.positionEditing=!r.positionEditing}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(i=document.createElement("div")).innerHTML='\n \n
            \n
            \n
            \n 名称\n \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n 经度\n \n
            \n
            \n 纬度\n \n
            \n
            \n
            \n
            \n 高度\n
            \n \n m\n \n
            \n
            \n
            \n
            \n
            \n 起始颜色\n
            \n
            \n
            \n 结束颜色\n
            \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n
            \n 最小初速度\n \n
            \n
            \n
            \n
            \n 最大初速度\n \n
            \n
            \n
            \n
            \n
            \n
            \n 最小存在时间\n \n
            \n
            \n
            \n
            \n 最大存在时间\n \n
            \n
            \n
            \n
            \n
            \n
            \n 起始比例\n \n
            \n
            \n
            \n
            \n 结束比例\n \n
            \n
            \n
            \n
            \n
            \n
            \n 发射速率(个/秒)\n \n
            \n
            \n
            \n
            \n 尺寸(像素)\n \n
            \n
            \n
            \n
            \n \n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.startColor=t},clear:function(){r.startColor="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.endColor=t},clear:function(){r.endColor="rgba(255,255,255,1)"}}),s=i.getElementsByTagName("*"),zu.on(this,s),this._elms=zu.element,this._elms.startColor=[n],this._elms.endColor=[o],t.next=21;break;case 21:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.startColor=this.originalOptions.startColor,this.endColor=this.originalOptions.endColor,this.minimumSpeed=this.originalOptions.minimumSpeed,this.maximumSpeed=this.originalOptions.maximumSpeed,this.minimumParticleLife=this.originalOptions.minimumParticleLife,this.maximumParticleLife=this.originalOptions.maximumParticleLife,this.startScale=this.originalOptions.startScale,this.endScale=this.originalOptions.endScale,this.emissionRate=this.originalOptions.emissionRate,this.particleSize=this.originalOptions.particleSize,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.alt=this.originalOptions.alt)}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Uu(e,"remove",this,3)([]),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,!0===t){var i;this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:Vu({},this.entity.position)},this.event.mouse_move((function(t,n){i=t.endPosition;var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(e.options.lng,e.options.lat,e.options.alt),a=e.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);e.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),e._elms.lng&&e._elms.lng.forEach((function(t){t.value=e.options.lng})),e._elms.lat&&e._elms.lat.forEach((function(t){t.value=e.options.lat})),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.alt})),e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,n){if(!i||i.x!==t.position.x||i.y!==t.position.y-2){var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt}e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Vu({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.lng=t.lng,e.options.lat=t.lat,e.options.alt=t.alt,e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Vu({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))}else{if(this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),!this.sdk||!this.sdk.viewer||!this.entity)return;this.options.lng=this.entity.position.lng,this.options.lat=this.entity.position.lat,this.options.alt=this.entity.position.alt;var n=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e.options.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e.options.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.alt}))}}},{key:"flicker",value:function(){}}]);var i,n,s,r}(Wn);function Yu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ju(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ju(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ju(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Zu(this,e,[t,i])).options.url=i.url,n.options.startColor=i.startColor||"#c1f7f2",n.options.endColor=i.endColor||"#ffffff00",n.options.startScale=i.startScale||.2,n.options.endScale=i.endScale||2,n.options.minimumParticleLife=i.minimumParticleLife||12,n.options.maximumParticleLife=i.maximumParticleLife||12,n.options.emissionRate=i.emissionRate||100,n.options.particleSize=i.particleSize||1,n.options.show=!1!==i.show,n._elms={},n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n.previous={positions:{lng:n.options.start.lng,lat:n.options.start.lat,alt:n.options.start.alt}},n.Dialog=o,n.event=new X(n.sdk),n}return sn()(e,t),_()(e,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;this.isShowView&&e||(this.options.show=t),this.showView&&3!=this.showView&&e?(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=!1),this.options.label&&this.options.label.show&&(this.label.show=!1)):(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:C=function(t,e){var i=new Cesium.Cartesian3,n=Cesium.Transforms.eastNorthUpToFixedFrame(t);return Cesium.Matrix4.inverse(n,n),Cesium.Matrix4.multiplyByPoint(n,e,i),Cesium.Cartesian3.normalize(i,i),Cesium.Math.toDegrees(Math.atan2(i.x,i.y))},b=function(){var t=Cesium.HeadingPitchRoll.fromDegrees(e.options.heading+90,e.options.pitch,0),i=new Cesium.TranslationRotationScale;//!!!发射粒子的方向 return i.translation=Cesium.Cartesian3.fromElements(0,0,1),i.rotation=Cesium.Quaternion.fromHeadingPitchRoll(t),Cesium.Matrix4.fromTranslationRotationScale(i)},y=function(t,i){t._billboard.id=e.options.id;var n=t.position;Cesium.Cartesian3.normalize(n,r),Cesium.Cartesian3.multiplyByScalar(r,l*i,r),t.velocity=Cesium.Cartesian3.add(t.velocity,r,t.velocity)},e=this,this.originalOptions=this.deepCopyObj(this.options),i=this.sdk.viewer.scene,n=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n),s=Cesium.Transforms.eastNorthUpToFixedFrame(o),Cesium.Matrix4.multiplyByScale(s,new Cesium.Cartesian3(1,1,1),s),r=new Cesium.Cartesian3,l=-3.8,c=Cesium.Cartesian3.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),u=Cesium.Cartesian3.fromDegrees(this.options.end.lng,this.options.end.lat,this.options.end.alt),this.options.heading||0===this.options.heading||(this.options.heading=C(c,u)),p=this.options.end.alt-this.options.start.alt,h=Cesium.Cartesian3.distance(c,Cesium.Cartesian3.fromDegrees(this.options.end.lng,this.options.end.lat,this.options.start.alt)),d=p?2*p/h:0,m=Math.atan(d)*(180/Math.PI),f=Math.sqrt(Math.abs(d)*h/-l),v=-l*f/Math.abs(Math.cos(m)),this.options.pitch||0===this.options.pitch||(this.options.pitch=90-m),this.options.speed||0===this.options.speed||(this.options.speed=v),g=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=i.primitives.add(new Cesium.ParticleSystem({show:!(g>=1e7)&&this.options.show,image:this.options.url||this.getSourceRootPath()+"/img/particlesystem/smoke.png",startColor:Cesium.Color.fromCssColorString(this.options.startColor),endColor:Cesium.Color.fromCssColorString(this.options.endColor),startScale:this.options.startScale,endScale:this.options.endScale,minimumParticleLife:this.options.minimumParticleLife,maximumParticleLife:this.options.maximumParticleLife,minimumSpeed:this.options.speed,maximumSpeed:this.options.speed,lifetime:.5,imageSize:new Cesium.Cartesian2(this.options.particleSize,2*this.options.particleSize),sizeInMeters:!0,emissionRate:this.options.emissionRate,loop:!0,emitter:new Cesium.CircleEmitter(.2),modelMatrix:s,emitterModelMatrix:b(),updateCallback:y})),this.particleSystem.id=this.options.id,this.entity=this.particleSystem,this.entity.position={lng:this.options.start.lng,lat:this.options.start.lat,alt:this.options.start.alt},Pe(this.sdk,this.options.id),this.options.show&&Kt(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(w.entity&&w.show){var t=w.sdk.viewer.camera.positionCartographic.height;w.entity.show=!(t>=1e7)}}));case 31:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Xu({},this.options.position):this.options.positions?l=Xu({},this.options.positions[0]):this.options.line&&this.options.line.positions?l=Xu({},this.options.line.positions[0]):this.options.center?l=Xu({},this.options.center):this.options.start?l=Xu({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=24;break;case 23:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt+500),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 24:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(t){var e=this;this.options.startColor=t,this.particleSystem.startColor=Cesium.Color.fromCssColorString(t),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.startColor=t},clear:function(){e.startColor="rgba(255,255,255,1)"}});e._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(t){var e=this;this.options.endColor=t,this.particleSystem.endColor=Cesium.Color.fromCssColorString(t),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.endColor=t},clear:function(){e.endColor="rgba(255,255,255,1)"}});e._elms.endColor[n]=o}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=Number(t),this.particleSystem.minimumSpeed=Number(t),this.particleSystem.maximumSpeed=Number(t),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=Number(t)}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(t){this.options.minimumParticleLife=Number(t),this.particleSystem.minimumParticleLife=Number(t),this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(e){e.value=Number(t)}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(t){this.options.maximumParticleLife=Number(t),this.particleSystem.maximumParticleLife=Number(t),this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(e){e.value=Number(t)}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(t){this.options.startScale=Number(t),this.particleSystem.startScale=Number(t),this._elms.startScale&&this._elms.startScale.forEach((function(e){e.value=Number(t)}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(t){this.options.endScale=Number(t),this.particleSystem.endScale=Number(t),this._elms.endScale&&this._elms.endScale.forEach((function(e){e.value=Number(t)}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(t){this.options.emissionRate=Number(t),this.particleSystem.emissionRate=Number(t),this._elms.emissionRate&&this._elms.emissionRate.forEach((function(e){e.value=Number(t)}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(t){this.options.particleSize=Number(t),this.particleSystem.minimumImageSize=new Cesium.Cartesian2(Number(t),2*Number(t)),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(Number(t),2*Number(t)),this._elms.particleSize&&this._elms.particleSize.forEach((function(e){e.value=Number(t)}))}},{key:"lng",get:function(){return this.options.start.lng},set:function(t){this.options.start.lng=t;var e=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.start.lng,lat:this.options.start.lat,alt:this.options.start.alt},this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.start.lat},set:function(t){this.options.start.lat=t;var e=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.start.lng,lat:this.options.start.lat,alt:this.options.start.alt},this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.start.alt},set:function(t){this.options.start.alt=t;var e=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.start.lng,lat:this.options.start.lat,alt:this.options.start.alt},this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"heading",get:function(){return this.options.heading},set:function(t){this.options.heading=Number(t);var e=Cesium.HeadingPitchRoll.fromDegrees(this.options.heading+90,this.options.pitch,0),i=new Cesium.TranslationRotationScale;//!!!发射粒子的方向 i.translation=Cesium.Cartesian3.fromElements(0,0,1),i.rotation=Cesium.Quaternion.fromHeadingPitchRoll(e);var n=Cesium.Matrix4.fromTranslationRotationScale(i);this.particleSystem.emitterModelMatrix=n,this._elms.heading&&this._elms.heading.forEach((function(e){e.value=Number(t)}))}},{key:"pitch",get:function(){return this.options.pitch},set:function(t){this.options.pitch=Number(t);var e=Cesium.HeadingPitchRoll.fromDegrees(this.options.heading+90,this.options.pitch,0),i=new Cesium.TranslationRotationScale;//!!!发射粒子的方向