var _typeof2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function _asyncToGenerator(e){return function(){var s=e.apply(this,arguments);return new Promise(function(n,a){return function t(e,i){try{var r=s[e](i),o=r.value}catch(e){return void a(e)}if(!r.done)return Promise.resolve(o).then(function(e){t("next",e)},function(e){t("throw",e)});n(o)}("next")})}}function _toConsumableArray2(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}!function(){var requirejs,require,define;function LonLatProjection(e,t){var a=e,s=t;this.project=function(e,t){var i=t.xMax-t.xMin,r=t.yMin-t.yMax,o=Math.abs(e[0]-t.xMin),n=e[1]-t.yMax;return{x:o/i*a,y:n/r*s}},this.unproject=function(e,t){var i=t.xMax-t.xMin,r=t.yMin-t.yMax;return[e.x/a*i,e.y/s*r]},this.getBoundingRect=function(e){for(var t,i,r=Number.MAX_VALUE,o={xMin:r,yMin:r,xMax:-r,yMax:-r},n=0,a=e.length;n<a;n++){var s=e[n].getBoundingRect();t={x:s.xMin,y:s.yMin},i={x:s.xMax,y:s.yMax},o.xMin=o.xMin<t.x?o.xMin:t.x,o.yMin=o.yMin<t.y?o.yMin:t.y,o.xMax=o.xMax>i.x?o.xMax:i.x,o.yMax=o.yMax>i.y?o.yMax:i.y}return o}}!function(m){var n,a,p,g,f={},v={},_={},y={},i=Object.prototype.hasOwnProperty,r=[].slice,C=/\.js$/;function w(e,t){return i.call(e,t)}function s(e,t){var i,r,o,n,a,s,l,u,c,h,d,m=t&&t.split("/"),p=_.map,g=p&&p["*"]||{};if(e){for(a=(e=e.split("/")).length-1,_.nodeIdCompat&&C.test(e[a])&&(e[a]=e[a].replace(C,"")),"."===e[0].charAt(0)&&m&&(e=m.slice(0,m.length-1).concat(e)),c=0;c<e.length;c++)if("."===(d=e[c]))e.splice(c,1),c-=1;else if(".."===d){if(0===c||1===c&&".."===e[2]||".."===e[c-1])continue;0<c&&(e.splice(c-1,2),c-=2)}e=e.join("/")}if((m||g)&&p){for(c=(i=e.split("/")).length;0<c;c-=1){if(r=i.slice(0,c).join("/"),m)for(h=m.length;0<h;h-=1)if((o=p[m.slice(0,h).join("/")])&&(o=o[r])){n=o,s=c;break}if(n)break;!l&&g&&g[r]&&(l=g[r],u=c)}!n&&l&&(n=l,s=u),n&&(i.splice(0,s,n),e=i.join("/"))}return e}function b(t,i){return function(){var e=r.call(arguments,0);return"string"!=typeof e[0]&&1===e.length&&e.push(null),a.apply(m,e.concat([t,i]))}}function E(t){return function(e){f[t]=e}}function S(e){if(w(v,e)){var t=v[e];delete v[e],y[e]=!0,n.apply(m,t)}if(!w(f,e)&&!w(y,e))throw new Error("No "+e);return f[e]}function l(e){var t,i=e?e.indexOf("!"):-1;return-1<i&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function P(e){return e?l(e):[]}p=function(e,t){var i,r,o=l(e),n=o[0],a=t[1];return e=o[1],n&&(i=S(n=s(n,a))),n?e=i&&i.normalize?i.normalize(e,(r=a,function(e){return s(e,r)})):s(e,a):(n=(o=l(e=s(e,a)))[0],e=o[1],n&&(i=S(n))),{f:n?n+"!"+e:e,n:e,pr:n,p:i}},g={require:function(e){return b(e)},exports:function(e){var t=f[e];return void 0!==t?t:f[e]={}},module:function(e){return{id:e,uri:"",exports:f[e],config:(t=e,function(){return _&&_.config&&_.config[t]||{}})};var t}},n=function(e,t,i,r){var o,n,a,s,l,u,c,h=[],d=void 0===i?"undefined":_typeof2(i);if(u=P(r=r||e),"undefined"===d||"function"===d){for(t=!t.length&&i.length?["require","exports","module"]:t,l=0;l<t.length;l+=1)if("require"===(n=(s=p(t[l],u)).f))h[l]=g.require(e);else if("exports"===n)h[l]=g.exports(e),c=!0;else if("module"===n)o=h[l]=g.module(e);else if(w(f,n)||w(v,n)||w(y,n))h[l]=S(n);else{if(!s.p)throw new Error(e+" missing "+n);s.p.load(s.n,b(r,!0),E(n),{}),h[l]=f[n]}a=i?i.apply(f[e],h):void 0,e&&(o&&o.exports!==m&&o.exports!==f[e]?f[e]=o.exports:a===m&&c||(f[e]=a))}else e&&(f[e]=i)},requirejs=require=a=function(e,t,i,r,o){if("string"==typeof e)return g[e]?g[e](t):S(p(e,P(t)).f);if(!e.splice){if((_=e).deps&&a(_.deps,_.callback),!t)return;t.splice?(e=t,t=i,i=null):e=m}return t=t||function(){},"function"==typeof i&&(i=r,r=o),r?n(m,e,t,i):setTimeout(function(){n(m,e,t,i)},4),a},a.config=function(e){return a(e)},requirejs._defined=f,(define=function(e,t,i){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(i=t,t=[]),w(f,e)||w(v,e)||(v[e]=[e,t,i])}).amd={jQuery:!0}}(),define("SGWorld/AttachEvent",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.AttachEvent=function(e,n){var a=this._viewer,s=this._cesium;if("OnLButtonClk"==e){var l=this._viewer.scene;return(t=new this._cesium.ScreenSpaceEventHandler(l.canvas)).setInputAction(function(e){var t=a.camera.pickEllipsoid(e.position,l.globe.ellipsoid),i=s.Cartographic.fromCartesian(t),r=s.Math.toDegrees(i.longitude),o=s.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),t}if("OnLButtonDblClk"==e){l=this._viewer.scene;return(t=new this._cesium.ScreenSpaceEventHandler(l.canvas)).setInputAction(function(e){var t=a.camera.pickEllipsoid(e.position,l.globe.ellipsoid),i=s.Cartographic.fromCartesian(t),r=s.Math.toDegrees(i.longitude),o=s.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),t}if("OnLButtonDown"==e){l=this._viewer.scene;return(t=new this._cesium.ScreenSpaceEventHandler(l.canvas)).setInputAction(function(e){var t=a.camera.pickEllipsoid(e.position,l.globe.ellipsoid),i=s.Cartographic.fromCartesian(t),r=s.Math.toDegrees(i.longitude),o=s.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.LEFT_DOWN),t}if("OnLButtonUp"==e){l=this._viewer.scene;return(t=new this._cesium.ScreenSpaceEventHandler(l.canvas)).setInputAction(function(e){var t=a.camera.pickEllipsoid(e.position,l.globe.ellipsoid),i=s.Cartographic.fromCartesian(t),r=s.Math.toDegrees(i.longitude),o=s.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.LEFT_UP),t}if("OnMButtonClk"==e){l=this._viewer.scene;return(t=new this._cesium.ScreenSpaceEventHandler(l.canvas)).setInputAction(function(e){var t=a.camera.pickEllipsoid(e.position,l.globe.ellipsoid),i=s.Cartographic.fromCartesian(t),r=s.Math.toDegrees(i.longitude),o=s.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.MIDDLE_CLICK),t}if("OnMButtonDown"==e){l=this._viewer.scene;return(t=new this._cesium.ScreenSpaceEventHandler(l.canvas)).setInputAction(function(e){var t=a.camera.pickEllipsoid(e.position,l.globe.ellipsoid),i=s.Cartographic.fromCartesian(t),r=s.Math.toDegrees(i.longitude),o=s.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.MIDDLE_DOWN),t}if("OnMButtonUp"==e){l=this._viewer.scene;return(t=new this._cesium.ScreenSpaceEventHandler(l.canvas)).setInputAction(function(e){var t=a.camera.pickEllipsoid(e.position,l.globe.ellipsoid),i=s.Cartographic.fromCartesian(t),r=s.Math.toDegrees(i.longitude),o=s.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.MIDDLE_UP),t}if("OnRButtonClk"==e){l=this._viewer.scene;return(t=new this._cesium.ScreenSpaceEventHandler(l.canvas)).setInputAction(function(e){var t=a.camera.pickEllipsoid(e.position,l.globe.ellipsoid),i=s.Cartographic.fromCartesian(t),r=s.Math.toDegrees(i.longitude),o=s.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),t}if("OnRButtonDown"==e){l=this._viewer.scene;return(t=new this._cesium.ScreenSpaceEventHandler(l.canvas)).setInputAction(function(e){var t=a.camera.pickEllipsoid(e.position,l.globe.ellipsoid),i=s.Cartographic.fromCartesian(t),r=s.Math.toDegrees(i.longitude),o=s.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),t}if("OnRButtonUp"==e){l=this._viewer.scene;return(t=new this._cesium.ScreenSpaceEventHandler(l.canvas)).setInputAction(function(e){var t=a.camera.pickEllipsoid(e.position,l.globe.ellipsoid),i=s.Cartographic.fromCartesian(t),r=s.Math.toDegrees(i.longitude),o=s.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.RIGHT_UP),t}if("OnMouseWheel"==e){l=this._viewer.scene;return(t=new this._cesium.ScreenSpaceEventHandler(l.canvas)).setInputAction(function(e){"function"==typeof n&&n(e)},this._cesium.ScreenSpaceEventType.WHEEL),t}if("OnFrame"==e){var t;l=this._viewer.scene;return(t=new this._cesium.ScreenSpaceEventHandler(l.canvas)).setInputAction(function(e){"function"==typeof n&&n(e)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),t}},e.prototype.AttachOnLButtonDblClkEvent=function(n){var a=this._viewer.scene,s=this._viewer,l=this._cesium,e=new this._cesium.ScreenSpaceEventHandler(a.canvas);return e.setInputAction(function(e){var t=s.camera.pickEllipsoid(e.position,a.globe.ellipsoid),i=l.Cartographic.fromCartesian(t),r=l.Math.toDegrees(i.longitude),o=l.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),e},e.prototype.AttachOnLButtonDownEvent=function(n){var a=this._viewer,s=this._cesium,l=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(l.canvas);return e.setInputAction(function(e){var t=a.camera.pickEllipsoid(e.position,l.globe.ellipsoid),i=s.Cartographic.fromCartesian(t),r=s.Math.toDegrees(i.longitude),o=s.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.LEFT_DOWN),e},e.prototype.AttachOnLButtonUpEvent=function(n){var a=this._viewer,s=this._cesium,l=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(l.canvas);return e.setInputAction(function(e){var t=a.camera.pickEllipsoid(e.position,l.globe.ellipsoid),i=s.Cartographic.fromCartesian(t),r=s.Math.toDegrees(i.longitude),o=s.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.LEFT_UP),e},e.prototype.AttachOnMButtonDblClkEvent=function(n){var a=this._viewer,s=this._cesium,l=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(l.canvas);return e.setInputAction(function(e){var t=a.camera.pickEllipsoid(e.position,l.globe.ellipsoid),i=s.Cartographic.fromCartesian(t),r=s.Math.toDegrees(i.longitude),o=s.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.MIDDLE_CLICK),e},e.prototype.AttachOnMButtonDownEvent=function(n){var a=this._viewer,s=this._cesium,l=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(l.canvas);return e.setInputAction(function(e){var t=a.camera.pickEllipsoid(e.position,l.globe.ellipsoid),i=s.Cartographic.fromCartesian(t),r=s.Math.toDegrees(i.longitude),o=s.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.MIDDLE_DOWN),e},e.prototype.AttachOnMButtonUpEvent=function(n){var a=this._viewer,s=this._cesium,l=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(l.canvas);return e.setInputAction(function(e){var t=a.camera.pickEllipsoid(e.position,l.globe.ellipsoid),i=s.Cartographic.fromCartesian(t),r=s.Math.toDegrees(i.longitude),o=s.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.MIDDLE_UP),e},e.prototype.AttachOnMouseWheelEvent=function(n){var a=this._viewer,s=this._cesium,l=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(l.canvas);return e.setInputAction(function(e){var t=a.camera.pickEllipsoid(e.position,l.globe.ellipsoid),i=s.Cartographic.fromCartesian(t),r=s.Math.toDegrees(i.longitude),o=s.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.WHEEL),e},e.prototype.AttachOnFrameEvent=function(t){this._viewer,this._cesium;var e=this._viewer.scene,i=new this._cesium.ScreenSpaceEventHandler(e.canvas);return i.setInputAction(function(e){"function"==typeof t&&t(e)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),i},e.prototype.AttachOnRButtonDownEvent=function(n){var a=this._viewer,s=this._cesium,l=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(l.canvas);return e.setInputAction(function(e){var t=a.camera.pickEllipsoid(e.position,l.globe.ellipsoid),i=s.Cartographic.fromCartesian(t),r=s.Math.toDegrees(i.longitude),o=s.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),e},e.prototype.AttachOnRButtonUpEvent=function(n){var a=this._viewer,s=this._cesium,l=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(l.canvas);return e.setInputAction(function(e){var t=a.camera.pickEllipsoid(e.position,l.globe.ellipsoid),i=s.Cartographic.fromCartesian(t),r=s.Math.toDegrees(i.longitude),o=s.Math.toDegrees(i.latitude);"function"==typeof n&&n(r,o,e)},this._cesium.ScreenSpaceEventType.RIGHT_UP),e},e.prototype.AttachCameraChangeEvent=function(e){this._viewer,this._cesium;this._viewer.scene.camera.percentageChanged=1e-6,this._viewer.scene.camera.changed.addEventListener(e)},e.prototype.CameraMoveEndEvent=function(e){var t=this._viewer,i=(this._cesium,!1);function r(){i=!0}function o(){i&&(e(),t.scene.camera.moveStart.removeEventListener(r),t.scene.camera.moveEnd.removeEventListener(o))}setTimeout(function(){t.scene.camera.moveStart.addEventListener(r),t.scene.camera.moveEnd.addEventListener(o)},0)},e}),define("SGWorld/configData",[],function(){return{testModel:"Workers/Model/xiaoche.gltf",flyModel:"Workers/Model/fly.glb",ModelLibrary:"http://183.162.245.49:1988/ModelLibrary/",divpoint:"Workers/image/divpoint.png",divpoint1:"Workers/image/divpoint1.png",richtextpoint:"Workers/image/richtextpoint1.png",mark:"Workers/image/mark.png",TrailLine:"Workers/image/TrailLine.png",colors3:"Workers/image/colors3.png",loading:"Workers/image/loading.gif",smog:"Workers/image/smog.png",penquan:"Workers/image/penquan.png",fire:"Workers/image/fire.png",bottomplane:"Workers/image/bottomplane.jpg",wall:"Workers/image/ggy.jpg",rotate:"Workers/image/rotate.png",move:"Workers/image/move.png",draw:"Workers/image/cursor/draw.cur"}}),define("SGWorld/CoordServices",[],function(){"use strict";var e={SetEllipsoidWGS84:function(e){e.Ellipsoid.WGS84=e.freezeObject(new e.Ellipsoid(6378137,6378137,6356752.314245179))},SetEllipsoidOGCS2000:function(e){e.Ellipsoid.WGS84=e.freezeObject(new e.Ellipsoid(6378137,6378137,6356752.314140356))}};return e}),define("SGWorld/DetachEvent",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.DetachEvent=function(e,t){"OnLButtonClk"==t?e&&(e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_CLICK),e.destroy()):"OnLButtonDblClk"==t?e&&(e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),e.destroy()):"OnLButtonDown"==t?e&&(e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOWN),e.destroy()):"OnLButtonUp"==t?e&&(e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_UP),e.destroy()):"OnMButtonClk"==t?e&&(e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_CLICK),e.destroy()):"OnMButtonDown"==t?e&&(e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_DOWN),e.destroy()):"OnMButtonUp"==t?e&&(e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_UP),e.destroy()):"OnRButtonClk"==t?e&&(e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_CLICK),e.destroy()):"OnRButtonDown"==t?e&&(e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_DOWN),e.destroy()):"OnRButtonUp"==t?e&&(e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_UP),e.destroy()):"OnMouseWheel"==t?e&&(e.removeInputAction(this._cesium.ScreenSpaceEventType.WHEEL),e.destroy()):"OnFrame"==t&&e&&(e.removeInputAction(this._cesium.ScreenSpaceEventType.MOUSE_MOVE),e.destroy())},e.prototype.DetachEventAll=function(e){e&&(e.destroy(),e=null)},e.prototype.RemoNormalCesiumLeftDoubleClick=function(){this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)},e.prototype.DetachCameraChangeEvent=function(e){this._viewer;this._viewer.scene.camera.percentageChanged=.5,this._viewer.scene.camera.changed.removeEventListener(e)},e}),function(e){if("object"===("undefined"==typeof exports?"undefined":_typeof2(exports))&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define("SGWorld/pako_inflate",[],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pako=e()}}(function(){return function n(a,s,l){function u(i,e){if(!s[i]){if(!a[i]){var t="function"==typeof require&&require;if(!e&&t)return t(i,!0);if(c)return c(i,!0);var r=new Error("Cannot find module '"+i+"'");throw r.code="MODULE_NOT_FOUND",r}var o=s[i]={exports:{}};a[i][0].call(o.exports,function(e){var t=a[i][1][e];return u(t||e)},o,o.exports,n,a,s,l)}return s[i].exports}for(var c="function"==typeof require&&require,e=0;e<l.length;e++)u(l[e]);return u}({1:[function(e,t,i){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;i.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if("object"!==(void 0===i?"undefined":_typeof2(i)))throw new TypeError(i+"must be non-object");for(var r in i)i.hasOwnProperty(r)&&(e[r]=i[r])}}return e},i.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var o={arraySet:function(e,t,i,r,o){if(t.subarray&&e.subarray)e.set(t.subarray(i,i+r),o);else for(var n=0;n<r;n++)e[o+n]=t[i+n]},flattenChunks:function(e){var t,i,r,o,n,a;for(t=r=0,i=e.length;t<i;t++)r+=e[t].length;for(a=new Uint8Array(r),t=o=0,i=e.length;t<i;t++)n=e[t],a.set(n,o),o+=n.length;return a}},n={arraySet:function(e,t,i,r,o){for(var n=0;n<r;n++)e[o+n]=t[i+n]},flattenChunks:function(e){return[].concat.apply([],e)}};i.setTyped=function(e){e?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,o)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,n))},i.setTyped(r)},{}],2:[function(e,t,i){"use strict";var l=e("./common"),o=!0,n=!0;try{String.fromCharCode.apply(null,[0])}catch(e){o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){n=!1}for(var u=new l.Buf8(256),r=0;r<256;r++)u[r]=252<=r?6:248<=r?5:240<=r?4:224<=r?3:192<=r?2:1;function c(e,t){if(t<65537&&(e.subarray&&n||!e.subarray&&o))return String.fromCharCode.apply(null,l.shrinkBuf(e,t));for(var i="",r=0;r<t;r++)i+=String.fromCharCode(e[r]);return i}u[254]=u[254]=1,i.string2buf=function(e){var t,i,r,o,n,a=e.length,s=0;for(o=0;o<a;o++)55296==(64512&(i=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=e.charCodeAt(o+1)))&&(i=65536+(i-55296<<10)+(r-56320),o++),s+=i<128?1:i<2048?2:i<65536?3:4;for(t=new l.Buf8(s),o=n=0;n<s;o++)55296==(64512&(i=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=e.charCodeAt(o+1)))&&(i=65536+(i-55296<<10)+(r-56320),o++),i<128?t[n++]=i:(i<2048?t[n++]=192|i>>>6:(i<65536?t[n++]=224|i>>>12:(t[n++]=240|i>>>18,t[n++]=128|i>>>12&63),t[n++]=128|i>>>6&63),t[n++]=128|63&i);return t},i.buf2binstring=function(e){return c(e,e.length)},i.binstring2buf=function(e){for(var t=new l.Buf8(e.length),i=0,r=t.length;i<r;i++)t[i]=e.charCodeAt(i);return t},i.buf2string=function(e,t){var i,r,o,n,a=t||e.length,s=new Array(2*a);for(i=r=0;i<a;)if((o=e[i++])<128)s[r++]=o;else if(4<(n=u[o]))s[r++]=65533,i+=n-1;else{for(o&=2===n?31:3===n?15:7;1<n&&i<a;)o=o<<6|63&e[i++],n--;1<n?s[r++]=65533:o<65536?s[r++]=o:(o-=65536,s[r++]=55296|o>>10&1023,s[r++]=56320|1023&o)}return c(s,r)},i.utf8border=function(e,t){var i;for((t=t||e.length)>e.length&&(t=e.length),i=t-1;0<=i&&128==(192&e[i]);)i--;return i<0?t:0===i?t:i+u[e[i]]>t?i:t}},{"./common":1}],3:[function(e,t,i){"use strict";t.exports=function(e,t,i,r){for(var o=65535&e|0,n=e>>>16&65535|0,a=0;0!==i;){for(i-=a=2e3<i?2e3:i;n=n+(o=o+t[r++]|0)|0,--a;);o%=65521,n%=65521}return o|n<<16|0}},{}],4:[function(e,t,i){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,i){"use strict";var s=function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}();t.exports=function(e,t,i,r){var o=s,n=r+i;e^=-1;for(var a=r;a<n;a++)e=e>>>8^o[255&(e^t[a])];return-1^e}},{}],6:[function(e,t,i){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],7:[function(e,t,i){"use strict";t.exports=function(e,t){var i,r,o,n,a,s,l,u,c,h,d,m,p,g,f,v,_,y,C,w,b,E,S,P,x;i=e.state,r=e.next_in,P=e.input,o=r+(e.avail_in-5),n=e.next_out,x=e.output,a=n-(t-e.avail_out),s=n+(e.avail_out-257),l=i.dmax,u=i.wsize,c=i.whave,h=i.wnext,d=i.window,m=i.hold,p=i.bits,g=i.lencode,f=i.distcode,v=(1<<i.lenbits)-1,_=(1<<i.distbits)-1;e:do{p<15&&(m+=P[r++]<<p,p+=8,m+=P[r++]<<p,p+=8),y=g[m&v];t:for(;;){if(m>>>=C=y>>>24,p-=C,0===(C=y>>>16&255))x[n++]=65535&y;else{if(!(16&C)){if(0==(64&C)){y=g[(65535&y)+(m&(1<<C)-1)];continue t}if(32&C){i.mode=12;break e}e.msg="invalid literal/length code",i.mode=30;break e}w=65535&y,(C&=15)&&(p<C&&(m+=P[r++]<<p,p+=8),w+=m&(1<<C)-1,m>>>=C,p-=C),p<15&&(m+=P[r++]<<p,p+=8,m+=P[r++]<<p,p+=8),y=f[m&_];i:for(;;){if(m>>>=C=y>>>24,p-=C,!(16&(C=y>>>16&255))){if(0==(64&C)){y=f[(65535&y)+(m&(1<<C)-1)];continue i}e.msg="invalid distance code",i.mode=30;break e}if(b=65535&y,p<(C&=15)&&(m+=P[r++]<<p,(p+=8)<C&&(m+=P[r++]<<p,p+=8)),l<(b+=m&(1<<C)-1)){e.msg="invalid distance too far back",i.mode=30;break e}if(m>>>=C,p-=C,(C=n-a)<b){if(c<(C=b-C)&&i.sane){e.msg="invalid distance too far back",i.mode=30;break e}if(S=d,(E=0)===h){if(E+=u-C,C<w){for(w-=C;x[n++]=d[E++],--C;);E=n-b,S=x}}else if(h<C){if(E+=u+h-C,(C-=h)<w){for(w-=C;x[n++]=d[E++],--C;);if(E=0,h<w){for(w-=C=h;x[n++]=d[E++],--C;);E=n-b,S=x}}}else if(E+=h-C,C<w){for(w-=C;x[n++]=d[E++],--C;);E=n-b,S=x}for(;2<w;)x[n++]=S[E++],x[n++]=S[E++],x[n++]=S[E++],w-=3;w&&(x[n++]=S[E++],1<w&&(x[n++]=S[E++]))}else{for(E=n-b;x[n++]=x[E++],x[n++]=x[E++],x[n++]=x[E++],2<(w-=3););w&&(x[n++]=x[E++],1<w&&(x[n++]=x[E++]))}break}}break}}while(r<o&&n<s);r-=w=p>>3,m&=(1<<(p-=w<<3))-1,e.next_in=r,e.next_out=n,e.avail_in=r<o?o-r+5:5-(r-o),e.avail_out=n<s?s-n+257:257-(n-s),i.hold=m,i.bits=p}},{}],8:[function(e,t,i){"use strict";var D=e("../utils/common"),L=e("./adler32"),M=e("./crc32"),A=e("./inffast"),R=e("./inftrees"),O=1,N=2,V=0,F=-2,H=1,r=852,o=592;function G(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function n(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new D.Buf16(320),this.work=new D.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=H,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new D.Buf32(r),t.distcode=t.distdyn=new D.Buf32(o),t.sane=1,t.back=-1,V):F}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):F}function l(e,t){var i,r;return e&&e.state?(r=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?F:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=i,r.wbits=t,s(e))):F}function u(e,t){var i,r;return e?(r=new n,(e.state=r).window=null,(i=l(e,t))!==V&&(e.state=null),i):F}var c,h,d=!0;function k(e){if(d){var t;for(c=new D.Buf32(512),h=new D.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(R(O,e.lens,0,288,c,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;R(N,e.lens,0,32,h,0,e.work,{bits:5}),d=!1}e.lencode=c,e.lenbits=9,e.distcode=h,e.distbits=5}function B(e,t,i,r){var o,n=e.state;return null===n.window&&(n.wsize=1<<n.wbits,n.wnext=0,n.whave=0,n.window=new D.Buf8(n.wsize)),r>=n.wsize?(D.arraySet(n.window,t,i-n.wsize,n.wsize,0),n.wnext=0,n.whave=n.wsize):(r<(o=n.wsize-n.wnext)&&(o=r),D.arraySet(n.window,t,i-r,o,n.wnext),(r-=o)?(D.arraySet(n.window,t,i-r,r,0),n.wnext=r,n.whave=n.wsize):(n.wnext+=o,n.wnext===n.wsize&&(n.wnext=0),n.whave<n.wsize&&(n.whave+=o))),0}i.inflateReset=s,i.inflateReset2=l,i.inflateResetKeep=a,i.inflateInit=function(e){return u(e,15)},i.inflateInit2=u,i.inflate=function(e,t){var i,r,o,n,a,s,l,u,c,h,d,m,p,g,f,v,_,y,C,w,b,E,S,P,x=0,T=new D.Buf8(4),I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return F;12===(i=e.state).mode&&(i.mode=13),a=e.next_out,o=e.output,l=e.avail_out,n=e.next_in,r=e.input,s=e.avail_in,u=i.hold,c=i.bits,h=s,d=l,E=V;e:for(;;)switch(i.mode){case H:if(0===i.wrap){i.mode=13;break}for(;c<16;){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}if(2&i.wrap&&35615===u){T[i.check=0]=255&u,T[1]=u>>>8&255,i.check=M(i.check,T,2,0),c=u=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",i.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",i.mode=30;break}if(c-=4,b=8+(15&(u>>>=4)),0===i.wbits)i.wbits=b;else if(b>i.wbits){e.msg="invalid window size",i.mode=30;break}i.dmax=1<<b,e.adler=i.check=1,i.mode=512&u?10:12,c=u=0;break;case 2:for(;c<16;){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}if(i.flags=u,8!=(255&i.flags)){e.msg="unknown compression method",i.mode=30;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=30;break}i.head&&(i.head.text=u>>8&1),512&i.flags&&(T[0]=255&u,T[1]=u>>>8&255,i.check=M(i.check,T,2,0)),c=u=0,i.mode=3;case 3:for(;c<32;){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}i.head&&(i.head.time=u),512&i.flags&&(T[0]=255&u,T[1]=u>>>8&255,T[2]=u>>>16&255,T[3]=u>>>24&255,i.check=M(i.check,T,4,0)),c=u=0,i.mode=4;case 4:for(;c<16;){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}i.head&&(i.head.xflags=255&u,i.head.os=u>>8),512&i.flags&&(T[0]=255&u,T[1]=u>>>8&255,i.check=M(i.check,T,2,0)),c=u=0,i.mode=5;case 5:if(1024&i.flags){for(;c<16;){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}i.length=u,i.head&&(i.head.extra_len=u),512&i.flags&&(T[0]=255&u,T[1]=u>>>8&255,i.check=M(i.check,T,2,0)),c=u=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(s<(m=i.length)&&(m=s),m&&(i.head&&(b=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),D.arraySet(i.head.extra,r,n,m,b)),512&i.flags&&(i.check=M(i.check,r,m,n)),s-=m,n+=m,i.length-=m),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===s)break e;for(m=0;b=r[n+m++],i.head&&b&&i.length<65536&&(i.head.name+=String.fromCharCode(b)),b&&m<s;);if(512&i.flags&&(i.check=M(i.check,r,m,n)),s-=m,n+=m,b)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===s)break e;for(m=0;b=r[n+m++],i.head&&b&&i.length<65536&&(i.head.comment+=String.fromCharCode(b)),b&&m<s;);if(512&i.flags&&(i.check=M(i.check,r,m,n)),s-=m,n+=m,b)break e}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;c<16;){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}if(u!==(65535&i.check)){e.msg="header crc mismatch",i.mode=30;break}c=u=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=12;break;case 10:for(;c<32;){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}e.adler=i.check=G(u),c=u=0,i.mode=11;case 11:if(0===i.havedict)return e.next_out=a,e.avail_out=l,e.next_in=n,e.avail_in=s,i.hold=u,i.bits=c,2;e.adler=i.check=1,i.mode=12;case 12:if(5===t||6===t)break e;case 13:if(i.last){u>>>=7&c,c-=7&c,i.mode=27;break}for(;c<3;){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}switch(i.last=1&u,c-=1,3&(u>>>=1)){case 0:i.mode=14;break;case 1:if(k(i),i.mode=20,6!==t)break;u>>>=2,c-=2;break e;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=30}u>>>=2,c-=2;break;case 14:for(u>>>=7&c,c-=7&c;c<32;){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}if((65535&u)!=(u>>>16^65535)){e.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&u,c=u=0,i.mode=15,6===t)break e;case 15:i.mode=16;case 16:if(m=i.length){if(s<m&&(m=s),l<m&&(m=l),0===m)break e;D.arraySet(o,r,n,m,a),s-=m,n+=m,l-=m,a+=m,i.length-=m;break}i.mode=12;break;case 17:for(;c<14;){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}if(i.nlen=257+(31&u),u>>>=5,c-=5,i.ndist=1+(31&u),u>>>=5,c-=5,i.ncode=4+(15&u),u>>>=4,c-=4,286<i.nlen||30<i.ndist){e.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;c<3;){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}i.lens[I[i.have++]]=7&u,u>>>=3,c-=3}for(;i.have<19;)i.lens[I[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,S={bits:i.lenbits},E=R(0,i.lens,0,19,i.lencode,0,i.work,S),i.lenbits=S.bits,E){e.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;v=(x=i.lencode[u&(1<<i.lenbits)-1])>>>16&255,_=65535&x,!((f=x>>>24)<=c);){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}if(_<16)u>>>=f,c-=f,i.lens[i.have++]=_;else{if(16===_){for(P=f+2;c<P;){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}if(u>>>=f,c-=f,0===i.have){e.msg="invalid bit length repeat",i.mode=30;break}b=i.lens[i.have-1],m=3+(3&u),u>>>=2,c-=2}else if(17===_){for(P=f+3;c<P;){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}c-=f,b=0,m=3+(7&(u>>>=f)),u>>>=3,c-=3}else{for(P=f+7;c<P;){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}c-=f,b=0,m=11+(127&(u>>>=f)),u>>>=7,c-=7}if(i.have+m>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=30;break}for(;m--;)i.lens[i.have++]=b}}if(30===i.mode)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,S={bits:i.lenbits},E=R(O,i.lens,0,i.nlen,i.lencode,0,i.work,S),i.lenbits=S.bits,E){e.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,S={bits:i.distbits},E=R(N,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,S),i.distbits=S.bits,E){e.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===t)break e;case 20:i.mode=21;case 21:if(6<=s&&258<=l){e.next_out=a,e.avail_out=l,e.next_in=n,e.avail_in=s,i.hold=u,i.bits=c,A(e,d),a=e.next_out,o=e.output,l=e.avail_out,n=e.next_in,r=e.input,s=e.avail_in,u=i.hold,c=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;v=(x=i.lencode[u&(1<<i.lenbits)-1])>>>16&255,_=65535&x,!((f=x>>>24)<=c);){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}if(v&&0==(240&v)){for(y=f,C=v,w=_;v=(x=i.lencode[w+((u&(1<<y+C)-1)>>y)])>>>16&255,_=65535&x,!(y+(f=x>>>24)<=c);){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}u>>>=y,c-=y,i.back+=y}if(u>>>=f,c-=f,i.back+=f,i.length=_,0===v){i.mode=26;break}if(32&v){i.back=-1,i.mode=12;break}if(64&v){e.msg="invalid literal/length code",i.mode=30;break}i.extra=15&v,i.mode=22;case 22:if(i.extra){for(P=i.extra;c<P;){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}i.length+=u&(1<<i.extra)-1,u>>>=i.extra,c-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;v=(x=i.distcode[u&(1<<i.distbits)-1])>>>16&255,_=65535&x,!((f=x>>>24)<=c);){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}if(0==(240&v)){for(y=f,C=v,w=_;v=(x=i.distcode[w+((u&(1<<y+C)-1)>>y)])>>>16&255,_=65535&x,!(y+(f=x>>>24)<=c);){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}u>>>=y,c-=y,i.back+=y}if(u>>>=f,c-=f,i.back+=f,64&v){e.msg="invalid distance code",i.mode=30;break}i.offset=_,i.extra=15&v,i.mode=24;case 24:if(i.extra){for(P=i.extra;c<P;){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}i.offset+=u&(1<<i.extra)-1,u>>>=i.extra,c-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===l)break e;if(m=d-l,i.offset>m){if((m=i.offset-m)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=30;break}p=m>i.wnext?(m-=i.wnext,i.wsize-m):i.wnext-m,m>i.length&&(m=i.length),g=i.window}else g=o,p=a-i.offset,m=i.length;for(l<m&&(m=l),l-=m,i.length-=m;o[a++]=g[p++],--m;);0===i.length&&(i.mode=21);break;case 26:if(0===l)break e;o[a++]=i.length,l--,i.mode=21;break;case 27:if(i.wrap){for(;c<32;){if(0===s)break e;s--,u|=r[n++]<<c,c+=8}if(d-=l,e.total_out+=d,i.total+=d,d&&(e.adler=i.check=i.flags?M(i.check,o,d,a-d):L(i.check,o,d,a-d)),d=l,(i.flags?u:G(u))!==i.check){e.msg="incorrect data check",i.mode=30;break}c=u=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;c<32;){if(0===s)break e;s--,u+=r[n++]<<c,c+=8}if(u!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=30;break}c=u=0}i.mode=29;case 29:E=1;break e;case 30:E=-3;break e;case 31:return-4;case 32:default:return F}return e.next_out=a,e.avail_out=l,e.next_in=n,e.avail_in=s,i.hold=u,i.bits=c,(i.wsize||d!==e.avail_out&&i.mode<30&&(i.mode<27||4!==t))&&B(e,e.output,e.next_out,d-e.avail_out)?(i.mode=31,-4):(h-=e.avail_in,d-=e.avail_out,e.total_in+=h,e.total_out+=d,i.total+=d,i.wrap&&d&&(e.adler=i.check=i.flags?M(i.check,o,d,e.next_out-d):L(i.check,o,d,e.next_out-d)),e.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),(0===h&&0===d||4===t)&&E===V&&(E=-5),E)},i.inflateEnd=function(e){if(!e||!e.state)return F;var t=e.state;return t.window&&(t.window=null),e.state=null,V},i.inflateGetHeader=function(e,t){var i;return e&&e.state?0==(2&(i=e.state).wrap)?F:((i.head=t).done=!1,V):F},i.inflateSetDictionary=function(e,t){var i,r=t.length;return e&&e.state?0!==(i=e.state).wrap&&11!==i.mode?F:11===i.mode&&L(1,t,r,0)!==i.check?-3:B(e,t,r,r)?(i.mode=31,-4):(i.havedict=1,V):F},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,i){"use strict";var O=e("../utils/common"),N=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],V=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],F=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],H=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,i,r,o,n,a,s){var l,u,c,h,d,m,p,g,f,v=s.bits,_=0,y=0,C=0,w=0,b=0,E=0,S=0,P=0,x=0,T=0,I=null,D=0,L=new O.Buf16(16),M=new O.Buf16(16),A=null,R=0;for(_=0;_<=15;_++)L[_]=0;for(y=0;y<r;y++)L[t[i+y]]++;for(b=v,w=15;1<=w&&0===L[w];w--);if(w<b&&(b=w),0===w)return o[n++]=20971520,o[n++]=20971520,s.bits=1,0;for(C=1;C<w&&0===L[C];C++);for(b<C&&(b=C),_=P=1;_<=15;_++)if(P<<=1,(P-=L[_])<0)return-1;if(0<P&&(0===e||1!==w))return-1;for(M[1]=0,_=1;_<15;_++)M[_+1]=M[_]+L[_];for(y=0;y<r;y++)0!==t[i+y]&&(a[M[t[i+y]]++]=y);if(m=0===e?(I=A=a,19):1===e?(I=N,D-=257,A=V,R-=257,256):(I=F,A=H,-1),_=C,d=n,S=y=T=0,c=-1,h=(x=1<<(E=b))-1,1===e&&852<x||2===e&&592<x)return 1;for(;;){for(p=_-S,f=a[y]<m?(g=0,a[y]):a[y]>m?(g=A[R+a[y]],I[D+a[y]]):(g=96,0),l=1<<_-S,C=u=1<<E;o[d+(T>>S)+(u-=l)]=p<<24|g<<16|f|0,0!==u;);for(l=1<<_-1;T&l;)l>>=1;if(0!==l?(T&=l-1,T+=l):T=0,y++,0==--L[_]){if(_===w)break;_=t[i+a[y]]}if(b<_&&(T&h)!==c){for(0===S&&(S=b),d+=C,P=1<<(E=_-S);E+S<w&&!((P-=L[E+S])<=0);)E++,P<<=1;if(x+=1<<E,1===e&&852<x||2===e&&592<x)return 1;o[c=T&h]=b<<24|E<<16|d-n|0}}return 0!==T&&(o[d+T]=_-S<<24|64<<16|0),s.bits=b,0}},{"../utils/common":1}],10:[function(e,t,i){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,i){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/inflate.js":[function(e,t,i){"use strict";var d=e("./zlib/inflate"),m=e("./utils/common"),p=e("./utils/strings"),g=e("./zlib/constants"),r=e("./zlib/messages"),o=e("./zlib/zstream"),n=e("./zlib/gzheader"),f=Object.prototype.toString;function a(e){if(!(this instanceof a))return new a(e);this.options=m.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var i=d.inflateInit2(this.strm,t.windowBits);if(i!==g.Z_OK)throw new Error(r[i]);this.header=new n,d.inflateGetHeader(this.strm,this.header)}function s(e,t){var i=new a(t);if(i.push(e,!0),i.err)throw i.msg||r[i.err];return i.result}a.prototype.push=function(e,t){var i,r,o,n,a,s,l=this.strm,u=this.options.chunkSize,c=this.options.dictionary,h=!1;if(this.ended)return!1;r=t===~~t?t:!0===t?g.Z_FINISH:g.Z_NO_FLUSH,"string"==typeof e?l.input=p.binstring2buf(e):"[object ArrayBuffer]"===f.call(e)?l.input=new Uint8Array(e):l.input=e,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new m.Buf8(u),l.next_out=0,l.avail_out=u),(i=d.inflate(l,g.Z_NO_FLUSH))===g.Z_NEED_DICT&&c&&(s="string"==typeof c?p.string2buf(c):"[object ArrayBuffer]"===f.call(c)?new Uint8Array(c):c,i=d.inflateSetDictionary(this.strm,s)),i===g.Z_BUF_ERROR&&!0===h&&(i=g.Z_OK,h=!1),i!==g.Z_STREAM_END&&i!==g.Z_OK)return this.onEnd(i),!(this.ended=!0);l.next_out&&(0!==l.avail_out&&i!==g.Z_STREAM_END&&(0!==l.avail_in||r!==g.Z_FINISH&&r!==g.Z_SYNC_FLUSH)||("string"===this.options.to?(o=p.utf8border(l.output,l.next_out),n=l.next_out-o,a=p.buf2string(l.output,o),l.next_out=n,l.avail_out=u-n,n&&m.arraySet(l.output,l.output,o,n,0),this.onData(a)):this.onData(m.shrinkBuf(l.output,l.next_out)))),0===l.avail_in&&0===l.avail_out&&(h=!0)}while((0<l.avail_in||0===l.avail_out)&&i!==g.Z_STREAM_END);return i===g.Z_STREAM_END&&(r=g.Z_FINISH),r===g.Z_FINISH?(i=d.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===g.Z_OK):r!==g.Z_SYNC_FLUSH||(this.onEnd(g.Z_OK),!(l.avail_out=0))},a.prototype.onData=function(e){this.chunks.push(e)},a.prototype.onEnd=function(e){e===g.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=m.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},i.Inflate=a,i.inflate=s,i.inflateRaw=function(e,t){return(t=t||{}).raw=!0,s(e,t)},i.ungzip=s},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")}),define("SGWorld/Navigate/zoomIn",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.zoomIn=function(){var e=.6*Math.ceil(this._viewer.camera.positionCartographic.height);return this._viewer.camera.zoomIn(e)},e}),define("SGWorld/Navigate/zoomOut",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.zoomOut=function(){var e=.6*Math.ceil(this._viewer.camera.positionCartographic.height);return this._viewer.camera.zoomOut(e)},e}),define("SGWorld/Navigate/flyTo",[],function(){"use strict";function e(e,t,i){this._viewer=e,this._cesium=t,this._tree=i}return e.prototype.flyTo=function(e,t){if(0==t)for(var i=0;i<this._tree.length;i++)if(e==this._tree[i].id)return this._viewer.camera.flyTo({destination:this._cesium.Cartesian3.fromDegrees(this._tree[i].postion[0],this._tree[i].postion[1],this._tree[i].postion[2])})},e.prototype.flyToPointsInterest=function(e,t){return this._viewer.camera.flyTo({destination:e.destination,orientation:e.orientation,duration:e.duration,complete:t})},e.prototype.flyToPosition=function(e,t,i){Math.abs(e)<=180&&Math.abs(t)<=90?this._viewer.camera.flyTo({destination:this._cesium.Cartesian3.fromDegrees(e,t,i)}):this._viewer.camera.flyTo({destination:{x:e,y:t,z:i}})},e}),function(){function Kn(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}function $n(e,t,i,r){for(var o=-1,n=null==e?0:e.length;++o<n;){var a=e[o];t(r,a,i(a),e)}return r}function Zn(e,t){for(var i=-1,r=null==e?0:e.length;++i<r&&!1!==t(e[i],i,e););return e}function ea(e,t){for(var i=-1,r=null==e?0:e.length;++i<r;)if(!t(e[i],i,e))return!1;return!0}function ta(e,t){for(var i=-1,r=null==e?0:e.length,o=0,n=[];++i<r;){var a=e[i];t(a,i,e)&&(n[o++]=a)}return n}function ia(e,t){return!(null==e||!e.length)&&-1<ha(e,t,0)}function ra(e,t,i){for(var r=-1,o=null==e?0:e.length;++r<o;)if(i(t,e[r]))return!0;return!1}function oa(e,t){for(var i=-1,r=null==e?0:e.length,o=Array(r);++i<r;)o[i]=t(e[i],i,e);return o}function na(e,t){for(var i=-1,r=t.length,o=e.length;++i<r;)e[o+i]=t[i];return e}function aa(e,t,i,r){var o=-1,n=null==e?0:e.length;for(r&&n&&(i=e[++o]);++o<n;)i=t(i,e[o],o,e);return i}function sa(e,t,i,r){var o=null==e?0:e.length;for(r&&o&&(i=e[--o]);o--;)i=t(i,e[o],o,e);return i}function la(e,t){for(var i=-1,r=null==e?0:e.length;++i<r;)if(t(e[i],i,e))return!0;return!1}function ua(e,r,t){var o;return t(e,function(e,t,i){if(r(e,t,i))return o=t,!1}),o}function ca(e,t,i,r){for(var o=e.length,n=i+(r?1:-1);r?n--:++n<o;)if(t(e[n],n,e))return n;return-1}function ha(e,t,i){return t==t?function(e,t,i){for(var r=i-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}(e,t,i):ca(e,ma,i)}function da(e,t,i,r){for(var o=i-1,n=e.length;++o<n;)if(r(e[o],t))return o;return-1}function ma(e){return e!=e}function pa(e,t){var i=null==e?0:e.length;return i?va(e,t)/i:Ha}function ga(t){return function(e){return null==e?Aa:e[t]}}function e(t){return function(e){return null==t?Aa:t[e]}}function fa(e,r,o,n,t){return t(e,function(e,t,i){o=n?(n=!1,e):r(o,e,t,i)}),o}function va(e,t){for(var i,r=-1,o=e.length;++r<o;){var n=t(e[r]);n!==Aa&&(i=i===Aa?n:i+n)}return i}function _a(e,t){for(var i=-1,r=Array(e);++i<e;)r[i]=t(i);return r}function ya(t){return function(e){return t(e)}}function Ca(t,e){return oa(e,function(e){return t[e]})}function wa(e,t){return e.has(t)}function ba(e,t){for(var i=-1,r=e.length;++i<r&&-1<ha(t,e[i],0););return i}function Ea(e,t){for(var i=e.length;i--&&-1<ha(t,e[i],0););return i}function Sa(e){return"\\"+R[e]}function Pa(e){return A.test(e)}function xa(e){var i=-1,r=Array(e.size);return e.forEach(function(e,t){r[++i]=[t,e]}),r}function Ta(t,i){return function(e){return t(i(e))}}function Ia(e,t){for(var i=-1,r=e.length,o=0,n=[];++i<r;){var a=e[i];a!==t&&a!==Na||(e[i]=Na,n[o++]=i)}return n}function Da(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}function La(e){return Pa(e)?function(e){for(var t=M.lastIndex=0;M.test(e);)++t;return t}(e):k(e)}function Ma(e){return Pa(e)?e.match(M)||[]:e.split("")}var Aa,Ra="Expected a function",Oa="__lodash_hash_undefined__",Na="__lodash_placeholder__",Va=128,Fa=9007199254740991,Ha=NaN,Ga=4294967295,ka=[["ary",Va],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],Ba="[object Arguments]",ja="[object Array]",za="[object Boolean]",Wa="[object Date]",Ua="[object Error]",qa="[object Function]",Ya="[object GeneratorFunction]",Xa="[object Map]",Ja="[object Number]",Qa="[object Object]",Ka="[object Promise]",$a="[object RegExp]",Za="[object Set]",es="[object String]",ts="[object Symbol]",is="[object WeakMap]",rs="[object ArrayBuffer]",os="[object DataView]",ns="[object Float32Array]",as="[object Float64Array]",ss="[object Int8Array]",ls="[object Int16Array]",us="[object Int32Array]",cs="[object Uint8Array]",hs="[object Uint8ClampedArray]",ds="[object Uint16Array]",ms="[object Uint32Array]",ps=/\b__p \+= '';/g,gs=/\b(__p \+=) '' \+/g,fs=/(__e\(.*?\)|\b__t\)) \+\n'';/g,vs=/&(?:amp|lt|gt|quot|#39);/g,_s=/[&<>"']/g,ys=RegExp(vs.source),Cs=RegExp(_s.source),ws=/<%-([\s\S]+?)%>/g,bs=/<%([\s\S]+?)%>/g,Es=/<%=([\s\S]+?)%>/g,Ss=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ps=/^\w*$/,xs=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ts=/[\\^$.*+?()[\]{}|]/g,Is=RegExp(Ts.source),Ds=/^\s+|\s+$/g,Ls=/^\s+/,Ms=/\s+$/,As=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Rs=/\{\n\/\* \[wrapped with (.+)\] \*/,Os=/,? & /,Ns=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Vs=/\\(\\)?/g,Fs=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Hs=/\w*$/,Gs=/^[-+]0x[0-9a-f]+$/i,ks=/^0b[01]+$/i,Bs=/^\[object .+?Constructor\]$/,js=/^0o[0-7]+$/i,zs=/^(?:0|[1-9]\d*)$/,Ws=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Us=/($^)/,qs=/['\n\r\u2028\u2029\\]/g,t="\\ud800-\\udfff",i="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",r="\\u2700-\\u27bf",o="a-z\\xdf-\\xf6\\xf8-\\xff",n="A-Z\\xc0-\\xd6\\xd8-\\xde",a="\\ufe0e\\ufe0f",s="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",l="['’]",u="["+t+"]",c="["+s+"]",h="["+i+"]",d="\\d+",m="["+r+"]",p="["+o+"]",g="[^"+t+s+d+r+o+n+"]",f="\\ud83c[\\udffb-\\udfff]",v="[^"+t+"]",_="(?:\\ud83c[\\udde6-\\uddff]){2}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",C="["+n+"]",w="\\u200d",b="(?:"+p+"|"+g+")",E="(?:"+C+"|"+g+")",S="(?:['’](?:d|ll|m|re|s|t|ve))?",P="(?:['’](?:D|LL|M|RE|S|T|VE))?",x="(?:"+h+"|"+f+")"+"?",T="["+a+"]?",I=T+x+("(?:"+w+"(?:"+[v,_,y].join("|")+")"+T+x+")*"),D="(?:"+[m,_,y].join("|")+")"+I,L="(?:"+[v+h+"?",h,_,y,u].join("|")+")",Ys=RegExp(l,"g"),Xs=RegExp(h,"g"),M=RegExp(f+"(?="+f+")|"+L+I,"g"),Js=RegExp([C+"?"+p+"+"+S+"(?="+[c,C,"$"].join("|")+")",E+"+"+P+"(?="+[c,C+b,"$"].join("|")+")",C+"?"+b+"+"+S,C+"+"+P,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",d,D].join("|"),"g"),A=RegExp("["+w+t+i+a+"]"),Qs=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ks=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$s=-1,Zs={};Zs[ns]=Zs[as]=Zs[ss]=Zs[ls]=Zs[us]=Zs[cs]=Zs[hs]=Zs[ds]=Zs[ms]=!0,Zs[Ba]=Zs[ja]=Zs[rs]=Zs[za]=Zs[os]=Zs[Wa]=Zs[Ua]=Zs[qa]=Zs[Xa]=Zs[Ja]=Zs[Qa]=Zs[$a]=Zs[Za]=Zs[es]=Zs[is]=!1;var el={};el[Ba]=el[ja]=el[rs]=el[os]=el[za]=el[Wa]=el[ns]=el[as]=el[ss]=el[ls]=el[us]=el[Xa]=el[Ja]=el[Qa]=el[$a]=el[Za]=el[es]=el[ts]=el[cs]=el[hs]=el[ds]=el[ms]=!0,el[Ua]=el[qa]=el[is]=!1;var R={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tl=parseFloat,il=parseInt,O="object"==("undefined"==typeof global?"undefined":_typeof2(global))&&global&&global.Object===Object&&global,N="object"==("undefined"==typeof self?"undefined":_typeof2(self))&&self&&self.Object===Object&&self,rl=O||N||Function("return this")(),V="object"==("undefined"==typeof exports?"undefined":_typeof2(exports))&&exports&&!exports.nodeType&&exports,F=V&&"object"==("undefined"==typeof module?"undefined":_typeof2(module))&&module&&!module.nodeType&&module,ol=F&&F.exports===V,H=ol&&O.process,G=function(){try{var e=F&&F.require&&F.require("util").types;return e||H&&H.binding&&H.binding("util")}catch(e){}}(),nl=G&&G.isArrayBuffer,al=G&&G.isDate,sl=G&&G.isMap,ll=G&&G.isRegExp,ul=G&&G.isSet,cl=G&&G.isTypedArray,k=ga("length"),hl=e({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),dl=e({"&":"&","<":"<",">":">",'"':""","'":"'"}),ml=e({"&":"&","<":"<",">":">",""":'"',"'":"'"}),pl=function e(t){function f(e){if(oi(e)&&!$o(e)&&!(e instanceof _)){if(e instanceof v)return e;if(Xi.call(e,"__wrapped__"))return Lt(e)}return new v(e)}function n(){}function v(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=Aa}function _(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ga,this.__views__=[]}function i(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function o(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function s(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function y(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new s;++t<i;)this.add(e[t])}function S(e){this.size=(this.__data__=new o(e)).size}function r(e,t){var i=$o(e),r=!i&&Ko(e),o=!i&&!r&&en(e),n=!i&&!r&&!o&&an(e),a=i||r||o||n,s=a?_a(e.length,Bi):[],l=s.length;for(var u in e)!t&&!Xi.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||n&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||gt(u,l))||s.push(u);return s}function a(e){var t=e.length;return t?e[re(0,t-1)]:Aa}function g(e,t,i){(i===Aa||Qt(e[t],i))&&(i!==Aa||t in e)||c(e,t,i)}function P(e,t,i){var r=e[t];Xi.call(e,t)&&Qt(r,i)&&(i!==Aa||t in e)||c(e,t,i)}function l(e,t){for(var i=e.length;i--;)if(Qt(e[i][0],t))return i;return-1}function u(e,r,o,n){return qr(e,function(e,t,i){r(n,e,o(e),i)}),n}function x(e,t){return e&&Ae(t,_i(t),e)}function c(e,t,i){"__proto__"==t&&dr?dr(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}function h(e,t){for(var i=-1,r=t.length,o=Oi(r),n=null==e;++i<r;)o[i]=n?Aa:fi(e,t[i]);return o}function d(e,t,i){return e==e&&(i!==Aa&&(e=e<=i?e:i),t!==Aa&&(e=t<=e?e:t)),e}function T(i,r,o,e,t,n){var a,s=1&r,l=2&r,u=4&r;if(o&&(a=t?o(i,e,t,n):o(i)),a!==Aa)return a;if(!ri(i))return i;var c,h,d,m,p,g,f,v,_,y=$o(i);if(y){if(v=(f=i).length,_=new f.constructor(v),v&&"string"==typeof f[0]&&Xi.call(f,"index")&&(_.index=f.index,_.input=f.input),a=_,!s)return Me(i,a)}else{var C=oo(i),w=C==qa||C==Ya;if(en(i))return Pe(i,s);if(C==Qa||C==Ba||w&&!t){if(a=l||w?{}:mt(i),!s)return l?(g=d=i,m=(p=a)&&Ae(g,yi(g),p),Ae(d,ro(d),m)):(h=x(a,c=i),Ae(c,io(c),h))}else{if(!el[C])return t?i:{};a=function(e,t,i){var r,o,n,a,s,l=e.constructor;switch(t){case rs:return xe(e);case za:case Wa:return new l(+e);case os:return s=i,new(a=e).constructor(s?xe(a.buffer):a.buffer,a.byteOffset,a.byteLength);case ns:case as:case ss:case ls:case us:case cs:case hs:case ds:case ms:return Te(e,i);case Xa:return new l;case Ja:case es:return new l(e);case $a:return(n=new(o=e).constructor(o.source,Hs.exec(o))).lastIndex=o.lastIndex,n;case Za:return new l;case ts:return r=e,zr?Gi(zr.call(r)):{}}}(i,C,s)}}n||(n=new S);var b=n.get(i);if(b)return b;n.set(i,a),nn(i)?i.forEach(function(e){a.add(T(e,r,o,e,i,n))}):rn(i)&&i.forEach(function(e,t){a.set(t,T(e,r,o,t,i,n))});var E=y?Aa:(u?l?nt:ot:l?yi:_i)(i);return Zn(E||i,function(e,t){E&&(e=i[t=e]),P(a,t,T(e,r,o,t,i,n))}),a}function m(e,t,i){var r=i.length;if(null==e)return!r;for(e=Gi(e);r--;){var o=i[r],n=t[o],a=e[o];if(a===Aa&&!(o in e)||!n(a))return!1}return!0}function p(e,t,i){if("function"!=typeof e)throw new ji(Ra);return uo(function(){e.apply(Aa,i)},t)}function C(e,t,i,r){var o=-1,n=ia,a=!0,s=e.length,l=[],u=t.length;if(!s)return l;i&&(t=oa(t,ya(i))),r?(n=ra,a=!1):200<=t.length&&(n=wa,a=!1,t=new y(t));e:for(;++o<s;){var c=e[o],h=null==i?c:i(c);if(c=r||0!==c?c:0,a&&h==h){for(var d=u;d--;)if(t[d]===h)continue e;l.push(c)}else n(t,h,r)||l.push(c)}return l}function w(e,r){var o=!0;return qr(e,function(e,t,i){return o=!!r(e,t,i)}),o}function b(e,t,i){for(var r=-1,o=e.length;++r<o;){var n=e[r],a=t(n);if(null!=a&&(s===Aa?a==a&&!li(a):i(a,s)))var s=a,l=n}return l}function E(e,r){var o=[];return qr(e,function(e,t,i){r(e,t,i)&&o.push(e)}),o}function I(e,t,i,r,o){var n=-1,a=e.length;for(i||(i=pt),o||(o=[]);++n<a;){var s=e[n];0<t&&i(s)?1<t?I(s,t-1,i,r,o):na(o,s):r||(o[o.length]=s)}return o}function D(e,t){return e&&Xr(e,t,_i)}function L(e,t){return e&&Jr(e,t,_i)}function M(t,e){return ta(e,function(e){return ei(t[e])})}function A(e,t){for(var i=0,r=(t=Ee(t,e)).length;null!=e&&i<r;)e=e[It(t[i++])];return i&&i==r?e:Aa}function R(e,t,i){var r=t(e);return $o(e)?r:na(r,i(e))}function O(e){return null==e?e===Aa?"[object Undefined]":"[object Null]":hr&&hr in Gi(e)?function(e){var t=Xi.call(e,hr),i=e[hr];try{e[hr]=Aa;var r=!0}catch(e){}var o=Ki.call(e);return r&&(t?e[hr]=i:delete e[hr]),o}(e):(t=e,Ki.call(t));var t}function N(e,t){return t<e}function V(e,t){return null!=e&&Xi.call(e,t)}function F(e,t){return null!=e&&t in Gi(e)}function H(e,t,i){for(var r=i?ra:ia,o=e[0].length,n=e.length,a=n,s=Oi(n),l=1/0,u=[];a--;){var c=e[a];a&&t&&(c=oa(c,ya(t))),l=Sr(c.length,l),s[a]=!i&&(t||120<=o&&120<=c.length)?new y(a&&c):Aa}c=e[0];var h=-1,d=s[0];e:for(;++h<o&&u.length<l;){var m=c[h],p=t?t(m):m;if(m=i||0!==m?m:0,!(d?wa(d,p):r(u,p,i))){for(a=n;--a;){var g=s[a];if(!(g?wa(g,p):r(e[a],p,i)))continue e}d&&d.push(p),u.push(m)}}return u}function G(e,t,i){var r=null==(e=Et(e,t=Ee(t,e)))?e:e[It(Nt(t))];return null==r?Aa:Kn(r,e,i)}function k(e){return oi(e)&&O(e)==Ba}function B(e,t,i,r,o){return e===t||(null==e||null==t||!oi(e)&&!oi(t)?e!=e&&t!=t:function(e,t,i,r,o,n){var a=$o(e),s=$o(t),l=a?ja:oo(e),u=s?ja:oo(t),c=(l=l==Ba?Qa:l)==Qa,h=(u=u==Ba?Qa:u)==Qa,d=l==u;if(d&&en(e)){if(!en(t))return!1;c=!(a=!0)}if(d&&!c)return n||(n=new S),a||an(e)?it(e,t,i,r,o,n):function(e,t,i,r,o,n,a){switch(i){case os:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case rs:return!(e.byteLength!=t.byteLength||!n(new rr(e),new rr(t)));case za:case Wa:case Ja:return Qt(+e,+t);case Ua:return e.name==t.name&&e.message==t.message;case $a:case es:return e==t+"";case Xa:var s=xa;case Za:var l=1&r;if(s||(s=Da),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;r|=2,a.set(e,t);var c=it(s(e),s(t),r,o,n,a);return a.delete(e),c;case ts:if(zr)return zr.call(e)==zr.call(t)}return!1}(e,t,l,i,r,o,n);if(!(1&i)){var m=c&&Xi.call(e,"__wrapped__"),p=h&&Xi.call(t,"__wrapped__");if(m||p){var g=m?e.value():e,f=p?t.value():t;return n||(n=new S),o(g,f,i,r,n)}}return!!d&&(n||(n=new S),function(e,t,i,r,o,n){var a=1&i,s=ot(e),l=s.length;if(l!=ot(t).length&&!a)return!1;for(var u=l;u--;){var c=s[u];if(!(a?c in t:Xi.call(t,c)))return!1}var h=n.get(e),d=n.get(t);if(h&&d)return h==t&&d==e;var m=!0;n.set(e,t),n.set(t,e);for(var p=a;++u<l;){c=s[u];var g=e[c],f=t[c];if(r)var v=a?r(f,g,c,t,e,n):r(g,f,c,e,t,n);if(!(v===Aa?g===f||o(g,f,i,r,n):v)){m=!1;break}p||(p="constructor"==c)}if(m&&!p){var _=e.constructor,y=t.constructor;_!=y&&"constructor"in e&&"constructor"in t&&!("function"==typeof _&&_ instanceof _&&"function"==typeof y&&y instanceof y)&&(m=!1)}return n.delete(e),n.delete(t),m}(e,t,i,r,o,n))}(e,t,i,r,B,o))}function j(e,t,i,r){var o=i.length,n=o,a=!r;if(null==e)return!n;for(e=Gi(e);o--;){var s=i[o];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<n;){var l=(s=i[o])[0],u=e[l],c=s[1];if(a&&s[2]){if(u===Aa&&!(l in e))return!1}else{var h=new S;if(r)var d=r(u,c,l,e,t,h);if(!(d===Aa?B(c,u,3,r,h):d))return!1}}return!0}function z(e){return!(!ri(e)||(t=e,Qi&&Qi in t))&&(ei(e)?er:Bs).test(Dt(e));var t}function W(e){return"function"==typeof e?e:null==e?xi:"object"==(void 0===e?"undefined":_typeof2(e))?$o(e)?Q(e[0],e[1]):J(e):Li(e)}function U(e){if(!yt(e))return br(e);var t=[];for(var i in Gi(e))Xi.call(e,i)&&"constructor"!=i&&t.push(i);return t}function q(e){if(!ri(e))return function(e){var t=[];if(null!=e)for(var i in Gi(e))t.push(i);return t}(e);var t=yt(e),i=[];for(var r in e)("constructor"!=r||!t&&Xi.call(e,r))&&i.push(r);return i}function Y(e,t){return e<t}function X(e,r){var o=-1,n=Kt(e)?Oi(e.length):[];return qr(e,function(e,t,i){n[++o]=r(e,t,i)}),n}function J(t){var i=ct(t);return 1==i.length&&i[0][2]?wt(i[0][0],i[0][1]):function(e){return e===t||j(e,t,i)}}function Q(i,r){return vt(i)&&Ct(r)?wt(It(i),r):function(e){var t=fi(e,i);return t===Aa&&t===r?vi(e,i):B(r,t,3)}}function K(r,o,n,a,s){r!==o&&Xr(o,function(e,t){if(s||(s=new S),ri(e))!function(e,t,i,r,o,n,a){var s=St(e,i),l=St(t,i),u=a.get(l);if(u)return g(e,i,u);var c=n?n(s,l,i+"",e,t,a):Aa,h=c===Aa;if(h){var d=$o(l),m=!d&&en(l),p=!d&&!m&&an(l);c=l,d||m||p?c=$o(s)?s:$t(s)?Me(s):m?Pe(l,!(h=!1)):p?Te(l,!(h=!1)):[]:ai(l)||Ko(l)?Ko(c=s)?c=pi(s):ri(s)&&!ei(s)||(c=mt(l)):h=!1}h&&(a.set(l,c),o(c,l,r,n,a),a.delete(l)),g(e,i,c)}(r,o,t,n,K,a,s);else{var i=a?a(St(r,t),e,t+"",r,o,s):Aa;i===Aa&&(i=e),g(r,t,i)}},yi)}function $(e,t){var i=e.length;if(i)return gt(t+=t<0?i:0,i)?e[t]:Aa}function Z(e,r,i){r=r.length?oa(r,function(t){return $o(t)?function(e){return A(e,1===t.length?t[0]:t)}:t}):[xi];var o=-1;return r=oa(r,ya(lt())),function(e,t){var i=e.length;for(e.sort(t);i--;)e[i]=e[i].value;return e}(X(e,function(t,e,i){return{criteria:oa(r,function(e){return e(t)}),index:++o,value:t}}),function(e,t){return function(e,t,i){for(var r=-1,o=e.criteria,n=t.criteria,a=o.length,s=i.length;++r<a;){var l=Ie(o[r],n[r]);if(l)return s<=r?l:l*("desc"==i[r]?-1:1)}return e.index-t.index}(e,t,i)})}function ee(e,t,i){for(var r=-1,o=t.length,n={};++r<o;){var a=t[r],s=A(e,a);i(s,a)&&ae(n,Ee(a,e),s)}return n}function te(e,t,i,r){var o=r?da:ha,n=-1,a=t.length,s=e;for(e===t&&(t=Me(t)),i&&(s=oa(e,ya(i)));++n<a;)for(var l=0,u=t[n],c=i?i(u):u;-1<(l=o(s,c,l,r));)s!==e&&lr.call(s,l,1),lr.call(e,l,1);return e}function ie(e,t){for(var i=e?t.length:0,r=i-1;i--;){var o=t[i];if(i==r||o!==n){var n=o;gt(o)?lr.call(e,o,1):ge(e,o)}}return e}function re(e,t){return e+vr(Tr()*(t-e+1))}function oe(e,t){var i="";if(!e||t<1||Fa<t)return i;for(;t%2&&(i+=e),(t=vr(t/2))&&(e+=e),t;);return i}function ne(e,t){return co(bt(e,t,xi),e+"")}function ae(e,t,i,r){if(!ri(e))return e;for(var o=-1,n=(t=Ee(t,e)).length,a=n-1,s=e;null!=s&&++o<n;){var l=It(t[o]),u=i;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(o!=a){var c=s[l];(u=r?r(c,l,s):Aa)===Aa&&(u=ri(c)?c:gt(t[o+1])?[]:{})}P(s,l,u),s=s[l]}return e}function se(e,t,i){var r=-1,o=e.length;t<0&&(t=o<-t?0:o+t),(i=o<i?o:i)<0&&(i+=o),o=i<t?0:i-t>>>0,t>>>=0;for(var n=Oi(o);++r<o;)n[r]=e[r+t];return n}function le(e,r){var o;return qr(e,function(e,t,i){return!(o=r(e,t,i))}),!!o}function ue(e,t,i){var r=0,o=null==e?r:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var n=r+o>>>1,a=e[n];null!==a&&!li(a)&&(i?a<=t:a<t)?r=n+1:o=n}return o}return ce(e,t,xi,i)}function ce(e,t,i,r){var o=0,n=null==e?0:e.length;if(0===n)return 0;for(var a=(t=i(t))!=t,s=null===t,l=li(t),u=t===Aa;o<n;){var c=vr((o+n)/2),h=i(e[c]),d=h!==Aa,m=null===h,p=h==h,g=li(h);if(a)var f=r||p;else f=u?p&&(r||d):s?p&&d&&(r||!m):l?p&&d&&!m&&(r||!g):!m&&!g&&(r?h<=t:h<t);f?o=c+1:n=c}return Sr(n,4294967294)}function he(e,t){for(var i=-1,r=e.length,o=0,n=[];++i<r;){var a=e[i],s=t?t(a):a;if(!i||!Qt(s,l)){var l=s;n[o++]=0===a?0:a}}return n}function de(e){return"number"==typeof e?e:li(e)?Ha:+e}function me(e){if("string"==typeof e)return e;if($o(e))return oa(e,me)+"";if(li(e))return Wr?Wr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function pe(e,t,i){var r=-1,o=ia,n=e.length,a=!0,s=[],l=s;if(i)a=!1,o=ra;else if(200<=n){var u=t?null:eo(e);if(u)return Da(u);a=!1,o=wa,l=new y}else l=t?[]:s;e:for(;++r<n;){var c=e[r],h=t?t(c):c;if(c=i||0!==c?c:0,a&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),s.push(c)}else o(l,h,i)||(l!==s&&l.push(h),s.push(c))}return s}function ge(e,t){return null==(e=Et(e,t=Ee(t,e)))||delete e[It(Nt(t))]}function fe(e,t,i,r){return ae(e,t,i(A(e,t)),r)}function ve(e,t,i,r){for(var o=e.length,n=r?o:-1;(r?n--:++n<o)&&t(e[n],n,e););return i?se(e,r?0:n,r?n+1:o):se(e,r?n+1:0,r?o:n)}function _e(e,t){var i=e;return i instanceof _&&(i=i.value()),aa(t,function(e,t){return t.func.apply(t.thisArg,na([e],t.args))},i)}function ye(e,t,i){var r=e.length;if(r<2)return r?pe(e[0]):[];for(var o=-1,n=Oi(r);++o<r;)for(var a=e[o],s=-1;++s<r;)s!=o&&(n[o]=C(n[o]||a,e[s],t,i));return pe(I(n,1),t,i)}function Ce(e,t,i){for(var r=-1,o=e.length,n=t.length,a={};++r<o;)i(a,e[r],r<n?t[r]:Aa);return a}function we(e){return $t(e)?e:[]}function be(e){return"function"==typeof e?e:xi}function Ee(e,t){return $o(e)?e:vt(e,t)?[e]:ho(gi(e))}function Se(e,t,i){var r=e.length;return i=i===Aa?r:i,!t&&r<=i?e:se(e,t,i)}function Pe(e,t){if(t)return e.slice();var i=e.length,r=or?or(i):new e.constructor(i);return e.copy(r),r}function xe(e){var t=new e.constructor(e.byteLength);return new rr(t).set(new rr(e)),t}function Te(e,t){return new e.constructor(t?xe(e.buffer):e.buffer,e.byteOffset,e.length)}function Ie(e,t){if(e!==t){var i=e!==Aa,r=null===e,o=e==e,n=li(e),a=t!==Aa,s=null===t,l=t==t,u=li(t);if(!s&&!u&&!n&&t<e||n&&a&&l&&!s&&!u||r&&a&&l||!i&&l||!o)return 1;if(!r&&!n&&!u&&e<t||u&&i&&o&&!r&&!n||s&&i&&o||!a&&o||!l)return-1}return 0}function De(e,t,i,r){for(var o=-1,n=e.length,a=i.length,s=-1,l=t.length,u=Er(n-a,0),c=Oi(l+u),h=!r;++s<l;)c[s]=t[s];for(;++o<a;)(h||o<n)&&(c[i[o]]=e[o]);for(;u--;)c[s++]=e[o++];return c}function Le(e,t,i,r){for(var o=-1,n=e.length,a=-1,s=i.length,l=-1,u=t.length,c=Er(n-s,0),h=Oi(c+u),d=!r;++o<c;)h[o]=e[o];for(var m=o;++l<u;)h[m+l]=t[l];for(;++a<s;)(d||o<n)&&(h[m+i[a]]=e[o++]);return h}function Me(e,t){var i=-1,r=e.length;for(t||(t=Oi(r));++i<r;)t[i]=e[i];return t}function Ae(e,t,i,r){var o=!i;i||(i={});for(var n=-1,a=t.length;++n<a;){var s=t[n],l=r?r(i[s],e[s],s,i,e):Aa;l===Aa&&(l=e[s]),o?c(i,s,l):P(i,s,l)}return i}function Re(o,n){return function(e,t){var i=$o(e)?$n:u,r=n?n():{};return i(e,o,lt(t,2),r)}}function Oe(s){return ne(function(e,t){var i=-1,r=t.length,o=1<r?t[r-1]:Aa,n=2<r?t[2]:Aa;for(o=3<s.length&&"function"==typeof o?(r--,o):Aa,n&&ft(t[0],t[1],n)&&(o=r<3?Aa:o,r=1),e=Gi(e);++i<r;){var a=t[i];a&&s(e,a,i,o)}return e})}function Ne(n,a){return function(e,t){if(null==e)return e;if(!Kt(e))return n(e,t);for(var i=e.length,r=a?i:-1,o=Gi(e);(a?r--:++r<i)&&!1!==t(o[r],r,o););return e}}function Ve(l){return function(e,t,i){for(var r=-1,o=Gi(e),n=i(e),a=n.length;a--;){var s=n[l?a:++r];if(!1===t(o[s],s,o))break}return e}}function Fe(o){return function(e){var t=Pa(e=gi(e))?Ma(e):Aa,i=t?t[0]:e.charAt(0),r=t?Se(t,1).join(""):e.slice(1);return i[o]()+r}}function He(t){return function(e){return aa(Si(Ei(e).replace(Ys,"")),t,"")}}function Ge(r){return function(){var e=arguments;switch(e.length){case 0:return new r;case 1:return new r(e[0]);case 2:return new r(e[0],e[1]);case 3:return new r(e[0],e[1],e[2]);case 4:return new r(e[0],e[1],e[2],e[3]);case 5:return new r(e[0],e[1],e[2],e[3],e[4]);case 6:return new r(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new r(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=Ur(r.prototype),i=r.apply(t,e);return ri(i)?i:t}}function ke(a){return function(e,t,i){var r=Gi(e);if(!Kt(e)){var o=lt(t,3);e=_i(e),t=function(e){return o(r[e],e,r)}}var n=a(e,t,i);return-1<n?r[o?e[n]:n]:Aa}}function Be(l){return rt(function(o){var n=o.length,e=n,t=v.prototype.thru;for(l&&o.reverse();e--;){var i=o[e];if("function"!=typeof i)throw new ji(Ra);if(t&&!a&&"wrapper"==at(i))var a=new v([],!0)}for(e=a?e:n;++e<n;){var r=at(i=o[e]),s="wrapper"==r?to(i):Aa;a=s&&_t(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?a[at(s[0])].apply(a,s[3]):1==i.length&&_t(i)?a[r]():a.thru(i)}return function(){var e=arguments,t=e[0];if(a&&1==e.length&&$o(t))return a.plant(t).value();for(var i=0,r=n?o[i].apply(this,e):t;++i<n;)r=o[i].call(this,r);return r}})}function je(l,u,c,h,d,m,p,g,f,v){var _=u&Va,y=1&u,C=2&u,w=24&u,b=512&u,E=C?Aa:Ge(l);return function e(){for(var t=arguments.length,i=Oi(t),r=t;r--;)i[r]=arguments[r];if(w)var o=st(e),n=function(e,t){for(var i=e.length,r=0;i--;)e[i]===t&&++r;return r}(i,o);if(h&&(i=De(i,h,d,w)),m&&(i=Le(i,m,p,w)),t-=n,w&&t<v)return Je(l,u,je,e.placeholder,c,i,Ia(i,o),g,f,v-t);var a=y?c:this,s=C?a[l]:l;return t=i.length,g?i=function(e,t){for(var i=e.length,r=Sr(t.length,i),o=Me(e);r--;){var n=t[r];e[r]=gt(n,i)?o[n]:Aa}return e}(i,g):b&&1<t&&i.reverse(),_&&f<t&&(i.length=f),this&&this!==rl&&this instanceof e&&(s=E||Ge(s)),s.apply(a,i)}}function ze(a,s){return function(e,t){return i=e,r=a,o=s(t),n={},D(i,function(e,t,i){r(n,o(e),t,i)}),n;var i,r,o,n}}function We(r,o){return function(e,t){var i;if(e===Aa&&t===Aa)return o;if(e!==Aa&&(i=e),t!==Aa){if(i===Aa)return t;t="string"==typeof e||"string"==typeof t?(e=me(e),me(t)):(e=de(e),de(t)),i=r(e,t)}return i}}function Ue(r){return rt(function(e){return e=oa(e,ya(lt())),ne(function(t){var i=this;return r(e,function(e){return Kn(e,i,t)})})})}function qe(e,t){var i=(t=t===Aa?" ":me(t)).length;if(i<2)return i?oe(t,e):t;var r=oe(t,fr(e/La(t)));return Pa(t)?Se(Ma(r),0,e).join(""):r.slice(0,e)}function Ye(r){return function(e,t,i){return i&&"number"!=typeof i&&ft(e,t,i)&&(t=i=Aa),e=ci(e),t===Aa?(t=e,e=0):t=ci(t),function(e,t,i,r){for(var o=-1,n=Er(fr((t-e)/(i||1)),0),a=Oi(n);n--;)a[r?n:++o]=e,e+=i;return a}(e,t,i=i===Aa?e<t?1:-1:ci(i),r)}}function Xe(i){return function(e,t){return"string"==typeof e&&"string"==typeof t||(e=mi(e),t=mi(t)),i(e,t)}}function Je(e,t,i,r,o,n,a,s,l,u){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var h=[e,t,o,c?n:Aa,c?a:Aa,c?Aa:n,c?Aa:a,s,l,u],d=i.apply(Aa,h);return _t(e)&&lo(d,h),d.placeholder=r,Pt(d,e,t)}function Qe(e){var r=Hi[e];return function(e,t){if(e=mi(e),(t=null==t?0:Sr(hi(t),292))&&Cr(e)){var i=(gi(e)+"e").split("e");return+((i=(gi(r(i[0]+"e"+(+i[1]+t)))+"e").split("e"))[0]+"e"+(+i[1]-t))}return r(e)}}function Ke(a){return function(e){var t,i,r,o,n=oo(e);return n==Xa?xa(e):n==Za?(i=e,r=-1,o=Array(i.size),i.forEach(function(e){o[++r]=[e,e]}),o):oa(a(t=e),function(e){return[e,t[e]]})}}function $e(e,t,i,r,o,n,a,s){var l=2&t;if(!l&&"function"!=typeof e)throw new ji(Ra);var u=r?r.length:0;if(u||(t&=-97,r=o=Aa),a=a===Aa?a:Er(hi(a),0),s=s===Aa?s:hi(s),u-=o?o.length:0,64&t){var c=r,h=o;r=o=Aa}var d,m,p,g,f,v,_,y,C,w,b,E,S,P=l?Aa:to(e),x=[e,t,i,r,o,c,h,n,a,s];if(P&&function(e,t){var i=e[1],r=t[1],o=i|r,n=o<131,a=r==Va&&8==i||r==Va&&256==i&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==i;if(n||a){1&r&&(e[2]=t[2],o|=1&i?0:4);var s=t[3];if(s){var l=e[3];e[3]=l?De(l,s,t[4]):s,e[4]=l?Ia(e[3],Na):t[4]}(s=t[5])&&(l=e[5],e[5]=l?Le(l,s,t[6]):s,e[6]=l?Ia(e[5],Na):t[6]),(s=t[7])&&(e[7]=s),r&Va&&(e[8]=null==e[8]?t[8]:Sr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}}(x,P),e=x[0],t=x[1],i=x[2],r=x[3],o=x[4],!(s=x[9]=x[9]===Aa?l?0:e.length:Er(x[9]-u,0))&&24&t&&(t&=-25),t&&1!=t)T=8==t||16==t?(b=t,E=s,S=Ge(w=e),function e(){for(var t=arguments.length,i=Oi(t),r=t,o=st(e);r--;)i[r]=arguments[r];var n=t<3&&i[0]!==o&&i[t-1]!==o?[]:Ia(i,o);return(t-=n.length)<E?Je(w,b,je,e.placeholder,Aa,i,n,Aa,Aa,E-t):Kn(this&&this!==rl&&this instanceof e?S:w,this,i)}):32!=t&&33!=t||o.length?je.apply(Aa,x):(v=i,_=r,y=1&t,C=Ge(f=e),function e(){for(var t=-1,i=arguments.length,r=-1,o=_.length,n=Oi(o+i),a=this&&this!==rl&&this instanceof e?C:f;++r<o;)n[r]=_[r];for(;i--;)n[r++]=arguments[++t];return Kn(a,y?v:this,n)});else var T=(m=i,p=1&t,g=Ge(d=e),function e(){return(this&&this!==rl&&this instanceof e?g:d).apply(p?m:this,arguments)});return Pt((P?Qr:lo)(T,x),e,t)}function Ze(e,t,i,r){return e===Aa||Qt(e,Ui[i])&&!Xi.call(r,i)?t:e}function et(e,t,i,r,o,n){return ri(e)&&ri(t)&&(n.set(t,e),K(e,t,Aa,et,n),n.delete(t)),e}function tt(e){return ai(e)?Aa:e}function it(e,t,i,r,o,n){var a=1&i,s=e.length,l=t.length;if(s!=l&&!(a&&s<l))return!1;var u=n.get(e),c=n.get(t);if(u&&c)return u==t&&c==e;var h=-1,d=!0,m=2&i?new y:Aa;for(n.set(e,t),n.set(t,e);++h<s;){var p=e[h],g=t[h];if(r)var f=a?r(g,p,h,t,e,n):r(p,g,h,e,t,n);if(f!==Aa){if(f)continue;d=!1;break}if(m){if(!la(t,function(e,t){if(!wa(m,t)&&(p===e||o(p,e,i,r,n)))return m.push(t)})){d=!1;break}}else if(p!==g&&!o(p,g,i,r,n)){d=!1;break}}return n.delete(e),n.delete(t),d}function rt(e){return co(bt(e,Aa,Rt),e+"")}function ot(e){return R(e,_i,io)}function nt(e){return R(e,yi,ro)}function at(e){for(var t=e.name+"",i=Vr[t],r=Xi.call(Vr,t)?i.length:0;r--;){var o=i[r],n=o.func;if(null==n||n==e)return o.name}return t}function st(e){return(Xi.call(f,"placeholder")?f:e).placeholder}function lt(){var e=f.iteratee||Ti;return e=e===Ti?W:e,arguments.length?e(arguments[0],arguments[1]):e}function ut(e,t){var i,r,o=e.__data__;return("string"==(r=void 0===(i=t)?"undefined":_typeof2(i))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==i:null===i)?o["string"==typeof t?"string":"hash"]:o.map}function ct(e){for(var t=_i(e),i=t.length;i--;){var r=t[i],o=e[r];t[i]=[r,o,Ct(o)]}return t}function ht(e,t){var i,r,o=(r=t,null==(i=e)?Aa:i[r]);return z(o)?o:Aa}function dt(e,t,i){for(var r=-1,o=(t=Ee(t,e)).length,n=!1;++r<o;){var a=It(t[r]);if(!(n=null!=e&&i(e,a)))break;e=e[a]}return n||++r!=o?n:!!(o=null==e?0:e.length)&&ii(o)&>(a,o)&&($o(e)||Ko(e))}function mt(e){return"function"!=typeof e.constructor||yt(e)?{}:Ur(nr(e))}function pt(e){return $o(e)||Ko(e)||!!(ur&&e&&e[ur])}function gt(e,t){var i=void 0===e?"undefined":_typeof2(e);return!!(t=null==t?Fa:t)&&("number"==i||"symbol"!=i&&zs.test(e))&&-1<e&&e%1==0&&e<t}function ft(e,t,i){if(!ri(i))return!1;var r=void 0===t?"undefined":_typeof2(t);return!!("number"==r?Kt(i)&>(t,i.length):"string"==r&&t in i)&&Qt(i[t],e)}function vt(e,t){if($o(e))return!1;var i=void 0===e?"undefined":_typeof2(e);return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!li(e))||Ps.test(e)||!Ss.test(e)||null!=t&&e in Gi(t)}function _t(e){var t=at(e),i=f[t];if("function"!=typeof i||!(t in _.prototype))return!1;if(e===i)return!0;var r=to(i);return!!r&&e===r[0]}function yt(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ui)}function Ct(e){return e==e&&!ri(e)}function wt(t,i){return function(e){return null!=e&&e[t]===i&&(i!==Aa||t in Gi(e))}}function bt(n,a,s){return a=Er(a===Aa?n.length-1:a,0),function(){for(var e=arguments,t=-1,i=Er(e.length-a,0),r=Oi(i);++t<i;)r[t]=e[a+t];t=-1;for(var o=Oi(a+1);++t<a;)o[t]=e[t];return o[a]=s(r),Kn(n,this,o)}}function Et(e,t){return t.length<2?e:A(e,se(t,0,-1))}function St(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function Pt(e,t,i){var r,o,n,a=t+"";return co(e,function(e,t){var i=t.length;if(!i)return e;var r=i-1;return t[r]=(1<i?"& ":"")+t[r],t=t.join(2<i?", ":" "),e.replace(As,"{\n/* [wrapped with "+t+"] */\n")}(a,(n=a.match(Rs),r=n?n[1].split(Os):[],o=i,Zn(ka,function(e){var t="_."+e[0];o&e[1]&&!ia(r,t)&&r.push(t)}),r.sort())))}function xt(i){var r=0,o=0;return function(){var e=Pr(),t=16-(e-o);if(o=e,0<t){if(800<=++r)return arguments[0]}else r=0;return i.apply(Aa,arguments)}}function Tt(e,t){var i=-1,r=e.length,o=r-1;for(t=t===Aa?r:t;++i<t;){var n=re(i,o),a=e[n];e[n]=e[i],e[i]=a}return e.length=t,e}function It(e){if("string"==typeof e||li(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Dt(e){if(null!=e){try{return Yi.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Lt(e){if(e instanceof _)return e.clone();var t=new v(e.__wrapped__,e.__chain__);return t.__actions__=Me(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Mt(e,t,i){var r=null==e?0:e.length;if(!r)return-1;var o=null==i?0:hi(i);return o<0&&(o=Er(r+o,0)),ca(e,lt(t,3),o)}function At(e,t,i){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return i!==Aa&&(o=hi(i),o=i<0?Er(r+o,0):Sr(o,r-1)),ca(e,lt(t,3),o,!0)}function Rt(e){return null!=e&&e.length?I(e,1):[]}function Ot(e){return e&&e.length?e[0]:Aa}function Nt(e){var t=null==e?0:e.length;return t?e[t-1]:Aa}function Vt(e,t){return e&&e.length&&t&&t.length?te(e,t):e}function Ft(e){return null==e?e:Ir.call(e)}function Ht(t){if(!t||!t.length)return[];var i=0;return t=ta(t,function(e){if($t(e))return i=Er(e.length,i),!0}),_a(i,function(e){return oa(t,ga(e))})}function Gt(e,t){if(!e||!e.length)return[];var i=Ht(e);return null==t?i:oa(i,function(e){return Kn(t,Aa,e)})}function kt(e){var t=f(e);return t.__chain__=!0,t}function Bt(e,t){return t(e)}function jt(e,t){return($o(e)?Zn:qr)(e,lt(t,3))}function zt(e,t){return($o(e)?function(e,t){for(var i=null==e?0:e.length;i--&&!1!==t(e[i],i,e););return e}:Yr)(e,lt(t,3))}function Wt(e,t){return($o(e)?oa:X)(e,lt(t,3))}function Ut(e,t,i){return t=i?Aa:t,t=e&&null==t?e.length:t,$e(e,Va,Aa,Aa,Aa,Aa,t)}function qt(e,t){var i;if("function"!=typeof t)throw new ji(Ra);return e=hi(e),function(){return 0<--e&&(i=t.apply(this,arguments)),e<=1&&(t=Aa),i}}function Yt(r,o,e){function n(e){var t=u,i=c;return u=c=Aa,g=e,d=r.apply(i,t)}function a(e){var t=e-p;return p===Aa||o<=t||t<0||v&&h<=e-g}function s(){var e,t,i=Go();return a(i)?l(i):(m=uo(s,(t=o-((e=i)-p),v?Sr(t,h-(e-g)):t)),Aa)}function l(e){return m=Aa,i&&u?n(e):(u=c=Aa,d)}function t(){var e,t=Go(),i=a(t);if(u=arguments,c=this,p=t,i){if(m===Aa)return g=e=p,m=uo(s,o),f?n(e):d;if(v)return Zr(m),m=uo(s,o),n(p)}return m===Aa&&(m=uo(s,o)),d}var u,c,h,d,m,p,g=0,f=!1,v=!1,i=!0;if("function"!=typeof r)throw new ji(Ra);return o=mi(o)||0,ri(e)&&(f=!!e.leading,h=(v="maxWait"in e)?Er(mi(e.maxWait)||0,o):h,i="trailing"in e?!!e.trailing:i),t.cancel=function(){m!==Aa&&Zr(m),g=0,u=p=c=m=Aa},t.flush=function(){return m===Aa?d:l(Go())},t}function Xt(n,a){if("function"!=typeof n||null!=a&&"function"!=typeof a)throw new ji(Ra);var e=function e(){var t=arguments,i=a?a.apply(this,t):t[0],r=e.cache;if(r.has(i))return r.get(i);var o=n.apply(this,t);return e.cache=r.set(i,o)||r,o};return e.cache=new(Xt.Cache||s),e}function Jt(t){if("function"!=typeof t)throw new ji(Ra);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function Qt(e,t){return e===t||e!=e&&t!=t}function Kt(e){return null!=e&&ii(e.length)&&!ei(e)}function $t(e){return oi(e)&&Kt(e)}function Zt(e){if(!oi(e))return!1;var t=O(e);return t==Ua||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ai(e)}function ei(e){if(!ri(e))return!1;var t=O(e);return t==qa||t==Ya||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ti(e){return"number"==typeof e&&e==hi(e)}function ii(e){return"number"==typeof e&&-1<e&&e%1==0&&e<=Fa}function ri(e){var t=void 0===e?"undefined":_typeof2(e);return null!=e&&("object"==t||"function"==t)}function oi(e){return null!=e&&"object"==(void 0===e?"undefined":_typeof2(e))}function ni(e){return"number"==typeof e||oi(e)&&O(e)==Ja}function ai(e){if(!oi(e)||O(e)!=Qa)return!1;var t=nr(e);if(null===t)return!0;var i=Xi.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&Yi.call(i)==$i}function si(e){return"string"==typeof e||!$o(e)&&oi(e)&&O(e)==es}function li(e){return"symbol"==(void 0===e?"undefined":_typeof2(e))||oi(e)&&O(e)==ts}function ui(e){if(!e)return[];if(Kt(e))return si(e)?Ma(e):Me(e);if(cr&&e[cr])return function(e){for(var t,i=[];!(t=e.next()).done;)i.push(t.value);return i}(e[cr]());var t=oo(e);return(t==Xa?xa:t==Za?Da:wi)(e)}function ci(e){return e?(e=mi(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function hi(e){var t=ci(e),i=t%1;return t==t?i?t-i:t:0}function di(e){return e?d(hi(e),0,Ga):0}function mi(e){if("number"==typeof e)return e;if(li(e))return Ha;if(ri(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ri(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Ds,"");var i=ks.test(e);return i||js.test(e)?il(e.slice(2),i?2:8):Gs.test(e)?Ha:+e}function pi(e){return Ae(e,yi(e))}function gi(e){return null==e?"":me(e)}function fi(e,t,i){var r=null==e?Aa:A(e,t);return r===Aa?i:r}function vi(e,t){return null!=e&&dt(e,t,F)}function _i(e){return Kt(e)?r(e):U(e)}function yi(e){return Kt(e)?r(e,!0):q(e)}function Ci(e,i){if(null==e)return{};var t=oa(nt(e),function(e){return[e]});return i=lt(i),ee(e,t,function(e,t){return i(e,t[0])})}function wi(e){return null==e?[]:Ca(e,_i(e))}function bi(e){return An(gi(e).toLowerCase())}function Ei(e){return(e=gi(e))&&e.replace(Ws,hl).replace(Xs,"")}function Si(e,t,i){return e=gi(e),(t=i?Aa:t)===Aa?(r=e,Qs.test(r)?e.match(Js)||[]:e.match(Ns)||[]):e.match(t)||[];var r}function Pi(e){return function(){return e}}function xi(e){return e}function Ti(e){return W("function"==typeof e?e:T(e,1))}function Ii(r,t,e){var i=_i(t),o=M(t,i);null!=e||ri(t)&&(o.length||!i.length)||(e=t,t=r,r=this,o=M(t,_i(t)));var n=!(ri(e)&&"chain"in e&&!e.chain),a=ei(r);return Zn(o,function(e){var i=t[e];r[e]=i,a&&(r.prototype[e]=function(){var e=this.__chain__;if(n||e){var t=r(this.__wrapped__);return(t.__actions__=Me(this.__actions__)).push({func:i,args:arguments,thisArg:r}),t.__chain__=e,t}return i.apply(r,na([this.value()],arguments))})}),r}function Di(){}function Li(e){return vt(e)?ga(It(e)):(t=e,function(e){return A(e,t)});var t}function Mi(){return[]}function Ai(){return!1}var Ri,Oi=(t=null==t?rl:pl.defaults(rl.Object(),t,pl.pick(rl,Ks))).Array,Ni=t.Date,Vi=t.Error,Fi=t.Function,Hi=t.Math,Gi=t.Object,ki=t.RegExp,Bi=t.String,ji=t.TypeError,zi=Oi.prototype,Wi=Fi.prototype,Ui=Gi.prototype,qi=t["__core-js_shared__"],Yi=Wi.toString,Xi=Ui.hasOwnProperty,Ji=0,Qi=(Ri=/[^.]+$/.exec(qi&&qi.keys&&qi.keys.IE_PROTO||""))?"Symbol(src)_1."+Ri:"",Ki=Ui.toString,$i=Yi.call(Gi),Zi=rl._,er=ki("^"+Yi.call(Xi).replace(Ts,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tr=ol?t.Buffer:Aa,ir=t.Symbol,rr=t.Uint8Array,or=tr?tr.allocUnsafe:Aa,nr=Ta(Gi.getPrototypeOf,Gi),ar=Gi.create,sr=Ui.propertyIsEnumerable,lr=zi.splice,ur=ir?ir.isConcatSpreadable:Aa,cr=ir?ir.iterator:Aa,hr=ir?ir.toStringTag:Aa,dr=function(){try{var e=ht(Gi,"defineProperty");return e({},"",{}),e}catch(e){}}(),mr=t.clearTimeout!==rl.clearTimeout&&t.clearTimeout,pr=Ni&&Ni.now!==rl.Date.now&&Ni.now,gr=t.setTimeout!==rl.setTimeout&&t.setTimeout,fr=Hi.ceil,vr=Hi.floor,_r=Gi.getOwnPropertySymbols,yr=tr?tr.isBuffer:Aa,Cr=t.isFinite,wr=zi.join,br=Ta(Gi.keys,Gi),Er=Hi.max,Sr=Hi.min,Pr=Ni.now,xr=t.parseInt,Tr=Hi.random,Ir=zi.reverse,Dr=ht(t,"DataView"),Lr=ht(t,"Map"),Mr=ht(t,"Promise"),Ar=ht(t,"Set"),Rr=ht(t,"WeakMap"),Or=ht(Gi,"create"),Nr=Rr&&new Rr,Vr={},Fr=Dt(Dr),Hr=Dt(Lr),Gr=Dt(Mr),kr=Dt(Ar),Br=Dt(Rr),jr=ir?ir.prototype:Aa,zr=jr?jr.valueOf:Aa,Wr=jr?jr.toString:Aa,Ur=function(){function i(){}return function(e){if(!ri(e))return{};if(ar)return ar(e);i.prototype=e;var t=new i;return i.prototype=Aa,t}}();f.templateSettings={escape:ws,evaluate:bs,interpolate:Es,variable:"",imports:{_:f}},(f.prototype=n.prototype).constructor=f,(v.prototype=Ur(n.prototype)).constructor=v,(_.prototype=Ur(n.prototype)).constructor=_,i.prototype.clear=function(){this.__data__=Or?Or(null):{},this.size=0},i.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},i.prototype.get=function(e){var t=this.__data__;if(Or){var i=t[e];return i===Oa?Aa:i}return Xi.call(t,e)?t[e]:Aa},i.prototype.has=function(e){var t=this.__data__;return Or?t[e]!==Aa:Xi.call(t,e)},i.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Or&&t===Aa?Oa:t,this},o.prototype.clear=function(){this.__data__=[],this.size=0},o.prototype.delete=function(e){var t=this.__data__,i=l(t,e);return!(i<0||(i==t.length-1?t.pop():lr.call(t,i,1),--this.size,0))},o.prototype.get=function(e){var t=this.__data__,i=l(t,e);return i<0?Aa:t[i][1]},o.prototype.has=function(e){return-1<l(this.__data__,e)},o.prototype.set=function(e,t){var i=this.__data__,r=l(i,e);return r<0?(++this.size,i.push([e,t])):i[r][1]=t,this},s.prototype.clear=function(){this.size=0,this.__data__={hash:new i,map:new(Lr||o),string:new i}},s.prototype.delete=function(e){var t=ut(this,e).delete(e);return this.size-=t?1:0,t},s.prototype.get=function(e){return ut(this,e).get(e)},s.prototype.has=function(e){return ut(this,e).has(e)},s.prototype.set=function(e,t){var i=ut(this,e),r=i.size;return i.set(e,t),this.size+=i.size==r?0:1,this},y.prototype.add=y.prototype.push=function(e){return this.__data__.set(e,Oa),this},y.prototype.has=function(e){return this.__data__.has(e)},S.prototype.clear=function(){this.__data__=new o,this.size=0},S.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},S.prototype.get=function(e){return this.__data__.get(e)},S.prototype.has=function(e){return this.__data__.has(e)},S.prototype.set=function(e,t){var i=this.__data__;if(i instanceof o){var r=i.__data__;if(!Lr||r.length<199)return r.push([e,t]),this.size=++i.size,this;i=this.__data__=new s(r)}return i.set(e,t),this.size=i.size,this};var qr=Ne(D),Yr=Ne(L,!0),Xr=Ve(),Jr=Ve(!0),Qr=Nr?function(e,t){return Nr.set(e,t),e}:xi,Kr=dr?function(e,t){return dr(e,"toString",{configurable:!0,enumerable:!1,value:Pi(t),writable:!0})}:xi,$r=ne,Zr=mr||function(e){return rl.clearTimeout(e)},eo=Ar&&1/Da(new Ar([,-0]))[1]==1/0?function(e){return new Ar(e)}:Di,to=Nr?function(e){return Nr.get(e)}:Di,io=_r?function(t){return null==t?[]:(t=Gi(t),ta(_r(t),function(e){return sr.call(t,e)}))}:Mi,ro=_r?function(e){for(var t=[];e;)na(t,io(e)),e=nr(e);return t}:Mi,oo=O;(Dr&&oo(new Dr(new ArrayBuffer(1)))!=os||Lr&&oo(new Lr)!=Xa||Mr&&oo(Mr.resolve())!=Ka||Ar&&oo(new Ar)!=Za||Rr&&oo(new Rr)!=is)&&(oo=function(e){var t=O(e),i=t==Qa?e.constructor:Aa,r=i?Dt(i):"";if(r)switch(r){case Fr:return os;case Hr:return Xa;case Gr:return Ka;case kr:return Za;case Br:return is}return t});var no,ao,so=qi?ei:Ai,lo=xt(Qr),uo=gr||function(e,t){return rl.setTimeout(e,t)},co=xt(Kr),ho=(ao=(no=Xt(function(e){var o=[];return 46===e.charCodeAt(0)&&o.push(""),e.replace(xs,function(e,t,i,r){o.push(i?r.replace(Vs,"$1"):t||e)}),o},function(e){return 500===ao.size&&ao.clear(),e})).cache,no),mo=ne(function(e,t){return $t(e)?C(e,I(t,1,$t,!0)):[]}),po=ne(function(e,t){var i=Nt(t);return $t(i)&&(i=Aa),$t(e)?C(e,I(t,1,$t,!0),lt(i,2)):[]}),go=ne(function(e,t){var i=Nt(t);return $t(i)&&(i=Aa),$t(e)?C(e,I(t,1,$t,!0),Aa,i):[]}),fo=ne(function(e){var t=oa(e,we);return t.length&&t[0]===e[0]?H(t):[]}),vo=ne(function(e){var t=Nt(e),i=oa(e,we);return t===Nt(i)?t=Aa:i.pop(),i.length&&i[0]===e[0]?H(i,lt(t,2)):[]}),_o=ne(function(e){var t=Nt(e),i=oa(e,we);return(t="function"==typeof t?t:Aa)&&i.pop(),i.length&&i[0]===e[0]?H(i,Aa,t):[]}),yo=ne(Vt),Co=rt(function(e,t){var i=null==e?0:e.length,r=h(e,t);return ie(e,oa(t,function(e){return gt(e,i)?+e:e}).sort(Ie)),r}),wo=ne(function(e){return pe(I(e,1,$t,!0))}),bo=ne(function(e){var t=Nt(e);return $t(t)&&(t=Aa),pe(I(e,1,$t,!0),lt(t,2))}),Eo=ne(function(e){var t=Nt(e);return t="function"==typeof t?t:Aa,pe(I(e,1,$t,!0),Aa,t)}),So=ne(function(e,t){return $t(e)?C(e,t):[]}),Po=ne(function(e){return ye(ta(e,$t))}),xo=ne(function(e){var t=Nt(e);return $t(t)&&(t=Aa),ye(ta(e,$t),lt(t,2))}),To=ne(function(e){var t=Nt(e);return t="function"==typeof t?t:Aa,ye(ta(e,$t),Aa,t)}),Io=ne(Ht),Do=ne(function(e){var t=e.length,i=1<t?e[t-1]:Aa;return i="function"==typeof i?(e.pop(),i):Aa,Gt(e,i)}),Lo=rt(function(t){var i=t.length,e=i?t[0]:0,r=this.__wrapped__,o=function(e){return h(e,t)};return!(1<i||this.__actions__.length)&&r instanceof _&>(e)?((r=r.slice(e,+e+(i?1:0))).__actions__.push({func:Bt,args:[o],thisArg:Aa}),new v(r,this.__chain__).thru(function(e){return i&&!e.length&&e.push(Aa),e})):this.thru(o)}),Mo=Re(function(e,t,i){Xi.call(e,i)?++e[i]:c(e,i,1)}),Ao=ke(Mt),Ro=ke(At),Oo=Re(function(e,t,i){Xi.call(e,i)?e[i].push(t):c(e,i,[t])}),No=ne(function(e,t,i){var r=-1,o="function"==typeof t,n=Kt(e)?Oi(e.length):[];return qr(e,function(e){n[++r]=o?Kn(t,e,i):G(e,t,i)}),n}),Vo=Re(function(e,t,i){c(e,i,t)}),Fo=Re(function(e,t,i){e[i?0:1].push(t)},function(){return[[],[]]}),Ho=ne(function(e,t){if(null==e)return[];var i=t.length;return 1<i&&ft(e,t[0],t[1])?t=[]:2<i&&ft(t[0],t[1],t[2])&&(t=[t[0]]),Z(e,I(t,1),[])}),Go=pr||function(){return rl.Date.now()},ko=ne(function(e,t,i){var r=1;if(i.length){var o=Ia(i,st(ko));r|=32}return $e(e,r,t,i,o)}),Bo=ne(function(e,t,i){var r=3;if(i.length){var o=Ia(i,st(Bo));r|=32}return $e(t,r,e,i,o)}),jo=ne(function(e,t){return p(e,1,t)}),zo=ne(function(e,t,i){return p(e,mi(t)||0,i)});Xt.Cache=s;var Wo,Uo=$r(function(r,o){var n=(o=1==o.length&&$o(o[0])?oa(o[0],ya(lt())):oa(I(o,1),ya(lt()))).length;return ne(function(e){for(var t=-1,i=Sr(e.length,n);++t<i;)e[t]=o[t].call(this,e[t]);return Kn(r,this,e)})}),qo=ne(function(e,t){return $e(e,32,Aa,t,Ia(t,st(qo)))}),Yo=ne(function(e,t){return $e(e,64,Aa,t,Ia(t,st(Yo)))}),Xo=rt(function(e,t){return $e(e,256,Aa,Aa,Aa,t)}),Jo=Xe(N),Qo=Xe(function(e,t){return t<=e}),Ko=k(function(){return arguments}())?k:function(e){return oi(e)&&Xi.call(e,"callee")&&!sr.call(e,"callee")},$o=Oi.isArray,Zo=nl?ya(nl):function(e){return oi(e)&&O(e)==rs},en=yr||Ai,tn=al?ya(al):function(e){return oi(e)&&O(e)==Wa},rn=sl?ya(sl):function(e){return oi(e)&&oo(e)==Xa},on=ll?ya(ll):function(e){return oi(e)&&O(e)==$a},nn=ul?ya(ul):function(e){return oi(e)&&oo(e)==Za},an=cl?ya(cl):function(e){return oi(e)&&ii(e.length)&&!!Zs[O(e)]},sn=Xe(Y),ln=Xe(function(e,t){return e<=t}),un=Oe(function(e,t){if(yt(t)||Kt(t))return Ae(t,_i(t),e),Aa;for(var i in t)Xi.call(t,i)&&P(e,i,t[i])}),cn=Oe(function(e,t){Ae(t,yi(t),e)}),hn=Oe(function(e,t,i,r){Ae(t,yi(t),e,r)}),dn=Oe(function(e,t,i,r){Ae(t,_i(t),e,r)}),mn=rt(h),pn=ne(function(e,t){e=Gi(e);var i=-1,r=t.length,o=2<r?t[2]:Aa;for(o&&ft(t[0],t[1],o)&&(r=1);++i<r;)for(var n=t[i],a=yi(n),s=-1,l=a.length;++s<l;){var u=a[s],c=e[u];(c===Aa||Qt(c,Ui[u])&&!Xi.call(e,u))&&(e[u]=n[u])}return e}),gn=ne(function(e){return e.push(Aa,et),Kn(Cn,Aa,e)}),fn=ze(function(e,t,i){null!=t&&"function"!=typeof t.toString&&(t=Ki.call(t)),e[t]=i},Pi(xi)),vn=ze(function(e,t,i){null!=t&&"function"!=typeof t.toString&&(t=Ki.call(t)),Xi.call(e,t)?e[t].push(i):e[t]=[i]},lt),_n=ne(G),yn=Oe(function(e,t,i){K(e,t,i)}),Cn=Oe(function(e,t,i,r){K(e,t,i,r)}),wn=rt(function(t,e){var i={};if(null==t)return i;var r=!1;e=oa(e,function(e){return e=Ee(e,t),r||(r=1<e.length),e}),Ae(t,nt(t),i),r&&(i=T(i,7,tt));for(var o=e.length;o--;)ge(i,e[o]);return i}),bn=rt(function(e,t){return null==e?{}:ee(i=e,t,function(e,t){return vi(i,t)});var i}),En=Ke(_i),Sn=Ke(yi),Pn=He(function(e,t,i){return t=t.toLowerCase(),e+(i?bi(t):t)}),xn=He(function(e,t,i){return e+(i?"-":"")+t.toLowerCase()}),Tn=He(function(e,t,i){return e+(i?" ":"")+t.toLowerCase()}),In=Fe("toLowerCase"),Dn=He(function(e,t,i){return e+(i?"_":"")+t.toLowerCase()}),Ln=He(function(e,t,i){return e+(i?" ":"")+An(t)}),Mn=He(function(e,t,i){return e+(i?" ":"")+t.toUpperCase()}),An=Fe("toUpperCase"),Rn=ne(function(e,t){try{return Kn(e,Aa,t)}catch(e){return Zt(e)?e:new Vi(e)}}),On=rt(function(t,e){return Zn(e,function(e){e=It(e),c(t,e,ko(t[e],t))}),t}),Nn=Be(),Vn=Be(!0),Fn=ne(function(t,i){return function(e){return G(e,t,i)}}),Hn=ne(function(t,i){return function(e){return G(t,e,i)}}),Gn=Ue(oa),kn=Ue(ea),Bn=Ue(la),jn=Ye(),zn=Ye(!0),Wn=We(function(e,t){return e+t},0),Un=Qe("ceil"),qn=We(function(e,t){return e/t},1),Yn=Qe("floor"),Xn=We(function(e,t){return e*t},1),Jn=Qe("round"),Qn=We(function(e,t){return e-t},0);return f.after=function(e,t){if("function"!=typeof t)throw new ji(Ra);return e=hi(e),function(){if(--e<1)return t.apply(this,arguments)}},f.ary=Ut,f.assign=un,f.assignIn=cn,f.assignInWith=hn,f.assignWith=dn,f.at=mn,f.before=qt,f.bind=ko,f.bindAll=On,f.bindKey=Bo,f.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return $o(e)?e:[e]},f.chain=kt,f.chunk=function(e,t,i){t=(i?ft(e,t,i):t===Aa)?1:Er(hi(t),0);var r=null==e?0:e.length;if(!r||t<1)return[];for(var o=0,n=0,a=Oi(fr(r/t));o<r;)a[n++]=se(e,o,o+=t);return a},f.compact=function(e){for(var t=-1,i=null==e?0:e.length,r=0,o=[];++t<i;){var n=e[t];n&&(o[r++]=n)}return o},f.concat=function(){var e=arguments.length;if(!e)return[];for(var t=Oi(e-1),i=arguments[0],r=e;r--;)t[r-1]=arguments[r];return na($o(i)?Me(i):[i],I(t,1))},f.cond=function(r){var o=null==r?0:r.length,t=lt();return r=o?oa(r,function(e){if("function"!=typeof e[1])throw new ji(Ra);return[t(e[0]),e[1]]}):[],ne(function(e){for(var t=-1;++t<o;){var i=r[t];if(Kn(i[0],this,e))return Kn(i[1],this,e)}})},f.conforms=function(e){return t=T(e,1),i=_i(t),function(e){return m(e,t,i)};var t,i},f.constant=Pi,f.countBy=Mo,f.create=function(e,t){var i=Ur(e);return null==t?i:x(i,t)},f.curry=function e(t,i,r){var o=$e(t,8,Aa,Aa,Aa,Aa,Aa,i=r?Aa:i);return o.placeholder=e.placeholder,o},f.curryRight=function e(t,i,r){var o=$e(t,16,Aa,Aa,Aa,Aa,Aa,i=r?Aa:i);return o.placeholder=e.placeholder,o},f.debounce=Yt,f.defaults=pn,f.defaultsDeep=gn,f.defer=jo,f.delay=zo,f.difference=mo,f.differenceBy=po,f.differenceWith=go,f.drop=function(e,t,i){var r=null==e?0:e.length;return r?se(e,(t=i||t===Aa?1:hi(t))<0?0:t,r):[]},f.dropRight=function(e,t,i){var r=null==e?0:e.length;return r?se(e,0,(t=r-(t=i||t===Aa?1:hi(t)))<0?0:t):[]},f.dropRightWhile=function(e,t){return e&&e.length?ve(e,lt(t,3),!0,!0):[]},f.dropWhile=function(e,t){return e&&e.length?ve(e,lt(t,3),!0):[]},f.fill=function(e,t,i,r){var o=null==e?0:e.length;return o?(i&&"number"!=typeof i&&ft(e,t,i)&&(i=0,r=o),function(e,t,i,r){var o=e.length;for((i=hi(i))<0&&(i=o<-i?0:o+i),(r=r===Aa||o<r?o:hi(r))<0&&(r+=o),r=r<i?0:di(r);i<r;)e[i++]=t;return e}(e,t,i,r)):[]},f.filter=function(e,t){return($o(e)?ta:E)(e,lt(t,3))},f.flatMap=function(e,t){return I(Wt(e,t),1)},f.flatMapDeep=function(e,t){return I(Wt(e,t),1/0)},f.flatMapDepth=function(e,t,i){return i=i===Aa?1:hi(i),I(Wt(e,t),i)},f.flatten=Rt,f.flattenDeep=function(e){return null!=e&&e.length?I(e,1/0):[]},f.flattenDepth=function(e,t){return null!=e&&e.length?I(e,t=t===Aa?1:hi(t)):[]},f.flip=function(e){return $e(e,512)},f.flow=Nn,f.flowRight=Vn,f.fromPairs=function(e){for(var t=-1,i=null==e?0:e.length,r={};++t<i;){var o=e[t];r[o[0]]=o[1]}return r},f.functions=function(e){return null==e?[]:M(e,_i(e))},f.functionsIn=function(e){return null==e?[]:M(e,yi(e))},f.groupBy=Oo,f.initial=function(e){return null!=e&&e.length?se(e,0,-1):[]},f.intersection=fo,f.intersectionBy=vo,f.intersectionWith=_o,f.invert=fn,f.invertBy=vn,f.invokeMap=No,f.iteratee=Ti,f.keyBy=Vo,f.keys=_i,f.keysIn=yi,f.map=Wt,f.mapKeys=function(e,r){var o={};return r=lt(r,3),D(e,function(e,t,i){c(o,r(e,t,i),e)}),o},f.mapValues=function(e,r){var o={};return r=lt(r,3),D(e,function(e,t,i){c(o,t,r(e,t,i))}),o},f.matches=function(e){return J(T(e,1))},f.matchesProperty=function(e,t){return Q(e,T(t,1))},f.memoize=Xt,f.merge=yn,f.mergeWith=Cn,f.method=Fn,f.methodOf=Hn,f.mixin=Ii,f.negate=Jt,f.nthArg=function(t){return t=hi(t),ne(function(e){return $(e,t)})},f.omit=wn,f.omitBy=function(e,t){return Ci(e,Jt(lt(t)))},f.once=function(e){return qt(2,e)},f.orderBy=function(e,t,i,r){return null==e?[]:($o(t)||(t=null==t?[]:[t]),$o(i=r?Aa:i)||(i=null==i?[]:[i]),Z(e,t,i))},f.over=Gn,f.overArgs=Uo,f.overEvery=kn,f.overSome=Bn,f.partial=qo,f.partialRight=Yo,f.partition=Fo,f.pick=bn,f.pickBy=Ci,f.property=Li,f.propertyOf=function(t){return function(e){return null==t?Aa:A(t,e)}},f.pull=yo,f.pullAll=Vt,f.pullAllBy=function(e,t,i){return e&&e.length&&t&&t.length?te(e,t,lt(i,2)):e},f.pullAllWith=function(e,t,i){return e&&e.length&&t&&t.length?te(e,t,Aa,i):e},f.pullAt=Co,f.range=jn,f.rangeRight=zn,f.rearg=Xo,f.reject=function(e,t){return($o(e)?ta:E)(e,Jt(lt(t,3)))},f.remove=function(e,t){var i=[];if(!e||!e.length)return i;var r=-1,o=[],n=e.length;for(t=lt(t,3);++r<n;){var a=e[r];t(a,r,e)&&(i.push(a),o.push(r))}return ie(e,o),i},f.rest=function(e,t){if("function"!=typeof e)throw new ji(Ra);return ne(e,t=t===Aa?t:hi(t))},f.reverse=Ft,f.sampleSize=function(e,t,i){return t=(i?ft(e,t,i):t===Aa)?1:hi(t),($o(e)?function(e,t){return Tt(Me(e),d(t,0,e.length))}:function(e,t){var i=wi(e);return Tt(i,d(t,0,i.length))})(e,t)},f.set=function(e,t,i){return null==e?e:ae(e,t,i)},f.setWith=function(e,t,i,r){return r="function"==typeof r?r:Aa,null==e?e:ae(e,t,i,r)},f.shuffle=function(e){return($o(e)?function(e){return Tt(Me(e))}:function(e){return Tt(wi(e))})(e)},f.slice=function(e,t,i){var r=null==e?0:e.length;return r?(i=i&&"number"!=typeof i&&ft(e,t,i)?(t=0,r):(t=null==t?0:hi(t),i===Aa?r:hi(i)),se(e,t,i)):[]},f.sortBy=Ho,f.sortedUniq=function(e){return e&&e.length?he(e):[]},f.sortedUniqBy=function(e,t){return e&&e.length?he(e,lt(t,2)):[]},f.split=function(e,t,i){return i&&"number"!=typeof i&&ft(e,t,i)&&(t=i=Aa),(i=i===Aa?Ga:i>>>0)?(e=gi(e))&&("string"==typeof t||null!=t&&!on(t))&&!(t=me(t))&&Pa(e)?Se(Ma(e),0,i):e.split(t,i):[]},f.spread=function(r,o){if("function"!=typeof r)throw new ji(Ra);return o=null==o?0:Er(hi(o),0),ne(function(e){var t=e[o],i=Se(e,0,o);return t&&na(i,t),Kn(r,this,i)})},f.tail=function(e){var t=null==e?0:e.length;return t?se(e,1,t):[]},f.take=function(e,t,i){return e&&e.length?se(e,0,(t=i||t===Aa?1:hi(t))<0?0:t):[]},f.takeRight=function(e,t,i){var r=null==e?0:e.length;return r?se(e,(t=r-(t=i||t===Aa?1:hi(t)))<0?0:t,r):[]},f.takeRightWhile=function(e,t){return e&&e.length?ve(e,lt(t,3),!1,!0):[]},f.takeWhile=function(e,t){return e&&e.length?ve(e,lt(t,3)):[]},f.tap=function(e,t){return t(e),e},f.throttle=function(e,t,i){var r=!0,o=!0;if("function"!=typeof e)throw new ji(Ra);return ri(i)&&(r="leading"in i?!!i.leading:r,o="trailing"in i?!!i.trailing:o),Yt(e,t,{leading:r,maxWait:t,trailing:o})},f.thru=Bt,f.toArray=ui,f.toPairs=En,f.toPairsIn=Sn,f.toPath=function(e){return $o(e)?oa(e,It):li(e)?[e]:Me(ho(gi(e)))},f.toPlainObject=pi,f.transform=function(e,r,o){var t=$o(e),i=t||en(e)||an(e);if(r=lt(r,4),null==o){var n=e&&e.constructor;o=i?t?new n:[]:ri(e)&&ei(n)?Ur(nr(e)):{}}return(i?Zn:D)(e,function(e,t,i){return r(o,e,t,i)}),o},f.unary=function(e){return Ut(e,1)},f.union=wo,f.unionBy=bo,f.unionWith=Eo,f.uniq=function(e){return e&&e.length?pe(e):[]},f.uniqBy=function(e,t){return e&&e.length?pe(e,lt(t,2)):[]},f.uniqWith=function(e,t){return t="function"==typeof t?t:Aa,e&&e.length?pe(e,Aa,t):[]},f.unset=function(e,t){return null==e||ge(e,t)},f.unzip=Ht,f.unzipWith=Gt,f.update=function(e,t,i){return null==e?e:fe(e,t,be(i))},f.updateWith=function(e,t,i,r){return r="function"==typeof r?r:Aa,null==e?e:fe(e,t,be(i),r)},f.values=wi,f.valuesIn=function(e){return null==e?[]:Ca(e,yi(e))},f.without=So,f.words=Si,f.wrap=function(e,t){return qo(be(t),e)},f.xor=Po,f.xorBy=xo,f.xorWith=To,f.zip=Io,f.zipObject=function(e,t){return Ce(e||[],t||[],P)},f.zipObjectDeep=function(e,t){return Ce(e||[],t||[],ae)},f.zipWith=Do,f.entries=En,f.entriesIn=Sn,f.extend=cn,f.extendWith=hn,Ii(f,f),f.add=Wn,f.attempt=Rn,f.camelCase=Pn,f.capitalize=bi,f.ceil=Un,f.clamp=function(e,t,i){return i===Aa&&(i=t,t=Aa),i!==Aa&&(i=(i=mi(i))==i?i:0),t!==Aa&&(t=(t=mi(t))==t?t:0),d(mi(e),t,i)},f.clone=function(e){return T(e,4)},f.cloneDeep=function(e){return T(e,5)},f.cloneDeepWith=function(e,t){return T(e,5,t="function"==typeof t?t:Aa)},f.cloneWith=function(e,t){return T(e,4,t="function"==typeof t?t:Aa)},f.conformsTo=function(e,t){return null==t||m(e,t,_i(t))},f.deburr=Ei,f.defaultTo=function(e,t){return null==e||e!=e?t:e},f.divide=qn,f.endsWith=function(e,t,i){e=gi(e),t=me(t);var r=e.length,o=i=i===Aa?r:d(hi(i),0,r);return 0<=(i-=t.length)&&e.slice(i,o)==t},f.eq=Qt,f.escape=function(e){return(e=gi(e))&&Cs.test(e)?e.replace(_s,dl):e},f.escapeRegExp=function(e){return(e=gi(e))&&Is.test(e)?e.replace(Ts,"\\$&"):e},f.every=function(e,t,i){var r=$o(e)?ea:w;return i&&ft(e,t,i)&&(t=Aa),r(e,lt(t,3))},f.find=Ao,f.findIndex=Mt,f.findKey=function(e,t){return ua(e,lt(t,3),D)},f.findLast=Ro,f.findLastIndex=At,f.findLastKey=function(e,t){return ua(e,lt(t,3),L)},f.floor=Yn,f.forEach=jt,f.forEachRight=zt,f.forIn=function(e,t){return null==e?e:Xr(e,lt(t,3),yi)},f.forInRight=function(e,t){return null==e?e:Jr(e,lt(t,3),yi)},f.forOwn=function(e,t){return e&&D(e,lt(t,3))},f.forOwnRight=function(e,t){return e&&L(e,lt(t,3))},f.get=fi,f.gt=Jo,f.gte=Qo,f.has=function(e,t){return null!=e&&dt(e,t,V)},f.hasIn=vi,f.head=Ot,f.identity=xi,f.includes=function(e,t,i,r){e=Kt(e)?e:wi(e),i=i&&!r?hi(i):0;var o=e.length;return i<0&&(i=Er(o+i,0)),si(e)?i<=o&&-1<e.indexOf(t,i):!!o&&-1<ha(e,t,i)},f.indexOf=function(e,t,i){var r=null==e?0:e.length;if(!r)return-1;var o=null==i?0:hi(i);return o<0&&(o=Er(r+o,0)),ha(e,t,o)},f.inRange=function(e,t,i){return t=ci(t),i===Aa?(i=t,t=0):i=ci(i),e=mi(e),(r=e)>=Sr(o=t,n=i)&&r<Er(o,n);var r,o,n},f.invoke=_n,f.isArguments=Ko,f.isArray=$o,f.isArrayBuffer=Zo,f.isArrayLike=Kt,f.isArrayLikeObject=$t,f.isBoolean=function(e){return!0===e||!1===e||oi(e)&&O(e)==za},f.isBuffer=en,f.isDate=tn,f.isElement=function(e){return oi(e)&&1===e.nodeType&&!ai(e)},f.isEmpty=function(e){if(null==e)return!0;if(Kt(e)&&($o(e)||"string"==typeof e||"function"==typeof e.splice||en(e)||an(e)||Ko(e)))return!e.length;var t=oo(e);if(t==Xa||t==Za)return!e.size;if(yt(e))return!U(e).length;for(var i in e)if(Xi.call(e,i))return!1;return!0},f.isEqual=function(e,t){return B(e,t)},f.isEqualWith=function(e,t,i){var r=(i="function"==typeof i?i:Aa)?i(e,t):Aa;return r===Aa?B(e,t,Aa,i):!!r},f.isError=Zt,f.isFinite=function(e){return"number"==typeof e&&Cr(e)},f.isFunction=ei,f.isInteger=ti,f.isLength=ii,f.isMap=rn,f.isMatch=function(e,t){return e===t||j(e,t,ct(t))},f.isMatchWith=function(e,t,i){return i="function"==typeof i?i:Aa,j(e,t,ct(t),i)},f.isNaN=function(e){return ni(e)&&e!=+e},f.isNative=function(e){if(so(e))throw new Vi("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return z(e)},f.isNil=function(e){return null==e},f.isNull=function(e){return null===e},f.isNumber=ni,f.isObject=ri,f.isObjectLike=oi,f.isPlainObject=ai,f.isRegExp=on,f.isSafeInteger=function(e){return ti(e)&&-Fa<=e&&e<=Fa},f.isSet=nn,f.isString=si,f.isSymbol=li,f.isTypedArray=an,f.isUndefined=function(e){return e===Aa},f.isWeakMap=function(e){return oi(e)&&oo(e)==is},f.isWeakSet=function(e){return oi(e)&&"[object WeakSet]"==O(e)},f.join=function(e,t){return null==e?"":wr.call(e,t)},f.kebabCase=xn,f.last=Nt,f.lastIndexOf=function(e,t,i){var r=null==e?0:e.length;if(!r)return-1;var o=r;return i!==Aa&&(o=(o=hi(i))<0?Er(r+o,0):Sr(o,r-1)),t==t?function(e,t,i){for(var r=i+1;r--;)if(e[r]===t)return r;return r}(e,t,o):ca(e,ma,o,!0)},f.lowerCase=Tn,f.lowerFirst=In,f.lt=sn,f.lte=ln,f.max=function(e){return e&&e.length?b(e,xi,N):Aa},f.maxBy=function(e,t){return e&&e.length?b(e,lt(t,2),N):Aa},f.mean=function(e){return pa(e,xi)},f.meanBy=function(e,t){return pa(e,lt(t,2))},f.min=function(e){return e&&e.length?b(e,xi,Y):Aa},f.minBy=function(e,t){return e&&e.length?b(e,lt(t,2),Y):Aa},f.stubArray=Mi,f.stubFalse=Ai,f.stubObject=function(){return{}},f.stubString=function(){return""},f.stubTrue=function(){return!0},f.multiply=Xn,f.nth=function(e,t){return e&&e.length?$(e,hi(t)):Aa},f.noConflict=function(){return rl._===this&&(rl._=Zi),this},f.noop=Di,f.now=Go,f.pad=function(e,t,i){e=gi(e);var r=(t=hi(t))?La(e):0;if(!t||t<=r)return e;var o=(t-r)/2;return qe(vr(o),i)+e+qe(fr(o),i)},f.padEnd=function(e,t,i){e=gi(e);var r=(t=hi(t))?La(e):0;return t&&r<t?e+qe(t-r,i):e},f.padStart=function(e,t,i){e=gi(e);var r=(t=hi(t))?La(e):0;return t&&r<t?qe(t-r,i)+e:e},f.parseInt=function(e,t,i){return i||null==t?t=0:t&&(t=+t),xr(gi(e).replace(Ls,""),t||0)},f.random=function(e,t,i){if(i&&"boolean"!=typeof i&&ft(e,t,i)&&(t=i=Aa),i===Aa&&("boolean"==typeof t?(i=t,t=Aa):"boolean"==typeof e&&(i=e,e=Aa)),e===Aa&&t===Aa?(e=0,t=1):(e=ci(e),t===Aa?(t=e,e=0):t=ci(t)),t<e){var r=e;e=t,t=r}if(i||e%1||t%1){var o=Tr();return Sr(e+o*(t-e+tl("1e-"+((o+"").length-1))),t)}return re(e,t)},f.reduce=function(e,t,i){var r=$o(e)?aa:fa,o=arguments.length<3;return r(e,lt(t,4),i,o,qr)},f.reduceRight=function(e,t,i){var r=$o(e)?sa:fa,o=arguments.length<3;return r(e,lt(t,4),i,o,Yr)},f.repeat=function(e,t,i){return t=(i?ft(e,t,i):t===Aa)?1:hi(t),oe(gi(e),t)},f.replace=function(){var e=arguments,t=gi(e[0]);return e.length<3?t:t.replace(e[1],e[2])},f.result=function(e,t,i){var r=-1,o=(t=Ee(t,e)).length;for(o||(o=1,e=Aa);++r<o;){var n=null==e?Aa:e[It(t[r])];n===Aa&&(r=o,n=i),e=ei(n)?n.call(e):n}return e},f.round=Jn,f.runInContext=e,f.sample=function(e){return($o(e)?a:function(e){return a(wi(e))})(e)},f.size=function(e){if(null==e)return 0;if(Kt(e))return si(e)?La(e):e.length;var t=oo(e);return t==Xa||t==Za?e.size:U(e).length},f.snakeCase=Dn,f.some=function(e,t,i){var r=$o(e)?la:le;return i&&ft(e,t,i)&&(t=Aa),r(e,lt(t,3))},f.sortedIndex=function(e,t){return ue(e,t)},f.sortedIndexBy=function(e,t,i){return ce(e,t,lt(i,2))},f.sortedIndexOf=function(e,t){var i=null==e?0:e.length;if(i){var r=ue(e,t);if(r<i&&Qt(e[r],t))return r}return-1},f.sortedLastIndex=function(e,t){return ue(e,t,!0)},f.sortedLastIndexBy=function(e,t,i){return ce(e,t,lt(i,2),!0)},f.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var i=ue(e,t,!0)-1;if(Qt(e[i],t))return i}return-1},f.startCase=Ln,f.startsWith=function(e,t,i){return e=gi(e),i=null==i?0:d(hi(i),0,e.length),t=me(t),e.slice(i,i+t.length)==t},f.subtract=Qn,f.sum=function(e){return e&&e.length?va(e,xi):0},f.sumBy=function(e,t){return e&&e.length?va(e,lt(t,2)):0},f.template=function(a,e,t){var i=f.templateSettings;t&&ft(a,e,t)&&(e=Aa),a=gi(a),e=hn({},e,i,Ze);var s,l,r=hn({},e.imports,i.imports,Ze),o=_i(r),n=Ca(r,o),u=0,c=e.interpolate||Us,h="__p += '",d=ki((e.escape||Us).source+"|"+c.source+"|"+(c===Es?Fs:Us).source+"|"+(e.evaluate||Us).source+"|$","g"),m="//# sourceURL="+(Xi.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$s+"]")+"\n";a.replace(d,function(e,t,i,r,o,n){return i||(i=r),h+=a.slice(u,n).replace(qs,Sa),t&&(s=!0,h+="' +\n__e("+t+") +\n'"),o&&(l=!0,h+="';\n"+o+";\n__p += '"),i&&(h+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),u=n+e.length,e}),h+="';\n";var p=Xi.call(e,"variable")&&e.variable;p||(h="with (obj) {\n"+h+"\n}\n"),h=(l?h.replace(ps,""):h).replace(gs,"$1").replace(fs,"$1;"),h="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(l?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=Rn(function(){return Fi(o,m+"return "+h).apply(Aa,n)});if(g.source=h,Zt(g))throw g;return g},f.times=function(e,t){if((e=hi(e))<1||Fa<e)return[];var i=Ga,r=Sr(e,Ga);t=lt(t),e-=Ga;for(var o=_a(r,t);++i<e;)t(i);return o},f.toFinite=ci,f.toInteger=hi,f.toLength=di,f.toLower=function(e){return gi(e).toLowerCase()},f.toNumber=mi,f.toSafeInteger=function(e){return e?d(hi(e),-Fa,Fa):0===e?e:0},f.toString=gi,f.toUpper=function(e){return gi(e).toUpperCase()},f.trim=function(e,t,i){if((e=gi(e))&&(i||t===Aa))return e.replace(Ds,"");if(!e||!(t=me(t)))return e;var r=Ma(e),o=Ma(t);return Se(r,ba(r,o),Ea(r,o)+1).join("")},f.trimEnd=function(e,t,i){if((e=gi(e))&&(i||t===Aa))return e.replace(Ms,"");if(!e||!(t=me(t)))return e;var r=Ma(e);return Se(r,0,Ea(r,Ma(t))+1).join("")},f.trimStart=function(e,t,i){if((e=gi(e))&&(i||t===Aa))return e.replace(Ls,"");if(!e||!(t=me(t)))return e;var r=Ma(e);return Se(r,ba(r,Ma(t))).join("")},f.truncate=function(e,t){var i=30,r="...";if(ri(t)){var o="separator"in t?t.separator:o;i="length"in t?hi(t.length):i,r="omission"in t?me(t.omission):r}var n=(e=gi(e)).length;if(Pa(e)){var a=Ma(e);n=a.length}if(n<=i)return e;var s=i-La(r);if(s<1)return r;var l=a?Se(a,0,s).join(""):e.slice(0,s);if(o===Aa)return l+r;if(a&&(s+=l.length-s),on(o)){if(e.slice(s).search(o)){var u,c=l;for(o.global||(o=ki(o.source,gi(Hs.exec(o))+"g")),o.lastIndex=0;u=o.exec(c);)var h=u.index;l=l.slice(0,h===Aa?s:h)}}else if(e.indexOf(me(o),s)!=s){var d=l.lastIndexOf(o);-1<d&&(l=l.slice(0,d))}return l+r},f.unescape=function(e){return(e=gi(e))&&ys.test(e)?e.replace(vs,ml):e},f.uniqueId=function(e){var t=++Ji;return gi(e)+t},f.upperCase=Mn,f.upperFirst=An,f.each=jt,f.eachRight=zt,f.first=Ot,Ii(f,(Wo={},D(f,function(e,t){Xi.call(f.prototype,t)||(Wo[t]=e)}),Wo),{chain:!1}),f.VERSION="4.17.20",Zn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){f[e].placeholder=f}),Zn(["drop","take"],function(i,r){_.prototype[i]=function(e){e=e===Aa?1:Er(hi(e),0);var t=this.__filtered__&&!r?new _(this):this.clone();return t.__filtered__?t.__takeCount__=Sr(e,t.__takeCount__):t.__views__.push({size:Sr(e,Ga),type:i+(t.__dir__<0?"Right":"")}),t},_.prototype[i+"Right"]=function(e){return this.reverse()[i](e).reverse()}}),Zn(["filter","map","takeWhile"],function(e,t){var i=t+1,r=1==i||3==i;_.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:lt(e,3),type:i}),t.__filtered__=t.__filtered__||r,t}}),Zn(["head","last"],function(e,t){var i="take"+(t?"Right":"");_.prototype[e]=function(){return this[i](1).value()[0]}}),Zn(["initial","tail"],function(e,t){var i="drop"+(t?"":"Right");_.prototype[e]=function(){return this.__filtered__?new _(this):this[i](1)}}),_.prototype.compact=function(){return this.filter(xi)},_.prototype.find=function(e){return this.filter(e).head()},_.prototype.findLast=function(e){return this.reverse().find(e)},_.prototype.invokeMap=ne(function(t,i){return"function"==typeof t?new _(this):this.map(function(e){return G(e,t,i)})}),_.prototype.reject=function(e){return this.filter(Jt(lt(e)))},_.prototype.slice=function(e,t){e=hi(e);var i=this;return i.__filtered__&&(0<e||t<0)?new _(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),t!==Aa&&(i=(t=hi(t))<0?i.dropRight(-t):i.take(t-e)),i)},_.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},_.prototype.toArray=function(){return this.take(Ga)},D(_.prototype,function(h,e){var d=/^(?:filter|find|map|reject)|While$/.test(e),m=/^(?:head|last)$/.test(e),p=f[m?"take"+("last"==e?"Right":""):e],g=m||/^find/.test(e);p&&(f.prototype[e]=function(){var e=this.__wrapped__,i=m?[1]:arguments,t=e instanceof _,r=i[0],o=t||$o(e),n=function(e){var t=p.apply(f,na([e],i));return m&&a?t[0]:t};o&&d&&"function"==typeof r&&1!=r.length&&(t=o=!1);var a=this.__chain__,s=!!this.__actions__.length,l=g&&!a,u=t&&!s;if(g||!o)return l&&u?h.apply(this,i):(c=this.thru(n),l?m?c.value()[0]:c.value():c);e=u?e:new _(this);var c=h.apply(e,i);return c.__actions__.push({func:Bt,args:[n],thisArg:Aa}),new v(c,a)})}),Zn(["pop","push","shift","sort","splice","unshift"],function(e){var i=zi[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);f.prototype[e]=function(){var t=arguments;if(!o||this.__chain__)return this[r](function(e){return i.apply($o(e)?e:[],t)});var e=this.value();return i.apply($o(e)?e:[],t)}}),D(_.prototype,function(e,t){var i=f[t];if(i){var r=i.name+"";Xi.call(Vr,r)||(Vr[r]=[]),Vr[r].push({name:t,func:i})}}),Vr[je(Aa,2).name]=[{name:"wrapper",func:Aa}],_.prototype.clone=function(){var e=new _(this.__wrapped__);return e.__actions__=Me(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Me(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Me(this.__views__),e},_.prototype.reverse=function(){if(this.__filtered__){var e=new _(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},_.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,i=$o(e),r=t<0,o=i?e.length:0,n=function(e,t,i){for(var r=-1,o=i.length;++r<o;){var n=i[r],a=n.size;switch(n.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=Sr(t,e+a);break;case"takeRight":e=Er(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=n.start,s=n.end,l=s-a,u=r?s:a-1,c=this.__iteratees__,h=c.length,d=0,m=Sr(l,this.__takeCount__);if(!i||!r&&o==l&&m==l)return _e(e,this.__actions__);var p=[];e:for(;l--&&d<m;){for(var g=-1,f=e[u+=t];++g<h;){var v=c[g],_=v.iteratee,y=v.type,C=_(f);if(2==y)f=C;else if(!C){if(1==y)continue e;break e}}p[d++]=f}return p},f.prototype.at=Lo,f.prototype.chain=function(){return kt(this)},f.prototype.commit=function(){return new v(this.value(),this.__chain__)},f.prototype.next=function(){this.__values__===Aa&&(this.__values__=ui(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?Aa:this.__values__[this.__index__++]}},f.prototype.plant=function(e){for(var t,i=this;i instanceof n;){var r=Lt(i);r.__index__=0,r.__values__=Aa,t?o.__wrapped__=r:t=r;var o=r;i=i.__wrapped__}return o.__wrapped__=e,t},f.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof _){var t=e;return this.__actions__.length&&(t=new _(this)),(t=t.reverse()).__actions__.push({func:Bt,args:[Ft],thisArg:Aa}),new v(t,this.__chain__)}return this.thru(Ft)},f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=function(){return _e(this.__wrapped__,this.__actions__)},f.prototype.first=f.prototype.head,cr&&(f.prototype[cr]=function(){return this}),f}();"function"==typeof define&&"object"==_typeof2(define.amd)&&define.amd?(rl._=pl,define("SGWorld/../../node_modules/lodash/lodash.min",[],function(){return pl})):F?((F.exports=pl)._=pl,V._=pl):rl._=pl}.call(this),define("SGWorld/ProjectTree/treeSource",["../../../node_modules/lodash/lodash.min"],function(a){"use strict";var s={Source:[],TempSource:[],entity:[],lastSelectEntity:null,pointsId:[],states:0,PointSelectSource:[],currentObj:null,selectedItem:null,setSource:function(e){this.Source=e},setTempSource:function(e){this.TempSource=e},setPointSelectSource:function(e){this.PointSelectSource=e},getSource:function(){return this.Source},getTempSource:function(){return this.TempSource},getPointSelectSource:function(){return this.PointSelectSource},push:function(e){this.Source.push(e)},pusTemSource:function(e){this.TempSource.push(e)},pusPointSelectSource:function(e){this.PointSelectSource.push(e)},insertGroupId:function(e,t){null!=e.checked&&"true"!=e.checked&&null!=e.checked||(e.checked=!0);try{0==e.item.item.show&&(e.checked=!1)}catch(e){}var i=this.getSourceById(s.Source,t);if(i){for(var r=0,o=this.TempSource.length;r<o;r++)if(this.TempSource[r].id==t){e.checked&&!this.TempSource[r].checked&&(this.TempSource[r].checked=!0);break}i.children||(i.children=[]),i.children.push(e)}else this.push(e);var n=a.clone(e);return n.item=null,s.currentObj=n,this.pusTemSource(n),e.id},getSourceById:function(e,t){if(e)for(var i=0;i<e.length;i++){if(e[i].id==t)return e[i];if(e[i]&&e[i].children&&0<e[i].children.length){var r=this.getSourceById(e[i].children,t);if(null!=r)return r}}},exitsGroup:function(e,t){if(e)for(var i=s.Source,r=0;r<i.length;r++){if(i[r].id==e){if("group"==i[r].type)for(var o=0;o<i[r].children.length;o++){if(i[r].children[o].name==t)return!0}return!1}if(i[r]&&i[r].children&&0<i[r].children.length)this.getSourceById(i[r].children,e)}},getTempSourceById:function(e){for(var t=0;t<this.TempSource.length;t++)if(this.TempSource[t].id==e)return this.TempSource[t]},getPointSelectSourceById:function(e){for(var t=0;t<this.PointSelectSource.length;t++)if(this.PointSelectSource[t].id==e)return this.PointSelectSource[t]},getSourceByName:function(e,t){return a.find(e,function(e){return e.name==t})},delete:function(e,t,i){var r=this.getSourceById(s.Source,e);if(r&&r.children&&0<r.children.length){for(;0<r.children.length;)this.delete(r.children[0].id);if(r&&"group"==r.type)if(0==r.pId||""==r.pId){var o=this.getIndex(s.Source,r);s.Source.splice(o,1),this.delete1(r.id)}else{var n=this.getSourceById(s.Source,r.pId);o=this.getIndex(n.children,r);n.children.splice(o,1),this.delete1(r.id)}else{if(r.item)r.item.deleteObject(e);else{try{t.entities.removeById(r.id)}catch(e){}try{(a=t.dataSources.get(r.id))&&t.dataSources.remove(a)}catch(e){}try{(a=t.imageryLayers.get(r.id))&&t.imageryLayers.remove(a)}catch(e){}try{var a=t.scene.primitives.get(r.id);t.scene.primitives.remove(a)}catch(e){}}n=this.getSourceById(s.Source,r.pId),o=this.getIndex(n.children,r);n.children.splice(o,1),this.delete1(r.id)}}else if(r&&"group"==r.type)if(0==r.pId||""==r.pId){o=this.getIndex(s.Source,r);s.Source.splice(o,1),this.delete1(r.id)}else{n=this.getSourceById(s.Source,r.pId),o=this.getIndex(n.children,r);n.children.splice(o,1),this.delete1(r.id)}else if(r){if(r.item&&r.item.deleteObject)r.item.deleteObject(e);else{try{t.entities.removeById(r.id)}catch(e){}try{(a=t.dataSources.get(r.id))&&t.dataSources.remove(a)}catch(e){}try{(a=t.imageryLayers.get(r.id))&&t.imageryLayers.remove(a)}catch(e){}try{a=t.scene.primitives.get(r.id);t.scene.primitives.remove(a)}catch(e){}}if(this.delete1(r.id),n=this.getSourceById(s.Source,r.pId)){o=this.getIndex(n.children,r);n.children.splice(o,1)}}},temporaryItem:{obj:[],state:"start",operation:""},endtemporaryItem:function(){s.temporaryItem.obj=[],s.temporaryItem.state="end",s.temporaryItem.operation=""},starttemporaryItem:function(e){var t=null;try{t=document.getElementById("toolTip")}catch(e){}if(null!=t&&(t.style.display="none"),null!=s.handler&&(s.handler.destroy(),s.handler=null),0<s.temporaryItem.obj.length&&"start"==s.temporaryItem.state)for(var i=0;i<s.temporaryItem.obj.length;i++){try{s.temporaryItem.obj[i].destroy()}catch(e){}try{e.entities.remove(s.temporaryItem.obj[i])}catch(e){}}return s.temporaryItem.obj=[],s.temporaryItem.state="start",s.temporaryItem.operation},delete1:function(e){for(var t=0;t<this.TempSource.length;t++)this.TempSource[t].id==e&&this.TempSource.splice(t,1)},getIndex:function(e,t){for(var i=0;i<e.length;i++)if(e[i].id==t.id)return i;return-1},setVisibilityTemp:function(t,e){var i=a.filter(this.TempSource,function(e){return e.id==t});i&&i.length&&(i[0].checked=e)},setVisibility:function(e,t,i,r){this.setVisibilityTemp(e,t);var o=this.getSourceById(s.Source,e);if(o)if(o.children&&0<o.children.length){for(var n=0;n<o.children.length;n++)this.setVisibility(o.children[n].id,t);if("group"==o.type);else if(o.item&&o.item.setVisibility)o.item.setVisibility(t,e);else{try{(a=i.entities.getById(o.id))&&(a.show=t)}catch(e){}try{(a=i.dataSources.get(o.id))&&(a.show=t)}catch(e){}try{(a=i.imageryLayers.get(o.id))&&(a.show=t)}catch(e){}try{(a=i.scene.primitives.get(o.id))&&(a.show=t)}catch(e){}}}else if("group"==o.type);else if(o.item&&o.item.setVisibility)o.item.setVisibility(t,e);else{try{(a=i.entities.getById(o.id))&&(a.show=t)}catch(e){}try{(a=i.dataSources.get(o.id))&&(a.show=t)}catch(e){}try{(a=i.imageryLayers.get(o.id))&&(a.show=t)}catch(e){}try{var a;(a=i.scene.primitives.get(o.id))&&(a.show=t)}catch(e){}}},removeItem:function(e){if(e)for(var t=0;t<e.length;t++)e[t].item=null,e[t].children&&this.removeItem(e[t].children);return e},changeGroup:function(e,t){var i=this.getSourceById(this.Source,e),r=this.getSourceById(this.Source,t);if(i&&r&&r.children)if(0==i.id||null==i.id||null==i.id){var o=this.getIndex(this.Source,i);this.Source.splice(o,1),i.pId=t,r.children.push(i)}else{var n=this.getSourceById(this.Source,i.pId);o=this.getIndex(n.children,i);n.children.splice(o,1),i.pId=t,r.children.push(i)}(i=this.getTempSourceById(e))&&(i.pId=t)},handler:null,removeHandler:function(){s.handler&&(s.handler.destroy(),s.handler=null)}};return s}),define("SGWorld/Navigate/flyToObj",["../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min"],function(u,c){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._tree=u.getSource()}return e.prototype.flyToObj=function(e){if(e&&null!=e.west&&null!=e.west)this._viewer.camera.flyTo({destination:this._cesium.Rectangle.fromDegrees(e.west,e.south,e.east,e.north)});else{if(e&&e.item&&null!=e.item.id&&null!=e.item.id){var t=u.getSourceById(this._tree,e.item.id);try{var i=this._viewer.scene.primitives.get(t.id);this._viewer.flyTo(i)}catch(e){}}if(e&&e.item)if(e.item.entities)this._viewer.flyTo(e.item);else if(e.item._primitives&&e.item._primitives.length){var r=c.filter(e.item._primitives,function(e){return null==e.geometryInstances});if(0<r.length)if(null!=r[0]._boundingSpheres)this._viewer.camera.flyToBoundingSphere(r[0]._boundingSpheres[0]);else if(null!=r[0]._primitive&&null!=r[0]._primitive&&null!=r[0]._primitive._boundingSpheres[0]&&null!=r[0]._primitive._boundingSpheres[0])this._viewer.camera.flyToBoundingSphere(r[0]._primitive._boundingSpheres[0]);else if(null!=r[0]._labels&&0<r[0]._labels.length){var o=r[0]._labels[0].position,n=this._cesium.Cartographic.fromCartesian(o),a=this._cesium.Math.toDegrees(n.longitude),s=this._cesium.Math.toDegrees(n.latitude),l=this._cesium.Cartesian3.fromDegrees(a,s,2e3);this._viewer.camera.flyTo({destination:l})}else if(null!=r[0]._pointPrimitives&&0<r[0]._pointPrimitives.length){o=r[0]._pointPrimitives[0].position,n=this._cesium.Cartographic.fromCartesian(o),a=this._cesium.Math.toDegrees(n.longitude),s=this._cesium.Math.toDegrees(n.latitude),l=this._cesium.Cartesian3.fromDegrees(a,s,2e3);this._viewer.camera.flyTo({destination:l})}else if(null!=r[0]._billboards&&0<r[0]._billboards.length){o=r[0]._billboards[0].position,n=this._cesium.Cartographic.fromCartesian(o),a=this._cesium.Math.toDegrees(n.longitude),s=this._cesium.Math.toDegrees(n.latitude),l=this._cesium.Cartesian3.fromDegrees(a,s,2e3);this._viewer.camera.flyTo({destination:l})}}else if(e.item._primitives&&e.item._primitives._boundingSpheres)e.item._primitives._boundingSpheres.length&&this._viewer.camera.flyToBoundingSphere(e.item._primitives._boundingSpheres[0]);else if(e.item._boundingSpheres&&0<e.item._boundingSpheres.length)this._viewer.camera.flyToBoundingSphere(e.item._boundingSpheres[0]);else if(e.item._boundingVolumes&&e.item._boundingVolumes.length){o=e.item._boundingVolumes[0].center,n=this._cesium.Cartographic.fromCartesian(o),a=this._cesium.Math.toDegrees(n.longitude),s=this._cesium.Math.toDegrees(n.latitude),l=this._cesium.Cartesian3.fromDegrees(a,s,5e3);this._viewer.camera.flyTo({destination:l})}else this._viewer.flyTo(e.item);else e&&this._viewer.flyTo(e)}},e}),define("SGWorld/Navigate/jumpTo",["../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min"],function(u,c){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._tree=u.getSource()}return e.prototype.jumpTo=function(e){if(e&&null!=e.west&&null!=e.west)this._viewer.camera.setView({destination:this._cesium.Rectangle.fromDegrees(e.west,e.south,e.east,e.north)});else if(e&&void 0!==e.destination)this._viewer.camera.setView({destination:e.destination,orientation:e.orientation});else{if(e&&e.item&&null!=e.item.id&&null!=e.item.id){var t=u.getSourceById(this._tree,e.item.id);try{var i=this._viewer.scene.primitives.get(t.id);this._viewer.zoomTo(i)}catch(e){}}if(e&&e.item)if(e.item.entities)this._viewer.zoomTo(e.item);else if(e.item._primitives&&e.item._primitives.length){var r=c.filter(e.item._primitives,function(e){return null==e.geometryInstances});if(0<r.length)if(null!=r[0]._boundingSpheres)this._viewer.camera.viewBoundingSphere(r[0]._boundingSpheres[0]);else if(null!=r[0]._labels&&0<r[0]._labels.length){var o=r[0]._labels[0].position,n=this._cesium.Cartographic.fromCartesian(o),a=this._cesium.Math.toDegrees(n.longitude),s=this._cesium.Math.toDegrees(n.latitude),l=this._cesium.Cartesian3.fromDegrees(a,s,2e3);this._viewer.camera.setView({destination:l})}else if(null!=r[0]._pointPrimitives&&0<r[0]._pointPrimitives.length){o=r[0]._pointPrimitives[0].position,n=this._cesium.Cartographic.fromCartesian(o),a=this._cesium.Math.toDegrees(n.longitude),s=this._cesium.Math.toDegrees(n.latitude),l=this._cesium.Cartesian3.fromDegrees(a,s,2e3);this._viewer.camera.setView({destination:l})}else if(null!=r[0]._billboards&&0<r[0]._billboards.length){o=r[0]._billboards[0].position,n=this._cesium.Cartographic.fromCartesian(o),a=this._cesium.Math.toDegrees(n.longitude),s=this._cesium.Math.toDegrees(n.latitude),l=this._cesium.Cartesian3.fromDegrees(a,s,2e3);this._viewer.camera.setView({destination:l})}}else if(e.item._primitives&&e.item._primitives._boundingSpheres)e.item._primitives._boundingSpheres.length&&this._viewer.camera.viewBoundingSphere(e.item._primitives._boundingSpheres[0]);else if(e.item._boundingSpheres&&0<e.item._boundingSpheres.length)this._viewer.camera.viewBoundingSphere(e.item._boundingSpheres[0]);else if(e.item._boundingVolumes&&e.item._boundingVolumes.length){o=e.item._boundingVolumes[0].center,n=this._cesium.Cartographic.fromCartesian(o),a=this._cesium.Math.toDegrees(n.longitude),s=this._cesium.Math.toDegrees(n.latitude),l=this._cesium.Cartesian3.fromDegrees(a,s,5e3);this._viewer.camera.setView({destination:l})}else this._viewer.zoomTo(e.item);else e&&this._viewer.zoomTo(e)}},e}),define("SGWorld/Navigate/northfinger",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.northfinger=function(){this._viewer.camera.setView({destination:this._viewer.camera._destination,orientation:{pitch:this._viewer.camera._pitch,roll:0}})},e}),define("SGWorld/Navigate/getPosition",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.getPosition=function(){return this._viewer.camera.position},e.prototype.getDegrees=function(){var e=this._viewer.camera.positionCartographic;return{lon:this._cesium.Math.toDegrees(e.longitude),lat:this._cesium.Math.toDegrees(e.latitude),height:e.height}},e.prototype.getMousePosition=function(e,t,i,r,o){var n,a,s,l,u=e.endPosition||e.position||e;void 0===i&&(i=0),r=this._cesium.defaultValue(r,!1),void 0===this.defaultDepthTest&&(this.defaultDepthTest=!!this._viewer.scene.globe.depthTestAgainstTerrain);var c=r?o||30:1;if(0!==i?(this._viewer.scene.globe.depthTestAgainstTerrain=!0,(n=this._viewer.camera.getPickRay(u))&&(a=this._viewer.scene.globe.pick(n,this._viewer.scene)),t&&0!==t.length?(l=this._viewer.scene.drillPick(u,t.length,c,c),l=this.getNotExcludedObj(l,t)):(l=this._viewer.scene.pick(u))&&l.id&&!this.id3DGraphic(l.id)&&(l=void 0),l&&!r?(this._viewer.scene.pick(u),(s=this._viewer.scene.pickPosition(u))&&(a=s)):(a&&r&&(s=this._getAdsorptionPosition(u,l,o)),s&&(a=s))):(t&&0!==t.length?(l=this._viewer.scene.drillPick(u,t&&t.length&&t.length+1||1,c,c),l=this.getNotExcludedObj(l,t)):(l=this._viewer.scene.pick(u))&&l.id&&!this.id3DGraphic(l.id)&&(l=void 0),l&&!r?(this._viewer.scene.pick(u),a=this._viewer.scene.pickPosition(u)):l&&r?(this._viewer.scene.pick(u),a=this._viewer.scene.pickPosition(u),(s=this._getAdsorptionPosition(u,l,o))&&(a=s)):(this._viewer.scene.globe.depthTestAgainstTerrain=!0,(n=this._viewer.camera.getPickRay(u))&&(a=this._viewer.scene.globe.pick(n,this._viewer.scene)))),this._viewer.scene.globe.depthTestAgainstTerrain=!!this.defaultDepthTest,this.defaultDepthTest=void 0,a)return a;console.log("未拾取到坐标!")},e.prototype.getMouseDegrees=function(e,t,i,r,o){var n,a,s,l,u=e.endPosition||e.position||e;void 0===i&&(i=0),r=this._cesium.defaultValue(r,!1),void 0===this.defaultDepthTest&&(this.defaultDepthTest=!!this._viewer.scene.globe.depthTestAgainstTerrain);var c=r?o||30:1;if(0!==i?(this._viewer.scene.globe.depthTestAgainstTerrain=!0,(n=this._viewer.camera.getPickRay(u))&&(a=this._viewer.scene.globe.pick(n,this._viewer.scene)),t&&0!==t.length?(l=this._viewer.scene.drillPick(u,t&&t.length&&t.length+1||1,c,c),l=this.getNotExcludedObj(l,t)):(l=this._viewer.scene.pick(u))&&l.id&&!this.id3DGraphic(l.id)&&(l=void 0),l&&!r?(this._viewer.scene.pick(u),(s=this._viewer.scene.pickPosition(u))&&(a=s)):(a&&r&&(s=this._getAdsorptionPosition(u,l,o)),s&&(a=s))):(t&&0!==t.length?(l=this._viewer.scene.drillPick(u,t&&t.length&&t.length+1||1,c,c),l=this.getNotExcludedObj(l,t)):(l=this._viewer.scene.pick(u))&&l.id&&!this.id3DGraphic(l.id)&&(l=void 0),l&&!r?(this._viewer.scene.pick(u),a=this._viewer.scene.pickPosition(u)):l&&r?(this._viewer.scene.pick(u),a=this._viewer.scene.pickPosition(u),(s=this._getAdsorptionPosition(u,l,o))&&(a=s)):(this._viewer.scene.globe.depthTestAgainstTerrain=!0,(n=this._viewer.camera.getPickRay(u))&&(a=this._viewer.scene.globe.pick(n,this._viewer.scene)))),this._viewer.scene.globe.depthTestAgainstTerrain=!!this.defaultDepthTest,this.defaultDepthTest=void 0,a){var h=this._cesium.Cartographic.fromCartesian(a);return{lon:this._cesium.Math.toDegrees(h.longitude),lat:this._cesium.Math.toDegrees(h.latitude),height:h.height}}console.log("未拾取到坐标!")},e.prototype.id3DGraphic=function(e){var t=!0;return e.polyline||e.point||e.label||e.billboard?t=!1:e.polygon&&null==e.polygon.extrudedHeight?t=!1:e.rectangle&&null==e.rectangle.extrudedHeight?t=!1:e.ellipse&&null==e.ellipse.extrudedHeight?t=!1:e.corridor&&null==e.corridor.extrudedHeight&&(t=!1),t},e.prototype.getAdsorptionPosition=function(e,t){for(var i=this._viewer.scene.drillPick(e,t&&t.length&&t.length+1||3,8,8),r=!1,o=0;o<i.length;o++)if(i[o]&&!this.isExcluded(i[o],t)){r=!0;break}if(r){if((i=this._viewer.scene.pick(e,1,1))&&!this.isExcluded(i,t))return e;for(o=5/3;o<=5;o+=5/3)if((i=this._viewer.scene.pick({x:e.x+o,y:e.y},1,1))&&!this.isExcluded(i,t))return{x:e.x+o,y:e.y};for(o=5/3;o<=5;o+=5/3)if((i=this._viewer.scene.pick({x:e.x+o,y:e.y+o},1,1))&&!this.isExcluded(i,t))return{x:e.x+o,y:e.y+o};for(o=5/3;o<=5;o+=5/3)if((i=this._viewer.scene.pick({x:e.x,y:e.y+o},1,1))&&!this.isExcluded(i,t))return{x:e.x,y:e.y+o};for(o=5/3;o<=5;o+=5/3)if((i=this._viewer.scene.pick({x:e.x-o,y:e.y+o},1,1))&&!this.isExcluded(i,t))return{x:e.x-o,y:e.y+o};for(o=5/3;o<=5;o+=5/3)if((i=this._viewer.scene.pick({x:e.x-o,y:e.y},1,1))&&!this.isExcluded(i,t))return{x:e.x-o,y:e.y};for(o=5/3;o<=5;o+=5/3)if((i=this._viewer.scene.pick({x:e.x-o,y:e.y-o},1,1))&&!this.isExcluded(i,t))return{x:e.x-o,y:e.y-o};for(o=5/3;o<=5;o+=5/3)if((i=this._viewer.scene.pick({x:e.x,y:e.y-o},1,1))&&!this.isExcluded(i,t))return{x:e.x,y:e.y-o};for(o=5/3;o<=5;o+=5/3)if((i=this._viewer.scene.pick({x:e.x+o,y:e.y-o},1,1))&&!this.isExcluded(i,t))return{x:e.x+o,y:e.y-o}}return e},e.prototype._getAdsorptionPosition=function(e,t,i){var r=i||30;if(t){t=this.getFeature(t);for(var o,n=[],a=0;a<t.position.length;a++)(o=this._viewer.scene.cartesianToCanvasCoordinates(t.position[a]))&&(o.index=a,n.push(o));if((n=n.sort(function(e,t){var i=e.x,r=t.x;return i<r?-1:r<i?1:0}))&&1<n.length){var s=Math.log(n.length)/Math.log(2),l=0,u=n.length,c=0,h=-1;for(a=0;a<s;a++)if(l=Math.floor((u+c)/2),e.x-n[l].x>r)c=l;else if(e.x-n[l].x<-r)u=l;else if(Math.abs(e.x-n[l].x)<r){h=l;break}if(-1!==h){for(a=l;a<u;a++)if(Math.abs(e.x-n[a].x)>r){u=a;break}for(a=l;c<a;a--)if(Math.abs(e.x-n[a].x)>r){c=a+1;break}for(a=c;a<u;a++)if(Math.abs(e.y-n[a].y)<r)return t.position[n[a].index]}}if(n&&1===n.length&&Math.abs(e.x-n[0].x)<r&&Math.abs(e.y-n[0].y)<r)return t.position[0]}},e.prototype.getFeature=function(e){var t,i={position:[],object:[]};if(e&&e.id&&e.id instanceof this._cesium.Entity){var r=e.id;r.billboard&&(t=r.position.getValue(this._viewer.clock.currentTime),i.position.push(t),i.object.push({type:"billboard",feature:r.billboard})),r.box&&(t=r.position.getValue(this._viewer.clock.currentTime),i.position.push(t),i.object.push({type:"box",feature:r.box})),r.corridor&&(t=r.position.getValue(this._viewer.clock.currentTime),i.position.push(t),i.object.push({type:"corridor",feature:r.corridor})),r.cylinder&&(t=r.position.getValue(this._viewer.clock.currentTime),i.position.push(t),i.object.push({type:"cylinder",feature:r.cylinder})),r.ellipse&&(t=r.position.getValue(this._viewer.clock.currentTime),i.position.push(t),i.object.push({type:"ellipse",feature:r.ellipse})),r.ellipsoid&&(t=r.position.getValue(this._viewer.clock.currentTime),i.position.push(t),i.object.push({type:"ellipsoid",feature:r.ellipsoid})),r.label&&(t=r.position.getValue(this._viewer.clock.currentTime),i.position.push(t),i.object.push({type:"label",feature:r.label})),r.model&&(t=r.position.getValue(this._viewer.clock.currentTime),i.position.push(t),i.object.push({type:"model",feature:r.model})),r.path&&(t=r.position.getValue(this._viewer.clock.currentTime),i.position.push(t),i.object.push({type:"path",feature:r.path})),r.plane&&(t=r.position.getValue(this._viewer.clock.currentTime),i.position.push(t),i.object.push({type:"plane",feature:r.plane})),r.point&&(t=r.position.getValue(this._viewer.clock.currentTime),i.position.push(t),i.object.push({type:"point",feature:r.point})),r.polygon&&(t=r.polygon.hierarchy.getValue(this._viewer.clock.currentTime),i.position=i.position.concat(t.positions),i.object.push({type:"polygon",feature:r.polygon})),r.polyline&&(t=r.polyline.positions.getValue(this._viewer.clock.currentTime),i.position=i.position.concat(t),i.object.push({type:"polyline",feature:r.polyline})),r.polylineVolume&&(t=r.polylineVolume.positions.getValue(this._viewer.clock.currentTime),i.position=i.position.concat(t),i.object.push({type:"polylineVolume",feature:r.polylineVolume})),r.rectangle&&(t=r.rectangle.coordinates.getValue(this._viewer.clock.currentTime),i.position=i.position.concat(t),i.object.push({type:"rectangle",feature:r.rectangle})),r.wall&&(t=r.wall.positions.getValue(this._viewer.clock.currentTime),i.position=i.position.concat(t),i.object.push({type:"wall",feature:r.wall}))}return e&&e.primitive&&e.primitive instanceof this._cesium.Model&&(t=e.primitive.positionObj,i.position.push(t),i.object.push({type:"model",feature:e.primitive})),i},e.prototype.isExcluded=function(e,t){return!(!this._cesium.defined(e)||!this._cesium.defined(t)||0===t.length)&&(-1<t.indexOf(e)||-1<t.indexOf(e.primitive)||-1<t.indexOf(e.id))},e.prototype.getNotExcludedObj=function(e,t){if(0===e.length)return!1;if(!this._cesium.defined(t)||0===t.length)return e;for(var i=0;i<e.length;i++)if(e[i]&&!this.isExcluded(e[i],t))return e[i];return!1},e.prototype.isObjectsToExcludeShow=function(e,t){this._cesium.defined(e)&&0!==e.length&&(e instanceof Array?e.forEach(function(e){e.show=t}):e.show=t)},e}),define("SGWorld/Navigate/setPosition",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.setPosition=function(e,t,i){Math.abs(e)<=180&&Math.abs(t)<=90?this._viewer.camera.setView({destination:this._cesium.Cartesian3.fromDegrees(e,t,i)}):this._viewer.camera.setView({destination:{x:e,y:t,z:i}})},e}),define("SGWorld/Navigate/Stop",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.Stop=function(){this._viewer.scene.camera.cancelFlight()},e}),define("SGWorld/Navigate/Navigate",["./zoomIn","./zoomOut","./flyTo","./flyToObj","./jumpTo","./northfinger","./getPosition","./setPosition","./Stop"],function(r,o,n,a,s,l,u,c,h){"use strict";function e(e,t,i){this._viewer=e,this._cesium=t,this._zoomIn=new r(this._viewer,this._cesium),this._zoomOut=new o(this._viewer,this._cesium),this._flyTo=new n(this._viewer,this._cesium,this._tree),this._flyToObj=new a(this._viewer,this._cesium),this._jumpTo=new s(this._viewer,this._cesium,this._tree),this._northfinger=new l(this._viewer,this._cesium),this._Stop=new h(this._viewer,this._cesium)}return e.prototype.getPosition=function(){return this._getPosition||(this._getPosition=new u(this._viewer,this._cesium)),this._getPosition.getPosition()},e.prototype.getMousePosition=function(e,t,i,r,o){return this._getPosition||(this._getPosition=new u(this._viewer,this._cesium)),this._getPosition.getMousePosition(e,t,i,r,o)},e.prototype.getDegrees=function(){return this._getPosition||(this._getPosition=new u(this._viewer,this._cesium)),this._getPosition.getDegrees()},e.prototype.getMouseDegrees=function(e,t,i,r,o){return this._getPosition||(this._getPosition=new u(this._viewer,this._cesium)),this._getPosition.getMouseDegrees(e,t,i,r,o)},e.prototype.setPosition=function(e,t,i){return this._setPosition||(this._setPosition=new c(this._viewer,this._cesium)),this._setPosition.setPosition(e,t,i)},e.prototype.zoomIn=function(){return this._zoomIn.zoomIn()},e.prototype.zoomOut=function(){return this._zoomOut.zoomOut()},e.prototype.flyTo=function(e,t){return this._flyTo.flyTo(e,t)},e.prototype.flyToObj=function(e){this._flyToObj.flyToObj(e)},e.prototype.jumpTo=function(e,t){return this._jumpTo.jumpTo(e,t)},e.prototype.northfinger=function(){this._northfinger.northfinger()},e.prototype.flyToPosition=function(e,t,i){this._flyTo.flyToPosition(e,t,i)},e.prototype.flyToPointsInterest=function(e,t){this._flyTo.flyToPointsInterest(e,t)},e.prototype.Stop=function(){this._Stop.Stop()},e}),define("SGWorld/Core/CombineEcharts",[],function(){"use strict";function e(e){var a;this._mapContainer=e,echarts.cesiumViewer||(a=e,function(i){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return i[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=i,o.c=r,o.d=function(e,t,i){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==(void 0===t?"undefined":_typeof2(t))&&t&&t.__esModule)return t;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(i,r,function(e){return t[e]}.bind(null,r));return i},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,i){e.exports=i(1)},function(e,t,i){echarts?i(2).load():console.error("missing echarts lib")},function(e,t,i){function o(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}i.r(t);var r=function(){function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this._viewer=e,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}var e,t;return t=[{key:"create",value:function(e,t){var i;e.eachComponent("GLMap",function(e){(i=new r(echarts.cesiumViewer,t)).setMapOffset(e.__mapOffset||[0,0]),e.coordinateSystem=i}),e.eachSeries(function(e){"GLMap"===e.get("coordinateSystem")&&(e.coordinateSystem=i)})}},{key:"dimensions",get:function(){return["lng","lat"]}}],o((e=r).prototype,[{key:"setMapOffset",value:function(e){return this._mapOffset=e,this}},{key:"getViewer",value:function(){return this._viewer}},{key:"dataToPoint",value:function(e){var t=this._viewer.scene,i=Cesium.Cartesian3.fromDegrees(e[0],e[1]);if(!i)return[0,0];if(t.mode===Cesium.SceneMode.SCENE3D&&Cesium.Cartesian3.angleBetween(t.camera.position,i)>Cesium.Math.toRadians(80))return!1;var r=t.cartesianToCanvasCoordinates(i);return r?[r.x-this._mapOffset[0],r.y-this._mapOffset[1]]:[]}},{key:"pointToData",value:function(e){var t=this._mapOffset,i=a.scene.globe.ellipsoid,r=new Cesium.cartesian3(e[1]+t,e[2]+t[2],0),o=i.cartesianToCartographic(r);return[o.lng,o.lat]}},{key:"getViewRect",value:function(){var e=this._api;return new echarts.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())}},{key:"getRoamTransform",value:function(){return echarts.matrix.create()}}]),o(e,t),r}();function n(){echarts.registerCoordinateSystem("GLMap",r),echarts.registerAction({type:"GLMapRoam",event:"GLMapRoam",update:"updateLayout"},function(e,t){})}echarts.extendComponentModel({type:"GLMap",getViewer:function(){return echarts.cesiumViewer},defaultOption:{roam:!1}}),echarts.extendComponentView({type:"GLMap",init:function(e,t){this.api=t,echarts.cesiumViewer.scene.postRender.addEventListener(this.moveHandler,this)},moveHandler:function(e,t){this.api.dispatchAction({type:"GLMapRoam"})},render:function(e,t,i){},dispose:function(e){echarts.cesiumViewer.scene.postRender.removeEventListener(this.moveHandler,this)}}),i.d(t,"load",function(){return n})}]),echarts.cesiumViewer=a)}return e.prototype.setOption=function(e,t){return this._echartsContainer&&t&&this.clear(),!this._overlay&&(this._overlay=this._createChartOverlay()),this._overlay.setOption(e),this},e.prototype._createChartOverlay=function(){var e=this._mapContainer.scene;e.canvas.setAttribute("tabIndex",0);var t=document.createElement("div");return t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width=e.canvas.width+"px",t.style.height=e.canvas.height+"px",t.style.pointerEvents="none",t.setAttribute("id","smartearth-cesium-echarts"),t.setAttribute("class","echartMap"),this._mapContainer.container.appendChild(t),this._echartsContainer=t,echarts.init(t)},e.prototype.clear=function(){this._echartsContainer&&(this._mapContainer.container.removeChild(this._echartsContainer),this._echartsContainer=null),this._overlay&&(this._overlay.dispose(),this._overlay=null)},e.prototype.updateOverlay=function(e){this._overlay&&this._overlay.setOption(e)},e.prototype.getMap=function(){return this._mapContainer},e.prototype.getOverlay=function(){return this._overlay},e.prototype.show=function(){document.getElementById(this._id).style.visibility="visible"},e.prototype.hide=function(){document.getElementById(this._id).style.visibility="hidden"},e}),define("SGWorld/Core/jquery",[],function(){return $}),define("SGWorld/Core/CIMServerTool",["./jquery"],function(o){"use strict";function e(e){this.serverUrl=e}return e.prototype.xhr=function(e,t,i,r,o){var n=new XMLHttpRequest;n.open(e,t),n.setRequestHeader("CONTENT-TYPE","application/x-www-from-urlencoded"),n.send(i),n.onreadystatechange=function(){4===n.readyState&&200===n.status?r(JSON.parse(n.responseText)):o(n),n=null}},e.prototype.getSceneList=function(t){o.ajax({url:this.serverUrl+"/scene/sceneList",type:"get",success:function(e){t&&"function"==typeof t&&e&&t(JSON.parse(e))}})},e.prototype.query=function(e,t){var i=e.database,r={type:e.type||"building",id:e.id,returnGeometry:!0,returnChildren:!0};void 0!==e.returnGeometry&&(r.returnGeometry=e.returnGeometry),void 0!==e.returnChildren&&(r.returnChildren=e.returnChildren),o.ajax({url:this.serverUrl+"/"+i+"/query?version=v2.1",type:"post",async:!0,data:r,success:function(e){t&&"function"==typeof t&&e&&t(JSON.parse(e))},error:function(e,t,i){alert("error:"+e.status)}})},e}),define("SGWorld/Core/Recorder",[],function(){"use strict";function e(e,t){this.mediaOutputPath=e||"test.mp4",this.videoBPS=t||512e4}return e.prototype.startRecord=function(){var t=this;navigator.mediaDevices.getDisplayMedia({video:!0,audio:!0}).then(function(e){t.createRecorder(e)}).catch(function(e){t.getUserMediaError(e)})},e.prototype.getUserMediaError=function(e){console.log("mediaError",e)},e.prototype.createRecorder=function(e){var i=this;console.log("start record");var t={videoBitsPerSecond:this.videoBPS};this.recorder=new MediaRecorder(e,t),this.recorder.start();var r=[];this.recorder.onstop=function(e){var t=new Blob(r,{type:"video/mp4"});i.saveMedia(t)},this.recorder.ondataavailable=function(e){r.push(e.data)}},e.prototype.saveMedia=function(e){var t=window.URL.createObjectURL(e),i=document.createElement("a");i.innerHTML="test",i.download=this.mediaOutputPath,i.href=t,i.click()},e.prototype.stopRecord=function(){this.recorder.stop()},e}),define("SGWorld/Core/Core",["../configData","../ProjectTree/treeSource","./CombineEcharts","./CIMServerTool","./Recorder"],function(o,e,r,t,n){"use strict";function a(){this._tree=e,this._selectedColor="#ff0000",this.curCanvas="a",this.images="../../img/arrow.png",this.i=0,this.id="0"}a.prototype.defaultValue=function(e,t){return null!=e?e:t},a.prototype.Entityadd=function(e){this._tree.entity.push(e)},a.prototype.Pointadd=function(e){this._tree.pointsId.push(e)},a.prototype.Point=function(){this._tree.pointsId=[]},a.prototype.getPoint=function(){return this._tree.pointsId},a.prototype.mouse=function(e,t,i){e.style.cursor=1==t?"url("+i+"),auto":"default"},a.prototype.CreateTooltip=function(e,t,i){var r,o,n,a,s;e&&"object"===(void 0===e?"undefined":_typeof2(e))&&(r=e),r&&r.origin?("center"===r.origin&&(o=15,n=-12),"top"===r.origin&&(o=15,n=-44),"bottom"===r.origin&&(o=15,n=20)):(o=15,n=20),r&&r.color?("white"===r.color&&(a="background: rgba(255, 255, 255, 0.8);color: black;"),"black"===r.color&&(a="background: rgba(0, 0, 0, 0.5);color: white;"),"yellow"===r.color&&(a="color: black;background-color: #ffcc33;border: 1px solid white;")):a="background: rgba(0, 0, 0, 0.5);color: white;",s=r&&r.id?"toolTip"+r.id:"toolTip";var l=document.getElementById(s);if(!l){var u=document.createElement("div");$(".cesium-viewer").append(u);var c='<div id="'+s+'" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:黑体;color:white;font-weight: bolder;font-size: 14px;'+a+'"></div>';$(".cesium-viewer").append(c),l=document.getElementById(s)}return i?(l.innerHTML=e,l.style.left=t.x+o+"px",l.style.top=t.y+n+"px",l.style.display="block"):l.style.display="none",{tooltip:l,style:r,showAt:function(e,t){this.tooltip.innerHTML=t,this.style&&this.style.origin?("center"===this.style.origin&&(o=15,n=-this.tooltip.offsetHeight/2),"top"===this.style.origin&&(o=15,n=-this.tooltip.offsetHeight-20),"bottom"===this.style.origin&&(o=15,n=20)):(o=15,n=-this.tooltip.offsetHeight/2),this.tooltip.style.left=e.x+o+"px",this.tooltip.style.top=e.y+n+"px",this.tooltip.style.display="block"},show:function(e){this.tooltip.style.display=e?"block":"none"}}},a.prototype.CreateResultTooltip=function(r,t){var o,n,e;!t&&(t={});var i=t.id?"resultToolTip"+t.id:"resultToolTip",a=document.getElementById(i);if(t.color?("white"===t.color&&(e="background: rgba(255, 255, 255, 0.8);color: black;"),"black"===t.color&&(e="background: rgba(0, 0, 0, 0.5);color: white;"),"blue"===t.color&&(e="background: rgba(48, 119, 221);color: white;"),"yellow"===t.color&&(e="color: black;background-color: #ffcc33;border: 1px solid white;")):e="color: black;background-color: #ffcc33;border: 1px solid white;",!a){var s='<div id="'+i+'" class="resultToolTip" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:黑体;color:white;font-weight: bolder;font-size: 14px;'+e+'"></div>';$(r.container).append(s),a=document.getElementById(i)}var l,u=t.addX||0,c=t.addY||0;return r.scene.camera.percentageChanged=1e-6,r.scene.camera.changed.addEventListener(function(){if(l){if(void 0!==t.distance){if(Cesium.Cartesian3.distance(l,r.camera.position)>t.distance)return void(a.style.display="none");a.style.display="block"}var e=r.scene.cartesianToCanvasCoordinates(l);if(!e)return;o=-a.offsetWidth/2+u,n=-a.offsetHeight+c,a.style.left=e.x+o+"px",a.style.top=e.y+n+"px"}}),{tooltip:a,position:l,showAt:function(e,t){if(this.tooltip.innerHTML=t,this.tooltip.style.display="block",this.position=e,l=e){var i=r.scene.cartesianToCanvasCoordinates(l);if(!i)return;o=-this.tooltip.offsetWidth/2+u,n=-this.tooltip.offsetHeight+c,this.tooltip.style.left=i.x+o+"px",this.tooltip.style.top=i.y+n+"px"}},show:function(e){l=e?(this.tooltip.style.display="block",this.position):void(this.tooltip.style.display="none")}}},a.prototype.CombineEcharts=function(e,t,i){return this._CombineEcharts||(this._CombineEcharts=new r(e)),this._CombineEcharts.setOption(t,i)},a.prototype.getPositionFromWKT=function(e){var t=e+"!",n=void 0,a=[];return-1<t.indexOf("MULTIPOLYGON")?(n=(n=(n=t.replace("MULTIPOLYGON(","")).replace(")!","")).split(")),((")).forEach(function(e,t){var o=void 0;(o=(o=1===n.length?e.substring(1,e.length-1):0===t?e.substring(1,e.length)+")":t===n.length-1?"("+e.substring(0,e.length-1):"("+e+")").split("),(")).forEach(function(e,t){var i=void 0;1===o.length?i=e.substring(1,e.length-1):0===t?i=e.substring(1,e.length):t===o.length-1&&(i=e.substring(0,e.length-1)),i=i.split(",");var r=[];i.forEach(function(e){var t=e.split(" ");r.push(Cesium.Cartesian3.fromDegrees(t[0],t[1]))}),a.push(r)})}):-1<t.indexOf("POLYGON")&&(n=(n=(n=t.replace("POLYGON(","")).replace(")!","")).split("),(")).forEach(function(e,t){var i=void 0;1===n.length?i=e.substring(1,e.length-1):0===t?i=e.substring(1,e.length):t===n.length-1&&(i=e.substring(0,e.length-1)),i=i.split(",");var r=[];i.forEach(function(e){var t=e.split(" ");r.push(Cesium.Cartesian3.fromDegrees(t[0],t[1]))}),a.push(r)}),a},a.prototype.getCatesian3FromPXjt=function(e,t,i){var r=t.camera.getPickRay(e);return r?t.scene.globe.pick(r,t.scene):null},a.prototype.VectorSlice=function(e,t){var i="EPSG:4490";return e.port&&(i=e.port),{url:e.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:e.layer,STYLE:"",TILEMATRIX:i+":{z}",TILEMATRIXSET:i,FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:e.upperLevelLimit,lowerLevelLimit:e.lowerLevelLimit,rectangle:t.Rectangle.fromDegrees(e.minx,e.miny,e.maxx,e.maxy),Cesium:t}},a.prototype.setheight=function(e,t,i,r){r.scene.globe.ellipsoid;var o=i.Cartographic.fromCartesian(e),n=i.Math.toDegrees(o.longitude),a=i.Math.toDegrees(o.latitude),s=o.height+t;return new i.Cartesian3.fromDegrees(n,a,s)},a.prototype.setpolylineheight=function(e,i,r,t){var o=[];e.forEach(function(e){if(i){var t=r.Cartographic.fromCartesian(e);lon=r.Math.toDegrees(t.longitude),lat=r.Math.toDegrees(t.latitude),o.push(r.Cartesian3.fromDegrees(lon,lat,i))}else o.push(e)})},a.prototype.StyleContrastGeoJson=function(e,t){var i={color:t.Color.WHITE,pixelSize:1,outlineColor:t.Color.BLACK,outlineWidth:0,show:!0,distanceDisplayCondition:new t.DistanceDisplayCondition(0,999999999)},r={id:"my label",text:"",font:"30px sans-serif",fillColor:t.Color.WHITE,outlineColor:t.Color.WHITE,outlineWidth:"10",scale:1,distanceDisplayCondition:new t.DistanceDisplayCondition(0,999999999)},o={show:!0,scale:1,width:void 0,height:void 0,pixelOffset:void 0,color:t.Color.WHITE,image:"",distanceDisplayCondition:new t.DistanceDisplayCondition(0,999999999)},n={positions:[],arcType:t.ArcType.GEODESIC,clampToGround:!0,width:1,show:!0,material:t.Color.RED,height:30},a={height:0,heightReference:t.HeightReference.NONE,show:!0,fill:!0,material:t.Color.WHITE,outline:!1,outlineColor:t.Color.BLACK,outlineWidth:1,stRotation:0,granularity:t.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:t.ShadowMode.ENABLED,clampToGround:!0};this.isnull(e.near)&&(e.near=0),this.isnull(e.far)&&(e.far=999999999);var s=parseFloat(e.near),l=parseFloat(e.far);return delete e.near,delete e.far,null!=e.point&&(e.point=this.extend(i,e.point,!0),e.point.distanceDisplayCondition=new t.DistanceDisplayCondition(s,l)),null!=e.label&&(e.label=this.extend(r,e.label,!0),e.label.distanceDisplayCondition=new t.DistanceDisplayCondition(s,l)),null!=e.billboard&&(e.billboard=this.extend(o,e.billboard,!0),e.billboard.distanceDisplayCondition=new t.DistanceDisplayCondition(s,l)),null!=e.polyline&&(e.polyline=this.extend(n,e.polyline,!0),e.polyline.distanceDisplayCondition=new t.DistanceDisplayCondition(s,l)),null!=e.polygon&&(e.polygon=this.extend(a,e.polygon,!0),e.polygon.distanceDisplayCondition=new t.DistanceDisplayCondition(s,l)),e},a.prototype.getCatesian3FromPX=function(e,t,i,r){var o,n=t.scene.pick(e),a=t.scene.drillPick(e),s=null;if(r){for(var l=0;l<a.length;l++)if(a[l].id._id!=(r&&r[0]&&r[0].id)&&a[l].id._id!=(r&&r[1]&&r[1].id)){s=a[l].id;break}}else s=n;if(t.scene.pickPositionSupported&&i.defined(s))o=t.scene.pickPosition(e);else{var u=t.camera.getPickRay(e);if(!u)return;o=t.scene.globe.pick(u,t.scene)}return o},a.prototype.StyleContrast=function(e,t,i){var r={text:"",font:" 30px sans-serif",style:i.LabelStyle.FILL_AND_OUTLINE,fillColor:i.Color.WHITE,outlineColor:i.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new i.Color(.165,.165,.165,.8),backgroundPadding:new i.Cartesian2(7,5),scale:1,horizontalOrigin:i.HorizontalOrigin.CENTER,verticalOrigin:i.VerticalOrigin.CENTER,eyeOffset:i.Cartesian3.ZERO,pixelOffset:i.Cartesian2.ZERO,heightReference:i.HeightReference.NONE,scaleByDistance:void 0,distanceDisplayCondition:void 0},o={show:!0,position:i.Cartesian3.ZERO,pixelOffset:i.Cartesian2.ZERO,eyeOffset:i.Cartesian3.ZERO,heightReference:i.HeightReference.NONE,horizontalOrigin:i.HorizontalOrigin.CENTER,verticalOrigin:i.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:i.Color.WHITE,rotation:0,alignedAxis:i.Cartesian3.ZERO,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0},n={show:!0,pixelSize:1,heightReference:i.HeightReference.NONE,color:i.WHITE,outlineColor:i.Color.BLACK,outlineWidth:1,scaleByDistance:void 0,translucencyByDistance:void 0,distanceDisplayCondition:void 0},a={positions:[],width:5,material:i.Color.ALICEBLUE,arcType:i.ArcType.GEODESIC},s={polygonHierarchy:new i.PolygonHierarchy(i.Cartesian3.fromDegreesArray([-72,40,-70,35,-75,30,-70,30,-68,40])),height:0,extrudedHeight:0,material:"rgba(245, 20, 20, 0.91)"};this.isnull(t.near)&&(t.near=0),this.isnull(t.far)&&(t.far=999999999);var l=parseFloat(t.near),u=parseFloat(t.far);return delete t.near,delete t.far,t.distanceDisplayCondition=new i.DistanceDisplayCondition(l,u),"lable"==e?t=this.extend(r,t,!0):"billboard"==e?t=this.extend(o,t,!0):"point"==e?t=this.extend(n,t,!0):"polyline"==e?t=this.extend(a,t,!0):"polygon"==e&&(t=this.extend(s,t,!0)),t},a.prototype.createPolyline=function(e,t,i,r){var o=null;if(-1==t){var n=new r.PolylineGeometry(e);o=new r.GeometryInstance({id:i,geometry:n})}else{n=new r.GroundPolylineGeometry(e);o=new r.GeometryInstance({geometry:n,id:i})}return o},a.prototype.createPolygon=function(e,t,i,r){var o=e.material,n=new r.PolygonGeometry(e);return delete e.material,new r.GeometryInstance({id:i,geometry:n,attributes:{color:new r.ColorGeometryInstanceAttribute.fromColor(o)}})},a.prototype.coordinate=function(e,t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?this.coordinate(e,t[i]):e.push(t[i]);return e},a.prototype.Analysis=function(e,t){if(/^\[/.test(e)&&/\]$/.test(e)){var i=e.replace(/\[/,"").replace(/\]/,"");null!=t.properties[i]&&(e=t.properties[i])}return e},a.prototype.EntityEdit=function(r,o){var n=this;this.EntityEditHandler&&this.EntityEditHandler.destroy(),this.EntityEditHandler=new o.ScreenSpaceEventHandler(r.scene._imageryLayerCollection),this.EntityEditHandler.setInputAction(function(e){var t=r.scene.pick(e.position);if(o.defined(t)&&t.id)for(var i=0;i<n._tree.entity.length;i++)if(t.id.objId==n._tree.entity[i].objId){n._tree.lastSelectEntity=n._tree.entity[i],n._tree.entity[i].startModify(t.id);break}},o.ScreenSpaceEventType.LEFT_CLICK)},a.prototype.unique=function(e){for(var t=[],i=0;i<e.length;i++)-1===t.indexOf(e[i])&&t.push(e[i]);return t},a.prototype.extend=function(e,t,i){for(var r in t)!t.hasOwnProperty(r)||e.hasOwnProperty(r)&&!i||(e[r]=t[r]);return e},a.prototype.getPointFromWindowPoint=function(e,t){if("EllipsoidTerrainProvider"==t.scene.terrainProvider.constructor.name)return t.camera.pickEllipsoid(e,t.scene.globe.ellipsoid);var i=t.scene.camera.getPickRay(e);return t.scene.globe.pick(i,t.scene)},a.prototype.isnull=function(e){return null==e||null==e||""===e},a.prototype.getuid=function(){return this.uuid(8,16)},a.prototype.extendgl=function(e,t,i){return null!=t&&null!=t?("string"==typeof t&&"["==t.charAt(0)&&"]"==t.charAt(t.length-1)&&(t=(t=t.substr(0,t.length-1)).substr(1),null!=e.properties[t]._value?t=e.properties[t]._value:null!=e.properties[t]&&(t=e.properties[t])),t):i},a.prototype.uuid=function(e,t){var i,r,o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[];n=[];if(t=t||o.length,e)for(i=0;i<e;i++)n[i]=o[0|Math.random()*t];else for(n[8]=n[13]=n[18]=n[23]="-",n[14]="4",i=0;i<36;i++)n[i]||(r=0|16*Math.random(),n[i]=o[19==i?3&r|8:r]);return n.join("")},a.prototype.Shaders=function(e){var t="";return"VSHADER_SOURCE "==e?t="attribute vec4 a_Position;\nattribute vec2 a_TexCoord;\nuniform mat4 u_MvpMatrix;\nvarying vec2 v_TexCoord;\nvoid main(){\ngl_Position = u_MvpMatrix * a_Position;\nv_TexCoord = a_TexCoord;\n}\n":"TRIANGLE_FSHADER_SOURCE"==e?t="#ifdef GL_ES\nprecision mediump float;\n#endif\nvarying vec4 v_Color;\nvoid main() {\ngl_FragColor = v_Color;\n'}\n":"TRIANGLE_VSHADER_SOURCE"==e?t="attribute vec4 a_Position;\nattribute vec4 a_Normal;\nuniform mat4 u_MvpMatrix;\nuniform mat4 u_NormalMatrix;\nvarying vec4 v_Color;\nvoid main() {\nvec3 lightDirection = vec3(0.0, 0.0, 1.0);\nvec4 color = vec4(1.0, 1.0, 0.0, 1.0);\ngl_Position = u_MvpMatrix * a_Position;\nvec3 normal = normalize(vec3(u_NormalMatrix * a_Normal));\nfloat nDotL = max(dot(normal, lightDirection), 0.0);\nv_Color = vec4(color.rgb * nDotL, color.a);\n}\n":"vertexShaderSource"==e?t="attribute vec3 position3DHigh;\r\nattribute vec3 position3DLow;\r\nattribute vec3 normal;\r\nattribute vec2 st;\r\nattribute vec4 color;\r\nattribute float batchId;\r\nvarying vec3 v_positionEC;\r\nvarying vec3 v_normalEC;\r\nvarying vec2 v_st;\r\nvarying vec4 v_color;\r\nvoid main()\r\n{\r\nvec4 p = czm_computePosition();\r\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\r\nv_normalEC = czm_normal * normal;\r\nv_st = st;\r\nv_color = color;\r\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\r\n}\r\n":"fragmentShaderSource"==e&&(t="varying vec3 v_positionEC;\r\nvarying vec3 v_normalEC;\r\nvarying vec2 v_st;\r\nvarying vec4 v_color;\r\n\r\nvec4 czm_phong(vec3 toEye, czm_material material)\r\n{\r\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\r\nif (czm_sceneMode == czm_sceneMode3D) {\r\n diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\r\n}\r\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\r\nvec3 materialDiffuse = material.diffuse * 0.5;\r\nvec3 ambient = materialDiffuse;\r\nvec3 color = ambient + material.emission;\r\ncolor += materialDiffuse * diffuse;\r\ncolor += material.specular * specular;\r\nreturn vec4(color, material.alpha);\r\n}void main()\r\n{\r\nvec3 positionToEyeEC = -v_positionEC;\r\nvec3 normalEC = normalize(v_normalEC);\r\n#ifdef FACE_FORWARD\r\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\r\n#endif\r\nvec4 color = czm_gammaCorrect(v_color);\r\nczm_materialInput materialInput;\r\nmaterialInput.normalEC = normalEC;\r\nmaterialInput.positionToEyeEC = positionToEyeEC;\r\nmaterialInput.st = v_st;\r\nczm_material material = czm_getDefaultMaterial(materialInput);\r\nmaterial.diffuse = color.rgb;\r\nmaterial.alpha = color.a;\r\n#ifdef FLAT\r\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\r\n#else\r\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\r\n#endif\r\n}\r\n"),t},a.prototype.isHtmlColor=function(e){return/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e)},a.prototype.isUrl=function(e){if(this.isnull(e))return!1;return/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/.test(e)},a.prototype.dateTimespan=function(){return(new Date).toTimeString()},a.prototype.getPointFromTwoPointCenter=function(e,t,i){var r=this.getSpaceDistancem(e,Cesium),o=e[0],n=e[1],a=Cesium.Cartographic.fromCartesian(o),s=Cesium.Math.toDegrees(a.longitude),l=Cesium.Math.toDegrees(a.latitude),u=a.height,c=Cesium.Cartographic.fromCartesian(n),h=Cesium.Math.toDegrees(c.longitude),d=Cesium.Math.toDegrees(c.latitude),m=c.height,p=parseFloat(r/t),g=Cesium.Math.lerp(s,h,1/p)-s,f=Cesium.Math.lerp(l,d,1/p)-l,v=Cesium.Math.lerp(u,m,1/p)-u;return Cesium.Cartesian3.fromDegrees(s+g,l+f,i||u+v)},a.prototype.getSpaceDistance=function(e,t){for(var i=0,r=0;r<e.length-1;r++){var o=t.Cartographic.fromCartesian(e[r]),n=t.Cartographic.fromCartesian(e[r+1]),a=new t.EllipsoidGeodesic;a.setEndPoints(o,n);var s=a.surfaceDistance;i+=s=Math.sqrt(Math.pow(s,2)+Math.pow(n.height-o.height,2))}return 1e3<=i?(i/1e3).toFixed(2)+"千米":i.toFixed(2)+"米"},a.prototype.getSpaceDistancem=function(e,t){for(var i=0,r=0;r<e.length-1;r++){var o=t.Cartographic.fromCartesian(e[r]),n=t.Cartographic.fromCartesian(e[r+1]),a=new t.EllipsoidGeodesic;a.setEndPoints(o,n);var s=a.surfaceDistance;i+=s=Math.sqrt(Math.pow(s,2)+Math.pow(n.height-o.height,2))}return i.toFixed(2)},a.prototype.getHorizontalDistance=function(e,t){for(var i=0,r=0;r<e.length-1;r++){var o=t.Cartographic.fromCartesian(e[r]),n=t.Cartographic.fromCartesian(e[r+1]),a=new t.EllipsoidGeodesic;a.setEndPoints(o,n),i+=a.surfaceDistance}return i=1e3<=i?(i/1e3).toFixed(2)+"千米":i.toFixed(2)+"米"},a.prototype.starPositions=function(e,t,i){for(var r=Math.PI/e,o=[],n=0;n<2*e;n++){var a=n%2==0?t:i,s=new Cesium.Cartesian2(Math.cos(n*r)*a,Math.sin(n*r)*a);o.push(s)}return o},a.prototype.computeCircle=function(e){for(var t=[],i=0;i<360;i++){var r=Cesium.Math.toRadians(i);t.push(new Cesium.Cartesian2(e*Math.cos(r),e*Math.sin(r)))}return t},a.prototype.getArea=function(e,t,i,r){for(var o=0,n=0;n<e.length-2;n++){var a=(n+1)%e.length,s=(n+2)%e.length,l=this.Angle(e[n],e[a],e[s]);o+=this.getdistance(t[n],t[a],i)*this.getdistance(t[a],t[s],i)*Math.abs(Math.sin(l))}return r?o:o=o<1e6?o.toFixed(2)+"平方米":(o/1e6).toFixed(2)+"平方千米"},a.prototype.getdistance=function(e,t,i){var r=i.Cartographic.fromCartesian(e),o=i.Cartographic.fromCartesian(t),n=new i.EllipsoidGeodesic;n.setEndPoints(r,o);var a=n.surfaceDistance;return a=Math.sqrt(Math.pow(a,2)+Math.pow(o.height-r.height,2))},a.prototype.Angle=function(e,t,i){var r=this.Bearing(t,e)-this.Bearing(t,i);return r<0&&(r+=360),r},a.prototype.Bearing=function(e,t){var i=Math.PI,r=Math.PI,o=(i=Math.PI/180,r=180/Math.PI,e.lat*i),n=e.lon*i,a=t.lat*i,s=t.lon*i,l=-Math.atan2(Math.sin(n-s)*Math.cos(a),Math.cos(o)*Math.sin(a)-Math.sin(o)*Math.cos(a)*Math.cos(n-s));return l<0&&(l+=2*Math.PI),l*=r,l*=r},a.prototype.getHeight=function(e,t){try{if(1<e.length){var i=t.Cartographic.fromCartesian(e[0]);return((t.Cartographic.fromCartesian(e[1]).height-i.height)/1e3).toFixed(2)}return 0}catch(e){console.log(e)}},a.prototype.getPmfx=function(e,t,i,r,o,n){var a={gcs:[],min:99999,max:0,juli:0,cys:t},s=this.getSpaceDistancem(e,r);a.juli=s,0==i||(t=parseInt(s/i)),a.cys=t;var l,u=e[0],c=e[e.length-1],h=r.Cartographic.fromCartesian(u),d=r.Math.toDegrees(h.longitude),m=r.Math.toDegrees(h.latitude),p=(h.height,r.Cartographic.fromCartesian(c)),g=r.Math.toDegrees(p.longitude),f=r.Math.toDegrees(p.latitude),v=(p.height,t),_=r.Math.lerp(d,g,1/v)-d,y=r.Math.lerp(m,f,1/v)-m,C=[],w=[];C.push(h);for(var b=0;b<v;b++){var E=d+(b+1)*_,S=m+(b+1)*y;l=r.Cartesian3.fromDegrees(E,S),C.push(r.Cartographic.fromCartesian(l))}var P=this;this.getHeightsFromLonLat(C,r,o,function(e){if(e){w=e;var t=!1;for(!0!==o.scene.globe.depthTestAgainstTerrain&&(t=o.scene.globe.depthTestAgainstTerrain=!0),b=0;b<w.length;b++){var i=P.get3DTileOrPrimitivesHeights(C[b],o);void 0!==i&&(w[b]=i);var r=w[b].toFixed(2);parseFloat(r)<parseFloat(a.min)&&(a.min=parseFloat(r)),parseFloat(r)>parseFloat(a.max)&&(a.max=parseFloat(r)),a.gcs.push(r)}t&&(o.scene.globe.depthTestAgainstTerrain=!1),""!=n&&null!=n&&"function"==typeof n&&n(a)}})},a.prototype.getPmfxPro=function(v,e,t,_,a,s){for(var i=this,l=this,u={gcs:[],min:99999,max:0,juli:0,cys:0},y=[],r=[],o=0;o<v.length-1;o++){var n=l.getSpaceDistancem([v[o],v[o+1]],_);n=parseFloat(n),u.juli+=n,0==t||(e=parseInt(n/t)),r.push(e),u.cys+=e}var c=function(){r.forEach(function(e,t){var i=v[t],r=v[t+1],o=_.Cartographic.fromCartesian(i),n=_.Math.toDegrees(o.longitude),a=_.Math.toDegrees(o.latitude),s=_.Cartographic.fromCartesian(r),l=_.Math.toDegrees(s.longitude),u=_.Math.toDegrees(s.latitude),c=e,h=_.Math.lerp(n,l,1/c)-n,d=_.Math.lerp(a,u,1/c)-a,m=void 0;0===t&&y.push(o);for(var p=0;p<c;p++){var g=n+(p+1)*h,f=a+(p+1)*d;m=_.Cartesian3.fromDegrees(g,f),y.push(_.Cartographic.fromCartesian(m))}}),y.push(_.Cartographic.fromCartesian(v[v.length-1]));var n=[];u.allPoint=y,i.getHeightsFromLonLat(y,_,a,function(e){if(e){n=e;var t=a.scene.globe.depthTestAgainstTerrain;a.scene.globe.depthTestAgainstTerrain=!0;for(var i=0;i<n.length;i++){var r=l.get3DTileOrPrimitivesHeights(y[i],a);void 0!==r&&(n[i]=r);var o=n[i].toFixed(2);parseFloat(o)<parseFloat(u.min)&&(u.min=parseFloat(o)),parseFloat(o)>parseFloat(u.max)&&(u.max=parseFloat(o)),u.gcs.push(o)}a.scene.globe.depthTestAgainstTerrain=t,s&&"function"==typeof s&&s(u)}})};1e3<u.cys?layuiLayer&&layuiLayer.msg("当前采样点数过多,是否继续分析?",{time:0,btn:["继续","取消"],btnAlign:"c",yes:function(e){layuiLayer.close(e),setTimeout(function(){c()},10)},btn2:function(){s&&"function"==typeof s&&s(u)}}):setTimeout(function(){c()},10)},a.prototype.get3DTileOrPrimitivesHeights=function(e,t){return t.scene.sampleHeight(e)},a.prototype.getHeightsFromLonLat=function(e,t,i,r){var o=i.camera,n=[];if(i.scene&&i.scene.terrainProvider&&i.scene.terrainProvider._layers){var a=t.sampleTerrainMostDetailed(i.terrainProvider,e);o.positionCartographic.height;t.when(a,function(e){e.forEach(function(e){n.push(e.height)}),"function"==typeof r&&r(n)})}else e.forEach(function(e){n.push(i.scene.globe.getHeight(e))}),"function"==typeof r&&r(n)},a.prototype.getColorRamp=function(e,i,t,r){var o=[],n=document.createElement("canvas");n.width=100,n.height=1;var a,s=n.getContext("2d");"elevation"===e?a=[0,.045,.046,.1,.15,.37,.54,.99,1]:"slope"===e?a=o:"aspect"===e&&(a=[0,0,.2,.4,.6,.8,.9,1,1]),i||(i=["#0b0b88","#2747E0","#D33B7D","#D33038","#FF9742","#ffd700","#bbff00"]);var l=s.createLinearGradient(0,0,100,0);if("slope"===e){void 0===t&&(t=0),void 0===r&&(t=90),0==t?o.push(0):(o.push(t/90),l.addColorStop(0,"#000000"));var u=(r-t)/6;if(90==r){for(var c=1;c<=5;c++)o.push((t+c*u)/90);o.push(1),o.forEach(function(e,t){l.addColorStop(e,i[t])})}else{for(c=1;c<=5;c++)o.push((t+c*u)/90);o.push(r/90),o.forEach(function(e,t){l.addColorStop(e,i[t])}),l.addColorStop(1,"#000000")}}else l.addColorStop(a[0],"#000000"),l.addColorStop(a[1],i[0]),l.addColorStop(a[2],i[1]),l.addColorStop(a[3],i[2]),l.addColorStop(a[4],i[3]),l.addColorStop(a[5],i[4]),l.addColorStop(a[6],i[5]),l.addColorStop(a[7],i[6]),l.addColorStop(a[8],"#000000");return s.fillStyle=l,s.fillRect(0,0,100,1),n},a.prototype.Gauss_to_XY=function(e,t,i,r){var o,n,a,s,l=6378137,u=6356752.3142,c=(Math.sqrt(l*l-u*u),Math.sqrt(l*l-u*u)/u),h=this.to_Radian(i);t=this.to_Radian(t);var d=(e=this.to_Radian(e))-h,m=Math.cos(t);a=(s=this.to_N(t))*Math.cos(t),o=Math.tan(t),n=c*m;var p=Math.pow(o,2),g=Math.pow(o,4),f=Math.pow(n,2),v=Math.pow(n,4),_=Math.pow(m,3),y=Math.pow(m,5),C=this.to_Sm(t)+Math.pow(d,2)/2*a*m*o+Math.pow(d,4)/24*o*a*_*(5-p+9*f+4*v)+Math.pow(d,6)/720*o*a*y*(61-58*o*o+g+270*f-330*o*o*f),w=d*s*m+Math.pow(d,3)/6*s*_*(1-o*o+n*n)+Math.pow(d,5)/120*s*y*(5-18*o*o+g+14*f-58*f*p);return new r.Cartesian2(w,C)},a.prototype.to_Radian=function(e){return e*Math.PI/180},a.prototype.to_N=function(e){var t=6378137,i=6356752.3142,r=Math.sqrt(t*t-i*i)/t;Math.sqrt(t*t-i*i);return t/Math.sqrt(1-r*r*Math.sin(e)*Math.sin(e))},a.prototype.to_Sm=function(e){var t,i,r,o,n,a=6378137,s=6356752.3142,l=Math.sqrt(a*a-s*s)/a;Math.sqrt(a*a-s*s);return t=1+l*l*3/4+45*Math.pow(l,4)/64+175*Math.pow(l,6)/256+11025*Math.pow(l,8)/16384,i=3*Math.pow(l,2)/4+15*Math.pow(l,4)/16+525*Math.pow(l,6)/512+2205*Math.pow(l,8)/2048,r=15*Math.pow(l,4)/64+105*Math.pow(l,6)/256+2205*Math.pow(l,8)/4096,o=35*Math.pow(l,6)/512+315*Math.pow(l,8)/2048,n=315*Math.pow(l,8)/16384,a*(1-l*l)*(t*e-i/2*Math.sin(2*e)+r/4*Math.sin(4*e)-o/6*Math.sin(6*e)+n/8*Math.sin(8*e))},a.prototype.ElevationAngle=function(e,t,i){var r=i.Cartographic.fromCartesian(e),o=i.Cartographic.fromCartesian(t),n=(r.height,r.height,o.height,i.Cartesian3.fromDegrees(i.Math.toDegrees(o.longitude),i.Math.toDegrees(o.latitude),r.height)),a=parseFloat(function(e,t){for(var i=0,r=0;r<e.length-1;r++){var o=t.Cartographic.fromCartesian(e[r]),n=t.Cartographic.fromCartesian(e[r+1]),a=new t.EllipsoidGeodesic;a.setEndPoints(o,n);var s=a.surfaceDistance;i+=s=Math.sqrt(Math.pow(s,2)+Math.pow(n.height-o.height,2))}return i}([e,t],i)),s=(parseFloat(function(e,t){for(var i=0,r=0;r<e.length-1;r++){var o=t.Cartographic.fromCartesian(e[r]),n=t.Cartographic.fromCartesian(e[r+1]),a=new t.EllipsoidGeodesic;a.setEndPoints(o,n),i+=a.surfaceDistance}return i}([e,n],i)),parseFloat(function(e,t){try{if(1<e.length){var i=t.Cartographic.fromCartesian(e[0]);return t.Cartographic.fromCartesian(e[1]).height-i.height}return 0}catch(e){console.log(e)}}([n,t],i))/a);return 180*Math.asin(s)/3.14},a.prototype.TwoPointAzimuth=function(e,t,i,r){var o=0,n=function(e){return e*Math.PI/180},a=Math.round(.5+36e4*t),s=Math.round(.5+36e4*r),l=Math.round(.5+36e4*e),u=Math.round(.5+36e4*i);if(t=n(t),e=n(e),r=n(r),i=n(i),a===s&&l===u)return o;if(l===u)s<a&&(o=180);else{var c=Math.acos(Math.sin(r)*Math.sin(t)+Math.cos(r)*Math.cos(t)*Math.cos(i-e));o=180*Math.asin(Math.cos(r)*Math.sin(i-e)/Math.sin(c))/Math.PI,a<s&&l<u||(s<a&&u<l?o=180-o:s<a&&l<u?o=180-o:a<s&&u<l&&(o+=360))}return o},a.prototype.ThreePointAzimuth=function(e,t,i,r){var o,n,a,s=Math.PI/180,l=180/Math.PI,u=r.Cartographic.fromCartesian(e),c=r.Cartographic.fromCartesian(t),h=r.Cartographic.fromCartesian(i);function d(e,t){var i=e.latitude*s,r=e.longitude*s,o=t.latitude*s,n=t.longitude*s,a=-Math.atan2(Math.sin(r-n)*Math.cos(o),Math.cos(i)*Math.sin(o)-Math.sin(i)*Math.cos(o)*Math.cos(r-n));return a<0&&(a+=2*Math.PI),a*=l}return t=r.Cartesian3.fromDegrees(r.Math.toDegrees(c.longitude),r.Math.toDegrees(c.latitude),u.height),i=r.Cartesian3.fromDegrees(r.Math.toDegrees(h.longitude),r.Math.toDegrees(h.latitude),u.height),c=r.Cartographic.fromCartesian(t),h=r.Cartographic.fromCartesian(i),n=h,(a=d(o=c,u)-d(o,n))<0&&(a+=360),a},a.prototype.setDepthTest=function(e,t){"open"===e&&void 0===this.defaultDepthTest?(this.defaultDepthTest=!!t.scene.globe.depthTestAgainstTerrain,t.scene.globe.depthTestAgainstTerrain=!0):"close"===e&&void 0!==this.defaultDepthTest&&(t.scene.globe.depthTestAgainstTerrain=!!this.defaultDepthTest,this.defaultDepthTest=void 0)},a.prototype.setImageMaterialProperty=function(e,t,i,r){this.id=r;var n=this,o=document.createElement("canvas");o.id=this.id+"-a",o.width=700,o.height=100;var a=document.createElement("canvas");a.id=this.id+"-b",a.width=700,a.height=100,document.body.appendChild(o),document.body.appendChild(a),e&&(n.images=e);var s=new t.CallbackProperty(function(e,t){var i=document.getElementById(n.id+"-"+n.curCanvas),r=i.getContext("2d"),o=new Image;return o.src=n.images,r.clearRect(0,0,700,100),o.onload=function(){n.i<=700?(r.drawImage(o,n.i,0),r.drawImage(o,n.i+100,0)):n.i=0,n.i+=5},n.curCanvas="a"===n.curCanvas?"b":"a",i},!1);return 1==i&&(s=new t.CallbackProperty(function(e,t){var i=document.getElementById(n.id+"-"+n.curCanvas),r=i.getContext("2d"),o=r.createLinearGradient(0,100,0,0);return o.addColorStop(0,"red"),1<n.i&&(n.i=1),o.addColorStop(n.i,"rgb(255,0,0,0.6)"),o.addColorStop(1,"rgb(255,0,0,0.1)"),r.clearRect(0,0,700,100),r.fillStyle=o,r.fillRect(0,0,700,100),n.i<1?n.i+=.01:n.i=0,n.curCanvas="a"===n.curCanvas?"b":"a",i},!1)),new t.ImageMaterialProperty({image:s,transparent:!0})},a.prototype.setDrawCanvasImage=function(e,t){var r=document.getElementById("canvas-"+curCanvas),o=r.getContext("2d"),n=new Image;return n.src=images,o.clearRect(0,0,700,100),n.onload=function(){i<=700?(o.drawImage(n,i,0),o.drawImage(n,i+100,0)):i=0,i+=5},curCanvas="a"===curCanvas?"b":"a",r},a.prototype.setDrawCanvasColorUpdown=function(e,t){var r=document.getElementById("canvas-"+curCanvas),o=r.getContext("2d"),n=o.createLinearGradient(0,100,0,0);return n.addColorStop(0,"red"),1<i&&(i=1),n.addColorStop(i,"rgb(255,0,0,0.6)"),n.addColorStop(1,"rgb(255,0,0,0.1)"),o.clearRect(0,0,700,100),o.fillStyle=n,o.fillRect(0,0,700,100),i<1?i+=.01:i=0,curCanvas="a"===curCanvas?"b":"a",r},a.prototype.getMousePosition=function(e,t,i,r,o,n,a){var s,l,u,c,h=e.endPosition||e.position;void 0===o&&(o=0),this._cesium=t,this._viewer=i,n=this._cesium.defaultValue(n,!1),void 0===this.defaultDepthTest&&(this.defaultDepthTest=!!this._viewer.scene.globe.depthTestAgainstTerrain);var d=n?a||30:1;if(0!==o?(this._viewer.scene.globe.depthTestAgainstTerrain=!0,(s=this._viewer.camera.getPickRay(h))&&(l=this._viewer.scene.globe.pick(s,this._viewer.scene)),c=this._viewer.scene.drillPick(h,r&&r.length&&r.length+1||1,d,d),(c=this.getNotExcludedObj(c,r))&&!n?(this._viewer.scene.pick(h),(u=this._viewer.scene.pickPosition(h))&&(l=u)):(l&&n&&(u=this._getAdsorptionPosition(h,c,a)),u&&(l=u))):(c=this._viewer.scene.drillPick(h,r&&r.length&&r.length+1||1,d,d),(c=this.getNotExcludedObj(c,r))&&!n?(this._viewer.scene.pick(h),l=this._viewer.scene.pickPosition(h)):c&&n?(this._viewer.scene.pick(h),l=this._viewer.scene.pickPosition(h),(u=this._getAdsorptionPosition(h,c,a))&&(l=u)):(this._viewer.scene.globe.depthTestAgainstTerrain=!0,(s=this._viewer.camera.getPickRay(h))&&(l=this._viewer.scene.globe.pick(s,this._viewer.scene)))),l)return this._viewer.scene.globe.depthTestAgainstTerrain=!!this.defaultDepthTest,this.defaultDepthTest=void 0,l;console.log("未拾取到坐标!")},a.prototype.toDegrees=function(e){var t=Cesium.Cartographic.fromCartesian(e);return{lon:Cesium.Math.toDegrees(t.longitude),lat:Cesium.Math.toDegrees(t.latitude),height:t.height}},a.prototype.LineInterpolation=function(r,e){var t=void 0,m=void 0,p=!1;t=e.positions?e.positions:e,m=e.num||100,e.getHeight&&(p=!0);for(var g={positions:[],cartographic:[],lon_lat:[],height:[]},i=0;i<t.length-1;i++){var o=this.toDegrees(t[i]),n=this.toDegrees(t[i+1]);a(o.lon,o.lat,n.lon,n.lat)}function a(e,t,i,r){var o=Cesium.Math.lerp(e,i,1/m)-e,n=Cesium.Math.lerp(t,r,1/m)-t;g.lon_lat.push(e,t);var a=void 0;if(p){a=f(e,t),g.height.push(a),g.positions.push(Cesium.Cartesian3.fromDegrees(e,t,a));for(var s=0;s<m;s++){var l=e+(s+1)*o,u=t+(s+1)*n;g.lon_lat.push(l,u),a=f(l,u),g.height.push(a),g.positions.push(Cesium.Cartesian3.fromDegrees(l,u,a))}g.lon_lat.push(i,r),a=f(i,r),g.height.push(a),g.positions.push(Cesium.Cartesian3.fromDegrees(i,r,a))}else{g.positions.push(Cesium.Cartesian3.fromDegrees(e,t));for(var c=0;c<m;c++){var h=e+(c+1)*o,d=t+(c+1)*n;g.lon_lat.push(h,d),g.positions.push(Cesium.Cartesian3.fromDegrees(h,d))}g.lon_lat.push(i,r),g.positions.push(Cesium.Cartesian3.fromDegrees(i,r))}}function f(e,t){var i=Cesium.Cartographic.fromDegrees(e,t);return r.scene.globe.getHeight(i)}return g},a.prototype.CIMServerTool=function(e){return new t(e)},a.prototype.Recorder=function(e,t){return this._Recorder?(this._Recorder.mediaOutputPath=this.defaultValue(e,"test.mp4"),t&&(this._Recorder.videoBPS=t)):this._Recorder=new n(e,t),this._Recorder},a.prototype.getLinkMaterial=function(e,t,i){if(!Cesium.PolylineLinkMaterialProperty){var r=function(e,t,i){this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.lightSpotColor=t,this.duration=i,this.old=void 0,this._time=(new Date).getTime()};Object.defineProperties(r.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color")}),r.prototype.getType=function(e){return"PolylineLink"},r.prototype.getValue=function(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.Color.WHITE,t.color),t.lightSpotColor=this.lightSpotColor,t.time=((new Date).getTime()-this._time)%this.duration/this.duration,void 0===this.old&&(this.old=t.time),.5<this.old&&t.time<.5&&(t.plus=!t.plus,t.inverse=!t.inverse),this.old=t.time,t.plus?t.time=1.1*t.time:t.time=1.2*t.time-.1,t},r.prototype.equals=function(e){return this===e||e instanceof r&&Cesium.Property.equals(this._color,e._color)},Cesium.PolylineLinkMaterialProperty=r,Cesium.Material.PolylineLinkType="PolylineLink",Cesium.Material.PolylineLinkSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n if(plus && st.s < time && time - st.s <= 0.1){\n material.alpha = 1.0 - (time - st.s) / 0.1;\n if(material.alpha < 0.3){\n material.alpha = 0.3;\n material.diffuse = color.rgb;\n }else{\n material.diffuse = lightSpotColor.rgb;\n }\n }else if(inverse && st.s < (1.0 - time) && (1.0 - time) - st.s <= 0.1){\n material.alpha = ((1.0-time) - st.s) / 0.1;\n if(material.alpha < 0.3){\n material.alpha = 0.3;\n material.diffuse = color.rgb;\n }else{\n material.diffuse = lightSpotColor.rgb;\n }\n }else{\n material.alpha = 0.3;\n material.diffuse = color.rgb;\n }\n return material;\n }",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineLinkType,{fabric:{type:Cesium.Material.PolylineLinkType,uniforms:{color:new Cesium.Color(1,0,0,.5),lightSpotColor:new Cesium.Color(1,1,1,.5),time:0,plus:!0,inverse:!1},source:Cesium.Material.PolylineLinkSource},translucent:function(e){return!0}})}return new Cesium.PolylineLinkMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#0000ff")),Cesium.Color.fromCssColorString(this.defaultValue(t,"#ffffff")),this.defaultValue(i,3e3))},a.prototype.getTrailLinkMaterial=function(e,t,i){if(!Cesium.PolylineTrailLinkMaterialProperty){var r=function(e,t,i){this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this._Line=t,this.duration=i,this._time=(new Date).getTime()};Object.defineProperties(r.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color")}),r.prototype.getType=function(e){return"PolylineTrailLink"},r.prototype.setScale=function(e){this.scale=e},r.prototype.getValue=function(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.Color.WHITE,t.color),"object"===_typeof2(this._Line)?this._Line.LightSpot?(t.lightSpot=!0,t.lightSpotColor=this._Line.color):(t.color1=this._Line.color1,t.color2=this._Line.color2,t.twoColor=!0):t.image=this._Line,void 0!==this.scale?t.time=this.scale:t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t},r.prototype.equals=function(e){return this===e||e instanceof r&&Cesium.Property.equals(this._color,e._color)},Cesium.PolylineTrailLinkMaterialProperty=r,Cesium.Material.PolylineTrailLinkType="PolylineTrailLink",Cesium.Material.PolylineTrailLinkImage=window.SmartEarthRootUrl+o.colors1,Cesium.Material.PolylineTrailLinkSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n if(twoColor){\n if(st.s<time){\n material.alpha = color1.a;\n material.diffuse = color1.rgb;\n }else{\n material.alpha = color2.a;\n material.diffuse = color2.rgb;\n }\n }else if(lightSpot){\n if(st.s<time){\n material.alpha = pow(st.s / time, 20.0);\n if(material.alpha<0.3){\n material.alpha = 0.3;\n material.diffuse = color.rgb;\n }else{\n material.diffuse = lightSpotColor.rgb;\n }\n }else{\n material.alpha = 0.3;\n material.diffuse = color.rgb;\n }\n }else{\n vec4 colorImage = texture2D(image, vec2(fract(st.s - time), st.t));\n material.alpha = colorImage.a * color.a;\n material.diffuse = (colorImage.rgb+color.rgb)/2.0;\n }\n return material;\n }",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineTrailLinkType,{fabric:{type:Cesium.Material.PolylineTrailLinkType,uniforms:{color:new Cesium.Color(1,0,0,.5),color1:new Cesium.Color(0,1,0,.5),color2:new Cesium.Color(1,0,0,.5),image:Cesium.Material.PolylineTrailLinkImage,twoColor:!1,lightSpot:!1,lightSpotColor:new Cesium.Color(1,1,1,.5),time:0},source:Cesium.Material.PolylineTrailLinkSource},translucent:function(e){return!0}})}return new Cesium.PolylineTrailLinkMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#ffffff")),t,this.defaultValue(i,3e3))},a.prototype.getConeRadarMaterial=function(e){if(!Cesium.ConeRadarMaterialProperty){var t=function(e,t){this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.duration=t,this._time=(new Date).getTime()};Object.defineProperties(t.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color")}),t.prototype.getType=function(e){return"ConeRadar"},t.prototype.getValue=function(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.Color.WHITE,t.color),t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t},t.prototype.equals=function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)},Cesium.ConeRadarMaterialProperty=t,Cesium.Material.ConeRadarType="ConeRadar",Cesium.Material.ConeRadarSource="\n float ripple(float dist, float rippleIntensity, float rippleScale) {\n return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n }\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n material.alpha = 0.0;\n float intensity = step(0.001,ripple(dis, 80.0, 15.0));\n if(intensity == 1.0)\n {\n material.alpha = 1.0;\n }\n return material;\n }",Cesium.Material._materialCache.addMaterial(Cesium.Material.ConeRadarType,{fabric:{type:Cesium.Material.ConeRadarType,uniforms:{color:new Cesium.Color(1,0,0,.5),time:0},source:Cesium.Material.ConeRadarSource},translucent:function(e){return!0}})}return new Cesium.ConeRadarMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#0000ff")),3e3)},a.prototype.getMultiCircleScanMaterial=function(e,t){if(!Cesium.CircleScanMultiMaterialProperty){var i=function(e,t){this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.u_radius1=0,this.u_radius2=0,this.u_radius3=0,this.duration=t,this._time=(new Date).getTime()};Object.defineProperties(i.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color")}),i.prototype.getType=function(e){return"CircleScanMulti"},i.prototype.getValue=function(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.Color.WHITE,t.color),t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t.time<1/3&&0===this.u_radius2&&0===this.u_radius1?this.u_radius3=t.time:t.time>=1/3&&t.time<2/3&&0===this.u_radius1?(this.u_radius3=t.time,this.u_radius2=this.u_radius3-1/3):t.time>=2/3?(this.u_radius3=t.time,this.u_radius2=this.u_radius3-1/3,this.u_radius1=this.u_radius3-2/3):t.time<1/3&&0!==this.u_radius2&&0!==this.u_radius1?(this.u_radius1=t.time,this.u_radius2=t.time+1/3,this.u_radius3=t.time+2/3):t.time>=1/3&&t.time<2/3&&0!==this.u_radius1&&(this.u_radius1=t.time-1/3,this.u_radius2=t.time,this.u_radius3=t.time+1/3),t.u_radius1=this.u_radius1,t.u_radius2=this.u_radius2,t.u_radius3=this.u_radius3,t},i.prototype.equals=function(e){return this===e||e instanceof i&&Cesium.Property.equals(this._color,e._color)},Cesium.CircleScanMultiMaterialProperty=i,Cesium.Material.CircleScanMultiType="CircleScanMulti",Cesium.Material.CircleScanMultiSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n dis = dis * 2.0;\n if(dis < u_radius1)\n\n {\n float f = dis / u_radius1;\n material.alpha = pow(f, 9.0);\n }else if(dis < u_radius2){\n float f = dis / u_radius2;\n material.alpha = pow(f, 9.0);\n }else if(dis < u_radius3){\n float f = dis / u_radius3;\n material.alpha = pow(f, 9.0);\n }else{\n material.alpha = 0.0;\n }\n return material;\n }",Cesium.Material._materialCache.addMaterial(Cesium.Material.CircleScanMultiType,{fabric:{type:Cesium.Material.CircleScanMultiType,uniforms:{color:new Cesium.Color(1,0,0,1),time:0,u_radius1:0,u_radius2:0,u_radius3:0},source:Cesium.Material.CircleScanMultiSource},translucent:function(e){return!0}})}return new Cesium.CircleScanMultiMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#ff0000")),this.defaultValue(t,3e3))},a.prototype.getSectorScanMaterial=function(e,t){if(!Cesium.EllipsoidFadeMaterialProperty){var i=function(e,t,i){this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.duration=i,this._angle=t,this._time=(new Date).getTime()};Object.defineProperties(i.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color"),angle:Cesium.createPropertyDescriptor("angle")}),i.prototype.getType=function(e){return"EllipsoidFade"},i.prototype.getValue=function(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.ColorWHITE,t.color),t.angle=this._angle,t},i.prototype.equals=function(e){return this===e||e instanceof i&&Property.equals(this._color,e._color)},Cesium.EllipsoidFadeMaterialProperty=i,Cesium.Material.EllipsoidFadeType="EllipsoidFade",Cesium.Material.EllipsoidFadeSource="float getAngle(in vec2 dv)\n{\n if(dv.y == 0.0 && dv.x > 0.0)\n {\n return 90.0;\n }\n if(dv.y == 0.0 && dv.x < 0.0)\n {\n return 270.0;\n }\n float rAngle = atan(dv.x/dv.y) * 180.0 / 3.1415926;\n if(dv.x > 0.0)\n {\n if(dv.y < 0.0)\n {\n rAngle = 180.0 + rAngle;\n }\n }\n if(dv.x <= 0.0)\n {\n if(dv.y < 0.0)\n {\n rAngle = 180.0 + rAngle;\n }\n if(dv.y > 0.0)\n {\n rAngle = 360.0 + rAngle;\n }\n }\n return rAngle;\n}\nfloat ripple(float dist, float rippleIntensity, float rippleScale) {\n return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n float nowAngle = getAngle(st.xy-vec2(0.5, 0.5));\n if(nowAngle < angle)\n {\n material.alpha = 1.0 - dis/0.5;\n float intensity =step(0.001,ripple(dis, 100.0, 15.0));\n if(intensity == 1.0)\n {\n material.alpha = material.alpha/2.0;\n }\n }\n else{\n material.alpha = 0.0;\n discard;\n }\n return material;\n}",Cesium.Material._materialCache.addMaterial(Cesium.Material.EllipsoidFadeType,{fabric:{type:Cesium.Material.EllipsoidFadeType,uniforms:{color:new Cesium.Color(1,0,0,1),angle:90},source:Cesium.Material.EllipsoidFadeSource},translucent:function(e){return!0}})}return new Cesium.EllipsoidFadeMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#ff0000")),this.defaultValue(t,45))},a.prototype.getCircleScanMaterial=function(e,t){if(!Cesium.CircleScanMaterialProperty){var i=function(e,t){this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.duration=t,this._time=(new Date).getTime()};Object.defineProperties(i.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color")}),i.prototype.getType=function(e){return"CircleScan"},i.prototype.getValue=function(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.Color.WHITE,t.color),t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t},i.prototype.equals=function(e){return this===e||e instanceof i&&Cesium.Property.equals(this._color,e._color)},Cesium.CircleScanMaterialProperty=i,Cesium.Material.CircleScanType="CircleScan",Cesium.Material.CircleScanSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n if(dis<time){\n float f = dis / time;\n material.alpha = pow(f, 4.0);\n }else{\n material.alpha = 0.0;\n }\n return material;\n }",Cesium.Material._materialCache.addMaterial(Cesium.Material.CircleScanType,{fabric:{type:Cesium.Material.CircleScanType,uniforms:{color:new Cesium.Color(1,0,0,1),time:0},source:Cesium.Material.CircleScanSource},translucent:function(e){return!0}})}return new Cesium.CircleScanMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#ff0000")),this.defaultValue(t,3e3))},a.prototype.getRadarScanMaterial=function(e,t){if(!Cesium.RadarScanMaterialProperty){var i=function(e,t){this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.duration=t,this._time=(new Date).getTime()};Object.defineProperties(i.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color")}),i.prototype.getType=function(e){return"RadarScan"},i.prototype.getValue=function(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.Color.WHITE,t.color),t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t.angle1=360*t.time,t.angle2=360*t.time+60,360<t.angle2&&(t.angle2=t.angle2-360),t},i.prototype.equals=function(e){return this===e||e instanceof i&&Cesium.Property.equals(this._color,e._color)},Cesium.RadarScanMaterialProperty=i,Cesium.Material.RadarScanType="RadarScan",Cesium.Material.RadarScanSource="float getAngle(in vec2 dv)\n {\n if(dv.y == 0.0 && dv.x > 0.0)\n {\n return 90.0;\n }\n if(dv.y == 0.0 && dv.x < 0.0)\n {\n return 270.0;\n }\n float rAngle = atan(dv.x/dv.y) * 180.0 / 3.1415926;\n if(dv.x > 0.0)\n {\n if(dv.y < 0.0)\n {\n rAngle = 180.0 + rAngle;\n }\n }\n if(dv.x <= 0.0)\n {\n if(dv.y < 0.0)\n {\n rAngle = 180.0 + rAngle;\n }\n if(dv.y > 0.0)\n {\n rAngle = 360.0 + rAngle;\n }\n }\n return rAngle;\n }\n float ripple(float dist, float rippleIntensity, float rippleScale) {\n return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n }\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n float f = 0.0;\n float nowAngle = getAngle(st.xy-vec2(0.5, 0.5));\n if(nowAngle < angle2 && nowAngle > angle1)\n {\n f = (nowAngle - angle1) / 60.0;\n material.alpha = f;\n }else if(nowAngle < 360.0 && nowAngle > angle1 && angle2 < 60.0){\n f = (nowAngle - angle1) / 60.0;\n material.alpha = f;\n }else if(nowAngle < angle2 && nowAngle > 0.0 && angle2 < 60.0){\n f = (nowAngle + 360.0 - angle1) / 60.0;\n material.alpha = f;\n }else{\n material.alpha = 0.0;\n discard;\n }\n return material;\n }",Cesium.Material._materialCache.addMaterial(Cesium.Material.RadarScanType,{fabric:{type:Cesium.Material.RadarScanType,uniforms:{color:new Cesium.Color(1,0,0,1),time:0,angle2:0,angle1:0},source:Cesium.Material.RadarScanSource},translucent:function(e){return!0}})}return new Cesium.RadarScanMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#ff0000")),this.defaultValue(t,3e3))},a.prototype.gradientColor=function(e,t,i){return new l(e,t,i)},a.prototype.xhr=function(e){var t=new XMLHttpRequest,i=!0;i=null==e.async||(null==e.async||e.async),t.open(e.type,e.url,i),t.send(e.data||{}),t.onreadystatechange=function(){4===this.readyState&&200===this.status?e.success&&"function"==typeof e.success&&e.success(e.isXml?this.responseXML:JSON.parse(this.responseText)):e.error&&"function"==typeof e.error&&e.error(t),e.complete&&"function"==typeof e.complete&&e.complete()}};var s="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof2(e)};function l(e,t,i){if(e&&t){"#"!==e[0]&&(e=this.colorHex(e)),"#"!==t[0]&&(t=this.colorHex(t));for(var r=this.colorRgb(e),o=r[0],n=r[1],a=r[2],s=this.colorRgb(t),l=(s[0]-o)/i,u=(s[1]-n)/i,c=(s[2]-a)/i,h=[],d=0;d<i;d++){var m=this.colorHex("rgb("+parseInt(l*d+o)+","+parseInt(u*d+n)+","+parseInt(c*d+a)+")");h.push(m)}return h}return this}return a.prototype._serialize=function(e){var t=[],i=window.encodeURIComponent;for(var r in e){var o=e[r];"object"===(void 0===o?"undefined":s(o))?t.push(i(r)+"="+i(JSON.stringify(o))):t.push(i(r)+"="+i(e[r]))}return t.join("&")},a.prototype.xml2json=function(e,h){if(!e)return{};"string"==typeof e&&(e=function(e){var t=null;if(window.DOMParser)try{var i=new DOMParser;t=i.parseFromString(e,"text/xml")}catch(e){}else{if(window.DOMParser||!window.ActiveXObject)return null;for(var r=["MSXML2.DOMDocument","Microsoft.XMLDOM"],o=0;o<r.length;o++)try{(t=new ActiveXObject(r[o])).async=!1,t.loadXML(e);break}catch(e){continue}}return t}(e));var d=this;var m=function(e){return String(e||"").replace(/-/g,"_")};var p=function(e){return Array.isArray(e)||(e=[e]),e.length=e.length,e};if(e.nodeType){if(3==e.nodeType||4==e.nodeType)return e.nodeValue;var t=9==e.nodeType?e.documentElement:e,i=function n(e,t){if(!e)return null;var a="",s=null,i=null;e.nodeType,m(e.localName||e.nodeName),e.text||e.nodeValue;if(e.childNodes&&0<e.childNodes.length&&e.childNodes.forEach(function(e,t){var i=e.nodeType,r=m(e.localName||e.nodeName),o=e.text||e.nodeValue||"";if(8!=i)if(3!=i&&4!=i&&r)(s=s||{})[r]?(s[r].length||(s[r]=p(s[r])),s[r]=p(s[r]),s[r][s[r].length]=n(e,!0),s[r].length=s[r].length):s[r]=n(e);else{if(o.match(/^\s+$/))return;a+=o.replace(/^\s+/,"").replace(/\s+$/,"")}}),e.attributes&&0<e.attributes.length){i={},s=s||{};for(var r,o=0;o<e.attributes.length;o++){r=e.attributes[o];var l=m("@"+r.name),u=r.value;i[l]=u,s[l]?(s[cnn]=p(s[cnn]),s[l][s[l].length]=u,s[l].length=s[l].length):s[l]=u}}s&&(s=d.extend(""!=a?new String(a):{},s||{}),(a=s.text?[s.text||""].concat([a]):a)&&(s.text=a),a="");var c=s||a;return h&&(a&&(c={}),(a=c.text||a||"")&&(c.text=a),t||(c=p(c))),c}(t,!0);return t=e=null,i}},l.prototype.colorRgb=function(e){if((e=e.toLowerCase())&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e)){if(4===e.length){for(var t="#",i=1;i<4;i+=1)t+=e.slice(i,i+1).concat(e.slice(i,i+1));e=t}var r=[];for(i=1;i<7;i+=2)r.push(parseInt("0x"+e.slice(i,i+2)));return r}return e},l.prototype.colorHex=function(e){var t=e;if(/^(rgb|RGB)/.test(t)){for(var i=t.replace(/(rgb|RGB)*/g,""),r=(i=i.replace("(","").replace(")","")).split(","),o="#",n=0;n<r.length;n++){var a=Number(r[n]).toString(16);"0"===(a=1===a.length?"0"+a:a)&&(a+=a),o+=a}return 7!==o.length&&(o=t),o}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t))return t;var s=t.replace(/#/,"").split("");if(6===s.length)return t;if(3===s.length){var l="#";for(n=0;n<s.length;n+=1)l+=s[n]+s[n];return l}},Object.defineProperties(a.prototype,{selectedColor:{get:function(){return this._selectedColor},set:function(e){this._selectedColor=e}}}),a.prototype.getBrowser=function(){var e=navigator.userAgent.toLowerCase(),t=(e.match(/firefox|chrome|safari|opera/g)||"other")[0];(e.match(/msie|trident/g)||[])[0]&&(t="msie");var i,r="",o="";switch(r="ontouchstart"in window||-1!==e.indexOf("touch")||-1!==e.indexOf("mobile")?-1!==e.indexOf("ipad")?"pad":-1!==e.indexOf("mobile")?"mobile":-1!==e.indexOf("android")?"androidPad":"pc":"pc",t){case"chrome":case"safari":case"mobile":o="webkit";break;case"msie":o="ms";break;case"firefox":o="Moz";break;case"opera":o="O";break;default:o="webkit"}return i=0<e.indexOf("android")?"android":navigator.platform.toLowerCase(),{version:(e.match(/[\s\S]+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],plat:i,type:t,pc:r,prefix:o,isMobile:"pc"!=r}},a}),define("SGWorld/Creator/Color",["../Core/Core"],function(i){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i}return e.prototype.VectorColorTransformation=function(e,t){var i=e;if(i&&"["==i.toString().charAt(0)&&"]"==i.toString().charAt(i.length-1)){var r=styleOption.fillColor.replace(/\[/,"").replace(/\]/,"");i=t.properties[r]}return this._core.isnull(i)||(this._core.isHtmlColor(i)?i=this.colorFromHtmlColor(i):(/^rgb/.test(i)&&(i=this.rgbaStringToRgbaObj(i)),null!=i.r?(1<i.r&&(i.r=i.r/255),1<i.g&&(i.g=i.g/255),1<i.b&&(i.b=i.b/255),1<i.a&&(i.a=i.a/255),i=this.createColor(i.r,i.g,i.b,i.a)):null!=i.red&&(1<i.red&&(i.red=i.red/255),1<i.green&&(i.green=i.green/255),1<i.blue&&(i.blue=i.blue/255),1<i.alpha&&(i.alpha=i.alpha/255),i=this.createColor(i.red,i.green,i.blue,i.alpha)))),i},e.prototype.createColorTransformation=function(e){var t=e;return this._core.isnull(t)||"["==t.toString().charAt(0)&&"]"==t.toString().charAt(t.length-1)||(t=this._core.isHtmlColor(t)?this.colorFromHtmlColor(t):(/^rgb/.test(t)&&(t=this.rgbaStringToRgbaObj(t)),1<t.r&&(t.r=t.r/255),1<t.g&&(t.g=t.g/255),1<t.b&&(t.b=t.b/255),1<t.a&&(t.a=t.a/255),this.createColor(t.r,t.g,t.b,t.a))),t},e.prototype.createColor=function(e,t,i,r){return new this._cesium.Color(e,t,i,r)},e.prototype.colorFromHtmlColor=function(e){if("object"==(void 0===e?"undefined":_typeof2(e)))return e.color?e.color:void 0;if(e=e.toLowerCase(),/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e)){if(4==e.length){for(var t="#",i=1;i<4;i+=1)t+=e.slice(i,i+1).concat(e.slice(i,i+1));e=t}var r=[];for(i=1;i<7;i+=2)r.push(parseInt("0x"+e.slice(i,i+2)));if(9!=e.length)return this.createColor(r[0]/255,r[1]/255,r[2]/255,1);var o=parseInt(e.substr(7,2))/100;return this.createColor(r[0]/255,r[1]/255,r[2]/255,o)}console.log("不是有效的html颜色",e)},e.prototype.toHtmlColor=function(e){var t=e.split(",");return"#"+((1<<24)+(parseInt(t[0].split("(")[1])<<16)+(parseInt(t[1])<<8)+parseInt(t[2].split(")")[0])).toString(16).slice(1)},e.prototype.rgbaStringToRgbaObj=function(e){if(/^rgb/.test(e)){var t=(e=(e=(e=e.replace(/rgba\(/g,"")).replace(/rgb\(/g,"")).replace(/\)/g,"")).split(",");e={},3==t.length?(e.r=parseFloat(t[0]),e.g=parseFloat(t[1]),e.b=parseFloat(t[2]),e.a=1):4==t.length&&(e.r=parseFloat(t[0]),e.g=parseFloat(t[1]),e.b=parseFloat(t[2]),e.a=parseFloat(t[3]))}return e},e.prototype.CreateColor=function(e,t,i,r){return new this._cesium.Color(e,t,i,r)},e}),define("SGWorld/Creator/Label",["../Core/Core","./Color","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min","../configData"],function(i,l,s,e,u){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._tree=s,this._core=new i,this._Color=new l(this._viewer,this._cesium),this._postion={Altitude:0,AltitudeType:0,Cartesian:!0,Distance:0,Pitch:0,Roll:0,X:0,Y:0,Yaw:0}}return t.prototype.createLabel=function(e,t,i,r,o){var n={id:this._core.getuid(),text:"default text",backgroundColor:new l(this._viewer,this._cesium).createColor(.165,.165,.165,1),fillColor:new l(this._viewer,this._cesium).createColor(.9411764705882353,.9725490196078431,1,1),font:"30px sans-serif",horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,show:!0,scale:1,showBackground:!1,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(0,Number.MAX_VALUE)},a=this._core.extend(n,i,!0);this._core.isnull(t)||(a.text=t),a.fillColor&&(this._core.isnull(a)||this._core.isnull(a.fillColor)||"["==a.fillColor.toString().charAt(0)&&"]"==a.fillColor.toString().charAt(a.fillColor.length-1)||(this._core.isHtmlColor(a.fillColor)&&/^#/.test(a.fillColor.toString())?a.fillColor=this._Color.colorFromHtmlColor(a.fillColor):(/^rgb/.test(a.fillColor)&&(a.fillColor=this._Color.rgbaStringToRgbaObj(a.fillColor)),1<a.fillColor.r&&(a.fillColor.r=a.fillColor.r/255),1<a.fillColor.g&&(a.fillColor.g=a.fillColor.g/255),1<a.fillColor.b&&(a.fillColor.b=a.fillColor.b/255),1<a.fillColor.a&&(a.fillColor.a=a.fillColor.a/255),a.fillColor.r&&(a.fillColor=this._Color.createColor(a.fillColor.r,a.fillColor.g,a.fillColor.b,a.fillColor.a))))),a.backgroundColor&&(this._core.isnull(a)||this._core.isnull(a.backgroundColor)||"["==a.backgroundColor.toString().charAt(0)&&"]"==a.backgroundColor.toString().charAt(a.backgroundColor.length-1)||(this._core.isHtmlColor(a.backgroundColor)&&/^#/.test(a.backgroundColor.toString())?a.backgroundColor=this._Color.colorFromHtmlColor(a.backgroundColor):(/^rgb/.test(a.backgroundColor)&&(a.backgroundColor=this._Color.rgbaStringToRgbaObj(a.backgroundColor)),1<a.backgroundColor.r&&(a.backgroundColor.r=a.backgroundColor.r/255),1<a.backgroundColor.g&&(a.backgroundColor.g=a.backgroundColor.g/255),1<a.backgroundColor.b&&(a.backgroundColor.b=a.backgroundColor.b/255),1<a.backgroundColor.a&&(a.backgroundColor.a=a.backgroundColor.a/255),a.backgroundColor.r&&(a.backgroundColor=this._Color.createColor(a.backgroundColor.r,a.backgroundColor.g,a.backgroundColor.b,a.backgroundColor.a))))),a.outlineColor&&(this._core.isnull(a)||this._core.isnull(a.outlineColor)||"["==a.outlineColor.toString().charAt(0)&&"]"==a.outlineColor.toString().charAt(a.outlineColor.length-1)||(this._core.isHtmlColor(a.outlineColor)&&/^#/.test(a.outlineColor.toString())?a.outlineColor=this._Color.colorFromHtmlColor(a.outlineColor):(/^rgb/.test(a.outlineColor)&&(a.outlineColor=this._Color.rgbaStringToRgbaObj(a.outlineColor)),1<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor.r&&(a.outlineColor=this._Color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a))))),a.near&&a.far&&(a.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(a.near,a.far)),this.item=this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),label:a});var s={id:this.item.id,name:a.text,pId:this._core.isnull(r)?0:r,type:"label",item:this};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(r)?0:r),this},t.prototype.getstyles=function(){var e={};return e.backgroundColor="rgba"+this.item.label._backgroundColor.toString(),e.fillColor="rgba"+this.item.label._fillColor.toString(),e.text=this.item.label.text.toString(),e.show=!this.item.label.show||this.item.label.show._value,e.font=this.item.label.font?this.item.label.font.toString():null,e.style=this.item.label.style?"null"==this.item.label.style.toString()?null:this.item.label.style.toString():null,e.scale=this.item.label.scale?this.item.label.scale.toString():null,e.showBackground=this.item.label.showBackground?this.item.label.showBackground._value:null,e.horizontalOrigin=this.item.label.horizontalOrigin?this.item.label.horizontalOrigin.toString():null,e.verticalOrigin=this.item.label.verticalOrigin?this.item.label.verticalOrigin.toString():null,e.heightReference=this.item.label.heightReference?this.item.label.heightReference.toString():null,e.outlineColor=this.item.label.outlineColor?"rgba"+this.item.label.outlineColor.toString():null,e.outlineWidth=this.item.label.outlineWidth?this.item.label.outlineWidth._value:null,e.near=this.item.label.distanceDisplayCondition?this.item.label.distanceDisplayCondition._value.near:null,e.far=this.item.label.distanceDisplayCondition?this.item.label.distanceDisplayCondition._value.far:null,e.position=this.item.position.getValue().toString(),e},t.prototype.executeLabel=function(e){var n=this,a=[],t=new n._cesium.ScreenSpaceEventHandler(n._viewer.scene.canvas);return t.setInputAction(function(e){var t=n._viewer.scene.camera.pickEllipsoid(e.position,n._viewer.scene.globe.ellipsoid);a.push(t);var i=n._viewer.entities.add({position:t,label:{id:n._core.getuid(),text:"",font:"30px sans-serif",horizontalOrigin:n._cesium.HorizontalOrigin.CENTER,verticalOrigin:n._cesium.VerticalOrigin.CENTER,show:!0,showBackground:!0}});n.item=i;var r=0;n._core.isnull(s.selectedItem)||"group"!=s.selectedItem.type||(r=s.selectedItem.id);var o={id:n._core.getuid(),name:"",pId:n._core.isnull(r)?0:r,type:"Point",item:n};n.setTreeobj(o),n._tree.insertGroupId(o,n._core.isnull(r)?0:r)},n._cesium.ScreenSpaceEventType.LEFT_CLICK),t.setInputAction(function(e){t.destroy()},n._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},t.prototype.deleteObject=function(){try{if("DivPoint"===this.item.type){this.pointPrimitive.remove(this.item);var e=document.getElementById(this.item.id);return void(e&&e.remove())}this._viewer.entities.remove(this.item)}catch(e){}},t.prototype.setVisibility=function(e){this.item.show=e},t.prototype.setRichtext=function(e){var t=this._core.getuid();null!=this.item.position._value?this._position=this.item.position._value:this._position=this.item.position;var i=this.treeobj.pId;if(this.deleteObject(),!this.pointPrimitive){var r,o,n;this.pointPrimitive=this._viewer.scene.primitives.add(new this._cesium.PointPrimitiveCollection);var a=this;this.pointPrimitive.update=function(){for(var e,t,i=0;i<a.pointPrimitive.length;i++){if(e=a.pointPrimitive.get(i),n=e.position,!(o=a._viewer.scene.cartesianToCanvasCoordinates(n)))return;r=document.getElementById(e.id),e.name||(e.name="泰瑞"),r||(r=(t=e.description?'<div id="'+e.id+'" style="position: absolute; width: 200px; height: 157px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+u.divpoint+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)"></div>\n <div class="content" style="position: inherit;font-size: 14px;top: 50px;left: 50px;width: 140px;text-align: left;color: rgba(255,255,255,1);">'+e.description+"</div> \n </div>":'<div id="'+e.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+u.divpoint1+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">'+e.name+"</div>\n </div>",$(".cesium-viewer").append(t),document.getElementById(e.id))),e.description?r.style.transform="matrix(1, 0, 0, 1, "+o.x+", "+(o.y-157)+")":r.style.transform="matrix(1, 0, 0, 1, "+o.x+", "+(o.y-134)+")"}}}this.item=this.pointPrimitive.add({id:"DivPoint"+t,position:this._position,color:this._cesium.Color.YELLOW}),this.item.type="DivPoint",this.item.name=name,this.item.description=e;var s={id:this.item.id,name:name,pId:this._core.isnull(i)?0:i,type:"Point",item:this};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),this.item},t.prototype.getVisibility=function(){return this.item.show},t.prototype.setRadius=function(e){try{this.item._label.outlineWidth=e,this.item._label.outlineColor=this._cesium.Color.RED.withAlpha(.4)}catch(e){console.log(e)}return this},t.prototype.setText=function(e){try{this.item._label.text=e}catch(e){console.log(e)}return this},t.prototype.setHeightType=function(e){try{1==e?this.item._label.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._label.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._label.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},t.prototype.setUrl=function(e){try{this.item.billboard=new this._cesium.BillboardGraphics({id:this._core.getuid(),image:e,show:!0})}catch(e){console.log(e)}return this},t.prototype.setFillColorRgba=function(e,t,i,r){try{this.item._label.fillColor=new l(this._viewer,this._cesium).createColor(e,t,i,r)}catch(e){console.log(e)}},t.prototype.setFillColorHtml=function(e){try{this.item._label.fillColor=new l(this._viewer,this._cesium).colorFromHtmlColor(e),this.item.fillColor=this.item._label.fillColor}catch(e){console.log(e)}},t.prototype.setFillColorAlpha=function(e){try{this.item._label.fillColor._value.alpha=e}catch(e){console.log(e)}},t.prototype.setBackgroundColorRgba=function(e,t,i,r){try{this.item._label.backgroundColor=new l(this._viewer,this._cesium).createColor(e,t,i,r)}catch(e){console.log(e)}},t.prototype.setBackgroundColorHtml=function(e){try{this.item._label.backgroundColor=new l(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}},t.prototype.setBackgroundColorAlpha=function(e){try{this.item._label.backgroundColor._value.alpha=e}catch(e){console.log(e)}},t.prototype.setFontSize=function(e){try{this.item._label.font=parseFloat(e)+"px sans-serif"}catch(e){console.log(e)}},t.prototype.setFillColorAlpha=function(e){try{this.item._label.fillColor._value.alpha=e}catch(e){console.log(e)}},t.prototype.showBackground=function(e){try{this.item._label.showBackground=e}catch(e){console.log(e)}},t.prototype.setOutlineWidth=function(e){try{this.item._label.outlineWidth=e}catch(e){console.log(e)}},t.prototype.setOutlineColorRgba=function(e,t,i,r){try{this.item._label.outlineColor=new this._cesium.Color(e,t,i,r)}catch(e){console.log(e)}},t.prototype.setOutlineColorHtml=function(e){try{this.item._label.outlineColor=new l(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}},t.prototype.setOutlineColorAlpha=function(e){try{this.item._label.outlineColor._value.alpha=e}catch(e){console.log(e)}},t.prototype.setStyle_LabelStyle_FILL=function(e){try{this.item._label.style=this.LabelStyle_FILL}catch(e){console.log(e)}},t.prototype.setStyle_LabelStyle_FILL_AND_OUTLINE=function(){try{this.item._label.style=this.LabelStyle_FILL_AND_OUTLINE}catch(e){console.log(e)}},t.prototype.setDistanceDisplayCondition=function(e,t){var i=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._label.distanceDisplayCondition=i}catch(e){console.log(e)}return this},t.prototype.setStyle_LabelStyle_OUTLINE=function(){try{this.item._label.style=this.LabelStyle_OUTLINE}catch(e){console.log(e)}},t.prototype.setItem=function(e){this.item=e},t.prototype.CreateLabel=function(e,t,i,r,o,n){this._postion=e;var a={id:this._core.getuid(),text:t,backgroundColor:r.BackgroundColor,font:r.FontName,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,show:!0,scale:r.Scale,showBackground:!1,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(r.MinViewingHeight,r.MaxViewingHeight)};r.Italic&&(a.font="italic "+a.font),r.Bold&&(a.font="Bold "+a.font),this._core.isnull(r)||this._core.isnull(r.IconColor)||"["==r.IconColor.toString().charAt(0)&&"]"==r.IconColor.toString().charAt(r.IconColor.length-1)||(this._core.isHtmlColor(r.IconColor)?a.fillColor=this._Color.colorFromHtmlColor(r.IconColor):(/^rgb/.test(r.IconColor)&&(a.fillColor=this._Color.rgbaStringToRgbaObj(r.IconColor)),1<a.fillColor.r&&(a.fillColor.r=a.fillColor.r/255),1<a.fillColor.g&&(a.fillColor.g=a.fillColor.g/255),1<a.fillColor.b&&(a.fillColor.b=a.fillColor.b/255),1<a.fillColor.a&&(a.fillColor.a=a.fillColor.a/255),a.fillColor=this._Color.createColor(a.fillColor.r,a.fillColor.g,a.fillColor.b,a.fillColor.a))),this._core.isnull(r)||this._core.isnull(r.LineColor)||"["==r.LineColor.toString().charAt(0)&&"]"==r.LineColor.toString().charAt(r.LineColor.length-1)||(this._core.isHtmlColor(r.LineColor)?a.outlineColor=this._Color.colorFromHtmlColor(r.LineColor):(/^rgb/.test(r.LineColor)&&(a.outlineColor=this._Color.rgbaStringToRgbaObj(r.LineColor)),1<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor=this._Color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a))),a=this._core.extend(a,r,!0);var s={position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),label:a};if(i&&""!==i){s.label.pixelOffset=this._cesium.defaultValue(r.pixelOffset,{x:30*(t.length/2+1),y:-30});var l={image:i,fillColor:a.fillColor,horizontalOrigin:this._cesium.defaultValue(r.ImageHorizontal,this._cesium.HorizontalOrigin.CENTER),verticalOrigin:this._cesium.defaultValue(r.ImageVertical,this._cesium.VerticalOrigin.CENTER),outlineColor:a.outlineColor,show:!0,scale:r.ImageScale||1,showBackground:!1,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(r.ImageMinViewingHeight||0,r.ImageMaxViewingHeight||99999999999999)};r.pixelOffset={x:0,y:0},l=this._core.extend(l,r,!1),s.billboard=l}this.item=this._viewer.entities.add(s);var u={id:this.item.id,name:a.text,pId:this._core.isnull(o)?0:o,type:"label",item:this};return this.setTreeobj(u),this._tree.insertGroupId(u,this._core.isnull(o)?0:o),this},t.prototype.export=function(){var e=null==this.item.label.show?void 0:this.item.label.show._value,t=null==this.item.label.text?void 0:this.item.label.text._value,i=null==this.item.label.font?void 0:this.item.label.font._value,r=null==this.item.label.style?void 0:this.item.label.style._value,o=null==this.item.label.scale?void 0:this.item.label.scale._value,n=null==this.item.label.showBackground?void 0:this.item.label.showBackground._value,a=null==this.item.label.backgroundColor?void 0:"rgba("+this.item.label.backgroundColor._value.red+","+this.item.label.backgroundColor._value.green+","+this.item.label.backgroundColor._value.blue+","+this.item.label.backgroundColor._value.alpha+")",s=null==this.item.label.horizontalOrigin?void 0:this.item.label.horizontalOrigin._value,l=null==this.item.label.verticalOrigin?void 0:this.item.label.verticalOrigin._value,u=null==this.item.label.heightReference?void 0:this.item.label.heightReference._value,c=null==this.item.label.fillColor?void 0:"rgba("+this.item.label.fillColor._value.red+","+this.item.label.fillColor._value.green+","+this.item.label.fillColor._value.blue+","+this.item.label.fillColor._value.alpha+")",h=null==this.item.label.outlineColor?void 0:"rgba("+this.item.label.outlineColor._value.red+","+this.item.label.outlineColor._value.green+","+this.item.label.outlineColor._value.blue+","+this.item.label.outlineColor._value.alpha+")",d=null==this.item.label.outlineWidth?void 0:this.item.label.outlineWidth._value,m=this.item.label.distanceDisplayCondition,p=null==m?void 0:m._value.near,g=null==m?void 0:m._value.far,f=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"label",position:{x:this._cesium.Math.toDegrees(f.longitude),y:this._cesium.Math.toDegrees(f.latitude),z:this._cesium.Math.toDegrees(f.height)},treeobj:{name:this.treeobj.name},style:{show:e,text:t,font:i,style:r,scale:o,showBackground:n,backgroundColor:a,horizontalOrigin:s,verticalOrigin:l,heightReference:u,fillColor:c,outlineColor:h,outlineWidth:d,near:p,far:g}}},t.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(t.prototype,{position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=this._cesium.Math.toDegrees(t.longitude),r=this._cesium.Math.toDegrees(t.latitude),o=(this._cesium.Math.toDegrees(t.height),this._cesium.Cartesian3.fromDegrees(i,r,e));this.item.position.position=o,this._postion.Altitude=e}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e;var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=(this._cesium.Math.toDegrees(t.longitude),this._cesium.Math.toDegrees(t.latitude)),r=this._cesium.Math.toDegrees(t.height),o=this._cesium.Cartesian3.fromDegrees(e,i,r);this.item.position.position=o}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e;var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=this._cesium.Math.toDegrees(t.longitude),r=(this._cesium.Math.toDegrees(t.latitude),this._cesium.Math.toDegrees(t.height)),o=this._cesium.Cartesian3.fromDegrees(i,e,r);this.item.position.position=o}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e}catch(e){console.log(e)}}}},LabelStyle:{BackgroundColor:{set:e.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._Color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.backgroundColor=e,this.item.backgroundColor=e)},500),get:function(){var e=this.item.label.backgroundColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},Bold:{get:function(){return-1!=this.item._label.font.getValue().indexOf("bold")},set:function(){var e="bold "+this.item._label.font.getValue();this.item._label.font.setValue(e)}},FontName:{get:function(){for(var e=this.item._label.font.getValue().split(" "),t=0;t<e.length;t++)if("bold"!=e[t]&&-1==e[t].indexOf("px")&&-1==e[t].indexOf("PX"))return e[t]},set:function(e){for(var t=this.item._label.font.getValue().split(" "),i=e,r=0;r<t.length;r++)"bold"!=t[r]&&-1==t[r].indexOf("px")&&-1==t[r].indexOf("PX")||(i=i+" "+t[r]);this.item._label.font.setValue(i)}},FontSize:{get:function(){for(var e=this.item._label.font.getValue().split(" "),t=0;t<e.length;t++)if(-1!=e[t].indexOf("px"))return e[t]},set:function(e){for(var t=this.item._label.font.getValue().split(" "),i=e,r=0;r<t.length;r++)-1==t[r].indexOf("px")||(i=i+" "+t[r]);this.item._label.font.setValue(i)}},FrameFileName:{get:function(){return""},set:function(e){}},IconColor:{set:e.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._Color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.fillColor=e)},500),get:function(){var e=this.item.label.fillColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},Italic:{get:function(){for(var e=this.item._label.font.getValue().split(" "),t=0;t<e.length;t++)if(-1!=e[t].indexOf("italic"))return e[t]},set:function(e){for(var t=this.item._label.font.getValue().split(" "),i=e,r=0;r<t.length;r++)-1==t[r].indexOf("italic")||(i=i+" "+t[r]);this.item._label.font.setValue(i)}},LimitScreenSize:{get:function(){return""},set:function(e){}},LineColor:{set:e.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._Color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.outlineColor=e)},500),get:function(){var e=this.item.label.outlineColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},LineToGround:{get:function(){return""},set:function(e){}},LockMode:{get:function(){return""},set:function(e){}},MaxImageSize:{get:function(){return""},set:function(e){}},MaxViewingHeight:{get:function(){if(null!=this.item._label.distanceDisplayCondition)return this.item._label.distanceDisplayCondition._value.far},set:function(e){var t=0;null!=this.item._label.distanceDisplayCondition&&(t=this.item._label.distanceDisplayCondition._value.near),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(t,e)}},MinViewingHeight:{get:function(){if(null!=this.item._label.distanceDisplayCondition)return this.item._label.distanceDisplayCondition._value.near},set:function(e){var t=0;null!=this.item._label.distanceDisplayCondition&&(t=this.item._label.distanceDisplayCondition._value.far),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,t)}},MultilineJustification:{get:function(){return""},set:function(e){}},PivotAlignment:{get:function(){return""},set:function(e){}},Scale:{get:function(){if(null!=this.item._label.scale)return this.item.label.scale.getValue()},set:function(e){this.item.label.scale.setValue(e)}},TextAlignment:{get:function(){return""},set:function(e){}},TextColor:{get:function(){return""},set:function(e){}},TextOnImage:{get:function(){return""},set:function(e){}},Underline:{get:function(){return""},set:function(e){}}}}),t}),define("SGWorld/Analysis/Cdcl/Cdcl",[],function(){"use strict";return function(e,t,i,r){var o=Math.PI;function n(e){return e*o/180}var a,s,l,u,c=n((e+i)/2),h=n((e-i)/2),d=n((t-r)/2),m=Math.sin(h),p=Math.sin(d),g=Math.sin(c);return a=(m*=m)*(1-(p*=p))+(1-(g*=g))*p,s=(1-m)*(1-p)+g*p,2*(l=Math.atan(Math.sqrt(a/s)))*6378137*(1+1/298.257*((3*(u=Math.sqrt(a*s)/l)-1)/2/s*g*(1-m)-(3*u+1)/2/a*(1-g)*m))}}),define("SGWorld/Creator/Circle",["../Core/Core","./Color","../ProjectTree/treeSource","../Analysis/Cdcl/Cdcl","../Navigate/getPosition","../configData"],function(i,h,r,d,o,t){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._getPosition=new o(this._viewer,this._cesium),this._tree=r,this._postion={Altitude:0,AltitudeType:0,Cartesian:!0,Distance:0,Pitch:0,Roll:0,X:0,Y:0,Yaw:0},this.positions=[],this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.style=null,this.state=0,this.gonCircleArr=[],this.radius=0}return e.prototype.createCircle=function(e,t,i,r){var o={id:this._core.getuid(),semiMinorAxis:3e5,semiMajorAxis:3e5,height:2e5,material:this._cesium.Color.GREEN,outline:!0},n=this._Core.extend(o,t,!0);this.item=this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),name:i,ellipse:n});var a={id:this.item.id,name:i,pId:this._core.isnull(r)?0:r,type:"circle",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(r)?0:r),greenCircle},e.prototype.getstyles=function(){var e={};return e.show=!this.item.ellipse.show||this.item.ellipse.show._value,e.height=this.item.ellipse.height&&this.item.ellipse.height._value?this.item.ellipse.height._value:void 0,e.semiMajorAxis=this.item.ellipse.semiMajorAxis&&this.item.ellipse.semiMajorAxis.getValue()?this.item.ellipse.semiMajorAxis.getValue():void 0,e.semiMinorAxis=this.item.ellipse.semiMinorAxis&&this.item.ellipse.semiMinorAxis.getValue()?this.item.ellipse.semiMinorAxis.getValue():void 0,e.heightReference=this.item.ellipse.heightReference&&this.item.ellipse.heightReference._value?this.item.ellipse.heightReference._value:void 0,e.extrudedHeight=this.item.ellipse.extrudedHeight&&this.item.ellipse.extrudedHeight.getValue()?this.item.ellipse.extrudedHeight.getValue():void 0,e.extrudedHeightReference=this.item.ellipse.extrudedHeightReference&&this.item.ellipse.extrudedHeightReference._value?this.item.ellipse.extrudedHeightReference._value:void 0,e.rotation=this.item.ellipse.rotation&&this.item.ellipse.rotation._value?this.item.ellipse.rotation._value:void 0,e.stRotation=this.item.ellipse.stRotation&&this.item.ellipse.stRotation._value?this.item.ellipse.stRotation._value:void 0,e.granularity=this.item.ellipse.granularity&&this.item.ellipse.granularity._value?this.item.ellipse.granularity._value:void 0,e.fill=this.item.ellipse.fill?this.item.ellipse.fill._value:void 0,e.material={},e.material.color=this.item.ellipse.material&&this.item.ellipse.material.color&&this.item.ellipse.material.color._value?"rgba"+this.item.ellipse.material.color.toString():void 0,e.material.image=this.item.ellipse.material&&this.item.ellipse.material.image?this.item.ellipse.material.image._value:void 0,e.material.repeat=this.item.ellipse.material&&this.item.ellipse.material.repeat._value?this.item.ellipse.material.repeat._value:void 0,e.outline=this.item.ellipse.outline?this.item.ellipse.outline._value:void 0,e.outlineWidth=this.item.ellipse.outlineWidth&&this.item.ellipse.outlineWidth._value?this.item.ellipse.outlineWidth._value:void 0,e.outlineColor=this.item.ellipse.outlineColor&&this.item.ellipse.outlineColor._value?"rgba"+this.item.ellipse.outlineColor.toString():void 0,e.numberOfVerticalLines=this.item.ellipse.numberOfVerticalLines&&this.item.ellipse.numberOfVerticalLines._value?this.item.ellipse.numberOfVerticalLines._value:void 0,e.classificationType=this.item.ellipse.classificationType&&this.item.ellipse.classificationType._value?this.item.ellipse.classificationType._value:void 0,e.near=this.item.ellipse.distanceDisplayCondition?this.item.ellipse.distanceDisplayCondition._value.near:void 0,e.far=this.item.ellipse.distanceDisplayCondition?this.item.ellipse.distanceDisplayCondition._value.far:void 0,e.position=this.item.position.getValue().toString(),e},e.prototype.createCircleOptimization=function(e,t){this.style=e;var l=this;this.handler.setInputAction(function(e){var t=l.getCatesian3FromPX(e.position,l._viewer,[l.circle]);0==l.positions.length&&l.positions.push(t.clone()),l.positions.push(t);var i=l.createPoint(t,!1);0<l.gonCircleArr.length&&(l.positions.pop(),l.state=1,l.handler.destroy()),i.wz=l.gonCircleArr.length,l.gonCircleArr.push(i)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){if(!(l.positions.length<1)){var t=l.getCatesian3FromPX(e.endPosition,l._viewer,[l.circle]);if(2==l.positions.length&&!l._cesium.defined(l.circle)){var i=l._cesium.Cartographic.fromCartesian(l.positions[0]),r=l._cesium.Math.toDegrees(i.longitude),o=l._cesium.Math.toDegrees(i.latitude),n=l._cesium.Cartographic.fromCartesian(l.positions[1]),a=l._cesium.Math.toDegrees(n.longitude),s=l._cesium.Math.toDegrees(n.latitude);l.radius=d(o,r,s,a),l.circle=l.createCircle(l.style),l._core.Entityadd(l),l.circle.objId=l.objId}if(l.circle){l.positions.pop(),l.positions.push(t);i=l._cesium.Cartographic.fromCartesian(l.positions[0]),r=l._cesium.Math.toDegrees(i.longitude),o=l._cesium.Math.toDegrees(i.latitude),n=l._cesium.Cartographic.fromCartesian(l.positions[1]),a=l._cesium.Math.toDegrees(n.longitude),s=l._cesium.Math.toDegrees(n.latitude);l.radius=d(o,r,s,a)}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE)},e.prototype.startModify=function(){var u="拖动修改位置";if(2==this.state||1==this.state){this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas));for(var c=this,e=0;e<c.gonCircleArr.length;e++){var t=c.gonCircleArr[e];t&&(t.show=!0)}this.modifyHandler.setInputAction(function(e){var t=c._viewer.scene.pick(e.position);if(Cesium.defined(t)&&t.id)t.id.objId||(c.modifyPoint=t.id,u="释放后完成修改"),c.forbidDrawWorld(!0);else{for(var i=0;i<c.gonCircleArr.length;i++){var r=c.gonCircleArr[i];r&&(r.show=!1)}c.modifyHandler&&(c.modifyHandler.destroy(),c.modifyHandler=null)}c.state=2},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){var t=c._viewer.scene.pick(e.endPosition);if(c._core.CreateTooltip(u,e.endPosition,!1),Cesium.defined(t)&&t.id&&(t.id.objId||c._core.CreateTooltip(u,e.endPosition,!0)),!(c.positions.length<1)&&c.modifyPoint){var i=c.getCatesian3FromPX(e.endPosition,c._viewer,[c.circle,c.modifyPoint]);if(i)if(c.modifyPoint.position.setValue(i),c.positions[c.modifyPoint.wz]=i,0==c.modifyPoint.wz)c.gonCircleArr[1].position={x:c.positions[0].x+c.radius,y:c.positions[0].y,z:c.positions[0].z};else{var r=c._cesium.Cartographic.fromCartesian(c.positions[0]),o=c._cesium.Math.toDegrees(r.longitude),n=c._cesium.Math.toDegrees(r.latitude),a=c._cesium.Cartographic.fromCartesian(c.positions[c.modifyPoint.wz]),s=c._cesium.Math.toDegrees(a.longitude),l=c._cesium.Math.toDegrees(a.latitude);c.radius=d(n,o,l,s)}c._core.CreateTooltip(u,e.endPosition,!0)}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){if(c.modifyPoint){var t=c.getCatesian3FromPX(e.position,c._viewer,[c.circle,c.modifyPoint]);if(c.modifyPoint.position.setValue(t),c.positions[c.modifyPoint.wz]=t,0==c.modifyPoint.wz)c.gonCircleArr[1].position={x:c.positions[0].x+c.radius,y:c.positions[0].y,z:c.positions[0].z};else{var i=c._cesium.Cartographic.fromCartesian(c.positions[0]),r=c._cesium.Math.toDegrees(i.longitude),o=c._cesium.Math.toDegrees(i.latitude),n=c._cesium.Cartographic.fromCartesian(c.positions[c.modifyPoint.wz]),a=c._cesium.Math.toDegrees(n.longitude),s=c._cesium.Math.toDegrees(n.latitude);c.radius=d(o,r,s,a)}c.modifyPoint=null,c.forbidDrawWorld(!1),u="拖动修改位置"}},Cesium.ScreenSpaceEventType.LEFT_UP)}},e.prototype.forbidDrawWorld=function(e){this._viewer.scene.screenSpaceCameraController.enableRotate=!e,this._viewer.scene.screenSpaceCameraController.enableTilt=!e,this._viewer.scene.screenSpaceCameraController.enableTranslate=!e,this._viewer.scene.screenSpaceCameraController.enableInputs=!e},e.prototype.getCatesian3FromPX=function(e,t,i){var r,o=t.scene.pick(e),n=t.scene.drillPick(e),a=null;if(i){for(var s=0;s<n.length;s++)if(n[s].id._id!=i[0].id&&n[s].id._id!=i[1].id){a=n[s].id;break}}else a=o;if(t.scene.pickPositionSupported&&Cesium.defined(a))r=t.scene.pickPosition(e);else{var l=t.camera.getPickRay(e);if(!l)return;r=t.scene.globe.pick(l,t.scene)}return r},e.prototype.createCircle=function(e){var t=this;return this._viewer.entities.add({position:new t._cesium.CallbackProperty(function(){return t.positions[0]},!1),ellipse:{semiMinorAxis:new t._cesium.CallbackProperty(function(){return t.radius},!1),semiMajorAxis:new t._cesium.CallbackProperty(function(){return t.radius},!1),material:t._cesium.Color.BLUE.withAlpha(.5),outline:e.outline||!0}})},e.prototype.createPoint=function(e,t){if(e)return this._viewer.entities.add({position:e,point:{pixelSize:10,color:this._cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},e.prototype.executeClircle=function(e){var s=[],l=this;this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+t.draw);var u=new this._cesium.ScreenSpaceEventHandler(l._viewer.scene.canvas);function c(){return d(s[0].lat,s[0].lon,s[1].lat,s[1].lon)}return u.setInputAction(function(e){var t=l._getPosition.getMousePosition(e,[l.item]);if(t){var i=l._cesium.Cartographic.fromCartesian(t),r=l._cesium.Math.toDegrees(i.longitude),o=l._cesium.Math.toDegrees(i.latitude);if(s.push({lon:r,lat:o}),1==s.length){s.push({lon:r,lat:o});var n=l._viewer.entities.add({position:l._cesium.Cartesian3.fromDegrees(s[0].lon,s[0].lat),ellipse:{semiMinorAxis:0,semiMajorAxis:0,material:l._cesium.Color.fromRandom({alpha:.8})}});n.ellipse.semiMinorAxis=new l._cesium.CallbackProperty(c,!1),n.ellipse.semiMajorAxis=new l._cesium.CallbackProperty(c,!1),l.item=n}else{var a=c();l._core.mouse(l._viewer.container,0,"0"),l.item.ellipse.semiMinorAxis=a,l.item.ellipse.semiMajorAxis=a,u.destroy(),u=void 0,s=[]}}},l._cesium.ScreenSpaceEventType.LEFT_CLICK),u.setInputAction(function(e){if(s.length){var t=l._getPosition.getMousePosition(e,[l.item]);if(t){var i=l._cesium.Cartographic.fromCartesian(t),r=l._cesium.Math.toDegrees(i.longitude),o=l._cesium.Math.toDegrees(i.latitude);s[1]={lon:r,lat:o}}}},l._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},e.prototype.executeClirclews=function(e){var n=this;this._cesium.Material.fromType(this._cesium.Material.ColorType).uniforms.color=new this._cesium.Color(1,1,0,.5);var r=this._cesium.Ellipsoid.WGS84,i=this,o=this._viewer.scene,a=this._viewer.scene.primitives,s=null,t=new this._cesium.ScreenSpaceEventHandler(o.canvas);t.setInputAction(function(e){if(null!=e.position){var t=o.camera.pickEllipsoid(e.position,r);t&&(null==s?(s=new l({center:t,radius:0,asynchronous:!1,material:n._cesium.Color.RED}),a.add(s)):i.stopDrawing())}},n._cesium.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(function(e){var t=e.endPosition;if(null!=t)if(null==s);else{var i=o.camera.pickEllipsoid(t,r);i&&s.setRadius(n._cesium.Cartesian3.distance(s.getCenter(),i))}},n._cesium.ScreenSpaceEventType.MOUSE_MOVE);var l=function(){function e(e){if(!n._cesium.defined(e.center)||!n._cesium.defined(e.radius))throw new n._cesium.DeveloperError("Center and radius are required");e=copyOptions(e,defaultSurfaceOptions),this.initialiseOptions(e),this.setRadius(e.radius)}return(e.prototype=new u).setCenter=function(e){this.setAttribute("center",e)},e.prototype.setRadius=function(e){this.setAttribute("radius",Math.max(.1,e))},e.prototype.getCenter=function(){return this.getAttribute("center")},e.prototype.getRadius=function(){return this.getAttribute("radius")},e.prototype.getGeometry=function(){if(n._cesium.defined(this.center)&&n._cesium.defined(this.radius))return new n._cesium.CircleGeometry({center:this.center,radius:this.radius,height:this.height,vertexFormat:n._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},e.prototype.getOutlineGeometry=function(){return new n._cesium.CircleOutlineGeometry({center:this.getCenter(),radius:this.getRadius()})},e},u=function(){function e(){}return e.prototype.initialiseOptions=function(e){fillOptions(this,e),this._ellipsoid=void 0,this._granularity=void 0,this._height=void 0,this._textureRotationAngle=void 0,this._id=void 0,this._createPrimitive=!0,this._primitive=void 0,this._outlinePolygon=void 0},e.prototype.setAttribute=function(e,t){this[e]=t,this._createPrimitive=!0},e.prototype.getAttribute=function(e){return this[e]},e.prototype.update=function(e,t,i){if(!n._cesium.defined(this.ellipsoid))throw new n._cesium.DeveloperError("this.ellipsoid must be defined.");if(!n._cesium.defined(this.appearance))throw new n._cesium.DeveloperError("this.material must be defined.");if(this.granularity<0)throw new n._cesium.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(this.show&&(this._createPrimitive||n._cesium.defined(this._primitive))){if(this._createPrimitive||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){var r=this.getGeometry();if(!r)return;this._createPrimitive=!1,this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id,this._primitive=this._primitive&&this._primitive.destroy(),this._primitive=new n._cesium.Primitive({geometryInstances:new n._cesium.GeometryInstance({geometry:r,id:this.id,pickPrimitive:this}),appearance:this.appearance,asynchronous:this.asynchronous}),this._outlinePolygon=this._outlinePolygon&&this._outlinePolygon.destroy(),this.strokeColor&&this.getOutlineGeometry&&(this._outlinePolygon=new n._cesium.Primitive({geometryInstances:new n._cesium.GeometryInstance({geometry:this.getOutlineGeometry(),attributes:{color:n._cesium.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)}}),appearance:new n._cesium.PerInstanceColorAppearance({flat:!0,renderState:{depthTest:{enabled:!0},lineWidth:Math.min(this.strokeWidth)}})}))}var o=this._primitive;o.appearance.material=this.material,o.debugShowBoundingVolume=this.debugShowBoundingVolume,o.update(e,t,i),this._outlinePolygon&&this._outlinePolygon.update(e,t,i)}},e.prototype.isDestroyed=function(){return!1},e.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),n._cesium.destroyObject(this)},e.prototype.setStrokeStyle=function(e,t){this.strokeColor&&this.strokeColor.equals(e)&&this.strokeWidth==t||(this._createPrimitive=!0,this.strokeColor=e,this.strokeWidth=t)},e}()},e.prototype.setSemiMajorAxis=function(e){try{this.item._ellipse.semiMajorAxis=e}catch(e){console.log(e)}return this},e.prototype.setSemiMinorAxis=function(e){try{this.item._ellipse.semiMinorAxis=e}catch(e){console.log(e)}return this},e.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show._value,t=null==this.item.ellipse.semiMajorAxis?void 0:this.item.ellipse.semiMajorAxis._value,i=null==this.item.ellipse.semiMinorAxis?void 0:this.item.ellipse.semiMinorAxis._value,r=null==this.item.ellipse.height?void 0:this.item.ellipse.height._value,o=null==this.item.ellipse.extrudedHeight?void 0:this.item.ellipse.extrudedHeight._value,n=null==this.item.ellipse.rotation?void 0:this.item.ellipse.rotation._value,a=null==this.item.ellipse.stRotation?void 0:this.item.ellipse.stRotation._value,s=null==this.item.ellipse.fill?void 0:this.item.ellipse.fill._value,l=this.item.ellipse.material;null!=l&&(l={color:null==l.color?void 0:"rgba("+l.color._value.red+","+l.color._value.green+","+l.color._value.blue+","+l.color._value.alpha+")",image:null==l.image?void 0:l.image._value,diffusemap:null==l.diffusemap?void 0:l.diffusemap._value,alphamap:null==l.alphamap?void 0:l.alphamap._value});var u=null==this.item.ellipse.outline?void 0:this.item.ellipse.outline._value,c=null==this.item.ellipse.outlineColor?void 0:"rgba("+this.item.ellipse.outlineColor._value.red+","+this.item.ellipse.outlineColor._value.green+","+this.item.ellipse.outlineColor._value.blue+","+this.item.ellipse.outlineColor._value.alpha+")",h=null==this.item.ellipse.outlineWidth?void 0:this.item.ellipse.outlineWidth._value,d=null==this.item.ellipse.numberOfVerticalLines?void 0:this.item.ellipse.numberOfVerticalLines._value,m=this.item.ellipse.distanceDisplayCondition,p=null==m?void 0:m._value.near,g=null==m?void 0:m._value.far,f=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"circle",position:{x:this._cesium.Math.toDegrees(f.longitude),y:this._cesium.Math.toDegrees(f.latitude),z:r=this._cesium.Math.toDegrees(f.height)},treeobj:{name:this.treeobj.name},style:{show:e,semiMajorAxis:t,semiMinorAxis:i,height:r,extrudedHeight:o,rotation:n,stRotation:a,fill:s,material:l,outline:u,outlineColor:c,outlineWidth:h,numberOfVerticalLines:d,near:p,far:g}}},e.prototype.setTreeobj=function(e){this.treeobj=e},e.prototype.setHeight=function(e){try{this.item._ellipse.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND,this.item._ellipse.height=e}catch(e){console.log(e)}return this},e.prototype.setHeightType=function(e){try{1==e?this.item._ellipse.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._ellipse.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._ellipse.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},e.prototype.setDistanceDisplayCondition=function(e,t){var i=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._ellipse.distanceDisplayCondition=i}catch(e){console.log(e)}return this},e.prototype.setEllipseImage=function(e){try{this.item._ellipse.material.uniforms.image=e}catch(e){console.log(e)}return this},e.prototype.setOutlineColor=function(e){try{this.item._ellipse.outlineWidth=5,this.item._ellipse.outlineColor=new h(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},e.prototype.setMaterial=function(e){try{this.item._ellipse.material.color=new h(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},e.prototype.setMaterialAlpha=function(e){try{this.item._ellipse.material.color._value.alpha=e,this.item._ellipse.show=!0}catch(e){console.log(e)}return this},e.prototype.setItem=function(e){this.item=e},e.prototype.setExtrudedHeight=function(e){try{this.item._ellipse.extrudedHeight=e}catch(e){console.log(e)}return this},e.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},e.prototype.CreateCircle=function(e,t,i,r,o,n){this._postion=e;var a,s={semiMinorAxis:this._cesium.defaultValue(t,3e5),semiMajorAxis:this._cesium.defaultValue(t,3e5),material:this._cesium.Color.YELLOW,outline:!0,outlineColor:this._cesium.Color.WHITE};i&&""!==i&&(s.outlineColor=new h(this._viewer,this._cesium).colorFromHtmlColor(i)),r&&""!==r&&(s.material=new h(this._viewer,this._cesium).colorFromHtmlColor(r)),(e.Yaw||e.Pitch||e.Roll)&&(a=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw),this._cesium.Math.toRadians(e.Pitch),this._cesium.Math.toRadians(e.Roll)))),this.item=this._viewer.entities.add({name:n,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),ellipse:s,orientation:a});var l={id:this.item.id,name:n,pId:this._core.isnull(o)?0:o,type:"circle",item:this};return this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(o)?0:o),this},e.prototype.CreateEllipse=function(e,t,i,r,o,n,a,s){this._postion=e;var l,u={semiMinorAxis:this._cesium.defaultValue(t,3e5),semiMajorAxis:this._cesium.defaultValue(i,1e5),numberOfVerticalLines:this._cesium.defaultValue(n,16),material:this._cesium.Color.YELLOW,outline:!0,outlineColor:this._cesium.Color.WHITE};r&&""!==r&&(u.outlineColor=new h(this._viewer,this._cesium).colorFromHtmlColor(r)),o&&""!==o&&(u.material=new h(this._viewer,this._cesium).colorFromHtmlColor(o)),(e.Yaw||e.Pitch||e.Roll)&&(l=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw),this._cesium.Math.toRadians(e.Pitch),this._cesium.Math.toRadians(e.Roll)))),this.item=this._viewer.entities.add({name:s,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),ellipse:u,orientation:l});var c={id:this.item.id,name:s,pId:this._core.isnull(a)?0:a,type:"ellipse",item:this};return this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(a)?0:a),this},Object.defineProperties(e.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{this._postion.Altitude=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}}}}),e}),define("SGWorld/Creator/Box",["../Core/Core","./Color","../ProjectTree/treeSource"],function(i,h,v){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=v}return e.prototype.createBox=function(e,t,i,r){var o={id:this._core.getuid(),dimensions:new this._cesium.Cartesian3(4e5,3e5,5e5),material:this._cesium.Color.RED.withAlpha(.5),fill:!0,outline:!0,outlineColor:this._cesium.Color.BLACK},n=this._core.extend(o,t,!0);this.item=this._viewer.entities.add({name:i,position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),box:n});var a={id:this.item.id,name:i,pId:this._core.isnull(r)?0:r,type:"box",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(r)?0:r),this},e.prototype.getstyles=function(){var e={};return e.show=!this.item.box.show||this.item.box.show._value,e.heightReference=this.item.box.heightReference?this.item.box.heightReference:void 0,e.fill=this.item.box.fill&&this.item.box.fill._value?this.item.box.fill._value:void 0,e.dimensions=this.item.box.dimensions?this.item.box.dimensions.getValue():void 0,e.shadows=this.item.box.shadows&&this.item.box.shadows._value?this.item.box.shadows._value:void 0,e.material={},e.material.color=this.item.box.material&&this.item.box.material.color._value?"rgba"+this.item.box.material.color.toString():void 0,e.material.image=this.item.box.material&&this.item.box.material.image._value?this.item.box.material.image._value:void 0,e.material.repeat=this.item.box.material&&this.item.box.material.repeat?this.item.box.material.repeat._value:void 0,e.outline=this.item.box.outline&&this.item.box.outline._value?this.item.box.outline._value:void 0,e.outlineColor=this.item.box.outlineColor&&this.item.box.outlineColor._value?"rgba"+this.item.box.outlineColor.toString():void 0,e.outlineWidth=this.item.box.outlineWidth&&this.item.box.outlineWidth._value?this.item.box.outlineWidth._value:void 0,e.near=this.item.box.distanceDisplayCondition?this.item.box.distanceDisplayCondition._value.near:void 0,e.far=this.item.box.distanceDisplayCondition?this.item.box.distanceDisplayCondition._value.far:void 0,e.position=this.item.position.getValue().toString(),e},e.prototype.executeBox=function(l){var u=this;u.shape={tempPoints:[],button:0,position:{}};var c=new this._cesium.ScreenSpaceEventHandler(u._viewer.scene.canvas),h=[];return c.setInputAction(function(e){var t=u._viewer.scene.camera.pickEllipsoid(e.position,u._viewer.scene.globe.ellipsoid),i=u._cesium.Cartographic.fromCartesian(t),r=u._cesium.Math.toDegrees(i.longitude),o=u._cesium.Math.toDegrees(i.latitude);h.push({lon:r,lat:o}),0==u.shape.button&&(u.box=u._viewer.entities.add({name:"",position:u._cesium.Cartesian3.fromDegrees(h[0].lon,h[0].lat),box:{id:u._core.getuid(),dimensions:new u._cesium.Cartesian3(4e5,3e5,5e5),material:u._cesium.Color.RED.withAlpha(.5),fill:!0,outline:!0,outlineColor:u._cesium.Color.RED}}),u.item=u.box);var n=0;u._core.isnull(v.selectedItem)||"group"!=v.selectedItem.type||(n=v.selectedItem.id);var a=u._core.getuid(),s={id:a,name:"新建立方体"+a,pId:u._core.isnull(n)?0:n,type:"box",item:u};u.setTreeobj(s),u._tree.insertGroupId(s,u._core.isnull(n)?0:n),"function"==typeof l&&l({polyline:{},positions:[],distance:[]}),c.destroy()},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this},e.prototype.executeExcavation=function(d,m){var p=this;p.shape={tempPoints:[],button:0,position:{}};var g=new this._cesium.ScreenSpaceEventHandler(p._viewer.scene.canvas),f=[];return g.setInputAction(function(e){var t=p._viewer.scene.camera.pickEllipsoid(e.position,p._viewer.scene.globe.ellipsoid),i=p._cesium.Cartographic.fromCartesian(t),r=p._cesium.Math.toDegrees(i.longitude),o=p._cesium.Math.toDegrees(i.latitude);f.push({lon:r,lat:o});var n=-d.z/2;if(0==p.shape.button){p.box=p._viewer.entities.add({name:"",position:p._cesium.Cartesian3.fromDegrees(f[0].lon,f[0].lat,n),box:{id:p._core.getuid(),dimensions:new p._cesium.Cartesian3(d.x,d.y,d.z),material:p._cesium.Color.WHITE.withAlpha(.5),outline:!0,outlineColor:p._cesium.Color.WHITE}}),p.item=p.box;var a=p._viewer.scene.globe,s=-d.x/2,l=-d.y/2;a.depthTestAgainstTerrain=!0,a.clippingPlanes=new p._cesium.ClippingPlaneCollection({modelMatrix:p.box.computeModelMatrix(p._cesium.JulianDate.now()),planes:[new p._cesium.Plane(new p._cesium.Cartesian3(1,0,0),s),new p._cesium.Plane(new p._cesium.Cartesian3(-1,0,0),s),new p._cesium.Plane(new p._cesium.Cartesian3(0,1,0),l),new p._cesium.Plane(new p._cesium.Cartesian3(0,-1,0),l)],edgeWidth:1,edgeColor:p._cesium.Color.WHITE})}var u=0;p._core.isnull(v.selectedItem)||"group"!=v.selectedItem.type||(u=v.selectedItem.id);var c=p._core.getuid(),h={id:c,name:"新建立方体"+c,pId:p._core.isnull(u)?0:u,type:"box",item:p};p.setTreeobj(h),v.insertGroupId(h,p._core.isnull(u)?0:u),"function"==typeof m&&m({polyline:{},positions:[],distance:[]}),g.destroy()},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this},e.prototype.executeBox1=function(e){var t,o=this,n=this,a=[];o.shape={points:[],button:0,rect:null,entity:null};var i=new this._cesium.ScreenSpaceEventHandler(n._viewer.scene.canvas);return i.setInputAction(function(e){t=n._core.getPointFromWindowPoint(e.position,n._viewer),2<=o.shape.button&&(i.removeInputAction(n._cesium.ScreenSpaceEventType.MOUSE_MOVE),i.removeInputAction(n._cesium.ScreenSpaceEventType.LEFT_CLICK)),o.shape.button=o.shape.button+1,t&&(0==o.shape.points.length?(a.push(t),o.shape.points.push(n._viewer.scene.globe.ellipsoid.cartesianToCartographic(t)),o.shape.rect=n._cesium.Rectangle.fromCartographicArray(o.shape.points),o.shape.rect.east+=1e-6,o.shape.rect.north+=1e-6,o.shape.entity=n._viewer.entities.add({rectangle:{coordinates:o.shape.rect,material:n._cesium.Color.BLACK.withAlpha(.4),outline:!0,outlineWidth:2,outlineColor:n._cesium.Color.RED,height:0}}),o.bufferEntity=o.shape.entity):2==o.shape.points.length||(i.removeInputAction(n._cesium.ScreenSpaceEventType.MOUSE_MOVE),i.removeInputAction(n._cesium.ScreenSpaceEventType.LEFT_CLICK)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),i.setInputAction(function(e){if(0!=o.shape.points.length){var t=n._core.getPointFromWindowPoint(e.endPosition,n._viewer);if(t){var i=n._viewer.camera.getPickRay(e.endPosition),r=n._viewer.scene.globe.pick(i,n._viewer.scene);a[1]=t,o.shape.points[1]=n._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),o.shape.rect=n._cesium.Rectangle.fromCartographicArray(o.shape.points),2==o.shape.button?o.shape.entity.rectangle.extrudedHeight=r.z:(o.shape.rect.west==o.shape.rect.east&&(o.shape.rect.east+=1e-6),o.shape.rect.south==o.shape.rect.north&&(o.shape.rect.north+=1e-6),o.shape.entity.rectangle.coordinates=o.shape.rect)}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},e.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show._value,t=null==this.item.box.dimensions?void 0:this.item.box.dimensions.getValue(),i=null==this.item.box.fill?void 0:this.item.box.fill._value,r=this.item.box.material;null!=r&&(r={color:null==r.color._value?void 0:"rgba("+r.color._value.red+","+r.color._value.green+","+r.color._value.blue+","+r.color._value.alpha+")",image:null==r.image?void 0:r.image._value,diffusemap:null==r.diffusemap?void 0:r.diffusemap._value,alphamap:null==r.alphamap?void 0:r.alphamap._value});var o=null==this.item.box.outline?void 0:this.item.box.outline._value,n=null==this.item.box.outlineColor?void 0:"rgba("+this.item.box.outlineColor._value.red+","+this.item.box.outlineColor._value.green+","+this.item.box.outlineColor._value.blue+","+this.item.box.outlineColor._value.alpha+")",a=null==this.item.box.outlineWidth?void 0:this.item.box.outlineWidth._value,s=this.item.box.distanceDisplayCondition,l=null==s?void 0:s._value.near,u=null==s?void 0:s._value.far,c=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"box",position:{x:this._cesium.Math.toDegrees(c.longitude),y:this._cesium.Math.toDegrees(c.latitude),z:this._cesium.Math.toDegrees(c.height)},treeobj:{name:this.treeobj.name},style:{show:e,dimensions:t,fill:i,material:r,outline:o,outlineColor:n,outlineWidth:a,near:l,far:u}}},e.prototype.setTreeobj=function(e){this.treeobj=e},e.prototype.setVisibility=function(e){this.item.show=e},e.prototype.setShow=function(e){try{this.item._box.show=e}catch(e){console.log(e)}return this},e.prototype.getVolume=function(){try{var e=this.item._box.dimensions._value,t=e.x*e.y*e.z}catch(e){console.log(e)}return t},e.prototype.setBoxImage=function(e){try{this.item._box.material=new this._cesium.ImageMaterialProperty({image:e})}catch(e){console.log(e)}return this},e.prototype.setBoxRepeat=function(e,t){try{this.item._box.material.repeat=new this._cesium.Cartesian2(e,t)}catch(e){console.log(e)}return this},e.prototype.setHeightType=function(e){try{1==e?this.item._box.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._box.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._box.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},e.prototype.setDistanceDisplayCondition=function(e,t){var i=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._box.distanceDisplayCondition=i}catch(e){console.log(e)}return this},e.prototype.setFill=function(e){try{this.item._box.fill=e}catch(e){console.log(e)}return this},e.prototype.setMaterialAlpha=function(e){try{this.item._box.material.color._value.alpha=e,this.item._box.show=!0}catch(e){console.log(e)}return this},e.prototype.setOutlineColor=function(e){try{this.item._box.outlineColor=new h(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},e.prototype.setMaterial=function(e){try{this.item._box.material.color=new h(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},e.prototype.setItem=function(e){this.item=e},e.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},Object.defineProperties(e.prototype,{ColorAlpha:{get:function(){return this.item._box.color._value.alpha}},Scale:{get:function(){return this.item._box.scale}},Rotation:{get:function(){return this.item._box.rotation}},Width:{get:function(){return this.item._box.width}},Height:{get:function(){return this.item._box.heightReference}},Color:{get:function(){return this._color.toHtmlColor("rgb("+255*this.item._box.backgroundColor._value.red+","+255*this.item._box.backgroundColor._value.green+","+255*this.item._box.backgroundColor._value.blue+","+255*this.item._box.backgroundColor._value.alpha+")")}}}),e.prototype.CreateBox=function(e,t,i,r,o,n,a,s){this._postion=e;var l,u={dimensions:new this._cesium.Cartesian3(r,t,i),material:this._cesium.Color.YELLOW,outline:!0,outlineColor:this._cesium.Color.RED};o&&""!==o&&(u.outlineColor=new h(this._viewer,this._cesium).colorFromHtmlColor(o)),n&&""!==n&&(u.material=new h(this._viewer,this._cesium).colorFromHtmlColor(n)),(e.Yaw||e.Pitch||e.Roll)&&(l=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw),this._cesium.Math.toRadians(e.Pitch),this._cesium.Math.toRadians(e.Roll)))),this.item=this._viewer.entities.add({name:s,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),box:u,orientation:l});var c={id:this.item.id,name:s,pId:this._core.isnull(a)?0:a,type:"box",item:this};return this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(a)?0:a),this},Object.defineProperties(e.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{this._postion.Altitude=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}}}}),e}),define("SGWorld/Creator/Cone",["../Core/Core","./Color","../ProjectTree/treeSource","../Analysis/Cdcl/Cdcl"],function(i,h,p,E){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=p,this.positions=[],this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.style=null,this.state=0,this.gonCircleArr=[],this.gonPointStretchingArr=[],this.topRadius=0,this.bottomRadius=0,this.length=50}return e.prototype.createCone=function(e,t,i,r){var o={length:4e5,topRadius:0,bottomRadius:2e5,material:this._cesium.Color.GREEN},n=this._core.extend(o,t,!0);this.item=this._viewer.entities.add({name:i,position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[1]),cylinder:n});var a={id:this.item.id,name:i,pId:this._core.isnull(r)?0:r,type:"cylinder",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(r)?0:r),this},e.prototype.getstyles=function(){var e={};return e.show=!this.item.cylinder.show||this.item.cylinder.show._value,e.length=this.item.cylinder.length?this.item.cylinder.length.getValue():void 0,e.topRadius=this.item.cylinder.topRadius?this.item.cylinder.topRadius.getValue():void 0,e.bottomRadius=this.item.cylinder.bottomRadius?this.item.cylinder.bottomRadius.getValue():void 0,e.heightReference=this.item.cylinder.heightReference&&this.item.cylinder.heightReference._value?this.item.cylinder.heightReference._value:void 0,e.fill=this.item.cylinder.fill&&this.item.cylinder.fill._value?this.item.cylinder.fill._value:void 0,e.material={},e.material.color=this.item.cylinder.material&&this.item.cylinder.material.color&&this.item.cylinder.material.color._value?"rgba"+this.item.cylinder.material.color.toString():void 0,e.material.image=this.item.cylinder.material&&this.item.cylinder.material.image&&this.item.cylinder.material.image._value?this.item.cylinder.material.image._value:void 0,e.material.repeat=this.item.cylinder.material&&this.item.cylinder.material.repeat&&this.item.cylinder.material.repeat._value?this.item.cylinder.material.repeat._value:void 0,e.outline=this.item.cylinder.outline?this.item.cylinder.outline._value:void 0,e.outlineWidth=this.item.cylinder.outlineWidth&&this.item.cylinder.outlineWidth._value?this.item.cylinder.outlineWidth._value:void 0,e.outlineColor=this.item.cylinder.outlineColor&&this.item.cylinder.outlineColor&&this.item.cylinder.outlineColor._value?"rgba"+this.item.cylinder.outlineColor.toString():void 0,e.near=this.item.cylinder.distanceDisplayCondition?this.item.cylinder.distanceDisplayCondition._value.near:void 0,e.far=this.item.cylinder.distanceDisplayCondition?this.item.cylinder.distanceDisplayCondition._value.far:void 0,e.position=this.item.position.getValue().toString(),e},e.prototype.createRectangularSensor=function(e,t,i,r){var o=this;!t&&(t={});var n=this._core.defaultValue(t.radius,100),a={radii:new this._cesium.Cartesian3(n,n,n),maximumCone:this._cesium.Math.toRadians(90),material:this._cesium.Color.AQUAMARINE.withAlpha(.3),outline:!0,outlineColor:this._cesium.Color.AQUAMARINE.withAlpha(.5),outlineWidth:1},s=this._core.extend(a,t,!0);"string"==typeof t.color&&(s.material=this._cesium.Color.fromCssColorString(t.color)),"string"==typeof t.outlineColor&&(s.outlineColor=this._cesium.Color.fromCssColorString(t.outlineColor));var l=0,u=this.calcPoints(e[0],e[1],e[2],n,l);this.wall=[];var c=this._viewer.entities.add({polygon:{hierarchy:new this._cesium.CallbackProperty(function(){return new o._cesium.PolygonHierarchy(o._cesium.Cartesian3.fromDegreesArrayHeights(u))},!1),perPositionHeight:!0,material:this._core.defaultValue(t.wallColor&&this._cesium.Color.fromCssColorString(t.wallColor),this._cesium.Color.AQUAMARINE.withAlpha(.5)),outline:!0,outlineColor:this._core.defaultValue(t.wallOutlineColor&&this._cesium.Color.fromCssColorString(t.wallOutlineColor),this._cesium.Color.RED.withAlpha(.5))}});if(this.wall.push(c),s.angle){var h=this.calcPoints(e[0],e[1],e[2],n,l+s.angle),d=this._viewer.entities.add({polygon:{hierarchy:new this._cesium.CallbackProperty(function(){return new o._cesium.PolygonHierarchy(o._cesium.Cartesian3.fromDegreesArrayHeights(h))},!1),perPositionHeight:!0,material:this._core.defaultValue(t.wallColor&&this._cesium.Color.fromCssColorString(t.wallColor),this._cesium.Color.AQUAMARINE.withAlpha(.5)),outline:!0,outlineColor:this._core.defaultValue(t.wallOutlineColor&&this._cesium.Color.fromCssColorString(t.wallOutlineColor),this._cesium.Color.RED.withAlpha(.5))}});this.wall.push(d);var m=this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),ellipsoid:{radii:s.radii,minimumClock:this._cesium.Math.toRadians(0),maximumClock:this._cesium.Math.toRadians(s.angle),maximumCone:this._cesium.Math.toRadians(90),material:this._core.defaultValue(t.surfaceColor&&this._cesium.Color.fromCssColorString(t.surfaceColor),this._cesium.Color.RED.withAlpha(.5))},orientation:new o._cesium.CallbackProperty(function(){return o._cesium.Transforms.headingPitchRollQuaternion(o._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),new o._cesium.HeadingPitchRoll(o._cesium.Math.toRadians(-l),0,0))},!1)});this.wall.push(m)}this.item=this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),ellipsoid:s});var p=this._core.defaultValue(s.speed,1);this._viewer.clock.onTick.addEventListener(function(){l+=.1*p,u=o.calcPoints(e[0],e[1],e[2],n,l),h&&(h=o.calcPoints(e[0],e[1],e[2],n,l+s.angle))});var g={id:this.item.id,name:i,pId:this._core.isnull(r)?0:r,type:"cylinder",item:this};return this.setTreeobj(g),this._tree.insertGroupId(g,this._core.isnull(r)?0:r),this},e.prototype.computeCirclularFlight=function(e,t,i,r,o,n,a){var s=[];s.push(e),s.push(t),s.push(o);for(var l=this._cesium.Cartesian3.distance(this._cesium.Cartesian3.fromDegrees(e,t,o),this._cesium.Cartesian3.fromDegrees(i,r,o)),u=n;u<=n+a;u++){var c=l*Math.sin(u*Math.PI/180),h=Math.cos(u*Math.PI/180),d=(i-e)*h+e,m=(r-t)*h+t;s.push(d),s.push(m),s.push(c+o)}return s},e.prototype.calcPoints=function(e,t,i,r,o){var n=this._cesium.Transforms.eastNorthUpToFixedFrame(this._cesium.Cartesian3.fromDegrees(e,t,i)),a=r*Math.cos(o*Math.PI/180),s=r*Math.sin(o*Math.PI/180),l=this._cesium.Cartesian3.fromElements(a,s,0),u=this._cesium.Matrix4.multiplyByPoint(n,l,new this._cesium.Cartesian3),c=this._cesium.Cartographic.fromCartesian(u),h=this._cesium.Math.toDegrees(c.longitude),d=this._cesium.Math.toDegrees(c.latitude);return this.computeCirclularFlight(e,t,h,d,i,0,90)},e.prototype.createRadarMaskScan=function(e,t,i,r){var o=this;!i&&(i={});var n=this._core.defaultValue(i.radius,100),a=this._core.defaultValue(i.yaw,0),s=this._core.defaultValue(i.angle,60),l={innerRadii:new this._cesium.Cartesian3(2,2,2),radii:new this._cesium.Cartesian3(n,n,n),maximumCone:this._cesium.Math.toRadians(this._core.defaultValue(i.maxLat,105)),minimumCone:this._cesium.Math.toRadians(this._core.defaultValue(i.minLat,75)),minimumClock:this._cesium.Math.toRadians(a),maximumClock:this._cesium.Math.toRadians(a+s),material:this._cesium.Color.AQUAMARINE.withAlpha(.3),outline:!0,outlineColor:this._cesium.Color.AQUAMARINE.withAlpha(.5),outlineWidth:1},u=this._core.extend(l,i,!0);"string"==typeof i.color&&(u.material=this._cesium.Color.fromCssColorString(i.color)),"string"==typeof i.outlineColor&&(u.outlineColor=this._cesium.Color.fromCssColorString(i.outlineColor));var c=0,h=this._core.defaultValue(i.scanAngle,15);this._scan=this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2]),ellipsoid:{radii:u.radii,minimumClock:new this._cesium.CallbackProperty(function(){return o._cesium.Math.toRadians(a+c)},!1),maximumClock:new this._cesium.CallbackProperty(function(){return o._cesium.Math.toRadians(a+c+h)},!1),maximumCone:u.maximumCone,minimumCone:u.minimumCone,material:this._core.defaultValue(i.scanColor&&this._cesium.Color.fromCssColorString(i.scanColor),this._cesium.Color.RED.withAlpha(.5))}}),this.item=this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2]),ellipsoid:u});var d=this._core.defaultValue(u.speed,1);this._viewer.clock.onTick.addEventListener(function(){(c+=.1*d)<=0&&d<0?(c=0,d=-d):s-h<=c&&0<d&&(c=s-h,d=-d)});var m={id:this.item.id,name:e,pId:this._core.isnull(r)?0:r,type:"ellipsoid",item:this};return this.setTreeobj(m),this._tree.insertGroupId(m,this._core.isnull(r)?0:r),this},e.prototype.createRadarMask=function(e,t,i,r){!i&&(i={});var o=this._core.defaultValue(i.radius,100),n=this._core.defaultValue(i.yaw,0),a=this._core.defaultValue(i.angle,60),s={innerRadii:new this._cesium.Cartesian3(2,2,2),radii:new this._cesium.Cartesian3(o,o,o),maximumCone:this._cesium.Math.toRadians(this._core.defaultValue(i.maxLat,105)),minimumCone:this._cesium.Math.toRadians(this._core.defaultValue(i.minLat,75)),minimumClock:this._cesium.Math.toRadians(n),maximumClock:this._cesium.Math.toRadians(n+a),material:this._cesium.Color.AQUAMARINE.withAlpha(.3),outline:!1,outlineColor:this._cesium.Color.AQUAMARINE.withAlpha(.5),outlineWidth:1},l=this._core.extend(s,i,!0);"string"==typeof i.color&&(l.material=this._cesium.Color.fromCssColorString(i.color)),"string"==typeof i.outlineColor&&(l.outlineColor=this._cesium.Color.fromCssColorString(i.outlineColor)),this.item=this._viewer.entities.add({position:t,ellipsoid:l});var u={id:this.item.id,name:e,pId:this._core.isnull(r)?0:r,type:"ellipsoid",item:this};return this.setTreeobj(u),this._tree.insertGroupId(u,this._core.isnull(r)?0:r),this},e.prototype.createConeRadar=function(s,e){!e&&(e={});var l=this;l.lon=s[0],l.lat=s[1],l.height=this._core.defaultValue(s[2],3e3),this.planePosition=null,this.halfLen=l.height/2,this.lengthl=l.height,this.geoD=new this._cesium.EllipsoidGeodesic,this.startPt=this._cesium.Cartographic.fromDegrees(l.lon,l.lat,0),this.changenum=0,this.curCanvas="a";var t=this._viewer.scene.globe.getHeight(this.startPt)||0;this._cesium.Color.fromCssColorString(l._core.defaultValue(e.color,"#0000ff"));this.item=this._viewer.entities.add({name:"Red cone",position:e.rotate?new this._cesium.CallbackProperty(function(){return l.lon>s[0]+.01&&l.lat<s[1]+.005?l.lat+=1e-5:l.lat>s[1]+.005&&l.lon>s[0]?l.lon-=1e-5:l.lon<=s[0]&&l.lat>s[1]?l.lat-=1e-5:l.lon+=1e-5,l.planePosition=l._cesium.Cartesian3.fromDegrees(l.lon,l.lat,l.height/2),l.planePosition},!1):l._cesium.Cartesian3.fromDegrees(l.lon,l.lat,(l.height+t)/2),orientation:e.rotate?new this._cesium.CallbackProperty(function(){var e=Cesium.Cartographic.fromDegrees(l.lon,s[1],0);l.geoD.setEndPoints(l.startPt,e);var t=l.geoD.surfaceDistance,i=Math.atan(t/l.halfLen),r=Cesium.Cartographic.fromDegrees(l.lon,l.lat,0);l.geoD.setEndPoints(l.startPt,r),t=l.geoD.surfaceDistance,l.lengthl=Math.sqrt(t*t+l.halfLen*l.halfLen);var o=Cesium.Cartographic.fromDegrees(s[0],l.lat,0);l.geoD.setEndPoints(l.startPt,o),t=l.geoD.surfaceDistance;var n=Math.asin(t/l.lengthl),a=new Cesium.HeadingPitchRoll(0,i,n);return Cesium.Transforms.headingPitchRollQuaternion(l.planePosition,a)},!1):void 0,cylinder:{length:e.rotate?new l._cesium.CallbackProperty(function(){return 2*l.lengthl},!1):l.height-t,topRadius:0,bottomRadius:l._core.defaultValue(e.radius,300),bottomSurface:!1,material:l._core.getConeRadarMaterial(e.color)}});var i={id:this._core.getuid(),name:"新建卫星雷达",pId:0,type:"ConeRadar",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,0),this},e.prototype.setLength=function(e){try{this.item._cylinder.length=e}catch(e){console.log(e)}return this},e.prototype.createCylinderOptimization=function(e,t){this.style=e;var l=this;this.handler.setInputAction(function(e){var t=l.getCatesian3FromPX(e.position,l._viewer,[l.circle]);0==l.positions.length&&l.positions.push(t.clone()),l.positions.push(t);var i=l.createPoint(t,!1);0<l.gonCircleArr.length&&(l.positions.pop(),l.state=1,l.handler.destroy());var r=l.createPointStretching(t,!1);r.wq=l.gonCircleArr.length,l.gonPointStretchingArr.push(r),i.wz=l.gonCircleArr.length,l.gonCircleArr.push(i)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){if(!(l.positions.length<1)){var t=l.getCatesian3FromPX(e.endPosition,l._viewer,[l.circle]);if(2==l.positions.length&&!l._cesium.defined(l.circle)){var i=l._cesium.Cartographic.fromCartesian(l.positions[0]),r=l._cesium.Math.toDegrees(i.longitude),o=l._cesium.Math.toDegrees(i.latitude),n=l._cesium.Cartographic.fromCartesian(l.positions[1]),a=l._cesium.Math.toDegrees(n.longitude),s=l._cesium.Math.toDegrees(n.latitude);l.topRadius=E(o,r,s,a),l.bottomRadius=E(o,r,s,a),l.circle=l.createCylinder(l.style),l._core.Entityadd(l),l.circle.objId=l.objId}if(l.circle){l.positions.pop(),l.positions.push(t);i=l._cesium.Cartographic.fromCartesian(l.positions[0]),r=l._cesium.Math.toDegrees(i.longitude),o=l._cesium.Math.toDegrees(i.latitude),n=l._cesium.Cartographic.fromCartesian(l.positions[1]),a=l._cesium.Math.toDegrees(n.longitude),s=l._cesium.Math.toDegrees(n.latitude);l.topRadius=E(o,r,s,a),l.bottomRadius=E(o,r,s,a)}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE)},e.prototype.startModify=function(){var w="拖动修改位置";if(2==this.state||1==this.state){this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas));for(var b=this,e=0;e<b.gonCircleArr.length;e++){(t=b.gonCircleArr[e])&&(t.show=!0)}if(0<b.gonPointStretchingArr.length)for(e=0;e<b.gonPointStretchingArr.length;e++){var t;(t=b.gonPointStretchingArr[e])&&(t.show=!0)}this.modifyHandler.setInputAction(function(e){var t=b._viewer.scene.pick(e.position);if(Cesium.defined(t)&&t.id)t.id.objId||(b.modifyPoint=t.id,w="释放后完成修改"),b.forbidDrawWorld(!0);else{for(var i=0;i<b.gonCircleArr.length;i++){(r=b.gonCircleArr[i])&&(r.show=!1)}if(0<b.gonPointStretchingArr.length)for(i=0;i<b.gonPointStretchingArr.length;i++){var r;(r=b.gonPointStretchingArr[i])&&(r.show=!1)}b.modifyHandler&&(b.modifyHandler.destroy(),b.modifyHandler=null)}b.state=2},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){var t=b._viewer.scene.pick(e.endPosition);if(b._core.CreateTooltip(w,e.endPosition,!1),Cesium.defined(t)&&t.id&&(t.id.objId||b._core.CreateTooltip(w,e.endPosition,!0)),!(b.positions.length<1)&&b.modifyPoint){var i=b.getCatesian3FromPX(e.endPosition,b._viewer,[b.circle,b.modifyPoint]);if(i)if(null!=b.modifyPoint.wq){var r={x:i.x,y:i.y,z:i.z+ +b.length};if(b.positions[b.modifyPoint.wq]=i,0==b.modifyPoint.wq)b.modifyPoint.position.setValue(r),b.gonCircleArr[b.modifyPoint.wq].position=i;else{var o=b._viewer.scene.pickPosition(e.endPosition),n=b._cesium.Cartographic.fromCartesian(o),a=b._cesium.Math.toDegrees(n.longitude),s=b._cesium.Math.toDegrees(n.latitude),l=b._cesium.Cartographic.fromCartesian(b.positions[1]),u=b._cesium.Math.toDegrees(l.longitude),c=b._cesium.Math.toDegrees(l.latitude);b.length=E(s,a,c,u);var h=b._cesium.Cartographic.fromCartesian(b.gonCircleArr[0].position.getValue()),d=b._cesium.Math.toDegrees(h.longitude),m=b._cesium.Math.toDegrees(h.latitude),p=h.height+b.length,g=b._cesium.Cartesian3.fromDegrees(d,m,p),f=b._cesium.Cartographic.fromCartesian(b.gonCircleArr[1].position.getValue()),v=b._cesium.Math.toDegrees(f.longitude),_=b._cesium.Math.toDegrees(f.latitude),y=f.height+b.length,C=b._cesium.Cartesian3.fromDegrees(v,_,y);b.gonPointStretchingArr[0].position.setValue(g),b.gonPointStretchingArr[1].position.setValue(C)}}else if(b.modifyPoint.position.setValue(i),b.positions[b.modifyPoint.wz]=i,b.gonPointStretchingArr[b.modifyPoint.wz].position={x:i.x,y:i.y,z:i.z+b.length},b.modifyPoint.wz&&0==b.modifyPoint.wz)b.gonCircleArr[1].position={x:b.positions[0].x+b.topRadius,y:b.positions[0].y,z:b.positions[0].z},b.gonPointStretchingArr[1].position={x:b.positions[0].x+b.topRadius,y:b.positions[0].y,z:b.positions[0].z+b.length};else{n=b._cesium.Cartographic.fromCartesian(b.positions[0]),a=b._cesium.Math.toDegrees(n.longitude),s=b._cesium.Math.toDegrees(n.latitude),l=b._cesium.Cartographic.fromCartesian(b.positions[b.modifyPoint.wz]),u=b._cesium.Math.toDegrees(l.longitude),c=b._cesium.Math.toDegrees(l.latitude);b.topRadius=E(s,a,c,u),b.bottomRadius=E(s,a,c,u)}b._core.CreateTooltip(w,e.endPosition,!0)}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){b.modifyPoint&&(b.modifyPoint=null,b.forbidDrawWorld(!1),w="拖动修改位置")},Cesium.ScreenSpaceEventType.LEFT_UP)}},e.prototype.forbidDrawWorld=function(e){this._viewer.scene.screenSpaceCameraController.enableRotate=!e,this._viewer.scene.screenSpaceCameraController.enableTilt=!e,this._viewer.scene.screenSpaceCameraController.enableTranslate=!e,this._viewer.scene.screenSpaceCameraController.enableInputs=!e},e.prototype.getCatesian3FromPX=function(e,t,i){var r,o=t.scene.pick(e),n=t.scene.drillPick(e),a=null;if(i){for(var s=0;s<n.length;s++)if(n[s].id._id!=i[0].id&&n[s].id._id!=i[1].id){a=n[s].id;break}}else a=o;if(t.scene.pickPositionSupported&&Cesium.defined(a))r=t.scene.pickPosition(e);else{var l=t.camera.getPickRay(e);if(!l)return;r=t.scene.globe.pick(l,t.scene)}return r},e.prototype.createCylinder=function(e){var t=this;return e.length&&(t.length=e.length),this._viewer.entities.add({position:new t._cesium.CallbackProperty(function(){return t.positions[0]},!1),cylinder:{topRadius:new t._cesium.CallbackProperty(function(){return t.topRadius},!1),bottomRadius:new t._cesium.CallbackProperty(function(){return t.bottomRadius},!1),length:new t._cesium.CallbackProperty(function(){return t.length},!1),material:e.material||Cesium.Color.WHITE}})},e.prototype.createPoint=function(e,t){if(e)return this._viewer.entities.add({position:e,point:{pixelSize:10,color:this._cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},e.prototype.createPointStretching=function(e,t){if(e){var i=Cesium.Cartographic.fromCartesian(e),r=Cesium.Math.toDegrees(i.longitude),o=Cesium.Math.toDegrees(i.latitude),n=i.height+this.length;return e=Cesium.Cartesian3.fromDegrees(r,o,n),this._viewer.entities.add({position:e,point:{pixelSize:10,color:Cesium.Color.fromAlpha(Cesium.Color.FUCHSIA,.5),outlineWidth:2,outlineColor:Cesium.Color.fromAlpha(Cesium.Color.WHITE,.5),heightReference:Cesium.HeightReference.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})}},e.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=null==this.item.cylinder.length?void 0:this.item.cylinder.length.getValue(),i=null==this.item.cylinder.topRadius?void 0:this.item.cylinder.topRadius.getValue(),r=null==this.item.cylinder.bottomRadius?void 0:this.item.cylinder.bottomRadius.getValue(),o=null==this.item.cylinder.fill?void 0:this.item.cylinder.fill.getValue(),n=this.item.cylinder.material;null!=n&&(n={color:null==n.color?void 0:"rgba("+n.color._value.red+","+n.color._value.green+","+n.color._value.blue+","+n.color._value.alpha+")",image:null==n.image?void 0:n.image._value,diffusemap:null==n.diffusemap?void 0:n.diffusemap._value,alphamap:null==n.alphamap?void 0:n.alphamap._value});var a=null==this.item.cylinder.outline?void 0:this.item.cylinder.outline._value,s=null==this.item.cylinder.outlineColor?void 0:"rgba("+this.item.cylinder.outlineColor._value.red+","+this.item.cylinder.outlineColor._value.green+","+this.item.cylinder.outlineColor._value.blue+","+this.item.cylinder.outlineColor._value.alpha+")",l=null==this.item.cylinder.outlineWidth?void 0:this.item.cylinder.outlineWidth._value,u=null==this.item.cylinder.numberOfVerticalLines?void 0:this.item.cylinder.numberOfVerticalLines._value,c=null==this.item.cylinder.slices?void 0:this.item.cylinder.slices._value,h=this.item.cylinder.distanceDisplayCondition,d=null==h?void 0:h._value.near,m=null==h?void 0:h._value.far,p=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"cylinder",position:{x:this._cesium.Math.toDegrees(p.longitude),y:this._cesium.Math.toDegrees(p.latitude),z:this._cesium.Math.toDegrees(p.height)},treeobj:{name:this.treeobj.name},style:{show:e,length:t,topRadius:i,bottomRadius:r,fill:o,material:n,outline:a,outlineColor:s,outlineWidth:l,numberOfVerticalLines:u,slices:c,near:d,far:m}}},e.prototype.setTreeobj=function(e){this.treeobj=e},e.prototype.setVisibility=function(t){this.item.show=t,this._scan&&(this._scan.show=t),this.wall&&this.wall.forEach(function(e){e.show=t})},e.prototype.getVolume=function(){try{var e=0,t=this.item._cylinder.bottomRadius,i=(this.item._cylinder.topRadius,this.item._cylinder.length);e=0==t?3.14159*t*t*i/3:3.14159*t*t*i}catch(e){console.log(e)}return e},e.prototype.executeCone=function(u){var c=this;c.shape={tempPoints:[],button:0,position:{}};var h=new this._cesium.ScreenSpaceEventHandler(c._viewer.scene.canvas),d=[],m=[];return h.setInputAction(function(e){var t=c._viewer.scene.camera.pickEllipsoid(e.position,c._viewer.scene.globe.ellipsoid),i=c._cesium.Cartographic.fromCartesian(t),r=c._cesium.Math.toDegrees(i.longitude),o=c._cesium.Math.toDegrees(i.latitude);m.push({lon:r,lat:o});if(0==c.shape.button)d.push(t.clone()),d.push(t),c.shape.position=t,c.cylinder=c._viewer.entities.add({name:"",position:c._cesium.Cartesian3.fromDegrees(m[0].lon,m[0].lat),cylinder:{length:100,show:!0,fill:!0,topRadius:0,bottomRadius:100,material:c._cesium.Color.RED}}),c.item=c.cylinder;else if(1==c.shape.button){var n=E(m[0].lat,m[0].lon,m[1].lat,m[1].lon);c.item.cylinder.bottomRadius=n}else if(2==c.shape.button){h.destroy();var a=0;c._core.isnull(p.selectedItem)||"group"!=p.selectedItem.type||(a=p.selectedItem.id);var s=c._core.getuid(),l={id:s,name:"新建圆锥"+s,pId:c._core.isnull(a)?0:a,type:"cylinder",item:c};this.setTreeobj(l),p.insertGroupId(l,c._core.isnull(a)?0:a),"function"==typeof u&&u({polyline:{},positions:[],distance:[]})}c.shape.button=c.shape.button+1},this._cesium.ScreenSpaceEventType.LEFT_CLICK),h.setInputAction(function(e){if(2==c.shape.button){var t=c._viewer.camera.getPickRay(e.endPosition),i=c._viewer.scene.globe.pick(t,c._viewer.scene);c.item.cylinder.length=i.z}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},e.prototype.executeCylinder=function(u){var c=this;c.shape={tempPoints:[],button:0,position:{}};var h=new this._cesium.ScreenSpaceEventHandler(c._viewer.scene.canvas),d=[],m=[];return h.setInputAction(function(e){var t=c._viewer.scene.camera.pickEllipsoid(e.position,c._viewer.scene.globe.ellipsoid),i=c._cesium.Cartographic.fromCartesian(t),r=c._cesium.Math.toDegrees(i.longitude),o=c._cesium.Math.toDegrees(i.latitude);m.push({lon:r,lat:o});if(0==c.shape.button)d.push(t.clone()),d.push(t),c.shape.position=t,c.cylinder=c._viewer.entities.add({name:"",position:c._cesium.Cartesian3.fromDegrees(m[0].lon,m[0].lat),cylinder:{length:100,topRadius:0,bottomRadius:100,material:c._cesium.Color.RED}}),c.item=c.cylinder;else if(1==c.shape.button){var n=E(m[0].lat,m[0].lon,m[1].lat,m[1].lon);c.item.cylinder.bottomRadius=n,c.item.cylinder.topRadius=n}else if(2==c.shape.button){h.destroy();var a=0;c._core.isnull(p.selectedItem)||"group"!=p.selectedItem.type||(a=p.selectedItem.id);var s=c._core.getuid(),l={id:s,name:"新建圆柱"+s,pId:c._core.isnull(a)?0:a,type:"cylinder",item:c};c.setTreeobj(l),p.insertGroupId(l,c._core.isnull(a)?0:a),"function"==typeof u&&u({polyline:{},positions:[],distance:[]})}c.shape.button=c.shape.button+1},this._cesium.ScreenSpaceEventType.LEFT_CLICK),h.setInputAction(function(e){if(2==c.shape.button){var t=c._viewer.camera.getPickRay(e.endPosition),i=c._viewer.scene.globe.pick(t,c._viewer.scene);c.item.cylinder.length=i.z}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},e.prototype.setTopRadius=function(e){try{this.item._cylinder.topRadius=e}catch(e){console.log(e)}return this},e.prototype.setHeight=function(e){try{var t=this._cesium.Cartesian3.fromDegrees(-94.74211811500844,37.34584317651723,e);this.item._position._value.z=t.z}catch(e){console.log(e)}return this},e.prototype.deleteObject=function(){var t=this._viewer;t.entities.remove(this.item),this.wall&&(this.wall.forEach(function(e){t.entities.remove(e)}),this.wall=[])},e.prototype.setHeightType=function(e){try{1==e?this.item._cylinder.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._cylinder.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._cylinder.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},e.prototype.setCylinderImage=function(e){try{this.item._cylinder.material=new this._cesium.ImageMaterialProperty({image:e})}catch(e){console.log(e)}return this},e.prototype.setCylinderRepeat=function(e,t){try{this.item._cylinder.material.repeat=new this._cesium.Cartesian2(e,t)}catch(e){console.log(e)}return this},e.prototype.setDistanceDisplayCondition=function(e,t){var i=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._cylinder.distanceDisplayCondition=i}catch(e){console.log(e)}return this},e.prototype.setBottomRadius=function(e){try{this.item._cylinder.bottomRadius=e}catch(e){console.log(e)}return this},e.prototype.setShow=function(e){try{this.item._cylinder.show=e}catch(e){console.log(e)}return this},e.prototype.setMaterial=function(e){try{this.item._cylinder.material=e}catch(e){console.log(e)}return this},e.prototype.setMaterial=function(e){try{this.item._cylinder.material.color=new h(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},e.prototype.setMaterialAlpha=function(e){try{this.item._cylinder.material.color._value.alpha=e,this.item._cylinder.show=!0}catch(e){console.log(e)}return this},e.prototype.setItem=function(e){this.item=e},e.prototype.CreateCone=function(e,t,i,r,o,n,a,s){this._postion=e;var l,u={topRadius:0,bottomRadius:this._cesium.defaultValue(t,2e4),length:this._cesium.defaultValue(i,4e4),slices:this._cesium.defaultValue(n,128),material:this._cesium.Color.RED,outline:!1,outlineColor:void 0};r&&""!==r&&(u.outlineColor=new h(this._viewer,this._cesium).colorFromHtmlColor(r),u.outline=!0),o&&""!==o&&(u.material=new h(this._viewer,this._cesium).colorFromHtmlColor(o)),(e.Yaw||e.Pitch||e.Roll)&&(l=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw),this._cesium.Math.toRadians(e.Pitch),this._cesium.Math.toRadians(e.Roll)))),this.item=this._viewer.entities.add({name:s,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),cylinder:u,orientation:l});var c={id:this.item.id,name:s,pId:this._core.isnull(a)?0:a,type:"cylinder",item:this};return this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(a)?0:a),this},e.prototype.CreateCylinder=function(e,t,i,r,o,n,a,s){this._postion=e;var l,u={topRadius:this._cesium.defaultValue(t,2e4),bottomRadius:this._cesium.defaultValue(t,2e4),length:this._cesium.defaultValue(i,4e4),slices:this._cesium.defaultValue(n,128),material:this._cesium.Color.RED,outline:!1,outlineColor:void 0};r&&""!==r&&(u.outlineColor=new h(this._viewer,this._cesium).colorFromHtmlColor(r),u.outline=!0),o&&""!==o&&(u.material=new h(this._viewer,this._cesium).colorFromHtmlColor(o)),(e.Yaw||e.Pitch||e.Roll)&&(l=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw),this._cesium.Math.toRadians(e.Pitch),this._cesium.Math.toRadians(e.Roll)))),this.item=this._viewer.entities.add({name:s,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),cylinder:u,orientation:l});var c={id:this.item.id,name:s,pId:this._core.isnull(a)?0:a,type:"cylinder",item:this};return this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(a)?0:a),this},Object.defineProperties(e.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{this._postion.Altitude=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}}}}),e}),define("SGWorld/Creator/Point",["../configData","./Color","../Core/Core","../Navigate/getPosition","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min"],function(p,i,r,o,n,e){"use strict";function t(e,t){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this._viewer=e,this._cesium=t,this._core=new r,this._getPosition=new o(this._viewer,this._cesium),this._tree=n,this.modifyPoint=null,this._color=new i(this._viewer,this._cesium),this.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._position=void 0,this._points=[],this._listeners={},this._point=null}return t.prototype.createPoint=function(e,t,i,r,o,n){var a={id:this._core.getuid(),show:!0,pixelSize:10,color:this._cesium.Color.RED,clampToGround:!0};r||(r={}),a=this._core.extend(a,r,!0),i&&(this._core.isHtmlColor(i)?i=this._color.colorFromHtmlColor(i):(/^rgb/.test(i)&&(i=this._Color.rgbaStringToRgbaObj(i)),1<i.r&&(i.r=i.r/255),1<i.g&&(i.g=i.g/255),1<i.b&&(i.b=i.b/255),1<i.a&&(i.a=i.a/255),i.r&&(i=this._color.createColor(i.r,i.g,i.b,i.a))),a.color=i),this._position=t,this.item=this._viewer.entities.add({name:e,position:this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2]||0),point:a});var s={id:this.item.id,name:e,pId:this._core.isnull(o)?0:o,type:"Point",item:this};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(o)?0:o),this},t.prototype.getstyles=function(){var e={};return e.show=!this.item.point.show||this.item.point.show._value,e.pixelSize=this.item.point.pixelSize?this.item.point.pixelSize.toString():null,e.heightReference=this.item.point.heightReference&&this.item.point.heightReference._value?this.item.point.heightReference.toString():null,e.color=this.item.point.color&&this.item.point.color._value?"rgba"+this.item.point.color.toString():null,e.outlineColor=this.item.point.outlineColor&&this.item.point.outlineColor._value?"rgba"+this.item.point.outlineColor.toString():null,e.outlineWidth=this.item.point.outlineWidth&&this.item.point.outlineWidth._value?this.item.point.outlineWidth.toString():null,e.near=this.item.point.distanceDisplayCondition?this.item.point.distanceDisplayCondition._value.near:null,e.far=this.item.point.distanceDisplayCondition?this.item.point.distanceDisplayCondition._value.far:null,e.position=this.item.position.getValue().toString(),e},t.prototype.createLonlat=function(a){var s=this,t=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);t.setInputAction(function(e){var t=s._viewer.camera.pickEllipsoid(e.position,s._viewer.scene.globe.ellipsoid),i=s._cesium.Cartographic.fromCartesian(t,s._viewer.scene.globe.ellipsoid,new s._cesium.Cartographic),r=s._cesium.Math.toDegrees(i.latitude),o=s._cesium.Math.toDegrees(i.longitude),n=i.height;"function"==typeof a&&a({lng:o,lat:r,height:n})},this._cesium.ScreenSpaceEventType.LEFT_CLICK),t.setInputAction(function(e){t.destroy()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK)},t.prototype.createDivPoint=function(e,t,i,r,n){var o,a=this;!n&&(n={});var s=n.id||"DivPoint"+this._core.getuid();if(void 0!==t.length?2===t.length?o=this._cesium.Cartesian3.fromDegrees(t[0],t[1]):3===t.length&&(o=this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2])):o=t.z?this._cesium.Cartesian3.fromDegrees(t.x,t.y,t.z):this._cesium.Cartesian3.fromDegrees(t.x,t.y),this._position=o,void 0!==n.level&&("number"==typeof n.level?(this.minLevel=n.level,this.maxLevel=28):(n.level=n.level.split(","),this.minLevel=n.level[0],this.maxLevel=n.level[1])),!this.pointPrimitive){var l,u;this.pointPrimitive=this._viewer.scene.primitives.add(new this._cesium.PointPrimitiveCollection);var c=this;this.Level=0,c.isShow=!0,this.pointPrimitive.update=function(){if(c.item&&c.isShow&&c.minLevel&&c.maxLevel){if(c.Level=c.getLevel(),c.Level>=c.minLevel&&c.Level<=c.maxLevel)(e=document.getElementById(c.item.id))&&(e.style.display="block");else if(c.Level<c.minLevel||c.Level>c.maxLevel)return void((e=document.getElementById(c.item.id))&&(e.style.display="none"))}else if(c.item&&!c.isShow){var e;return void((e=document.getElementById(c.item.id))&&(e.style.display="none"))}for(var t,i,r=0;r<c.pointPrimitive.length;r++){if(t=c.pointPrimitive.get(r),u=t.position,!(l=c._viewer.scene.cartesianToCanvasCoordinates(u)))return;if(e=document.getElementById(t.id),t.name||(t.name="泰瑞"),!e)if(t.description){var o="";Array.isArray(t.description)?t.description.forEach(function(e){o+='<div class="divpoint-data-li" style="padding: 4px 45px 4px 0;font-size: 14px;">'+e+"</div>"}):o='<div class="divpoint-data-li" style="padding: 4px 45px 4px 0;font-size: 14px;">'+t.description+"</div>",i='<div id="'+t.id+'" style="pointer-events: none;position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 246.52, 299.197); transform-origin: left bottom 0px;"> <div class="divpoint"> <div class="divpoint-wrap" style="position: relative;padding: 30px;overflow: hidden;"> <div class="divpoint-area" style="background-image:linear-gradient(135deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50%,transparent 50%),linear-gradient(-45deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50.1%,transparent 50%);position: relative;min-width: 180px;"> <div class="divpoint-arrow-lt"></div> <div class="divpoint-b-t" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 44px;right: 0;height: 1px;z-index: 10;"></div> <div class="divpoint-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;right: 0;bottom: 44px;width: 1px;z-index: 10;"></div> <div class="divpoint-b-b" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;left: 0;right: 44px;bottom: 0;height: 1px;z-index: 10;"></div> <div class="divpoint-b-l" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 44px;left: 0;bottom: 0;width: 1px;z-index: 10;"></div> <div class="divpoint-arrow-rb"></div> <div class="divpoint-label-wrap" style="padding-left: 12px;color:#fff;font-size: 16px;white-space: nowrap;overflow: hidden;"> <div class="divpoint-title" style="background-image: linear-gradient(135deg,transparent 25px,#29baf1 25px); margin-top: 20px;padding: 0 12px 0 30px;height: 36px;line-height: 36px;position: relative;">'+t.name+'</div> <div class="divpoint-label-content" style="padding: 15px 0;margin-top: 3px;border-top: 2px solid #29baf1;">'+o+' </div> </div> </div> <div class="divpoint-b-t-l" style="background-color:#29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(52px,-22px);z-index: 10;"></div> <div class="divpoint-b-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;bottom: 0;right: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(-52px,22px);z-index: 10;"></div> </div> <div class="divpoint-arrow" style="background-color: #28bbf0;position: absolute;bottom: 0;left: 0;width: 45px;height: 2px;transform: rotate(-45deg) translate(5px,-15px);"></div> </div></div></div>',$(c._viewer.container).append(i),e=document.getElementById(t.id)}else i='<div id="'+t.id+'" style="pointer-events: none;position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 246.52, 299.197); transform-origin: left bottom 0px;"> <div class="divpoint"> <div class="divpoint-wrap" style="position: relative;padding: 30px;overflow: hidden;"> <div class="divpoint-area" style="background-image:linear-gradient(135deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50%,transparent 50%),linear-gradient(-45deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50.1%,transparent 50%);position: relative;min-width: 180px;"> <div class="divpoint-arrow-lt"></div> <div class="divpoint-b-t" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 44px;right: 0;height: 1px;z-index: 10;"></div> <div class="divpoint-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;right: 0;bottom: 44px;width: 1px;z-index: 10;"></div> <div class="divpoint-b-b" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;left: 0;right: 44px;bottom: 0;height: 1px;z-index: 10;"></div> <div class="divpoint-b-l" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 44px;left: 0;bottom: 0;width: 1px;z-index: 10;"></div> <div class="divpoint-arrow-rb"></div> <div class="divpoint-label-wrap" style="padding-left: 12px;color:#fff;font-size: 16px;white-space: nowrap;overflow: hidden;"> <div class="divpoint-title" style="background-image: linear-gradient(135deg,transparent 25px,#28bbf0 25px,#28bbf0 50%,transparent 50%),linear-gradient(-45deg,transparent 32px,#28bbf0 32px,#28bbf0 50%,transparent 50%);margin-top: 10px;margin-bottom: 10px;padding: 0 12px 0 30px;height: 36px;line-height: 36px;position: relative;">'+t.name+'</div> </div> </div> <div class="divpoint-b-t-l" style="background-color:#29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(52px,-22px);z-index: 10;"></div> <div class="divpoint-b-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;bottom: 0;right: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(-52px,22px);z-index: 10;"></div> </div> <div class="divpoint-arrow" style="background-color: #28bbf0;position: absolute;bottom: 0;left: 0;width: 45px;height: 2px;transform: rotate(-45deg) translate(5px,-15px);"></div> </div></div></div>',$(c._viewer.container).append(i),e=document.getElementById(t.id);e.style.transform="matrix(1, 0, 0, 1, "+l.x+", "+(l.y-e.offsetHeight)+")"}n.update&&n.update()}}this.item=this.pointPrimitive.add({id:s,position:this._position,color:this._cesium.Color.YELLOW}),this.item.type="DivPoint",this.item.name=e,this.item.description=r,this.updateDivPoint=function(e,t){a.item.name=e,a.item.description=t;var i=document.getElementById(a.item.id);i&&i.remove()};var h={id:this.item.id,name:e,pId:this._core.isnull(i)?0:i,type:"Point",item:this};return this.setTreeobj(h),this._tree.insertGroupId(h,this._core.isnull(i)?0:i),this},t.prototype.createDivPointAndCallback=function(e,t,i,r,n,o){var a,s=this._core.getuid();if(!n&&(n={}),void 0!==t.length?2===t.length?a=this._cesium.Cartesian3.fromDegrees(t[0],t[1]):3===t.length&&(a=this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2])):a=t.z?this._cesium.Cartesian3.fromDegrees(t.x,t.y,t.z):this._cesium.Cartesian3.fromDegrees(t.x,t.y),this._position=a,void 0!==n.level&&("number"==typeof n.level?(this.minLevel=n.level,this.maxLevel=28):(n.level=n.level.split(","),this.minLevel=n.level[0],this.maxLevel=n.level[1])),!this.pointPrimitive){var l,u;this.pointPrimitive=this._viewer.scene.primitives.add(new this._cesium.PointPrimitiveCollection),this.callback=o;var c=this;this.Level=0,c.isShow=!0,c.callback=o,this.pointPrimitive.update=function(){if(c.item&&c.isShow&&c.minLevel&&c.maxLevel){if(c.Level=c.getLevel(),c.Level>=c.minLevel&&c.Level<=c.maxLevel)(e=document.getElementById(c.item.id))&&(e.style.display="block");else if(c.Level<c.minLevel||c.Level>c.maxLevel)return void((e=document.getElementById(c.item.id))&&(e.style.display="none"))}else if(c.item&&!c.isShow){var e;return void((e=document.getElementById(c.item.id))&&(e.style.display="none"))}for(var t,i,r=0;r<c.pointPrimitive.length;r++){if(t=c.pointPrimitive.get(r),u=t.position,!(l=c._viewer.scene.cartesianToCanvasCoordinates(u)))return;if(e=document.getElementById(t.id),t.name||(t.name="泰瑞"),!e)if(t.description){var o="";Array.isArray(t.description)?t.description.forEach(function(e){o+='<div class="divpoint-data-li" style="padding: 4px 45px 4px 0;font-size: 14px;">'+e+"</div>"}):o='<div class="divpoint-data-li" style="padding: 4px 45px 4px 0;font-size: 14px;">'+t.description+"</div>",i='<div id="'+t.id+'" style="position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 246.52, 299.197); transform-origin: left bottom 0px;"> <div class="divpoint"> <div class="divpoint-wrap" style="position: relative;padding: 30px;overflow: hidden;"> <div class="divpoint-area" style="background-image:linear-gradient(135deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50%,transparent 50%),linear-gradient(-45deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50.1%,transparent 50%);position: relative;min-width: 180px;"> <div class="divpoint-arrow-lt"></div> <div class="divpoint-b-t" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 44px;right: 0;height: 1px;z-index: 10;"></div> <div class="divpoint-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;right: 0;bottom: 44px;width: 1px;z-index: 10;"></div> <div class="divpoint-b-b" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;left: 0;right: 44px;bottom: 0;height: 1px;z-index: 10;"></div> <div class="divpoint-b-l" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 44px;left: 0;bottom: 0;width: 1px;z-index: 10;"></div> <div class="divpoint-arrow-rb"></div> <div class="divpoint-label-wrap" style="padding-left: 12px;color:#fff;font-size: 16px;white-space: nowrap;overflow: hidden;"> <div class="divpoint-title" style="background-image: linear-gradient(135deg,transparent 25px,#29baf1 25px); margin-top: 20px;padding: 0 12px 0 30px;height: 36px;line-height: 36px;position: relative;">'+t.name+'</div> <div class="divpoint-label-content" style="padding: 15px 0;margin-top: 3px;border-top: 2px solid #29baf1;">'+o+' </div> </div> </div> <div class="divpoint-b-t-l" style="background-color:#29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(52px,-22px);z-index: 10;"></div> <div class="divpoint-b-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;bottom: 0;right: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(-52px,22px);z-index: 10;"></div> </div> <div class="divpoint-arrow" style="background-color: #28bbf0;position: absolute;bottom: 0;left: 0;width: 45px;height: 2px;transform: rotate(-45deg) translate(5px,-15px);"></div> </div></div></div>',$(c._viewer.container).append(i),(e=document.getElementById(t.id)).onclick=function(){c.callback(n)}}else i='<div id="'+t.id+'" style="position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 246.52, 299.197); transform-origin: left bottom 0px;"> <div class="divpoint"> <div class="divpoint-wrap" style="position: relative;padding: 30px;overflow: hidden;"> <div class="divpoint-area" style="background-image:linear-gradient(135deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50%,transparent 50%),linear-gradient(-45deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50.1%,transparent 50%);position: relative;min-width: 180px;"> <div class="divpoint-arrow-lt"></div> <div class="divpoint-b-t" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 44px;right: 0;height: 1px;z-index: 10;"></div> <div class="divpoint-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;right: 0;bottom: 44px;width: 1px;z-index: 10;"></div> <div class="divpoint-b-b" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;left: 0;right: 44px;bottom: 0;height: 1px;z-index: 10;"></div> <div class="divpoint-b-l" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 44px;left: 0;bottom: 0;width: 1px;z-index: 10;"></div> <div class="divpoint-arrow-rb"></div> <div class="divpoint-label-wrap" style="padding-left: 12px;color:#fff;font-size: 16px;white-space: nowrap;overflow: hidden;"> <div class="divpoint-title" style="background-image: linear-gradient(135deg,transparent 25px,#28bbf0 25px,#28bbf0 50%,transparent 50%),linear-gradient(-45deg,transparent 32px,#28bbf0 32px,#28bbf0 50%,transparent 50%);margin-top: 10px;margin-bottom: 10px;padding: 0 12px 0 30px;height: 36px;line-height: 36px;position: relative;">'+t.name+'</div> </div> </div> <div class="divpoint-b-t-l" style="background-color:#29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(52px,-22px);z-index: 10;"></div> <div class="divpoint-b-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;bottom: 0;right: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(-52px,22px);z-index: 10;"></div> </div> <div class="divpoint-arrow" style="background-color: #28bbf0;position: absolute;bottom: 0;left: 0;width: 45px;height: 2px;transform: rotate(-45deg) translate(5px,-15px);"></div> </div></div></div>',$(c._viewer.container).append(i),(e=document.getElementById(t.id)).onclick=function(){c.callback(n)};e.style.transform="matrix(1, 0, 0, 1, "+l.x+", "+(l.y-e.offsetHeight)+")"}n.update&&n.update()}}this.item=this.pointPrimitive.add({id:"DivPoint"+s,position:this._position,color:this._cesium.Color.YELLOW}),this.item.type="DivPoint",this.item.name=e,this.item.description=r;var h={id:this.item.id,name:e,pId:this._core.isnull(i)?0:i,type:"Point",item:this};return this.setTreeobj(h),this._tree.insertGroupId(h,this._core.isnull(i)?0:i),this},t.prototype.getLevel=function(){var e,t,i=this._viewer.camera;if(i&&i.positionCartographic&&i.positionCartographic.height){var r=this._viewer.scene.globe.getHeight(i.positionCartographic);!r&&(r=0),e=i.positionCartographic.height-r,t=Math.round(80955.31/(1+Math.pow(e/91610.74,7096758e-11))-40467.74)}else t=0;return t},t.prototype.createRichTextPoint=function(e,t,i,r){var o,n=this,a=this._core.getuid();void 0!==t.length?2===t.length?o=this._cesium.Cartesian3.fromDegrees(t[0],t[1]):3===t.length&&(o=this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2])):o=t.z?this._cesium.Cartesian3.fromDegrees(t.x,t.y,t.z):this._cesium.Cartesian3.fromDegrees(t.x,t.y),this._position=o;var f,v,_,y,C,s={horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.BOTTOM,show:!0,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(n._core.defaultValue(i.near,0),n._core.defaultValue(i.far,Number.MAX_VALUE))},l=this._core.extend(s,i,!0),u="",c=15;i&&i.fontColor&&(u=i.fontColor),i&&i.fontSize&&(c=i.fontSize),f=e,v=c,_=u,y=function(e){l.image=e,n.item=n._viewer.entities.add({id:a,name:"新建富文本点"+a,position:n._position,billboard:l}),n.item.type="RichPoint"},(C=document.createElement("img")).src=n._core.defaultValue(l.url,window.SmartEarthRootUrl+p.richtextpoint),v=parseFloat(v),C.crossOrigin="Anonymous",C.onload=function(){var e=document.createElement("canvas"),t=e.getContext("2d"),i=C.width,r=C.height;if(e.width=i,e.height=r,t.drawImage(C,0,0,i,r),t.shadowOffsetX=1,t.shadowOffsetY=0,t.shadowColor="#fff",t.shadowBlur=1,/^\</.test(f)&&/\>$/.test(f)){var o='<svg xmlns="http://www.w3.org/2000/svg" width="'+i+'" height="60"><foreignObject width="100%" height="100%">'+f+"</foreignObject></svg>",n=window.URL||window.webkitURL||window,a=document.createElement("img"),s=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),l=n.createObjectURL(s);a.crossOrigin="Anonymous",a.src=l,a.onload=function(){t.drawImage(a,0,0,a.width,a.height),n.revokeObjectURL(l)},y(e)}else{if(t.fillStyle=_||"#fff",t.font=v+"px Calibri,sans-serif",f.length*v>i){var u=f.substring(0,Math.ceil(f.length/2)),c=f.substring(Math.floor(f.length/2),f.length),h=(r-100-2*v)/2,d=h+v,m=(i-u.length*v)/2;t.fillText(u,m,h),t.fillText(c,m,d)}else{var p=(r-100-v)/2,g=(i-f.length*v)/2;t.fillText(f,g,p)}y(e)}};var h={id:a,name:"新建富文本点"+a,pId:n._core.isnull(r)?0:r,type:"Imagelabel",item:n};return n.setTreeobj(h),n._tree.insertGroupId(h,n._core.isnull(r)?0:r),this},t.prototype.createPoints=function(e,t){var i={id:this._core.getuid(),show:!0,pixelSize:10,color:this._cesium.Color.RED,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND},r=this._core.extend(i,e,!0);this._core.isnull(text)||(r.text=text),this._position=position,this.item=this._viewer.entities.add({name:name,position:this._cesium.Cartesian3.fromDegrees(position[0],position[1]),point:r});var o={id:this.item.id,name:r.text,pId:this._core.isnull(t)?0:t,type:"Point",item:this};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(t)?0:t),this},t.prototype.createLocations=function(e,t,i){var r={id:this._core.getuid(),show:!0,pixelSize:10,color:this._cesium.Color.TRANSPARENT,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND};this._position=t,this._core.isnull(e)&&(e="新建兴趣点"),this.item=this._viewer.entities.add({name:e,position:this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2]),point:r});var o={id:r.id,name:e,pId:this._core.isnull(i)?0:i,type:"Location",item:this};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},t.prototype.createLocation=function(t,e,i){var r={id:this._core.getuid(),show:!0,pixelSize:10,color:this._cesium.Color.TRANSPARENT,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND},o={destination:e.position,orientation:{heading:e.orientation.heading,pitch:e.orientation.pitch,roll:e.orientation.roll}};this._position=e,this._core.isnull(t)&&(t="新建兴趣点");var n=this._core.getuid();this.item=this._viewer.entities.add({name:t,position:e.position,point:r}),this.item.originalCameraLocation=o;var a=this;return setTimeout(function(){var e={id:n,name:t+n,pId:a._core.isnull(i)?0:i,type:"Location",item:a};a.setTreeobj(e),a._tree.insertGroupId(e,a._core.isnull(i)?0:i)}),this},t.prototype.createPointOptimization=function(e,t){var s=this,l=[],u=this._core.StyleContrastGeoJson(e,this._cesium);return this.handler.setInputAction(function(e){var t,i,r=s._viewer.scene.camera.getPickRay(e.position);if(r&&(t=s._viewer.scene.globe.pick(r,s._viewer.scene)),t){i=s._cesium.Ellipsoid.WGS84.cartesianToCartographic(t);var o=s._viewer.scene.globe.getHeight(i);s._point=s._cesium.Cartesian3.fromDegrees(i.longitude/Math.PI*180,i.latitude/Math.PI*180,o),u.position=new s._cesium.CallbackProperty(function(){return s._point},!1),s.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var n=s._viewer.entities.add(u);n.objId=s.objId,(n.obj=s)._core.Entityadd(s);var a={point:n};l.push(a),s.state=1,s.handler.destroy(),"function"==typeof method&&method(l),s.item=n}},s._cesium.ScreenSpaceEventType.LEFT_CLICK),this},t.prototype.startModify=function(){var r="拖动修改位置";if(2==this.state||1==this.state){this._tree.starttemporaryItem(this._viewer),this.modifyHandler||(this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));var o=this;this.modifyHandler.setInputAction(function(e){var t=o._viewer.scene.pick(e.position);o._cesium.defined(t)&&t.id&&o._cesium.defined(t)&&t.id&&t.id.objId&&t.id.objId==o.objId&&(o.modifyPoint=t.id,r="释放后完成修改",o.forbidDrawWorld(!0)),o.state=2},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){var t=o._viewer.scene.pick(e.endPosition);if(o._core.CreateTooltip(r,e.endPosition,!1),o.modifyPoint){if(o.modifyPoint){var i=o.getCatesian3FromPX(e.endPosition,o._viewer,[o.modifyPoint]);i&&(o._point=i,o.modifyPoint.position=i),o._core.CreateTooltip(r,e.endPosition,!0)}}else o._cesium.defined(t)&&t.id&&t.id.objId&&o._core.CreateTooltip("拖动修改位置",e.endPosition,!0)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){var t=o.getCatesian3FromPX(e.position,o._viewer,[o.modifyPoint]);o.modifyPoint&&(t&&(o._point=t),o.modifyPoint.position=t,o.modifyPoint=null,o.forbidDrawWorld(!1),r="拖动修改位置")},this._cesium.ScreenSpaceEventType.LEFT_UP)}},t.prototype.getCatesian3FromPX=function(e,t,i){var r,o=t.scene.pick(e),n=t.scene.drillPick(e),a=null;if(0<i.length){for(var s=0;s<n.length;s++)if(n[s].id._id!=i[0].id&&n[s].id._id!=i[1].id){a=n[s].id;break}}else a=o;if(t.scene.pickPositionSupported&&this._cesium.defined(a))r=t.scene.pickPosition(e);else{var l=t.camera.getPickRay(e);if(!l)return;r=t.scene.globe.pick(l,t.scene)}return r},t.prototype.forbidDrawWorld=function(e){this._viewer.scene.screenSpaceCameraController.enableRotate=!e,this._viewer.scene.screenSpaceCameraController.enableTilt=!e,this._viewer.scene.screenSpaceCameraController.enableTranslate=!e,this._viewer.scene.screenSpaceCameraController.enableInputs=!e},t.prototype.executePoint=function(u,e){this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+p.draw);var c=this;this._tree.starttemporaryItem(this._viewer);var h=[],d={point:c._cesium.Color.RED};0<Object.keys(e).length&&""!=e.point&&null!=e.point&&(d.point=e.point),this._tree.removeHandler();var m=this._core.CreateTooltip();return this._tree.handler=new c._cesium.ScreenSpaceEventHandler(c._viewer.scene.canvas),this._tree.handler.setInputAction(function(e){var t,i,r=c._viewer.scene.camera.getPickRay(e.position);if(r&&(t=c._viewer.scene.globe.pick(r,c._viewer.scene)),t){i=c._cesium.Ellipsoid.WGS84.cartesianToCartographic(t);var o,n=c._viewer.scene.globe.getHeight(i),a=c._cesium.Cartesian3.fromDegrees(i.longitude/Math.PI*180,i.latitude/Math.PI*180,n);o=1e3<=n?(n/1e3).toFixed(2)+"千米":n.toFixed(2)+"米";var s=c._viewer.entities.add({name:"高度",position:a,point:{color:d.point,pixelSize:5,outlineColor:c._cesium.Color.WHITE,outlineWidth:2,heightReference:c._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:"海拔高度:"+o,show:!0,font:"26px 楷体",fillColor:c._cesium.Color.WHITE,style:c._cesium.LabelStyle.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:c._cesium.VerticalOrigin.BOTTOM,pixelOffset:new c._cesium.Cartesian2(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}});c._tree.temporaryItem.obj.push(s);var l={point:s,height:o};h.push(l),c._tree.endtemporaryItem(),c._core.mouse(c._viewer.container,0,"0"),c._tree.handler.destroy(),m.show(!1),"function"==typeof u&&u(h),c.item=s}},c._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){m.showAt(e.endPosition,"点击拾取高度!")},c._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},t.prototype.executePointp=function(r,e){this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+p.draw);var o=this;this._tree.starttemporaryItem(this._viewer);var n={point:o._cesium.Color.RED};return 0<Object.keys(e).length&&""!=e.point&&null!=e.point&&(n.point=e.point),this._tree.removeHandler(),this._tree.handler=new o._cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas),this._tree.handler.setInputAction(function(e){var t=o._getPosition.getMousePosition(e);if(t){var i=o._viewer.entities.add({name:"高度",position:t,point:{color:n.point,pixelSize:5,outlineColor:o._cesium.Color.WHITE,outlineWidth:2,heightReference:o._cesium.HeightReference.none}});o._tree.temporaryItem.obj.push(i),o._tree.endtemporaryItem(),o._core.mouse(o._viewer.container,0,"0"),o._tree.handler.destroy(),"function"==typeof r&&r(i),o.item=i}},o._cesium.ScreenSpaceEventType.LEFT_CLICK),this},t.prototype.deleteObject=function(){try{if("DivPoint"===this.item.type){this.pointPrimitive.remove(this.item);var e=document.getElementById(this.item.id);return void(e&&e.remove())}if(this._viewer.entities.remove(this.item),0<this._points.length)for(var t=0;t<this._points.length;t++)this._viewer.entities.remove(this._points[t])}catch(e){}},t.prototype.setVisibility=function(e){if(this.isShow=e,"DivPoint"===this.item.type){var t=document.getElementById(this.item.id);t&&(t.style.display=e?"block":"none")}if(0<this._points.length)for(var i=0;i<this._points.length;i++)this._points[i].show=e;this.item.show=e},t.prototype.getVisibility=function(){return this.item.show},t.prototype.setPointAlpha=function(e){try{this.item._point.material._value.alpha=e}catch(e){console.log(e)}return this},t.prototype.export=function(){var e=null==this.item.point.show?void 0:this.item.point.show._value,t=null==this.item.point.pixelSize?void 0:this.item.point.pixelSize._value,i=null==this.item.point.color?void 0:"rgba("+this.item.point.color._value.red+","+this.item.point.color._value.green+","+this.item.point.color._value.blue+","+this.item.point.color._value.alpha+")",r=null==this.item.point.outlineColor?void 0:"rgba("+this.item.point.outlineColor._value.red+","+this.item.point.outlineColor._value.green+","+this.item.point.outlineColor._value.blue+","+this.item.point.outlineColor._value.alpha+")",o=null==this.item.point.outlineWidth?void 0:this.item.point.outlineWidth._value,n=this.item.point.distanceDisplayCondition,a=null==n?void 0:n._value.near,s=null==n?void 0:n._value.far,l=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"point",position:{x:this._cesium.Math.toDegrees(l.longitude),y:this._cesium.Math.toDegrees(l.latitude),z:this._cesium.Math.toDegrees(l.height)},treeobj:{name:this.treeobj.name},style:{show:e,pixelSize:t,color:i,outlineColor:r,outlineWidth:o,near:a,far:s}}},t.prototype.setTreeobj=function(e){this.treeobj=e},t.prototype.setPointColor=function(e){try{this.item._point.color=new i(this._viewer,this._cesium).colorFromHtmlColor(e),this.item.fillColor=this.item._point.color}catch(e){console.log(e)}return this},t.prototype.setRadius=function(e){try{this.item.ellipse=new this._cesium.EllipseGraphics({semiMinorAxis:e,semiMajorAxis:e,material:this._cesium.Color.RED.withAlpha(.4)})}catch(e){console.log(e)}return this},t.prototype.setOutlineColor=function(e){try{this.item._point.outlineColor=new Color(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},Object.defineProperties(t.prototype,{HighLight:{set:function(e){e&&(this.item.fillColor=this.item.point._color),e?this.item._point.color=new i(this._viewer,this._cesium).colorFromHtmlColor(this._core.selectedColor):this.item.point._color=this.item.fillColor}}}),Object.defineProperties(t.prototype,{pointColor:{get:function(){if(this.item.point._color._value)return this._color.toHtmlColor("rgb("+255*this.item.point._color._value.red+","+255*this.item.point._color._value.green+","+255*this.item.point._color._value.blue+","+255*this.item.point._color._value.alpha+")")},set:function(e){try{/^rgb/.test(e)?(1<(e=this._color.rgbaStringToRgbaObj(e)).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),e=this._color.createColor(e.r,e.g,e.b,e.a),this.item._point.color=e):this.item._point.color=new e(this._viewer,this._cesium).colorFromHtmlColor(e),this.item.fillColor=this.item._point.color}catch(e){}}},pointOutlineColor:{get:function(){if(null!=this.item._point._outlineColor)return this._color.toHtmlColor("rgb("+255*this.item._point.outlineColor._value.red+","+255*this.item._point.outlineColor._value.green+","+255*this.item._point.outlineColor._value.blue+","+255*this.item._point.outlineColor._value.alpha+")")},set:function(e){try{/^rgb/.test(e)?(1<(e=this._color.rgbaStringToRgbaObj(e)).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),e=this._color.createColor(e.r,e.g,e.b,e.a),this.item._point.outlineColor=e):this.item._point.outlineColor=this._color.colorFromHtmlColor(e)}catch(e){console.log(e)}}},pointOutlineWidth:{get:function(){if(null!=this.item.point.outlineWidth)return this.item.point.outlineWidth._value},set:function(e){this.item.point.outlineWidth=e}},pointAlpha:{get:function(){if(null!=this.item._point._color)return this.item._point._color._value.alpha},set:function(e){this.item._point._color._value.alpha=e}},pointOutlineAlpha:{get:function(){if(null!=this.item._point.outlineColor)return this.item._point.outlineColor._value.alpha},set:function(e){try{this.item._point.outlineColor._value.alpha=e}catch(e){}}},pointHeight:{set:function(e){e=parseFloat(e);var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=this._cesium.Math.toDegrees(t.longitude),r=this._cesium.Math.toDegrees(t.latitude),o=this._cesium.Cartesian3.fromDegrees(i,r,e);this.item.position._value=o},get:function(){var e=this._cesium.Cartographic.fromCartesian(this.item.position._value);return this._cesium.Math.toDegrees(e.height)}},pointX:{set:function(e){var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=(this._cesium.Math.toDegrees(t.longitude),this._cesium.Math.toDegrees(t.latitude)),r=this._cesium.Math.toDegrees(t.height),o=this._cesium.Cartesian3.fromDegrees(e,i,r);this.item.position.position=o},get:function(){var e=this._cesium.Cartographic.fromCartesian(this.item.position._value);return this._cesium.Math.toDegrees(e.longitude)}},pointY:{set:function(e){var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=this._cesium.Math.toDegrees(t.longitude),r=(this._cesium.Math.toDegrees(t.latitude),this._cesium.Math.toDegrees(t.height)),o=this._cesium.Cartesian3.fromDegrees(i,e,r);this.item.position.position=o},get:function(){var e=this._cesium.Cartographic.fromCartesian(this.item.position._value);return this._cesium.Math.toDegrees(e.latitude)}}}),Object.defineProperties(t.prototype,{pixelSize:{get:function(){return this.item.point.pixelSize._value},set:function(e){this.item.point.pixelSize=e}}}),Object.defineProperties(t.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),t.prototype.setItem=function(e){this.item=e},Object.defineProperties(t.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),Object.defineProperties(t.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(t.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(t.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(t.prototype,{position:{get:function(){return this._position?this._position:this.item.position}}}),Object.defineProperties(t.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Object.defineProperties(t.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(t.prototype,{pointTempOptions:{get:function(){return{color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:Color.BLACK,outlineWidth:0,show:!0,scaleByDistance:null,translucencyByDistance:null,heightReference:null,distanceDisplayCondition:null,disableDepthTestDistance:null}}}}),t}),define("SGWorld/Creator/Polyline",["../configData","./Color","../Core/Core","../Navigate/getPosition","../ProjectTree/treeSource","../Analysis/Cdcl/Cdcl","../../../node_modules/lodash/lodash.min"],function(C,u,i,r,w,g,e){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._Color=new u(this._viewer,this._cesium),this._core=new i,this._getPosition=new r(this._viewer,this._cesium),this._tree=w,this._points=[],this._polylines=[]}return t.prototype.createPolyline=function(e,t,i,r,o){var n=[];if(e[0].x||e[0].y)if(void 0!==e[0].z)for(a=0;a<e.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a].x,e[a].y,e[a].z));else for(a=0;a<e.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a].x,e[a].y));else if(2===e[0].length)for(var a=0;a<e.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a][0],e[a][1]));else if(3===e[0].length)for(var a=0;a<e.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a][0],e[a][1],e[a][2]));var s=!0;2===i&&(s=!1),this.item=this._viewer.entities.add({polyline:{positions:n,width:10,material:new this._cesium.PolylineGlowMaterialProperty({outlineColor:this._cesium.Color.BLACK,color:new u(this._viewer,this._cesium).colorFromHtmlColor(t)}),clampToGround:s}});var l={id:this.item.id,name:o,pId:this._core.isnull(r)?0:r,type:"polyline",item:this};return this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(r)?0:r),this},t.prototype.getstyles=function(){var e={};return e.show=!this.item.polyline.show||this.item.polyline.show.getValue(),e.positions=this.item.polyline.positions.getValue().toString(),e.width=this.item.polyline.width.toString(),e.granularity=this.item.polyline.granularity?this.item.polyline.granularity.toString():null,e.material={},e.material.color=this.item.polyline.material&&this.item.polyline.material.color&&this.item.polyline.material.color._value?"rgba"+this.item.polyline.material.color.toString():null,e.material.outlineColor=this.item.polyline.material.outlineColor&&this.item.polyline.material.outlineColor._value?"rgba"+this.item.polyline.material.outlineColor.toString():null,e.material.outlineWidth=this.item.polyline.material.outlineWidth&&this.item.polyline.material.outlineWidth._value?this.item.polyline.material.outlineWidth.toString():null,e.classificationType=this.item.polyline.classificationType?this.item.polyline.classificationType.toString():null,e.near=this.item.polyline.distanceDisplayCondition?this.item.polyline.distanceDisplayCondition._value.near:null,e.far=this.item.polyline.distanceDisplayCondition?this.item.polyline.distanceDisplayCondition._value.far:null,e},t.prototype.createLink=function(e,t,i){!i&&(i={});var r=[],o=[];if(e.lon&&e.lat?void 0!==e.height?(r.push(this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height)),r.push(this._cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height)),o.push({x:e.lon,y:e.lat,z:e.height},{x:t.lon,y:t.lat,z:t.height})):(r.push(this._cesium.Cartesian3.fromDegrees(e.lon,e.lat)),r.push(this._cesium.Cartesian3.fromDegrees(t.lon,t.lat)),o.push({x:e.lon,y:e.lat,z:0},{x:t.lon,y:t.lat,z:0})):e.x&&e.y?(void 0!==e.z?(r.push(this._cesium.Cartesian3.fromDegrees(e.x,e.y,e.z)),r.push(this._cesium.Cartesian3.fromDegrees(t.x,t.y,t.z))):(r.push(this._cesium.Cartesian3.fromDegrees(e.x,e.y)),r.push(this._cesium.Cartesian3.fromDegrees(t.x,t.y)),e.z=0,t.z=0),o.push(e,t)):2===e.length?(r.push(this._cesium.Cartesian3.fromDegrees(e[0],e[1])),r.push(this._cesium.Cartesian3.fromDegrees(t[0],t[1])),o.push({x:e[0],y:e[1],z:0},{x:t[0],y:t[1],z:0})):3===e.length&&(r.push(this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2])),r.push(this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2])),o.push({x:e[0],y:e[1],z:e[2]},{x:t[0],y:t[1],z:t[2]})),1===i.lineType?i.material=new this._cesium.PolylineDashMaterialProperty({color:this._core.defaultValue(i.lineColor&&this._cesium.Color.fromCssColorString(i.lineColor),this._cesium.Color.AQUAMARINE)}):2===i.lineType?i.material=new this._cesium.PolylineGlowMaterialProperty({glowPower:.3,color:this._core.defaultValue(i.lineColor&&this._cesium.Color.fromCssColorString(i.lineColor),this._cesium.Color.BLUE)}):i.material=this._core.defaultValue(i.lineColor&&this._cesium.Color.fromCssColorString(i.lineColor),this._cesium.Color.AQUAMARINE),i.cylinder){var n=o[1].z-o[0].z,a=Cesium.Cartesian3.fromDegrees(o[0].x,o[0].y,0),s=Cesium.Cartesian3.fromDegrees(o[1].x,o[0].y,0),l=this._core.getSpaceDistancem([a,s],this._cesium),u=0===n?Math.PI/2:Math.atan(l/n),c=this._core.getSpaceDistancem(r,this._cesium),h=Cesium.Cartesian3.fromDegrees(o[0].x,o[1].y,0);l=this._core.getSpaceDistancem([a,h],this._cesium);var d=Math.asin(l/c);o[0].x>o[1].x&&o[0].y>o[1].y?d=n<0?-d:d:o[0].x>o[1].x&&o[0].y<o[1].y?d=0<=n?-d:d:o[0].x<o[1].x&&o[0].y<=o[1].y?(u=0!==n?-u:u,d=0<n?-d:d):o[0].x<o[1].x&&o[0].y>o[1].y&&(d=n<0?-d:d,u=-u);var m=new Cesium.HeadingPitchRoll(0,u,d)}var p=r[0];this.item=this._viewer.entities.add({position:new this._cesium.CallbackProperty(function(){return p},!1),orientation:i.cylinder?new this._cesium.CallbackProperty(function(){return Cesium.Transforms.headingPitchRollQuaternion(p,m)},!1):void 0,polyline:{positions:r,width:this._core.defaultValue(i.width,2),material:i.material,clampToGround:!1},cylinder:i.cylinder?{length:this._core.defaultValue(i.length,20),topRadius:this._core.defaultValue(i.size,8),bottomRadius:this._core.defaultValue(i.size,8),material:this._core.defaultValue(i.pointColor&&this._cesium.Color.fromCssColorString(i.pointColor),this._cesium.Color.RED)}:void 0,point:i.cylinder?void 0:{color:this._core.defaultValue(i.pointColor&&this._cesium.Color.fromCssColorString(i.pointColor),this._cesium.Color.RED),outlineColor:this._core.defaultValue(i.outlineColor&&this._cesium.Color.fromCssColorString(i.outlineColor),this._cesium.Color.YELLOW),outlineWidth:this._core.defaultValue(i.outlineWidth,2),pixelSize:this._core.defaultValue(i.size,8)}});var g=this._core.defaultValue(i.num,200),f=this._cesium.Math.lerp(o[0].x,o[1].x,1/g)-o[0].x,v=this._cesium.Math.lerp(o[0].y,o[1].y,1/g)-o[0].y,_=this._cesium.Math.lerp(o[0].z,o[1].z,1/g)-o[0].z,y=[];y.push(r[0]);for(var C=0;C<g;C++){var w=o[0].x+(C+1)*f,b=o[0].y+(C+1)*v,E=o[0].z+(C+1)*_;y.push(this._cesium.Cartesian3.fromDegrees(w,b,E))}y.push(r[1]);var S=this._core.defaultValue(i.speed,1),P=0;this._viewer.clock.onTick.addEventListener(function(){P+=S,(P=parseInt(P))>=y.length-1&&0<S?S=-S:P<=0&&S<0&&(S=-S),p=y[P]});var x={id:this.item.id,name:"新建链路",pId:0,type:"polyline",item:this};return this.setTreeobj(x),this._tree.insertGroupId(x,0),this},t.prototype.createLinkPros=function(r){var o=this;this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+C.draw),this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(o._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene._imageryLayerCollection);var n,a=[],s=null,t="0米",i=null,l=(o=this,""),u=this._core.CreateTooltip(),c={name:"",spot:[],distance:[],label:[],ployline:[]},h={point:o._cesium.Color.RED,polyline:o._cesium.Color.BLUE};this._tree.handler.setInputAction(function(e){(i=o._getPosition.getMousePosition(e))&&(0===a.length?u.showAt(e.endPosition,"左键开始绘制!"):u.showAt(e.endPosition,"右键结束绘制!"),2<=a.length&&(o._cesium.defined(s)?(a.length>o._points.length&&a.pop(),a.push(i)):s=new d(a)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){o._viewer.camera.getPickRay(e.position);if(i=o._getPosition.getMousePosition(e)){0==a.length?a.push(i,i):a.length>o._points.length?(a.pop(),a.push(i)):a.push(i,i),2<=a.length&&(o._cesium.defined(s)||(s=new d(a)),t=o._core.getSpaceDistance(a,o._cesium)),n&&(o._viewer.entities.remove(n),n=void 0);l="总长:"+t,c.spot.push(i),c.distance.push(t)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){o.end&&o.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){var t={width:4,lineColor:"#0000ff"},i=s.positions;u.show(!1),o._tree&&o._tree.endtemporaryItem(),n&&(o._viewer.entities.remove(n),n=void 0,a.pop()),o._points[o._points.length-1]&&(o._points[o._points.length-1].label.text=l),o._tree&&o._tree.handler.destroy(),o._core.mouse(o._viewer.container,0,"0"),o.end=void 0,o._viewer.entities.remove(o.item),"cancel"===e||a.length<2||(o.item=o._viewer.entities.add({name:"新建链路",polyline:{positions:i,width:o._core.defaultValue(t.width,2),material:o._core.getLinkMaterial(t.lineColor,t.pointColor,t.time),clampToGround:!0}}),r&&r(o.item))};var d=function(){function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:h.polyline,width:3,clampToGround:!0}},this.positions=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polyline.positions=new o._cesium.CallbackProperty(function(){return e.positions},!1);var t=o._viewer.entities.add(this.options);o.item=t,o._tree.temporaryItem.obj.push(t),c.ployline.push(t);var i=o._core.getuid();c.name="新建空间距离"+i},e}();return this},t.prototype.createLinkPro=function(e,t,i){!i&&(i={});var r=[],o=[];e.lon&&e.lat?void 0!==e.height?(r.push(this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height)),r.push(this._cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height)),o.push({x:e.lon,y:e.lat,z:e.height},{x:t.lon,y:t.lat,z:t.height})):(r.push(this._cesium.Cartesian3.fromDegrees(e.lon,e.lat)),r.push(this._cesium.Cartesian3.fromDegrees(t.lon,t.lat)),o.push({x:e.lon,y:e.lat,z:0},{x:t.lon,y:t.lat,z:0})):e.x&&e.y?(void 0!==e.z?(r.push(this._cesium.Cartesian3.fromDegrees(e.x,e.y,e.z)),r.push(this._cesium.Cartesian3.fromDegrees(t.x,t.y,t.z))):(r.push(this._cesium.Cartesian3.fromDegrees(e.x,e.y)),r.push(this._cesium.Cartesian3.fromDegrees(t.x,t.y)),e.z=0,t.z=0),o.push(e,t)):2===e.length?(r.push(this._cesium.Cartesian3.fromDegrees(e[0],e[1])),r.push(this._cesium.Cartesian3.fromDegrees(t[0],t[1])),o.push({x:e[0],y:e[1],z:0},{x:t[0],y:t[1],z:0})):3===e.length&&(r.push(this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2])),r.push(this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2])),o.push({x:e[0],y:e[1],z:e[2]},{x:t[0],y:t[1],z:t[2]})),this.item=this._viewer.entities.add({name:"新建链路",polyline:{positions:r,width:this._core.defaultValue(i.width,2),material:this._core.getLinkMaterial(i.lineColor,i.pointColor,i.time)}});var n={id:this.item.id,name:"新建链路",pId:0,type:"polyline",item:this};return this.setTreeobj(n),this._tree.insertGroupId(n,0),this},t.prototype.executePolyline=function(t,u){var c=this,i=function(){function e(e){this.options={polyline:{show:!0,positions:[],material:new c._cesium.PolylineOutlineMaterialProperty({color:c._core.defaultValue(t.color,c._cesium.Color.YELLOW)}),clampToGround:c._core.defaultValue(t.clampToGround,!0),width:c._core.defaultValue(t.width,3)}},this.positions=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polyline.positions=new c._cesium.CallbackProperty(function(){return e.positions},!1),this.polyline=c._viewer.entities.add(this.options),c.item=this.polyline},e}(),h=new c._cesium.ScreenSpaceEventHandler(c._viewer.scene.canvas),d=[],m=void 0,p=this._core.CreateTooltip();return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+C.draw),h.setInputAction(function(e){var t=c._getPosition.getMousePosition(e);0==d.length&&d.push(t.clone()),d.push(t)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),h.setInputAction(function(e){0===d.length?p.showAt(e.endPosition,"左键开始绘制!"):p.showAt(e.endPosition,"右键结束绘制!");var t=c._getPosition.getMousePosition(e);2<=d.length&&(c._cesium.defined(m)?null!=t&&(d.pop(),t.y+=1+Math.random(),d.push(t)):m=new i(d))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),h.setInputAction(function(e){p.show(!1);var t={polyline:{},positions:[],positionsp:[],distance:[],setDistance:function(){alert("qq")}};h.destroy(),t.polyline=m;for(var i=[],r=0;r<d.length;r++){var o=c._cesium.Cartographic.fromCartesian(d[r]),n=c._cesium.Math.toDegrees(o.longitude),a=c._cesium.Math.toDegrees(o.latitude),s=o.height;i.push({lon:n,lat:a,hei:s})}t.positions=i;for(var l=1;l<d.length;l++)t.distance[l-1]=g(d[l-1].y,d[l-1].x,d[l].y,d[l].x);t.positionsp=d,c._core.mouse(c._viewer.container,0,"0"),"function"==typeof u&&u(t)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},t.prototype.executePolyline1=function(t,e){var r=this;this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+C.draw),this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(r._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene._imageryLayerCollection);var i,o,n=[],a=null,s="0米",l=null,u=(r=this,""),c=this._core.CreateTooltip(),h={name:"",spot:[],distance:[],label:[],ployline:[]},d={point:r._cesium.Color.RED,polyline:r._cesium.Color.YELLOW};0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(d.point=e.point),""!=e.polyline&&null!=e.polyline&&(d.polyline=e.polyline)),this._tree.handler.setInputAction(function(e){(l=r._getPosition.getMousePosition(e))&&(0===n.length?c.showAt(e.endPosition,"左键开始绘制!"):c.showAt(e.endPosition,"右键结束绘制!"),2<=n.length&&(r._cesium.defined(a)?(n.length>r._points.length&&n.pop(),n.push(l)):a=new m(n),s=r._core.getSpaceDistance(n,r._cesium)),o&&(r._viewer.entities.remove(o),o=void 0),o=r._viewer.entities.add({name:"空间直线距离",position:n[n.length-1],label:{text:"总长:"+s,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),r._tree.temporaryItem.obj.push(o))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){r._viewer.camera.getPickRay(e.position);if(l=r._getPosition.getMousePosition(e)){0==n.length?n.push(l,l):n.length>r._points.length?(n.pop(),n.push(l)):n.push(l,l),2<=n.length&&(r._cesium.defined(a)||(a=new m(n)),s=r._core.getSpaceDistance(n,r._cesium)),o&&(r._viewer.entities.remove(o),o=void 0);var t=s;u="总长:"+s,i=r._viewer.entities.add({name:"空间直线距离",position:n[n.length-1],point:{pixelSize:5,color:d.point,outlineColor:r._cesium.Color.WHITE,outlineWidth:2,clampToGround:!0},label:{text:t,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),r._tree.temporaryItem.obj.push(i),r._points.push(i),h.spot.push(l),h.distance.push(s),h.label.push(i)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){r.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){c.show(!1),r._tree&&r._tree.endtemporaryItem(),r.end=void 0,o&&(r._viewer.entities.remove(o),o=void 0,n.pop()),r._points[r._points.length-1]&&(r._points[r._points.length-1].label.text=u),r._tree&&r._tree.handler.destroy(),r._core.mouse(r._viewer.container,0,"0"),"cancel"!==e?(n.length<2&&r.deleteObject(),""!=t&&null!=t&&"function"==typeof t&&t(h)):r.deleteObject()};var m=function(){function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:d.polyline,width:3,clampToGround:!1}},this.positions=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polyline.positions=new r._cesium.CallbackProperty(function(){return e.positions},!1);var t=r._viewer.entities.add(this.options);r.item=t,r._tree.temporaryItem.obj.push(t),h.ployline.push(t);var i=r._core.getuid();h.name="新建空间距离"+i},e}();return this},t.prototype.executeHorizontal=function(t,e){var h=this;this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(h._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene._imageryLayerCollection);var i,r,o=[],n=null,a="0米",s=null,d=(h=this,[]),l="",u=this._core.CreateTooltip(),c={spot:[],distance:[],label:[],ployline:[]},m={point:h._cesium.Color.RED,polyline:h._cesium.Color.YELLOW};0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(m.point=e.point),""!=e.polyline&&null!=e.polyline&&(m.polyline=e.polyline)),this._tree.handler.setInputAction(function(e){(s=h._getPosition.getMousePosition(e))&&(0===o.length?u.showAt(e.endPosition,"左键开始绘制!"):u.showAt(e.endPosition,"右键结束绘制!"),2<=o.length&&(h._cesium.defined(n)?(o.pop(),o.push(s)):n=new g(o),a=h._core.getSpaceDistance(o,h._cesium)),h._viewer.entities.remove(r),r=h._viewer.entities.add({name:"空间直线距离",position:o[o.length-1],label:{text:"总长:"+a,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),h._tree.temporaryItem.obj.push(r))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){h._viewer.camera.getPickRay(e.position);if(s=h._getPosition.getMousePosition(e)){p(s),0==o.length&&o.push(s.clone()),o.push(s);var t=a;l="总长:"+a,i=h._viewer.entities.add({name:"空间直线距离",position:o[o.length-1],point:{pixelSize:5,color:m.point,outlineColor:h._cesium.Color.WHITE,outlineWidth:2,clampToGround:!0},label:{text:t,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),h._tree.temporaryItem.obj.push(i),h._points.push(i),c.spot.push(s),c.distance.push(a),c.label.push(i)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK);var p=function(e){polylineCartographic.push(e);var t=[];if(1<polylineCartographic.length){var i=polylineCartographic[polylineCartographic.length-2],r=polylineCartographic[polylineCartographic.length-1],o=1e7*Math.abs(i.longitude-r.longitude),n=1e7*Math.abs(i.latitude-r.latitude);n<o&&(n=o);var a=parseInt(n/10);1e3<a&&(a=1e3),a<2&&(a=2);for(var s=0;s<a;++s)t.push(new h._cesium.Cartographic(h._cesium.Math.lerp(i.longitude,r.longitude,s/(a-1)),h._cesium.Math.lerp(i.latitude,r.latitude,s/(a-1))))}else t=polylineCartographic;if(0<t.length)for(var l=0;l<t.length;l++){e=t[l];var u=h._viewer.scene.globe.getHeight(e),c=h._cesium.Cartesian3.fromDegrees(e.longitude/Math.PI*180,e.latitude/Math.PI*180,u);d.push(c)}};this._tree.handler.setInputAction(function(e){u.show(!1),h._tree.endtemporaryItem(),h._viewer.entities.remove(r),h._points[h._points.length-1].label.text=l,h._tree.handler.destroy(),o.pop(),""!=t&&null!=t&&"function"==typeof t&&t(c)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK);var g=function(){function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:m.polyline,width:3,clampToGround:!1}},this.positions=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polyline.positions=new h._cesium.CallbackProperty(function(){return e.positions},!1);var t=h._viewer.entities.add(this.options);h.item=t,h._tree.temporaryItem.obj.push(t),c.ployline.push(t)},e}();return this},t.prototype.executeHorizontals=function(t,e){this._tree.removeHandler(),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+C.draw),this._tree.starttemporaryItem(this._viewer);var h=this,a=[],s="",d=[],l=void 0,i=h._viewer.scene,c=i.globe.ellipsoid,u={name:"",spot:[],distance:[],label:[],polyline:[]},m={point:h._cesium.Color.RED,polyline:h._cesium.Color.YELLOW};0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(m.point=e.point),""!=e.polyline&&null!=e.polyline&&(m.polyline=e.polyline));var r=new h._cesium.BillboardCollection;i.primitives.add(r);var p=new h._cesium.WebMercatorProjection;this._tree.handler=new h._cesium.ScreenSpaceEventHandler(i.canvas);var g,o=this._core.CreateTooltip(),f=[];this._tree.handler.setInputAction(function(e){var t;if(0===a.length?o.showAt(e.endPosition,"左键开始绘制!"):o.showAt(e.endPosition,"右键结束绘制!"),(t=h._getPosition.getMousePosition(e,u.polyline.concat(u.label)))&&h._cesium.Ellipsoid.WGS84.cartesianToCartographic(t)){var i=t;if(a.length<1)return;h._cesium.defined(l)?(l.path.pop(),l.path.push(i),f.pop(),f.push(i)):l=new _(a,h._cesium);var r=v(f);g&&(h._viewer.entities.remove(g),g=void 0),g=h._viewer.entities.add({name:"空间直线距离",position:l.path[l.path.length-1],label:{text:"总长:"+r,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}})}},h._cesium.ScreenSpaceEventType.MOUSE_MOVE);this._tree.handler.setInputAction(function(e){var t,i=h._getPosition.getMousePosition(e,u.polyline.concat(u.label));if(i&&(t=h._cesium.Ellipsoid.WGS84.cartesianToCartographic(i)),t){var r=i;0<f.length&&f.pop(),function(e){d.push(e);var t=[];if(1<d.length){var i=d[d.length-2],r=d[d.length-1],o=1e7*Math.abs(i.longitude-r.longitude),n=1e7*Math.abs(i.latitude-r.latitude);n<o&&(n=o);var a=parseInt(n/10);1e3<a&&(a=1e3),a<2&&(a=2);for(var s=0;s<a;++s)t.push(new h._cesium.Cartographic(h._cesium.Math.lerp(i.longitude,r.longitude,s/(a-1)),h._cesium.Math.lerp(i.latitude,r.latitude,s/(a-1))));t.push(r.clone())}else t=d;if(0<t.length)for(var l=0;l<t.length;l++){e=t[l];var u=h._viewer.scene.globe.getHeight(e),c=h._cesium.Cartesian3.fromRadians(e.longitude,e.latitude,u);f.push(c)}}(t),0===a.length?a.push(r,r):a.push(r),h._cesium.defined(l)||(l=new _(a,h._cesium)),g&&(h._viewer.entities.remove(g),g=void 0);var o="0米";l&&(o=v(f)),f.push(r),s="总长:"+o,u.spot.push(r),u.distance.push(o);var n=h._viewer.entities.add({position:r,point:{pixelSize:5,color:m.point,outlineColor:h._cesium.Color.WHITE,outlineWidth:1,clampToGround:!0},label:{text:o,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});u.label.push(n),h._points.push(n)}},h._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(){h.end()},h._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){h._tre&&h._tree.endtemporaryItem(),g&&h._viewer.entities.remove(g),h._points[h._points.length-1]&&(h._points[h._points.length-1].label.text=s),h._tree&&h._tree.handler.destroy(),h.end=void 0,h._core.mouse(h._viewer.container,0,"0"),a.pop(),o.show(!1),"cancel"!==e?(a.length<2&&h.deleteObject(),""!=t&&null!=t&&"function"==typeof t&&t(u)):h.deleteObject()};var v=function(e){for(var t,i,r,o,n,a,s=0,l="0米",u=0;u<e.length-1;u++)t=c.cartesianToCartographic(e[u]),r=(i=p.project(t)).x,o=i.y,t=c.cartesianToCartographic(e[u+1]),n=(i=p.project(t)).x,a=i.y,s+=Math.sqrt((r-n)*(r-n)+(o-a)*(o-a));return 0<s&&(l=s.toFixed(2)+"米"),1<=s/1e3&&(l=(s/1e3).toFixed(2)+"千米"),l},_=function(){function e(e,t){if(!h._cesium.defined(e))throw new h._cesium.DeveloperError("positions is required!");if(e.length<2)throw new h._cesium.DeveloperError("positions 的长度必须大于等于2");h._cesium.Material.fromType(h._cesium.Material.ColorType).uniforms.color=new h._cesium.Color(1,1,0,.5),this.options={name:"直线",polyline:{show:!0,positions:[],material:m.polyline,width:3,clampToGround:!0}},this.path=e,this._init(h._cesium)}return e.prototype._init=function(e){var t=this;this.options.polyline.positions=new h._cesium.CallbackProperty(function(){return t.path},!1),this.lineEntity=h._viewer.entities.add(this.options),h.item=this.lineEntity,u.polyline.push(this.lineEntity);var i=h._core.getuid();u.name="新建水平距离"+i},e}();return this},t.prototype.getHeight=function(e){var t=this._cesium.Cartographic.fromCartesian(e[0]),i=this._cesium.Cartographic.fromCartesian(e[1]).height-t.height;return i=i<1e3?i.toFixed(2)+"米":(i/=1e3).toFixed(2)+"千米"},t.prototype.executeHeight=function(r){var a=this;this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler(),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene._imageryLayerCollection);var s=[],t=null,l=0,i=this._core.CreateTooltip(),o=null;this._tree.handler.setInputAction(function(e){(o=a._getPosition.getMousePosition(e))&&(0===s.length?i.showAt(e.endPosition,"左键开始绘制!"):i.showAt(e.endPosition,"右键结束绘制!"),2<=s.length&&(a._cesium.defined(t)?(s.pop(),s.push(o)):t=new n(s),1<s.lenght&&(l=a._core.getHeight(s,a._cesium))))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){if(o=a._getPosition.getMousePosition(e)){var t=l+"米";if(0==s.length){s.push(o.clone()),s.push(o);var i=a._viewer.entities.add({name:"高度",position:s[0],point:{pixelSize:5,color:a._cesium.Color.RED,outlineColor:a._cesium.Color.WHITE,outlineWidth:2,clampToGround:!0,heightReference:a._cesium.HeightReference.none},label:{text:t,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});a._tree.temporaryItem.obj.push(i),a._points.push(i)}else 1<=s.length&&(a._tree.endtemporaryItem(),""!=r&&null!=r&&"function"==typeof r&&r(s))}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){a._tree.handler.destroy();var t=l+"米",i=a._cesium.Cartographic.fromCartesian(s[0]),r=a._cesium.Cartographic.fromCartesian(s[1]),o=a._cesium.Cartesian3.fromDegrees(cesium.Math.toDegrees(i.longitude),a._cesium.Math.toDegrees(i.latitude),r.height),n=a._viewer.entities.add({name:"直线距离",position:o,point:{pixelSize:5,color:a._cesium.Color.RED,outlineColor:a._cesium.Color.WHITE,outlineWidth:2,clampToGround:!0,heightReference:a._cesium.HeightReference.none},label:{text:t,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});a._tree.temporaryItem.obj.push(n),a._points.push(n)},this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var n=function(){function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:a._cesium.Color.YELLOW,clampToGround:!0,width:3},ellipse:{show:!1,material:a._cesium.Color.GREEN.withAlpha(.5),clampToGround:!0,outline:!0}},this.positions=e,this._init3()}return e.prototype._init3=function(){var o=this;this.options.polyline.positions=new a._cesium.CallbackProperty(function(){var e=[];e.push(o.positions[0]);var t=a._cesium.Cartographic.fromCartesian(o.positions[0]);try{var i=a._cesium.Cartographic.fromCartesian(o.positions[1])}catch(e){return}var r=a._cesium.Cartesian3.fromDegrees(a._cesium.Math.toDegrees(t.longitude),a._cesium.Math.toDegrees(t.latitude),i.height);return e.push(r),e},!1);var e=a._viewer.entities.add(this.options);a.item=e,a._tree.temporaryItem.obj.push(e)},e}();return this},t.prototype.executeHeightTe=function(t){this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+C.draw),this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer);this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene._imageryLayerCollection);var n,a=[],s=null,l=null,u=this,c={name:"",spot:[],kjdistance:"",spdistance:"",gddistance:"",point:[],polyline:[]},h=!1,o=this._core.CreateTooltip();function d(e){var t,i,r,o=u._cesium.Cartographic.fromCartesian(e[0]),n=u._cesium.Cartographic.fromCartesian(e[1]);n.height,n.height,o.height;return r=0<n.height-o.height?(t=u._cesium.Cartesian3.fromDegrees(u._cesium.Math.toDegrees(o.longitude),u._cesium.Math.toDegrees(o.latitude),n.height),i=[e[1],t],[e[0],t]):(t=u._cesium.Cartesian3.fromDegrees(u._cesium.Math.toDegrees(n.longitude),u._cesium.Math.toDegrees(n.latitude),o.height),i=[e[0],t],[e[1],t]),{new:t,eq_height:i,eq_lon_lat:r}}this._tree.handler.setInputAction(function(e){if(0===a.length?o.showAt(e.endPosition,"左键开始绘制!"):o.showAt(e.endPosition,"中键开启/关闭吸附,右键结束!"),(l=u._getPosition.getMousePosition(e,c.polyline.concat(c.point),0,h))&&2<=a.length)if(u._cesium.defined(s))a.pop(),a.push(l.clone()),n=d(a);else{s=new m(a);var t=u._viewer.entities.add({name:"高度测量",position:new u._cesium.CallbackProperty(function(){return a[1]},!1),point:{pixelSize:5,color:u._cesium.Color.RED,outlineColor:u._cesium.Color.WHITE,outlineWidth:2,heightReference:u._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}});u._tree.temporaryItem.obj.push(t),c.point.push(t),u._points.push(t),n=d(a);var i=u._viewer.entities.add({position:new u._cesium.CallbackProperty(function(){return u._cesium.Cartesian3.midpoint(n.eq_lon_lat[0],n.eq_lon_lat[1],new u._cesium.Cartesian3)},!1),name:"等经纬度",polyline:{show:!0,positions:new u._cesium.CallbackProperty(function(){return n.eq_lon_lat},!1),material:u._cesium.Color.GOLD,width:2},label:{text:new u._cesium.CallbackProperty(function(){var e=u.getHeight(n.eq_lon_lat),t="米",i=e;return i=-1!==e.indexOf("千米")?(t="千米",e.replace("千米","")):e.replace("米",""),e="高度:"+(e=(i=parseFloat(i))<0?(i=Math.abs(i))+t:i+t),c.gddistance=e},!1),font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});c.polyline.push(i),u._polylines.push(i);var r=u._viewer.entities.add({position:new u._cesium.CallbackProperty(function(){return u._cesium.Cartesian3.midpoint(n.eq_height[0],n.eq_height[1],new u._cesium.Cartesian3)},!1),name:"等高度直线",polyline:{show:!0,positions:new u._cesium.CallbackProperty(function(){return n.eq_height},!1),material:u._cesium.Color.GOLD,width:2},label:{text:new u._cesium.CallbackProperty(function(){var e=u._core.getHorizontalDistance(n.eq_height,u._cesium);return e="水平距离:"+e,c.spdistance=e},!1),font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});c.polyline.push(r),u._polylines.push(r)}},u._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){if(l=u._getPosition.getMousePosition(e,c.polyline.concat(c.point),0,h))if(0==a.length){a.push(l.clone()),a.push(l.clone()),n=d(a);var t=u._viewer.entities.add({name:"高度测量",position:a[0],point:{pixelSize:5,color:u._cesium.Color.RED,outlineColor:u._cesium.Color.WHITE,outlineWidth:2,heightReference:u._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}});u._tree.temporaryItem.obj.push(t),c.point.push(t),u._points.push(t)}else if(2<=a.length)if(u._cesium.defined(s))a.pop(),a.push(l.clone()),n=d(a);else{s=new m(a);var i=u._viewer.entities.add({name:"高度测量",position:new u._cesium.CallbackProperty(function(){return a[1]},!1),point:{pixelSize:5,color:u._cesium.Color.RED,outlineColor:u._cesium.Color.WHITE,outlineWidth:2,heightReference:u._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}});u._tree.temporaryItem.obj.push(i),c.point.push(i),u._points.push(i),n=d(a);var r=u._viewer.entities.add({position:new u._cesium.CallbackProperty(function(){return u._cesium.Cartesian3.midpoint(n.eq_lon_lat[0],n.eq_lon_lat[1],new u._cesium.Cartesian3)},!1),name:"等经纬度",polyline:{show:!0,positions:new u._cesium.CallbackProperty(function(){return n.eq_lon_lat},!1),material:u._cesium.Color.GOLD,width:2},label:{text:new u._cesium.CallbackProperty(function(){var e=u.getHeight(n.eq_lon_lat),t="米",i=e;return i=-1!==e.indexOf("千米")?(t="千米",e.replace("千米","")):e.replace("米",""),e="高度:"+(e=(i=parseFloat(i))<0?(i=Math.abs(i))+t:i+t),c.gddistance=e},!1),font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});c.polyline.push(r),u._polylines.push(r);var o=u._viewer.entities.add({position:new u._cesium.CallbackProperty(function(){return u._cesium.Cartesian3.midpoint(n.eq_height[0],n.eq_height[1],new u._cesium.Cartesian3)},!1),name:"等高度直线",polyline:{show:!0,positions:new u._cesium.CallbackProperty(function(){return n.eq_height},!1),material:u._cesium.Color.GOLD,width:2},label:{text:new u._cesium.CallbackProperty(function(){var e=u._core.getHorizontalDistance(n.eq_height,u._cesium);return e="水平距离:"+e,c.spdistance=e},!1),font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});c.polyline.push(o),u._polylines.push(o)}},u._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){h=!h},u._cesium.ScreenSpaceEventType.MIDDLE_CLICK),this._tree.handler.setInputAction(function(e){u.end()},u._cesium.ScreenSpaceEventType.RIGHT_CLICK),this._tree.handler.setInputAction(function(e){u.end()},u._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.end=function(e){u._tree.handler.destroy(),o.show(!1),u.end=void 0,u._tree.endtemporaryItem(),u._core.mouse(u._viewer.container,0,"0"),"cancel"!==e?""!=t&&null!=t&&"function"==typeof t&&t(c):u.deleteObject()};var m=function(){function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:u._cesium.Color.GOLD,width:2},label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=e,this._init()}return e.prototype._init=function(){var t=this;this.options.polyline.positions=new u._cesium.CallbackProperty(function(){return t.positions},!1),this.options.position=new u._cesium.CallbackProperty(function(){return u._cesium.Cartesian3.midpoint(n.eq_height[0],n.eq_height[1],new u._cesium.Cartesian3)},!1),this.options.label.text=new u._cesium.CallbackProperty(function(){var e=function(e){var t=u._cesium.Cartographic.fromCartesian(e[0]),i=u._cesium.Cartographic.fromCartesian(e[1]),r=new u._cesium.EllipsoidGeodesic;r.setEndPoints(t,i);var o=r.surfaceDistance;return o=1e3<=(o=Math.sqrt(Math.pow(o,2)+Math.pow(i.height-t.height,2)))?(o/1e3).toFixed(2)+"千米":o.toFixed(2)+"米"}(t.positions);return e="空间距离:"+e,c.kjdistance=e},!1);var e=u._viewer.entities.add(this.options);u.item=e,u._tree.temporaryItem.obj.push(e),c.polyline.push(e);var i=u._core.getuid();c.name="新建垂直高度"+i},e}();return this},t.prototype.executeHeightTe1=function(t){this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer);this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene._imageryLayerCollection);var i=[],r=null,o=null,n=null,a=null,s=this,l={spot:[],kjdistance:"",spdistance:"",gddistance:"",point:[],polyline:[]},u=this._core.CreateTooltip();function c(e){var t=s._cesium.Cartographic.fromCartesian(e[0]),i=s._cesium.Cartographic.fromCartesian(e[1]);i.height,i.height,t.height;return s._cesium.Cartesian3.fromDegrees(s._cesium.Math.toDegrees(t.longitude),s._cesium.Math.toDegrees(t.latitude),i.height)}this._tree.handler.setInputAction(function(e){0===i.length?u.showAt(e.endPosition,"左键开始绘制!"):u.showAt(e.endPosition,"右键结束绘制!"),(a=s._getPosition.getMousePosition(e))&&2<=i.length&&(s._cesium.defined(r)?(i.pop(),i.push(a.clone()),c(i)):r=new h(i),s._cesium.define(o)||(o=new d(i)),s._cesium.define(n)||(n=new m(i)))},s._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){if(0==i.length){if(!(a=s._getPosition.getMousePosition(e)))return;i.push(a.clone()),i.push(a.clone()),c(i);var t=s._viewer.entities.add({name:"高度测量",position:i[0],point:{pixelSize:5,color:s._cesium.Color.RED,outlineColor:s._cesium.Color.WHITE,outlineWidth:2,heightReference:s._cesium.HeightReference.none}});s._tree.temporaryItem.obj.push(t),l.point.push(t)}},s._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){s._tree.handler.destroy(),u.show(!1),s._tree.endtemporaryItem(),""!=t&&null!=t&&"function"==typeof t&&t(l)},s._cesium.ScreenSpaceEventType.RIGHT_CLICK);var h=function(){function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:s._cesium.Color.GOLD,width:2},label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=e,this._init()}return e.prototype._init=function(){var t=this;this.options.polyline.positions=new s._cesium.CallbackProperty(function(){return t.positions},!1),this.options.position=new s._cesium.CallbackProperty(function(){return t.positions[1].clone()},!1),this.options.label.text=new s._cesium.CallbackProperty(function(){var e=function(e){var t=s._cesium.Cartographic.fromCartesian(e[0]),i=s._cesium.Cartographic.fromCartesian(e[1]),r=new s._cesium.EllipsoidGeodesic;r.setEndPoints(t,i);var o=r.surfaceDistance;return o=1e3<=(o=Math.sqrt(Math.pow(o,2)+Math.pow(i.height-t.height,2)))?(o/1e3).toFixed(2)+"千米":o.toFixed(2)+"米"}(t.positions);return e="空间距离:"+e,l.kjdistance=e},!1);var e=s._viewer.entities.add(this.options);s._tree.temporaryItem.obj.push(e),l.polyline.push(e)},e}(),d=function(){function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:s._cesium.Color.GOLD,width:2},label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=e,this._init()}return e.prototype._init=function(){var t=this;this.options.polyline.positions=new s._cesium.CallbackProperty(function(){return t.positions},!1),this.options.position=new s._cesium.CallbackProperty(function(){return t.positions[1].clone()},!1),this.options.label.text=new s._cesium.CallbackProperty(function(){var e=function(e){var t=s._cesium.Cartographic.fromCartesian(e[0]),i=s._cesium.Cartographic.fromCartesian(e[1]),r=new s._cesium.EllipsoidGeodesic;r.setEndPoints(t,i);var o=r.surfaceDistance;return o=1e3<=(o=Math.sqrt(Math.pow(o,2)+Math.pow(i.height-t.height,2)))?(o/1e3).toFixed(2)+"千米":o.toFixed(2)+"米"}(t.positions);return e="空间距离:"+e,l.kjdistance=e},!1);var e=s._viewer.entities.add(this.options);s._tree.temporaryItem.obj.push(e),l.polyline.push(e)},e}(),m=function(){function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:s._cesium.Color.GOLD,width:2},label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=e,this._init()}return e.prototype._init=function(){var t=this;this.options.polyline.positions=new s._cesium.CallbackProperty(function(){return t.positions},!1),this.options.position=new s._cesium.CallbackProperty(function(){return t.positions[1].clone()},!1),this.options.label.text=new s._cesium.CallbackProperty(function(){var e=function(e){var t=s._cesium.Cartographic.fromCartesian(e[0]),i=s._cesium.Cartographic.fromCartesian(e[1]),r=new s._cesium.EllipsoidGeodesic;r.setEndPoints(t,i);var o=r.surfaceDistance;return o=1e3<=(o=Math.sqrt(Math.pow(o,2)+Math.pow(i.height-t.height,2)))?(o/1e3).toFixed(2)+"千米":o.toFixed(2)+"米"}(t.positions);return e="空间距离:"+e,l.kjdistance=e},!1);var e=s._viewer.entities.add(this.options);s._tree.temporaryItem.obj.push(e),l.polyline.push(e)},e}();return this},t.prototype.executeAngle=function(t){this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+C.draw),this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer);this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene._imageryLayerCollection);var s,l,u,c,h=[],d=null,m=null,p=this,g={name:"",spot:[],kjdistance:"",spdistance:"",gddistance:"",point:[],polyline:[],labels:[]},f=!1,v=this._core.CreateTooltip();function _(e){var t,i,r,o=p._cesium.Cartographic.fromCartesian(e[0]),n=p._cesium.Cartographic.fromCartesian(e[1]);n.height,n.height,o.height;return r=0<n.height-o.height?(t=p._cesium.Cartesian3.fromDegrees(p._cesium.Math.toDegrees(o.longitude),p._cesium.Math.toDegrees(o.latitude),n.height),i=[e[1],t],[e[0],t]):(t=p._cesium.Cartesian3.fromDegrees(p._cesium.Math.toDegrees(n.longitude),p._cesium.Math.toDegrees(n.latitude),o.height),i=[e[0],t],[e[1],t]),{new:t,eq_height:i,eq_lon_lat:r}}this._tree.handler.setInputAction(function(e){if(0===h.length?v.showAt(e.endPosition,"左键开始绘制!"):v.showAt(e.endPosition,"中键开启/关闭吸附,右键结束!"),(m=p._getPosition.getMousePosition(e,g.polyline.concat(g.point),0,f))&&2<=h.length){var t=p._core.ElevationAngle(u,m,p._cesium),i="",r="";if(r=u.z<=m.z?(i="角度:"+(90-Math.abs(t)).toFixed(2),"角度:"+Math.abs(t).toFixed(2)):(i="角度:"+Math.abs(t).toFixed(2),"角度:"+(90-Math.abs(t)).toFixed(2)),l.label.text=i,p._cesium.defined(d)?(c.position.setValue(m),c.label.text=r):(c=p._viewer.entities.add({position:m,name:"等经纬度",label:{text:r,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),g.labels.push(c),p._points.push(c)),p._cesium.defined(d))h.pop(),h.push(m.clone()),s=_(h);else{d=new y(h);var o=p._viewer.entities.add({name:"角度测量",position:new p._cesium.CallbackProperty(function(){return h[1]},!1),point:{pixelSize:5,color:p._cesium.Color.RED,outlineColor:p._cesium.Color.WHITE,outlineWidth:2,heightReference:p._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}});p._tree.temporaryItem.obj.push(o),g.point.push(o),p._points.push(o),s=_(h);var n=p._viewer.entities.add({position:new p._cesium.CallbackProperty(function(){return h[0]},!1),name:"等经纬度",polyline:{show:!0,positions:new p._cesium.CallbackProperty(function(){return s.eq_lon_lat},!1),material:p._cesium.Color.GOLD,width:2}});g.polyline.push(n),p._polylines.push(n);var a=p._viewer.entities.add({position:new p._cesium.CallbackProperty(function(){return h[1]},!1),name:"等高度直线",polyline:{show:!0,positions:new p._cesium.CallbackProperty(function(){return s.eq_height},!1),material:p._cesium.Color.GOLD,width:2}});g.polyline.push(a),p._polylines.push(a)}}},p._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){if(m=p._getPosition.getMousePosition(e,g.polyline.concat(g.point),0,f))if(0==h.length){u=m,l=p._viewer.entities.add({position:m,name:"等经纬度",label:{text:"0",font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),g.labels.push(l);var t=p._viewer.entities.add({position:new p._cesium.CallbackProperty(function(){return p._cesium.Cartesian3.midpoint(s.eq_lon_lat[0],s.eq_lon_lat[1],new p._cesium.Cartesian3)},!1),label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});h.push(m.clone()),h.push(m.clone()),s=_(h);var i=p._viewer.entities.add({name:"高度测量",position:h[0],point:{pixelSize:5,color:p._cesium.Color.RED,outlineColor:p._cesium.Color.WHITE,outlineWidth:2,heightReference:p._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}});p._tree.temporaryItem.obj.push(i),g.point.push(i),p._points.push(l,i)}else if(2<=h.length)if(p._cesium.defined(d))h.pop(),h.push(m.clone()),s=_(h);else{d=new y(h);var r=p._viewer.entities.add({name:"高度测量",position:new p._cesium.CallbackProperty(function(){return h[1]},!1),point:{pixelSize:5,color:p._cesium.Color.RED,outlineColor:p._cesium.Color.WHITE,outlineWidth:2,heightReference:p._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}});p._tree.temporaryItem.obj.push(r),g.point.push(r),p._points.push(r),s=_(h);t=p._viewer.entities.add({position:new p._cesium.CallbackProperty(function(){return p._cesium.Cartesian3.midpoint(s.eq_lon_lat[0],s.eq_lon_lat[1],new p._cesium.Cartesian3)},!1),name:"等经纬度",polyline:{show:!0,positions:new p._cesium.CallbackProperty(function(){return s.eq_lon_lat},!1),material:p._cesium.Color.GOLD,width:2},label:{text:new p._cesium.CallbackProperty(function(){var e=p.getHeight(s.eq_lon_lat),t="米",i=e;return i=-1!==e.indexOf("千米")?(t="千米",e.replace("千米","")):e.replace("米",""),e="高度:"+(e=(i=parseFloat(i))<0?(i=Math.abs(i))+t:i+t),g.gddistance=e},!1),font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});g.polyline.push(t),p._polylines.push(t);var o=p._viewer.entities.add({position:new p._cesium.CallbackProperty(function(){return p._cesium.Cartesian3.midpoint(s.eq_height[0],s.eq_height[1],new p._cesium.Cartesian3)},!1),name:"等高度直线",polyline:{show:!0,positions:new p._cesium.CallbackProperty(function(){return s.eq_height},!1),material:p._cesium.Color.GOLD,width:2},label:{text:new p._cesium.CallbackProperty(function(){var e=p._core.ElevationAngle(firtP,m,p._cesium);return e="角度:"+e.toFixed(2),g.spdistance=e},!1),font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(60,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});g.polyline.push(o),p._polylines.push(o)}},p._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){f=!f},p._cesium.ScreenSpaceEventType.MIDDLE_CLICK),this._tree.handler.setInputAction(function(e){p.end()},p._cesium.ScreenSpaceEventType.RIGHT_CLICK),this._tree.handler.setInputAction(function(e){p.end()},p._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.end=function(e){p._tree.handler.destroy(),v.show(!1),p._tree.endtemporaryItem(),p.end=void 0,p._core.mouse(p._viewer.container,0,"0"),"cancel"!==e?""!=t&&null!=t&&"function"==typeof t&&(this.labels=g.labels,t(g)):p.deleteObject()};var y=function(){function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:p._cesium.Color.GOLD,width:2},label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polyline.positions=new p._cesium.CallbackProperty(function(){return e.positions},!1),this.options.position=new p._cesium.CallbackProperty(function(){return p._cesium.Cartesian3.midpoint(e.positions[0],e.positions[1],new p._cesium.Cartesian3)},!1);var t=p._viewer.entities.add(this.options);p.item=t,p._tree.temporaryItem.obj.push(t),g.polyline.push(t);var i=p._core.getuid();g.name="新建垂直高度"+i},e}();return this},t.prototype.executeHeightDg=function(e){this._tree.removeHandler();var o=this;this._tree.handler=new o._cesium.ScreenSpaceEventHandler(o._viewer.scene._imageryLayerCollection);var n,a=[],t=null,i=null;this._tree.handler.setInputAction(function(e){(i=o._getPosition.getMousePosition(e))&&2<=a.length&&(o._cesium.defined(t)?(a.pop(),a.push(i.clone()),n=point_conf(a)):t=new r(a))},o._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){if(0==a.length){if(!(i=o._getPosition.getMousePosition(e)))return;a.push(i.clone()),a.push(i.clone());o._viewer.entities.add({parent:measure_entities,name:"多边形面积",position:a[0],point:{pixelSize:5,color:o._cesium.Color.RED,outlineColor:o._cesium.Color.WHITE,outlineWidth:2,heightReference:o._cesium.HeightReference.none}})}},o._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){o._tree.handler.destroy();var t=[],i=[];t.push(a[0].clone()),t.push(n.clone());var r=o.getHeight(t);o._viewer.entities.add({parent:measure_entities,name:"等经纬度",position:t[0].clone(),polyline:{show:!0,clampToGround:!0,positions:t,material:new o._cesium.PolylineDashMaterialProperty({color:o._cesium.Color.RED}),width:2},label:{text:r,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),i.push(n.clone()),i.push(a[1].clone()),r=getDistance(i)+"千米",o._viewer.entities.add({parent:measure_entities,name:"等高度直线",position:i[0].clone(),polyline:{show:!0,positions:i,clampToGround:!0,material:new o._cesium.PolylineDashMaterialProperty({color:o._cesium.Color.RED}),width:2},label:{text:r,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(60,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}})},o._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var r=function(){function e(e){this.options={parent:measure_entities,name:"直线",polyline:{show:!0,positions:[],clampToGround:!0,material:o._cesium.Color.GOLD,width:2},label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polyline.positions=new o._cesium.CallbackProperty(function(){return e.positions},!1),this.options.position=new o._cesium.CallbackProperty(function(){return e.positions[1].clone()},!1),this.options.label.text=new o._cesium.CallbackProperty(function(){return getSpaceDistance(e.positions)},!1),o._viewer.entities.add(this.options)},e}()},t.prototype.executeAnge=function(t){var i=this;this._tree.removeHandler(),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene._imageryLayerCollection);var r,o=[],n=null,a="",s=null,l=0,u={spot:[],distance:0,label:{},angle:0};this._tree.handler.setInputAction(function(e){i._viewer.camera.getPickRay(e.endPosition);if(s=i._getPosition.getMousePosition(e)){2<=o.length&&(i._cesium.defined(n)?(o.pop(),o.push(s)):n=new h(o),a=i._core.getSpaceDistance(o,i._cesium));var t=a;i._viewer.entities.remove(r),1<o.length&&(l=(180*Math.atan2(o[1].y-o[0].y,o[1].x-o[0].x)/Math.PI).toFixed(0),r=i._viewer.entities.add({name:"空间直线距离",position:o[o.length-1],label:{text:t+";"+l+"度",font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}))}},i._cesium.ScreenSpaceEventType.MOUSE_MOVE);var c=0;this._tree.handler.setInputAction(function(e){0<c&&(i._tree.handler.destroy(),o.pop());i._viewer.camera.getPickRay(e.position);if(s=i._getPosition.getMousePosition(e)){0==o.length&&o.push(s.clone()),o.push(s);u.spot.push(s),u.distance=a,u.label=r,i._points.push(r),u.angle=l,1==c&&""!=t&&null!=t&&"function"==typeof t&&t(u),c+=1}},i._cesium.ScreenSpaceEventType.LEFT_CLICK);var h=function(){function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:i._cesium.Color.YELLOW,width:3,clampToGround:!0}},this.positions=e,this._init6()}return e.prototype._init6=function(){var e=this;this.options.polyline.positions=new i._cesium.CallbackProperty(function(){return e.positions},!1);var t=i._viewer.entities.add(this.options);i.item=t},e}();return this},t.prototype.executeProfile=function(e,n){var a=this;this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene._imageryLayerCollection);var s,l=[],u=[],o=null,c=e.parameterd,h=e.objid,d=e.cyjj,m=(u=[],0),p=this._core.CreateTooltip(),g=null,f={spot:[],min:0,max:0,distance:0,label:{},cys:0,gcs:[]};this._tree.handler.setInputAction(function(e){0===l.length?p.showAt(e.endPosition,"左键开始绘制!"):p.showAt(e.endPosition,"再次点击结束绘制!");var t=a._viewer.camera.getPickRay(e.endPosition);if(g=a._viewer.scene.globe.pick(t,a._viewer.scene),a._viewer.scene.pick(e.endPosition)){var i=a._viewer.scene.pickPosition(e.endPosition);i&&(g=i)}if(g){2<=l.length&&(a._cesium.defined(o)?(l.pop(),l.push(g)):o=new y(l),m=a._core.getSpaceDistance(l,a._cesium));var r=m;a._viewer.entities.remove(s),1<l.length&&((180*Math.atan2(l[1].y-l[0].y,l[1].x-l[0].x)/Math.PI).toFixed(0),s=a._viewer.entities.add({name:"空间直线距离",position:l[l.length-1],label:{text:r,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),a._tree.temporaryItem.obj.push(s),a._points.push(s))}},a._cesium.ScreenSpaceEventType.MOUSE_MOVE);var v=0,_=[];this._tree.handler.setInputAction(function(e){0<v&&(a._tree.handler.destroy(),l.pop(),p.show(!1));var t=a._viewer.camera.getPickRay(e.position);if(g=a._viewer.scene.globe.pick(t,a._viewer.scene),a._viewer.scene.pick(e.position)){var i=a._viewer.scene.pickPosition(e.position);i&&(g=i)}if(g){if(0==l.length&&l.push(g.clone()),u.push(g),l.push(g),f.spot.push(g),f.label=s,1==v){a._tree.endtemporaryItem();var r=c;a._core.getPmfx(u,r,d,a._cesium,a._viewer,function(e){f.distance=e.juli,f.gcs=e.gcs,f.gcs=e.gcs,f.cys=e.cys,f.max=e.max,f.min=e.min,p.show(!1),""!=n&&null!=n&&"function"==typeof n&&n(f)})}else{var o={leftX:e.position.x,leftY:e.position.y};_.push(o)}v+=1}},a._cesium.ScreenSpaceEventType.LEFT_CLICK);var y=function(){function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:a._cesium.Color.YELLOW,width:2,clampToGround:!0}},this.positions=e,this._init10()}return e.prototype._init10=function(){var e=this;this.options.polyline.positions=new a._cesium.CallbackProperty(function(){return e.positions},!1);var t=a._viewer.entities.add(this.options);a.item=t,a._tree.temporaryItem.obj.push(t);a._core.isnull(w.selectedItem)||"group"!=w.selectedItem.type||w.selectedItem.id;var i=a._core.getuid(),r={id:i,name:"新建剖面分析"+i,pId:a._core.isnull(h)?0:h,type:"polyline",item:a};a.setTreeobj(r),w.insertGroupId(r,a._core.isnull(h)?0:h)},e}();return this},t.prototype.executeProfilePro=function(e,i){var o=this;this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var r=[],n=null,a=e.parameterd,s=e.objid,l=e.cyjj,u=this._core.CreateTooltip(),c=null,h={spot:[],min:0,max:0,distance:0,label:{},cys:0,gcs:[]};this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+C.draw),this._tree.handler.setInputAction(function(e){3<=r.length?u.showAt(e.endPosition,"右键结束绘制"):u.showAt(e.endPosition,"点击绘制剖面点");var t=o._viewer.camera.getPickRay(e.endPosition);if(c=o._viewer.scene.globe.pick(t,o._viewer.scene),o._viewer.scene.pick(e.endPosition)){var i=o._viewer.scene.pickPosition(e.endPosition);i&&(c=i)}c&&2<=r.length&&(o._cesium.defined(n)?(r.pop(),r.push(c)):n=new d(r))},o._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){o.end()},o._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){if(o._tree.handler.destroy(),o._core.mouse(o._viewer.container,0),o._tree.endtemporaryItem(),"pc"==o._core.getBrowser().pc&&r.pop(),u.show(!1),o.end=void 0,"cancel"!==e)if(r.length<=1)window.layuiLayer&&window.layuiLayer.msg("剖面点小于两点,请重新绘制");else{h.spot=r;var t=a;o._core.getPmfxPro(r,t,l,o._cesium,o._viewer,function(e){h.distance=e.juli,h.gcs=e.gcs,h.cys=e.cys,h.max=e.max,h.min=e.min,h.allPoint=e.allPoint,""!=i&&null!=i&&"function"==typeof i&&i(h)})}else o.item&&o._viewer.entities.remove(o.item)};this._tree.handler.setInputAction(function(e){var t=o._viewer.camera.getPickRay(e.position);if(c=o._viewer.scene.globe.pick(t,o._viewer.scene),o._viewer.scene.pick(e.position)){var i=o._viewer.scene.pickPosition(e.position);i&&(c=i)}c&&(0===r.length&&r.push(c.clone()),r.push(c),2<r.length&&(o._cesium.defined(n)||(n=new d(r))))},o._cesium.ScreenSpaceEventType.LEFT_CLICK);var d=function(){function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:o._cesium.Color.YELLOW,width:2,clampToGround:!0}},this.positions=e,this._init10()}return e.prototype._init10=function(){var e=this;this.options.polyline.positions=new o._cesium.CallbackProperty(function(){return e.positions},!1);var t=o._viewer.entities.add(this.options);o.item=t,o._tree.temporaryItem.obj.push(t);o._core.isnull(w.selectedItem)||"group"!=w.selectedItem.type||w.selectedItem.id;var i=o._core.getuid(),r={id:i,name:"新建剖面分析"+i,pId:o._core.isnull(s)?0:s,type:"polyline",item:o};o.setTreeobj(r),w.insertGroupId(r,o._core.isnull(s)?0:s)},e}();return this},t.prototype.executeAngeSdcs=function(n){var a=this;this._tree.removeHandler(),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene._imageryLayerCollection);var s,l=[],r=null,u=[],c=this._core.CreateTooltip(),h="",d=null,m=0,p={spot:[],distance:0,label:{},angle:0};this._tree.handler.setInputAction(function(e){0===l.length?c.showAt(e.endPosition,"左键开始绘制!"):c.showAt(e.endPosition,"再次点击结束绘制!");a._viewer.camera.getPickRay(e.endPosition);if((d=a._getPosition.getMousePosition(e))&&2<=l.length&&(a._cesium.defined(r)?(l.pop(),l.push(d)):r=new o(l),h=a._core.getSpaceDistance(l,a._cesium),2<=g)){a._viewer.entities.remove(s);var t=a._cesium.Cartographic.fromCartesian(l[l.length-1]),i={lon:a._cesium.Math.toDegrees(t.longitude),lat:a._cesium.Math.toDegrees(t.latitude),hei:t.height};u[2]=i,m=a._core.Angle(u[0],u[1],u[2]).toFixed(1),s=a._viewer.entities.add({name:"三点角度测量",position:l[l.length-1],label:{text:m+"度",font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),a._points.push(s)}},a._cesium.ScreenSpaceEventType.MOUSE_MOVE);var g=0;this._tree.handler.setInputAction(function(e){1<g&&(a._tree.handler.destroy(),l.pop());a._viewer.camera.getPickRay(e.position);if(d=a._getPosition.getMousePosition(e)){0==l.length&&l.push(d.clone()),l.push(d);var t=a._cesium.Cartographic.fromCartesian(l[l.length-1]),i=a._cesium.Math.toDegrees(t.longitude),r=a._cesium.Math.toDegrees(t.latitude),o=t.height;u.push({lon:i,lat:r,hei:o});p.spot.push(d),p.distance=h,2==g&&(c.show(!1),p.label=s,p.angle=m,""!=n&&null!=n&&"function"==typeof n&&n(p)),g+=1}},a._cesium.ScreenSpaceEventType.LEFT_CLICK);var o=function(){function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:a._cesium.Color.YELLOW,width:3,clampToGround:!1}},this.positions=e,this._init6()}return e.prototype._init6=function(){var e=this;this.options.polyline.positions=new a._cesium.CallbackProperty(function(){return e.positions},!1);var t=a._viewer.entities.add(this.options);a.item=t},e}();return this},t.prototype.executeAngeSd=function(s){this._tree.removeHandler();var l=[];this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+C.draw);var u=this,c=[],h=void 0,d=[],m=[];this._tree.starttemporaryItem(this._viewer);var p=this._core.CreateTooltip(),g=function(){function e(e){this.options={polyline:{show:!0,positions:[],material:u._cesium.Color.YELLOW,width:3,clampToGround:!1}},this.positionsp=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polyline.positions=new u._cesium.CallbackProperty(function(){return e.positionsp},!1),this.polyline=u._viewer.entities.add(this.options),u._tree.temporaryItem.obj.push(this.polyline),u.item=this.polyline},e}();this._tree.handler=new u._cesium.ScreenSpaceEventHandler(u._viewer.scene.canvas);var f=[],v=void 0;if(0<this._points.length)for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e]);this._tree.handler.setInputAction(function(e){var t=u._getPosition.getMousePosition(e);if(t){d.push(t);u._cesium.Cartographic.fromCartesian(t);if(0==f.length)f.push(t.clone()),f.push(t.clone()),h=t.clone();else{var i=u._core.ElevationAngle(h,t,u._cesium);1==l.length?m.push("俯仰角1 "+i.toFixed(2)):m.push("俯仰角2 "+i.toFixed(2)),v=void 0,(f=[]).push(h.clone()),f.push(h.clone()),v=new g(f),l.push(v.polyline)}if(2<=m.length){p.show(!1);var r=u._core.ThreePointAzimuth(d[0],d[1],d[2],u._cesium);m.push("水平角 "+r.toFixed(2));var o=u._viewer.entities.add({name:"三点角度测量",position:d[1],label:{text:m[0],font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});u._tree.temporaryItem.obj.push(o);var n=u._viewer.entities.add({name:"三点角度测量",position:d[2],label:{text:m[1],font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});u._tree.temporaryItem.obj.push(n);var a=u._viewer.entities.add({name:"三点角度测量",position:d[0],label:{text:m[2],font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});u._tree.temporaryItem.obj.push(a),c.push(o),c.push(n),c.push(a),f.pop(),u._tree.handler.destroy(),u._core.mouse(u._viewer.container,0,"0"),u._tree.endtemporaryItem(),u._points=c,u._polylines=l,u._polylines1=l,""!=s&&null!=s&&"function"==typeof s&&s({polylines:l,labels:c,angles:m})}}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){var t=u._getPosition.getMousePosition(e);t&&(0===f.length?p.showAt(e.endPosition,"左键开始绘制!"):f.length<=3?p.showAt(e.endPosition,"点击绘制目标点!"):p.showAt(e.endPosition,"再次点击结束绘制!"),2<=f.length&&(u._cesium.defined(v)?null!=t&&(f.pop(),t.y+=1+Math.random(),f.push(t)):(v=new g(f),l.push(v.polyline))))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);return this},t.prototype.deleteObject=function(){if(this.item&&this.item.item?this._viewer.entities.remove(this.item.item):this._viewer.entities.remove(this.item),this._points&&0<this._points.length){for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e]);this._points=[]}if(this._polylines&&0<this._polylines.length){for(e=0;e<this._polylines.length;e++)this._viewer.entities.remove(this._polylines[e]);this._polylines=[]}if(this.labels&&0<this.labels.length){for(e=0;e<this.labels.length;e++)this._viewer.entities.remove(this.labels[e]);this.labels=[]}if(this.item&&this.item._points&&0<this.item._points.length){for(e=0;e<this.item._points.length;e++)this._viewer.entities.remove(this.item._points[e]);this.item._points=[]}if(this.item&&this.item._polylines&&0<this.item._polylines.length){for(e=0;e<this.item._polylines.length;e++)this._viewer.entities.remove(this.item._polylines[e]);this.item._polylines=[]}},t.prototype.setHeightType=function(e){try{1==e?this.item._polyline.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._polyline.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._polyline.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},t.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show._value,t=this.item.polyline.positions.getValue(),i=null==this.item.polyline.width?void 0:this.item.polyline.width._value,r=this.item.polyline.material;null!=r&&(r={color:null==r.color?void 0:"rgba("+r.color._value.red+","+r.color._value.green+","+r.color._value.blue+","+r.color._value.alpha+")",image:null==r.image?void 0:r.image._value,diffusemap:null==r.diffusemap?void 0:r.diffusemap._value,alphamap:null==r.alphamap?void 0:r.alphamap._value});var o=null==this.item.polyline.clampToGround?void 0:this.item.polyline.clampToGround._value,n=this.item.polyline.distanceDisplayCondition,a=null==n?void 0:n._value.near,s=null==n?void 0:n._value.far;return{type:"polyline",treeobj:{name:this.treeobj.name},style:{show:e,positions:t,width:i,material:r,clampToGround:o,near:a,far:s}}},t.prototype.setVisibility=function(e){if(this.item&&this.item.item?this.item.item.show=e:this.item.show=e,this.item&&this.item._points&&0<this.item._points.length)for(var t=0;t<this.item._points.length;t++)this.item._points[t].show=e;if(this._polylines&&0<this._polylines.length)for(t=0;t<this._polylines.length;t++)this._polylines[t].show=e;if(this._points&&0<this._points.length)for(t=0;t<this._points.length;t++)this._points[t].show=e;if(this.item&&this.item._polylines&&0<this.item._polylines.length)for(t=0;t<this.item._polylines.length;t++)this.item._polylines[t].show=e},t.prototype.getVisibility=function(){return this.item.show},t.prototype.setOutlinewidth=function(e){this.item._polyline.material.outlineWidth=e},t.prototype.setMaterial=function(e){try{this._core.extend({outlineWidth:3},e,!0);this.item._polyline.material=new this._cesium.PolylineGlowMaterialProperty(e),this.item.material=this.item._polyline.material}catch(e){console.log(e)}return this},t.prototype.setPolylineWall=function(e){try{for(var t=[],i=[],r=this.item._polyline.positions.getValue(),o=this._viewer.scene.globe.ellipsoid,n=0;n<r.length;n++){var a=new this._cesium.Cartesian3(r[n].x,r[n].y,r[n].z),s=o.cartesianToCartographic(a),l=this._cesium.Math.toDegrees(s.latitude),u=this._cesium.Math.toDegrees(s.longitude);t.push(u),t.push(l),i.push(e)}t=this._cesium.Cartesian3.fromDegreesArray(t),this.item.wall=new this._cesium.WallGraphics({positions:t,minimumHeights:i,material:this.item._polyline.material.color._value})}catch(e){console.log(e)}return this},t.prototype.setRadius=function(e){try{for(var t=[],i=this.item._polyline.positions.getValue(),r=this._viewer.scene.globe.ellipsoid,o=0;o<i.length;o++){var n=new this._cesium.Cartesian3(i[o].x,i[o].y,i[o].z),a=r.cartesianToCartographic(n),s=this._cesium.Math.toDegrees(a.latitude),l=this._cesium.Math.toDegrees(a.longitude);t.push(l),t.push(s)}t=this._cesium.Cartesian3.fromDegreesArray(t),this.item.corridor=new this._cesium.CorridorGraphics({positions:t,width:e,show:!0,outline:!0,material:this._cesium.Color.RED.withAlpha(.4),heightReference:this._cesium.HeightReference.none})}catch(e){console.log(e)}return this},t.prototype.setGlow=function(e){try{this.item._polyline.material=e?new this._cesium.PolylineGlowMaterialProperty({glowPower:.2,taperPower:.5,color:this.item._polyline.material.color}):new this._cesium.PolylineOutlineMaterialProperty({color:this.item._polyline.material.color,outlineWidth:this.item._polyline.material.outlineWidth,outlineColor:this.item._polyline.material.outlineColor}),this.item.material=this.item._polyline.material}catch(e){console.log(e)}return this},t.prototype.setMaterialAlpha=function(e){try{this.item._polyline.material.color._value.alpha=e,this.item.material=this.item._polyline.material}catch(e){console.log(e)}return this},t.prototype.setType=function(e){try{"PolylineDashMaterialProperty"==e?this.item._polyline.material=new this._cesium.PolylineDashMaterialProperty({color:this.item._polyline.material.color}):"PolylineArrowMaterialProperty"==e?this.item._polyline.material=new this._cesium.PolylineArrowMaterialProperty({color:this.item._polyline.material.color}):"PolylineOutlineMaterialProperty"==e&&(this.item._polyline.material=new this._cesium.PolylineOutlineMaterialProperty({color:this.item._polyline.material.color}))}catch(e){console.log(e)}return this},t.prototype.setMaterialColor=function(e){try{this.item._polyline.material.color=new u(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},t.prototype.setOutlineColor=function(e){try{this.item._polyline.material.outlineColor=new u(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},t.prototype.setClampToGround=function(e){try{this.item._polyline.clampToGround=e}catch(e){console.log(e)}return this},t.prototype.setWidth=function(e){try{this.item._polyline.width=e}catch(e){console.log(e)}return this},t.prototype.setDistanceDisplayCondition=function(e,t){var i=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._polyline.distanceDisplayCondition=i}catch(e){console.log(e)}return this},Object.defineProperties(t.prototype,{HighLight:{set:function(e){e&&(this.item.material=this.item.polyline.material),this.item.polyline.material=e?new this._cesium.PolylineGlowMaterialProperty({glowPower:.8,color:this._cesium.Color.ORANGERED.withAlpha(.9)}):this.item.material}},polylinemMterial:{set:e.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._Color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.polyline.material=e,this.item.material=this.item.polyline.material)},500),get:function(){var e=this.item.polyline.material;if(e)try{return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}},polylinemArcType:{set:e.debounce(function(e){this._core.isnull(e)||(this.item.polyline.arcType=e)},500),get:function(){var e=this.item.polyline.arcType;if(e)return e._value}},polylineWidth:{set:e.debounce(function(e){this._core.isnull(e)||(e=parseFloat(e),this.item.polyline.width=e)},500),get:function(){var e=this.item.polyline.width;if(e)return e._value}}}),Object.defineProperties(t.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),Object.defineProperties(t.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),Object.defineProperties(t.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(t.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(t.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(t.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),t.prototype.setItem=function(e){this.item=e},t.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(t.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(t.prototype,{polylineTempOptions:{get:function(){return{positions:[],arcType:ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE}}}}),Object.defineProperties(t.prototype,{MaterialColor:{get:function(){return new u(this._viewer,this._cesium).toHtmlColor("rgb("+255*this.item._polyline.material.color._value.red+","+255*this.item._polyline.material.color._value.green+","+255*this.item._polyline.material.color._value.blue+")")}},Height:{get:function(){return this.item._polyline.height}},Visibility:{get:function(){return this.item.show}},Outlinewidth:{get:function(){return this.item._polyline.material.outlineWidth._value}},OutlineColor:{get:function(){var e=this.item._polyline.material.outlineColor;return e?(e=e._value,new u(this._viewer,this._cesium).toHtmlColor("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")")):"#ff0000"}},ClampToGround:{get:function(){return this.item._polyline.clampToGround}},Width:{get:function(){return this.item._polyline.width._value}},Type:{get:function(){return this.item._polyline.material instanceof this._cesium.PolylineDashMaterialProperty?"PolylineDashMaterialProperty":this.item._polyline.material instanceof this._cesium.PolylineArrowMaterialProperty?"PolylineArrowMaterialProperty":"PolylineOutlineMaterialProperty"}},Glow:{get:function(){return this.item._polyline.material instanceof this._cesium.PolylineGlowMaterialProperty}},MaterialAlpha:{get:function(){return 100*this.item._polyline.material.color._value.alpha}}}),t.prototype.CreatePolyline=function(e,t,i,r,o){this._Geometry=e;var n={color:this._cesium.Color.YELLOW,outlineColor:this._cesium.Color.BLACK,width:10,show:!0,AltitudeType:this._cesium.defaultValue(i,999)};t&&""!==t&&(n.color=new u(this._viewer,this._cesium).colorFromHtmlColor(t));for(var a=[],s=0;s<e.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(e[s].x,e[s].y));this.item=this._viewer.entities.add({name:o,polyline:{positions:a,width:n.width,material:new this._cesium.PolylineGlowMaterialProperty({outlineColor:n.outlineColor,color:n.color})}});var l={id:this.item.id,name:o,pId:this._core.isnull(r)?0:r,type:"polyline",item:this};return this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(r)?0:r),this},t.prototype.forceEndHanlder=function(){this.handler&&(this.handler.destroy(),this.handler=void 0),this._tree.handler&&(this._tree.handler.destroy(),this._tree.handler=void 0)},t}),define("SGWorld/Creator/PolylineVolume",["./Color","../Core/Core","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min"],function(e,i,r,a){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=r}return t.prototype.createPolylineVolume=function(e,t,i,r,o){var n={positions:[],shape:this.starPositions(7,3e4,2e4),material:this._cesium.Color.fromRandom({alpha:1})};if(!this._core.isnull(r)){r=this._core.extend(n,r,!0);var a=[];if(t[0].x||t[0].y)if(t[0].z)for(s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s].x,t[s].y,t[s].z));else for(s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s].x,t[s].y));else if(2===t[0].length)for(var s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s][0],t[s][1]));else if(3===t[0].length)for(var s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s][0],t[s][1],t[s][2]));r.positions=a,"circle"===i?r.shape=this.computeCircle(r.radius||10):"star"===i?(r.shape=this.starPositions(r.arms||7,r.rOuter||30,r.rInner||20),r.cornerType=Cesium.CornerType.MITERED):"box"===i&&(r.radius=r.radius||10,r.shape=[new this._cesium.Cartesian2(-r.radius,-r.radius),new this._cesium.Cartesian2(r.radius,-r.radius),new this._cesium.Cartesian2(r.radius,r.radius),new this._cesium.Cartesian2(-r.radius,r.radius)],r.cornerType=Cesium.CornerType.BEVELED);var l=this._viewer.entities.add({id:this._core.getuid(),name:e,polylineVolume:r});return this.item=l,this._tree.insertGroupId({id:l.id,name:e,pId:this._core.isnull(o)?0:o,type:"polylinevolume",item:this},this._core.isnull(o)?0:o),this}console.log("options is required")},t.prototype.getstyles=function(){var e={};return e.show=!this.item.polylineVolume.show||this.item.polylineVolume.show._value,e.positions=this.item.polylineVolume.positions.getValue().toString(),e.shape=this.item.polylineVolume.shape.toString(),e.cornerType=this.item.polylineVolume.cornerType?this.item.polylineVolume.cornerType.toString():null,e.granularity=this.item.polylineVolume.granularity?this.item.polylineVolume.granularity.toString():null,e.fill=this.item.polylineVolume.fill?this.item.polylineVolume.fill._value:null,e.material=this.item.polylineVolume.material?this.item.polylineVolume.material.toString():null,e.outline=this.item.polylineVolume.outline?this.item.polylineVolume.outline._value:null,e.outlineWidth=this.item.polylineVolume.outlineWidth?this.item.polylineVolume.outlineWidth.toString():null,e.outlineColor=this.item.polylineVolume.outlineColor&&this.item.polylineVolume.outlineColor._value?"rgba"+this.item.polylineVolume.outlineColor.toString():null,e.near=this.item.polylineVolume.distanceDisplayCondition?this.item.polylineVolume.distanceDisplayCondition._value.near:null,e.far=this.item.polylineVolume.distanceDisplayCondition?this.item.polylineVolume.distanceDisplayCondition._value.far:null,e},t.prototype.executeWall=function(t,i){var l=[],r=void 0,u=this,o=function(){function e(e){this.options={id:u._core.getuid(),type:"wall",wall:{positions:[],minimumHeights:[2e3,2e3],maximumHeights:[1e3,1e3],material:u._cesium.Color.AQUA.withAlpha(1)}},this.positions=e,this._init()}return e.prototype._init=function(){var s=this;this.options.wall.maximumHeights=new u._cesium.CallbackProperty(function(){for(var e=[],t=0;t<s.positions.length;t++)e.push(2e3);return e},!1),this.options.wall.minimumHeights=new u._cesium.CallbackProperty(function(){for(var e=[],t=0;t<s.positions.length;t++)e.push(1e3);return e},!1),this.options.wall.positions=new u._cesium.CallbackProperty(function(){for(var e=[],t=0;t<s.positions.length;t++){if(!l[t])return;var i=u._viewer.scene.globe.ellipsoid,r=new u._cesium.Cartesian3(l[t].x,l[t].y,l[t].z),o=i.cartesianToCartographic(r),n=u._cesium.Math.toDegrees(o.latitude),a=u._cesium.Math.toDegrees(o.longitude);o.height,e.push(a),e.push(n)}return u._cesium.Cartesian3.fromDegreesArray(e)},!1);var e=u._viewer.entities.add(this.options);u.item=e,u._tree.insertGroupId({id:this.options.id,name:t,pId:u._core.isnull(i)?0:i,type:"wall",item:u},u._core.isnull(i)?0:i)},e}(),n=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);n.setInputAction(function(e){var t=u._viewer.scene.camera.pickEllipsoid(e.position,u._viewer.scene.globe.ellipsoid);0==l.length&&l.push(a.clone(t)),l.push(a.clone(t))},u._cesium.ScreenSpaceEventType.LEFT_CLICK),n.setInputAction(function(e){var t=u._viewer.scene.camera.pickEllipsoid(e.endPosition,u._viewer.scene.globe.ellipsoid);1<=l.length&&(u._cesium.defined(r)?(l.pop(),l.push(t)):r=new o(l))},u._cesium.ScreenSpaceEventType.MOUSE_MOVE),n.setInputAction(function(e){n.destroy(),l.pop()},u._cesium.ScreenSpaceEventType.RIGHT_CLICK)},t.prototype.starPositions=function(e,t,i){for(var r=Math.PI/e,o=[],n=0;n<2*e;n++){var a=n%2==0?t:i,s=new this._cesium.Cartesian2(Math.cos(n*r)*a,Math.sin(n*r)*a);o.push(s)}return o},t.prototype.computeCircle=function(e){for(var t=[],i=0;i<360;i++){var r=this._cesium.Math.toRadians(i);t.push(new this._cesium.Cartesian2(e*Math.cos(r),e*Math.sin(r)))}return t},t.prototype.setVisibility=function(e){this.item.polylineVolume.show=e},t.prototype.getVisibility=function(){return this.item.polylineVolume.show},t.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},Object.defineProperties(t.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),Object.defineProperties(t.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),t.prototype.setItem=function(e){this.item=e},t.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(t.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(t.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(t.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(t.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Object.defineProperties(t.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(t.prototype,{wallTempOptions:{get:function(){return{positions:[],maximumHeights:[],minimumHeights:[],show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,granularity:this._cesium.Math.RADIANS_PER_DEGREE,shadows:ShadowMode.DISABLED,distanceDisplayCondition:null}}}}),t}),define("SGWorld/Creator/Corridor",["../Core/Core","../ProjectTree/treeSource"],function(i,r){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=r}return e.prototype.createCorridor=function(e,t,i,r){var o={show:!0,material:this._cesium.Color.RED.withAlpha(.5),width:1e3};if(!this._core.isnull(i)){i=this._core.extend(o,i,!0);var n=[];if(t[0].x||t[0].y)if(void 0!==t[0].z)for(a=0;a<t.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(t[a].x,t[a].y,t[a].z));else for(a=0;a<t.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(t[a].x,t[a].y));else if(2===t[0].length)for(var a=0;a<t.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(t[a][0],t[a][1]));else if(3===t[0].length)for(var a=0;a<t.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(t[a][0],t[a][1],t[a][2]));i.positions=n;var s=this._viewer.entities.add({name:e,id:this._core.getuid(),corridor:i});return this.item=s,this._tree.insertGroupId({id:s.id,name:e,pId:this._core.isnull(r)?0:r,type:"corridor",item:this},this._core.isnull(r)?0:r),this}console.log("options is required")},e.prototype.getstyles=function(){var e={};return e.show=!this.item.ellipse.show||this.item.ellipse.show._value,e.positions=this.item.ellipse.positions?this.item.ellipse.positions.getValue().toString():void 0,e.width=this.item.ellipse.width&&this.item.ellipse.width._value?this.item.ellipse.width.toString():void 0,e.height=this.item.ellipse.height&&this.item.ellipse.height._value?this.item.ellipse.height.toString():void 0,e.heightReference=this.item.ellipse.heightReference&&this.item.ellipse.heightReference._value?this.item.ellipse.heightReference._value:void 0,e.extrudedHeight=this.item.ellipse.extrudedHeight&&this.item.ellipse.extrudedHeight.getValue()?this.item.ellipse.extrudedHeight.getValue():void 0,e.extrudedHeightReference=this.item.ellipse.extrudedHeightReference&&this.item.ellipse.extrudedHeightReference._value?this.item.ellipse.extrudedHeightReference._value:void 0,e.cornerType=this.item.ellipse.cornerType?this.item.ellipse.cornerType._value:void 0,e.material={},tyles.material.color=this.item.ellipse.material&&this.item.ellipse.material.color&&this.item.ellipse.material.color._value?this.item.ellipse.material.color.toString():void 0,e.material.image=this.item.ellipse.material&&this.item.ellipse.material.image&&this.item.ellipse.material.image._value?this.item.ellipse.material.image._value:void 0,e.material.repeat=this.item.ellipse.material&&this.item.ellipse.material.repeat&&this.item.ellipse.material.repeat._value?this.item.ellipse.material.repeat._value:void 0,e.fill=this.item.ellipse.fill?this.item.ellipse.fill._value:void 0,e.outline=this.item.ellipse.outline?this.item.ellipse.outline._value:void 0,e.outlineWidth=this.item.ellipse.outlineWidth&&this.item.ellipse.outlineWidth._value?this.item.ellipse.outlineWidth._value:void 0,e.outlineColor=this.item.ellipse.outlineColor&&this.item.ellipse.outlineColor._value?"rgba"+this.item.ellipse.outlineColor.toString():void 0,e.near=this.item.ellipse.distanceDisplayCondition?this.item.ellipse.distanceDisplayCondition._value.near:void 0,e.far=this.item.ellipse.distanceDisplayCondition?this.item.ellipse.distanceDisplayCondition._value.far:void 0,e.position=this.item.position.getValue().toString(),e},e.prototype.setVisibility=function(e){this.item.show=e},e.prototype.getVisibility=function(){return this.item.show},e.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},e.prototype.setItem=function(e){this.item=e},e.prototype.setTreeobj=function(e){this.treeobj=e},e}),define("SGWorld/Creator/Rectangle",["../configData","./Color","../Core/Core","../ProjectTree/treeSource","../Navigate/getPosition"],function(r,d,i,m,o){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=m,this._viewEvent=null,this.positions=[],this._getPosition=new o(this._viewer,this._cesium),this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.style=null,this.state=0,this.gonRectangleArr=[]}return e.prototype.createRectangle=function(o,n){var a=this,s=this;this._tree.removeHandler(),!o&&(o={});var l,u=[];a.shape={points:[],button:0,rect:null,entity:null};var c={fillColor:this._cesium.Color.YELLOW.withAlpha(.4),outlineColor:this._cesium.Color.RED};o&&o.fillColor&&(c.fillColor=new d(this._viewer,this._cesium).colorFromHtmlColor(fillColor)),o&&o.outlineColor&&(c.outlineColor=new d(this._viewer,this._cesium).colorFromHtmlColor(outlineColor)),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(s._viewer.scene.canvas),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+r.draw);var h=null;this._tree.handler.setInputAction(function(e){l=s._getPosition.getMousePosition(e,[a.shape.entity]);var t=s._getPosition.getMouseDegrees(e,[a.shape.entity]);if(1<=a.shape.button){var i={obj1:h,obj2:t},r={position:s._viewer.camera.position.clone(),orientation:{heading:s._viewer.camera.heading,pitch:s._viewer.camera.pitch,roll:s._viewer.camera.roll}};"function"==typeof n&&n({originalCameraLocation:r,pointes:i,terrainExaggeration:"5",zj:"true"}),s._tree.handler.removeInputAction(s._cesium.ScreenSpaceEventType.MOUSE_MOVE),s._tree.handler.removeInputAction(s._cesium.ScreenSpaceEventType.LEFT_CLICK)}else h=t;a.shape.button=a.shape.button+1,l&&(0==a.shape.points.length?(u.push(l),a.shape.points.push(s._viewer.scene.globe.ellipsoid.cartesianToCartographic(l)),a.shape.rect=s._cesium.Rectangle.fromCartographicArray(a.shape.points),a.shape.rect.east+=1e-6,a.shape.rect.north+=1e-6,a.shape.entity=s._viewer.entities.add({rectangle:{coordinates:a.shape.rect,material:c.fillColor,outline:!0,outlineWidth:2,outlineColor:c.outlineColor,height:o&&o.height,heightReference:o&&o.heightReference}}),a.shape.entity.rectangle.coordinates=new s._cesium.CallbackProperty(function(){return a.shape.rect},!1),a.bufferEntity=a.shape.entity,s.item=a.shape.entity):(s._core.mouse(s._viewer.container,0,"0"),a.shape.entity.rectangle.coordinates=s._cesium.Rectangle.clone(a.shape.rect),s._tree.handler.removeInputAction(s._cesium.ScreenSpaceEventType.MOUSE_MOVE),s._tree.handler.removeInputAction(s._cesium.ScreenSpaceEventType.LEFT_CLICK)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),s._tree.handler.setInputAction(function(e){if(0!=a.shape.points.length){var t=s._getPosition.getMousePosition(e,[a.shape.entity]);t&&(u[1]=t,a.shape.points[1]=s._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),a.shape.rect=s._cesium.Rectangle.fromCartographicArray(a.shape.points),a.shape.rect.west==a.shape.rect.east&&(a.shape.rect.east+=1e-6),a.shape.rect.south==a.shape.rect.north&&(a.shape.rect.north+=1e-6))}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);var e=0;s._core.isnull(m.selectedItem)||"group"!=m.selectedItem.type||(e=m.selectedItem.id);var t=s._core.getuid(),i={id:t,name:"新建矩形"+t,pId:s._core.isnull(e)?0:e,type:"rectangle",item:s};return s.setTreeobj(i),m.insertGroupId(i,s._core.isnull(e)?0:e),this},e.prototype.getstyles=function(){var e={};return e.show=!this.item.rectangle.show||this.item.rectangle.show._value,e.coordinates=this.item.rectangle.coordinates?{east:this.item.rectangle.coordinates.getValue().east,north:this.item.rectangle.coordinates.getValue().north,south:this.item.rectangle.coordinates.getValue().south,west:this.item.rectangle.coordinates.getValue().west}:[],e.height=this.item.rectangle.height?this.item.rectangle.height.toString():0,e.heightReference=this.item.rectangle.heightReference?this.item.rectangle.heightReference.toString():0,e.extrudedHeight=this.item.rectangle.extrudedHeight?this.item.rectangle.extrudedHeight.getValue().toString():0,e.extrudedHeightReference=this.item.rectangle.extrudedHeightReference?this.item.rectangle.extrudedHeightReference.toString():0,e.rotation=this.item.rectangle.rotation?this.item.rectangle.rotation.toString():0,e.stRotation=this.item.rectangle.stRotation?this.item.rectangle.stRotation.toString():0,e.granularity=this.item.rectangle.granularity&&this.item.rectangle.granularity._value?this.item.rectangle.granularity._value:void 0,e.fill=this.item.rectangle.fill?this.item.rectangle.fill._value:0,e.outline=this.item.rectangle.outline?this.item.rectangle.outline._value:0,e.outlineWidth=this.item.rectangle.outlineWidth&&this.item.rectangle.outlineWidth._value?this.item.rectangle.outlineWidth._value.toString():1,e.outlineColor=this.item.rectangle.outlineColor&&this.item.rectangle.outlineColor._value?"rgba"+this.item.rectangle.outlineColor.toString():null,e.material={},e.material.color=this.item.rectangle.material&&this.item.rectangle.material.color&&this.item.rectangle.material.color._value?"rgba"+this.item.rectangle.material.color.toString():null,e.material.image=this.item.rectangle.material&&this.item.rectangle.material.image&&this.item.rectangle.material.image._value?this.item.rectangle.material.image.toString():null,e.material.repeat=this.item.rectangle.material&&this.item.rectangle.material.repeat&&this.item.rectangle.material.repeat._value?this.item.rectangle.material.repeat._value:null,e.classificationType=this.item.rectangle.classificationType?this.item.rectangle.classificationType.toString():null,e.near=this.item.rectangle.distanceDisplayCondition?this.item.rectangle.distanceDisplayCondition._value.near:null,e.far=this.item.rectangle.distanceDisplayCondition?this.item.rectangle.distanceDisplayCondition._value.far:null,e},e.prototype.createRectangleOptimization=function(n,a){var s=this;this._tree.removeHandler();var l,u=[];s.shape={points:[],button:0,rect:null,entity:null};var c={fillColor:this._cesium.Color.YELLOW.withAlpha(.4),outlineColor:this._cesium.Color.RED};n&&n.fillColor&&(c.fillColor=new d(this._viewer,this._cesium).colorFromHtmlColor(fillColor)),n&&n.outlineColor&&(c.outlineColor=new d(this._viewer,this._cesium).colorFromHtmlColor(outlineColor)),this.handler=new this._cesium.ScreenSpaceEventHandler(s._viewer.scene.canvas);var h=null;this.handler.setInputAction(function(e){l=s._core.getPointFromWindowPoint(e.position,s._viewer);var t=s._viewer.camera.pickEllipsoid(e.position,s._viewer.scene.globe.ellipsoid);if(1<=s.shape.button){var i={obj1:h,obj2:t},r={position:s._viewer.camera.position.clone(),orientation:{heading:s._viewer.camera.heading,pitch:s._viewer.camera.pitch,roll:s._viewer.camera.roll}};"function"==typeof a&&a({originalCameraLocation:r,pointes:i,terrainExaggeration:"5",zj:"true"}),s.handler.removeInputAction(s._cesium.ScreenSpaceEventType.MOUSE_MOVE),s.handler.removeInputAction(s._cesium.ScreenSpaceEventType.LEFT_CLICK)}else h=t;if(s.shape.button=s.shape.button+1,l){0==s.shape.points.length?(u.push(l),s.shape.points.push(s._viewer.scene.globe.ellipsoid.cartesianToCartographic(l)),s.shape.rect=s._cesium.Rectangle.fromCartographicArray(s.shape.points),s.shape.rect.east+=1e-6,s.shape.rect.north+=1e-6,s.shape.entity=s._viewer.entities.add({rectangle:{coordinates:s.shape.rect,material:c.fillColor,outline:!0,outlineWidth:2,outlineColor:c.outlineColor,height:n&&n.height,heightReference:n&&n.heightReference||1}}),s.shape.entity.objId=s.objId,s.shape.entity.rectangle.coordinates=new s._cesium.CallbackProperty(function(){return s.shape.rect},!1),s._core.Entityadd(s),s.bufferEntity=s.shape.entity,s.item=s.shape.entity):(s.state=1,s.handler.removeInputAction(s._cesium.ScreenSpaceEventType.MOUSE_MOVE),s.handler.removeInputAction(s._cesium.ScreenSpaceEventType.LEFT_CLICK));var o=s.createPoint(l,!1);o.wz=s.gonRectangleArr.length,s.gonRectangleArr.push(o),s.positions.push(l)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){if(0!=s.shape.points.length){var t=s._core.getPointFromWindowPoint(e.endPosition,s._viewer);if(t){var i=s._viewer.camera.getPickRay(e.endPosition);s._viewer.scene.globe.pick(i,s._viewer.scene);u[1]=t,s.shape.points[1]=s._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),s.shape.rect=s._cesium.Rectangle.fromCartographicArray(s.shape.points),s.shape.rect.west==s.shape.rect.east&&(s.shape.rect.east+=1e-6),s.shape.rect.south==s.shape.rect.north&&(s.shape.rect.north+=1e-6)}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);var e=0;s._core.isnull(m.selectedItem)||"group"!=m.selectedItem.type||(e=m.selectedItem.id);var t=s._core.getuid(),i={id:t,name:"新建矩形"+t,pId:s._core.isnull(e)?0:e,type:"rectangle",item:s};return s.setTreeobj(i),m.insertGroupId(i,s._core.isnull(e)?0:e),this},e.prototype.startModify=function(){var o="拖动修改位置,右击删除该点";if(1==this.state||2==this.state){this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas));for(var n=this,e=0;e<n.gonRectangleArr.length;e++){var t=n.gonRectangleArr[e];t&&(t.show=!0)}this.modifyHandler.setInputAction(function(e){var t=n._viewer.scene.pick(e.position);if(Cesium.defined(t)&&t.id)t.id.objId||(n.modifyPoint=t.id,o="释放后完成修改"),n.forbidDrawWorld(!0);else{for(var i=0;i<n.gonRectangleArr.length;i++){var r=n.gonRectangleArr[i];r&&(r.show=!1)}n.modifyHandler&&(n.modifyHandler.destroy(),n.modifyHandler=null)}},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){var t=n._viewer.scene.pick(e.endPosition);if(n._core.CreateTooltip(o,e.endPosition,!1),n.modifyPoint){if(!(n.positions.length<1)&&n.modifyPoint){var i=n.getCatesian3FromPX(e.endPosition,n._viewer,[n.shape.entity,n.modifyPoint]);i&&(n.modifyPoint.position.setValue(i),n.shape.points[n.modifyPoint.wz]=n._viewer.scene.globe.ellipsoid.cartesianToCartographic(i),n.shape.rect=n._cesium.Rectangle.fromCartographicArray(n.shape.points),n.shape.rect.east+=1e-6,n.shape.rect.north+=1e-6),n._core.CreateTooltip(o,e.endPosition,!0)}}else n._cesium.defined(t)&&t.id&&t.id.objId&&n._core.CreateTooltip("拖动修改位置",e.endPosition,!0)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){if(n.forbidDrawWorld(!1),n.modifyPoint){var t=n.getCatesian3FromPX(e.position,n._viewer,[n.shape.entity,n.modifyPoint]);n.modifyPoint.position.setValue(t),n.shape.points[n.modifyPoint.wz]=n._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),n.shape.rect=n._cesium.Rectangle.fromCartographicArray(n.shape.points),n.shape.rect.east+=1e-6,n.shape.rect.north+=1e-6,n.modifyPoint=null,n.forbidDrawWorld(!1),o="拖动修改位置"}},Cesium.ScreenSpaceEventType.LEFT_UP)}},e.prototype.createPoint=function(e,t){if(e)return this._viewer.entities.add({position:e,point:{pixelSize:10,color:this._cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},e.prototype.getCatesian3FromPX=function(e,t,i){var r,o=t.scene.pick(e),n=t.scene.drillPick(e),a=null;if(i){for(var s=0;s<n.length;s++)if(n[s].id._id!=i[0].id&&n[s].id._id!=i[1].id){a=n[s].id;break}}else a=o;if(t.scene.pickPositionSupported&&this._cesium.defined(a))r=t.scene.pickPosition(e);else{var l=t.camera.getPickRay(e);if(!l)return;r=t.scene.globe.pick(l,t.scene)}return r},e.prototype.forbidDrawWorld=function(e){this._viewer.scene.screenSpaceCameraController.enableRotate=!e,this._viewer.scene.screenSpaceCameraController.enableTilt=!e,this._viewer.scene.screenSpaceCameraController.enableTranslate=!e,this._viewer.scene.screenSpaceCameraController.enableInputs=!e},e.prototype.CreateRectangle=function(e,t,i,r,o){var n=this._core.getuid(),a={outlineColor:this._cesium.Color.RED,material:this._cesium.Color.YELLOW.withAlpha(.5)};i&&i.fillColor&&(a.material=new d(this._viewer,this._cesium).colorFromHtmlColor(i.fillColor)),i&&i.outlineColor&&(a.outlineColor=new d(this._viewer,this._cesium).colorFromHtmlColor(i.outlineColor)),(a=this._core.extend(a,i,!1)).coordinates=this.getCoordinates(t),this.item=this._viewer.entities.add({id:n,name:e||"新建矩形",rectangle:a}),"function"==typeof o&&o(this.item),this._core.isnull(m.selectedItem)||"group"!=m.selectedItem.type||(r=m.selectedItem.id);var s={id:n,name:"新建矩形"+n,pId:this._core.isnull(r)?0:r,type:"rectangle",item:this.item};return this.setTreeobj(s),m.insertGroupId(s,this._core.isnull(r)?0:r),this},e.prototype.getCoordinates=function(e){var t,i,r,o;return i=e[0].lon>e[1].lon?(t=e[1].lon,e[0].lon):(t=e[0].lon,e[1].lon),o=e[0].lat>e[1].lat?(r=e[0].lat,e[1].lat):(r=e[1].lat,e[0].lat),new this._cesium.Rectangle.fromDegrees(t,o,i,r)},e.prototype.createRectanglelbj=function(e,o){var n,a=this,s=this,l=[];a.shape={points:[],button:0,rect:null,entity:null},this._tree.removeHandler(),this.closeBrowseBorder();var t=0;null!=e&&null!=e&&null!=e.id&&(t=e.id);var r=this._core.CreateTooltip();s._tree.handler=new this._cesium.ScreenSpaceEventHandler(s._viewer.scene.canvas);var u=null,c=null;s._tree.handler.setInputAction(function(e){n=s._core.getPointFromWindowPoint(e.position,s._viewer);var t=s._viewer.camera.pickEllipsoid(e.position,s._viewer.scene.globe.ellipsoid);if(1<=a.shape.button){var i={obj1:u,obj2:c=t},r={originalCameraLocation:{position:s._viewer.camera.position.clone(),orientation:{heading:s._viewer.camera.heading,pitch:s._viewer.camera.pitch,roll:s._viewer.camera.roll}},pointes:i,terrainExaggeration:"5",zj:"true"};s.llbj(r,a.shape.entity),"function"==typeof o&&o(a.shape.entity),s._tree.handler.removeInputAction(s._cesium.ScreenSpaceEventType.LEFT_CLICK)}else u=t;a.shape.button=a.shape.button+1,n&&(0==a.shape.points.length?(l.push(n),a.shape.points.push(s._viewer.scene.globe.ellipsoid.cartesianToCartographic(n)),a.shape.rect=s._cesium.Rectangle.fromCartographicArray(a.shape.points),a.shape.rect.east+=1e-6,a.shape.rect.north+=1e-6,a.shape.entity=s._viewer.entities.add({rectangle:{coordinates:a.shape.rect,material:s._cesium.Color.YELLOW.withAlpha(0),outline:!0,outlineWidth:10,outlineColor:s._cesium.Color.YELLOW,height:0}}),a.shape.entity.rectangle.coordinates=new s._cesium.CallbackProperty(function(){return a.shape.rect},!1),s.item=a.shape.entity):2==a.shape.points.length||s._tree.handler.removeInputAction(s._cesium.ScreenSpaceEventType.MOUSE_MOVE))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),s._tree.handler.setInputAction(function(e){if(0==a.shape.points.length?r.showAt(e.endPosition,"点击左键在球面上绘制矩形!"):c&&r.showAt(e.endPosition,"请将视野缩放到范围内以开启边界浏览"),0!=a.shape.points.length&&!c){r.showAt(e.endPosition,"再次点击结束绘制!");var t=s._core.getPointFromWindowPoint(e.endPosition,s._viewer);if(t){var i=s._viewer.camera.getPickRay(e.endPosition);s._viewer.scene.globe.pick(i,s._viewer.scene);l[1]=t,a.shape.points[1]=s._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),a.shape.rect=s._cesium.Rectangle.fromCartographicArray(a.shape.points),a.shape.rect.west==a.shape.rect.east&&(a.shape.rect.east+=1e-6),a.shape.rect.south==a.shape.rect.north&&(a.shape.rect.north+=1e-6)}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);s._core.isnull(m.selectedItem)||"group"!=m.selectedItem.type||m.selectedItem.id;var i=s._core.getuid(),h={id:i,name:"新建浏览边界"+i,pId:s._core.isnull(t)?0:t,type:"rectangle",item:s};return s.setTreeobj(h),m.insertGroupId(h,s._core.isnull(t)?0:t),this},e.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show._value,t=null==this.item.rectangle.coordinates?void 0:this.item.rectangle.coordinates._value;null!=t&&(t={east:t.east,north:t.north,south:t.south,west:t.west});var i=null==this.item.rectangle.height?void 0:this.item.rectangle.height._value,r=null==this.item.rectangle.extrudedHeight?void 0:this.item.rectangle.extrudedHeight._value,o=null==this.item.rectangle.rotation?void 0:this.item.rectangle.rotation._value,n=null==this.item.rectangle.stRotation?void 0:this.item.rectangle.stRotation._value,a=null==this.item.rectangle.fill?void 0:this.item.rectangle.fill._value,s=this.item.rectangle.material;null!=s&&(s={color:null==s.color._value?void 0:"rgba("+s.color._value.red+","+s.color._value.green+","+s.color._value.blue+","+s.color._value.alpha+")",image:null==s.image?void 0:s.image._value,diffusemap:null==s.diffusemap?void 0:s.diffusemap._value,alphamap:null==s.alphamap?void 0:s.alphamap._value});var l=null==this.item.rectangle.outline?void 0:this.item.rectangle.outline._value,u=null==this.item.rectangle.outlineColor?void 0:"rgba("+this.item.rectangle.outlineColor._value.red+","+this.item.rectangle.outlineColor._value.green+","+this.item.rectangle.outlineColor._value.blue+","+this.item.rectangle.outlineColor._value.alpha+")",c=null==this.item.rectangle.outlineWidth?void 0:this.item.rectangle.outlineWidth._value,h=this.item.rectangle.distanceDisplayCondition,d=null==h?void 0:h._value.near,m=null==h?void 0:h._value.far;return{type:"rectangle",treeobj:{name:this.treeobj.name},style:{show:e,coordinates:t,height:i,extrudedHeight:r,rotation:o,stRotation:n,fill:a,material:s,outline:l,outlineColor:u,outlineWidth:c,near:d,far:m}}},e.prototype.setTreeobj=function(e){this.treeobj=e},e.prototype.llbj=function(e,t){var i=document.getElementById("toolTip");i.innerHTML="请将视野缩放到范围内以开启边界浏览";var r=t.rectangle;r.height=void 0,r.heightReference=void 0,r.perPositionHeight=!1;var o=e.pointes,n=[];n.push(o.obj1),n.push(o.obj2);for(var a,s,l,u={},c=0;c<n.length;c++)a=this._cesium.Cartographic.fromCartesian(n[c]),s=this._cesium.Math.toDegrees(a.longitude),l=this._cesium.Math.toDegrees(a.latitude),0===c?(u.west=s,u.north=l,u.east=s,u.south=l):(s>u.west?u.east=s:u.west=s,l>u.south?u.north=l:u.south=l);n[0].x,n[1].x,n[0].y,n[1].y,n[0].z,this._viewer.camera.heading,this._viewer.camera.pitch,this._viewer.camera.roll;var h=this._viewer.camera.heading,d=this._viewer.camera.pitch,m=this._viewer.camera.roll,p=this._viewer.camera.position.clone(),g={orientation:{heading:h,pitch:d,roll:m},position:p},f=this;f.flyListener=function(){var e=f._viewer.camera.computeViewRectangle(),t={west:e.west/Math.PI*180,north:e.north/Math.PI*180,east:e.east/Math.PI*180,south:e.south/Math.PI*180};f.isInArea(t,u)?(f._tree.removeHandler(),i.style.left="50%",i.style.top="50%",i.innerHTML="边界浏览已开启,右键结束边界浏览",setTimeout(function(){i.style.display="none"},2e3),f._viewer.scene.camera.changed.removeEventListener(f.flyListener),f.flyListener=void 0,f._tree.handler=new f._cesium.ScreenSpaceEventHandler(f._viewer.scene.canvas),f._viewEvent=function(e){g=f.limitView(u,g)},f._viewer.scene.camera.percentageChanged=.001,f._viewer.scene.camera.changed.addEventListener(f._viewEvent),f._tree.handler.setInputAction(function(e){f.closeBrowseBorder()},f._cesium.ScreenSpaceEventType.RIGHT_CLICK)):(h=f._viewer.camera.heading,d=f._viewer.camera.pitch,m=f._viewer.camera.roll,p=f._viewer.camera.position.clone(),g={orientation:{heading:h,pitch:d,roll:m},position:p})},this._viewer.scene.camera.percentageChanged=.001,this._viewer.scene.camera.changed.addEventListener(f.flyListener)},e.prototype.closeBrowseBorder=function(){var e=document.getElementById("toolTip");this._tree.endtemporaryItem(),this._tree.handler&&this._tree.handler.destroy(),this.flyListener&&(this._viewer.scene.camera.changed.removeEventListener(this.flyListener),this.flyListener=void 0),this._viewEvent?(this._viewer.scene.camera.changed.removeEventListener(this._viewEvent),this._viewEvent=void 0,e.style.display="block",e.innerHTML="取消边界浏览",setTimeout(function(){e.style.display="none"},1e3)):e&&(e.style.display="none")},e.prototype.limitView=function(e,t){var i=this._viewer.camera.computeViewRectangle(),r={west:i.west/Math.PI*180,north:i.north/Math.PI*180,east:i.east/Math.PI*180,south:i.south/Math.PI*180};this.isInArea(r,e)?t={orientation:{heading:this._viewer.camera.heading,pitch:this._viewer.camera.pitch,roll:this._viewer.camera.roll},position:this._viewer.camera.position.clone()}:null!==t&&this._viewer.camera.setView({destination:t.position,orientation:t.orientation});return t},e.prototype.isInArea=function(e,t){var i=!1;return e.south>t.south&&e.east<t.east&&e.north<t.north&&e.west>t.west&&(i=!0),i},e.prototype.createRectangledxkz=function(o){var n=this,a=this,s=[];a.shape={points:[],rect:null,entity:null};var l,u=null,c=null,h=new n._cesium.ScreenSpaceEventHandler(n._viewer.scene.canvas);function d(e){if("EllipsoidTerrainProvider"==n._viewer.scene.terrainProvider.constructor.name)return n._viewer.camera.pickEllipsoid(e,n._viewer.scene.globe.ellipsoid);var t=n._viewer.scene.camera.getPickRay(e);return n._viewer.scene.globe.pick(t,n._viewer.scene)}return h.setInputAction(function(e){l=d(e.position);var t=n._viewer.camera.pickEllipsoid(e.position,n._viewer.scene.globe.ellipsoid);if(null==u&&(u=t),u.x==t.x&&u.y==t.y&&u.z==t.z||(c=t),l)if(0==a.shape.points.length)s.push(l),a.shape.points.push(n._viewer.scene.globe.ellipsoid.cartesianToCartographic(l)),a.shape.rect=n._cesium.Rectangle.fromCartographicArray(a.shape.points),a.shape.rect.east+=1e-6,a.shape.rect.north+=1e-6,a.shape.entity=n._viewer.entities.add({rectangle:{coordinates:a.shape.rect,material:n._cesium.Color.BLACK.withAlpha(.4),outline:!0,outlineWidth:2,outlineColor:n._cesium.Color.RED,height:0}}),a.bufferEntity=a.shape.entity;else{h.removeInputAction(n._cesium.ScreenSpaceEventType.MOUSE_MOVE),h.removeInputAction(n._cesium.ScreenSpaceEventType.LEFT_CLICK);var i={obj1:u,obj2:c},r={position:n._viewer.camera.position.clone(),orientation:{heading:n._viewer.camera.heading,pitch:n._viewer.camera.pitch,roll:n._viewer.camera.roll}};""!=o&&null!=o&&"function"==typeof o&&o({pointes:i,originalCameraLocation:r})}},n._cesium.ScreenSpaceEventType.LEFT_CLICK),h.setInputAction(function(e){if(0!=a.shape.points.length){var t=d(e.endPosition);t&&(s[1]=t,a.shape.points[1]=n._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),a.shape.rect=n._cesium.Rectangle.fromCartographicArray(a.shape.points),a.shape.rect.west==a.shape.rect.east&&(a.shape.rect.east+=1e-6),a.shape.rect.south==a.shape.rect.north&&(a.shape.rect.north+=1e-6),a.shape.entity.rectangle.coordinates=a.shape.rect)}},n._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},e.prototype.executeExcavation=function(e){var a,s=this,l=this,u=[];s.shape={points:[],button:0,rect:null,entity:null};var c=new this._cesium.ScreenSpaceEventHandler(l._viewer.scene.canvas),h=[];c.setInputAction(function(e){if(a=l._core.getPointFromWindowPoint(e.position,l._viewer),2<=s.shape.button){var t=s._viewer.scene.globe;s.shape.box=l._viewer.entities.add({position:l._cesium.Cartesian3.fromDegrees(h[0].lon,h[0].lat,100),box:{dimensions:new l._cesium.Cartesian3(1e4,1e4,1e4),material:l._cesium.Color.WHITE.withAlpha(.5),outline:!0,outlineColor:l._cesium.Color.WHITE}}),t.depthTestAgainstTerrain=!0,t.clippingPlanes=new s._cesium.ClippingPlaneCollection({modelMatrix:s.shape.box.computeModelMatrix(l._cesium.JulianDate.now()),planes:[new l._cesium.Plane(new l._cesium.Cartesian3(1,0,0),-700),new l._cesium.Plane(new l._cesium.Cartesian3(-1,0,0),-700),new l._cesium.Plane(new l._cesium.Cartesian3(0,1,0),-700),new l._cesium.Plane(new l._cesium.Cartesian3(0,-1,0),-700)],edgeWidth:1,edgeColor:l._cesium.Color.WHITE}),c.removeInputAction(l._cesium.ScreenSpaceEventType.MOUSE_MOVE),c.removeInputAction(l._cesium.ScreenSpaceEventType.LEFT_CLICK)}if(s.shape.button=s.shape.button+1,a)if(0==s.shape.points.length){u.push(a),s.shape.points.push(l._viewer.scene.globe.ellipsoid.cartesianToCartographic(a));var i=l._viewer.scene.camera.pickEllipsoid(movement.position,l._viewer.scene.globe.ellipsoid),r=l._cesium.Cartographic.fromCartesian(i),o=l._cesium.Math.toDegrees(r.longitude),n=l._cesium.Math.toDegrees(r.latitude);h.push({lon:o,lat:n}),s.shape.rect=l._cesium.Rectangle.fromCartographicArray(s.shape.points),s.shape.rect.east+=1e-6,s.shape.rect.north+=1e-6,s.shape.entity=l._viewer.entities.add({rectangle:{coordinates:s.shape.rect,material:l._cesium.Color.BLACK.withAlpha(.4),outline:!0,outlineWidth:2,outlineColor:l._cesium.Color.RED,height:0}}),s.bufferEntity=s.shape.entity,l.item=s.shape.entity}else 2==s.shape.points.length||(c.removeInputAction(l._cesium.ScreenSpaceEventType.MOUSE_MOVE),c.removeInputAction(l._cesium.ScreenSpaceEventType.LEFT_CLICK))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(e){if(0!=s.shape.points.length){var t=l._core.getPointFromWindowPoint(e.endPosition,l._viewer);if(t){var i=l._viewer.camera.getPickRay(e.endPosition);l._viewer.scene.globe.pick(i,l._viewer.scene);u[1]=t,s.shape.points[1]=l._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),s.shape.rect=l._cesium.Rectangle.fromCartographicArray(s.shape.points),s.shape.rect.west==s.shape.rect.east&&(s.shape.rect.east+=1e-6),s.shape.rect.south==s.shape.rect.north&&(s.shape.rect.north+=1e-6),s.shape.entity.rectangle.coordinates=s.shape.rect}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);var t=0;l._core.isnull(m.selectedItem)||"group"!=m.selectedItem.type||(t=m.selectedItem.id);var i=l._core.getuid(),r={id:i,name:"新建矩形"+i,pId:l._core.isnull(t)?0:t,type:"rectangle",item:l};return l.setTreeobj(r),m.insertGroupId(r,l._core.isnull(t)?0:t),"function"==typeof e&&e(ploylinejl),this},e.prototype.deleteObject=function(){this._viewer.entities.remove(this.item),null!=this._viewEvent&&(this._tree.handler.destroy(),this._viewer.scene.camera.changed.removeEventListener(this._viewEvent))},e.prototype.setVisibility=function(e){this.item.show=e},e.prototype.getVisibility=function(){return this.item.show},e.prototype.setDistanceDisplayCondition=function(e,t){var i=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._rectangle.distanceDisplayCondition=i}catch(e){console.log(e)}return this},e.prototype.setRectangleAlpha=function(e){try{this.item._rectangle.material.color._value.alpha=e,this.item._rectangle.show=!0}catch(e){console.log(e)}return this},e.prototype.setRectangleColor=function(e){try{this.item._rectangle.material.color=new d(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},e.prototype.setDistanceDisplayCondition=function(e,t){var i=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._rectangle.distanceDisplayCondition=i}catch(e){console.log(e)}return this},e.prototype.setPolygonImage=function(e){try{this.item._rectangle.material=new this._cesium.ImageMaterialProperty({image:e})}catch(e){console.log(e)}return this},e.prototype.setRectangleRepeat=function(e,t){try{this.item._rectangle.material.repeat=new this._cesium.Cartesian2(e,t)}catch(e){console.log(e)}return this},e.prototype.setOutlineColor=function(e){try{this.item._rectangle.outlineColor=new d(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},e.prototype.setOutline=function(e){try{this.item._rectangle.outline=e}catch(e){console.log(e)}return this},e.prototype.setExtrudedHeight=function(e){try{this.item._rectangle.extrudedHeight=e}catch(e){console.log(e)}return this},e.prototype.setHeight=function(e){try{this.item._rectangle.height=e}catch(e){console.log(e)}return this},Object.defineProperties(e.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),e.prototype.setItem=function(e){this.item=e},Object.defineProperties(e.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),Object.defineProperties(e.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(e.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(e.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(e.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Object.defineProperties(e.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(e.prototype,{polygonTempOptions:{get:function(){return{height:0,extrudedHeight:0,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:1,granularity:this._cesium.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:ShadowMode.DISABLED,classificationType:ClassificationType.BOTH,arcType:ArcType.GEODESIC}}}}),e}),define("SGWorld/Creator/Polygon",["../configData","./Color","../Core/Core","../Navigate/getPosition","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min"],function(b,c,i,r,d,e){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._Color=new c(this._viewer,this._cesium),this._core=new i,this._getPosition=new r(this._viewer,this._cesium),this._tree=d,this._points=[],this._lable=null,this._entity=null,this.polygon1,this.id="0",this.curCanvas="a"}return t.prototype.createPolygon=function(e,t,i,r,o){var n,a=[];if(e[0]instanceof Array){if(2===e[0].length){for(var s=0;s<e.length;s++)a.push(e[s][0],e[s][1]);n=this._cesium.Cartesian3.fromDegreesArray(a)}else if(3===e[0].length){for(s=0;s<e.length;s++)a.push(e[s][0],e[s][1],e[s][2]);n=this._cesium.Cartesian3.fromDegreesArrayHeights(a)}}else if(e[0].z){for(s=0;s<e.length;s++)a.push(e[s].x,e[s].y,e[s].z);n=this._cesium.Cartesian3.fromDegreesArrayHeights(a)}else{for(s=0;s<e.length;s++)a.push(e[s].x,e[s].y);n=this._cesium.Cartesian3.fromDegreesArray(a)}var l=t;"string"==typeof l&&(l={fillColor:l}),this.item=this._viewer.entities.add({name:o,polygon:{hierarchy:new this._cesium.PolygonHierarchy(n),material:new c(this._viewer,this._cesium).colorFromHtmlColor(l.fillColor),heightReference:this._core.defaultValue(i,1),perPositionHeight:1!==i,outline:!0,outlineWidth:this._core.defaultValue(l.outlineWidth,1),outlineColor:new c(this._viewer,this._cesium).colorFromHtmlColor(this._core.defaultValue(l.outlineColor,l.fillColor))}});var u={id:this.item.id,name:o||"新建面"+this._core.getuid(),pId:this._core.isnull(r)?0:r,type:"polygon",item:this};return this.setTreeobj(u),this._tree.insertGroupId(u,this._core.isnull(r)?0:r),this},t.prototype.getstyles=function(){var e={};return e.show=!this.item.polygon.show||this.item.polygon.show._value,e.hierarchy=this.item.polygon.hierarchy?this.item.polygon.hierarchy.getValue().positions.toString():null,e.height=this.item.polygon.height?this.item.polygon.height._value:null,e.heightReference=this.item.polygon.heightReference?this.item.polygon.heightReference._value:null,e.extrudedHeight=this.item.polygon.extrudedHeight?this.item.polygon.extrudedHeight.getValue():null,e.extrudedHeightReference=this.item.polygon.extrudedHeightReference?this.item.polygon.extrudedHeightReference.toString():null,e.stRotation=this.item.polygon.stRotation?this.item.polygon.stRotation._value:null,e.granularity=this.item.polygon.granularity?this.item.polygon.granularity._value:null,e.fill=this.item.polygon.fill?this.item.polygon.fill._value:null,e.material={},e.material.color=this.item.polygon.material&&this.item.polygon.material.color&&this.item.polygon.material.color._value?"rgba"+this.item.polygon.material.color.toString():null,e.material.image=this.item.polygon.material&&this.item.polygon.material.image?this.item.polygon.material.image._value:null,e.material.repeat=this.item.polygon.material&&this.item.polygon.material.repeat&&this.item.polygon.material.repeat._value?this.item.polygon.material.repeat._value:null,e.outline=this.item.polygon.outline?this.item.polygon.outline._value:null,e.outlineWidth=this.item.polygon.outlineWidth?this.item.polygon.outlineWidth._value:null,e.outlineColor=this.item.polygon.outlineColor&&this.item.polygon.outlineColor._value?"rgba"+this.item.polygon.outlineColor.toString():null,e.perPositionHeight=this.item.polygon.perPositionHeight?this.item.polygon.perPositionHeight.toString():null,e.closeTop=this.item.polygon.closeTop?this.item.polygon.closeTop.toString():null,e.closeBottom=this.item.polygon.closeBottom?this.item.polygon.closeBottom.toString():null,e.arcType=this.item.polygon.arcType?this.item.polygon.arcType.toString():null,e.classificationType=this.item.polygon.classificationType?this.item.polygon.classificationType.toString():null,e.near=this.item.polygon.distanceDisplayCondition?this.item.polygon.distanceDisplayCondition._value.near:null,e.far=this.item.polygon.distanceDisplayCondition?this.item.polygon.distanceDisplayCondition._value.far:null,e},t.prototype.createCloudMap=function(e,t,i,r){var o=[],n=this;o.push(t.minx,t.miny),o.push(t.maxx,t.miny),o.push(t.maxx,t.maxy),o.push(t.minx,t.maxy);var a=this._cesium.Cartesian3.fromDegreesArray(o);r=this._core.defaultValue(r,1);var s=0,l=0;this.item=this._viewer.entities.add({name:e,polygon:{hierarchy:new this._cesium.PolygonHierarchy(a),material:new Cesium.ImageMaterialProperty({image:new this._cesium.CallbackProperty(function(){return 30<(l+=r)&&(l=0,++s>i.length-1&&(s=0)),i[s]},!1),color:new this._cesium.CallbackProperty(function(){return n._cesium.Color.WHITE.withAlpha(l<15?.5+l/30:1.5-l/30)},!1),repeat:new n._cesium.Cartesian2(1,1)})}});var u={id:this.item.id,name:e,pId:0,type:"polygon",item:this};return this.setTreeobj(u),this._tree.insertGroupId(u,0),this},t.prototype.createSector=function(e,t,T,i,r){var o,n={fillColor:this._cesium.Color.YELLOW.withAlpha(.5),outlineColor:this._cesium.Color.YELLOW},a=2*Math.PI/360*r,s=Math.sin(a)*t,l=function(e,t,i){var r={a:6378137,b:6356752.3142,f:1/298.257223563};function o(e){return e*Math.PI/180}function n(e){return 180*e/Math.PI}var a=r.a,s=r.b,l=r.f,u=1*e.lon,c=1*e.lat,h=i,d=o(t),m=Math.sin(d),p=Math.cos(d),g=(1-l)*Math.tan(o(c)),f=1/Math.sqrt(1+g*g),v=g*f,_=Math.atan2(g,p),y=f*m,C=1-y*y,w=C*(a*a-s*s)/(s*s),b=1+w/16384*(4096+w*(w*(320-175*w)-768)),E=w/1024*(256+w*(w*(74-47*w)-128)),S=h/(s*b),P=2*Math.PI;for(;1e-12<Math.abs(S-P);){var x=Math.cos(2*_+S),T=Math.sin(S),I=Math.cos(S),D=E*T*(x+E/4*(I*(2*x*x-1)-E/6*x*(4*T*T-3)*(4*x*x-3)));P=S,S=h/(s*b)+D}var L=v*T-f*I*p,M=Math.atan2(v*I+f*T*p,(1-l)*Math.sqrt(y*y+L*L)),A=Math.atan2(T*m,f*I-v*T*p),R=l/16*C*(4+l*(4-3*C)),O=A-(1-R)*l*y*(S+R*T*(x+R*I*(2*x*x-1)));Math.atan2(y,-L);return{lon:1*u+n(O),lat:n(M)}}(e,i,Math.cos(a)*t),u={lon:e.lon,lat:e.lat,height:e.height},c={lon:l.lon,lat:l.lat,height:e.height+s},I=6378137,D=6356725,L=this;o=function(e,t){var i=[],r=(a=e.lat,s=e.lon,l=t.lat,u=t.lon,c=M(a),h=M(l),d=M(l)-M(a),m=M(u)-M(s),p=2*Math.asin(Math.sqrt(Math.pow(Math.sin(d/2),2)+Math.cos(c)*Math.cos(h)*Math.pow(Math.sin(m/2),2))),p*=I,p=Math.round(1e4*p)/1e4,{anglew:L._core.TwoPointAzimuth(s,a,u,l),distance:p}),o=r.anglew,n=r.distance;var a,s,l,u,c,h,d,m,p;i.push(e.lon,e.lat,e.height);for(var g=o-T/2,f=null;g<o+T/2;g++)v=e.lat,_=e.lon,C=g,void 0,w=(y=n)*Math.sin(C*Math.PI/180),b=y*Math.cos(C*Math.PI/180),S=(E=D+(I-D)*(90-v)/90)*Math.cos(v*Math.PI/180),P=180*(w/S+_*Math.PI/180)/Math.PI,x=180*(b/E+v*Math.PI/180)/Math.PI,f=[P,x],i.push(f[0],f[1],t.height+10*g);var v,_,y,C,w,b,E,S,P,x;return i}(u,c);var h=document.createElement("canvas");h.id="0-a",h.width=800,h.height=800,document.body.appendChild(h);var d=document.createElement("canvas");d.id="0-b",d.width=800,d.height=800;var m="a";document.body.appendChild(d);var p=1,g=new Cesium.CallbackProperty(function(e,t){var i=document.getElementById("0-"+m),r=i.getContext("2d");function o(e,t,i){r.beginPath(),r.arc(400,800,i,n(e),n(t),!1),r.stroke()}function n(e){return(e-=90)*Math.PI/180}r.strokeStyle="red",r.lineWidth=15,r.clearRect(0,0,800,800);var a,s,l,u=r.createLinearGradient(0,800,0,0);return u.addColorStop(0,"rgba(255,0,0,0.6)"),u.addColorStop(1,"rgba(255,0,0,0)"),a=-T/2,s=T/2,l=p+600,r.beginPath(),r.arc(400,800,l,n(a),n(s),!1),r.stroke(),r.lineTo(400,800),r.closePath(),r.fillStyle=u,r.fill(),o(-T/2,T/2,p+100),o(-T/2,T/2,p+200),o(-T/2,T/2,p+300),o(-T/2,T/2,p+400),o(-T/2,T/2,p+500),o(-T/2,T/2,p+600),p<100?p+=1:p=1,m="a"===m?"b":"a",i},!1);function M(e){return e*Math.PI/180}return this.item=this._viewer.entities.add({polygon:{hierarchy:new this._cesium.PolygonHierarchy(this._cesium.Cartesian3.fromDegreesArrayHeights(o)),material:new this._cesium.ImageMaterialProperty({image:g,transparent:!0}),perPositionHeight:!0,outlineColor:n.outlineColor}}),this},t.prototype.setImageMaterialProperty=function(){var o=this,e=document.createElement("canvas");e.id="0-a",e.width=700,e.height=100;var t=document.createElement("canvas");t.id="0-b",t.width=700,t.height=100,document.body.appendChild(e),document.body.appendChild(t);var i=new o._cesium.CallbackProperty(function(e,t){var i=document.getElementById("0-"+o.curCanvas),r=i.getContext("2d");return i.strokeStyle="1px solid red",r.strokeStyle="red",r.fillStyle="red",r.save(),r.translate(100,100),r.arc(0,0,100,0,180*Math.PI/180),r.restore(),r.stroke(),o.curCanvas="a"===o.curCanvas?"b":"a",i},!1);return new o._cesium.ImageMaterialProperty({image:i,transparent:!0})},t.prototype.executeSector=function(t,e){var i=this,P=this;this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler();var r,o,n=this._viewer,a=0,s={fillColor:P._cesium.Color.YELLOW.withAlpha(.5),outlineColor:P._cesium.Color.YELLOW};e&&e.fillColor&&(s.fillColor=e.fillColor),e&&e.outlineColor&&(s.outlineColor=e.outlineColor),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(P._viewer.scene.canvas),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+b.draw);var x,T,l=[],u=this._core.CreateTooltip();this.item=void 0,this.end=function(e){P._tree.handler.destroy(),P._tree.handler=null,u.show(!1),P._core.mouse(P._viewer.container,0,"0"),i.end=void 0,"cancel"!==e?(P.item&&(P.item.polygon.hierarchy=new P._cesium.PolygonHierarchy(P._cesium.Cartesian3.fromDegreesArray(l))),"function"==typeof t&&t(P.item,{position:r,angle:x,distance:T})):P.item&&n.entities.remove(P.item)},this._tree.handler.setInputAction(function(e){var t=P._getPosition.getMouseDegrees(e);0===a?(r={lon:t.lon,lat:t.lat,height:t.height},a++):P.end&&P.end()},P._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){0!==a?(u.showAt(e.endPosition,"再次点击结束绘制"),o=P._getPosition.getMouseDegrees(e),l=function(e,t){var i=[],r=(o=e.lat,n=e.lon,a=t.lat,s=t.lon,l=L(o),u=L(a),c=L(a)-L(o),h=L(s)-L(n),d=2*Math.asin(Math.sqrt(Math.pow(Math.sin(c/2),2)+Math.cos(l)*Math.cos(u)*Math.pow(Math.sin(h/2),2))),d*=I,d=Math.round(1e4*d)/1e4,{angle:P._core.TwoPointAzimuth(n,o,s,a),distance:d});var o,n,a,s,l,u,c,h,d;x=r.angle,T=r.distance,i.push(e.lon,e.lat);for(var m=x-30,p=null;m<x+30;m++)g=e.lat,f=e.lon,_=m,void 0,y=(v=T)*Math.sin(_*Math.PI/180),C=v*Math.cos(_*Math.PI/180),b=(w=D+(I-D)*(90-g)/90)*Math.cos(g*Math.PI/180),E=180*(y/b+f*Math.PI/180)/Math.PI,S=180*(C/w+g*Math.PI/180)/Math.PI,p=[E,S],i.push(p[0],p[1]);var g,f,v,_,y,C,w,b,E,S;return i}(r,o),P.item||(P.item=n.entities.add({polygon:{hierarchy:new P._cesium.PolygonHierarchy(P._cesium.Cartesian3.fromDegreesArray(l)),material:new P._cesium.ColorMaterialProperty(s.fillColor),outlineColor:s.outlineColor,fill:!0}}),P.item.polygon.hierarchy=new P._cesium.CallbackProperty(function(){return new P._cesium.PolygonHierarchy(P._cesium.Cartesian3.fromDegreesArray(l))},!1))):u.showAt(e.endPosition,"点击开始绘制")},P._cesium.ScreenSpaceEventType.MOUSE_MOVE);var I=6378137,D=6356725;function L(e){return e*Math.PI/180}return this},t.prototype.executePolygon=function(t,l){var u=this;this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler();var i=function(){function e(e){this.options={name:"",polygon:{hierarchy:[],heightReference:u._core.defaultValue(t.heightReference,1),perPositionHeight:0===t.heightReference,material:u._core.defaultValue(t.material,u._cesium.Color.YELLOW.withAlpha(.5))}},this.hierarchy=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new u._cesium.CallbackProperty(function(){return e.hierarchy},!1),this.polygon=u._viewer.entities.add(this.options),u.item=this.polygon,u._tree.temporaryItem.obj.push(this.polygon)},e}();this._tree.handler=new this._cesium.ScreenSpaceEventHandler(u._viewer.scene.canvas);var c=[],r={},h=void 0;this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+b.draw);var d=this._core.CreateTooltip();return this._tree.handler.setInputAction(function(e){var t=u._getPosition.getMousePosition(e);0==c.length&&c.push(t.clone()),c.push(t),r=new u._cesium.PolygonHierarchy(c)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){0===c.length?d.showAt(e.endPosition,"左键开始绘制!"):c.length<=2?d.showAt(e.endPosition,"点击继续绘制!"):d.showAt(e.endPosition,"右键结束绘制!");var t=u._getPosition.getMousePosition(e);2<=c.length&&(u._cesium.defined(h)?null!=t&&(c.pop(),t.y+=1+Math.random(),c.push(t),r=new u._cesium.PolygonHierarchy(c)):(r=new u._cesium.PolygonHierarchy(c),h=new i(r)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){u._tree.endtemporaryItem(),u._tree.handler.destroy(),d.show(!1);var t={polygon:{},positions:[],area:[]};t.polygon=h;for(var i=[],r=0;r<c.length;r++){var o=u._cesium.Cartographic.fromCartesian(c[r]),n=u._cesium.Math.toDegrees(o.longitude),a=u._cesium.Math.toDegrees(o.latitude),s=o.height;i.push({lon:n,lat:a,hei:s})}t.positions=i,u._core.mouse(u._viewer.container,0,"0"),"function"==typeof l&&l(t)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},t.prototype.executePolygonvideo=function(l,t){var u=this,c=this;this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler();var i=function(){function e(e){this.options={name:"",polygon:{hierarchy:[],heightReference:c._cesium.HeightReference.CLAMP_TO_GROUND,classificationType:c._cesium.ClassificationType.BOTH,material:c._cesium.Color.YELLOW.withAlpha(.5)}},this.hierarchy=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new c._cesium.CallbackProperty(function(){return e.hierarchy},!1),this.polygon=c._viewer.entities.add(this.options),p.style.transform="rotate("+t.angle+"deg)",this.polygon.polygon.stRotation=c._cesium.Math.toRadians(t.angle),c.item=this.polygon,c._tree.temporaryItem.obj.push(this.polygon)},e}();this._tree.handler=new this._cesium.ScreenSpaceEventHandler(c._viewer.scene.canvas);var h=[],r={},o=void 0,d=this._core.CreateTooltip(),m=c._core.getuid(),e=document.getElementById("videoToolbar");if(!e){$(".cesium-viewer").append('<div id="videoToolbar"></div>'),e=document.getElementById("videoToolbar")}var n='<video id="video'+m+'" style="display: none;" muted autoplay loop crossorigin controls><source src="'+t.url+'" type="video/mp4"></video>';$(e).append(n);var p=document.getElementById("video"+m);p.style.transform="rotate("+t.angle+"deg)";var g=void 0;return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+b.draw),this._tree.handler.setInputAction(function(e){var t=c._getPosition.getMousePosition(e);if(0==h.length&&h.push(t.clone()),h.push(t),2!==h.length||g||(g=c._viewer.entities.add({name:"临时线",polyline:{positions:new Cesium.CallbackProperty(function(){return h},!1),clampToGround:!0,material:new Cesium.ColorMaterialProperty(Cesium.Color.YELLOW.withAlpha(.5)),width:3}})),3<=h.length&&!o)return g&&c._viewer.entities.remove(g),r=new c._cesium.PolygonHierarchy(h),void(o=new i(r));r=new c._cesium.PolygonHierarchy(h)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){if(0===h.length?d.showAt(e.endPosition,"左键开始绘制!"):h.length<=2?d.showAt(e.endPosition,"点击继续绘制!"):d.showAt(e.endPosition,"右键结束绘制!"),2<=h.length){var t=c._getPosition.getMousePosition(e);t&&(h.pop(),h.push(t),r=new c._cesium.PolygonHierarchy(h))}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){c.end&&c.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){if(c._tree.endtemporaryItem(),c._tree.handler.destroy(),d.show(!1),c._core.mouse(c._viewer.container,0,"0"),u.end=void 0,g&&c._viewer.entities.remove(g),"cancel"===e||h.length<3)c.item&&c._viewer.entities.remove(c.item);else{p.play(),c.item.polygon.material=p;var t={polygon:{},positions:[],area:[]};t.polygon=c.item;for(var i=[],r=0;r<h.length;r++){var o=c._cesium.Cartographic.fromCartesian(h[r]),n=c._cesium.Math.toDegrees(o.longitude),a=c._cesium.Math.toDegrees(o.latitude),s=o.height;i.push({lon:n,lat:a,hei:s})}t.positions=i,t.id=m,"function"==typeof l&&l(t)}},this},t.prototype.addVideoPolygon=function(e,t){var i,r=[];if(e[0]instanceof Array){if(2===e[0].length){for(var o=0;o<e.length;o++)r.push(e[o][0],e[o][1]);i=this._cesium.Cartesian3.fromDegreesArray(r)}else if(3===e[0].length){for(o=0;o<e.length;o++)r.push(e[o][0],e[o][1],e[o][2]);i=this._cesium.Cartesian3.fromDegreesArrayHeights(r)}}else if(e[0].z){for(o=0;o<e.length;o++)r.push(e[o].x,e[o].y,e[o].z);i=this._cesium.Cartesian3.fromDegreesArrayHeights(r)}else{for(o=0;o<e.length;o++)r.push(e[o].x,e[o].y);i=this._cesium.Cartesian3.fromDegreesArray(r)}var n=document.getElementById("videoToolbar");if(!n){$(".cesium-viewer").append('<div id="videoToolbar"></div>'),n=document.getElementById("videoToolbar")}var a=this._core.getuid(),s='<video id="video'+a+'" style="display: none;" muted autoplay loop crossorigin controls><source src="'+t.url+'" type="video/mp4"></video>';$(n).append(s);var l=document.getElementById("video"+a);l.play();var u=this._core.defaultValue(t.heightReference,1),c=this._core.defaultValue(t.color,"#FFFFFF");return this.item=this._viewer.entities.add({name:"面贴视频",polygon:{hierarchy:new Cesium.PolygonHierarchy(i),material:new Cesium.ImageMaterialProperty({image:l,color:Cesium.Color.fromCssColorString(c)}),heightReference:u,perPositionHeight:1!==u,stRotation:Cesium.Math.toRadians(t.angle||0),rotation:Cesium.Math.toRadians(t.rotation||0)}}),this},t.prototype.addVideoBox=function(e,t){var i,r;e instanceof Array?i=(r=this._cesium.Cartesian3).fromDegrees.apply(r,_toConsumableArray2(e)):e.x?i=this._cesium.Cartesian3.fromDegrees(e.x,e.y,e.z):e.lon&&(i=this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height));var o=document.getElementById("videoToolbar");if(!o){$(".cesium-viewer").append('<div id="videoToolbar"></div>'),o=document.getElementById("videoToolbar")}var n=this._core.getuid(),a='<video id="video'+n+'" style="display: none;" muted autoplay loop crossorigin controls><source src="'+t.url+'" type="video/mp4"></video>';$(o).append(a);var s=document.getElementById("video"+n);s.play();var l=this._core.defaultValue(t.color,"#FFFFFF");return this.item=this._viewer.entities.add({name:"盒子贴视频",position:i,orientation:Cesium.Transforms.headingPitchRollQuaternion(i,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(t.heading||0),Cesium.Math.toRadians(t.pitch||0),Cesium.Math.toRadians(t.roll||0))),box:{dimensions:new Cesium.Cartesian3(t.long||100,t.width||100,t.height||100),material:new Cesium.ImageMaterialProperty({image:s,color:Cesium.Color.fromCssColorString(l)})}}),this},t.prototype.deleteObject=function(){if(this._viewer.entities.remove(this.item),0<this._points.length){for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e]);this._points=[]}try{this._viewer.scene.primitives.remove(this.item)}catch(e){console.log(e)}this.item=void 0},t.prototype.executePolygoncl=function(r,e){this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer);var a=this,o=0;this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+b.draw),a._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene._imageryLayerCollection);var s,l=this._core.CreateTooltip(),u=[],c={},h=[],d=null,m=null,p={point:a._cesium.Color.RED,polyline:a._cesium.Color.YELLOW,polygon:a._cesium.Color.YELLOW.withAlpha(.5)};0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(p.point=e.point),""!=e.polyline&&null!=e.polyline&&(p.polyline=e.polyline),""!=e.polygon&&null!=e.polygon&&(p.polygon=e.polygon));var g={mj:0,label:[],polygon:[]},f=void 0;this._tree.handler.setInputAction(function(e){if(0===u.length?l.showAt(e.endPosition,"左键开始绘制!"):u.length<=3?l.showAt(e.endPosition,"点击继续绘制!"):l.showAt(e.endPosition,"右键结束绘制!"),m=a._getPosition.getMousePosition(e)){var t=a._cesium.Cartographic.fromCartesian(m),i=a._cesium.Math.toDegrees(t.longitude),r=a._cesium.Math.toDegrees(t.latitude),o=t.height;if(2<=u.length){a._cesium.defined(d)?(u.pop(),u.push(m),c=new a._cesium.PolygonHierarchy(u),h.pop(),h.push({lon:i,lat:r,hei:o})):(c=new a._cesium.PolygonHierarchy(u),d=new v(c));var n=a._core.getArea(h,u,a._cesium);a._viewer.entities.remove(s),s=a._viewer.entities.add({name:"多边形面积",position:new Cesium.CallbackProperty(function(){var t=new Cesium.Cartesian3;return u.forEach(function(e){Cesium.Cartesian3.add(t,e,t)}),Cesium.Cartesian3.divideByScalar(t,u.length,new Cesium.Cartesian3)},!1),label:{text:n,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:a._cesium.HeightReference.CLAMP_TO_GROUND}}),a._tree.temporaryItem.obj.push(s),g.label=s}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){if(m=a._getPosition.getMousePosition(e)){var t=a._cesium.Cartographic.fromCartesian(m),i=a._cesium.Math.toDegrees(t.longitude),r=a._cesium.Math.toDegrees(t.latitude),o=t.height;if(0==u.length&&(u.push(m.clone()),h.push({lon:i,lat:r,hei:o})),u.push(m),h.push({lon:i,lat:r,hei:o}),c=new a._cesium.PolygonHierarchy(u),2===u.length&&(f=a._viewer.entities.add({name:"临时线",polyline:{positions:new Cesium.CallbackProperty(function(){return u},!1),clampToGround:!1,material:p.polygon,width:3}})),3<=u.length){f&&a._viewer.entities.remove(f),a._cesium.defined(d)||(c=new a._cesium.PolygonHierarchy(u),d=new v(c));var n=a._core.getArea(h,u,a._cesium);a._viewer.entities.remove(s),s=a._viewer.entities.add({name:"多边形面积",position:new Cesium.CallbackProperty(function(){var t=new Cesium.Cartesian3;return u.forEach(function(e){Cesium.Cartesian3.add(t,e,t)}),Cesium.Cartesian3.divideByScalar(t,u.length,new Cesium.Cartesian3)},!1),label:{text:n,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:a._cesium.HeightReference.CLAMP_TO_GROUND}}),a._tree.temporaryItem.obj.push(s),g.label=s}}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){a.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){if(l.show(!1),a._viewer.entities.remove(s),a._tree.handler.destroy(),a.end=void 0,a._core.mouse(a._viewer.container,0,"0"),f&&a._viewer.entities.remove(f),"cancel"===e||u.length<3)a.item&&a._viewer.entities.remove(a.item);else{var t=a._core.getArea(h,u,a._cesium);o=t;var i=a._viewer.entities.add({name:"多边形面积",position:new Cesium.CallbackProperty(function(){var t=new Cesium.Cartesian3;return u.forEach(function(e){Cesium.Cartesian3.add(t,e,t)}),Cesium.Cartesian3.divideByScalar(t,u.length,new Cesium.Cartesian3)},!1),label:{text:t,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:a._cesium.HeightReference.CLAMP_TO_GROUND}});a._tree.endtemporaryItem(),a._points.push(i),a._lable=i,g.mj=o,g.label=i,""!=r&&null!=r&&"function"==typeof r&&r(g)}};var v=function(){function e(e){this.options={name:"多边形",polygon:{hierarchy:[],perPositionHeight:!0,material:p.polygon,classificationType:a._cesium.ClassificationType.BOTH}},this.hierarchy=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new a._cesium.CallbackProperty(function(){return e.hierarchy},!1),this.polygon=a._viewer.entities.add(this.options),a.item=this.polygon,a._entity=this.polygon,a._tree.temporaryItem.obj.push(this.polygon),g.polygon=this.polygon},e}();return this},t.prototype.executePolygonym=function(i){var s=this;this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler();var r=0;s._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(s._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._tree.handler=new s._cesium.ScreenSpaceEventHandler(s._viewer.scene._imageryLayerCollection);var l=[],u={},c=[],o=null,h=null,n={mj:0,label:{}};this._tree.handler.setInputAction(function(e){var t=s._viewer.camera.getPickRay(e.endPosition);h=s._viewer.scene.globe.pick(t,s._viewer.scene),2<=l.length&&(s._cesium.defined(o)?(l.pop(),l.push(h),u=new s._cesium.PolygonHierarchy(l)):(u=new s._cesium.PolygonHierarchy(l),o=new a(u)))},s._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){var t=s._viewer.camera.getPickRay(e.position);h=s._viewer.scene.globe.pick(t,s._viewer.scene),0==l.length&&(l.push(h.clone()),u=new s._cesium.PolygonHierarchy(l)),l.push(h),u=new s._cesium.PolygonHierarchy(l);var i=s._cesium.Cartographic.fromCartesian(l[l.length-1]),r=s._cesium.Math.toDegrees(i.longitude),o=s._cesium.Math.toDegrees(i.latitude),n=i.height;c.push({lon:r,lat:o,hei:n});var a=s._viewer.entities.add({name:"多边形面积",position:l[l.length-1],point:{pixelSize:5,color:s._cesium.Color.RED,outlineColor:s._cesium.Color.WHITE,outlineWidth:2,heightReference:s._cesium.HeightReference.CLAMP_TO_GROUND}});s._tree.temporaryItem.obj.push(a),s._points.push(a)},s._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){s._tree.handler.destroy(),s._tree.endtemporaryItem(),l.pop(),u=new s._cesium.PolygonHierarchy(l);r="平方千米";var t=s._viewer.entities.add({name:"多边形面积",position:new Cesium.CallbackProperty(function(){var t=new Cesium.Cartesian3;return l.forEach(function(e){Cesium.Cartesian3.add(t,e,t)}),Cesium.Cartesian3.divideByScalar(t,l.length,new Cesium.Cartesian3)},!1),label:{text:"平方千米",font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:s._cesium.HeightReference.CLAMP_TO_GROUND}});s._tree.temporaryItem.obj.push(t),s._points.push(t),n.mj=r,n.label=t,""!=i&&null!=i&&"function"==typeof i&&i(o)},s._cesium.ScreenSpaceEventType.RIGHT_CLICK);var a=function(){function e(e){this.options={name:"多边形",polygon:{hierarchy:[],perPositionHeight:!0,material:s._cesium.Color.SKYBLUE.withAlpha(.4),extrudedHeight:0}},this.hierarchy=e,this._init()}e.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new s._cesium.CallbackProperty(function(){return e.hierarchy},!1);var t=s._viewer.entities.add(this.options);s._tree.temporaryItem.obj.push(t),s.item=t};var t=0;s._core.isnull(d.selectedItem)||"group"!=d.selectedItem.type||(t=d.selectedItem.id);var i=s._core.getuid(),r={id:i,name:"新建面"+i,pId:s._core.isnull(t)?0:t,type:"polygon",item:s};return s.setTreeobj(r),d.insertGroupId(r,s._core.isnull(t)?0:t),e}();return this},t.prototype.executePolygonymsd=function(n,a){var i=this;!n&&(n={}),this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer);var P=this;this._tree.handler=new P._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var x=this._core.CreateTooltip(),T={},I=[],D=[],_=null,y=null,C=null,s="0",L=0,M=1e3,r=10,A=!1,R={mj:0,label:[],ployline:[]},O=[];function N(){P.end();var o=r/20;P.waterTimer=setInterval(function(){if(L<M&&(L+=o,P.item._polygon.extrudedHeight.setValue(L),M<=L)){clearInterval(P.waterTimer),P.waterTimer=void 0,L=M,P._viewer.entities.remove(P.item),P.polygon1=new P._cesium.PolygonGeometry({polygonHierarchy:new P._cesium.PolygonHierarchy(I),extrudedHeight:M,height:0,vertexFormat:P._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT});var e=new P._cesium.Primitive({geometryInstances:new P._cesium.GeometryInstance({geometry:P.polygon1}),appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Water",uniforms:{baseWaterColor:n.watherColor||Cesium.Color.SKYBLUE.withAlpha(.6),blendColor:n.watherColor||Cesium.Color.SKYBLUE.withAlpha(.6),normalMap:n.url,frequency:n.frequency||1e3,animationSpeed:n.watherSpeed||.01,amplitude:n.amplitude||10}}})}),show:!0}),t=P._viewer.scene.primitives.add(e);R.ployline.push(t),P.item=e,""!=a&&null!=a&&"function"==typeof a&&a(L),P._core.isnull(d.selectedItem)||"group"!=d.selectedItem.type||(s=d.selectedItem.id);var i=P._core.getuid(),r={id:i,name:"新建淹没分析"+i,pId:P._core.isnull(s)?0:s,type:"polygon",item:P};P.setTreeobj(r),d.insertGroupId(r,P._core.isnull(s)?0:s)}},50)}this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+b.draw),this._tree.handler.setInputAction(function(e){if(A)void 0===L?x.showAt(e.endPosition,"点击拾取初始水面高度"):void 0===M&&x.showAt(e.endPosition,"点击拾取最大淹没高度");else{4<=I.length?x.showAt(e.endPosition,"右键结束绘制"):x.showAt(e.endPosition,"点击左键绘制淹没区域");var t=P._viewer.camera.getPickRay(e.endPosition);if(C=P._viewer.scene.globe.pick(t,P._viewer.scene),2<=I.length){if(P._cesium.defined(_)){for(var i=I[0],r=P._viewer.scene.globe.ellipsoid.cartesianToCartographic(i),o=Cesium.Math.toDegrees(r.latitude),n=Cesium.Math.toDegrees(r.longitude),a=I[I.length-2],s=P._viewer.scene.globe.ellipsoid.cartesianToCartographic(a),l=Cesium.Math.toDegrees(s.latitude),u=Cesium.Math.toDegrees(s.longitude),c=P._viewer.scene.globe.ellipsoid.cartesianToCartographic(C),h=Cesium.Math.toDegrees(c.latitude),d=Cesium.Math.toDegrees(c.longitude),m=Cesium.turf.lineString([[n,o],[d,h]]),p=Cesium.turf.lineString([[u,l],[d,h]]),g=!0,f=0;f<O.length&&2<=O.length;f++){var v=O[f];if(0!=f){if(f!=O.length-1){if(Cesium.turf.lineIntersect(m,v).features.length)return g=!1,void(x.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>');if(Cesium.turf.lineIntersect(p,v).features.length){g=!1,x.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>';break}}else if(Cesium.turf.lineIntersect(m,v).features.length){g=!1,x.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>';break}}else if(Cesium.turf.lineIntersect(p,v).features.length){g=!1,x.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>';break}}if(!g)return;I.pop(),I.push(C),T=new P._cesium.PolygonHierarchy(I)}else T=new P._cesium.PolygonHierarchy(I),_=new w(T);y||(y=P._viewer.entities.add({polyline:{positions:new Cesium.CallbackProperty(function(){return I.concat([I[0]])},!1),clampToGround:!0,width:3}}),P._points.push(y))}}},P._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){var t=P._getPosition.getMousePosition(e);if(t)if(A){var i=P._cesium.Cartographic.fromCartesian(t);if(void 0===L)L=i.height;else if(void 0===M){if((M=i.height)<L)return window.layuiLayer&&window.layuiLayer.msg("最大淹没高度小于初始水面高度,请重新拾取"),void(L=M=void 0);N()}}else{if(0==I.length&&(I.push(t.clone()),T=new P._cesium.PolygonHierarchy(I)),2<=I.length)if(0==O.length){var r=I[0],o=P._viewer.scene.globe.ellipsoid.cartesianToCartographic(r),n=Cesium.Math.toDegrees(o.latitude),a=Cesium.Math.toDegrees(o.longitude),s=I[1],l=P._viewer.scene.globe.ellipsoid.cartesianToCartographic(s),u=Cesium.Math.toDegrees(l.latitude),c=Cesium.Math.toDegrees(l.longitude),h=Cesium.turf.lineString([[a,n],[c,u]]);O.push(h)}else{if(2<=O.length){r=I[0],o=P._viewer.scene.globe.ellipsoid.cartesianToCartographic(r),n=Cesium.Math.toDegrees(o.latitude),a=Cesium.Math.toDegrees(o.longitude),s=I[I.length-2],l=P._viewer.scene.globe.ellipsoid.cartesianToCartographic(s),u=Cesium.Math.toDegrees(l.latitude),c=Cesium.Math.toDegrees(l.longitude);for(var d=P._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),m=Cesium.Math.toDegrees(d.latitude),p=Cesium.Math.toDegrees(d.longitude),g=Cesium.turf.lineString([[a,n],[p,m]]),f=Cesium.turf.lineString([[c,u],[p,m]]),v=!0,_=0;_<O.length&&2<=O.length;_++){var y=O[_];if(0!=_){if(_!=O.length-1){if(Cesium.turf.lineIntersect(g,y).features.length)return v=!1,void(x.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>');if(Cesium.turf.lineIntersect(f,y).features.length){v=!1,x.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>';break}}else if(Cesium.turf.lineIntersect(g,y).features.length){v=!1,x.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>';break}}else if(Cesium.turf.lineIntersect(f,y).features.length){v=!1,x.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>';break}}if(!v)return}r=I[I.length-2],o=P._viewer.scene.globe.ellipsoid.cartesianToCartographic(r),n=Cesium.Math.toDegrees(o.latitude),a=Cesium.Math.toDegrees(o.longitude),l=P._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),u=Cesium.Math.toDegrees(l.latitude),c=Cesium.Math.toDegrees(l.longitude),h=Cesium.turf.lineString([[a,n],[c,u]]);O.push(h)}I.push(t),T=new P._cesium.PolygonHierarchy(I);var C=P._cesium.Cartographic.fromCartesian(I[I.length-1]),w=P._cesium.Math.toDegrees(C.longitude),b=P._cesium.Math.toDegrees(C.latitude),E=C.height;D.push({lon:w,lat:b,hei:E});var S=P._viewer.entities.add({name:"多边形",position:I[I.length-1],point:{pixelSize:5,color:P._cesium.Color.RED,outlineColor:P._cesium.Color.WHITE,outlineWidth:1,heightReference:P._cesium.HeightReference.CLAMP_TO_GROUND}});P._tree.temporaryItem.obj.push(S),R.label.push(S),P._points.push(S)}},P._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){A||I.length<=3||(x.show(!1),I.pop(),T=new P._cesium.PolygonHierarchy(I),n.pointSelect?A=!(M=L=void 0):N())},P._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){if(x.show(!1),P._core.mouse(P._viewer.container,0),P._tree.handler.destroy(),P._tree.endtemporaryItem(),P.end=void 0,"cancel"===e&&!i.waterTimer&&(P.item&&P._viewer.entities.remove(P.item),0<i._points.length)){for(var t=0;t<i._points.length;t++)i._viewer.entities.remove(i._points[t]);i._points=[]}};var w=function(){function e(e){this.options={name:"多边形",polygon:{hierarchy:[],material:P._cesium.Color.SKYBLUE.withAlpha(.5),heightReference:P._cesium.HeightReference.NONE,extrudedHeight:0}},this.hierarchy=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new P._cesium.CallbackProperty(function(){return e.hierarchy},!1);var t=P._viewer.entities.add(this.options);P.item=t,P._tree.temporaryItem.obj.push(t);try{null!=n&&""!=n&&(0<n.waterHeight&&(L=n.waterHeight),0<n.targetHeight&&(M=n.targetHeight),0<n.spood&&(r=n.spood),""!=n.GroupID&&null!=n.GroupID&&(s=n.GroupID))}catch(e){console.log(e)}},e}();return this},t.prototype.endWater=function(){this.end&&this.end(),this.waterTimer&&clearInterval(this.waterTimer),this._tree.endtemporaryItem(),this.deleteObject()},t.prototype.executePolygonymsdtt=function(o,e){var n=0;this._tree.removeHandler();var s=this;this._tree.starttemporaryItem(this._viewer),s._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(s._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._tree.handler=new s._cesium.ScreenSpaceEventHandler(s._viewer.scene._imageryLayerCollection);var l=[],u=[],i=null,c=null,a={mj:0,label:{}};this._tree.handler.setInputAction(function(e){var t=s._viewer.camera.getPickRay(e.endPosition);c=s._viewer.scene.globe.pick(t,s._viewer.scene),2<=l.length&&(s._cesium.defined(i)?(l.pop(),l.push(c)):i=new r(l),new s._cesium.PolygonHierarchy(l))},s._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){var t=s._viewer.camera.getPickRay(e.position);c=s._viewer.scene.globe.pick(t,s._viewer.scene),0==l.length&&(l.push(c.clone()),new s._cesium.PolygonHierarchy(l)),l.push(c),new s._cesium.PolygonHierarchy(l);var i=s._cesium.Cartographic.fromCartesian(l[l.length-1]),r=s._cesium.Math.toDegrees(i.longitude),o=s._cesium.Math.toDegrees(i.latitude),n=i.height;u.push({lon:r,lat:o,hei:n});var a=s._viewer.entities.add({name:"多边形面积",position:l[l.length-1],point:{pixelSize:5,color:s._cesium.Color.RED,outlineColor:s._cesium.Color.WHITE,outlineWidth:2,heightReference:s._cesium.HeightReference.CLAMP_TO_GROUND}});s._tree.temporaryItem.obj.push(a),s._points.push(a)},s._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){s._tree.handler.destroy();n="平方千米",a.mj=n,s._viewer.entities.remove(s.item),s.polygon1=new s._cesium.PolygonGeometry({polygonHierarchy:new s._cesium.PolygonHierarchy(l),extrudedHeight:0,height:0,vertexFormat:s._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT});var t=new s._cesium.Primitive({geometryInstances:new s._cesium.GeometryInstance({geometry:s.polygon1}),appearance:new s._cesium.EllipsoidSurfaceAppearance({aboveGround:!0}),show:!0}),i=new s._cesium.Material({fabric:{type:"Water",uniforms:{normalMap:o.url,frequency:100,animationSpeed:.01,amplitude:10}}});t.appearance.material=i;var r=s._viewer.scene;s.polygon1=r.primitives.add(t),s._tree.endtemporaryItem(),l.pop(),new s._cesium.PolygonHierarchy(l)},s._cesium.ScreenSpaceEventType.RIGHT_CLICK);var r=function(){function e(e){this.options={name:"多边形",polygon:{hierarchy:[],material:s._cesium.Color.SKYBLUE.withAlpha(.4),heightReference:s._cesium.HeightReference.NONE,extrudedHeight:0}},this.hierarchy=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new s._cesium.CallbackProperty(function(){return e.hierarchy},!1);var t=s._viewer.entities.add(this.options);s.item=t,s._tree.temporaryItem.obj.push(t);var i=0;s._core.isnull(d.selectedItem)||"group"!=d.selectedItem.type||(i=d.selectedItem.id);var r=s._core.getuid(),o={id:r,name:"新建水面"+r,pId:s._core.isnull(i)?0:i,type:"polyline",item:s};s.setTreeobj(o),d.insertGroupId(o,s._core.isnull(i)?0:i)},e}();return this},t.prototype.executePolygontdmj=function(t,e){var o=this;this._tree.starttemporaryItem(this._viewer),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+b.draw),this._tree.removeHandler();var r,n={mj:0,label:[],polygon:[]},a=!0,s=[],l={},u=void 0,i=this._viewer.scene,c=i.globe.ellipsoid,h={point:o._cesium.Color.RED,polyline:o._cesium.Color.YELLOW,polygon:o._cesium.Color.YELLOW.withAlpha(.5)};0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(h.point=e.point),""!=e.polyline&&null!=e.polyline&&(h.polyline=e.polyline),""!=e.polygon&&null!=e.polygon&&(h.polygon=e.polygon));var d=this._core.CreateTooltip();this._tree.handler=new o._cesium.ScreenSpaceEventHandler(i.canvas);var m=0;this._tree.handler.setInputAction(function(e){0===s.length?d.showAt(e.endPosition,"左键开始绘制!"):s.length<=2?d.showAt(e.endPosition,"点击继续绘制!"):d.showAt(e.endPosition,"右键结束绘制!"),r&&(o._viewer.entities.remove(r),r=void 0);var t=o._getPosition.getMousePosition(e,[n.polygon,n.label]);if(t&&o._cesium.Ellipsoid.WGS84.cartesianToCartographic(t)&&a&&(s.pop(),s.push(t),3<=s.length)){var i=String(g(u.path.positions));i=i.substr(0,i.indexOf(".",0)),m=i.length<6?i+"平方米":(i=(i=String(i/1e6)).substr(0,i.indexOf(".",0)+3))+"平方千米",n.mj=m,r=o._viewer.entities.add({name:"多边形面积",position:new Cesium.CallbackProperty(function(){var t=new Cesium.Cartesian3;return s.forEach(function(e){Cesium.Cartesian3.add(t,e,t)}),Cesium.Cartesian3.divideByScalar(t,s.length,new Cesium.Cartesian3)},!1),label:{text:m,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:o._cesium.HeightReference.CLAMP_TO_GROUND}}),o._tree.temporaryItem.obj.push(r),o._points.push(r),n.label=r}},o._cesium.ScreenSpaceEventType.MOUSE_MOVE);var p=void 0;this._tree.handler.setInputAction(function(e){var t=o._getPosition.getMousePosition(e,[n.polygon,n.label]);if(1,t&&a&&(s.length||s.push(t.clone()),s.push(t),l=new o._cesium.PolygonHierarchy(s),r&&(o._viewer.entities.remove(r),r=void 0),2===s.length&&(p=o._viewer.entities.add({name:"临时线",polyline:{positions:new Cesium.CallbackProperty(function(){return s},!1),clampToGround:!0,material:h.polygon,width:3}})),3<=s.length&&!o._cesium.defined(u)&&(p&&o._viewer.entities.remove(p),u=new _(l,o._cesium)),3<=s.length)){var i=String(g(u.path.positions));i=i.substr(0,i.indexOf(".",0)),m=i.length<6?i+"平方米":(i=(i=String(i/1e6)).substr(0,i.indexOf(".",0)+3))+"平方千米",n.mj=m,r=o._viewer.entities.add({name:"多边形面积",position:new Cesium.CallbackProperty(function(){var t=new Cesium.Cartesian3;return s.forEach(function(e){Cesium.Cartesian3.add(t,e,t)}),Cesium.Cartesian3.divideByScalar(t,s.length,new Cesium.Cartesian3)},!1),label:{text:m,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:o._cesium.HeightReference.CLAMP_TO_GROUND}}),o._tree.temporaryItem.obj.push(r),o._points.push(r),n.label=r}},o._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(){o.end&&o.end()},o._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){o._tree.handler.removeInputAction(o._cesium.ScreenSpaceEventType.LEFT_CLICK),o._tree.handler.removeInputAction(o._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),o._cesium.trackedEntity=void 0,o.end=void 0,o._tree.endtemporaryItem(),a=!1,d.show(!1),o._tree.handler.destroy(),o._core.mouse(o._viewer.container,0,"0"),p&&o._viewer.entities.remove(p),"cancel"!==e?(s.length<3&&o.deleteObject(),""!=t&&null!=t&&"function"==typeof t&&t(n)):o.deleteObject()};var g=function(e){for(var t=new Array(e.length),i=0;i<e.length;i++)t[i]=f(c.cartesianToCartographic(e[i]));var r=0;for(i=0;i<t.length;i++)r+=t[i].longitude;r/=t.length;for(i=0;i<t.length;i++)t[i]=o._core.Gauss_to_XY(t[i].longitude,t[i].latitude,r,o._cesium);return Math.abs(v(t))},f=function(e){return e.longitude=e.longitude/Math.PI*180,e.latitude=e.latitude/Math.PI*180,e},v=function(e){for(var t=0,i=0;i<e.length;i++){var r,o=e[i];r=i<e.length-1?e[i+1]:e[0],t+=o.x*r.y-r.x*o.y}return t/2},_=function(){function e(e,t){if(!o._cesium.defined(e))throw new o._cesium.DeveloperError("positions is required!");if(e.length<3)throw new o._cesium.DeveloperError("positions 的长度必须大于等于3");this.options={polygon:{show:!0,hierarchy:void 0,classificationType:o._cesium.ClassificationType.BOTH,material:h.polygon}},this.path=e,this._init(t)}return e.prototype._init=function(e){var t=this;this.options.polygon.hierarchy=new o._cesium.CallbackProperty(function(){return t.path},!1),this.polygonEntity=o._viewer.entities.add(this.options),o.item=this.polygonEntity,o._tree.temporaryItem.obj.push(this.polygonEntity),n.polygon=this.polygonEntity,o._entity=this.polygonEntity},e}();return this},t.prototype.setVisibility=function(e){if(0<this._points.length)for(var t=0;t<this._points.length;t++)this._points[t].show=e;this._lable&&(this._lable.show=e),this.item.show=e},t.prototype.getVisibility=function(){return this.item.show},t.prototype.setRadius=function(e){try{for(var t=[],i=this.item._polygon.hierarchy.getValue(),r=this._viewer.scene.globe.ellipsoid,o=0;o<i.length;o++){var n=new this._cesium.Cartesian3(i[o].x,i[o].y,i[o].z),a=r.cartesianToCartographic(n),s=this._cesium.Math.toDegrees(a.latitude),l=this._cesium.Math.toDegrees(a.longitude);t.push(l),t.push(s)}var u=new this._cesium.Cartesian3(i[0].x,i[0].y,i[0].z),c=r.cartesianToCartographic(u);s=this._cesium.Math.toDegrees(c.latitude),l=this._cesium.Math.toDegrees(c.longitude);t.push(l),t.push(s),t=this._cesium.Cartesian3.fromDegreesArray(t),this.item.corridor=new this._cesium.CorridorGraphics({positions:t,width:e,material:this._cesium.Color.RED.withAlpha(.4)})}catch(e){console.log(e)}return this},t.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show._value,t=this.item.polygon.hierarchy.getValue(),i=null==this.item.polygon.height?void 0:this.item.polygon.height._value,r=null==this.item.polygon.extrudedHeight?void 0:this.item.polygon.extrudedHeight._value,o=null==this.item.polygon.stRotation?void 0:this.item.polygon.stRotation._value,n=null==this.item.polygon.fill?void 0:this.item.polygon.fill._value,a=this.item.polygon.material;null!=a&&(a={color:null==a.color?void 0:"rgba("+a.color._value.red+","+a.color._value.green+","+a.color._value.blue+","+a.color._value.alpha+")",image:null==a.image?void 0:a.image._value,diffusemap:null==a.diffusemap?void 0:a.diffusemap._value,alphamap:null==a.alphamap?void 0:a.alphamap._value});var s=null==this.item.polygon.outline?void 0:this.item.polygon.outline._value,l=null==this.item.polygon.outlineColor?void 0:"rgba("+this.item.polygon.outlineColor._value.red+","+this.item.polygon.outlineColor._value.green+","+this.item.polygon.outlineColor._value.blue+","+this.item.polygon.outlineColor._value.alpha+")",u=null==this.item.polygon.outlineWidth?void 0:this.item.polygon.outlineWidth._value,c=null==this.item.polygon.perPositionHeight?void 0:this.item.polygon.perPositionHeight._value,h=null==this.item.polygon.closeTop?void 0:this.item.polygon.closeTop._value,d=null==this.item.polygon.closeBottom?void 0:this.item.polygon.closeBottom._value,m=this.item.polygon.distanceDisplayCondition,p=null==m?void 0:m._value.near,g=null==m?void 0:m._value.far;return{type:"polygon",treeobj:{name:this.treeobj.name},style:{show:e,hierarchy:t,height:i,extrudedHeight:r,stRotation:o,fill:n,material:a,outline:s,outlineColor:l,outlineWidth:u,perPositionHeight:c,closeTop:h,closeBottom:d,near:p,far:g}}},t.prototype.setTreeobj=function(e){this.treeobj=e},t.prototype.setDistanceDisplayCondition=function(e,t){var i=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._polygon.distanceDisplayCondition=i}catch(e){console.log(e)}return this},t.prototype.setPolygonAlpha=function(e){try{this.item._polygon.material.color._value.alpha=e}catch(e){console.log(e)}return this},t.prototype.setPolygonColor=function(e){try{this.item._polygon.material.color=new c(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},t.prototype.setDistanceDisplayCondition=function(e,t){var i=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._polygon.distanceDisplayCondition=i}catch(e){console.log(e)}return this},t.prototype.setPolygonImage=function(e){try{this.item._polygon.material=new this._cesium.ImageMaterialProperty({image:e})}catch(e){console.log(e)}return this},t.prototype.setPolygonRepeat=function(e,t){try{this.item._polygon.material.repeat=new this._cesium.Cartesian2(e,t)}catch(e){console.log(e)}return this},t.prototype.setOutlineColor=function(e){try{this.item._polygon.outlineColor=new c(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},t.prototype.setOutline=function(e){try{this.item._polygon.outline=e}catch(e){console.log(e)}return this},t.prototype.setExtrudedHeight=function(e){try{this.item._polygon.extrudedHeight=e}catch(e){console.log(e)}return this},t.prototype.setHeight=function(e){try{this.item._polygon.height=e}catch(e){console.log(e)}return this},t.prototype.setHeightType=function(e){try{1==e?this.item._polygon.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._polygon.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._polygon.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},Object.defineProperties(t.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),Object.defineProperties(t.prototype,{HighLight:{set:function(e){e&&(this.item.material=this.item.polygon.material),this.item.polygon.material=e?new c(this._viewer,this._cesium).colorFromHtmlColor(this._core.selectedColor):this.item.material}},polygonShow:{set:e.debounce(function(e){this.item.polygon.show=e},500),get:function(){return this.item.polygon.b}},polygonHeight:{set:e.debounce(function(e){this._core.isnull(e)||(/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,"")),this.item.polygon.height=e)},500),get:function(){var e=this.item.polygon.height;if(e)return e._value}},polygonHeightReference:{set:e.debounce(function(e){this._core.isnull(e)||(this.item.polygon.heightReference=e)},500),get:function(){var e=this.item.polygon.heightReference;if(e)return e._value}},polygonExtrudedHeight:{set:e.debounce(function(e){this._core.isnull(e)||(/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,"")),this.item.polygon.extrudedHeight=e)},500),get:function(){var e=this.item.polygon.extrudedHeight;if(e)return e._value}},polygonExtrudedHeightReference:{set:e.debounce(function(e){this._core.isnull(e)||(this.item.polygon.extrudedHeightReference=e)},500),get:function(){var e=this.item.polygon.extrudedHeightReference;if(e)return e._value}},polygonFill:{set:e.debounce(function(e){this.item.polygon.fill=e},500),get:function(){var e=this.item.polygon.fill;if(e)return e._value}},polygonMaterial:{set:e.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._Color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.polygon.material=e,this.item.material=this.item.polygon.material)},500),get:function(){var e=this.item.polygon.material;try{return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}},polygonMaterialAlpha:{set:e.debounce(function(e){this._core.isnull(e)||(this.item.polygon.material.color.alpha=e)},500),get:function(){this.item.polygon.material;try{return this.item.polygon.material.color.alpha}catch(e){}}},polygonOutline:{set:e.debounce(function(e){this._core.isnull(e)||(this.item.polygon.outline=e)},500),get:function(){var e=this.item.polygon.outline;if(e)return e._value}},polygonOutlineColor:{set:e.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._Color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.polygon.outlineColor=e)},500),get:function(){var e=this.item.polygon.outlineColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},polygonOutlineWidth:{set:e.debounce(function(e){this._core.isnull(e)||(/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,"")),this.item.polygon.outlineWidth=e)},500),get:function(){var e=this.item.polygon.outlineWidth;if(e)return e._value}}}),t.prototype.setItem=function(e){this.item=e},Object.defineProperties(t.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),Object.defineProperties(t.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(t.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(t.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(t.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Object.defineProperties(t.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(t.prototype,{polygonTempOptions:{get:function(){return{height:0,extrudedHeight:0,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:1,granularity:this._cesium.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:ShadowMode.DISABLED,classificationType:ClassificationType.BOTH,arcType:ArcType.GEODESIC}}}}),Object.defineProperties(t.prototype,{Visibility:{get:function(){return this.item.show}},PolygonColor:{get:function(){var e=this.item._polygon.material.color._value;if(e)return new c(this._viewer,this._cesium).toHtmlColor("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")")}},PolygonAlpha:{get:function(){if(this.item._polygon.material.color)return this.item._polygon.material.color._value.alpha||1}},Outline:{get:function(){if(this.item._polygon.outline)return this.item._polygon.outline._value}},OutlineColor:{get:function(){var e=this.item._polygon.outlineColor;if(this.item._polygon.outlineColor)return e=e._value,new c(this._viewer,this._cesium).toHtmlColor("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")")}},ExtrudedHeight:{get:function(){if(this.item._polygon.extrudedHeight)return this.item._polygon.extrudedHeight._value}},Height:{get:function(){return this.item._polygon.height}},PolygonImage:{get:function(){if(this.item._polygon.material.uniforms)return this.item._polygon.material.uniforms.image}},PolygonRepeat:{get:function(){if(this.item._polygon.material.uniforms)return this.item._polygon.material.repeat}}}),t.prototype.forceEndHanlder=function(){this._tree.handler&&(this._tree.handler.destroy(),this._tree.handler=void 0)},t}),define("SGWorld/Creator/position",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.createPosition=function(e,t,i){return new this.Cartesian3.fromDegrees(e,t,i)},e.prototype.CreatePosition=function(e,t,i,r,o,n,a,s){return{X:e,Y:t,Altitude:i,AltitudeType:r,Yaw:o,Pitch:n,Roll:a,Distance:s}},e}),define("SGWorld/Creator/ImageLabel",["../Core/Core","./Color","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min"],function(i,r,o,e){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._tree=o,this._core=new i,this._Color=new r(this._viewer,this._cesium)}return t.prototype.createImageLabel=function(e,t,i,r){var o={id:this._core.getuid(),image:"../images/Cesium_Logo_overlay.png",show:!0,color:this._cesium.Color.IVORY},n=this._core.extend(o,t,!0);n.color&&(this._core.isnull(n)||this._core.isnull(n.color)||"["==n.color.toString().charAt(0)&&"]"==n.color.toString().charAt(n.color.length-1)||(this._core.isHtmlColor(n.color)&&/^#/.test(n.color.toString())?n.color=this._Color.colorFromHtmlColor(n.color):(/^rgb/.test(n.color)&&(n.color=this._Color.rgbaStringToRgbaObj(n.color)),1<n.color.r&&(n.color.r=n.color.r/255),1<n.color.g&&(n.color.g=n.color.g/255),1<n.color.b&&(n.color.b=n.color.b/255),1<n.color.a&&(n.color.a=n.color.a/255),n.color.r&&(n.color=this._Color.createColor(n.color.r,n.color.g,n.color.b,n.color.a))))),n.near&&n.far&&(n.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(n.near,n.far)),this.item=this._viewer.entities.add({name:r,position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),billboard:n});var a={id:this.item.id,name:r,pId:this._core.isnull(i)?0:i,type:"Imagelabel",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},t.prototype.getstyles=function(){var e={};return e.show=!this.item.billboard.show||this.item.billboard.show._value,e.image=this.item.billboard.image&&this.item.billboard.image._value?this.item.billboard.image._value:void 0,e.scale=this.item.billboard.scale&&this.item.billboard.scale._value?this.item.billboard.scale._value:void 0,e.pixelOffset=this.item.billboard.pixelOffset?this.item.billboard.pixelOffset._value:void 0,e.horizontalOrigin=this.item.billboard.horizontalOrigin&&this.item.billboard.horizontalOrigin._value?this.item.billboard.horizontalOrigin._value:void 0,e.verticalOrigin=this.item.billboard.verticalOrigin&&this.item.billboard.verticalOrigin._value?this.item.billboard.verticalOrigin._value:void 0,e.heightReference=this.item.billboard.heightReference&&this.item.billboard.heightReference._value&&this.item.billboard.heightReference._value?this.item.billboard.heightReference._value:null,e.color=this.item.billboard.color&&this.item.billboard.color._value?"rgba"+this.item.billboard.color.toString():void 0,e.width=this.item.billboard.width&&this.item.billboard.width._value?this.item.billboard.width._value:void 0,e.height=this.item.billboard.height&&this.item.billboard.height._value?this.item.billboard.height._value:void 0,e.near=this.item.billboard.distanceDisplayCondition?this.item.billboard.distanceDisplayCondition._value.near:void 0,e.far=this.item.billboard.distanceDisplayCondition?this.item.billboard.distanceDisplayCondition._value.far:void 0,e.position=this.item.position.getValue().toString(),e},t.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},t.prototype.setDistanceDisplayCondition=function(e,t){var i=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._billboard.distanceDisplayCondition=i}catch(e){console.log(e)}return this},t.prototype.setUrl=function(e){this.item._billboard.image=e},t.prototype.setVisibility=function(e){this.item.show=e},t.prototype.getVisibility=function(){return this.item.show},t.prototype.setColor=function(e){try{this.item._billboard.color=new r(this._viewer,this._cesium).colorFromHtmlColor(e),this.item.color=this.item._billboard.color}catch(e){console.log(e)}return this},t.prototype.setWidth=function(e){try{this.item._billboard.width=e}catch(e){console.log(e)}return this},t.prototype.setColorAlpha=function(e){try{this.item._billboard.color._value.alpha=e}catch(e){console.log(e)}return this},t.prototype.setHeight=function(e){try{this.item._billboard.height=e}catch(e){console.log(e)}return this},t.prototype.setHeightType=function(e){try{1==e?this.item._billboard.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._billboard.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._billboard.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},t.prototype.setRotation=function(e){try{this.item._billboard.rotation=this._cesium.Math.toRadians(e)}catch(e){console.log(e)}return this},t.prototype.setItem=function(e){this.item=e},t.prototype.setScale=function(e){try{this.item._billboard.scale=e}catch(e){console.log(e)}return this},t.prototype.CreateImageLabel=function(e,t,i,r,o){var n={id:this._core.getuid(),image:ImageLabel,show:!0,scale:i.Scale,color:i.IconColor,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(i.MinViewingHeight,i.MaxViewingHeight)};this.item=this._viewer.entities.add({name:o,position:this._cesium.Cartesian3.fromDegrees(positions.X,positions.X,positions.Altitude),billboard:n});var a=this.item.id;""==o&&(a=o);var s={id:this.item.id,name:a,pId:this._core.isnull(r)?0:r,type:"Imagelabel",item:this};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(r)?0:r),this},t.prototype.export=function(){var e=null==this.item.billboard.image?void 0:this.item.billboard.image._value,t=null==this.item.billboard.show?void 0:this.item.billboard.show._value,i=null==this.item.billboard.scale?void 0:this.item.billboard.scale._value,r=null==this.item.billboard.horizontalOrigin?void 0:this.item.billboard.horizontalOrigin._value,o=null==this.item.billboard.verticalOrigin?void 0:this.item.billboard.verticalOrigin._value,n=null==this.item.billboard.rotation?void 0:this.item.billboard.rotation._value,a=null==this.item.billboard.width?void 0:this.item.billboard.width._value,s=null==this.item.billboard.height?void 0:this.item.billboard.height._value,l=null==this.item.billboard.color?void 0:"rgba("+this.item.billboard.color._value.red+","+this.item.billboard.color._value.green+","+this.item.billboard.color._value.blue+","+this.item.billboard.color._value.alpha+")",u=null==this.item.billboard.heightReference?void 0:this.item.billboard.heightReference._value,c=this.item.billboard.distanceDisplayCondition,h=null==c?void 0:c._value.near,d=null==c?void 0:c._value.far,m=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"image",position:{x:this._cesium.Math.toDegrees(m.longitude),y:this._cesium.Math.toDegrees(m.latitude),z:this._cesium.Math.toDegrees(m.height)},treeobj:{name:this.treeobj.name},style:{image:e,show:t,scale:i,horizontalOrigin:r,verticalOrigin:o,rotation:n,width:a,height:s,color:l,heightReference:u,near:h,far:d}}},t.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(t.prototype,{position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=this._cesium.Math.toDegrees(t.longitude),r=this._cesium.Math.toDegrees(t.latitude),o=(this._cesium.Math.toDegrees(t.height),this._cesium.Cartesian3.fromDegrees(i,r,e));this.item.position.position=o,this._postion.Altitude=e}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e;var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=(this._cesium.Math.toDegrees(t.longitude),this._cesium.Math.toDegrees(t.latitude)),r=this._cesium.Math.toDegrees(t.height),o=this._cesium.Cartesian3.fromDegrees(e,i,r);this.item.position.position=o}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e;var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=this._cesium.Math.toDegrees(t.longitude),r=(this._cesium.Math.toDegrees(t.latitude),this._cesium.Math.toDegrees(t.height)),o=this._cesium.Cartesian3.fromDegrees(i,e,r);this.item.position.position=o}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e}catch(e){console.log(e)}}}},LabelStyle:{BackgroundColor:{get:function(){return""},set:function(e){}},Bold:{get:function(){return""},set:function(e){}},FontName:{get:function(){return""},set:function(e){}},FontSize:{get:function(){return""},set:function(e){}},FrameFileName:{get:function(){return""},set:function(e){}},IconColor:{set:e.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._Color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.fillColor=e)},500),get:function(){var e=this.item.label.fillColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},Italic:{get:function(){return""},set:function(e){}},LimitScreenSize:{get:function(){return""},set:function(e){}},LineColor:{get:function(){return""},set:function(e){}},LineToGround:{get:function(){return""},set:function(e){}},LockMode:{get:function(){return""},set:function(e){}},MaxImageSize:{get:function(){return""},set:function(e){}},MaxViewingHeight:{get:function(){if(null!=this.item._label.distanceDisplayCondition)return this.item._label.distanceDisplayCondition._value.far},set:function(e){var t=0;null!=this.item._label.distanceDisplayCondition&&(t=this.item._label.distanceDisplayCondition._value.near),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(t,e)}},MinViewingHeight:{get:function(){if(null!=this.item._label.distanceDisplayCondition)return this.item._label.distanceDisplayCondition._value.near},set:function(e){var t=0;null!=this.item._label.distanceDisplayCondition&&(t=this.item._label.distanceDisplayCondition._value.far),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,t)}},MultilineJustification:{get:function(){return""},set:function(e){}},PivotAlignment:{get:function(){return""},set:function(e){}},Scale:{get:function(){if(null!=this.item._label.scale)return this.item.label.scale.getValue()},set:function(e){this.item.label.scale.setValue(e)}},TextAlignment:{get:function(){return""},set:function(e){}},TextColor:{get:function(){return""},set:function(e){}},TextOnImage:{get:function(){return""},set:function(e){}},Underline:{get:function(){return""},set:function(e){}}}}),t.prototype.CreateImageLabel=function(e,t,i,r,o){this._postion=e;var n={id:this._core.getuid(),image:t,backgroundColor:i.BackgroundColor,fillColor:i.IconColor,font:i.FontName,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,outlineColor:i.LineColor,show:!0,scale:i.Scale,showBackground:!1,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(i.MinViewingHeight,i.MaxViewingHeight)};i.Italic&&(n.font="italic "+n.font),i.Italic&&(n.font="Bold "+n.font);var a=this._core.extend(n,i,!0);this.item=this._viewer.entities.add({name:o,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),billboard:a});var s={id:this.item.id,name:o,pId:this._core.isnull(r)?0:r,type:"ImageLabel",item:this};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(r)?0:r),this},Object.defineProperties(t.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{this._postion.Altitude=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}}},LabelStyle:{BackgroundColor:{set:e.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._Color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.backgroundColor=e,this.item.backgroundColor=e)},500),get:function(){var e=this.item.label.backgroundColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},Bold:{get:function(){return-1!=this.item._label.font.getValue().indexOf("bold")},set:function(){var e="bold "+this.item._label.font.getValue();this.item._label.font.setValue(e)}},FontName:{get:function(){for(var e=this.item._label.font.getValue().split(" "),t=0;t<e.length;t++)if("bold"!=e[t]&&-1==e[t].indexOf("px")&&-1==e[t].indexOf("PX"))return e[t]},set:function(e){for(var t=this.item._label.font.getValue().split(" "),i=e,r=0;r<t.length;r++)"bold"!=t[r]&&-1==t[r].indexOf("px")&&-1==t[r].indexOf("PX")||(i=i+" "+t[r]);this.item._label.font.setValue(i)}},FontSize:{get:function(){for(var e=this.item._label.font.getValue().split(" "),t=0;t<e.length;t++)if(-1!=e[t].indexOf("px"))return e[t]},set:function(e){for(var t=this.item._label.font.getValue().split(" "),i=e,r=0;r<t.length;r++)-1==t[r].indexOf("px")||(i=i+" "+t[r]);this.item._label.font.setValue(i)}},FrameFileName:{get:function(){return""},set:function(e){}},IconColor:{set:e.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._Color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.fillColor=e)},500),get:function(){var e=this.item.label.fillColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},Italic:{get:function(){for(var e=this.item._label.font.getValue().split(" "),t=0;t<e.length;t++)if(-1!=e[t].indexOf("italic"))return e[t]},set:function(e){for(var t=this.item._label.font.getValue().split(" "),i=e,r=0;r<t.length;r++)-1==t[r].indexOf("italic")||(i=i+" "+t[r]);this.item._label.font.setValue(i)}},LimitScreenSize:{get:function(){return""},set:function(e){}},LineColor:{set:e.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._Color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.outlineColor=e)},500),get:function(){var e=this.item.label.outlineColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},LineToGround:{get:function(){return""},set:function(e){}},LockMode:{get:function(){return""},set:function(e){}},MaxImageSize:{get:function(){return""},set:function(e){}},MaxViewingHeight:{get:function(){if(null!=this.item._label.distanceDisplayCondition)return this.item._label.distanceDisplayCondition._value.far},set:function(e){var t=0;null!=this.item._label.distanceDisplayCondition&&(t=this.item._label.distanceDisplayCondition._value.near),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(t,e)}},MinViewingHeight:{get:function(){if(null!=this.item._label.distanceDisplayCondition)return this.item._label.distanceDisplayCondition._value.near},set:function(e){var t=0;null!=this.item._label.distanceDisplayCondition&&(t=this.item._label.distanceDisplayCondition._value.far),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,t)}},MultilineJustification:{get:function(){return""},set:function(e){}},PivotAlignment:{get:function(){return""},set:function(e){}},Scale:{get:function(){if(null!=this.item._label.scale)return this.item.label.scale.getValue()},set:function(e){this.item.label.scale.setValue(e)}},TextAlignment:{get:function(){return""},set:function(e){}},TextColor:{get:function(){return""},set:function(e){}},TextOnImage:{get:function(){return""},set:function(e){}},Underline:{get:function(){return""},set:function(e){}}}}),t}),define("SGWorld/Creator/wall",["./Color","../Core/Core","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min"],function(e,u,i,a){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new u,this._tree=i}t.prototype.createWall=function(e,t,i,r){var o={show:!0,minimumHeights:[100,100,100,100,100,100,100],maximumHeights:[2e3,2e3,2e3,2e3,2e3,2e3,2e3],material:this._cesium.Color.AQUA.withAlpha(1)};if(!this._core.isnull(i)){i=this._core.extend(o,i,!0);var n=new u;i&&"ImageMaterialProperty"==i.material?i.material=n.setImageMaterialProperty("../../img/arrow.png",this._cesium,0,i.id):i&&"DrawCanvasColorUpdown"==i.material&&(i.material=n.setImageMaterialProperty("../../img/arrow.png",this._cesium,1,i.id));var a=[];if(t[0].x||t[0].y)if(void 0!==t[0].z)for(s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s].x,t[s].y,t[s].z));else for(s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s].x,t[s].y));else if(2===t[0].length)for(var s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s][0],t[s][1]));else if(3===t[0].length)for(var s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s][0],t[s][1],t[s][2]));i.positions=a,void 0!==i.minHeight&&(i.minimumHeights=new Array(i.positions.length).fill(i.minHeight)),void 0!==i.maxHeight&&(i.maximumHeights=new Array(i.positions.length).fill(i.maxHeight));var l=this._viewer.entities.add({name:e,id:this._core.getuid(),wall:i});return l.positions=i.positions,this.item=l,this._tree.insertGroupId({id:l.id,name:e,pId:this._core.isnull(r)?0:r,type:"wall",item:this},this._core.isnull(r)?0:r),this}console.log("options is required")},t.prototype.executeWall=function(t,i){var l=[],r=void 0,u=this,o=function(){function e(e){this.options={id:u._core.getuid(),type:"wall",wall:{positions:[],minimumHeights:[2e3,2e3],maximumHeights:[1e3,1e3],material:u._core.setImageMaterialProperty("img/arrow.png",u._cesium,1)}},this.positions=e,this._init()}return e.prototype._init=function(){var s=this;this.options.wall.maximumHeights=new u._cesium.CallbackProperty(function(){for(var e=[],t=0;t<s.positions.length;t++)e.push(2e3);return e},!1),this.options.wall.minimumHeights=new u._cesium.CallbackProperty(function(){for(var e=[],t=0;t<s.positions.length;t++)e.push(1e3);return e},!1),this.options.wall.positions=new u._cesium.CallbackProperty(function(){for(var e=[],t=0;t<s.positions.length;t++){if(!l[t])return;var i=u._viewer.scene.globe.ellipsoid,r=new u._cesium.Cartesian3(l[t].x,l[t].y,l[t].z),o=i.cartesianToCartographic(r),n=u._cesium.Math.toDegrees(o.latitude),a=u._cesium.Math.toDegrees(o.longitude);o.height,e.push(a),e.push(n)}return u._cesium.Cartesian3.fromDegreesArray(e)},!1);var e=u._viewer.entities.add(this.options);u.item=e,u._tree.insertGroupId({id:this.options.id,name:t,pId:u._core.isnull(i)?0:i,type:"wall",item:u},u._core.isnull(i)?0:i)},e}(),n=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);n.setInputAction(function(e){var t=u._viewer.scene.camera.pickEllipsoid(e.position,u._viewer.scene.globe.ellipsoid);0==l.length&&l.push(a.clone(t)),l.push(a.clone(t))},u._cesium.ScreenSpaceEventType.LEFT_CLICK),n.setInputAction(function(e){var t=u._viewer.scene.camera.pickEllipsoid(e.endPosition,u._viewer.scene.globe.ellipsoid);1<=l.length&&(u._cesium.defined(r)?(l.pop(),l.push(t)):r=new o(l))},u._cesium.ScreenSpaceEventType.MOUSE_MOVE),n.setInputAction(function(e){n.destroy(),l.pop()},u._cesium.ScreenSpaceEventType.RIGHT_CLICK)};var n="a",s=0;return t.prototype.drawCanvasImage=function(e,t){var i=document.getElementById("canvas-"+n),r=i.getContext("2d"),o=new Image;return o.src="img/arrow.png",r.clearRect(0,0,700,100),o.onload=function(){s<=700?(r.drawImage(o,s,0),r.drawImage(o,s+100,0)):s=0,s+=5},n="a"===n?"b":"a",i},t.prototype.setVisibility=function(e){this.item.wall.show=e},t.prototype.getVisibility=function(){return this.item.wall.show},t.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},Object.defineProperties(t.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),Object.defineProperties(t.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),t.prototype.setItem=function(e){this.item=e},t.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(t.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(t.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(t.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(t.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Object.defineProperties(t.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(t.prototype,{wallTempOptions:{get:function(){return{positions:[],maximumHeights:[],minimumHeights:[],show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,granularity:this._cesium.Math.RADIANS_PER_DEGREE,shadows:ShadowMode.DISABLED,distanceDisplayCondition:null}}}}),t}),define("SGWorld/Creator/FeatureLayer",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.createCircle=function(e,t,i,r){return new this._cesium.ProviderViewModel({name:r,tooltip:r,iconUrl:"img/1.jpg",creationFunction:function(){return new this._cesium.ArcGisMapServerImageryProvider({url:e})}})},e.prototype.setItem=function(e){this.item=e},e}),define("SGWorld/Core/tdtwmtsimageprovider",[],function(){"use strict";var e=function(e,t,i,r,o,n,a){var s=new Cesium.Credit("WMTS");o=Cesium.defaultValue(o,{}),this._7=new Cesium.GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1}),this._3=256,this._4=256,this._10=Cesium.defaultValue(o.fileExtension,"jpg"),this._9=o.proxy,this._12=o.tileDiscardPolicy,this._2=i,this._1=r,this._8=new Cesium.Rectangle(0-Math.PI,0-Math.PI/2,Math.PI,Math.PI/2),this._5=new Cesium.Rectangle(0-Math.PI,0-Math.PI/2,Math.PI,Math.PI/2),this._6=!0,this.baseurl=e,this.needaddone=t,n&&(this._0=n,this.baseurl2=a);var l=Cesium.defaultValue(o.credit,s);"string"==typeof l&&(l=new Cesium.Credit(l)),this._11=l};return Object.defineProperties(e.prototype,{tileWidth:{get:function(){return this._3}},tileHeight:{get:function(){return this._4}},defaultAlpha:{get:function(){return 1}},hasAlphaChannel:{get:function(){return!0}},maximumLevel:{get:function(){return this._1}},minimumLevel:{get:function(){return this._2}},tilingScheme:{get:function(){return this._7}},extent:{get:function(){return this._8}},rectangle:{get:function(){return this._5}},ready:{get:function(){return this._6}},minimumTerrainLevel:{get:function(){return 0}},maximumTerrainLevel:{get:function(){return 17}}}),e.prototype.requestImage=function(e,t,i){this.needaddone&&(e+=1,t+=1,i+=1);var r=this.baseurl;this._0&&i>this._0&&(r=this.baseurl2);var o=r.replace("{x}",e);return o=(o=(o=o.replace("{l}",t%8)).replace("{y}",t)).replace("{z}",i+1),Cesium.ImageryProvider.loadImage(this,o)},e}),define("SGWorld/Creator/BaiduImageryProvider",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}var i=function(){function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,i){return t&&r(e.prototype,t),i&&r(e,i),e}}();return e.prototype.BaiduImageryProvider=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this._url="http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}",this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._tilingScheme=new Cesium.WebMercatorTilingScheme({rectangleSouthwestInMeters:new Cesium.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new Cesium.Cartesian2(33554054,33746824)}),this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=e.style||"normal"}return i(t,[{key:"getTileCredits",value:function(e,t,i){}},{key:"requestImage",value:function(e,t,i){if(!this.ready)throw new Cesium.DeveloperError("requestImage must not be called before the imagery provider is ready.");var r=this._tilingScheme.getNumberOfXTilesAtLevel(i),o=this._tilingScheme.getNumberOfYTilesAtLevel(i),n=this._url.replace("{x}",e-r/2).replace("{y}",o/2-t-1).replace("{z}",i).replace("{s}",1).replace("{style}",this._style);return Cesium.ImageryProvider.loadImage(this,n)}},{key:"url",get:function(){return this._url}},{key:"token",get:function(){return this._token}},{key:"tileWidth",get:function(){if(!this.ready)throw new Cesium.DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},{key:"tileHeight",get:function(){if(!this.ready)throw new Cesium.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},{key:"maximumLevel",get:function(){if(!this.ready)throw new Cesium.DeveloperError("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},{key:"minimumLevel",get:function(){if(!this.ready)throw new Cesium.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}},{key:"tilingScheme",get:function(){if(!this.ready)throw new Cesium.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},{key:"rectangle",get:function(){if(!this.ready)throw new Cesium.DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},{key:"ready",get:function(){return!!this._url}},{key:"credit",get:function(){return this._credit}}]),t}(),e}),define("SGWorld/Creator/ImageryLayer",["../Core/Core","../ProjectTree/treeSource","../Core/tdtwmtsimageprovider","./BaiduImageryProvider"],function(i,r,m,o){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=r,this._BaiduImageryProvider=new o(e,t)}return e.prototype.createArcGisImageryLayer=function(e,t,i,r,o,n){var a={url:""},s=null;this._core.isUrl(t)?(s=a).url=t:s=this._core.extend(a,t,!0),this._core.isnull(e)&&(e="新建影像图层");var l=new this._cesium.ArcGisMapServerImageryProvider(s),u={alpha:s.alpha,brightness:s.brightness,availability:s.availability};if(void 0!==s.Level||void 0!==s.level){var c=this._core.defaultValue(s.Level,s.level);c.indexOf&&-1<c.indexOf(",")?(c=c.split(","),u.maximumTerrainLevel=c[1],u.minimumTerrainLevel=c[0]):u.minimumTerrainLevel=c}s.time&&(u.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:s.time.start?this._cesium.JulianDate.fromDate(new Date(s.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?this._cesium.JulianDate.fromDate(new Date(s.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=u.availability,this.item=new this._cesium.ImageryLayer(l,u),this._viewer.imageryLayers.add(this.item,r),!o&&this.setVisibility(!1),n&&"function"==typeof n&&n(this.item);var h=this._core.getuid(),d={id:s.id||h,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",smtype:"arcgis",item:this};return this.setTreeobj(d),this._tree.insertGroupId(d,this._core.isnull(i)?0:i),this},e.prototype.createImageryLayerGrid=function(e){var t=this._viewer.imageryLayers.addImageryProvider(new this._cesium.GridImageryProvider(e));return this.item=t,this},e.prototype.createWebMapServerImageLayer=function(e,t,i,r,o,n){var a={url:"",layers:"",parameters:{service:"WMS",format:"image/png",transparent:!0}},s=null;this._core.isUrl(t)?(s=a).url=t:s=this._core.extend(a,t,!0),this._core.isnull(e)&&(e="新建影像图层");var l=new this._cesium.WebMapServiceImageryProvider(s),u={alpha:s.alpha,brightness:s.brightness,availability:s.availability};if(void 0!==s.Level||void 0!==s.level){var c=this._core.defaultValue(s.Level,s.level);c.indexOf&&-1<c.indexOf(",")?(c=c.split(","),u.maximumTerrainLevel=c[1],u.minimumTerrainLevel=c[0]):u.minimumTerrainLevel=c}s.time&&(u.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:s.time.start?this._cesium.JulianDate.fromDate(new Date(s.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?this._cesium.JulianDate.fromDate(new Date(s.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=u.availability,this.item=new this._cesium.ImageryLayer(l,u),this._viewer.imageryLayers.add(this.item,r),!o&&this.setVisibility(!1),n&&"function"==typeof n&&n(this.item);var h=this._core.getuid(),d={id:s.id||h,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",smtype:"wms",item:this};return this.setTreeobj(d),this._tree.insertGroupId(d,this._core.isnull(i)?0:i),this},e.prototype.createMVTWithStyle=function(e,t,i,r){this.item=this._viewer.imageryLayers.addImageryProvider(t),checked||this.setVisibility(!1),t.show=!1;var o=this._core.getuid(),n={id:options.id||o,name:e,checked:checked,pId:(this._core.isnull(0),0),type:"ImageryProvider",show:!1,item:this};return this.setTreeobj(n),this._tree.insertGroupId(n,(this._core.isnull(0),0)),this},e.prototype.createWebMapTileServerImageLayer=function(e,t,i,r,o,n){var a,s={url:""},l=null;this._core.isUrl(t)?(l=s).url=t:l=this._core.extend(s,t,!0),this._core.isnull(e)&&(e="新建影像图层"),a=l.TD_SD?new m(l.url,!1,l.minimumLevel||0,l.maximumLevel||21):new this._cesium.WebMapTileServiceImageryProvider(l);var u={alpha:l.alpha,brightness:l.brightness,availability:l.availability};if(l.addLevel&&(a.addLevel=l.addLevel),void 0!==l.Level||void 0!==l.level){var c=this._core.defaultValue(l.Level,l.level);c.indexOf&&-1<c.indexOf(",")?(c=c.split(","),u.maximumTerrainLevel=c[1],u.minimumTerrainLevel=c[0]):u.minimumTerrainLevel=c}l.time&&(u.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:l.time.start?this._cesium.JulianDate.fromDate(new Date(l.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:l.time.end?this._cesium.JulianDate.fromDate(new Date(l.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=u.availability,this.item=new this._cesium.ImageryLayer(a,u),this._viewer.imageryLayers.add(this.item,r),!o&&this.setVisibility(!1),n&&"function"==typeof n&&n(this.item);var h=this._core.getuid(),d={id:l.id||h,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",smtype:"skymap",item:this};return this.setTreeobj(d),this._tree.insertGroupId(d,this._core.isnull(i)?0:i),this},e.prototype.createUrlTemplateImageryProvider=function(e,t,i,r,o,n){var a={url:""},s=null;this._core.isUrl(t)?(s=a).url=t:s=this._core.extend(a,t,!0),this._core.isnull(e)&&(e="新建影像图层");var l=new this._cesium.UrlTemplateImageryProvider(s),u={alpha:s.alpha,brightness:s.brightness,availability:s.availability};if(void 0!==s.Level||void 0!==s.level){var c=this._core.defaultValue(s.Level,s.level);c.indexOf&&-1<c.indexOf(",")?(c=c.split(","),u.maximumTerrainLevel=c[1],u.minimumTerrainLevel=c[0]):u.minimumTerrainLevel=c}s.time&&(u.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:s.time.start?this._cesium.JulianDate.fromDate(new Date(s.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?this._cesium.JulianDate.fromDate(new Date(s.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=u.availability,this.item=new this._cesium.ImageryLayer(l,u),this._viewer.imageryLayers.add(this.item,r),!o&&this.setVisibility(!1),n&&"function"==typeof n&&n(this.item);var h=this._core.getuid(),d={id:s.id||h,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",smtype:"goglemap",item:this};return this.setTreeobj(d),this._tree.insertGroupId(d,this._core.isnull(i)?0:i),this},e.prototype.createImageryProvider=function(e,t,i,r,o,n,a){var s,l=this._core.extend({},i,!0);"arcgis"==t?s=new this._cesium.ArcGisMapServerImageryProvider(l):"geoserver"==t?s=new this._cesium.WebMapServiceImageryProvider(l):"wms"==t?s=new this._cesium.WebMapServiceImageryProvider(l):"cesiumBlack"==t?s=new this._cesium.TileMapServiceImageryProvider(l):"skymap"==t?s=new this._cesium.WebMapTileServiceImageryProvider(l):"goglemap"==t?s=new this._cesium.UrlTemplateImageryProvider(l):"BingMap"==t?s=new this._cesium.BingMapsImageryProvider(l):"OpenStreetMap"==t?s=new this._cesium.OpenStreetMapImageryProvider(l):"MapBox"==t?s=new this._cesium.MapboxImageryProvider(l):"BaiduMap"==t&&(s=new this._BaiduImageryProvider.BaiduImageryProvider(l));var u={alpha:l.alpha,brightness:l.brightness,availability:l.availability};if(void 0!==l.Level||void 0!==l.level){var c=this._core.defaultValue(l.Level,l.level);c.indexOf&&-1<c.indexOf(",")?(c=c.split(","),u.maximumTerrainLevel=c[1],u.minimumTerrainLevel=c[0]):u.minimumTerrainLevel=c}l.time&&(u.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:l.time.start?this._cesium.JulianDate.fromDate(new Date(l.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:l.time.end?this._cesium.JulianDate.fromDate(new Date(l.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=u.availability,this.item=new this._cesium.ImageryLayer(s,u),this._viewer.imageryLayers.add(this.item,o),!n&&this.setVisibility(!1),a&&"function"==typeof a&&a(this.item),this._core.isnull(l.id)&&(l.id=this._core.getuid());var h={id:l.id,name:e,pId:this._core.isnull(r)?0:r,type:"ImageryProvider",checked:n,item:this};return this.setTreeobj(h),this._tree.insertGroupId(h,this._core.isnull(r)?0:r),this},e.prototype.createCacheImageryProvider=function(e,t,i,r,o,n){r|=1;var a=this._core.extend({fileExtension:"jpg",cacheMaxLevel:16},t,!0),s={alpha:a.alpha,brightness:a.brightness,availability:a.availability,show:!0},l={alpha:a.alpha,brightness:a.brightness,availability:a.availability,show:!0};if(a.time&&(s.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:a.time.start?this._cesium.JulianDate.fromDate(new Date(a.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:a.time.end?this._cesium.JulianDate.fromDate(new Date(a.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})]),l.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:a.time.start?this._cesium.JulianDate.fromDate(new Date(a.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:a.time.end?this._cesium.JulianDate.fromDate(new Date(a.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),void 0!==a.Level||void 0!==a.level){var u=this._core.defaultValue(a.Level,a.level);u.indexOf&&-1<u.indexOf(",")?((u=u.split(","))[1]>a.cacheMaxLevel?(s.show=!0,l.maximumTerrainLevel=u[1],l.show=!0):(s.show=!0,l.show=!1),u[0]>a.cacheMaxLevel?(s.show=!1,l.minimumTerrainLevel=u[0],l.show=!0):(s.show=!0,l.minimumTerrainLevel=a.cacheMaxLevel)):(u>a.cacheMaxLevel?(s.show=!1,l.minimumTerrainLevel=u):(s.show=!0,l.minimumTerrainLevel=a.cacheMaxLevel),l.show=!0)}else s.show=!0,l.minimumTerrainLevel=a.cacheMaxLevel,l.show=!0;this.availability=s.availability;var c=null;s.show&&(c=new this._cesium.TileMapServiceImageryProvider({url:Cesium.buildModuleUrl(a.cacheUrl),fileExtension:a.fileExtension}),this.item=new this._cesium.ImageryLayer(c,s),this._viewer.imageryLayers.add(this.item,r)),this.items||(this.items=[]);var h=null;if(l.show)if(a.minimumLevel=l.minimumTerrainLevel|a.cacheMaxLevel,l.maximumTerrainLevel&&(a.maximumLevel=l.maximumTerrainLevel),h=new this._cesium.WebMapServiceImageryProvider(a),this.item){var d=this.items.push(new this._cesium.ImageryLayer(h,l));this._viewer.imageryLayers.add(this.items[d-1],r+1)}else this.item=new this._cesium.ImageryLayer(h,l),this._viewer.imageryLayers.add(this.item,r+1);!o&&this.setVisibility(!1),n&&"function"==typeof n&&n(this.item),this._core.isnull(a.id)&&(a.id=this._core.getuid());var m={id:a.id,name:e,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",checked:o,item:this};return this.setTreeobj(m),this._tree.insertGroupId(m,this._core.isnull(i)?0:i),this},e.prototype.createPolylineImageryProviderer=function(e,t,i,r){var o=this._core.extend({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"},t,!0),n=new this._cesium.WebMapTileServiceImageryProvider(o);this.item=this._viewer.imageryLayers.addImageryProvider(n),"function"==typeof r&&r(this.item),this._core.isnull(o.id)&&(o.id=this._core.getuid());var a={id:o.id,name:e,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},e.prototype.createterrainProvider=function(e,t,i,r){var o=this._core.extend({url:""},t,!0),n=new this._cesium.CesiumTerrainProvider(o);this._viewer.terrainProvider=n,this.item=this._viewer.terrainProvider,"function"==typeof r&&r(dataSource),this._core.isnull(o.id)&&(o.id=this._core.getuid());var a={id:o.id,name:e,pId:this._core.isnull(i)?0:i,type:"terrainProvider",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},e.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.item.imageryProvider.url;return{type:"ImageryLayer",treeobj:{name:this.treeobj.name,type:this.treeobj.smtype},style:{show:e,url:t}}},e.prototype.setTreeobj=function(e){this.treeobj=e},e.prototype.getLevel=function(){var e,t,i=this._viewer.camera;try{if(i&&i.positionCartographic&&i.positionCartographic.height){var r=this._viewer.scene.globe.getHeight(i.positionCartographic);!r&&(r=0),e=i.positionCartographic.height-r,t=Math.round(80955.31/(1+Math.pow(e/91610.74,7096758e-11))-40467.74)}else t=0}catch(e){}return t},e.prototype.setVisibility=function(e){if(this.isShow=e,this.item.show=e,this.item._availability&&!e?this.item._availability=void 0:this.availability&&e&&(this.item._availability=this.availability),this.items)for(var t=0;t<this.items.length;t++)this.items[t].show=e,this.items[t]._availability&&!e?this.items[t]._availability=void 0:this.availability&&e&&(this.items[t]._availability=this.availability)},e.prototype.getVisibility=function(){return this.item.show},e.prototype.getType=function(){return{label:"影像",value:"ImageryProvider"}},e.prototype.deleteObject=function(){return this._viewer.imageryLayers.remove(this.item)},Object.defineProperties(e.prototype,{url:{set:function(e){},get:function(){}}}),e.prototype.setItem=function(e){this.item=e},e}),define("SGWorld/Creator/GeoJsonFeatureLayer",["../Core/Core","./Color","../Navigate/getPosition","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min"],function(i,r,o,ne,e){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._color=new r(this._viewer,this._cesium),this._getPosition=new o(this._viewer,this._cesium),this._tree=ne,this.Legend=[],this.tooltip=this._core.CreateTooltip()}return t.prototype.createGeojsonFeatureLayer=function(e,t,i,r,o,u){var n=t.url,a=t.maxLevel,s=t.minLevel,c=this._core.StyleContrastGeoJson(i,this._cesium);null==n&&console.log("geojson is required");var l=null;l=n.then?n:this._cesium.GeoJsonDataSource.load(n),this._viewer.dataSources.add(l);var h=this;!this.setNearAndFar&&a&&s&&(this.setNearAndFar=!0,this.Level=0,this._viewer.scene.preRender.addEventListener(function(){h.isShow&&h.item&&(h.Level=h.getLevel(),h.Level>=s&&h.Level<=a&&!h.item.show?h.item.show=!0:(h.Level<s||h.Level>a)&&(h.item.show=!1))})),l.then(function(e){for(var t=(h.item=e).entities.values,i=0;i<t.length;i++){var r=t[i];if(null!=c.point){var o=c.point;o.color=h._color.VectorColorTransformation(o.color,r),o.outlineColor=h._color.VectorColorTransformation(o.outlineColor,r),null!=o.pointHeight&&(r.position._value=h._core.setheight(r.position._value,o.pointHeight,h._cesium,h._viewer),delete o.pointHeight),r.point=new h._cesium.PointGraphics(o)}if(null!=c.label){var n=c.label;n.fillColor=h._color.VectorColorTransformation(n.fillColor,r),n.outlineColor=h._color.VectorColorTransformation(n.outlineColor,r),null!=n.pointHeight&&(r.position._value=h._core.setheight(r.position._value,n.pointHeight,h._cesium,h._viewer),delete n.pointHeight),r.label=new h._cesium.LabelGraphics(n)}if(null!=c.billboard){var a=c.billboard;a.color=h._color.VectorColorTransformation(a.color,r),null!=a.pointHeight&&(r.position._value=h._core.setheight(r.position._value,a.pointHeight,h._cesium,h._viewer),delete a.pointHeight),r.billboard=new h._cesium.BillboardGraphics(a)}if(null!=c.polyline){var s=c.polyline;s.material=h._color.VectorColorTransformation(s.material,r),s.positions=r.polyline.positions,null!=s.pointHeight&&(r.position._value=h._core.setpolylineheight(r.position._value,s.pointHeight,h._cesium,h._viewer),delete s.pointHeight),r.polyline=new h._cesium.PolylineGraphics(s)}if(null!=c.polygon){var l=c.polygon;l.hierarchy=r.polygon.hierarchy,l.material=h._color.VectorColorTransformation(l.material,r),l.outlineColor=h._color.VectorColorTransformation(l.outlineColor,r),l.outlineColor&&(l.outline=!0),r.polygon=new h._cesium.PolygonGraphics(l)}}"function"==typeof u&&u(e)}),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id),o?h.isShow=!0:h.setVisibility(!1);var d={id:c.id,name:e,checked:o,pId:this._core.isnull(r)?0:r,type:"datasource",item:this,url:n,style:c};return this.setTreeobj(d),this._tree.insertGroupId(d,this._core.isnull(r)?0:r),this},t.prototype.createGeojsonKmlFeatureLayer=function(e,t,i,r,o){var n=t,a={camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas};this._viewer.dataSources.add(this._cesium.KmlDataSource.load(t,a));this._core.isnull(a.id)&&(a.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+a.id),r||this.setVisibility(!1);var s={id:a.id,name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"datasource",item:this,url:n,style:a};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),this},t.prototype.createGeoJsonFeatureLayerAlawys=function(e,t,l,i,u){var r={id:this._core.getuid(),layertype:"",text:"",font:"16px",fillColor:this._cesium.WHITE,outlineColor:this._cesium.BLACK,outlineWidth:"1.0",scale:"1.0",maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,icon:""};this._core.isnull(l)||this._core.isnull(l.fillColor)||"["==l.fillColor.toString().charAt(0)&&"]"==l.fillColor.toString().charAt(l.fillColor.length-1)||(this._core.isHtmlColor(l.fillColor)?l.fillColor=this._color.colorFromHtmlColor(l.fillColor):l.fillColor=this._color.createColor(l.fillColor.r,l.fillColor.g,l.fillColor.b,l.fillColor.a)),this._core.isnull(l)||this._core.isnull(l.outlineColor)||"["==l.outlineColor.toString().charAt(0)&&"]"==l.outlineColor.toString().charAt(l.outlineColor.length-1)||(this._core.isHtmlColor(l.outlineColor)?l.outlineColor=this._color.colorFromHtmlColor(l.outlineColor):l.outlineColor=this._color.createColor(l.outlineColor.r,l.outlineColor.g,l.outlineColor.b,l.outlineColor.a));var c=this._core.extend(r,l,!0);null==t&&console.log("geojson is required");var o=null;o=t.then?t:this._cesium.GeoJsonDataSource.load(t),this._viewer.dataSources.add(o);var h,d=this;l&&l.time&&(h=new d._cesium.TimeIntervalCollection([new d._cesium.TimeInterval({start:l.time.start?d._cesium.JulianDate.fromDate(new Date(l.time.start)):d._cesium.Iso8601.MINIMUM_VALUE,stop:l.time.end?d._cesium.JulianDate.fromDate(new Date(l.time.end)):d._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){for(var t=(d.item=e).entities.values,i=0;i<t.length;i++){var r=t[i];c.id=d._core.extendgl(r,l.id,c.id),c.text=d._core.extendgl(r,l.text,c.text),c.font=d._core.extendgl(r,l.font,c.font),c.fillColor=d._core.extendgl(r,l.fillColor,c.fillColor),c.outlineColor=d._core.extendgl(r,l.outlineColor,c.outlineColor),c.outlineWidth=parseInt(d._core.extendgl(r,l.outlineWidth,c.outlineWidth)),c.scale=parseFloat(d._core.extendgl(r,l.scale,c.scale)),c.image=d._core.extendgl(r,l.image,c.image),c.icon=d._core.extendgl(r,l.icon,c.icon);var o=parseFloat(d._core.extendgl(r,c.minDistanceDisplay||c.near)),n=parseFloat(d._core.extendgl(r,c.maxDistanceDisplay||c.far)),a=new d._cesium.DistanceDisplayCondition(o,n);if(r.billboard){if(c)if((d._core.isUrl(r.properties[c.icon])||d._core.isUrl(c.icon))&&!d._core.isnull(r.properties[c.text])||!d._core.isnull(c.text)){var s="fillColor:"+255*c.fillColor.red+","+255*c.fillColor.green+","+255*c.fillColor.blue+";outlineColor:"+255*c.outlineColor.red+","+255*c.outlineColor.green+","+255*c.outlineColor.blue;d.Legend.push(s),r.label={id:"my label",text:d._core.isnull(r.properties[c.text])?c.text:r.properties[c.text]+"",font:c.font+" sans-serif",fillColor:c.fillColor,outlineColor:c.outlineColor,outlineWidth:c.outlineWidth,scale:parseFloat(c.scale),distanceDisplayCondition:a},r.billboard={image:d._core.isUrl(r.properties[c.icon])?r.properties[c.icon]:c.icon,distanceDisplayCondition:a}}else if(d._core.isnull(c.icon))if(d._core.isnull(r.properties[c.text])&&d._core.isnull(c.text)){s="color:"+255*c.fillColor.red+","+255*c.fillColor.green+","+255*c.fillColor.blue;d.Legend.push(s),r.billboard=void 0,r.point=new d._cesium.PointGraphics({color:d._cesium.Color.RED,pixelSize:10,distanceDisplayCondition:a})}else{r.billboard=void 0;var s="fillColor:"+255*c.fillColor.red+","+255*c.fillColor.green+","+255*c.fillColor.blue+";outlineColor:"+255*c.outlineColor.red+","+255*c.outlineColor.green+","+255*c.outlineColor.blue;d.Legend.push(s),r.label={id:"my label",text:d._core.isnull(r.properties[c.text])?c.text:r.properties[c.text]+"",font:c.font+" sans-serif",fillColor:c.fillColor,outlineColor:c.outlineColor,outlineWidth:c.outlineWidth,scale:parseFloat(c.scale),distanceDisplayCondition:a}}else r.billboard={image:d._core.isUrl(r.properties[c.icon])?r.properties[c.icon]:c.icon,distanceDisplayCondition:a};else r.polygon?r.polygon.distanceDisplayCondition=a:r.polyline&&(r.polyline.distanceDisplayCondition=a);h&&(r.availability=h)}}"function"==typeof u&&u(e)}),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id);var n={id:c.id,name:e,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t,style:c};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},t.prototype.createGeoJsonFeatureLayer=function(i,e,r,o,n,a){var s=this._cesium.GeoJsonDataSource.load(e),l=this;return s.then(function(e){var t=e.entities.values[0];/^point.fid/.test(t._id)||null!=t.point?l.createPointGeojsonFeatureLayer(i,s,r,o,n,a):/^polygon.fid/.test(t._id)||null!=t.polygon?l.createPolygonGeoJsonFeatureLayer(i,s,r,o,n,a):/^line.fid/.test(t._id)||null!=t.polyline?l.createPolylineGeoJsonFeatureLayer(i,s,r,o,n,a):l.createGeoJsonFeatureLayerAlawys(i,s,r,o,a)}),this},t.prototype.createPointGeojsonFeatureLayer=function(e,t,p,i,g,f){var r={color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1),height:0,pointHeight:0,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0};this._core.isnull(p)||this._core.isnull(p.color)||"["==p.color.toString().charAt(0)&&"]"==p.color.toString().charAt(p.color.length-1)||(this._core.isHtmlColor(p.color)?p.color=this._color.colorFromHtmlColor(p.color):(/^rgb/.test(p.color)&&(p.color=this._color.rgbaStringToRgbaObj(p.color)),1<p.color.r&&(p.color.r=p.color.r/255),1<p.color.g&&(p.color.g=p.color.g/255),1<p.color.b&&(p.color.b=p.color.b/255),1<p.color.a&&(p.color.a=p.color.a/255),p.color=this._color.createColor(p.color.r,p.color.g,p.color.b,p.color.a))),this._core.isnull(p)||this._core.isnull(p.outlineColor)||"["==p.outlineColor.toString().charAt(0)&&"]"==p.outlineColor.toString().charAt(p.outlineColor.length-1)||(this._core.isHtmlColor(p.outlineColor)?p.outlineColor=this._color.colorFromHtmlColor(p.outlineColor):(/^rgb/.test(p.outlineColor)&&(p.outlineColor=this._color.rgbaStringToRgbaObj(p.outlineColor)),1<p.outlineColor.r&&(p.outlineColor.r=p.outlineColor.r/255),1<p.outlineColor.g&&(p.outlineColor.g=p.outlineColor.g/255),1<p.outlineColor.b&&(p.outlineColor.b=p.outlineColor.b/255),1<p.outlineColor.a&&(p.outlineColor.a=p.outlineColor.a/255),p.outlineColor=this._color.createColor(p.outlineColor.r,p.outlineColor.g,p.outlineColor.b,p.outlineColor.a)));var v=this._core.extend(r,p,!0);null==t&&console.log("geojson is required");var o=null;o=t.then?t:this._cesium.GeoJsonDataSource.load(t),this._viewer.dataSources.add(o);var _,y=this;p&&p.time&&(_=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:p.time.start?this._cesium.JulianDate.fromDate(new Date(p.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:p.time.end?this._cesium.JulianDate.fromDate(new Date(p.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){for(var t=(y.item=e).entities.values,i=0;i<t.length;i++){var r=t[i];v.color=y._core.extendgl(r,p.color,v.color),v.pixelSize=parseInt(y._core.extendgl(r,p.pixelSize,v.pixelSize)),v.outlineColor=y._core.extendgl(r,p.outlineColor,v.outlineColor),v.outlineWidth=parseFloat(y._core.extendgl(r,p.outlineWidth,v.outlineWidth)),v.show=y._core.extendgl(r,p.show,v.show),v.height=parseFloat(y._core.extendgl(r,p.height,v.height)),v.scaleByDistance=y._core.extendgl(r,p.scaleByDistance,v.scaleByDistance);var o=parseFloat(y._core.extendgl(r,v.minDistanceDisplay||v.near)),n=parseFloat(y._core.extendgl(r,v.maxDistanceDisplay||v.far)),a=new y._cesium.DistanceDisplayCondition(o,n),s="color:"+255*v.color.red+","+255*v.color.green+","+255*v.color.blue+";outlineColor:"+255*v.outlineColor.red+","+255*v.outlineColor.green+","+255*v.outlineColor.blue;y.Legend.push(s),v.distanceDisplayCondition=a,v.pointHeight=y._core.extendgl(r,p.pointHeight,v.pointHeight),v.pointHeight=parseFloat(v.pointHeight);y._viewer.scene.globe.ellipsoid;var l=y._cesium.Cartographic.fromCartesian(r.position._value),u=y._cesium.Math.toDegrees(l.longitude),c=y._cesium.Math.toDegrees(l.latitude),h=l.height+v.pointHeight,d=new y._cesium.Cartesian3.fromDegrees(u,c,h);r.position._value=d,r.point=new y._cesium.PointGraphics(v),r.billboard=void 0;var m={positions:d};r.description=m,_&&(r.availability=_)}g||y.setVisibility(!1),"function"==typeof f&&f(e)}),this._core.isnull(v.id)&&(v.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+v.id);var n={id:v.id,name:e,checked:g,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t,style:v};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},t.prototype.createCirclePointGeoJsonFeatureLayer=function(e,t,l,i,u){var r={semiMajorAxis:1,semiMinorAxis:1,height:0,heightReference:this._cesium.HeightReference.NONE,extrudedHeight:0,extrudedHeightReference:this._cesium.HeightReference.NONE,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)};this._core.isnull(l)||this._core.isnull(l.outlineColor)||"["==l.outlineColor.toString().charAt(0)&&"]"==l.outlineColor.toString().charAt(l.outlineColor.length-1)||(this._core.isHtmlColor(l.outlineColor)?l.outlineColor=this._color.colorFromHtmlColor(l.outlineColor):(/^rgb/.test(l.outlineColor)&&(l.outlineColor=this._color.rgbaStringToRgbaObj(l.outlineColor)),1<l.outlineColor.r&&(l.outlineColor.r=l.outlineColor.r/255),1<l.outlineColor.g&&(l.outlineColor.g=l.outlineColor.g/255),1<l.outlineColor.b&&(l.outlineColor.b=l.outlineColor.b/255),1<l.outlineColor.a&&(l.outlineColor.a=l.outlineColor.a/255),l.outlineColor=this._color.createColor(l.outlineColor.r,l.outlineColor.g,l.outlineColor.b,l.outlineColor.a))),this._core.isnull(l)||this._core.isnull(l.material)||"["==l.material.toString().charAt(0)&&"]"==l.material.toString().charAt(l.material.length-1)||"("==l.material.toString().charAt(0)&&")"==l.material.toString().charAt(l.material.length-1)||(this._core.isHtmlColor(l.material)?l.material=this._color.colorFromHtmlColor(l.material):(/^rgb/.test(l.material)&&(l.material=this._color.rgbaStringToRgbaObj(l.material)),1<l.material.r&&(l.material.r=l.material.r/255),1<l.material.g&&(l.material.g=l.material.g/255),1<l.material.b&&(l.material.b=l.material.b/255),1<l.material.a&&(l.material.a=l.material.a/255),l.material=this._color.createColor(l.material.r,l.material.g,l.material.b,l.material.a))),this._core.isnull(l)||this._core.isnull(l.radius)||(r.semiMajorAxis=l.radius,r.semiMinorAxis=l.radius),h._core.isnull(l.near)&&(l.near=0),h._core.isnull(l.far)&&(l.far=999999999);var c=this._core.extend(r,l,!0);null==t&&console.log("geojson is required");var o=this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(o);var h=this;o.then(function(e){for(var t=(h.item=e).entities.values,i=0;i<t.length;i++){var r=t[i];c.semiMajorAxis=parseFloat(h._core.extendgl(r,l.semiMajorAxis,c.semiMajorAxis)),c.semiMinorAxis=parseFloat(h._core.extendgl(r,l.semiMinorAxis,c.semiMinorAxis)),c.height=parseFloat(h._core.extendgl(r,l.height,c.height)),c.heightReference=h._core.extendgl(r,l.heightReference,c.heightReference),c.extrudedHeight=parseFloat(h._core.extendgl(r,l.extrudedHeight,c.extrudedHeight)),c.extrudedHeightReference=h._core.extendgl(r,l.extrudedHeightReference,c.extrudedHeightReference),c.show=h._core.extendgl(r,l.show,c.show),c.fill=h._core.extendgl(r,l.fill,c.fill),c.material=h._core.extendgl(r,l.material,c.material),c.outline=h._core.extendgl(r,l.outline,c.outline),c.outlineColor=h._core.extendgl(r,l.outlineColor,c.outlineColor),c.outlineWidth=parseFloat(h._core.extendgl(r,l.outlineWidth,c.outlineWidth)),c.scaleByDistance=h._core.extendgl(r,l.scaleByDistance,c.scaleByDistance);var o="material:"+255*c.material.red+","+255*c.material.green+","+255*c.material.blue+";outlineColor:"+255*c.outlineColor.red+","+255*c.outlineColor.green+","+255*c.outlineColor.blue;h.Legend.push(o);var n=parseFloat(h._core.extendgl(r,c.near)),a=parseFloat(h._core.extendgl(r,c.far)),s=new h._cesium.DistanceDisplayCondition(n,a);c.distanceDisplayCondition=s,r.billboard=void 0,r.ellipse=new h._cesium.EllipseGraphics(c)}"function"==typeof u&&u(e)}),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id);var n={id:c.id,name:e,pId:this._core.isnull(i)?0:i,type:"layer",item:this,url:t,style:c};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},t.prototype.createModelPointGeoJsonFeatureLayer=function(e,t,h,i,d,m){var r={uri:"",show:!0,scale:1,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,lightColor:void 0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1),color:this._cesium.Color.WHITE,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},p=this;this._core.isnull(h)||this._core.isnull(h.color)||(this._core.isHtmlColor(h.color)?h.color=this._color.colorFromHtmlColor(h.color):(/^rgb/.test(h.color)&&(h.color=this._color.rgbaStringToRgbaObj(h.color)),1<h.color.r&&(h.color.r=h.color.r/255),1<h.color.g&&(h.color.g=h.color.g/255),1<h.color.b&&(h.color.b=h.color.b/255),1<h.color.a&&(h.color.a=h.color.a/255),h.color=this._color.createColor(h.color.r,h.color.g,h.color.b,h.color.a))),p._core.isnull(h.near)&&(h.near=0),p._core.isnull(h.far)&&(h.far=999999999);var g=this._core.extend(r,h,!0);null==t&&console.log("geojson is required");var f,o=this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(o),h&&h.time&&(f=new p._cesium.TimeIntervalCollection([new p._cesium.TimeInterval({start:h.time.start?p._cesium.JulianDate.fromDate(new Date(h.time.start)):p._cesium.Iso8601.MINIMUM_VALUE,stop:h.time.end?p._cesium.JulianDate.fromDate(new Date(h.time.end)):p._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){for(var t=(p.item=e).entities.values,i=0;i<t.length;i++){var r=t[i];g.uri=p._core.extendgl(r,h.uri,g.uri),g.scale=parseFloat(p._core.extendgl(r,h.scale,g.scale)),g.incrementallyLoadTextures=p._core.extendgl(r,h.incrementallyLoadTextures,g.incrementallyLoadTextures),g.runAnimations=p._core.extendgl(r,h.runAnimations,g.runAnimations),g.clampAnimations=p._core.extendgl(r,h.clampAnimations,g.clampAnimations),g.shadows=p._core.extendgl(r,h.shadows,g.shadows),g.heightReference=p._core.extendgl(r,h.heightReference,g.heightReference),g.lightColor=p._core.extendgl(r,h.lightColor,g.lightColor),g.scaleByDistance=p._core.extendgl(r,h.scaleByDistance,g.scaleByDistance),g.color=p._core.extendgl(r,h.color,g.color),g.height?g.height=parseFloat(p._core.extendgl(r,h.height,g.height)):g.height=void 0;var o=parseFloat(p._core.extendgl(r,h.near,g.near)),n=parseFloat(p._core.extendgl(r,h.far,g.far)),a="color:"+255*g.color.red+","+255*g.color.green+","+255*g.color.blue;p.Legend.push(a);var s=new p._cesium.DistanceDisplayCondition(o,n);if(g.distanceDisplayCondition=s,r.billboard=void 0,r.model=new p._cesium.ModelGraphics(g),g.height){var l=p._cesium.Cartographic.fromCartesian(r.position._value),u=p._cesium.Math.toDegrees(l.longitude),c=p._cesium.Math.toDegrees(l.latitude);r.position=p._cesium.Cartesian3.fromDegrees(u,c,g.height)}f&&(r.availability=f)}"function"==typeof m&&m(e),d||p.setVisibility(!1)}),this._core.isnull(g.id)&&(g.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+g.id);var n={id:g.id,name:e,checked:d,pId:this._core.isnull(i)?0:i,type:"modelLayer",item:this,url:t,style:g};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},t.prototype.createLabelPointGeoJsonFeatureLayer=function(f,e,v,t,_,y){var C,i={Name:"",text:"test",font:" 30px sans-serif",style:this._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.RELATIVE_TO_GROUND,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1),pointHeight:0,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},w=this;this._core.isnull(v)||this._core.isnull(v.fillColor)||(this._core.isHtmlColor(v.fillColor)?v.fillColor=this._color.colorFromHtmlColor(v.fillColor):(/^rgb/.test(v.fillColor)&&(v.fillColor=this._color.rgbaStringToRgbaObj(v.fillColor)),1<v.fillColor.r&&(v.fillColor.r=v.fillColor.r/255),1<v.fillColor.g&&(v.fillColor.g=v.fillColor.g/255),1<v.fillColor.b&&(v.fillColor.b=v.fillColor.b/255),1<v.fillColor.a&&(v.fillColor.a=v.fillColor.a/255),v.fillColor=this._color.createColor(v.fillColor.r,v.fillColor.g,v.fillColor.b,v.fillColor.a))),this._core.isnull(v)||this._core.isnull(v.outlineColor)||(this._core.isHtmlColor(v.outlineColor)?v.outlineColor=this._color.colorFromHtmlColor(v.outlineColor):(/^rgb/.test(v.outlineColor)&&(v.outlineColor=this._color.rgbaStringToRgbaObj(v.outlineColor)),1<v.outlineColor.r&&(v.outlineColor.r=v.outlineColor.r/255),1<v.outlineColor.g&&(v.outlineColor.g=v.outlineColor.g/255),1<v.outlineColor.b&&(v.outlineColor.b=v.outlineColor.b/255),1<v.outlineColor.a&&(v.outlineColor.a=v.outlineColor.a/255),v.outlineColor=this._color.createColor(v.outlineColor.r,v.outlineColor.g,v.outlineColor.b,v.outlineColor.a))),this._core.isnull(v)||this._core.isnull(v.backgroundColor)||(this._core.isHtmlColor(v.backgroundColor)?v.backgroundColor=this._color.colorFromHtmlColor(v.backgroundColor):(/^rgb/.test(v.backgroundColor)&&(v.backgroundColor=this._color.rgbaStringToRgbaObj(v.backgroundColor)),1<v.backgroundColor.r&&(v.backgroundColor.r=v.backgroundColor.r/255),1<v.backgroundColor.g&&(v.backgroundColor.g=v.backgroundColor.g/255),1<v.backgroundColor.b&&(v.backgroundColor.b=v.backgroundColor.b/255),1<v.backgroundColor.a&&(v.backgroundColor.a=v.backgroundColor.a/255),v.backgroundColor=this._color.createColor(v.backgroundColor.r,v.backgroundColor.g,v.backgroundColor.b,v.backgroundColor.a))),w._core.isnull(v.near)&&(v.near=0),w._core.isnull(v.far)&&(v.far=999999999),v&&v.time&&(C=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:v.time.start?this._cesium.JulianDate.fromDate(new Date(v.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:v.time.end?this._cesium.JulianDate.fromDate(new Date(v.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})]));var b=this._core.extend(i,v,!0);null==e&&console.log("geojson is required");var r=this._cesium.GeoJsonDataSource.load(e);this._viewer.dataSources.add(r);w=this;r.then(function(e){var t=(w.item=e).entities.values;w._core.isnull(b.font_size)&&(b.font_size="30px"),w._core.isnull(b.font_family)&&(b.font_family=" sans-serif"),-1==b.font_size.toString().indexOf("px")?b.font=b.font_size+"px "+b.font_family:b.font=b.font_size+" "+b.font_family;for(var i=0;i<t.length;i++){var r=t[i];b.font=w._core.extendgl(r,v.font,b.font),b.style=parseInt(w._core.extendgl(r,b.style,b.style)),b.fillColor=w._core.extendgl(r,v.fillColor,b.fillColor),b.outlineColor=w._core.extendgl(r,v.outlineColor,b.outlineColor),b.outlineWidth=parseFloat(w._core.extendgl(r,v.outlineWidth,b.outlineWidth)),b.show=w._core.extendgl(r,v.show,b.show),b.showBackground=w._core.extendgl(r,v.showBackground,b.showBackground),b.backgroundColor=w._core.extendgl(r,v.backgroundColor,b.backgroundColor),b.backgroundPadding=w._core.extendgl(r,v.backgroundPadding,b.backgroundPadding),b.scale=parseFloat(w._core.extendgl(r,v.scale,b.scale)),b.horizontalOrigin=w._core.extendgl(r,v.horizontalOrigin,b.horizontalOrigin),b.pointHeight=parseFloat(w._core.extendgl(r,v.pointHeight,b.pointHeight)),b.text=w._core.extendgl(r,v.text,b.text).toString();var o=parseFloat(w._core.extendgl(r,b.near)),n=parseFloat(w._core.extendgl(r,b.far)),a=new w._cesium.DistanceDisplayCondition(o,n);if(b.distanceDisplayCondition=a,null!=b.image&&null!=b.image&&0<b.image.length)r.billboard.image=b.image,r.billboard.scale=b.scale,r.billboard.color=b.fillColor,r.billboard.verticalOrigin=b.verticalOrigin,r.billboard.horizontalOrigin=b.horizontalOrigin,r.billboard.disableDepthTestDistance=b.disableDepthTestDistance,r.billboard.heightReference=b.heightReference,r.billboard.distanceDisplayCondition=b.distanceDisplayCondition;else if("ellipsoidlayer"==b.layertype){r.billboard=void 0,r.name=f;var s={show:!0,radii:new w._cesium.Cartesian3(b.long_axis,b.short_axis,b.long_axis),material:w._cesium.Color.fromRandom({alpha:1})};r.ellipsoid=new w._cesium.EllipsoidGraphics(s),r.ellipsoid.heightReference=b.heightReference,r.ellipsoid.material=url}else{r.billboard=void 0;var l={Name:b.Name,text:b.text,font:b.font,style:b.stylet,fillColor:b.fillColor,outlineColor:b.outlineColor,outlineWidth:b.outlineWidth,show:b.show,showBackground:b.showBackground,backgroundColor:b.backgroundColor,backgroundPadding:b.backgroundPadding,scale:b.scale,horizontalOrigin:b.horizontalOrigin,verticalOrigin:b.verticalOrigin,eyeOffset:b.eyeOffset,pixelOffset:b.pixelOffset,heightReference:b.heightReference,distanceDisplayCondition:b.distanceDisplayCondition,scaleByDistance:b.scaleByDistance},u="fillColor:"+255*b.fillColor.red+","+255*b.fillColor.green+","+255*b.fillColor.blue+";outlineColor:"+255*b.outlineColor.red+","+255*b.outlineColor.green+","+255*b.outlineColor.blue;w.Legend.push(u),r.label=new w._cesium.LabelGraphics(l),C&&(r.availability=C)}s=w._viewer.scene.globe.ellipsoid;var c=w._cesium.Cartographic.fromCartesian(r.position._value),h=w._cesium.Math.toDegrees(c.longitude),d=w._cesium.Math.toDegrees(c.latitude),m=c.height+b.pointHeight,p=new w._cesium.Cartesian3.fromDegrees(h,d,m),g={positions:r.position._value=p};r.description=g}_||w.setVisibility(!1),"function"==typeof y&&y(e)}),this._core.isnull(b.id)&&(b.id=this._core.getuid()),this._core.isnull(f)&&(f="新建街景"+b.id);var o={id:b.id,name:f,checked:_,pId:this._core.isnull(t)?0:t,type:"labelPointLayer",item:this,url:e,style:b};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(t)?0:t),this},t.prototype.createStreetscapeGeoJsonFeatureLayer=function(e,t,d,i,m,p){var r={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!0,width:1,show:!0,material:this._cesium.Color.RED,height:30,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},g=this;this._core.isnull(d)||this._core.isnull(d.material)||"["==d.material.toString().charAt(0)&&"]"==d.material.toString().charAt(d.material.length-1)||"("==d.material.toString().charAt(0)&&")"==d.material.toString().charAt(d.material.length-1)||(this._core.isHtmlColor(d.material)?d.material=this._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=this._color.rgbaStringToRgbaObj(d.material)),1<d.material.r&&(d.material.r=d.material.r/255),1<d.material.g&&(d.material.g=d.material.g/255),1<d.material.b&&(d.material.b=d.material.b/255),1<d.material.a&&(d.material.a=d.material.a/255),d.material=this._color.createColor(d.material.r,d.material.g,d.material.b,d.material.a)),"1"==d.arcType||1==d.arcType?d.material=new Cesium.PolylineDashMaterialProperty({color:d.material}):d.material=d.material),g._core.isnull(d.near)&&(d.near=0),g._core.isnull(d.far)&&(d.far=999999999);var f=this._core.extend(r,d,!0);null==t&&console.log("geojson is required");var v,o=null;o=t.then?t:this._cesium.GeoJsonDataSource.load(t),this._viewer.dataSources.add(o,{camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas,clampToGround:!0}),d&&d.time&&(v=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:d.time.start?this._cesium.JulianDate.fromDate(new Date(d.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:d.time.end?this._cesium.JulianDate.fromDate(new Date(d.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){for(var t=(g.item=e).entities.values,i=0;i<t.length;i++){var r=t[i];f.arcType=g._core.extendgl(r,d.arcType,f.arcType),f.clampToGround=g._core.extendgl(r,d.clampToGround,f.clampToGround),f.width=parseFloat(g._core.extendgl(r,d.width,f.width)),f.show=g._core.extendgl(r,d.show,f.show),f.material=g._core.extendgl(r,d.material,f.material),f.height=parseFloat(g._core.extendgl(r,d.height,f.height));var o=parseFloat(g._core.extendgl(r,f.near)),n=parseFloat(g._core.extendgl(r,f.far)),a=new g._cesium.DistanceDisplayCondition(o,n);f.distanceDisplayCondition=a,r.polyline.arcType=!0,0==f.heightReference?r.polyline.arcType=0:r.polyline.arcType=1,r.polyline.clampToGround=f.clampToGround,r.polyline.width=f.width,r.polyline.height=f.height,r.polyline.show=f.show,r.polyline.material=f.material,r.polyline.distanceDisplayCondition=a;var s,l,u,c=[];r.polyline.positions._value.forEach(function(e){f.height?(s=g._cesium.Cartographic.fromCartesian(e),l=g._cesium.Math.toDegrees(s.longitude),u=g._cesium.Math.toDegrees(s.latitude),c.push(g._cesium.Cartesian3.fromDegrees(l,u,f.height))):c.push(e)}),r.polyline.positions=c,v&&(r.availability=v);var h="material:"+255*f.material.red+","+255*f.material.green+","+255*f.material.blue;g.Legend.push(h)}m||g.setVisibility(!1),"function"==typeof p&&p(e)}),this._core.isnull(f.id)&&(f.id=this._core.getuid()),this._core.isnull(e)&&(e="新建街景"+f.id);var n={id:f.id,name:e,checked:m,pId:this._core.isnull(i)?0:i,type:"Streetscape",item:this,url:t,style:f};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},t.prototype.createEllipsoidlayerPointGeoJsonFeatureLayer=function(e,t,c,i,h){var r={Name:"",text:"",font:" 30px sans-serif",style:this._cesium.LabelStyle.OUTLINE,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)};this._core.isnull(c)||this._core.isnull(c.fillColor)||"["==c.fillColor.toString().charAt(0)&&"]"==c.fillColor.toString().charAt(c.fillColor.length-1)||"("==c.material.toString().charAt(0)&&")"==c.material.toString().charAt(c.material.length-1)||(this._core.isHtmlColor(c.fillColor)?c.fillColor=this._color.colorFromHtmlColor(c.fillColor):(/^rgb/.test(c.fillColor)&&(c.fillColor=this._color.rgbaStringToRgbaObj(c.fillColor)),1<c.fillColor.r&&(c.fillColor.r=c.fillColor.r/255),1<c.fillColor.g&&(c.fillColor.g=c.fillColor.g/255),1<c.fillColor.b&&(c.fillColor.b=c.fillColor.b/255),1<c.fillColor.a&&(c.fillColor.a=c.fillColor.a/255),c.fillColor=this._color.createColor(c.fillColor.r,c.fillColor.g,c.fillColor.b,c.fillColor.a))),this._core.isnull(c)||this._core.isnull(c.outlineColor)||"["==c.outlineColor.toString().charAt(0)&&"]"==c.outlineColor.toString().charAt(c.outlineColor.length-1)||(this._core.isHtmlColor(c.outlineColor)?c.outlineColor=this._color.colorFromHtmlColor(c.outlineColor):(/^rgb/.test(c.outlineColor)&&(c.outlineColor=this._color.rgbaStringToRgbaObj(c.outlineColor)),1<c.outlineColor.r&&(c.outlineColor.r=c.outlineColor.r/255),1<c.outlineColor.g&&(c.outlineColor.g=c.outlineColor.g/255),1<c.outlineColor.b&&(c.outlineColor.b=c.outlineColor.b/255),1<c.outlineColor.a&&(c.outlineColor.a=c.outlineColor.a/255),c.outlineColor=this._color.createColor(c.outlineColor.r,c.outlineColor.g,c.outlineColor.b,c.outlineColor.a))),this._core.isnull(c)||this._core.isnull(c.backgroundColor)||"["==c.backgroundColor.toString().charAt(0)&&"]"==c.backgroundColor.toString().charAt(c.backgroundColor.length-1)||(this._core.isHtmlColor(c.backgroundColor)?c.backgroundColor=this._color.colorFromHtmlColor(c.backgroundColor):(/^rgb/.test(c.backgroundColor)&&(c.backgroundColor=this._color.rgbaStringToRgbaObj(c.backgroundColor)),1<c.backgroundColor.r&&(c.backgroundColor.r=c.backgroundColor.r/255),1<c.backgroundColor.g&&(c.backgroundColor.g=c.backgroundColor.g/255),1<c.backgroundColor.b&&(c.backgroundColor.b=c.backgroundColor.b/255),1<c.backgroundColor.a&&(c.backgroundColor.a=c.backgroundColor.a/255),c.backgroundColor=this._color.createColor(c.backgroundColor.r,c.backgroundColor.g,c.backgroundColor.b,c.backgroundColor.a))),m._core.isnull(c.near)&&(c.near=0),m._core.isnull(c.far)&&(c.far=999999999);var d=this._core.extend(r,c,!0);null==t&&console.log("geojson is required");var o=this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(o);var m=this;o.then(function(e){var t=(m.item=e).entities.values;m._core.isnull(c.font_size)&&(c.font_size="30px"),m._core.isnull(c.font_family)&&(c.font_family=" sans-serif"),d.font=c.font_size+"px "+c.font_family;for(var i=0;i<t.length;i++){d.text=m._core.extendgl(entity,c.text,d.text),d.font=m._core.extendgl(entity,c.font,d.font),d.stylet=m._core.extendgl(entity,c.stylet,d.stylet),d.fillColor=m._core.extendgl(entity,c.fillColor,d.fillColor),d.outlineColor=m._core.extendgl(entity,c.outlineColor,d.outlineColor),d.outlineWidth=parseFloat(m._core.extendgl(entity,c.outlineWidth,d.outlineWidth)),d.show=m._core.extendgl(entity,c.show,d.show),d.showBackground=m._core.extendgl(entity,c.showBackground,d.showBackground),d.backgroundColor=m._core.extendgl(entity,c.backgroundColor,d.backgroundColor),d.backgroundPadding=m._core.extendgl(entity,c.backgroundPadding,d.backgroundPadding),d.scale=parseFloat(m._core.extendgl(entity,c.scale,d.scale)),d.horizontalOrigin=m._core.extendgl(entity,c.horizontalOrigin,d.horizontalOrigin),d.pointheight=parseFloat(m._core.extendgl(entity,c.pointheight,d.pointheight));var r=parseFloat(m._core.extendgl(entity,d.near)),o=parseFloat(m._core.extendgl(entity,d.far)),n="fillColor:"+255*d.fillColor.red+","+255*d.fillColor.green+","+255*d.fillColor.blue+";outlineColor:"+255*d.outlineColor.red+","+255*d.outlineColor.green+","+255*d.outlineColor.blue;m.Legend.push(n);var a=new m._cesium.DistanceDisplayCondition(r,o);if(d.distanceDisplayCondition=a,entity.ellipsoid.radii=new _this._cesium.Cartesian3(c.long_axis,c.short_axis,c.short_axis),entity.label=new m._cesium.LabelGraphics(d),entity.label.text=null==entity.properties[c.text]?c.text:entity.properties[c.text]._value,d.pointheight){var s=m._cesium.Cartographic.fromCartesian(entity.position._value),l=m._cesium.Math.toDegrees(s.longitude),u=m._cesium.Math.toDegrees(s.latitude);entity.position=m._cesium.Cartesian3.fromDegrees(l,u,d.pointheight)}}"function"==typeof h&&h(e)}),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id);var n={id:d.id,name:e,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t,style:d};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},t.prototype.createBillboardGeoJsonFeature=function(e,t,p,i,g,f){var r={image:"",show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:2,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)};this._core.isnull(p)||this._core.isnull(p.color)||"["==p.color.toString().charAt(0)&&"]"==p.color.toString().charAt(p.color.length-1)||(this._core.isHtmlColor(p.color)?p.color=this._color.colorFromHtmlColor(p.color):(/^rgb/.test(p.color)&&(p.color=this._color.rgbaStringToRgbaObj(p.color)),1<p.color.r&&(p.color.r=p.color.r/255),1<p.color.g&&(p.color.g=p.color.g/255),1<p.color.b&&(p.color.b=p.color.b/255),1<p.color.a&&(p.color.a=p.color.a/255),p.color=this._color.createColor(p.color.r,p.color.g,p.color.b,p.color.a)));var v=this._core.extend(r,p,!0);null==t&&console.log("geojson is required");var o=this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(o);var _,y=this;y._core.isnull(p.near)&&(p.near=0),y._core.isnull(p.far)&&(p.far=999999999),p&&p.time&&(_=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:p.time.start?this._cesium.JulianDate.fromDate(new Date(p.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:p.time.end?this._cesium.JulianDate.fromDate(new Date(p.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){for(var t=(y.item=e).entities.values,i=0;i<t.length;i++){var r=t[i];v.image=y._core.extendgl(r,p.image,v.image),v.show=y._core.extendgl(r,p.show,v.show),v.scale=parseFloat(y._core.extendgl(r,p.scale,v.scale)),v.horizontalOrigin=y._core.extendgl(r,p.horizontalOrigin,v.horizontalOrigin),v.verticalOrigin=y._core.extendgl(r,p.verticalOrigin,v.verticalOrigin),v.eyeOffset=y._core.extendgl(r,p.eyeOffset,v.eyeOffset),v.pixelOffset=y._core.extendgl(r,p.pixelOffset,v.pixelOffset),v.alignedAxis=y._core.extendgl(r,p.alignedAxis,v.alignedAxis),v.rotation=y._core.extendgl(r,p.rotation,v.rotation),v.width?v.width=parseFloat(y._core.extendgl(r,p.width,v.width)):v.width=void 0,v.height?v.height=parseFloat(y._core.extendgl(r,p.height,v.height)):v.height=void 0,v.color=y._core.extendgl(r,p.color,v.color);var o="color:"+255*v.color.red+","+255*v.color.green+","+255*v.color.blue+";image:"+v.image;y.Legend.push(o);var n=parseFloat(y._core.extendgl(r,v.near)),a=parseFloat(y._core.extendgl(r,v.far)),s=new y._cesium.DistanceDisplayCondition(n,a);v.distanceDisplayCondition=s,r.billboard=void 0,r.billboard=new y._cesium.BillboardGraphics(v);y._viewer.scene.globe.ellipsoid;var l=y._cesium.Cartographic.fromCartesian(r.position._value),u=y._cesium.Math.toDegrees(l.longitude),c=y._cesium.Math.toDegrees(l.latitude);if(p.pointHeight)var h=p.pointHeight;else h=l.height;var d=new y._cesium.Cartesian3.fromDegrees(u,c,h),m={positions:r.position._value=d};r.description=m,_&&(r.availability=_)}g||y.setVisibility(!1),"function"==typeof f&&f(e)}),this._core.isnull(v.id)&&(v.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+v.id);var n={id:v.id,name:e,checked:g,pId:this._core.isnull(i)?0:i,type:"imageLayer",item:this};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},t.prototype.createPolylineGeoJsonFeatureLayer=function(e,t,l,i,u,c){var r={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!0,width:1,show:!0,material:this._cesium.Color.WHITE,height:30,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},h=this;this._core.isnull(l)||this._core.isnull(l.material)||"["==l.material.toString().charAt(0)&&"]"==l.material.toString().charAt(l.material.length-1)||"("==l.material.toString().charAt(0)&&")"==l.material.toString().charAt(l.material.length-1)||(this._core.isHtmlColor(l.material)?l.material=this._color.colorFromHtmlColor(l.material):(/^rgb/.test(l.material)&&(l.material=this._color.rgbaStringToRgbaObj(l.material)),1<l.material.r&&(l.material.r=l.material.r/255),1<l.material.g&&(l.material.g=l.material.g/255),1<l.material.b&&(l.material.b=l.material.b/255),1<l.material.a&&(l.material.a=l.material.a/255),l.material=this._color.createColor(l.material.r,l.material.g,l.material.b,l.material.a))),h._core.isnull(l.near)&&(l.near=0),h._core.isnull(l.far)&&(l.far=999999999);var d=this._core.extend(r,l,!0);null==t&&console.log("geojson is required");var m,o=null;o=t.then?t:this._cesium.GeoJsonDataSource.load(t),this._viewer.dataSources.add(o,{camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas,clampToGround:!0}),l&&l.time&&(m=new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({start:l.time.start?h._cesium.JulianDate.fromDate(new Date(l.time.start)):h._cesium.Iso8601.MINIMUM_VALUE,stop:l.time.end?h._cesium.JulianDate.fromDate(new Date(l.time.end)):h._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){for(var t=(h.item=e).entities.values,i=0;i<t.length;i++){var r=t[i];d.arcType=h._core.extendgl(r,l.arcType,d.arcType),d.clampToGround=h._core.extendgl(r,l.clampToGround,d.clampToGround),d.width=parseFloat(h._core.extendgl(r,l.width,d.width)),d.show=h._core.extendgl(r,l.show,d.show),d.material=h._core.extendgl(r,l.material,d.material),d.height=parseFloat(h._core.extendgl(r,l.height,d.height));var o=parseFloat(h._core.extendgl(r,d.near)),n=parseFloat(h._core.extendgl(r,d.far)),a=new h._cesium.DistanceDisplayCondition(o,n);d.distanceDisplayCondition=a;h._viewer.scene.globe.ellipsoid;1!=d.heightReference?r.polyline.arcType=!1:r.polyline.arcType=!0,r.polyline.clampToGround=d.clampToGround,r.polyline.width=d.width,r.polyline.show=d.show,r.polyline.material=d.material,r.polyline.distanceDisplayCondition=a,m&&(r.availability=m);var s="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue;h.Legend.push(s)}u||h.setVisibility(!1),"function"==typeof c&&c(e)}),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id);var n={id:d.id,name:e,checked:u,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t,style:d};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},t.prototype.createpolylineVolumeGeojsonFeatureLayer=function(e,t,g,i,f,v){var r={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,radius:.5,radiusScale:1};this._core.isnull(g)||this._core.isnull(g.material)||"["==g.material.toString().charAt(0)&&"]"==g.material.toString().charAt(g.material.length-1)||"("==g.material.toString().charAt(0)&&")"==g.material.toString().charAt(g.material.length-1)||(this._core.isHtmlColor(g.material)?g.material=this._color.colorFromHtmlColor(g.material):(/^rgb/.test(g.material)&&(g.material=this._color.rgbaStringToRgbaObj(g.material)),1<g.material.r&&(g.material.r=g.material.r/255),1<g.material.g&&(g.material.g=g.material.g/255),1<g.material.b&&(g.material.b=g.material.b/255),1<g.material.a&&(g.material.a=g.material.a/255),g.material=this._color.createColor(g.material.r,g.material.g,g.material.b,g.material.a)));var _=this._core.extend(r,g,!0);null==t&&console.log("geojson is required");var o=null;o=t.then?t:this._cesium.GeoJsonDataSource.load(t),this._viewer.dataSources.add(o);var y,C=this;_.shape=this.computeCircle(g.radius),g&&g.time&&(y=new C._cesium.TimeIntervalCollection([new C._cesium.TimeInterval({start:g.time.start?C._cesium.JulianDate.fromDate(new Date(g.time.start)):C._cesium.Iso8601.MINIMUM_VALUE,stop:g.time.end?C._cesium.JulianDate.fromDate(new Date(g.time.end)):C._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){var t=(C.item=e).entities.values;C._core.isnull(g.near)&&(g.near=0),C._core.isnull(g.far)&&(g.far=999999999);var i=parseFloat(g.near),r=parseFloat(g.far),o=new C._cesium.DistanceDisplayCondition(i,r);_.distanceDisplayCondition=o;if("string"==typeof _.radius&&-1<_.radius.indexOf("[")&&-1<_.radius.indexOf("]")){var n=void 0;if(_.radius=_.radius.replace("[",""),_.radius=_.radius.replace("]",""),t[0]&&t[0].properties[_.radius])if((n=t[0].properties[_.radius].getValue()).indexOf&&(-1<n.indexOf("*")||-1<n.indexOf("x")||-1<n.indexOf("X"))){-1<n.indexOf("*")?n=n.split("*"):-1<n.indexOf("X")?n=n.split("X"):-1<n.indexOf("x")&&(n=n.split("x"));var a=parseFloat(n[0])*_.radiusScale,s=parseFloat(n[1])*_.radiusScale;_.shape=[new C._cesium.Cartesian2(-a,-s),new C._cesium.Cartesian2(a,-s),new C._cesium.Cartesian2(a,s),new C._cesium.Cartesian2(-a,s)]}else _.shape=C._core.computeCircle(n*_.radiusScale);else _.shape=C._core.computeCircle(.5)}else if("0"==_.slttype||0==_.slttype)_.shape=C._core.computeCircle(_.radius);else if("1"==_.slttype||1==_.slttype)_.shape=C._core.starPositions(_.number,_.exradius,_.inradius);else if("2"==_.slttype||2==_.slttype){a=_.orth_width/2,s=_.orth_height/2;_.shape=[new C._cesium.Cartesian2(-a,-s),new C._cesium.Cartesian2(a,-s),new C._cesium.Cartesian2(a,s),new C._cesium.Cartesian2(-a,s)]}for(var l=0;l<t.length;l++){var u=t[l];_.show=C._core.extendgl(u,g.show,_.show),_.shape=C._core.extendgl(u,g.shape,_.shape),_.cornerType=C._core.extendgl(u,g.cornerType,_.cornerType),_.granularity=C._core.extendgl(u,g.granularity,_.granularity),_.fill=C._core.extendgl(u,g.fill,_.fill),_.material=C._core.extendgl(u,g.material,_.material),_.outline=C._core.extendgl(u,g.outline,_.outline),_.outlineColor=C._core.extendgl(u,g.outlineColor,_.outlineColor),_.outlineWidth=parseFloat(C._core.extendgl(u,g.outlineWidth,_.outlineWidth)),_.shadows=C._core.extendgl(u,g.shadows,_.shadows);var c,h,d,m=[];u.polyline.positions._value.forEach(function(e){_.height?(c=C._cesium.Cartographic.fromCartesian(e),h=C._cesium.Math.toDegrees(c.longitude),d=C._cesium.Math.toDegrees(c.latitude),m.push(C._cesium.Cartesian3.fromDegrees(h,d,_.height))):m.push(e)}),u.polylineVolume=new C._cesium.PolylineVolumeGraphics({positions:m,show:_.show,shape:_.shape,cornerType:_.cornerType,fill:_.fill,outline:_.outline,outlineWidth:_.outlineWidth,material:_.material,distanceDisplayCondition:o});var p="material:"+255*_.material.red+","+255*_.material.green+","+255*_.material.blue;C.Legend.push(p),u.polyline=void 0,y&&(u.availability=y)}f||C.setVisibility(!1),"function"==typeof v&&v(e)}),this._core.isnull(_.id)&&(_.id=this._core.getuid()),this._core.isnull(e)&&(e="新建管状图层"+_.id);var n={id:_.id,name:e,checked:f,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t,style:_};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},t.prototype.createpolylineVolumeGeojsonPrimitiveLayer=function(e,t,c,i,h,d){var r,o,m=(r=_asyncToGenerator(regeneratorRuntime.mark(function e(i,t){var r,o,n,a,s,l,u,c,h,d,m,p,g;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=[],o=v._core.getPointFromTwoPointCenter([t[0],t[1]],2*f.connectRadius,f.height-f.connectRadius),n=v._core.getPointFromTwoPointCenter([t[0],t[1]],2*f.connectRadius2,f.height-f.connectRadius2),a=v._core.getPointFromTwoPointCenter([t[t.length-1],t[t.length-2]],2*f.connectRadius,f.height-f.connectRadius),s=v._core.getPointFromTwoPointCenter([t[t.length-1],t[t.length-2]],2*f.connectRadius2,f.height-f.connectRadius2),l=new v._cesium.PolylineVolumeGeometry({polylinePositions:[t[0],o],shapePositions:f.connectShape1,cornerType:f.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}}),r.push(l),u=new v._cesium.PolylineVolumeGeometry({polylinePositions:[o,n],shapePositions:f.connectShape2,cornerType:f.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}}),r.push(u),c=new v._cesium.PolylineVolumeGeometry({polylinePositions:[t[t.length-1],a],shapePositions:f.connectShape1,cornerType:f.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}}),r.push(c),h=new v._cesium.PolylineVolumeGeometry({polylinePositions:[a,s],shapePositions:f.connectShape2,cornerType:f.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}}),r.push(h),d=[],r.forEach(function(e){var t=new v._cesium.GeometryInstance({id:i,geometry:e,attributes:{color:new v._cesium.ColorGeometryInstanceAttribute.fromColor(f.material)}});d.push(t)}),m=new Cesium.EllipsoidGeometry({vertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0},stackPartitions:16,slicePartitions:16,radii:new Cesium.Cartesian3(f.connectRadius,f.connectRadius,f.connectRadius)}),p=new Cesium.GeometryInstance({geometry:m,modelMatrix:Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(t[0]),new Cesium.Cartesian3(0,0,f.connectRadius),new Cesium.Matrix4),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(f.material)}}),d.push(p),g=new Cesium.GeometryInstance({geometry:m,modelMatrix:Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(t[t.length-1]),new Cesium.Cartesian3(0,0,f.connectRadius),new Cesium.Matrix4),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(f.material)}}),d.push(g),y.geometryInstances=d,_.add(new v._cesium.Primitive(y));case 22:case"end":return e.stop()}},e,this)})),function(e,t){return r.apply(this,arguments)}),p=(o=_asyncToGenerator(regeneratorRuntime.mark(function e(t){var i,r,o,n,a,s,l,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i=[],t.polyline&&t.polyline.positions._value.forEach(function(e){f.height?(r=v._cesium.Cartographic.fromCartesian(e),o=v._cesium.Math.toDegrees(r.longitude),n=v._cesium.Math.toDegrees(r.latitude),i.push(v._cesium.Cartesian3.fromDegrees(o,n,f.height-f.radius))):i.push(e)}),t.polyline=void 0,a={polylinePositions:i,shapePositions:f.shape,cornerType:f.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}},s=new v._cesium.PolylineVolumeGeometry(a),l=new v._cesium.GeometryInstance({id:t,geometry:s,attributes:{color:new v._cesium.ColorGeometryInstanceAttribute.fromColor(f.material)}}),y.geometryInstances=l,_.add(new v._cesium.Primitive(y)),f.connect&&1<i.length&&m(t,i),u="material:"+255*f.material.red+","+255*f.material.green+","+255*f.material.blue,v.Legend.push(u);case 11:case"end":return e.stop()}},e,this)})),function(e){return o.apply(this,arguments)}),n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,radius:.5,radiusScale:1};this._core.isnull(c)||this._core.isnull(c.material)||"["==c.material.toString().charAt(0)&&"]"==c.material.toString().charAt(c.material.length-1)||"("==c.material.toString().charAt(0)&&")"==c.material.toString().charAt(c.material.length-1)||(this._core.isHtmlColor(c.material)?c.material=this._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=this._color.rgbaStringToRgbaObj(c.material)),1<c.material.r&&(c.material.r=c.material.r/255),1<c.material.g&&(c.material.g=c.material.g/255),1<c.material.b&&(c.material.b=c.material.b/255),1<c.material.a&&(c.material.a=c.material.a/255),c.material=this._color.createColor(c.material.r,c.material.g,c.material.b,c.material.a)));var f=this._core.extend(n,c,!0);null==t&&console.log("geojson is required");var a=null;a=t.then?t:this._cesium.GeoJsonDataSource.load(t);var v=this;c&&c.time&&new v._cesium.TimeIntervalCollection([new v._cesium.TimeInterval({start:c.time.start?v._cesium.JulianDate.fromDate(new Date(c.time.start)):v._cesium.Iso8601.MINIMUM_VALUE,stop:c.time.end?v._cesium.JulianDate.fromDate(new Date(c.time.end)):v._cesium.Iso8601.MAXIMUM_VALUE})]);var _=new Cesium.PrimitiveCollection,y={allowPicking:!0,appearance:new v._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:v._core.Shaders("vertexShaderSource"),fragmentShaderSource:v._core.Shaders("fragmentShaderSource")}),shadows:f.shadows,geometryInstances:void 0};a.then(function(e){var t=(v.item=e).entities.values;v._core.isnull(c.near)&&(c.near=0),v._core.isnull(c.far)&&(c.far=999999999);var i=parseFloat(c.near),r=parseFloat(c.far),o=new v._cesium.DistanceDisplayCondition(i,r);f.distanceDisplayCondition=o;if("string"==typeof f.radius&&-1<f.radius.indexOf("[")&&-1<f.radius.indexOf("]")){var n=void 0;if(f.radius=f.radius.replace("[",""),f.radius=f.radius.replace("]",""),t[0]&&t[0].properties[f.radius])if((n=t[0].properties[f.radius].getValue()).indexOf&&(-1<n.indexOf("*")||-1<n.indexOf("x")||-1<n.indexOf("X"))){-1<n.indexOf("*")?n=n.split("*"):-1<n.indexOf("X")?n=n.split("X"):-1<n.indexOf("x")&&(n=n.split("x"));var a=parseFloat(n[0])*f.radiusScale,s=parseFloat(n[1])*f.radiusScale;f.shape=[new v._cesium.Cartesian2(-a,-s),new v._cesium.Cartesian2(a,-s),new v._cesium.Cartesian2(a,s),new v._cesium.Cartesian2(-a,s)],f.radius=s}else f.shape=v._core.computeCircle(n*f.radiusScale),f.connect&&(f.connectRadius=n*f.radiusScale*1.1,f.connectRadius2=n*f.radiusScale*1.2,f.connectShape1=v._core.computeCircle(f.connectRadius),f.connectShape2=v._core.computeCircle(f.connectRadius2)),f.radius=n*f.radiusScale;else f.shape=v._core.computeCircle(.5),f.radius=.5,f.connect&&(f.connectRadius=1.1*f.radius,f.connectRadius2=1.2*f.radius,f.connectShape1=v._core.computeCircle(f.connectRadius),f.connectShape2=v._core.computeCircle(f.connectRadius2))}else if("0"==f.slttype||0==f.slttype)f.shape=v._core.computeCircle(f.radius),f.connect&&(f.connectRadius=1.1*f.radius,f.connectRadius2=1.2*f.radius,f.connectShape1=v._core.computeCircle(f.connectRadius),f.connectShape2=v._core.computeCircle(f.connectRadius2));else if("1"==f.slttype||1==f.slttype)f.shape=v._core.starPositions(f.number,f.exradius,f.inradius);else if("2"==f.slttype||2==f.slttype){a=f.orth_width/2,s=f.orth_height/2;f.shape=[new v._cesium.Cartesian2(-a,-s),new v._cesium.Cartesian2(a,-s),new v._cesium.Cartesian2(a,s),new v._cesium.Cartesian2(-a,s)],f.radius=s}f.show=v._core.extendgl(t[0],c.show,f.show),f.shape=v._core.extendgl(t[0],c.shape,f.shape),f.cornerType=v._core.extendgl(t[0],c.cornerType,f.cornerType),f.granularity=v._core.extendgl(t[0],c.granularity,f.granularity),f.fill=v._core.extendgl(t[0],c.fill,f.fill),f.material=v._core.extendgl(t[0],c.material,f.material),f.outline=v._core.extendgl(t[0],c.outline,f.outline),f.outlineColor=v._core.extendgl(t[0],c.outlineColor,f.outlineColor),f.outlineWidth=parseFloat(v._core.extendgl(t[0],c.outlineWidth,f.outlineWidth)),f.shadows=v._core.extendgl(t[0],c.shadows,f.shadows);for(var l=0;l<t.length;l++){var u=t[l];p(u)}v._viewer.scene.primitives.add(_),v.item=_,h||v.setVisibility(!1),"function"==typeof d&&d(_)}),this._core.isnull(f.id)&&(f.id=this._core.getuid()),this._core.isnull(e)&&(e="新建管状图层"+f.id);var s={id:f.id,name:e,checked:h,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t,style:f};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),this},t.prototype.computeCircle=function(e){this._core.isnull(e)&&(e=4);for(var t=[],i=0;i<360;i++){var r=Cesium.Math.toRadians(i);t.push(new this._cesium.Cartesian2(e*Math.cos(r),e*Math.sin(r)))}return t},t.prototype.createWallGeoFeatureLayer=function(e,t,h,i,d,m){var r={positions:[],minimumHeights:[],maximumHeights:[],granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0};this._core.isnull(h)||this._core.isnull(h.material)||"["==h.material.toString().charAt(0)&&"]"==h.material.toString().charAt(h.material.length-1)||(this._core.isHtmlColor(h.material)?h.material=this._color.colorFromHtmlColor(h.material):(/^rgb/.test(h.material)&&(h.material=this._color.rgbaStringToRgbaObj(h.material)),1<h.material.r&&(h.material.r=h.material.r/255),1<h.material.g&&(h.material.g=h.material.g/255),1<h.material.b&&(h.material.b=h.material.b/255),1<h.material.a&&(h.material.a=h.material.a/255),h.material=this._color.createColor(h.material.r,h.material.g,h.material.b,h.material.a))),this._core.isnull(h)||this._core.isnull(h.outlineColor)||"["==h.outlineColor.toString().charAt(0)&&"]"==h.outlineColor.toString().charAt(h.outlineColor.length-1)||(this._core.isHtmlColor(h.outlineColor)?h.outlineColor=this._color.colorFromHtmlColor(h.outlineColor):(/^rgb/.test(h.outlineColor)&&(h.outlineColor=this._color.rgbaStringToRgbaObj(h.outlineColor)),1<h.outlineColor.r&&(h.outlineColor.r=h.outlineColor.r/255),1<h.outlineColor.g&&(h.outlineColor.g=h.outlineColor.g/255),1<h.outlineColor.b&&(h.outlineColor.b=h.outlineColor.b/255),1<h.outlineColor.a&&(h.outlineColor.a=h.outlineColor.a/255),h.outlineColor=this._color.createColor(h.outlineColor.r,h.outlineColor.g,h.outlineColor.b,h.outlineColor.a)));var p=this._core.extend(r,h,!0);null==t&&console.log("geojson is required");var o=null;o=t.then?t:this._cesium.GeoJsonDataSource.load(t),this._viewer.dataSources.add(o);var g,f=this;h&&h.time&&(g=new f._cesium.TimeIntervalCollection([new f._cesium.TimeInterval({start:h.time.start?f._cesium.JulianDate.fromDate(new Date(h.time.start)):f._cesium.Iso8601.MINIMUM_VALUE,stop:h.time.end?f._cesium.JulianDate.fromDate(new Date(h.time.end)):f._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){var t=(f.item=e).entities.values;f._core.isnull(h.near)&&(h.near=0),f._core.isnull(h.far)&&(h.far=999999999);var i=parseFloat(h.near),r=parseFloat(h.far),o=new f._cesium.DistanceDisplayCondition(i,r);p.distanceDisplayCondition=o;for(var n=0;n<t.length;n++){var a=t[n];p.granularity=f._core.extendgl(a,h.granularity,p.granularity),p.fill=f._core.extendgl(a,h.fill,p.fill),p.material=f._core.extendgl(a,h.material,p.material),p.outline=f._core.extendgl(a,h.outline,p.outline),p.outlineColor=f._core.extendgl(a,h.outlineColor,p.outlineColor),p.outlineWidth=parseFloat(f._core.extendgl(a,h.outlineWidth,p.outlineWidth)),p.shadows=f._core.extendgl(a,h.shadows,p.shadows);var s=a.polyline.positions._value.length,l=new Array(s),u=new Array(s);l.fill(p.minimumHeights),u.fill(p.maximumHeights),a.wall=new f._cesium.WallGraphics({positions:a.polyline.positions._value,maximumHeights:u,minimumHeights:l,outline:p.outline,fill:p.fill,material:p.material,outlineColor:p.outlineColor,outlineWidth:p.outlineWidth,shadows:p.shadows,distanceDisplayCondition:o});var c="material:"+255*p.material.red+","+255*p.material.green+","+255*p.material.blue+";outlineColor:"+255*p.outlineColor.red+","+255*p.outlineColor.green+","+255*p.outlineColor.blue;f.Legend.push(c),a.polyline=void 0,g&&(a.availability=g)}d||f.setVisibility(!1),"function"==typeof m&&m(e)}),this._core.isnull(p.id)&&(p.id=this._core.getuid()),this._core.isnull(e)&&(e="新建墙图层"+p.id);var n={id:p.id,name:e,checked:d,pId:this._core.isnull(i)?0:i,type:"polylineWallLayer",item:this,url:t,style:p};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},t.prototype.createterrainProvider=function(e,t,i,r){var o=this._core.extend({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"},t,!0),n=new this._cesium.CesiumTerrainProvider(o);return this._viewer.terrainProvider=n,this.item=n,"function"==typeof r&&r(dataSource),this._core.isnull(o.id)&&(o.id=this._core.getuid()),this._tree.insertGroupId({id:o.id,name:e,pId:this._core.isnull(i)?0:i,type:"terrainProvider",item:this},this._core.isnull(i)?0:i),this},t.prototype.createPolygonGeoJsonFeatureLayers=function(e,t,l,i,r,u){var o={height:0,extrudedHeight:0,heightReference:this._cesium.HeightReference.NONE,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:0,granularity:this._cesium.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:this._cesium.ShadowMode.ENABLED,clampToGround:!0};this._core.isnull(l)||this._core.isnull(l.material)||"["==l.material.toString().charAt(0)&&"]"==l.material.toString().charAt(l.material.length-1)||"("==l.material.toString().charAt(0)&&")"==l.material.toString().charAt(l.material.length-1)||(this._core.isHtmlColor(l.material)?l.material=this._color.colorFromHtmlColor(l.material):(/^rgb/.test(l.material)&&(l.material=this._color.rgbaStringToRgbaObj(l.material)),1<l.material.r&&(l.material.r=l.material.r/255),1<l.material.g&&(l.material.g=l.material.g/255),1<l.material.b&&(l.material.b=l.material.b/255),1<l.material.a&&(l.material.a=l.material.a/255),l.material=this._color.createColor(l.material.r,l.material.g,l.material.b,l.material.a))),this._core.isnull(l)||this._core.isnull(l.outlineColor)||"["==l.outlineColor.toString().charAt(0)&&"]"==l.outlineColor.toString().charAt(l.outlineColor.length-1)||(this._core.isHtmlColor(l.outlineColor)?l.outlineColor=this._color.colorFromHtmlColor(l.outlineColor):(/^rgb/.test(l.outlineColor)&&(l.outlineColor=this._color.rgbaStringToRgbaObj(l.outlineColor)),1<l.outlineColor.r&&(l.outlineColor.r=l.outlineColor.r/255),1<l.outlineColor.g&&(l.outlineColor.g=l.outlineColor.g/255),1<l.outlineColor.b&&(l.outlineColor.b=l.outlineColor.b/255),1<l.outlineColor.a&&(l.outlineColor.a=l.outlineColor.a/255),l.outlineColor=this._color.createColor(l.outlineColor.r,l.outlineColor.g,l.outlineColor.b,l.outlineColor.a))),l.checked=r;var c=this._core.extend(o,l,!0);null==t&&console.log("geojson is required");var n=null;n=t.then?t:this._cesium.GeoJsonDataSource.load(t),this._viewer.dataSources.add(n);var h=this;n.then(function(e){var t=(h.item=e).entities.values;h._core.isnull(l.near)&&(l.near=0),h._core.isnull(l.far)&&(l.far=999999999);var i=parseFloat(l.near),r=parseFloat(l.far),o=new h._cesium.DistanceDisplayCondition(i,r);c.distanceDisplayCondition=o;for(var n=0;n<t.length;n++){var a=t[n];c.height=parseFloat(h._core.extendgl(a,l.height,c.height)),c.extrudedHeight=parseFloat(h._core.extendgl(a,l.extrudedHeight,c.extrudedHeight)),c.heightReference=h._core.extendgl(a,l.heightReference,c.heightReference),c.show=h._core.extendgl(a,l.show,c.show),c.fill=h._core.extendgl(a,l.fill,c.fill),c.material=h._core.extendgl(a,l.material,c.material),c.outline=h._core.extendgl(a,l.outline,c.outline),c.outlineColor=h._core.extendgl(a,l.outlineColor,c.outlineColor),c.outlineWidth=parseFloat(h._core.extendgl(a,l.outlineWidth,c.outlineWidth)),c.stRotation=parseInt(h._core.extendgl(a,l.stRotation,c.stRotation)),c.granularity=h._core.extendgl(a,l.granularity,c.granularity),c.shadows=h._core.extendgl(a,l.shadows,c.shadows),a.polygon.height=c.height,a.polygon.extrudedHeight=c.extrudedHeight,a.polygon.heightReference=c.heightReference,a.polygon.show=c.show,a.polygon.fill=c.fill,a.polygon.material=c.material,a.polygon.outline=c.outline,a.polygon.outlineColor=c.outlineColor,a.polygon.outlineWidth=c.outlineWidth,a.polygon.stRotation=c.stRotation,a.polygon.granularity=c.granularity,a.polygon.distanceDisplayCondition=o,a.polygon.perPositionHeight=c.perPositionHeight,a.polygon.closeTop=c.closeTop,a.polygon.closeBottom=c.closeBottom,a.polygon.shadows=c.shadows;var s="material:"+255*c.material.red+","+255*c.material.green+","+255*c.material.blue+";outlineColor:"+255*c.outlineColor.red+","+255*c.outlineColor.green+","+255*c.outlineColor.blue;h.Legend.push(s)}"function"==typeof u&&u(e),l.checked||h.setVisibility(!1)}),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id);var a={id:c.id,name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t,style:c};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},t.prototype.createPolygonGeoJsonFeatureLayer=function(e,t,l,i,r,u){var o={height:0,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:0,shadows:this._cesium.ShadowMode.ENABLED,clampToGround:!0,classificationType:this._cesium.ClassificationType.BOTH,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0};this._core.isnull(l)||this._core.isnull(l.material)||(-1!=l.material.indexOf("type")?"checker"==l.material.type?l.material=new this._cesium.CheckerboardMaterialProperty({evenColor:l.material.evenColor,oddColor:l.material.oddColor,repeat:l.material.repeat}):"stripe"==l.material.type?l.material=new this._cesium.StripeMaterialProperty({evenColor:l.material.evenColor,oddColor:l.material.oddColor,repeat:l.material.repeat,offset:l.material.repeat,orientation:l.material.repeat}):"grid"==l.material.type&&(l.material=new this._cesium.GridMaterialProperty({color:l.material.color,cellAlpha:l.material.cellAlpha,lineCount:l.material.lineCount,lineThickness:l.material.lineThickness})):this._core.isHtmlColor(l.material)?l.material=this._color.colorFromHtmlColor(l.material):-1!=l.material.indexOf("[")||"("==l.material.toString().charAt(0)&&")"==l.material.toString().charAt(l.material.length-1)||(/^rgb/.test(l.material)&&(l.material=this._color.rgbaStringToRgbaObj(l.material)),1<l.material.r&&(l.material.r=l.material.r/255),1<l.material.g&&(l.material.g=l.material.g/255),1<l.material.b&&(l.material.b=l.material.b/255),1<l.material.a&&(l.material.a=l.material.a/255),l.material=this._color.createColor(l.material.r,l.material.g,l.material.b,l.material.a))),this._core.isnull(l)||this._core.isnull(l.outlineColor)||(this._core.isHtmlColor(l.outlineColor)?l.outlineColor=this._color.colorFromHtmlColor(l.outlineColor):(/^rgb/.test(l.outlineColor)&&(l.outlineColor=this._color.rgbaStringToRgbaObj(l.outlineColor)),1<l.outlineColor.r&&(l.outlineColor.r=l.outlineColor.r/255),1<l.outlineColor.g&&(l.outlineColor.g=l.outlineColor.g/255),1<l.outlineColor.b&&(l.outlineColor.b=l.outlineColor.b/255),1<l.outlineColor.a&&(l.outlineColor.a=l.outlineColor.a/255),l.outlineColor=this._color.createColor(l.outlineColor.r,l.outlineColor.g,l.outlineColor.b,l.outlineColor.a)));var c=this._core.extend(o,l,!0);l.checked=r;null==t&&console.log("geojson is required");var n=null;n=t.then?t:this._cesium.GeoJsonDataSource.load(t,{clampToGround:!0}),this._viewer.dataSources.add(n);var h,d=this;l&&l.time&&(h=new d._cesium.TimeIntervalCollection([new d._cesium.TimeInterval({start:l.time.start?d._cesium.JulianDate.fromDate(new Date(l.time.start)):d._cesium.Iso8601.MINIMUM_VALUE,stop:l.time.end?d._cesium.JulianDate.fromDate(new Date(l.time.end)):d._cesium.Iso8601.MAXIMUM_VALUE})])),n.then(function(e){var t=(d.item=e).entities.values;d._core.isnull(l.near)&&(l.near=0),d._core.isnull(l.far)&&(l.far=999999999);var i=parseFloat(l.near),r=parseFloat(l.far),o=new d._cesium.DistanceDisplayCondition(i,r);c.distanceDisplayCondition=o;for(var n=0;n<t.length;n++){var a=t[n];c.height=parseFloat(d._core.extendgl(a,l.height,c.height)),c.height!=c.height&&(c.height=void 0),c.extrudedHeight=d._core.extendgl(a,l.extrudedHeight,c.extrudedHeight),c.heightReference=d._core.extendgl(a,l.heightReference,c.heightReference),c.show=d._core.extendgl(a,l.show,c.show),c.fill=d._core.extendgl(a,l.fill,c.fill),c.material=d._core.extendgl(a,l.material,c.material),void 0!==c.extrudedHeight&&(c.extrudedHeight=parseFloat(c.extrudedHeight)),c.outline=d._core.extendgl(a,l.outline,c.outline),c.outlineColor=d._core.extendgl(a,l.outlineColor,c.outlineColor),c.outlineWidth=parseFloat(d._core.extendgl(a,l.outlineWidth,c.outlineWidth)),c.stRotation=d._core.extendgl(a,l.stRotation,c.stRotation),c.granularity=d._core.extendgl(a,l.granularity,c.granularity),c.distanceDisplayCondition=d._core.extendgl(a,l.distanceDisplayCondition,c.distanceDisplayCondition),c.perPositionHeight=d._core.extendgl(a,l.perPositionHeight,c.perPositionHeight),c.closeTop=d._core.extendgl(a,l.closeTop,c.closeTop),c.closeBottom=d._core.extendgl(a,l.closeBottom,c.closeBottom),c.shadows=d._core.extendgl(a,l.shadows,c.shadows),c.classificationType=d._core.extendgl(a,l.classificationType,c.classificationType);a.polygon._hierarchy._value.positions;a.polygon.extrudedHeightReference=c.extrudedHeightReference,a.polygon.heightReference=c.heightReference,1!=c.heightReference&&(a.polygon.height=c.height,c.height&&(a.polygon.perPositionHeight=!1)),1!=c.extrudedHeightReference&&(a.polygon.extrudedHeight=c.extrudedHeight),a.polygon.show=c.show,a.polygon.fill=c.fill,a.polygon.material=c.material,a.polygon.outline=c.outline,a.polygon.outlineColor=c.outlineColor,a.polygon.outlineWidth=c.outlineWidth,a.polygon.stRotation=c.stRotation,a.polygon.granularity=c.granularity,a.polygon.distanceDisplayCondition=o,a.polygon.closeTop=c.closeTop,a.polygon.closeBottom=c.closeBottom,a.polygon.shadows=c.shadows,a.polygon.classificationType=c.classificationType;var s="material:"+255*c.material.red+","+255*c.material.green+","+255*c.material.blue+";outlineColor:"+255*c.outlineColor.red+","+255*c.outlineColor.green+","+255*c.outlineColor.blue;d.Legend.push(s),h&&(a.availability=h)}l.checked?d.isShow=!0:d.setVisibility(!1),"function"==typeof u&&u(e)}),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id);var a={id:c.id,name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t,style:c};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},t.prototype.createGeoJsonDataSource=function(e,t,i,r,o){var n=this._cesium.GeoJsonDataSource.load(t,i);this._viewer.dataSources.add(n);var a=this;return n.then(function(e){a.item=e,"function"==typeof o&&o(e)}),this._tree.insertGroupId({id:this._core.getuid(),name:e,pId:this._core.isnull(r)?0:r,type:"layer",item:this},this._core.isnull(r)?0:r),this},t.prototype.deleteObject=function(){this._viewer.dataSources.remove(this.item)},t.prototype.getLevel=function(){var e,t,i=this._viewer.camera;if(i&&i.positionCartographic&&i.positionCartographic.height){var r=this._viewer.scene.globe.getHeight(i.positionCartographic);!r&&(r=0),e=i.positionCartographic.height-r,t=Math.round(80955.31/(1+Math.pow(e/91610.74,7096758e-11))-40467.74)}else t=0;return t},t.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},t.prototype.setVisibility=function(e){this.isShow=e,null!=this.item&&(this.item.show=e)},t.prototype.getVisibility=function(){return this.item.show},t.prototype.getProperties=function(){var e=[];if(this.item.entities.values){var t=this.item.entities.values[0];if(t.properties)for(var i=0;i<t.properties.propertyNames.length;i++)e.push({value:"["+t.properties.propertyNames[i]+"]",label:t.properties.propertyNames[i]})}return e},t.prototype.getTypes=function(){if(this.item.entities.values){var e=this.item.entities.values[0];if(/^point.fid/.test(e._id)||null!=e.point)return[{label:"文本标签",value:"labelLayer"},{label:"图片标签",value:"billboardLayer"},{label:"点标签",value:"pointLayer"},{label:"模型",value:"modelLayer"},{label:"圆",value:"circleLayer"}];if(/^polygon.fid/.test(e._id)||null!=e.polygon)return[{label:"面",value:"polygonLayer"}];if(/^line.fid/.test(e._id)||null!=e.polyline)return[{label:"线",value:"polylineLayer"}]}},t.prototype.getType=function(){if(this.item.entities.values){var e=this.item.entities.values[0];return null!=e.label&&e.label.show?{label:"文本标签",value:"labelLayer"}:null!=e.model&&e.model.show?{label:"模型",value:"modelLayer"}:null!=e.billboard&&e.billboard.show?{label:"图片标签",value:"billboardLayer"}:null!=e.ellipse&&e.ellipse.show?{label:"圆",value:"circleLayer"}:/^polygon.fid/.test(e._id)||null!=e.polygon?{label:"面",value:"polygonLayer"}:/^line.fid/.test(e._id)||null!=e.polyline?{label:"线",value:"polylineLayer"}:null!=e.polylineVolume&&e.polylineVolume.show?{label:"扫掠体",value:"polylineVolume"}:null!=e.wall&&null!=e.wall?{label:"墙",value:"polylineWall"}:{label:"点标签",value:"pointLayer"}}},t.prototype.getLegend=function(){var e=[];return null!=this.Legend&&(e=this._core.unique(this.Legend)),e},t.prototype.getFirstDataSourceItem=function(){if(this.item.entities.values)return this.item.entities.values[0]},t.prototype.setTreeobj=function(e){this.treeobj=e},t.prototype.setItem=function(e){this.item=e},t.prototype.edit=function(e,u){var K=this,$=this._viewer;if(!u&&(u={}),this.editHandler&&(this.editHandler.destroy(),this.editHandler=void 0),void 0===e&&(e=!0),e){var Z,ee,te,ie;this.editHandler=new this._cesium.ScreenSpaceEventHandler($.scene.canvas),this.isEditting=!1;var re=void 0;this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))K.isEditting&&(oe(),K.defaultEvent(!1));else{var t=e.position,i=$.scene.pick(t);if(K._cesium.defined(i)&&i.id instanceof Cesium.Entity){var r=i.id;if(!K.isEditting&&K.item&&0==ne.states){if(-1===K.item.entities.values.indexOf(r))return;if(void 0===(Z=r).GeoType){var o=K.getEntityTypeAndObject(Z);Z.GeoType=o.type}ie=Z.GeoType,K.getSimpleGraphicData(ie,Z),"point"===ie||"billboard"===ie||"label"===ie||"model"===ie?(K.isEditting=!0,K.tooltip.showAt(e.position,"拖拽修改位置")):(K.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint())}else if(r==Z&&("point"===r.GeoType||"billboard"===r.GeoType||"label"===r.GeoType||"model"===r.GeoType)||"_height_point"==r.name||"_edit_point"==r.name||"_move_point"==r.name||"_add_point"==r.name||"_size_point"==r.name)$.container.style.cursor="crosshair",K.defaultEvent(!1),"_height_point"==r.name?(te={windowPosition:t,originHeight:K._cesium.Cartographic.fromCartesian(r.position.getValue()).height},re="_height_point"):"_move_point"==r.name?re="_move_point":"point"===r.GeoType||"billboard"===r.GeoType||"label"===r.GeoType||"model"===r.GeoType?(K.tooltip.showAt(e.position,"释放后完成修改"),re="_move_point","model"===r.GeoType&&(r.show=!1)):"_edit_point"==r.name?re="_edit_point":"_add_point"==r.name?re="_add_point":"_size_point"==r.name&&(re="_size_point"),ee=r;else{if(Z&&r.id===Z.id)return;oe()}}else oe()}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))K.isEditting&&(oe(),K.defaultEvent(!1));else{var t=$.scene.pick(e.endPosition);if(K._cesium.defined(t)){if(K.isEditting&&!ee)"point"!==ie&&"billboard"!==ie&&"label"!==ie&&"model"!==ie||t.id!=Z?t.id&&"_edit_point"===t.id.name&&Z.pottingPoint?"polyline"===ie&&2<Z.pottingPoint.length?K.tooltip.showAt(e.endPosition,"拖拽修改位置,右键删除点"):"polygon"===ie&&3<Z.pottingPoint.length?K.tooltip.showAt(e.endPosition,"拖拽修改位置,右键删除点"):K.tooltip.showAt(e.endPosition,"拖拽修改位置"):!t.id||"_move_point"!==t.id.name&&"_size_point"!==t.id.name?t.id&&"_add_point"===t.id.name?K.tooltip.showAt(e.endPosition,"拖拽增加节点"):t.id&&"_height_point"===t.id.name?K.tooltip.showAt(e.endPosition,"拖拽修改高度"):t.id==Z&&K.tooltip.show(!1):K.tooltip.showAt(e.endPosition,"拖拽修改位置"):K.tooltip.showAt(e.endPosition,"拖拽修改位置,右键删除");else if(!K.isEditting&&0===ne.states){var i=K.item.entities.values;t.id&&-1<i.indexOf(t.id)?K.tooltip.showAt(e.endPosition,"点击激活编辑,右键删除"):K.tooltip.show(!1)}}else 0!=ne.states||ee||K.tooltip.show(!1);if(K.isEditting&&ee){K.tooltip.showAt(e.endPosition,"释放后完成修改");var r=K._getPosition.getMousePosition(e);if(!r&&"_height_point"!==re)return;if("_edit_point"===re){ee.position=r;var o=ne.editPointID.edit.indexOf(ee.id);if(void 0!==Z[ie].height){var n=K.toDegrees(r);Z.pottingPoint[o]=Cesium.Cartesian3.fromDegrees(n.lon,n.lat,Z[ie].height.getValue()),ee.position=Z.pottingPoint[o]}else Z.pottingPoint[o]=r;if(0<ne.editPointID.height.length){var a=$.entities.getById(ne.editPointID.height[o]);if(a){var s=K.toDegrees(r),l=K._cesium.Cartographic.fromCartesian(a.position.getValue());a.position=K._cesium.Cartesian3.fromDegrees(s.lon,s.lat,l.height)}}if(0<ne.editPointID.add.length){if(0<o){var u=$.entities.getById(ne.editPointID.add[o-1]);if(u){var c=$.entities.getById(ne.editPointID.edit[o-1]),h=$.entities.getById(ne.editPointID.edit[o]);u.position=Cesium.Cartesian3.midpoint(c.position.getValue(),h.position.getValue(),new Cesium.Cartesian3)}}if(o<Z.pottingPoint.length-1){var d=$.entities.getById(ne.editPointID.add[o]);if(d){var m=$.entities.getById(ne.editPointID.edit[o]),p=$.entities.getById(ne.editPointID.edit[o+1]);d.position=Cesium.Cartesian3.midpoint(m.position.getValue(),p.position.getValue(),new Cesium.Cartesian3)}}if("polygon"===ie&&(0===o||o===Z.pottingPoint.length-1)){var g=$.entities.getById(ne.editPointID.add[ne.editPointID.add.length-1]);if(g){var f=$.entities.getById(ne.editPointID.edit[0]),v=$.entities.getById(ne.editPointID.edit[Z.pottingPoint.length-1]);g.position=Cesium.Cartesian3.midpoint(f.position.getValue(),v.position.getValue(),new Cesium.Cartesian3)}}}var _=Z.pottingPoint.concat([]),y=new K._cesium.Cartesian3,C=_.length;_.forEach(function(e){y.x+=e.x,y.y+=e.y,y.z+=e.z}),y.x/=C,y.y/=C,y.z/=C,ne.editPointID.move&&(ne.editPointID.move.position=y),"polyline"!==ie&&"polygon"!==ie&&"rectangle"!==ie||SmartEarthPopupData.editGraphic.setValue("positions",_)}else if("_height_point"===re){var w=ne.editPointID.height.indexOf(ee.id),b=$.entities.getById(ne.editPointID.edit[w]);"ellipse"!==ie&&"cylinder"!==ie&&"box"!==ie||(b=ne.editPointID.move);var E=K.toDegrees(b.position.getValue()),S=te.originHeight-E.height,P=$.scene.cartesianToCanvasCoordinates(b.position.getValue()),x=(te.windowPosition.y-e.endPosition.y)*S/Math.abs(P.y-te.windowPosition.y),T=Math.abs(S+x);ne.editPointID.height.forEach(function(e){var t=$.entities.getById(e);if(t){var i=t.position.getValue(),r=K.toDegrees(i);t.position=K._cesium.Cartesian3.fromDegrees(r.lon,r.lat,T+E.height)}}),Z[ie].extrudedHeight?Z[ie].extrudedHeight=T+E.height:"box"===ie?SmartEarthPopupData.editGraphic.setValue("height",T):"cylinder"===ie&&SmartEarthPopupData.editGraphic.setValue("length",T)}else if("_add_point"===re){var I=ne.editPointID.add.indexOf(ee.id);$.entities.remove(ee);var D=$.entities.add({name:"_edit_point",position:r,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(ne.editPointID.edit.splice(I+1,0,D.id),Z.pottingPoint.splice(I+1,0,r.clone()),0<ne.editPointID.height.length){var L=K.toDegrees(r);L.height=Z[ie].extrudedHeight.getValue();var M=$.entities.add({name:"_height_point",position:K._cesium.Cartesian3.fromDegrees(L.lon,L.lat,L.height),point:{color:K._cesium.Color.YELLOW,pixelSize:12,outlineColor:K._cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});ne.editPointID.height.splice(I+1,0,M.id)}var A=Cesium.Cartesian3.midpoint(Z.pottingPoint[I],Z.pottingPoint[I+1],new Cesium.Cartesian3),R=$.entities.add({name:"_add_point",position:A,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),O=Cesium.Cartesian3.midpoint(Z.pottingPoint[I+1],Z.pottingPoint[I+2===Z.pottingPoint.length?0:I+2],new Cesium.Cartesian3),N=$.entities.add({name:"_add_point",position:O,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});ne.editPointID.add.splice(I,1,R.id,N.id),ee=D,re="_edit_point";var V=Z.pottingPoint.concat([]);"polyline"!==ie&&"polygon"!==ie||SmartEarthPopupData.editGraphic.setValue("positions",V)}else if("_size_point"===re){var F=ne.editPointID.move.position.getValue(),H=K._cesium.Cartesian3.distance(F,r);if("ellipse"===ie||"cylinder"===ie||"ellipsoid"===ie&&Z.isSphere)SmartEarthPopupData.editGraphic.setValue("radius",H);else if("box"===ie){var G=90===ee.angle?"long":"width";SmartEarthPopupData.editGraphic.setValue(G,2*H)}}else{if("point"===ie||"billboard"===ie||"label"===ie||"model"===ie)return void(ee.position=r);var k=K.toDegrees(r);te=ee.position.getValue();var B=K.toDegrees(te),j=k.lon-B.lon,z=k.lat-B.lat,W=k.height-B.height;if(ee.position=r,Z[ie].height){var U=K.toDegrees(r).height;Z[ie].height=U,Z.thisHeight=U}Z.pottingPoint.forEach(function(e,t){var i,r=void 0,o=void 0,n=$.entities.getById(ne.editPointID.edit[t]);if(n||(n=$.entities.getById(ne.editPointID.size[t])),r=n?K.toDegrees(n.position.getValue()):K.toDegrees(e),i=K._cesium.Cartesian3.fromDegrees(r.lon+j,r.lat+z,r.height+W),e.x=i.x,e.y=i.y,e.z=i.z,n&&(n.position=i),0<ne.editPointID.height.length){var a=$.entities.getById(ne.editPointID.height[t]);a&&(r=a.position.getValue(),o=K._cesium.Cartographic.fromCartesian(r),r={lon:K._cesium.Math.toDegrees(o.longitude),lat:K._cesium.Math.toDegrees(o.latitude),height:o.height},a.position=K._cesium.Cartesian3.fromDegrees(r.lon+j,r.lat+z,r.height+W))}if(0<ne.editPointID.add.length&&ne.editPointID.add[t]){var s=$.entities.getById(ne.editPointID.add[t]);s&&(r=K.toDegrees(s.position.getValue()),s.position=K._cesium.Cartesian3.fromDegrees(r.lon+j,r.lat+z,r.height+W))}});var q=Z.pottingPoint.concat([]);if("polyline"===ie||"polygon"===ie||"rectangle"===ie)SmartEarthPopupData.editGraphic.setValue("positions",q),0<ne.editPointID.height.length&&SmartEarthPopupData.editGraphic.setValue("extrudedHeight",SmartEarthPopupData.editGraphic.getValue("extrudedHeight")+W);else if("ellipse"===ie)Z.pottingPoint[1]=r,Z.position=r.clone();else if("box"===ie){Z.pottingPoint[2]=r;var Y=Z.box.dimensions.getValue(),X=K.toDegrees(r);Z.position=Cesium.Cartesian3.fromDegrees(X.lon,X.lat,X.height+Y.z/2)}else if("cylinder"===ie){Z.pottingPoint[1]=r;var J=Z.cylinder.length.getValue(),Q=K.toDegrees(Z.pottingPoint[1]);Z.position=Cesium.Cartesian3.fromDegrees(Q.lon,Q.lat,Q.height+J/2)}else"ellipsoid"===ie&&(Z.pottingPoint[Z.pottingPoint.length-1]=r,Z.position=r.clone())}}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.editHandler.setInputAction(function(e){Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?K.isEditting&&(oe(),K.defaultEvent(!1)):(ee&&"model"===ee.GeoType&&(ee.show=!0),ee&&u.callBack&&u.callBack.updata&&u.callBack.updata(ee.name,Z),$.container.style.cursor="default",ee=void 0,K.defaultEvent(!0))},this._cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))K.isEditting&&(oe(),K.defaultEvent(!1));else{var t=$.scene.pick(e.position);if(K._cesium.defined(t)&&0==ne.states){var i=t.id;if(-1<K.item.entities.values.indexOf(i))K.tooltip.show(!1),K.delButton(!0,e.position,function(){i.treeobj&&ne.delete(i.treeobj.id,$,K._cesium),i.entityCollection.remove(i),K.delButton(!1),K.tooltip.show(!1),oe(),u.callBack&&u.callBack.delete&&u.callBack.delete(i)});else if(-1<ne.editPointID.edit.indexOf(i.id)&&("polyline"===ie&&2<ne.editPointID.edit.length||"polygon"===ie&&3<ne.editPointID.edit.length)){var r=ne.editPointID.edit.indexOf(i.id);if($.entities.removeById(i.id),ne.editPointID.edit.splice(r,1),0<ne.editPointID.height.length&&($.entities.removeById(ne.editPointID.height[r]),ne.editPointID.height.splice(r,1)),Z.pottingPoint.splice(r,1),0<ne.editPointID.add.length)if(ne.editPointID.add[r]){if($.entities.removeById(ne.editPointID.add[r]),ne.editPointID.add.splice(r,1),0<=r-1){var o=$.entities.getById(ne.editPointID.add[r-1]);o&&(o.position=Cesium.Cartesian3.midpoint(Z.pottingPoint[r-1],Z.pottingPoint[r===Z.pottingPoint.length?0:r],new Cesium.Cartesian3))}else if(r-1==-1&&"polygon"===ie){var n=$.entities.getById(ne.editPointID.add[ne.editPointID.add.length-1]);n&&(n.position=Cesium.Cartesian3.midpoint(Z.pottingPoint[0],Z.pottingPoint[Z.pottingPoint.length-1],new Cesium.Cartesian3))}}else $.entities.removeById(ne.editPointID.add[r-1]),ne.editPointID.add.pop();var a=new K._cesium.Cartesian3,s=Z.pottingPoint.length;Z.pottingPoint.forEach(function(e){a.x+=e.x,a.y+=e.y,a.z+=e.z}),a.x/=s,a.y/=s,a.z/=s,ne.editPointID.move&&(ne.editPointID.move.position=a);var l=Z.pottingPoint.concat([]);"polyline"!==ie&&"polygon"!==ie||SmartEarthPopupData.editGraphic.setValue("positions",l),K.tooltip.show(!1),u.callBack&&u.callBack.updata&&u.callBack.updata(ee&&ee.name,Z)}}}},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),oe()}else oe();function oe(){K.defaultEvent(!0),ne.editPointID.edit.forEach(function(e){$.entities.removeById(e)}),ne.editPointID.edit=[],ne.editPointID.height.forEach(function(e){$.entities.removeById(e)}),ne.editPointID.height=[],ne.editPointID.add.forEach(function(e){$.entities.removeById(e)}),ne.editPointID.add=[],ne.editPointID.size.forEach(function(e){$.entities.removeById(e)}),ne.editPointID.size=[],ne.editPointID.move&&$.entities.remove(ne.editPointID.move),ne.editPointID.move=void 0,ie=Z=void 0,SmartEarthPopupData.editGraphic={},K.isEditting=!1,K.delButton(!1)}},t.prototype.delButton=function(e,t,i){if(e){var r=document.getElementById("DeleteMilitaryStandardDelete");r||((r=document.createElement("button")).id="DeleteMilitaryStandardDelete",r.innerText="删除对象",r.style.cssText="height: 38px;\n line-height: 38px;\n padding: 0 18px;\n background-color: #052355;\n color: #fff;\n white-space: nowrap;\n text-align: center;\n font-size: 14px;\n border: none;\n border-radius: 2px;\n cursor: pointer;\n position: absolute;",this._viewer.container.appendChild(r)),r.style.display="block",r.style.top=t.y+"px",r.style.left=t.x+"px",r.onclick=i}else{var o=document.getElementById("DeleteMilitaryStandardDelete");o&&(o.style.display="none",o.onclick=null)}},t.prototype.defaultEvent=function(e){var t=this._viewer.scene;t.screenSpaceCameraController.enableRotate=e,t.screenSpaceCameraController.enableTranslate=e,t.screenSpaceCameraController.enableZoom=e,t.screenSpaceCameraController.enableTilt=e,t.screenSpaceCameraController.enableLook=e},t.prototype.getEntityTypeAndObject=function(e){var t={type:"",object:null};return e&&(e.billboard?(t.type="billboard",t.object=e.billboard):e.box?(t.type="box",t.object=e.box):e.corridor?(t.type="corridor",t.object=e.corridor):e.cylinder?(t.type="cylinder",t.object=e.cylinder):e.ellipse?(t.type="ellipse",t.object=e.ellipse):e.ellipsoid?(t.type="ellipsoid",t.object=e.ellipsoid):e.label?(t.type="label",t.object=e.label):e.model?(t.type="model",t.object=e.model):e.path?(t.type="path",t.object=e.path):e.plane?(t.type="plane",t.object=e.plane):e.point?(t.type="point",t.object=e.point):e.polygon?(t.type="polygon",t.object=e.polygon):e.polyline?(t.type="polyline",t.object=e.polyline):e.polylineVolume?(t.type="polylineVolume",t.object=e.polylineVolume):e.rectangle?(t.type="rectangle",t.object=e.rectangle):e.wall&&(t.type="wall",t.object=e.wall)),t},t.prototype.toDegrees=function(e){var t=this._cesium.Cartographic.fromCartesian(e);return{lon:this._cesium.Math.toDegrees(t.longitude),lat:this._cesium.Math.toDegrees(t.latitude),height:t.height}},t.prototype.getSimpleGraphicData=function(s,c){var e,h=this,d=this._viewer;if(SmartEarthPopupData.editGraphic={entity:c,type:s,graphic:c[s],getValue:function(e){return"position"===e||"name"===e||"id"===e?this.entity[e]&&(this.entity[e].getValue?this.entity[e].getValue():this.entity[e]):"radius"!==e?"repeat"===e?this.graphic.material[e]&&(this.graphic.material[e].getValue?this.graphic.material[e].getValue():this.graphic.material[e]):this.graphic[e]&&(this.graphic[e].getValue?this.graphic[e].getValue():this.graphic[e]):"ellipse"===this.type?this.graphic.semiMajorAxis.getValue():"ellipsoid"===this.type?this.graphic.radii.getValue().x:"cylinder"===this.type?this.graphic.bottomRadius.getValue():void 0},changeHeightPoint:function(o){0<ne.editPointID.height.length&&ne.editPointID.height.forEach(function(e){var t=d.entities.getById(e);if(t){var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}})},changeEditPoint:function(o){0<ne.editPointID.edit.length&&ne.editPointID.edit.forEach(function(e){var t=d.entities.getById(e);if(t)if("clampToGround"===o)t.point.heightReference=1;else{t.point.heightReference=0;var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}}),0<ne.editPointID.size.length&&ne.editPointID.size.forEach(function(e){var t=d.entities.getById(e);if(t)if("clampToGround"===o)t.point.heightReference=1;else{t.point.heightReference=0;var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}}),0<ne.editPointID.add.length&&ne.editPointID.add.forEach(function(e){var t=d.entities.getById(e);if(t)if("clampToGround"===o)t.point.heightReference=1;else{t.point.heightReference=0;var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}});var e=ne.editPointID.move;if(e)if("clampToGround"===o)e.point.heightReference=1;else{e.point.heightReference=0;var t=e.position.getValue(),i=h.toDegrees(t);e.position=Cesium.Cartesian3.fromDegrees(i.lon,i.lat,o)}},clearAllEditPoint:function(){ne.editPointID.edit.forEach(function(e){d.entities.removeById(e)}),ne.editPointID.edit=[],ne.editPointID.height.forEach(function(e){d.entities.removeById(e)}),ne.editPointID.height=[],ne.editPointID.add.forEach(function(e){d.entities.removeById(e)}),ne.editPointID.add=[],ne.editPointID.size.forEach(function(e){d.entities.removeById(e)}),ne.editPointID.size=[],ne.editPointID.move&&d.entities.remove(ne.editPointID.move),ne.editPointID.move=void 0}},"billboard"===s||"point"===s||"label"===s||"model"===s){var t=SmartEarthPopupData.editGraphic.getValue("color")||SmartEarthPopupData.editGraphic.getValue("fillColor");t?v(t):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var i=SmartEarthPopupData.editGraphic.getValue("outlineColor");if(i?_(i):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),"label"===s){var r=SmartEarthPopupData.editGraphic.getValue("backgroundColor");r?(e=r,SmartEarthPopupData.editGraphic.backgroundColor=y("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.backgroundAlpha=100*e.alpha):(SmartEarthPopupData.editGraphic.backgroundColor="#000000",SmartEarthPopupData.editGraphic.backgroundAlpha=80)}SmartEarthPopupData.editGraphic.setValue=function(e,t){if("position"===e||"name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e||"backgroundColor"===e||"fillColor"===e)t=Cesium.Color.fromCssColorString(t);else if("fontSize"===e){var i=this.getValue("font");(i=i.split(" "))[0]=t,t=i.join(" ")}else{if("alpha"===e)return void("label"===this.type?this.graphic.fillColor._value.alpha=t:this.graphic.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("backgroundAlpha"===e)return void(this.graphic.backgroundColor._value.alpha=t)}this.graphic[e]=t}}}else if("polyline"===s){var o=SmartEarthPopupData.editGraphic.getValue("material");o.color?v(o.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),o.outlineColor?_(o.outlineColor):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e)return t=Cesium.Color.fromCssColorString(t),void(this.graphic.material[e]=t);if("outlineWidth"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.material.outlineColor._value.alpha=t);if("positions"===e)return void(this.graphic[e]=t);this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("positions");return this.entity.pottingPoint=e},SmartEarthPopupData.editGraphic.updataEditPoint=function(){var s=this;this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var l=new Cesium.Cartesian3;e.forEach(function(e,t){var i=d.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:s.graphic.heightReference&&s.graphic.heightReference.getValue()}});if(ne.editPointID.edit.push(i.id),void 0!==s.getValue("extrudedHeight")){var r=Cesium.Cartographic.fromCartesian(e),o={lon:Cesium.Math.toDegrees(r.longitude),lat:Cesium.Math.toDegrees(r.latitude),height:s.getValue("extrudedHeight")};if(s.getValue("height")){var n=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,s.getValue("height"));e.x=n.x,e.y=n.y,e.z=n.z,i.position=n,s.entity.pottingPoint[t]=n.clone()}var a=d.entities.add({name:"_height_point",position:Cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});ne.editPointID.height.push(a.id)}l.x+=e.x,l.y+=e.y,l.z+=e.z}),l.x/=e.length,l.y/=e.length,l.z/=e.length,ne.editPointID.move=d.entities.add({name:"_move_point",position:l,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(var t=0;t<e.length-1;t++){var i=Cesium.Cartesian3.midpoint(e[t],e[t+1],new Cesium.Cartesian3),r=d.entities.add({name:"_add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});ne.editPointID.add.push(r.id)}}}}else if("polygon"===s){var n=SmartEarthPopupData.editGraphic.getValue("material");n.color?v(n.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var a=SmartEarthPopupData.editGraphic.getValue("outlineColor");a?_(a):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,i){var t=this;if("name"===e)this.entity[e]=i;else{if("color"===e||"outlineColor"===e){if(i=Cesium.Color.fromCssColorString(i),"color"===e)return void(this.graphic.material.color=i)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=i);if("alpha"===e)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=i);if("positions"===e)return this.graphic.hierarchy=new Cesium.PolygonHierarchy(i),void setTimeout(function(){t.entity.entityCollection.show=!1,t.entity.entityCollection.show=!0},100);if("hierarchy"===e)return void(this.graphic.hierarchy=i);if("clampToGround"===e){var r=function(e,t,i){i?(e.perPositionHeight=!1,e.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(e.perPositionHeight=!0,e.heightReference=Cesium.HeightReference.NONE),0<ne.editPointID.edit.length&&!i&&t.forEach(function(e,t){var i=d.entities.getById(ne.editPointID.edit[t]);if(i){var r=i.position.getValue();e.x=r.x,e.y=r.y,e.z=r.z}}),e.hierarchy=new Cesium.PolygonHierarchy(t)};return this.graphic.hierarchy instanceof Cesium.CallbackProperty?(this.graphic.hierarchy=this.graphic.hierarchy.getValue(),setTimeout(function(){r(t.graphic,t.entity.pottingPoint,i)},100)):r(this.graphic,this.entity.pottingPoint,i),void(0<ne.editPointID.add.length&&ne.editPointID.add.forEach(function(e){var t=d.entities.getById(e);t&&(t.point.heightReference=i?1:0)}))}"extrudedHeight"===e?this.changeHeightPoint(i):"height"===e&&this.changeEditPoint(i)}this.graphic[e]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("hierarchy").positions.concat([]);if(void 0!==this.getValue("height")){var r=this.getValue("height");e.forEach(function(e){var t=h.toDegrees(e),i=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,r);e.x=i.x,e.y=i.y,e.z=i.z})}return this.entity.pottingPoint=e},SmartEarthPopupData.editGraphic.updataEditPoint=function(){var s=this;this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var l=new Cesium.Cartesian3;e.forEach(function(e,t){var i=d.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:s.graphic.heightReference&&s.graphic.heightReference.getValue()}});if(ne.editPointID.edit.push(i.id),void 0!==s.getValue("extrudedHeight")){var r=Cesium.Cartographic.fromCartesian(e),o={lon:Cesium.Math.toDegrees(r.longitude),lat:Cesium.Math.toDegrees(r.latitude),height:s.getValue("extrudedHeight")};if(s.getValue("height")){var n=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,s.getValue("height"));e.x=n.x,e.y=n.y,e.z=n.z,i.position=n,s.entity.pottingPoint[t]=n.clone()}var a=d.entities.add({name:"_height_point",position:Cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});ne.editPointID.height.push(a.id)}l.x+=e.x,l.y+=e.y,l.z+=e.z}),l.x/=e.length,l.y/=e.length,l.z/=e.length,ne.editPointID.move=d.entities.add({name:"_move_point",position:l,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(var t=0;t<e.length-1;t++){var i=Cesium.Cartesian3.midpoint(e[t],e[t+1],new Cesium.Cartesian3),r=d.entities.add({name:"_add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});ne.editPointID.add.push(r.id)}var o=Cesium.Cartesian3.midpoint(e[0],e[e.length-1],new Cesium.Cartesian3),n=d.entities.add({name:"_add_point",position:o,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});ne.editPointID.add.push(n.id)}}}else if("ellipse"===s||"cylinder"===s||c.isSphere){var l=SmartEarthPopupData.editGraphic.getValue("material");l.color?v(l.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var u=SmartEarthPopupData.editGraphic.getValue("outlineColor");u?_(u):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){var i=this;if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("semiMajorAxis"===e)return void(this.graphic.semiMajorAxis=t);if("semiMinorAxis"===e)return void(this.graphic.semiMinorAxis=t);if("radii"===e)return void(this.graphic.radii=t);if("topRadius"===e)return void(this.graphic.topRadius=t);if("bottomRadius"===e)return void(this.graphic.bottomRadius=t);if("radius"===e){"ellipse"===this.type?(this.graphic.semiMajorAxis=t,this.graphic.semiMinorAxis=t):"ellipsoid"===this.type?(this.graphic.material.image.getValue(),this.graphic.radii=new Cesium.Cartesian3(t,t,t)):"cylinder"===this.type&&(this.graphic.bottomRadius=t,this.entity.changeTop&&(this.graphic.topRadius=t));var r=ne.editPointID.move.position.getValue(),o=h.GetPositionFromA_D(r,t,90);d.entities.getById(ne.editPointID.size[0]).position=o,c.pottingPoint[0]=o,c.pottingPoint[c.pottingPoint.length-1]=r;var n=d.entities.getById(ne.editPointID.height[0]);if(n){var a=h.toDegrees(o),s=h._cesium.Cartographic.fromCartesian(n.position.getValue());n.position=h._cesium.Cartesian3.fromDegrees(a.lon,a.lat,s.height)}return}if("cylinder"===this.type&&"length"===e){this.graphic.length=t;var l=h.toDegrees(this.entity.pottingPoint[1]);return this.entity.position=Cesium.Cartesian3.fromDegrees(l.lon,l.lat,l.height+t/2),void this.changeHeightPoint(l.height+t)}if("ellipse"===this.type&&"clampToGround"===e){var u=function(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);var r=t.semiMinorAxis.getValue();t.semiMinorAxis=r,t.semiMajorAxis=r};return this.graphic.semiMinorAxis instanceof Cesium.CallbackProperty?(this.graphic.semiMinorAxis=this.graphic.semiMinorAxis.getValue(),this.graphic.semiMajorAxis=this.graphic.semiMajorAxis.getValue(),setTimeout(function(){u(i.entity,i.graphic,t)},100)):u(this.entity,this.graphic,t),void(t?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight))}"ellipse"===this.type&&"extrudedHeight"===e?this.changeHeightPoint(t):"ellipse"===this.type&&"height"===e&&(this.changeEditPoint(t),this.entity.thisHeight=t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("radius"),t=this.getValue("position");if("ellipse"===this.type||this.entity.isSphere){if("ellipse"===this.type&&void 0!==this.getValue("height")){var i=this.getValue("height"),r=h.toDegrees(t);t=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,i)}var o=h.GetPositionFromA_D(t,e,90);return this.entity.pottingPoint=[o,t],[o,t]}var n=h.toDegrees(t);t=Cesium.Cartesian3.fromDegrees(n.lon,n.lat,n.height-this.getValue("length")/2);var a=h.GetPositionFromA_D(t,e,90);return this.entity.pottingPoint=[a,t],[a,t]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var t=d.entities.add({name:"_size_point",position:e[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});if(t.angle=90,ne.editPointID.size.push(t.id),void 0!==this.getValue("extrudedHeight")){var i=h.toDegrees(e[1]);i.height=this.getValue("extrudedHeight");var r=d.entities.add({name:"_height_point",position:Cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});ne.editPointID.height.push(r.id)}else if("cylinder"===s){var o=h.toDegrees(e[1]),n=this.getValue("length"),a=d.entities.add({name:"_height_point",position:Cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height+n),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});ne.editPointID.height.push(void 0,a.id)}ne.editPointID.move=d.entities.add({name:"_move_point",position:e[1],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}}else if("rectangle"===s){var m=SmartEarthPopupData.editGraphic.getValue("material");m.color?v(m.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var p=SmartEarthPopupData.editGraphic.getValue("outlineColor");p?_(p):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){var i=this;if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("positions"===e)return void(this.graphic.coordinates=Cesium.Rectangle.fromCartesianArray(t));if("coordinates"===e)return void(this.graphic.coordinates=t);if("clampToGround"===e){var r=function(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);var r=t.coordinates.getValue();t.coordinates=r};return this.graphic.coordinates instanceof Cesium.CallbackProperty?(this.graphic.coordinates=this.graphic.coordinates.getValue(),setTimeout(function(){r(i.entity,i.graphic,t)},100)):r(this.entity,this.graphic,t),void(t?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight))}"extrudedHeight"===e?this.changeHeightPoint(t):"height"===e&&(this.changeEditPoint(t),this.entity.thisHeight=t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("coordinates"),t=void 0,i=void 0,r=this.getValue("height");return i=(void 0!==r?t=Cesium.Cartesian3.fromRadians(e.west,e.north,r):(r=d.scene.sampleHeight(new Cesium.Cartographic(e.west,e.north,0),[this.entity]),t=Cesium.Cartesian3.fromRadians(e.west,e.north,r),r=d.scene.sampleHeight(new Cesium.Cartographic(e.east,e.south,0),[this.entity])),Cesium.Cartesian3.fromRadians(e.east,e.south,r)),this.entity.pottingPoint=[t,i],[t,i]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){var s=this;this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var l=new Cesium.Cartesian3;e.forEach(function(e,t){var i=d.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:s.graphic.heightReference&&s.graphic.heightReference.getValue()}});if(ne.editPointID.edit.push(i.id),void 0!==s.getValue("extrudedHeight")){var r=Cesium.Cartographic.fromCartesian(e),o={lon:Cesium.Math.toDegrees(r.longitude),lat:Cesium.Math.toDegrees(r.latitude),height:s.getValue("extrudedHeight")};if(s.getValue("height")){var n=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,s.getValue("height"));e.x=n.x,e.y=n.y,e.z=n.z,i.position=n,s.entity.pottingPoint[t]=n.clone()}var a=d.entities.add({name:"_height_point",position:Cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});ne.editPointID.height.push(a.id)}l.x+=e.x,l.y+=e.y,l.z+=e.z}),l.x/=e.length,l.y/=e.length,l.z/=e.length,ne.editPointID.move=d.entities.add({name:"_move_point",position:l,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}}else if("box"===s){var g=SmartEarthPopupData.editGraphic.getValue("material");g.color?v(g.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var f=SmartEarthPopupData.editGraphic.getValue("outlineColor");f?_(f):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("long"===e||"width"===e||"height"===e){var i=this.getValue("dimensions");if("long"===e?i.x=t:"width"===e?i.y=t:i.z=t,this.graphic.dimensions=i,"long"===e||"width"===e){var r="long"===e?90:180,o="long"===e?0:1,n=ne.editPointID.move.position.getValue(),a=h.GetPositionFromA_D(n,t/2,r);d.entities.getById(ne.editPointID.size[o]).position=a,this.entity.pottingPoint[o]=a,this.entity.pottingPoint[this.entity.pottingPoint.length-1]=n}else{var s=h.toDegrees(ne.editPointID.move.position.getValue());this.entity.position=Cesium.Cartesian3.fromDegrees(s.lon,s.lat,s.height+t/2),this.changeHeightPoint(s.height+t)}return}if("dimensions"===e)return void(this.graphic.dimensions=t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("dimensions"),t=this.getValue("position"),i=h.toDegrees(t);t=Cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height-e.z/2);var r=h.GetPositionFromA_D(t,e.x/2,90),o=h.GetPositionFromA_D(t,e.y/2,180);return this.entity.pottingPoint=[r,o,t],[r,o,t]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var t=d.entities.add({name:"_size_point",position:e[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});t.angle=90;var i=d.entities.add({name:"_size_point",position:e[1],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});i.angle=180,ne.editPointID.size.push(t.id),ne.editPointID.size.push(i.id);var r=h.toDegrees(e[2]),o=this.getValue("dimensions"),n=d.entities.add({name:"_height_point",position:Cesium.Cartesian3.fromDegrees(r.lon,r.lat,r.height+o.z),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});ne.editPointID.height.push(void 0,void 0,n.id),ne.editPointID.move=d.entities.add({name:"_move_point",position:e[2],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}}else"corridor"===s||"ellipsoid"===s&&c.isSphere;function v(e){SmartEarthPopupData.editGraphic.fillColor=y("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.alpha=100*e.alpha}function _(e){SmartEarthPopupData.editGraphic.outlineColor=y("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.outlineAlpha=100*e.alpha}function y(e){var t=e;if(/^(rgb|RGB)/.test(t)){for(var i=t.replace(/(rgb|RGB)*/g,""),r=(i=i.replace("(","").replace(")","")).split(","),o="#",n=0;n<r.length;n++){var a=Number(r[n]).toString(16);"0"===(a=1===a.length?"0"+a:a)&&(a+=a),o+=a}return 7!==o.length&&(o=t),o}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t))return t;var s=t.replace(/#/,"").split("");if(6===s.length)return t;if(3===s.length){var l="#";for(n=0;n<s.length;n+=1)l+=s[n]+s[n];return l}}},Object.defineProperties(t.prototype,{labelText:{set:e.debounce(function(e){var t=e;if(!this._core.isnull(e)){var i=this.item.entities.values;if(i&&0<i.length)for(var r=0;r<i.length;r++)if(/^\[/.test(e)&&(t=e.replace(/\[/,"").replace(/\]/,""),t=i[r].properties[t]._value),i[r].label){i[r].label.text=t;try{i[r].point.show=!1}catch(e){}}else{try{i[r].point.show=!1}catch(e){}i[r].label=new this._cesium.LabelGraphics({text:t,font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})}}},500)},labelStyles:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.style=e}},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?e[0].label.style:void 0}},labelFont:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if(e=e.toString().replace(/px/g,""),!t||/^point.fid/.test(t[0]._id)||null!=t[0].label){var i=t[0].label.font,r=16;if(i&&(r=(i=i._value.trimLeft().trimRight()).split("px")[0]),t&&0<t.length&&t[0].label)for(var o=0;o<t.length;o++)t[o].label.font=r+"px "+e}}},500)},labelFontSize1:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if(e=e.toString().replace(/px/g,""),!t||/^point.fid/.test(t[0]._id)||null!=t[0].label){var i=t[0].label.font,r="sans-serif";if(i&&(r=(i=i._value.trimLeft().trimRight()).split("px")[1]),t&&0<t.length&&t[0].label)for(var o=0;o<t.length;o++)t[o].label.font=e+"px "+r}}},500)},labelFontSize:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if(e=e.toString().replace(/px/g,""),(!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.font=e+"px sans-serif"}},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?parseFloat(e[0].label.font):void 0}},labelFillColor:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.fillColor=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.fillColor;return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}}},labelOutlineColor:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.outlineColor=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.outlineColor;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},labelOutlineWidth:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].label.outlineWidth=e}},200),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.outlineWidth;return t?t._value:void 0}}},labelBackgroundColor:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.backgroundColor=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.backgroundColor;return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}}},labelBackground:{set:e.debounce(function(e){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.showBackground=e},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?e[0].label.background:void 0}},labelScale:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].label.scale=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.scale;return t?t._value:void 0}}},labelHorizontalOrigin:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.horizontalOrigin=parseInt(e)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.horizontalOrigin;return t?t._value:void 0}}},labelVerticalOrigin:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.verticalOrigin=parseInt(e)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.verticalOrigin;return t?t._value:void 0}}},labelHeightReference:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.heightReference=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.heightReference;return t?t._value:void 0}}},labelDistanceDisplayMaxCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=t[0].label.distanceDisplayCondition?t[0].label.distanceDisplayCondition._value.near:0,r=0;r<t.length;r++)t[r].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,parseInt(e)),t[r].label.scaleByDistance=new this._cesium.NearFarScalar(i,1,parseInt(e),0)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&(e&&0<e.length&&e[0].label))return e[0].label.distanceDisplayCondition?e[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE}},labelDistanceDisplayMinCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=t[0].label.distanceDisplayCondition?t[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE,r=0;r<t.length;r++)t[r].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(parseInt(e),i),t[r].label.scaleByDistance=new this._cesium.NearFarScalar(parseInt(e),1,i,0)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&(e&&0<e.length&&e[0].label))return e[0].label.distanceDisplayCondition?e[0].label.distanceDisplayCondition._value.near:0}},labelHeight:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var r=this._cesium.Cartographic.fromCartesian(t[i].position._value),o=this._cesium.Math.toDegrees(r.longitude),n=this._cesium.Math.toDegrees(r.latitude),a=this._cesium.Cartesian3.fromDegrees(o,n,e);t[i].position=a}}},500),get:function(){return 0}},labelShow:{set:e.debounce(function(e){var t=this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].label&&e?(t[i].point&&(t[i].point.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e),t[i].label=new this._cesium.LabelGraphics({text:"label",font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})):(t[i].label&&(t[i].label.show=e),t[i].point&&(t[i].point.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?e[0].label.show:void 0}},pointColor:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.color=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){var t=e[0].point.color;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},pointShow:{set:e.debounce(function(e){var t=this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].point&&e?(t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e),t[i].point=new this._cesium.PointGraphics({color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0})):(t[i].point&&(t[i].point.show=e),t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)return e&&0<e.length&&e[0].point?e[0].point.show:void 0}},pointPixelSize:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].point.pixelSize=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){var t=e[0].point.pixelSize;return t?t._value:void 0}}},pointOutlineColor:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.outlineColor=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){var t=e[0].point.outlineColor;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},pointOutlineWidth:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].point.outlineWidth=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){var t=e[0].point.outlineWidth;return t?t._value:void 0}}},pointHeightReference:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.heightReference=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){var t=e[0].point.heightReference;return t?t._value:void 0}}},pointDistanceDisplayMaxCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=t[0].point.distanceDisplayCondition?t[0].point.distanceDisplayCondition._value.near:0,r=0;r<t.length;r++)t[r].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e),t[r].point.scaleByDistance=new this._cesium.NearFarScalar(i,1,e,0)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&(e&&0<e.length&&e[0].point))return e[0].point.distanceDisplayCondition?e[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE}},pointDistanceDisplayMinCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=t[0].point.distanceDisplayCondition?t[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE,r=0;r<t.length;r++)t[r].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i),t[r].point.scaleByDistance=new this._cesium.NearFarScalar(e,1,i,0)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&(e&&0<e.length&&e[0].point))return e[0].point.distanceDisplayCondition?e[0].point.distanceDisplayCondition._value.near:0}},pointHeight:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var r=this._cesium.Cartographic.fromCartesian(t[i].position._value),o=this._cesium.Math.toDegrees(r.longitude),n=this._cesium.Math.toDegrees(r.latitude),a=this._cesium.Cartesian3.fromDegrees(o,n,e);t[i].position=a}}},500),get:function(){return 0}},modelShow:{set:e.debounce(function(e){var t=this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)t[i].label&&(t[i].label.show=!e),t[i].point&&(t[i].point.show=!e),t[i].billboard&&(t[i].billboard.show=!e),!t[i].model&&e?t[i].model=new this._cesium.ModelGraphics({show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE}):(t[i].model&&(t[i].model.show=e),t[i].label&&(t[i].label.show=!e),t[i].point&&(t[i].point.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)return e&&0<e.length&&e[0].model?e[0].model.show:void 0}},modelUri:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length)for(var i=0;i<t.length;i++)if(t[i].model)t[i].model.uri=e;else{if(/^\[/.test(e)){var r=e.split("[");e=1<r.length?r[0]+r[1].replace(/\[/,"").replace(/\]/,""):(e=e.replace(/\[/,"").replace(/\]/,""),t[i].properties[e])}t[i].model=new this._cesium.ModelGraphics({uri:e,show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE})}}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){var t=e[0].model.uri;return t?t._value:void 0}}},modelScale:{set:e.debounce(function(e){if(!this._core.isnull(e)){e=parseFloat(e);var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].model.scale=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){var t=e[0].model.scale;return t?t._value:void 0}}},modelShadows:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.shadows=e}},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)return e&&0<e.length&&e[0].model?e[0].model.shadows:void 0}},modelHeightReference:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.heightReference=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){var t=e[0].model.heightReference;return t?t._value:void 0}}},modelDistanceDisplayMaxCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=t[0].model.distanceDisplayCondition?t[0].model.distanceDisplayCondition._value.near:0,r=0;r<t.length;r++)t[r].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model)e[0].model.distanceDisplayCondition?e[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE}},modelDistanceDisplayMinCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=t[0].model.distanceDisplayCondition?t[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE,r=0;r<t.length;r++)t[r].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&(e&&0<e.length&&e[0].model))return e[0].model.distanceDisplayCondition?e[0].model.distanceDisplayCondition._value.near:0}},modelColor:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.color=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){var t=e[0].model.color;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},modelLightColor:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.lightColor=e}},100),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){var t=e[0].model.lightColor;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},modelHeight:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var r=this._cesium.Cartographic.fromCartesian(t[i].position._value),o=this._cesium.Math.toDegrees(r.longitude),n=this._cesium.Math.toDegrees(r.latitude),a=this._cesium.Cartesian3.fromDegrees(o,n,e);t[i].position=a}}},500),get:function(){return 0}},billboardShow:{set:e.debounce(function(e){var t=this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].billboard&&e?(t[i].point&&(t[i].point.show=!e),t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard=new this._cesium.BillboardGraphics({show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})):(t[i].billboard&&(t[i].billboard.show=e),t[i].point&&(t[i].point.show=!e),t[i].label&&(t[i].label.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)return e&&0<e.length&&e[0].billboard?e[0].billboard.show:void 0}},billboardImage:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length)for(var i=0;i<t.length;i++){if(/^\[/.test(e)){var r=e.split("[");e=1<r.length?r[0]+r[1].replace(/\[/,"").replace(/\]/,""):(e=e.replace(/\[/,"").replace(/\]/,""),t[i].properties[e])}t[i].billboard?t[i].billboard.image=e:t[i].billboard=new this._cesium.BillboardGraphics({image:e,show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})}}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){var t=e[0].billboard.image;return t?t._value:void 0}}},billboardScale:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.scale=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){var t=e[0].billboard.scale;return t?t._value:void 0}}},billboardHorizontalOrigin:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.horizontalOrigin=e}},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)return e&&0<e.length&&e[0].billboard?e[0].billboard.horizontalOrigin:void 0}},billboardVerticalOrigin:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.verticalOrigin=e}},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)return e&&0<e.length&&e[0].billboard?e[0].billboard.verticalOrigin:void 0}},billboardWidth:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.width=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){var t=e[0].billboard.width;return t?t._value:void 0}}},billboardHeight:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.height=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){var t=e[0].billboard.height;return t?t._value:void 0}}},billboardColor:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.color=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){var t=e[0].billboard.color;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},billboardHeightReference:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].billboard.heightReference=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].model){var t=e[0].billboard.heightReference;return t?t._value:void 0}}},billboardDistanceDisplayMaxCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=t[0].billboard.distanceDisplayCondition?t[0].billboard.distanceDisplayCondition._value.near:0,r=0;r<t.length;r++)t[r].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e),t[r].billboard.scaleByDistance=new this._cesium.NearFarScalar(i,1,e,0)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&(e&&0<e.length&&e[0].billboard))return e[0].billboard.distanceDisplayCondition?e[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE}},billboardDistanceDisplayMinCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=t[0].billboard.distanceDisplayCondition?t[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE,r=0;r<t.length;r++)t[r].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i),t[r].billboard.scaleByDistance=new this._cesium.NearFarScalar(e,1,i,0)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&(e&&0<e.length&&e[0].billboard))return e[0].billboard.distanceDisplayCondition?e[0].billboard.distanceDisplayCondition._value.near:0}},billboardPHeight:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var r=this._cesium.Cartographic.fromCartesian(t[i].position._value),o=this._cesium.Math.toDegrees(r.longitude),n=this._cesium.Math.toDegrees(r.latitude),a=this._cesium.Cartesian3.fromDegrees(o,n,e);t[i].position=a}}},500),get:function(){return 0}},polylineShow:{set:e.debounce(function(e){var t=this.item.entities.values;if(/^line.fid/.test(t[0]._id)&&t&&0<t.length&&t[0].polyline)for(var i=0;i<t.length;i++)t[i].polyline&&(t[i].polyline.show=e)},500),get:function(){var e=this.item.entities.values;if(/^line.fid/.test(e[0]._id)||null!=e[0].polyline)return e&&0<e.length&&e[0].polyline?e[0].polyline.b:void 0}},polylineWidth:{set:e.debounce(function(e){if(!this._core.isnull(e)){e=parseFloat(e);var t=this.item.entities.values;if((/^line.fid/.test(t[0]._id)||null!=t[0].polyline)&&t&&0<t.length&&t[0].polyline)for(var i=0;i<t.length;i++)t[i].polyline.width=e}},500),get:function(){var e=this.item.entities.values;if((/^line.fid/.test(e[0]._id)||null!=e[0].polyline)&&e&&0<e.length&&e[0].polyline){var t=e[0].polyline.width;return t?t._value:void 0}}},polylinemMterial:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((/^line.fid/.test(t[0]._id)||null!=t[0].polyline)&&t&&0<t.length&&t[0].polyline)for(var i=0;i<t.length;i++)t[i].polyline.material=e}},500),get:function(){var e=this.item.entities.values;if((/^line.fid/.test(e[0]._id)||null!=e[0].polyline)&&e&&0<e.length&&e[0].polyline){var t=e[0].polyline.material;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},polylinemArcType:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^line.fid/.test(t[0]._id)||null!=t[0].polyline)&&t&&0<t.length&&t[0].polyline)for(var i=0;i<t.length;i++)t[i].polyline.arcType=e}},500),get:function(){var e=this.item.entities.values;if((/^line.fid/.test(e[0]._id)||null!=e[0].polyline)&&e&&0<e.length&&e[0].polyline){var t=e[0].polyline.arcType;return t?t._value:void 0}}},polylineDistanceDisplayMaxCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^line.fid/.test(t[0]._id)||null!=t[0].polyline)&&t&&0<t.length&&t[0].polyline)for(var i=t[0].polyline.distanceDisplayCondition?t[0].polyline.distanceDisplayCondition._value.near:0,r=0;r<t.length;r++)t[r].polyline.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e)}},500),get:function(){var e=this.item.entities.values;if((/^line.fid/.test(e[0]._id)||null!=e[0].polyline)&&(e&&0<e.length&&e[0].polyline))return e[0].polyline.distanceDisplayCondition?e[0].polyline.distanceDisplayCondition._value.far:Number.MAX_VALUE}},polylineDistanceDisplayMinCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^line.fid/.test(t[0]._id)||null!=t[0].polyline)&&t&&0<t.length&&t[0].polyline)for(var i=t[0].polyline.distanceDisplayCondition?t[0].polyline.distanceDisplayCondition._value.far:Number.MAX_VALUE,r=0;r<t.length;r++)t[r].polyline.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i)}},500),get:function(){var e=this.item.entities.values;if((/^line.fid/.test(e[0]._id)||null!=e[0].polyline)&&(e&&0<e.length&&e[0].polyline))return e[0].polyline.distanceDisplayCondition?e[0].polyline.distanceDisplayCondition._value.near:0}},polygonShow:{set:e.debounce(function(e){var t=this.item.entities.values;if(/^polygon.fid/.test(t[0]._id)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon&&(t[i].polygon.show=e)},500),get:function(){var e=this.item.entities.values;if(/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)return e&&0<e.length&&e[0].polygon?e[0].polygon.b:void 0}},polygonHeight:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].polygon.height=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){var t=e[0].polygon.height;return t?t._value:void 0}}},polygonHeightReference:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon.heightReference=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){var t=e[0].polygon.heightReference;return t?t._value:void 0}}},polygonExtrudedHeight:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].polygon.extrudedHeight=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){var t=e[0].polygon.extrudedHeight;return t?t._value:void 0}}},polygonExtrudedHeightReference:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon.extrudedHeightReference=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){var t=e[0].polygon.extrudedHeightReference;return t?t._value:void 0}}},polygonFill:{set:e.debounce(function(e){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon.fill=e},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){var t=e[0].polygon.fill;return t?t._value:void 0}}},polygonMaterial:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon.material=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){var t=e[0].polygon.material;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},polygonOutline:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon.outline=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){var t=e[0].polygon.outline;return t?t._value:void 0}}},polygonOutlineColor:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon.outlineColor=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){var t=e[0].polygon.outlineColor;return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}}},polygonOutlineWidth:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].polygon.outlineWidth=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){var t=e[0].polygon.outlineWidth;return t?t._value:void 0}}},polygonDistanceDisplayMaxCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=t[0].polygon.distanceDisplayCondition?t[0].polygon.distanceDisplayCondition._value.near:0,r=0;r<t.length;r++)t[r].polygon.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e)}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&(e&&0<e.length&&e[0].polygon))return e[0].polygon.distanceDisplayCondition?e[0].polygon.distanceDisplayCondition._value.far:Number.MAX_VALUE}},polygonDistanceDisplayMinCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=t[0].polygon.distanceDisplayCondition?t[0].polygon.distanceDisplayCondition._value.far:Number.MAX_VALUE,r=0;r<t.length;r++)t[r].polygon.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i)}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&(e&&0<e.length&&e[0].polygon))return e[0].polygon.distanceDisplayCondition?e[0].polygon.distanceDisplayCondition._value.near:0}}}),t}),define("SGWorld/VectorTileProvider/VectorTileProvider",["../Navigate/getPosition","../Core/Core","../ProjectTree/treeSource"],function(i,r,Z){"use strict";function o(e,t){this._viewer=e,this._cesium=t,this._quadtree=void 0,this._tilingScheme=new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._reTilesKey=[],this._state=!0,this._client=!0,this._reTiles=[],this._normalTile=16,this._minimumHeight=0,this._maximumHeight=0,this._PrimitiveCollection=new Cesium.PrimitiveCollection,this._levelZeroMaximumError=Cesium.QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme),this.cartographicLimitRectangle=Cesium.Rectangle.clone(Cesium.Rectangle.MAX_VALUE),o.prototype.ready||Object.defineProperties(o.prototype,{quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}}}),this._core=new r,this.tooltip=this._core.CreateTooltip(),this._getPosition=new i(this._viewer,this._cesium)}return o.prototype.update=function(e){this._quadtree.beginFrame(e),this._quadtree.render(e),this._quadtree.endFrame(e)},o.prototype.static=function(e){this.cs=e},o.prototype.initialize=function(e){},o.prototype.beginUpdate=function(e){},o.prototype.endUpdate=function(e){},o.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)},o.prototype.loadTile=function(e,t){},o.prototype.computeTileVisibility=function(e,t,i){var r=this.computeDistanceToTile(e,t);if(e._distance=r,t.fog.enabled&&1<=Cesium.Math.fog(r,t.fog.density))return Cesium.Visibility.NONE;var o=e.data;o.tileBoundingRegion;if(void 0===o.boundingVolumeSourceTile)return Cesium.Visibility.PARTIAL;var n=t.cullingVolume,a=o.orientedBoundingBox;!a&&o.renderedMesh&&(a=o.renderedMesh.boundingSphere3D),o.clippedByBoundaries=!1;var s=function(e,t){if(t.west<t.east)return t;var i=Rectangle.clone(t,splitCartographicLimitRectangleScratch);return 0<Rectangle.center(e,rectangleCenterScratch).longitude?i.east=CesiumMath.PI:i.west=-CesiumMath.PI,i}(e.rectangle,this.cartographicLimitRectangle),l=new Cesium.Rectangle,u=Cesium.Rectangle.simpleIntersection(s,e.rectangle,l);if(!u)return Visibility.NONE;if(Cesium.Rectangle.equals(u,e.rectangle)||(o.clippedByBoundaries=!0),t.mode,Cesium.SceneMode.SCENE3D,!a)return Cesium.Intersect.INTERSECTING;var c=this._clippingPlanes;if(c&&c.enabled){var h=c.computeIntersectionWithBoundingVolume(a);if(e.isClipped=h!==Intersect.INSIDE,h===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE}var d=n.computeVisibility(a);if(d===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE;var m=t.mode===Cesium.SceneMode.SCENE3D&&t.camera.frustum instanceof Cesium.OrthographicFrustum;if(t.mode!==Cesium.SceneMode.SCENE3D||m||!i)return d;var p=o.occludeePointInScaledSpace;return p?i.ellipsoid.isScaledSpacePointVisible(p)?d:Cesium.Visibility.NONE:d},o.prototype.canRefine=function(e,t,i){return e.level<this._normalTile},o.prototype.showTileThisFrame=function(e,t,i,r){this._availability&&(this._state=this.isAvailable(t.time)),e.data.geometryPrimitive&&this._state&&this._client&&"function"==typeof e.data.geometryPrimitive.update&&e.data.geometryPrimitive.update(t,i,r)},o.prototype.computeDistanceToTile=function(e,t){var i,r,o,n,a,s,l,u,c,h,d,m,p=(i=this._maximumHeight,r=this._minimumHeight,o=e,this.terrainProvider,void 0===(n=o.data)&&(n=o.data=new Cesium.GlobeSurfaceTile),o._minimumHeight&&(r=o._minimumHeight),o._maximumHeight&&(i=o._maximumHeight),void 0===n.tileBoundingRegion&&(n.tileBoundingRegion=new Cesium.TileBoundingRegion({computeBoundingVolumes:!1,rectangle:o.rectangle,ellipsoid:o.tilingScheme.ellipsoid,minimumHeight:r||0,maximumHeight:i||0})),o),g=e.data,f=g.tileBoundingRegion;if(void 0===p)return 9999999999;if(g.boundingVolumeSourceTile!==p){g.boundingVolumeSourceTile=p;var v=e.rectangle;v&&v.width<Cesium.Math.PI_OVER_TWO+Cesium.Math.EPSILON5&&(g.orientedBoundingBox=Cesium.OrientedBoundingBox.fromRectangle(e.rectangle,f.minimumHeight,f.maximumHeight,e.tilingScheme.ellipsoid,g.orientedBoundingBox),g.occludeePointInScaledSpace=(a=this,s=g.orientedBoundingBox.center,l=e.rectangle,u=f.maximumHeight,c=g.occludeePointInScaledSpace,h=a.quadtree._occluders.ellipsoid,d=h.ellipsoid,m=[new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3],Cesium.Cartesian3.fromRadians(l.west,l.south,u,d,m[0]),Cesium.Cartesian3.fromRadians(l.east,l.south,u,d,m[1]),Cesium.Cartesian3.fromRadians(l.west,l.north,u,d,m[2]),Cesium.Cartesian3.fromRadians(l.east,l.north,u,d,m[3]),h.computeHorizonCullingPoint(s,m,c)))}var _=f.minimumHeight,y=f.maximumHeight;if(g.boundingVolumeSourceTile!==e){var C=t.camera.positionCartographic.height,w=Math.abs(C-_);Math.abs(C-y)<w?(f.minimumHeight=_,f.maximumHeight=_):(f.minimumHeight=y,f.maximumHeight=y)}var b=f.distanceToCamera(t);return f.minimumHeight=_,f.maximumHeight=y,b},o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){return Cesium.destroyObject(this)},o.prototype.remove=function(){this.destroy()},o.prototype.setStatus=function(e){this._state=e,this._client=e},o.prototype.edit=function(e,u){var U=this,q=this._viewer;if(!u&&(u={}),this.editHandler&&(this.editHandler.destroy(),this.editHandler=void 0),void 0===e&&(e=!0),e){var Y,X,J,Q;this.editHandler=new this._cesium.ScreenSpaceEventHandler(q.scene.canvas),this.isEditting=!1;var K=void 0;return this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))U.isEditting&&($(),U.defaultEvent(!1));else{var t=e.position,i=q.scene.pick(t);if(!(i&&i&&i.id&&i.id.treeID!==U.treeID)&&i&&i.id&&(i.id instanceof Cesium.Entity||i.id.VectorType)){var r=i.id;U.isEditting||0!=Z.states?(r!=Y||"point"!==r.VectorType&&"billboard"!==r.VectorType&&"label"!==r.VectorType&&"model"!==r.VectorType)&&"_height_point"!=r.name&&"_edit_point"!=r.name&&"_move_point"!=r.name&&"_add_point"!=r.name&&"_size_point"!=r.name||(q.container.style.cursor="crosshair",U.defaultEvent(!1),"_height_point"==r.name?(J={windowPosition:t,originHeight:U._cesium.Cartographic.fromCartesian(r.position.getValue()).height},K="_height_point"):"_move_point"==r.name?K="_move_point":"point"===r.VectorType||"billboard"===r.VectorType||"label"===r.VectorType||"model"===r.VectorType?(U.tooltip.showAt(e.position,"释放后完成修改"),K="_move_point","model"===r.VectorType&&(r.show=!1)):"_edit_point"==r.name?K="_edit_point":"_add_point"==r.name?K="_add_point":"_size_point"==r.name&&(K="_size_point"),X=r):(u.callBack&&u.callBack.start&&u.callBack.start(r),Q=r.VectorType,(Y=U.createEditEntity(Q,r.VectorStyle)).feature=r,Y.treeID=U.treeID,U.getSimpleGraphicData(Q,Y),"point"===Q||"billboard"===Q||"label"===Q||"model"===Q?(U.isEditting=!0,U.tooltip.showAt(e.position,"拖拽修改位置")):(U.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint(),SmartEarthPopupData.editGraphic.setTreeID(U.treeID)),U.setStatus(!1),Z.editVector=!0)}}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))U.isEditting&&($(),U.defaultEvent(!1));else{var t=q.scene.pick(e.endPosition);if(!(t&&t&&t.id&&t.id.treeID!==U.treeID)&&(U._cesium.defined(t)?U.isEditting&&!X?"point"!==Q&&"billboard"!==Q&&"label"!==Q&&"model"!==Q||t.id!=Y?t.id&&"_edit_point"===t.id.name&&Y.pottingPoint?"polyline"===Q&&2<Y.pottingPoint.length?U.tooltip.showAt(e.endPosition,"拖拽修改位置,右键删除点"):"polygon"===Q&&3<Y.pottingPoint.length?U.tooltip.showAt(e.endPosition,"拖拽修改位置,右键删除点"):U.tooltip.showAt(e.endPosition,"拖拽修改位置"):!t.id||"_move_point"!==t.id.name&&"_size_point"!==t.id.name?t.id&&"_add_point"===t.id.name?U.tooltip.showAt(e.endPosition,"拖拽增加节点"):t.id&&"_height_point"===t.id.name?U.tooltip.showAt(e.endPosition,"拖拽修改高度"):t.id==Y&&U.tooltip.show(!1):U.tooltip.showAt(e.endPosition,"拖拽修改位置"):U.tooltip.showAt(e.endPosition,"拖拽修改位置,右键删除"):U.isEditting||0!==Z.states||(t.id&&t.id.VectorType?U.tooltip.showAt(e.endPosition,"点击激活编辑"):U.tooltip.show(!1)):0!=Z.states||X||U.tooltip.show(!1),U.isEditting&&X)){U.tooltip.showAt(e.endPosition,"释放后完成修改");var i=U._getPosition.getMousePosition(e);if(!i&&"_height_point"!==K)return;if("_edit_point"===K){X.position=i;var r=Z.editPointID.edit.indexOf(X.id);if(void 0!==Y[Q].height){var o=U.toDegrees(i);Y.pottingPoint[r]=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,Y[Q].height.getValue()),X.position=Y.pottingPoint[r]}else Y.pottingPoint[r]=i;if(0<Z.editPointID.add.length){if(0<r){var n=q.entities.getById(Z.editPointID.add[r-1]);if(n){var a=q.entities.getById(Z.editPointID.edit[r-1]),s=q.entities.getById(Z.editPointID.edit[r]);n.position=Cesium.Cartesian3.midpoint(a.position.getValue(),s.position.getValue(),new Cesium.Cartesian3)}}if(r<Y.pottingPoint.length-1){var l=q.entities.getById(Z.editPointID.add[r]);if(l){var u=q.entities.getById(Z.editPointID.edit[r]),c=q.entities.getById(Z.editPointID.edit[r+1]);l.position=Cesium.Cartesian3.midpoint(u.position.getValue(),c.position.getValue(),new Cesium.Cartesian3)}}if("polygon"===Q&&(0===r||r===Y.pottingPoint.length-1)){var h=q.entities.getById(Z.editPointID.add[Z.editPointID.add.length-1]);if(h){var d=q.entities.getById(Z.editPointID.edit[0]),m=q.entities.getById(Z.editPointID.edit[Y.pottingPoint.length-1]);h.position=Cesium.Cartesian3.midpoint(d.position.getValue(),m.position.getValue(),new Cesium.Cartesian3)}}}var p=Y.pottingPoint.concat([]),g=new U._cesium.Cartesian3,f=p.length;p.forEach(function(e){g.x+=e.x,g.y+=e.y,g.z+=e.z}),g.x/=f,g.y/=f,g.z/=f,Z.editPointID.move&&(Z.editPointID.move.position=g),"polyline"!==Q&&"polygon"!==Q&&"rectangle"!==Q||SmartEarthPopupData.editGraphic.setValue("positions",p)}else if("_height_point"===K){var v=Z.editPointID.height.indexOf(X.id),_=q.entities.getById(Z.editPointID.edit[v]);"ellipse"!==Q&&"cylinder"!==Q&&"box"!==Q||(_=Z.editPointID.move);var y=U.toDegrees(_.position.getValue()),C=J.originHeight-y.height,w=q.scene.cartesianToCanvasCoordinates(_.position.getValue()),b=(J.windowPosition.y-e.endPosition.y)*C/Math.abs(w.y-J.windowPosition.y),E=Math.abs(C+b);Z.editPointID.height.forEach(function(e){var t=q.entities.getById(e);if(t){var i=t.position.getValue(),r=U.toDegrees(i);t.position=U._cesium.Cartesian3.fromDegrees(r.lon,r.lat,E+y.height)}}),Y[Q].extrudedHeight?Y[Q].extrudedHeight=E+y.height:"box"===Q?SmartEarthPopupData.editGraphic.setValue("height",E):"cylinder"===Q&&SmartEarthPopupData.editGraphic.setValue("length",E)}else if("_add_point"===K){var S=Z.editPointID.add.indexOf(X.id);q.entities.remove(X);var P=q.entities.add({name:"_edit_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});Z.editPointID.edit.splice(S+1,0,P.id),Y.pottingPoint.splice(S+1,0,i.clone());var x=Cesium.Cartesian3.midpoint(Y.pottingPoint[S],Y.pottingPoint[S+1],new Cesium.Cartesian3),T=q.entities.add({name:"_add_point",position:x,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),I=Cesium.Cartesian3.midpoint(Y.pottingPoint[S+1],Y.pottingPoint[S+2===Y.pottingPoint.length?0:S+2],new Cesium.Cartesian3),D=q.entities.add({name:"_add_point",position:I,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});Z.editPointID.add.splice(S,1,T.id,D.id),SmartEarthPopupData.editGraphic.setTreeID(U.treeID),X=P,K="_edit_point";var L=Y.pottingPoint.concat([]);"polyline"!==Q&&"polygon"!==Q||SmartEarthPopupData.editGraphic.setValue("positions",L)}else if("_size_point"===K){var M=Z.editPointID.move.position.getValue(),A=U._cesium.Cartesian3.distance(M,i);if("ellipse"===Q||"cylinder"===Q||"ellipsoid"===Q&&Y.isSphere)SmartEarthPopupData.editGraphic.setValue("radius",A);else if("box"===Q){var R=90===X.angle?"long":"width";SmartEarthPopupData.editGraphic.setValue(R,2*A)}}else{if("point"===Q||"billboard"===Q||"label"===Q||"model"===Q)return void(X.position=i);var O=U.toDegrees(i);J=X.position.getValue();var N=U.toDegrees(J),V=O.lon-N.lon,F=O.lat-N.lat,H=O.height-N.height;if(X.position=i,Y[Q].height){var G=U.toDegrees(i).height;Y[Q].height=G,Y.thisHeight=G}Y.pottingPoint.forEach(function(e,t){var i,r=void 0,o=q.entities.getById(Z.editPointID.edit[t]);if(o||(o=q.entities.getById(Z.editPointID.size[t])),r=o?U.toDegrees(o.position.getValue()):U.toDegrees(e),i=U._cesium.Cartesian3.fromDegrees(r.lon+V,r.lat+F,r.height+H),e.x=i.x,e.y=i.y,e.z=i.z,o&&(o.position=i),0<Z.editPointID.add.length&&Z.editPointID.add[t]){var n=q.entities.getById(Z.editPointID.add[t]);n&&(r=U.toDegrees(n.position.getValue()),n.position=U._cesium.Cartesian3.fromDegrees(r.lon+V,r.lat+F,r.height+H))}});var k=Y.pottingPoint.concat([]);if("polyline"===Q||"polygon"===Q||"rectangle"===Q)SmartEarthPopupData.editGraphic.setValue("positions",k);else if("ellipse"===Q)Y.pottingPoint[1]=i,Y.position=i.clone();else if("box"===Q){Y.pottingPoint[2]=i;var B=Y.box.dimensions.getValue(),j=U.toDegrees(i);Y.position=Cesium.Cartesian3.fromDegrees(j.lon,j.lat,j.height+B.z/2)}else if("cylinder"===Q){Y.pottingPoint[1]=i;var z=Y.cylinder.length.getValue(),W=U.toDegrees(Y.pottingPoint[1]);Y.position=Cesium.Cartesian3.fromDegrees(W.lon,W.lat,W.height+z/2)}else"ellipsoid"===Q&&(Y.pottingPoint[Y.pottingPoint.length-1]=i,Y.position=i.clone())}}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.editHandler.setInputAction(function(e){Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?U.isEditting&&($(),U.defaultEvent(!1)):(X&&"model"===X.VectorType&&(X.show=!0),X&&u.callBack&&u.callBack.updata&&u.callBack.updata(X.name,Y),q.container.style.cursor="default",X=void 0,U.defaultEvent(!0))},this._cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))U.isEditting&&($(),U.defaultEvent(!1));else{var t=q.scene.pick(e.position);if((!t||!t.id||t.id.treeID===U.treeID)&&U._cesium.defined(t)&&0==Z.states){var i=t.id;if(i.VectorType);else if(-1<Z.editPointID.edit.indexOf(i.id)&&("polyline"===Q&&2<Z.editPointID.edit.length||"polygon"===Q&&3<Z.editPointID.edit.length)){var r=Z.editPointID.edit.indexOf(i.id);if(q.entities.removeById(i.id),Z.editPointID.edit.splice(r,1),Y.pottingPoint.splice(r,1),0<Z.editPointID.add.length)if(Z.editPointID.add[r]){if(q.entities.removeById(Z.editPointID.add[r]),Z.editPointID.add.splice(r,1),0<=r-1){var o=q.entities.getById(Z.editPointID.add[r-1]);o&&(o.position=Cesium.Cartesian3.midpoint(Y.pottingPoint[r-1],Y.pottingPoint[r===Y.pottingPoint.length?0:r],new Cesium.Cartesian3))}else if(r-1==-1&&"polygon"===Q){var n=q.entities.getById(Z.editPointID.add[Z.editPointID.add.length-1]);n&&(n.position=Cesium.Cartesian3.midpoint(Y.pottingPoint[0],Y.pottingPoint[Y.pottingPoint.length-1],new Cesium.Cartesian3))}}else q.entities.removeById(Z.editPointID.add[r-1]),Z.editPointID.add.pop();var a=new U._cesium.Cartesian3,s=Y.pottingPoint.length;Y.pottingPoint.forEach(function(e){a.x+=e.x,a.y+=e.y,a.z+=e.z}),a.x/=s,a.y/=s,a.z/=s,Z.editPointID.move&&(Z.editPointID.move.position=a);var l=Y.pottingPoint.concat([]);"polyline"!==Q&&"polygon"!==Q||SmartEarthPopupData.editGraphic.setValue("positions",l),U.tooltip.show(!1),u.callBack&&u.callBack.updata&&u.callBack.updata(X&&X.name,Y)}}}},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),$(),{endThisEdit:$,getEditData:function(){return{entity:Y}}}}function $(){U.defaultEvent(!0),Z.editPointID.edit.forEach(function(e){q.entities.removeById(e)}),Z.editPointID.edit=[],Z.editPointID.height.forEach(function(e){q.entities.removeById(e)}),Z.editPointID.height=[],Z.editPointID.add.forEach(function(e){q.entities.removeById(e)}),Z.editPointID.add=[],Z.editPointID.size.forEach(function(e){q.entities.removeById(e)}),Z.editPointID.size=[],Z.editPointID.move&&q.entities.remove(Z.editPointID.move),Z.editPointID.move=void 0,Y&&q.entities.remove(Y),Q=Y=void 0,SmartEarthPopupData.editGraphic={},U.isEditting=!1,U.setStatus(!0),Z.editVector=!1,U.delButton(!1)}$()},o.prototype.createEditEntity=function(e,t){var i=void 0,r=this,o=this._viewer;if("polygon"===e){var n=t.positions,a=r._core.defaultValue(t.height,void 0),s=void 0;s=t.hierarchy?t.hierarchy:(n=t.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(n):r._cesium.Cartesian3.fromDegreesArray(n),new r._cesium.PolygonHierarchy(n)),(i=o.entities.add({polygon:{hierarchy:new r._cesium.CallbackProperty(function(){return s},!1),extrudedHeight:r._core.defaultValue(t.extrudedHeight,void 0),height:a,material:new r._cesium.ImageMaterialProperty({image:r._core.defaultValue(t.image,null),repeat:r._core.defaultValue(t.repeat,new r._cesium.Cartesian2(1,1)),color:t.material}),shadows:r._cesium.ShadowMode.ENABLED,fill:!0}})).VectorType="polygon"}else if("polyline"===e){var l=t.positions;l=t.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(l):r._cesium.Cartesian3.fromDegreesArray(l),(i=o.entities.add({polyline:{positions:new r._cesium.CallbackProperty(function(){return l},!1),clampToGround:r._core.defaultValue(t.clampToGround,!1),material:new Cesium.PolylineOutlineMaterialProperty({color:t.material,outlineWidth:r._core.defaultValue(t.outlineWidth,0),outlineColor:r._cesium.Color.fromCssColorString(r._core.defaultValue(t.outlineColor,"rgba(255,255,255,0.6)"))}),width:r._core.defaultValue(t.width,3)}})).VectorType="polyline"}else if("wall"===e){var u=t.positions;u=t.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(u):r._cesium.Cartesian3.fromDegreesArray(u),(i=o.entities.add({wall:{positions:new r._cesium.CallbackProperty(function(){return u},!1),minimumHeights:t.minimumHeights,maximumHeights:t.maximumHeights,material:t.material,outline:!0,outlineWidth:r._core.defaultValue(t.outlineWidth,0),outlineColor:t.outlineColor}})).VectorType="wall"}else"label"===e?(i=o.entities.add({position:t.position,label:{text:t.text,font:t.font,scale:t.scale,style:t.style,fillColor:t.fillColor,outlineColor:t.outlineColor,outlineWidth:t.outlineWidth,showBackground:t.showBackground,backgroundColor:t.backgroundColor,heightReference:t.heightReference,horizontalOrigin:t.horizontalOrigin,verticalOrigin:t.verticalOrigin,scaleByDistance:t.scaleByDistance,distanceDisplayCondition:t.distanceDisplayCondition}})).VectorType="label":"billboard"===e?(i=o.entities.add({position:t.position,billboard:{rotation:t.rotation,width:t.width,height:t.height,image:t.image,color:t.color,scale:t.scale,heightReference:t.heightReference,horizontalOrigin:t.horizontalOrigin,verticalOrigin:t.verticalOrigin,scaleByDistance:t.scaleByDistance,distanceDisplayCondition:t.distanceDisplayCondition}})).VectorType="billboard":"point"===e&&((i=o.entities.add({position:t.position,point:{pixelSize:t.pixelSize,color:t.color,outlineWidth:t.outlineWidth,outlineColor:t.outlineColor,heightReference:t.heightReference,scaleByDistance:t.scaleByDistance,distanceDisplayCondition:t.distanceDisplayCondition}})).VectorType="point");return i},o.prototype.delButton=function(e,t,i){if(e){var r=document.getElementById("DeleteMilitaryStandardDelete");r||((r=document.createElement("button")).id="DeleteMilitaryStandardDelete",r.innerText="删除对象",r.style.cssText="height: 38px;\n line-height: 38px;\n padding: 0 18px;\n background-color: #052355;\n color: #fff;\n white-space: nowrap;\n text-align: center;\n font-size: 14px;\n border: none;\n border-radius: 2px;\n cursor: pointer;\n position: absolute;",this._viewer.container.appendChild(r)),r.style.display="block",r.style.top=t.y+"px",r.style.left=t.x+"px",r.onclick=i}else{var o=document.getElementById("DeleteMilitaryStandardDelete");o&&(o.style.display="none",o.onclick=null)}},o.prototype.defaultEvent=function(e){var t=this._viewer.scene;t.screenSpaceCameraController.enableRotate=e,t.screenSpaceCameraController.enableTranslate=e,t.screenSpaceCameraController.enableZoom=e,t.screenSpaceCameraController.enableTilt=e,t.screenSpaceCameraController.enableLook=e},o.prototype.getEntityTypeAndObject=function(e){var t={type:"",object:null};return e&&(e.billboard?(t.type="billboard",t.object=e.billboard):e.box?(t.type="box",t.object=e.box):e.corridor?(t.type="corridor",t.object=e.corridor):e.cylinder?(t.type="cylinder",t.object=e.cylinder):e.ellipse?(t.type="ellipse",t.object=e.ellipse):e.ellipsoid?(t.type="ellipsoid",t.object=e.ellipsoid):e.label?(t.type="label",t.object=e.label):e.model?(t.type="model",t.object=e.model):e.path?(t.type="path",t.object=e.path):e.plane?(t.type="plane",t.object=e.plane):e.point?(t.type="point",t.object=e.point):e.polygon?(t.type="polygon",t.object=e.polygon):e.polyline?(t.type="polyline",t.object=e.polyline):e.polylineVolume?(t.type="polylineVolume",t.object=e.polylineVolume):e.rectangle?(t.type="rectangle",t.object=e.rectangle):e.wall&&(t.type="wall",t.object=e.wall)),t},o.prototype.toDegrees=function(e){var t=this._cesium.Cartographic.fromCartesian(e);return{lon:this._cesium.Math.toDegrees(t.longitude),lat:this._cesium.Math.toDegrees(t.latitude),height:t.height}},o.prototype.getSimpleGraphicData=function(e,c){var t,h=this,d=this._viewer;if(SmartEarthPopupData.editGraphic={entity:c,type:e,graphic:c[e],getValue:function(e){if("position"===e||"name"===e||"id"===e)return this.entity[e]&&(this.entity[e].getValue?this.entity[e].getValue():this.entity[e]);if("radius"===e){if("ellipse"===this.type)return this.graphic.semiMajorAxis.getValue();if("ellipsoid"===this.type)return this.graphic.radii.getValue().x;if("cylinder"===this.type)return this.graphic.bottomRadius.getValue()}else{if("pHeight"!==e)return"repeat"===e?this.graphic.material[e]&&(this.graphic.material[e].getValue?this.graphic.material[e].getValue():this.graphic.material[e]):this.graphic[e]&&(this.graphic[e].getValue?this.graphic[e].getValue():this.graphic[e]);if(this.getValue("position")){var t=this.getValue("position");return Cesium.Cartographic.fromCartesian(t).height}}},changeHeightPoint:function(o){0<Z.editPointID.height.length&&Z.editPointID.height.forEach(function(e){var t=d.entities.getById(e);if(t){var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}})},changeEditPoint:function(o){0<Z.editPointID.edit.length&&Z.editPointID.edit.forEach(function(e){var t=d.entities.getById(e);if(t)if("clampToGround"===o)t.point.heightReference=1;else{t.point.heightReference=0;var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}}),0<Z.editPointID.size.length&&Z.editPointID.size.forEach(function(e){var t=d.entities.getById(e);if(t)if("clampToGround"===o)t.point.heightReference=1;else{t.point.heightReference=0;var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}}),0<Z.editPointID.add.length&&Z.editPointID.add.forEach(function(e){var t=d.entities.getById(e);if(t)if("clampToGround"===o)t.point.heightReference=1;else{t.point.heightReference=0;var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}});var e=Z.editPointID.move;if(e)if("clampToGround"===o)e.point.heightReference=1;else{e.point.heightReference=0;var t=e.position.getValue(),i=h.toDegrees(t);e.position=Cesium.Cartesian3.fromDegrees(i.lon,i.lat,o)}},clearAllEditPoint:function(){Z.editPointID.edit.forEach(function(e){d.entities.removeById(e)}),Z.editPointID.edit=[],Z.editPointID.height.forEach(function(e){d.entities.removeById(e)}),Z.editPointID.height=[],Z.editPointID.add.forEach(function(e){d.entities.removeById(e)}),Z.editPointID.add=[],Z.editPointID.size.forEach(function(e){d.entities.removeById(e)}),Z.editPointID.size=[],Z.editPointID.move&&d.entities.remove(Z.editPointID.move),Z.editPointID.move=void 0},setTreeID:function(t){Z.editPointID.edit.forEach(function(e){d.entities.getById(e).treeID=t}),Z.editPointID.height.forEach(function(e){d.entities.getById(e).treeID=t}),Z.editPointID.add.forEach(function(e){d.entities.getById(e).treeID=t}),Z.editPointID.size.forEach(function(e){d.entities.getById(e).treeID=t}),Z.editPointID.move&&(Z.editPointID.move.treeID=t)}},"billboard"===e||"point"===e||"label"===e||"model"===e){var i=SmartEarthPopupData.editGraphic.getValue("color")||SmartEarthPopupData.editGraphic.getValue("fillColor");i?v(i):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var r=SmartEarthPopupData.editGraphic.getValue("outlineColor");if(r?_(r):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),"label"===e){var o=SmartEarthPopupData.editGraphic.getValue("backgroundColor");o?(t=o,SmartEarthPopupData.editGraphic.backgroundColor=y("rgb("+255*t.red+","+255*t.green+","+255*t.blue+")"),SmartEarthPopupData.editGraphic.backgroundAlpha=100*t.alpha):(SmartEarthPopupData.editGraphic.backgroundColor="#000000",SmartEarthPopupData.editGraphic.backgroundAlpha=80)}SmartEarthPopupData.editGraphic.setValue=function(e,t){if("position"===e||"name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e||"backgroundColor"===e||"fillColor"===e)t=Cesium.Color.fromCssColorString(t);else if("fontSize"===e){var i=this.getValue("font");(i=i.split(" "))[0]=t,t=i.join(" ")}else{if("alpha"===e)return void("label"===this.type?this.graphic.fillColor._value.alpha=t:this.graphic.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("backgroundAlpha"===e)return void(this.graphic.backgroundColor._value.alpha=t);if("pHeight"===e&&this.getValue("position")){var r=this.getValue("position"),o=Cesium.Cartographic.fromCartesian(r);return o.height=t,void(this.entity.position=Cesium.Cartographic.toCartesian(o))}}this.graphic[e]=t}}}else if("polyline"===e){var n=SmartEarthPopupData.editGraphic.getValue("material");n.color?v(n.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),n.outlineColor?_(n.outlineColor):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e)return t=Cesium.Color.fromCssColorString(t),void(this.graphic.material[e]=t);if("outlineWidth"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.material.outlineColor._value.alpha=t);if("positions"===e)return void(this.graphic[e]=new Cesium.CallbackProperty(function(){return t},!1));this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("positions");return this.entity.pottingPoint=e},SmartEarthPopupData.editGraphic.updataEditPoint=function(){var r=this;this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var o=new Cesium.Cartesian3;e.forEach(function(e,t){var i=d.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:r.graphic.heightReference&&r.graphic.heightReference.getValue()}});Z.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=e.length,o.y/=e.length,o.z/=e.length,Z.editPointID.move=d.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(var t=0;t<e.length-1;t++){var i=Cesium.Cartesian3.midpoint(e[t],e[t+1],new Cesium.Cartesian3),n=d.entities.add({name:"_add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Z.editPointID.add.push(n.id)}}}}else if("polygon"===e){var a=SmartEarthPopupData.editGraphic.getValue("material");a.color?v(a.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var s=SmartEarthPopupData.editGraphic.getValue("outlineColor");s?_(s):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,i){var t=this;if("name"===e)this.entity[e]=i;else{if("color"===e||"outlineColor"===e){if(i=Cesium.Color.fromCssColorString(i),"color"===e)return void(this.graphic.material.color=i)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=i);if("alpha"===e)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=i);if("positions"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(i)},!1));if("hierarchy"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return i},!1));if("clampToGround"===e){var r=function(e,t,i){i?(e.perPositionHeight=!1,e.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(e.perPositionHeight=!0,e.heightReference=Cesium.HeightReference.NONE),0<Z.editPointID.edit.length&&!i&&t.forEach(function(e,t){var i=d.entities.getById(Z.editPointID.edit[t]);if(i){var r=i.position.getValue();e.x=r.x,e.y=r.y,e.z=r.z}}),e.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(t)},!1)};return this.graphic.hierarchy instanceof Cesium.CallbackProperty?(this.graphic.hierarchy=this.graphic.hierarchy.getValue(),setTimeout(function(){r(t.graphic,t.entity.pottingPoint,i)},100)):r(this.graphic,this.entity.pottingPoint,i),void(0<Z.editPointID.add.length&&Z.editPointID.add.forEach(function(e){var t=d.entities.getById(e);t&&(t.point.heightReference=i?1:0)}))}"extrudedHeight"===e?this.changeHeightPoint(i):"height"===e&&this.changeEditPoint(i)}this.graphic[e]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("hierarchy").positions.concat([]);if(void 0!==this.getValue("height")){var r=this.getValue("height");e.forEach(function(e){var t=h.toDegrees(e),i=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,r);e.x=i.x,e.y=i.y,e.z=i.z})}return this.entity.pottingPoint=e},SmartEarthPopupData.editGraphic.updataEditPoint=function(){var r=this;this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var o=new Cesium.Cartesian3;e.forEach(function(e,t){var i=d.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:r.graphic.heightReference&&r.graphic.heightReference.getValue()}});Z.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=e.length,o.y/=e.length,o.z/=e.length,Z.editPointID.move=d.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(var t=0;t<e.length-1;t++){var i=Cesium.Cartesian3.midpoint(e[t],e[t+1],new Cesium.Cartesian3),n=d.entities.add({name:"_add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Z.editPointID.add.push(n.id)}var a=Cesium.Cartesian3.midpoint(e[0],e[e.length-1],new Cesium.Cartesian3),s=d.entities.add({name:"_add_point",position:a,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Z.editPointID.add.push(s.id)}}}else if("ellipse"===e||"cylinder"===e||c.isSphere){var l=SmartEarthPopupData.editGraphic.getValue("material");l.color?v(l.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var u=SmartEarthPopupData.editGraphic.getValue("outlineColor");u?_(u):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){var i=this;if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("semiMajorAxis"===e)return void(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return t},!1));if("semiMinorAxis"===e)return void(this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return t},!1));if("radii"===e)return void(this.graphic.radii=new Cesium.CallbackProperty(function(){return t},!1));if("topRadius"===e)return void(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return t},!1));if("bottomRadius"===e)return void(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return t},!1));if("radius"===e){"ellipse"===this.type?(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return t},!1),this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return t},!1)):"ellipsoid"===this.type?null!==this.graphic.material.image.getValue()?this.graphic.radii=new Cesium.Cartesian3(t,t,t):this.graphic.radii=new Cesium.CallbackProperty(function(){return new Cesium.Cartesian3(t,t,t)},!1):"cylinder"===this.type&&(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return t},!1),this.entity.changeTop&&(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return t},!1)));var r=Z.editPointID.move.position.getValue(),o=h.GetPositionFromA_D(r,t,90);d.entities.getById(Z.editPointID.size[0]).position=o,c.pottingPoint[0]=o,c.pottingPoint[c.pottingPoint.length-1]=r;var n=d.entities.getById(Z.editPointID.height[0]);if(n){var a=h.toDegrees(o),s=h._cesium.Cartographic.fromCartesian(n.position.getValue());n.position=h._cesium.Cartesian3.fromDegrees(a.lon,a.lat,s.height)}return}if("cylinder"===this.type&&"length"===e){this.graphic.length=t;var l=h.toDegrees(this.entity.pottingPoint[1]);return this.entity.position=Cesium.Cartesian3.fromDegrees(l.lon,l.lat,l.height+t/2),void this.changeHeightPoint(l.height+t)}if("ellipse"===this.type&&"clampToGround"===e){var u=function(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);var r=t.semiMinorAxis.getValue();t.semiMinorAxis=new Cesium.CallbackProperty(function(){return r},!1),t.semiMajorAxis=new Cesium.CallbackProperty(function(){return r},!1)};return this.graphic.semiMinorAxis instanceof Cesium.CallbackProperty?(this.graphic.semiMinorAxis=this.graphic.semiMinorAxis.getValue(),this.graphic.semiMajorAxis=this.graphic.semiMajorAxis.getValue(),setTimeout(function(){u(i.entity,i.graphic,t)},100)):u(this.entity,this.graphic,t),void(t?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight))}"ellipse"===this.type&&"extrudedHeight"===e?this.changeHeightPoint(t):"ellipse"===this.type&&"height"===e&&(this.changeEditPoint(t),this.entity.thisHeight=t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("radius"),t=this.getValue("position");if("ellipse"===this.type||this.entity.isSphere){if("ellipse"===this.type&&void 0!==this.getValue("height")){var i=this.getValue("height"),r=h.toDegrees(t);t=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,i)}var o=h.GetPositionFromA_D(t,e,90);return this.entity.pottingPoint=[o,t],[o,t]}var n=h.toDegrees(t);t=Cesium.Cartesian3.fromDegrees(n.lon,n.lat,n.height-this.getValue("length")/2);var a=h.GetPositionFromA_D(t,e,90);return this.entity.pottingPoint=[a,t],[a,t]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var t=d.entities.add({name:"_size_point",position:e[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});t.angle=90,Z.editPointID.size.push(t.id),Z.editPointID.move=d.entities.add({name:"_move_point",position:e[1],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}}else if("rectangle"===e){var m=SmartEarthPopupData.editGraphic.getValue("material");m.color?v(m.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var p=SmartEarthPopupData.editGraphic.getValue("outlineColor");p?_(p):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){var i=this;if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("positions"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return Cesium.Rectangle.fromCartesianArray(t)},!1));if("coordinates"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return t},!1));if("clampToGround"===e){var r=function(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);var r=t.coordinates.getValue();t.coordinates=new Cesium.CallbackProperty(function(){return r},!1)};return this.graphic.coordinates instanceof Cesium.CallbackProperty?(this.graphic.coordinates=this.graphic.coordinates.getValue(),setTimeout(function(){r(i.entity,i.graphic,t)},100)):r(this.entity,this.graphic,t),void(t?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight))}"extrudedHeight"===e?this.changeHeightPoint(t):"height"===e&&(this.changeEditPoint(t),this.entity.thisHeight=t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("coordinates"),t=void 0,i=void 0,r=this.getValue("height");return i=(void 0!==r?t=Cesium.Cartesian3.fromRadians(e.west,e.north,r):(r=d.scene.sampleHeight(new Cesium.Cartographic(e.west,e.north,0),[this.entity]),t=Cesium.Cartesian3.fromRadians(e.west,e.north,r),r=d.scene.sampleHeight(new Cesium.Cartographic(e.east,e.south,0),[this.entity])),Cesium.Cartesian3.fromRadians(e.east,e.south,r)),this.entity.pottingPoint=[t,i],[t,i]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){var r=this;this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var o=new Cesium.Cartesian3;e.forEach(function(e,t){var i=d.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:r.graphic.heightReference&&r.graphic.heightReference.getValue()}});Z.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=e.length,o.y/=e.length,o.z/=e.length,Z.editPointID.move=d.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}}else if("box"===e){var g=SmartEarthPopupData.editGraphic.getValue("material");g.color?v(g.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var f=SmartEarthPopupData.editGraphic.getValue("outlineColor");f?_(f):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("long"===e||"width"===e||"height"===e){var i=this.getValue("dimensions");if("long"===e?i.x=t:"width"===e?i.y=t:i.z=t,this.graphic.dimensions=new Cesium.CallbackProperty(function(){return i},!1),"long"===e||"width"===e){var r="long"===e?90:180,o="long"===e?0:1,n=Z.editPointID.move.position.getValue(),a=h.GetPositionFromA_D(n,t/2,r);d.entities.getById(Z.editPointID.size[o]).position=a,this.entity.pottingPoint[o]=a,this.entity.pottingPoint[this.entity.pottingPoint.length-1]=n}else{var s=h.toDegrees(Z.editPointID.move.position.getValue());this.entity.position=Cesium.Cartesian3.fromDegrees(s.lon,s.lat,s.height+t/2),this.changeHeightPoint(s.height+t)}return}if("dimensions"===e)return void(this.graphic.dimensions=new Cesium.CallbackProperty(function(){return t},!1))}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("dimensions"),t=this.getValue("position"),i=h.toDegrees(t);t=Cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height-e.z/2);var r=h.GetPositionFromA_D(t,e.x/2,90),o=h.GetPositionFromA_D(t,e.y/2,180);return this.entity.pottingPoint=[r,o,t],[r,o,t]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var t=d.entities.add({name:"_size_point",position:e[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});t.angle=90;var i=d.entities.add({name:"_size_point",position:e[1],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});i.angle=180,Z.editPointID.size.push(t.id),Z.editPointID.size.push(i.id),Z.editPointID.move=d.entities.add({name:"_move_point",position:e[2],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}}else"corridor"===e||"ellipsoid"===e&&c.isSphere;function v(e){SmartEarthPopupData.editGraphic.fillColor=y("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.alpha=100*e.alpha}function _(e){SmartEarthPopupData.editGraphic.outlineColor=y("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.outlineAlpha=100*e.alpha}function y(e){var t=e;if(/^(rgb|RGB)/.test(t)){for(var i=t.replace(/(rgb|RGB)*/g,""),r=(i=i.replace("(","").replace(")","")).split(","),o="#",n=0;n<r.length;n++){var a=Number(r[n]).toString(16);"0"===(a=1===a.length?"0"+a:a)&&(a+=a),o+=a}return 7!==o.length&&(o=t),o}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t))return t;var s=t.replace(/#/,"").split("");if(6===s.length)return t;if(3===s.length){for(var l="#",u=0;u<s.length;u+=1)l+=s[u]+s[u];return l}}},o}),define("SGWorld/VectorTileProvider/GeoJSONVectorTileProvider",["../Navigate/getPosition","../Core/Core","../ProjectTree/treeSource"],function(p,g,te){"use strict";var n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],r=!0,o=!1,n=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){o=!0,n=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw n}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof2(e)};function h(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function e(e,t,i){this._viewer=e,this._cesium=t,this._Cesium=i.Cesium,this._url=i.url,this._urlParams=i.urlParams,this._urlTemplate=this._url+"?"+this._serialize(this._urlParams),this._rectangle=i.rectangle,this._maximumLevel=i.maximumLevel||19,this._minimumLevel=i.minimumLevel||1,this._tilingScheme=i.tilingScheme||new this._Cesium.GeographicTilingScheme,this._tileRangeByLevel={},this._moveEndTimestamp=null,this._isRemoved=!1,this._isCameraMoving=!1,this._propertyToBeFiltered=null,this._valuesToBeFiltered=null,this._primitiveByTile={},this._tileKeys=[],this._lowerLevelLimit=i.lowerLevelLimit||1,this._upperLevelLimit=i.upperLevelLimit||null,this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._cameraMoveStartHandler=this._cameraMoveStartHandler.bind(this),this.heightById={};for(var r=this._radianToDegree(this._rectangle.west),o=this._radianToDegree(this._rectangle.south),n=this._radianToDegree(this._rectangle.east),a=this._radianToDegree(this._rectangle.north),s=this._minimumLevel;s<=this._maximumLevel;s++){var l=this._lonLatToTileInWGS84([r,o],s),u=this._lonLatToTileInWGS84([n,a],s),c=Math.min(l[0],u[0]),h=Math.max(l[0],u[0]),d=Math.min(l[1],u[1]),m=Math.max(l[1],u[1]);this._tileRangeByLevel[s]={minCol:d,maxCol:m,minRow:c,maxRow:h}}this._tileRangeByLevel[0]={minCol:0,maxCol:0,minRow:0,maxRow:0},this._primitiveCollection=new this._Cesium.PrimitiveCollection,this._stop=!1,this._core=new g,this.tooltip=this._core.CreateTooltip(),this._getPosition=new p(this._viewer,this._cesium)}return e.prototype._serialize=function(e){var t=[],i=window.encodeURIComponent;for(var r in e){var o=e[r];"object"===(void 0===o?"undefined":a(o))?t.push(i(r)+"="+i(JSON.stringify(o))):t.push(i(r)+"="+i(e[r]))}return t.join("&")},e.prototype._fetch=function(o){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(t,i){var r=new XMLHttpRequest;if(r.open(n.method||"GET",o),n.headers)for(var e in n.headers)r.setRequestHeader(e,n.headers[e]);r.onload=function(){if(4===r.readyState&&200===r.status)try{var e=JSON.parse(r.responseText);t(e)}catch(e){i(new Error("INVALID RESPONSE"))}},r.onerror=function(e){i(e)},r.onloadend=function(e){200!==e.target.status&&i(new Error("["+e.target.status+"]request failed: "+o))},r.send(n.body||null)})},e.prototype._lonLatToTileInWGS84=function(e,t){var i=n(e,2),r=i[0],o=i[1];return[Math.floor(Math.pow(2,t)*(90-o)/180),Math.floor(Math.pow(2,t)*(180+r)/180)]},e.prototype._radianToDegree=function(e){return e/Math.PI*180},e.prototype._isTileInRange=function(e){try{var t=this._tileRangeByLevel[e.level],i=t.minCol,r=t.maxCol,o=t.minRow,n=t.maxRow;return e.x>=i&&e.x<=r&&e.y>=o&&e.y<=n}catch(e){return!1}},e.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0},e.prototype._loadTile=function(e){var l=[],u=new this._Cesium.ColorGeometryInstanceAttribute(.75,.75,.75,1),c=this;return e.features.forEach(function(e){if(c._propertyToBeFiltered&&Array.isArray(c._valuesToBeFiltered)){var t=e.properties[c._propertyToBeFiltered];if(c._valuesToBeFiltered.includes(t))return}var i=e.geometry.type;if("Polygon"===i||"MultiPolygon"===i){var s=[];c.heightById[e.properties.house_id]=e.properties.height,e.geometry.coordinates.forEach(function(e,i){s.push([]),e.forEach(function(e){var t;2<e.length?e.forEach(function(e){var t;2<=e.length&&(t=s[i]).push.apply(t,h(e))}):(t=s[i]).push.apply(t,h(e))});var t=new c._Cesium.PolygonHierarchy(c._Cesium.Cartesian3.fromDegreesArray(s[i])),r=c._Cesium.BoundingSphere.fromPoints(t.positions).center,o=c._viewer.scene.globe.getHeight(c._Cesium.Cartographic.fromCartesian(r))||0,n=new c._Cesium.PolygonGeometry({polygonHierarchy:t,height:o,vertexFormat:c._Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,extrudedHeight:1e3}),a=new c._Cesium.GeometryInstance({geometry:n,attributes:{color:u}});l.push(a)})}else console.warn('GeoJSONVectorTileProvider: geometry type "'+e.geometry.type+'" detected, but is not going to be rendered')}),new this._Cesium.Primitive({allowPicking:!1,appearance:new this._Cesium.PerInstanceColorAppearance({translucent:!1}),geometryInstances:l})},e.prototype._cameraMoveEndHandler=function(){if(!this._stop){var o=this,n=Date.now(),e=this._viewer.scene.globe._surface._tilesToRender,t=e.map(function(e){return e.level}),i=Math.min.apply(Math,h(t)),r=Math.max.apply(Math,h(t));if(r<this._lowerLevelLimit)return o._tileKeys=[],o._removeObsoletePrimitives(o._primitiveByTile,[]),void(e=[]);if(this._upperLevelLimit&&i>this._upperLevelLimit)return o._tileKeys=[],o._removeObsoletePrimitives(o._primitiveByTile,[]),void(e=[]);2<r-i&&(e=e.filter(function(e){return e.level>=r-2})),e.sort(function(e,t){return-(e.level-t.level)}),e=e.filter(function(e){return o._isTileInRange(e)}),this._upperLevelLimit&&(e=this._refineTiles(e,this._upperLevelLimit)),this._isCameraMoving=!1,this._moveEndTimestamp=n;var a=[],s=0,l=0;e.forEach(function(i){var r="z"+i.level+"x"+i.x+"y"+i.y;if(a.push(r),o._tileKeys.push(r),!o._primitiveByTile[r]){var e=o._urlTemplate.replace(window.encodeURIComponent("{x}"),i.x).replace(window.encodeURIComponent("{y}"),i.y).replace(window.encodeURIComponent("{z}"),i.level);s++,o._fetch(e).then(function(e){if(o._isRemoved)throw new Error("DISCARD");if(o._isCameraMoving)throw new Error("DISCARD");if(n!==o._moveEndTimestamp)throw new Error("DISCARD");var t=o._loadTile(e,i);o._primitiveCollection.add(t),o._primitiveByTile[r]=t,s<=++l&&(o._tileKeys=a,o._removeObsoletePrimitives(o._primitiveByTile,a))}).catch(function(e){s<=++l&&(o._tileKeys=a,o._removeObsoletePrimitives(o._primitiveByTile,a)),e.message})}})}},e.prototype._refineTiles=function(e,c){var h=[],d=[];return e.forEach(function(e){var t="Z"+e.level+"X"+e.x+"Y"+e.y;if(e.level<c-1)d.includes(t)||(h.push(e),d.push(t));else if(e.level===c-1)for(var i=0;i<2;i++)for(var r=0;r<2;r++){var o="Z"+(e.level+1)+"X"+(2*e.x+i)+"Y"+(2*e.y+r);d.includes(o)||(h.push({x:2*e.x+i,y:2*e.y+r,level:e.level+1}),d.push(o))}else{var n=e.level-c;if(0===n)d.includes(t)||(h.push(e),d.push(t));else{var a=2*n,s=Math.floor(e.x/a),l=Math.floor(e.y/a),u="Z"+c+"X"+s+"Y"+l;d.includes(u)||(h.push({x:s,y:l,level:c}),d.push(u))}}}),h},e.prototype._removeObsoletePrimitives=function(e,t){var i=[];for(var r in 0<t.length&&(i=t),e){if(!i.includes(r))this._primitiveCollection.remove(e[r])&&delete e[r]}},e.prototype.addTo=function(e){this._viewer=e,this._viewer.scene.primitives.add(this._primitiveCollection,this.availability),this._isRemoved=!1,this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.addEventListener(this._cameraMoveStartHandler),this._cameraMoveEndHandler()},e.prototype.remove=function(){if(this._viewer){for(var e in this._primitiveByTile)this._viewer.scene.primitives.remove(this._primitiveByTile[e]);this._primitiveByTile={},this._viewer.camera.moveEnd.removeEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.removeEventListener(this._cameraMoveStartHandler),this._viewer=null,this._isRemoved=!0}},e.prototype.setStatus=function(e){this._stop=e,this._primitiveCollection._availability&&e?this._primitiveCollection._availability=void 0:this.availability&&!e&&(this._primitiveCollection._availability=this.availability)},e.prototype.isRemoved=function(){return this._isRemoved},e.prototype.filterBy=function(e,t,i){this._propertyToBeFiltered=e,this._valuesToBeFiltered=t},e.prototype.removeFilter=function(){this._propertyToBeFiltered=null,this._valuesToBeFiltered=null},e.prototype.edit=function(e,h){var Y=this,X=this._viewer;if(!h&&(h={}),this.editHandler&&(this.editHandler.destroy(),this.editHandler=void 0),void 0===e&&(e=!0),e){var J,Q,K,$;this.editHandler=new this._cesium.ScreenSpaceEventHandler(X.scene.canvas),this.isEditting=!1;var Z=void 0;return this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))Y.isEditting&&(ee(),Y.defaultEvent(!1));else{var t=e.position,i=X.scene.pick(t);if((!i||!i.id||i.id.treeID===Y.treeID)&&i&&i.id&&(i.id instanceof Cesium.Entity||i.id.VectorType)){var r=i.id;Y.isEditting||0!=te.states?(r!=J||"point"!==r.VectorType&&"billboard"!==r.VectorType&&"label"!==r.VectorType&&"model"!==r.VectorType)&&"_height_point"!=r.name&&"_edit_point"!=r.name&&"_move_point"!=r.name&&"_add_point"!=r.name&&"_size_point"!=r.name||(X.container.style.cursor="crosshair",Y.defaultEvent(!1),"_height_point"==r.name?(K={windowPosition:t,originHeight:Y._cesium.Cartographic.fromCartesian(r.position.getValue()).height},Z="_height_point"):"_move_point"==r.name?Z="_move_point":"point"===r.VectorType||"billboard"===r.VectorType||"label"===r.VectorType||"model"===r.VectorType?(Y.tooltip.showAt(e.position,"释放后完成修改"),Z="_move_point","model"===r.VectorType&&(r.show=!1)):"_edit_point"==r.name?Z="_edit_point":"_add_point"==r.name?Z="_add_point":"_size_point"==r.name&&(Z="_size_point"),Q=r):(h.callBack&&h.callBack.start&&h.callBack.start(r),$=r.VectorType,(J=Y.createEditEntity($,r.VectorStyle)).feature=r,J.treeID=Y.treeID,Y.getSimpleGraphicData($,J),"point"===$||"billboard"===$||"label"===$||"model"===$?(Y.isEditting=!0,Y.tooltip.showAt(e.position,"拖拽修改位置")):(Y.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint(),SmartEarthPopupData.editGraphic.setTreeID(Y.treeID)),Y.setStatus(!0),te.editVector=!0,Y._primitiveCollection.show=!1)}}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))Y.isEditting&&(ee(),Y.defaultEvent(!1));else{var t=X.scene.pick(e.endPosition);if((!t||!t.id||t.id.treeID===Y.treeID)&&(Y._cesium.defined(t)?Y.isEditting&&!Q?"point"!==$&&"billboard"!==$&&"label"!==$&&"model"!==$||t.id!=J?t.id&&"_edit_point"===t.id.name&&J.pottingPoint?("polyline"===$||"wall"===$)&&2<J.pottingPoint.length?Y.tooltip.showAt(e.endPosition,"拖拽修改位置,右键删除点"):"polygon"===$&&3<J.pottingPoint.length?Y.tooltip.showAt(e.endPosition,"拖拽修改位置,右键删除点"):Y.tooltip.showAt(e.endPosition,"拖拽修改位置"):!t.id||"_move_point"!==t.id.name&&"_size_point"!==t.id.name?t.id&&"_add_point"===t.id.name?Y.tooltip.showAt(e.endPosition,"拖拽增加节点"):t.id&&"_height_point"===t.id.name?Y.tooltip.showAt(e.endPosition,"拖拽修改高度"):t.id==J&&Y.tooltip.show(!1):Y.tooltip.showAt(e.endPosition,"拖拽修改位置"):Y.tooltip.showAt(e.endPosition,"拖拽修改位置,右键删除"):Y.isEditting||0!==te.states||(t.id&&t.id.VectorType?Y.tooltip.showAt(e.endPosition,"点击激活编辑"):Y.tooltip.show(!1)):0!=te.states||Q||Y.tooltip.show(!1),Y.isEditting&&Q)){Y.tooltip.showAt(e.endPosition,"释放后完成修改");var i=Y._getPosition.getMousePosition(e);if(!i&&"_height_point"!==Z)return;if("_edit_point"===Z){Q.position=i;var r=te.editPointID.edit.indexOf(Q.id);if(void 0!==J[$].height){var o=Y.toDegrees(i);J.pottingPoint[r]=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,J[$].height.getValue()),Q.position=J.pottingPoint[r]}else J.pottingPoint[r]=i;if(0<te.editPointID.add.length){if(0<r){var n=X.entities.getById(te.editPointID.add[r-1]);if(n){var a=X.entities.getById(te.editPointID.edit[r-1]),s=X.entities.getById(te.editPointID.edit[r]);n.position=Cesium.Cartesian3.midpoint(a.position.getValue(),s.position.getValue(),new Cesium.Cartesian3)}}if(r<J.pottingPoint.length-1){var l=X.entities.getById(te.editPointID.add[r]);if(l){var u=X.entities.getById(te.editPointID.edit[r]),c=X.entities.getById(te.editPointID.edit[r+1]);l.position=Cesium.Cartesian3.midpoint(u.position.getValue(),c.position.getValue(),new Cesium.Cartesian3)}}if("polygon"===$&&(0===r||r===J.pottingPoint.length-1)){var h=X.entities.getById(te.editPointID.add[te.editPointID.add.length-1]);if(h){var d=X.entities.getById(te.editPointID.edit[0]),m=X.entities.getById(te.editPointID.edit[J.pottingPoint.length-1]);h.position=Cesium.Cartesian3.midpoint(d.position.getValue(),m.position.getValue(),new Cesium.Cartesian3)}}}var p=J.pottingPoint.concat([]),g=new Y._cesium.Cartesian3,f=p.length;p.forEach(function(e){g.x+=e.x,g.y+=e.y,g.z+=e.z}),g.x/=f,g.y/=f,g.z/=f,te.editPointID.move&&(te.editPointID.move.position=g),"polyline"!==$&&"wall"!==$&&"polygon"!==$&&"rectangle"!==$||SmartEarthPopupData.editGraphic.setValue("positions",p)}else if("_height_point"===Z){var v=te.editPointID.height.indexOf(Q.id),_=X.entities.getById(te.editPointID.edit[v]);"ellipse"!==$&&"cylinder"!==$&&"box"!==$||(_=te.editPointID.move);var y=Y.toDegrees(_.position.getValue()),C=K.originHeight-y.height,w=X.scene.cartesianToCanvasCoordinates(_.position.getValue()),b=(K.windowPosition.y-e.endPosition.y)*C/Math.abs(w.y-K.windowPosition.y),E=Math.abs(C+b);te.editPointID.height.forEach(function(e){var t=X.entities.getById(e);if(t){var i=t.position.getValue(),r=Y.toDegrees(i);t.position=Y._cesium.Cartesian3.fromDegrees(r.lon,r.lat,E+y.height)}}),J[$].extrudedHeight?J[$].extrudedHeight=E+y.height:"box"===$?SmartEarthPopupData.editGraphic.setValue("height",E):"cylinder"===$&&SmartEarthPopupData.editGraphic.setValue("length",E)}else if("_add_point"===Z){var S=te.editPointID.add.indexOf(Q.id);X.entities.remove(Q);var P=X.entities.add({name:"_edit_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});te.editPointID.edit.splice(S+1,0,P.id),J.pottingPoint.splice(S+1,0,i.clone());var x=Cesium.Cartesian3.midpoint(J.pottingPoint[S],J.pottingPoint[S+1],new Cesium.Cartesian3),T=X.entities.add({name:"_add_point",position:x,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),I=Cesium.Cartesian3.midpoint(J.pottingPoint[S+1],J.pottingPoint[S+2===J.pottingPoint.length?0:S+2],new Cesium.Cartesian3),D=X.entities.add({name:"_add_point",position:I,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});te.editPointID.add.splice(S,1,T.id,D.id),SmartEarthPopupData.editGraphic.setTreeID(Y.treeID),Q=P,Z="_edit_point";var L=J.pottingPoint.concat([]);if("polyline"===$||"polygon"===$)SmartEarthPopupData.editGraphic.setValue("positions",L);else if("wall"===$){SmartEarthPopupData.editGraphic.setValue("positions",L);var M=SmartEarthPopupData.editGraphic.getValue("minimumHeights"),A=SmartEarthPopupData.editGraphic.getValue("maximumHeights");M.push(M[0]),A.push(A[0]),SmartEarthPopupData.editGraphic.setValue("minimumHeights",M),SmartEarthPopupData.editGraphic.setValue("maximumHeights",A)}}else if("_size_point"===Z){var R=te.editPointID.move.position.getValue(),O=Y._cesium.Cartesian3.distance(R,i);if("ellipse"===$||"cylinder"===$||"ellipsoid"===$&&J.isSphere)SmartEarthPopupData.editGraphic.setValue("radius",O);else if("box"===$){var N=90===Q.angle?"long":"width";SmartEarthPopupData.editGraphic.setValue(N,2*O)}}else{if("point"===$||"billboard"===$||"label"===$||"model"===$)return void(Q.position=i);var V=Y.toDegrees(i);K=Q.position.getValue();var F=Y.toDegrees(K),H=V.lon-F.lon,G=V.lat-F.lat,k=V.height-F.height;if(Q.position=i,J[$].height){var B=Y.toDegrees(i).height;J[$].height=B,J.thisHeight=B}J.pottingPoint.forEach(function(e,t){var i,r=void 0,o=X.entities.getById(te.editPointID.edit[t]);if(o||(o=X.entities.getById(te.editPointID.size[t])),r=o?Y.toDegrees(o.position.getValue()):Y.toDegrees(e),i=Y._cesium.Cartesian3.fromDegrees(r.lon+H,r.lat+G,r.height+k),e.x=i.x,e.y=i.y,e.z=i.z,o&&(o.position=i),0<te.editPointID.add.length&&te.editPointID.add[t]){var n=X.entities.getById(te.editPointID.add[t]);n&&(r=Y.toDegrees(n.position.getValue()),n.position=Y._cesium.Cartesian3.fromDegrees(r.lon+H,r.lat+G,r.height+k))}});var j=J.pottingPoint.concat([]);if("polyline"===$||"wall"===$||"polygon"===$||"rectangle"===$)SmartEarthPopupData.editGraphic.setValue("positions",j);else if("ellipse"===$)J.pottingPoint[1]=i,J.position=i.clone();else if("box"===$){J.pottingPoint[2]=i;var z=J.box.dimensions.getValue(),W=Y.toDegrees(i);J.position=Cesium.Cartesian3.fromDegrees(W.lon,W.lat,W.height+z.z/2)}else if("cylinder"===$){J.pottingPoint[1]=i;var U=J.cylinder.length.getValue(),q=Y.toDegrees(J.pottingPoint[1]);J.position=Cesium.Cartesian3.fromDegrees(q.lon,q.lat,q.height+U/2)}else"ellipsoid"===$&&(J.pottingPoint[J.pottingPoint.length-1]=i,J.position=i.clone())}}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.editHandler.setInputAction(function(e){Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?Y.isEditting&&(ee(),Y.defaultEvent(!1)):(Q&&"model"===Q.VectorType&&(Q.show=!0),Q&&h.callBack&&h.callBack.updata&&h.callBack.updata(Q.name,J),X.container.style.cursor="default",Q=void 0,Y.defaultEvent(!0))},this._cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))Y.isEditting&&(ee(),Y.defaultEvent(!1));else{var t=X.scene.pick(e.position);if((!t||!t.id||t.id.treeID===Y.treeID)&&Y._cesium.defined(t)&&0==te.states){var i=t.id;if(i.VectorType);else if(-1<te.editPointID.edit.indexOf(i.id)&&(("polyline"===$||"wall"===$)&&2<te.editPointID.edit.length||"polygon"===$&&3<te.editPointID.edit.length)){var r=te.editPointID.edit.indexOf(i.id);if(X.entities.removeById(i.id),te.editPointID.edit.splice(r,1),J.pottingPoint.splice(r,1),0<te.editPointID.add.length)if(te.editPointID.add[r]){if(X.entities.removeById(te.editPointID.add[r]),te.editPointID.add.splice(r,1),0<=r-1){var o=X.entities.getById(te.editPointID.add[r-1]);o&&(o.position=Cesium.Cartesian3.midpoint(J.pottingPoint[r-1],J.pottingPoint[r===J.pottingPoint.length?0:r],new Cesium.Cartesian3))}else if(r-1==-1&&"polygon"===$){var n=X.entities.getById(te.editPointID.add[te.editPointID.add.length-1]);n&&(n.position=Cesium.Cartesian3.midpoint(J.pottingPoint[0],J.pottingPoint[J.pottingPoint.length-1],new Cesium.Cartesian3))}}else X.entities.removeById(te.editPointID.add[r-1]),te.editPointID.add.pop();var a=new Y._cesium.Cartesian3,s=J.pottingPoint.length;J.pottingPoint.forEach(function(e){a.x+=e.x,a.y+=e.y,a.z+=e.z}),a.x/=s,a.y/=s,a.z/=s,te.editPointID.move&&(te.editPointID.move.position=a);var l=J.pottingPoint.concat([]);if("polyline"===$||"polygon"===$)SmartEarthPopupData.editGraphic.setValue("positions",l);else if("wall"===$){SmartEarthPopupData.editGraphic.setValue("positions",l);var u=SmartEarthPopupData.editGraphic.getValue("minimumHeights"),c=SmartEarthPopupData.editGraphic.getValue("maximumHeights");u.pop(),c.pop(),SmartEarthPopupData.editGraphic.setValue("minimumHeights",u),SmartEarthPopupData.editGraphic.setValue("maximumHeights",c)}Y.tooltip.show(!1),h.callBack&&h.callBack.updata&&h.callBack.updata(Q&&Q.name,J)}}}},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),ee(),{endThisEdit:ee,getEditData:function(){return{entity:J}}}}function ee(){Y.defaultEvent(!0),te.editPointID.edit.forEach(function(e){X.entities.removeById(e)}),te.editPointID.edit=[],te.editPointID.height.forEach(function(e){X.entities.removeById(e)}),te.editPointID.height=[],te.editPointID.add.forEach(function(e){X.entities.removeById(e)}),te.editPointID.add=[],te.editPointID.size.forEach(function(e){X.entities.removeById(e)}),te.editPointID.size=[],te.editPointID.move&&X.entities.remove(te.editPointID.move),te.editPointID.move=void 0,J&&X.entities.remove(J),$=J=void 0,SmartEarthPopupData.editGraphic={},Y.isEditting=!1,Y.setStatus(!1),te.editVector=!1,Y._primitiveCollection.show=!0,Y.delButton(!1)}ee()},e.prototype.createEditEntity=function(e,t){var i=void 0,r=this,o=this._viewer;if("polygon"===e){var n=t.positions,a=r._core.defaultValue(t.height,void 0),s=void 0;s=t.hierarchy?t.hierarchy:(n=t.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(n):r._cesium.Cartesian3.fromDegreesArray(n),new r._cesium.PolygonHierarchy(n)),(i=o.entities.add({polygon:{hierarchy:new r._cesium.CallbackProperty(function(){return s},!1),extrudedHeight:r._core.defaultValue(t.extrudedHeight,void 0),height:a,material:new r._cesium.ImageMaterialProperty({image:r._core.defaultValue(t.image,null),repeat:r._core.defaultValue(t.repeat,new r._cesium.Cartesian2(1,1)),color:t.material}),shadows:r._cesium.ShadowMode.ENABLED,fill:!0}})).VectorType="polygon"}else if("polyline"===e){var l=t.positions;l=t.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(l):r._cesium.Cartesian3.fromDegreesArray(l),(i=o.entities.add({polyline:{positions:new r._cesium.CallbackProperty(function(){return l},!1),clampToGround:r._core.defaultValue(t.clampToGround,!1),material:new Cesium.PolylineOutlineMaterialProperty({color:t.material,outlineWidth:r._core.defaultValue(t.outlineWidth,0),outlineColor:r._cesium.Color.fromCssColorString(r._core.defaultValue(t.outlineColor,"rgba(255,255,255,0.6)"))}),width:r._core.defaultValue(t.width,3)}})).VectorType="polyline"}else if("wall"===e){var u=t.positions;u=t.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(u):r._cesium.Cartesian3.fromDegreesArray(u),(i=o.entities.add({wall:{positions:new r._cesium.CallbackProperty(function(){return u},!1),minimumHeights:t.minimumHeights,maximumHeights:t.maximumHeights,material:t.material,outline:!0,outlineWidth:r._core.defaultValue(t.outlineWidth,0),outlineColor:t.outlineColor}})).VectorType="wall"}else"label"===e?(i=o.entities.add({position:t.position,label:{text:t.text,font:t.font,scale:t.scale,style:t.style,fillColor:t.fillColor,outlineColor:t.outlineColor,outlineWidth:t.outlineWidth,showBackground:t.showBackground,backgroundColor:t.backgroundColor,heightReference:t.heightReference,horizontalOrigin:t.horizontalOrigin,verticalOrigin:t.verticalOrigin,scaleByDistance:t.scaleByDistance,distanceDisplayCondition:t.distanceDisplayCondition}})).VectorType="label":"billboard"===e&&((i=o.entities.add({position:t.position,billboard:{rotation:t.rotation,width:t.width,height:t.height,image:t.image,color:t.color,scale:t.scale,heightReference:t.heightReference,horizontalOrigin:t.horizontalOrigin,verticalOrigin:t.verticalOrigin,scaleByDistance:t.scaleByDistance,distanceDisplayCondition:t.distanceDisplayCondition}})).VectorType="billboard");return i},e.prototype.delButton=function(e,t,i){if(e){var r=document.getElementById("DeleteMilitaryStandardDelete");r||((r=document.createElement("button")).id="DeleteMilitaryStandardDelete",r.innerText="删除对象",r.style.cssText="height: 38px;\n line-height: 38px;\n padding: 0 18px;\n background-color: #052355;\n color: #fff;\n white-space: nowrap;\n text-align: center;\n font-size: 14px;\n border: none;\n border-radius: 2px;\n cursor: pointer;\n position: absolute;",this._viewer.container.appendChild(r)),r.style.display="block",r.style.top=t.y+"px",r.style.left=t.x+"px",r.onclick=i}else{var o=document.getElementById("DeleteMilitaryStandardDelete");o&&(o.style.display="none",o.onclick=null)}},e.prototype.defaultEvent=function(e){var t=this._viewer.scene;t.screenSpaceCameraController.enableRotate=e,t.screenSpaceCameraController.enableTranslate=e,t.screenSpaceCameraController.enableZoom=e,t.screenSpaceCameraController.enableTilt=e,t.screenSpaceCameraController.enableLook=e},e.prototype.getEntityTypeAndObject=function(e){var t={type:"",object:null};return e&&(e.billboard?(t.type="billboard",t.object=e.billboard):e.box?(t.type="box",t.object=e.box):e.corridor?(t.type="corridor",t.object=e.corridor):e.cylinder?(t.type="cylinder",t.object=e.cylinder):e.ellipse?(t.type="ellipse",t.object=e.ellipse):e.ellipsoid?(t.type="ellipsoid",t.object=e.ellipsoid):e.label?(t.type="label",t.object=e.label):e.model?(t.type="model",t.object=e.model):e.path?(t.type="path",t.object=e.path):e.plane?(t.type="plane",t.object=e.plane):e.point?(t.type="point",t.object=e.point):e.polygon?(t.type="polygon",t.object=e.polygon):e.polyline?(t.type="polyline",t.object=e.polyline):e.polylineVolume?(t.type="polylineVolume",t.object=e.polylineVolume):e.rectangle?(t.type="rectangle",t.object=e.rectangle):e.wall&&(t.type="wall",t.object=e.wall)),t},e.prototype.toDegrees=function(e){var t=this._cesium.Cartographic.fromCartesian(e);return{lon:this._cesium.Math.toDegrees(t.longitude),lat:this._cesium.Math.toDegrees(t.latitude),height:t.height}},e.prototype.getSimpleGraphicData=function(e,c){var t,h=this,d=this._viewer;if(SmartEarthPopupData.editGraphic={entity:c,type:e,graphic:c[e],getValue:function(e){if("position"===e||"name"===e||"id"===e)return this.entity[e]&&(this.entity[e].getValue?this.entity[e].getValue():this.entity[e]);if("radius"===e){if("ellipse"===this.type)return this.graphic.semiMajorAxis.getValue();if("ellipsoid"===this.type)return this.graphic.radii.getValue().x;if("cylinder"===this.type)return this.graphic.bottomRadius.getValue()}else{if("pHeight"!==e)return"repeat"===e?this.graphic.material[e]&&(this.graphic.material[e].getValue?this.graphic.material[e].getValue():this.graphic.material[e]):this.graphic[e]&&(this.graphic[e].getValue?this.graphic[e].getValue():this.graphic[e]);if(this.getValue("position")){var t=this.getValue("position");return Cesium.Cartographic.fromCartesian(t).height}}},changeHeightPoint:function(o){0<te.editPointID.height.length&&te.editPointID.height.forEach(function(e){var t=d.entities.getById(e);if(t){var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}})},changeEditPoint:function(o){0<te.editPointID.edit.length&&te.editPointID.edit.forEach(function(e){var t=d.entities.getById(e);if(t)if("clampToGround"===o)t.point.heightReference=1;else{t.point.heightReference=0;var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}}),0<te.editPointID.size.length&&te.editPointID.size.forEach(function(e){var t=d.entities.getById(e);if(t)if("clampToGround"===o)t.point.heightReference=1;else{t.point.heightReference=0;var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}}),0<te.editPointID.add.length&&te.editPointID.add.forEach(function(e){var t=d.entities.getById(e);if(t)if("clampToGround"===o)t.point.heightReference=1;else{t.point.heightReference=0;var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}});var e=te.editPointID.move;if(e)if("clampToGround"===o)e.point.heightReference=1;else{e.point.heightReference=0;var t=e.position.getValue(),i=h.toDegrees(t);e.position=Cesium.Cartesian3.fromDegrees(i.lon,i.lat,o)}},clearAllEditPoint:function(){te.editPointID.edit.forEach(function(e){d.entities.removeById(e)}),te.editPointID.edit=[],te.editPointID.height.forEach(function(e){d.entities.removeById(e)}),te.editPointID.height=[],te.editPointID.add.forEach(function(e){d.entities.removeById(e)}),te.editPointID.add=[],te.editPointID.size.forEach(function(e){d.entities.removeById(e)}),te.editPointID.size=[],te.editPointID.move&&d.entities.remove(te.editPointID.move),te.editPointID.move=void 0},setTreeID:function(t){te.editPointID.edit.forEach(function(e){d.entities.getById(e).treeID=t}),te.editPointID.height.forEach(function(e){d.entities.getById(e).treeID=t}),te.editPointID.add.forEach(function(e){d.entities.getById(e).treeID=t}),te.editPointID.size.forEach(function(e){d.entities.getById(e).treeID=t}),te.editPointID.move&&(te.editPointID.move.treeID=t)}},"billboard"===e||"point"===e||"label"===e||"model"===e){var i=SmartEarthPopupData.editGraphic.getValue("color")||SmartEarthPopupData.editGraphic.getValue("fillColor");i?y(i):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var r=SmartEarthPopupData.editGraphic.getValue("outlineColor");if(r?C(r):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),"label"===e){var o=SmartEarthPopupData.editGraphic.getValue("backgroundColor");o?(t=o,SmartEarthPopupData.editGraphic.backgroundColor=w("rgb("+255*t.red+","+255*t.green+","+255*t.blue+")"),SmartEarthPopupData.editGraphic.backgroundAlpha=100*t.alpha):(SmartEarthPopupData.editGraphic.backgroundColor="#000000",SmartEarthPopupData.editGraphic.backgroundAlpha=80)}SmartEarthPopupData.editGraphic.setValue=function(e,t){if("position"===e||"name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e||"backgroundColor"===e||"fillColor"===e)t=Cesium.Color.fromCssColorString(t);else if("fontSize"===e){var i=this.getValue("font");(i=i.split(" "))[0]=t,t=i.join(" ")}else{if("alpha"===e)return void("label"===this.type?this.graphic.fillColor._value.alpha=t:this.graphic.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("backgroundAlpha"===e)return void(this.graphic.backgroundColor._value.alpha=t);if("pHeight"===e&&this.getValue("position")){var r=this.getValue("position"),o=Cesium.Cartographic.fromCartesian(r);return o.height=t,void(this.entity.position=Cesium.Cartographic.toCartesian(o))}}this.graphic[e]=t}}}else if("polyline"===e){var n=SmartEarthPopupData.editGraphic.getValue("material");n.color?y(n.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),n.outlineColor?C(n.outlineColor):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e)return t=Cesium.Color.fromCssColorString(t),void(this.graphic.material[e]=t);if("outlineWidth"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.material.outlineColor._value.alpha=t);if("positions"===e)return void(this.graphic[e]=new Cesium.CallbackProperty(function(){return t},!1));this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("positions");return this.entity.pottingPoint=e},SmartEarthPopupData.editGraphic.updataEditPoint=function(){var r=this;this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var o=new Cesium.Cartesian3;e.forEach(function(e,t){var i=d.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:r.graphic.heightReference&&r.graphic.heightReference.getValue()}});te.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=e.length,o.y/=e.length,o.z/=e.length,te.editPointID.move=d.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(var t=0;t<e.length-1;t++){var i=Cesium.Cartesian3.midpoint(e[t],e[t+1],new Cesium.Cartesian3),n=d.entities.add({name:"_add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});te.editPointID.add.push(n.id)}}}}else if("polygon"===e){var a=SmartEarthPopupData.editGraphic.getValue("material");a.color?y(a.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var s=SmartEarthPopupData.editGraphic.getValue("outlineColor");s?C(s):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,i){var t=this;if("name"===e)this.entity[e]=i;else{if("color"===e||"outlineColor"===e){if(i=Cesium.Color.fromCssColorString(i),"color"===e)return void(this.graphic.material.color=i)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=i);if("alpha"===e)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=i);if("positions"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(i)},!1));if("hierarchy"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return i},!1));if("clampToGround"===e){var r=function(e,t,i){i?(e.perPositionHeight=!1,e.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(e.perPositionHeight=!0,e.heightReference=Cesium.HeightReference.NONE),0<te.editPointID.edit.length&&!i&&t.forEach(function(e,t){var i=d.entities.getById(te.editPointID.edit[t]);if(i){var r=i.position.getValue();e.x=r.x,e.y=r.y,e.z=r.z}}),e.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(t)},!1)};return this.graphic.hierarchy instanceof Cesium.CallbackProperty?(this.graphic.hierarchy=this.graphic.hierarchy.getValue(),setTimeout(function(){r(t.graphic,t.entity.pottingPoint,i)},100)):r(this.graphic,this.entity.pottingPoint,i),void(0<te.editPointID.add.length&&te.editPointID.add.forEach(function(e){var t=d.entities.getById(e);t&&(t.point.heightReference=i?1:0)}))}"extrudedHeight"===e?this.changeHeightPoint(i):"height"===e&&this.changeEditPoint(i)}this.graphic[e]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("hierarchy").positions.concat([]);if(void 0!==this.getValue("height")){var r=this.getValue("height");e.forEach(function(e){var t=h.toDegrees(e),i=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,r);e.x=i.x,e.y=i.y,e.z=i.z})}return this.entity.pottingPoint=e},SmartEarthPopupData.editGraphic.updataEditPoint=function(){var r=this;this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var o=new Cesium.Cartesian3;e.forEach(function(e,t){var i=d.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:r.graphic.heightReference&&r.graphic.heightReference.getValue()}});te.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=e.length,o.y/=e.length,o.z/=e.length,te.editPointID.move=d.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(var t=0;t<e.length-1;t++){var i=Cesium.Cartesian3.midpoint(e[t],e[t+1],new Cesium.Cartesian3),n=d.entities.add({name:"_add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});te.editPointID.add.push(n.id)}var a=Cesium.Cartesian3.midpoint(e[0],e[e.length-1],new Cesium.Cartesian3),s=d.entities.add({name:"_add_point",position:a,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});te.editPointID.add.push(s.id)}}}else if("ellipse"===e||"cylinder"===e||c.isSphere){var l=SmartEarthPopupData.editGraphic.getValue("material");l.color?y(l.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var u=SmartEarthPopupData.editGraphic.getValue("outlineColor");u?C(u):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){var i=this;if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("semiMajorAxis"===e)return void(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return t},!1));if("semiMinorAxis"===e)return void(this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return t},!1));if("radii"===e)return void(this.graphic.radii=new Cesium.CallbackProperty(function(){return t},!1));if("topRadius"===e)return void(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return t},!1));if("bottomRadius"===e)return void(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return t},!1));if("radius"===e){"ellipse"===this.type?(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return t},!1),this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return t},!1)):"ellipsoid"===this.type?null!==this.graphic.material.image.getValue()?this.graphic.radii=new Cesium.Cartesian3(t,t,t):this.graphic.radii=new Cesium.CallbackProperty(function(){return new Cesium.Cartesian3(t,t,t)},!1):"cylinder"===this.type&&(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return t},!1),this.entity.changeTop&&(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return t},!1)));var r=te.editPointID.move.position.getValue(),o=h.GetPositionFromA_D(r,t,90);d.entities.getById(te.editPointID.size[0]).position=o,c.pottingPoint[0]=o,c.pottingPoint[c.pottingPoint.length-1]=r;var n=d.entities.getById(te.editPointID.height[0]);if(n){var a=h.toDegrees(o),s=h._cesium.Cartographic.fromCartesian(n.position.getValue());n.position=h._cesium.Cartesian3.fromDegrees(a.lon,a.lat,s.height)}return}if("cylinder"===this.type&&"length"===e){this.graphic.length=t;var l=h.toDegrees(this.entity.pottingPoint[1]);return this.entity.position=Cesium.Cartesian3.fromDegrees(l.lon,l.lat,l.height+t/2),void this.changeHeightPoint(l.height+t)}if("ellipse"===this.type&&"clampToGround"===e){var u=function(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);var r=t.semiMinorAxis.getValue();t.semiMinorAxis=new Cesium.CallbackProperty(function(){return r},!1),t.semiMajorAxis=new Cesium.CallbackProperty(function(){return r},!1)};return this.graphic.semiMinorAxis instanceof Cesium.CallbackProperty?(this.graphic.semiMinorAxis=this.graphic.semiMinorAxis.getValue(),this.graphic.semiMajorAxis=this.graphic.semiMajorAxis.getValue(),setTimeout(function(){u(i.entity,i.graphic,t)},100)):u(this.entity,this.graphic,t),void(t?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight))}"ellipse"===this.type&&"extrudedHeight"===e?this.changeHeightPoint(t):"ellipse"===this.type&&"height"===e&&(this.changeEditPoint(t),this.entity.thisHeight=t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("radius"),t=this.getValue("position");if("ellipse"===this.type||this.entity.isSphere){if("ellipse"===this.type&&void 0!==this.getValue("height")){var i=this.getValue("height"),r=h.toDegrees(t);t=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,i)}var o=h.GetPositionFromA_D(t,e,90);return this.entity.pottingPoint=[o,t],[o,t]}var n=h.toDegrees(t);t=Cesium.Cartesian3.fromDegrees(n.lon,n.lat,n.height-this.getValue("length")/2);var a=h.GetPositionFromA_D(t,e,90);return this.entity.pottingPoint=[a,t],[a,t]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var t=d.entities.add({name:"_size_point",position:e[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});t.angle=90,te.editPointID.size.push(t.id),te.editPointID.move=d.entities.add({name:"_move_point",position:e[1],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}}else if("rectangle"===e){var m=SmartEarthPopupData.editGraphic.getValue("material");m.color?y(m.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var p=SmartEarthPopupData.editGraphic.getValue("outlineColor");p?C(p):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){var i=this;if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("positions"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return Cesium.Rectangle.fromCartesianArray(t)},!1));if("coordinates"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return t},!1));if("clampToGround"===e){var r=function(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);var r=t.coordinates.getValue();t.coordinates=new Cesium.CallbackProperty(function(){return r},!1)};return this.graphic.coordinates instanceof Cesium.CallbackProperty?(this.graphic.coordinates=this.graphic.coordinates.getValue(),setTimeout(function(){r(i.entity,i.graphic,t)},100)):r(this.entity,this.graphic,t),void(t?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight))}"extrudedHeight"===e?this.changeHeightPoint(t):"height"===e&&(this.changeEditPoint(t),this.entity.thisHeight=t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("coordinates"),t=void 0,i=void 0,r=this.getValue("height");return i=(void 0!==r?t=Cesium.Cartesian3.fromRadians(e.west,e.north,r):(r=d.scene.sampleHeight(new Cesium.Cartographic(e.west,e.north,0),[this.entity]),t=Cesium.Cartesian3.fromRadians(e.west,e.north,r),r=d.scene.sampleHeight(new Cesium.Cartographic(e.east,e.south,0),[this.entity])),Cesium.Cartesian3.fromRadians(e.east,e.south,r)),this.entity.pottingPoint=[t,i],[t,i]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){var r=this;this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var o=new Cesium.Cartesian3;e.forEach(function(e,t){var i=d.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:r.graphic.heightReference&&r.graphic.heightReference.getValue()}});te.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=e.length,o.y/=e.length,o.z/=e.length,te.editPointID.move=d.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}}else if("box"===e){var g=SmartEarthPopupData.editGraphic.getValue("material");g.color?y(g.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var f=SmartEarthPopupData.editGraphic.getValue("outlineColor");f?C(f):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("long"===e||"width"===e||"height"===e){var i=this.getValue("dimensions");if("long"===e?i.x=t:"width"===e?i.y=t:i.z=t,this.graphic.dimensions=new Cesium.CallbackProperty(function(){return i},!1),"long"===e||"width"===e){var r="long"===e?90:180,o="long"===e?0:1,n=te.editPointID.move.position.getValue(),a=h.GetPositionFromA_D(n,t/2,r);d.entities.getById(te.editPointID.size[o]).position=a,this.entity.pottingPoint[o]=a,this.entity.pottingPoint[this.entity.pottingPoint.length-1]=n}else{var s=h.toDegrees(te.editPointID.move.position.getValue());this.entity.position=Cesium.Cartesian3.fromDegrees(s.lon,s.lat,s.height+t/2),this.changeHeightPoint(s.height+t)}return}if("dimensions"===e)return void(this.graphic.dimensions=new Cesium.CallbackProperty(function(){return t},!1))}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("dimensions"),t=this.getValue("position"),i=h.toDegrees(t);t=Cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height-e.z/2);var r=h.GetPositionFromA_D(t,e.x/2,90),o=h.GetPositionFromA_D(t,e.y/2,180);return this.entity.pottingPoint=[r,o,t],[r,o,t]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var t=d.entities.add({name:"_size_point",position:e[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});t.angle=90;var i=d.entities.add({name:"_size_point",position:e[1],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});i.angle=180,te.editPointID.size.push(t.id),te.editPointID.size.push(i.id),te.editPointID.move=d.entities.add({name:"_move_point",position:e[2],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}}else if("corridor"===e);else if("ellipsoid"!==e||c.isSphere){if("path"===e);else if("plane"===e);else if("polylineVolume"===e);else if("wall"===e){var v=SmartEarthPopupData.editGraphic.getValue("material");v.color?y(v.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var _=SmartEarthPopupData.editGraphic.getValue("outlineColor");_?C(_):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e)return t=Cesium.Color.fromCssColorString(t),void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("positions"===e)return void(this.graphic[e]=new Cesium.CallbackProperty(function(){return t},!1));this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("positions");return this.entity.pottingPoint=e},SmartEarthPopupData.editGraphic.updataEditPoint=function(){var n=this;this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var a=new Cesium.Cartesian3,s=this.getValue("minimumHeights");e.forEach(function(e,t){var i=Cesium.Cartographic.fromCartesian(e),r=Cesium.Cartesian3.fromRadians(i.longitude,i.latitude,s[t]),o=d.entities.add({name:"_edit_point",position:r,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:n.graphic.heightReference&&n.graphic.heightReference.getValue()}});te.editPointID.edit.push(o.id),a.x+=r.x,a.y+=r.y,a.z+=r.z}),a.x/=e.length,a.y/=e.length,a.z/=e.length,te.editPointID.move=d.entities.add({name:"_move_point",position:a,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(var t=0;t<e.length-1;t++){var i=Cesium.Cartesian3.midpoint(e[t],e[t+1],new Cesium.Cartesian3),r=d.entities.add({name:"_add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});te.editPointID.add.push(r.id)}}}}}else;function y(e){SmartEarthPopupData.editGraphic.fillColor=w("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.alpha=100*e.alpha}function C(e){SmartEarthPopupData.editGraphic.outlineColor=w("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.outlineAlpha=100*e.alpha}function w(e){var t=e;if(/^(rgb|RGB)/.test(t)){for(var i=t.replace(/(rgb|RGB)*/g,""),r=(i=i.replace("(","").replace(")","")).split(","),o="#",n=0;n<r.length;n++){var a=Number(r[n]).toString(16);"0"===(a=1===a.length?"0"+a:a)&&(a+=a),o+=a}return 7!==o.length&&(o=t),o}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t))return t;var s=t.replace(/#/,"").split("");if(6===s.length)return t;if(3===s.length){for(var l="#",u=0;u<s.length;u+=1)l+=s[u]+s[u];return l}}},e}),define("SGWorld/Creator/PolylineGeoJsonFeatureLayer",["../Core/Core","./Color","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min","../Navigate/flyTo","../VectorTileProvider/VectorTileProvider","../VectorTileProvider/GeoJSONVectorTileProvider"],function(i,r,o,h,n,d,c){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this.item={show:!0},this._core=new i,this._color=new r(this._viewer,this._cesium),this._tree=o,this._flyTo=new n(this._viewer,this._cesium,this._tree),this._Provider=void 0,this.Legend=[],this.model=[],this._cache=!1,this._forceRefreshPrvimitive=null,this._forceRefreshProvider=null}return e.prototype.createPolylineGeoJsonFeatureLayer=function(e,t,i,r,l){var o={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a)));var u=this._core.extend(o,i,!0);null==t&&console.log("geojson is required");var n=null;n=t.then?t:this._cesium.GeoJsonDataSource.load(t);var c=this;n.then(function(e){for(var t=e.entities.values,i=[],r=0;r<t.length;r++){var o=t[r],n=new c._cesium.GeometryInstance({id:o,geometry:new c._cesium.PolylineGeometry({positions:o.polyline.positions._value,width:u.width,arcType:u.arcType,vertexFormat:c._cesium.PolylineColorAppearance.VERTEX_FORMAT}),attributes:{color:new c._cesium.ColorGeometryInstanceAttribute.fromColor(u.material)}}),a="material:"+255*u.material.red+","+255*u.material.green+","+255*u.material.blue;c.Legend.push(a),i.push(n)}var s=c._viewer.scene.primitives.add(new c._cesium.Primitive({geometryInstances:i,appearance:new c._cesium.PolylineColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:c._cesium.ShadowMode.ENABLED,classificationType:c._cesium.ClassificationType.TERRAIN}));s.show=u.show,c.item=s,"function"==typeof l&&l(s)}),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id);var a={id:u.id,name:e,checked:u.show,pId:this._core.isnull(r)?0:r,type:"polylineLayer",item:this,url:t,style:u};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(r)?0:r),this},e.prototype.createGroundPolylineGeoJsonFeatureLayer=function(e,t,_,i,y,C){var r={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30};this._core.isnull(_)||this._core.isnull(_.material)||"["==_.material.toString().charAt(0)&&"]"==_.material.toString().charAt(_.material.length-1)||(this._core.isHtmlColor(_.material)?_.material=this._color.colorFromHtmlColor(_.material):(/^rgb/.test(_.material)&&(_.material=this._color.rgbaStringToRgbaObj(_.material)),1<_.material.r&&(_.material.r=_.material.r/255),1<_.material.g&&(_.material.g=_.material.g/255),1<_.material.b&&(_.material.b=_.material.b/255),1<_.material.a&&(_.material.a=_.material.a/255),_.material=this._color.createColor(_.material.r,_.material.g,_.material.b,_.material.a)));var w=this._core.extend(r,_,!0);null==t&&console.log("geojson is required");var o=null;o=t.then?t:this._cesium.GeoJsonDataSource.load(t);var b=this;o.then(function(e){for(var t,i=e.entities.values,r=new b._cesium.PrimitiveCollection,o=0;o<i.length;o++){var n=i[o],a=null;if(w.clampToGround){w.positions=n.polyline.positions._value;var s={positions:n.polyline.positions._value,width:w.width};s=new b._cesium.GroundPolylineGeometry(s);a=new b._cesium.GeometryInstance({id:n,geometry:s,attributes:{color:new b._cesium.ColorGeometryInstanceAttribute.fromColor(w.material)}})}else{var l=[];for(o=0;o<n.polyline.positions._value.length;o++){b._viewer.scene.globe.ellipsoid;var u=b._cesium.Cartographic.fromCartesian(n.polyline.positions._value[o]),c=b._cesium.Math.toDegrees(u.longitude),h=b._cesium.Math.toDegrees(u.latitude),d=u.height+w.height,m=new b._cesium.Cartesian3.fromDegrees(c,h,d);l.push(m)}w.positions=l;var p=new b._cesium.PolylineGeometry(w),g=b._cesium.PolylineGeometry.createGeometry(p);a=new b._cesium.GeometryInstance({id:n,geometry:g,attributes:{color:new b._cesium.ColorGeometryInstanceAttribute.fromColor(w.material)}})}n.positions=w.positions;var f="material:"+255*w.material.red+","+255*w.material.green+","+255*w.material.blue;b.Legend.push(f);var v=null;v=w.clampToGround?new b._cesium.GroundPolylinePrimitive({geometryInstances:a,appearance:new b._cesium.MaterialAppearance({material:new b._cesium.Material({fabric:{type:"Color",uniforms:{color:w.material}}}),faceForward:!0,flat:!1})}):new b._cesium.Primitive({geometryInstances:a,appearance:new b._cesium.PolylineMaterialAppearance({material:new b._cesium.Material({fabric:{type:"Color",uniforms:{color:w.material}}})}),shadows:b._cesium.ShadowMode.ENABLED}),r.add(v)}_&&_.time&&(t=new b._cesium.TimeIntervalCollection([new b._cesium.TimeInterval({start:_.time.start?b._cesium.JulianDate.fromDate(new Date(_.time.start)):b._cesium.Iso8601.MINIMUM_VALUE,stop:_.time.end?b._cesium.JulianDate.fromDate(new Date(_.time.end)):b._cesium.Iso8601.MAXIMUM_VALUE})])),b._viewer.scene.primitives.add(r,t).show=w.show,b.item=r,y||b.setVisibility(!1),"function"==typeof C&&C(b.item)}),this._core.isnull(w.id)&&(w.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+w.id);var n={id:w.id,name:e,checked:y,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t,style:w};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},e.prototype.createPolylineVectorGeoJsonFeatureLayerProvider1=function(e,t,g,i,r,o){var n={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(g)||this._core.isnull(g.material)||"["==g.material.toString().charAt(0)&&"]"==g.material.toString().charAt(g.material.length-1)||(this._core.isHtmlColor(g.material)?g.material=this._color.colorFromHtmlColor(g.material):(/^rgb/.test(g.material)&&(g.material=this._color.rgbaStringToRgbaObj(g.material)),1<g.material.r&&(g.material.r=g.material.r/255),1<g.material.g&&(g.material.g=g.material.g/255),1<g.material.b&&(g.material.b=g.material.b/255),1<g.material.a&&(g.material.a=g.material.a/255),g.material=this._color.createColor(g.material.r,g.material.g,g.material.b,g.material.a)));var f=this._core.extend(n,g,!0),v=this,s=new c(this._viewer,this._cesium,a);(this._Provider=s)._loadTile=function(e){v.Legend=[];var p=new v._cesium.PrimitiveCollection;return e.features.forEach(function(d){var i=[],m=!1;if(/^\[/.test(g.material)&&/\]$/.test(g.material)){var e=g.material.replace(/\[/,"").replace(/\]/,"");f.material=d.properties[e],v._core.isHtmlColor(f.material)?f.material=v._color.colorFromHtmlColor(f.material):(/^rgb/.test(f.material)&&(f.material=v._color.rgbaStringToRgbaObj(f.material)),1<f.material.r&&(f.material.r=f.material.r/255),1<f.material.g&&(f.material.g=f.material.g/255),1<f.material.b&&(f.material.b=f.material.b/255),1<f.material.a&&(f.material.a=f.material.a/255),f.material=v._color.createColor(f.material.r,f.material.g,f.material.b,f.material.a))}function r(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?r(e[t]):(i.push(e[t]),2!==t||m||(m=!0))}if(Array.isArray(d.geometry.coordinates)&&0<d.geometry.coordinates.length)if(Array.isArray(d.geometry.coordinates[0][0]))for(var t=0;t<d.geometry.coordinates.length;t++)i=[],r(d.geometry.coordinates[t]),o(i);else r(d.geometry.coordinates),o(i);function o(e){var t=m?v._cesium.Cartesian3.fromDegreesArrayHeights(e):v._cesium.Cartesian3.fromDegreesArray(e);f.positions=t;var i={positions:f.positions,width:f.width};d.positions=t,d.treeID=f.id,d.VectorType="polyline",d.VectorStyle={haveZ:m,width:f.width,positions:e,material:f.material,clampToGround:f.clampToGround};var r=null;if(f.clampToGround){i=new v._cesium.GroundPolylineGeometry(i);r=new v._cesium.GeometryInstance({id:d,geometry:i,attributes:{color:new v._cesium.ColorGeometryInstanceAttribute.fromColor(f.material)}})}else{var o=e,n=e.length/2+1+e.length;if(/^\[/.test(g.height)&&/\]$/.test(g.height)){var a=g.height.replace(/\[/,"").replace(/\]/,"");f.height=d.properties[a]}for(var s=2;s<n;s+=3)o.splice(s,0,parseFloat(f.height));var l=v._cesium.Cartesian3.fromDegreesArrayHeights(o);f.positions=l,d.positions=l;var u=new v._cesium.PolylineGeometry(f);r=new v._cesium.GeometryInstance({id:d,geometry:u,attributes:{color:new v._cesium.ColorGeometryInstanceAttribute.fromColor(f.material)}})}var c="material:"+255*f.material.red+","+255*f.material.green+","+255*f.material.blue;v.Legend.push(c);var h=null;h=f.clampToGround?new v._cesium.GroundPolylinePrimitive({geometryInstances:r,appearance:new v._cesium.MaterialAppearance({material:new v._cesium.Material({fabric:{type:"Color",uniforms:{color:f.material}}}),faceForward:!0,flat:!1})}):new v._cesium.Primitive({geometryInstances:r,appearance:new v._cesium.PolylineMaterialAppearance({material:new v._cesium.Material({fabric:{type:"Color",uniforms:{color:f.material}}})}),shadows:v._cesium.ShadowMode.ENABLED}),p.add(h)}}),p},g&&g.time&&(s.availability=new v._cesium.TimeIntervalCollection([new v._cesium.TimeInterval({start:g.time.start?v._cesium.JulianDate.fromDate(new Date(g.time.start)):v._cesium.Iso8601.MINIMUM_VALUE,stop:g.time.end?v._cesium.JulianDate.fromDate(new Date(g.time.end)):v._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=s._primitiveCollection,s.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(f.id)&&(f.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+f.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var l={id:f.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t.url,style:g};return this._Provider.treeID=f.id,this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},e.prototype.createPolylineVectorGeoJsonFeatureLayerProvider=function(e,t,v,i,r,o){var n={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4326:{z}",TILEMATRIXSET:"EPSG:4326",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(v)||this._core.isnull(v.material)||"["==v.material.toString().charAt(0)&&"]"==v.material.toString().charAt(v.material.length-1)||(this._core.isHtmlColor(v.material)?v.material=this._color.colorFromHtmlColor(v.material):(/^rgb/.test(v.material)&&(v.material=this._color.rgbaStringToRgbaObj(v.material)),1<v.material.r&&(v.material.r=v.material.r/255),1<v.material.g&&(v.material.g=v.material.g/255),1<v.material.b&&(v.material.b=v.material.b/255),1<v.material.a&&(v.material.a=v.material.a/255),v.material=this._color.createColor(v.material.r,v.material.g,v.material.b,v.material.a)));var _=this._core.extend(n,v,!0),s=this;this._urlTemplate=t.url+"?"+this._core._serialize(a.urlParams);var l=t.url+"?"+this._core._serialize(a.urlParams);this._Provider=new d(this._viewer,this._cesium),this._Provider._normalTile=v.level_max-1,this._Provider.loadTile=function(e,t){!function(p,g,f){if(g.state===Cesium.QuadtreeTileLoadState.START){if(g.data={lines:[],geometryPrimitive:void 0},!(g.level>=v.level_min&&g.level<v.level_max&&f.item.show))return g.state=Cesium.QuadtreeTileLoadState.DONE,g.renderable=!0;var e=l.replace(window.encodeURIComponent("{x}"),g.x).replace(window.encodeURIComponent("{y}"),g.y).replace(window.encodeURIComponent("{z}"),g.level);f._cache&&(e+="&"+f._core.getuid()),f._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var h=[],r=[],t=function(){function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):(r.push(e[t]),2!==t||d||(d=!0))}if(d=!(r=[]),/^\[/.test(v.material)&&/\]$/.test(v.material)&&(l=v.material.replace(/\[/,"").replace(/\]/,""),_.material=m.properties[l],f._core.isHtmlColor(_.material)?_.material=f._color.colorFromHtmlColor(_.material):(/^rgb/.test(_.material)&&(_.material=f._color.rgbaStringToRgbaObj(_.material)),1<_.material.r&&(_.material.r=_.material.r/255),1<_.material.g&&(_.material.g=_.material.g/255),1<_.material.b&&(_.material.b=_.material.b/255),1<_.material.a&&(_.material.a=_.material.a/255),_.material=f._color.createColor(_.material.r,_.material.g,_.material.b,_.material.a))),Array.isArray(m.geometry.coordinates)&&0<m.geometry.coordinates.length)if(Array.isArray(m.geometry.coordinates[0][0]))for(u=0;u<m.geometry.coordinates.length;u++)r=[],i(m.geometry.coordinates[u]),e(r);else i(m.geometry.coordinates),e(r);function e(e){var t=d?f._cesium.Cartesian3.fromDegreesArrayHeights(e):f._cesium.Cartesian3.fromDegreesArray(e);_.positions=t;var i={positions:_.positions,width:_.width};m.positions=t,m.treeID=_.id,m.VectorType="polyline",m.VectorStyle={haveZ:d,width:_.width,positions:e,material:_.material,clampToGround:_.clampToGround};var r=null;if(_.clampToGround){i=new f._cesium.GroundPolylineGeometry(i);r=new f._cesium.GeometryInstance({id:m,geometry:i,attributes:{color:new f._cesium.ColorGeometryInstanceAttribute.fromColor(_.material)}})}else{var o=e,n=e.length/2+1+e.length;if(/^\[/.test(v.height)&&/\]$/.test(v.height)){var a=v.height.replace(/\[/,"").replace(/\]/,"");_.height=m.properties[a]}for(var s=2;s<n;s+=3)o.splice(s,0,parseFloat(_.height));var l=f._cesium.Cartesian3.fromDegreesArrayHeights(o);_.positions=l,m.positions=l;var u=new f._cesium.PolylineGeometry(_);r=new f._cesium.GeometryInstance({id:m,geometry:u,attributes:{color:new f._cesium.ColorGeometryInstanceAttribute.fromColor(_.material)}})}var c="material:"+255*_.material.red+","+255*_.material.green+","+255*_.material.blue;f.Legend.push(c),h.push(r)}},i=!0,o=!1,n=void 0;try{for(var a,s=e.features[Symbol.iterator]();!(i=(a=s.next()).done);i=!0){var d,l,u,m=a.value;t()}}catch(e){o=!0,n=e}finally{try{!i&&s.return&&s.return()}finally{if(o)throw n}}var c=null;c=_.clampToGround?new f._cesium.GroundPolylinePrimitive({geometryInstances:h,appearance:new f._cesium.MaterialAppearance({material:new f._cesium.Material({fabric:{type:"Color",uniforms:{color:_.material}}}),faceForward:!0,flat:!1})}):new f._cesium.Primitive({geometryInstances:h,appearance:new f._cesium.PolylineMaterialAppearance({material:new f._cesium.Material({fabric:{type:"Color",uniforms:{color:_.material}}})}),shadows:f._cesium.ShadowMode.ENABLED}),g.data.geometryPrimitive=c,g.state=Cesium.QuadtreeTileLoadState.LOADING,g.state===Cesium.QuadtreeTileLoadState.LOADING&&(g.data.geometryPrimitive.update(p,[]),g.state=Cesium.QuadtreeTileLoadState.DONE,g.renderable=!0)},error:function(){null==g.count&&(g.count=0),g.count+=1,2<=g.count?(g.state=Cesium.QuadtreeTileLoadState.DONE,g.renderable=!0):g.state=Cesium.QuadtreeTileLoadState.START}}),g.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,s)},this._forceRefreshProvider=h.cloneDeep(this._Provider),this._primitive=new s._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});var u=this._viewer.scene;u.primitives.add(this._primitive),u.primitivesQuadTrees&&u.primitivesQuadTrees.push(this._primitive),v&&v.time&&(geoJSONVectorTileProvider.availability=new s._cesium.TimeIntervalCollection([new s._cesium.TimeInterval({start:v.time.start?s._cesium.JulianDate.fromDate(new Date(v.time.start)):s._cesium.Iso8601.MINIMUM_VALUE,stop:v.time.end?s._cesium.JulianDate.fromDate(new Date(v.time.end)):s._cesium.Iso8601.MAXIMUM_VALUE})])),r||this.setVisibility(!1),this._core.isnull(_.id)&&(_.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+_.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var c={id:_.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t.url,style:v};return this._Provider.treeID=_.id,this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},e.prototype.createPolylineVectorGeoJsonFeatureLayerProviderModel_obsolete=function(e,t,a,i,r,o){var n={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(a)||this._core.isnull(a.material)||"["==a.material.toString().charAt(0)&&"]"==a.material.toString().charAt(a.material.length-1)||(this._core.isHtmlColor(a.material)?a.material=this._color.colorFromHtmlColor(a.material):(/^rgb/.test(a.material)&&(a.material=this._color.rgbaStringToRgbaObj(a.material)),1<a.material.r&&(a.material.r=a.material.r/255),1<a.material.g&&(a.material.g=a.material.g/255),1<a.material.b&&(a.material.b=a.material.b/255),1<a.material.a&&(a.material.a=a.material.a/255),a.material=this._color.createColor(a.material.r,a.material.g,a.material.b,a.material.a)));var m=this._core.extend(n,a,!0),p=this,l=new c(this._viewer,this._cesium,s);(this._Provider=l)._loadTile=function(e,t){var d=new p._cesium.PrimitiveCollection,l=[];if(e.features.forEach(function(h){var i=[];if(/^\[/.test(a.material)&&/\]$/.test(a.material)){var e=a.material.replace(/\[/,"").replace(/\]/,"");m.material=h.properties[e],p._core.isHtmlColor(m.material)?m.material=p._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=p._color.rgbaStringToRgbaObj(m.material)),1<m.material.r&&(m.material.r=m.material.r/255),1<m.material.g&&(m.material.g=m.material.g/255),1<m.material.b&&(m.material.b=m.material.b/255),1<m.material.a&&(m.material.a=m.material.a/255),m.material=p._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))}function r(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?r(e[t]):i.push(e[t])}if(Array.isArray(h.geometry.coordinates)&&0<h.geometry.coordinates.length)if(Array.isArray(h.geometry.coordinates[0][0]))for(var t=0;t<h.geometry.coordinates.length;t++)i=[],r(h.geometry.coordinates[t]),o(i),n(i);else r(h.geometry.coordinates),o(i),n(i);function o(e){var t=p._cesium.Cartesian3.fromDegreesArray(e);m.positions=t,h.positions=t;var i={positions:m.positions,width:m.width},r=null;if(m.clampToGround){i=new p._cesium.GroundPolylineGeometry(i);r=new p._cesium.GeometryInstance({id:h,geometry:i,attributes:{color:new p._cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}})}else{for(var o=e,n=e.length/2+1+e.length,a=2;a<n;a+=3)o.splice(a,0,parseFloat(m.height));var s=p._cesium.Cartesian3.fromDegreesArrayHeights(o);m.positions=s;var l=new p._cesium.PolylineGeometry(m),u=p._cesium.PolylineGeometry.createGeometry(l);r=new p._cesium.GeometryInstance({id:h,geometry:u,attributes:{color:new p._cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}})}var c=null;c=m.clampToGround?new p._cesium.GroundPolylinePrimitive({geometryInstances:r,appearance:new p._cesium.MaterialAppearance({material:new p._cesium.Material({fabric:{type:"Color",uniforms:{color:m.material}}}),faceForward:!0,flat:!1})}):new p._cesium.Primitive({geometryInstances:r,appearance:new p._cesium.PolylineMaterialAppearance({material:new p._cesium.Material({fabric:{type:"Color",uniforms:{color:m.material}}})}),shadows:p._cesium.ShadowMode.ENABLED}),d.add(c)}function n(e){var t;t=m.clampToGround?p._cesium.Cartesian3.fromDegreesArray(e):p._cesium.Cartesian3.fromDegreesArrayHeights(e);for(var i=1;i<t.length;i++){var r=[];r.push(t[i-1]),r.push(t[i]);var o=p._cesium.SceneTransforms.wgs84ToWindowCoordinates(p._viewer.scene,t[i-1]).x,n=p._cesium.SceneTransforms.wgs84ToWindowCoordinates(p._viewer.scene,t[i-1]).y,a=p._cesium.SceneTransforms.wgs84ToWindowCoordinates(p._viewer.scene,t[i]).x,s=p._cesium.SceneTransforms.wgs84ToWindowCoordinates(p._viewer.scene,t[i]).y;p.setPolylinemodels(r,o,n,a,s,m,function(e){l.push(e)})}}}),l.length){var i=new p._cesium.ModelInstanceCollectionzh({url:m.url,instances:l,color:m.color,lightColor:m.lightColor,scale:parseInt(m.scale),heightReference:parseInt(m.heightReference),distanceDisplayCondition:m.distanceDisplayCondition});d.add(i)}return d},a&&a.time&&(l.availability=new p._cesium.TimeIntervalCollection([new p._cesium.TimeInterval({start:a.time.start?p._cesium.JulianDate.fromDate(new Date(a.time.start)):p._cesium.Iso8601.MINIMUM_VALUE,stop:a.time.end?p._cesium.JulianDate.fromDate(new Date(a.time.end)):p._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=l._primitiveCollection,l.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var u={id:m.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t.url,style:a};return this.setTreeobj(u),this._tree.insertGroupId(u,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},e.prototype.createPolylineVectorGeoJsonFeatureLayerProviderModel=function(e,t,g,i,r,o){var n={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this.item.show=r,this._core.isnull(g)||this._core.isnull(g.material)||"["==g.material.toString().charAt(0)&&"]"==g.material.toString().charAt(g.material.length-1)||(this._core.isHtmlColor(g.material)?g.material=this._color.colorFromHtmlColor(g.material):(/^rgb/.test(g.material)&&(g.material=this._color.rgbaStringToRgbaObj(g.material)),1<g.material.r&&(g.material.r=g.material.r/255),1<g.material.g&&(g.material.g=g.material.g/255),1<g.material.b&&(g.material.b=g.material.b/255),1<g.material.a&&(g.material.a=g.material.a/255),g.material=this._color.createColor(g.material.r,g.material.g,g.material.b,g.material.a)));var f=this._core.extend(n,g,!0),s=this;this._urlTemplate=t.url+"?"+this._core._serialize(a.urlParams);var l=t.url+"?"+this._core._serialize(a.urlParams);this._Provider=new d(this._viewer,this._cesium),this._Provider._normalTile=g.level_max-1,this._Provider.loadTile=function(e,t){!function(e,m,p){if(m.state===Cesium.QuadtreeTileLoadState.START){if(m.data={lines:[],geometryPrimitive:void 0},!(m.level>=g.level_min&&m.level<g.level_max&&p.item.show))return m.state=Cesium.QuadtreeTileLoadState.DONE,m.renderable=!0;var t=l.replace(window.encodeURIComponent("{x}"),m.x).replace(window.encodeURIComponent("{y}"),m.y).replace(window.encodeURIComponent("{z}"),m.level);p._cache&&(t+="&"+p._core.getuid()),p._core.xhr({url:t,type:"get",dataType:"json",success:function(e){var l=[],h=new p._cesium.PrimitiveCollection,t=e.features,i=[];if(/^\[/.test(g.material)&&/\]$/.test(g.material)){var r=g.material.replace(/\[/,"").replace(/\]/,"");f.material=d.properties[r],p._core.isHtmlColor(f.material)?f.material=p._color.colorFromHtmlColor(f.material):(/^rgb/.test(f.material)&&(f.material=p._color.rgbaStringToRgbaObj(f.material)),1<f.material.r&&(f.material.r=f.material.r/255),1<f.material.g&&(f.material.g=f.material.g/255),1<f.material.b&&(f.material.b=f.material.b/255),1<f.material.a&&(f.material.a=f.material.a/255),f.material=p._color.createColor(f.material.r,f.material.g,f.material.b,f.material.a))}function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):i.push(e[t])}function n(e){var t=p._cesium.Cartesian3.fromDegreesArray(e);f.positions=t,d.positions=t;var i={positions:f.positions,width:f.width},r=null;if(f.clampToGround){i=new p._cesium.GroundPolylineGeometry(i);r=new p._cesium.GeometryInstance({id:d,geometry:i,attributes:{color:new p._cesium.ColorGeometryInstanceAttribute.fromColor(f.material)}})}else{for(var o=e,n=e.length/2+1+e.length,a=2;a<n;a+=3)o.splice(a,0,parseFloat(f.height));var s=p._cesium.Cartesian3.fromDegreesArrayHeights(o);f.positions=s;var l=new p._cesium.PolylineGeometry(f),u=p._cesium.PolylineGeometry.createGeometry(l);r=new p._cesium.GeometryInstance({id:d,geometry:u,attributes:{color:new p._cesium.ColorGeometryInstanceAttribute.fromColor(f.material)}})}var c=null;c=f.clampToGround?new p._cesium.GroundPolylinePrimitive({geometryInstances:r,appearance:new p._cesium.MaterialAppearance({material:new p._cesium.Material({fabric:{type:"Color",uniforms:{color:f.material}}}),faceForward:!0,flat:!1})}):new p._cesium.Primitive({geometryInstances:r,appearance:new p._cesium.PolylineMaterialAppearance({material:new p._cesium.Material({fabric:{type:"Color",uniforms:{color:f.material}}})}),shadows:p._cesium.ShadowMode.ENABLED}),h.add(c)}function a(e){var t;t=f.clampToGround?p._cesium.Cartesian3.fromDegreesArray(e):p._cesium.Cartesian3.fromDegreesArrayHeights(e);for(var i=1;i<t.length;i++)try{var r=[];r.push(t[i-1]),r.push(t[i]);var o=p._cesium.SceneTransforms.wgs84ToWindowCoordinates(p._viewer.scene,t[i-1]).x,n=p._cesium.SceneTransforms.wgs84ToWindowCoordinates(p._viewer.scene,t[i-1]).y,a=p._cesium.SceneTransforms.wgs84ToWindowCoordinates(p._viewer.scene,t[i]).x,s=p._cesium.SceneTransforms.wgs84ToWindowCoordinates(p._viewer.scene,t[i]).y;p.setPolylinemodels(r,o,n,a,s,f,function(e){l.push(e)})}catch(e){}}for(var s=0;s<t.length;s++){var d=t[s];if(Array.isArray(d.geometry.coordinates)&&0<d.geometry.coordinates.length)if(Array.isArray(d.geometry.coordinates[0][0]))for(var u=0;u<d.geometry.coordinates.length;u++)i=[],o(d.geometry.coordinates[u]),n(i),a(i);else o(d.geometry.coordinates),n(i),a(i)}if(l.length){var c=new p._cesium.ModelInstanceCollectionzh({url:f.url,instances:l,color:f.color,lightColor:f.lightColor,scale:parseInt(f.scale),heightReference:parseInt(f.heightReference),distanceDisplayCondition:f.distanceDisplayCondition});h.add(c)}m.data.geometryPrimitive=h},error:function(){null==m.count&&(m.count=0),m.count+=1,2<=m.count?(m.state=Cesium.QuadtreeTileLoadState.DONE,m.renderable=!0):m.state=Cesium.QuadtreeTileLoadState.START}}),m.state=Cesium.QuadtreeTileLoadState.LOADING}}(0,t,s)},this._primitive=new s._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});var u=this._viewer.scene;u.primitives.add(this._primitive),u.primitivesQuadTrees&&u.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(f.id)&&(f.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+f.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var c={id:f.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t.url,style:g};return this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},e.prototype.setPolylinemodels=function(e,t,i,r,o,n,a){var s=this._cesium,l=this._core.getSpaceDistancem(e,s),u=10,c=parseFloat(n.distance);0==c||(u=parseInt(l/c));for(var h=e[0],d=e[e.length-1],m=s.Cartographic.fromCartesian(h),p=s.Math.toDegrees(m.longitude),g=s.Math.toDegrees(m.latitude),f=s.Cartographic.fromCartesian(d),v=s.Math.toDegrees(f.longitude),_=s.Math.toDegrees(f.latitude),y=u,C=s.Math.lerp(p,v,1/y)-p,w=s.Math.lerp(g,_,1/y)-g,b=0;b<y;b++){var E=p+(b+1)*C,S=g+(b+1)*w,P=s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(E,S,parseInt(n.height)));Cesium.Matrix4.multiplyByUniformScale(P,parseInt(n.scale),P),a&&a({modelMatrix:P,modelId:n})}},e.prototype.getType=function(){return{label:"线",value:"polylineLayer"}},e.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},e.prototype.deleteObject=function(){if(this._viewer.scene.primitives.remove(this.item),null!=this.model&&null!=this.model&&0<this.model.length)for(var e=0;e<this.model.length;e++)this._viewer.scene.primitives.remove(this.model[e]);try{this._Provider.remove()}catch(e){}},e.prototype.setTreeobj=function(e){this.treeobj=e},e.prototype.getLegend=function(){var e=[];return null!=this.Legend&&(e=this._core.unique(this.Legend)),e},e.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(!e)}catch(e){}},e.prototype.setVisibility=function(e){if(null!=this.item&&(this.item.show=e),this._Provider&&this._Provider.setStatus(e),null!=this.model&&null!=this.model&&0<this.model.length)for(var t=0;t<this.model.length;t++)this.model[t].show=e},e.prototype.edit=function(e,t){return this.editoption=t,this.isEditting=e,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},e.prototype.forceRefresh=function(){try{for(var e=0;e<this._Provider.quadtree._levelZeroTiles.length;e++)this._Provider.quadtree._levelZeroTiles[e].freeResources()}catch(e){}},e}),define("SGWorld/Creator/PolygonGeoJsonFeatureLayer",["../Core/Core","./Color","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min","../Core/jquery","../VectorTileProvider/VectorTileProvider","../VectorTileProvider/GeoJSONVectorTileProvider"],function(i,r,o,e,h,t,f){"use strict";function n(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._color=new r(this._viewer,this._cesium),this._tree=o,this._Provider=void 0,this._primitive=void 0,this._taskProcessor=new this._cesium.TaskProcessor("vectorTileProvider"),this.model=[],this.Legend=[],this._ajax=null,this.datas=null}return n.prototype.createPolygonGeoJsonFeatureLayer=function(e,t,i,r,u){var o={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,show:!0};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a)));var c=this._core.extend(o,i,!0);null==t&&console.log("geojson is required");var n=null;n=t.then?t:this._cesium.GeoJsonDataSource.load(t);var h=this,d=[];n.then(function(e){for(var t=e.entities.values,i=0;i<t.length;i++){var r=t[i];c.polygonHierarchy=new h._cesium.PolygonHierarchy(r.polygon.hierarchy._value.positions);var o=new h._cesium.PolygonGeometry(c),n=h._cesium.PolygonGeometry.createGeometry(o),a=new h._cesium.GeometryInstance({geometry:n});d.push(a)}var s=h._viewer.scene.primitives.add(new h._cesium.Primitive({geometryInstances:d,appearance:new h._cesium.MaterialAppearance({material:new h._cesium.Material({fabric:{type:"Color",uniforms:{color:c.material}}}),faceForward:!0,flat:!1})})),l="material:"+255*c.material.red+","+255*c.material.green+","+255*c.material.blue;h.Legend.push(l),h.item=s,0==c.show&&(s.show=!1),"function"==typeof u&&u(s)}),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id);var a={id:c.id,name:e,checked:!0,pId:this._core.isnull(r)?0:r,type:"polygonLayer",item:this,url:t,style:c};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(r)?0:r),this},n.prototype.deleteObject=function(){if(null!=this.items&&null!=this.items&&0<this.items.length)for(var e=0;e<this.items.length;e++)this._viewer.scene.primitives.remove(this.items[e]);else this._viewer.scene.primitives.remove(this.item);if(null!=this.model&&null!=this.model&&0<this.model.length)for(e=0;e<this.model.length;e++)this._viewer.scene.primitives.remove(this.model[e]);try{this._Provider.remove()}catch(e){}},n.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(!e)}catch(e){}},n.prototype.setVisibility=function(e){if(null!=this.items&&null!=this.items&&0<this.items.length)for(var t=0;t<this.items.length;t++)this.items[t].show=e;else this.item.show=e;if(null!=this.model&&null!=this.model&&0<this.model.length)for(t=0;t<this.model.length;t++)this.model[t].show=e;this._Provider&&this._Provider.setStatus(!e)},n.prototype.createPolygonVectorGeoJsonFeatureLayerProvider=function(e,t,u,i,r,o){var n={polygonHierarchy:void 0,height:0,extrudedHeight:999999,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(u)||this._core.isnull(u.material)||"["==u.material.toString().charAt(0)&&"]"==u.material.toString().charAt(u.material.length-1)||(this._core.isHtmlColor(u.material)?u.material=this._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=this._color.rgbaStringToRgbaObj(u.material)),1<u.material.r&&(u.material.r=u.material.r/255),1<u.material.g&&(u.material.g=u.material.g/255),1<u.material.b&&(u.material.b=u.material.b/255),1<u.material.a&&(u.material.a=u.material.a/255),u.material=this._color.createColor(u.material.r,u.material.g,u.material.b,u.material.a)));var c=this._core.extend(n,u,!0);0==c.extrudedHeight&&(c.extrudedHeight=999999),this.items=[];var h=this,d=new f(this._viewer,this._cesium,a);(this._Provider=d)._loadTile=function(e){var l=[];scene.primitives;h.Legend=[];new h._cesium.PrimitiveCollection;if(e.features.forEach(function(s){if(d._isCameraMoving)return null;var i=[];function r(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?r(e[t]):i.push(e[t])}if(Array.isArray(s.geometry.coordinates)&&0<s.geometry.coordinates.length)if(Array.isArray(s.geometry.coordinates[0][0]))for(var e=0;e<s.geometry.coordinates.length;e++)i=[],r(s.geometry.coordinates[e]),t(i);else r(s.geometry.coordinates),t(i);function t(e){if(d._isCameraMoving)return null;var t=h._cesium.Cartesian3.fromDegreesArray(e);if(/^\[/.test(u.extrudedHeight)&&/\]$/.test(u.extrudedHeight)){var i=u.extrudedHeight.replace(/\[/,"").replace(/\]/,"");c.extrudedHeight=parseFloat(s.properties[i])}if(c.extrudedHeight=parseFloat(c.extrudedHeight),1==c.heightReference&&delete c.height,1==c.extrudedHeightReference&&delete c.extrudedHeight,/^\[/.test(u.material)&&/\]$/.test(u.material)){var r=u.material.replace(/\[/,"").replace(/\]/,"");c.material=s.properties[r],h._core.isHtmlColor(c.material)?c.material=h._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=h._color.rgbaStringToRgbaObj(c.material)),1<c.material.r&&(c.material.r=c.material.r/255),1<c.material.g&&(c.material.g=c.material.g/255),1<c.material.b&&(c.material.b=c.material.b/255),1<c.material.a&&(c.material.a=c.material.a/255),c.material=h._color.createColor(c.material.r,c.material.g,c.material.b,c.material.a))}c.polygonHierarchy=new h._cesium.PolygonHierarchy(t),s.positions=t;var o,n=new h._cesium.PolygonGeometry(c);o=new h._cesium.GeometryInstance({id:s,geometry:n,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(c.material)}});var a="material:"+255*c.material.red+","+255*c.material.green+","+255*c.material.blue;h.Legend.push(a),l.push(o)}}),0<l.length)return new h._cesium.GroundPrimitive({geometryInstances:l,appearance:new h._cesium.PerInstanceColorAppearance({closed:!0,flat:!1}),classificationType:c.classificationType})},this.item=d._primitiveCollection,d.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var s={id:c.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:u};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},n.prototype.createPolygonVectorGeoJsonFeatureLayerProviderModel=function(e,t,c,i,r,o){var n={polygonHierarchy:void 0,height:0,extrudedHeight:999999,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},h=c.material,d=c.height;this._core.isnull(c)||this._core.isnull(c.color)||(this._core.isHtmlColor(c.color)?c.color=this._color.colorFromHtmlColor(c.color):(/^rgb/.test(c.color)&&(c.color=this._color.rgbaStringToRgbaObj(c.color)),1<c.color.r&&(c.color.r=c.color.r/255),1<c.color.g&&(c.color.g=c.color.g/255),1<c.color.b&&(c.color.b=c.color.b/255),1<c.color.a&&(c.color.a=c.color.a/255),c.color=this._color.createColor(c.color.r,c.color.g,c.color.b,c.color.a))),this._core.isnull(c)||this._core.isnull(c.lightColor)||(this._core.isHtmlColor(c.lightColor)?c.lightColor=this._color.colorFromHtmlColor(c.lightColor):(/^rgb/.test(c.lightColor)&&(c.lightColor=this._color.rgbaStringToRgbaObj(c.lightColor)),1<c.lightColor.r&&(c.lightColor.r=c.lightColor.r/255),1<c.lightColor.g&&(c.lightColor.g=c.lightColor.g/255),1<c.lightColor.b&&(c.lightColor.b=c.lightColor.b/255),1<c.lightColor.a&&(c.lightColor.a=c.lightColor.a/255),c.lightColor=this._color.createColor(c.lightColor.r,c.lightColor.g,c.lightColor.b,c.lightColor.a))),this._core.isnull(c)||this._core.isnull(c.material)||"["==c.material.toString().charAt(0)&&"]"==c.material.toString().charAt(c.material.length-1)||(this._core.isHtmlColor(c.material)?c.material=this._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=this._color.rgbaStringToRgbaObj(c.material)),1<c.material.r&&(c.material.r=c.material.r/255),1<c.material.g&&(c.material.g=c.material.g/255),1<c.material.b&&(c.material.b=c.material.b/255),1<c.material.a&&(c.material.a=c.material.a/255),c.material=this._color.createColor(c.material.r,c.material.g,c.material.b,c.material.a)));var m=this._core.extend(n,c,!0);0==m.extrudedHeight&&(m.extrudedHeight=999999),this.items=[];var p=this,g=new f(this._viewer,this._cesium,a);(this._Provider=g)._loadTile=function(e){var l=null,u=(scene.primitives,new p._cesium.PrimitiveCollection);return p.Legend=[],e.features.forEach(function(s){if(g._isCameraMoving)return null;var i=[];function r(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?r(e[t]):i.push(e[t])}if(Array.isArray(s.geometry.coordinates)&&0<s.geometry.coordinates.length)if(Array.isArray(s.geometry.coordinates[0][0]))for(var e=0;e<s.geometry.coordinates.length;e++)i=[],r(s.geometry.coordinates[e]),t(i),o(i);else r(s.geometry.coordinates),t(i),o(i);function t(e){if(g._isCameraMoving)return null;var t=p._cesium.Cartesian3.fromDegreesArray(e);if(/^\[/.test(c.extrudedHeight)&&/\]$/.test(c.extrudedHeight)){var i=c.extrudedHeight.replace(/\[/,"").replace(/\]/,"");m.extrudedHeight=parseFloat(s.properties[i])}if(m.extrudedHeight=parseFloat(m.extrudedHeight),1==m.heightReference&&delete m.height,1==m.extrudedHeightReference&&delete m.extrudedHeight,/^\[/.test(c.material)&&/\]$/.test(c.material)){var r=c.material.replace(/\[/,"").replace(/\]/,"");m.material=s.properties[r],p._core.isHtmlColor(m.material)?m.material=p._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=p._color.rgbaStringToRgbaObj(m.material)),1<m.material.r&&(m.material.r=m.material.r/255),1<m.material.g&&(m.material.g=m.material.g/255),1<m.material.b&&(m.material.b=m.material.b/255),1<m.material.a&&(m.material.a=m.material.a/255),m.material=p._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))}m.polygonHierarchy=new p._cesium.PolygonHierarchy(t);var o,n=new p._cesium.PolygonGeometry(m);s.positions=t,o=new p._cesium.GeometryInstance({id:s,geometry:n,attributes:{color:new p._cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}});var a="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue;p.Legend.push(a),l=new p._cesium.ClassificationPrimitive({geometryInstances:o,appearance:new p._cesium.PerInstanceColorAppearance({closed:!0,flat:!1}),classificationType:m.classificationType,shadows:p._cesium.ShadowMode.ENABLED}),u.add(l)}function o(e){for(var t=p._cesium.Cartesian3.fromDegreesArray(e),i=[],r=new p._cesium.PolygonHierarchy(t).positions,o=0;o<r.length;o++){var n=p._cesium.Math.toDegrees(p._cesium.Cartographic.fromCartesian(r[o]).longitude),a=p._cesium.Math.toDegrees(p._cesium.Cartographic.fromCartesian(r[o]).latitude);i.push(n),i.push(a)}var s=p.getTheBottomPoint(i);p.scanningPolygon(s,m.offset_x,m.offset_y,i).forEach(function(e){var t=p._cesium.Transforms.eastNorthUpToFixedFrame(p._cesium.Cartesian3.fromDegrees(e.lon,e.lat,d)),i=p._cesium.Model.fromGltf({url:h,color:m.color,lightColor:m.lightColor,modelMatrix:t,scale:m.scale});u.add(i)})}}),u},c&&c.time&&(g.availability=new p._cesium.TimeIntervalCollection([new p._cesium.TimeInterval({start:c.time.start?p._cesium.JulianDate.fromDate(new Date(c.time.start)):p._cesium.Iso8601.MINIMUM_VALUE,stop:c.time.end?p._cesium.JulianDate.fromDate(new Date(c.time.end)):p._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=g._primitiveCollection,g.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var s={id:m.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:c};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},n.prototype.GetPositionFromA_D=function(e,t,i,r){var o=i*Math.sin(r*Math.PI/180),n=i*Math.cos(r*Math.PI/180),a=6356725+21412*(90-e)/90;return[180*(o/(a*Math.cos(e*Math.PI/180))+t*Math.PI/180)/Math.PI,180*(n/a+e*Math.PI/180)/Math.PI]},n.prototype.getTheBottomPoint=function(e){for(var t=90,i=0,r=1;r<e.length;r+=2)t=t<e[r]?t:(i=r)&&e[r];return{lon:e[i-1],lat:e[i]}},n.prototype.scanningPolygon=function(e,t,i,r){for(var o,n,a,s,l,u=[],c=180,h=-180,d=-90,m=0;m<r.length;m+=2)d=d>r[m+1]?d:r[m+1],c=c<r[m]?c:r[m],h=h>r[m]?h:r[m];var p=this.GetPositionFromA_D(e.lat,e.lon,i,0);for(o=this.GetPositionFromA_D(e.lat,e.lon,t,90)[0]-e.lon,n=p[1]-e.lat,u.push({lon:e.lon,lat:e.lat}),(l={lon:e.lon,lat:e.lat}).lat+=n;l.lat<=d;l.lat+=n){for(a={lon:l.lon-o,lat:l.lat},s={lon:l.lon+o,lat:l.lat},this.IsInPolygon(l.lon,l.lat,r)&&u.push({lon:l.lon,lat:l.lat});a.lon>=c;a.lon-=o)this.IsInPolygon(a.lon,a.lat,r)&&u.push({lon:a.lon,lat:a.lat});for(;s.lon<=h;s.lon+=o)this.IsInPolygon(s.lon,s.lat,r)&&u.push({lon:s.lon,lat:s.lat})}return u},n.prototype.IsInPolygon=function(e,t,i){var r,o,n,a,s=0;if(i.length<6)return!1;i.push(i[0],i[1]);for(var l=0;l<i.length-2;l+=2)r=i[l],n=i[l+1],o=i[l+2],a=i[l+3],(n<=t&&t<a||a<=t&&t<n)&&0<Math.abs(n-a)&&r-(r-o)*(n-t)/(n-a)<=e&&s++;return s%2!=0},n.prototype.setPolylinemodels=function(e,t,i,r,o,n,a,s,l){var u=this._core.getSpaceDistancem(e,s),c=10,h=parseFloat(a.distance);0==h||(c=parseInt(u/h));for(var d=e[0],m=e[e.length-1],p=s.Cartographic.fromCartesian(d),g=s.Math.toDegrees(p.longitude),f=s.Math.toDegrees(p.latitude),v=(p.height,s.Cartographic.fromCartesian(m)),_=s.Math.toDegrees(v.longitude),y=s.Math.toDegrees(v.latitude),C=(v.height,s.Math.toDegrees(p.height),c),w=s.Math.lerp(g,_,1/C)-g,b=s.Math.lerp(f,y,1/C)-f,E=(s.Math.lerp(t,r,1/C),s.Math.lerp(i,o,1/C),0);E<C;E++){var S=g+(E+1)*w,P=f+(E+1)*b,x=s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(S,P,a.height)),T=(parseInt(a.heightReference),s.Model.fromGltf({url:a.url,modelMatrix:x,color:a.color,lightColor:a.lightColor,scale:a.scale,heightReference:parseInt(a.heightReference)}));l.scene.primitives.add(T);n.push(T)}return n},n.prototype.createPolygonVectorGeoJsonFeatureLayerProviderlsjl=function(e,t,r,i,o,n){var a={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(r)||this._core.isnull(r.material)||"["==r.material.toString().charAt(0)&&"]"==r.material.toString().charAt(r.material.length-1)||(this._core.isHtmlColor(r.material)?r.material=this._color.colorFromHtmlColor(r.material):(/^rgb/.test(r.material)&&(r.material=this._color.rgbaStringToRgbaObj(r.material)),1<r.material.r&&(r.material.r=r.material.r/255),1<r.material.g&&(r.material.g=r.material.g/255),1<r.material.b&&(r.material.b=r.material.b/255),1<r.material.a&&(r.material.a=r.material.a/255),r.material=this._color.createColor(r.material.r,r.material.g,r.material.b,r.material.a)));var l=this._core.extend(a,r,!0),u=this,c=new f(this._viewer,this._cesium,s);(this._Provider=c)._loadTile=function(e,t){var i=u._taskProcessor.scheduleTask({json:e,styleOption:r,options:l,tileKey:t});if(u._cesium.defined(i)){var s=u;u._cesium.when(i,function(e){if(!c._primitiveByTile[e.tileKey]){for(var t=new s._cesium.PrimitiveCollection,i=0;i<e.geomInstances.length;i++){var r=null,o=e.geomInstances[i],n=o.id.id;if(!c._primitiveByTile[n]){var a=new s._cesium.Material({fabric:{type:"Color",uniforms:{color:e.materials[i]}}});new s._cesium.MaterialAppearance({material:a,faceForward:!0,flat:!1}),r=new s._cesium.Primitive({allowPicking:!0,appearance:new s._cesium.PerInstanceColorAppearance,geometryInstances:o,shadows:u._cesium.ShadowMode.ENABLED});t.add(r)}}c._primitiveCollection.add(t),c._primitiveByTile[e.tileKey]=t}})}},this.item=c._primitiveCollection,c.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var h={id:l.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:r};return this.setTreeobj(h),this._tree.insertGroupId(h,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item),this},n.prototype.createPolygonVectorGeoJsonFeatureLayerProviderls=function(e,t,d,i,r,o){var n={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(d)||this._core.isnull(d.material)||"["==d.material.toString().charAt(0)&&"]"==d.material.toString().charAt(d.material.length-1)||(this._core.isHtmlColor(d.material)?d.material=this._color.colorFromHtmlColor(d.material):/^http/.test(d.material)||(/^rgb/.test(d.material)&&(d.material=this._color.rgbaStringToRgbaObj(d.material)),1<d.material.r&&(d.material.r=d.material.r/255),1<d.material.g&&(d.material.g=d.material.g/255),1<d.material.b&&(d.material.b=d.material.b/255),1<d.material.a&&(d.material.a=d.material.a/255),d.material=this._color.createColor(d.material.r,d.material.g,d.material.b,d.material.a))),this._core.isnull(d)||this._core.isnull(d.fill)||"["==d.fill.toString().charAt(0)&&"]"==d.fill.toString().charAt(d.fill.length-1)||(this._core.isHtmlColor(d.fill)?d.fill=this._color.colorFromHtmlColor(d.fill):/^http/.test(d.fill)||(/^rgb/.test(d.fill)&&(d.fill=this._color.rgbaStringToRgbaObj(d.fill)),1<d.fill.r&&(d.fill.r=d.fill.r/255),1<d.fill.g&&(d.fill.g=d.fill.g/255),1<d.fill.b&&(d.fill.b=d.fill.b/255),1<d.fill.a&&(d.fill.a=d.fill.a/255),d.fill=this._color.createColor(d.fill.r,d.fill.g,d.fill.b,d.fill.a)));var m=this._core.extend(n,d,!0),p=this,s=new f(this._viewer,this._cesium,a);(this._Provider=s)._loadTile=function(e){p.Legend=[];var h=new p._cesium.PrimitiveCollection;return e.features.forEach(function(c){var i=[];function r(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?r(e[t]):i.push(e[t])}if(Array.isArray(c.geometry.coordinates)&&0<c.geometry.coordinates.length)if(Array.isArray(c.geometry.coordinates[0][0]))for(var e=0;e<c.geometry.coordinates.length;e++)i=[],r(c.geometry.coordinates[e]),t(i);else r(c.geometry.coordinates),t(i);function t(e){var t=p._cesium.Cartesian3.fromDegreesArray(e);if(/^\[/.test(d.extrudedHeight)&&/\]$/.test(d.extrudedHeight)){var i=d.extrudedHeight.replace(/\[/,"").replace(/\]/,"");m.extrudedHeight=parseFloat(c.properties[i])}if(m.extrudedHeight=parseFloat(m.extrudedHeight),1==m.heightReference&&delete m.height,1==m.extrudedHeightReference&&delete m.extrudedHeight,/^\[/.test(d.material)&&/\]$/.test(d.material)){var r=d.material.replace(/\[/,"").replace(/\]/,"");m.material=c.properties[r],p._core.isHtmlColor(m.material)?m.material=p._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=p._color.rgbaStringToRgbaObj(m.material)),1<m.material.r&&(m.material.r=m.material.r/255),1<m.material.g&&(m.material.g=m.material.g/255),1<m.material.b&&(m.material.b=m.material.b/255),1<m.material.a&&(m.material.a=m.material.a/255),m.material=p._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))}m.polygonHierarchy=new p._cesium.PolygonHierarchy(t),c.positions=t;var o,n=new p._cesium.PolygonGeometry(m),a=new p._cesium.ColorGeometryInstanceAttribute.fromColor(m.fill),s={};if(/^http/.test(m.material))s=new p._cesium.Material({fabric:{type:"Image",uniforms:{image:m.material}}});else{var l="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue;p.Legend.push(l),s=new p._cesium.Material({fabric:{type:"Color",uniforms:{color:m.material}}})}o=new p._cesium.GeometryInstance({id:c,geometry:n,attributes:{color:a}});var u;u=new p._cesium.Primitive({allowPicking:!0,appearance:new p._cesium.MaterialAppearance({material:s}),geometryInstances:o,shadows:p._cesium.ShadowMode.ENABLED}),h.add(u)}}),h},d&&d.time&&(s.availability=new p._cesium.TimeIntervalCollection([new p._cesium.TimeInterval({start:d.time.start?p._cesium.JulianDate.fromDate(new Date(d.time.start)):p._cesium.Iso8601.MINIMUM_VALUE,stop:d.time.end?p._cesium.JulianDate.fromDate(new Date(d.time.end)):p._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=s._primitiveCollection,s.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var l={id:m.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:d};return this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},n.prototype.createPolygonVectorGeoJsonFeatureLayerProviderlsd=function(e,t,i,r,o,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._core.isnull(i)||this._core.isnull(i.outlineColor)||"["==i.outlineColor.toString().charAt(0)&&"]"==i.outlineColor.toString().charAt(i.outlineColor.length-1)||(this._core.isHtmlColor(i.outlineColor)?i.outlineColor=this._color.colorFromHtmlColor(i.outlineColor):(/^rgb/.test(i.outlineColor)&&(i.outlineColor=this._color.rgbaStringToRgbaObj(i.outlineColor)),1<i.outlineColor.r&&(i.outlineColor.r=i.outlineColor.r/255),1<i.outlineColor.g&&(i.outlineColor.g=i.outlineColor.g/255),1<i.outlineColor.b&&(i.outlineColor.b=i.outlineColor.b/255),1<i.outlineColor.a&&(i.outlineColor.a=i.outlineColor.a/255),i.outlineColor=this._color.createColor(i.outlineColor.r,i.outlineColor.g,i.outlineColor.b,i.outlineColor.a))),this._option=this._core.extend(a,i,!0);var m=this,l=t.urlinit,p={polygonHierarchy:void 0,height:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED};h.ajax({url:l,type:"get",async:!1,dataType:"json",success:function(e){m.datas=e.features}});var u=new f(this._viewer,this._cesium,s);(this._Provider=u)._loadTile=function(e){m.Legend=[];new m._cesium.PrimitiveCollection;var h=[],d=[],t=new Cesium.PrimitiveCollection;return e.features.forEach(function(c){var i=[];function r(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?(3==e[t].length&&e[t].splice(2,1),e[t].push(m._option.height),r(e[t])):i.push(e[t])}var e=c.id,t=parseInt(e.split(".")[1])-1;if(c=m.datas[t],Array.isArray(c.geometry.coordinates)&&0<c.geometry.coordinates.length&&Array.isArray(c.geometry.coordinates[0][0][0]))for(var o=0;o<c.geometry.coordinates[0].length;o++)i=[],r(c.geometry.coordinates[0][o]),n(i);function n(e){if(/^\[/.test(m._option.extrudedHeight)&&/\]$/.test(m._option.extrudedHeight)){var t=m._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");p.extrudedHeight=parseFloat(c.properties[t])}if(p.material=m._option.material,/^\[/.test(m._option.material)&&/\]$/.test(m._option.material)){var i=m._option.material.replace(/\[/,"").replace(/\]/,"");p.material=c.properties[i],m._core.isHtmlColor(p.material)?p.material=m._color.colorFromHtmlColor(p.material):(/^rgb/.test(p.material)&&(p.material=m._color.rgbaStringToRgbaObj(p.material)),1<p.material.red&&(p.material.red=p.material.red/255),1<p.material.green&&(p.material.green=p.material.green/255),1<p.material.blue&&(p.material.blue=p.material.blue/255),1<p.material.alpha&&(p.material.a=p.material.alpha/255),p.material=m._color.createColor(p.material.red,p.material.green,p.material.blue,p.material.alpha))}else m._option.material&&(p.material=m._option.material),p.material&&(m._core.isHtmlColor(p.material)?p.material=m._color.colorFromHtmlColor(p.material):(/^rgb/.test(p.material)&&(p.material=m._color.rgbaStringToRgbaObj(p.material)),1<p.material.red&&(p.material.red=p.material.red/255),1<p.material.green&&(p.material.green=p.material.green/255),1<p.material.blue&&(p.material.blue=p.material.blue/255),1<p.material.alpha&&(p.material.a=p.material.alpha/255),p.material=m._color.createColor(p.material.red,p.material.green,p.material.blue,p.material.alpha)));var r=m._cesium.Cartesian3.fromDegreesArrayHeights(e);p.polygonHierarchy=new m._cesium.PolygonHierarchy(r);var o=new m._cesium.PolygonGeometry(p),n=new Cesium.GeometryInstance({id:c,geometry:o,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(m._option.randomColor?Cesium.Color.fromRandom().withAlpha(p.material.alpha):p.material)}});h.push(n);var a={positions:r,width:m._option.width},s=new m._cesium.GroundPolylineGeometry(a),l=new m._cesium.GeometryInstance({geometry:s});d.push(l);var u="material:"+255*p.material.red+","+255*p.material.green+","+255*p.material.blue;m.Legend.push(u)}}),0<h.length&&(p.extrudedHeight?t.add(new m._cesium.Primitive({geometryInstances:h,appearance:new m._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:m._core.Shaders("vertexShaderSource"),fragmentShaderSource:m._core.Shaders("fragmentShaderSource")})})):t.add(new m._cesium.GroundPrimitive({geometryInstances:h,appearance:new m._cesium.PerInstanceColorAppearance({translucent:!0,vertexShaderSource:m._core.Shaders("vertexShaderSource")})}))),0<d.length&&t.add(new m._cesium.GroundPolylinePrimitive({geometryInstances:d,appearance:new m._cesium.PolylineMaterialAppearance({material:new m._cesium.Material({fabric:{type:"Color",uniforms:{color:m._option.outlineColor}}})}),shadows:m._cesium.ShadowMode.ENABLED})),t},this.item=u._primitiveCollection,u.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(p.id)&&(p.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+p.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var c={id:p.id,name:e,checked:!0,pId:this._core.isnull(r)?0:r,type:"polygonLayer",item:this,url:t.url,style:i};return this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(r)?0:r),"function"==typeof n&&n(this.item),this},n.prototype.setTreeobj=function(e){this.treeobj=e},n.prototype.createPolygonVectorFeatureLayerProvider=function(e,t,u,i,r){var o={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,show:!0},n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(u)||this._core.isnull(u.material)||"["==u.material.toString().charAt(0)&&"]"==u.material.toString().charAt(u.material.length-1)||(this._core.isHtmlColor(u.material)?u.material=this._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=this._color.rgbaStringToRgbaObj(u.material)),1<u.material.r&&(u.material.r=u.material.r/255),1<u.material.g&&(u.material.g=u.material.g/255),1<u.material.b&&(u.material.b=u.material.b/255),1<u.material.a&&(u.material.a=u.material.a/255),u.material=this._color.createColor(u.material.r,u.material.g,u.material.b,u.material.a)));var c=this._core.extend(o,u,!0),h=this,a=new f(this._viewer,this._cesium,n);(this._Provider=a)._loadTile=function(e){var l=[];return h.Legend=[],e.features.forEach(function(e){var r=[];!function e(t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?e(t[i]):r.push(t[i])}(e.geometry.coordinates[0]);var t=h._cesium.Cartesian3.fromDegreesArray(r);if(/^\[/.test(u.extrudedHeight)&&/\]$/.test(u.extrudedHeight)){var i=u.extrudedHeight.replace(/\[/,"").replace(/\]/,"");c.extrudedHeight=parseFloat(e.properties[i])}c.polygonHierarchy=new h._cesium.PolygonHierarchy(t);var o=new h._cesium.PolygonGeometry(c),n=h._cesium.PolygonGeometry.createGeometry(o),a="material:"+255*c.material.red+","+255*c.material.green+","+255*c.material.blue;h.Legend.push(a);var s=new h._cesium.GeometryInstance({geometry:n,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(c.material)},shadows:h._cesium.ShadowMode.ENABLED});l.push(s)}),new this._cesium.Primitive({allowPicking:!1,appearance:new this._cesium.PerInstanceColorAppearance({translucent:!1,flat:!0,faceForward:!0,closed:!0}),geometryInstances:l})},this.item=a._primitiveCollection,a.addTo(this._viewer),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id);var s={id:c.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:u};this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item)},n.prototype.createPolygonVectorMonomerFeatureLayerProvider=function(e,t,s,i,r){var o={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,show:!0},n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(s)||this._core.isnull(s.material)||"["==s.material.toString().charAt(0)&&"]"==s.material.toString().charAt(s.material.length-1)||(this._core.isHtmlColor(s.material)?s.material=this._color.colorFromHtmlColor(s.material):(/^rgb/.test(s.material)&&(s.material=this._color.rgbaStringToRgbaObj(s.material)),1<s.material.r&&(s.material.r=s.material.r/255),1<s.material.g&&(s.material.g=s.material.g/255),1<s.material.b&&(s.material.b=s.material.b/255),1<s.material.a&&(s.material.a=s.material.a/255),s.material=this._color.createColor(s.material.r,s.material.g,s.material.b,s.material.a)));var l=this._core.extend(o,s,!0),a=new f(this._viewer,this._cesium,n);this._Provider=a;var u=this;a._loadTile=function(e){var a=[];return e.features.forEach(function(e){var r=[];!function e(t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?e(t[i]):r.push(t[i])}(e.geometry.coordinates[0]);var t=u._cesium.Cartesian3.fromDegreesArray(r);if(/^\[/.test(s.extrudedHeight)&&/\]$/.test(s.extrudedHeight)){var i=s.extrudedHeight.replace(/\[/,"").replace(/\]/,"");l.extrudedHeight=parseFloat(e.properties[i])}l.polygonHierarchy=new u._cesium.PolygonHierarchy(t);var o=new u._cesium.PolygonGeometry(l),n=new u._cesium.GeometryInstance({geometry:o,attributes:{color:u._cesium.ColorGeometryInstanceAttribute.fromColor(u._cesium.Color.fromCssColorString("#004FFF").withAlpha(.5)),show:new u._cesium.ShowGeometryInstanceAttribute(!0)}});a.push(n)}),new u._cesium.GroundPrimitive({classificationType:u._cesium.ClassificationType.BOTH,geometryInstances:a})},this.item=a._primitiveCollection,a.addTo(this._viewer),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id);var c={id:l.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:s};this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item)},n.prototype.getLegend=function(){var e=[];return null!=this.Legend&&(e=this._core.unique(this.Legend)),e},n.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},n}),define("SGWorld/VectorTileProviderPolymerization/GeoJSONVectorTileProvider",[],function(){"use strict";var n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],r=!0,o=!1,n=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){o=!0,n=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw n}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof2(e)};function p(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function e(e,t,i){this._viewer=e,this._cesium=t,this._viewer=null,this._Cesium=i.Cesium,this.UrlData={output:i.output,resultmode:i.resultmode,uid:i.uid,st:i.st,words:i.words,area:i.area,callback:i.callback},this.minLevel1=i.minLevel1,this.minLevel3=i.minLevel3,this._url=i.url,this._urlTemplate=i.url,this._rectangle=i.rectangle,this._maximumLevel=i.maximumLevel||19,this._minimumLevel=i.minimumLevel||1,this.dx={},this._tilingScheme=i.tilingScheme||new this._Cesium.GeographicTilingScheme,this._tileRangeByLevel={},this._moveEndTimestamp=null,this._isRemoved=!1,this.cluster="city",this.primitivecount=null,this._isCameraMoving=!1,this._propertyToBeFiltered=null,this._valuesToBeFiltered=null,this._primitiveByTile={},this._tileKeys=[],this._lowerLevelLimit=i.lowerLevelLimit||1,this._upperLevelLimit=i.upperLevelLimit||null,this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._cameraMoveStartHandler=this._cameraMoveStartHandler.bind(this),this.heightById={};for(var r=this._radianToDegree(this._rectangle.west),o=this._radianToDegree(this._rectangle.south),n=this._radianToDegree(this._rectangle.east),a=this._radianToDegree(this._rectangle.north),s=this._minimumLevel;s<=this._maximumLevel;s++){var l=this._lonLatToTileInWGS84([r,o],s),u=this._lonLatToTileInWGS84([n,a],s),c=Math.min(l[0],u[0]),h=Math.max(l[0],u[0]),d=Math.min(l[1],u[1]),m=Math.max(l[1],u[1]);this._tileRangeByLevel[s]={minCol:d,maxCol:m,minRow:c,maxRow:h}}this._tileRangeByLevel[0]={minCol:0,maxCol:0,minRow:0,maxRow:0},this._primitiveCollection=new this._Cesium.PrimitiveCollection,this._stop=!1}return e.prototype._serialize=function(e){var t=[],i=window.encodeURIComponent;for(var r in e){var o=e[r];"object"===(void 0===o?"undefined":a(o))?t.push(i(r)+"="+i(JSON.stringify(o))):t.push(i(r)+"="+i(e[r]))}return t.join("&")},e.prototype._fetch=function(o){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(t,i){var r=new XMLHttpRequest;if(r.open(n.method||"GET",o),n.headers)for(var e in n.headers)r.setRequestHeader(e,n.headers[e]);r.onload=function(){if(4===r.readyState&&200===r.status)try{var e=JSON.parse(r.responseText);t(e)}catch(e){i(new Error("INVALID RESPONSE"))}},r.onerror=function(e){i(e)},r.onloadend=function(e){200!==e.target.status&&i(new Error("["+e.target.status+"]request failed: "+o))},r.send(n.body||null)})},e.prototype._lonLatToTileInWGS84=function(e,t){var i=n(e,2),r=i[0],o=i[1];return[Math.floor(Math.pow(2,t)*(90-o)/180),Math.floor(Math.pow(2,t)*(180+r)/180)]},e.prototype._radianToDegree=function(e){return e/Math.PI*180},e.prototype._isTileInRange=function(e){try{var t=this._tileRangeByLevel[e.level],i=t.minCol,r=t.maxCol,o=t.minRow,n=t.maxRow;return e.x>=i&&e.x<=r&&e.y>=o&&e.y<=n}catch(e){return!1}},e.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0},e.prototype._loadTile=function(e,t){var l=[],u=new this._Cesium.ColorGeometryInstanceAttribute(.75,.75,.75,1),c=this;return e.features.forEach(function(e){if(c._propertyToBeFiltered&&Array.isArray(c._valuesToBeFiltered)){var t=e.properties[c._propertyToBeFiltered];if(c._valuesToBeFiltered.includes(t))return}var i=e.geometry.type;if("Polygon"===i||"MultiPolygon"===i){var s=[];c.heightById[e.properties.house_id]=e.properties.height,e.geometry.coordinates.forEach(function(e,i){s.push([]),e.forEach(function(e){var t;2<e.length?e.forEach(function(e){var t;2<=e.length&&(t=s[i]).push.apply(t,p(e))}):(t=s[i]).push.apply(t,p(e))});var t=new c._Cesium.PolygonHierarchy(c._Cesium.Cartesian3.fromDegreesArray(s[i])),r=c._Cesium.BoundingSphere.fromPoints(t.positions).center,o=c._viewer.scene.globe.getHeight(c._Cesium.Cartographic.fromCartesian(r))||0,n=new c._Cesium.PolygonGeometry({polygonHierarchy:t,height:o,vertexFormat:c._Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,extrudedHeight:1e3}),a=new c._Cesium.GeometryInstance({geometry:n,attributes:{color:u}});l.push(a)})}else console.warn('GeoJSONVectorTileProvider: geometry type "'+e.geometry.type+'" detected, but is not going to be rendered')}),new this._Cesium.Primitive({allowPicking:!1,appearance:new this._Cesium.PerInstanceColorAppearance({translucent:!1}),geometryInstances:l})},e.prototype._cameraMoveEndHandler=function(){if(!this._stop){var i=this,e=Date.now(),t=this._viewer.scene.globe._surface._tilesToRender,r=t.map(function(e){return e.level}),o=Math.min.apply(Math,p(r)),n=Math.max.apply(Math,p(r));i._removeObsoletePrimitives(i._primitiveByTile,[]),n<this._lowerLevelLimit&&(i._tileKeys=[],i._removeObsoletePrimitives(i._primitiveByTile,[]),t=[]),this._upperLevelLimit&&o>this._upperLevelLimit&&(i._tileKeys=[],i._removeObsoletePrimitives(i._primitiveByTile,[]),t=[]),2<n-o&&(t=t.filter(function(e){return e.level>=n-2})),t.sort(function(e,t){return-(e.level-t.level)}),t=t.filter(function(e){return i._isTileInRange(e)}),this._upperLevelLimit&&(t=this._refineTiles(t,this._upperLevelLimit)),this._isCameraMoving=!1,this._moveEndTimestamp=e,this._viewer.scene.primitives.remove(this.dx),this.dx={},this._primitiveByTile={};var a=[],s=0,l=this._viewer.camera.computeViewRectangle(),u=this._radianToDegree(l.west),c=this._radianToDegree(l.south),h=this._radianToDegree(l.east),d=this._radianToDegree(l.north);this.UrlData.area="RECT("+u+" "+c+","+h+" "+d+")";var m="";o<=this.minLevel1||"Infinity"==o?(this.cluster="city",this.UrlData.cluster=this.cluster,m=this._urlTemplate+"?output="+this.UrlData.output+"&resultmode="+this.UrlData.resultmode+"&uid="+this.UrlData.uid+"&st="+this.UrlData.st+"&words="+this.UrlData.words+"&area="+this.UrlData.area+"&cluster="+this.UrlData.cluster+"&callback="+this.UrlData.callback):o>this.minLevel1&&this.minLevel3>o?(this.cluster="county",this.UrlData.cluster=this.cluster,m=this._urlTemplate+"?output="+this.UrlData.output+"&resultmode="+this.UrlData.resultmode+"&uid="+this.UrlData.uid+"&st="+this.UrlData.st+"&words="+this.UrlData.words+"&area="+this.UrlData.area+"&cluster="+this.UrlData.cluster+"&callback="+this.UrlData.callback):o>=this.minLevel3&&(this.cluster="",m=this._urlTemplate+"?output="+this.UrlData.output+"&resultmode="+this.UrlData.resultmode+"&uid="+this.UrlData.uid+"&st="+this.UrlData.st+"&words="+this.UrlData.words+"&area="+this.UrlData.area+"&callback="+this.UrlData.callback),i._fetch(m).then(function(e){var t=i._loadTile(e,i.cluster);i._primitiveCollection=t,0<=++s&&(i._tileKeys=a,i._removeObsoletePrimitives(i._primitiveByTile,a))}).catch(function(e){0<=++s&&(i._tileKeys=a,i._removeObsoletePrimitives(i._primitiveByTile,a)),e.message})}},e.prototype._refineTiles=function(e,c){var h=[],d=[];return e.forEach(function(e){var t="Z"+e.level+"X"+e.x+"Y"+e.y;if(e.level<c-1)d.includes(t)||(h.push(e),d.push(t));else if(e.level===c-1)for(var i=0;i<2;i++)for(var r=0;r<2;r++){var o="Z"+(e.level+1)+"X"+(2*e.x+i)+"Y"+(2*e.y+r);d.includes(o)||(h.push({x:2*e.x+i,y:2*e.y+r,level:e.level+1}),d.push(o))}else{var n=e.level-c;if(0===n)d.includes(t)||(h.push(e),d.push(t));else{var a=2*n,s=Math.floor(e.x/a),l=Math.floor(e.y/a),u="Z"+c+"X"+s+"Y"+l;d.includes(u)||(h.push({x:s,y:l,level:c}),d.push(u))}}}),h},e.prototype._removeObsoletePrimitives=function(e,t){var i=[];for(var r in 0<t.length&&(i=t),e)i.includes(r)||removed&&delete e[r]},e.prototype.addTo=function(e){this._viewer=e,this._isRemoved=!1,this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.addEventListener(this._cameraMoveStartHandler),this._cameraMoveEndHandler()},e.prototype.remove=function(){if(this._viewer){for(var e in this._primitiveByTile)this._viewer.scene.primitives.remove(this._primitiveByTile[e]);this._primitiveByTile={},this._viewer.camera.moveEnd.removeEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.removeEventListener(this._cameraMoveStartHandler),this._viewer=null,this._isRemoved=!0}},e.prototype.setStatus=function(e){this._stop=e},e.prototype.isRemoved=function(){return this._isRemoved},e.prototype.filterBy=function(e,t,i){this._propertyToBeFiltered=e,this._valuesToBeFiltered=t},e.prototype.removeFilter=function(){this._propertyToBeFiltered=null,this._valuesToBeFiltered=null},e}),define("SGWorld/Creator/LabelGeoJsonFeatureLayer",["../Core/Core","./Color","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min","../VectorTileProvider/GeoJSONVectorTileProvider","../VectorTileProviderPolymerization/GeoJSONVectorTileProvider","../configData"],function(i,r,o,e,h,d,C){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._color=new r(this._viewer,this._cesium),this._tree=o,this._Provider=void 0,this.labelCollections1=[],this.labelCollections2=[],this.labelCollections=this._cesium.PointPrimitiveCollection(),this.gd=0,this.model=[],this.Legend=[],this.sj=!0}return t.prototype.createLabelPointGeoJsonFeatureLayer=function(e,t,d,i,m){null==t&&console.log("geojson is required");var r=this._cesium.GeoJsonDataSource.load(t),p=this;r.then(function(e){var t={Name:"",text:"",font:" 30px sans-serif",stylet:p._cesium.LabelStyle.OUTLINE,fillColor:p._cesium.Color.WHITE,outlineColor:p._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new p._cesium.Color(.165,.165,.165,.8),backgroundPadding:new p._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:p._cesium.HorizontalOrigin.CENTER,verticalOrigin:p._cesium.VerticalOrigin.CENTER,eyeOffset:p._cesium.Cartesian3.ZERO,pixelOffset:p._cesium.Cartesian2.ZERO,heightReference:p._cesium.HeightReference.NONE,scaleByDistance:new p._cesium.NearFarScalar(0,0,1,1)};d.material;p._core.isnull(d)||p._core.isnull(d.fillColor)||/^\[/.test(d.fillColor)&&"["==d.fillColor.toString().charAt(0)&&"]"==d.fillColor.toString().charAt(d.fillColor.length-1)||(p._core.isHtmlColor(d.fillColor)?d.fillColor=p._color.colorFromHtmlColor(d.fillColor):(/^rgb/.test(d.fillColor)&&(d.fillColor=p._color.rgbaStringToRgbaObj(d.fillColor)),1<d.fillColor.r&&(d.fillColor.r=d.fillColor.r/255),1<d.fillColor.g&&(d.fillColor.g=d.fillColor.g/255),1<d.fillColor.b&&(d.fillColor.b=d.fillColor.b/255),1<d.fillColor.a&&(d.fillColor.a=d.fillColor.a/255),d.fillColor=p._color.createColor(d.fillColor.r,d.fillColor.g,d.fillColor.b,d.fillColor.a))),p._core.isnull(d)||p._core.isnull(d.material)||/^\[/.test(d.material)&&"["==d.material.toString().charAt(0)&&"]"==d.material.toString().charAt(d.material.length-1)||(p._core.isHtmlColor(d.material)?d.material=p._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=p._color.rgbaStringToRgbaObj(d.material)),1<d.material.r&&(d.material.r=d.fillColor.r/255),1<d.material.g&&(d.material.g=d.fillColor.g/255),1<d.material.b&&(d.material.b=d.material.b/255),1<d.material.a&&(d.material.a=d.material.a/255),d.material=p._color.createColor(d.material.r,d.material.g,d.material.b,d.material.a))),p._core.isnull(d)||p._core.isnull(d.outlineColor)||/^\[/.test(d.outlineColor)&&"["==d.outlineColor.toString().charAt(0)&&"]"==d.outlineColor.toString().charAt(d.outlineColor.length-1)||(p._core.isHtmlColor(d.outlineColor)?d.outlineColor=p._color.colorFromHtmlColor(d.outlineColor):(/^rgb/.test(d.outlineColor)&&(d.outlineColor=p._color.rgbaStringToRgbaObj(d.outlineColor)),1<d.outlineColor.r&&(d.outlineColor.r=d.outlineColor.r/255),1<d.outlineColor.g&&(d.outlineColor.g=d.outlineColor.g/255),1<d.outlineColor.b&&(d.outlineColor.b=d.outlineColor.b/255),1<d.outlineColor.a&&(d.outlineColor.a=d.outlineColor.a/255),d.outlineColor=p._color.createColor(d.outlineColor.r,d.outlineColor.g,d.outlineColor.b,d.outlineColor.a))),p._core.isnull(d)||p._core.isnull(d.backgroundColor)||/^\[/.test(d.backgroundColor)&&"["==d.backgroundColor.toString().charAt(0)&&"]"==d.backgroundColor.toString().charAt(d.backgroundColor.length-1)||(p._core.isHtmlColor(d.backgroundColor)?d.backgroundColor=p._color.colorFromHtmlColor(d.backgroundColor):(/^rgb/.test(d.backgroundColor)&&(d.backgroundColor=p._color.rgbaStringToRgbaObj(d.backgroundColor)),1<d.backgroundColor.r&&(d.backgroundColor.r=d.backgroundColor.r/255),1<d.backgroundColor.g&&(d.backgroundColor.g=d.backgroundColor.g/255),1<d.backgroundColor.b&&(d.backgroundColor.b=d.backgroundColor.b/255),1<d.backgroundColor.a&&(d.backgroundColor.a=d.backgroundColor.a/255),d.backgroundColor=p._color.createColor(d.backgroundColor.r,d.backgroundColor.g,d.backgroundColor.b,d.backgroundColor.a)));var i=p._core.extend(t,d,!0),r=(p.item=e).entities.values;p._core.isnull(d.near)&&(d.near=0),p._core.isnull(d.far)&&(d.far=999999999);var o=parseFloat(d.near),n=parseFloat(d.far),a=new p._cesium.DistanceDisplayCondition(o,n);i.distanceDisplayCondition=a,p._core.isnull(d.font_size)&&(d.font_size="30px"),p._core.isnull(d.font_family)&&(d.font_family=" sans-serif"),i.font=parseFloat(d.font_size)+"px "+d.font_family;for(var s=new p._cesium.LabelCollection,l=0;l<r.length;l++){var u=r[l];i.position=u.position._value,i.text="a label";var c="fillColor:"+255*i.fillColor.red+","+255*i.fillColor.green+","+255*i.fillColor.blue+";outlineColor:"+255*i.outlineColor.red+","+255*i.outlineColor.green+","+255*i.outlineColor.blue;p.Legend.push(c),s.add(i)}var h=p._viewer.scene.primitives.add(s);"function"==typeof m&&m(h)});var o=this._core.getuid();this._core.isnull(e)&&(e="新建图层"+o);var n={id:o,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"labelPointLayer",item:this,url:t,style:options};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},t.prototype.createLabelPolymerizationGeoJsonFeatureLayer=function(e,t,f,i,v,_){var r={Name:"",text:"",font:" 30px sans-serif",style:this._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.RELATIVE_TO_GROUND,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)},y=this;this._core.isnull(f)||this._core.isnull(f.fillColor)||(this._core.isHtmlColor(f.fillColor)?f.fillColor=this._color.colorFromHtmlColor(f.fillColor):(/^rgb/.test(f.fillColor)&&(f.fillColor=this._color.rgbaStringToRgbaObj(f.fillColor)),1<f.fillColor.r&&(f.fillColor.r=f.fillColor.r/255),1<f.fillColor.g&&(f.fillColor.g=f.fillColor.g/255),1<f.fillColor.b&&(f.fillColor.b=f.fillColor.b/255),1<f.fillColor.a&&(f.fillColor.a=f.fillColor.a/255),f.fillColor=this._color.createColor(f.fillColor.r,f.fillColor.g,f.fillColor.b,f.fillColor.a))),this._core.isnull(f)||this._core.isnull(f.outlineColor)||(this._core.isHtmlColor(f.outlineColor)?f.outlineColor=this._color.colorFromHtmlColor(f.outlineColor):(/^rgb/.test(f.outlineColor)&&(f.outlineColor=this._color.rgbaStringToRgbaObj(f.outlineColor)),1<f.outlineColor.r&&(f.outlineColor.r=f.outlineColor.r/255),1<f.outlineColor.g&&(f.outlineColor.g=f.outlineColor.g/255),1<f.outlineColor.b&&(f.outlineColor.b=f.outlineColor.b/255),1<f.outlineColor.a&&(f.outlineColor.a=f.outlineColor.a/255),f.outlineColor=this._color.createColor(f.outlineColor.r,f.outlineColor.g,f.outlineColor.b,f.outlineColor.a))),this._core.isnull(f)||this._core.isnull(f.backgroundColor)||(this._core.isHtmlColor(f.backgroundColor)?f.backgroundColor=this._color.colorFromHtmlColor(f.backgroundColor):(/^rgb/.test(f.backgroundColor)&&(f.backgroundColor=this._color.rgbaStringToRgbaObj(f.backgroundColor)),1<f.backgroundColor.r&&(f.backgroundColor.r=f.backgroundColor.r/255),1<f.backgroundColor.g&&(f.backgroundColor.g=f.backgroundColor.g/255),1<f.backgroundColor.b&&(f.backgroundColor.b=f.backgroundColor.b/255),1<f.backgroundColor.a&&(f.backgroundColor.a=f.backgroundColor.a/255),f.backgroundColor=this._color.createColor(f.backgroundColor.r,f.backgroundColor.g,f.backgroundColor.b,f.backgroundColor.a))),y._core.isnull(f.near)&&(f.near=0),y._core.isnull(f.far)&&(f.far=999999999);var C=this._core.extend(r,f,!0),o=(this._viewer.scene.camera,this._viewer.scene.canvas,this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(t)));y=this;o.then(function(t){var i,e=(y.item=t).entities.values;y._core.isnull(C.font_size)&&(C.font_size="30"),y._core.isnull(C.font_family)&&(C.font_family=" sans-serif"),C.font=C.font_size+"px "+C.font_family;for(var r=0;r<e.length;r++){var o=e[r];C.font=y._core.extendgl(o,f.font,C.font),C.style=parseInt(y._core.extendgl(o,f.stylet,C.stylet)),C.fillColor=y._core.extendgl(o,f.fillColor,C.fillColor),C.outlineColor=y._core.extendgl(o,f.outlineColor,C.outlineColor),C.outlineWidth=parseFloat(y._core.extendgl(o,f.outlineWidth,C.outlineWidth)),C.show=y._core.extendgl(o,f.show,C.show),C.showBackground=y._core.extendgl(o,f.showBackground,C.showBackground),C.backgroundColor=y._core.extendgl(o,f.backgroundColor,C.backgroundColor),C.backgroundPadding=y._core.extendgl(o,f.backgroundPadding,C.backgroundPadding),C.scale=parseFloat(y._core.extendgl(o,f.scale,C.scale)),C.horizontalOrigin=y._core.extendgl(o,f.horizontalOrigin,C.horizontalOrigin),C.pointHeight=parseFloat(y._core.extendgl(o,f.pointHeight,C.pointHeight)),C.text=y._core.extendgl(o,f.text,C.text);var n=parseFloat(y._core.extendgl(o,C.near)),a=parseFloat(y._core.extendgl(o,C.far)),s=new y._cesium.DistanceDisplayCondition(n,a);C.distanceDisplayCondition=s,C.text=null==o.properties[C.text]?C.text:o.properties[C.text]._value,o.billboard.color=y._cesium.Color.WHITE.withAlpha(0),o.label=new y._cesium.LabelGraphics(C);y._viewer.scene.globe.ellipsoid;var l=y._cesium.Cartographic.fromCartesian(o.position._value),u=y._cesium.Math.toDegrees(l.longitude),c=y._cesium.Math.toDegrees(l.latitude),h=l.height+C.pointHeight,d=new y._cesium.Cartesian3.fromDegrees(u,c,h);o.position._value=d}t.clustering.enabled=!0,t.clustering.pixelRange=45,t.clustering.minimumClusterSize=3;var m=new y._cesium.PinBuilder,p=(m.fromText("50+",y._cesium.Color.RED,48).toDataURL(),m.fromText("40+",y._cesium.Color.ORANGE,48).toDataURL(),m.fromText("30+",y._cesium.Color.YELLOW,48).toDataURL(),m.fromText("20+",y._cesium.Color.GREEN,48).toDataURL(),m.fromText("10+",y._cesium.Color.BLUE,48).toDataURL(),new Array(8));for(r=0;r<p.length;++r)p[r]=m.fromText(""+(r+2),y._cesium.Color.VIOLET,48).toDataURL();!function(){i=y._cesium.defined(i)?void i():t.clustering.clusterEvent.addEventListener(function(e,t){t.label.show=!1,t.point.show=!1,t.billboard.show=!0,t.billboard.id=t.label.id,t.billboard.verticalOrigin=y._cesium.VerticalOrigin.BOTTOM,50<=e.length?t.billboard.image=m.fromText(e.length,y._cesium.Color.RED,48).toDataURL():40<=e.length?t.billboard.image=m.fromText(e.length,y._cesium.Color.ORANGE,48).toDataURL():30<=e.length?t.billboard.image=m.fromText(e.length,y._cesium.Color.YELLOW,48).toDataURL():20<=e.length?t.billboard.image=m.fromText(e.length,y._cesium.Color.GREEN,48).toDataURL():10<=e.length?t.billboard.image=m.fromText(e.length,y._cesium.Color.BLUE,48).toDataURL():t.billboard.image=p[e.length-2]});var e=t.clustering.pixelRange;t.clustering.pixelRange=0,t.clustering.pixelRange=e,v||y.setVisibility(v)}();var g={pixelRange:45,minimumClusterSize:3};y._cesium.knockout.track(g),"function"==typeof _&&_(ps)});var n=this._core.getuid();this._core.isnull(e)&&(e="新建图层"+n);var a={id:n,name:e,checked:v,pId:this._core.isnull(i)?0:i,type:"labelPointLayer",item:this,url:t};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},t.prototype.createPointPolymerizationGeoJsonFeatureLayer=function(e,t,f,i,v,_){var r={color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)};this._core.isnull(f)||this._core.isnull(f.color)||"["==f.color.toString().charAt(0)&&"]"==f.color.toString().charAt(f.color.length-1)||(this._core.isHtmlColor(f.color)?f.color=this._color.colorFromHtmlColor(f.color):(/^rgb/.test(f.color)&&(f.color=this._color.rgbaStringToRgbaObj(f.color)),1<f.color.r&&(f.color.r=f.color.r/255),1<f.color.g&&(f.color.g=f.color.g/255),1<f.color.b&&(f.color.b=f.color.b/255),1<f.color.a&&(f.color.a=f.color.a/255),f.color=this._color.createColor(f.color.r,f.color.g,f.color.b,f.color.a))),this._core.isnull(f)||this._core.isnull(f.outlineColor)||"["==f.outlineColor.toString().charAt(0)&&"]"==f.outlineColor.toString().charAt(f.outlineColor.length-1)||(this._core.isHtmlColor(f.outlineColor)?f.outlineColor=this._color.colorFromHtmlColor(f.outlineColor):(/^rgb/.test(f.outlineColor)&&(f.outlineColor=this._color.rgbaStringToRgbaObj(f.outlineColor)),1<f.outlineColor.r&&(f.outlineColor.r=f.outlineColor.r/255),1<f.outlineColor.g&&(f.outlineColor.g=f.outlineColor.g/255),1<f.outlineColor.b&&(f.outlineColor.b=f.outlineColor.b/255),1<f.outlineColor.a&&(f.outlineColor.a=f.outlineColor.a/255),f.outlineColor=this._color.createColor(f.outlineColor.r,f.outlineColor.g,f.outlineColor.b,f.outlineColor.a)));var y=this._core.extend(r,f,!0),o=(this._viewer.scene.camera,this._viewer.scene.canvas,this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(t))),C=this;o.then(function(t){for(var i,e=(C.item=t).entities.values,r=0;r<e.length;r++){var o=e[r];y.color=C._core.extendgl(o,f.color,y.color),y.pixelSize=parseInt(C._core.extendgl(o,f.pixelSize,y.pixelSize)),y.outlineColor=C._core.extendgl(o,f.outlineColor,y.outlineColor),y.outlineWidth=parseFloat(C._core.extendgl(o,f.outlineWidth,y.outlineWidth)),y.show=C._core.extendgl(o,f.show,y.show),y.height=parseFloat(C._core.extendgl(o,f.height,y.height)),y.scaleByDistance=C._core.extendgl(o,f.scaleByDistance,y.scaleByDistance);var n=parseFloat(C._core.extendgl(o,y.minDistanceDisplay)),a=parseFloat(C._core.extendgl(o,y.maxDistanceDisplay)),s=new C._cesium.DistanceDisplayCondition(n,a);o.billboard.image="",y.distanceDisplayCondition=s,o.point=new C._cesium.PointGraphics(y),y.pointHeight=C._core.extendgl(o,f.pointHeight,y.pointHeight),y.pointHeight=parseFloat(y.pointHeight);C._viewer.scene.globe.ellipsoid;var l=C._cesium.Cartographic.fromCartesian(o.position._value),u=C._cesium.Math.toDegrees(l.longitude),c=C._cesium.Math.toDegrees(l.latitude),h=l.height+y.pointHeight,d=new C._cesium.Cartesian3.fromDegrees(u,c,h);o.position._value=d}t.clustering.enabled=!0,t.clustering.pixelRange=45,t.clustering.minimumClusterSize=3;var m=new C._cesium.PinBuilder,p=(m.fromText("50+",C._cesium.Color.RED,48).toDataURL(),m.fromText("40+",C._cesium.Color.ORANGE,48).toDataURL(),m.fromText("30+",C._cesium.Color.YELLOW,48).toDataURL(),m.fromText("20+",C._cesium.Color.GREEN,48).toDataURL(),m.fromText("10+",C._cesium.Color.BLUE,48).toDataURL(),new Array(8));for(r=0;r<p.length;++r)p[r]=m.fromText(""+(r+2),C._cesium.Color.VIOLET,48).toDataURL();!function(){i=C._cesium.defined(i)?void i():t.clustering.clusterEvent.addEventListener(function(e,t){t.label.show=!1,t.point.show=!1,t.billboard.show=!0,t.billboard.id=t.label.id,t.billboard.verticalOrigin=C._cesium.VerticalOrigin.BOTTOM,50<=e.length?t.billboard.image=m.fromText(e.length,C._cesium.Color.RED,48).toDataURL():40<=e.length?t.billboard.image=m.fromText(e.length,C._cesium.Color.ORANGE,48).toDataURL():30<=e.length?t.billboard.image=m.fromText(e.length,C._cesium.Color.YELLOW,48).toDataURL():20<=e.length?t.billboard.image=m.fromText(e.length,C._cesium.Color.GREEN,48).toDataURL():10<=e.length?t.billboard.image=m.fromText(e.length,C._cesium.Color.BLUE,48).toDataURL():t.billboard.image=p[e.length-2]});var e=t.clustering.pixelRange;t.clustering.pixelRange=0,t.clustering.pixelRange=e,v||C.setVisibility(v)}();var g={pixelRange:45,minimumClusterSize:3};C._cesium.knockout.track(g),"function"==typeof _&&_(ps)});var n=this._core.getuid();this._core.isnull(e)&&(e="新建图层"+n);var a={id:n,name:e,checked:v,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},t.prototype._cameraMoveEndHandler=function(){if(this._viewer.camera.getMagnitude()<this.gd){if(this.sj){this._viewer.scene.primitives.remove(this.labelCollections),this.labelCollections=new this._cesium.LabelCollection;for(var e=0;e<this.labelCollections1.length;e++)this.labelCollections.add(this.labelCollections1[e]);this._viewer.scene.primitives.add(this.labelCollections),this.sj=!1}}else{this._viewer.scene.primitives.remove(this.labelCollections);for(new this._cesium.BillboardCollection,e=0;e<this.labelCollections2.length;e++)this.BillboardCollections.add(this.labelCollections2[e]);this._viewer.scene.primitives.add(this.BillboardCollections),this.sj=!0}},t.prototype.createLabelpolymerizationGeoJsonFeatureLayer=function(e,t,i,r,o,n){var a=t;this._viewer.scene.primitives;this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this.gd=i.height;new this._cesium.BillboardCollection;for(var s={},l=[],u=0;u<a.length;u++){var c={position:new this._cesium.Cartesian3.fromDegrees(a[u].lng,a[u].lat,100),text:a[u].name};this.labelCollections1.push(c);var h=a[u];if(s[h[i.adminname]])for(var d=0;d<l.length;d++){var m=l[d];if(m.adminname==h[i.adminname]){m.data.push(h);break}}else l.push({adminname:h[i.adminname],name:h.name,showBackground:!0,lat:h.lat,lng:h.lng,data:[h]}),s[h[i.adminname]]=h}for(u=0;u<l.length;u++){c={position:new this._cesium.Cartesian3.fromDegrees(l[u].lng,l[u].lat,100),image:pinBuilder.fromText(l[u].data.length+"",this._cesium.Color.BLACK,48).toDataURL()};this.labelCollections2.push(c),this.BillboardCollections.add(c)}this._viewer.scene.primitives.add(this.BillboardCollections)},t.prototype.createLabelpolymerizationGeoJsonFeatureLayers=function(e,t,i,r,o,n){var a={height:0,material:this._cesium.Color.WHITE,size:50,fill:this._cesium.Color.RED},s={url:t.url,upperLevelLimit:21,lowerLevelLimit:0,minLevel1:t.minLevel1,minLevel3:t.minLevel3,rectangle:this._cesium.Rectangle.fromDegrees(118.74324788700017,32.036708147800084,118.7994917630001,32.07298490959994),Cesium:this._cesium,output:t.output,resultmode:t.resultmode,uid:t.uid,st:t.st,words:t.words,area:t.area,callback:t.callback};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):/^http/.test(i.material)||(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._core.isnull(i)||this._core.isnull(i.fill)||"["==i.fill.toString().charAt(0)&&"]"==i.fill.toString().charAt(i.fill.length-1)||(this._core.isHtmlColor(i.fill)?i.fill=this._color.colorFromHtmlColor(i.fill):/^http/.test(i.fill)||(/^rgb/.test(i.fill)&&(i.fill=this._color.rgbaStringToRgbaObj(i.fill)),1<i.fill.r&&(i.fill.r=i.fill.r/255),1<i.fill.g&&(i.fill.g=i.fill.g/255),1<i.fill.b&&(i.fill.b=i.fill.b/255),1<i.fill.a&&(i.fill.a=i.fill.a/255),i.fill=this._color.createColor(i.fill.r,i.fill.g,i.fill.b,i.fill.a)));var l=this._core.extend(a,i,!0),u=this,c=new d(this._viewer,this._cesium,s);(this._Provider=c)._loadTile=function(e,r){u._viewer.scene.primitives.remove(u.labelCollections);u.labelCollections=""==r?new u._cesium.PointPrimitiveCollection:new u._cesium.BillboardCollection;var o=new u._cesium.PinBuilder;return e.result.features.forEach(function(e){var t={};if(null!=e.lng){var i=new u._cesium.Cartesian3.fromDegrees(e.lng,e.lat,l.height);t=""==r?{id:e,color:l.material,position:i}:{position:i,image:o.fromText(e.count+"",l.fill,l.size).toDataURL(),verticalOrigin:u._cesium.VerticalOrigin.BOTTOM},u.labelCollections.add(t)}}),u._viewer.scene.primitives.add(u.labelCollections),u.item=u.labelCollections,u.labelCollections},c.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var h={id:l.id,name:e,checked:!0,pId:this._core.isnull(r)?0:r,type:"polygonLayer",item:this,url:t.url,style:i};return this.setTreeobj(h),this._tree.insertGroupId(h,this._core.isnull(r)?0:r),"function"==typeof n&&n(this.item),this},t.prototype.createLabelGeoJsonFeatureLayerProvider=function(e,t,s,i,r,o){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},l=this;s.material;l._core.isnull(s)||l._core.isnull(s.fillColor)||/^\[/.test(s.fillColor)&&"["==s.fillColor.toString().charAt(0)&&"]"==s.fillColor.toString().charAt(s.fillColor.length-1)||(l._core.isHtmlColor(s.fillColor)?s.fillColor=l._color.colorFromHtmlColor(s.fillColor):(/^rgb/.test(s.fillColor)&&(s.fillColor=l._color.rgbaStringToRgbaObj(s.fillColor)),1<s.fillColor.r&&(s.fillColor.r=s.fillColor.r/255),1<s.fillColor.g&&(s.fillColor.g=s.fillColor.g/255),1<s.fillColor.b&&(s.fillColor.b=s.fillColor.b/255),1<s.fillColor.a&&(s.fillColor.a=s.fillColor.a/255),s.fillColor=l._color.createColor(s.fillColor.r,s.fillColor.g,s.fillColor.b,s.fillColor.a))),l._core.isnull(s)||l._core.isnull(s.material)||/^\[/.test(s.material)&&"["==s.material.toString().charAt(0)&&"]"==s.material.toString().charAt(s.material.length-1)||(l._core.isHtmlColor(s.material)?s.material=l._color.colorFromHtmlColor(s.material):(/^rgb/.test(s.material)&&(s.material=l._color.rgbaStringToRgbaObj(s.material)),1<s.material.r&&(s.material.r=s.material.r/255),1<s.material.g&&(s.material.g=s.material.g/255),1<s.material.b&&(s.material.b=s.material.b/255),1<s.material.a&&(s.material.a=s.material.a/255),s.material=l._color.createColor(s.material.r,s.material.g,s.material.b,s.material.a))),l._core.isnull(s)||l._core.isnull(s.outlineColor)||/^\[/.test(s.outlineColor)&&"["==s.outlineColor.toString().charAt(0)&&"]"==s.outlineColor.toString().charAt(s.outlineColor.length-1)||(l._core.isHtmlColor(s.outlineColor)?s.outlineColor=l._color.colorFromHtmlColor(s.outlineColor):(/^rgb/.test(s.outlineColor)&&(s.outlineColor=l._color.rgbaStringToRgbaObj(s.outlineColor)),1<s.outlineColor.r&&(s.outlineColor.r=s.outlineColor.r/255),1<s.outlineColor.g&&(s.outlineColor.g=s.outlineColor.g/255),1<s.outlineColor.b&&(s.outlineColor.b=s.outlineColor.b/255),1<s.outlineColor.a&&(s.outlineColor.a=s.outlineColor.a/255),s.outlineColor=l._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a))),l._core.isnull(s)||l._core.isnull(s.backgroundColor)||/^\[/.test(s.backgroundColor)&&"["==s.backgroundColor.toString().charAt(0)&&"]"==s.backgroundColor.toString().charAt(s.backgroundColor.length-1)||(l._core.isHtmlColor(s.backgroundColor)?s.backgroundColor=l._color.colorFromHtmlColor(s.backgroundColor):(/^rgb/.test(s.backgroundColor)&&(s.backgroundColor=l._color.rgbaStringToRgbaObj(s.backgroundColor)),1<s.backgroundColor.r&&(s.backgroundColor.r=s.backgroundColor.r/255),1<s.backgroundColor.g&&(s.backgroundColor.g=s.backgroundColor.g/255),1<s.backgroundColor.b&&(s.backgroundColor.b=s.backgroundColor.b/255),1<s.backgroundColor.a&&(s.backgroundColor.a=s.backgroundColor.a/255),s.backgroundColor=l._color.createColor(s.backgroundColor.r,s.backgroundColor.g,s.backgroundColor.b,s.backgroundColor.a)));var a=new h(this._viewer,this._cesium,n);(this._Provider=a)._loadTile=function(e){var t={Name:"",text:"",font:" 30px sans-serif",style:l._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:l._cesium.Color.WHITE,outlineColor:l._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new l._cesium.Color(.165,.165,.165,.8),backgroundPadding:new l._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:l._cesium.HorizontalOrigin.CENTER,verticalOrigin:l._cesium.VerticalOrigin.CENTER,eyeOffset:l._cesium.Cartesian3.ZERO,pixelOffset:l._cesium.Cartesian2.ZERO,heightReference:l._cesium.HeightReference.NONE,scaleByDistance:new l._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},n=l._core.extend(t,s,!0);l._core.isnull(s.near)&&(s.near=0),l._core.isnull(s.far)&&(s.far=999999999);var a,i=parseFloat(s.near),r=parseFloat(s.far),o=new l._cesium.DistanceDisplayCondition(i,r);return n.distanceDisplayCondition=o,l._core.isnull(s.font_size)&&(s.font_size="30px"),l._core.isnull(s.font_family)&&(s.font_family=" sans-serif"),n.font=parseFloat(s.font_size)+"px "+s.font_family,a=null!=n.image&&null!=n.image?new l._cesium.BillboardCollection:new l._cesium.LabelCollection,e.features.forEach(function(e){n.id=e;var t=n.pointHeight;if(/^\[/.test(t)&&/\]$/.test(t)){var i=t.replace(/\[/,"").replace(/\]/,"");t=parseFloat(e.properties[i])}else null!=t&&""!=t?t=parseFloat(t):null!=e.properties.height&&(t=parseFloat(e.properties.height));if(n.position=new l._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),/^\[/.test(s.fillColor)&&/\]$/.test(s.fillColor)){var r=s.fillColor.replace(/\[/,"").replace(/\]/,"");n.fillColor=e.properties[r],l._core.isHtmlColor(n.fillColor)?n.fillColor=l._color.colorFromHtmlColor(n.fillColor):(/^rgb/.test(n.fillColor)&&(n.fillColor=l._color.rgbaStringToRgbaObj(n.fillColor)),1<n.fillColor.r&&(n.fillColor.r=n.fillColor.r/255),1<n.fillColor.g&&(n.fillColor.g=n.fillColor.g/255),1<n.fillColor.b&&(n.fillColor.b=n.fillColor.b/255),1<n.fillColor.a&&(n.fillColor.a=n.fillColor.a/255),n.fillColor=l._color.createColor(n.fillColor.r,n.fillColor.g,n.fillColor.b,n.fillColor.a))}if(/^\[/.test(s.outlineColor)&&/\]$/.test(s.outlineColor)){r=s.outlineColor.replace(/\[/,"").replace(/\]/,"");n.outlineColor=e.properties[r],l._core.isHtmlColor(n.outlineColor)?n.outlineColor=l._color.colorFromHtmlColor(n.outlineColor):(/^rgb/.test(n.outlineColor)&&(n.outlineColor=l._color.rgbaStringToRgbaObj(n.outlineColor)),1<n.outlineColor.r&&(n.outlineColor.r=n.outlineColor.r/255),1<n.outlineColor.g&&(n.outlineColor.g=n.outlineColor.g/255),1<n.outlineColor.b&&(n.outlineColor.b=n.outlineColor.b/255),1<n.outlineColor.a&&(n.outlineColor.a=n.outlineColor.a/255),n.outlineColor=l._color.createColor(n.outlineColor.r,n.outlineColor.g,n.outlineColor.b,n.outlineColor.a))}var o="fillColor:"+255*n.fillColor.red+","+255*n.fillColor.green+","+255*n.fillColor.blue+";outlineColor:"+255*n.outlineColor.red+","+255*n.outlineColor.green+","+255*n.outlineColor.blue;if(l.Legend.push(o),/^\[/.test(s.text)&&/\]$/.test(s.text)){r=s.text.replace(/\[/,"").replace(/\]/,"");n.text=e.properties[r]}a.add(n)}),a},s&&s.time&&(a.availability=new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:s.time.start?l._cesium.JulianDate.fromDate(new Date(s.time.start)):l._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?l._cesium.JulianDate.fromDate(new Date(s.time.end)):l._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=a._primitiveCollection,a.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+s.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var u={id:s.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"labelPointLayer",item:this,url:t.url,style:s};return this.setTreeobj(u),this._tree.insertGroupId(u,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},t.prototype.createLabelRichtextGeoJsonFeatureLayerProvider=function(e,t,g,i,f,v){null==t&&console.log("geojson is required");var r=this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(r);var _=this,y=new this._cesium.PointPrimitiveCollection;_.optiontext=[],r.then(function(e){for(var t=(_.item=e).entities.values,i=0;i<t.length;i++){var r,o=t[i];if(/^\[/.test(g.text)&&/\]$/.test(g.text)){var n=g.text.replace(/\[/,"").replace(/\]/,"");r=o.properties[n]._value}else r=g.text;_.optiontext.push(r),o.billboard=void 0;_._viewer.scene.globe.ellipsoid;var a,s=_._cesium.Cartographic.fromCartesian(o.position._value),l=[_._cesium.Math.toDegrees(s.longitude),_._cesium.Math.toDegrees(s.latitude),s.height+g.pointHeight],u=_._core.getuid();l instanceof Array?2===l.length?a=_._cesium.Cartesian3.fromDegrees(l[0],l[1]):3===l.length&&(a=_._cesium.Cartesian3.fromDegrees(l[0],l[1],l[2])):a=l.z?_._cesium.Cartesian3.fromDegrees(l.x,l.y,l.z):_._cesium.Cartesian3.fromDegrees(l.x,l.y);var c="DivPoint"+u;y.add({id:c,position:a,color:_._cesium.Color.YELLOW,description:g.text})}_.item=y,_.pointPrimitive=_._viewer.scene.primitives.add(y);var h,d,m,p=!0;_.pointPrimitive.update=function(){for(var e,t,i=0;i<_.pointPrimitive.length;i++){if(e=_.pointPrimitive.get(i),m=e.position,!(d=_._viewer.scene.cartesianToCanvasCoordinates(m)))return;(h=document.getElementById(e.id))||(t='<div id="'+e.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+C.divpoint1+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">'+_.optiontext[i]+"</div>\n </div>",$(".cesium-viewer").append(t),h=document.getElementById(e.id)),e.description?h.style.transform="matrix(1, 0, 0, 1, "+d.x+", "+(d.y-157)+")":h.style.transform="matrix(1, 0, 0, 1, "+d.x+", "+(d.y-134)+")"}p&&(f||_.setVisibility(!1),p=!1)},"function"==typeof v&&v(e)}),this._core.isnull(g.id)&&(g.id=this._core.getuid()),this._core.isnull(e)&&(e="富文本");var o={id:g.id,name:e,checked:f,pId:this._core.isnull(i)?0:i,type:"DivPoint",item:this,url:t,style:g};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},t.prototype.createLabelRichtextGeoJsonFeatureLayerProviderLayer=function(e,t,l,i,u,r){var o={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},c=this,n=new h(this._viewer,this._cesium,o);(this._Provider=n)._loadTile=function(e){var r,o,n,a=new c._cesium.PointPrimitiveCollection;c.optiontext=[],e.features.forEach(function(e){var t=options.pointHeight;if(null!=e.properties.height&&(t=parseFloat(e.properties.height)+t),/^\[/.test(options.pointHeight)&&/\]$/.test(options.pointHeight)){var i=options.pointHeight.replace(/\[/,"").replace(/\]/,"");t=parseFloat(e.properties[i])}if(l.position=new c._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),/^\[/.test(l.text)&&/\]$/.test(l.text)){var r=l.text.replace(/\[/,"").replace(/\]/,"");l.text=e.properties[r]}var o="DivPoint"+c._core.getuid();a.add({id:o,position:Cartesian3,color:c._cesium.Color.YELLOW,description:l.text}),c.optiontext.push(option.text)}),c.pointPrimitive=c._viewer.scene.primitives.add(a);var s=!0;return c.pointPrimitive.update=function(){for(var e,t,i=0;i<c.pointPrimitive.length;i++){if(e=c.pointPrimitive.get(i),n=e.position,!(o=c._viewer.scene.cartesianToCanvasCoordinates(n)))return;(r=document.getElementById(e.id))||(t='<div id="'+e.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+C.divpoint1+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">'+c.optiontext[i]+"</div>\n </div>",$(".cesium-viewer").append(t),r=document.getElementById(e.id)),e.description?r.style.transform="matrix(1, 0, 0, 1, "+o.x+", "+(o.y-157)+")":r.style.transform="matrix(1, 0, 0, 1, "+o.x+", "+(o.y-134)+")"}s&&(u||c.setVisibility(!1),s=!1)},c.item=a,""},n.addTo(this._viewer),u||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="富文本"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var a={id:l.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"DivPoint",item:this,url:t.url,style:l};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},t.prototype.createModelGeoJsonFeatureLayerProvider=function(e,t,s,i,r,o){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},l=this;s.material;l._core.isnull(s)||l._core.isnull(s.color)||/^\[/.test(s.color)&&"["==s.color.toString().charAt(0)&&"]"==s.color.toString().charAt(s.color.length-1)||(l._core.isHtmlColor(s.color)?s.color=l._color.colorFromHtmlColor(s.color):(/^rgb/.test(s.color)&&(s.color=l._color.rgbaStringToRgbaObj(s.color)),1<s.color.r&&(s.color.r=s.color.r/255),1<s.color.g&&(s.color.g=s.color.g/255),1<s.color.b&&(s.color.b=s.color.b/255),1<s.color.a&&(s.color.a=s.color.a/255),s.color=l._color.createColor(s.color.r,s.color.g,s.color.b,s.color.a)));var a=new h(this._viewer,this._cesium,n);(this._Provider=a)._loadTile=function(e){var t={url:"",modelMatrix:l._cesium.Transforms.eastNorthUpToFixedFrame(origin),color:l._cesium.Color.DARKSALMON,scale:2},o=l._core.extend(t,s,!0);l._core.isnull(s.near)&&(s.near=0),l._core.isnull(s.far)&&(s.far=999999999);var i=parseFloat(s.near),r=parseFloat(s.far),n=new l._cesium.DistanceDisplayCondition(i,r);o.distanceDisplayCondition=n;var a=new l._cesium.PrimitiveCollection;return e.features.forEach(function(e){o.id=e;var t=o.height;if(null!=e.properties.height&&(t=parseFloat(e.properties.height)),/^\[/.test(o.height)&&/\]$/.test(o.height)){var i=o.height.replace(/\[/,"").replace(/\]/,"");t=parseFloat(e.properties[i])}o.modelMatrix=l._cesium.Transforms.eastNorthUpToFixedFrame(l._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t));var r=l._cesium.Model.fromGltf({id:e,url:o.uri,color:o.color,modelMatrix:o.modelMatrix,scale:o.scale,heightReference:parseInt(o.heightReference),distanceDisplayCondition:o.distanceDisplayCondition});a.add(r)}),a},this.item=a._primitiveCollection,a.addTo(this._viewer),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+s.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,r||this.setVisibility(!1);var u={id:s.id,name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"modelLayer",item:this,url:t.url,style:s};return this.setTreeobj(u),this._tree.insertGroupId(u,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},t.prototype.createPointGeoJsonFeatureLayerProvider=function(e,t,l,i,r,o){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},u=this;u._core.isnull(l)||u._core.isnull(l.color)||/^\[/.test(l.color)&&"["==l.color.toString().charAt(0)&&"]"==l.color.toString().charAt(l.color.length-1)||(u._core.isHtmlColor(l.color)?l.color=u._color.colorFromHtmlColor(l.color):(/^rgb/.test(l.color)&&(l.color=u._color.rgbaStringToRgbaObj(l.color)),1<l.color.r&&(l.color.r=l.color.r/255),1<l.color.g&&(l.color.g=l.color.g/255),1<l.color.b&&(l.color.b=l.color.b/255),1<l.color.a&&(l.color.a=l.color.a/255),l.color=u._color.createColor(l.color.r,l.color.g,l.color.b,l.color.a))),u._core.isnull(l)||u._core.isnull(l.outlineColor)||/^\[/.test(l.outlineColor)&&"["==l.outlineColor.toString().charAt(0)&&"]"==l.outlineColor.toString().charAt(l.outlineColor.length-1)||(u._core.isHtmlColor(l.outlineColor)?l.outlineColor=u._color.colorFromHtmlColor(l.outlineColor):(/^rgb/.test(l.outlineColor)&&(l.outlineColor=u._color.rgbaStringToRgbaObj(l.outlineColor)),1<l.outlineColor.r&&(l.outlineColor.r=l.outlineColor.r/255),1<l.outlineColor.g&&(l.outlineColor.g=l.outlineColor.g/255),1<l.outlineColor.b&&(l.outlineColor.b=l.outlineColor.b/255),1<l.outlineColor.a&&(l.outlineColor.a=l.outlineColor.a/255),l.outlineColor=u._color.createColor(l.outlineColor.r,l.outlineColor.g,l.outlineColor.b,l.outlineColor.a)));var a=new h(this._viewer,this._cesium,n);(this._Provider=a)._loadTile=function(e){var t={Name:"",text:"",font:" 30px sans-serif",pixelSize:10,style:u._cesium.LabelStyle.OUTLINE,fillColor:u._cesium.Color.WHITE,outlineColor:u._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new u._cesium.Color(.165,.165,.165,.8),backgroundPadding:new u._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:u._cesium.HorizontalOrigin.CENTER,verticalOrigin:u._cesium.VerticalOrigin.CENTER,eyeOffset:u._cesium.Cartesian3.ZERO,pixelOffset:u._cesium.Cartesian2.ZERO,heightReference:u._cesium.HeightReference.NONE,scaleByDistance:new u._cesium.NearFarScalar(0,0,1,1)};l.material;u._core.isnull(l)||u._core.isnull(l.backgroundColor)||/^\[/.test(l.backgroundColor)&&"["==l.backgroundColor.toString().charAt(0)&&"]"==l.backgroundColor.toString().charAt(l.backgroundColor.length-1)||(u._core.isHtmlColor(l.backgroundColor)?l.backgroundColor=u._color.colorFromHtmlColor(l.backgroundColor):(/^rgb/.test(l.backgroundColor)&&(l.backgroundColor=u._color.rgbaStringToRgbaObj(l.backgroundColor)),1<l.backgroundColor.r&&(l.backgroundColor.r=l.backgroundColor.r/255),1<l.backgroundColor.g&&(l.backgroundColor.g=l.backgroundColor.g/255),1<l.backgroundColor.b&&(l.backgroundColor.b=l.backgroundColor.b/255),1<l.backgroundColor.a&&(l.backgroundColor.a=l.backgroundColor.a/255),l.backgroundColor=u._color.createColor(l.backgroundColor.r,l.backgroundColor.g,l.backgroundColor.b,l.backgroundColor.a)));var a=u._core.extend(t,l,!0);u._core.isnull(l.near)&&(l.near=0),u._core.isnull(l.far)&&(l.far=999999999);var i=parseFloat(l.near),r=parseFloat(l.far),o=new u._cesium.DistanceDisplayCondition(i,r);a.distanceDisplayCondition=o,u._core.isnull(l.font_size)&&(l.font_size="30px"),u._core.isnull(l.font_family)&&(l.font_family=" sans-serif"),a.font=parseFloat(l.font_size)+"px "+l.font_family;var s=new u._cesium.PointPrimitiveCollection;return e.features.forEach(function(e){a.id=e;var t=0;if(/^\[/.test(a.pointHeight)&&/\]$/.test(a.pointHeight)){var i=a.pointHeight.replace(/\[/,"").replace(/\]/,"");t=parseFloat(e.properties[i])}else void 0!==a.pointHeight&&""!==a.pointHeight?t=parseFloat(a.pointHeight):null!=e.properties.height&&(t=parseFloat(e.properties.height));if(/^\[/.test(l.color)&&/\]$/.test(l.color)){var r=l.color.replace(/\[/,"").replace(/\]/,"");a.color=e.properties[r],u._core.isHtmlColor(a.color)?a.color=u._color.colorFromHtmlColor(a.color):(/^rgb/.test(a.color)&&(a.color=u._color.rgbaStringToRgbaObj(a.color)),1<a.color.r&&(a.color.r=a.color.r/255),1<a.color.g&&(a.color.g=a.color.g/255),1<a.color.b&&(a.color.b=a.color.b/255),1<a.color.a&&(a.color.a=a.color.a/255),a.color=u._color.createColor(a.color.r,a.color.g,a.color.b,a.color.a))}if(/^\[/.test(l.outlineColor)&&/\]$/.test(l.outlineColor)){r=l.outlineColor.replace(/\[/,"").replace(/\]/,"");a.outlineColor=e.properties[r],u._core.isHtmlColor(a.outlineColor)?a.outlineColor=u._color.colorFromHtmlColor(a.outlineColor):(/^rgb/.test(a.outlineColor)&&(a.outlineColor=u._color.rgbaStringToRgbaObj(a.outlineColor)),1<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor=u._color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a))}a.position=new u._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),a.text=e.properties.name;var o={show:a.show,position:a.position,pixelSize:a.pixelSize,color:a.color,outlineColor:a.outlineColor,outlineWidth:a.outlineWidth,id:e},n="color:"+255*a.color.red+","+255*a.color.green+","+255*a.color.blue+";outlineColor:"+255*a.outlineColor.red+","+255*a.outlineColor.green+","+255*a.outlineColor.blue;u.Legend.push(n),s.add(o)}),s},this.item=a._primitiveCollection,a.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var s={id:l.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t.url,style:l};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},t.prototype.createPointGeoJsonFeatureLayerProvider=function(e,t,l,i,r,o){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},u=this;u._core.isnull(l)||u._core.isnull(l.color)||/^\[/.test(l.color)&&"["==l.color.toString().charAt(0)&&"]"==l.color.toString().charAt(l.color.length-1)||(u._core.isHtmlColor(l.color)?l.color=u._color.colorFromHtmlColor(l.color):(/^rgb/.test(l.color)&&(l.color=u._color.rgbaStringToRgbaObj(l.color)),1<l.color.r&&(l.color.r=l.color.r/255),1<l.color.g&&(l.color.g=l.color.g/255),1<l.color.b&&(l.color.b=l.color.b/255),1<l.color.a&&(l.color.a=l.color.a/255),l.color=u._color.createColor(l.color.r,l.color.g,l.color.b,l.color.a))),u._core.isnull(l)||u._core.isnull(l.outlineColor)||/^\[/.test(l.outlineColor)&&"["==l.outlineColor.toString().charAt(0)&&"]"==l.outlineColor.toString().charAt(l.outlineColor.length-1)||(u._core.isHtmlColor(l.outlineColor)?l.outlineColor=u._color.colorFromHtmlColor(l.outlineColor):(/^rgb/.test(l.outlineColor)&&(l.outlineColor=u._color.rgbaStringToRgbaObj(l.outlineColor)),1<l.outlineColor.r&&(l.outlineColor.r=l.outlineColor.r/255),1<l.outlineColor.g&&(l.outlineColor.g=l.outlineColor.g/255),1<l.outlineColor.b&&(l.outlineColor.b=l.outlineColor.b/255),1<l.outlineColor.a&&(l.outlineColor.a=l.outlineColor.a/255),l.outlineColor=u._color.createColor(l.outlineColor.r,l.outlineColor.g,l.outlineColor.b,l.outlineColor.a)));var a=new h(this._viewer,this._cesium,n);(this._Provider=a)._loadTile=function(e){var t={Name:"",text:"",font:" 30px sans-serif",pixelSize:10,style:u._cesium.LabelStyle.OUTLINE,fillColor:u._cesium.Color.WHITE,outlineColor:u._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new u._cesium.Color(.165,.165,.165,.8),backgroundPadding:new u._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:u._cesium.HorizontalOrigin.CENTER,verticalOrigin:u._cesium.VerticalOrigin.CENTER,eyeOffset:u._cesium.Cartesian3.ZERO,pixelOffset:u._cesium.Cartesian2.ZERO,heightReference:u._cesium.HeightReference.NONE,scaleByDistance:new u._cesium.NearFarScalar(0,0,1,1)};l.material;u._core.isnull(l)||u._core.isnull(l.backgroundColor)||/^\[/.test(l.backgroundColor)&&"["==l.backgroundColor.toString().charAt(0)&&"]"==l.backgroundColor.toString().charAt(l.backgroundColor.length-1)||(u._core.isHtmlColor(l.backgroundColor)?l.backgroundColor=u._color.colorFromHtmlColor(l.backgroundColor):(/^rgb/.test(l.backgroundColor)&&(l.backgroundColor=u._color.rgbaStringToRgbaObj(l.backgroundColor)),1<l.backgroundColor.r&&(l.backgroundColor.r=l.backgroundColor.r/255),1<l.backgroundColor.g&&(l.backgroundColor.g=l.backgroundColor.g/255),1<l.backgroundColor.b&&(l.backgroundColor.b=l.backgroundColor.b/255),1<l.backgroundColor.a&&(l.backgroundColor.a=l.backgroundColor.a/255),l.backgroundColor=u._color.createColor(l.backgroundColor.r,l.backgroundColor.g,l.backgroundColor.b,l.backgroundColor.a)));var a=u._core.extend(t,l,!0);u._core.isnull(l.near)&&(l.near=0),u._core.isnull(l.far)&&(l.far=999999999);var i=parseFloat(l.near),r=parseFloat(l.far),o=new u._cesium.DistanceDisplayCondition(i,r);a.distanceDisplayCondition=o,u._core.isnull(l.font_size)&&(l.font_size="30px"),u._core.isnull(l.font_family)&&(l.font_family=" sans-serif"),a.font=parseFloat(l.font_size)+"px "+l.font_family;var s=new u._cesium.PointPrimitiveCollection;return e.features.forEach(function(e){a.id=e;var t=0;if(/^\[/.test(a.pointHeight)&&/\]$/.test(a.pointHeight)){var i=a.pointHeight.replace(/\[/,"").replace(/\]/,"");t=parseFloat(e.properties[i])}else void 0!==a.pointHeight&&""!==a.pointHeight?t=parseFloat(a.pointHeight):null!=e.properties.height&&(t=parseFloat(e.properties.height));if(/^\[/.test(l.color)&&/\]$/.test(l.color)){var r=l.color.replace(/\[/,"").replace(/\]/,"");a.color=e.properties[r],u._core.isHtmlColor(a.color)?a.color=u._color.colorFromHtmlColor(a.color):(/^rgb/.test(a.color)&&(a.color=u._color.rgbaStringToRgbaObj(a.color)),1<a.color.r&&(a.color.r=a.color.r/255),1<a.color.g&&(a.color.g=a.color.g/255),1<a.color.b&&(a.color.b=a.color.b/255),1<a.color.a&&(a.color.a=a.color.a/255),a.color=u._color.createColor(a.color.r,a.color.g,a.color.b,a.color.a))}if(/^\[/.test(l.outlineColor)&&/\]$/.test(l.outlineColor)){r=l.outlineColor.replace(/\[/,"").replace(/\]/,"");a.outlineColor=e.properties[r],u._core.isHtmlColor(a.outlineColor)?a.outlineColor=u._color.colorFromHtmlColor(a.outlineColor):(/^rgb/.test(a.outlineColor)&&(a.outlineColor=u._color.rgbaStringToRgbaObj(a.outlineColor)),1<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor=u._color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a))}a.position=new u._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),a.text=e.properties.name;var o={show:a.show,position:a.position,pixelSize:a.pixelSize,color:a.color,outlineColor:a.outlineColor,outlineWidth:a.outlineWidth,id:e},n="color:"+255*a.color.red+","+255*a.color.green+","+255*a.color.blue+";outlineColor:"+255*a.outlineColor.red+","+255*a.outlineColor.green+","+255*a.outlineColor.blue;u.Legend.push(n),s.add(o)}),s},this.item=a._primitiveCollection,a.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var s={id:l.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t.url,style:l};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},t.prototype.setTreeobj=function(e){this.treeobj=e},t.prototype.getLegend=function(){var e=[];return null!=this.Legend&&(e=this._core.unique(this.Legend)),e},t.prototype.deleteObject=function(){if(null!=this._Provider&&this._Provider.setStatus(!1),null!=this.items&&null!=this.items&&0<this.items.length)for(var e=0;e<this.items.length;e++)this._viewer.scene.primitives.remove(this.items[e]);else this._viewer.scene.primitives.remove(this.item);if("DivPoint"===this.treeobj.type&&this.item&&null!=this.item._pointPrimitives&&null!=this.item._pointPrimitives)for(e=0;e<this.item._pointPrimitives.length;e++){var t=document.getElementById(this.item._pointPrimitives[e].id);t&&t.remove()}try{this._Provider.remove()}catch(e){}},t.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},t.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(!e)}catch(e){}},t.prototype.setVisibility=function(e){if(null!=this.treeobj&&"DivPoint"===this.treeobj.type&&this.item&&null!=this.item._pointPrimitives&&null!=this.item._pointPrimitives)for(var t=0;t<this.item._pointPrimitives.length;t++){var i=document.getElementById(this.item._pointPrimitives[t].id);i&&(i.style.display=e?"block":"none")}null!=this.item&&(this.item.show=e),this._Provider&&this._Provider.setStatus(!e)},Object.defineProperties(t.prototype,{labelText:{set:e.debounce(function(e){var t=e;if(!this._core.isnull(e)){var i=this.item.entities&&this.item.entities.values;if(i&&0<i.length)for(var r=0;r<i.length;r++)if(/^\[/.test(e)&&(t=e.replace(/\[/,"").replace(/\]/,""),t=i[r].properties[t]._value),i[r].label){i[r].label.text=t;try{i[r].point.show=!1}catch(e){}}else{try{i[r].point.show=!1}catch(e){}i[r].label=new this._cesium.LabelGraphics({text:t,font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})}}},500)},labelStyles:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.style=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?e[0].label.style:void 0}},labelFont:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if(e=e.toString().replace(/px/g,""),!t||/^point.fid/.test(t[0]._id)||null!=t[0].label){var i=t[0].label.font,r=16;if(i&&(r=(i=i._value.trimLeft().trimRight()).split("px")[0]),t&&0<t.length&&t[0].label)for(var o=0;o<t.length;o++)t[o].label.font=r+"px "+e}}},500)},labelFontSize1:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if(e=e.toString().replace(/px/g,""),!t||/^point.fid/.test(t[0]._id)||null!=t[0].label){var i=t[0].label.font,r="sans-serif";if(i&&(r=(i=i._value.trimLeft().trimRight()).split("px")[1]),t&&0<t.length&&t[0].label)for(var o=0;o<t.length;o++)t[o].label.font=e+"px "+r}}},500)},labelFontSize:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if(e=e.toString().replace(/px/g,""),(!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.font=e+"px sans-serif"}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?parseFloat(e[0].label.font):void 0}},labelFillColor:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.fillColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.fillColor;return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}}},labelOutlineColor:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.outlineColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.outlineColor;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},labelOutlineWidth:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].label.outlineWidth=e}},200),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.outlineWidth;return t?t._value:void 0}}},labelBackgroundColor:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.backgroundColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.backgroundColor;return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}}},labelBackground:{set:e.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.showBackground=e},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?e[0].label.background:void 0}},labelScale:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].label.scale=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.scale;return t?t._value:void 0}}},labelHorizontalOrigin:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.horizontalOrigin=parseInt(e)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.horizontalOrigin;return t?t._value:void 0}}},labelVerticalOrigin:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.verticalOrigin=parseInt(e)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.verticalOrigin;return t?t._value:void 0}}},labelHeightReference:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.heightReference;return t?t._value:void 0}}},labelDistanceDisplayMaxCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=t[0].label.distanceDisplayCondition?t[0].label.distanceDisplayCondition._value.near:0,r=0;r<t.length;r++)t[r].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,parseInt(e)),t[r].label.scaleByDistance=new this._cesium.NearFarScalar(i,1,parseInt(e),0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&(e&&0<e.length&&e[0].label))return e[0].label.distanceDisplayCondition?e[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE}},labelDistanceDisplayMinCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=t[0].label.distanceDisplayCondition?t[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE,r=0;r<t.length;r++)t[r].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(parseInt(e),i),t[r].label.scaleByDistance=new this._cesium.NearFarScalar(parseInt(e),1,i,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&(e&&0<e.length&&e[0].label))return e[0].label.distanceDisplayCondition?e[0].label.distanceDisplayCondition._value.near:0}},labelHeight:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var r=this._cesium.Cartographic.fromCartesian(t[i].position._value),o=this._cesium.Math.toDegrees(r.longitude),n=this._cesium.Math.toDegrees(r.latitude),a=this._cesium.Cartesian3.fromDegrees(o,n,e);t[i].position=a}}},500),get:function(){return 0}},labelShow:{set:e.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].label&&e?(t[i].point&&(t[i].point.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e),t[i].label=new this._cesium.LabelGraphics({text:"label",font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})):(t[i].label&&(t[i].label.show=e),t[i].point&&(t[i].point.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?e[0].label.show:void 0}},modelShow:{set:e.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)t[i].label&&(t[i].label.show=!e),t[i].point&&(t[i].point.show=!e),t[i].billboard&&(t[i].billboard.show=!e),!t[i].model&&e?t[i].model=new this._cesium.ModelGraphics({show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE}):(t[i].model&&(t[i].model.show=e),t[i].label&&(t[i].label.show=!e),t[i].point&&(t[i].point.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)return e&&0<e.length&&e[0].model?e[0].model.show:void 0}},modelUri:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length)for(var i=0;i<t.length;i++)if(t[i].model)t[i].model.uri=e;else{if(/^\[/.test(e)){var r=e.split("[");e=1<r.length?r[0]+r[1].replace(/\[/,"").replace(/\]/,""):(e=e.replace(/\[/,"").replace(/\]/,""),t[i].properties[e])}t[i].model=new this._cesium.ModelGraphics({uri:e,show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE})}}},500)},modelScale:{set:e.debounce(function(e){if(!this._core.isnull(e)){e=parseFloat(e);var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].model.scale=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){var t=e[0].model.scale;return t?t._value:void 0}}},modelShadows:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.shadows=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)return e&&0<e.length&&e[0].model?e[0].model.shadows:void 0}},modelHeightReference:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){var t=e[0].model.heightReference;return t?t._value:void 0}}},modelDistanceDisplayMaxCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=t[0].model.distanceDisplayCondition?t[0].model.distanceDisplayCondition._value.near:0,r=0;r<t.length;r++)t[r].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model)e[0].model.distanceDisplayCondition?e[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE}},modelDistanceDisplayMinCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=t[0].model.distanceDisplayCondition?t[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE,r=0;r<t.length;r++)t[r].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&(e&&0<e.length&&e[0].model))return e[0].model.distanceDisplayCondition?e[0].model.distanceDisplayCondition._value.near:0}},modelColor:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.color=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){var t=e[0].model.color;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},modelLightColor:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.lightColor=e}},100),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){var t=e[0].model.lightColor;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},modelHeight:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var r=this._cesium.Cartographic.fromCartesian(t[i].position._value),o=this._cesium.Math.toDegrees(r.longitude),n=this._cesium.Math.toDegrees(r.latitude),a=this._cesium.Cartesian3.fromDegrees(o,n,e);t[i].position=a}}},500),get:function(){return 0}},pointColor:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.color=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){var t=e[0].point.color;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},pointShow:{set:e.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].point&&e?(t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e),t[i].point=new this._cesium.PointGraphics({color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0})):(t[i].point&&(t[i].point.show=e),t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)return e&&0<e.length&&e[0].point?e[0].point.show:void 0}},pointPixelSize:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].point.pixelSize=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){var t=e[0].point.pixelSize;return t?t._value:void 0}}},pointOutlineColor:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.outlineColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){var t=e[0].point.outlineColor;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},pointOutlineWidth:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].point.outlineWidth=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){var t=e[0].point.outlineWidth;return t?t._value:void 0}}},pointHeightReference:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){var t=e[0].point.heightReference;return t?t._value:void 0}}},pointDistanceDisplayMaxCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=t[0].point.distanceDisplayCondition?t[0].point.distanceDisplayCondition._value.near:0,r=0;r<t.length;r++)t[r].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e),t[r].point.scaleByDistance=new this._cesium.NearFarScalar(i,1,e,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&(e&&0<e.length&&e[0].point))return e[0].point.distanceDisplayCondition?e[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE}},pointDistanceDisplayMinCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=t[0].point.distanceDisplayCondition?t[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE,r=0;r<t.length;r++)t[r].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i),t[r].point.scaleByDistance=new this._cesium.NearFarScalar(e,1,i,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&(e&&0<e.length&&e[0].point))return e[0].point.distanceDisplayCondition?e[0].point.distanceDisplayCondition._value.near:0}},pointHeight:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var r=this._cesium.Cartographic.fromCartesian(t[i].position._value),o=this._cesium.Math.toDegrees(r.longitude),n=this._cesium.Math.toDegrees(r.latitude),a=this._cesium.Cartesian3.fromDegrees(o,n,e);t[i].position=a}}},500),get:function(){return 0}},billboardShow:{set:e.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].billboard&&e?(t[i].point&&(t[i].point.show=!e),t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard=new this._cesium.BillboardGraphics({show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})):(t[i].billboard&&(t[i].billboard.show=e),t[i].point&&(t[i].point.show=!e),t[i].label&&(t[i].label.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)return e&&0<e.length&&e[0].billboard?e[0].billboard.show:void 0}},billboardImage:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length)for(var i=0;i<t.length;i++){if(/^\[/.test(e)){var r=e.split("[");e=1<r.length?r[0]+r[1].replace(/\[/,"").replace(/\]/,""):(e=e.replace(/\[/,"").replace(/\]/,""),t[i].properties[e])}t[i].billboard?t[i].billboard.image=e:t[i].billboard=new this._cesium.BillboardGraphics({image:e,show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})}}},500)},billboardScale:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.scale=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){var t=e[0].billboard.scale;return t?t._value:void 0}}},billboardHorizontalOrigin:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.horizontalOrigin=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)return e&&0<e.length&&e[0].billboard?e[0].billboard.horizontalOrigin:void 0}},billboardVerticalOrigin:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.verticalOrigin=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)return e&&0<e.length&&e[0].billboard?e[0].billboard.verticalOrigin:void 0}},billboardWidth:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.width=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){var t=e[0].billboard.width;return t?t._value:void 0}}},billboardHeight:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.height=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){var t=e[0].billboard.height;return t?t._value:void 0}}},billboardColor:{set:e.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.color=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){var t=e[0].billboard.color;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},billboardHeightReference:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].billboard.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].model){var t=e[0].billboard.heightReference;return t?t._value:void 0}}},billboardDistanceDisplayMaxCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=t[0].billboard.distanceDisplayCondition?t[0].billboard.distanceDisplayCondition._value.near:0,r=0;r<t.length;r++)t[r].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e),t[r].billboard.scaleByDistance=new this._cesium.NearFarScalar(i,1,e,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&(e&&0<e.length&&e[0].billboard))return e[0].billboard.distanceDisplayCondition?e[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE}},billboardDistanceDisplayMinCondition:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=t[0].billboard.distanceDisplayCondition?t[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE,r=0;r<t.length;r++)t[r].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i),t[r].billboard.scaleByDistance=new this._cesium.NearFarScalar(e,1,i,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&(e&&0<e.length&&e[0].billboard))return e[0].billboard.distanceDisplayCondition?e[0].billboard.distanceDisplayCondition._value.near:0}},billboardPHeight:{set:e.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var r=this._cesium.Cartographic.fromCartesian(t[i].position._value),o=this._cesium.Math.toDegrees(r.longitude),n=this._cesium.Math.toDegrees(r.latitude),a=this._cesium.Cartesian3.fromDegrees(o,n,e);t[i].position=a}}},500),get:function(){return 0}}}),t}),define("SGWorld/VectorTileProvider/VectorTileProviderEntity",["../Navigate/getPosition","../Core/Core","../ProjectTree/treeSource"],function(i,r,Z){"use strict";function o(e,t){this._viewer=e,this._cesium=t,this._quadtree=void 0,this._tilingScheme=new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._reTilesKey=[],this._state=!0,this._client=!0,this._reTiles=[],this._normalTile=16,this._minimumHeight=0,this._maximumHeight=0,this._PrimitiveCollection=new Cesium.PrimitiveCollection,this._levelZeroMaximumError=Cesium.QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme),this.cartographicLimitRectangle=Cesium.Rectangle.clone(Cesium.Rectangle.MAX_VALUE),o.prototype.ready||Object.defineProperties(o.prototype,{quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}}}),this._core=new r,this.tooltip=this._core.CreateTooltip(),this._getPosition=new i(this._viewer,this._cesium)}return o.prototype.update=function(e){this._quadtree.beginFrame(e),this._quadtree.render(e),this._quadtree.endFrame(e)},o.prototype.static=function(e){this.cs=e},o.prototype.initialize=function(e){},o.prototype.beginUpdate=function(e){},o.prototype.endUpdate=function(e){},o.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)},o.prototype.loadTile=function(e,t){},o.prototype.computeTileVisibility=function(e,t,i){var r=this.computeDistanceToTile(e,t);if(e._distance=r,t.fog.enabled&&1<=Cesium.Math.fog(r,t.fog.density))return Cesium.Visibility.NONE;var o=e.data;o.tileBoundingRegion;if(void 0===o.boundingVolumeSourceTile)return Cesium.Visibility.PARTIAL;var n=t.cullingVolume,a=o.orientedBoundingBox;!a&&o.renderedMesh&&(a=o.renderedMesh.boundingSphere3D),o.clippedByBoundaries=!1;var s=function(e,t){if(t.west<t.east)return t;var i=Rectangle.clone(t,splitCartographicLimitRectangleScratch);return 0<Rectangle.center(e,rectangleCenterScratch).longitude?i.east=CesiumMath.PI:i.west=-CesiumMath.PI,i}(e.rectangle,this.cartographicLimitRectangle),l=new Cesium.Rectangle,u=Cesium.Rectangle.simpleIntersection(s,e.rectangle,l);if(!u)return Visibility.NONE;if(Cesium.Rectangle.equals(u,e.rectangle)||(o.clippedByBoundaries=!0),t.mode,Cesium.SceneMode.SCENE3D,!a)return Cesium.Intersect.INTERSECTING;var c=this._clippingPlanes;if(c&&c.enabled){var h=c.computeIntersectionWithBoundingVolume(a);if(e.isClipped=h!==Intersect.INSIDE,h===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE}var d=n.computeVisibility(a);if(d===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE;var m=t.mode===Cesium.SceneMode.SCENE3D&&t.camera.frustum instanceof Cesium.OrthographicFrustum;if(t.mode!==Cesium.SceneMode.SCENE3D||m||!i)return d;var p=o.occludeePointInScaledSpace;return p?i.ellipsoid.isScaledSpacePointVisible(p)?d:Cesium.Visibility.NONE:d},o.prototype.canRefine=function(e,t,i){return e.level<this._normalTile},o.prototype.showTileThisFrame=function(e,t,i,r){this._availability&&(this._state=this.isAvailable(t.time)),e.data.geometryPrimitive&&this._state&&this._client&&"function"==typeof e.data.geometryPrimitive.update&&e.data.geometryPrimitive.update(t,i,r)},o.prototype.computeDistanceToTile=function(e,t){var i,r,o,n,a,s,l,u,c,h,d,m,p=(i=this._maximumHeight,r=this._minimumHeight,o=e,this.terrainProvider,void 0===(n=o.data)&&(n=o.data=new Cesium.GlobeSurfaceTile),o._minimumHeight&&(r=o._minimumHeight),o._maximumHeight&&(i=o._maximumHeight),void 0===n.tileBoundingRegion&&(n.tileBoundingRegion=new Cesium.TileBoundingRegion({computeBoundingVolumes:!1,rectangle:o.rectangle,ellipsoid:o.tilingScheme.ellipsoid,minimumHeight:r||0,maximumHeight:i||0})),o),g=e.data,f=g.tileBoundingRegion;if(void 0===p)return 9999999999;if(g.boundingVolumeSourceTile!==p){g.boundingVolumeSourceTile=p;var v=e.rectangle;v&&v.width<Cesium.Math.PI_OVER_TWO+Cesium.Math.EPSILON5&&(g.orientedBoundingBox=Cesium.OrientedBoundingBox.fromRectangle(e.rectangle,f.minimumHeight,f.maximumHeight,e.tilingScheme.ellipsoid,g.orientedBoundingBox),g.occludeePointInScaledSpace=(a=this,s=g.orientedBoundingBox.center,l=e.rectangle,u=f.maximumHeight,c=g.occludeePointInScaledSpace,h=a.quadtree._occluders.ellipsoid,d=h.ellipsoid,m=[new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3],Cesium.Cartesian3.fromRadians(l.west,l.south,u,d,m[0]),Cesium.Cartesian3.fromRadians(l.east,l.south,u,d,m[1]),Cesium.Cartesian3.fromRadians(l.west,l.north,u,d,m[2]),Cesium.Cartesian3.fromRadians(l.east,l.north,u,d,m[3]),h.computeHorizonCullingPoint(s,m,c)))}var _=f.minimumHeight,y=f.maximumHeight;if(g.boundingVolumeSourceTile!==e){var C=t.camera.positionCartographic.height,w=Math.abs(C-_);Math.abs(C-y)<w?(f.minimumHeight=_,f.maximumHeight=_):(f.minimumHeight=y,f.maximumHeight=y)}var b=f.distanceToCamera(t);return f.minimumHeight=_,f.maximumHeight=y,b},o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){return Cesium.destroyObject(this)},o.prototype.remove=function(){this.destroy()},o.prototype.setStatus=function(e){this._state=e,this._client=e},o.prototype.edit=function(e,u){var U=this,q=this._viewer;if(!u&&(u={}),this.editHandler&&(this.editHandler.destroy(),this.editHandler=void 0),void 0===e&&(e=!0),e){var Y,X,J,Q;this.editHandler=new this._cesium.ScreenSpaceEventHandler(q.scene.canvas),this.isEditting=!1;var K=void 0;return this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))U.isEditting&&($(),U.defaultEvent(!1));else{var t=e.position,i=q.scene.pick(t);if(!(i&&i&&i.id&&i.id.treeID!==U.treeID)&&i&&i.id&&(i.id instanceof Cesium.Entity||i.id.VectorType)){var r=i.id;U.isEditting||0!=Z.states?(r!=Y||"point"!==r.VectorType&&"billboard"!==r.VectorType&&"label"!==r.VectorType&&"model"!==r.VectorType)&&"_height_point"!=r.name&&"_edit_point"!=r.name&&"_move_point"!=r.name&&"_add_point"!=r.name&&"_size_point"!=r.name||(q.container.style.cursor="crosshair",U.defaultEvent(!1),"_height_point"==r.name?(J={windowPosition:t,originHeight:U._cesium.Cartographic.fromCartesian(r.position.getValue()).height},K="_height_point"):"_move_point"==r.name?K="_move_point":"point"===r.VectorType||"billboard"===r.VectorType||"label"===r.VectorType||"model"===r.VectorType?(U.tooltip.showAt(e.position,"释放后完成修改"),K="_move_point","model"===r.VectorType&&(r.show=!1)):"_edit_point"==r.name?K="_edit_point":"_add_point"==r.name?K="_add_point":"_size_point"==r.name&&(K="_size_point"),X=r):(u.callBack&&u.callBack.start&&u.callBack.start(r),Q=r.VectorType,(Y=U.createEditEntity(Q,r.VectorStyle)).feature=r,Y.treeID=U.treeID,U.getSimpleGraphicData(Q,Y),"point"===Q||"billboard"===Q||"label"===Q||"model"===Q?(U.isEditting=!0,U.tooltip.showAt(e.position,"拖拽修改位置")):(U.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint(),SmartEarthPopupData.editGraphic.setTreeID(U.treeID)),U.setStatus(!1),Z.editVector=!0)}}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))U.isEditting&&($(),U.defaultEvent(!1));else{var t=q.scene.pick(e.endPosition);if(!(t&&t&&t.id&&t.id.treeID!==U.treeID)&&(U._cesium.defined(t)?U.isEditting&&!X?"point"!==Q&&"billboard"!==Q&&"label"!==Q&&"model"!==Q||t.id!=Y?t.id&&"_edit_point"===t.id.name&&Y.pottingPoint?"polyline"===Q&&2<Y.pottingPoint.length?U.tooltip.showAt(e.endPosition,"拖拽修改位置,右键删除点"):"polygon"===Q&&3<Y.pottingPoint.length?U.tooltip.showAt(e.endPosition,"拖拽修改位置,右键删除点"):U.tooltip.showAt(e.endPosition,"拖拽修改位置"):!t.id||"_move_point"!==t.id.name&&"_size_point"!==t.id.name?t.id&&"_add_point"===t.id.name?U.tooltip.showAt(e.endPosition,"拖拽增加节点"):t.id&&"_height_point"===t.id.name?U.tooltip.showAt(e.endPosition,"拖拽修改高度"):t.id==Y&&U.tooltip.show(!1):U.tooltip.showAt(e.endPosition,"拖拽修改位置"):U.tooltip.showAt(e.endPosition,"拖拽修改位置,右键删除"):U.isEditting||0!==Z.states||(t.id&&t.id.VectorType?U.tooltip.showAt(e.endPosition,"点击激活编辑"):U.tooltip.show(!1)):0!=Z.states||X||U.tooltip.show(!1),U.isEditting&&X)){U.tooltip.showAt(e.endPosition,"释放后完成修改");var i=U._getPosition.getMousePosition(e);if(!i&&"_height_point"!==K)return;if("_edit_point"===K){X.position=i;var r=Z.editPointID.edit.indexOf(X.id);if(void 0!==Y[Q].height){var o=U.toDegrees(i);Y.pottingPoint[r]=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,Y[Q].height.getValue()),X.position=Y.pottingPoint[r]}else Y.pottingPoint[r]=i;if(0<Z.editPointID.add.length){if(0<r){var n=q.entities.getById(Z.editPointID.add[r-1]);if(n){var a=q.entities.getById(Z.editPointID.edit[r-1]),s=q.entities.getById(Z.editPointID.edit[r]);n.position=Cesium.Cartesian3.midpoint(a.position.getValue(),s.position.getValue(),new Cesium.Cartesian3)}}if(r<Y.pottingPoint.length-1){var l=q.entities.getById(Z.editPointID.add[r]);if(l){var u=q.entities.getById(Z.editPointID.edit[r]),c=q.entities.getById(Z.editPointID.edit[r+1]);l.position=Cesium.Cartesian3.midpoint(u.position.getValue(),c.position.getValue(),new Cesium.Cartesian3)}}if("polygon"===Q&&(0===r||r===Y.pottingPoint.length-1)){var h=q.entities.getById(Z.editPointID.add[Z.editPointID.add.length-1]);if(h){var d=q.entities.getById(Z.editPointID.edit[0]),m=q.entities.getById(Z.editPointID.edit[Y.pottingPoint.length-1]);h.position=Cesium.Cartesian3.midpoint(d.position.getValue(),m.position.getValue(),new Cesium.Cartesian3)}}}var p=Y.pottingPoint.concat([]),g=new U._cesium.Cartesian3,f=p.length;p.forEach(function(e){g.x+=e.x,g.y+=e.y,g.z+=e.z}),g.x/=f,g.y/=f,g.z/=f,Z.editPointID.move&&(Z.editPointID.move.position=g),"polyline"!==Q&&"polygon"!==Q&&"rectangle"!==Q||SmartEarthPopupData.editGraphic.setValue("positions",p)}else if("_height_point"===K){var v=Z.editPointID.height.indexOf(X.id),_=q.entities.getById(Z.editPointID.edit[v]);"ellipse"!==Q&&"cylinder"!==Q&&"box"!==Q||(_=Z.editPointID.move);var y=U.toDegrees(_.position.getValue()),C=J.originHeight-y.height,w=q.scene.cartesianToCanvasCoordinates(_.position.getValue()),b=(J.windowPosition.y-e.endPosition.y)*C/Math.abs(w.y-J.windowPosition.y),E=Math.abs(C+b);Z.editPointID.height.forEach(function(e){var t=q.entities.getById(e);if(t){var i=t.position.getValue(),r=U.toDegrees(i);t.position=U._cesium.Cartesian3.fromDegrees(r.lon,r.lat,E+y.height)}}),Y[Q].extrudedHeight?Y[Q].extrudedHeight=E+y.height:"box"===Q?SmartEarthPopupData.editGraphic.setValue("height",E):"cylinder"===Q&&SmartEarthPopupData.editGraphic.setValue("length",E)}else if("_add_point"===K){var S=Z.editPointID.add.indexOf(X.id);q.entities.remove(X);var P=q.entities.add({name:"_edit_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});Z.editPointID.edit.splice(S+1,0,P.id),Y.pottingPoint.splice(S+1,0,i.clone());var x=Cesium.Cartesian3.midpoint(Y.pottingPoint[S],Y.pottingPoint[S+1],new Cesium.Cartesian3),T=q.entities.add({name:"_add_point",position:x,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),I=Cesium.Cartesian3.midpoint(Y.pottingPoint[S+1],Y.pottingPoint[S+2===Y.pottingPoint.length?0:S+2],new Cesium.Cartesian3),D=q.entities.add({name:"_add_point",position:I,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});Z.editPointID.add.splice(S,1,T.id,D.id),SmartEarthPopupData.editGraphic.setTreeID(U.treeID),X=P,K="_edit_point";var L=Y.pottingPoint.concat([]);"polyline"!==Q&&"polygon"!==Q||SmartEarthPopupData.editGraphic.setValue("positions",L)}else if("_size_point"===K){var M=Z.editPointID.move.position.getValue(),A=U._cesium.Cartesian3.distance(M,i);if("ellipse"===Q||"cylinder"===Q||"ellipsoid"===Q&&Y.isSphere)SmartEarthPopupData.editGraphic.setValue("radius",A);else if("box"===Q){var R=90===X.angle?"long":"width";SmartEarthPopupData.editGraphic.setValue(R,2*A)}}else{if("point"===Q||"billboard"===Q||"label"===Q||"model"===Q)return void(X.position=i);var O=U.toDegrees(i);J=X.position.getValue();var N=U.toDegrees(J),V=O.lon-N.lon,F=O.lat-N.lat,H=O.height-N.height;if(X.position=i,Y[Q].height){var G=U.toDegrees(i).height;Y[Q].height=G,Y.thisHeight=G}Y.pottingPoint.forEach(function(e,t){var i,r=void 0,o=q.entities.getById(Z.editPointID.edit[t]);if(o||(o=q.entities.getById(Z.editPointID.size[t])),r=o?U.toDegrees(o.position.getValue()):U.toDegrees(e),i=U._cesium.Cartesian3.fromDegrees(r.lon+V,r.lat+F,r.height+H),e.x=i.x,e.y=i.y,e.z=i.z,o&&(o.position=i),0<Z.editPointID.add.length&&Z.editPointID.add[t]){var n=q.entities.getById(Z.editPointID.add[t]);n&&(r=U.toDegrees(n.position.getValue()),n.position=U._cesium.Cartesian3.fromDegrees(r.lon+V,r.lat+F,r.height+H))}});var k=Y.pottingPoint.concat([]);if("polyline"===Q||"polygon"===Q||"rectangle"===Q)SmartEarthPopupData.editGraphic.setValue("positions",k);else if("ellipse"===Q)Y.pottingPoint[1]=i,Y.position=i.clone();else if("box"===Q){Y.pottingPoint[2]=i;var B=Y.box.dimensions.getValue(),j=U.toDegrees(i);Y.position=Cesium.Cartesian3.fromDegrees(j.lon,j.lat,j.height+B.z/2)}else if("cylinder"===Q){Y.pottingPoint[1]=i;var z=Y.cylinder.length.getValue(),W=U.toDegrees(Y.pottingPoint[1]);Y.position=Cesium.Cartesian3.fromDegrees(W.lon,W.lat,W.height+z/2)}else"ellipsoid"===Q&&(Y.pottingPoint[Y.pottingPoint.length-1]=i,Y.position=i.clone())}}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.editHandler.setInputAction(function(e){Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?U.isEditting&&($(),U.defaultEvent(!1)):(X&&"model"===X.VectorType&&(X.show=!0),X&&u.callBack&&u.callBack.updata&&u.callBack.updata(X.name,Y),q.container.style.cursor="default",X=void 0,U.defaultEvent(!0))},this._cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))U.isEditting&&($(),U.defaultEvent(!1));else{var t=q.scene.pick(e.position);if((!t||!t.id||t.id.treeID===U.treeID)&&U._cesium.defined(t)&&0==Z.states){var i=t.id;if(i.VectorType);else if(-1<Z.editPointID.edit.indexOf(i.id)&&("polyline"===Q&&2<Z.editPointID.edit.length||"polygon"===Q&&3<Z.editPointID.edit.length)){var r=Z.editPointID.edit.indexOf(i.id);if(q.entities.removeById(i.id),Z.editPointID.edit.splice(r,1),Y.pottingPoint.splice(r,1),0<Z.editPointID.add.length)if(Z.editPointID.add[r]){if(q.entities.removeById(Z.editPointID.add[r]),Z.editPointID.add.splice(r,1),0<=r-1){var o=q.entities.getById(Z.editPointID.add[r-1]);o&&(o.position=Cesium.Cartesian3.midpoint(Y.pottingPoint[r-1],Y.pottingPoint[r===Y.pottingPoint.length?0:r],new Cesium.Cartesian3))}else if(r-1==-1&&"polygon"===Q){var n=q.entities.getById(Z.editPointID.add[Z.editPointID.add.length-1]);n&&(n.position=Cesium.Cartesian3.midpoint(Y.pottingPoint[0],Y.pottingPoint[Y.pottingPoint.length-1],new Cesium.Cartesian3))}}else q.entities.removeById(Z.editPointID.add[r-1]),Z.editPointID.add.pop();var a=new U._cesium.Cartesian3,s=Y.pottingPoint.length;Y.pottingPoint.forEach(function(e){a.x+=e.x,a.y+=e.y,a.z+=e.z}),a.x/=s,a.y/=s,a.z/=s,Z.editPointID.move&&(Z.editPointID.move.position=a);var l=Y.pottingPoint.concat([]);"polyline"!==Q&&"polygon"!==Q||SmartEarthPopupData.editGraphic.setValue("positions",l),U.tooltip.show(!1),u.callBack&&u.callBack.updata&&u.callBack.updata(X&&X.name,Y)}}}},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),$(),{endThisEdit:$,getEditData:function(){return{entity:Y}}}}function $(){U.defaultEvent(!0),Z.editPointID.edit.forEach(function(e){q.entities.removeById(e)}),Z.editPointID.edit=[],Z.editPointID.height.forEach(function(e){q.entities.removeById(e)}),Z.editPointID.height=[],Z.editPointID.add.forEach(function(e){q.entities.removeById(e)}),Z.editPointID.add=[],Z.editPointID.size.forEach(function(e){q.entities.removeById(e)}),Z.editPointID.size=[],Z.editPointID.move&&q.entities.remove(Z.editPointID.move),Z.editPointID.move=void 0,Y&&q.entities.remove(Y),Q=Y=void 0,SmartEarthPopupData.editGraphic={},U.isEditting=!1,U.setStatus(!0),Z.editVector=!1,U.delButton(!1)}$()},o.prototype.createEditEntity=function(e,t){var i=void 0,r=this,o=this._viewer;if("polygon"===e){var n=t.positions,a=r._core.defaultValue(t.height,void 0),s=void 0;s=t.hierarchy?t.hierarchy:(n=t.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(n):r._cesium.Cartesian3.fromDegreesArray(n),new r._cesium.PolygonHierarchy(n)),(i=o.entities.add({polygon:{hierarchy:new r._cesium.CallbackProperty(function(){return s},!1),extrudedHeight:r._core.defaultValue(t.extrudedHeight,void 0),height:a,material:new r._cesium.ImageMaterialProperty({image:r._core.defaultValue(t.image,null),repeat:r._core.defaultValue(t.repeat,new r._cesium.Cartesian2(1,1)),color:t.material}),shadows:r._cesium.ShadowMode.ENABLED,fill:!0}})).VectorType="polygon"}else if("polyline"===e){var l=t.positions;l=t.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(l):r._cesium.Cartesian3.fromDegreesArray(l),(i=o.entities.add({polyline:{positions:new r._cesium.CallbackProperty(function(){return l},!1),clampToGround:r._core.defaultValue(t.clampToGround,!1),material:new Cesium.PolylineOutlineMaterialProperty({color:t.material,outlineWidth:r._core.defaultValue(t.outlineWidth,0),outlineColor:r._cesium.Color.fromCssColorString(r._core.defaultValue(t.outlineColor,"rgba(255,255,255,0.6)"))}),width:r._core.defaultValue(t.width,3)}})).VectorType="polyline"}else if("wall"===e){var u=t.positions;u=t.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(u):r._cesium.Cartesian3.fromDegreesArray(u),(i=o.entities.add({wall:{positions:new r._cesium.CallbackProperty(function(){return u},!1),minimumHeights:t.minimumHeights,maximumHeights:t.maximumHeights,material:t.material,outline:!0,outlineWidth:r._core.defaultValue(t.outlineWidth,0),outlineColor:t.outlineColor}})).VectorType="wall"}else"label"===e?(i=o.entities.add({position:t.position,label:{text:t.text,font:t.font,scale:t.scale,style:t.style,fillColor:t.fillColor,outlineColor:t.outlineColor,outlineWidth:t.outlineWidth,showBackground:t.showBackground,backgroundColor:t.backgroundColor,heightReference:t.heightReference,horizontalOrigin:t.horizontalOrigin,verticalOrigin:t.verticalOrigin,scaleByDistance:t.scaleByDistance,distanceDisplayCondition:t.distanceDisplayCondition}})).VectorType="label":"billboard"===e?(i=o.entities.add({position:t.position,billboard:{rotation:t.rotation,width:t.width,height:t.height,image:t.image,color:t.color,scale:t.scale,heightReference:t.heightReference,horizontalOrigin:t.horizontalOrigin,verticalOrigin:t.verticalOrigin,scaleByDistance:t.scaleByDistance,distanceDisplayCondition:t.distanceDisplayCondition}})).VectorType="billboard":"point"===e&&((i=o.entities.add({position:t.position,point:{pixelSize:t.pixelSize,color:t.color,outlineWidth:t.outlineWidth,outlineColor:t.outlineColor,heightReference:t.heightReference,scaleByDistance:t.scaleByDistance,distanceDisplayCondition:t.distanceDisplayCondition}})).VectorType="point");return i},o.prototype.delButton=function(e,t,i){if(e){var r=document.getElementById("DeleteMilitaryStandardDelete");r||((r=document.createElement("button")).id="DeleteMilitaryStandardDelete",r.innerText="删除对象",r.style.cssText="height: 38px;\n line-height: 38px;\n padding: 0 18px;\n background-color: #052355;\n color: #fff;\n white-space: nowrap;\n text-align: center;\n font-size: 14px;\n border: none;\n border-radius: 2px;\n cursor: pointer;\n position: absolute;",this._viewer.container.appendChild(r)),r.style.display="block",r.style.top=t.y+"px",r.style.left=t.x+"px",r.onclick=i}else{var o=document.getElementById("DeleteMilitaryStandardDelete");o&&(o.style.display="none",o.onclick=null)}},o.prototype.defaultEvent=function(e){var t=this._viewer.scene;t.screenSpaceCameraController.enableRotate=e,t.screenSpaceCameraController.enableTranslate=e,t.screenSpaceCameraController.enableZoom=e,t.screenSpaceCameraController.enableTilt=e,t.screenSpaceCameraController.enableLook=e},o.prototype.getEntityTypeAndObject=function(e){var t={type:"",object:null};return e&&(e.billboard?(t.type="billboard",t.object=e.billboard):e.box?(t.type="box",t.object=e.box):e.corridor?(t.type="corridor",t.object=e.corridor):e.cylinder?(t.type="cylinder",t.object=e.cylinder):e.ellipse?(t.type="ellipse",t.object=e.ellipse):e.ellipsoid?(t.type="ellipsoid",t.object=e.ellipsoid):e.label?(t.type="label",t.object=e.label):e.model?(t.type="model",t.object=e.model):e.path?(t.type="path",t.object=e.path):e.plane?(t.type="plane",t.object=e.plane):e.point?(t.type="point",t.object=e.point):e.polygon?(t.type="polygon",t.object=e.polygon):e.polyline?(t.type="polyline",t.object=e.polyline):e.polylineVolume?(t.type="polylineVolume",t.object=e.polylineVolume):e.rectangle?(t.type="rectangle",t.object=e.rectangle):e.wall&&(t.type="wall",t.object=e.wall)),t},o.prototype.toDegrees=function(e){var t=this._cesium.Cartographic.fromCartesian(e);return{lon:this._cesium.Math.toDegrees(t.longitude),lat:this._cesium.Math.toDegrees(t.latitude),height:t.height}},o.prototype.getSimpleGraphicData=function(e,c){var t,h=this,d=this._viewer;if(SmartEarthPopupData.editGraphic={entity:c,type:e,graphic:c[e],getValue:function(e){if("position"===e||"name"===e||"id"===e)return this.entity[e]&&(this.entity[e].getValue?this.entity[e].getValue():this.entity[e]);if("radius"===e){if("ellipse"===this.type)return this.graphic.semiMajorAxis.getValue();if("ellipsoid"===this.type)return this.graphic.radii.getValue().x;if("cylinder"===this.type)return this.graphic.bottomRadius.getValue()}else{if("pHeight"!==e)return"repeat"===e?this.graphic.material[e]&&(this.graphic.material[e].getValue?this.graphic.material[e].getValue():this.graphic.material[e]):this.graphic[e]&&(this.graphic[e].getValue?this.graphic[e].getValue():this.graphic[e]);if(this.getValue("position")){var t=this.getValue("position");return Cesium.Cartographic.fromCartesian(t).height}}},changeHeightPoint:function(o){0<Z.editPointID.height.length&&Z.editPointID.height.forEach(function(e){var t=d.entities.getById(e);if(t){var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}})},changeEditPoint:function(o){0<Z.editPointID.edit.length&&Z.editPointID.edit.forEach(function(e){var t=d.entities.getById(e);if(t)if("clampToGround"===o)t.point.heightReference=1;else{t.point.heightReference=0;var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}}),0<Z.editPointID.size.length&&Z.editPointID.size.forEach(function(e){var t=d.entities.getById(e);if(t)if("clampToGround"===o)t.point.heightReference=1;else{t.point.heightReference=0;var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}}),0<Z.editPointID.add.length&&Z.editPointID.add.forEach(function(e){var t=d.entities.getById(e);if(t)if("clampToGround"===o)t.point.heightReference=1;else{t.point.heightReference=0;var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}});var e=Z.editPointID.move;if(e)if("clampToGround"===o)e.point.heightReference=1;else{e.point.heightReference=0;var t=e.position.getValue(),i=h.toDegrees(t);e.position=Cesium.Cartesian3.fromDegrees(i.lon,i.lat,o)}},clearAllEditPoint:function(){Z.editPointID.edit.forEach(function(e){d.entities.removeById(e)}),Z.editPointID.edit=[],Z.editPointID.height.forEach(function(e){d.entities.removeById(e)}),Z.editPointID.height=[],Z.editPointID.add.forEach(function(e){d.entities.removeById(e)}),Z.editPointID.add=[],Z.editPointID.size.forEach(function(e){d.entities.removeById(e)}),Z.editPointID.size=[],Z.editPointID.move&&d.entities.remove(Z.editPointID.move),Z.editPointID.move=void 0},setTreeID:function(t){Z.editPointID.edit.forEach(function(e){d.entities.getById(e).treeID=t}),Z.editPointID.height.forEach(function(e){d.entities.getById(e).treeID=t}),Z.editPointID.add.forEach(function(e){d.entities.getById(e).treeID=t}),Z.editPointID.size.forEach(function(e){d.entities.getById(e).treeID=t}),Z.editPointID.move&&(Z.editPointID.move.treeID=t)}},"billboard"===e||"point"===e||"label"===e||"model"===e){var i=SmartEarthPopupData.editGraphic.getValue("color")||SmartEarthPopupData.editGraphic.getValue("fillColor");i?v(i):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var r=SmartEarthPopupData.editGraphic.getValue("outlineColor");if(r?_(r):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),"label"===e){var o=SmartEarthPopupData.editGraphic.getValue("backgroundColor");o?(t=o,SmartEarthPopupData.editGraphic.backgroundColor=y("rgb("+255*t.red+","+255*t.green+","+255*t.blue+")"),SmartEarthPopupData.editGraphic.backgroundAlpha=100*t.alpha):(SmartEarthPopupData.editGraphic.backgroundColor="#000000",SmartEarthPopupData.editGraphic.backgroundAlpha=80)}SmartEarthPopupData.editGraphic.setValue=function(e,t){if("position"===e||"name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e||"backgroundColor"===e||"fillColor"===e)t=Cesium.Color.fromCssColorString(t);else if("fontSize"===e){var i=this.getValue("font");(i=i.split(" "))[0]=t,t=i.join(" ")}else{if("alpha"===e)return void("label"===this.type?this.graphic.fillColor._value.alpha=t:this.graphic.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("backgroundAlpha"===e)return void(this.graphic.backgroundColor._value.alpha=t);if("pHeight"===e&&this.getValue("position")){var r=this.getValue("position"),o=Cesium.Cartographic.fromCartesian(r);return o.height=t,void(this.entity.position=Cesium.Cartographic.toCartesian(o))}}this.graphic[e]=t}}}else if("polyline"===e){var n=SmartEarthPopupData.editGraphic.getValue("material");n.color?v(n.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),n.outlineColor?_(n.outlineColor):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e)return t=Cesium.Color.fromCssColorString(t),void(this.graphic.material[e]=t);if("outlineWidth"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.material.outlineColor._value.alpha=t);if("positions"===e)return void(this.graphic[e]=new Cesium.CallbackProperty(function(){return t},!1));this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("positions");return this.entity.pottingPoint=e},SmartEarthPopupData.editGraphic.updataEditPoint=function(){var r=this;this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var o=new Cesium.Cartesian3;e.forEach(function(e,t){var i=d.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:r.graphic.heightReference&&r.graphic.heightReference.getValue()}});Z.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=e.length,o.y/=e.length,o.z/=e.length,Z.editPointID.move=d.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(var t=0;t<e.length-1;t++){var i=Cesium.Cartesian3.midpoint(e[t],e[t+1],new Cesium.Cartesian3),n=d.entities.add({name:"_add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Z.editPointID.add.push(n.id)}}}}else if("polygon"===e){var a=SmartEarthPopupData.editGraphic.getValue("material");a.color?v(a.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var s=SmartEarthPopupData.editGraphic.getValue("outlineColor");s?_(s):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,i){var t=this;if("name"===e)this.entity[e]=i;else{if("color"===e||"outlineColor"===e){if(i=Cesium.Color.fromCssColorString(i),"color"===e)return void(this.graphic.material.color=i)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=i);if("alpha"===e)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=i);if("positions"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(i)},!1));if("hierarchy"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return i},!1));if("clampToGround"===e){var r=function(e,t,i){i?(e.perPositionHeight=!1,e.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(e.perPositionHeight=!0,e.heightReference=Cesium.HeightReference.NONE),0<Z.editPointID.edit.length&&!i&&t.forEach(function(e,t){var i=d.entities.getById(Z.editPointID.edit[t]);if(i){var r=i.position.getValue();e.x=r.x,e.y=r.y,e.z=r.z}}),e.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(t)},!1)};return this.graphic.hierarchy instanceof Cesium.CallbackProperty?(this.graphic.hierarchy=this.graphic.hierarchy.getValue(),setTimeout(function(){r(t.graphic,t.entity.pottingPoint,i)},100)):r(this.graphic,this.entity.pottingPoint,i),void(0<Z.editPointID.add.length&&Z.editPointID.add.forEach(function(e){var t=d.entities.getById(e);t&&(t.point.heightReference=i?1:0)}))}"extrudedHeight"===e?this.changeHeightPoint(i):"height"===e&&this.changeEditPoint(i)}this.graphic[e]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("hierarchy").positions.concat([]);if(void 0!==this.getValue("height")){var r=this.getValue("height");e.forEach(function(e){var t=h.toDegrees(e),i=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,r);e.x=i.x,e.y=i.y,e.z=i.z})}return this.entity.pottingPoint=e},SmartEarthPopupData.editGraphic.updataEditPoint=function(){var r=this;this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var o=new Cesium.Cartesian3;e.forEach(function(e,t){var i=d.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:r.graphic.heightReference&&r.graphic.heightReference.getValue()}});Z.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=e.length,o.y/=e.length,o.z/=e.length,Z.editPointID.move=d.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(var t=0;t<e.length-1;t++){var i=Cesium.Cartesian3.midpoint(e[t],e[t+1],new Cesium.Cartesian3),n=d.entities.add({name:"_add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Z.editPointID.add.push(n.id)}var a=Cesium.Cartesian3.midpoint(e[0],e[e.length-1],new Cesium.Cartesian3),s=d.entities.add({name:"_add_point",position:a,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Z.editPointID.add.push(s.id)}}}else if("ellipse"===e||"cylinder"===e||c.isSphere){var l=SmartEarthPopupData.editGraphic.getValue("material");l.color?v(l.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var u=SmartEarthPopupData.editGraphic.getValue("outlineColor");u?_(u):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){var i=this;if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("semiMajorAxis"===e)return void(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return t},!1));if("semiMinorAxis"===e)return void(this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return t},!1));if("radii"===e)return void(this.graphic.radii=new Cesium.CallbackProperty(function(){return t},!1));if("topRadius"===e)return void(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return t},!1));if("bottomRadius"===e)return void(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return t},!1));if("radius"===e){"ellipse"===this.type?(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return t},!1),this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return t},!1)):"ellipsoid"===this.type?null!==this.graphic.material.image.getValue()?this.graphic.radii=new Cesium.Cartesian3(t,t,t):this.graphic.radii=new Cesium.CallbackProperty(function(){return new Cesium.Cartesian3(t,t,t)},!1):"cylinder"===this.type&&(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return t},!1),this.entity.changeTop&&(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return t},!1)));var r=Z.editPointID.move.position.getValue(),o=h.GetPositionFromA_D(r,t,90);d.entities.getById(Z.editPointID.size[0]).position=o,c.pottingPoint[0]=o,c.pottingPoint[c.pottingPoint.length-1]=r;var n=d.entities.getById(Z.editPointID.height[0]);if(n){var a=h.toDegrees(o),s=h._cesium.Cartographic.fromCartesian(n.position.getValue());n.position=h._cesium.Cartesian3.fromDegrees(a.lon,a.lat,s.height)}return}if("cylinder"===this.type&&"length"===e){this.graphic.length=t;var l=h.toDegrees(this.entity.pottingPoint[1]);return this.entity.position=Cesium.Cartesian3.fromDegrees(l.lon,l.lat,l.height+t/2),void this.changeHeightPoint(l.height+t)}if("ellipse"===this.type&&"clampToGround"===e){var u=function(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);var r=t.semiMinorAxis.getValue();t.semiMinorAxis=new Cesium.CallbackProperty(function(){return r},!1),t.semiMajorAxis=new Cesium.CallbackProperty(function(){return r},!1)};return this.graphic.semiMinorAxis instanceof Cesium.CallbackProperty?(this.graphic.semiMinorAxis=this.graphic.semiMinorAxis.getValue(),this.graphic.semiMajorAxis=this.graphic.semiMajorAxis.getValue(),setTimeout(function(){u(i.entity,i.graphic,t)},100)):u(this.entity,this.graphic,t),void(t?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight))}"ellipse"===this.type&&"extrudedHeight"===e?this.changeHeightPoint(t):"ellipse"===this.type&&"height"===e&&(this.changeEditPoint(t),this.entity.thisHeight=t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("radius"),t=this.getValue("position");if("ellipse"===this.type||this.entity.isSphere){if("ellipse"===this.type&&void 0!==this.getValue("height")){var i=this.getValue("height"),r=h.toDegrees(t);t=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,i)}var o=h.GetPositionFromA_D(t,e,90);return this.entity.pottingPoint=[o,t],[o,t]}var n=h.toDegrees(t);t=Cesium.Cartesian3.fromDegrees(n.lon,n.lat,n.height-this.getValue("length")/2);var a=h.GetPositionFromA_D(t,e,90);return this.entity.pottingPoint=[a,t],[a,t]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var t=d.entities.add({name:"_size_point",position:e[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});t.angle=90,Z.editPointID.size.push(t.id),Z.editPointID.move=d.entities.add({name:"_move_point",position:e[1],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}}else if("rectangle"===e){var m=SmartEarthPopupData.editGraphic.getValue("material");m.color?v(m.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var p=SmartEarthPopupData.editGraphic.getValue("outlineColor");p?_(p):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){var i=this;if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("positions"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return Cesium.Rectangle.fromCartesianArray(t)},!1));if("coordinates"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return t},!1));if("clampToGround"===e){var r=function(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);var r=t.coordinates.getValue();t.coordinates=new Cesium.CallbackProperty(function(){return r},!1)};return this.graphic.coordinates instanceof Cesium.CallbackProperty?(this.graphic.coordinates=this.graphic.coordinates.getValue(),setTimeout(function(){r(i.entity,i.graphic,t)},100)):r(this.entity,this.graphic,t),void(t?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight))}"extrudedHeight"===e?this.changeHeightPoint(t):"height"===e&&(this.changeEditPoint(t),this.entity.thisHeight=t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("coordinates"),t=void 0,i=void 0,r=this.getValue("height");return i=(void 0!==r?t=Cesium.Cartesian3.fromRadians(e.west,e.north,r):(r=d.scene.sampleHeight(new Cesium.Cartographic(e.west,e.north,0),[this.entity]),t=Cesium.Cartesian3.fromRadians(e.west,e.north,r),r=d.scene.sampleHeight(new Cesium.Cartographic(e.east,e.south,0),[this.entity])),Cesium.Cartesian3.fromRadians(e.east,e.south,r)),this.entity.pottingPoint=[t,i],[t,i]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){var r=this;this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var o=new Cesium.Cartesian3;e.forEach(function(e,t){var i=d.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:r.graphic.heightReference&&r.graphic.heightReference.getValue()}});Z.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=e.length,o.y/=e.length,o.z/=e.length,Z.editPointID.move=d.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}}else if("box"===e){var g=SmartEarthPopupData.editGraphic.getValue("material");g.color?v(g.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var f=SmartEarthPopupData.editGraphic.getValue("outlineColor");f?_(f):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("long"===e||"width"===e||"height"===e){var i=this.getValue("dimensions");if("long"===e?i.x=t:"width"===e?i.y=t:i.z=t,this.graphic.dimensions=new Cesium.CallbackProperty(function(){return i},!1),"long"===e||"width"===e){var r="long"===e?90:180,o="long"===e?0:1,n=Z.editPointID.move.position.getValue(),a=h.GetPositionFromA_D(n,t/2,r);d.entities.getById(Z.editPointID.size[o]).position=a,this.entity.pottingPoint[o]=a,this.entity.pottingPoint[this.entity.pottingPoint.length-1]=n}else{var s=h.toDegrees(Z.editPointID.move.position.getValue());this.entity.position=Cesium.Cartesian3.fromDegrees(s.lon,s.lat,s.height+t/2),this.changeHeightPoint(s.height+t)}return}if("dimensions"===e)return void(this.graphic.dimensions=new Cesium.CallbackProperty(function(){return t},!1))}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("dimensions"),t=this.getValue("position"),i=h.toDegrees(t);t=Cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height-e.z/2);var r=h.GetPositionFromA_D(t,e.x/2,90),o=h.GetPositionFromA_D(t,e.y/2,180);return this.entity.pottingPoint=[r,o,t],[r,o,t]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var t=d.entities.add({name:"_size_point",position:e[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});t.angle=90;var i=d.entities.add({name:"_size_point",position:e[1],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});i.angle=180,Z.editPointID.size.push(t.id),Z.editPointID.size.push(i.id),Z.editPointID.move=d.entities.add({name:"_move_point",position:e[2],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}}else"corridor"===e||"ellipsoid"===e&&c.isSphere;function v(e){SmartEarthPopupData.editGraphic.fillColor=y("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.alpha=100*e.alpha}function _(e){SmartEarthPopupData.editGraphic.outlineColor=y("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.outlineAlpha=100*e.alpha}function y(e){var t=e;if(/^(rgb|RGB)/.test(t)){for(var i=t.replace(/(rgb|RGB)*/g,""),r=(i=i.replace("(","").replace(")","")).split(","),o="#",n=0;n<r.length;n++){var a=Number(r[n]).toString(16);"0"===(a=1===a.length?"0"+a:a)&&(a+=a),o+=a}return 7!==o.length&&(o=t),o}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t))return t;var s=t.replace(/#/,"").split("");if(6===s.length)return t;if(3===s.length){for(var l="#",u=0;u<s.length;u+=1)l+=s[u]+s[u];return l}}},o}),define("SGWorld/Creator/LabelGeoJsonFeatureLayercopy",["../Core/Core","./Color","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min","../VectorTileProvider/GeoJSONVectorTileProvider","../VectorTileProviderPolymerization/GeoJSONVectorTileProvider","../VectorTileProvider/VectorTileProvider","../VectorTileProvider/VectorTileProviderEntity","../configData"],function(i,r,o,p,s,e,g,y,w){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._color=new r(this._viewer,this._cesium),this._tree=o,this._Provider=void 0,this.labelCollections1=[],this.labelCollections2=[],this.labelCollections=this._cesium.PointPrimitiveCollection(),this.gd=0,this.item={show:!0},this.model=[],this.Legend=[],this.sj=!0,this._cache=!1,this._forceRefreshPrvimitive=null}return t.prototype.createLabelPointGeoJsonFeatureLayer=function(e,t,d,i,m){null==t&&console.log("geojson is required");var r=this._cesium.GeoJsonDataSource.load(t),p=this;r.then(function(e){var t={Name:"",text:"",font:" 30px sans-serif",stylet:p._cesium.LabelStyle.OUTLINE,fillColor:p._cesium.Color.WHITE,outlineColor:p._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new p._cesium.Color(.165,.165,.165,.8),backgroundPadding:new p._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:p._cesium.HorizontalOrigin.CENTER,verticalOrigin:p._cesium.VerticalOrigin.CENTER,eyeOffset:p._cesium.Cartesian3.ZERO,pixelOffset:p._cesium.Cartesian2.ZERO,heightReference:p._cesium.HeightReference.NONE,scaleByDistance:new p._cesium.NearFarScalar(0,0,1,1)};d.material;p._core.isnull(d)||p._core.isnull(d.fillColor)||/^\[/.test(d.fillColor)&&"["==d.fillColor.toString().charAt(0)&&"]"==d.fillColor.toString().charAt(d.fillColor.length-1)||(p._core.isHtmlColor(d.fillColor)?d.fillColor=p._color.colorFromHtmlColor(d.fillColor):(/^rgb/.test(d.fillColor)&&(d.fillColor=p._color.rgbaStringToRgbaObj(d.fillColor)),1<d.fillColor.r&&(d.fillColor.r=d.fillColor.r/255),1<d.fillColor.g&&(d.fillColor.g=d.fillColor.g/255),1<d.fillColor.b&&(d.fillColor.b=d.fillColor.b/255),1<d.fillColor.a&&(d.fillColor.a=d.fillColor.a/255),d.fillColor=p._color.createColor(d.fillColor.r,d.fillColor.g,d.fillColor.b,d.fillColor.a))),p._core.isnull(d)||p._core.isnull(d.material)||/^\[/.test(d.material)&&"["==d.material.toString().charAt(0)&&"]"==d.material.toString().charAt(d.material.length-1)||(p._core.isHtmlColor(d.material)?d.material=p._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=p._color.rgbaStringToRgbaObj(d.material)),1<d.material.r&&(d.material.r=d.fillColor.r/255),1<d.material.g&&(d.material.g=d.fillColor.g/255),1<d.material.b&&(d.material.b=d.material.b/255),1<d.material.a&&(d.material.a=d.material.a/255),d.material=p._color.createColor(d.material.r,d.material.g,d.material.b,d.material.a))),p._core.isnull(d)||p._core.isnull(d.outlineColor)||/^\[/.test(d.outlineColor)&&"["==d.outlineColor.toString().charAt(0)&&"]"==d.outlineColor.toString().charAt(d.outlineColor.length-1)||(p._core.isHtmlColor(d.outlineColor)?d.outlineColor=p._color.colorFromHtmlColor(d.outlineColor):(/^rgb/.test(d.outlineColor)&&(d.outlineColor=p._color.rgbaStringToRgbaObj(d.outlineColor)),1<d.outlineColor.r&&(d.outlineColor.r=d.outlineColor.r/255),1<d.outlineColor.g&&(d.outlineColor.g=d.outlineColor.g/255),1<d.outlineColor.b&&(d.outlineColor.b=d.outlineColor.b/255),1<d.outlineColor.a&&(d.outlineColor.a=d.outlineColor.a/255),d.outlineColor=p._color.createColor(d.outlineColor.r,d.outlineColor.g,d.outlineColor.b,d.outlineColor.a))),p._core.isnull(d)||p._core.isnull(d.backgroundColor)||/^\[/.test(d.backgroundColor)&&"["==d.backgroundColor.toString().charAt(0)&&"]"==d.backgroundColor.toString().charAt(d.backgroundColor.length-1)||(p._core.isHtmlColor(d.backgroundColor)?d.backgroundColor=p._color.colorFromHtmlColor(d.backgroundColor):(/^rgb/.test(d.backgroundColor)&&(d.backgroundColor=p._color.rgbaStringToRgbaObj(d.backgroundColor)),1<d.backgroundColor.r&&(d.backgroundColor.r=d.backgroundColor.r/255),1<d.backgroundColor.g&&(d.backgroundColor.g=d.backgroundColor.g/255),1<d.backgroundColor.b&&(d.backgroundColor.b=d.backgroundColor.b/255),1<d.backgroundColor.a&&(d.backgroundColor.a=d.backgroundColor.a/255),d.backgroundColor=p._color.createColor(d.backgroundColor.r,d.backgroundColor.g,d.backgroundColor.b,d.backgroundColor.a)));var i=p._core.extend(t,d,!0),r=(p.item=e).entities.values;p._core.isnull(d.near)&&(d.near=0),p._core.isnull(d.far)&&(d.far=999999999);var o=parseFloat(d.near),n=parseFloat(d.far),a=new p._cesium.DistanceDisplayCondition(o,n);i.distanceDisplayCondition=a,p._core.isnull(d.font_size)&&(d.font_size="30px"),p._core.isnull(d.font_family)&&(d.font_family=" sans-serif"),i.font=parseFloat(d.font_size)+"px "+d.font_family;for(var s=new p._cesium.LabelCollection,l=0;l<r.length;l++){var u=r[l];i.position=u.position._value,i.text="a label";var c="fillColor:"+255*i.fillColor.red+","+255*i.fillColor.green+","+255*i.fillColor.blue+";outlineColor:"+255*i.outlineColor.red+","+255*i.outlineColor.green+","+255*i.outlineColor.blue;p.Legend.push(c),s.add(i)}var h=p._viewer.scene.primitives.add(s);"function"==typeof m&&m(h)});var o=this._core.getuid();this._core.isnull(e)&&(e="新建图层"+o);var n={id:o,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"labelPointLayer",item:this,url:t,style:options};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},t.prototype.createLabelPolymerizationGeoJsonFeatureLayer=function(e,t,f,i,v,_){var r={Name:"",text:"",font:" 30px sans-serif",style:this._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.RELATIVE_TO_GROUND,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,pointHeight:0},y=this;this._core.isnull(f)||this._core.isnull(f.fillColor)||(this._core.isHtmlColor(f.fillColor)?f.fillColor=this._color.colorFromHtmlColor(f.fillColor):(/^rgb/.test(f.fillColor)&&(f.fillColor=this._color.rgbaStringToRgbaObj(f.fillColor)),1<f.fillColor.r&&(f.fillColor.r=f.fillColor.r/255),1<f.fillColor.g&&(f.fillColor.g=f.fillColor.g/255),1<f.fillColor.b&&(f.fillColor.b=f.fillColor.b/255),1<f.fillColor.a&&(f.fillColor.a=f.fillColor.a/255),f.fillColor=this._color.createColor(f.fillColor.r,f.fillColor.g,f.fillColor.b,f.fillColor.a))),this._core.isnull(f)||this._core.isnull(f.outlineColor)||(this._core.isHtmlColor(f.outlineColor)?f.outlineColor=this._color.colorFromHtmlColor(f.outlineColor):(/^rgb/.test(f.outlineColor)&&(f.outlineColor=this._color.rgbaStringToRgbaObj(f.outlineColor)),1<f.outlineColor.r&&(f.outlineColor.r=f.outlineColor.r/255),1<f.outlineColor.g&&(f.outlineColor.g=f.outlineColor.g/255),1<f.outlineColor.b&&(f.outlineColor.b=f.outlineColor.b/255),1<f.outlineColor.a&&(f.outlineColor.a=f.outlineColor.a/255),f.outlineColor=this._color.createColor(f.outlineColor.r,f.outlineColor.g,f.outlineColor.b,f.outlineColor.a))),this._core.isnull(f)||this._core.isnull(f.backgroundColor)||(this._core.isHtmlColor(f.backgroundColor)?f.backgroundColor=this._color.colorFromHtmlColor(f.backgroundColor):(/^rgb/.test(f.backgroundColor)&&(f.backgroundColor=this._color.rgbaStringToRgbaObj(f.backgroundColor)),1<f.backgroundColor.r&&(f.backgroundColor.r=f.backgroundColor.r/255),1<f.backgroundColor.g&&(f.backgroundColor.g=f.backgroundColor.g/255),1<f.backgroundColor.b&&(f.backgroundColor.b=f.backgroundColor.b/255),1<f.backgroundColor.a&&(f.backgroundColor.a=f.backgroundColor.a/255),f.backgroundColor=this._color.createColor(f.backgroundColor.r,f.backgroundColor.g,f.backgroundColor.b,f.backgroundColor.a))),y._core.isnull(f.near)&&(f.near=0),y._core.isnull(f.far)&&(f.far=999999999);var C=this._core.extend(r,f,!0),o=(this._viewer.scene.camera,this._viewer.scene.canvas,this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(t)));y=this;o.then(function(t){var i,e=(y.item=t).entities.values;y._core.isnull(C.font_size)&&(C.font_size="30"),y._core.isnull(C.font_family)&&(C.font_family=" sans-serif"),C.font=C.font_size+"px "+C.font_family;for(var r=0;r<e.length;r++){var o=e[r];C.font=y._core.extendgl(o,f.font,C.font),C.style=parseInt(y._core.extendgl(o,C.stylet,C.style)),C.fillColor=y._core.extendgl(o,f.fillColor,C.fillColor),C.outlineColor=y._core.extendgl(o,f.outlineColor,C.outlineColor),C.outlineWidth=parseFloat(y._core.extendgl(o,f.outlineWidth,C.outlineWidth)),C.show=y._core.extendgl(o,f.show,C.show),C.showBackground=y._core.extendgl(o,f.showBackground,C.showBackground),C.backgroundColor=y._core.extendgl(o,f.backgroundColor,C.backgroundColor),C.backgroundPadding=y._core.extendgl(o,f.backgroundPadding,C.backgroundPadding),C.scale=parseFloat(y._core.extendgl(o,f.scale,C.scale)),C.horizontalOrigin=y._core.extendgl(o,f.horizontalOrigin,C.horizontalOrigin),C.pointHeight=parseFloat(y._core.extendgl(o,f.pointHeight,C.pointHeight)),C.text=y._core.extendgl(o,f.text,C.text);var n=parseFloat(y._core.extendgl(o,C.near)),a=parseFloat(y._core.extendgl(o,C.far)),s=new y._cesium.DistanceDisplayCondition(n,a);C.distanceDisplayCondition=s,C.text=null==o.properties[C.text]?C.text:o.properties[C.text]._value,o.billboard.color=y._cesium.Color.WHITE.withAlpha(0),o.label=new y._cesium.LabelGraphics(C);y._viewer.scene.globe.ellipsoid;var l=y._cesium.Cartographic.fromCartesian(o.position._value),u=y._cesium.Math.toDegrees(l.longitude),c=y._cesium.Math.toDegrees(l.latitude),h=l.height+C.pointHeight,d=new y._cesium.Cartesian3.fromDegrees(u,c,h);o.position._value=d}t.clustering.enabled=!0,t.clustering.pixelRange=45,t.clustering.minimumClusterSize=3;var m=new y._cesium.PinBuilder,p=(m.fromText("50+",y._cesium.Color.RED,48).toDataURL(),m.fromText("40+",y._cesium.Color.ORANGE,48).toDataURL(),m.fromText("30+",y._cesium.Color.YELLOW,48).toDataURL(),m.fromText("20+",y._cesium.Color.GREEN,48).toDataURL(),m.fromText("10+",y._cesium.Color.BLUE,48).toDataURL(),new Array(8));for(r=0;r<p.length;++r)p[r]=m.fromText(""+(r+2),y._cesium.Color.VIOLET,48).toDataURL();!function(){i=y._cesium.defined(i)?void i():t.clustering.clusterEvent.addEventListener(function(e,t){t.label.show=!1,t.point.show=!1,t.billboard.show=!0,t.billboard.id=t.label.id,t.billboard.verticalOrigin=y._cesium.VerticalOrigin.BOTTOM,50<=e.length?t.billboard.image=m.fromText(e.length,y._cesium.Color.RED,48).toDataURL():40<=e.length?t.billboard.image=m.fromText(e.length,y._cesium.Color.ORANGE,48).toDataURL():30<=e.length?t.billboard.image=m.fromText(e.length,y._cesium.Color.YELLOW,48).toDataURL():20<=e.length?t.billboard.image=m.fromText(e.length,y._cesium.Color.GREEN,48).toDataURL():10<=e.length?t.billboard.image=m.fromText(e.length,y._cesium.Color.BLUE,48).toDataURL():t.billboard.image=p[e.length-2]});var e=t.clustering.pixelRange;t.clustering.pixelRange=0,t.clustering.pixelRange=e,v||y.setVisibility(v)}();var g={pixelRange:45,minimumClusterSize:3};y._cesium.knockout.track(g),"function"==typeof _&&_(ps)});var n=this._core.getuid();this._core.isnull(e)&&(e="新建图层"+n);var a={id:n,name:e,checked:v,pId:this._core.isnull(i)?0:i,type:"labelPointLayer",item:this,url:t};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},t.prototype.createPointPolymerizationGeoJsonFeatureLayer=function(e,t,f,i,v,_){var r={color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)};this._core.isnull(f)||this._core.isnull(f.color)||"["==f.color.toString().charAt(0)&&"]"==f.color.toString().charAt(f.color.length-1)||(this._core.isHtmlColor(f.color)?f.color=this._color.colorFromHtmlColor(f.color):(/^rgb/.test(f.color)&&(f.color=this._color.rgbaStringToRgbaObj(f.color)),1<f.color.r&&(f.color.r=f.color.r/255),1<f.color.g&&(f.color.g=f.color.g/255),1<f.color.b&&(f.color.b=f.color.b/255),1<f.color.a&&(f.color.a=f.color.a/255),f.color=this._color.createColor(f.color.r,f.color.g,f.color.b,f.color.a))),this._core.isnull(f)||this._core.isnull(f.outlineColor)||"["==f.outlineColor.toString().charAt(0)&&"]"==f.outlineColor.toString().charAt(f.outlineColor.length-1)||(this._core.isHtmlColor(f.outlineColor)?f.outlineColor=this._color.colorFromHtmlColor(f.outlineColor):(/^rgb/.test(f.outlineColor)&&(f.outlineColor=this._color.rgbaStringToRgbaObj(f.outlineColor)),1<f.outlineColor.r&&(f.outlineColor.r=f.outlineColor.r/255),1<f.outlineColor.g&&(f.outlineColor.g=f.outlineColor.g/255),1<f.outlineColor.b&&(f.outlineColor.b=f.outlineColor.b/255),1<f.outlineColor.a&&(f.outlineColor.a=f.outlineColor.a/255),f.outlineColor=this._color.createColor(f.outlineColor.r,f.outlineColor.g,f.outlineColor.b,f.outlineColor.a)));var y,C=this._core.extend(r,f,!0),o=(this._viewer.scene.camera,this._viewer.scene.canvas,this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(t))),w=this;f&&f.time&&(y=new w._cesium.TimeIntervalCollection([new w._cesium.TimeInterval({start:f.time.start?w._cesium.JulianDate.fromDate(new Date(f.time.start)):w._cesium.Iso8601.MINIMUM_VALUE,stop:f.time.end?w._cesium.JulianDate.fromDate(new Date(f.time.end)):w._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(t){for(var i,e=(w.item=t).entities.values,r=0;r<e.length;r++){var o=e[r];C.color=w._core.extendgl(o,f.color,C.color),C.pixelSize=parseInt(w._core.extendgl(o,f.pixelSize,C.pixelSize)),C.outlineColor=w._core.extendgl(o,f.outlineColor,C.outlineColor),C.outlineWidth=parseFloat(w._core.extendgl(o,f.outlineWidth,C.outlineWidth)),C.show=w._core.extendgl(o,f.show,C.show),C.height=parseFloat(w._core.extendgl(o,f.height,C.height)),C.scaleByDistance=w._core.extendgl(o,f.scaleByDistance,C.scaleByDistance);var n=parseFloat(w._core.extendgl(o,C.minDistanceDisplay)),a=parseFloat(w._core.extendgl(o,C.maxDistanceDisplay)),s=new w._cesium.DistanceDisplayCondition(n,a);o.billboard.image="",C.distanceDisplayCondition=s,o.point=new w._cesium.PointGraphics(C),C.pointHeight=w._core.extendgl(o,f.pointHeight,C.pointHeight),C.pointHeight=parseFloat(C.pointHeight);w._viewer.scene.globe.ellipsoid;var l=w._cesium.Cartographic.fromCartesian(o.position._value),u=w._cesium.Math.toDegrees(l.longitude),c=w._cesium.Math.toDegrees(l.latitude),h=l.height+C.pointHeight,d=new w._cesium.Cartesian3.fromDegrees(u,c,h);o.position._value=d,y&&(o.availability=y)}t.clustering.enabled=!0,t.clustering.pixelRange=45,t.clustering.minimumClusterSize=3;var m=new w._cesium.PinBuilder,p=(m.fromText("50+",w._cesium.Color.RED,48).toDataURL(),m.fromText("40+",w._cesium.Color.ORANGE,48).toDataURL(),m.fromText("30+",w._cesium.Color.YELLOW,48).toDataURL(),m.fromText("20+",w._cesium.Color.GREEN,48).toDataURL(),m.fromText("10+",w._cesium.Color.BLUE,48).toDataURL(),new Array(8));for(r=0;r<p.length;++r)p[r]=m.fromText(""+(r+2),w._cesium.Color.VIOLET,48).toDataURL();!function(){i=w._cesium.defined(i)?void i():t.clustering.clusterEvent.addEventListener(function(e,t){t.label.show=!1,t.point.show=!1,t.billboard.show=!0,t.billboard.id=t.label.id,t.billboard.verticalOrigin=w._cesium.VerticalOrigin.BOTTOM,50<=e.length?t.billboard.image=m.fromText(e.length,w._cesium.Color.RED,48).toDataURL():40<=e.length?t.billboard.image=m.fromText(e.length,w._cesium.Color.ORANGE,48).toDataURL():30<=e.length?t.billboard.image=m.fromText(e.length,w._cesium.Color.YELLOW,48).toDataURL():20<=e.length?t.billboard.image=m.fromText(e.length,w._cesium.Color.GREEN,48).toDataURL():10<=e.length?t.billboard.image=m.fromText(e.length,w._cesium.Color.BLUE,48).toDataURL():t.billboard.image=p[e.length-2]});var e=t.clustering.pixelRange;t.clustering.pixelRange=0,t.clustering.pixelRange=e,v||w.setVisibility(v)}();var g={pixelRange:45,minimumClusterSize:3};w._cesium.knockout.track(g),"function"==typeof _&&_(ps)});var n=this._core.getuid();this._core.isnull(e)&&(e="新建图层"+n);var a={id:n,name:e,checked:v,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},t.prototype._cameraMoveEndHandler=function(){if(this._viewer.camera.getMagnitude()<this.gd){if(this.sj){this._viewer.scene.primitives.remove(this.labelCollections),this.labelCollections=new this._cesium.LabelCollection;for(var e=0;e<this.labelCollections1.length;e++)this.labelCollections.add(this.labelCollections1[e]);this._viewer.scene.primitives.add(this.labelCollections),this.sj=!1}}else{this._viewer.scene.primitives.remove(this.labelCollections);for(new this._cesium.BillboardCollection,e=0;e<this.labelCollections2.length;e++)this.BillboardCollections.add(this.labelCollections2[e]);this._viewer.scene.primitives.add(this.BillboardCollections),this.sj=!0}},t.prototype.createLabelpolymerizationGeoJsonFeatureLayer=function(e,t,i,r,o,n){var a=t;this._viewer.scene.primitives;this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this.gd=i.height;new this._cesium.BillboardCollection;for(var s,l={},u=[],c=0;c<a.length;c++){var h={position:new this._cesium.Cartesian3.fromDegrees(a[c].lng,a[c].lat,100),text:a[c].name};this.labelCollections1.push(h);var d=a[c];if(l[d[i.adminname]])for(var m=0;m<u.length;m++){var p=u[m];if(p.adminname==d[i.adminname]){p.data.push(d);break}}else u.push({adminname:d[i.adminname],name:d.name,showBackground:!0,lat:d.lat,lng:d.lng,data:[d]}),l[d[i.adminname]]=d}for(c=0;c<u.length;c++){h={position:new this._cesium.Cartesian3.fromDegrees(u[c].lng,u[c].lat,100),image:pinBuilder.fromText(u[c].data.length+"",this._cesium.Color.BLACK,48).toDataURL()};this.labelCollections2.push(h),this.BillboardCollections.add(h)}i&&i.time&&(s=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:i.time.start?this._cesium.JulianDate.fromDate(new Date(i.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:i.time.end?this._cesium.JulianDate.fromDate(new Date(i.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this._viewer.scene.primitives.add(this.BillboardCollections,s)},t.prototype.createLabelpolymerizationGeoJsonFeatureLayers=function(e,t,r,i,o,n){var a={height:0,material:this._cesium.Color.WHITE,size:50,fill:this._cesium.Color.RED,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(r)||this._core.isnull(r.material)||"["==r.material.toString().charAt(0)&&"]"==r.material.toString().charAt(r.material.length-1)||(this._core.isHtmlColor(r.material)?r.material=this._color.colorFromHtmlColor(r.material):/^http/.test(r.material)||(/^rgb/.test(r.material)&&(r.material=this._color.rgbaStringToRgbaObj(r.material)),1<r.material.r&&(r.material.r=r.material.r/255),1<r.material.g&&(r.material.g=r.material.g/255),1<r.material.b&&(r.material.b=r.material.b/255),1<r.material.a&&(r.material.a=r.material.a/255),r.material=this._color.createColor(r.material.r,r.material.g,r.material.b,r.material.a))),this._core.isnull(r)||this._core.isnull(r.fill)||"["==r.fill.toString().charAt(0)&&"]"==r.fill.toString().charAt(r.fill.length-1)||(this._core.isHtmlColor(r.fill)?r.fill=this._color.colorFromHtmlColor(r.fill):/^http/.test(r.fill)||(/^rgb/.test(r.fill)&&(r.fill=this._color.rgbaStringToRgbaObj(r.fill)),1<r.fill.r&&(r.fill.r=r.fill.r/255),1<r.fill.g&&(r.fill.g=r.fill.g/255),1<r.fill.b&&(r.fill.b=r.fill.b/255),1<r.fill.a&&(r.fill.a=r.fill.a/255),r.fill=this._color.createColor(r.fill.r,r.fill.g,r.fill.b,r.fill.a)));var l=this._core.extend(a,r,!0),u=this;this._urlTemplate=t.url+"?"+this._core._serialize(s.urlParams);var c=t.url+"?"+this._core._serialize(s.urlParams);this._Provider=new g(this._viewer,this._cesium),this._Provider._normalTile=r.level_max-1,this._Provider._minimumHeight=parseFloat(l.height)||0,this._Provider.loadTile=function(t,i){if(i.state===Cesium.QuadtreeTileLoadState.START){if(i.data={lines:[],geometryPrimitive:void 0},!(i.level>=r.level_min&&i.level<r.level_max&&u.item.show))return i.state=Cesium.QuadtreeTileLoadState.DONE,void(i.renderable=!0);var e=c.replace(window.encodeURIComponent("{x}"),i.x).replace(window.encodeURIComponent("{y}"),i.y).replace(window.encodeURIComponent("{z}"),i.level);u._cache&&(e+="&"+u._core.getuid()),u._core.xhr({url:e,type:"get",dataType:"json",success:function(e){""==cluster?u.labelCollections=new u._cesium.PointPrimitiveCollection:u.labelCollections=new u._cesium.BillboardCollection;var n=new u._cesium.PinBuilder;if(null==e)return i.state=Cesium.QuadtreeTileLoadState.DONE,void(i.renderable=!0);e.features.forEach(function(e){var t=(l.id=e).geometry.coordinates[2]||0;if(null!=e.properties.height&&(t=parseFloat(e.properties.height)),/^\[/.test(l.height)&&/\]$/.test(l.height)){var i=l.height.replace(/\[/,"").replace(/\]/,"");t+=parseFloat(e.properties[i])}else t+=parseFloat(l.height)||0;var r={},o=new u._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t);r=""==cluster?{id:e,color:l.material,position:o}:{position:o,image:n.fromText(e.count+"",l.fill,l.size).toDataURL(),verticalOrigin:u._cesium.VerticalOrigin.BOTTOM},u.labelCollections.add(r)}),0==e.features.length&&(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0),i.data.geometryPrimitive=u.labelCollections,i.state=Cesium.QuadtreeTileLoadState.LOADING,i.state===Cesium.QuadtreeTileLoadState.LOADING&&(i.data.geometryPrimitive.update(t,[]),i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0)},error:function(){null==i.count&&(i.count=0),i.count+=1,2<=i.count?(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0):i.state=Cesium.QuadtreeTileLoadState.START}}),i.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var h=this._viewer.scene,d=h.primitives;r&&r.time&&(this._Provider._availability=new u._cesium.TimeIntervalCollection([new u._cesium.TimeInterval({start:r.time.start?u._cesium.JulianDate.fromDate(new Date(r.time.start)):u._cesium.Iso8601.MINIMUM_VALUE,stop:r.time.end?u._cesium.JulianDate.fromDate(new Date(r.time.end)):u._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),d.add(this._primitive),h.primitivesQuadTrees&&h.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var m={id:l.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:r};return this.setTreeobj(m),this._tree.insertGroupId(m,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item),this},t.prototype.createLabelGeoJsonFeatureLayerProvider=function(e,t,u,i,r,o){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},c=this;u.material;c._core.isnull(u)||c._core.isnull(u.fillColor)||/^\[/.test(u.fillColor)&&"["==u.fillColor.toString().charAt(0)&&"]"==u.fillColor.toString().charAt(u.fillColor.length-1)||(c._core.isHtmlColor(u.fillColor)?u.fillColor=c._color.colorFromHtmlColor(u.fillColor):(/^rgb/.test(u.fillColor)&&(u.fillColor=c._color.rgbaStringToRgbaObj(u.fillColor)),1<u.fillColor.r&&(u.fillColor.r=u.fillColor.r/255),1<u.fillColor.g&&(u.fillColor.g=u.fillColor.g/255),1<u.fillColor.b&&(u.fillColor.b=u.fillColor.b/255),1<u.fillColor.a&&(u.fillColor.a=u.fillColor.a/255),u.fillColor=c._color.createColor(u.fillColor.r,u.fillColor.g,u.fillColor.b,u.fillColor.a))),c._core.isnull(u)||c._core.isnull(u.material)||/^\[/.test(u.material)&&"["==u.material.toString().charAt(0)&&"]"==u.material.toString().charAt(u.material.length-1)||(c._core.isHtmlColor(u.material)?u.material=c._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=c._color.rgbaStringToRgbaObj(u.material)),1<u.material.r&&(u.material.r=u.material.r/255),1<u.material.g&&(u.material.g=u.material.g/255),1<u.material.b&&(u.material.b=u.material.b/255),1<u.material.a&&(u.material.a=u.material.a/255),u.material=c._color.createColor(u.material.r,u.material.g,u.material.b,u.material.a))),c._core.isnull(u)||c._core.isnull(u.outlineColor)||/^\[/.test(u.outlineColor)&&"["==u.outlineColor.toString().charAt(0)&&"]"==u.outlineColor.toString().charAt(u.outlineColor.length-1)||(c._core.isHtmlColor(u.outlineColor)?u.outlineColor=c._color.colorFromHtmlColor(u.outlineColor):(/^rgb/.test(u.outlineColor)&&(u.outlineColor=c._color.rgbaStringToRgbaObj(u.outlineColor)),1<u.outlineColor.r&&(u.outlineColor.r=u.outlineColor.r/255),1<u.outlineColor.g&&(u.outlineColor.g=u.outlineColor.g/255),1<u.outlineColor.b&&(u.outlineColor.b=u.outlineColor.b/255),1<u.outlineColor.a&&(u.outlineColor.a=u.outlineColor.a/255),u.outlineColor=c._color.createColor(u.outlineColor.r,u.outlineColor.g,u.outlineColor.b,u.outlineColor.a))),c._core.isnull(u)||c._core.isnull(u.backgroundColor)||/^\[/.test(u.backgroundColor)&&"["==u.backgroundColor.toString().charAt(0)&&"]"==u.backgroundColor.toString().charAt(u.backgroundColor.length-1)||(c._core.isHtmlColor(u.backgroundColor)?u.backgroundColor=c._color.colorFromHtmlColor(u.backgroundColor):(/^rgb/.test(u.backgroundColor)&&(u.backgroundColor=c._color.rgbaStringToRgbaObj(u.backgroundColor)),1<u.backgroundColor.r&&(u.backgroundColor.r=u.backgroundColor.r/255),1<u.backgroundColor.g&&(u.backgroundColor.g=u.backgroundColor.g/255),1<u.backgroundColor.b&&(u.backgroundColor.b=u.backgroundColor.b/255),1<u.backgroundColor.a&&(u.backgroundColor.a=u.backgroundColor.a/255),u.backgroundColor=c._color.createColor(u.backgroundColor.r,u.backgroundColor.g,u.backgroundColor.b,u.backgroundColor.a))),this._urlTemplate=t.url+"?"+this._core._serialize(n.urlParams);var a=t.url+"?"+this._core._serialize(n.urlParams);this._Provider=new g(this._viewer,this._cesium),this._Provider._normalTile=u.level_max-1,this._Provider._minimumHeight=parseFloat(u.height)||0,this._Provider.loadTile=function(s,l){if(l.state===Cesium.QuadtreeTileLoadState.START){if(l.data={lines:[],geometryPrimitive:void 0},!(l.level>=u.level_min&&l.level<u.level_max&&c.item.show))return l.state=Cesium.QuadtreeTileLoadState.DONE,void(l.renderable=!0);var e=a.replace(window.encodeURIComponent("{x}"),l.x).replace(window.encodeURIComponent("{y}"),l.y).replace(window.encodeURIComponent("{z}"),l.level);c._cache&&(e+="&"+c._core.getuid()),c._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return l.state=Cesium.QuadtreeTileLoadState.DONE,void(l.renderable=!0);var t={Name:"",text:"",font:" 30px sans-serif",style:c._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:c._cesium.Color.WHITE,outlineColor:c._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new c._cesium.Color(.165,.165,.165,.8),backgroundPadding:new c._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:c._cesium.HorizontalOrigin.CENTER,verticalOrigin:c._cesium.VerticalOrigin.CENTER,eyeOffset:c._cesium.Cartesian3.ZERO,pixelOffset:c._cesium.Cartesian2.ZERO,heightReference:c._cesium.HeightReference.NONE,scaleByDistance:new c._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},n=c._core.extend(t,u,!0);c._core.isnull(u.near)&&(u.near=0),c._core.isnull(u.far)&&(u.far=999999999);var a,i=parseFloat(u.near),r=parseFloat(u.far),o=new c._cesium.DistanceDisplayCondition(i,r);n.distanceDisplayCondition=o,c._core.isnull(u.font_size)&&(u.font_size="30px"),c._core.isnull(u.font_family)&&(u.font_family=" sans-serif"),n.font=parseFloat(u.font_size)+"px "+u.font_family,a=null!=n.image&&null!=n.image?new c._cesium.BillboardCollection:new c._cesium.LabelCollection,e.features.forEach(function(e){n.id=e;var t=n.pointHeight;if(/^\[/.test(t)&&/\]$/.test(t)){var i=t.replace(/\[/,"").replace(/\]/,"");t=parseFloat(e.properties[i])}else null!=t&&""!=t?t=parseFloat(t):null!=e.properties.height&&(t=parseFloat(e.properties.height));if(n.position=new c._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),/^\[/.test(u.fillColor)&&/\]$/.test(u.fillColor)){var r=u.fillColor.replace(/\[/,"").replace(/\]/,"");n.fillColor=e.properties[r],c._core.isHtmlColor(n.fillColor)?n.fillColor=c._color.colorFromHtmlColor(n.fillColor):(/^rgb/.test(n.fillColor)&&(n.fillColor=c._color.rgbaStringToRgbaObj(n.fillColor)),1<n.fillColor.r&&(n.fillColor.r=n.fillColor.r/255),1<n.fillColor.g&&(n.fillColor.g=n.fillColor.g/255),1<n.fillColor.b&&(n.fillColor.b=n.fillColor.b/255),1<n.fillColor.a&&(n.fillColor.a=n.fillColor.a/255),n.fillColor=c._color.createColor(n.fillColor.r,n.fillColor.g,n.fillColor.b,n.fillColor.a))}if(/^\[/.test(u.outlineColor)&&/\]$/.test(u.outlineColor)){r=u.outlineColor.replace(/\[/,"").replace(/\]/,"");n.outlineColor=e.properties[r],c._core.isHtmlColor(n.outlineColor)?n.outlineColor=c._color.colorFromHtmlColor(n.outlineColor):(/^rgb/.test(n.outlineColor)&&(n.outlineColor=c._color.rgbaStringToRgbaObj(n.outlineColor)),1<n.outlineColor.r&&(n.outlineColor.r=n.outlineColor.r/255),1<n.outlineColor.g&&(n.outlineColor.g=n.outlineColor.g/255),1<n.outlineColor.b&&(n.outlineColor.b=n.outlineColor.b/255),1<n.outlineColor.a&&(n.outlineColor.a=n.outlineColor.a/255),n.outlineColor=c._color.createColor(n.outlineColor.r,n.outlineColor.g,n.outlineColor.b,n.outlineColor.a))}var o="fillColor:"+255*n.fillColor.red+","+255*n.fillColor.green+","+255*n.fillColor.blue+";outlineColor:"+255*n.outlineColor.red+","+255*n.outlineColor.green+","+255*n.outlineColor.blue;if(c.Legend.push(o),/^\[/.test(u.text)&&/\]$/.test(u.text)){r=u.text.replace(/\[/,"").replace(/\]/,"");n.text=e.properties[r]}n.id.treeID=u.id,n.id.VectorType="label",n.id.VectorStyle={position:n.position,pointHeight:t,text:n.text,font:n.font,scale:n.scale,style:n.style,fillColor:n.fillColor,outlineColor:n.outlineColor,outlineWidth:n.outlineWidth,showBackground:n.showBackground,backgroundColor:n.backgroundColor,heightReference:n.heightReference,horizontalOrigin:n.horizontalOrigin,verticalOrigin:n.verticalOrigin,scaleByDistance:n.scaleByDistance,distanceDisplayCondition:n.distanceDisplayCondition},a.add(n)}),0==e.features.length&&(l.state=Cesium.QuadtreeTileLoadState.DONE,l.renderable=!0),l.data.geometryPrimitive=a,l.state=Cesium.QuadtreeTileLoadState.LOADING,l.state===Cesium.QuadtreeTileLoadState.LOADING&&(l.data.geometryPrimitive.update(s,[]),l.state=Cesium.QuadtreeTileLoadState.DONE,l.renderable=!0)},error:function(){null==l.count&&(l.count=0),l.count+=1,2<=l.count?(l.state=Cesium.QuadtreeTileLoadState.DONE,l.renderable=!0):l.state=Cesium.QuadtreeTileLoadState.START}}),l.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var s=this._viewer.scene,l=s.primitives;u&&u.time&&(this._Provider._availability=new c._cesium.TimeIntervalCollection([new c._cesium.TimeInterval({start:u.time.start?c._cesium.JulianDate.fromDate(new Date(u.time.start)):c._cesium.Iso8601.MINIMUM_VALUE,stop:u.time.end?c._cesium.JulianDate.fromDate(new Date(u.time.end)):c._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),l.add(this._primitive),s.primitivesQuadTrees&&s.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var h={id:u.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:u};return this._Provider.treeID=u.id,this.setTreeobj(h),this._tree.insertGroupId(h,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},t.prototype.createLabelImageGeoJsonFeatureLayerProvider=function(e,a,p,t,i,r){var o={url:a.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:a.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(a.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(a.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:a.upperLevelLimit,lowerLevelLimit:a.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(a.minx,a.miny,a.maxx,a.maxy),Cesium:this._cesium},g=this;p.material;g._core.isnull(p)||g._core.isnull(p.fillColor)||"string"!=typeof p.fillColor||/^\[/.test(p.fillColor)&&/\]$/.test(p.fillColor)||(g._core.isHtmlColor(p.fillColor)||/^rgb/.test(p.fillColor))&&(p.fillColor=Cesium.Color.fromCssColorString(p.fillColor)),g._core.isnull(p)||g._core.isnull(p.outlineColor)||"string"!=typeof p.outlineColor||/^\[/.test(p.outlineColor)&&/\]$/.test(p.outlineColor)||(g._core.isHtmlColor(p.outlineColor)||/^rgb/.test(p.outlineColor))&&(p.outlineColor=Cesium.Color.fromCssColorString(p.outlineColor)),g._core.isnull(p)||g._core.isnull(p.color)||"string"!=typeof p.color||/^\[/.test(p.color)&&/\]$/.test(p.color)||(g._core.isHtmlColor(p.color)||/^rgb/.test(p.color))&&(p.color=Cesium.Color.fromCssColorString(p.color)),g._core.isnull(p)||g._core.isnull(p.backgroundColor)||"string"!=typeof p.backgroundColor||/^\[/.test(p.backgroundColor)&&/\]$/.test(p.backgroundColor)||(g._core.isHtmlColor(p.backgroundColor)||/^rgb/.test(p.backgroundColor))&&(p.backgroundColor=Cesium.Color.fromCssColorString(p.backgroundColor)),g._core.isnull(p.font)&&(g._core.isnull(p.font_size)&&(p.font_size="30px"),g._core.isnull(p.font_family)&&(p.font_family=" sans-serif"),p.font=p.font_size+" "+p.font_family),g._core.isnull(p.near)&&(p.near=0),g._core.isnull(p.far)&&(p.far=999999999);var n=parseFloat(p.near),s=parseFloat(p.far),l=new g._cesium.DistanceDisplayCondition(n,s);p.distanceDisplayCondition=l,this._urlTemplate=a.url+"?"+this._core._serialize(o.urlParams);var u=a.url+"?"+this._core._serialize(o.urlParams);function f(e,t){var i=void 0;if("string"==typeof t.value)i=/^\[/.test(t.value)&&/\]$/.test(t.value)?(i=t.value.replace(/\[/,"").replace(/\]/,""),e.properties[i]):t.value;else{var r=t.value,o=r.Condition,n=e.properties[o];i=r.Value[n]}return!i&&(i=t.defaultValue),g._core.isHtmlColor(i)&&(i=Cesium.Color.fromCssColorString(i)),i}function v(e,t,i){this.viewer=e,this.collection=t,this.key=i.level+"-"+i.x+"-"+i.y,this.isDestroy=!1,this.values=[],this._time=void 0,this.show=!0}this._Provider=new y(this._viewer,this._cesium),this._Provider._normalTile=p.level_max+1,this._Provider._minimumHeight=parseFloat(p.height)||0,g._core.xhr({url:a.url+"?service=WMTS&request=GetCapabilities",type:"get",isXml:!0,success:function(e){var t=g._core.xml2json(e),i=(t.Contents&&t.Contents.Layer).filter(function(e){return e.Identifier===a.layer})[0];if(i){var r=i.TileMatrixSetLink,o=a.srs||"EPSG:4490",n=r.filter(function(e){return e.TileMatrixSet===o})[0];n&&(g.TileMatrixLimits={},n.TileMatrixSetLimits&&n.TileMatrixSetLimits.TileMatrixLimits.forEach(function(e){var t=e.TileMatrix,i=(t=t.split(":"))[t.length-1];g.TileMatrixLimits[i]={maxCol:e.MaxTileCol,minCol:e.MinTileCol,maxRow:e.MaxTileRow,minRow:e.MinTileRow}}))}}}),this._Provider.EntityCollection=new Cesium.EntityCollection,this._Provider.EntityCollection.childrenCollection={},v.prototype.update=function(){var e=this;clearTimeout(this._time),this.setVisibility(!0),this._time=setTimeout(function(){e.setVisibility(!1)},1e3)},v.prototype.add=function(e){this.isDestroy||(this.viewer&&this.viewer.entities.add(e),this.collection&&this.collection.add(e),this.values.push(e.id))},v.prototype.setVisibility=function(i){var r=this;this.show===!i&&(this.show=i,this.values.length&&this.values.forEach(function(e){var t=r.viewer.entities.getById(e);t&&(t.show=i)}))},v.prototype.destroy=function(){var t=this;this.isDestroy=!0,this.add=function(){},this.update=function(){},this.values.length&&this.values.forEach(function(e){t.viewer&&t.viewer.entities.removeById(e),t.collection&&t.collection.removeById(e)}),delete this.collection.childrenCollection[this.key],this.collection=void 0,this.values=[],this.viewer=void 0,Cesium.destroyObject(this)};var c=void 0;function _(){clearTimeout(c),c=setTimeout(function(){!function(){if(g._Provider.quadtree&&g._Provider.quadtree._tilesToRender&&g._Provider.quadtree._tilesToRender.length){var t=[];for(var e in g._Provider.quadtree._tilesToRender.forEach(function(e){t.push(e.level+"-"+e.x+"-"+e.y)}),g._Provider.EntityCollection.childrenCollection)t.indexOf(e)<0&&g._Provider.EntityCollection.childrenCollection[e].setVisibility(!1)}}()},100)}this._Provider.loadTile=function(e,a){if(a.state===Cesium.QuadtreeTileLoadState.START){if(a.data={lines:[],geometryPrimitive:void 0},!(a.level>=p.level_min&&a.level<p.level_max&&g.item.show))return a.state=Cesium.QuadtreeTileLoadState.DONE,void(a.renderable=!0);if(g.TileMatrixLimits){var t=g.TileMatrixLimits[a.level];if(a.x>t.maxCol||a.x<t.minCol||a.y>t.maxRow||a.y<t.minRow)return a.state=Cesium.QuadtreeTileLoadState.DONE,void(a.renderable=!0)}if(g._Provider.EntityCollection.childrenCollection[a.level+"-"+a.x+"-"+a.y]){var i=g._Provider.EntityCollection.childrenCollection[a.level+"-"+a.x+"-"+a.y];return i.setVisibility(!0),a.data.geometryPrimitive=i,a.state=Cesium.QuadtreeTileLoadState.DONE,void(a.renderable=!0)}var r=u.replace(window.encodeURIComponent("{x}"),a.x).replace(window.encodeURIComponent("{y}"),a.y).replace(window.encodeURIComponent("{z}"),a.level);g._cache&&(r+="&"+g._core.getuid()),g._core.xhr({url:r,type:"get",dataType:"json",success:function(e){var t,i,r=(t=_asyncToGenerator(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t.features.forEach(function(e,t){m.isDestroy||o(e)});case 1:case"end":return e.stop()}},e,this)})),function(e){return t.apply(this,arguments)}),o=(i=_asyncToGenerator(regeneratorRuntime.mark(function e(t){var i,r,o,n,a,s,l,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:d.id=t.id,"string"==typeof(i=d.pointHeight)&&/^\[/.test(i)&&/\]$/.test(i)?(r=i.replace(/\[/,"").replace(/\]/,""),i=parseFloat(t.properties[r])):null!=i&&""!=i?i=parseFloat(i):null!=t.properties.height&&(i=parseFloat(t.properties.height)),d.position=new g._cesium.Cartesian3.fromDegrees(t.geometry.coordinates[0],t.geometry.coordinates[1],i),"object"===_typeof2(p.font)&&(d.font=f(t,p.font)),"string"==typeof p.fillColor&&/^\[/.test(p.fillColor)&&/\]$/.test(p.fillColor)?(o=p.fillColor.replace(/\[/,"").replace(/\]/,""),d.fillColor=t.properties[o],(g._core.isHtmlColor(d.fillColor)||/^rgb/.test(d.fillColor))&&(d.fillColor=Cesium.Color.fromCssColorString(d.fillColor))):"object"===_typeof2(p.fillColor)&&p.fillColor.value&&(d.fillColor=f(t,p.fillColor)),"string"==typeof p.outlineColor&&/^\[/.test(p.outlineColor)&&/\]$/.test(p.outlineColor)?(o=p.outlineColor.replace(/\[/,"").replace(/\]/,""),d.outlineColor=t.properties[o],(g._core.isHtmlColor(d.outlineColor)||/^rgb/.test(d.outlineColor))&&(d.outlineColor=Cesium.Color.fromCssColorString(d.outlineColor))):"object"===_typeof2(p.outlineColor)&&p.outlineColor.value&&(d.outlineColor=f(t,p.outlineColor)),p.showBackground&&("string"==typeof p.backgroundColor&&/^\[/.test(p.backgroundColor)&&/\]$/.test(p.backgroundColor)?(o=p.backgroundColor.replace(/\[/,"").replace(/\]/,""),d.backgroundColor=t.properties[o],(g._core.isHtmlColor(d.backgroundColor)||/^rgb/.test(d.backgroundColor))&&(d.backgroundColor=Cesium.Color.fromCssColorString(d.backgroundColor))):"object"===_typeof2(p.backgroundColor)&&p.backgroundColor.value&&(d.backgroundColor=f(t,p.backgroundColor))),n="fillColor:"+255*d.fillColor.red+","+255*d.fillColor.green+","+255*d.fillColor.blue+";outlineColor:"+255*d.outlineColor.red+","+255*d.outlineColor.green+","+255*d.outlineColor.blue,g.Legend.push(n),"string"==typeof p.text&&/^\[/.test(p.text)&&/\]$/.test(p.text)?(o=p.text.replace(/\[/,"").replace(/\]/,""),d.text=t.properties[o]):"object"===_typeof2(p.text)&&(d.text=f(t,p.text)),"string"==typeof p.image&&/^\[/.test(p.image)&&/\]$/.test(p.image)?(o=p.image.replace(/\[/,"").replace(/\]/,""),d.image=t.properties[o]):"object"===_typeof2(p.image)&&(d.image=f(t,p.image)),a={position:d.position},c&&((s=d).labelData&&(s=g._core.extend(d,d.labelData,!0)),a.label=s),h&&((l=d).imageData&&(l=g._core.extend(d,d.imageData,!0)),a.billboard=l),(u=new Cesium.Entity(a)).feature=t,m.add(u);case 18:case"end":return e.stop()}},e,this)})),function(e){return i.apply(this,arguments)});if(!e||!e.features||!e.features.length)return a.state=Cesium.QuadtreeTileLoadState.DONE,void(a.renderable=!0);var c,h,n={Name:"",text:"",font:" 30px sans-serif",style:g._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:g._cesium.Color.WHITE,outlineColor:g._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new g._cesium.Color(.165,.165,.165,.8),backgroundPadding:new g._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:g._cesium.HorizontalOrigin.CENTER,verticalOrigin:g._cesium.VerticalOrigin.CENTER,eyeOffset:g._cesium.Cartesian3.ZERO,pixelOffset:g._cesium.Cartesian2.ZERO,heightReference:g._cesium.HeightReference.NONE,scaleByDistance:new g._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},d=g._core.extend(n,p,!0);d.image&&!d.text?h=!0:c=!(d.image||!d.text)||(!d.image||!d.text||(h=!0));var m=new v(g._viewer,g._Provider.EntityCollection,a);r(e),a.data.geometryPrimitive=m,g._Provider.EntityCollection.childrenCollection[a.level+"-"+a.x+"-"+a.y]=m,a.state=Cesium.QuadtreeTileLoadState.LOADING,a.state===Cesium.QuadtreeTileLoadState.LOADING&&(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0),_()},error:function(){a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0,_()}}),a.state=Cesium.QuadtreeTileLoadState.LOADING}_()},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var h=this._viewer.scene,d=h.primitives;p&&p.time&&(this._Provider._availability=new g._cesium.TimeIntervalCollection([new g._cesium.TimeInterval({start:p.time.start?g._cesium.JulianDate.fromDate(new Date(p.time.start)):g._cesium.Iso8601.MINIMUM_VALUE,stop:p.time.end?g._cesium.JulianDate.fromDate(new Date(p.time.end)):g._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),d.add(this._primitive),h.primitivesQuadTrees&&h.primitivesQuadTrees.push(this._primitive),i||this.setVisibility(!1),this._core.isnull(p.id)&&(p.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+p.id),this.west=a.minx,this.south=a.miny,this.east=a.maxx,this.north=a.maxy;var m={id:p.id,name:e,checked:!0,pId:this._core.isnull(t)?0:t,type:"polygonLayer",item:this,url:a.url,style:p};return this._Provider.treeID=p.id,this.setTreeobj(m),this._tree.insertGroupId(m,this._core.isnull(t)?0:t),"function"==typeof r&&r(this.item),this},t.prototype.createLabelImageGeoJsonFeatureLayerProvider1=function(e,t,d,i,r,o){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},m=this,a=(d.material,{Name:"",text:"",font:" 30px sans-serif",style:m._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:m._cesium.Color.WHITE,outlineColor:m._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new m._cesium.Color(.165,.165,.165,.8),backgroundPadding:new m._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:m._cesium.HorizontalOrigin.CENTER,verticalOrigin:m._cesium.VerticalOrigin.CENTER,eyeOffset:m._cesium.Cartesian3.ZERO,pixelOffset:m._cesium.Cartesian2.ZERO,heightReference:m._cesium.HeightReference.NONE,scaleByDistance:new m._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0});this._urlTemplate=t.url+"?"+this._core._serialize(n.urlParams);var s=t.url+"?"+this._core._serialize(n.urlParams);this._Provider=new g(this._viewer,this._cesium),this._Provider._normalTile=21,this._Provider._minimumHeight=parseFloat(d.height)||0,this._Provider.loadTile=function(i,r){if(r.state===Cesium.QuadtreeTileLoadState.START){if(r.data={lines:[],geometryPrimitive:void 0},!(r.level>=d.level_min&&r.level<d.level_max&&m.item.show))return r.state=Cesium.QuadtreeTileLoadState.DONE,void(r.renderable=!0);var e=s.replace(window.encodeURIComponent("{x}"),r.x).replace(window.encodeURIComponent("{y}"),r.y).replace(window.encodeURIComponent("{z}"),r.level);m._cache&&(e+="&"+m._core.getuid()),m._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return r.state=Cesium.QuadtreeTileLoadState.DONE,void(r.renderable=!0);var u,c,t,h=m._core.extend(a,d,!0);h.font=d.font,h.image&&!h.text?c=new m._cesium.BillboardCollection({scene:m._viewer.scene}):!h.image&&h.text?u=new m._cesium.LabelCollection({scene:m._viewer.scene}):h.image&&h.text?(u=new m._cesium.LabelCollection({scene:m._viewer.scene}),c=new m._cesium.BillboardCollection({scene:m._viewer.scene}),(t=new m._cesium.PrimitiveCollection).add(u),t.add(c)):u=new m._cesium.LabelCollection({scene:m._viewer.scene}),e.features.forEach(function(e){h.id=e;var t=h.pointHeight;if(/^\[/.test(t)&&/\]$/.test(t)){var i=t.replace(/\[/,"").replace(/\]/,"");t=parseFloat(e.properties[i])}else null!=t&&""!=t?t=parseFloat(t):null!=e.properties.height&&(t=parseFloat(e.properties.height));if(h.position=new m._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),d.fillColor){if(/^\[/.test(d.fillColor)&&/\]$/.test(d.fillColor)){var r=d.fillColor.replace(/\[/,"").replace(/\]/,"");h.fillColor=e.properties[r]}m._core.isHtmlColor(h.fillColor)?h.fillColor=m._color.colorFromHtmlColor(h.fillColor):(/^rgb/.test(h.fillColor)&&(h.fillColor=m._color.rgbaStringToRgbaObj(h.fillColor)),1<h.fillColor.r&&(h.fillColor.r=h.fillColor.r/255),1<h.fillColor.g&&(h.fillColor.g=h.fillColor.g/255),1<h.fillColor.b&&(h.fillColor.b=h.fillColor.b/255),1<h.fillColor.a&&(h.fillColor.a=h.fillColor.a/255),h.fillColor=m._color.createColor(h.fillColor.r,h.fillColor.g,h.fillColor.b,h.fillColor.a))}else if(d.fillColor&&d.fillColor.Class instanceof Array)for(var o=0;o<d.fillColor.Class.length;o++){if((s=(a=d.fillColor.Class[o]).Condition.replace("<","").replace(">","").split("="))[0]=s[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),s[1]=s[1].replace(/\"/,"").replace(/\"/,""),e.properties[s[0]]==s[1]){h.fillColor=a.Value,m._core.isHtmlColor(h.fillColor)?h.fillColor=m._color.colorFromHtmlColor(h.fillColor):(/^rgb/.test(h.fillColor)&&(h.fillColor=m._color.rgbaStringToRgbaObj(h.fillColor)),1<h.fillColor.r&&(h.fillColor.r=h.fillColor.r/255),1<h.fillColor.g&&(h.fillColor.g=h.fillColor.g/255),1<h.fillColor.b&&(h.fillColor.b=h.fillColor.b/255),1<h.fillColor.a&&(h.fillColor.a=h.fillColor.a/255),h.fillColor=m._color.createColor(h.fillColor.r,h.fillColor.g,h.fillColor.b,h.fillColor.a));break}}else d.fillColor&&"{}"!=d.fillColor.Class.toString()?(h.fillColor=d.fillColor.Value,m._core.isHtmlColor(h.fillColor)?h.fillColor=m._color.colorFromHtmlColor(h.fillColor):(/^rgb/.test(h.fillColor)&&(h.fillColor=m._color.rgbaStringToRgbaObj(h.fillColor)),1<h.fillColor.r&&(h.fillColor.r=h.fillColor.r/255),1<h.fillColor.g&&(h.fillColor.g=h.fillColor.g/255),1<h.fillColor.b&&(h.fillColor.b=h.fillColor.b/255),1<h.fillColor.a&&(h.fillColor.a=h.fillColor.a/255),h.fillColor=m._color.createColor(h.fillColor.r,h.fillColor.g,h.fillColor.b,h.fillColor.a))):style.fillColor&&"{}"!=style.fillColor.toString()&&(h.fillColor=d.fillColor.Value,m._core.isHtmlColor(h.fillColor)?h.fillColor=m._color.colorFromHtmlColor(h.fillColor):(/^rgb/.test(h.fillColor)&&(h.fillColor=m._color.rgbaStringToRgbaObj(h.fillColor)),1<h.fillColor.r&&(h.fillColor.r=h.fillColor.r/255),1<h.fillColor.g&&(h.fillColor.g=h.fillColor.g/255),1<h.fillColor.b&&(h.fillColor.b=h.fillColor.b/255),1<h.fillColor.a&&(h.fillColor.a=h.fillColor.a/255),h.fillColor=m._color.createColor(h.fillColor.r,h.fillColor.g,h.fillColor.b,h.fillColor.a)));if(d.outlineColor){if(/^\[/.test(d.outlineColor)&&/\]$/.test(d.outlineColor)){r=d.outlineColor.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,"");h.outlineColor=e.properties[r],m._core.isHtmlColor(h.outlineColor)?h.outlineColor=m._color.colorFromHtmlColor(h.outlineColor):(/^rgb/.test(h.outlineColor)&&(h.outlineColor=m._color.rgbaStringToRgbaObj(h.outlineColor)),1<h.outlineColor.r&&(h.outlineColor.r=h.outlineColor.r/255),1<h.outlineColor.g&&(h.outlineColor.g=h.outlineColor.g/255),1<h.outlineColor.b&&(h.outlineColor.b=h.outlineColor.b/255),1<h.outlineColor.a&&(h.outlineColor.a=h.outlineColor.a/255),h.outlineColor=m._color.createColor(h.outlineColor.r,h.outlineColor.g,h.outlineColor.b,h.outlineColor.a))}}else if(d.outlineColor&&d.outlineColor.Class instanceof Array)for(o=0;o<d.fillColor.Class.length;o++){if((s=(a=d.fillColor.Class[o]).Condition.replace("<","").replace(">","").split("="))[0]=s[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),s[1]=s[1].replace(/\"/,"").replace(/\"/,""),e.properties[s[0]]==s[1]){h.outlineColor=s.Value,m._core.isHtmlColor(h.outlineColor)?h.outlineColor=m._color.colorFromHtmlColor(h.outlineColor):(/^rgb/.test(h.outlineColor)&&(h.outlineColor=m._color.rgbaStringToRgbaObj(h.outlineColor)),1<h.outlineColor.r&&(h.outlineColor.r=h.outlineColor.r/255),1<h.outlineColor.g&&(h.outlineColor.g=h.outlineColor.g/255),1<h.outlineColor.b&&(h.outlineColor.b=h.outlineColor.b/255),1<h.outlineColor.a&&(h.outlineColor.a=h.outlineColor.a/255),h.outlineColor=m._color.createColor(h.outlineColor.r,h.outlineColor.g,h.outlineColor.b,h.outlineColor.a));break}}else d.outlineColor&&"{}"!=d.outlineColor.Class.toString()?(h.outlineColor=d.outlineColor.Value,m._core.isHtmlColor(h.outlineColor)?h.outlineColor=m._color.colorFromHtmlColor(h.outlineColor):(/^rgb/.test(h.outlineColor)&&(h.outlineColor=m._color.rgbaStringToRgbaObj(h.outlineColor)),1<h.outlineColor.r&&(h.outlineColor.r=h.outlineColor.r/255),1<h.outlineColor.g&&(h.outlineColor.g=h.outlineColor.g/255),1<h.outlineColor.b&&(h.outlineColor.b=h.outlineColor.b/255),1<h.outlineColor.a&&(h.outlineColor.a=h.outlineColor.a/255),h.outlineColor=m._color.createColor(h.outlineColor.r,h.outlineColor.g,h.outlineColor.b,h.outlineColor.a))):d.outlineColorTe&&"{}"!=d.outlineColor.toString()&&(h.outlineColor=d.outlineColor.Value,m._core.isHtmlColor(h.outlineColor)?h.outlineColor=m._color.colorFromHtmlColor(h.outlineColor):(/^rgb/.test(h.outlineColor)&&(h.outlineColor=m._color.rgbaStringToRgbaObj(h.outlineColor)),1<h.outlineColor.r&&(h.outlineColor.r=h.outlineColor.r/255),1<h.outlineColor.g&&(h.outlineColor.g=h.outlineColor.g/255),1<h.outlineColor.b&&(h.outlineColor.b=h.outlineColor.b/255),1<h.outlineColor.a&&(h.outlineColor.a=h.outlineColor.a/255),h.outlineColor=m._color.createColor(h.outlineColor.r,h.outlineColor.g,h.outlineColor.b,h.outlineColor.a)));if(d.backgroundColor){if(/^\[/.test(d.backgroundColor)&&/\]$/.test(d.backgroundColor)){r=d.backgroundColor.replace(/\[/,"").replace(/\]/,"");h.backgroundColor=e.properties[r],m._core.isHtmlColor(h.backgroundColor)?h.backgroundColor=m._color.colorFromHtmlColor(h.backgroundColor):(/^rgb/.test(h.backgroundColor)&&(h.backgroundColor=m._color.rgbaStringToRgbaObj(h.backgroundColor)),1<h.backgroundColor.r&&(h.backgroundColor.r=h.backgroundColor.r/255),1<h.backgroundColor.g&&(h.backgroundColor.g=h.backgroundColor.g/255),1<h.backgroundColor.b&&(h.backgroundColor.b=h.backgroundColor.b/255),1<h.backgroundColor.a&&(h.backgroundColor.a=h.backgroundColor.a/255),h.backgroundColor=m._color.createColor(h.backgroundColor.r,h.backgroundColor.g,h.backgroundColor.b,h.backgroundColor.a))}}else if(d.backgroundColor&&d.backgroundColor.Class instanceof Array)for(o=0;o<d.backgroundColor.Class.length;o++){if((s=(a=d.backgroundColor.Class[o]).Condition.replace("<","").replace(">","").split("="))[0]=s[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),s[1]=s[1].replace(/\"/,"").replace(/\"/,""),e.properties[s[0]]==s[1]){h.backgroundColor=getSGColor(s.Value),m._core.isHtmlColor(h.backgroundColor)?h.backgroundColor=m._color.colorFromHtmlColor(h.backgroundColor):(/^rgb/.test(h.backgroundColor)&&(h.backgroundColor=m._color.rgbaStringToRgbaObj(h.backgroundColor)),1<h.backgroundColor.r&&(h.backgroundColor.r=h.backgroundColor.r/255),1<h.backgroundColor.g&&(h.backgroundColor.g=h.backgroundColor.g/255),1<h.backgroundColor.b&&(h.backgroundColor.b=h.backgroundColor.b/255),1<h.backgroundColor.a&&(h.backgroundColor.a=h.backgroundColor.a/255),h.backgroundColor=m._color.createColor(h.backgroundColor.r,h.backgroundColor.g,h.backgroundColor.b,h.backgroundColor.a));break}}else d.backgroundColor&&"{}"!=d.backgroundColor.Class.toString()?(h.backgroundColor=getSGColor(d.backgroundColor.Value),m._core.isHtmlColor(h.backgroundColor)?h.backgroundColor=m._color.colorFromHtmlColor(h.backgroundColor):(/^rgb/.test(h.backgroundColor)&&(h.backgroundColor=m._color.rgbaStringToRgbaObj(h.backgroundColor)),1<h.backgroundColor.r&&(h.backgroundColor.r=h.backgroundColor.r/255),1<h.backgroundColor.g&&(h.backgroundColor.g=h.backgroundColor.g/255),1<h.backgroundColor.b&&(h.backgroundColor.b=h.backgroundColor.b/255),1<h.backgroundColor.a&&(h.backgroundColor.a=h.backgroundColor.a/255),h.backgroundColor=m._color.createColor(h.backgroundColor.r,h.backgroundColor.g,h.backgroundColor.b,h.backgroundColor.a))):d.backgroundColor&&"{}"!=d.backgroundColor.toString()&&(h.backgroundColor=d.backgroundColor.Value,m._core.isHtmlColor(h.backgroundColor)?h.backgroundColor=m._color.colorFromHtmlColor(h.backgroundColor):(/^rgb/.test(h.backgroundColor)&&(h.backgroundColor=m._color.rgbaStringToRgbaObj(h.backgroundColor)),1<h.backgroundColor.r&&(h.backgroundColor.r=h.backgroundColor.r/255),1<h.backgroundColor.g&&(h.backgroundColor.g=h.backgroundColor.g/255),1<h.backgroundColor.b&&(h.backgroundColor.b=h.backgroundColor.b/255),1<h.backgroundColor.a&&(h.backgroundColor.a=h.backgroundColor.a/255),h.backgroundColor=m._color.createColor(h.backgroundColor.r,h.backgroundColor.g,h.backgroundColor.b,h.backgroundColor.a)));if(d.scale){if(/^\[/.test(d.scale)&&/\]$/.test(d.scale)){r=d.scale.replace(/\[/,"").replace(/\]/,"");h.scale=e.properties[r]}}else if(d.scale&&d.scale.Class instanceof Array)for(o=0;o<d.scale.Class.length;o++){(s=(a=d.scale.Class[o]).Condition.replace("<","").replace(">","").split("="))[0]=s[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),s[1]=s[1].replace(/\"/,"").replace(/\"/,""),e.properties[s[0]]==s[1]&&(h.scale=a.Value)}else d.scale&&"{}"!=d.scale.Class.toString()?h.scale=d.scale.Value:d.scale&&"[object Object]"!=d.scale.toString()&&"{}"!=d.scale.toString()&&(h.scale=d.scale);if(/^\[/.test(d.text)&&/\]$/.test(d.text)||d.textTe)if(d.textTe)if(d.text.Class instanceof Object){var n=d.text.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,"");h.text=e.properties[n]}else if(d.text&&d.text.Class&&"{}"!=d.text.Class.toString()){r=d.text.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,"");h.text=e.properties[r]}else{r=d.text.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,"");h.text=e.properties[r]}else if(d.text&&"[object Object]"!=d.text.toString()&&"{}"!=d.text.toString())h.text=d.text;else{r=d.text.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,"");h.text=e.properties[r]}else d.text&&"[object Object]"!=d.text.toString()&&"{}"!=d.text.toString()&&(h.text=d.text);if(h.labelData&&(h=m._core.extend(h,h.labelData,!0)),h.verticalOrigin=Cesium.VerticalOrigin.CENTER,h.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,u&&u.add(h),d.image&&d.image.Class instanceof Array)for(o=0;o<d.image.Class.length;o++){var a,s;if((s=(a=d.image.Class[o]).Condition.replace("<","").replace(">","").split("="))[0]=s[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),s[1]=s[1].replace(/\"/,"").replace(/\"/,""),e.properties[s[0]]==s[1]){h.image=a.Value;break}}else if(d.image&&d.image.Class&&"{}"!=d.image.Class.toString()){r=d.image.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,"");h.image=e.properties[r]}else d.image&&"[object Object]"!=d.image.toString()&&"{}"!=d.image.toString()&&(h.image=d.image);var l=p.cloneDeep(h);l.verticalOrigin=Cesium.VerticalOrigin.CENTER,l.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,c&&c.add(l)}),0==e.features.length&&(r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0),r.data.geometryPrimitive=t||(c||u),r.state===Cesium.QuadtreeTileLoadState.LOADING&&(r.data.geometryPrimitive.update(i,[]),r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0)},error:function(){r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0}}),r.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var l=this._viewer.scene,u=l.primitives;d&&d.time&&(this._Provider._availability=new m._cesium.TimeIntervalCollection([new m._cesium.TimeInterval({start:d.time.start?m._cesium.JulianDate.fromDate(new Date(d.time.start)):m._cesium.Iso8601.MINIMUM_VALUE,stop:d.time.end?m._cesium.JulianDate.fromDate(new Date(d.time.end)):m._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),u.add(this._primitive),l.primitivesQuadTrees&&l.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var c={id:d.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:d};return this._Provider.treeID=d.id,this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},t.prototype.createSXTLabelGeoJsonFeatureLayerProvider=function(e,t,m,i,r,o){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},a=this,p=(m.material,{show:!0,position:a._cesium.Cartesian3.ZERO,pixelOffset:a._cesium.Cartesian2.ZERO,eyeOffset:a._cesium.Cartesian3.ZERO,heightReference:a._cesium.HeightReference.NONE,horizontalOrigin:a._cesium.HorizontalOrigin.CENTER,verticalOrigin:a._cesium.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:a._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:a._cesium.Cartesian3.ZERO,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0});m.width&&(p.width=m.width),m.height&&(p.height=m.height),m.image&&(p.image=m.image),this._urlTemplate=t.url+"?"+this._core._serialize(n.urlParams);var s=t.url+"?"+this._core._serialize(n.urlParams);this._Provider=new g(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider._minimumHeight=parseFloat(m.height)||0,this._Provider.loadTile=function(h,d){if(d.state===Cesium.QuadtreeTileLoadState.START){if(d.data={lines:[],geometryPrimitive:void 0},!(d.level>=m.level_min&&d.level<=m.level_max&&a.item.show))return d.state=Cesium.QuadtreeTileLoadState.DONE,void(d.renderable=!0);var e=s.replace(window.encodeURIComponent("{x}"),d.x).replace(window.encodeURIComponent("{y}"),d.y).replace(window.encodeURIComponent("{z}"),d.level);a._cache&&(e+="&"+a._core.getuid()),a._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return d.state=Cesium.QuadtreeTileLoadState.DONE,void(d.renderable=!0);var t;if(d.level==parseInt(m.level_max)-1)"function"==typeof initSXTData&&(t=initSXTData(e));else{t=new Cesium.BillboardCollection;var i=!0,r=!1,o=void 0;try{for(var n,a=e.features[Symbol.iterator]();!(i=(n=a.next()).done);i=!0){var s=n.value,l=s.geometry.coordinates[0],u=s.geometry.coordinates[1],c=m.pointHeight?parseFloat(m.pointHeight):0;p.position=Cesium.Cartesian3.fromDegrees(l,u,c),t.add(p)}}catch(e){r=!0,o=e}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}}0==e.features.length&&(d.state=Cesium.QuadtreeTileLoadState.DONE,d.renderable=!0),d.data.geometryPrimitive=t,d.state=Cesium.QuadtreeTileLoadState.LOADING,d.state===Cesium.QuadtreeTileLoadState.LOADING&&"function"==typeof d.data.geometryPrimitive.update?(d.data.geometryPrimitive.update(h,[]),d.state=Cesium.QuadtreeTileLoadState.DONE,d.renderable=!0):(d.data.geometryPrimitive.destroy=function(){},d.data.geometryPrimitive.update=function(){})},error:function(){null==d.count&&(d.count=0),d.count+=1,2<=d.count?(d.state=Cesium.QuadtreeTileLoadState.DONE,d.renderable=!0):d.state=Cesium.QuadtreeTileLoadState.START}}),d.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var l=this._viewer.scene,u=l.primitives;m&&m.time&&(this._Provider._availability=new a._cesium.TimeIntervalCollection([new a._cesium.TimeInterval({start:m.time.start?a._cesium.JulianDate.fromDate(new Date(m.time.start)):a._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?a._cesium.JulianDate.fromDate(new Date(m.time.end)):a._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),u.add(this._primitive),l.primitivesQuadTrees&&l.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var c={id:m.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:m};return this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},t.prototype.createCustomCallbackGeoJsonFeatureLayerProvider=function(e,t,o,i,r,n,a){var s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},l=this,u=(o.material,{show:!0,position:l._cesium.Cartesian3.ZERO,pixelOffset:l._cesium.Cartesian2.ZERO,eyeOffset:l._cesium.Cartesian3.ZERO,heightReference:l._cesium.HeightReference.NONE,horizontalOrigin:l._cesium.HorizontalOrigin.CENTER,verticalOrigin:l._cesium.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:l._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:l._cesium.Cartesian3.ZERO,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0});o.width&&(u.width=o.width),o.height&&(u.height=o.height),o.image&&(u.image=o.image),this._urlTemplate=t.url+"?"+this._core._serialize(s.urlParams);var c=t.url+"?"+this._core._serialize(s.urlParams);this._Provider=new g(this._viewer,this._cesium),this._Provider._normalTile=o.level_max-1,this._Provider._minimumHeight=parseFloat(o.height)||0,this._Provider.loadTile=function(i,r){if(r.state===Cesium.QuadtreeTileLoadState.START){if(r.data={lines:[],geometryPrimitive:void 0},!(r.level>=o.level_min&&r.level<=o.level_max&&l.item.show))return r.state=Cesium.QuadtreeTileLoadState.DONE,void(r.renderable=!0);var e=c.replace(window.encodeURIComponent("{x}"),r.x).replace(window.encodeURIComponent("{y}"),r.y).replace(window.encodeURIComponent("{z}"),r.level);l._cache&&(e+="&"+l._core.getuid()),l._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return r.state=Cesium.QuadtreeTileLoadState.DONE,void(r.renderable=!0);var t;"function"==typeof n&&(t=n(e)),0==e.features.length&&(r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0),r.data.geometryPrimitive=t,r.state=Cesium.QuadtreeTileLoadState.LOADING,r.state===Cesium.QuadtreeTileLoadState.LOADING&&"function"==typeof r.data.geometryPrimitive.update?(r.data.geometryPrimitive.update(i,[]),r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0):(r.data.geometryPrimitive.destroy=function(){},r.data.geometryPrimitive.update=function(){})},error:function(){null==r.count&&(r.count=0),r.count+=1,2<=r.count?(r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0):r.state=Cesium.QuadtreeTileLoadState.START}}),r.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var h=this._viewer.scene,d=h.primitives;o&&o.time&&(this._Provider._availability=new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:o.time.start?l._cesium.JulianDate.fromDate(new Date(o.time.start)):l._cesium.Iso8601.MINIMUM_VALUE,stop:o.time.end?l._cesium.JulianDate.fromDate(new Date(o.time.end)):l._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),d.add(this._primitive),h.primitivesQuadTrees&&h.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(o.id)&&(o.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+o.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var m={id:o.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:o};return this.setTreeobj(m),this._tree.insertGroupId(m,this._core.isnull(i)?0:i),"function"==typeof a&&a(this.item),this},t.prototype.createLabelRichtextGeoJsonFeatureLayerProvider=function(e,t,f,i,v,_){null==t&&console.log("geojson is required");var r=this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(r);var y=this,C=new this._cesium.PointPrimitiveCollection;y.optiontext=[],r.then(function(e){for(var t,i=(y.item=e).entities.values,r=0;r<i.length;r++){var o,n=i[r];if(/^\[/.test(f.text)&&/\]$/.test(f.text)){var a=f.text.replace(/\[/,"").replace(/\]/,"");o=n.properties[a]._value}else o=f.text;y.optiontext.push(o),n.billboard=void 0;y._viewer.scene.globe.ellipsoid;var s,l=y._cesium.Cartographic.fromCartesian(n.position._value),u=[y._cesium.Math.toDegrees(l.longitude),y._cesium.Math.toDegrees(l.latitude),l.height+(f.pointHeight||0)],c=y._core.getuid();u instanceof Array?2===u.length?s=y._cesium.Cartesian3.fromDegrees(u[0],u[1]):3===u.length&&(s=y._cesium.Cartesian3.fromDegrees(u[0],u[1],u[2])):s=u.z?y._cesium.Cartesian3.fromDegrees(u.x,u.y,u.z):y._cesium.Cartesian3.fromDegrees(u.x,u.y);var h="DivPoint"+c;C.add({id:h,position:s,color:y._cesium.Color.YELLOW,description:f.text})}f&&f.time&&(t=new y._cesium.TimeIntervalCollection([new y._cesium.TimeInterval({start:f.time.start?y._cesium.JulianDate.fromDate(new Date(f.time.start)):y._cesium.Iso8601.MINIMUM_VALUE,stop:f.time.end?y._cesium.JulianDate.fromDate(new Date(f.time.end)):y._cesium.Iso8601.MAXIMUM_VALUE})])),y.item=C,y.pointPrimitive=y._viewer.scene.primitives.add(C,t);var d,m,p,g=!0;y.pointPrimitive.update=function(){for(var e,t,i=0;i<y.pointPrimitive.length;i++){if(e=y.pointPrimitive.get(i),p=e.position,!(m=y._viewer.scene.cartesianToCanvasCoordinates(p)))return;(d=document.getElementById(e.id))||(t='<div id="'+e.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+w.divpoint1+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">'+y.optiontext[i]+"</div>\n </div>",$(".cesium-viewer").append(t),d=document.getElementById(e.id)),e.description?d.style.transform="matrix(1, 0, 0, 1, "+m.x+", "+(m.y-157)+")":d.style.transform="matrix(1, 0, 0, 1, "+m.x+", "+(m.y-134)+")",d&&(d.style.display=y.pointPrimitive.show?"block":"none")}g&&(v||y.setVisibility(!1),g=!1)},"function"==typeof _&&_(e)}),this._core.isnull(f.id)&&(f.id=this._core.getuid()),this._core.isnull(e)&&(e="富文本");var o={id:f.id,name:e,checked:v,pId:this._core.isnull(i)?0:i,type:"DivPoint",item:this,url:t,style:f};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},t.prototype.createLabelRichtextGeoJsonFeatureLayerProviderLayer=function(e,t,l,i,u,r){var o={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},c=this,n=new s(this._viewer,this._cesium,o);(this._Provider=n)._loadTile=function(e){var r,o,n,a=new c._cesium.PointPrimitiveCollection;c.optiontext=[],e.features.forEach(function(e){var t=options.pointHeight;if(null!=e.properties.height&&(t=parseFloat(e.properties.height)+t),/^\[/.test(options.pointHeight)&&/\]$/.test(options.pointHeight)){var i=options.pointHeight.replace(/\[/,"").replace(/\]/,"");t=parseFloat(e.properties[i])}if(l.position=new c._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),/^\[/.test(l.text)&&/\]$/.test(l.text)){var r=l.text.replace(/\[/,"").replace(/\]/,"");l.text=e.properties[r]}var o="DivPoint"+c._core.getuid();a.add({id:o,position:Cartesian3,color:c._cesium.Color.YELLOW,description:l.text}),c.optiontext.push(option.text)}),c.pointPrimitive=c._viewer.scene.primitives.add(a);var s=!0;return c.pointPrimitive.update=function(){for(var e,t,i=0;i<c.pointPrimitive.length;i++){if(e=c.pointPrimitive.get(i),n=e.position,!(o=c._viewer.scene.cartesianToCanvasCoordinates(n)))return;(r=document.getElementById(e.id))||(t='<div id="'+e.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+w.divpoint1+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">'+c.optiontext[i]+"</div>\n </div>",$(".cesium-viewer").append(t),r=document.getElementById(e.id)),e.description?r.style.transform="matrix(1, 0, 0, 1, "+o.x+", "+(o.y-157)+")":r.style.transform="matrix(1, 0, 0, 1, "+o.x+", "+(o.y-134)+")"}s&&(u||c.setVisibility(!1),s=!1)},c.item=a,""},n.addTo(this._viewer),u||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="富文本"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var a={id:l.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"DivPoint",item:this,url:t.url,style:l};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},t.prototype.createModelGeoJsonFeatureLayerProvider=function(e,t,u,i,r,o){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},c=this;u.material;c._core.isnull(u)||c._core.isnull(u.color)||/^\[/.test(u.color)&&"["==u.color.toString().charAt(0)&&"]"==u.color.toString().charAt(u.color.length-1)||(c._core.isHtmlColor(u.color)?u.color=c._color.colorFromHtmlColor(u.color):(/^rgb/.test(u.color)&&(u.color=c._color.rgbaStringToRgbaObj(u.color)),1<u.color.r&&(u.color.r=u.color.r/255),1<u.color.g&&(u.color.g=u.color.g/255),1<u.color.b&&(u.color.b=u.color.b/255),1<u.color.a&&(u.color.a=u.color.a/255),u.color=c._color.createColor(u.color.r,u.color.g,u.color.b,u.color.a))),this._urlTemplate=t.url+"?"+this._core._serialize(n.urlParams);var a=t.url+"?"+this._core._serialize(n.urlParams);this._Provider=new g(this._viewer,this._cesium),this._Provider._normalTile=u.level_max-1,this._Provider._minimumHeight=parseFloat(u.height)||0,this._Provider.loadTile=function(s,l){if(l.state===Cesium.QuadtreeTileLoadState.START){if(l.data={lines:[],geometryPrimitive:void 0},!(l.level>=u.level_min&&l.level<u.level_max&&c.item.show))return l.state=Cesium.QuadtreeTileLoadState.DONE,void(l.renderable=!0);var e=a.replace(window.encodeURIComponent("{x}"),l.x).replace(window.encodeURIComponent("{y}"),l.y).replace(window.encodeURIComponent("{z}"),l.level);c._cache&&(e+="&"+c._core.getuid()),c._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return l.state=Cesium.QuadtreeTileLoadState.DONE,void(l.renderable=!0);var t={url:"",modelMatrix:c._cesium.Transforms.eastNorthUpToFixedFrame(origin),color:c._cesium.Color.DARKSALMON,scale:2},o=c._core.extend(t,u,!0);c._core.isnull(u.near)&&(u.near=0),c._core.isnull(u.far)&&(u.far=999999999);var i=parseFloat(u.near),r=parseFloat(u.far),n=new c._cesium.DistanceDisplayCondition(i,r);o.distanceDisplayCondition=n;var a=new c._cesium.PrimitiveCollection;e.features.forEach(function(e){o.id=e;var t=o.height;if(null!=e.properties.height&&(t=parseFloat(e.properties.height)),/^\[/.test(o.height)&&/\]$/.test(o.height)){var i=o.height.replace(/\[/,"").replace(/\]/,"");t=parseFloat(e.properties[i])}o.modelMatrix=c._cesium.Transforms.eastNorthUpToFixedFrame(c._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t));var r=c._cesium.Model.fromGltf({id:e,url:o.uri,color:o.color,modelMatrix:o.modelMatrix,scale:o.scale,heightReference:parseInt(o.heightReference),distanceDisplayCondition:o.distanceDisplayCondition});a.add(r)}),0==e.features.length&&(l.state=Cesium.QuadtreeTileLoadState.DONE,l.renderable=!0),l.data.geometryPrimitive=a,l.state=Cesium.QuadtreeTileLoadState.LOADING,l.state===Cesium.QuadtreeTileLoadState.LOADING&&(l.data.geometryPrimitive.update(s,[]),l.state=Cesium.QuadtreeTileLoadState.DONE,l.renderable=!0)},error:function(){null==l.count&&(l.count=0),l.count+=1,2<=l.count?(l.state=Cesium.QuadtreeTileLoadState.DONE,l.renderable=!0):l.state=Cesium.QuadtreeTileLoadState.START}}),l.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var s=this._viewer.scene;s.primitives.add(this._primitive),s.primitivesQuadTrees&&s.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var l={id:u.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:u};return this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},t.prototype.createPointGeoJsonFeatureLayerProvider=function(e,t,u,i,r,o){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},c=this;c._core.isnull(u)||c._core.isnull(u.color)||/^\[/.test(u.color)&&"["==u.color.toString().charAt(0)&&"]"==u.color.toString().charAt(u.color.length-1)||(c._core.isHtmlColor(u.color)?u.color=c._color.colorFromHtmlColor(u.color):(/^rgb/.test(u.color)&&(u.color=c._color.rgbaStringToRgbaObj(u.color)),1<u.color.r&&(u.color.r=u.color.r/255),1<u.color.g&&(u.color.g=u.color.g/255),1<u.color.b&&(u.color.b=u.color.b/255),1<u.color.a&&(u.color.a=u.color.a/255),u.color=c._color.createColor(u.color.r,u.color.g,u.color.b,u.color.a))),c._core.isnull(u)||c._core.isnull(u.outlineColor)||/^\[/.test(u.outlineColor)&&"["==u.outlineColor.toString().charAt(0)&&"]"==u.outlineColor.toString().charAt(u.outlineColor.length-1)||(c._core.isHtmlColor(u.outlineColor)?u.outlineColor=c._color.colorFromHtmlColor(u.outlineColor):(/^rgb/.test(u.outlineColor)&&(u.outlineColor=c._color.rgbaStringToRgbaObj(u.outlineColor)),1<u.outlineColor.r&&(u.outlineColor.r=u.outlineColor.r/255),1<u.outlineColor.g&&(u.outlineColor.g=u.outlineColor.g/255),1<u.outlineColor.b&&(u.outlineColor.b=u.outlineColor.b/255),1<u.outlineColor.a&&(u.outlineColor.a=u.outlineColor.a/255),u.outlineColor=c._color.createColor(u.outlineColor.r,u.outlineColor.g,u.outlineColor.b,u.outlineColor.a))),this._urlTemplate=t.url+"?"+this._core._serialize(n.urlParams);var a=t.url+"?"+this._core._serialize(n.urlParams);this._Provider=new g(this._viewer,this._cesium),this._Provider._normalTile=u.level_max-1,this._Provider._minimumHeight=parseFloat(u.height)||0,this._Provider.loadTile=function(n,l){if(l.state===Cesium.QuadtreeTileLoadState.START){if(l.data={lines:[],geometryPrimitive:void 0},!(l.level>=u.level_min&&l.level<u.level_max&&c.item.show))return l.state=Cesium.QuadtreeTileLoadState.DONE,void(l.renderable=!0);var e=a.replace(window.encodeURIComponent("{x}"),l.x).replace(window.encodeURIComponent("{y}"),l.y).replace(window.encodeURIComponent("{z}"),l.level);c._cache&&(e+="&"+c._core.getuid()),c._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return l.state=Cesium.QuadtreeTileLoadState.DONE,void(l.renderable=!0);var t={Name:"",text:"",font:" 30px sans-serif",pixelSize:10,style:c._cesium.LabelStyle.OUTLINE,fillColor:c._cesium.Color.WHITE,outlineColor:c._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new c._cesium.Color(.165,.165,.165,.8),backgroundPadding:new c._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:c._cesium.HorizontalOrigin.CENTER,verticalOrigin:c._cesium.VerticalOrigin.CENTER,eyeOffset:c._cesium.Cartesian3.ZERO,pixelOffset:c._cesium.Cartesian2.ZERO,heightReference:c._cesium.HeightReference.NONE,scaleByDistance:new c._cesium.NearFarScalar(0,0,1,1)};u.material;c._core.isnull(u)||c._core.isnull(u.backgroundColor)||/^\[/.test(u.backgroundColor)&&"["==u.backgroundColor.toString().charAt(0)&&"]"==u.backgroundColor.toString().charAt(u.backgroundColor.length-1)||(c._core.isHtmlColor(u.backgroundColor)?u.backgroundColor=c._color.colorFromHtmlColor(u.backgroundColor):(/^rgb/.test(u.backgroundColor)&&(u.backgroundColor=c._color.rgbaStringToRgbaObj(u.backgroundColor)),1<u.backgroundColor.r&&(u.backgroundColor.r=u.backgroundColor.r/255),1<u.backgroundColor.g&&(u.backgroundColor.g=u.backgroundColor.g/255),1<u.backgroundColor.b&&(u.backgroundColor.b=u.backgroundColor.b/255),1<u.backgroundColor.a&&(u.backgroundColor.a=u.backgroundColor.a/255),u.backgroundColor=c._color.createColor(u.backgroundColor.r,u.backgroundColor.g,u.backgroundColor.b,u.backgroundColor.a)));var a=c._core.extend(t,u,!0);c._core.isnull(u.near)&&(u.near=0),c._core.isnull(u.far)&&(u.far=999999999);var i=parseFloat(u.near),r=parseFloat(u.far),o=new c._cesium.DistanceDisplayCondition(i,r);a.distanceDisplayCondition=o,c._core.isnull(u.font_size)&&(u.font_size="30px"),c._core.isnull(u.font_family)&&(u.font_family=" sans-serif"),a.font=parseFloat(u.font_size)+"px "+u.font_family;var s=new c._cesium.PointPrimitiveCollection;e.features.forEach(function(e){a.id=e;var t=0;if(/^\[/.test(a.pointHeight)&&/\]$/.test(a.pointHeight)){var i=a.pointHeight.replace(/\[/,"").replace(/\]/,"");t=parseFloat(e.properties[i])}else void 0!==a.pointHeight&&""!==a.pointHeight?t=parseFloat(a.pointHeight):null!=e.properties.height&&(t=parseFloat(e.properties.height));if(/^\[/.test(u.color)&&/\]$/.test(u.color)){var r=u.color.replace(/\[/,"").replace(/\]/,"");a.color=e.properties[r],c._core.isHtmlColor(a.color)?a.color=c._color.colorFromHtmlColor(a.color):(/^rgb/.test(a.color)&&(a.color=c._color.rgbaStringToRgbaObj(a.color)),1<a.color.r&&(a.color.r=a.color.r/255),1<a.color.g&&(a.color.g=a.color.g/255),1<a.color.b&&(a.color.b=a.color.b/255),1<a.color.a&&(a.color.a=a.color.a/255),a.color=c._color.createColor(a.color.r,a.color.g,a.color.b,a.color.a))}if(/^\[/.test(u.outlineColor)&&/\]$/.test(u.outlineColor)){r=u.outlineColor.replace(/\[/,"").replace(/\]/,"");a.outlineColor=e.properties[r],c._core.isHtmlColor(a.outlineColor)?a.outlineColor=c._color.colorFromHtmlColor(a.outlineColor):(/^rgb/.test(a.outlineColor)&&(a.outlineColor=c._color.rgbaStringToRgbaObj(a.outlineColor)),1<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor=c._color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a))}a.position=new c._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),a.text=e.properties.name;var o={show:a.show,position:a.position,pixelSize:a.pixelSize,color:a.color,outlineColor:a.outlineColor,outlineWidth:a.outlineWidth,id:e},n="color:"+255*a.color.red+","+255*a.color.green+","+255*a.color.blue+";outlineColor:"+255*a.outlineColor.red+","+255*a.outlineColor.green+","+255*a.outlineColor.blue;c.Legend.push(n),s.add(o)}),0==e.features.length&&(l.state=Cesium.QuadtreeTileLoadState.DONE,l.renderable=!0),l.data.geometryPrimitive=s,l.state=Cesium.QuadtreeTileLoadState.LOADING,l.state===Cesium.QuadtreeTileLoadState.LOADING&&(l.data.geometryPrimitive.update(n,[]),l.state=Cesium.QuadtreeTileLoadState.DONE,l.renderable=!0)},error:function(){null==l.count&&(l.count=0),l.count+=1,2<=l.count?(l.state=Cesium.QuadtreeTileLoadState.DONE,l.renderable=!0):l.state=Cesium.QuadtreeTileLoadState.START}}),l.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var s=this._viewer.scene;s.primitives.add(this._primitive),s.primitivesQuadTrees&&s.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var l={id:u.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:u};return this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},t.prototype.setTreeobj=function(e){this.treeobj=e},t.prototype.getLegend=function(){var e=[];return null!=this.Legend&&(e=this._core.unique(this.Legend)),e},t.prototype.deleteObject=function(){if(this._viewer.scene.primitives.remove(this.item),this.probj&&0<this.probj.length&&(this._viewer.scene.primitives.remove(this.probj[0]),this.probj.pop()),null!=this.img&&this._viewer.imageryLayers.remove(this.img),this.primitve&&0<this.primitve.length){for(var e=0;e<this.primitve.length;e++)this._viewer.scene.primitives.remove(this.primitve[e]);this.primitve=[]}this.loadAllKey&&0<this.loadAllKey.length&&(this.loadAllKey=[]);try{this._Provider.remove()}catch(e){}if(null!=this._Provider&&this._Provider.setStatus(!1),null!=this.items&&null!=this.items&&0<this.items.length)for(e=0;e<this.items.length;e++)this._viewer.scene.primitives.remove(this.items[e]);else this._viewer.scene.primitives.remove(this.item);if(this.treeobj&&"DivPoint"===this.treeobj.type&&this.item&&null!=this.item._pointPrimitives&&null!=this.item._pointPrimitives)for(e=0;e<this.item._pointPrimitives.length;e++){var t=document.getElementById(this.item._pointPrimitives[e].id);t&&t.remove()}try{this._Provider.remove()}catch(e){}},t.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},t.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(!e)}catch(e){}},t.prototype.setVisibility=function(e){try{if(this.loadAllKey=[],null!=this.item&&null!=this.item.show&&(this.item.show=e),null!=this.img&&(this.img.show=e),this.primitve&&0<this.primitve.length)for(var t=0;t<this.primitve.length;t++)this.primitve[t].show=e;if(this._Provider&&this._Provider.setStatus&&void 0!==this._Provider._state&&this._Provider.setStatus(e),this._Provider&&this._Provider.EntityCollection&&(this._Provider.EntityCollection.show=e),this.probj&&0<this.probj.length)for(t=0;t<this.probj.length;t++)this.probj[t].show=e}catch(e){}if(null!=this.treeobj&&"DivPoint"===this.treeobj.type&&this.item&&null!=this.item._pointPrimitives&&null!=this.item._pointPrimitives)for(t=0;t<this.item._pointPrimitives.length;t++){var i=document.getElementById(this.item._pointPrimitives[t].id);i&&(i.style.display=e?"block":"none")}null!=this.item&&(this.item.show=e),this._Provider&&void 0!==this._Provider._stop&&this._Provider.setStatus(!e)},t.prototype.edit=function(e,t){return this.isEditting=e,this.editoption=t,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},t.prototype.forceRefresh=function(){try{this._cache=!0,this._forceRefreshPrvimitive||(this._forceRefreshPrvimitive=p.cloneDeep(this._primitive));var e=p.cloneDeep(this._forceRefreshPrvimitive);this._viewer.scene.primitives.remove(this._primitive),this._viewer.scene.primitives.add(e),this.edit(this.isEditting,this.editoption)}catch(e){}},Object.defineProperties(t.prototype,{labelText:{set:p.debounce(function(e){var t=e;if(!this._core.isnull(e)){var i=this.item.entities&&this.item.entities.values;if(i&&0<i.length)for(var r=0;r<i.length;r++)if(/^\[/.test(e)&&(t=e.replace(/\[/,"").replace(/\]/,""),t=i[r].properties[t]._value),i[r].label){i[r].label.text=t;try{i[r].point.show=!1}catch(e){}}else{try{i[r].point.show=!1}catch(e){}i[r].label=new this._cesium.LabelGraphics({text:t,font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})}}},500)},labelStyles:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.style=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?e[0].label.style:void 0}},labelFont:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if(e=e.toString().replace(/px/g,""),!t||/^point.fid/.test(t[0]._id)||null!=t[0].label){var i=t[0].label.font,r=16;if(i&&(r=(i=i._value.trimLeft().trimRight()).split("px")[0]),t&&0<t.length&&t[0].label)for(var o=0;o<t.length;o++)t[o].label.font=r+"px "+e}}},500)},labelFontSize1:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if(e=e.toString().replace(/px/g,""),!t||/^point.fid/.test(t[0]._id)||null!=t[0].label){var i=t[0].label.font,r="sans-serif";if(i&&(r=(i=i._value.trimLeft().trimRight()).split("px")[1]),t&&0<t.length&&t[0].label)for(var o=0;o<t.length;o++)t[o].label.font=e+"px "+r}}},500)},labelFontSize:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if(e=e.toString().replace(/px/g,""),(!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.font=e+"px sans-serif"}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?parseFloat(e[0].label.font):void 0}},labelFillColor:{set:p.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.fillColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.fillColor;return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}}},labelOutlineColor:{set:p.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.outlineColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.outlineColor;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},labelOutlineWidth:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].label.outlineWidth=e}},200),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.outlineWidth;return t?t._value:void 0}}},labelBackgroundColor:{set:p.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.backgroundColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.backgroundColor;return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}}},labelBackground:{set:p.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.showBackground=e},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?e[0].label.background:void 0}},labelScale:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].label.scale=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.scale;return t?t._value:void 0}}},labelHorizontalOrigin:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.horizontalOrigin=parseInt(e)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.horizontalOrigin;return t?t._value:void 0}}},labelVerticalOrigin:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.verticalOrigin=parseInt(e)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.verticalOrigin;return t?t._value:void 0}}},labelHeightReference:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){var t=e[0].label.heightReference;return t?t._value:void 0}}},labelDistanceDisplayMaxCondition:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=t[0].label.distanceDisplayCondition?t[0].label.distanceDisplayCondition._value.near:0,r=0;r<t.length;r++)t[r].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,parseInt(e)),t[r].label.scaleByDistance=new this._cesium.NearFarScalar(i,1,parseInt(e),0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&(e&&0<e.length&&e[0].label))return e[0].label.distanceDisplayCondition?e[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE}},labelDistanceDisplayMinCondition:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=t[0].label.distanceDisplayCondition?t[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE,r=0;r<t.length;r++)t[r].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(parseInt(e),i),t[r].label.scaleByDistance=new this._cesium.NearFarScalar(parseInt(e),1,i,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&(e&&0<e.length&&e[0].label))return e[0].label.distanceDisplayCondition?e[0].label.distanceDisplayCondition._value.near:0}},labelHeight:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var r=this._cesium.Cartographic.fromCartesian(t[i].position._value),o=this._cesium.Math.toDegrees(r.longitude),n=this._cesium.Math.toDegrees(r.latitude),a=this._cesium.Cartesian3.fromDegrees(o,n,e);t[i].position=a}}},500),get:function(){return 0}},labelShow:{set:p.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].label&&e?(t[i].point&&(t[i].point.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e),t[i].label=new this._cesium.LabelGraphics({text:"label",font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})):(t[i].label&&(t[i].label.show=e),t[i].point&&(t[i].point.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?e[0].label.show:void 0}},modelShow:{set:p.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)t[i].label&&(t[i].label.show=!e),t[i].point&&(t[i].point.show=!e),t[i].billboard&&(t[i].billboard.show=!e),!t[i].model&&e?t[i].model=new this._cesium.ModelGraphics({show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE}):(t[i].model&&(t[i].model.show=e),t[i].label&&(t[i].label.show=!e),t[i].point&&(t[i].point.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)return e&&0<e.length&&e[0].model?e[0].model.show:void 0}},modelUri:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length)for(var i=0;i<t.length;i++)if(t[i].model)t[i].model.uri=e;else{if(/^\[/.test(e)){var r=e.split("[");e=1<r.length?r[0]+r[1].replace(/\[/,"").replace(/\]/,""):(e=e.replace(/\[/,"").replace(/\]/,""),t[i].properties[e])}t[i].model=new this._cesium.ModelGraphics({uri:e,show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE})}}},500)},modelScale:{set:p.debounce(function(e){if(!this._core.isnull(e)){e=parseFloat(e);var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].model.scale=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){var t=e[0].model.scale;return t?t._value:void 0}}},modelShadows:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.shadows=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)return e&&0<e.length&&e[0].model?e[0].model.shadows:void 0}},modelHeightReference:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){var t=e[0].model.heightReference;return t?t._value:void 0}}},modelDistanceDisplayMaxCondition:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=t[0].model.distanceDisplayCondition?t[0].model.distanceDisplayCondition._value.near:0,r=0;r<t.length;r++)t[r].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model)e[0].model.distanceDisplayCondition?e[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE}},modelDistanceDisplayMinCondition:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=t[0].model.distanceDisplayCondition?t[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE,r=0;r<t.length;r++)t[r].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&(e&&0<e.length&&e[0].model))return e[0].model.distanceDisplayCondition?e[0].model.distanceDisplayCondition._value.near:0}},modelColor:{set:p.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.color=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){var t=e[0].model.color;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},modelLightColor:{set:p.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.lightColor=e}},100),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){var t=e[0].model.lightColor;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},modelHeight:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var r=this._cesium.Cartographic.fromCartesian(t[i].position._value),o=this._cesium.Math.toDegrees(r.longitude),n=this._cesium.Math.toDegrees(r.latitude),a=this._cesium.Cartesian3.fromDegrees(o,n,e);t[i].position=a}}},500),get:function(){return 0}},pointColor:{set:p.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.color=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){var t=e[0].point.color;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},pointShow:{set:p.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].point&&e?(t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e),t[i].point=new this._cesium.PointGraphics({color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0})):(t[i].point&&(t[i].point.show=e),t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)return e&&0<e.length&&e[0].point?e[0].point.show:void 0}},pointPixelSize:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].point.pixelSize=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){var t=e[0].point.pixelSize;return t?t._value:void 0}}},pointOutlineColor:{set:p.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.outlineColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){var t=e[0].point.outlineColor;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},pointOutlineWidth:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].point.outlineWidth=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){var t=e[0].point.outlineWidth;return t?t._value:void 0}}},pointHeightReference:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){var t=e[0].point.heightReference;return t?t._value:void 0}}},pointDistanceDisplayMaxCondition:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=t[0].point.distanceDisplayCondition?t[0].point.distanceDisplayCondition._value.near:0,r=0;r<t.length;r++)t[r].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e),t[r].point.scaleByDistance=new this._cesium.NearFarScalar(i,1,e,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&(e&&0<e.length&&e[0].point))return e[0].point.distanceDisplayCondition?e[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE}},pointDistanceDisplayMinCondition:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=t[0].point.distanceDisplayCondition?t[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE,r=0;r<t.length;r++)t[r].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i),t[r].point.scaleByDistance=new this._cesium.NearFarScalar(e,1,i,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&(e&&0<e.length&&e[0].point))return e[0].point.distanceDisplayCondition?e[0].point.distanceDisplayCondition._value.near:0}},pointHeight:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var r=this._cesium.Cartographic.fromCartesian(t[i].position._value),o=this._cesium.Math.toDegrees(r.longitude),n=this._cesium.Math.toDegrees(r.latitude),a=this._cesium.Cartesian3.fromDegrees(o,n,e);t[i].position=a}}},500),get:function(){return 0}},billboardShow:{set:p.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].billboard&&e?(t[i].point&&(t[i].point.show=!e),t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard=new this._cesium.BillboardGraphics({show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})):(t[i].billboard&&(t[i].billboard.show=e),t[i].point&&(t[i].point.show=!e),t[i].label&&(t[i].label.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)return e&&0<e.length&&e[0].billboard?e[0].billboard.show:void 0}},billboardImage:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length)for(var i=0;i<t.length;i++){if(/^\[/.test(e)){var r=e.split("[");e=1<r.length?r[0]+r[1].replace(/\[/,"").replace(/\]/,""):(e=e.replace(/\[/,"").replace(/\]/,""),t[i].properties[e])}t[i].billboard?t[i].billboard.image=e:t[i].billboard=new this._cesium.BillboardGraphics({image:e,show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})}}},500)},billboardScale:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.scale=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){var t=e[0].billboard.scale;return t?t._value:void 0}}},billboardHorizontalOrigin:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.horizontalOrigin=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)return e&&0<e.length&&e[0].billboard?e[0].billboard.horizontalOrigin:void 0}},billboardVerticalOrigin:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.verticalOrigin=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)return e&&0<e.length&&e[0].billboard?e[0].billboard.verticalOrigin:void 0}},billboardWidth:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.width=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){var t=e[0].billboard.width;return t?t._value:void 0}}},billboardHeight:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.height=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){var t=e[0].billboard.height;return t?t._value:void 0}}},billboardColor:{set:p.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.color=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){var t=e[0].billboard.color;try{return this._color.toHtmlColor("rgb("+255*t._value.red+","+255*t._value.green+","+255*t._value.blue+","+255*t._value.alpha+")")}catch(e){}}}},billboardHeightReference:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].billboard.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].model){var t=e[0].billboard.heightReference;return t?t._value:void 0}}},billboardDistanceDisplayMaxCondition:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=t[0].billboard.distanceDisplayCondition?t[0].billboard.distanceDisplayCondition._value.near:0,r=0;r<t.length;r++)t[r].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e),t[r].billboard.scaleByDistance=new this._cesium.NearFarScalar(i,1,e,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&(e&&0<e.length&&e[0].billboard))return e[0].billboard.distanceDisplayCondition?e[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE}},billboardDistanceDisplayMinCondition:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=t[0].billboard.distanceDisplayCondition?t[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE,r=0;r<t.length;r++)t[r].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i),t[r].billboard.scaleByDistance=new this._cesium.NearFarScalar(e,1,i,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&(e&&0<e.length&&e[0].billboard))return e[0].billboard.distanceDisplayCondition?e[0].billboard.distanceDisplayCondition._value.near:0}},billboardPHeight:{set:p.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var r=this._cesium.Cartographic.fromCartesian(t[i].position._value),o=this._cesium.Math.toDegrees(r.longitude),n=this._cesium.Math.toDegrees(r.latitude),a=this._cesium.Cartesian3.fromDegrees(o,n,e);t[i].position=a}}},500),get:function(){return 0}}}),t}),define("SGWorld/Creator/Ellipsoid",["../Core/Core","./Color","../ProjectTree/treeSource","../Analysis/Cdcl/Cdcl"],function(i,h,p,g){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=p}return e.prototype.createEllipsoid=function(e,t,i,r){var o={radii:new this._cesium.Cartesian3(60,60,60),material:this._cesium.Color.YELLOW},n=this._core.extend(o,t,!0);this.item=this._viewer.entities.add({name:i,position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[1]),ellipsoid:n});var a={id:this.item.id,name:i,pId:this._core.isnull(r)?0:r,type:"ellipsoid",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(r)?0:r),this},e.prototype.getstyles=function(){var e={};return e.show=!this.item.ellipsoid.show||this.item.ellipsoid.show._value,e.radii=this.item.ellipsoid.radii?this.item.ellipsoid.radii.getValue():void 0,e.innerRadii=this.item.ellipsoid.innerRadii?this.item.ellipsoid.innerRadii.getValue():void 0,e.minimumClock=this.item.ellipsoid.minimumClock?this.item.ellipsoid.minimumClock._value:void 0,e.maximumClock=this.item.ellipsoid.maximumClock?this.item.ellipsoid.maximumClock._value:void 0,e.minimumCone=this.item.ellipsoid.minimumCone?this.item.ellipsoid.minimumCone._value:void 0,e.maximumCone=this.item.ellipsoid.maximumCone?this.item.ellipsoid.maximumCone._value:void 0,e.heightReference=this.item.ellipsoid.heightReference&&this.item.ellipsoid.heightReference._value?this.item.ellipsoid.heightReference._value:null,e.fill=this.item.ellipsoid.fill?this.item.ellipsoid.fill._value:void 0,e.material={},e.material.color=this.item.ellipsoid.material&&this.item.ellipsoid.material.color&&this.item.ellipsoid.material.color._value?"rgba"+this.item.ellipsoid.material.color.toString():null,e.material.image=this.item.ellipsoid.material&&this.item.ellipsoid.material.image?this.item.ellipsoid.material.image._value:void 0,e.material.repeat=this.item.ellipsoid.material&&this.item.ellipsoid.material.repeat&&this.item.ellipsoid.material.repeat._value?this.item.ellipsoid.material.repeat._value:null,e.outline=this.item.ellipsoid.outline?this.item.ellipsoid.outline._value:void 0,e.outlineWidth=this.item.ellipsoid.outlineWidth&&this.item.ellipsoid.outlineWidth._value?this.item.ellipsoid.outlineWidth._value:void 0,e.outlineColor=this.item.ellipsoid.outlineColor&&this.item.ellipsoid.outlineColor._value?"rgba"+this.item.ellipsoid.outlineColor.toString():null,e.stackPartitions=this.item.ellipsoid.stackPartitions&&this.item.ellipsoid.stackPartitions._value?this.item.ellipsoid.stackPartitions._value:void 0,e.slicePartitions=this.item.ellipsoid.slicePartitions&&this.item.ellipsoid.slicePartitions._value?this.item.ellipsoid.slicePartitions._value:void 0,e.subdivisions=this.item.ellipsoid.subdivisions&&this.item.ellipsoid.subdivisions._value?this.item.ellipsoid.subdivisions._value:void 0,e.near=this.item.ellipsoid.distanceDisplayCondition?this.item.ellipsoid.distanceDisplayCondition._value.near:void 0,e.far=this.item.ellipsoid.distanceDisplayCondition?this.item.ellipsoid.distanceDisplayCondition._value.far:void 0,e.position=this.item.position.getValue().toString(),e},e.prototype.executeEllipsoid=function(u){var c=this;c.shape={tempPoints:[],button:0,position:{}};var h=new this._cesium.ScreenSpaceEventHandler(c._viewer.scene.canvas),d=[],m=[];return h.setInputAction(function(e){var t=c._viewer.scene.camera.pickEllipsoid(e.position,c._viewer.scene.globe.ellipsoid),i=c._cesium.Cartographic.fromCartesian(t),r=c._cesium.Math.toDegrees(i.longitude),o=c._cesium.Math.toDegrees(i.latitude);m.push({lon:r,lat:o});if(0==c.shape.button)d.push(t.clone()),d.push(t),c.shape.position=t,c.ellipsoid=c._viewer.entities.add({name:"",position:c._cesium.Cartesian3.fromDegrees(m[0].lon,m[0].lat),ellipsoid:{radii:new c._cesium.Cartesian3(67500,67500,67500),material:c._cesium.Color.fromRandom({alpha:1})}}),c.item=c.ellipsoid;else if(1==c.shape.button){var n=g(m[0].lat,m[0].lon,m[1].lat,m[1].lon);c.item.ellipsoid.radii=new c._cesium.Cartesian3(n,n,n),h.destroy()}var a=0;c._core.isnull(p.selectedItem)||"group"!=p.selectedItem.type||(a=p.selectedItem.id);var s=c._core.getuid(),l={id:s,name:"新建球"+s,pId:c._core.isnull(a)?0:a,type:"ellipsoid",item:c};c.setTreeobj(l),p.insertGroupId(l,c._core.isnull(a)?0:a),"function"==typeof u&&u({polyline:{},positions:[],distance:[]}),c.shape.button=c.shape.button+1},this._cesium.ScreenSpaceEventType.LEFT_CLICK),h.setInputAction(function(e){if(1==c.shape.button){var t=c._viewer.camera.pickEllipsoid(e.endPosition,c._viewer.scene.globe.ellipsoid);if(t){var i=c._cesium.Cartographic.fromCartesian(t),r=c._cesium.Math.toDegrees(i.longitude),o=c._cesium.Math.toDegrees(i.latitude);Math.ceil(c._viewer.camera.positionCartographic.height);m.push({lon:r,lat:o});var n=g(m[0].lat,m[0].lon,m[m.length-1].lat,m[m.length-1].lon);c.item.ellipsoid.radii=new c._cesium.Cartesian3(n,n,n)}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},e.prototype.setMaterialColor=function(e){try{this.item._ellipsoid.material.color=new h(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},e.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=null==this.item.ellipsoid.radii?void 0:this.item.ellipsoid.radii.getValue(),i=null==this.item.ellipsoid.fill?void 0:this.item.ellipsoid.fill.getValue(),r=this.item.ellipsoid.material;null!=r&&(r={color:null==r.color._value?void 0:"rgba("+r.color._value.red+","+r.color._value.green+","+r.color._value.blue+","+r.color._value.alpha+")",image:null==r.image?void 0:r.image._value,diffusemap:null==r.diffusemap?void 0:r.diffusemap._value,alphamap:null==r.alphamap?void 0:r.alphamap._value});var o=null==this.item.ellipsoid.outline?void 0:this.item.ellipsoid.outline._value,n=null==this.item.ellipsoid.outlineColor?void 0:"rgba("+this.item.ellipsoid.outlineColor._value.red+","+this.item.ellipsoid.outlineColor._value.green+","+this.item.ellipsoid.outlineColor._value.blue+","+this.item.ellipsoid.outlineColor._value.alpha+")",a=null==this.item.ellipsoid.outlineWidth?void 0:this.item.ellipsoid.outlineWidth.getValue(),s=this.item.ellipsoid.distanceDisplayCondition,l=null==s?void 0:s._value.near,u=null==s?void 0:s._value.far,c=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"ellipsoid",position:{x:this._cesium.Math.toDegrees(c.longitude),y:this._cesium.Math.toDegrees(c.latitude),z:this._cesium.Math.toDegrees(c.height)},treeobj:{name:this.treeobj.name},style:{show:e,radii:t,fill:i,material:r,outline:o,outlineColor:n,outlineWidth:a,near:l,far:u}}},e.prototype.setTreeobj=function(e){this.treeobj=e},e.prototype.setVisibility=function(e){this.item.show=e},e.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},e.prototype.setHeightType=function(e){try{1==e?this.item._ellipsoid.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._ellipsoid.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._ellipsoid.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},e.prototype.setEllipsoidAlpha=function(e){try{this.item._ellipsoid.material.color._value.alpha=e,this.item._ellipsoid.show=!0}catch(e){console.log(e)}return this},e.prototype.setDistanceDisplayCondition=function(e,t){var i=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._ellipsoid.distanceDisplayCondition=i}catch(e){console.log(e)}return this},e.prototype.setEllipsoidImage=function(e){try{this.item._ellipsoid.material=new this._cesium.ImageMaterialProperty({image:e})}catch(e){console.log(e)}return this},e.prototype.setEllipsoidRepeat=function(e,t){try{this.item._ellipsoid.material.repeat=new this._cesium.Cartesian2(e,t)}catch(e){console.log(e)}return this},e.prototype.setMaterial=function(e){try{this.item._ellipsoid.show=e}catch(e){console.log(e)}return this},e.prototype.setRadii=function(e){try{this.item._ellipsoid.radii=new this._cesium.Cartesian3(e,e,e)}catch(e){console.log(e)}return this},e.prototype.setItem=function(e){this.item=e},e.prototype.CreateSphere=function(e,t,i,r,o,n,a,s){this._postion=e;var l,u={radii:this._cesium.defaultValue(new this._cesium.Cartesian3(t,t,t),new this._cesium.Cartesian3(60,60,60)),material:this._cesium.Color.RED,outline:!1,outlineColor:void 0};r&&""!==r&&(u.outlineColor=new h(this._viewer,this._cesium).colorFromHtmlColor(r),u.outline=!0),o&&""!==o&&(u.material=new h(this._viewer,this._cesium).colorFromHtmlColor(o)),(e.Yaw||e.Pitch||e.Roll)&&(l=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw),this._cesium.Math.toRadians(e.Pitch),this._cesium.Math.toRadians(e.Roll)))),this.item=this._viewer.entities.add({name:s,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),ellipsoid:u,orientation:l});var c={id:this.item.id,name:name,pId:this._core.isnull(a)?0:a,type:"ellipsoid",item:this};return this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(a)?0:a),this},Object.defineProperties(e.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{this._postion.Altitude=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}}}}),e}),define("SGWorld/Creator/3DTileset",["../configData","./Color","../Core/Core","../ProjectTree/treeSource"],function(e,i,r,o){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new r,this._tree=o,this._color=new i(this._viewer,this._cesium),this.modelEditData={lon:0,lat:0,height:0,scale:1,r_x:0,r_y:0,r_z:0,rootTransform:void 0}}return t.prototype.create3DTilesets=function(e,t,i,r,o,n,a){if("string"==typeof i.lightColor){var s=i.lightColor.split(",");i.lightColor=new this._cesium.Cartesian2(s[0],s[1],s[2])}var l=this._core.extend({url:""},i,!0);l.url=t,l.time&&(l.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:l.time.start?this._cesium.JulianDate.fromDate(new Date(l.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:l.time.end?this._cesium.JulianDate.fromDate(new Date(l.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})]),this.availability=l.availability);var u=new this._cesium.Cesium3DTileset(l),c=this,h=l.id||c._core.getuid();u.id=h,u.Level=l.Level,c.item=u,setTimeout(function(){var e=c._viewer.scene.primitives.add(u);null!=r.maximumscreenspaceerror&&(u.maximumScreenSpaceError=r.maximumscreenspaceerror),null!=l.maximumscreenspaceerror&&(u.maximumScreenSpaceError=l.maximumscreenspaceerror),null!=l.maximumMemoryUsage&&(u.maximumMemoryUsage=l.maximumMemoryUsage),null!=r.pointcloudshading&&(u.pointCloudShading.maximumAttenuation=c.checkZero(r.pointcloudshading.maximumattenuation),u.pointCloudShading.baseResolution=r.pointcloudshading.baseresolution,u.pointCloudShading.geometricErrorScale=r.pointcloudshading.geometricerrorscale,u.pointCloudShading.attenuation=r.pointcloudshading.attenuation,u.pointCloudShading.eyeDomeLighting=r.pointcloudshading.eyedomelighting,u.pointCloudShading.eyeDomeLightingStrength=r.eyeDomeLightingStrength,u.pointCloudShading.eyeDomeLightingRadius=r.eyeDomeLightingRadius),u.readyPromise.then(function(e){if(null!=r.groundheight&&null!=r.groundheight&&c.setHeight(r.groundheight),null!=r.groundCenter&&null!=r.groundCenter&&c.setPosition(r.groundCenter),!c.boundingSphereCenter){c.getCenter();var t=c._cesium.Cartographic.fromCartesian(c.boundingSphereCenter);c.modelEditData.lon=c._cesium.Math.toDegrees(t.longitude),c.modelEditData.lat=c._cesium.Math.toDegrees(t.latitude),c.modelEditData.height=t.height}null!=r.editData&&null!=r.editData&&c.setEditData(r.edit),"function"==typeof a&&a(c)}).otherwise(function(e){console.log(e)}),u.Level&&(c.Level=0,c._viewer.scene.preRender.addEventListener(function(){c.isShow&&c._viewer.camera.positionCartographic&&c.oldCameraHeight!==c._viewer.camera.positionCartographic.height&&(c.oldCameraHeight=c._viewer.camera.positionCartographic.height,c.Level=c.getLevel(),c.Level>u.Level&&!u.show?u.show=!0:c.Level<u.Level&&u.show&&(u.show=!1))})),c.sd=e,n?c.isShow=!0:c.setVisibility(!1);var t=c.setStyle(r);u.style=new c._cesium.Cesium3DTileStyle(t)}),c._core.isnull(e)&&(e="新建模型");var d={id:h,name:e,checked:n,pId:c._core.isnull(o)?0:o,type:"3DTilesets",item:c};return c.setTreeobj(d),c._tree.insertGroupId(d,c._core.isnull(o)?0:o),this},t.prototype.getLevel=function(){var e,t,i=this._viewer.camera;try{if(i&&i.positionCartographic&&i.positionCartographic.height){var r=this._viewer.scene.globe.getHeight(i.positionCartographic);!r&&(r=0),e=i.positionCartographic.height-r,t=Math.round(80955.31/(1+Math.pow(e/91610.74,7096758e-11))-40467.74)}else t=0}catch(e){}return t},t.prototype.setVisibility=function(e){this.isShow=e,this.item.show=e,this.item._availability&&!e?this.item._availability=void 0:this.availability&&e&&(this.item._availability=this.availability)},t.prototype.checkZero=function(e){var t=parseFloat(e);return 0===t?void 0:t},t.prototype.getVisibility=function(){return this.item.show},t.prototype.deleteObject=function(){try{this._viewer.scene.primitives.remove(this.item)}catch(e){console.log(e.message)}},t.prototype.restore=function(){this.modelEditData={lon:0,lat:0,height:0,scale:1,r_x:0,r_y:0,r_z:0,rootTransform:this.modelEditData.rootTransform,originalMatrix:this.modelEditData.originalMatrix};var e=this._cesium.Cartographic.fromCartesian(this.boundingSphereCenter);this.modelEditData.lon=this._cesium.Math.toDegrees(e.longitude),this.modelEditData.lat=this._cesium.Math.toDegrees(e.latitude),this.modelEditData.height=e.height,this.modelEditData.rootTransform.equals(Cesium.Matrix4.IDENTITY)?this.item.modelMatrix=this.modelEditData.originalMatrix.clone():this.item._root.transform=this.modelEditData.originalMatrix.clone(),this.moveModelEnd&&(this.moveModelEnd(),this.moveModelEnd=void 0),this.rotatePointPosition=void 0,this.moveEndCenter=void 0},t.prototype.setHeight=function(e){if(e=Number(e),!isNaN(e)&&null!=this.item&&null!=this.item.boundingSphere){this.boundingSphereCenter||this.getCenter();var t=this._cesium.Cartographic.fromCartesian(this.boundingSphereCenter);this.modelEditData.lon=this._cesium.Math.toDegrees(t.longitude),this.modelEditData.lat=this._cesium.Math.toDegrees(t.latitude),this.modelEditData.height=t.height;var i=this._cesium.Cartesian3.fromRadians(t.longitude,t.latitude,0),r=this._cesium.Cartesian3.fromRadians(t.longitude,t.latitude,e),o=this._cesium.Cartesian3.subtract(r,i,new this._cesium.Cartesian3);this.item.modelMatrix=this._cesium.Matrix4.fromTranslation(o)}},t.prototype.setPosition=function(e,t){null!=this.item&&null!=this.item.boundingSphere&&(this.boundingSphereCenter||this.getCenter(),this.modelEditData.lon=e[0],this.modelEditData.lat=e[1],this.modelEditData.height=t?this.boundingSphereCenterHeight:e[2],this.setEditData())},t.prototype.setEditData=function(e){if(null!=this.item&&null!=this.item.boundingSphere){if(this.boundingSphereCenter||this.getCenter(),e&&(this.modelEditData=this._core.extend(this.modelEditData,e,!0)),this.modelEditData.rootTransform.equals(Cesium.Matrix4.IDENTITY)){var t=this.boundingSphereCenter,i=this._cesium.Cartesian3.fromDegrees(this.modelEditData.lon,this.modelEditData.lat,this.modelEditData.height),r=this._cesium.Cartesian3.subtract(i,t,new this._cesium.Cartesian3);return void(this.item.modelMatrix=this._cesium.Matrix4.fromTranslation(r))}var o=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(this.modelEditData.r_x)),n=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(this.modelEditData.r_y)),a=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(this.modelEditData.r_z)),s=Cesium.Matrix4.fromRotationTranslation(o),l=Cesium.Matrix4.fromRotationTranslation(n),u=Cesium.Matrix4.fromRotationTranslation(a),c=Cesium.Cartesian3.fromDegrees(this.modelEditData.lon,this.modelEditData.lat,this.modelEditData.height),h=Cesium.Transforms.eastNorthUpToFixedFrame(c);Cesium.Matrix4.multiply(h,s,h),Cesium.Matrix4.multiply(h,l,h),Cesium.Matrix4.multiply(h,u,h);var d=Cesium.Matrix4.fromUniformScale(this.modelEditData.scale);Cesium.Matrix4.multiply(h,d,h),this.item._root.transform=h}},t.prototype.getCenter=function(){if(!this.boundingSphereCenter){var e=this._cesium.Cartographic.fromCartesian(this.item.boundingSphere.center);this.boundingSphereCenter=this.item.boundingSphere.center.clone(),this.boundingSphereCenterHeight=e.height,this.boundingSphereRadius=this.item.boundingSphere.radius,this.modelEditData.rootTransform=this.item._root.transform.clone(),this.modelEditData.rootTransform.equals(Cesium.Matrix4.IDENTITY)?this.modelEditData.originalMatrix=this.item.modelMatrix.clone():this.modelEditData.originalMatrix=this.item._root.transform.clone()}},t.prototype.arge=function(e,t,i){var r=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),o=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),n=Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2)),a=(Math.pow(r,2)+Math.pow(o,2)-Math.pow(n,2))/(2*r*o);return Math.round(180*Math.acos(a)/Math.PI)},t.prototype.moveModel=function(r){!r&&(r={});var o=this,n=this._viewer;this.moveHandler&&(this.moveHandler.destroy(),this.moveHandler=void 0,this._viewer.entities.remove(this.movePoint),this._viewer.entities.remove(this.rotatePoint));var a,s,l,u,c,h,d,m,p,g,f=!1,v=!1;o.moveEndCenter||(l=o._cesium.Cartographic.fromCartesian(this.boundingSphereCenter),o.moveEndCenter={lon:this.modelEditData.lon,lat:this.modelEditData.lat}),u=o.moveEndCenter.lon,c=o.moveEndCenter.lat,h=d=0;var _=this._viewer.entities.add({name:"tilesetMovePoint",position:new o._cesium.CallbackProperty(function(){return o._cesium.Cartesian3.fromDegrees(u+h,c+d,o.boundingSphereCenterHeight)},!1),billboard:{image:r.moveImg||window.SmartEarthRootUrl+e.move,color:this._cesium.Color.BLUE,disableDepthTestDistance:Number.POSITIVE_INFINITY,scaleByDistance:new Cesium.NearFarScalar(0,1,1e6,0)}});this.rotatePointPosition||(this.rotatePointPosition={lon:o.moveEndCenter.lon+9e-6*this.boundingSphereRadius,lat:o.moveEndCenter.lat});var y=this._viewer.entities.add({show:!!r.rotate,name:"tilesetRotatePoint",position:new o._cesium.CallbackProperty(function(){return o._cesium.Cartesian3.fromDegrees(o.rotatePointPosition.lon,o.rotatePointPosition.lat,o.boundingSphereCenterHeight)},!1),billboard:{image:r.rotateImg||window.SmartEarthRootUrl+e.rotate,color:this._cesium.Color.BLUE,disableDepthTestDistance:Number.POSITIVE_INFINITY,scaleByDistance:new Cesium.NearFarScalar(0,1,1e6,0)}});y.oldPosition={lon:o.moveEndCenter.lon+9e-6*this.boundingSphereRadius,lat:o.moveEndCenter.lat},this.movePoint=_,this.rotatePoint=y,this.moveHandler=new this._cesium.ScreenSpaceEventHandler(n.scene.canvas);var C=o._core.CreateTooltip();function i(e){var t=n.scene;t.screenSpaceCameraController.enableRotate=e,t.screenSpaceCameraController.enableTranslate=e,t.screenSpaceCameraController.enableZoom=e,t.screenSpaceCameraController.enableTilt=e,t.screenSpaceCameraController.enableLook=e}this.moveHandler.setInputAction(function(e){var t=n.scene.pick(e.position);o._cesium.defined(t)&&(f||v||!(t.id==_||t.tileset==o.item||t.primitive&&t.primitive.tileset==o.item||t.content&&t.content.tileset==o.item)?f||v||t.id!=y||(m=o._cesium.SceneTransforms.wgs84ToWindowCoordinates(o._viewer.scene,_.position.getValue()),p=o._cesium.SceneTransforms.wgs84ToWindowCoordinates(o._viewer.scene,o._cesium.Cartesian3.fromDegrees(u+h+9e-6*o.boundingSphereRadius,c+d,o.boundingSphereCenterHeight)),i(!(v=!0)),C.show(!1)):((a=n.camera.getPickRay(e.position))&&(s=n.scene.globe.pick(a,n.scene)),s&&(l=o._cesium.Cartographic.fromCartesian(s),u=o._cesium.Math.toDegrees(l.longitude),c=o._cesium.Math.toDegrees(l.latitude),h=o.moveEndCenter.lon-u,d=o.moveEndCenter.lat-c),_.oldPosition={lon:u+h,lat:c+d},y.oldPosition={lon:o.rotatePointPosition.lon,lat:o.rotatePointPosition.lat},i(!(f=!0)),C.show(!1)))},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.moveHandler.setInputAction(function(e){if(f)(a=n.camera.getPickRay(e.endPosition))&&(s=n.scene.globe.pick(a,n.scene)),s&&(l=o._cesium.Cartographic.fromCartesian(s),u=o._cesium.Math.toDegrees(l.longitude),c=o._cesium.Math.toDegrees(l.latitude),o.rotatePointPosition={lon:y.oldPosition.lon+(u+h-_.oldPosition.lon),lat:y.oldPosition.lat+(c+d-_.oldPosition.lat)},o.modelEditData.lon=u+h,o.modelEditData.lat=c+d,o.setEditData(),r.callback&&r.callback.move&&r.callback.move());else if(v){if((a=n.camera.getPickRay(e.endPosition))&&(s=n.scene.globe.pick(a,n.scene)),s){l=o._cesium.Cartographic.fromCartesian(s),o.rotatePointPosition={lon:o._cesium.Math.toDegrees(l.longitude),lat:o._cesium.Math.toDegrees(l.latitude)},g=e.endPosition;var t=o.arge(m,p,g);o.rotatePointPosition.lat-c-d<0&&(t=-t),o.rotateZ(t),r.callback&&r.callback.rotate&&r.callback.rotate(t)}}else{var i=n.scene.pick(e.endPosition);o._cesium.defined(i)?f||v||!(i.id==_||i.tileset==o.item||i.primitive&&i.primitive.tileset==o.item||i.content&&i.content.tileset==o.item)?f||v||i.id!=y?C.show(!1):C.showAt(e.endPosition,"点击拖拽旋转模型,右键结束编辑"):C.showAt(e.endPosition,"点击拖拽移动模型,右键结束编辑"):C.show(!1)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.moveHandler.setInputAction(function(e){i(!(v=f=!1)),o.moveEndCenter={lon:u+h,lat:c+d}},this._cesium.ScreenSpaceEventType.LEFT_UP),this.moveHandler.setInputAction(function(e){o.moveModelEnd(),o.moveModelEnd=void 0},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),this.moveModelEnd=function(){o.moveHandler.destroy(),o._viewer.entities.remove(_),o._viewer.entities.remove(y),i(!0),C.show(!1)}},t.prototype.clippingModel=function(t){!t&&(t={});var i=this,r=this._viewer;this.moveHandler&&(this.moveHandler.destroy(),this.moveHandler=void 0,this._viewer.entities.remove(this.movePoint),this._viewer.entities.remove(this.rotatePoint)),this.clippingHandler&&(this.clippingHandler.destroy(),this.clippingHandler=void 0,i.planeEntities&&i.planeEntities.forEach(function(e){i._viewer.entities.remove(e)}),i.planeEntities=[]),i.planeEntities=[];var o,n=0;this.clippingPlanes||(this.clippingPlanes=new this._cesium.ClippingPlaneCollection({planes:[new this._cesium.ClippingPlane(new this._cesium.Cartesian3(0,0,-1),0)],edgeWidth:1}),this.item.clippingPlanes=this.clippingPlanes),this.boundingSphereCenter||this.getCenter();var e=this.item.boundingSphere,a=this.boundingSphereRadius;if(!this._cesium.Matrix4.equals(this.item.root.transform,this._cesium.Matrix4.IDENTITY)){var s=this._cesium.Matrix4.getTranslation(this.item.root.transform,new Cesium.Cartesian3),l=this._cesium.Cartographic.fromCartesian(s),u=this._cesium.Cartographic.fromCartesian(this.item.boundingSphere.center).height-l.height;this.clippingPlanes.modelMatrix=this._cesium.Matrix4.fromTranslation(new this._cesium.Cartesian3(0,0,u))}for(var c=0;c<this.clippingPlanes.length;++c){var h=this.clippingPlanes.get(c),d=r.entities.add({name:"modelClippingPlane",position:e.center,plane:{dimensions:new Cesium.Cartesian2(2.5*a,2.5*a),material:Cesium.Color.WHITE.withAlpha(.1),plane:new Cesium.CallbackProperty(m(h),!1),outline:!0,outlineColor:Cesium.Color.WHITE}});i.planeEntities.push(d)}this.clippingHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas);i._core.CreateTooltip();function m(e){return function(){return e.distance=n,e}}this.clippingHandler.setInputAction(function(e){var t=r.scene.pick(e.position);i._cesium.defined(t)&&t.id&&"modelClippingPlane"===t.id.name&&((o=t.id.plane).material=i._cesium.Color.WHITE.withAlpha(.05),o.outlineColor=i._cesium.Color.WHITE,r.scene.screenSpaceCameraController.enableInputs=!1)},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.clippingHandler.setInputAction(function(e){if(Cesium.defined(o)){var t=e.startPosition.y-e.endPosition.y;n+=.1*t}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.clippingHandler.setInputAction(function(e){Cesium.defined(o)&&(o.material=Cesium.Color.WHITE.withAlpha(.1),o.outlineColor=Cesium.Color.WHITE,o=void 0),r.scene.screenSpaceCameraController.enableInputs=!0},this._cesium.ScreenSpaceEventType.LEFT_UP),this.clippingHandler.setInputAction(function(e){i.endClipping(),t.end&&t.end()},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),this.endClipping=function(){i.clippingHandler.destroy(),i.planeEntities&&i.planeEntities.forEach(function(e){i._viewer.entities.remove(e)}),i.planeEntities=[]}},t.prototype.rotateX=function(e){this.modelEditData.r_x=e,this.setEditData()},t.prototype.rotateY=function(e){this.modelEditData.r_y=e,this.setEditData()},t.prototype.rotateZ=function(e){this.modelEditData.r_z=e,this.setEditData()},t.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(t.prototype,{style:{get:function(){return this.item.style}}}),t.prototype.export=function(){var e=this.item.url,t=this.item.show,i=this.item.shadows;return{type:"3DTilesets",treeobj:{name:this.treeobj.name},style:{url:e,show:t,shadows:i}}},t.prototype.setTreeobj=function(e){this.treeobj=e},t.prototype.setItem=function(e){this.item=e},t.prototype.setShowStyle=function(e){this.item.style;this.item.style=new this._cesium.Cesium3DTileStyle({show:!0})},t.prototype.setStyle=function(e){var t=[],i={color:void 0,show:!0},r=!0;if(e.colors instanceof Array){for(var o=0;o<e.colors.length;o++){var n=[],a=e.colors[o].color,s=e.colors[o].condition;/^\[/.test(s)&&(s=s.replace(/^\[/,"${").replace(/\]/,"}")),a=this._core.isHtmlColor(a)?this._color.colorFromHtmlColor(a):(/^rgb/.test(a)&&(a=this._color.rgbaStringToRgbaObj(a)),1<a.r&&(a.r=a.r/255),1<a.g&&(a.g=a.g/255),1<a.b&&(a.b=a.b/255),1<a.a&&(a.a=a.a/255),this._color.createColor(a.r,a.g,a.b,a.a)),n.push(s),n.push(a),t.push(n)}i.color={},i.color.conditions=t}else e.colors&&(i.color=e.colors);return e.show&&/\[/.test(e.show)?r=e.show.replace(/^\[/,"${").replace(/\]/,"}"):e.show&&(r=e.show),i.show=r,i},t.prototype.getTypes=function(){},Object.defineProperties(t.prototype,{luminanceAtZenith:{get:function(){return this.item.luminanceAtZenith},set:function(e){this.item.luminanceAtZenith=e}},groundHeight:{get:function(){return null==this.item||null==this.item.boundingSphere?0:this._cesium.Cartographic.fromCartesian(this.item.boundingSphere.center).altitude},set:function(e){if(e=Number(e),!isNaN(e)&&null!=this.item&&null!=this.item.boundingSphere){var t=this._cesium.Cartographic.fromCartesian(this.item.boundingSphere.center),i=this._cesium.Cartesian3.fromRadians(t.longitude,t.latitude,0),r=this._cesium.Cartesian3.fromRadians(t.longitude,t.latitude,e),o=this._cesium.Cartesian3.subtract(r,i,new this._cesium.Cartesian3);this.item.modelMatrix=this._cesium.Matrix4.fromTranslation(o)}}},lon:{get:function(){return this.modelEditData.lon},set:function(e){this.modelEditData.lon=e,this.setEditData()}},lat:{get:function(){return this.modelEditData.lat},set:function(e){this.modelEditData.lat=e,this.setEditData()}},height:{get:function(){return this.modelEditData.height},set:function(e){this.modelEditData.height=e,this.setEditData()}},scale:{get:function(){return this.modelEditData.scale},set:function(e){this.modelEditData.scale=e,this.setEditData()}},material:{set:function(e){this._core.isHtmlColor(e)||(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),e="rgba("+e.r+","+e.g+","+e.b+","+e.a+")"),this.item.style=new this._cesium.Cesium3DTileStyle({color:"color('"+e+"')"})}},dynamicScreenSpaceErrorDensity:{get:function(){return this.item.dynamicScreenSpaceErrorDensity},set:function(e){this.item.dynamicScreenSpaceErrorDensity=e}},shadows:{get:function(){return this.item.shadows},set:function(e){this.item.shadows=e}},classificationType:{get:function(){return this.item.classificationType},set:function(e){this.item.classificationType=e}},dynamicScreenSpaceErrorHeightFalloff:{get:function(){return this.item.dynamicScreenSpaceErrorHeightFalloff},set:function(e){this.item.dynamicScreenSpaceErrorHeightFalloff=e}},dynamicScreenSpaceErrorFactor:{get:function(){return this.item.dynamicScreenSpaceErrorFactor},set:function(e){this.item.dynamicScreenSpaceErrorFactor=e}},imageBasedLightingFactor_x:{get:function(){return null==this.item.imageBasedLightingFactor?0:this.item.imageBasedLightingFactor.x},set:function(e){this.item.imageBasedLightingFactor=new this._cesium.Cartesian2(e,this.item.imageBasedLightingFactor_y)}},imageBasedLightingFactor_y:{get:function(){return null==this.item.imageBasedLightingFactor?0:this.item.imageBasedLightingFactor.y},set:function(e){this.item.imageBasedLightingFactor=new this._cesium.Cartesian2(e,this.item.imageBasedLightingFactor_y)}}}),t.prototype.getType=function(){return{label:"模型",value:"3DTileset"}},t}),define("SGWorld/Creator/dynamicObject",["../Core/Core","./Color","../ProjectTree/treeSource","../Navigate/getPosition","../Analysis/Cdcl/Cdcl","../configData"],function(i,e,r,o,t,c){"use strict";function n(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._getPosition=new o(this._viewer,this._cesium),this._tree=r,this._entityFly=null}n.prototype.executeFlycesium=function(t){var i=this,r=function(){function e(e){this.options={polyline:{show:!0,positions:[],material:new i._cesium.PolylineGlowMaterialProperty({glowPower:.1,color:i._cesium.Color.YELLOW}),width:10,clampToGround:!0}},this.positions=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polyline.positions=new i._cesium.CallbackProperty(function(){return e.positions},!1),this.flycesium=i._viewer.entities.add(this.options),i.item=this.flycesium},e}(),o=this.handler=new i._cesium.ScreenSpaceEventHandler(i._viewer.scene.canvas),n=[],a=0,s=void 0,l={polyline:{},cameraRoll:null,cameraPitch:null,cameraPosition:null,cameraHeading:null,positions:[],distance:[],Totaltime:""},u=this._core.CreateTooltip();return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+c.draw),o.setInputAction(function(e){var t=i._getPosition.getMousePosition(e);"pc"===i._core.getBrowser().pc&&0==n.length&&n.push(t.clone()),n.push(t),2<=n.length&&(i._cesium.defined(s)||(s=new r(n)),a=i._core.getSpaceDistancem(n,i._cesium))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),o.setInputAction(function(e){u.showAt(e.endPosition,"左键开始,右键结束!");var t=i._getPosition.getMousePosition(e);2<=n.length&&(i._cesium.defined(s)?t&&(n.pop(),n.push(t)):s=new r(n),a=i._core.getSpaceDistancem(n,i._cesium))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(function(e){i.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){o.destroy(),u.show(!1),i._core.mouse(i._viewer.container,0),i.end=void 0,i._viewer.entities.remove(i.item),"cancel"===e||n.length<2||(a=i._core.getSpaceDistancem(n,i._cesium),l.polyline=s,l.positions=n,l.distance=parseFloat(a),i.setFlycesium(l,function(e){i.flyceium=e,i.ploylinejl=l,"function"==typeof t&&t(e)}))},this},n.prototype.setFlycesium=function(r,o){for(var n=this,a=[],s=0,e=0;e<r.positions.length;e++){var t=n._cesium.Cartographic.fromCartesian(r.positions[e]),i=[t.longitude/Math.PI*180,t.latitude/Math.PI*180,t.height];a.push(i)}this._core.getPmfxPro(r.positions,25,0,n._cesium,n._viewer,function(e){var t;s=e.max,t=(r.distance/50).toFixed(1);var i={id:n._core.getuid(),name:"新建路线",distance:r.distance,showPoint:!1,showLine:!0,showModel:!0,isLoop:!1,Totaltime:Math.round(t),height:(s+100).toFixed(2),pitch:-20,range:100,mode:0,url:c.testModel,geojson:{geometry:{type:"LineString",coordinates:a}}};o&&o(i)})},n.prototype.Start=function(e,t,i){var r=this;e.geojson;return e.Totaltime||(e.Totaltime=3e3),r._entityFly&&r.exit(),C=i,setTimeout(function(){r.executeFly3D(e,t)},200),this};var m,p,g,f,v,a,_=null,y=null,C=null,w={start:null,time:null,longitude:0,latitude:0,cameraHeight:100,speed:null,position:0},u=0;n.prototype.executeFly3D=function(e,t){var l=this,i=e.geojson;if(m=new l._cesium.Cartesian3,f=new l._cesium.SampledProperty(Number),v=new l._cesium.SampledPositionProperty,i&&i.geometry){var r=i.geometry.coordinates,o=[],n=[];if(0<r.length){for(var a=0;a<r.length;a++){var s=r[a][0],u=r[a][1],c=r[a][2];void 0!==e.lineHeight&&(c=e.lineHeight),n.push(s,u,c),o.push({x:s,y:u,z:c})}w.start=l._cesium.JulianDate.fromDate(new Date),w.stop=l._cesium.JulianDate.addSeconds(w.start,e.Totaltime,new l._cesium.JulianDate),l._viewer.clock.startTime=w.start.clone(),l._viewer.clock.stopTime=w.stop.clone(),l._viewer.clock.currentTime=w.start.clone(),l._viewer.clock.clockRange=e.isLoop?l._cesium.ClockRange.LOOP_STOP:l._cesium.ClockRange.CLAMPED,l._viewer.clock.multiplier=1,l._viewer.clock.canAnimate=!1,l._viewer.clock.shouldAnimate=!0,w.Totaltime=e.Totaltime,w.distance=e.distance,w.cameraHeight=e.height,w.lineHeight=e.lineHeight,w.pitch=e.pitch,w.range=e.range;var h=l.computeCirclularFlight(o);w.position=h,w.degrees=o,g=new l._cesium.VelocityOrientationProperty(h);var d={};d=""!==t?{show:l._cesium.defaultValue(e.showModel,!0),scale:l._cesium.defaultValue(e.modelScale,1),uri:t}:{show:l._cesium.defaultValue(e.showModel,!0),scale:l._cesium.defaultValue(e.modelScale,1)},e.modelData&&(d=l._core.extend(d,e.modelData)),b=function(){},_=l._viewer.entities.add({availability:new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:w.start,stop:w.stop})]),position:h,polyline:{clampToGround:void 0===w.lineHeight,positions:Cesium.Cartesian3.fromDegreesArrayHeights(n),show:l._cesium.defaultValue(e.showLine,!0),material:new l._cesium.PolylineGlowMaterialProperty({glowPower:.1,color:l._cesium.Color.YELLOW}),width:10},label:{text:new l._cesium.CallbackProperty(function(e,t){l._viewer.camera;if(2!==l._viewer.clock.clockRange&&Cesium.JulianDate.equals(l._viewer.clock.currentTime,l._viewer.clock.stopTime))return _.label.text="",l.exit(),null!=C&&"function"==typeof C&&C("end"),void(b=function(){});try{var i=E.position.getValue(l._viewer.clock.currentTime),r=l._cesium.Cartographic.fromCartesian(i);if(w.longitude=l._cesium.Math.toDegrees(r.longitude),w.latitude=l._cesium.Math.toDegrees(r.latitude),void 0===w.lineHeight){var o=l._viewer.scene.sampleHeight(r,[y,E]),n=l._viewer.scene.globe.getHeight(r);y.position=l._cesium.Cartesian3.fromRadians(r.longitude,r.latitude,o<n?n:o)}}catch(e){}try{p.getValue(e,m),b(e);var a=l._cesium.Cartesian3.magnitude(m),s=Math.round(3.6*a);s+=" km/h",w.time=l._cesium.JulianDate.secondsDifference(e,w.start),w.ratio=w.time/w.Totaltime,w.distanceTraveled=w.ratio*w.distance,w.speed=s,w.height=r.height,w.globeHeight=l._viewer.scene.globe.getHeight(r),null!=C&&"function"==typeof C&&C(w)}catch(e){}return""},!1),font:"20px sans-serif",showBackground:!1,distanceDisplayCondition:new l._cesium.DistanceDisplayCondition(0,100),eyeOffset:new l._cesium.Cartesian3(0,3.5,0)}}),y=l._viewer.entities.add({availability:new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:w.start,stop:w.stop})]),position:h,orientation:g,point:{show:l._cesium.defaultValue(e.showPoint,!1),color:l._cesium.Color.RED,outlineColor:l._cesium.Color.WHITE,outlineWidth:2,pixelSize:10},model:d,billboard:e.image,viewFrom:e.viewFrom||new l._cesium.Cartesian3(500,500,500)}),E=_,l._viewer.trackedEntity=y,l._entityFly=_,e.speed&&l.setSpeed(e.speed),e.mode&&l.changeFlyMode(e.mode)}}};var b,E=null;function s(e){u=f.getValue(e),w.heading=u}function l(e){var t=Cesium.Cartographic.fromCartesian(e),i=Cesium.Math.toDegrees(t.longitude),r=Cesium.Math.toDegrees(t.latitude);return Cesium.Cartesian3.fromDegrees(i,r,w.cameraHeight||100)}return n.prototype.showPoint=function(e){y&&y.point&&(y.point.show=e)},n.prototype.showLine=function(e){_&&_.polyline&&(_.polyline.show=e)},n.prototype.showModel=function(e){y&&y.model&&(y.model.show=e)},n.prototype.setFlyHeight=function(e){w.cameraHeight=e},n.prototype.setFlyDistance=function(e){w.range=e},n.prototype.setFlyPitch=function(e){w.pitch=e},n.prototype.changeFlyMode=function(e){var t=this;switch(e){case 0:b=function(){},t.BindingModel(!0);break;case 1:this.BindingModel(!1),b=function(e){s(e),t.exeuteVisualAngle(t._cesium.Math.toRadians(w.heading),t._cesium.Math.toRadians(w.pitch),w.range)};break;case 2:this.BindingModel(!1),b=function(e){s(e),(a=t._entityFly.position.getValue(t._viewer.clock.currentTime))&&(a=l(a),t._viewer.camera.setView({destination:a,orientation:{heading:t._cesium.Math.toRadians(w.heading),pitch:t._cesium.Math.toRadians(-90),roll:0}}))}}},n.prototype.faster=function(){this._viewer.animation.viewModel.faster()},n.prototype.slower=function(){this._viewer.animation.viewModel.slower()},n.prototype.setSpeed=function(e){this._viewer.clock.multiplier=parseFloat(e)},n.prototype.isPause=function(e){this._viewer.clockViewModel.shouldAnimate=!e},n.prototype.exit=function(){this.isPause(!0),this._viewer.clock.multiplier=1,this.executeSignout(),this.BindingModel(!1),this._viewer.entities.remove(_),this._viewer.entities.remove(y),y=_=null,this._entityFly=null},n.prototype.updateSpeedLabel=function(e,t){},n.prototype.computeCirclularFlight=function(e){var t,i,r,o,n=this;p=new n._cesium.VelocityVectorProperty(v,!1);for(var a=0;a<e.length;a++){0===a&&(i=n._cesium.JulianDate.addSeconds(w.start,0,new n._cesium.JulianDate),r=n._cesium.Cartesian3.fromDegrees(e[0].x,e[0].y,w.lineHeight),v.addSample(i,r),u=n._core.TwoPointAzimuth(e[0].x,e[0].y,e[1].x,e[1].y),f.addSample(i,u));try{if(0<a&&a!=e.length-1){r=new n._cesium.Cartesian3(v._property._values[3*a-3],v._property._values[3*a-2],v._property._values[3*a-1]),o=n._cesium.Cartesian3.fromDegrees(e[a].x,e[a].y,n._cesium.defaultValue(w.lineHeight,e[a].z));var s=[n._cesium.Cartographic.fromCartesian(r),n._cesium.Cartographic.fromCartesian(o)],l=new n._cesium.EllipsoidGeodesic(s[0],s[1]).surfaceDistance;i=n._cesium.JulianDate.addSeconds(v._property._times[a-1],.5,new n._cesium.JulianDate),t=n._cesium.JulianDate.addSeconds(v._property._times[a-1],l/50,new n._cesium.JulianDate),v.addSample(t,o),u=n._core.TwoPointAzimuth(e[a-1].x,e[a-1].y,e[a].x,e[a].y),f.addSample(i,u),f.addSample(t,u)}}catch(e){console.log(e)}}return v},n.prototype.executePauseFly3DPaths=function(){var e=this._viewer.clockViewModel;e.shouldAnimate?e.shouldAnimate=!1:this._viewer.clockViewModel.canAnimate&&(e.shouldAnimate=!0)},n.prototype.changeModel=function(e){y.model.uri=e},n.prototype.PointView=function(){return{position:Viewer.camera.position.clone(),orientation:{heading:Viewer.camera.heading,pitch:Viewer.camera.pitch,roll:Viewer.camera.roll}}},n.prototype.PlayPaths=function(e){var t=this;setInterval(function(){viewer.camera.setView({destination:t._cesium.Cartesian3.fromDegrees(117.48,30.67,15e3),orientation:{heading:t._cesium.Math.toRadians(90,0),pitch:t._cesium.Math.toRadians(-90),roll:0}})},2e3)},n.prototype.BindingModel=function(e){e?this._viewer.trackedEntity=y:(this._viewer.trackedEntity=void 0,this._viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY))},n.prototype.exeuteVisualAngle=function(e,t,i){var r={heading:null,pitch:null,range:null};r.heading=e||this._cesium.Math.toRadians(90),r.pitch=t||this._cesium.Math.toRadians(0),r.range=i||1e3;var o=this._entityFly.position.getValue(this._viewer.clock.currentTime);if(o){o=l(o);var n=new this._cesium.HeadingPitchRange(r.heading,r.pitch,r.range);this._viewer.camera.lookAt(o,n)}},n.prototype.Pathshow=function(e){this._entityFly.polyline.show=e},n.prototype.Pointshow=function(e){y._point.show=e},n.prototype.Modelshow=function(e){y._model.show=e},n.prototype.executePlayForwardFly3DPaths=function(){var e=this._viewer.clockViewModel,t=e.multiplier;t<0&&(e.multiplier=-t),e.shouldAnimate=!0},n.prototype.executePlayReverseFly3DPaths=function(){var e=this._viewer.clockViewModel,t=e.multiplier;0<t&&(e.multiplier=-t),e.shouldAnimate=!0},n.prototype.executeSignout=function(){var e=this._cesium.JulianDate.fromDate(new Date);this._viewer.clock.startTime=e.clone();var t=this._cesium.JulianDate.addSeconds(e,86400,new this._cesium.JulianDate);this._viewer.clock.stopTime=t.clone()},n.prototype.forceEndHanlder=function(){this.handler&&(this.handler.destroy(),this.handler=void 0)},n}),define("SGWorld/ProjectTree/TreeSource",["../../../node_modules/lodash/lodash.min"],function(a){"use strict";var s={Source:[],TempSource:[],entity:[],lastSelectEntity:null,pointsId:[],states:0,PointSelectSource:[],currentObj:null,selectedItem:null,setSource:function(e){this.Source=e},setTempSource:function(e){this.TempSource=e},setPointSelectSource:function(e){this.PointSelectSource=e},getSource:function(){return this.Source},getTempSource:function(){return this.TempSource},getPointSelectSource:function(){return this.PointSelectSource},push:function(e){this.Source.push(e)},pusTemSource:function(e){this.TempSource.push(e)},pusPointSelectSource:function(e){this.PointSelectSource.push(e)},insertGroupId:function(e,t){null!=e.checked&&"true"!=e.checked&&null!=e.checked||(e.checked=!0);try{0==e.item.item.show&&(e.checked=!1)}catch(e){}var i=this.getSourceById(s.Source,t);if(i){for(var r=0,o=this.TempSource.length;r<o;r++)if(this.TempSource[r].id==t){e.checked&&!this.TempSource[r].checked&&(this.TempSource[r].checked=!0);break}i.children||(i.children=[]),i.children.push(e)}else this.push(e);var n=a.clone(e);return n.item=null,s.currentObj=n,this.pusTemSource(n),e.id},getSourceById:function(e,t){if(e)for(var i=0;i<e.length;i++){if(e[i].id==t)return e[i];if(e[i]&&e[i].children&&0<e[i].children.length){var r=this.getSourceById(e[i].children,t);if(null!=r)return r}}},exitsGroup:function(e,t){if(e)for(var i=s.Source,r=0;r<i.length;r++){if(i[r].id==e){if("group"==i[r].type)for(var o=0;o<i[r].children.length;o++){if(i[r].children[o].name==t)return!0}return!1}if(i[r]&&i[r].children&&0<i[r].children.length)this.getSourceById(i[r].children,e)}},getTempSourceById:function(e){for(var t=0;t<this.TempSource.length;t++)if(this.TempSource[t].id==e)return this.TempSource[t]},getPointSelectSourceById:function(e){for(var t=0;t<this.PointSelectSource.length;t++)if(this.PointSelectSource[t].id==e)return this.PointSelectSource[t]},getSourceByName:function(e,t){return a.find(e,function(e){return e.name==t})},delete:function(e,t,i){var r=this.getSourceById(s.Source,e);if(r&&r.children&&0<r.children.length){for(;0<r.children.length;)this.delete(r.children[0].id);if(r&&"group"==r.type)if(0==r.pId||""==r.pId){var o=this.getIndex(s.Source,r);s.Source.splice(o,1),this.delete1(r.id)}else{var n=this.getSourceById(s.Source,r.pId);o=this.getIndex(n.children,r);n.children.splice(o,1),this.delete1(r.id)}else{if(r.item)r.item.deleteObject(e);else{try{t.entities.removeById(r.id)}catch(e){}try{(a=t.dataSources.get(r.id))&&t.dataSources.remove(a)}catch(e){}try{(a=t.imageryLayers.get(r.id))&&t.imageryLayers.remove(a)}catch(e){}try{var a=t.scene.primitives.get(r.id);t.scene.primitives.remove(a)}catch(e){}}n=this.getSourceById(s.Source,r.pId),o=this.getIndex(n.children,r);n.children.splice(o,1),this.delete1(r.id)}}else if(r&&"group"==r.type)if(0==r.pId||""==r.pId){o=this.getIndex(s.Source,r);s.Source.splice(o,1),this.delete1(r.id)}else{n=this.getSourceById(s.Source,r.pId),o=this.getIndex(n.children,r);n.children.splice(o,1),this.delete1(r.id)}else if(r){if(r.item&&r.item.deleteObject)r.item.deleteObject(e);else{try{t.entities.removeById(r.id)}catch(e){}try{(a=t.dataSources.get(r.id))&&t.dataSources.remove(a)}catch(e){}try{(a=t.imageryLayers.get(r.id))&&t.imageryLayers.remove(a)}catch(e){}try{a=t.scene.primitives.get(r.id);t.scene.primitives.remove(a)}catch(e){}}if(this.delete1(r.id),n=this.getSourceById(s.Source,r.pId)){o=this.getIndex(n.children,r);n.children.splice(o,1)}}},temporaryItem:{obj:[],state:"start",operation:""},endtemporaryItem:function(){s.temporaryItem.obj=[],s.temporaryItem.state="end",s.temporaryItem.operation=""},starttemporaryItem:function(e){var t=null;try{t=document.getElementById("toolTip")}catch(e){}if(null!=t&&(t.style.display="none"),null!=s.handler&&(s.handler.destroy(),s.handler=null),0<s.temporaryItem.obj.length&&"start"==s.temporaryItem.state)for(var i=0;i<s.temporaryItem.obj.length;i++){try{s.temporaryItem.obj[i].destroy()}catch(e){}try{e.entities.remove(s.temporaryItem.obj[i])}catch(e){}}return s.temporaryItem.obj=[],s.temporaryItem.state="start",s.temporaryItem.operation},delete1:function(e){for(var t=0;t<this.TempSource.length;t++)this.TempSource[t].id==e&&this.TempSource.splice(t,1)},getIndex:function(e,t){for(var i=0;i<e.length;i++)if(e[i].id==t.id)return i;return-1},setVisibilityTemp:function(t,e){var i=a.filter(this.TempSource,function(e){return e.id==t});i&&i.length&&(i[0].checked=e)},setVisibility:function(e,t,i,r){this.setVisibilityTemp(e,t);var o=this.getSourceById(s.Source,e);if(o)if(o.children&&0<o.children.length){for(var n=0;n<o.children.length;n++)this.setVisibility(o.children[n].id,t);if("group"==o.type);else if(o.item&&o.item.setVisibility)o.item.setVisibility(t,e);else{try{(a=i.entities.getById(o.id))&&(a.show=t)}catch(e){}try{(a=i.dataSources.get(o.id))&&(a.show=t)}catch(e){}try{(a=i.imageryLayers.get(o.id))&&(a.show=t)}catch(e){}try{(a=i.scene.primitives.get(o.id))&&(a.show=t)}catch(e){}}}else if("group"==o.type);else if(o.item&&o.item.setVisibility)o.item.setVisibility(t,e);else{try{(a=i.entities.getById(o.id))&&(a.show=t)}catch(e){}try{(a=i.dataSources.get(o.id))&&(a.show=t)}catch(e){}try{(a=i.imageryLayers.get(o.id))&&(a.show=t)}catch(e){}try{var a;(a=i.scene.primitives.get(o.id))&&(a.show=t)}catch(e){}}},removeItem:function(e){if(e)for(var t=0;t<e.length;t++)e[t].item=null,e[t].children&&this.removeItem(e[t].children);return e},changeGroup:function(e,t){var i=this.getSourceById(this.Source,e),r=this.getSourceById(this.Source,t);if(i&&r&&r.children)if(0==i.id||null==i.id||null==i.id){var o=this.getIndex(this.Source,i);this.Source.splice(o,1),i.pId=t,r.children.push(i)}else{var n=this.getSourceById(this.Source,i.pId);o=this.getIndex(n.children,i);n.children.splice(o,1),i.pId=t,r.children.push(i)}(i=this.getTempSourceById(e))&&(i.pId=t)},handler:null,removeHandler:function(){s.handler&&(s.handler.destroy(),s.handler=null)}};return s}),define("SGWorld/Creator/Vector",["../Core/Core","../ProjectTree/TreeSource"],function(i,n){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=n}return e.prototype.createMVTWithStyle=function(e,t,i){this.item=this._viewer.imageryLayers.addImageryProvider(t);var r=0;this._core.isnull(n.selectedItem)||"group"!=n.selectedItem.type||(r=n.selectedItem.id);var o=this._core.getuid();n.insertGroupId({id:o,name:"矢量"+o,pId:this._core.isnull(r)?0:r,type:"polyline",item:this},this._core.isnull(r)?0:r)},e.prototype.setVisibility=function(e){this.item.show=e},e.prototype.getVisibility=function(){return this.item.show},e.prototype.deleteObject=function(){return this._viewer.imageryLayers.remove(this.item)},Object.defineProperties(e.prototype,{url:{set:function(e){},get:function(){}}}),e.prototype.setItem=function(e){this.item=e},e}),define("SGWorld/Creator/TerrainProvider",["../Core/Core","../ProjectTree/treeSource"],function(i,r){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=r,this._terrainProvider}return e.prototype.createterrainProvider=function(e,t,i,r){var o=this._core.extend({url:""},t,!0),n=new this._cesium.CesiumTerrainProvider(o);return this._viewer.terrainProvider=n,this._terrainProvider=n,this.item=this._viewer.terrainProvider,"function"==typeof r&&r(dataSource),this._core.isnull(o.id)&&(o.id=this._core.getuid()),this._tree.insertGroupId({id:o.id,name:e,pId:this._core.isnull(i)?0:i,type:"terrainProvider",item:this},this._core.isnull(i)?0:i),this},e.prototype.setVisibility=function(e){var t;e?this._viewer.scene.terrainProvider=this._terrainProvider:(t=new this._cesium.EllipsoidTerrainProvider({}),this._viewer.scene.terrainProvider=t)},e.prototype.getVisibility=function(){return this.item.show},e.prototype.deleteObject=function(){var e=this._viewer.scene,t=new this._cesium.EllipsoidTerrainProvider({});e.terrainProvider=t},Object.defineProperties(e.prototype,{url:{set:function(e){},get:function(){}}}),e.prototype.setItem=function(e){this.item=e},e}),define("SGWorld/Creator/MapGeoJsonFeatureLayer",["../Core/Core","./Color","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min"],function(i,r,o,e){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._color=new r(this._viewer,this._cesium),this._tree=o,this._River1=[],this._points=null}return t.prototype.createPolygonMapGeoJsonFeatureLayer=function(e,t,m,i,p,g){var r={height:0,extrudedHeight:0,heightReference:this._cesium.HeightReference.NONE,show:!1,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:0,granularity:this._cesium.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:this._cesium.ShadowMode.DISABLED};this._core.isnull(m)||this._core.isnull(m.outlineColor)||(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),1<m.outlineColor.r&&(m.outlineColor.r=m.outlineColor.r/255),1<m.outlineColor.g&&(m.outlineColor.g=m.outlineColor.g/255),1<m.outlineColor.b&&(m.outlineColor.b=m.outlineColor.b/255),1<m.outlineColor.a&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a))),this._core.isnull(m)||this._core.isnull(m.fill)||(this._core.isHtmlColor(m.fill)?m.fill=this._color.colorFromHtmlColor(m.fill):(/^rgb/.test(m.fill)&&(m.fill=this._color.rgbaStringToRgbaObj(m.fill)),1<m.fill.r&&(m.fill.r=m.fill.r/255),1<m.fill.g&&(m.fill.g=m.fill.g/255),1<m.fill.b&&(m.fill.b=m.fill.b/255),1<m.fill.a&&(m.fill.a=m.fill.a/255),m.fill=this._color.createColor(m.fill.r,m.fill.g,m.fill.b,m.fill.a)));var f=this._core.extend(r,m,!0);null==t&&console.log("geojson is required");var o=null;o=t.then?t:this._cesium.GeoJsonDataSource.load(t),this._viewer.dataSources.add(o);var v=this;o.then(function(e){var t=e.entities.values;v._core.isnull(m.near)&&(m.near=0),v._core.isnull(m.far)&&(m.far=999999999);var i=parseFloat(m.near),r=parseFloat(m.far),o=new v._cesium.DistanceDisplayCondition(i,r);f.distanceDisplayCondition=o;for(var n=[],a=0;a<t.length;a++){var s=t[a];f.extrudedHeight=v._core.extendgl(s,f.extrudedHeight),f.height=v._core.extendgl(s,f.height),f.vertexFormat=v._core.extendgl(s,f.vertexFormat),f.polygonHierarchy=v._core.extendgl(s,f.polygonHierarchy),s.polygon.height=f.height,s.polygon.extrudedHeight=f.extrudedHeight,s.polygon.heightReference=f.heightReference,s.polygon.show=f.show,s.polygon.fill=f.fill,s.polygon.material=f.material,s.polygon.outline=f.outline,s.polygon.outlineColor=f.outlineColor,s.polygon.outlineWidth=f.outlineWidth,s.polygon.stRotation=f.stRotation,s.polygon.granularity=f.granularity,s.polygon.distanceDisplayCondition=o,s.polygon.perPositionHeight=f.perPositionHeight,s.polygon.closeTop=f.closeTop,s.polygon.closeBottom=f.closeBottom,s.polygon.shadows=f.shadows;var l=new v._cesium.PolygonGeometry({polygonHierarchy:new v._cesium.PolygonHierarchy(s.polygon._hierarchy._value.positions),extrudedHeight:f.extrudedHeight,height:f.height,vertexFormat:v._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT}),u=v._cesium.PolygonGeometry.createGeometry(l),c=new v._cesium.GeometryInstance({id:s,geometry:u});n.push(c)}var h,d=new v._cesium.Primitive({geometryInstances:n,appearance:new v._cesium.EllipsoidSurfaceAppearance({material:new v._cesium.Material({fabric:{type:"Water",uniforms:{blendColor:new v._cesium.Color(0,0,1,.5),normalMap:m.material,frequency:1e3,animationSpeed:.01,amplitude:10}}})}),show:!0});m&&m.time&&(h=new v._cesium.TimeIntervalCollection([new v._cesium.TimeInterval({start:m.time.start?v._cesium.JulianDate.fromDate(new Date(m.time.start)):v._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?v._cesium.JulianDate.fromDate(new Date(m.time.end)):v._cesium.Iso8601.MAXIMUM_VALUE})]));v._viewer.scene.primitives.add(d,h);v.item=d,p||v.setVisibility(!1),"function"==typeof g&&g(e)}),this._core.isnull(f.id)&&(f.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+f.id);var n={id:f.id,name:e,checked:p,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:v,url:t,style:f};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},t.prototype.getType=function(){return{label:"面",value:"polygonLayer"}},t.prototype.setTreeobj=function(e){this.treeobj=e},t.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},t.prototype.setVisibility=function(e){for(var t=0;t<this._River1.length;t++){this._River1[t].getGeometryInstanceAttributes("polygon1sp").show=e}},t.prototype.deleteObject=function(){if(this._viewer.entities.remove(this.item),null!=this._points&&null!=this._points&&0<this._points.length)for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e]);try{this._viewer.scene.primitives.remove(this.item)}catch(e){console.log(e)}},t.prototype.setVisibility=function(e){this.item.show=e},t.prototype.getVisibility=function(){return this.item.show},t.prototype.setItem=function(e){this.item=e},t}),define("SGWorld/Creator/WorkerPool",[],function(){"use strict";var e=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(e){if(e=e||[],!Cesium.defined(e.workerPath))throw new Cesium.DeveloperError("workerPath is required.");this._workerPath=e.workerPath,this._poolSize=Cesium.defaultValue(e.poolSize,16),this._workers=[],this._defered=[]});return Object.defineProperties(e.prototype,{errorEvent:{get:function(){return this.errorEvent}},poolSize:{get:function(){return this._poolSize}}}),e.prototype.queueWorkItem=function(e,t){for(var i=Cesium.when.defer(),r=null,o=999999,n=0;n<this._workers.length;n++){r=this._workers[n];this._workers[n].jobQueueSize<o&&(r=this._workers[n],o=this._workers[n].jobQueueSize)}if(0<o&&this._workers.length<this.poolSize){r=new Worker(this._workerPath);var a=this;r.addEventListener("message",function(e){a.onWorkerMessage(e)},!1),r.addEventListener("error",function(e){a.onWorkerError(e)},!1),r.jobQueueSize=0,this._workers.push(r),r.id=Cesium.createGuid()}e.workerId=r.id;var s=Cesium.createGuid();return e.deferedId=s,this._defered[s]=i,r.jobQueueSize++,r.postMessage(e,t),i},e.prototype.trimPool=function(e){var t=this;if(null==e)return null!=this.timerId&&clearTimeout(this.timerId),void(this.timerId=setTimeout(function(){t.trimPool(!0)},5e3));for(var i=0;i<this._workers.length;i++)0==this._workers[i].jobQueueSize&&(this._workers[i].terminate(),this._workers.splice(i,1),i--);this._workers.length?this.timerId=setTimeout(function(){t.trimPool(!0)},5e3):this.timerId=null},e.prototype.onWorkerMessage=function(e){var t=e.data,i=function(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return i}(this._workers,function(e){return e.id===t.workerId});null!=i&&(this._workers[i].jobQueueSize--,this.trimPool());var r=this._defered[t.deferedId];delete this._defered[t.deferedId],r.resolve(t)},e.prototype.onWorkerError=function(e){console.log(e)},e}),define("SGWorld/Creator/SFSTerrainProvider7.2.3",["./WorkerPool"],function(o){"use strict";var w,u=function(e,p,g,f){var v=[],_=void 0!==e[0].longitude;return e.forEach(function(e){var t,i,r,o,n,a,s,l,u,c,h,d=[],m=_?e:w.scene.globe.ellipsoid.cartesianToCartographic(e);t=m,r=g,o=f,n=(i=p).west,a=i.east,s=i.south,l=a-n,u=i.north-s,c=180*t.longitude/Math.PI,h=180*t.latitude/Math.PI,t.normalizedLongitude=(c-n)/l*r,t.normalizedLatitude=(h-s)/u*o,m=t,d.push(m.normalizedLongitude),d.push(m.normalizedLatitude),v.push(d)}),v},a=function(e,t,i){var r=t.west*Cesium.Math.DEGREES_PER_RADIAN,o=t.east*Cesium.Math.DEGREES_PER_RADIAN,n=t.south*Cesium.Math.DEGREES_PER_RADIAN,a=t.north*Cesium.Math.DEGREES_PER_RADIAN,s=new Cesium.Rectangle(r,n,o,a),l=u(e,s,32,32);return c(l,"#FF0000",32,32)},c=function(e,t,i,r,o){void 0===o&&((o=document.createElement("canvas")).width=i,o.height=r);var n=o.getContext("2d");if(!(e.length<=0)){n.moveTo(e[0][0],e[0][1]);for(var a=0;a<e.length;a++)n.lineTo(e[a][0],e[a][1]);return null!=t&&null!=t&&(n.fillStyle=t,n.fill()),o}};function s(e,t){return Math.floor(Math.random()*(t-e+1))+e}function b(e,o){var i=Cesium.when.defer(),n=[];return e.forEach(function(e){var t,i,r;n.push((t=e,i=o,r=Cesium.when.defer(),(s=a(t.vertices,i,t.heights[0])).timeStamp=t.timeStamp,s.mtHeight=t.heights,s.mtType=t.mtType,s.fromKML=t.fromKML,s.rect=t.rectangle,s.level=t.level,r.resolve(s),r))}),Cesium.when.all(n,function(e){e[0].lenght;if(1===e.length)i.resolve(e[0]);else{var t=e.sort(function(e,t){return t.timeStamp-e.timeStamp}),r=t.shift();t.forEach(function(i){r.forEach(function(e,t){e===s&&i[t]!==s&&(r[t]=i[t])})}),i.resolve(r)}}),i}var t=function(e,t){if(w=e,!Cesium.defined(t))throw new Cesium.DeveloperError("options is required.");this._errorEvent=new Cesium.Event,this._modelFloorMasks={},this._credit=t.credit,"string"==typeof this._credit&&(this._credit=new Cesium.Credit(this._credit)),t.heightMapWidth=Cesium.defaultValue(t.heightMapWidth,32),t.heightMapHeight=Cesium.defaultValue(t.heightMapHeight,32),this._options=t,this.readyPromise=Cesium.when.resolve(!0),this._subdomains=t.subdomains,t.firstRequestUrl=t.url.replace("{s}",this.sTag(0,0,0)),this._firstRequest=t.firstRequestUrl+"?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox=-90,-180,90,180&height=32&width=32&optimizedOnly=0&v=1&layers="+t.layerName+"&Styles=&Format=image/mpt";var i=this,r=t.pngOnly;void 0!==t.maxTerrainLevel&&isNaN(t.maxTerrainLevel)&&(t.maxTerrainLevel=void 0),this._maxTerrainLevel=Cesium.defaultValue(t.maxTerrainLevel,30),r?i.setFormatMPT(!1):$.ajax({url:t.cacheUrl?t.cacheUrl+"/0/0/0.mpt":this._firstRequest,success:function(e){if(!!(Cesium.defined(e.childNodes)&&0<e.childNodes.length))return i.setFormatMPT(!1),null;i.setFormatMPT(!0)},error:function(){return i.setFormatMPT(!1),null},async:!1}),t.cacheUrl&&(this.isCache=!0,this.cacheLevel=t.cacheLevel||16,this._cacheUrl=t.cacheUrl+"/{z}/{x}/{y}.mpt"),this._urlTemplate=t.url+"?request=GetMap&Version=1.3.0&Service=WMS&v=1&CRS=EPSG:4326&bbox={south},{west},{north},{east}&height={height}&width={width}&optimizedOnly={optimizedOnly}&layers="+t.layerName+"&Styles=&Format=image/"+this._format,this._allElevationLayers=null,this._tilingScheme=new Cesium.GeographicTilingScheme,this._levelZeroMaximumGeometricError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,4*t.heightMapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._workerPool=new o({workerPath:function(){for(var e=document.scripts,t="./js/sfsterrainprovider/ParseElevationWorker.js",i=0;i<e.length;i++){var r=e[i].src.split("/"),o=r[r.length-1];"SmartEarth.js"==o?t=e[i].outerHTML.split('"')[1].replace("SmartEarth.js","Workers/ParseElevationWorker.js"):"SmartEarth.min.js"==o&&(t=e[i].outerHTML.split('"')[1].replace("SmartEarth.min.js","Workers/ParseElevationWorker.js"))}return t}()}),this._pendingRequests=0,this._requestGridSize=8,this._requestsCache={},this._requestsCacheKeys=[],this.errorEvent.addEventListener(function(e){},this)};return t._geometricErrorFactor=2,Object.defineProperties(t.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasVertexNormals:{get:function(){return!1}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},hasWaterMask:{get:function(){return!1}},heightMapHeight:{get:function(){return this._options.heightMapHeight}},heightMapWidth:{get:function(){return this._options.heightMapWidth}},pendingRequests:{get:function(){return this._pendingRequests}}}),t.prototype.setFormatMPT=function(e){if(!e||!this.pngOnly){var t=this._format;this._format=e?"mpt":"png",t!==this._format&&(this._isMPT=e,void 0!==this._urlTemplate&&(this._urlTemplate=this._urlTemplate.replace("image/"+t,"image/"+this._format)))}},t.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)*t._geometricErrorFactor},t.prototype.createKeyFromTile=function(e,t,i){return e+"_"+t+"_"+i},t.prototype.getTileDataAvailable=function(e,t,i){var r=Math.min(this._maxTerrainLevel,25);return!!this._isMPT||i<r},t.prototype.requestFactorForLevel=function(e){var t=Math.log(this._requestGridSize)/Math.log(2);return t=Math.min(t,e),Math.pow(2,t)},t.prototype.getRequestBaseTerrainUrl=function(e,t,i,r){return this.getRequestUrl(e,t,i,r)},t.prototype.getRequestElevationLayer=function(e,t,i){return this.getRequestUrl(e,t,i,!1,!0)},t.prototype.getRequestUrl=function(e,t,i,r,o){var n=i,a=null!=r?this.requestFactorForLevel(i):1;e=null!=r?(e-e%a)/a:e,t=null!=r?(t-t%a)/a:t,i=null!=r?i-Math.log(a)/Math.log(2):i;if(this.isCache&&0!==i&&i<=this.cacheLevel)return this._cacheUrl.replace("{x}",e).replace("{y}",t).replace("{z}",i);var s=this.tilingScheme.tileXYToNativeRectangle(e,t,i),l=this.heightMapWidth*a==256&&r?1:0;return o&&(l=0),this._urlTemplate.replace("{south}",s.south).replace("{north}",s.north).replace("{west}",s.west).replace("{east}",s.east).replace("{optimizedOnly}",l).replace("{width}",this.heightMapWidth*a).replace("{height}",this.heightMapHeight*a).replace("{s}",this.sTag(e,t,i))+"&level="+i+"&origLevel="+n},t.prototype.isT_Inside_E=function(e,t){return e.west>=t.west*Cesium.Math.DEGREES_PER_RADIAN&&e.east<=t.east*Cesium.Math.DEGREES_PER_RADIAN&&e.south>=t.south*Cesium.Math.DEGREES_PER_RADIAN&&e.north<=t.north*Cesium.Math.DEGREES_PER_RADIAN},t.prototype.isT_Intersects_E=function(e,t){var i=e.west*Cesium.Math.RADIANS_PER_DEGREE,r=e.east*Cesium.Math.RADIANS_PER_DEGREE,o=e.south*Cesium.Math.RADIANS_PER_DEGREE,n=e.north*Cesium.Math.RADIANS_PER_DEGREE,a=new Cesium.Rectangle(i,o,r,n);return Cesium.Rectangle.intersection(a,t,new Cesium.Rectangle)},t.prototype.sTag=function(e,t,i){if(null==this._subdomains)return"";var r=(e+t+i)%this._subdomains.length;return this._subdomains[r]},t.prototype.refreshElevationLayer=function(e){e.rectangle&&void 0!==w.scene.globe._surface._levelZeroTiles&&this.findDirectParent(e.rectangle,!0).freeResources()},t.prototype.findDirectParent=function(e,t){var i=function e(t,i,r){var o=r?4.1:2.1;if(t._rectangle.width<=i.width*o&&Cesium.Rectangle.contains(t._rectangle,Cesium.Rectangle.center(i)))return t;for(var n=t.children.length,a=0;a<n;a++){var s=t.children[a];if(Cesium.Rectangle.contains(s._rectangle,Cesium.Rectangle.center(i)))return e(s,i,r)}return null};if(e.width==Math.PI)return null;for(var r=0;r<w.scene.globe._surface._levelZeroTiles.length;r++){var o=i(w.scene.globe._surface._levelZeroTiles[r],e,t);if(o)return o}return null},t.prototype.isTileAvailable=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(e,t,i,new Cesium.Rectangle),o=this.findDirectParent(r);if(o&&o.data&&o.data.terrainData){if(!(0<o.data.terrainData._childTileMask))return!1;for(var n=o.children.length,a=0;a<n;a++){var s=o.children[a];if(Cesium.Rectangle.equals(s._rectangle,r))return o.data.terrainData._childTileMask&1<<a}}return!0},t.prototype.markTileAsUnavailable=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(e,t,i,new Cesium.Rectangle),o=this.findDirectParent(r);o&&o.data&&o.data.terrainData&&0<o.data.terrainData._childTileMask&&$.each(o.children,function(e,t){if(Cesium.Rectangle.equals(t._rectangle,r)){switch(e){case 0:o.data.terrainData._childTileMask&=-5;break;case 1:o.data.terrainData._childTileMask&=-9;break;case 2:o.data.terrainData._childTileMask&=-2;break;case 3:o.data.terrainData._childTileMask&=-3}return!1}return!0})},t.prototype.requestBaseTerrainTileGeometry=function(e,t,i,r){return this.requestTileGeometryBuffers(e,t,i,r)},t.prototype.requestElevationLayerTileGeometry=function(e,t,i,r,o){return this.requestTileGeometryBuffers(e,t,i,r,o)},t.prototype.requestTileGeometryBuffers=function(e,t,i,r,o){var m=this,p={};p.requestedRectangle=this.tilingScheme.tileXYToNativeRectangle(e,t,i),p.layer=o;var n,a,s,l,g=Cesium.when.defer();return void 0===(l=this.requestTileHeightBuffer(e,t,i,r,void 0,o))?void 0:(n=this.requestTileHeightBuffer(e+1,t,i,r,!0,o),a=this.requestTileHeightBuffer(e,t+1,i,r,!0,o),s=this.requestTileHeightBuffer(e+1,t+1,i,r,!0,o),Cesium.when.all([l,n,a,s],function(e){if(null!=e[0].myReject&&e[0].myReject)g.reject();else{for(var t=m.heightMapWidth+1,i=m.heightMapHeight+1,r=new Float32Array(t*i),o=e[0].isFloor,n=0;n<t;n++)for(var a=0;a<i;a++){var s=n,l=a,u=0;a===t-1&&(l=0,u=1,o&&(u=0,l=t-2)),n===i-1&&(s=0,u=2);var c=n*t+a,h=s*m.heightMapWidth+l;null!==e[u]&&(null==e[u].myReject||!e[u].myReject)&&(r[c]=e[u][h])}null!=e[3].myReject&&e[3].myReject||(r[t*i-1]=e[3][0]);var d=m.arrayToHeightmapTerrainData(r,t,i,15);p.buffer=d,g.resolve(p)}}).otherwise(function(){g.reject()}),g)},t.prototype.requestTileGeometry=function(r,o,n,a){var s=this,l=[],u=s.tilingScheme.tileXYToNativeRectangle(r,o,n);null!=this._allElevationLayers&&0<this._allElevationLayers.length&&7<n?$(this._allElevationLayers).each(function(e,t){if(t.show){var i=t.rectangle;s.isT_Inside_E(u,i)?(s.setFormatMPT(!1),l.push(s.requestElevationLayerTileGeometry(r,o,n,a,t))):(null!=s.isT_Intersects_E(u,i)?(s.setFormatMPT(!1),l.push(s.requestElevationLayerTileGeometry(r,o,n,a,t))):s.setFormatMPT(!0),l.push(s.requestBaseTerrainTileGeometry(r,o,n,a)))}else s.setFormatMPT(!0),l.push(s.requestBaseTerrainTileGeometry(r,o,n,a))}):(s.setFormatMPT(!0),l.push(s.requestBaseTerrainTileGeometry(r,o,n,a)));var c=Cesium.when.defer();return Cesium.when.all(l,function(e){if(1===e.length)void 0!==e.layer&&console.log("missing scale and offset"),c.resolve(e[0].buffer);else if(1<e.length){var t=$.grep(e,function(e){return void 0!==e.layer}),i=$.grep(e,function(e){return void 0===e.layer});if(0===t.length)c.resolve(e[0].buffer);else{var r=t[t.length-1],o=i[i.length-1],n={tolerance:r.layer.nullTolerance,nullValueNumber:r.layer.nullValueNumber,verticesX:r.layer.polygonVerticesX,verticesY:r.layer.polygonVerticesY,scale:Cesium.defaultValue(r.layer.scale,1),offset:Cesium.defaultValue(r.layer.offset,0)};c.resolve(s.mergeBuffers(o.buffer,r.buffer,n,o.requestedRectangle))}}else c.reject()}).otherwise(function(){c.reject()}),c},t.prototype.mergeBuffers=function(e,t,i,r){var o,n,a,s,l,u=r.west,c=r.north,h=(r.east,r.south,r.width/33),d=r.height/33,m=i.scale,p=i.offset,g=i.nullValueNumber,f=i.tolerance,v=void 0!==g&&void 0!==f;if(v)var _=Cesium.defaultValue(i.nullValueNumber,0),y=Cesium.defaultValue(Number(i.tolerance),0);var C=new Float32Array(1089);for(o=0,l=c;o<33;o++,l+=d)for(n=0,s=u;n<33;n++,s+=h)C[a=33*o+n]=v?!t._buffer[a]||t._buffer[a]>=_-y&&t._buffer[a]<=_+y?e._buffer[a]:t._buffer[a]*m+p:t._buffer[a]?t._buffer[a]*m+p:e._buffer[a];return this.arrayToHeightmapTerrainData(C,33,33,15)},t.prototype.requestTileHeightBuffer=function(u,c,h,e,t,r){if(!isNaN(u+c+h)){Cesium.defined(e)&&!1!==e||(e=new Cesium.Request({defer:!0}));var i=0==e.defer;t=Cesium.defaultValue(i,!1);var o,d=Cesium.when.defer();if(void 0!==r)r.getUrlFromSTag=function(e,t,i){return void 0===r.subdomains?r.url:r.subdomains[0]+"/SG"},o=this.getRequestElevationLayer(u,c,h).replace(this._options.url,r.getUrlFromSTag(u,c,h)+"/Elevation").replace(this._options.layerName,r.name),"mpt"===r.format&&(o=o.replace("image/png","image/mpt"));else{o=this.getRequestBaseTerrainUrl(u,c,h,i||t);var m=w.terrainProvider.tilingScheme.tileXYToRectangle(u,c,h),n=w.terrainProvider._modifyTerrainObjects,a=Cesium.when.defer();if(void 0!==n){var s=[];if(n.forEach(function(e){e.show&&null!=Cesium.Rectangle.intersection(m,e.rectangle,new Cesium.Rectangle)&&s.push(e)}),0<s.length)if(1===s.length&&s[0].modelFloorBestLevel&&h>s[0].modelFloorBestLevel)a.resolve("NoMerge");else{var l=b(s,m);Cesium.when(l,function(e){a.resolve(e)}).otherwise(function(e){console.log(e)})}else a.resolve("NoMerge")}else a.resolve("NoMerge");var p=Cesium.when.defer(),g=$.grep([],function(e){return 0<e._selectedTiles.length});if(1===g.length&&g[0].level&&h>g[0].level)p.resolve("NoFloor");else{var f=!1;g.forEach(function(e){if(e.ready&&e.show&&void 0!==e.rootFloorRectangle&&void 0!==Cesium.Rectangle.intersection(m,e.rootFloorRectangle)){for(var t,i=new Uint16Array(1024),r=m.west,o=(m.south,(m.east-m.west)/32),n=(m.north-m.south)/32,a=0;a<32;a++)for(var s=0;s<32;s++){var l=r+o*s+o/2,u=m.north-n*a-n/2,c=new Cesium.Cartographic(l,u);t=65535;var h=e.getHRMTFP(e,c,!0);null!=h&&h.content&&h.content._model&&h.content._model.floor&&(t=h.content._model.floor.getHeight(c.longitude,c.latitude)),65535!==t&&(t+=1.5),i[32*a+s]=t}f=!0,p.resolve(i)}}),f||p.resolve("NoFloor")}w.scene.globe.ellipsoid}if(!1===this._requestsCache.hasOwnProperty(o)){if(this._requestsCache[o]={},this._requestsCacheKeys.push(o),100<this._requestsCacheKeys.length){for(var v=0;v<50;v++)delete this._requestsCache[this._requestsCacheKeys[v]];this._requestsCacheKeys.splice(0,50)}}else{var _=this._requestsCacheKeys.indexOf(o);this._requestsCacheKeys.splice(_,1),this._requestsCacheKeys.push(o)}var y=this._requestsCache[o];if(void 0!==y.dataLoaded||(y.dataLoaded=Cesium.Resource.fetchArrayBuffer(o),Cesium.defined(y.dataLoaded))){var C=this;return this._pendingRequests++,Cesium.when(y.dataLoaded,function(e){void 0===y.workerFinished&&(y.workerFinished=C._workerPool.queueWorkItem({buffer:e,isElevation:void 0!==r,level:h})),Cesium.when.all([y.workerFinished,a,p],function(e){var t=void 0!==e[1]&&"NoMerge"!==e[1],i=void 0!==e[2]&&"NoFloor"!==e[2];if(e[0].rejected){for(var r=C.heightMapWidth*C.heightMapHeight,o=new Int16Array(r),n=0;n<r;n++)o[n]=300;return 2<h&&(o.myReject=!0),d.resolve(o),d}var a=C.extractTileHeightBuffer(e[0].buffer,u,c,h);if(C._pendingRequests--,t)for(n=0;n<32;n++)for(var s=0;s<32;s++){a[l=32*n+s]=e[1].mtHeight[0]}if(i){for(n=0;n<32;n++)for(s=0;s<32;s++){var l;a[l=32*n+s]=65535===e[2][l]||10500<e[2][l]?a[l]:e[2][l]}a.isFloor=!0}d.resolve(a)}).otherwise(function(){for(var e=C.heightMapWidth*C.heightMapHeight,t=new Int16Array(e),i=0;i<e;i++)t[i]=300;return 2<h&&(t.myReject=!0),d.resolve(t),d})}).otherwise(function(){C._pendingRequests--,d.reject()}),d}}},t.prototype.extractTileHeightBuffer=function(e,t,i,r){try{for(var o=this.requestFactorForLevel(r),n=t%o,a=i%o,s=new Float32Array(this.heightMapWidth*this.heightMapHeight),l=1e6,u=-1e5,c=0;c<this.heightMapHeight;c++)for(var h=0;h<this.heightMapWidth;h++){var d=c+a*this.heightMapHeight,m=h+n*this.heightMapWidth,p=c*this.heightMapWidth+h,g=d*this.heightMapWidth*o+m;e[g]>u&&(u=e[g]),e[g]<l&&(l=e[g]),s[p]=e[g]}}catch(e){console.log(e.message)}return s},t.prototype.arrayToHeightmapTerrainData=function(e,t,i,r){!1===Cesium.defined(e)&&(e=new Int16Array(t*i));var o={buffer:e,width:t,height:i,childTileMask:r};return new Cesium.HeightmapTerrainData(o)},t}),define("SGWorld/Creator/SFSTerrainProvider",["./WorkerPool"],function(r){"use strict";var y,v=function(e,p,g,f){var v=[],_=void 0!==e[0].longitude;return e.forEach(function(e){var t,i,r,o,n,a,s,l,u,c,h,d=[],m=_?e:y.scene.globe.ellipsoid.cartesianToCartographic(e);t=m,r=g,o=f,n=(i=p).west,a=i.east,s=i.south,l=a-n,u=i.north-s,c=180*t.longitude/Math.PI,h=180*t.latitude/Math.PI,t.normalizedLongitude=(c-n)/l*r,t.normalizedLatitude=(h-s)/u*o,m=t,d.push(m.normalizedLongitude),d.push(m.normalizedLatitude),v.push(d)}),v},_=function(e,t,i,r,o){void 0===o&&((o=document.createElement("canvas")).width=i,o.height=r);var n=o.getContext("2d");if(!(e.length<=0)){n.moveTo(e[0][0],e[0][1]);for(var a=0;a<e.length;a++)n.lineTo(e[a][0],e[a][1]);return null!=t&&null!=t&&(n.fillStyle=t,n.fill()),o}};var t=function(e,t){if(y=e,!Cesium.defined(t))throw new Cesium.DeveloperError("options is required.");this._errorEvent=new Cesium.Event,this._credit=t.credit,"string"==typeof this._credit&&(this._credit=new Cesium.Credit(this._credit)),t.heightMapWidth=Cesium.defaultValue(t.heightMapWidth,32),t.heightMapHeight=Cesium.defaultValue(t.heightMapHeight,32),this._options=t,this._subdomains=t.subdomains,t.url=t.url.replace("{s}",this.sTag(0,0,0)),this._firstRequest=t.url+"?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox=-90,-180,90,180&height=32&width=32&optimizedOnly=0&layers="+t.layerName+"&Styles=&Format=image/mpt",t.token&&(this._firstRequest+="&token="+t.token),this._requestVertexNormals=Cesium.defaultValue(t.requestVertexNormals,!1);var i=this;$.ajax({url:this._firstRequest,success:function(e){if(!!(Cesium.defined(e.childNodes)&&0<e.childNodes.length))return i._isMPT=!1,i._format="png",null;i._isMPT=!0,i._format="mpt"},error:function(){return i._isMPT=!1,i._format="png",null},async:!1}),this._urlTemplate=t.url+"?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox={south},{west},{north},{east}&height={height}&width={width}&optimizedOnly={optimizedOnly}&layers="+t.layerName+"&Styles=&Format=image/"+this._format,t.token&&(this._urlTemplate+="&token="+t.token),this._tilingScheme=new Cesium.GeographicTilingScheme,this._levelZeroMaximumGeometricError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,4*t.heightMapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._workerPool=new r({workerPath:function(){for(var e=document.scripts,t="./js/sfsterrainprovider/ParseElevationWorker.js",i=0;i<e.length;i++){var r=e[i].src.split("/"),o=r[r.length-1];"SmartEarth.js"==o?t=e[i].outerHTML.split('"')[1].replace("SmartEarth.js","Workers/ParseElevationWorker.js"):"SmartEarth.min.js"==o&&(t=e[i].outerHTML.split('"')[1].replace("SmartEarth.min.js","Workers/ParseElevationWorker.js"))}return t}()}),this._pendingRequests=0,this._requestGridSize=8,this._requestsCache={},this._requestsCacheKeys=[],this.errorEvent.addEventListener(function(e){},this)};return t._geometricErrorFactor=2,Object.defineProperties(t.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},hasWaterMask:{get:function(){return!1}},heightMapHeight:{get:function(){return this._options.heightMapHeight}},heightMapWidth:{get:function(){return this._options.heightMapWidth}},pendingRequests:{get:function(){return this._pendingRequests}}}),t.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)*t._geometricErrorFactor},t.prototype.createKeyFromTile=function(e,t,i){return e+"_"+t+"_"+i},t.prototype.getTileDataAvailable=function(e,t,i){return this._isMPT?void 0:i<16},t.prototype.requestFactorForLevel=function(e){var t=Math.log(this._requestGridSize)/Math.log(2);return t=Math.min(t,e),Math.pow(2,t)},t.prototype.getRequestUrl=function(e,t,i,r){var o=this.requestFactorForLevel(i);e=(e-e%o)/o,t=(t-t%o)/o,i-=Math.log(o)/Math.log(2);var n=this.tilingScheme.tileXYToNativeRectangle(e,t,i),a=this.heightMapWidth*o==256&&r?1:0;return this._urlTemplate.replace("{south}",n.south).replace("{north}",n.north).replace("{west}",n.west).replace("{east}",n.east).replace("{optimizedOnly}",a).replace("{width}",this.heightMapWidth*o).replace("{height}",this.heightMapHeight*o).replace("{s}",this.sTag(e,t,i))},t.prototype.sTag=function(e,t,i){if(null==this._subdomains)return"";var r=(e+t+i)%this._subdomains.length;return this._subdomains[r]},t.prototype.findDirectParent=function(e){var t=function e(t,i){if(t._rectangle.width<=2.1*i.width&&Cesium.Rectangle.contains(t._rectangle,Cesium.Rectangle.center(i)))return t;for(var r=t.children.length,o=0;o<r;o++){var n=t.children[o];if(Cesium.Rectangle.contains(n._rectangle,Cesium.Rectangle.center(i)))return e(n,i)}return null};if(e.width==Math.PI)return null;for(var i=0;i<y.scene.globe._surface._levelZeroTiles.length;i++){var r=t(y.scene.globe._surface._levelZeroTiles[i],e);if(r)return r}return null},t.prototype.isTileAvailable=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(e,t,i,new Cesium.Rectangle),o=this.findDirectParent(r);if(o&&o.data&&o.data.terrainData){if(!(0<o.data.terrainData._childTileMask))return!1;for(var n=o.children.length,a=0;a<n;a++){var s=o.children[a];if(Cesium.Rectangle.equals(s._rectangle,r))return o.data.terrainData._childTileMask&1<<a}}return!0},t.prototype.markTileAsUnavailable=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(e,t,i,new Cesium.Rectangle),o=this.findDirectParent(r);o&&o.data&&o.data.terrainData&&0<o.data.terrainData._childTileMask&&$.each(o.children,function(e,t){if(Cesium.Rectangle.equals(t._rectangle,r)){switch(e){case 0:o.data.terrainData._childTileMask&=-5;break;case 1:o.data.terrainData._childTileMask&=-9;break;case 2:o.data.terrainData._childTileMask&=-2;break;case 3:o.data.terrainData._childTileMask&=-3}return!1}return!0})},t.prototype.requestTileGeometry=function(d,m,p,e){var t=this.requestTileHeightBuffer(d,m,p,e);if(void 0!==t){var g=this,i=this.requestTileHeightBuffer(d+1,m,p,e,!0),r=this.requestTileHeightBuffer(d,m+1,p,e,!0),o=this.requestTileHeightBuffer(d+1,m+1,p,e,!0),f=Cesium.when.defer();return Cesium.when.all([t,i,r,o],function(e){if(null!=e[0].myReject&&e[0].myReject)return g.markTileAsUnavailable(d,m,p),void f.reject();for(var t=g.heightMapWidth+1,i=g.heightMapHeight+1,r=new Float32Array(t*i),o=0;o<t;o++)for(var n=0;n<i;n++){var a=o,s=n,l=0;n===t-1&&(s=0,l=1),o===i-1&&(a=0,l=2);var u=o*t+n,c=a*g.heightMapWidth+s;null!==e[l]&&(null==e[l].myReject||!e[l].myReject)&&(r[u]=e[l][c])}null!=e[3].myReject&&e[3].myReject||(r[t*i-1]=e[3][0]);var h=g.arrayToHeightmapTerrainData(r,t,i,15);f.resolve(h)}).otherwise(function(){f.reject()}),f}},t.prototype.requestTileHeightBuffer=function(u,c,h,e,t){if(!isNaN(u+c+h)){Cesium.defined(e)&&!1!==e||(e=new Cesium.Request({defer:!0}));var i=0==e.defer;t=Cesium.defaultValue(i,!1);var d=Cesium.when.defer(),r=this.getRequestUrl(u,c,h,i||t);if(!1===this._requestsCache.hasOwnProperty(r)){if(this._requestsCache[r]={},this._requestsCacheKeys.push(r),100<this._requestsCacheKeys.length){for(var o=0;o<50;o++)delete this._requestsCache[this._requestsCacheKeys[o]];this._requestsCacheKeys.splice(0,50)}}else{var n=this._requestsCacheKeys.indexOf(r);this._requestsCacheKeys.splice(n,1),this._requestsCacheKeys.push(r)}var a=this._requestsCache[r];if(void 0!==a.dataLoaded||(a.dataLoaded=i?Cesium.RequestScheduler.request(r,Cesium.loadArrayBuffer):Cesium.loadArrayBuffer(r),Cesium.defined(a.dataLoaded))){var m=y.terrainProvider.tilingScheme.tileXYToRectangle(u,c,h),s=y.terrainProvider._modifyTerrainObjects,p=null,g=null;null!=s&&0<s.length&&s.forEach(function(e){var t,i,r,o,n,a,s,l;e.show&&(Cesium.Rectangle.intersection(m,e.rectangle,new Cesium.Rectangle)&&(t=(g=e).vertices,i=m,g.heights[0],r=i.west*Cesium.Math.DEGREES_PER_RADIAN,o=i.east*Cesium.Math.DEGREES_PER_RADIAN,n=i.south*Cesium.Math.DEGREES_PER_RADIAN,a=i.north*Cesium.Math.DEGREES_PER_RADIAN,s=new Cesium.Rectangle(r,n,o,a),l=v(t,s,32,32),p=_(l,"#FF0000",32,32)))});var f=this;return this._pendingRequests++,Cesium.when(a.dataLoaded,function(e){void 0===a.workerFinished&&(a.workerFinished=f._workerPool.queueWorkItem({buffer:e})),Cesium.when(a.workerFinished,function(e){if(e.rejected){for(var t=f.heightMapWidth*f.heightMapHeight,i=new Int16Array(t),r=0;r<t;r++)i[r]=300;return 2<h&&(f.markTileAsUnavailable(u,c,h),i.myReject=!0),d.resolve(i),d}var o=f.extractTileHeightBuffer(e.buffer,u,c,h);if(null!=p)for(var n=p.getContext("2d").getImageData(0,0,32,32).data,a=0;a<32;a++)for(var s=0;s<32;s++){var l=32*(31-a)+s;0!==n[4*(32*a+s)]&&(o[l]=g.heights[0])}f._pendingRequests--,d.resolve(o)})}).otherwise(function(){f._pendingRequests--,d.reject()}),d}}},t.prototype.extractTileHeightBuffer=function(e,t,i,r){try{for(var o=this.requestFactorForLevel(r),n=t%o,a=i%o,s=new Int16Array(this.heightMapWidth*this.heightMapHeight),l=1e6,u=-1e5,c=0;c<this.heightMapHeight;c++)for(var h=0;h<this.heightMapWidth;h++){var d=c+a*this.heightMapHeight,m=h+n*this.heightMapWidth,p=c*this.heightMapWidth+h,g=d*this.heightMapWidth*o+m;e[g]>u&&(u=e[g]),e[g]<l&&(l=e[g]),s[p]=e[g]}}catch(e){console.log(e.message)}return s},t.prototype.arrayToHeightmapTerrainData=function(e,t,i,r){!1===Cesium.defined(e)&&(e=new Int16Array(t*i));var o={buffer:e,width:t,height:i,childTileMask:r};return new Cesium.HeightmapTerrainData(o)},t}),define("SGWorld/Creator/Terrain",["./Color","../Core/Core","./SFSTerrainProvider7.2.3","./SFSTerrainProvider","../ProjectTree/treeSource"],function(e,i,s,l,u){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=u,this._url="",this._show=!0}return t.prototype.createTerrainLayer=function(e,t,i,r,o,n){"Topography"==n?this.createTerrain(e,t,i,r,o):"sgs"==n?this.createSFSTerrain(e,t,i,r,o):"Arcgis"==n?this.createArcGISTerrain(e,t,i,r,o):"Cesium"==o&&this.createCesiumTerrain(e,t,i,r)},t.prototype.createTerrain=function(e,t,i,r,o){var n={url:"",requestVertexNormals:!1,requestWaterMask:!1,requestMetadata:!0,credit:""};this.name=e,this.option=t,this.GroupID=i,this.checked=r,this.Description=o,this.type="createTerrain";var a=null;if(this._core.isUrl(t)?(a=n).url=t:a=this._core.extend(n,t,!0),this._options=a,this._url=a.url,!r){var s={id:t.id||this._core.getuid(),name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),this}u.setVisibility(i,!1,this._viewer,this._cesium);var l=new this._cesium.CesiumTerrainProvider(a);this._viewer.scene.terrainProvider=l,this.item=l,this._show=!0;s={id:t.id||this._core.getuid(),name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),this},t.prototype.createCesiumTerrain=function(e,t,i,r){this.name=e,this.option=t,this.GroupID=i,this.checked=r,this.type="createCesiumTerrain";var o=this._core.extend({requestVertexNormals:!0},t,!0);this._options=o;var n=Cesium.createWorldTerrain(o);if(this.type="Cesium",this.item=n,!r){var a={id:t.id||this._core.getuid(),name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this}u.setVisibility(i,!1,this._viewer,this._cesium),this._viewer.scene.terrainProvider=n,this._show=!0;a={id:t.id||this._core.getuid(),name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},t.prototype.createSFSTerrain=function(e,t,i,r,o){var n=new s(this._viewer,{url:t.url,layerName:t.layerName,requestVertexNormals:t.requestVertexNormals,token:t.token,cacheUrl:t.cacheUrl,cacheLevel:t.cacheLevel});if(this.name=e,this.option=t,this.GroupID=i,this.checked=r,this.Description=o,this.type="createSFSTerrain",this.type="SGS",this._url=t.url,this.layerName=t.layerName,this.requestVertexNormals=t.requestVertexNormals,!r){this._show=!0;var a={id:t.id||this._core.getuid(),name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this}u.setVisibility(i,!1,this._viewer,this._cesium),this._viewer.terrainProvider=n,this.item=n,this._show=!0;a={id:t.id||this._core.getuid(),name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},t.prototype.createSFSTerrain71=function(e,t,i,r,o){var n=new l(this._viewer,{url:t.url,layerName:t.layerName});if(this.name=e,this.option=t,this.GroupID=i,this.checked=r,this.Description=o,this.type="createSFSTerrain",this.type="SGS71",this._url=t.url,this.layerName=t.layerName,this.requestVertexNormals=t.requestVertexNormals,!r){this._show=!0;var a={id:t.id||this._core.getuid(),name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this}u.setVisibility(i,!1,this._viewer,this._cesium),this._viewer.terrainProvider=n,this.item=n,this._show=!0;a={id:t.id||this._core.getuid(),name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},t.prototype.createArcGISTerrain=function(e,t,i,r,o){var n={url:""};this.name=e,this.option=t,this.GroupID=i,this.checked=r,this.Description=o,this.type="createArcGISTerrain";var a=null;this._core.isUrl(t)?(a=n).url=t:a=this._core.extend(n,t,!0),this.type="ArcGIS",this._url=a.url;var s=new this._cesium.ArcGISTiledElevationTerrainProvider(a);if(!r){this._show=!0;var l={id:t.id||this._core.getuid(),name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(i)?0:i),this}u.setVisibility(i,!1,this._viewer,this._cesium),this._viewer.terrainProvider=s,this.item=s,this._show=!0;l={id:t.id||this._core.getuid(),name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(i)?0:i),this},t.prototype.getType=function(){return{label:"影像",value:"TerrainProvider"}},t.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.item._layers[0].resource.url;return{type:"TerrainLayer",treeobj:{name:this.treeobj.name},style:{show:e,url:t}}},t.prototype.setVisibility=function(e){var t;if(e){var i;if(u.setVisibility(this.GroupID,!1,this._viewer,this._cesium),"SGS"===this.type)i=this.option,t=new s(this._viewer,{url:i.url,layerName:i.layerName,requestVertexNormals:i.requestVertexNormals,token:i.token,cacheUrl:i.cacheUrl,cacheLevel:i.cacheLevel});else if("SGS71"===this.type)i=this.option,t=new l(this._viewer,{url:i.url,layerName:i.layerName,requestVertexNormals:i.requestVertexNormals,token:i.token,cacheUrl:i.cacheUrl,cacheLevel:i.cacheLevel});else if("ArcGIS"===this.type);else if("Cesium"===this.type)t=Cesium.createWorldTerrain(this._options);else{var r=this._options,o={url:"",requestVertexNormals:!1,requestWaterMask:!1,requestMetadata:!0,credit:""};this._core.isUrl(r)?(i=o).url=r:i=this._core.extend(o,r,!0),t=new this._cesium.CesiumTerrainProvider(i)}this._show=!0,this.item=t,this._viewer.scene.terrainProvider=t}else t=new this._cesium.EllipsoidTerrainProvider({}),this.item=t,this._show=!1,this._viewer.scene.terrainProvider=t},t.prototype.getVisibility=function(){return this._show},t.prototype.setTreeobj=function(e){this.treeobj=e},t.prototype.deleteObject=function(){try{this.item=new this._cesium.EllipsoidTerrainProvider({}),this._viewer.scene.terrainProvider=this.item}catch(e){console.log(e.message)}},Object.defineProperties(t.prototype,{}),t}),define("SGWorld/Creator/VolumeGeoJsonFeatureLayer",["../Core/Core","./Color","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min","../Core/jquery","../VectorTileProvider/VectorTileProvider","../VectorTileProvider/GeoJSONVectorTileProvider"],function(i,r,o,g,e,f,u){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._color=new r(this._viewer,this._cesium),this._tree=o,this.item={show:!0},this._primitive=void 0,this._Provider=void 0,this.Legend=[],this.datas=[],this.PrimitiveData=[],this.PrimitiveObj={key:"",data:{}},this.Primitivekey=[],this.tilesLength=0,this.returnCount=0,this._primitiveByTile={},this._tileKeys=[],this._primitiveCollection=new this._cesium.PrimitiveCollection,this._cache=!1,this._forceRefreshPrvimitive=null}t.prototype.createVolumeVectorGeoJsonFeatureLayer=function(r,o,e,n,a,t,i){var s={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED};this._core.isnull(e)||this._core.isnull(e.material)||"["==e.material.toString().charAt(0)&&"]"==e.material.toString().charAt(e.material.length-1)||(this._core.isHtmlColor(e.material)?e.material=this._color.colorFromHtmlColor(e.material):(/^rgb/.test(e.material)&&(e.material=this._color.rgbaStringToRgbaObj(e.material)),1<e.material.r&&(e.material.r=e.material.r/255),1<e.material.g&&(e.material.g=e.material.g/255),1<e.material.b&&(e.material.b=e.material.b/255),1<e.material.a&&(e.material.a=e.material.a/255),e.material=this._color.createColor(e.material.r,e.material.g,e.material.b,e.material.a)));var l=this._core.extend(s,e,!0);this._core.isnull(n)&&(n=16),this._core.isnull(a)&&(a=14),null==o&&console.log("url is required"),null==r&&console.log("layername is required");var u=[],c=this;this._Provider=new f(this._viewer,this._cesium),this._Provider._normalTile=styleOption.level_max-1,this._Provider.loadTile=function(e,t){if((this.tile=t).state===c._cesium.QuadtreeTileLoadState.START)if(t.data={lines:[],geometryPrimitive:void 0},t.level>=a&&t.level<n){var i=g.filter(u,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=i.length&&i[0].data&&0<i[0].data.length)return t.data.geometryPrimitive=new c._cesium.Primitive({geometryInstances:i[0].data,appearance:new c._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:c._cesium.ShadowMode.ENABLED}),t.state=c._cesium.QuadtreeTileLoadState.LOADING,void(t.state===c._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=c._cesium.QuadtreeTileLoadState.DONE,t.renderable=!0));u.push({level:t.level,x:t.x,y:t.y,data:void 0}),s=t,c._core.xhr({url:o+"?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER="+r+"&STYLE=&TILEMATRIX=EPSG:4490:"+s.level+"&TILEMATRIXSET=EPSG:4490&FORMAT=application/json;type=geojson&TILECOL="+s.x+"&TILEROW="+s.y,type:"get",dataType:"json",success:function(e){var t=[];function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):o.push(e[t])}for(var r=0;r<e.features.length;r++){var o=[];i(e.features[r].geometry.coordinates[0]);var n=c._cesium.Cartesian3.fromDegreesArray(o);l.positions=n;var a=new c._cesium.GeometryInstance({geometry:new c._cesium.PolylineVolumeGeometry({polylinePositions:l.positions}),attributes:{color:new c._cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE)}});t.push(a)}g.filter(u,function(e){return e.x==s.x&&e.y==s.y})[0].data=t,s.data.geometryPrimitive=new c._cesium.Primitive({geometryInstances:t,appearance:new c._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:c._cesium.ShadowMode.ENABLED})},error:function(){u=g.remove(u,function(e){return e.x==s.x&&e.y==s.y&&e.level==s.level})},complete:function(){s.state=c._cesium.QuadtreeTileLoadState.LOADING,s.state===c._cesium.QuadtreeTileLoadState.LOADING&&(s.data.geometryPrimitive&&s.data.geometryPrimitive.update(e,[]),s.state=c._cesium.QuadtreeTileLoadState.DONE,s.renderable=!0)}})}else t.state=c._cesium.QuadtreeTileLoadState.LOADING,t.state===c._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=c._cesium.QuadtreeTileLoadState.DONE,t.renderable=!0);var s},this._primitive=new c._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var h=this._viewer.scene;h.primitives.add(this._primitive),h.primitivesQuadTrees&&h.primitivesQuadTrees.push(this._primitive)},t.prototype.createVolumeGeoJsonFeatureLayer1=function(e,t,c,i,h){var d={polylinePositions:void 0,shapePositions:void 0,ellipsoid:this._cesium.Ellipsoid.WGS84,granularity:this._cesium.Math.RADIANS_PER_DEGREE,vertexFormat:this._cesium.VertexFormat.DEFAULT,cornerType:this._cesium.CornerType.ROUNDED};null==t&&console.log("geojson is required");var r=null;r=t.then?t:this._cesium.GeoJsonDataSource.load(t);var m=this,p=[];d.shapePositions=this.computeCircle(c.radius),r.then(function(e){var t=m._cesium.Color.WHITE;m._core.isnull(c)||m._core.isnull(c.material)||(t="["==c.material.toString().charAt(0)&&"]"==c.material.toString().charAt(c.material.length-1)?c.material.replace(/\[/,"").replace("/]/",""):g.clone(c.material),t=m._core.isHtmlColor(t)?m._color.colorFromHtmlColor(c.material):(/^rgb/.test(t)&&(t=m._color.rgbaStringToRgbaObj(t)),1<t.r&&(t.r=t.r/255),1<t.g&&(t.g=t.g/255),1<t.b&&(t.b=t.b/255),1<t.a&&(t.a=t.a/255),m._color.createColor(t.r,t.g,t.b,t.a)));for(var i=e.entities.values,r=0;r<i.length;r++){var o=i[r];d.polylinePositions=o.polyline.positions._value;var n=new m._cesium.PolylineVolumeGeometry(d),a=m._cesium.PolylineVolumeGeometry.createGeometry(n),s=new m._cesium.GeometryInstance({geometry:a});p.push(s)}var l="material:"+255*t.red+","+255*t.green+","+255*t.blue;m.Legend.push(l);var u=m._viewer.scene.primitives.add(new m._cesium.Primitive({geometryInstances:p,appearance:new m._cesium.MaterialAppearance({material:new m._cesium.Material({fabric:{type:"Color",uniforms:{color:t}}}),faceForward:!0,flat:!1})}));m.item=u,0==c.show&&(u.show=!1),"function"==typeof h&&h(u)}),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建管状图层"+c.id);var o={id:c.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:geoOptions.url,style:c};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},t.prototype.computeCircle=function(e){this._core.isnull(e)&&(e=4);for(var t=[],i=0;i<360;i++){var r=this._cesium.Math.toRadians(i);t.push(new this._cesium.Cartesian2(e*Math.cos(r),e*Math.sin(r)))}return t},t.prototype.createVolumeGeoJsonFeatureLayerProvider1=function(e,t,v,i,r,o){var _=this,n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.RECEIVE_ONLY},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(v)||this._core.isnull(v.material)||"["==v.material.toString().charAt(0)&&"]"==v.material.toString().charAt(v.material.length-1)||(this._core.isHtmlColor(v.material)?v.material=this._color.colorFromHtmlColor(v.material):(/^rgb/.test(v.material)&&(v.material=this._color.rgbaStringToRgbaObj(v.material)),1<v.material.r&&(v.material.r=v.material.r/255),1<v.material.g&&(v.material.g=v.material.g/255),1<v.material.b&&(v.material.b=v.material.b/255),1<v.material.a&&(v.material.a=v.material.a/255),v.material=this._color.createColor(v.material.r,v.material.g,v.material.b,v.material.a)));var y=this._core.extend(n,v,!0),s=new u(this._viewer,this._cesium,a);this._Provider=s;var C=this;s._loadTile=function(e){var f=new C._cesium.PrimitiveCollection;return C.Legend=[],e.features.forEach(function(e){var t=[];if(/^\[/.test(v.material)&&/\]$/.test(v.material)){var i=v.material.replace(/\[/,"").replace(/\]/,"");y.material=e.properties[i],_._core.isHtmlColor(y.material)?y.material=_._color.colorFromHtmlColor(y.material):(/^rgb/.test(y.material)&&(y.material=_._color.rgbaStringToRgbaObj(y.material)),1<y.material.r&&(y.material.r=y.material.r/255),1<y.material.g&&(y.material.g=y.material.g/255),1<y.material.b&&(y.material.b=y.material.b/255),1<y.material.a&&(y.material.a=y.material.a/255),y.material=_._color.createColor(y.material.r,y.material.g,y.material.b,y.material.a))}for(var r=0;r<e.geometry.coordinates.length;r++){var o=e.geometry.coordinates[r];if(0<o.length)if(Array.isArray(o[0]))for(var n=0;n<o.length;n++){var a=o[n],s=C._cesium.Cartesian3.fromDegrees(a[0],a[1],y.height);t.push(s)}else{var l=C._cesium.Cartesian3.fromDegrees(o[0],o[1],y.height);t.push(l)}}if(y.position=t,e.positions=t,"0"==y.slttype||0==y.slttype)y.shape=C._core.computeCircle(y.radius);else if("1"==y.slttype||1==y.slttype)y.shape=C._core.starPositions(y.number,y.exradius,y.inradius);else if("2"==y.slttype||2==y.slttype){var u=y.orth_width/2,c=y.orth_height/2;y.shape=[new C._cesium.Cartesian2(-u,-c),new C._cesium.Cartesian2(u,-c),new C._cesium.Cartesian2(u,c),new C._cesium.Cartesian2(-u,c)]}var h={polylinePositions:y.position,shapePositions:y.shape,cornerType:y.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}},d=new C._cesium.PolylineVolumeGeometry(h),m=new C._cesium.GeometryInstance({id:e,geometry:d,attributes:{color:new C._cesium.ColorGeometryInstanceAttribute.fromColor(y.material)}}),p="material:"+255*y.material.red+","+255*y.material.green+","+255*y.material.blue;C.Legend.push(p);var g=new C._cesium.Primitive({allowPicking:!0,appearance:new C._cesium.MaterialAppearance({material:new C._cesium.Material({fabric:{type:"Color",uniforms:{color:y.material}}}),faceForward:!0,flat:!1}),shadows:y.shadows,geometryInstances:m});f.add(g)}),f},this.item=s._primitiveCollection,s.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(y.id)&&(y.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+y.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var l={id:y.id,name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t.url,style:v};this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item)},t.prototype.createVolumeGeoJsonFeatureLayerProvider=function(e,t,T,i,r,o){var n=this,a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.RECEIVE_ONLY,radiusScale:1},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(T)||this._core.isnull(T.material)||"["==T.material.toString().charAt(0)&&"]"==T.material.toString().charAt(T.material.length-1)||(this._core.isHtmlColor(T.material)?T.material=this._color.colorFromHtmlColor(T.material):(/^rgb/.test(T.material)&&(T.material=this._color.rgbaStringToRgbaObj(T.material)),1<T.material.r&&(T.material.r=T.material.r/255),1<T.material.g&&(T.material.g=T.material.g/255),1<T.material.b&&(T.material.b=T.material.b/255),1<T.material.a&&(T.material.a=T.material.a/255),T.material=this._color.createColor(T.material.r,T.material.g,T.material.b,T.material.a)));var I=this._core.extend(a,T,!0);if("string"==typeof I.radius&&-1<I.radius.indexOf("[")&&-1<I.radius.indexOf("]"))I.radius=I.radius.replace("[",""),I.radius=I.radius.replace("]",""),I.shape=void 0;else if("0"==I.slttype||0==I.slttype){I.shape=this._core.computeCircle(I.radius);var l=I.radius/2,u=I.radius/2;I.shape1=[new this._cesium.Cartesian2(-l,-u),new this._cesium.Cartesian2(l,-u),new this._cesium.Cartesian2(l,u),new this._cesium.Cartesian2(-l,u)]}else if("1"==I.slttype||1==I.slttype)I.shape=this._core.starPositions(I.number,I.exradius,I.inradius);else if("2"==I.slttype||2==I.slttype){l=I.orth_width/2,u=I.orth_height/2;I.shape=[new this._cesium.Cartesian2(-l,-u),new this._cesium.Cartesian2(l,-u),new this._cesium.Cartesian2(l,u),new this._cesium.Cartesian2(-l,u)]}this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),this._Provider=new f(this._viewer,this._cesium),this._Provider._normalTile=T.level_max-1,this._Provider._minimumHeight=parseFloat(T.height||0),this.item.show=r,this._Provider.loadTile=function(e,t){!function(S,P,x){if(P.state===Cesium.QuadtreeTileLoadState.START){if(P.data={lines:[],geometryPrimitive:void 0},0===x.item.show||!1===x.item.show||""===x.item.show||void 0===x.item.show)return P.state=Cesium.QuadtreeTileLoadState.DONE,P.renderable=!0;if(!(P.level>=T.level_min&&P.level<T.level_max&&x.item.show))return P.state=Cesium.QuadtreeTileLoadState.DONE,P.renderable=!0;var e=x._urlTemplate.replace(window.encodeURIComponent("{x}"),P.x).replace(window.encodeURIComponent("{y}"),P.y).replace(window.encodeURIComponent("{z}"),P.level);x._cache&&(e+="&"+x._core.getuid()),x._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return P.state=Cesium.QuadtreeTileLoadState.DONE,void(P.renderable=!0);if(!I.shape&&"string"==typeof I.radius&&0<e.features.length){var t=void 0;if(e.features[0]&&e.features[0].properties[I.radius])if((t=e.features[0].properties[I.radius]).indexOf&&(-1<t.indexOf("*")||-1<t.indexOf("x")||-1<t.indexOf("X"))){-1<t.indexOf("*")?t=t.split("*"):-1<t.indexOf("X")?t=t.split("X"):-1<t.indexOf("x")&&(t=t.split("x"));var i=parseFloat(t[0])*I.radiusScale,r=parseFloat(t[1])*I.radiusScale;I.shape=[new x._cesium.Cartesian2(-i,-r),new x._cesium.Cartesian2(i,-r),new x._cesium.Cartesian2(i,r),new x._cesium.Cartesian2(-i,r)]}else I.shape=x._core.computeCircle(t*I.radiusScale);else I.shape=x._core.computeCircle(.5)}x.Legend=[];for(var o=[],n=0;n<e.features.length;n++){var a=e.features[n];if(/^\[/.test(T.material)&&/\]$/.test(T.material)){var s=T.material.replace(/\[/,"").replace(/\]/,"");I.material=a.properties[s],x._core.isHtmlColor(I.material)?I.material=x._color.colorFromHtmlColor(I.material):(/^rgb/.test(I.material)&&(I.material=x._color.rgbaStringToRgbaObj(I.material)),1<I.material.r&&(I.material.r=I.material.r/255),1<I.material.g&&(I.material.g=I.material.g/255),1<I.material.b&&(I.material.b=I.material.b/255),1<I.material.a&&(I.material.a=I.material.a/255),I.material=x._color.createColor(I.material.r,I.material.g,I.material.b,I.material.a))}for(var l=[],u=[],c=parseFloat(T.height||0),h=0;h<a.geometry.coordinates.length;h++){var d=a.geometry.coordinates[h];if(0<d.length)if(Array.isArray(d[0]))for(var m=0;m<d.length;m++){var p=d[m];c=c<(p[2]||0)?p[2]||0:c;var g=x._cesium.Cartesian3.fromDegrees(p[0],p[1],I.height);l.push(g),u.push(I.material)}else{c=c<(d[2]||0)?d[2]||0:c;var f=x._cesium.Cartesian3.fromDegrees(d[0],d[1],I.height);l.push(f),u.push(I.material)}}P._minimumHeight=c,I.position=l,a.positions=l;var v="",_="";if("0"==I.slttype||0==I.slttype)if(P.level>=parseFloat(T.level_max)-8&&19<parseFloat(T.level_max)){v=I.shape;var y={polylinePositions:I.position,shapePositions:v,cornerType:I.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}};_=new x._cesium.PolylineVolumeGeometry(y)}else if(P.level>=parseFloat(T.level_max)-4&&16<parseFloat(T.level_max)){v=I.shape;y={polylinePositions:I.position,shapePositions:v,cornerType:I.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}};_=new x._cesium.PolylineVolumeGeometry(y)}else if(P.level>=parseFloat(T.level_max)-4){v=I.shape;y={polylinePositions:I.position,shapePositions:v,cornerType:I.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}};_=new x._cesium.PolylineVolumeGeometry(y)}else{v="";var C={positions:I.position,width:1,vertexFormat:x._cesium.PolylineColorAppearance.VERTEX_FORMAT,colors:u};_=new x._cesium.PolylineGeometry(C),!1}else{v=I.shape;y={polylinePositions:I.position,shapePositions:v,cornerType:I.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}};_=new x._cesium.PolylineVolumeGeometry(y)}var w=new x._cesium.GeometryInstance({id:a,geometry:_,attributes:{color:new x._cesium.ColorGeometryInstanceAttribute.fromColor(I.material)}});""==v&&(w=new x._cesium.GeometryInstance({id:a,geometry:_})),o.push(w)}var b="material:"+255*I.material.red+","+255*I.material.green+","+255*I.material.blue;x.Legend.push(b),0==o.length&&(P.state=Cesium.QuadtreeTileLoadState.DONE,P.renderable=!0);var E=null;E=""==v?new x._cesium.Primitive({appearance:new x._cesium.PolylineColorAppearance,geometryInstances:o}):new x._cesium.Primitive({allowPicking:!0,appearance:new x._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:x._core.Shaders("vertexShaderSource"),fragmentShaderSource:x._core.Shaders("fragmentShaderSource")}),shadows:I.shadows,geometryInstances:o}),P.data.geometryPrimitive=E,P.state=Cesium.QuadtreeTileLoadState.LOADING,P.state===Cesium.QuadtreeTileLoadState.LOADING&&(P.data.geometryPrimitive.update(S,[]),P.state=Cesium.QuadtreeTileLoadState.DONE,P.renderable=!0)},error:function(){null==P.count&&(P.count=0),P.count+=1,2<=P.count?(P.state=Cesium.QuadtreeTileLoadState.DONE,P.renderable=!0):P.state=Cesium.QuadtreeTileLoadState.START}}),P.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,n)},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var c=this._viewer.scene,h=c.primitives;T&&T.time&&(this._Provider._availability=new n._cesium.TimeIntervalCollection([new n._cesium.TimeInterval({start:T.time.start?n._cesium.JulianDate.fromDate(new Date(T.time.start)):n._cesium.Iso8601.MINIMUM_VALUE,stop:T.time.end?n._cesium.JulianDate.fromDate(new Date(T.time.end)):n._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),h.add(this._primitive),c.primitivesQuadTrees&&c.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(I.id)&&(I.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+I.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var d={id:I.id,name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t.url,style:T};return this.setTreeobj(d),this._tree.insertGroupId(d,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this};var n="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof2(e)};return t.prototype._serialize=function(e){var t=[],i=window.encodeURIComponent;for(var r in e){var o=e[r];"object"===(void 0===o?"undefined":n(o))?t.push(i(r)+"="+i(JSON.stringify(o))):t.push(i(r)+"="+i(e[r]))}return t.join("&")},t.prototype.createVolumeVectorGeoJsonFeatureLayerOptimization=function(e,t,h,i,r,o){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.RECEIVE_ONLY},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(h)||this._core.isnull(h.material)||"["==h.material.toString().charAt(0)&&"]"==h.material.toString().charAt(h.material.length-1)||(this._core.isHtmlColor(h.material)?h.material=this._color.colorFromHtmlColor(h.material):(/^rgb/.test(h.material)&&(h.material=this._color.rgbaStringToRgbaObj(h.material)),1<h.material.r&&(h.material.r=h.material.r/255),1<h.material.g&&(h.material.g=h.material.g/255),1<h.material.b&&(h.material.b=h.material.b/255),1<h.material.a&&(h.material.a=h.material.a/255),h.material=this._color.createColor(h.material.r,h.material.g,h.material.b,h.material.a)));var d=this,m=this._core.extend(n,h,!0);if("0"==m.slttype||0==m.slttype)m.shape=d._core.computeCircle(m.radius);else if("1"==m.slttype||1==m.slttype)m.shape=d._core.starPositions(m.number,m.exradius,m.inradius);else if("2"==m.slttype||2==m.slttype){var s=m.orth_width/2,l=m.orth_height/2;m.shape=[new d._cesium.Cartesian2(-s,-l),new d._cesium.Cartesian2(s,-l),new d._cesium.Cartesian2(s,l),new d._cesium.Cartesian2(-s,l)]}null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var u=[];this._urlTemplate=t.url+"?"+this._serialize(a.urlParams),this._Provider=new f(this._viewer,this._cesium),this._Provider._normalTile=h.level_max-1,this._Provider.loadTile=function(e,t){this.tile=null;var i,r;if((this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&d.item.show){var a="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},!(t.level>=h.level_min&&t.level<h.level_max&&d.item.show))return t.state=d._cesium.QuadtreeTileLoadState.LOADING,void(t.state===d._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=d._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));d.Primitivekey.includes(a)||(i=t,r=d._urlTemplate.replace(window.encodeURIComponent("{x}"),i.x).replace(window.encodeURIComponent("{y}"),i.y).replace(window.encodeURIComponent("{z}"),i.level),d.tilesLength++,d._cache&&(r+="&"+d._core.getuid()),d._core.xhr({url:r,type:"get",dataType:"json",success:function(e){var s=[],l=new d._cesium.PrimitiveCollection;function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):u.push(e[t])}function t(){if(/^\[/.test(h.material)&&/\]$/.test(h.material)){var e=h.material.replace(/\[/,"").replace(/\]/,"");m.material=c.properties[e],d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.r&&(m.material.r=m.material.r/255),1<m.material.g&&(m.material.g=m.material.g/255),1<m.material.b&&(m.material.b=m.material.b/255),1<m.material.a&&(m.material.a=m.material.a/255),m.material=d._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))}var t=d._cesium.Cartesian3.fromDegreesArray(u);m.position=t,c.positions=t;var i={polylinePositions:m.position,shapePositions:m.shape,cornerType:m.cornerType},r=new d._cesium.PolylineVolumeGeometry(i),o=new d._cesium.GeometryInstance({id:c,geometry:r,attributes:{color:new d._cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}}),n="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue;d.Legend.push(n),s.push(o);var a=new d._cesium.Primitive({allowPicking:!0,appearance:new d._cesium.MaterialAppearance({material:new d._cesium.Material({fabric:{type:"Color",uniforms:{color:m.material}}}),faceForward:!0,flat:!1}),shadows:m.shadows,geometryInstances:o});l.add(a)}d.Legend=[];for(var r=0;r<e.features.length;r++){var u=[],c=e.features[r];if(Array.isArray(c.geometry.coordinates)&&0<c.geometry.coordinates.length)if(Array.isArray(c.geometry.coordinates[0][0]))for(var o=0;o<c.geometry.coordinates.length;o++)u=[],c.geometry.coordinates[o].pop(),i(c.geometry.coordinates[o]),2<u.length&&t();else i(c.geometry.coordinates),2<u.length&&t()}if(0<s.length){d.PrimitiveObj.data=l,d.PrimitiveObj.key=d.Primitivekey[d.returnCount];var n={key:d.Primitivekey[d.returnCount],data:l};d.PrimitiveData.push(n),d._primitiveCollection.add(l),d._viewer.scene.primitives.add(l),d.datas.push(l),d.returnCount++,d._primitiveByTile[a]=l}},error:function(){u=g.remove(u,function(e){return e.x==i.x&&e.y==i.y&&e.level==i.level})},complete:function(e,t){i.state=d._cesium.QuadtreeTileLoadState.LOADING,i.state===d._cesium.QuadtreeTileLoadState.LOADING&&(i.data.geometryPrimitive&&(i.state=d._cesium.QuadtreeTileLoadState.DONE),i.renderable=!0)}}))}},this._primitive=new d._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var c=this._viewer.scene;c.primitives.add(this._primitive),c.primitivesQuadTrees&&c.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var p={id:m.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:h};this.setTreeobj(p),this._tree.insertGroupId(p,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item)},t.prototype.setTreeobj=function(e){this.treeobj=e},t.prototype._removeObsoletePrimitives=function(e,t){var i=[];for(var r in 0<t.length&&(i=t),e){if(!i.includes(r))this._primitiveCollection.remove(e[r])&&delete e[r]}},t.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},t.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch(e){}},t.prototype.getLegend=function(){var e=[];return null!=this.Legend&&(e=this._core.unique(this.Legend)),e},t.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(!e)}catch(e){}},t.prototype.setVisibility=function(e){this.item.show=e,this._Provider&&this._Provider.setStatus(e)},t.prototype.isCache=function(e){this._cache=e},t.prototype.edit=function(e,t){return this.isEditting=e,this.editoption=t,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},t.prototype.forceRefresh=function(){try{for(var e=0;e<this._Provider.quadtree._levelZeroTiles.length;e++)this._Provider.quadtree._levelZeroTiles[e].freeResources()}catch(e){}},t}),define("SGWorld/Creator/PolygonVectorGeoJsonFeatureLayer",["../Core/Core","./Color","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min","../Core/jquery","../VectorTileProvider/VectorTileProvider","../VectorTileProvider/GeoJSONVectorTileProvider"],function(i,r,o,v,e,p,u){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._color=new r(this._viewer,this._cesium),this._tree=o,this.item={show:!0},this._option=void 0,this._primitive=void 0,this._Provider=void 0,this.Legend=[],this.datas=[],this.PrimitiveData=[],this.PrimitiveObj={key:"",data:{}},this.Primitivekey=[],this.tilesLength=0,this.returnCount=0,this._cache=!1,this._forceRefreshPrvimitive=null}var n="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof2(e)};return t.prototype._serialize=function(e){var t=[],i=window.encodeURIComponent;for(var r in e){var o=e[r];"object"===(void 0===o?"undefined":n(o))?t.push(i(r)+"="+i(JSON.stringify(o))):t.push(i(r)+"="+i(e[r]))}return t.join("&")},t.prototype.createVolumeVectorGeoJsonFeatureLayer=function(e,t,o,i,r,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(o)||this._core.isnull(o.material)||"["==o.material.toString().charAt(0)&&"]"==o.material.toString().charAt(o.material.length-1)||(this._core.isHtmlColor(o.material)?o.material=this._color.colorFromHtmlColor(o.material):(/^rgb/.test(o.material)&&(o.material=this._color.rgbaStringToRgbaObj(o.material)),1<o.material.r&&(o.material.r=o.material.r/255),1<o.material.g&&(o.material.g=o.material.g/255),1<o.material.b&&(o.material.b=o.material.b/255),1<o.material.a&&(o.material.a=o.material.a/255),o.material=this._color.createColor(o.material.r,o.material.g,o.material.b,o.material.a))),this._option=this._core.extend(a,o,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var l=[],c={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},h=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),this._Provider=new p(this._viewer,this._cesium),this._Provider._normalTile=o.level_max-1,this._Provider.loadTile=function(i,t){if((this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&h.item.show){t.level,t.x,t.y;if(t.data={lines:[],geometryPrimitive:void 0},!(t.level>=o.level_min&&t.level<o.level_max&&h.item.show))return t.state=h._cesium.QuadtreeTileLoadState.LOADING,void(t.state===h._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(i,[]),t.state=h._cesium.QuadtreeTileLoadState.DONE,t.renderable=!0));var e=v.filter(l,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=e.length&&e[0].data&&0<e[0].data.length)return t.data.geometryPrimitive=new h._cesium.Primitive({geometryInstances:e[0].data,appearance:new h._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:h._cesium.ShadowMode.ENABLED}),t.state=h._cesium.QuadtreeTileLoadState.LOADING,void(t.state===h._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(),t.state=h._cesium.QuadtreeTileLoadState.DONE,t.renderable=!0));l.push({level:t.level,x:t.x,y:t.y,data:void 0}),n=t,r=h._urlTemplate.replace(window.encodeURIComponent("{x}"),n.x).replace(window.encodeURIComponent("{y}"),n.y).replace(window.encodeURIComponent("{z}"),n.level),h._cache&&(r+="&"+h._core.getuid()),h._core.xhr({url:r,type:"get",dataType:"json",success:function(e){var s=[];function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):l.push(e[t])}function t(){if(/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)){var e=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");c.extrudedHeight=parseFloat(u.properties[e])}else c.extrudedHeight=parseFloat(h._option.extrudedHeight);if(c.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)){var t=h._option.material.replace(/\[/,"").replace(/\]/,"");c.material=u.properties[t],h._core.isHtmlColor(c.material)?c.material=h._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=h._color.rgbaStringToRgbaObj(c.material)),1<c.material.red&&(c.material.red=c.material.red/255),1<c.material.green&&(c.material.green=c.material.green/255),1<c.material.blue&&(c.material.blue=c.material.blue/255),1<c.material.alpha&&(c.material.a=c.material.alpha/255),c.material=h._color.createColor(c.material.red,c.material.green,c.material.blue,c.material.alpha))}else h._option.material&&(c.material=h._option.material),c.material&&(h._core.isHtmlColor(c.material)?c.material=h._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=h._color.rgbaStringToRgbaObj(c.material)),1<c.material.red&&(c.material.red=c.material.red/255),1<c.material.green&&(c.material.green=c.material.green/255),1<c.material.blue&&(c.material.blue=c.material.blue/255),1<c.material.alpha&&(c.material.a=c.material.alpha/255),c.material=h._color.createColor(c.material.red,c.material.green,c.material.blue,c.material.alpha)));var i=h._cesium.Cartesian3.fromDegreesArray(l);c.polygonHierarchy=new h._cesium.PolygonHierarchy(i);var r=new h._cesium.PolygonGeometry(c),o=h._cesium.PolygonGeometry.createGeometry(r),n=new h._cesium.GeometryInstance({id:u,geometry:o,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(c.material)}}),a="material:"+255*c.material.red+","+255*c.material.green+","+255*c.material.blue;h.Legend.push(a),s.push(n)}h.Legend=[];for(var r=0;r<e.features.length;r++){var l=[],u=e.features[r];if(Array.isArray(u.geometry.coordinates)&&0<u.geometry.coordinates.length)if(Array.isArray(u.geometry.coordinates[0][0]))for(var o=0;o<u.geometry.coordinates.length;o++)l=[],u.geometry.coordinates[o].pop(),i(u.geometry.coordinates[o]),t();else i(u.geometry.coordinates),t()}n.data.geometryPrimitive=new h._cesium.Primitive({geometryInstances:s,appearance:new h._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:h._core.Shaders("vertexShaderSource"),fragmentShaderSource:h._core.Shaders("fragmentShaderSource")}),shadows:h._option.shadows})},error:function(){l=v.remove(l,function(e){return e.x==n.x&&e.y==n.y&&e.level==n.level})},complete:function(e,t){n.state=h._cesium.QuadtreeTileLoadState.LOADING,n.state===h._cesium.QuadtreeTileLoadState.LOADING&&(n.data.geometryPrimitive&&n.data.geometryPrimitive.update(i),n.state=h._cesium.QuadtreeTileLoadState.DONE,n.renderable=!0)}})}var n,r},this._primitive=new h._cesium.QuadtreePrimitive({tileProvider:this._Provider});var u=this._viewer.scene.primitives;o&&o.time&&(this._Provider._availability=new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({start:o.time.start?h._cesium.JulianDate.fromDate(new Date(o.time.start)):h._cesium.Iso8601.MINIMUM_VALUE,stop:o.time.end?h._cesium.JulianDate.fromDate(new Date(o.time.end)):h._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),u.add(this._primitive),r||this.setVisibility(!1),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var d={id:c.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:o};this.setTreeobj(d),this._tree.insertGroupId(d,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item)},t.prototype.createVolumeVectorGeoJsonFeatureLayerOptimization=function(e,t,s,i,r,o){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(s)||this._core.isnull(s.material)||"["==s.material.toString().charAt(0)&&"]"==s.material.toString().charAt(s.material.length-1)||(this._core.isHtmlColor(s.material)?s.material=this._color.colorFromHtmlColor(s.material):(/^rgb/.test(s.material)&&(s.material=this._color.rgbaStringToRgbaObj(s.material)),1<s.material.r&&(s.material.r=s.material.r/255),1<s.material.g&&(s.material.g=s.material.g/255),1<s.material.b&&(s.material.b=s.material.b/255),1<s.material.a&&(s.material.a=s.material.a/255),s.material=this._color.createColor(s.material.r,s.material.g,s.material.b,s.material.a))),this._option=this._core.extend(n,s,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var l=[],c={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},h=this;this._urlTemplate=t.url+"?"+this._serialize(a.urlParams),this._Provider=new p(this._viewer,this._cesium),this._Provider._normalTile=s.level_max-1,this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&h.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},!(t.level>=s.level_min&&t.level<s.level_max&&h.item.show))return t.state=h._cesium.QuadtreeTileLoadState.LOADING,void(t.state===h._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=h._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));var r=v.filter(l,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=r.length&&r[0].data&&0<r[0].data.length)return t.data.geometryPrimitive=new h._cesium.Primitive({geometryInstances:r[0].data,appearance:new h._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:h._cesium.ShadowMode.ENABLED}),t.state=h._cesium.QuadtreeTileLoadState.LOADING,void(t.state===h._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=h._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));if(0<h.PrimitiveData.length)for(var o=0;o<h.PrimitiveData.length;o++)if(h.PrimitiveData[o].key==i)return void h.Primitivekey.push(i);h.Primitivekey.includes(i)||(h.Primitivekey.push(i),l.push({level:t.level,x:t.x,y:t.y,data:void 0}),n=t,a=h._urlTemplate.replace(window.encodeURIComponent("{x}"),n.x).replace(window.encodeURIComponent("{y}"),n.y).replace(window.encodeURIComponent("{z}"),n.level),h._cache&&(a+="&"+h._core.getuid()),h.tilesLength++,h._core.xhr({url:a,type:"get",dataType:"json",success:function(e){var a=[];function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):s.push(e[t])}function t(){if(/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)){var e=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");c.extrudedHeight=parseFloat(l.properties[e])}if(c.extrudedHeight=parseFloat(h._option.extrudedHeight),c.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)){var t=h._option.material.replace(/\[/,"").replace(/\]/,"");c.material=l.properties[t],h._core.isHtmlColor(c.material)?c.material=h._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=h._color.rgbaStringToRgbaObj(c.material)),1<c.material.red&&(c.material.red=c.material.red/255),1<c.material.green&&(c.material.green=c.material.green/255),1<c.material.blue&&(c.material.blue=c.material.blue/255),1<c.material.alpha&&(c.material.a=c.material.alpha/255),c.material=h._color.createColor(c.material.red,c.material.green,c.material.blue,c.material.alpha))}else h._option.material&&(c.material=h._option.material),c.material&&(h._core.isHtmlColor(c.material)?c.material=h._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=h._color.rgbaStringToRgbaObj(c.material)),1<c.material.red&&(c.material.red=c.material.red/255),1<c.material.green&&(c.material.green=c.material.green/255),1<c.material.blue&&(c.material.blue=c.material.blue/255),1<c.material.alpha&&(c.material.a=c.material.alpha/255),c.material=h._color.createColor(c.material.red,c.material.green,c.material.blue,c.material.alpha)));var i=h._cesium.Cartesian3.fromDegreesArray(s);c.polygonHierarchy=new h._cesium.PolygonHierarchy(i);var r=new h._cesium.PolygonGeometry(c),o=new h._cesium.GeometryInstance({id:l,geometry:r,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(c.material)}}),n="material:"+255*c.material.red+","+255*c.material.green+","+255*c.material.blue;h.Legend.push(n),a.push(o)}h.Legend=[];for(var r=0;r<e.features.length;r++){var s=[],l=e.features[r];if(Array.isArray(l.geometry.coordinates)&&0<l.geometry.coordinates.length)if(Array.isArray(l.geometry.coordinates[0][0]))for(var o=0;o<l.geometry.coordinates.length;o++)s=[],l.geometry.coordinates[o].pop(),i(l.geometry.coordinates[o]),t();else i(l.geometry.coordinates),t()}var n=new h._cesium.Primitive({geometryInstances:a,appearance:new h._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:h._core.Shaders("vertexShaderSource"),fragmentShaderSource:h._core.Shaders("fragmentShaderSource")}),shadows:h._option.shadows});h.PrimitiveObj.data=n,h.PrimitiveObj.key=h.Primitivekey[h.returnCount];var u={key:h.Primitivekey[h.returnCount],data:n};h.PrimitiveData.push(u),h._viewer.scene.primitives.add(n),h.datas.push(n),h.returnCount++,h.returnCount>=h.tilesLength&&(h.returnCount=0,h.tilesLength=0,h.Primitivekey=[])},error:function(){l=v.remove(l,function(e){return e.x==n.x&&e.y==n.y&&e.level==n.level})},complete:function(e,t){n.state=h._cesium.QuadtreeTileLoadState.LOADING,n.state===h._cesium.QuadtreeTileLoadState.LOADING&&(n.data.geometryPrimitive&&(n.state=h._cesium.QuadtreeTileLoadState.DONE),n.renderable=!0)}}))}var n,a},this._primitive=new h._cesium.QuadtreePrimitive({tileProvider:this._Provider}),this._viewer.scene.primitives.add(this._primitive),r||this.setVisibility(!1),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var u={id:c.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:s};this.setTreeobj(u),this._tree.insertGroupId(u,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item)},t.prototype.createVolumeVectorGeoJsonFeatureLayersd=function(e,t,o,i,r,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(o)||this._core.isnull(o.material)||"["==o.material.toString().charAt(0)&&"]"==o.material.toString().charAt(o.material.length-1)||(this._core.isHtmlColor(o.material)?o.material=this._color.colorFromHtmlColor(o.material):(/^rgb/.test(o.material)&&(o.material=this._color.rgbaStringToRgbaObj(o.material)),1<o.material.r&&(o.material.r=o.material.r/255),1<o.material.g&&(o.material.g=o.material.g/255),1<o.material.b&&(o.material.b=o.material.b/255),1<o.material.a&&(o.material.a=o.material.a/255),o.material=this._color.createColor(o.material.r,o.material.g,o.material.b,o.material.a))),this._core.isnull(o)||this._core.isnull(o.outlineColor)||"["==o.outlineColor.toString().charAt(0)&&"]"==o.outlineColor.toString().charAt(o.outlineColor.length-1)||(this._core.isHtmlColor(o.outlineColor)?o.outlineColor=this._color.colorFromHtmlColor(o.outlineColor):(/^rgb/.test(o.outlineColor)&&(o.outlineColor=this._color.rgbaStringToRgbaObj(o.outlineColor)),1<o.outlineColor.r&&(o.outlineColor.r=o.outlineColor.r/255),1<o.outlineColor.g&&(o.outlineColor.g=o.outlineColor.g/255),1<o.outlineColor.b&&(o.outlineColor.b=o.outlineColor.b/255),1<o.outlineColor.a&&(o.outlineColor.a=o.outlineColor.a/255),o.outlineColor=this._color.createColor(o.outlineColor.r,o.outlineColor.g,o.outlineColor.b,o.outlineColor.a))),this._option=this._core.extend(a,o,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var l=[],d={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:Cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:Cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:Cesium.ArcType.GEODESIC,material:Cesium.Color.RED},m=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams);var u=t.url.split("geoserver")[0]+"geoserver/polygon/ows?service=WFS&version=1.0.0&request=GetFeature&typeName="+s.urlParams.LAYER+"&outputFormat=application%2Fjson";m._core.xhr({url:u,type:"get",async:!1,dataType:"json",success:function(e){m.datas=e.features}}),this._Provider=new p(this._viewer,this._cesium),this._Provider._normalTile=o.level_max-1,this._Provider.loadTile=function(i,t){if((this.tile=t).state===Cesium.QuadtreeTileLoadState.START&&m.item.show){t.level,t.x,t.y;if(t.data={lines:[],geometryPrimitive:void 0},!(t.level>=o.level_min&&t.level<o.level_max&&m.item.show))return t.state=Cesium.QuadtreeTileLoadState.LOADING,void(t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(i,[]),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0));var e=v.filter(l,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=e.length&&e[0].data&&0<e[0].data.length)return t.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:e[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),t.state=Cesium.QuadtreeTileLoadState.LOADING,void(t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0));l.push({level:t.level,x:t.x,y:t.y,data:void 0}),h=t,r=m._urlTemplate.replace(window.encodeURIComponent("{x}"),h.x).replace(window.encodeURIComponent("{y}"),h.y).replace(window.encodeURIComponent("{z}"),h.level),m._cache&&(r+="&"+m._core.getuid()),m._core.xhr({url:r,type:"get",dataType:"json",success:function(e){var s=[];function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?(3==e[t].length&&(e[t].splice(2,1),e[t].push(this._option.height)),i(e[t])):l.push(e[t])}function t(){if(/^\[/.test(m._option.extrudedHeight)&&/\]$/.test(m._option.extrudedHeight)){var e=m._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");d.extrudedHeight=parseFloat(u.properties[e])}else d.extrudedHeight=parseFloat(m._option.extrudedHeight);if(d.material=m._option.material,/^\[/.test(m._option.material)&&/\]$/.test(m._option.material)){var t=m._option.material.replace(/\[/,"").replace(/\]/,"");d.material=u.properties[t],m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha))}else m._option.material&&(d.material=m._option.material),d.material&&(m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha)));var i=Cesium.Cartesian3.fromDegreesArrayHeights(l);d.polygonHierarchy=new Cesium.PolygonHierarchy(i);var r={positions:i=Cesium.Cartesian3.fromDegreesArrayHeights(l),width:m._option.outlineWidth,color:Cesium.ColorGeometryInstanceAttribute.fromColor(m._option.outlineColor)},o=new Cesium.PolylineGeometry(r),n=new Cesium.GeometryInstance({geometry:o}),a="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue;m.Legend.push(a),s.push(n)}m.Legend=[];for(var r=0;r<e.features.length;r++){var l=[],o=e.features[r].id,n=parseInt(o.split(".")[1])+1,u=m.datas[n];if(Array.isArray(u.geometry.coordinates)&&0<u.geometry.coordinates.length&&Array.isArray(u.geometry.coordinates[0][0][0]))for(var a=0;a<u.geometry.coordinates[0].length;a++)l=[],i(u.geometry.coordinates[0][a]),t()}var c=new Cesium.PrimitiveCollection;c.add(new Cesium.Primitive({geometryInstances:s,appearance:new Cesium.PolylineColorAppearance})),h.data.geometryPrimitive=c},error:function(){l=v.remove(l,function(e){return e.x==h.x&&e.y==h.y&&e.level==h.level})},complete:function(e,t){h.state=Cesium.QuadtreeTileLoadState.LOADING,h.state===Cesium.QuadtreeTileLoadState.LOADING&&(h.data.geometryPrimitive&&h.data.geometryPrimitive.update(i),h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0)}})}var h,r},this._primitive=new m._cesium.QuadtreePrimitive({tileProvider:this._Provider}),this._viewer.scene.primitives.add(this._primitive),r||this.setVisibility(!1),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var c={id:d.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:o};return this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item),this},t.prototype.createVolumeVectorGeoJsonFeatureLayerDth=function(e,t,o,i,r,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._option=this._core.extend(a,o,!0),null==t&&console.log("url is required"),null==e&&console.log("layername is required");var l=[],g=(Cesium.VertexFormat.DEFAULT,Cesium.Ellipsoid.WGS84,Cesium.ArcType.GEODESIC,Cesium.Color.WHITE),f=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),this._Provider=new p(this._viewer,this._cesium),this._Provider._normalTile=o.level_max-1,this._Provider.loadTile=function(e,t){if((this.tile=t).state===Cesium.QuadtreeTileLoadState.START&&f.item.show){t.level,t.x,t.y;if(t.data={lines:[],geometryPrimitive:void 0},!(t.level>=o.level_min&&t.level<o.level_max&&f.item.show))return t.state=Cesium.QuadtreeTileLoadState.LOADING,void(t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0));var i=v.filter(l,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=i.length&&i[0].data&&0<i[0].data.length)return t.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:i[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),t.state=Cesium.QuadtreeTileLoadState.LOADING,void(t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0));l.push({level:t.level,x:t.x,y:t.y,data:void 0}),p=t,r=f._urlTemplate.replace(window.encodeURIComponent("{x}"),p.x).replace(window.encodeURIComponent("{y}"),p.y).replace(window.encodeURIComponent("{z}"),p.level),f._cache&&(r+="&"+f._core.getuid()),f._core.xhr({url:r,type:"get",dataType:"json",success:function(e){var t=[];f.Legend=[];var i=new f._cesium.PrimitiveCollection;function r(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?r(e[t]):n.push(e[t])}for(var o=0;o<e.features.length;o++){var n=[],a=e.features[o];if(r(e.features[o].geometry.coordinates[0]),/^\[/.test(f._option.extrudedHeight)&&/\]$/.test(f._option.extrudedHeight)){var s=f._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");f._option.extrudedHeight=parseFloat(a.properties[s])}else f._option.extrudedHeight=parseFloat(f._option.extrudedHeight);if(1==f._option.heightReference&&delete f._option.height,1==f._option.extrudedHeightReference&&delete f._option.extrudedHeight,/^\[/.test(f._option.material)&&/\]$/.test(f._option.material)){var l=f._option.material.replace(/\[/,"").replace(/\]/,"");f._option.material=a.properties[l],f._core.isHtmlColor(f._option.material)?f._option.material=f._color.colorFromHtmlColor(f._option.material):(/^rgb/.test(f._option.material)&&(f._option.material=f._color.rgbaStringToRgbaObj(f._option.material)),1<f._option.material.red&&(f._option.material.red=f._option.material.red/255),1<f._option.material.green&&(f._option.material.green=f._option.material.green/255),1<f._option.material.blue&&(f._option.material.blue=f._option.material.blue/255),1<f._option.material.alpha&&(f._option.material.a=f._option.material.alpha/255),f._option.material=f._color.createColor(f._option.material.red,f._option.material.green,f._option.material.blue,f._option.material.alpha))}else f._option.material&&(f._option.material=f._option.material),f._option.material&&(f._core.isHtmlColor(f._option.material)?f._option.material=f._color.colorFromHtmlColor(f._option.material):(/^rgb/.test(f._option.material)&&(f._option.material=f._color.rgbaStringToRgbaObj(f._option.material)),1<f._option.material.red&&(f._option.material.red=f._option.material.red/255),1<f._option.material.green&&(f._option.material.green=f._option.material.green/255),1<f._option.material.blue&&(f._option.material.blue=f._option.material.blue/255),1<f._option.material.alpha&&(f._option.material.a=f._option.material.alpha/255),f._option.material=f._color.createColor(f._option.material.red,f._option.material.green,f._option.material.blue,f._option.material.alpha)));var u=Cesium.Cartesian3.fromDegreesArray(n);a.positions=u,f._option.polygonHierarchy=new Cesium.PolygonHierarchy(u);var c=new Cesium.PolygonGeometry(f._option),h=Cesium.PolygonGeometry.createGeometry(c),d="material:"+255*g.red+","+255*g.green+","+255*g.blue;f.Legend.push(d),new Cesium.GeometryInstance({id:a,geometry:h,attributes:{color:new f._cesium.ColorGeometryInstanceAttribute.fromColor(f._option.material)}});var m=new Cesium.ClassificationPrimitive({geometryInstances:t,appearance:new Cesium.PerInstanceColorAppearance({closed:!0,flat:!1}),classificationType:f._option.classificationType,shadows:Cesium.ShadowMode.ENABLED});i.add(m)}p.data.geometryPrimitive=i},error:function(){l=v.remove(l,function(e){return e.x==p.x&&e.y==p.y&&e.level==p.level})},complete:function(){p.state=Cesium.QuadtreeTileLoadState.LOADING,p.state===Cesium.QuadtreeTileLoadState.LOADING&&(p.data.geometryPrimitive&&p.data.geometryPrimitive.update(e,[]),p.state=Cesium.QuadtreeTileLoadState.DONE,p.renderable=!0)}})}var p,r},this._primitive=new f._cesium.QuadtreePrimitive({tileProvider:this._Provider}),this._viewer.scene.primitives.add(this._primitive),r||this.setVisibility(!1),this._core.isnull(f._option.id)&&(f._option.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+f._option.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var u={id:f._option.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:o};this.setTreeobj(u),this._tree.insertGroupId(u,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item)},t.prototype.createVolumeGeoJsonFeatureLayer=function(e,t,u,i,c){var h={polylinePositions:void 0,shapePositions:void 0,ellipsoid:this._cesium.Ellipsoid.WGS84,granularity:this._cesium.Math.RADIANS_PER_DEGREE,vertexFormat:this._cesium.VertexFormat.DEFAULT,cornerType:this._cesium.CornerType.ROUNDED};null==t&&console.log("geojson is required");var r=null;r=t.then?t:this._cesium.GeoJsonDataSource.load(t);var d=this,m=[];h.shapePositions=this.computeCircle(u.radius),r.then(function(e){var t=d._cesium.Color.WHITE;d._core.isnull(u)||d._core.isnull(u.material)||(t="["==u.material.toString().charAt(0)&&"]"==u.material.toString().charAt(u.material.length-1)?u.material.replace(/\[/,"").replace("/]/",""):v.clone(u.material),t=d._core.isHtmlColor(t)?d._color.colorFromHtmlColor(u.material):(/^rgb/.test(t)&&(t=d._color.rgbaStringToRgbaObj(t)),1<t.r&&(t.r=t.r/255),1<t.g&&(t.g=t.g/255),1<t.b&&(t.b=t.b/255),1<t.a&&(t.a=t.a/255),d._color.createColor(t.r,t.g,t.b,t.a)));for(var i=e.entities.values,r=0;r<i.length;r++){var o=i[r];h.polylinePositions=o.polyline.positions._value;var n=new d._cesium.PolylineVolumeGeometry(h),a=d._cesium.PolylineVolumeGeometry.createGeometry(n),s=new d._cesium.GeometryInstance({geometry:a});m.push(s)}var l=d._viewer.scene.primitives.add(new d._cesium.Primitive({geometryInstances:m,appearance:new d._cesium.MaterialAppearance({material:new d._cesium.Material({fabric:{type:"Color",uniforms:{color:t}}}),faceForward:!0,flat:!1})}));d.item=l,0==u.show&&(l.show=!1),"function"==typeof c&&c(l)}),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建管状图层"+u.id);var o={id:u.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:geoOptions.url,style:u};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},t.prototype.computeCircle=function(e){this._core.isnull(e)&&(e=4);for(var t=[],i=0;i<360;i++){var r=this._cesium.Math.toRadians(i);t.push(new this._cesium.Cartesian2(e*Math.cos(r),e*Math.sin(r)))}return t},t.prototype.createVolumeGeoJsonFeatureLayerProvider=function(e,t,v,i,r,o){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.RECEIVE_ONLY},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(v)||this._core.isnull(v.material)||"["==v.material.toString().charAt(0)&&"]"==v.material.toString().charAt(v.material.length-1)||(this._core.isHtmlColor(v.material)?v.material=this._color.colorFromHtmlColor(v.material):(/^rgb/.test(v.material)&&(v.material=this._color.rgbaStringToRgbaObj(v.material)),1<v.material.r&&(v.material.r=v.material.r/255),1<v.material.g&&(v.material.g=v.material.g/255),1<v.material.b&&(v.material.b=v.material.b/255),1<v.material.a&&(v.material.a=v.material.a/255),v.material=this._color.createColor(v.material.r,v.material.g,v.material.b,v.material.a)));var _=this._core.extend(n,v,!0),s=new u(this._viewer,this._cesium,a);this._Provider=s;var y=this;s._loadTile=function(e){var f=new y._cesium.PrimitiveCollection;return e.features.forEach(function(e){var t=[];if(/^\[/.test(v.material)&&/\]$/.test(v.material)){var i=v.material.replace(/\[/,"").replace(/\]/,"");_.material=e.properties[i],that._core.isHtmlColor(_.material)?_.material=that._color.colorFromHtmlColor(_.material):(/^rgb/.test(_.material)&&(_.material=that._color.rgbaStringToRgbaObj(_.material)),1<_.material.r&&(_.material.r=_.material.r/255),1<_.material.g&&(_.material.g=_.material.g/255),1<_.material.b&&(_.material.b=_.material.b/255),1<_.material.a&&(_.material.a=_.material.a/255),_.material=that._color.createColor(_.material.r,_.material.g,_.material.b,_.material.a))}for(var r=0;r<e.geometry.coordinates.length;r++){var o=e.geometry.coordinates[r];if(0<o.length)if(Array.isArray(o[0]))for(var n=0;n<o.length;n++){var a=o[n],s=y._cesium.Cartesian3.fromDegrees(a[0],a[1],_.height);t.push(s)}else{var l=y._cesium.Cartesian3.fromDegrees(o[0],o[1],_.height);t.push(l)}}if(_.position=t,e.positions=t,"0"==_.slttype||0==_.slttype)_.shape=y._core.computeCircle(_.radius);else if("1"==_.slttype||1==_.slttype)_.shape=y._core.starPositions(_.number,_.exradius,_.inradius);else if("2"==_.slttype||2==_.slttype){var u=_.orth_width/2,c=_.orth_height/2;_.shape=[new y._cesium.Cartesian2(-u,-c),new y._cesium.Cartesian2(u,-c),new y._cesium.Cartesian2(u,c),new y._cesium.Cartesian2(-u,c)]}var h={polylinePositions:_.position,shapePositions:_.shape,cornerType:_.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}},d=new y._cesium.PolylineVolumeGeometry(h),m=y._cesium.PolylineVolumeGeometry.createGeometry(d),p=new y._cesium.GeometryInstance({id:e,geometry:m,attributes:{color:new y._cesium.ColorGeometryInstanceAttribute.fromColor(_.material)}}),g=new y._cesium.Primitive({allowPicking:!0,appearance:new y._cesium.MaterialAppearance({material:new y._cesium.Material({fabric:{type:"Color",uniforms:{color:_.material}}}),faceForward:!0,flat:!1}),shadows:_.shadows,geometryInstances:p});f.add(g)}),f},this.item=s._primitiveCollection,s.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(_.id)&&(_.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+_.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var l={id:_.id,name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t.url,style:v};this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item)},t.prototype.setTreeobj=function(e){this.treeobj=e},t.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},t.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch(e){}},t.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(e)}catch(e){}},t.prototype.setVisibility=function(e){try{null!=this.item&&null!=this.item.show&&(this.item.show=e),this._Provider&&this._Provider.setStatus(e)}catch(e){}},t.prototype.isCache=function(e){this._cache=e},t.prototype.edit=function(e,t){return this.isEditting=e,this.editoption=t,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},t.prototype.forceRefresh=function(){try{for(var e=0;e<this._Provider.quadtree._levelZeroTiles.length;e++)this._Provider.quadtree._levelZeroTiles[e].freeResources()}catch(e){}},t}),define("SGWorld/Creator/WallGeoFeatureLayer",["../Core/Core","./Color","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min","../Core/jquery","../VectorTileProvider/VectorTileProvider","../VectorTileProvider/GeoJSONVectorTileProvider"],function(i,r,o,y,e,n,l){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._color=new r(this._viewer,this._cesium),this._tree=o,this._VectorTileProvider=new n(this._viewer,this._cesium),this._primitive=void 0,this._Provider=void 0,this.Legend=[]}return t.prototype.createWallGeoFeatureLayer=function(r,o,e,n,a,t,i){var s={positions:[],minimumHeights:[],maximumHeights:[],granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED};this._core.isnull(e)||this._core.isnull(e.material)||"["==e.material.toString().charAt(0)&&"]"==e.material.toString().charAt(e.material.length-1)||(this._core.isHtmlColor(e.material)?e.material=this._color.colorFromHtmlColor(e.material):(/^rgb/.test(e.material)&&(e.material=this._color.rgbaStringToRgbaObj(e.material)),1<e.material.r&&(e.material.r=e.material.r/255),1<e.material.g&&(e.material.g=e.material.g/255),1<e.material.b&&(e.material.b=e.material.b/255),1<e.material.a&&(e.material.a=e.material.a/255),e.material=this._color.createColor(e.material.r,e.material.g,e.material.b,e.material.a)));var l=this._core.extend(s,e,!0);this._core.isnull(n)&&(n=16),this._core.isnull(a)&&(a=14),null==o&&console.log("url is required"),null==r&&console.log("layername is required");var u=this,c=[];this._VectorTileProvider.loadTile=function(e,t){if((this.tile=t).state===u._cesium.QuadtreeTileLoadState.START)if(t.data={lines:[],geometryPrimitive:void 0},t.level>=a&&t.level<n){var i=y.filter(c,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=i.length&&i[0].data&&0<i[0].data.length)return t.data.geometryPrimitive=new u._cesium.Primitive({geometryInstances:i[0].data,appearance:new u._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:u._cesium.ShadowMode.ENABLED}),t.state=u._cesium.QuadtreeTileLoadState.LOADING,void(t.state===u._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=u._cesium.QuadtreeTileLoadState.DONE,t.renderable=!0));c.push({level:t.level,x:t.x,y:t.y,data:void 0}),s=t,u._core.xhr({url:o+"?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER="+r+"&STYLE=&TILEMATRIX=EPSG:4490:"+s.level+"&TILEMATRIXSET=EPSG:4490&FORMAT=application/json;type=geojson&TILECOL="+s.x+"&TILEROW="+s.y,type:"get",dataType:"json",success:function(e){var t=[];function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):o.push(e[t])}for(var r=0;r<e.features.length;r++){var o=[];i(e.features[r].geometry.coordinates[0]);var n=u._cesium.Cartesian3.fromDegreesArray(o);l.positions=n;var a=new u._cesium.GeometryInstance({geometry:new u._cesium.WallGeometry({positions:l.positions}),attributes:{color:new u._cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE)}});t.push(a)}y.filter(c,function(e){return e.x==s.x&&e.y==s.y})[0].data=t,s.data.geometryPrimitive=new u._cesium.Primitive({geometryInstances:t,appearance:new u._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:u._cesium.ShadowMode.ENABLED})},error:function(){c=y.remove(c,function(e){return e.x==s.x&&e.y==s.y&&e.level==s.level})},complete:function(){s.state=u._cesium.QuadtreeTileLoadState.LOADING,s.state===u._cesium.QuadtreeTileLoadState.LOADING&&(s.data.geometryPrimitive&&s.data.geometryPrimitive.update(e,[]),s.state=u._cesium.QuadtreeTileLoadState.DONE,s.renderable=!0)}})}else t.state=u._cesium.QuadtreeTileLoadState.LOADING,t.state===u._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=u._cesium.QuadtreeTileLoadState.DONE,t.renderable=!0);var s},this._primitive=new u._cesium.QuadtreePrimitive({tileProvider:this._VectorTileProvider}),this._viewer.scene.primitives.add(this._primitive)},t.prototype.createWallPrimitiveGeoFeatureLayer=function(e,t,m,i,p,g){var f={positions:void 0,granularity:this._cesium.Math.RADIANS_PER_DEGREE,maximumHeights:0,minimumHeights:0,vertexFormat:this._cesium.VertexFormat.DEFAULT};null==t&&console.log("geojson is required");var r=null;r=t.then?t:this._cesium.GeoJsonDataSource.load(t);var v=this,_=[];r.then(function(e){for(var t,i=e.entities.values,r=0;r<i.length;r++){var o=i[r];f.positions=o.polyline.positions._value;var n=new Array(f.positions.length),a=new Array(f.positions.length),s=void 0,l=void 0;s=/^\[/.test(m.minimumHeights)?(s=m.minimumHeights.replace(/\[/,"").replace("/]/",""),o.properties[s]._value):m.minimumHeights,l=/^\[/.test(m.maximumHeights)?(l=m.maximumHeights.replace(/\[/,"").replace("/]/",""),o.properties[l]._value):m.maximumHeights,n.fill(s),a.fill(l),f.minimumHeights=n,f.maximumHeights=a;var u=v._cesium.Color.WHITE;v._core.isnull(m)||v._core.isnull(m.material)||(u="["==m.material.toString().charAt(0)&&"]"==m.material.toString().charAt(m.material.length-1)?m.material.replace(/\[/,"").replace("/]/",""):y.clone(m.material),u=v._core.isHtmlColor(u)?v._color.colorFromHtmlColor(m.material):(/^rgb/.test(u)&&(u=v._color.rgbaStringToRgbaObj(u)),1<u.r&&(u.r=u.r/255),1<u.g&&(u.g=u.g/255),1<u.b&&(u.b=u.b/255),1<u.a&&(u.a=u.a/255),v._color.createColor(u.r,u.g,u.b,u.a)));var c="material:"+255*u.red+","+255*u.green+","+255*u.blue;v.Legend.push(c);var h=new v._cesium.GeometryInstance({id:o,geometry:new v._cesium.WallGeometry(f),attributes:{color:new v._cesium.ColorGeometryInstanceAttribute.fromColor(u)}});_.push(h)}m&&m.time&&(t=new v._cesium.TimeIntervalCollection([new v._cesium.TimeInterval({start:m.time.start?v._cesium.JulianDate.fromDate(new Date(m.time.start)):v._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?v._cesium.JulianDate.fromDate(new Date(m.time.end)):v._cesium.Iso8601.MAXIMUM_VALUE})]));var d=v._viewer.scene.primitives.add(new v._cesium.Primitive({geometryInstances:_,appearance:new v._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0})}),t);v.item=d,p||_this.setVisibility(!1),"function"==typeof g&&g(d)}),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建墙图层"+options.id);var o={id:m.id,name:e,pId:this._core.isnull(i)?0:i,type:"polylineWallLayer",item:this,url:t,style:options};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},t.prototype.createWallGeoJsonFeatureLayerProvider=function(e,t,m,i,r,o){var p={positions:void 0,granularity:this._cesium.Math.RADIANS_PER_DEGREE,maximumHeights:0,minimumHeights:0,vertexFormat:this._cesium.VertexFormat.DEFAULT},n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(m)||this._core.isnull(m.material)||"["==m.material.toString().charAt(0)&&"]"==m.material.toString().charAt(m.material.length-1)||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),1<m.material.r&&(m.material.r=m.material.r/255),1<m.material.g&&(m.material.g=m.material.g/255),1<m.material.b&&(m.material.b=m.material.b/255),1<m.material.a&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)));var a=new l(this._viewer,this._cesium,n);this._Provider=a;var g=this;a._loadTile=function(e){g.Legend=[];var d=new g._cesium.PrimitiveCollection;return e.features.forEach(function(c){var i=[],h=!1;function r(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?r(e[t]):(i.push(e[t]),2!==t||h||(h=!0))}if(Array.isArray(c.geometry.coordinates)&&0<c.geometry.coordinates.length)if(Array.isArray(c.geometry.coordinates[0][0]))for(var e=0;e<c.geometry.coordinates.length;e++)i=[],r(c.geometry.coordinates[e]),t(i);else r(c.geometry.coordinates),t(i);function t(e){if(/^\[/.test(m.material)&&/\]$/.test(m.material)){var t=m.material.replace(/\[/,"").replace(/\]/,"");options.material=c.properties[t],g._core.isHtmlColor(options.material)?options.material=g._color.colorFromHtmlColor(options.material):(/^rgb/.test(options.material)&&(options.material=g._color.rgbaStringToRgbaObj(options.material)),1<options.material.r&&(options.material.r=options.material.r/255),1<options.material.g&&(options.material.g=options.material.g/255),1<options.material.b&&(options.material.b=options.material.b/255),1<options.material.a&&(options.material.a=options.material.a/255),options.material=g._color.createColor(options.material.r,options.material.g,options.material.b,options.material.a))}var i=h?g._cesium.Cartesian3.fromDegreesArrayHeights(e):g._cesium.Cartesian3.fromDegreesArray(e);p.positions=i,c.positions=i;var r=new Array(p.positions.length),o=new Array(p.positions.length),n=void 0,a=void 0;n=/^\[/.test(m.minimumHeights)?(n=m.minimumHeights.replace(/\[/,"").replace("/]/",""),entity.properties[n]._value):m.minimumHeights,a=/^\[/.test(m.maximumHeights)?(a=m.maximumHeights.replace(/\[/,"").replace("/]/",""),entity.properties[a]._value):m.maximumHeights,r.fill(n),o.fill(a),p.minimumHeights=r,p.maximumHeights=o,c.treeID=m.id,c.VectorType="wall",c.VectorStyle={haveZ:h,minimumHeights:r,maximumHeights:o,positions:e,material:m.material};var s=new g._cesium.GeometryInstance({id:c,geometry:new g._cesium.WallGeometry(p),attributes:{color:new g._cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}}),l="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue;g.Legend.push(l);var u=new g._cesium.Primitive({geometryInstances:s,appearance:new g._cesium.MaterialAppearance({material:new g._cesium.Material({fabric:{type:"Color",uniforms:{color:m.material}}}),faceForward:!0,flat:!1}),vertexCacheOptimize:!0,interleave:!0,shadows:g._cesium.ShadowMode.ENABLED});d.add(u)}}),d},m&&m.time&&(a.availability=new g._cesium.TimeIntervalCollection([new g._cesium.TimeInterval({start:m.time.start?g._cesium.JulianDate.fromDate(new Date(m.time.start)):g._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?g._cesium.JulianDate.fromDate(new Date(m.time.end)):g._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=a._primitiveCollection,a.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建墙图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var s={id:m.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineWallLayer",item:this,url:t.url,style:m};return this._Provider.treeID=m.id,this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},t.prototype.setTreeobj=function(e){this.treeobj=e},t.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch(e){}},t.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},t.prototype.getLegend=function(){var e=[];return null!=this.Legend&&(e=this._core.unique(this.Legend)),e},t.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(!e)}catch(e){}},t.prototype.setVisibility=function(e){this.item.show=e,this._Provider&&this._Provider.setStatus(!e)},t.prototype.edit=function(e,t){return this.isEditting=e,this.editoption=t,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},t.prototype.forceRefresh=function(){try{for(var e=0;e<this._Provider.quadtree._levelZeroTiles.length;e++)this._Provider.quadtree._levelZeroTiles[e].freeResources()}catch(e){}},t}),define("SGWorld/ProjectTree/createGroup",["./treeSource","../Core/Core"],function(a,i){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._tree=a.getSource(),this._core=new i}return e.prototype.createGroup=function(e,t,i){if(0==i);else if(null==i||null==i||""==i){if(i=this._core.isnull(a.selectedItem)?0:a.selectedItem.id,o=a.getSourceByName(this._tree,e))return o.id}var r=a.getSourceById(this._tree,i);if(r){var o;if(o=a.getSourceByName(r.children,e))return o.id;var n={id:this._core.getuid(),name:e,pId:i,checked:t,type:"group",item:this};return this.item=n,a.insertGroupId(n,i)}n={id:this._core.getuid(),name:e,pId:i,type:"group",checked:t,item:this};return this.item=n,a.insertGroupId(n,i)},e.prototype.changeGroup=function(e,t){a.changeGroup(e,t)},e.prototype.starttemporaryItem=function(){return a.starttemporaryItem(this._viewer)},e.prototype.pushtemporaryItem=function(e){a.temporaryItem.obj.push(e)},e.prototype.pushStateItem=function(e){a.temporaryItem.operation=e},e.prototype.endtemporaryItem=function(){a.endtemporaryItem()},e.prototype.export=function(){return{type:"group",style:{name:this.item.name,pId:this.item.pId}}},e}),define("SGWorld/Creator/PointModel",["../Core/Core","./Color","../ProjectTree/treeSource","../ProjectTree/createGroup","../Analysis/Cdcl/Cdcl"],function(i,r,o,n,e){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._color=new r(this._viewer,this._cesium),this._tree=o,this._createGroup=new n,this.model=[],this.heading=this._cesium.Math.toRadians(0),this.pitch=this._cesium.Math.toRadians(0),this.roll=this._cesium.Math.toRadians(0),this.rotate=10,this.state=0,this.modelPointArr=[],this.modifyModel=null,this.modifyPoint=null,this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this.position=null,this.tempPoints=[],this.scale=0,this.Radius=20}return t.prototype.exectPointModel=function(e,t,v,i,_,y){var r={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30};this._core.isnull(v)||this._core.isnull(v.material)||"["==v.material.toString().charAt(0)&&"]"==v.material.toString().charAt(v.material.length-1)||(this._core.isHtmlColor(v.material)?v.material=this._color.colorFromHtmlColor(v.material):(/^rgb/.test(v.material)&&(v.material=this._color.rgbaStringToRgbaObj(v.material)),1<v.material.r&&(v.material.r=v.material.r/255),1<v.material.g&&(v.material.g=v.material.g/255),1<v.material.b&&(v.material.b=v.material.b/255),1<v.material.a&&(v.material.a=v.material.a/255),v.material=this._color.createColor(v.material.r,v.material.g,v.material.b,v.material.a))),this._core.isnull(v)||this._core.isnull(v.color)||"["==v.color.toString().charAt(0)&&"]"==v.color.toString().charAt(v.color.length-1)||(this._core.isHtmlColor(v.color)?v.color=this._color.colorFromHtmlColor(v.color):(/^rgb/.test(v.color)&&(v.color=this._color.rgbaStringToRgbaObj(v.color)),1<v.color.r&&(v.color.r=v.color.r/255),1<v.color.g&&(v.color.g=v.color.g/255),1<v.color.b&&(v.color.b=v.color.b/255),1<v.color.a&&(v.color.a=v.color.a/255),v.color=this._color.createColor(v.color.r,v.color.g,v.color.b,v.color.a))),this._core.isnull(v)||this._core.isnull(v.lightColor)||"["==v.lightColor.toString().charAt(0)&&"]"==v.lightColor.toString().charAt(v.lightColor.length-1)||(this._core.isHtmlColor(v.lightColor)?v.lightColor=this._color.colorFromHtmlColor(v.lightColor):(/^rgb/.test(v.lightColor)&&(v.lightColor=this._color.rgbaStringToRgbaObj(v.lightColor)),1<v.lightColor.r&&(v.lightColor.r=v.lightColor.r/255),1<v.lightColor.g&&(v.lightColor.g=v.lightColor.g/255),1<v.lightColor.b&&(v.lightColor.b=v.lightColor.b/255),1<v.lightColor.a&&(v.lightColor.a=v.lightColor.a/255),v.lightColor=this._color.createColor(v.lightColor.r,v.lightColor.g,v.lightColor.b,v.lightColor.a))),this._core.isnull(v)||this._core.isnull(v.linecolor)||"["==v.linecolor.toString().charAt(0)&&"]"==v.linecolor.toString().charAt(v.linecolor.length-1)||(this._core.isHtmlColor(v.linecolor)?v.linecolor=this._color.colorFromHtmlColor(v.linecolor):(/^rgb/.test(v.linecolor)&&(v.linecolor=this._color.rgbaStringToRgbaObj(v.linecolor)),1<v.linecolor.r&&(v.linecolor.r=v.linecolor.r/255),1<v.linecolor.g&&(v.linecolor.g=v.linecolor.g/255),1<v.linecolor.b&&(v.linecolor.b=v.linecolor.b/255),1<v.linecolor.a&&(v.linecolor.a=v.linecolor.a/255),v.linecolor=this._color.createColor(v.linecolor.r,v.linecolor.g,v.linecolor.b,v.linecolor.a)));var C=this._core.extend(r,v,!0);this._core.isnull(v.near)&&(v.near=0),this._core.isnull(v.far)&&(v.far=999999999);var o=parseFloat(v.near),n=parseFloat(v.far),a=new this._cesium.DistanceDisplayCondition(o,n);C.distanceDisplayCondition=a,null==t&&console.log("geojson is required");var s=null;s=t.then?t:this._cesium.GeoJsonDataSource.load(t);var w=this;s.then(function(e){for(var t,i=e.entities.values,r=[],o=(i=e.entities.values,r=[],0);o<i.length;o++){var n=i[o],a=new w._cesium.GeometryInstance({id:n,geometry:new w._cesium.CorridorGeometry({positions:n.polyline.positions._value,width:C.width,height:C.height,arcType:C.arcType,vertexFormat:w._cesium.VertexFormat.POSITION_ONLY}),attributes:{color:new w._cesium.ColorGeometryInstanceAttribute.fromColor(C.linecolor)}});r.push(a)}v&&v.time&&(t=new w._cesium.TimeIntervalCollection([new w._cesium.TimeInterval({start:v.time.start?w._cesium.JulianDate.fromDate(new Date(v.time.start)):w._cesium.Iso8601.MINIMUM_VALUE,stop:v.time.end?w._cesium.JulianDate.fromDate(new Date(v.time.end)):w._cesium.Iso8601.MAXIMUM_VALUE})]));var s=w._viewer.scene.primitives.add(new w._cesium.GroundPrimitive({geometryInstances:r,classificationType:w._cesium.ClassificationType.BOTH}),t);s.show=C.show,w.item=s;var l=[];for(o=0;o<i.length;o++){n=i[o];for(var u=n.polyline.positions.getValue(),c=1;c<u.length;c++)try{var h=[];h.push(u[c-1]),h.push(u[c]);var d=w._cesium.SceneTransforms.wgs84ToWindowCoordinates(w._viewer.scene,u[c-1]).x,m=w._cesium.SceneTransforms.wgs84ToWindowCoordinates(w._viewer.scene,u[c-1]).y,p=w._cesium.SceneTransforms.wgs84ToWindowCoordinates(w._viewer.scene,u[c]).x,g=w._cesium.SceneTransforms.wgs84ToWindowCoordinates(w._viewer.scene,u[c]).y;l=w.setPolylinemodels(h,d,m,p,g,l,C,w._cesium,w._viewer,t)}catch(e){}}var f=new w._cesium.ModelInstanceCollectionzh({url:C.url,instances:l,color:C.color,lightColor:C.lightColor,scale:parseInt(C.scale),heightReference:parseInt(C.heightReference),distanceDisplayCondition:C.distanceDisplayCondition});w._viewer.scene.primitives.add(f),w.model.push(f),_||w.setVisibility(!1),"function"==typeof y&&y(s)}),this._core.isnull(C.id)&&(C.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+C.id);var l={id:C.id,name:e,checked:_,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this};return this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(i)?0:i),this},t.prototype.createPointModel=function(e,c){var h=this,d=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),d=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene._imageryLayerCollection);var m=[],i=null,o=0,n=null,p=[],g=e.parameterd,f=(e.objid,e.cyjj),t=e.url;this.modelurl=t;var v=[],r={point:h._cesium.Color.RED,polyline:h._cesium.Color.YELLOW};0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(r.point=e.point),""!=e.polyline&&null!=e.polyline&&(r.polyline=e.polyline));var _=this._core.CreateTooltip(),y={spot:[],distance:[],label:[],polyline:[],model:[]};d.setInputAction(function(e){0===m.length?_.showAt(e.endPosition,"左键开始,右键结束!"):_.showAt(e.endPosition,"右键结束!");var t=h._viewer.camera.getPickRay(e.endPosition);n=h._viewer.scene.globe.pick(t,h._viewer.scene),2<=m.length&&(h._cesium.defined(i)?(m.pop(),m.push(n)):i=new a(m),o=h._core.getHorizontalDistance(m,h._cesium))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),d.setInputAction(function(e){var t=h._viewer.camera.getPickRay(e.position);n=h._viewer.scene.globe.pick(t,h._viewer.scene),0==m.length&&m.push(n.clone());var i={px:e.position.x,py:e.position.y};m.push(n);var r={positionsxp:n,lxy:i};v.push(r);"总长:"+o,y.spot.push(n),y.distance.push(o)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),d.setInputAction(function(e){d.destroy(),m.pop();for(var t=0;t<p.length;t++)h._viewer.entities.remove(p[t]);for(var i=[],r=1;r<v.length;r++){var o=[],n=v[r-1].lxy.px,a=v[r-1].lxy.py,s=v[r].lxy.px,l=v[r].lxy.py,u=g;o.push(v[r-1].positionsxp),o.push(v[r].positionsxp),i=h.setPolylinemodel(o,n,a,s,l,u,f,h.modelurl,i,h._cesium,h._viewer)}y.model=i,""!=c&&null!=c&&"function"==typeof c&&c(y),_.show(!1)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK);var a=function(){function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:r.polyline,width:3,clampToGround:!0}},this.positions=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polyline.positions=new h._cesium.CallbackProperty(function(){return e.positions},!1);var t=h._viewer.entities.add(this.options);h.item=t,p.push(t),y.polyline.push(t)},e}();return this},t.prototype.setPolylinemodel=function(e,t,i,r,o,n,a,s,l,u,c){var h=this._core.getSpaceDistancem(e,u);0==a||(n=parseInt(h/a));for(var d=e[0],m=e[e.length-1],p=u.Cartographic.fromCartesian(d),g=u.Math.toDegrees(p.longitude),f=u.Math.toDegrees(p.latitude),v=(p.height,u.Cartographic.fromCartesian(m)),_=u.Math.toDegrees(v.longitude),y=u.Math.toDegrees(v.latitude),C=(v.height,n),w=u.Math.lerp(g,_,1/C)-g,b=u.Math.lerp(f,y,1/C)-f,E=u.Math.lerp(t,r,1/C)-t,S=u.Math.lerp(i,o,1/C)-i,P=0;P<C;P++){var x=g+(P+1)*w,T=f+(P+1)*b;0==P?new u.Cartesian3(x,T,0):1==P&&new u.Cartesian3(x,T,0);var I=(M=t+(P+1)*E,A=i+(P+1)*S),D=(I={x:M,y:A},c.camera.pickEllipsoid(I,c.scene.globe.ellipsoid)),L=u.Cartographic.fromCartesian(D),M=u.Math.toDegrees(L.longitude),A=u.Math.toDegrees(L.latitude),R=u.Transforms.eastNorthUpToFixedFrame(u.Cartesian3.fromDegrees(M,A,6)),O=u.Model.fromGltf({url:s,modelMatrix:R,scale:100});c.scene.primitives.add(O);l.push(O)}return l},t.prototype.setPolylinemodels_obsolete=function(e,t,i,r,o,n,a,s,l,u){var c=this._core.getSpaceDistancem(e,s),h=10,d=parseFloat(a.distance);0==d||(h=parseInt(c/d));for(var m=e[0],p=e[e.length-1],g=s.Cartographic.fromCartesian(m),f=s.Math.toDegrees(g.longitude),v=s.Math.toDegrees(g.latitude),_=(g.height,s.Cartographic.fromCartesian(p)),y=s.Math.toDegrees(_.longitude),C=s.Math.toDegrees(_.latitude),w=(_.height,s.Math.toDegrees(g.height),h),b=s.Math.lerp(f,y,1/w)-f,E=s.Math.lerp(v,C,1/w)-v,S=(s.Math.lerp(t,r,1/w),s.Math.lerp(i,o,1/w),0);S<w;S++){var P=f+(S+1)*b,x=v+(S+1)*E,T=s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(P,x,a.height)),I=(parseInt(a.heightReference),s.Model.fromGltf({url:a.url,modelMatrix:T,color:a.color,lightColor:a.lightColor,scale:parseInt(a.scale),heightReference:parseInt(a.heightReference),distanceDisplayCondition:a.distanceDisplayCondition}));l.scene.primitives.add(I,u);n.push(I)}return n},t.prototype.setPolylinemodels=function(e,t,i,r,o,n,a,s,l,u){var c=this._core.getSpaceDistancem(e,s),h=10,d=parseFloat(a.distance);0==d||(h=parseInt(c/d));for(var m=e[0],p=e[e.length-1],g=s.Cartographic.fromCartesian(m),f=s.Math.toDegrees(g.longitude),v=s.Math.toDegrees(g.latitude),_=(g.height,s.Cartographic.fromCartesian(p)),y=s.Math.toDegrees(_.longitude),C=s.Math.toDegrees(_.latitude),w=(_.height,s.Math.toDegrees(g.height),h),b=s.Math.lerp(f,y,1/w)-f,E=s.Math.lerp(v,C,1/w)-v,S=(s.Math.lerp(t,r,1/w),s.Math.lerp(i,o,1/w),0);S<w;S++){var P=f+(S+1)*b,x=v+(S+1)*E,T=s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(P,x,parseInt(a.height?a.height:0)));parseInt(a.heightReference);Cesium.Matrix4.multiplyByUniformScale(T,parseInt(a.scale),T),n.push({modelMatrix:T,modelId:a})}return n},t.prototype.createPolygonModel=function(e,t,m,i,r,p){var o={height:0,extrudedHeight:0,heightReference:this._cesium.HeightReference.RELATIVE_TO_GROUND,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:0,granularity:this._cesium.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:this._cesium.ShadowMode.ENABLED,clampToGround:!0,scale:1,classificationType:this._cesium.ClassificationType.BOTH},g=m.modelurl;this._core.isnull(m)||this._core.isnull(m.fill)||(this._core.isHtmlColor(m.fill)?m.material=this._color.colorFromHtmlColor(m.fill):(/^rgb/.test(m.fill)&&(m.material=this._color.rgbaStringToRgbaObj(m.fill)),1<m.material.r&&(m.material.r=m.material.r/255),1<m.material.g&&(m.material.g=m.material.g/255),1<m.material.b&&(m.material.b=m.material.b/255),1<m.material.a&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))),this._core.isnull(m)||this._core.isnull(m.outlineColor)||(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),1<m.outlineColor.r&&(m.outlineColor.r=m.outlineColor.r/255),1<m.outlineColor.g&&(m.outlineColor.g=m.outlineColor.g/255),1<m.outlineColor.b&&(m.outlineColor.b=m.outlineColor.b/255),1<m.outlineColor.a&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a))),this._core.isnull(m)||this._core.isnull(m.color)||(this._core.isHtmlColor(m.color)?m.color=this._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=this._color.rgbaStringToRgbaObj(m.color)),1<m.color.r&&(m.color.r=m.color.r/255),1<m.color.g&&(m.color.g=m.color.g/255),1<m.color.b&&(m.color.b=m.color.b/255),1<m.color.a&&(m.color.a=m.color.a/255),m.color=this._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a))),this._core.isnull(m)||this._core.isnull(m.lightColor)||(this._core.isHtmlColor(m.lightColor)?m.lightColor=this._color.colorFromHtmlColor(m.lightColor):(/^rgb/.test(m.lightColor)&&(m.lightColor=this._color.rgbaStringToRgbaObj(m.lightColor)),1<m.lightColor.r&&(m.lightColor.r=m.lightColor.r/255),1<m.lightColor.g&&(m.lightColor.g=m.lightColor.g/255),1<m.lightColor.b&&(m.lightColor.b=m.lightColor.b/255),1<m.lightColor.a&&(m.lightColor.a=m.lightColor.a/255),m.lightColor=this._color.createColor(m.lightColor.r,m.lightColor.g,m.lightColor.b,m.lightColor.a)));var f=this._core.extend(o,m,!0);m.checked=r,f.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND;null==t&&console.log("geojson is required");var n=null;n=t.then?t:this._cesium.GeoJsonDataSource.load(t,{clampToGround:!0}),this._viewer.dataSources.add(n);var v,_=this;m&&m.time&&(v=new _._cesium.TimeIntervalCollection([new _._cesium.TimeInterval({start:m.time.start?_._cesium.JulianDate.fromDate(new Date(m.time.start)):_._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?_._cesium.JulianDate.fromDate(new Date(m.time.end)):_._cesium.Iso8601.MAXIMUM_VALUE})])),n.then(function(e){_.item=e,_.model=[];var t=e.entities.values;_._core.isnull(m.near)&&(m.near=0),_._core.isnull(m.far)&&(m.far=999999999);var i=parseFloat(m.near),r=parseFloat(m.far),o=new _._cesium.DistanceDisplayCondition(i,r);f.distanceDisplayCondition=o;for(var n=0;n<t.length;n++){var a=t[n];f.height=parseFloat(_._core.extendgl(a,m.height,f.height)),f.extrudedHeight=parseFloat(_._core.extendgl(a,m.extrudedHeight,f.extrudedHeight)),f.heightReference=_._core.extendgl(a,m.heightReference,f.heightReference),f.show=_._core.extendgl(a,m.show,f.show),f.material=_._core.extendgl(a,m.material,f.material),f.outline=_._core.extendgl(a,m.outline,f.outline),f.outlineColor=_._core.extendgl(a,m.outlineColor,f.outlineColor),f.outlineWidth=parseFloat(_._core.extendgl(a,m.outlineWidth,f.outlineWidth)),f.stRotation=_._core.extendgl(a,m.stRotation,f.stRotation),f.granularity=_._core.extendgl(a,m.granularity,f.granularity),f.distanceDisplayCondition=_._core.extendgl(a,m.distanceDisplayCondition,f.distanceDisplayCondition),f.perPositionHeight=_._core.extendgl(a,m.perPositionHeight,f.perPositionHeight),f.closeTop=_._core.extendgl(a,m.closeTop,f.closeTop),f.closeBottom=_._core.extendgl(a,m.closeBottom,f.closeBottom),f.shadows=_._core.extendgl(a,m.shadows,f.shadows),f.classificationType=_._core.extendgl(a,m.classificationType,f.classificationType);a.polygon._hierarchy._value.positions;a.polygon.heightReference=1,a.polygon.show=f.show,a.polygon.material=f.material,a.polygon.outline=f.outline,a.polygon.outlineColor=f.outlineColor,a.polygon.outlineWidth=f.outlineWidth,a.polygon.stRotation=f.stRotation,a.polygon.granularity=f.granularity,a.polygon.distanceDisplayCondition=o,a.polygon.closeTop=f.closeTop,a.polygon.closeBottom=f.closeBottom,a.polygon.shadows=f.shadows,a.polygon.classificationType=f.classificationType,v&&(a.availability=v);for(var s=[],l=a.polygon.hierarchy.getValue().positions,u=0;u<l.length;u++){var c=_._cesium.Math.toDegrees(_._cesium.Cartographic.fromCartesian(l[u]).longitude),h=_._cesium.Math.toDegrees(_._cesium.Cartographic.fromCartesian(l[u]).latitude);s.push(c),s.push(h)}var d=_.getTheBottomPoint(s);_.scanningPolygon(d,f.offset_x,f.offset_y,s).forEach(function(e){var t=_._cesium.Transforms.eastNorthUpToFixedFrame(_._cesium.Cartesian3.fromDegrees(e.lon,e.lat,f.height)),i=_._cesium.Model.fromGltf({url:g,color:f.color,silhouetteColor:f.lightColor,silhouetteSize:f.lightWidth,modelMatrix:t,scale:f.scale,heightReference:parseInt(f.heightReference),distanceDisplayCondition:o});_._viewer.scene.primitives.add(i,v);i.time=v,_.model.push(i)})}m.checked||_.setVisibility(!1),"function"==typeof p&&p(e)}),this._core.isnull(f.id)&&(f.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+f.id);var a={id:f.id,name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t,style:f};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},t.prototype.setItem=function(e){this.item=e},t.prototype.modelMove=function(){this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.yd=!1;var l=this;this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene._imageryLayerCollection),this._tree.handler.setInputAction(function(e){l._viewer.scene.pickPosition(e.position);var t=l._viewer.scene.pick(e.position);if(null!=l.yd&&l.yd&&l._tree.handler.destroy(),l.yd=!0,null!=t.tileset){var n=t.tileset,a=l._cesium.Cartographic.fromCartesian(n.boundingSphere.center),s=l._cesium.Cartesian3.fromRadians(a.longitude,a.latitude,a.height);l._tree.handler.setInputAction(function(e){var t=l._viewer.scene.pickPosition(e.endPosition),i=l._cesium.Cartographic.fromCartesian(t),r=l._cesium.Cartesian3.fromRadians(i.longitude,i.latitude,a.height),o=l._cesium.Cartesian3.subtract(r,s,new l._cesium.Cartesian3);n.modelMatrix=l._cesium.Matrix4.fromTranslation(o)},l._cesium.ScreenSpaceEventType.MOUSE_MOVE)}},l._cesium.ScreenSpaceEventType.LEFT_CLICK)},t.prototype.getTheBottomPoint=function(e){for(var t=90,i=0,r=1;r<e.length;r+=2)t=t<e[r]?t:(i=r)&&e[r];return{lon:e[i-1],lat:e[i]}},t.prototype.scanningPolygon=function(e,t,i,r){for(var o,n,a,s,l,u=[],c=180,h=-180,d=-90,m=0;m<r.length;m+=2)d=d>r[m+1]?d:r[m+1],c=c<r[m]?c:r[m],h=h>r[m]?h:r[m];var p=this.GetPositionFromA_D(e.lat,e.lon,i,0);for(o=this.GetPositionFromA_D(e.lat,e.lon,t,90)[0]-e.lon,n=p[1]-e.lat,u.push({lon:e.lon,lat:e.lat}),(l={lon:e.lon,lat:e.lat}).lat+=n;l.lat<=d;l.lat+=n){for(a={lon:l.lon-o,lat:l.lat},s={lon:l.lon+o,lat:l.lat},this.IsInPolygon(l.lon,l.lat,r)&&u.push({lon:l.lon,lat:l.lat});a.lon>=c;a.lon-=o)this.IsInPolygon(a.lon,a.lat,r)&&u.push({lon:a.lon,lat:a.lat});for(;s.lon<=h;s.lon+=o)this.IsInPolygon(s.lon,s.lat,r)&&u.push({lon:s.lon,lat:s.lat})}return u},t.prototype.GetPositionFromA_D=function(e,t,i,r){var o=i*Math.sin(r*Math.PI/180),n=i*Math.cos(r*Math.PI/180),a=6356725+21412*(90-e)/90;return[180*(o/(a*Math.cos(e*Math.PI/180))+t*Math.PI/180)/Math.PI,180*(n/a+e*Math.PI/180)/Math.PI]},t.prototype.IsInPolygon=function(e,t,i){var r,o,n,a,s=0;if(i.length<6)return!1;i.push(i[0],i[1]);for(var l=0;l<i.length-2;l+=2)r=i[l],n=i[l+1],o=i[l+2],a=i[l+3],(n<=t&&t<a||a<=t&&t<n)&&0<Math.abs(n-a)&&r-(r-o)*(n-t)/(n-a)<=e&&s++;return s%2!=0},t.prototype.createModel=function(e,t,i,r,o,n){var a={id:this._core.getuid(),uri:t,show:!0,heading:0,pitch:0,roll:0,scale:1},s=this._core.extend(a,i,!0);this._position=e;var l={id:s.id,position:this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),model:s};(s.heading||s.pitch||s.roll)&&(this.heading=s.heading,this.pitch=s.pitch,this.roll=s.roll,l.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._cesium.defaultValue(s.heading,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(s.pitch,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(s.roll,0)))));var u=this;s.rotate&&(l.orientation=new this._cesium.CallbackProperty(function(){return u.heading=u.heading+u.rotate,u._cesium.Transforms.headingPitchRollQuaternion(u._cesium.Cartesian3.fromDegrees(u._position[0],u._position[1],u._position[2]),new u._cesium.HeadingPitchRoll(u._cesium.Math.toRadians(u._cesium.defaultValue(u.heading,0)),u._cesium.Math.toRadians(u._cesium.defaultValue(u.pitch,0)),u._cesium.Math.toRadians(u._cesium.defaultValue(u.roll,0))))},!1),u.rotate=s.rotate,delete s.rotate),delete s.heading,delete s.pitch,delete s.roll,l.model=s,this.item=this._viewer.entities.add(l),"function"==typeof n&&n(this.item);var c={id:this.item.id,name:o||"新建模型"+a.id,pId:this._core.isnull(r)?0:r,type:"Point",item:this.item};return this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(r)?0:r),this},t.prototype.createModelEditable=function(e,t,i,r,o,n){var a={id:this._core.getuid(),uri:t,show:!0,heading:0,pitch:0,roll:0,scale:1},s=this._core.extend(a,i,!0);this._position=e;var l={position:this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),model:s},u=this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),c=this.createCylinder(u,new this._cesium.CallbackProperty(function(){var e=g._cesium.Cartesian3.fromDegrees(g._position[0],g._position[1],g._position[2]),t=g._cesium.Math.toRadians(g.heading),i=new g._cesium.HeadingPitchRoll(t,g._cesium.Math.toRadians(g.pitch),g._cesium.Math.toRadians(g.roll));return g._cesium.Transforms.headingPitchRollQuaternion(e,i)},!1),new this._cesium.CallbackProperty(f,!1),new this._cesium.CallbackProperty(v,!1),this._cesium.Color.LIMEGREEN,!1);c.oid=1,this.modelPointArr.push(c);var h=this.createCylinder(u,new this._cesium.CallbackProperty(function(){var e=g._cesium.Cartesian3.fromDegrees(g._position[0],g._position[1],g._position[2]),t=g._cesium.Math.toRadians(g.heading),i=new g._cesium.HeadingPitchRoll(t,g._cesium.Math.toRadians(90+g.pitch),g._cesium.Math.toRadians(g.roll));return g._cesium.Transforms.headingPitchRollQuaternion(e,i)},!1),new this._cesium.CallbackProperty(f,!1),new this._cesium.CallbackProperty(v,!1),this._cesium.Color.MEDIUMBLUE,!1);h.oid=2,this.modelPointArr.push(h);var d=this.createCylinder(u,new this._cesium.CallbackProperty(function(){var e=g._cesium.Cartesian3.fromDegrees(g._position[0],g._position[1],g._position[2]),t=g._cesium.Math.toRadians(g.heading),i=new g._cesium.HeadingPitchRoll(t,g._cesium.Math.toRadians(g.pitch),g._cesium.Math.toRadians(90+g.roll));return g._cesium.Transforms.headingPitchRollQuaternion(e,i)},!1),new this._cesium.CallbackProperty(f,!1),new this._cesium.CallbackProperty(v,!1),this._cesium.Color.RED,!1);d.oid=3,this.modelPointArr.push(d);var m=this.creatBillboard(u,new this._cesium.CallbackProperty(function(){return new g._cesium.Cartesian2(0,-g.Radius*g.scale)},!1),"../../img/j.png",!1);m.oid=4,this.modelPointArr.push(m);var p=this.creatBillboard(u,new this._cesium.CallbackProperty(function(){return new g._cesium.Cartesian2(-g.Radius*g.scale,0)},!1),"../../img/s.png",!1);p.oid=5,this.modelPointArr.push(p),(s.heading||s.pitch||s.roll)&&(this.heading=s.heading,this.pitch=s.pitch,this.roll=s.roll,l.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._cesium.defaultValue(s.heading,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(s.pitch,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(s.roll,0)))));var g=this;function f(){return g.Radius*g.scale}function v(){return 100*g.Radius}s.rotate&&(l.orientation=new this._cesium.CallbackProperty(function(){return g.heading=g.heading+g.rotate,g._cesium.Transforms.headingPitchRollQuaternion(g._cesium.Cartesian3.fromDegrees(g._position[0],g._position[1],g._position[2]),new g._cesium.HeadingPitchRoll(g._cesium.Math.toRadians(g._cesium.defaultValue(g.heading,0)),g._cesium.Math.toRadians(g._cesium.defaultValue(g.pitch,0)),g._cesium.Math.toRadians(g._cesium.defaultValue(g.roll,0))))},!1),g.rotate=s.rotate,delete s.rotate),l.orientation=new this._cesium.CallbackProperty(function(){return g._cesium.Transforms.headingPitchRollQuaternion(g._cesium.Cartesian3.fromDegrees(g._position[0],g._position[1],g._position[2]),new g._cesium.HeadingPitchRoll(g._cesium.Math.toRadians(g._cesium.defaultValue(g.heading,0)),g._cesium.Math.toRadians(g._cesium.defaultValue(g.pitch,0)),g._cesium.Math.toRadians(g._cesium.defaultValue(g.roll,0))))},!1),g.scale=s.scale,l.model.scale=new this._cesium.CallbackProperty(function(){return g.scale},!1),delete s.heading,delete s.pitch,delete s.roll,l.model=s,this.item=this._viewer.entities.add(l),this.item.objId=this.objId,this._core.Entityadd(this),this.state=1,"function"==typeof n&&n(this.item);var _={id:this.item.id,name:o||"新建模型"+a.id,pId:this._core.isnull(r)?0:r,type:"Point",item:this.item};return this.setTreeobj(_),this._tree.insertGroupId(_,this._core.isnull(r)?0:r),this},t.prototype.createOrientation=function(e,t,i){var r=this._cesium.Math.toRadians(0),o=new this._cesium.HeadingPitchRoll(r,this._cesium.Math.toRadians(t),this._cesium.Math.toRadians(i));return this._cesium.Transforms.headingPitchRollQuaternion(e,o)},t.prototype.createCylinder=function(e,t,i,r,o,n){if(e)return this._viewer.entities.add({position:e,orientation:t,cylinder:{length:10,topRadius:i,bottomRadius:i,fill:!1,material:o.withAlpha(.5),outline:!0,outlineWidth:10,outlineColor:o,numberOfVerticalLines:r,slices:r},show:n})},t.prototype.startModify=function(){if(2==this.state||1==this.state){var n,a,s,l,u,c,h=this;this.modifyHandler||(this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas));for(var e=0;e<h.modelPointArr.length;e++){var t=h.modelPointArr[e];t&&(t.show=!0)}this.modifyHandler.setInputAction(function(e){var t=h._viewer.scene.pick(e.position);h._cesium.defined(t)&&t.id&&(t.id.objId?h.modifyModel=t.id:!h.modifyPoint||4!=h.modifyPoint.oid&&5!=h.modifyPoint.oid?h.modifyPoint=t.id:(t.id.oid!=h.modifyPoint.oid&&(h.modifyPoint=t.id),4==h.modifyPoint.oid?h.scale=h.scale+1:h.scale=h.scale-1),h.forbidDrawWorld(!0));var i=h._cesium.Cartesian3.fromDegrees(h._position[0],h._position[1],h._position[2]);n=h._cesium.SceneTransforms.wgs84ToWindowCoordinates(h._viewer.scene,i),a=e.position,l=h.heading+0,c=h.roll+0,u=h.pitch+0,h.state=2},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){var t=h._viewer.scene.pick(e.position);if(h._cesium.defined(t)&&t.id);else{for(var i=0;i<h.modelPointArr.length;i++){var r=h.modelPointArr[i];r&&(r.show=!1)}h.modifyHandler&&(h.modifyHandler.destroy(),h.modifyHandler=null)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){h._viewer.scene.pick(e.endPosition);if(h.modifyModel||h.modifyPoint){var t=h._viewer.scene.pickPosition(e.endPosition);if(t)if(h.modifyModel){h.item.position.setValue(t);for(var i=0;i<h.modelPointArr.length;i++){var r=h.modelPointArr[i];r&&r.position.setValue(t)}}else if(h.modifyPoint){s=e.endPosition;var o=h.arge(n,a,s);1==h.modifyPoint.oid?h.heading=l+o:2==h.modifyPoint.oid?h.roll=c+o:3==h.modifyPoint.oid&&(h.pitch=u+o)}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){(h.modifyPoint||h.modifyModel)&&(!h.modifyPoint||4!=h.modifyPoint.oid&&5!=h.modifyPoint.oid)&&(h.modifyPoint=null,h.modifyModel=null,h.forbidDrawWorld(!1))},this._cesium.ScreenSpaceEventType.LEFT_UP)}},t.prototype.creatBillboard=function(e,t,i,r){var o=this._viewer.entities.add({position:e,show:r,billboard:{image:i,pixelOffset:t,verticalOrigin:this._cesium.VerticalOrigin.BOTTOM}});return o.attr="editPoint",o},t.prototype.arge=function(e,t,i){var r=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),o=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),n=Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2)),a=(Math.pow(r,2)+Math.pow(o,2)-Math.pow(n,2))/(2*r*o);return Math.round(180*Math.acos(a)/Math.PI)},t.prototype.forbidDrawWorld=function(e){this._viewer.scene.screenSpaceCameraController.enableRotate=!e,this._viewer.scene.screenSpaceCameraController.enableTilt=!e,this._viewer.scene.screenSpaceCameraController.enableTranslate=!e,this._viewer.scene.screenSpaceCameraController.enableInputs=!e},t.prototype.getCatesian3FromPX=function(e,t,i){var r,o=t.scene.pick(e),n=t.scene.drillPick(e),a=null;if(i){for(var s=0;s<n.length;s++)if(n[s].id._id!=i[0].id&&n[s].id._id!=i[1].id){a=n[s].id;break}}else a=o;if(t.scene.pickPositionSupported&&Cesium.defined(a))r=t.scene.pickPosition(e);else{var l=t.camera.getPickRay(e);if(!l)return;r=t.scene.globe.pick(l,t.scene)}return r},t.prototype.setTreeobj=function(e){this.treeobj=e},t.prototype.setVisibility=function(e){if(this.item.item?this.item.item.show=e:this.item.show=e,0<this.model.length)for(var t=0;t<this.model.length;t++)this.model[t].show=e,this.model[t]._availability&&!e?this.model[t]._availability=void 0:this.model[t].time&&e&&(this.model[t]._availability=this.model[t].time)},t.prototype.setOrientation=function(e){(e.heading||e.pitch||e.roll)&&(this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._cesium.defaultValue(e.heading,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(e.pitch,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(e.roll,0)))))},t.prototype.setScale=function(e){this.item&&this.item.model&&(this.item.model.scale=e)},t.prototype.setPosition=function(e){this.item&&this.item.model&&(this._position=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]))},t.prototype.getVisibility=function(){return this.item.show},t.prototype.deleteObject=function(){if(this.model&&this.model.length)for(var e=0;e<this.model.length;e++)this._viewer.scene.primitives.remove(this.model[e]);try{this._viewer.scene.primitives.remove(this.item)}catch(e){}try{this._viewer.entities.remove(this.item)}catch(e){}try{this._viewer.dataSources.remove(this.item)}catch(e){}try{this._Provider.remove()}catch(e){}},t}),define("SGWorld/Creator/SkyBox",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this.SkyBoxFS="uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\ngl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n}\n",this.SkyBoxVS="attribute vec3 position;\nuniform mat3 u_rotateMatrix;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n"}return e.prototype.setSpaceBackground=function(e){var t=this;return this.clear&&this.clear(),this._viewer.container.style.backgroundImage="url("+e+")",this._viewer.scene.backgroundColor=new this._cesium.Color(0,0,0,0),this._viewer.scene.skyAtmosphere.show=!1,this._viewer.scene.skyBox&&(this._viewer.scene.skyBox.show=!1),this.clear=function(){t._viewer.container.style.backgroundImage="unset",t._viewer.scene.skyBox&&(t._viewer.scene.skyBox.show=!0),t._viewer.scene.backgroundColor=new t._cesium.Color(0,0,0,1),t._viewer.scene.skyAtmosphere.show=!0},this},e.prototype.SkyBox=function(e,t){this.defaultSky||(this.defaultSky=this._viewer.scene.skyBox,this.defaultSky&&!this.defaultSky.show&&(this.defaultSky.show=!0)),this.NearGround=e;var i=this,r=this._viewer,o=this.getSkyBox(t);function n(){var e=r.camera.position;i._cesium.Cartographic.fromCartesian(e).height<23e4?(o&&(r.scene.skyBox=o),r.scene.skyAtmosphere.show=!1):(i.defaultSky&&(r.scene.skyBox=i.defaultSky),r.scene.skyAtmosphere.show=!0)}return this._SkyBox=o,r.scene.skyBox=o,e&&this._viewer.scene.postRender.addEventListener(n),this.clear=function(){i.defaultSky&&(i._viewer.scene.skyBox=i.defaultSky),i.defaultSky=void 0,i._viewer.scene.skyAtmosphere.show=!0,i.NearGround&&i._viewer.scene.postRender.removeEventListener(n),i.clear=void 0},this},e.prototype.getSkyBox=function(e){var u=this,t=new this._cesium.SkyBox({sources:e});return this.NearGround&&(t.update=function(e,t){var i=this;if(this.show&&(e.mode===u._cesium.SceneMode.SCENE3D||e.mode===u._cesium.SceneMode.MORPHING)&&e.passes.render){var r=e.context;if(this._sources!==this.sources){this._sources=this.sources;var o=this.sources;"string"==typeof o.positiveX?u._cesium.loadCubeMap(r,this._sources).then(function(e){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new u._cesium.CubeMap({context:r,source:o}))}var n=this._command;if(!u._cesium.defined(n.vertexArray)){n.uniformMap={u_cubeMap:function(){return i._cubeMap},u_rotateMatrix:function(){return u.NearGround?(n.modelMatrix=u._cesium.Transforms.eastNorthUpToFixedFrame(e.camera._positionWC),u._cesium.Matrix4.getMatrix3(n.modelMatrix,new u._cesium.Matrix3)):u._cesium.Matrix3.IDENTITY}};var a=u._cesium.BoxGeometry.createGeometry(u._cesium.BoxGeometry.fromDimensions({dimensions:new u._cesium.Cartesian3(2,2,2),vertexFormat:u._cesium.VertexFormat.POSITION_ONLY})),s=this._attributeLocations=u._cesium.GeometryPipeline.createAttributeLocations(a);n.vertexArray=u._cesium.VertexArray.fromGeometry({context:r,geometry:a,attributeLocations:s,bufferUsage:u._cesium.BufferUsage.STATIC_DRAW}),n.renderState=u._cesium.RenderState.fromCache({blending:u._cesium.BlendingState.ALPHA_BLEND})}if(!u._cesium.defined(n.shaderProgram)||this._useHdr!==t){var l=new u._cesium.ShaderSource({defines:[t?"HDR":""],sources:[u.SkyBoxFS]});n.shaderProgram=u._cesium.ShaderProgram.fromCache({context:r,vertexShaderSource:u.SkyBoxVS,fragmentShaderSource:l,attributeLocations:this._attributeLocations}),this._useHdr=t}if(u._cesium.defined(this._cubeMap))return n}}),t},e}),define("SGWorld/Creator/FlowField",["../Core/Core","../Core/jquery"],function(i,r){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i}e.prototype.createWindField=function(e,t){var i=this;return this.WindFieldOption={color:this._cesium.Color.WHITE,speed:.15,num:2e3,maxAge:10,brighten:1.5},t||(t={}),t.color&&(t.color=this._cesium.Color.fromCssColorString(t.color)),this.WindFieldOption=this._core.extend(this.WindFieldOption,t,!1),this.destroy(),this.windData=void 0,this.windField=void 0,this.particles=[],this.lines=void 0,this.timer=void 0,this.primitives=this._viewer.scene.primitives,r.ajax({type:"get",async:!1,url:e,dataType:"json",success:function(e){i.windData=e,i._init(),i.timer=setInterval(function(){i.animate()},200)},error:function(e){console.log("请求风场数据失败!")}}),this},e.prototype._init=function(){this.windField=this.createField();for(var e=0;e<this.WindFieldOption.num;e++)this.particles.push(this.randomParticle(new t))},e.prototype.createField=function(){var e=this._parseWindJson();return new o(e)},e.prototype.animate=function(){var r=this,o=r.windField,e=r.particles,n=[],a=null,s=null,l=null;e.forEach(function(e){if(e.age<=0&&r.randomParticle(e),0<e.age){var t=e.x,i=e.y;o.isInBound(t,i)?(l=o.getIn(t,i),a=t+r.WindFieldOption.speed*l[0],s=i+r.WindFieldOption.speed*l[1],e.path.push(a,s),e.x=a,e.y=s,n.push(r._createLineInstance(r._map(e.path),e.age/e.birthAge)),e.age--):e.age=0}}),n.length<=0&&this.removeLines(),r._drawLines(n)},e.prototype._parseWindJson=function(){var t=null,i=null,r=null;return this.windData.forEach(function(e){switch(e.header.parameterCategory+","+e.header.parameterNumber){case"2,2":t=e.data,r=e.header;break;case"2,3":i=e.data}}),{header:r,uComponent:t,vComponent:i}},e.prototype.removeLines=function(){this.lines&&(this.primitives.remove(this.lines),this.lines.destroy())},e.prototype._map=function(e){for(var t=e.length,i=this.windField,r=i.dx,o=i.dy,n=i.west,a=i.north,s=[],l=0;l<=t-2;l+=2)s.push(n+e[l]*r,a-e[l+1]*o);return s},e.prototype._createLineInstance=function(e,t){for(var i=[],r=e.length,o=r/2,n=0;n<r;n++)i.push("random"===this.WindFieldOption.color?this._cesium.Color.fromRandom({alpha:n/o*t*this.WindFieldOption.brighten}):this.WindFieldOption.color.withAlpha(n/o*t*this.WindFieldOption.brighten));return new this._cesium.GeometryInstance({geometry:new this._cesium.PolylineGeometry({positions:this._cesium.Cartesian3.fromDegreesArray(e),colors:i,width:1.5,colorsPerVertex:!0})})},e.prototype._drawLines=function(e){this.removeLines();var t=new this._cesium.Primitive({appearance:new this._cesium.PolylineColorAppearance({translucent:!0}),geometryInstances:e,asynchronous:!1});this.lines=this.primitives.add(t)},e.prototype.randomParticle=function(e){for(var t,i,r=30;t=Math.floor(Math.random()*(this.windField.cols-2)),i=Math.floor(Math.random()*(this.windField.rows-2)),this.windField.getIn(t,i)[2]<=0&&r++<30;);return e.x=t,e.y=i,e.age=Math.round(Math.random()*this.WindFieldOption.maxAge),e.birthAge=e.age,e.path=[t,i],e},e.prototype.changeColor=function(e){this.WindFieldOption.color="random"===e?e:this._cesium.Color.fromCssColorString(e)},e.prototype.setSpeed=function(e){this.WindFieldOption.speed=e},e.prototype.setMaxAge=function(e){this.WindFieldOption.maxAge=e},e.prototype.setBrighten=function(e){this.WindFieldOption.brighten=e},e.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.timer=void 0,this.removeLines()};var t=function(){this.x=null,this.dx=null,this.dx=null,this.y=null,this.age=null,this.birthAge=null,this.path=null},o=function(e){this.west=null,this.east=null,this.south=null,this.north=null,this.rows=null,this.cols=null,this.dx=null,this.dy=null,this.unit=null,this.date=null,this.grid=null,this._init(e)};return o.prototype={constructor:o,_init:function(e){var t=e.header,i=e.uComponent,r=e.vComponent;this.west=+t.lo1,this.east=+t.lo2,this.south=+t.la2,this.north=+t.la1,this.rows=+t.ny,this.cols=+t.nx,this.dx=+t.dx,this.dy=+t.dy,this.unit=t.parameterUnit,this.date=t.refTime,this.grid=[];for(var o=0,n=null,a=null,s=0;s<this.rows;s++){n=[];for(var l=0;l<this.cols;l++,o++)a=this._calcUV(i[o],r[o]),n.push(a);this.grid.push(n)}},_calcUV:function(e,t){return[+e,+t,Math.sqrt(e*e+t*t)]},_bilinearInterpolation:function(e,t,i,r,o,n){var a=1-e,s=1-t,l=a*s,u=e*s,c=a*t,h=e*t,d=i[0]*l+r[0]*u+o[0]*c+n[0]*h,m=i[1]*l+r[1]*u+o[1]*c+n[1]*h;return this._calcUV(d,m)},getIn:function(e,t){var i,r,o=Math.floor(e),n=Math.floor(t);if(o===e&&n===t)return this.grid[t][e];i=o+1,r=n+1;var a=this.getIn(o,n),s=this.getIn(i,n),l=this.getIn(o,r),u=this.getIn(i,r);return this._bilinearInterpolation(e-o,t-n,a,s,l,u)},isInBound:function(e,t){return 0<=e&&e<this.cols-2&&0<=t&&t<this.rows-2}},e}),define("SGWorld/Creator/TrailLine",["../configData","./Color","../Core/Core","../Navigate/getPosition","../ProjectTree/treeSource"],function(h,i,r,o,n,e){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._Color=new i(this._viewer,this._cesium),this._core=new r,this._getPosition=new o(this._viewer,this._cesium),this._init(this._cesium),this._tree=n,this._points=[],this._polylines=[]}return t.prototype.createPath=function(e,t,i){!i&&(i={}),"number"==typeof i&&(i={time:i});var r,o={time:3e3,LineColor:this._core.defaultValue(i.color&&this._cesium.Color.fromCssColorString(i.color),this._cesium.Color.RED),LinkImage:this._core.defaultValue(i.url,window.SmartEarthRootUrl+h.TrailLine),height:5e4,num:100,width:2,LightSpot:!1};(o=this._core.extend(o,i,!0)).twoColor&&(r={color1:this._cesium.Color.fromCssColorString(o.twoColor.color1),color2:this._cesium.Color.fromCssColorString(o.twoColor.color2)}),o.LightSpot&&(r={LightSpot:!0,color:o.LightSpotColor?this._cesium.Color.fromCssColorString(o.LightSpotColor):o.LineColor});for(var n=new this._cesium.PolylineTrailLinkMaterialProperty(o.LineColor,this._core.defaultValue(r,o.LinkImage),o.time),a=0;a<t.length;a++){for(var s=this.parabolaEquation({pt1:e,pt2:t[a],height:o.height,num:o.num}),l=[],u=0;u<s.length;u++)l.push(s[u][0],s[u][1],s[u][2]);this._polylines.push(this._viewer.entities.add({name:"PolylineTrailLink"+a,polyline:{positions:this._cesium.Cartesian3.fromDegreesArrayHeights(l),width:o.width,material:n}}))}this._points.push(this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height),point:{pixelSize:6,color:this._cesium.Color.BLUE}}));for(u=0;u<t.length;u++)this._points.push(this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(t[u].lon,t[u].lat,t[u].height),point:{pixelSize:6,color:this._cesium.Color.RED}}));this.pathMaterial=n,o.static&&this.pathMaterial.setScale(0);var c={id:this._core.getuid(),name:"新建流动路径",pId:0,type:"TrailLine",item:this};return this.setTreeobj(c),this._tree.insertGroupId(c,0),this},t.prototype.createLine=function(e,t){!t&&(t={}),"number"==typeof t&&(t={time:t});var i={time:3e3,LineColor:this._core.defaultValue(t.color&&this._cesium.Color.fromCssColorString(t.color),this._cesium.Color.RED),LinkImage:this._core.defaultValue(t.url,window.SmartEarthRootUrl+h.TrailLine),width:10};i=this._core.extend(i,t,!0);var r=new this._cesium.PolylineTrailLinkMaterialProperty(i.LineColor,i.LinkImage,i.time),o=[];if(e[0].x||e[0].y)if(void 0!==e[0].z)if(-180<=e[0].x&&e[0].x<=180)for(n=0;n<e.length;n++)o.push(this._cesium.Cartesian3.fromDegrees(e[n].x,e[n].y,e[n].z));else o=e;else for(n=0;n<e.length;n++)o.push(this._cesium.Cartesian3.fromDegrees(e[n].x,e[n].y));else if(2===e[0].length)for(var n=0;n<e.length;n++)o.push(this._cesium.Cartesian3.fromDegrees(e[n][0],e[n][1]));else if(3===e[0].length)for(var n=0;n<e.length;n++)o.push(this._cesium.Cartesian3.fromDegrees(e[n][0],e[n][1],e[n][2]));this._polylines.push(this._viewer.entities.add({name:"PolylineTrail",polyline:{positions:o,width:i.width,material:r,clampToGround:i.clampToGround}}));var a={id:this._core.getuid(),name:"新建流动线",pId:0,type:"TrailLine",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,0),this},t.prototype.createWall=function(e,t){!t&&(t={}),"number"==typeof t&&(t={time:t});var i={time:9e3,LineColor:this._core.defaultValue(t.color&&this._cesium.Color.fromCssColorString(t.color),this._cesium.Color.ORANGE),LinkImage:this._core.defaultValue(t.url,window.SmartEarthRootUrl+h.colors3)};i=this._core.extend(i,t,!0);var r=new this._cesium.PolylineTrailLinkMaterialProperty(i.LineColor,i.LinkImage,i.time||9e3),o=[];if(e[0].x||e[0].y)if(void 0!==e[0].z)if(-180<=e[0].x&&e[0].x<=180)for(n=0;n<e.length;n++)o.push(this._cesium.Cartesian3.fromDegrees(e[n].x,e[n].y,e[n].z));else o=e;else for(n=0;n<e.length;n++)o.push(this._cesium.Cartesian3.fromDegrees(e[n].x,e[n].y));else if(2===e[0].length)for(var n=0;n<e.length;n++)o.push(this._cesium.Cartesian3.fromDegrees(e[n][0],e[n][1]));else if(3===e[0].length)for(var n=0;n<e.length;n++)o.push(this._cesium.Cartesian3.fromDegrees(e[n][0],e[n][1],e[n][2]));this._polylines.push(this._viewer.entities.add({name:"WallTrail",wall:{positions:o,material:r,maximumHeights:i.maximumHeights,minimumHeights:i.minimumHeights}}));var a={id:this._core.getuid(),name:"新建流动墙",pId:0,type:"TrailLine",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,0),this},t.prototype.parabolaEquation=function(e,t){var i=this._core.defaultValue(e.height,5e3),r=Math.abs(e.pt1.lon-e.pt2.lon)>Math.abs(e.pt1.lat-e.pt2.lat)?Math.abs(e.pt1.lon-e.pt2.lon):Math.abs(e.pt1.lat-e.pt2.lat),o=e.num&&50<e.num?e.num:50,n=[],a=r/o,s=e.pt1.height||0,l=e.pt2.height||0;if(Math.abs(e.pt1.lon-e.pt2.lon)>Math.abs(e.pt1.lat-e.pt2.lat)){var u=(e.pt2.lat-e.pt1.lat)/o;0<e.pt1.lon-e.pt2.lon&&(a=-a);for(var c=0;c<=o;c++){var h=i-4*Math.pow(-.5*r+Math.abs(a)*c,2)*i/Math.pow(r,2)+s+(l-s)*c/o,d=e.pt1.lon+a*c,m=e.pt1.lat+u*c;n.push([d,m,h])}}else{var p=(e.pt2.lon-e.pt1.lon)/o;0<e.pt1.lat-e.pt2.lat&&(a=-a);for(c=0;c<o;c++){h=i-4*Math.pow(-.5*r+Math.abs(a)*c,2)*i/Math.pow(r,2)+s+(l-s)*c/o,d=e.pt1.lon+p*c,m=e.pt1.lat+a*c;n.push([d,m,h])}}return null!=t&&(t=n),n},t.prototype.setThisPosition=function(e,t){if(this.pathMaterial){var i=this._cesium.Cartesian3.fromDegrees(e[0].lon,e[0].lat),r=this._cesium.Cartesian3.fromDegrees(e[1].lon,e[1].lat),o=this._cesium.Cartesian3.fromDegrees(t.lon,t.lat),n=this._core.getSpaceDistancem([i,r],this._cesium),a=this._core.getSpaceDistancem([i,o],this._cesium);this.pathMaterial.setScale(a/n)}},t.prototype.clear=function(){if(0<this._points.length)for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e]);if(0<this._polylines.length)for(e=0;e<this._polylines.length;e++)this._viewer.entities.remove(this._polylines[e]);this._points=[],this._polylines=[]},t.prototype.setTreeobj=function(e){this.treeobj=e},t.prototype.deleteObject=function(){this.clear()},t.prototype.setVisibility=function(e){if(0<this._points.length)for(var t=0;t<this._points.length;t++)this._points[t].show=e;if(0<this._polylines.length)for(t=0;t<this._polylines.length;t++)this._polylines[t].show=e},t.prototype._init=function(r){if(!r.PolylineTrailLinkMaterialProperty){var t=function(e,t,i){this._definitionChanged=new r.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this._Line=t,this.duration=i,this._time=(new Date).getTime()};Object.defineProperties(t.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:r.createPropertyDescriptor("color")}),t.prototype.getType=function(e){return"PolylineTrailLink"},t.prototype.setScale=function(e){this.scale=e},t.prototype.getValue=function(e,t){return r.defined(t)||(t={}),t.color=r.Property.getValueOrClonedDefault(this._color,e,r.Color.WHITE,t.color),"object"===_typeof2(this._Line)?this._Line.LightSpot?(t.lightSpot=!0,t.lightSpotColor=this._Line.color):(t.color1=this._Line.color1,t.color2=this._Line.color2,t.twoColor=!0):t.image=this._Line,void 0!==this.scale?t.time=this.scale:t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t},t.prototype.equals=function(e){return this===e||e instanceof t&&r.Property.equals(this._color,e._color)},r.PolylineTrailLinkMaterialProperty=t,r.Material.PolylineTrailLinkType="PolylineTrailLink",r.Material.PolylineTrailLinkImage=window.SmartEarthRootUrl+h.colors1,r.Material.PolylineTrailLinkSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n if(twoColor){\n if(st.s<time){\n material.alpha = color1.a;\n material.diffuse = color1.rgb;\n }else{\n material.alpha = color2.a;\n material.diffuse = color2.rgb;\n }\n }else if(lightSpot){\n if(st.s<time){\n material.alpha = pow(st.s / time, 20.0);\n if(material.alpha<0.3){\n material.alpha = 0.3;\n material.diffuse = color.rgb;\n }else{\n material.diffuse = lightSpotColor.rgb;\n }\n }else{\n material.alpha = 0.3;\n material.diffuse = color.rgb;\n }\n }else{\n vec4 colorImage = texture2D(image, vec2(fract(st.s - time), st.t));\n material.alpha = colorImage.a * color.a;\n material.diffuse = (colorImage.rgb+color.rgb)/2.0;\n }\n return material;\n }",r.Material._materialCache.addMaterial(r.Material.PolylineTrailLinkType,{fabric:{type:r.Material.PolylineTrailLinkType,uniforms:{color:new r.Color(1,0,0,.5),color1:new r.Color(0,1,0,.5),color2:new r.Color(1,0,0,.5),image:r.Material.PolylineTrailLinkImage,twoColor:!1,lightSpot:!1,lightSpotColor:new r.Color(1,1,1,.5),time:0},source:r.Material.PolylineTrailLinkSource},translucent:function(e){return!0}})}},t}),define("SGWorld/Creator/billboardGeoJsonFeatureLayer",["../Core/Core","./Color","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min","../VectorTileProvider/GeoJSONVectorTileProvider"],function(i,r,o,e,c){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._color=new r(this._viewer,this._cesium),this._tree=o,this._Provider=void 0,this._cache=!1,this._forceRefreshPrvimitive=null}return t.prototype.createBillboardPointGeoJsonFeatureLayer=function(e,t,c,i,h){null==t&&console.log("geojson is required");var r=this._cesium.GeoJsonDataSource.load(t),d=this;r.then(function(e){var t={show:!0,position:d._cesium.Cartesian3.ZERO,pixelOffset:d._cesium.Cartesian2.ZERO,eyeOffset:d._cesium.Cartesian3.ZERO,heightReference:d._cesium.HeightReference.NONE,horizontalOrigin:d._cesium.HorizontalOrigin.CENTER,verticalOrigin:d._cesium.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:d._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:d._cesium.Cartesian3.ZERO,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0};d._core.isnull(c)||d._core.isnull(c.color)||/^\[/.test(c.color)&&"["==c.color.charAt(0)&&"]"==c.color.charAt(c.color.length-1)||(d._core.isHtmlColor(c.color)?c.color=d._color.colorFromHtmlColor(c.color):(/^rgb/.test(c.color)&&(c.color=d._color.rgbaStringToRgbaObj(c.color)),1<c.color.r&&(c.color.r=c.color.r/255),1<c.color.g&&(c.color.g=c.color.g/255),1<c.color.b&&(c.color.b=c.color.b/255),1<c.color.a&&(c.color.a=c.color.a/255),c.color=d._color.createColor(c.color.r,c.color.g,c.color.b,c.color.a)));var i=d._core.extend(t,c,!0);d._core.isnull(c.near)&&(c.near=0),d._core.isnull(c.far)&&(c.far=999999999);for(var r=parseFloat(c.near),o=parseFloat(c.far),n=(new d._cesium.DistanceDisplayCondition(r,o),new d._cesium.BillboardCollection),a=e.entities.values,s=0;s<a.length;s++){var l=a[s];i.position=l.position._value,n.add(i)}var u=d._viewer.scene.primitives.add(n);"function"==typeof h&&h(u)});var o=this._core.getuid();this._core.isnull(e)&&(e="新建图层"+o);var n={id:o,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"billboardLayer",item:this,url:t,style:options};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},t.prototype.createBillboardGeoJsonFeatureLayerProvider=function(e,t,a,i,r,o){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},s=new c(this._viewer,this._cesium,n);this._Provider=s;var l=this;s._loadTile=function(e){var t={show:!0,position:l._cesium.Cartesian3.ZERO,pixelOffset:l._cesium.Cartesian2.ZERO,eyeOffset:l._cesium.Cartesian3.ZERO,heightReference:l._cesium.HeightReference.NONE,horizontalOrigin:l._cesium.HorizontalOrigin.CENTER,verticalOrigin:l._cesium.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:l._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:l._cesium.Cartesian3.ZERO,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0};l._core.isnull(a)||l._core.isnull(a.color)||/^\[/.test(a.color)&&"["==a.color.charAt(0)&&"]"==a.color.charAt(a.color.length-1)||(l._core.isHtmlColor(a.color)?a.color=l._color.colorFromHtmlColor(a.color):(/^rgb/.test(a.color)&&(a.color=l._color.rgbaStringToRgbaObj(a.color)),1<a.color.r&&(a.color.r=a.color.r/255),1<a.color.g&&(a.color.g=a.color.g/255),1<a.color.b&&(a.color.b=a.color.b/255),1<a.color.a&&(a.color.a=a.color.a/255),a.color=l._color.createColor(a.color.r,a.color.g,a.color.b,a.color.a)));var r=l._core.extend(t,a,!0);l._core.isnull(a.near)&&(a.near=0),l._core.isnull(a.far)&&(a.far=999999999);var i=parseFloat(a.near),o=parseFloat(a.far),n=(new l._cesium.DistanceDisplayCondition(i,o),new l._cesium.BillboardCollection);return e.features.forEach(function(e){var t;if(r.id=e,/^\[/.test(r.pointHeight)&&/\]$/.test(r.pointHeight)){var i=r.pointHeight.replace(/\[/,"").replace(/\]/,"");t=parseFloat(e.properties[i]),e.geometry.coordinates.push(t),r.position=l._cesium.Cartesian3.fromDegreesArrayHeights(e.geometry.coordinates)[0]}else r.pointHeight?(t=parseFloat(r.pointHeight),e.geometry.coordinates.push(t),r.position=l._cesium.Cartesian3.fromDegreesArrayHeights(e.geometry.coordinates)[0]):r.position=l._cesium.Cartesian3.fromDegreesArray(e.geometry.coordinates)[0];r.id.treeID=a.id,r.id.VectorType="billboard",r.id.VectorStyle={position:r.position,pointHeight:t,rotation:r.rotation,width:r.width,height:r.height,image:r.image,color:r.color,scale:r.scale,heightReference:r.heightReference,horizontalOrigin:r.horizontalOrigin,verticalOrigin:r.verticalOrigin,scaleByDistance:r.scaleByDistance,distanceDisplayCondition:r.distanceDisplayCondition},n.add(r)}),n},a&&a.time&&(s.availability=new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:a.time.start?l._cesium.JulianDate.fromDate(new Date(a.time.start)):l._cesium.Iso8601.MINIMUM_VALUE,stop:a.time.end?l._cesium.JulianDate.fromDate(new Date(a.time.end)):l._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=s._primitiveCollection,s.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(a.id)&&(a.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+a.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var u={id:a.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"imageLayer",item:this,url:n.url,style:a};return this._Provider.treeID=a.id,this.setTreeobj(u),this._tree.insertGroupId(u,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},t.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},t.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(e)}catch(e){}},t.prototype.setVisibility=function(e){this.item.show=e,this._Provider&&this._Provider.setStatus(!e),!e&&this.item.removeAll()},t.prototype.deleteObject=function(){if(null!=this._Provider&&this._Provider.setStatus(!1),null!=this.items&&null!=this.items&&0<this.items.length)for(var e=0;e<this.items.length;e++)this._viewer.scene.primitives.remove(this.items[e]);else this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch(e){}},t.prototype.setTreeobj=function(e){this.treeobj=e},t.prototype.edit=function(e,t){return this.isEditting=e,this.editoption=t,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},t.prototype.forceRefresh=function(){try{for(var e=0;e<this._Provider.quadtree._levelZeroTiles.length;e++)this._Provider.quadtree._levelZeroTiles[e].freeResources()}catch(e){}},t}),define("SGWorld/Core/pbf-dev",[],function(){"use strict";var t={};function r(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}t.read=function(e,t,i,r,o){var n,a,s=8*o-r-1,l=(1<<s)-1,u=l>>1,c=-7,h=i?o-1:0,d=i?-1:1,m=e[t+h];for(h+=d,n=m&(1<<-c)-1,m>>=-c,c+=s;0<c;n=256*n+e[t+h],h+=d,c-=8);for(a=n&(1<<-c)-1,n>>=-c,c+=r;0<c;a=256*a+e[t+h],h+=d,c-=8);if(0===n)n=1-u;else{if(n===l)return a?NaN:1/0*(m?-1:1);a+=Math.pow(2,r),n-=u}return(m?-1:1)*a*Math.pow(2,n-r)},t.write=function(e,t,i,r,o,n){var a,s,l,u=8*n-o-1,c=(1<<u)-1,h=c>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:n-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+h?d/l:d*Math.pow(2,1-h))*l&&(a++,l/=2),c<=a+h?(s=0,a=c):1<=a+h?(s=(t*l-1)*Math.pow(2,o),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,o),a=0));8<=o;e[i+m]=255&s,m+=p,s/=256,o-=8);for(a=a<<o|s,u+=o;0<u;e[i+m]=255&a,m+=p,a/=256,u-=8);e[i+m-p]|=128*g},r.Varint=0,r.Fixed64=1,r.Bytes=2,r.Fixed32=5;var i=4294967296,o=1/i;function n(e){return e.type===r.Bytes?e.readVarint()+e.pos:e.pos+1}function a(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function s(e,t,i){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.ceil(Math.log(t)/(7*Math.LN2));i.realloc(r);for(var o=i.pos-1;e<=o;o--)i.buf[o+r]=i.buf[o]}function l(e,t){for(var i=0;i<e.length;i++)t.writeVarint(e[i])}function u(e,t){for(var i=0;i<e.length;i++)t.writeSVarint(e[i])}function c(e,t){for(var i=0;i<e.length;i++)t.writeFloat(e[i])}function h(e,t){for(var i=0;i<e.length;i++)t.writeDouble(e[i])}function d(e,t){for(var i=0;i<e.length;i++)t.writeBoolean(e[i])}function m(e,t){for(var i=0;i<e.length;i++)t.writeFixed32(e[i])}function p(e,t){for(var i=0;i<e.length;i++)t.writeSFixed32(e[i])}function g(e,t){for(var i=0;i<e.length;i++)t.writeFixed64(e[i])}function f(e,t){for(var i=0;i<e.length;i++)t.writeSFixed64(e[i])}function v(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function _(e,t,i){e[i]=t,e[i+1]=t>>>8,e[i+2]=t>>>16,e[i+3]=t>>>24}function y(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}return r.prototype={destroy:function(){this.buf=null},readFields:function(e,t,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),o=r>>3,n=this.pos;this.type=7&r,e(o,t,this),this.pos===n&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=v(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=y(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=v(this.buf,this.pos)+v(this.buf,this.pos+4)*i;return this.pos+=8,e},readSFixed64:function(){var e=v(this.buf,this.pos)+y(this.buf,this.pos+4)*i;return this.pos+=8,e},readFloat:function(){var e=t.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=t.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,i,r=this.buf;return t=127&(i=r[this.pos++]),i<128?t:(t|=(127&(i=r[this.pos++]))<<7,i<128?t:(t|=(127&(i=r[this.pos++]))<<14,i<128?t:(t|=(127&(i=r[this.pos++]))<<21,i<128?t:function(e,t,i){var r,o,n=i.buf;if(o=n[i.pos++],r=(112&o)>>4,o<128)return a(e,r,t);if(o=n[i.pos++],r|=(127&o)<<3,o<128)return a(e,r,t);if(o=n[i.pos++],r|=(127&o)<<10,o<128)return a(e,r,t);if(o=n[i.pos++],r|=(127&o)<<17,o<128)return a(e,r,t);if(o=n[i.pos++],r|=(127&o)<<24,o<128)return a(e,r,t);if(o=n[i.pos++],r|=(1&o)<<31,o<128)return a(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(i=r[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=function(e,t,i){var r="",o=t;for(;o<i;){var n,a,s,l=e[o],u=null,c=239<l?4:223<l?3:191<l?2:1;if(i<o+c)break;1===c?l<128&&(u=l):2===c?128==(192&(n=e[o+1]))&&(u=(31&l)<<6|63&n)<=127&&(u=null):3===c?(n=e[o+1],a=e[o+2],128==(192&n)&&128==(192&a)&&((u=(15&l)<<12|(63&n)<<6|63&a)<=2047||55296<=u&&u<=57343)&&(u=null)):4===c&&(n=e[o+1],a=e[o+2],s=e[o+3],128==(192&n)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&n)<<12|(63&a)<<6|63&s)<=65535||1114112<=u)&&(u=null)),null===u?(u=65533,c=1):65535<u&&(u-=65536,r+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),r+=String.fromCharCode(u),o+=c}return r}(this.buf,this.pos,e);return this.pos=e,t},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){var i=n(this);for(e=e||[];this.pos<i;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){var t=n(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){var t=n(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){var t=n(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){var t=n(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){var t=n(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){var t=n(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){var t=n(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){var t=n(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===r.Varint)for(;127<this.buf[this.pos++];);else if(t===r.Bytes)this.pos=this.readVarint()+this.pos;else if(t===r.Fixed32)this.pos+=4;else{if(t!==r.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var i=new Uint8Array(t);i.set(this.buf),this.buf=i,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),_(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),_(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),_(this.buf,-1&e,this.pos),_(this.buf,Math.floor(e*o),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),_(this.buf,-1&e,this.pos),_(this.buf,Math.floor(e*o),this.pos+4),this.pos+=8},writeVarint:function(e){268435455<(e=+e||0)||e<0?function(e,t){var i,r;0<=e?(i=e%4294967296|0,r=e/4294967296|0):(r=~(-e/4294967296),4294967295^(i=~(-e%4294967296))?i=i+1|0:r=r+1|(i=0));if(0x10000000000000000<=e||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),o=i,n=t,n.buf[n.pos++]=127&o|128,o>>>=7,n.buf[n.pos++]=127&o|128,o>>>=7,n.buf[n.pos++]=127&o|128,o>>>=7,n.buf[n.pos++]=127&o|128,o>>>=7,n.buf[n.pos]=127&o,function(e,t){var i=(7&e)<<4;if(t.buf[t.pos++]|=i|((e>>>=3)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;t.buf[t.pos++]=127&e}(r,t);var o,n}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(127<e?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(127<e?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(127<e?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,i){for(var r,o,n=0;n<t.length;n++){if(55295<(r=t.charCodeAt(n))&&r<57344){if(!o){56319<r||n+1===t.length?(e[i++]=239,e[i++]=191,e[i++]=189):o=r;continue}if(r<56320){e[i++]=239,e[i++]=191,e[i++]=189,o=r;continue}r=o-55296<<10|r-56320|65536,o=null}else o&&(e[i++]=239,e[i++]=191,e[i++]=189,o=null);r<128?e[i++]=r:(r<2048?e[i++]=r>>6|192:(r<65536?e[i++]=r>>12|224:(e[i++]=r>>18|240,e[i++]=r>>12&63|128),e[i++]=r>>6&63|128),e[i++]=63&r|128)}return i}(this.buf,e,this.pos);var i=this.pos-t;128<=i&&s(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeFloat:function(e){this.realloc(4),t.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),t.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var i=0;i<t;i++)this.buf[this.pos++]=e[i]},writeRawMessage:function(e,t){this.pos++;var i=this.pos;e(t,this);var r=this.pos-i;128<=r&&s(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,i){this.writeTag(e,r.Bytes),this.writeRawMessage(t,i)},writePackedVarint:function(e,t){this.writeMessage(e,l,t)},writePackedSVarint:function(e,t){this.writeMessage(e,u,t)},writePackedBoolean:function(e,t){this.writeMessage(e,d,t)},writePackedFloat:function(e,t){this.writeMessage(e,c,t)},writePackedDouble:function(e,t){this.writeMessage(e,h,t)},writePackedFixed32:function(e,t){this.writeMessage(e,m,t)},writePackedSFixed32:function(e,t){this.writeMessage(e,p,t)},writePackedFixed64:function(e,t){this.writeMessage(e,g,t)},writePackedSFixed64:function(e,t){this.writeMessage(e,f,t)},writeBytesField:function(e,t){this.writeTag(e,r.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,r.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,r.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,r.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,r.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,r.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,r.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,r.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,r.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,r.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}},r}),define("SGWorld/Core/vectortile",[],function(){"use strict";function u(e,t){this.x=e,this.y=t}function p(e,t,i,r,o){this.properties={},this.extent=i,this.type=0,this._pbf=e,this._geometry=-1,this._keys=r,this._values=o,e.readFields(n,this,t)}function n(e,t,i){1==e?t.id=i.readVarint():2==e?function(e,t){var i=e.readVarint()+e.pos;for(;e.pos<i;){var r=t._keys[e.readVarint()],o=t._values[e.readVarint()];t.properties[r]=o}}(i,t):3==e?t.type=i.readVarint():4==e&&(t._geometry=i.pos)}function g(e){for(var t,i,r=0,o=0,n=e.length,a=n-1;o<n;a=o++)t=e[o],r+=((i=e[a]).x-t.x)*(t.y+i.y);return r}function o(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(i,this,t),this.length=this._features.length}function i(e,t,i){15===e?t.version=i.readVarint():1===e?t.name=i.readString():5===e?t.extent=i.readVarint():2===e?t._features.push(i.pos):3===e?t._keys.push(i.readString()):4===e&&t._values.push(function(e){var t=null,i=e.readVarint()+e.pos;for(;e.pos<i;){var r=e.readVarint()>>3;t=1===r?e.readString():2===r?e.readFloat():3===r?e.readDouble():4===r?e.readVarint64():5===r?e.readVarint():6===r?e.readSVarint():7===r?e.readBoolean():null}return t}(i))}function r(e,t,i){if(3===e){var r=new o(i,i.readVarint()+i.pos);r.length&&(t[r.name]=r)}}return u.prototype={clone:function(){return new u(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,i=e.y-this.y;return t*t+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,i=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=i,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),i=Math.sin(e),r=t*this.x-i*this.y,o=i*this.x+t*this.y;return this.x=r,this.y=o,this},_rotateAround:function(e,t){var i=Math.cos(e),r=Math.sin(e),o=t.x+i*(this.x-t.x)-r*(this.y-t.y),n=t.y+r*(this.x-t.x)+i*(this.y-t.y);return this.x=o,this.y=n,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},u.convert=function(e){return e instanceof u?e:Array.isArray(e)?new u(e[0],e[1]):e},p.types=["Unknown","Point","LineString","Polygon"],p.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,i=e.readVarint()+e.pos,r=1,o=0,n=0,a=0,s=[];e.pos<i;){if(o<=0){var l=e.readVarint();r=7&l,o=l>>3}if(o--,1===r||2===r)n+=e.readSVarint(),a+=e.readSVarint(),1===r&&(t&&s.push(t),t=[]),t.push(new u(n,a));else{if(7!==r)throw new Error("unknown command "+r);t&&t.push(t[0].clone())}}return t&&s.push(t),s},p.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,i=1,r=0,o=0,n=0,a=1/0,s=-1/0,l=1/0,u=-1/0;e.pos<t;){if(r<=0){var c=e.readVarint();i=7&c,r=c>>3}if(r--,1===i||2===i)(o+=e.readSVarint())<a&&(a=o),s<o&&(s=o),(n+=e.readSVarint())<l&&(l=n),u<n&&(u=n);else if(7!==i)throw new Error("unknown command "+i)}return[a,l,s,u]},p.prototype.toGeoJSON=function(e,t,i,r){var o,n,a=this.extent*Math.pow(2,i),s=this.extent*e,l=this.extent*t/2,u=this.loadGeometry(),c=p.types[this.type];function h(e){for(var t=0;t<e.length;t++){var i=e[t],r=90-180*(i.y+l)/(a/2);e[t]=[360*(i.x+s)/a-180,r]}}switch(this.type){case 1:var d=[];for(o=0;o<u.length;o++)d[o]=u[o][0];h(u=d);break;case 2:for(o=0;o<u.length;o++)h(u[o]);break;case 3:for(u=function(e){var t=e.length;if(t<=1)return[e];for(var i,r,o=[],n=0;n<t;n++){var a=g(e[n]);0!==a&&(void 0===r&&(r=a<0),r===a<0?(i&&o.push(i),i=[e[n]]):i.push(e[n]))}i&&o.push(i);return o}(u),o=0;o<u.length;o++)for(n=0;n<u[o].length;n++)h(u[o][n])}1===u.length?u=u[0]:c="Multi"+c;var m={type:"Feature",geometry:{type:c,coordinates:u},properties:this.properties};return"id"in this&&(m.id=this.id),m},o.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new p(this._pbf,t,this.extent,this._keys,this._values)},function(e,t){this.layers=e.readFields(r,{},t)}}),define("SGWorld/Creator/PolygonVectorTileLayerArcgis",["../Core/Core","./Color","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min","../Core/jquery","../VectorTileProvider/VectorTileProvider","../VectorTileProvider/GeoJSONVectorTileProvider","../Core/pbf-dev","../Core/vectortile"],function(i,r,o,p,e,l,u,I,D){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._color=new r(this._viewer,this._cesium),this._tree=o,this.item={show:!0},this._option=void 0,this._primitive=void 0,this._Provider=void 0,this.labelCollections=new this._cesium.PointPrimitiveCollection,this.geometries_line=[],this.geometries_polygon=[]}var n="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof2(e)};return t.prototype._serialize=function(e){var t=[],i=window.encodeURIComponent;for(var r in e){var o=e[r];"object"===(void 0===o?"undefined":n(o))?t.push(i(r)+"="+i(JSON.stringify(o))):t.push(i(r)+"="+i(e[r]))}return t.join("&")},t.prototype.createVolumeVectorGeoJsonFeatureLayer=function(e,t,x,i,r){var o={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10};t.url,t.layer,t.upperLevelLimit,t.lowerLevelLimit,this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),this._cesium;this.extent={XMin:t.minx||0,YMin:t.miny||0,XMax:t.maxx||0,YMax:t.maxy||0},this._core.isnull(x)||this._core.isnull(x.fill)||"["==x.fill.toString().charAt(0)&&"]"==x.fill.toString().charAt(x.fill.length-1)||(this._core.isHtmlColor(x.fill)?x.fill=this._color.colorFromHtmlColor(x.fill):(/^rgb/.test(x.fill)&&(x.fill=this._color.rgbaStringToRgbaObj(x.fill)),1<x.fill.r&&(x.fill.r=x.fill.r/255),1<x.fill.g&&(x.fill.g=x.fill.g/255),1<x.fill.b&&(x.fill.b=x.fill.b/255),1<x.fill.a&&(x.fill.a=x.fill.a/255),x.fill=this._color.createColor(x.fill.r,x.fill.g,x.fill.b,x.fill.a))),this._core.isnull(x)||this._core.isnull(x.polylinefill)||"["==x.polylinefill.toString().charAt(0)&&"]"==x.polylinefill.toString().charAt(x.polylinefill.length-1)||(this._core.isHtmlColor(x.polylinefill)?x.polylinefill=this._color.colorFromHtmlColor(x.polylinefill):(/^rgb/.test(x.polylinefill)&&(x.polylinefill=this._color.rgbaStringToRgbaObj(x.polylinefill)),1<x.polylinefill.r&&(x.polylinefill.r=x.polylinefill.r/255),1<x.polylinefill.g&&(x.polylinefill.g=x.polylinefill.g/255),1<x.polylinefill.b&&(x.polylinefill.b=x.polylinefill.b/255),1<x.polylinefill.a&&(x.polylinefill.a=x.polylinefill.a/255),x.polylinefill=this._color.createColor(x.polylinefill.r,x.polylinefill.g,x.polylinefill.b,x.polylinefill.a))),this._core.isnull(x)||this._core.isnull(x.outlineColor)||"["==x.outlineColor.toString().charAt(0)&&"]"==x.outlineColor.toString().charAt(x.outlineColor.length-1)||(this._core.isHtmlColor(x.outlineColor)?x.outlineColor=this._color.colorFromHtmlColor(x.outlineColor):(/^rgb/.test(x.outlineColor)&&(x.outlineColor=this._color.rgbaStringToRgbaObj(x.outlineColor)),1<x.outlineColor.r&&(x.outlineColor.r=x.outlineColor.r/255),1<x.outlineColor.g&&(x.outlineColor.g=x.outlineColor.g/255),1<x.outlineColor.b&&(x.outlineColor.b=x.outlineColor.b/255),1<x.outlineColor.a&&(x.outlineColor.a=x.outlineColor.a/255),x.outlineColor=this._color.createColor(x.outlineColor.r,x.outlineColor.g,x.outlineColor.b,x.outlineColor.a))),this._option=this._core.extend(o,x,!0),null==t&&console.log("url is required"),null==e&&console.log("layername is required");var T=this;Cesium.VertexFormat.DEFAULT,Cesium.Ellipsoid.WGS84,Cesium.ArcType.GEODESIC,Cesium.Color.WHITE;T._core.xhr({url:"http://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/resources/styles/root.json",type:"get",dataType:"json",success:function(e){var S=[],P=e.layers;Cesium.Resource.createIfNeeded("http://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/tile/0/0/0.pbf").fetchArrayBuffer().then(function(e){function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):S.push(e[t])}function t(e){var t={positions:Cesium.Cartesian3.fromDegreesArray(e),width:10,color:Cesium.ColorGeometryInstanceAttribute.fromColor(T._option.polylinefill)},i=new Cesium.PolylineGeometry(t),r=new Cesium.GeometryInstance({geometry:i});a.push(r)}function r(e){var t=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(e))}),i=Cesium.PolygonGeometry.createGeometry(t),r=new Cesium.GeometryInstance({geometry:i,attributes:{color:E}});s.push(r)}var o=new I(e),n=new D(o),a=[],s=[];for(var l in T.labelCollections=new T._cesium.LabelCollection,n.layers)for(var u=n.layers[l],c=0;c<u.length;c++)for(var h=u.feature(c),d=h.loadGeometry(),m=0;m<d.length;m++)for(var p=d[m],g=0;g<p.length;g++){p[g];var f=null;if(null!=h.properties._symbol)for(var v=h.properties._symbol,_=0;_<P.length;_++)null!=P[_].filter&&"=="==P[_].filter[0]&&"_symbol"==P[_].filter[1]&&P[_].filter[2]==v&&(f=P[_]);else if(null!=u.name){var y=u.name;for(_=0;_<P.length;_++)null!=P[_]["source-layer"]&&P[_]["source-layer"]==y&&(f=P[_])}if(1==h.type)try{var C=h.toGeoJSON(0,0,0,T.extent);if(null!=x.text&&/^\[/.test(x.text)&&/\]$/.test(x.text)){var w=x.text.replace(/\[/,"").replace(/\]/,"");T._option.text=h.properties[w]}null!=f.paint&&f.paint["icon-color"]&&(T._option.fill=T._color.createColorTransformation(f.paint["icon-color"])),T._option.position=new T._cesium.Cartesian3.fromDegrees(C.geometry.coordinates[0],C.geometry.coordinates[1],T._option.height);var b={};b="point"==C.geometry.type?{id:C,color:T._option.fill,position:T._option.position}:T._option,T.labelCollections.add(b)}catch(e){}if(2==h.type){p[0],C=h.toGeoJSON(0,0,0,T.extent);if(!T._core.isnull(x.polylinefill)&&null!=f.paint&&f.paint["icon-color"]&&(T._option.polylinefill=T._color.createColorTransformation(f.paint["icon-color"])),Array.isArray(C.geometry.coordinates)&&0<C.geometry.coordinates.length)if(Array.isArray(C.geometry.coordinates[0][0]))for(m=0;m<C.geometry.coordinates.length;m++)S=[],i(C.geometry.coordinates[m]),t(S);else i(C.geometry.coordinates),t(S)}if(3==h.type)try{p[0],C=h.toGeoJSON(0,0,0,T.extent);var E=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA);if(null!=f.paint["fill-color"]&&(E=Cesium.ColorGeometryInstanceAttribute.fromColor(T._color.createColorTransformation(f.paint["fill-color"]))),Array.isArray(C.geometry.coordinates)&&0<C.geometry.coordinates.length)if(Array.isArray(C.geometry.coordinates[0][0]))for(m=0;m<C.geometry.coordinates.length;m++)S=[],i(C.geometry.coordinates[m]),r(S);else i(C.geometry.coordinates),r(S)}catch(e){}}0<T.labelCollections.length&&T._viewer.scene.primitives.add(T.labelCollections),0<a.length&&T._viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:a,appearance:new Cesium.PolylineColorAppearance})),0<s.length&&T._viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:s,appearance:new T._cesium.MaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.fromRandom({alpha:1})}}}),faceForward:!0,flat:!1}),shadows:Cesium.ShadowMode.ENABLED}))})}})},t.prototype.createVolumeVectorGeoJsonFeatureLayers=function(e,t,r,i,o){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this.extent={XMin:t.minx||0,YMin:t.miny||0,XMax:t.maxx||0,YMax:t.maxy||0},this._core.isnull(r)||this._core.isnull(r.material)||"["==r.material.toString().charAt(0)&&"]"==r.material.toString().charAt(r.material.length-1)||(this._core.isHtmlColor(r.material)?r.material=this._color.colorFromHtmlColor(r.material):(/^rgb/.test(r.material)&&(r.material=this._color.rgbaStringToRgbaObj(r.material)),1<r.material.r&&(r.material.r=r.material.r/255),1<r.material.g&&(r.material.g=r.material.g/255),1<r.material.b&&(r.material.b=r.material.b/255),1<r.material.a&&(r.material.a=r.material.a/255),r.material=this._color.createColor(r.material.r,r.material.g,r.material.b,r.material.a))),this._option=this._core.extend(n,r,!0),null==t&&console.log("url is required"),null==e&&console.log("layername is required");var s=[],b={polygonHierarchy:void 0,height:0,extrudedHeight:100,vertexFormat:Cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:Cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:Cesium.ArcType.GEODESIC,material:Cesium.Color.WHITE},E=this;this._urlTemplate=t.url+"?"+this._serialize(a.urlParams),this._Provider=new l(this._viewer,this._cesium),this._Provider._normalTile=styleOption.level_max-1,this._Provider.loadTile=function(e,t){if((this.tile=t).state===Cesium.QuadtreeTileLoadState.START&&E.item.show){if(t.data={lines:[],geometryPrimitive:void 0},!(t.level>=r.level_min&&t.level<r.level_max))return t.state=Cesium.QuadtreeTileLoadState.LOADING,void(t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.data.geometryPrimitive.update(e,[]),t._parent&&t._parent.data&&t._parent.data.geometryPrimitive&&(t._parent.data.geometryPrimitive.destroy(),t._parent.data.geometryPrimitive=null,t._parent.state=Cesium.QuadtreeTileLoadState.START),t._southwestChild&&t._southwestChild.data&&t._southwestChild.data.geometryPrimitive&&(t._southwestChild.data.geometryPrimitive.destroy(),t._southwestChild.data.geometryPrimitive=null,t._southwestChild.state=Cesium.QuadtreeTileLoadState.START),t._southeastChild&&t._southeastChild.data&&t._southeastChild.data.geometryPrimitive&&(t._southeastChild.data.geometryPrimitive.destroy(),t._southeastChild.data.geometryPrimitive=null,t._southeastChild.state=Cesium.QuadtreeTileLoadState.START),t._northwestChild&&t._northwestChild.data&&t._northwestChild.data.geometryPrimitive&&(t._northwestChild.data.geometryPrimitive.destroy(),t._northwestChild.data.geometryPrimitive=null,t._northwestChild.state=Cesium.QuadtreeTileLoadState.START),t._northeastChild&&t._northeastChild.data&&t._northeastChild.data.geometryPrimitive&&(t._northeastChild.data.geometryPrimitive.destroy(),t._northeastChild.data.geometryPrimitive=null,t._northeastChild.state=Cesium.QuadtreeTileLoadState.START)),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0));var i=p.filter(s,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=i.length&&i[0].data&&0<i[0].data.length)return t.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:i[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),t.state=Cesium.QuadtreeTileLoadState.LOADING,void(t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0));w=t,Cesium.Resource.createIfNeeded("http://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/tile/0/0/0.pbf").fetchArrayBuffer().then(function(e){var t=new I(e),i=new D(t);E.labelCollections=new E._cesium.PointPrimitiveCollection;var r=[],o=[];for(var n in i.layers)for(var a=i.layers[n],s=0;s<a.length;s++)for(var l=a.feature(s),u=l.loadGeometry(),c=0;c<u.length;c++)for(var h=u[c],d=0;d<h.length;d++){if(h[d],1==l.type)try{var m=l.toGeoJSON(0,0,0,E.extent);if(null!=E._option.text&&/^\[/.test(E._option.text)&&/\]$/.test(E._option.text)){var p=E._option.text.replace(/\[/,"").replace(/\]/,"");b.text=l.properties[p]}b.position=new E._cesium.Cartesian3.fromDegrees(m.geometry.coordinates[0],m.geometry.coordinates[1],b.height);var g={};g="point"==m.geometry.type?{id:m,color:b.material,position:b.position}:b,E.labelCollections.add(g)}catch(e){}if(2==l.type)for(h[0],m=l.toGeoJSON(w.x,w.y,w.level,E.extent),d=0;d<m.geometry.coordinates.length;d++)try{var f=[];m.geometry.coordinates[d].forEach(function(e){f.push(e[0],e[1])});var v=new Cesium.PolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArray(f),width:10}),_=Cesium.PolylineGeometry.createGeometry(v),y=new Cesium.GeometryInstance({geometry:_});r.push(y)}catch(e){}if(3==l.type)for(h[0],m=l.toGeoJSON(w.x,w.y,w.level,E.extent),d=0;d<m.geometry.coordinates.length;d++)try{f=[],m.geometry.coordinates[d].forEach(function(e){f.push(e[0],e[1])});var C=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(f))});_=Cesium.PolygonGeometry.createGeometry(C),y=new Cesium.GeometryInstance({geometry:_}),o.push(y)}catch(e){}}0<E.labelCollections.length&&E._viewer.scene.primitives.add(E.labelCollections),0<r.length&&E._viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:r,appearance:new E._cesium.MaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.fromRandom({alpha:1})}}}),faceForward:!0,flat:!1}),shadows:Cesium.ShadowMode.ENABLED})),0<o.length&&E._viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:o,appearance:new E._cesium.MaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.fromRandom({alpha:1})}}}),faceForward:!0,flat:!1}),shadows:Cesium.ShadowMode.ENABLED}))})}var w},this._primitive=new E._cesium.QuadtreePrimitive({tileProvider:this._Provider}),this._viewer.scene.primitives.add(this._primitive)},t.prototype.createVolumeGeoJsonFeatureLayer=function(e,t,u,i,c){var h={polylinePositions:void 0,shapePositions:void 0,ellipsoid:this._cesium.Ellipsoid.WGS84,granularity:this._cesium.Math.RADIANS_PER_DEGREE,vertexFormat:this._cesium.VertexFormat.DEFAULT,cornerType:this._cesium.CornerType.ROUNDED};null==t&&console.log("geojson is required");var r=null;r=t.then?t:this._cesium.GeoJsonDataSource.load(t);var d=this,m=[];h.shapePositions=this.computeCircle(u.radius),r.then(function(e){var t=d._cesium.Color.WHITE;d._core.isnull(u)||d._core.isnull(u.material)||(t="["==u.material.toString().charAt(0)&&"]"==u.material.toString().charAt(u.material.length-1)?u.material.replace(/\[/,"").replace("/]/",""):p.clone(u.material),t=d._core.isHtmlColor(t)?d._color.colorFromHtmlColor(u.material):(/^rgb/.test(t)&&(t=d._color.rgbaStringToRgbaObj(t)),1<t.r&&(t.r=t.r/255),1<t.g&&(t.g=t.g/255),1<t.b&&(t.b=t.b/255),1<t.a&&(t.a=t.a/255),d._color.createColor(t.r,t.g,t.b,t.a)));for(var i=e.entities.values,r=0;r<i.length;r++){var o=i[r];h.polylinePositions=o.polyline.positions._value;var n=new d._cesium.PolylineVolumeGeometry(h),a=d._cesium.PolylineVolumeGeometry.createGeometry(n),s=new d._cesium.GeometryInstance({geometry:a});m.push(s)}var l=d._viewer.scene.primitives.add(new d._cesium.Primitive({geometryInstances:m,appearance:new d._cesium.MaterialAppearance({material:new d._cesium.Material({fabric:{type:"Color",uniforms:{color:t}}}),faceForward:!0,flat:!1})}));d.item=l,0==u.show&&(l.show=!1),"function"==typeof c&&c(l)}),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建管状图层"+u.id);var o={id:u.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:geoOptions.url,style:u};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},t.prototype.computeCircle=function(e){this._core.isnull(e)&&(e=4);for(var t=[],i=0;i<360;i++){var r=this._cesium.Math.toRadians(i);t.push(new this._cesium.Cartesian2(e*Math.cos(r),e*Math.sin(r)))}return t},t.prototype.createVolumeGeoJsonFeatureLayerProvider=function(e,t,v,i,r,o){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.RECEIVE_ONLY},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(v)||this._core.isnull(v.material)||"["==v.material.toString().charAt(0)&&"]"==v.material.toString().charAt(v.material.length-1)||(this._core.isHtmlColor(v.material)?v.material=this._color.colorFromHtmlColor(v.material):(/^rgb/.test(v.material)&&(v.material=this._color.rgbaStringToRgbaObj(v.material)),1<v.material.r&&(v.material.r=v.material.r/255),1<v.material.g&&(v.material.g=v.material.g/255),1<v.material.b&&(v.material.b=v.material.b/255),1<v.material.a&&(v.material.a=v.material.a/255),v.material=this._color.createColor(v.material.r,v.material.g,v.material.b,v.material.a)));var _=this._core.extend(n,v,!0),s=new u(this._viewer,this._cesium,a);this._Provider=s;var y=this;s._loadTile=function(e){var f=new y._cesium.PrimitiveCollection;return e.features.forEach(function(e){var t=[];if(/^\[/.test(v.material)&&/\]$/.test(v.material)){var i=v.material.replace(/\[/,"").replace(/\]/,"");_.material=e.properties[i],that._core.isHtmlColor(_.material)?_.material=that._color.colorFromHtmlColor(_.material):(/^rgb/.test(_.material)&&(_.material=that._color.rgbaStringToRgbaObj(_.material)),1<_.material.r&&(_.material.r=_.material.r/255),1<_.material.g&&(_.material.g=_.material.g/255),1<_.material.b&&(_.material.b=_.material.b/255),1<_.material.a&&(_.material.a=_.material.a/255),_.material=that._color.createColor(_.material.r,_.material.g,_.material.b,_.material.a))}for(var r=0;r<e.geometry.coordinates.length;r++){var o=e.geometry.coordinates[r];if(0<o.length)if(Array.isArray(o[0]))for(var n=0;n<o.length;n++){var a=o[n],s=y._cesium.Cartesian3.fromDegrees(a[0],a[1],_.height);t.push(s)}else{var l=y._cesium.Cartesian3.fromDegrees(o[0],o[1],_.height);t.push(l)}}if(_.position=t,"0"==_.slttype||0==_.slttype)_.shape=y._core.computeCircle(_.radius);else if("1"==_.slttype||1==_.slttype)_.shape=y._core.starPositions(_.number,_.exradius,_.inradius);else if("2"==_.slttype||2==_.slttype){var u=_.orth_width/2,c=_.orth_height/2;_.shape=[new y._cesium.Cartesian2(-u,-c),new y._cesium.Cartesian2(u,-c),new y._cesium.Cartesian2(u,c),new y._cesium.Cartesian2(-u,c)]}e.positions=t;var h={polylinePositions:_.position,shapePositions:_.shape,cornerType:_.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}},d=new y._cesium.PolylineVolumeGeometry(h),m=y._cesium.PolylineVolumeGeometry.createGeometry(d),p=new y._cesium.GeometryInstance({id:e,geometry:m,attributes:{color:new y._cesium.ColorGeometryInstanceAttribute.fromColor(_.material)}}),g=new y._cesium.Primitive({allowPicking:!0,appearance:new y._cesium.MaterialAppearance({material:new y._cesium.Material({fabric:{type:"Color",uniforms:{color:_.material}}}),faceForward:!0,flat:!1}),shadows:_.shadows,geometryInstances:p});f.add(g)}),f},this.item=s._primitiveCollection,s.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(_.id)&&(_.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+_.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var l={id:_.id,name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t.url,style:v};this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item)},t.prototype.setTreeobj=function(e){this.treeobj=e},t.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},t.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch(e){}},t.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(e)}catch(e){}},t.prototype.setVisibility=function(e){this.item.show=e,this._Provider&&this._Provider.setStatus(e)},t}),define("SGWorld/Creator/VectorEditing",["../Core/Core","../ProjectTree/treeSource"],function(e,i){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._tree=i}t.prototype.createVectorEditing=function(){this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(scene.canvas);var n=this;new a(this._viewer);this._tree.handler.setInputAction(function(e){var t=n._viewer.scene.pick(e.position);if(null!=t.primitives?n._viewer.scene.primitives.remove(t.primitives):null!=t.Collection&&n._viewer.scene.primitives.remove(t.Collection),null!=t.id&&null!=t.id.positions){if(-1!=t.id.geometry.type.indexOf("Line")){var i=new a.PolylinePrimitive({positions:t.id.positions,width:5,type:"plot",geodesic:!0});n._viewer.scene.primitives.add(i),i.setEditable()}else if(-1!=t.id.geometry.type.indexOf("L abel")){var r=new Cesium.BillboardCollection;viewer.scene.primitives.add(r),r.add({show:!0,id:"plot",position:t.id.positions,pixelOffset:new Cesium.Cartesian2(0,0),eyeOffset:new Cesium.Cartesian3(0,0,0),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,scale:1,image:"Content/images/glyphicons_242_google_maps.png",color:new Cesium.Color(1,1,1,1)}).setEditable()}else if(-1!=t.id.geometry.type.indexOf("Polygon")){var o=new a.PolygonPrimitive({positions:t.id.positions,type:"plot",material:Cesium.Material.fromType("Checkerboard")});viewer.scene.primitives.add(o),o.setEditable()}}else if(null!=t.collection)if(null!=t.id._label||null!=t.id._billboard||null!=t.id._point){r=new Cesium.BillboardCollection;viewer.scene.primitives.add(r),r.add({show:!0,id:"plot",position:t.id._position._value,pixelOffset:new Cesium.Cartesian2(0,0),eyeOffset:new Cesium.Cartesian3(0,0,0),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,scale:1,image:"Content/images/glyphicons_242_google_maps.png",color:new Cesium.Color(1,1,1,1)}).setEditable()}else if(null!=t.id._polyline){i=new a.PolylinePrimitive({positions:t.id._polyline.positions,width:5,type:"plot",geodesic:!0});n._viewer.scene.primitives.add(i),i.setEditable()}else if(null!=t.id._polyline){o=new a.PolygonPrimitive({positions:t.id._polyline.positions,type:"plot",material:Cesium.Material.fromType("Checkerboard")});viewer.scene.primitives.add(o),o.setEditable()}n._tree.removeHandler()},n._cesium.ScreenSpaceEventType.LEFT_CLICK)};var a=function h(){var p=Cesium.Ellipsoid.WGS84;function g(e){var t;this._scene=e.scene,this._viewer=e,this._cameraPosition=null,this._cameraHeading=null,this._cameraPitch=null,this._cameraRoll=null,this._tooltip=((t=function(){var e=document.createElement("DIV");e.className="twipsy right";var t=document.createElement("DIV");t.className="twipsy-arrow",e.appendChild(t);var i=document.createElement("DIV");i.className="twipsy-inner",e.appendChild(i),this._div=e,this._title=i,$(".cesium-viewer").append(e)}).prototype.setVisible=function(e){this._div.style.display=e?"block":"none"},t.prototype.showAt=function(e,t){e&&t&&(this.setVisible(!0),this._title.innerHTML=t,this._div.style.left=e.x+10+"px",this._div.style.top=e.y-this._div.clientHeight/2+"px")},new t),this._surfaces=[],this.initialiseHandlers(),this.enhancePrimitives()}g.prototype.initialiseHandlers=function(){var i,r=this._scene,o=this,e=new Cesium.ScreenSpaceEventHandler(r.canvas);function t(e,t){if(1!=o._handlersMuted){var i=r.pick(t);i&&i.primitive&&i.primitive[e]&&i.primitive[e](t)}}e.setInputAction(function(e){t("leftClick",e.position)},Cesium.ScreenSpaceEventType.LEFT_CLICK),e.setInputAction(function(e){t("leftDoubleClick",e.position)},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),e.setInputAction(function(e){if(1!=o._handlersMuted){var t=r.pick(e.endPosition);!i||t&&i==t.primitive||((!i.isDestroyed||!i.isDestroyed())&&i.mouseOut(e.endPosition),i=null),t&&t.primitive&&((t=t.primitive).mouseOut&&(i=t),t.mouseMove&&t.mouseMove(e.endPosition))}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),e.setInputAction(function(e){t("leftUp",e.position)},Cesium.ScreenSpaceEventType.LEFT_UP),e.setInputAction(function(e){t("leftDown",e.position)},Cesium.ScreenSpaceEventType.LEFT_DOWN)},g.prototype.setListener=function(e,t,i){e[t]=i},g.prototype.muteHandlers=function(e){this._handlersMuted=e},g.prototype.registerEditableShape=function(t){var i=this;l(t,"mouseMove",function(e){t.setHighlighted(!0),t._editMode||i._tooltip.showAt(e,"点击编辑图形")}),l(t,"mouseOut",function(e){t.setHighlighted(!1),i._tooltip.setVisible(!1)}),l(t,"leftClick",function(e){t.setEditMode(!0)})},g.prototype.startDrawing=function(e){this.disableAllEditMode(),this.editCleanUp&&this.editCleanUp(),this.editCleanUp=e,this.muteHandlers(!0)},g.prototype.stopDrawing=function(){this.editCleanUp&&(this.editCleanUp(),this.editCleanUp=null),this.muteHandlers(!1)},g.prototype.disableAllHighlights=function(){this.setHighlighted(void 0)},g.prototype.setHighlighted=function(e){this._highlightedSurface&&!this._highlightedSurface.isDestroyed()&&this._highlightedSurface!=e&&this._highlightedSurface.setHighlighted(!1),this._highlightedSurface=e},g.prototype.disableAllEditMode=function(){this.setEdited(void 0)},g.prototype.setEdited=function(e){this._editedSurface&&!this._editedSurface.isDestroyed()&&this._editedSurface.setEditMode(!1),this._editedSurface=e};var e=Cesium.Material.fromType(Cesium.Material.ColorType);e.uniforms.color=new Cesium.Color(1,1,0,.5);var t={ellipsoid:Cesium.Ellipsoid.WGS84,textureRotationAngle:0,height:0,asynchronous:!0,show:!0,debugShowBoundingVolume:!1},d=w(t,{appearance:new Cesium.EllipsoidSurfaceAppearance({aboveGround:!1}),material:e,granularity:Math.PI/180}),o=w(t,{}),n=w(t,{}),a=w(t,{}),i=w(d,{rotation:0}),c=w(t,{width:5,geodesic:!0,granularity:1e4,appearance:new Cesium.PolylineMaterialAppearance({aboveGround:!1}),material:e}),r=function(){function e(){}return e.prototype.initialiseOptions=function(e){C(this,e),this._ellipsoid=void 0,this._granularity=void 0,this._height=void 0,this._textureRotationAngle=void 0,this._id=void 0,this._createPrimitive=!0,this._primitive=void 0,this._outlinePolygon=void 0},e.prototype.setAttribute=function(e,t){this[e]=t,this._createPrimitive=!0},e.prototype.getAttribute=function(e){return this[e]},e.prototype.update=function(e,t,i){if(!Cesium.defined(this.ellipsoid))throw new Cesium.DeveloperError("this.ellipsoid must be defined.");if(!Cesium.defined(this.appearance))throw new Cesium.DeveloperError("this.material must be defined.");if(this.granularity<0)throw new Cesium.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(this.show&&(this._createPrimitive||Cesium.defined(this._primitive))){if(this._createPrimitive||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){var r=this.getGeometry();if(!r)return;this._createPrimitive=!1,this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id,this._primitive=this._primitive&&this._primitive.destroy(),this._primitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:r,id:this.id,pickPrimitive:this}),appearance:this.appearance,asynchronous:this.asynchronous}),this._outlinePolygon=this._outlinePolygon&&this._outlinePolygon.destroy(),this.strokeColor&&this.getOutlineGeometry&&(this._outlinePolygon=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:this.getOutlineGeometry(),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)}}),appearance:new Cesium.PerInstanceColorAppearance({flat:!0,renderState:{depthTest:{enabled:!0},lineWidth:Math.min(this.strokeWidth)}})}))}var o=this._primitive;o.appearance.material=this.material,o.debugShowBoundingVolume=this.debugShowBoundingVolume,o.update(e,t,i),this._outlinePolygon&&this._outlinePolygon.update(e,t,i)}},e.prototype.isDestroyed=function(){return!1},e.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),Cesium.destroyObject(this)},e.prototype.setStrokeStyle=function(e,t){this.strokeColor&&this.strokeColor.equals(e)&&this.strokeWidth==t||(this._createPrimitive=!0,this.strokeColor=e,this.strokeWidth=t)},e}();g.ExtentPrimitive=function(){function e(e){if(!Cesium.defined(e.extent))throw new Cesium.DeveloperError("Extent is required");e=w(e,d),this.initialiseOptions(e),this.setExtent(e.extent)}return(e.prototype=new r).setExtent=function(e){this.setAttribute("extent",e)},e.prototype.getExtent=function(){return this.getAttribute("extent")},e.prototype.getGeometry=function(){if(Cesium.defined(this.extent))return new Cesium.RectangleGeometry({rectangle:this.extent,height:this.height,vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},e.prototype.getOutlineGeometry=function(){return new Cesium.RectangleOutlineGeometry({rectangle:this.extent})},e}(),g.PolygonPrimitive=function(){function e(e){e=w(e,d),this.initialiseOptions(e),this.isPolygon=!0}return(e.prototype=new r).setPositions=function(e){this.setAttribute("positions",e)},e.prototype.getPositions=function(){return this.getAttribute("positions")},e.prototype.getGeometry=function(){if(Cesium.defined(this.positions)&&!(this.positions.length<3))return Cesium.PolygonGeometry.fromPositions({positions:this.positions,height:this.height,vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},e.prototype.getOutlineGeometry=function(){return Cesium.PolygonOutlineGeometry.fromPositions({positions:this.getPositions()})},e}(),g.CirclePrimitive=function(){function e(e){if(!Cesium.defined(e.center)||!Cesium.defined(e.radius))throw new Cesium.DeveloperError("Center and radius are required");e=w(e,d),this.initialiseOptions(e),this.setRadius(e.radius)}return(e.prototype=new r).setCenter=function(e){this.setAttribute("center",e)},e.prototype.setRadius=function(e){this.setAttribute("radius",Math.max(.1,e))},e.prototype.getCenter=function(){return this.getAttribute("center")},e.prototype.getRadius=function(){return this.getAttribute("radius")},e.prototype.getGeometry=function(){if(Cesium.defined(this.center)&&Cesium.defined(this.radius))return new Cesium.CircleGeometry({center:this.center,radius:this.radius,height:this.height,vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},e.prototype.getOutlineGeometry=function(){return new Cesium.CircleOutlineGeometry({center:this.getCenter(),radius:this.getRadius()})},e}(),g.EllipsePrimitive=function(){function e(e){if(!(Cesium.defined(e.center)&&Cesium.defined(e.semiMajorAxis)&&Cesium.defined(e.semiMinorAxis)))throw new Cesium.DeveloperError("Center and semi major and semi minor axis are required");e=w(e,i),this.initialiseOptions(e)}return(e.prototype=new r).setCenter=function(e){this.setAttribute("center",e)},e.prototype.setSemiMajorAxis=function(e){e<this.getSemiMinorAxis()||this.setAttribute("semiMajorAxis",e)},e.prototype.setSemiMinorAxis=function(e){e>this.getSemiMajorAxis()||this.setAttribute("semiMinorAxis",e)},e.prototype.setRotation=function(e){return this.setAttribute("rotation",e)},e.prototype.getCenter=function(){return this.getAttribute("center")},e.prototype.getSemiMajorAxis=function(){return this.getAttribute("semiMajorAxis")},e.prototype.getSemiMinorAxis=function(){return this.getAttribute("semiMinorAxis")},e.prototype.getRotation=function(){return this.getAttribute("rotation")},e.prototype.getGeometry=function(){if(Cesium.defined(this.center)&&Cesium.defined(this.semiMajorAxis)&&Cesium.defined(this.semiMinorAxis))return new Cesium.EllipseGeometry({ellipsoid:this.ellipsoid,center:this.center,semiMajorAxis:this.semiMajorAxis,semiMinorAxis:this.semiMinorAxis,rotation:this.rotation,height:this.height,vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,granularity:this.granularity})},e.prototype.getOutlineGeometry=function(){return new Cesium.EllipseOutlineGeometry({center:this.getCenter(),semiMajorAxis:this.getSemiMajorAxis(),semiMinorAxis:this.getSemiMinorAxis(),rotation:this.getRotation()})},e}(),g.PolylinePrimitive=function(){function e(e){e=w(e,c),this.initialiseOptions(e)}return(e.prototype=new r).setPositions=function(e){this.setAttribute("positions",e)},e.prototype.setWidth=function(e){this.setAttribute("width",e)},e.prototype.setGeodesic=function(e){this.setAttribute("geodesic",e)},e.prototype.getPositions=function(){return this.getAttribute("positions")},e.prototype.getWidth=function(){return this.getAttribute("width")},e.prototype.getGeodesic=function(e){return this.getAttribute("geodesic")},e.prototype.getGeometry=function(){if(Cesium.defined(this.positions)&&!(this.positions.length<2))return new Cesium.PolylineGeometry({positions:this.positions,height:this.height,width:this.width<1?1:this.width,vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,ellipsoid:this.ellipsoid})},e}();var m={iconUrl:"static/bj/dragIcon.png",shiftX:0,shiftY:0},f={iconUrl:"static/bj/dragIcon.png",shiftX:0,shiftY:0},v={iconUrl:"static/bj/dragIcon.png",shiftX:0,shiftY:0};function _(e){return p.cartographicArrayToCartesianArray([Cesium.Rectangle.northwest(e),Cesium.Rectangle.northeast(e),Cesium.Rectangle.southeast(e),Cesium.Rectangle.southwest(e)])}function y(e,t){var i=new Cesium.Rectangle;i.west=Math.min(e.longitude,t.longitude),i.east=Math.max(e.longitude,t.longitude),i.south=Math.min(e.latitude,t.latitude),i.north=Math.max(e.latitude,t.latitude);var r=Cesium.Math.EPSILON7;return i.east-i.west<r&&(i.east+=2*r),i.north-i.south<r&&(i.north+=2*r),i}function s(e,t){if(null==e||"object"!=(void 0===e?"undefined":_typeof2(e)))return e;if(e.constructor!=Object&&e.constructor!=Array)return e;if(e.constructor==Date||e.constructor==RegExp||e.constructor==Function||e.constructor==String||e.constructor==Number||e.constructor==Boolean)return new e.constructor(e);for(var i in t=t||new e.constructor,e)t[i]=void 0===t[i]?s(e[i],null):t[i];return t}function C(e,t){var i;for(i in e=e||{},t)void 0===e[i]&&(e[i]=s(t[i]))}function w(e,t){var i,r=s(e);for(i in t)void 0===r[i]&&(r[i]=s(t[i]));return r}function l(e,t,i){e[t]=i}function b(e){e._listeners={},e.addListener=function(e,t){return this._listeners[e]=this._listeners[e]||[],this._listeners[e].push(t),this._listeners[e].length},e.executeListeners=function(e,t){if(this._listeners[e.name]&&0<this._listeners[e.name].length)for(var i=0;i<this._listeners[e.name].length;i++)this._listeners[e.name][i](e);else t&&t(e)}}return g.prototype.createBillboardGroup=function(e,t,i){var r=new g.BillboardGroup(this,t);return r.addBillboards(e,i),r},(g.BillboardGroup=function(e,t){this._drawHelper=e,this._scene=e._scene,this._options=w(t,m);var i=new Cesium.BillboardCollection;this._scene.primitives.add(i),this._billboards=i,this._orderedBillboards=[]}).prototype.createBillboard=function(e,r){var o=this._billboards.add({show:!0,position:e,pixelOffset:new Cesium.Cartesian2(this._options.shiftX,this._options.shiftY),eyeOffset:new Cesium.Cartesian3(0,0,0),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,scale:2,image:this._options.iconUrl,color:new Cesium.Color(1,1,1,1)});function n(e){t.enableRotate=e}function a(){for(var e=0,t=s._orderedBillboards.length;e<t&&s._orderedBillboards[e]!=o;++e);return e}if(r){var s=this,t=this._scene.screenSpaceCameraController;if(r.dragHandlers){s=this;l(o,"leftDown",function(e){function i(e){t.destroy(),n(!0),r.dragHandlers.onDragEnd&&r.dragHandlers.onDragEnd(a(),e)}var t=new Cesium.ScreenSpaceEventHandler(s._scene.canvas);t.setInputAction(function(e){try{var t=s._scene.camera.pickEllipsoid(e.endPosition,p);t?function(e){o.position=e;for(var t=0,i=s._orderedBillboards.length;t<i&&s._orderedBillboards[t]!=o;++t);r.dragHandlers.onDrag&&r.dragHandlers.onDrag(a(),e)}(t):i(t)}catch(e){}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),t.setInputAction(function(e){i(s._scene.camera.pickEllipsoid(e.position,p))},Cesium.ScreenSpaceEventType.LEFT_UP),n(!1),r.dragHandlers.onDragStart&&r.dragHandlers.onDragStart(a(),s._scene.camera.pickEllipsoid(e,p))})}r.onDoubleClick&&l(o,"leftDoubleClick",function(e){r.onDoubleClick(a())}),r.onClick&&l(o,"leftClick",function(e){r.onClick(a())}),r.tooltip&&(l(o,"mouseMove",function(e){s._drawHelper._tooltip.showAt(e,r.tooltip())}),l(o,"mouseOut",function(e){s._drawHelper._tooltip.setVisible(!1)}))}return o},g.BillboardGroup.prototype.insertBillboard=function(e,t,i){this._orderedBillboards.splice(e,0,this.createBillboard(t,i))},g.BillboardGroup.prototype.addBillboard=function(e,t){this._orderedBillboards.push(this.createBillboard(e,t))},g.BillboardGroup.prototype.addBillboards=function(e,t){for(var i=0;i<e.length;i++)this.addBillboard(e[i],t)},g.BillboardGroup.prototype.updateBillboardsPositions=function(e){for(var t=0;t<e.length;t++)this.getBillboard(t).position=e[t]},g.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length},g.BillboardGroup.prototype.getBillboard=function(e){return this._orderedBillboards[e]},g.BillboardGroup.prototype.removeBillboard=function(e){this._billboards.remove(this.getBillboard(e)),this._orderedBillboards.splice(e,1)},g.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()},g.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)},g.prototype.startDrawingMarker=function(i){i=w(i,m);this.startDrawing(function(){o.remove(),e.destroy(),a.setVisible(!1)});var r=this,n=this._scene,a=(n.primitives,this._tooltip),o=new g.BillboardGroup(this,i),e=new Cesium.ScreenSpaceEventHandler(n.canvas);e.setInputAction(function(e){if(null!=e.position){var t=n.camera.pickEllipsoid(e.position,p);t&&(o.addBillboard(t),r.stopDrawing(),i.callback(t))}},Cesium.ScreenSpaceEventType.LEFT_CLICK),e.setInputAction(function(e){var t,i,r=e.endPosition;if(null!=r){var o=n.camera.pickEllipsoid(r,p);o?a.showAt(r,"<p>点击添加标记 位置是: </p>"+((t=p.cartesianToCartographic(o)).longitude.toFixed(i||3)+", "+t.latitude.toFixed(i||3))):a.showAt(r,"<p>点击添加标记</p>")}},Cesium.ScreenSpaceEventType.MOUSE_MOVE)},g.prototype.startDrawingPolygon=function(e){e=w(e,d);this.startDrawingPolyshape(!0,e)},g.prototype.startDrawingPolyline=function(e){e=w(e,c);this.startDrawingPolyshape(!1,e)},g.prototype.startDrawingPolyshape=function(e,i){this.startDrawing(function(){t.remove(r),u.remove(),c.destroy(),a.setVisible(!1)});var r,o=this,n=this._scene,t=n.primitives,a=this._tooltip,s=e?3:2;(r=e?new h.PolygonPrimitive(i):new h.PolylinePrimitive(i)).asynchronous=!1,t.add(r);var l=[],u=new g.BillboardGroup(this,m),c=new Cesium.ScreenSpaceEventHandler(n.canvas);c.setInputAction(function(e){if(null!=e.position){var t=n.camera.pickEllipsoid(e.position,p);t&&(0==l.length&&(l.push(t.clone()),u.addBillboard(l[0]),o._viewer.camera&&(o._cameraPosition=o._viewer.camera.position,o._cameraHeading=o._viewer.camera.heading,o._cameraPitch=o._viewer.camera.pitch,o._cameraRoll=o._viewer.camera.roll)),l.length>=s&&(r.positions=l,r._createPrimitive=!0),l.push(t),u.addBillboard(t))}},Cesium.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(e){var t=e.endPosition;if(null!=t)if(0==l.length)a.showAt(t,"<p>添加第一个点</p>");else{var i=n.camera.pickEllipsoid(t,p);i&&(l.pop(),i.y+=1+Math.random(),l.push(i),l.length>=s&&(r.positions=l,r._createPrimitive=!0),u.getBillboard(l.length-1).position=i,a.showAt(t,"<p>添加一个新的坐标点 ("+l.length+")</p>"+(l.length>s?"<p>双击完成多边形绘制</p>":"")))}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),c.setInputAction(function(e){var t=e.position;if(null!=t){if(l.length<s+2)return;if(n.camera.pickEllipsoid(t,p)&&(o.stopDrawing(),"function"==typeof i.callback)){l.length;i.callback(l)}}},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)},g.prototype.startDrawingExtent=function(i){i=w(i,d);this.startDrawing(function(){null!=l&&n.remove(l),u.remove(),e.destroy(),a.setVisible(!1)});var r=this,o=this._scene,n=this._scene.primitives,a=this._tooltip,s=null,l=null,u=null,e=new Cesium.ScreenSpaceEventHandler(o.canvas);function c(e){null==l&&((l=new Cesium.Primitive).asynchronous=!1,n.add(l));var t=_(l.rectangle=e);null==u?(u=new g.BillboardGroup(r,m)).addBillboards(t):u.updateBillboardsPositions(t)}e.setInputAction(function(e){if(null!=e.position){var t=o.camera.pickEllipsoid(e.position,p);if(t)if(null==l)c(y(s=p.cartesianToCartographic(t),s));else r.stopDrawing(),"function"==typeof i.callback&&i.callback(y(s,p.cartesianToCartographic(t)))}},Cesium.ScreenSpaceEventType.LEFT_DOWN),e.setInputAction(function(e){var t=e.endPosition;if(null!=t)if(null==l)a.showAt(t,"<p>点击添加矩形坐标点</p>");else{var i=o.camera.pickEllipsoid(t,p);if(i)c(y(s,p.cartesianToCartographic(i))),a.showAt(t,"<p>拖动改变矩形大小</p><p>点击完成矩形绘制</p>")}},Cesium.ScreenSpaceEventType.MOUSE_MOVE)},g.prototype.startDrawingCircle=function(i){i=w(i,d);this.startDrawing(function(){null!=s&&n.remove(s),e.remove(),t.destroy(),a.setVisible(!1)});var r=this,o=this._scene,n=this._scene.primitives,a=this._tooltip,s=null,e=null,t=new Cesium.ScreenSpaceEventHandler(o.canvas);t.setInputAction(function(e){if(null!=e.position){var t=o.camera.pickEllipsoid(e.position,p);t&&(null==s?(s=new g.CirclePrimitive({center:t,radius:0,asynchronous:!1,material:i.material}),n.add(s)):("function"==typeof i.callback&&i.callback(s.getCenter(),s.getRadius()),r.stopDrawing()))}},Cesium.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(function(e){var t=e.endPosition;if(null!=t)if(null==s)a.showAt(t,"<p>添加圆心点</p>");else{var i=o.camera.pickEllipsoid(t,p);i&&s.setRadius(Cesium.Cartesian3.distance(s.getCenter(),i))}},Cesium.ScreenSpaceEventType.MOUSE_MOVE)},g.prototype.enhancePrimitives=function(){var m=this;function e(e){m._scene;this._highlighted&&this._highlighted==e||!0!==this._editMode&&((this._highlighted=e)?(m.setHighlighted(this),this._strokeColor=this.strokeColor,this.setStrokeStyle(Cesium.Color.fromCssColorString("white"),this.strokeWidth)):this._strokeColor?this.setStrokeStyle(this._strokeColor,this.strokeWidth):this.setStrokeStyle(void 0,void 0))}function i(e){if(this._editMode!=e)if(m.disableAllHighlights(),e){m.setEdited(this);var i=m._scene,r=this;if(null==this._markers){var o=new g.BillboardGroup(m,f),n=new g.BillboardGroup(m,v),a={dragHandlers:{onDrag:function(e,t){r.positions[e]=t,h(e,r.positions),r._createPrimitive=!0},onDragEnd:function(e,t){r._createPrimitive=!0,d()}},onDoubleClick:function(e){r.positions.length<4||(r.positions.splice(e,1),r._createPrimitive=!0,o.removeBillboard(e),n.removeBillboard(e),h(e,r.positions),d())},tooltip:function(){if(3<r.positions.length)return"双击移除该点"}};o.addBillboards(r.positions,a),this._markers=o;for(var t=[],s=0,l=r.positions.length+(this.isPolygon?0:-1);s<l;s++)t.push(c(s));var u={dragHandlers:{onDragStart:function(e,t){this.index=e+1,r.positions.splice(this.index,0,t),r._createPrimitive=!0},onDrag:function(e,t){r.positions[this.index]=t,r._createPrimitive=!0},onDragEnd:function(e,t){o.insertBillboard(this.index,t,a),n.getBillboard(this.index-1).position=c(this.index-1),n.insertBillboard(this.index,c(this.index),u),r._createPrimitive=!0,d()}},tooltip:function(){return"拖动添加一个新的点"}};n.addBillboards(t,u),this._editMarkers=n,this._globeClickhandler=new Cesium.ScreenSpaceEventHandler(i.canvas),this._globeClickhandler.setInputAction(function(e){var t=i.pick(e.position);t&&t.primitive||r.setEditMode(!1)},Cesium.ScreenSpaceEventType.LEFT_CLICK),o.setOnTop(),n.setOnTop()}this._editMode=!0}else null!=this._markers&&(this._markers.remove(),this._editMarkers.remove(),this._markers=null,this._editMarkers=null,this._globeClickhandler.destroy()),this._editMode=!1;function c(e){var t=r.positions;return p.cartographicToCartesian(new Cesium.EllipsoidGeodesic(p.cartesianToCartographic(t[e]),p.cartesianToCartographic(t[e<t.length-1?e+1:0])).interpolateUsingFraction(.5))}function h(e,t){var i=e-1<0?t.length-1:e-1;i<n.countBillboards()&&(n.getBillboard(i).position=c(i)),(i=e)<n.countBillboards()&&(n.getBillboard(i).position=c(i))}function d(){r.executeListeners({name:"onEdited",positions:r.positions})}}Cesium.Billboard.prototype.setEditable=function(){if(!this._editable){this._editable=!0;var o=this,n=this;l(o,"leftDown",function(e){function r(e){t.destroy(),i(!0),n.executeListeners({name:"dragEnd",positions:e})}var t=new Cesium.ScreenSpaceEventHandler(m._scene.canvas);t.setInputAction(function(e){var t,i=m._scene.camera.pickEllipsoid(e.endPosition,p);i?(t=i,o.position=t,n.executeListeners({name:"drag",positions:t})):r(i)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),t.setInputAction(function(e){r(m._scene.camera.pickEllipsoid(e.position,p))},Cesium.ScreenSpaceEventType.LEFT_UP),i(!1)}),b(o)}function i(e){m._scene.screenSpaceCameraController.enableRotate=e}},h.PolylinePrimitive.prototype.setEditable=function(){if(!this.setEditMode){this.isPolygon=!1,this.asynchronous=!1,m.registerEditableShape(this),this.setEditMode=i;var t=this.width;this.setHighlighted=function(e){!0!==this._editMode&&(e?(m.setHighlighted(this),this.setWidth(2*t)):this.setWidth(t))},this.getExtent=function(){return Cesium.Extent.fromCartographicArray(p.cartesianArrayToCartographicArray(this.positions))},b(this),this.setEditMode(!1)}},h.PolygonPrimitive.prototype.setEditable=function(){this.asynchronous=!1;m._scene;m.registerEditableShape(this),this.setEditMode=i,this.setHighlighted=e,b(this),this.setEditMode(!1)},h.ExtentPrimitive.prototype.setEditable=function(){if(!this.setEditMode){var o=this,i=m._scene;m.registerEditableShape(o),o.asynchronous=!1,o.setEditMode=function(e){if(this._editMode!=e)if(m.disableAllHighlights(),e){if(m.setEdited(this),null==this._markers){var r=new g.BillboardGroup(m,f),t={dragHandlers:{onDrag:function(e,t){var i=r.getBillboard((e+2)%4).position;o.setExtent(y(p.cartesianToCartographic(i),p.cartesianToCartographic(t))),r.updateBillboardsPositions(_(o.extent))},onDragEnd:function(e,t){o.executeListeners({name:"onEdited",extent:o.extent})}},tooltip:function(){return"拖动改变矩形中心点"}};r.addBillboards(_(o.extent),t),this._markers=r,this._globeClickhandler=new Cesium.ScreenSpaceEventHandler(i.canvas),this._globeClickhandler.setInputAction(function(e){var t=i.pick(e.position);t.isDestroyed()?t&&!t.isDestroyed()&&t.primitive||o.setEditMode(!1):t&&t.primitive||o.setEditMode(!1)},Cesium.ScreenSpaceEventType.LEFT_CLICK),r.setOnTop()}this._editMode=!0}else null!=this._markers&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},o.setHighlighted=e,b(o),o.setEditMode(!1)}},g.EllipsePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var n=this,a=m._scene;n.asynchronous=!1,m.registerEditableShape(n),n.setEditMode=function(e){if(this._editMode!=e)if(m.disableAllHighlights(),e){m.setEdited(this);var i=this;if(null==this._markers){var r=new g.BillboardGroup(m,f),t={dragHandlers:{onDrag:function(e,t){var i=Cesium.Cartesian3.distance(n.getCenter(),t);e%2==0?n.setSemiMajorAxis(i):n.setSemiMinorAxis(i),r.updateBillboardsPositions(o())},onDragEnd:function(e,t){n.executeListeners({name:"onEdited",center:n.getCenter(),semiMajorAxis:n.getSemiMajorAxis(),semiMinorAxis:n.getSemiMinorAxis(),rotation:0})}},tooltip:function(){return"Drag to change the excentricity and radius"}};r.addBillboards(o(),t),this._markers=r,this._globeClickhandler=new Cesium.ScreenSpaceEventHandler(a.canvas),this._globeClickhandler.setInputAction(function(e){var t=a.pick(e.position);t&&t.primitive||i.setEditMode(!1)},Cesium.ScreenSpaceEventType.LEFT_CLICK),r.setOnTop()}this._editMode=!0}else null!=this._markers&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1;function o(){return Cesium.Shapes.computeEllipseBoundary(p,n.getCenter(),n.getSemiMajorAxis(),n.getSemiMinorAxis(),n.getRotation()+Math.PI/2,Math.PI/2).splice(0,4)}},n.setHighlighted=e,b(n),n.setEditMode(!1)}},g.CirclePrimitive.prototype.getCircleCartesianCoordinates=function(e){for(var t,i=Cesium.CircleOutlineGeometry.createGeometry(new Cesium.CircleOutlineGeometry({ellipsoid:p,center:this.getCenter(),radius:this.getRadius(),granularity:e})),r=0,o=[];r<i.attributes.position.values.length;r+=3)t=i.attributes.position.values,o.push(new Cesium.Cartesian3(t[r],t[r+1],t[r+2]));return o},g.CirclePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var n=this,a=m._scene;n.asynchronous=!1,m.registerEditableShape(n),n.setEditMode=function(e){if(this._editMode!=e)if(m.disableAllHighlights(),e){m.setEdited(this);var i=this;if(null==this._markers){var r=new g.BillboardGroup(m,f),t={dragHandlers:{onDrag:function(e,t){n.setRadius(Cesium.Cartesian3.distance(n.getCenter(),t)),r.updateBillboardsPositions(o())},onDragEnd:function(e,t){n.executeListeners({name:"onEdited",center:n.getCenter(),radius:n.getRadius()})}},tooltip:function(){return"拖动改变圆半径"}};r.addBillboards(o(),t),this._markers=r,this._globeClickhandler=new Cesium.ScreenSpaceEventHandler(a.canvas),this._globeClickhandler.setInputAction(function(e){var t=a.pick(e.position);t&&t.primitive||i.setEditMode(!1)},Cesium.ScreenSpaceEventType.LEFT_CLICK),r.setOnTop()}this._editMode=!0}else null!=this._markers&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1;function o(){return i.getCircleCartesianCoordinates(Cesium.Math.PI_OVER_TWO)}},n.setHighlighted=e,b(n),n.setEditMode(!1)}}},g.DrawHelperWidget=function(s,e){if(!Cesium.defined(e.container))throw new Cesium.DeveloperError("Container is required");C(e,{markerIcon:"Content/images/glyphicons_242_google_maps.png",polylineIcon:"Content/images/glyphicons_097_vector_path_line.png",polygonIcon:"Content/images/glyphicons_096_vector_path_polygon.png",circleIcon:"Content/images/glyphicons_095_vector_path_circle.png",extentIcon:"Content/images/glyphicons_094_vector_path_square.png",clearIcon:"Content/images/glyphicons_067_cleaning.png",polylineDrawingOptions:c,polygonDrawingOptions:o,extentDrawingOptions:n,circleDrawingOptions:a});var i=this,l=document.createElement("DIV");function t(e,t,i,r){var o=document.createElement("DIV");o.className="button",o.title=i,l.appendChild(o),o.onclick=r;var n=document.createElement("SPAN");o.appendChild(n);var a=document.createElement("IMG");return a.src=t,n.appendChild(a),o}l.className="drawtoolbar",e.container.appendChild(l);var u=s._scene;t(0,e.markerIcon,"添加标记",function(){s.startDrawingMarker({callback:function(e){i.executeListeners({name:"markerCreated",position:e})}})}),t(0,e.polylineIcon,"画线",function(){s.startDrawingPolyline({callback:function(e){i.executeListeners({name:"polylineCreated",positions:e})}})}),t(0,e.polygonIcon,"画面",function(){s.startDrawingPolygon({callback:function(e){i.executeListeners({name:"polygonCreated",positions:e})}})}),t(0,e.extentIcon,"矩形",function(){s.startDrawingExtent({callback:function(e){i.executeListeners({name:"extentCreated",extent:e})}})}),t(0,e.circleIcon,"画圆",function(){s.startDrawingCircle({callback:function(e,t){i.executeListeners({name:"circleCreated",center:e,radius:t})}})});var r=document.createElement("DIV");r.className="divider",l.appendChild(r),t(0,e.clearIcon,"清除图形",function(){s.disableAllEditMode();for(var e=u.primitives,t=e.length,i=0;i<t;++i){var r=e.get(i);if(r)if(r.hasOwnProperty("type")&&"plot"==r.type)e.remove(r);else if(r._billboards){var o=r._billboards,n=o.length;if(0<n)for(var a=0;a<n;a++)"plot"==o[a]._id&&e.remove(r)}}}),b(this)},g.prototype.addToolbar=function(e,t){return t=w(t,{container:e}),new g.DrawHelperWidget(this,t)},g};return t}),define("SGWorld/Creator/createPolyline",["../Core/Core","../Navigate/getPosition"],function(r,o){"use strict";function e(e,t,i){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this.viewer=e,this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this._getPosition=new o(this.viewer,Cesium),this.polyline=null,this.positions=[],this.style=i,this.floatPoint=null,this._core=new r,this.linePointArr=[],this.modifyPoint=null,this.state=0}return e.prototype={startCreate:function(t){var a=this;this.handler.setInputAction(function(e){var t=a._getPosition.getMousePosition(e);0==a.positions.length&&(a.positions.push(t.clone()),a.floatPoint=a.createPoint(t.clone(),!1)),a.positions.push(t);var i=a.createPoint(t,!1);if(0<a.linePointArr.length){var r=a.linePointArr[a.linePointArr.length-1].position.getValue(),o={x:(t.x+r.x)/2,y:(t.y+r.y)/2,z:(t.z+r.z)/2};a.positions.splice(a.linePointArr.length,0,o);var n=a.createPointTemporary(o,!1);n.wz=a.linePointArr.length,a.linePointArr.push(n)}i.wz=a.linePointArr.length,a.linePointArr.push(i)},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){if(!(a.positions.length<1)){var t=a._getPosition.getMousePosition(e);a.floatPoint&&a.floatPoint.position.setValue(t),2==a.positions.length&&(Cesium.defined(a.polyline)||(a.polyline=a.createPolyline(a.style))),a.polyline&&(a.positions.pop(),a.positions.push(t))}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(e){a.polyline&&(a.state=1,a.handler.destroy(),a.floatPoint&&(a.floatPoint&&(a.floatPoint.show=!1),a.floatPoint=null),a.positions.pop(),t(a.polyline))},Cesium.ScreenSpaceEventType.RIGHT_CLICK)},createByPositions:function(e,t){if(e){var i=this.lnglatArrToCartesianArr(e);if(i){this.polyline=this.createPolyline(this.style),this.positions=i,t(this.polyline);for(var r=0;r<i.length;r++){var o=this.createPoint(i[r],!1);o.wz=this.linePointArr.length,this.linePointArr.push(o)}this.state=1}}},startModify:function(){var h="拖动修改位置,右击删除该点";if(2==this.state||1==this.state){this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));for(var d=this,e=0;e<d.linePointArr.length;e++){var t=d.linePointArr[e];t&&(t.show=!0)}this.modifyHandler.setInputAction(function(e){var t=d.viewer.scene.pick(e.position);if(Cesium.defined(t)&&t.id)t.id.objId||(d.modifyPoint=t.id,h="释放后完成修改"),d.forbidDrawWorld(!0);else{for(var i=0;i<d.linePointArr.length;i++){var r=d.linePointArr[i];r&&(r.show=!1)}d.modifyHandler&&(d.modifyHandler.destroy(),d.modifyHandler=null)}d.state=2},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){var t=d.viewer.scene.pick(e.endPosition);if(d._core.CreateTooltip(h,e.endPosition,!1),Cesium.defined(t)&&t.id&&(t.id.objId||(t.id.wz%2!=0?d._core.CreateTooltip("拖动增加点",e.endPosition,!0):d._core.CreateTooltip(h,e.endPosition,!0))),!(d.positions.length<1)&&d.modifyPoint){var i=d._getPosition.getMousePosition(e);if(i&&(d.modifyPoint.position.setValue(i),d.positions[d.modifyPoint.wz]=i),d._core.CreateTooltip(h,e.endPosition,!0),d.modifyPoint.wz%2==0)if(0<d.modifyPoint.wz)if(d.modifyPoint.wz==d.linePointArr.length-1){var r=d.linePointArr[d.modifyPoint.wz-2].position.getValue(),o={x:(i.x+r.x)/2,y:(i.y+r.y)/2,z:(i.z+r.z)/2};d.linePointArr[d.modifyPoint.wz-1].position.setValue(o),d.positions[d.modifyPoint.wz-1]=o}else{r=d.linePointArr[d.modifyPoint.wz-2].position.getValue();var n=d.linePointArr[d.modifyPoint.wz+2].position.getValue(),a=(o={x:(i.x+r.x)/2,y:(i.y+r.y)/2,z:(i.z+r.z)/2},{x:(i.x+n.x)/2,y:(i.y+n.y)/2,z:(i.z+n.z)/2});d.linePointArr[d.modifyPoint.wz-1].position.setValue(o),d.positions[d.modifyPoint.wz-1]=o,d.linePointArr[d.modifyPoint.wz+1].position.setValue(a),d.positions[d.modifyPoint.wz+1]=a}else{n=d.linePointArr[d.modifyPoint.wz+2].position.getValue(),a={x:(i.x+n.x)/2,y:(i.y+n.y)/2,z:(i.z+n.z)/2};d.linePointArr[d.modifyPoint.wz+1].position.setValue(a),d.positions[d.modifyPoint.wz+1]=a}}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){if(d.modifyPoint){var t=d._getPosition.getMousePosition(e);if(d.modifyPoint.position.setValue(t),d.positions[d.modifyPoint.wz]=t,d.modifyPoint.wz%2!=0){var i=d.linePointArr[d.modifyPoint.wz-1].position.getValue(),r=d.linePointArr[d.modifyPoint.wz+1].position.getValue(),o={x:(t.x+i.x)/2,y:(t.y+i.y)/2,z:(t.z+i.z)/2},n={x:(t.x+r.x)/2,y:(t.y+r.y)/2,z:(t.z+r.z)/2},a=d.modifyPoint.wz;d.viewer.entities.remove(d.modifyPoint);var s=d.createPoint(t,!0);s.wz=a+1,d.linePointArr.splice(a,1,s);var l=d.createPointTemporary(o,!0);l.wz=a,d.linePointArr.splice(a,0,l),d.positions.splice(a,0,o);var u=d.createPointTemporary(n,!0);u.wz=a+2,d.linePointArr.splice(a+2,0,u);for(var c=0;c<d.linePointArr.length;c++)d.linePointArr[c].wz=c;d.positions.splice(a+2,0,n)}d.modifyPoint=null,d.forbidDrawWorld(!1),h="拖动修改位置,右击删除该点"}},Cesium.ScreenSpaceEventType.LEFT_UP),this.modifyHandler.setInputAction(function(e){var t=d.viewer.scene.pick(e.position);if(Cesium.defined(t)&&t.id&&!t.id.objId&&(d.forbidDrawWorld(!0),d.modifyPoint=t.id,d.modifyPoint.wz%2==0)){if(0<d.modifyPoint.wz)if(d.modifyPoint.wz==d.linePointArr.length-1)d.viewer.entities.remove(d.modifyPoint),d.viewer.entities.remove(d.linePointArr[d.modifyPoint.wz-1]),d.linePointArr.splice(d.modifyPoint.wz,1),d.linePointArr.splice(d.modifyPoint.wz-1,1),d.positions.splice(d.modifyPoint.wz,1),d.positions.splice(d.modifyPoint.wz-1,1);else{var i=d.linePointArr[d.modifyPoint.wz-2].position.getValue(),r=d.linePointArr[d.modifyPoint.wz+2].position.getValue(),o={x:(r.x+i.x)/2,y:(r.y+i.y)/2,z:(r.z+i.z)/2},n=d.createPointTemporary(o);d.viewer.entities.remove(d.modifyPoint),d.viewer.entities.remove(d.linePointArr[d.modifyPoint.wz-1]),d.viewer.entities.remove(d.linePointArr[d.modifyPoint.wz+1]),d.linePointArr[d.modifyPoint.wz]=n,d.positions[d.modifyPoint.wz]=o,d.linePointArr.splice(d.modifyPoint.wz-1,1),d.linePointArr.splice(d.modifyPoint.wz,1),d.positions.splice(d.modifyPoint.wz-1,1),d.positions.splice(d.modifyPoint.wz,1)}else d.viewer.entities.remove(d.modifyPoint),d.viewer.entities.remove(d.linePointArr[1]),d.linePointArr.splice(0,1),d.linePointArr.splice(0,1),d.positions.splice(0,1),d.positions.splice(0,1);for(var a=0;a<d.linePointArr.length;a++)d.linePointArr[a].wz=a;d.modifyPoint=null,d.forbidDrawWorld(!1)}},Cesium.ScreenSpaceEventType.RIGHT_CLICK)}},createPoint:function(e,t){if(e)return this.viewer.entities.add({position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},createPointTemporary:function(e,t){if(e)return this.viewer.entities.add({position:e,point:{pixelSize:10,color:Cesium.Color.fromAlpha(Cesium.Color.TURQUOISE,.5),outlineWidth:2,outlineColor:Cesium.Color.fromAlpha(Cesium.Color.WHITE,.5),heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},createPolyline:function(e){e||(e={});var t=this,i=this.viewer.entities.add({polyline:{positions:new Cesium.CallbackProperty(function(){return t.positions},!1),clampToGround:e.clampToGround,show:!0,fill:e.fill||!0,material:e.material||Cesium.Color.WHITE,width:e.width||3}});return i.objId=this.objId,i},getPositions:function(){return this.positions},setStyle:function(e){},remove:function(){this.polyline&&(this.state=0,this.viewer.entities.remove(this.polyline),this.polyline=null)},setVisible:function(e){this.polyline.show=e},forbidDrawWorld:function(e){this.viewer.scene.screenSpaceCameraController.enableRotate=!e,this.viewer.scene.screenSpaceCameraController.enableTilt=!e,this.viewer.scene.screenSpaceCameraController.enableTranslate=!e,this.viewer.scene.screenSpaceCameraController.enableInputs=!e},destroy:function(){this.linePointArr=[],this.handler&&(this.handler.destroy(),this.handler=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.polyline&&(this.viewer.entities.remove(this.polyline),this.polyline=null),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.positions=[],this.style=null;for(var e=0;e<this.linePointArr.length;e++){var t=this.linePointArr[e];this.viewer.entities.remove(t)}this.linePointArr=[],this.modifyPoint=null},getCatesian3FromPX:function(e,t,i){var r,o=t.scene.pick(e),n=t.scene.drillPick(e),a=null;if(i){for(var s=0;s<n.length;s++)if(n[s].id._id!=i[0].id&&n[s].id._id!=i[1].id){a=n[s].id;break}}else a=o;if(t.scene.pickPositionSupported&&Cesium.defined(a))r=t.scene.pickPosition(e);else{var l=t.camera.getPickRay(e);if(!l)return;r=t.scene.globe.pick(l,t.scene)}return r},lnglatArrToCartesianArr:function(e){if(!e)return[];for(var t=[],i=0;i<e.length;i++)t.push(Cesium.Cartesian3.fromDegrees(e[i]));return t}},e}),define("SGWorld/Creator/createPolygon",["../Core/Core","../Analysis/Cdcl/Cdcl","../Navigate/getPosition"],function(r,T,o){"use strict";function e(e,t,i){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this.viewer=e,this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this._getPosition=new o(this.viewer,Cesium),this.polygon=null,this.polyline=null,this.positions=[],this._core=new r,this.style=i,this.state=0,this.gonPointArr=[],this.gonPointStretchingArr=[],this.extrudedHeight=this.style.extrudedHeight,this.modifyPoint=null}return e.prototype={startCreate:function(n){var s=this;this.handler.setInputAction(function(e){var t=s._getPosition.getMousePosition(e);0==s.positions.length&&s.positions.push(t.clone()),s.positions.push(t);var i=s.createPoint(t,!1);if(0<s.gonPointArr.length){var r=s.gonPointArr[s.gonPointArr.length-1].position.getValue(),o={x:(t.x+r.x)/2,y:(t.y+r.y)/2,z:(t.z+r.z)/2};s.positions.splice(s.gonPointArr.length,0,o);var n=s.createPointTemporary(o,!1);n.wz=s.gonPointArr.length,s.gonPointArr.push(n)}if(s.style.extrudedHeight){var a=s.createPointStretching(t,!1);a.wq=s.gonPointArr.length,s.gonPointStretchingArr.push(a)}i.wz=s.gonPointArr.length,s.gonPointArr.push(i)},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){if(!(s.positions.length<1)){var t=s._getPosition.getMousePosition(e);2==s.positions.length&&(Cesium.defined(s.polygon)||(s.polygon=s.createPolygon(s.style),s.polygon.objId=s.objId)),s.polygon&&(s.positions.pop(),s.positions.push(t))}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(e){if(s.polygon){s.state=1,s.handler.destroy(),s.floatPoint&&(s.floatPoint&&(s.floatPoint.show=!1),s.floatPoint=null),s.positions.pop();var t=s.gonPointArr[s.gonPointArr.length-1].position.getValue(),i=s.gonPointArr[0].position.getValue(),r={x:(i.x+t.x)/2,y:(i.y+t.y)/2,z:(i.z+t.z)/2};s.positions.push(r);var o=s.createPointTemporary(r,!1);o.wz=s.gonPointArr.length,s.gonPointArr.push(o),n(s.polygon)}},Cesium.ScreenSpaceEventType.RIGHT_CLICK)},createByPositions:function(e,t){if(e){var i=this.lnglatArrToCartesianArr(e);if(i){this.polygon=this.createPolygon(this.style),this.positions=i,t(this.polygon);for(var r=0;r<i.length;r++){var o=this.createPoint(i[r]);o.wz=this.gonPointArr.length,this.gonPointArr.push(o)}this.state=1,this.polygon.objId=this.objId}}},startModify:function(){var P="拖动修改位置,右击删除该点";if(1==this.state||2==this.state){this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));for(var x=this,e=0;e<x.gonPointArr.length;e++){(t=x.gonPointArr[e])&&(t.show=!0)}if(0<x.gonPointStretchingArr.length)for(e=0;e<x.gonPointStretchingArr.length;e++){var t;(t=x.gonPointStretchingArr[e])&&(t.show=!0)}this.modifyHandler.setInputAction(function(e){var t=x.viewer.scene.pick(e.position);if(Cesium.defined(t)&&t.id)t.id.objId||(x.modifyPoint=t.id,P="释放后完成修改"),x.forbidDrawWorld(!0);else{for(var i=0;i<x.gonPointArr.length;i++){(r=x.gonPointArr[i])&&(r.show=!1)}if(0<x.gonPointStretchingArr.length)for(i=0;i<x.gonPointStretchingArr.length;i++){var r;(r=x.gonPointStretchingArr[i])&&(r.show=!1)}x.modifyHandler&&(x.modifyHandler.destroy(),x.modifyHandler=null)}},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){var t=x.viewer.scene.pick(e.endPosition);if(x._core.CreateTooltip(P,e.endPosition,!1),Cesium.defined(t)&&t.id&&(t.id.objId||(t.id.wz%2!=0?x._core.CreateTooltip("拖动增加点",e.endPosition,!0):x._core.CreateTooltip(P,e.endPosition,!0))),!(x.positions.length<1)&&x.modifyPoint){var i=x._getPosition.getMousePosition(e);if(x._core.CreateTooltip(P,e.endPosition,!0),x.modifyPoint.wq){var r=x.viewer.scene.pickPosition(e.endPosition),o=Cesium.Cartographic.fromCartesian(x.positions[x.modifyPoint.wq]),n=Cesium.Math.toDegrees(o.longitude),a=Cesium.Math.toDegrees(o.latitude),s=Cesium.Cartographic.fromCartesian(r),l=Cesium.Math.toDegrees(s.longitude),u=Cesium.Math.toDegrees(s.latitude),c=T(a,n,u,l);isNaN(c)&&(c=0),x.extrudedHeight=c;for(var h=0;h<x.gonPointStretchingArr.length;h++){s=Cesium.Cartographic.fromCartesian(x.positions[x.gonPointStretchingArr[h].wq]);var d=Cesium.Math.toDegrees(s.longitude),m=Cesium.Math.toDegrees(s.latitude),p=s.height+x.extrudedHeight,g=Cesium.Cartesian3.fromDegrees(d,m,p);x.gonPointStretchingArr[h].position.setValue(g)}}else i&&(x.modifyPoint.position.setValue(i),x.positions[x.modifyPoint.wz]=i);if(x.modifyPoint.wz%2==0){if(x.gonPointStretchingArr&&x.gonPointStretchingArr[x.modifyPoint.wz-x.modifyPoint.wz/2]&&x.gonPointStretchingArr[x.modifyPoint.wz-x.modifyPoint.wz/2].wq==x.modifyPoint.wz){var f=Cesium.Cartographic.fromCartesian(i),v=Cesium.Math.toDegrees(f.longitude),_=Cesium.Math.toDegrees(f.latitude),y=f.height+x.extrudedHeight,C=Cesium.Cartesian3.fromDegrees(v,_,y);x.gonPointStretchingArr[x.modifyPoint.wz-x.modifyPoint.wz/2].position.setValue(C)}if(0<x.modifyPoint.wz)if(x.modifyPoint.wz==x.gonPointArr.length-2){var w=x.gonPointArr[x.modifyPoint.wz-2].position.getValue(),b=x.gonPointArr[0].position.getValue(),E={x:(i.x+w.x)/2,y:(i.y+w.y)/2,z:(i.z+w.z)/2},S={x:(i.x+b.x)/2,y:(i.y+b.y)/2,z:(i.z+b.z)/2};x.gonPointArr[x.modifyPoint.wz-1].position.setValue(E),x.positions[x.modifyPoint.wz-1]=E,x.gonPointArr[x.gonPointArr.length-1].position.setValue(S),x.positions[x.gonPointArr.length-1]=S}else{w=x.gonPointArr[x.modifyPoint.wz-2].position.getValue(),b=x.gonPointArr[x.modifyPoint.wz+2].position.getValue(),E={x:(i.x+w.x)/2,y:(i.y+w.y)/2,z:(i.z+w.z)/2},S={x:(i.x+b.x)/2,y:(i.y+b.y)/2,z:(i.z+b.z)/2};x.gonPointArr[x.modifyPoint.wz-1].position.setValue(E),x.positions[x.modifyPoint.wz-1]=E,x.gonPointArr[x.modifyPoint.wz+1].position.setValue(S),x.positions[x.modifyPoint.wz+1]=S}else{w=x.gonPointArr[x.gonPointArr.length-2].position.getValue(),b=x.gonPointArr[x.modifyPoint.wz+2].position.getValue(),E={x:(i.x+w.x)/2,y:(i.y+w.y)/2,z:(i.z+w.z)/2},S={x:(i.x+b.x)/2,y:(i.y+b.y)/2,z:(i.z+b.z)/2};x.gonPointArr[x.gonPointArr.length-1].position.setValue(E),x.positions[x.gonPointArr.length-1]=E,x.gonPointArr[x.modifyPoint.wz+1].position.setValue(S),x.positions[x.modifyPoint.wz+1]=S}}}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){if(x.forbidDrawWorld(!1),x.modifyPoint){var t=x._getPosition.getMousePosition(e);if(x.modifyPoint.wz&&x.modifyPoint.wz%2!=0){if(x.gonPointStretchingArr&&0<x.gonPointStretchingArr.length&&x.style.extrudedHeight){var i=x.createPointStretching(t,!0);i.wq=x.modifyPoint.wz+1,x.gonPointStretchingArr.splice((x.modifyPoint.wz+1)/2,0,i)}x.modifyPoint.position.setValue(t),x.positions[x.modifyPoint.wz]=t,x.modifyPoint.wz,x.gonPointArr.length;var r=x.gonPointArr[x.modifyPoint.wz-1].position.getValue(),o=x.gonPointArr[0].position.getValue();if(x.modifyPoint.wz!=x.gonPointArr.length-1)o=x.gonPointArr[x.modifyPoint.wz+1].position.getValue();var n={x:(t.x+r.x)/2,y:(t.y+r.y)/2,z:(t.z+r.z)/2},a={x:(t.x+o.x)/2,y:(t.y+o.y)/2,z:(t.z+o.z)/2},s=x.modifyPoint.wz;x.viewer.entities.remove(x.modifyPoint);var l=x.createPoint(t,!0);l.wz=s+1,x.gonPointArr.splice(s,1,l);var u=x.createPointTemporary(n);u.wz=s,x.gonPointArr.splice(s,0,u),x.positions.splice(s,0,n);var c=x.createPointTemporary(a);c.wz=s+2,x.gonPointArr.splice(s+2,0,c),x.positions.splice(s+2,0,a);for(var h=0;h<x.gonPointArr.length;h++)x.gonPointArr[h].wz=h;if(0<x.gonPointStretchingArr.length)for(h=0;h<x.gonPointStretchingArr.length;h++)x.gonPointStretchingArr[h].wq=2*h}x.modifyPoint=null,x.forbidDrawWorld(!1),P="拖动修改位置,右击删除该点"}},Cesium.ScreenSpaceEventType.LEFT_UP),this.modifyHandler.setInputAction(function(e){var t=x.viewer.scene.pick(e.position);if(Cesium.defined(t)&&t.id&&!t.id.objId&&(x.forbidDrawWorld(!0),x.modifyPoint=t.id,6<x.gonPointArr.length&&x.modifyPoint.wz%2==0)){if(0<x.modifyPoint.wz)if(x.modifyPoint.wz==x.gonPointArr.length-2){var i=x.gonPointArr[x.modifyPoint.wz-2].position.getValue(),r={x:((n=x.gonPointArr[0].position.getValue()).x+i.x)/2,y:(n.y+i.y)/2,z:(n.z+i.z)/2},o=x.createPointTemporary(r);x.viewer.entities.remove(x.modifyPoint),x.viewer.entities.remove(x.gonPointArr[x.modifyPoint.wz-1]),x.viewer.entities.remove(x.gonPointArr[x.modifyPoint.wz+1]),x.gonPointArr[x.modifyPoint.wz]=o,x.positions[x.modifyPoint.wz]=r,x.gonPointArr.splice(x.modifyPoint.wz+1,1),x.gonPointArr.splice(x.modifyPoint.wz-1,1),x.positions.splice(x.modifyPoint.wz+1,1),x.positions.splice(x.modifyPoint.wz-1,1)}else{i=x.gonPointArr[x.modifyPoint.wz-2].position.getValue(),r={x:((n=x.gonPointArr[x.modifyPoint.wz+2].position.getValue()).x+i.x)/2,y:(n.y+i.y)/2,z:(n.z+i.z)/2},o=x.createPointTemporary(r);x.viewer.entities.remove(x.modifyPoint),x.viewer.entities.remove(x.gonPointArr[x.modifyPoint.wz-1]),x.viewer.entities.remove(x.gonPointArr[x.modifyPoint.wz+1]),x.gonPointArr[x.modifyPoint.wz]=o,x.positions[x.modifyPoint.wz]=r,x.gonPointArr.splice(x.modifyPoint.wz+1,1),x.gonPointArr.splice(x.modifyPoint.wz-1,1),x.positions.splice(x.modifyPoint.wz+1,1),x.positions.splice(x.modifyPoint.wz-1,1)}else{var n;i=x.gonPointArr[x.gonPointArr.length-2].position.getValue(),r={x:((n=x.gonPointArr[x.modifyPoint.wz+2].position.getValue()).x+i.x)/2,y:(n.y+i.y)/2,z:(n.z+i.z)/2},o=x.createPointTemporary(r);x.viewer.entities.remove(x.modifyPoint),x.viewer.entities.remove(x.gonPointArr[x.gonPointArr.length-1]),x.viewer.entities.remove(x.gonPointArr[x.modifyPoint.wz+1]),x.gonPointArr.splice(x.gonPointArr.length-1,1),x.gonPointArr.splice(x.modifyPoint.wz+1,1),x.gonPointArr.splice(x.modifyPoint.wz,1),x.gonPointArr.push(o),x.positions.splice(x.positions.length-1,1),x.positions.splice(x.modifyPoint.wz+1,1),x.positions.splice(x.modifyPoint.wz,1),x.positions.push(r)}for(var a=0;a<x.gonPointArr.length;a++)x.gonPointArr[a].wz=a;if(0<x.gonPointStretchingArr.length){x.viewer.entities.remove(x.gonPointStretchingArr[x.modifyPoint.wz/2]),x.gonPointStretchingArr.splice(x.modifyPoint.wz/2,1);for(a=0;a<x.gonPointStretchingArr.length;a++)x.gonPointStretchingArr[a].wq=2*a}}x.modifyPoint=null,x.forbidDrawWorld(!1)},Cesium.ScreenSpaceEventType.RIGHT_CLICK)}},createPoint:function(e,t){if(e)return this.viewer.entities.add({position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},createPointTemporary:function(e,t){if(e)return this.viewer.entities.add({position:e,point:{pixelSize:10,color:Cesium.Color.fromAlpha(Cesium.Color.TURQUOISE,.5),outlineWidth:2,outlineColor:Cesium.Color.fromAlpha(Cesium.Color.WHITE,.5),heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},createPointStretching:function(e,t){if(e){var i=Cesium.Cartographic.fromCartesian(e),r=Cesium.Math.toDegrees(i.longitude),o=Cesium.Math.toDegrees(i.latitude),n=i.height+this.extrudedHeight;return e=Cesium.Cartesian3.fromDegrees(r,o,n),this.viewer.entities.add({position:e,point:{pixelSize:10,color:Cesium.Color.fromAlpha(Cesium.Color.FUCHSIA,.5),outlineWidth:2,outlineColor:Cesium.Color.fromAlpha(Cesium.Color.WHITE,.5),heightReference:Cesium.HeightReference.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})}},createPolygon:function(e){var t=this;return t.extrudedHeight=e.extrudedHeight,this.viewer.entities.add({polygon:{hierarchy:new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(t.positions)},!1),heightReference:e.heightReference||1,show:!0,fill:e.fill||!0,material:e.material||Cesium.Color.WHITE,width:e.width||3,extrudedHeight:void 0===t.extrudedHeight?void 0:new Cesium.CallbackProperty(function(){return t.extrudedHeight},!1),outlineColor:e.outlineColor||Cesium.Color.BLACK,outlineWidth:e.outlineWidth||1,outline:e.outline}})},createPolyline:function(){return this.viewer.entities.add({polyline:{positions:new Cesium.CallbackProperty(function(){return $this.positions},!1),clampToGround:!0,show:!0,fill:!0,material:Cesium.Color.WHITE||obj.material,width:3}})},getPositions:function(){return this.positions},setStyle:function(e){},remove:function(){this.polygon&&(this.state=0,this.viewer.entities.remove(this.polygon),this.polygon=null)},setVisible:function(e){this.polygon.show=e},forbidDrawWorld:function(e){this.viewer.scene.screenSpaceCameraController.enableRotate=!e,this.viewer.scene.screenSpaceCameraController.enableTilt=!e,this.viewer.scene.screenSpaceCameraController.enableTranslate=!e,this.viewer.scene.screenSpaceCameraController.enableInputs=!e},destroy:function(){this.handler&&(this.handler.destroy(),this.handler=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.polygon&&(this.viewer.entities.remove(this.polygon),this.polygon=null),this.polyline&&(this.viewer.entities.remove(this.polyline),this.polyline=null),this.positions=[],this.style=null,this.modifyPoint&&(this.viewer.entities.remove(this.modifyPoint),this.modifyPoint=null);for(var e=0;e<this.gonPointArr.length;e++){var t=this.gonPointArr[e];this.viewer.entities.remove(t)}this.gonPointArr=[],this.state=0},getCatesian3FromPX:function(e,t,i){var r,o=t.scene.pick(e),n=t.scene.drillPick(e),a=null;if(i){for(var s=0;s<n.length;s++)if(n[s].id._id!=i[0].id&&i[1]&&n[s].id._id!=i[1].id){a=n[s].id;break}}else a=o;if(t.scene.pickPositionSupported&&Cesium.defined(a))r=t.scene.pickPosition(e);else{var l=t.camera.getPickRay(e);if(!l)return;r=t.scene.globe.pick(l,t.scene)}return r},lnglatArrToCartesianArr:function(e){if(!e)return[];for(var t=[],i=0;i<e.length;i++)t.push(Cesium.Cartesian3.fromDegrees(e[i]));return t}},e}),define("SGWorld/VectorTileProvider/GeoJSONVectorTileProvider1",[],function(){"use strict";return function(e,t,i,r){this.UrlTemplateGeojsonProvider=new t.UrlTemplateGeojsonProvider(i,1),this.UrlTemplateGeojsonProvider.loadtitle=r,this.ent=e.imageryLayers.addImageryProvider(this.UrlTemplateGeojsonProvider)}}),"undefined"==typeof module?this.LonLatProjection=LonLatProjection:module.exports=LonLatProjection,"function"==typeof define&&define("SGWorld/Core/LonLatProjection",[],function(){return LonLatProjection}),function(e){if("object"===("undefined"==typeof exports?"undefined":_typeof2(exports))&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define("SGWorld/Const/turf",[],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).turf=e()}}(function(){return function n(a,s,l){function u(i,e){if(!s[i]){if(!a[i]){var t="function"==typeof require&&require;if(!e&&t)return t(i,!0);if(c)return c(i,!0);var r=new Error("Cannot find module '"+i+"'");throw r.code="MODULE_NOT_FOUND",r}var o=s[i]={exports:{}};a[i][0].call(o.exports,function(e){var t=a[i][1][e];return u(t||e)},o,o.exports,n,a,s,l)}return s[i].exports}for(var c="function"==typeof require&&require,e=0;e<l.length;e++)u(l[e]);return u}({1:[function(e,t,i){var r=e("@turf/meta").featureEach,o=e("@turf/meta").geomEach,n=e("@turf/invariant").getCoords,a=e("@turf/helpers"),s=a.point,l=a.lineString,u=a.polygon,c=a.featureCollection;t.exports={lineIntersect:e("@turf/line-intersect"),bboxClip:e("@turf/bbox-clip"),polygonToLineString:e("@turf/polygon-to-linestring"),simplify:e("@turf/simplify"),featureEach:r,featureCollection:c,polygon:u,point:s,lineString:l,geomEach:o,getCoords:n,helpers:a,bbox:e("@turf/bbox"),within:e("@turf/within"),center:e("@turf/center"),centerOfMass:e("@turf/center-of-mass"),centroid:e("@turf/centroid"),lineOffset:e("@turf/line-offset"),buffer:e("@turf/buffer"),difference:e("@turf/difference"),mask:e("@turf/mask")}},{"@turf/bbox":6,"@turf/bbox-clip":3,"@turf/buffer":7,"@turf/center":9,"@turf/center-of-mass":8,"@turf/centroid":10,"@turf/difference":12,"@turf/helpers":14,"@turf/invariant":16,"@turf/line-intersect":17,"@turf/line-offset":21,"@turf/mask":27,"@turf/meta":28,"@turf/polygon-to-linestring":29,"@turf/simplify":32,"@turf/within":34}],2:[function(e,t,i){t.exports=function(e){if(!e||!e.type)return null;var t=r[e.type];if(!t)return null;{if("geometry"===t)return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:e}]};if("feature"===t)return{type:"FeatureCollection",features:[e]};if("featurecollection"===t)return e}};var r={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"}},{}],3:[function(e,t,i){var r=e("@turf/helpers"),s=e("lineclip"),l=e("@turf/invariant").getCoords,u=r.lineString,c=r.multiLineString,h=r.polygon,d=r.multiPolygon;function m(e,t){for(var i=[],r=0;r<e.length;r++){var o=s.polygon(e[r],t);0<o.length&&(o[0][0]===o[o.length-1][0]&&o[0][1]===o[o.length-1][1]||o.push(o[0]),i.push(o))}return i}t.exports=function(e,t){var i,r=(i=e).geometry?i.geometry.type:i.type,o=l(e),n=e.properties;switch(r){case"LineString":case"MultiLineString":var a=[];return"LineString"===r&&(o=[o]),o.forEach(function(e){s(e,t,a)}),1===a.length?u(a[0],n):c(a,n);case"Polygon":return h(m(o,t),n);case"MultiPolygon":return d(o.map(function(e){return m(e,t)}),n);default:throw new Error("geometry "+r+" not supported")}}},{"@turf/helpers":4,"@turf/invariant":5,lineclip:44}],4:[function(e,t,i){function n(e,t){if(!e)throw new Error("No geometry passed");return{type:"Feature",properties:t||{},geometry:e}}var r={miles:3960,nauticalmiles:3441.145,degrees:57.2957795,radians:1,inches:250905600,yards:6969600,meters:6373e3,metres:6373e3,kilometers:6373,kilometres:6373,feet:20908792.65};t.exports={feature:n,featureCollection:function(e){if(!e)throw new Error("No features passed");return{type:"FeatureCollection",features:e}},geometryCollection:function(e,t){if(!e)throw new Error("No geometries passed");return n({type:"GeometryCollection",geometries:e},t)},point:function(e,t){if(!e)throw new Error("No coordinates passed");if(void 0===e.length)throw new Error("Coordinates must be an array");if(e.length<2)throw new Error("Coordinates must be at least 2 numbers long");if("number"!=typeof e[0]||"number"!=typeof e[1])throw new Error("Coordinates must numbers");return n({type:"Point",coordinates:e},t)},multiPoint:function(e,t){if(!e)throw new Error("No coordinates passed");return n({type:"MultiPoint",coordinates:e},t)},lineString:function(e,t){if(!e)throw new Error("No coordinates passed");return n({type:"LineString",coordinates:e},t)},multiLineString:function(e,t){if(!e)throw new Error("No coordinates passed");return n({type:"MultiLineString",coordinates:e},t)},polygon:function(e,t){if(!e)throw new Error("No coordinates passed");for(var i=0;i<e.length;i++){var r=e[i];if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<r[r.length-1].length;o++)if(r[r.length-1][o]!==r[0][o])throw new Error("First and last Position are not equivalent.")}return n({type:"Polygon",coordinates:e},t)},multiPolygon:function(e,t){if(!e)throw new Error("No coordinates passed");return n({type:"MultiPolygon",coordinates:e},t)},radiansToDistance:function(e,t){var i=r[t||"kilometers"];if(void 0===i)throw new Error("Invalid unit");return e*i},distanceToRadians:function(e,t){var i=r[t||"kilometers"];if(void 0===i)throw new Error("Invalid unit");return e/i},distanceToDegrees:function(e,t){var i=r[t||"kilometers"];if(void 0===i)throw new Error("Invalid unit");return e/i*57.2958}}},{}],5:[function(e,t,i){function r(e){if(!e)throw new Error("No obj passed");var t;if(e.length?t=e:e.coordinates?t=e.coordinates:e.geometry&&e.geometry.coordinates&&(t=e.geometry.coordinates),t)return o(t),t;throw new Error("No valid coordinates")}function o(e){if(1<e.length&&"number"==typeof e[0]&&"number"==typeof e[1])return!0;if(Array.isArray(e[0])&&e[0].length)return o(e[0]);throw new Error("coordinates must only contain numbers")}t.exports={geojsonType:function(e,t,i){if(!t||!i)throw new Error("type and name required");if(!e||e.type!==t)throw new Error("Invalid input to "+i+": must be a "+t+", given "+e.type)},collectionOf:function(e,t,i){if(!e)throw new Error("No featureCollection passed");if(!i)throw new Error(".collectionOf() requires a name");if(!e||"FeatureCollection"!==e.type)throw new Error("Invalid input to "+i+", FeatureCollection required");for(var r=0;r<e.features.length;r++){var o=e.features[r];if(!o||"Feature"!==o.type||!o.geometry)throw new Error("Invalid input to "+i+", Feature with geometry required");if(!o.geometry||o.geometry.type!==t)throw new Error("Invalid input to "+i+": must be a "+t+", given "+o.geometry.type)}},featureOf:function(e,t,i){if(!e)throw new Error("No feature passed");if(!i)throw new Error(".featureOf() requires a name");if(!e||"Feature"!==e.type||!e.geometry)throw new Error("Invalid input to "+i+", Feature with geometry required");if(!e.geometry||e.geometry.type!==t)throw new Error("Invalid input to "+i+": must be a "+t+", given "+e.geometry.type)},getCoord:function(e){if(!e)throw new Error("No obj passed");var t=r(e);if(1<t.length&&"number"==typeof t[0]&&"number"==typeof t[1])return t;throw new Error("Coordinate is not a valid Point")},getCoords:r,containsNumber:o}},{}],6:[function(e,t,i){var r=e("@turf/meta").coordEach;t.exports=function(e){var t=[1/0,1/0,-1/0,-1/0];return r(e,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}},{"@turf/meta":28}],7:[function(e,t,i){var a=e("@turf/helpers"),s=a.featureCollection,l=e("jsts"),u=e("@mapbox/geojson-normalize");t.exports=function(e,t,i){var n=a.lengthToDegrees(t,i),r=u(e),o=u(s(r.features.map(function(e){return t=e,i=n,r=(new l.io.GeoJSONReader).read(t.geometry).buffer(i),o=new l.io.GeoJSONWriter,{type:"Feature",geometry:r=o.write(r),properties:{}};var t,i,r,o})));return 1<o.features.length?o:1===o.features.length?o.features[0]:void 0}},{"@mapbox/geojson-normalize":2,"@turf/helpers":14,jsts:43}],8:[function(e,_,t){var y=e("@turf/meta").coordEach,C=e("@turf/centroid"),w=e("@turf/convex"),b=e("@turf/explode"),E=e("@turf/helpers").point;_.exports=function(e){if("Feature"===e.type&&"Polygon"===e.geometry.type){var t=[];y(e,function(e){t.push(e)});var i,r,o,n,a,s,l,u,c=C(e),h=c.geometry.coordinates,d=0,m=0,p=0,g=t.map(function(e){return[e[0]-h[0],e[1]-h[1]]});for(i=0;i<t.length-1;i++)n=(r=g[i])[0],s=r[1],a=(o=g[i+1])[0],p+=u=n*(l=o[1])-a*s,d+=(n+a)*u,m+=(s+l)*u;if(0===p)return c;var f=1/(.5*p*6);return E([h[0]+f*d,h[1]+f*m])}var v=w(b(e));return v?_.exports(v):C(e)}},{"@turf/centroid":10,"@turf/convex":11,"@turf/explode":13,"@turf/helpers":14,"@turf/meta":28}],9:[function(e,t,i){var o=e("@turf/bbox"),n=e("@turf/helpers").point;t.exports=function(e){var t=o(e),i=(t[0]+t[2])/2,r=(t[1]+t[3])/2;return n([i,r])}},{"@turf/bbox":6,"@turf/helpers":14}],10:[function(e,t,i){var o=e("@turf/meta").coordEach,n=e("@turf/helpers").point;t.exports=function(e){var t=0,i=0,r=0;return o(e,function(e){t+=e[0],i+=e[1],r++},!0),n([t/r,i/r])}},{"@turf/helpers":14,"@turf/meta":28}],11:[function(e,t,i){var n=e("@turf/meta").coordEach,a=e("convex-hull"),s=e("@turf/helpers").polygon;t.exports=function(e){var t=[];n(e,function(e){t.push([e[0],e[1]])});var i=a(t);if(3<=i.length){for(var r=[],o=0;o<i.length;o++)r.push(t[i[o][0]]);return r.push(t[i[i.length-1][1]]),s([r])}}},{"@turf/helpers":14,"@turf/meta":28,"convex-hull":37}],12:[function(e,t,i){var u=e("jsts");t.exports=function(e,t){var i=JSON.parse(JSON.stringify(e)),r=JSON.parse(JSON.stringify(t));"Feature"!==i.type&&(i={type:"Feature",properties:{},geometry:i}),"Feature"!==r.type&&(r={type:"Feature",properties:{},geometry:r});var o=new u.io.GeoJSONReader,n=o.read(JSON.stringify(i.geometry)),a=o.read(JSON.stringify(r.geometry)),s=n.difference(a);if(!s.isEmpty()){var l=(new u.io.GeoJSONWriter).write(s);return i.geometry=s,{type:"Feature",properties:i.properties,geometry:l}}}},{jsts:43}],13:[function(e,t,i){var r=e("@turf/helpers").featureCollection,o=e("@turf/meta").featureEach,n=e("@turf/meta").coordEach,a=e("@turf/helpers").point;t.exports=function(t){var i=[];return"FeatureCollection"===t.type?o(t,function(t){n(t,function(e){i.push(a(e,t.properties))})}):n(t,function(e){i.push(a(e,t.properties))}),r(i)}},{"@turf/helpers":14,"@turf/meta":28}],14:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=6371008.8,o={meters:r,metres:r,millimeters:1e3*r,millimetres:1e3*r,centimeters:100*r,centimetres:100*r,kilometers:r/1e3,kilometres:r/1e3,miles:r/1609.344,nauticalmiles:r/1852,inches:39.37*r,yards:r/1.0936,feet:3.28084*r,radians:1,degrees:r/111325},n={meters:1,metres:1,millimeters:1e3,millimetres:1e3,centimeters:100,centimetres:100,kilometers:.001,kilometres:.001,miles:1/1609.344,nauticalmiles:1/1852,inches:39.37,yards:1/1.0936,feet:3.28084,radians:1/r,degrees:1/111325},a={meters:1,metres:1,millimeters:1e6,millimetres:1e6,centimeters:1e4,centimetres:1e4,kilometers:1e-6,kilometres:1e-6,acres:247105e-9,miles:386e-9,yards:1.195990046,feet:10.763910417,inches:1550.003100006};function s(e,t,i){if(!y(i=i||{}))throw new Error("options is invalid");var r=i.bbox,o=i.id;if(void 0===e)throw new Error("geometry is required");if(t&&t.constructor!==Object)throw new Error("properties must be an Object");r&&C(r),o&&w(o);var n={type:"Feature"};return o&&(n.id=o),r&&(n.bbox=r),n.properties=t||{},n.geometry=e,n}function l(e,t,i){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!_(e[0])||!_(e[1]))throw new Error("coordinates must contain numbers");return s({type:"Point",coordinates:e},t,i)}function u(e,t,i){if(!e)throw new Error("coordinates is required");for(var r=0;r<e.length;r++){var o=e[r];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var n=0;n<o[o.length-1].length;n++){if(0===r&&0===n&&!_(o[0][0])||!_(o[0][1]))throw new Error("coordinates must contain numbers");if(o[o.length-1][n]!==o[0][n])throw new Error("First and last Position are not equivalent.")}}return s({type:"Polygon",coordinates:e},t,i)}function c(e,t,i){if(!e)throw new Error("coordinates is required");if(e.length<2)throw new Error("coordinates must be an array of two or more positions");if(!_(e[0][1])||!_(e[0][1]))throw new Error("coordinates must contain numbers");return s({type:"LineString",coordinates:e},t,i)}function h(e,t){if(!y(t=t||{}))throw new Error("options is invalid");var i=t.bbox,r=t.id;if(!e)throw new Error("No features passed");if(!Array.isArray(e))throw new Error("features must be an Array");i&&C(i),r&&w(r);var o={type:"FeatureCollection"};return r&&(o.id=r),i&&(o.bbox=i),o.features=e,o}function d(e,t,i){if(!e)throw new Error("coordinates is required");return s({type:"MultiLineString",coordinates:e},t,i)}function m(e,t,i){if(!e)throw new Error("coordinates is required");return s({type:"MultiPoint",coordinates:e},t,i)}function p(e,t,i){if(!e)throw new Error("coordinates is required");return s({type:"MultiPolygon",coordinates:e},t,i)}function g(e,t){if(null==e)throw new Error("radians is required");if(t&&"string"!=typeof t)throw new Error("units must be a string");var i=o[t||"kilometers"];if(!i)throw new Error(t+" units is invalid");return e*i}function f(e,t){if(null==e)throw new Error("distance is required");if(t&&"string"!=typeof t)throw new Error("units must be a string");var i=o[t||"kilometers"];if(!i)throw new Error(t+" units is invalid");return e/i}function v(e){if(null==e)throw new Error("radians is required");return 180*(e%(2*Math.PI))/Math.PI}function _(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function y(e){return!!e&&e.constructor===Object}function C(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(e){if(!_(e))throw new Error("bbox must only contain numbers")})}function w(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(void 0===e?"undefined":_typeof2(e)))throw new Error("id must be a number or a string")}i.earthRadius=r,i.factors=o,i.unitsFactors=n,i.areaFactors=a,i.feature=s,i.geometry=function(e,t,i){if(!y(i=i||{}))throw new Error("options is invalid");var r,o=i.bbox;if(!e)throw new Error("type is required");if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");switch(o&&C(o),e){case"Point":r=l(t).geometry;break;case"LineString":r=c(t).geometry;break;case"Polygon":r=u(t).geometry;break;case"MultiPoint":r=m(t).geometry;break;case"MultiLineString":r=d(t).geometry;break;case"MultiPolygon":r=p(t).geometry;break;default:throw new Error(e+" is invalid")}return o&&(r.bbox=o),r},i.point=l,i.points=function(e,t,i){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");return h(e.map(function(e){return l(e,t)}),i)},i.polygon=u,i.polygons=function(e,t,i){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");return h(e.map(function(e){return u(e,t)}),i)},i.lineString=c,i.lineStrings=function(e,t,i){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");return h(e.map(function(e){return c(e,t)}),i)},i.featureCollection=h,i.multiLineString=d,i.multiPoint=m,i.multiPolygon=p,i.geometryCollection=function(e,t,i){if(!e)throw new Error("geometries is required");if(!Array.isArray(e))throw new Error("geometries must be an Array");return s({type:"GeometryCollection",geometries:e},t,i)},i.round=function(e,t){if(null==e||isNaN(e))throw new Error("num is required");if(t&&!(0<=t))throw new Error("precision must be a positive number");var i=Math.pow(10,t||0);return Math.round(e*i)/i},i.radiansToLength=g,i.lengthToRadians=f,i.lengthToDegrees=function(e,t){return v(f(e,t))},i.bearingToAzimuth=function(e){if(null==e)throw new Error("bearing is required");var t=e%360;return t<0&&(t+=360),t},i.radiansToDegrees=v,i.degreesToRadians=function(e){if(null==e)throw new Error("degrees is required");return e%360*Math.PI/180},i.convertLength=function(e,t,i){if(null==e)throw new Error("length is required");if(!(0<=e))throw new Error("length must be a positive number");return g(f(e,t),i||"kilometers")},i.convertArea=function(e,t,i){if(null==e)throw new Error("area is required");if(!(0<=e))throw new Error("area must be a positive number");var r=a[t||"meters"];if(!r)throw new Error("invalid original units");var o=a[i||"kilometers"];if(!o)throw new Error("invalid final units");return e/r*o},i.isNumber=_,i.isObject=y,i.validateBBox=C,i.validateId=w,i.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},i.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},i.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},i.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},i.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},i.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},i.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},{}],15:[function(e,t,i){var l=e("@turf/invariant");function u(e,t,i){var r=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var o=0,n=t.length-1;o<t.length;n=o++){var a=t[o][0],s=t[o][1],l=t[n][0],u=t[n][1];if(e[1]*(a-l)+s*(l-e[0])+u*(e[0]-a)==0&&(a-e[0])*(l-e[0])<=0&&(s-e[1])*(u-e[1])<=0)return!i;s>e[1]!=u>e[1]&&e[0]<(l-a)*(e[1]-s)/(u-s)+a&&(r=!r)}return r}t.exports=function(e,t){var i=l.getCoord(e),r=t.geometry.coordinates;"Polygon"===t.geometry.type&&(r=[r]);for(var o=0,n=!1;o<r.length&&!n;o++)if(u(i,r[o][0])){for(var a=!1,s=1;s<r[o].length&&!a;)u(i,r[o][s],!0)&&(a=!0),s++;a||(n=!0)}return n}},{"@turf/invariant":16}],16:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=e("@turf/helpers");i.getCoord=function(e){if(!e)throw new Error("coord is required");if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates;if(Array.isArray(e)&&2<=e.length&&void 0===e[0].length&&void 0===e[1].length)return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")},i.getCoords=function(e){if(!e)throw new Error("coords is required");if("Feature"===e.type&&null!==e.geometry)return e.geometry.coordinates;if(e.coordinates)return e.coordinates;if(Array.isArray(e))return e;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")},i.containsNumber=function e(t){if(1<t.length&&r.isNumber(t[0])&&r.isNumber(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return e(t[0]);throw new Error("coordinates must only contain numbers")},i.geojsonType=function(e,t,i){if(!t||!i)throw new Error("type and name required");if(!e||e.type!==t)throw new Error("Invalid input to "+i+": must be a "+t+", given "+e.type)},i.featureOf=function(e,t,i){if(!e)throw new Error("No feature passed");if(!i)throw new Error(".featureOf() requires a name");if(!e||"Feature"!==e.type||!e.geometry)throw new Error("Invalid input to "+i+", Feature with geometry required");if(!e.geometry||e.geometry.type!==t)throw new Error("Invalid input to "+i+": must be a "+t+", given "+e.geometry.type)},i.collectionOf=function(e,t,i){if(!e)throw new Error("No featureCollection passed");if(!i)throw new Error(".collectionOf() requires a name");if(!e||"FeatureCollection"!==e.type)throw new Error("Invalid input to "+i+", FeatureCollection required");for(var r=0;r<e.features.length;r++){var o=e.features[r];if(!o||"Feature"!==o.type||!o.geometry)throw new Error("Invalid input to "+i+", Feature with geometry required");if(!o.geometry||o.geometry.type!==t)throw new Error("Invalid input to "+i+": must be a "+t+", given "+o.geometry.type)}},i.getGeom=function(e){if(!e)throw new Error("geojson is required");if(void 0!==e.geometry)return e.geometry;if(e.coordinates||e.geometries)return e;throw new Error("geojson must be a valid Feature or Geometry Object")},i.getGeomType=function(){throw new Error("invariant.getGeomType has been deprecated in v5.0 in favor of invariant.getType")},i.getType=function(e,t){if(!e)throw new Error((t||"geojson")+" is required");if(e.geometry&&e.geometry.type)return e.geometry.type;if(e.type)return e.type;throw new Error((t||"geojson")+" is invalid")}},{"@turf/helpers":14}],17:[function(e,t,i){var r=e("@turf/helpers"),o=e("@turf/meta"),n=e("@turf/line-segment"),v=e("@turf/invariant").getCoords,a=e("geojson-rbush"),_=r.point,s=r.featureCollection,l=o.featureEach;function u(e,t){var i=v(e),r=v(t);if(2!==i.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==r.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=i[0][0],n=i[0][1],a=i[1][0],s=i[1][1],l=r[0][0],u=r[0][1],c=r[1][0],h=r[1][1],d=(h-u)*(a-o)-(c-l)*(s-n),m=(c-l)*(n-u)-(h-u)*(o-l),p=(a-o)*(n-u)-(s-n)*(o-l);if(0===d)return null;var g=m/d,f=p/d;return 0<=g&&g<=1&&0<=f&&f<=1?_([o+g*(a-o),n+g*(s-n)]):null}t.exports=function(e,t){var r=[];if("LineString"===e.geometry.type&&"LineString"===t.geometry.type&&2===e.geometry.coordinates.length&&2===t.geometry.coordinates.length){var i=u(e,t);return i&&r.push(i),s(r)}var o=a();return o.load(n(t)),l(n(e),function(i){l(o.search(i),function(e){var t=u(i,e);t&&r.push(t)})}),s(r)}},{"@turf/helpers":18,"@turf/invariant":19,"@turf/line-segment":22,"@turf/meta":20,"geojson-rbush":41}],18:[function(e,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],19:[function(e,t,i){arguments[4][5][0].apply(i,arguments)},{dup:5}],20:[function(e,t,i){function _(e,t,i){var r,o,n,a,s,l,u,c,h,d,m=0,p=0,g="FeatureCollection"===e.type,f="Feature"===e.type,v=g?e.features.length:1;for(r=0;r<v;r++)for(u=(d="GeometryCollection"===(h=g?e.features[r].geometry:f?e.geometry:e).type)?h.geometries.length:1,a=0;a<u;a++)if(c=(l=d?h.geometries[a]:h).coordinates,m=!i||"Polygon"!==l.type&&"MultiPolygon"!==l.type?0:1,"Point"===l.type)t(c,p),p++;else if("LineString"===l.type||"MultiPoint"===l.type)for(o=0;o<c.length;o++)t(c[o],p),p++;else if("Polygon"===l.type||"MultiLineString"===l.type)for(o=0;o<c.length;o++)for(n=0;n<c[o].length-m;n++)t(c[o][n],p),p++;else if("MultiPolygon"===l.type)for(o=0;o<c.length;o++)for(n=0;n<c[o].length;n++)for(s=0;s<c[o][n].length-m;s++)t(c[o][n][s],p),p++;else{if("GeometryCollection"!==l.type)throw new Error("Unknown Geometry Type");for(o=0;o<l.geometries.length;o++)_(l.geometries[o],t,i)}}function n(e,t){var i;switch(e.type){case"FeatureCollection":for(i=0;i<e.features.length;i++)t(e.features[i].properties,i);break;case"Feature":t(e.properties,0)}}function a(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var i=0;i<e.features.length;i++)t(e.features[i],i)}function s(e,t){var i,r,o,n,a,s,l,u=0,c="FeatureCollection"===e.type,h="Feature"===e.type,d=c?e.features.length:1;for(i=0;i<d;i++)for(a=(l="GeometryCollection"===(s=c?e.features[i].geometry:h?e.geometry:e).type)?s.geometries.length:1,o=0;o<a;o++)if("Point"===(n=l?s.geometries[o]:s).type||"LineString"===n.type||"MultiPoint"===n.type||"Polygon"===n.type||"MultiLineString"===n.type||"MultiPolygon"===n.type)t(n,u),u++;else{if("GeometryCollection"!==n.type)throw new Error("Unknown Geometry Type");for(r=0;r<n.geometries.length;r++)t(n.geometries[r],u),u++}}t.exports={coordEach:_,coordReduce:function(e,i,r,t){var o=r;return _(e,function(e,t){o=0===t&&void 0===r?e:i(o,e,t)},t),o},propEach:n,propReduce:function(e,i,r){var o=r;return n(e,function(e,t){o=0===t&&void 0===r?e:i(o,e,t)}),o},featureEach:a,featureReduce:function(e,i,r){var o=r;return a(e,function(e,t){o=0===t&&void 0===r?e:i(o,e,t)}),o},coordAll:function(e){var t=[];return _(e,function(e){t.push(e)}),t},geomEach:s,geomReduce:function(e,i,r){var o=r;return s(e,function(e,t){o=0===t&&void 0===r?e:i(o,e,t)}),o}}},{}],21:[function(e,t,i){"use strict";var s=e("@turf/meta"),l=e("@turf/invariant"),u=e("@turf/helpers");function v(e){var t=e[0],i=e[1];return[i[0]-t[0],i[1]-t[1]]}function _(e,t){return e[0]*t[1]-t[0]*e[1]}function y(e,t){return i=t,0!==_(v(e),v(i))&&(o=t,h=(r=e)[0],d=v(r),m=o[0],p=v(o),g=_(d,p),f=_((a=h,[(n=m)[0]-a[0],n[1]-a[1]]),p),s=h,l=[(u=f/g)*(c=d)[0],u*c[1]],[s[0]+l[0],s[1]+l[1]]);var i,r,o,n,a,s,l,u,c,h,d,m,p,g,f}function r(e,t,i){if(i=i||{},!u.isObject(i))throw new Error("options is invalid");var r=i.units;if(!e)throw new Error("geojson is required");if(null==t||isNaN(t))throw new Error("distance is required");var o=l.getType(e),n=e.properties;switch(o){case"LineString":return c(e,t,r);case"MultiLineString":var a=[];return s.flattenEach(e,function(e){a.push(c(e,t,r).geometry.coordinates)}),u.multiLineString(a,n);default:throw new Error("geometry "+o+" is not supported")}}function c(e,t,i){var m=[],p=u.lengthToDegrees(t,i),g=l.getCoords(e),f=[];return g.forEach(function(e,t){if(t!==g.length-1){var i=(n=e,a=g[t+1],s=p,l=Math.sqrt((n[0]-a[0])*(n[0]-a[0])+(n[1]-a[1])*(n[1]-a[1])),u=n[0]+s*(a[1]-n[1])/l,c=a[0]+s*(a[1]-n[1])/l,h=n[1]+s*(n[0]-a[0])/l,d=a[1]+s*(n[0]-a[0])/l,[[u,h],[c,d]]);if(m.push(i),0<t){var r=m[t-1],o=y(i,r);!1!==o&&(r[1]=o,i[0]=o),f.push(r[0]),t===g.length-2&&(f.push(i[0]),f.push(i[1]))}2===g.length&&(f.push(i[0]),f.push(i[1]))}var n,a,s,l,u,c,h,d}),u.lineString(f,e.properties)}t.exports=r,t.exports.default=r},{"@turf/helpers":14,"@turf/invariant":16,"@turf/meta":28}],22:[function(e,t,i){var n=e("@turf/flatten"),a=e("@turf/meta").featureEach,h=e("@turf/helpers").lineString,s=e("@turf/helpers").featureCollection,l=e("@turf/invariant").getCoords;t.exports=function(e){var r=[],o=0;return a(e,function(e){a(n(e),function(i){var e=[];switch(i.geometry?i.geometry.type:i.type){case"Polygon":e=l(i);break;case"LineString":e=[l(i)]}e.forEach(function(e){var t,u,c;(t=e,u=i.properties,c=[],t.reduce(function(e,t){var i,r,o,n,a,s,l=h([e,t],u);return l.bbox=(r=t,o=(i=e)[0],n=i[1],a=r[0],s=r[1],[o<a?o:a,n<s?n:s,a<o?o:a,s<n?n:s]),c.push(l),t}),c).forEach(function(e){e.id=o,r.push(e),o++})})})}),s(r)}},{"@turf/flatten":23,"@turf/helpers":24,"@turf/invariant":25,"@turf/meta":26}],23:[function(e,t,i){var u=e("@turf/meta").featureEach,c=e("@turf/meta").geomEach,h=e("@turf/invariant").getCoords,r=e("@turf/helpers"),d=r.point,m=r.lineString,p=r.polygon,g=r.featureCollection;function f(e){var i,t,r,o,n,a,s,l;switch(e.geometry?e.geometry.type:e.type){case"MultiPoint":return l=[],h(s=e).forEach(function(e){l.push(d(e,s.properties))}),g(l);case"MultiPolygon":return a=[],h(n=e).forEach(function(e){a.push(p(e,n.properties))}),g(a);case"MultiLineString":return o=[],h(r=e).forEach(function(e){o.push(m(e,r.properties))}),g(o);case"FeatureCollection":return t=[],u(e,function(e){switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":u(f(e),function(e){t.push(e)});break;default:t.push(e)}}),g(t);case"GeometryCollection":return i=[],c(e,function(e){switch(e.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":u(f(e),function(e){i.push(e)});break;default:var t={type:"Feature",properties:{},geometry:e};i.push(t)}}),g(i);case"Point":case"LineString":case"Polygon":return g([e])}}t.exports=f},{"@turf/helpers":24,"@turf/invariant":25,"@turf/meta":26}],24:[function(e,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],25:[function(e,t,i){arguments[4][5][0].apply(i,arguments)},{dup:5}],26:[function(e,t,i){arguments[4][20][0].apply(i,arguments)},{dup:20}],27:[function(e,t,i){var m=e("@turf/meta").featureEach,o=e("rbush"),l=e("@turf/bbox"),p=e("@turf/helpers"),u=e("@turf/union");function g(e){if(e.features.length<=1)return e;var t,i,r,n=(t=e,i=o(),r=[],m(t,function(e,t){var i=l(e);r.push({minX:i[0],minY:i[1],maxX:i[2],maxY:i[3],geojson:e,index:t})}),i.load(r),i),a=[],s={};return m(e,function(e,t){if(s[t])return!0;for(n.remove({index:t},c),s[t]=!0;;){var i=l(e),r=n.search({minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]});if(0<r.length){var o=r.map(function(e){return s[e.index]=!0,n.remove({index:e.index},c),e.geojson});o.push(e),e=u.apply(this,o)}if(0===r.length)break}a.push(e)}),p.featureCollection(a)}function c(e,t){return e.index===t.index}t.exports=function(e,t){var i,r,o,n,a,s,l,u=(r=(i=t)&&i.geometry.coordinates||[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]],p.polygon(r)),c=(o=[],n=[],m(e,function(e){var t;"MultiPolygon"===e.geometry.type&&(t=[],e.geometry.coordinates.forEach(function(e){t.push(p.polygon(e))}),e=p.featureCollection(t)),m(e,function(e){var t=e.geometry.coordinates,i=t[0],r=t.slice(1);o.push(p.polygon([i])),r.forEach(function(e){n.push(p.polygon([e]))})})}),[p.featureCollection(o),p.featureCollection(n)]),h=c[0],d=c[1];return h=g(h),d=g(d),a=h,s=d,(l=[]).push(u.geometry.coordinates[0]),m(a,function(e){l.push(e.geometry.coordinates[0])}),m(s,function(e){l.push(e.geometry.coordinates[0])}),p.polygon(l)}},{"@turf/bbox":6,"@turf/helpers":14,"@turf/meta":28,"@turf/union":33,rbush:47}],28:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var d=e("@turf/helpers");function b(e,t,i){if(null!==e)for(var r,o,n,a,s,l,u,c,h=0,d=0,m=e.type,p="FeatureCollection"===m,g="Feature"===m,f=p?e.features.length:1,v=0;v<f;v++){s=(c=!!(u=p?e.features[v].geometry:g?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var _=0;_<s;_++){var y=0,C=0;if(null!==(a=c?u.geometries[_]:u)){l=a.coordinates;var w=a.type;switch(h=!i||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===t(l,d,v,y,C))return!1;d++,y++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],d,v,y,C))return!1;d++,"MultiPoint"===w&&y++}"LineString"===w&&y++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(o=0;o<l[r].length-h;o++){if(!1===t(l[r][o],d,v,y,C))return!1;d++}"MultiLineString"===w&&y++,"Polygon"===w&&C++}"Polygon"===w&&y++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for("MultiPolygon"===w&&(C=0),o=0;o<l[r].length;o++){for(n=0;n<l[r][o].length-h;n++){if(!1===t(l[r][o][n],d,v,y,C))return!1;d++}C++}y++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===b(a.geometries[r],t,i))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function n(e,t){var i;switch(e.type){case"FeatureCollection":for(i=0;i<e.features.length&&!1!==t(e.features[i].properties,i);i++);break;case"Feature":t(e.properties,0)}}function a(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var i=0;i<e.features.length&&!1!==t(e.features[i],i);i++);}function r(e,t){var i,r,o,n,a,s,l,u,c,h,d=0,m="FeatureCollection"===e.type,p="Feature"===e.type,g=m?e.features.length:1;for(i=0;i<g;i++){for(s=m?e.features[i].geometry:p?e.geometry:e,u=m?e.features[i].properties:p?e.properties:{},c=m?e.features[i].bbox:p?e.bbox:void 0,h=m?e.features[i].id:p?e.id:void 0,a=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,o=0;o<a;o++)if(null!==(n=l?s.geometries[o]:s))switch(n.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(n,d,u,c,h))return!1;break;case"GeometryCollection":for(r=0;r<n.geometries.length;r++)if(!1===t(n.geometries[r],d,u,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,d,u,c,h))return!1;d++}}function s(e,u){r(e,function(e,t,i,r,o){var n,a=null===e?null:e.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==u(d.feature(e,i,{bbox:r,id:o}),t,0)&&void 0}switch(a){case"MultiPoint":n="Point";break;case"MultiLineString":n="LineString";break;case"MultiPolygon":n="Polygon"}for(var s=0;s<e.coordinates.length;s++){var l={type:n,coordinates:e.coordinates[s]};if(!1===u(d.feature(l,i),t,s))return!1}})}function o(e,h){s(e,function(a,s,l){var u=0;if(a.geometry){var c,e=a.geometry.type;if("Point"!==e&&"MultiPoint"!==e)return!1!==b(a,function(e,t,i,r,o){if(void 0!==c){var n=d.lineString([c,e],a.properties);if(!1===h(n,s,l,o,u))return!1;u++,c=e}else c=e})&&void 0}})}function l(e,a){if(!e)throw new Error("geojson is required");s(e,function(e,t,i){if(null!==e.geometry){var r=e.geometry.type,o=e.geometry.coordinates;switch(r){case"LineString":if(!1===a(e,t,i,0,0))return!1;break;case"Polygon":for(var n=0;n<o.length;n++)if(!1===a(d.lineString(o[n],e.properties),t,i,n))return!1}}})}i.coordEach=b,i.coordReduce=function(e,n,a,t){var s=a;return b(e,function(e,t,i,r,o){s=0===t&&void 0===a?e:n(s,e,t,i,r,o)},t),s},i.propEach=n,i.propReduce=function(e,i,r){var o=r;return n(e,function(e,t){o=0===t&&void 0===r?e:i(o,e,t)}),o},i.featureEach=a,i.featureReduce=function(e,i,r){var o=r;return a(e,function(e,t){o=0===t&&void 0===r?e:i(o,e,t)}),o},i.coordAll=function(e){var t=[];return b(e,function(e){t.push(e)}),t},i.geomEach=r,i.geomReduce=function(e,n,a){var s=a;return r(e,function(e,t,i,r,o){s=0===t&&void 0===a?e:n(s,e,t,i,r,o)}),s},i.flattenEach=s,i.flattenReduce=function(e,r,o){var n=o;return s(e,function(e,t,i){n=0===t&&0===i&&void 0===o?e:r(n,e,t,i)}),n},i.segmentEach=o,i.segmentReduce=function(e,n,a){var s=a,l=!1;return o(e,function(e,t,i,r,o){s=!1===l&&void 0===a?e:n(s,e,t,i,r,o),l=!0}),s},i.lineEach=l,i.lineReduce=function(e,o,n){var a=n;return l(e,function(e,t,i,r){a=0===t&&void 0===n?e:o(a,e,t,i,r)}),a},i.findSegment=function(e,t){if(t=t||{},!d.isObject(t))throw new Error("options is invalid");var i,r=t.featureIndex||0,o=t.multiFeatureIndex||0,n=t.geometryIndex||0,a=t.segmentIndex||0,s=t.properties;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,i=e.features[r].geometry;break;case"Feature":s=s||e.properties,i=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":i=e;break;default:throw new Error("geojson is invalid")}if(null===i)return null;var l=i.coordinates;switch(i.type){case"Point":case"MultiPoint":return null;case"LineString":return a<0&&(a=l.length+a-1),d.lineString([l[a],l[a+1]],s,t);case"Polygon":return n<0&&(n=l.length+n),a<0&&(a=l[n].length+a-1),d.lineString([l[n][a],l[n][a+1]],s,t);case"MultiLineString":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a-1),d.lineString([l[o][a],l[o][a+1]],s,t);case"MultiPolygon":return o<0&&(o=l.length+o),n<0&&(n=l[o].length+n),a<0&&(a=l[o][n].length-a-1),d.lineString([l[o][n][a],l[o][n][a+1]],s,t)}throw new Error("geojson is invalid")},i.findPoint=function(e,t){if(t=t||{},!d.isObject(t))throw new Error("options is invalid");var i,r=t.featureIndex||0,o=t.multiFeatureIndex||0,n=t.geometryIndex||0,a=t.coordIndex||0,s=t.properties;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,i=e.features[r].geometry;break;case"Feature":s=s||e.properties,i=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":i=e;break;default:throw new Error("geojson is invalid")}if(null===i)return null;var l=i.coordinates;switch(i.type){case"Point":return d.point(l,s,t);case"MultiPoint":return o<0&&(o=l.length+o),d.point(l[o],s,t);case"LineString":return a<0&&(a=l.length+a),d.point(l[a],s,t);case"Polygon":return n<0&&(n=l.length+n),a<0&&(a=l[n].length+a),d.point(l[n][a],s,t);case"MultiLineString":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a),d.point(l[o][a],s,t);case"MultiPolygon":return o<0&&(o=l.length+o),n<0&&(n=l[o].length+n),a<0&&(a=l[o][n].length-a),d.point(l[o][n][a],s,t)}throw new Error("geojson is invalid")}},{"@turf/helpers":14}],29:[function(e,t,i){var a=e("@turf/invariant").getCoords,r=e("@turf/helpers"),o=r.lineString,n=r.multiLineString,s=r.featureCollection;function l(e,t){return 1<e.length?n(e,t):o(e[0],t)}t.exports=function(e){var t,i=(t=e).geometry?t.geometry.type:t.type,r=a(e),o=e.properties;if(!r.length)throw new Error("polygon must contain coordinates");switch(i){case"Polygon":return s([l(r,o)]);case"MultiPolygon":var n=[];return r.forEach(function(e){n.push(l(e,o))}),s(n);default:throw new Error("geom "+i+" not supported")}}},{"@turf/helpers":30,"@turf/invariant":31}],30:[function(e,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],31:[function(e,t,i){arguments[4][5][0].apply(i,arguments)},{dup:5}],32:[function(e,t,i){var a=e("simplify-js"),o=["LineString","MultiLineString","Polygon","MultiPolygon"];function n(e,t,i){return"LineString"===e.geometry.type?{type:"LineString",coordinates:r(e.geometry.coordinates,t,i)}:"MultiLineString"===e.geometry.type?{type:"MultiLineString",coordinates:e.geometry.coordinates.map(function(e){return r(e,t,i)})}:"Polygon"===e.geometry.type?{type:"Polygon",coordinates:l(e.geometry.coordinates,t,i)}:"MultiPolygon"===e.geometry.type?{type:"MultiPolygon",coordinates:e.geometry.coordinates.map(function(e){return l(e,t,i)})}:e}function s(e,t){return{type:"Feature",geometry:e,properties:t}}function r(e,t,i){return a(e.map(function(e){return{x:e[0],y:e[1],z:e[2]}}),t,i).map(function(e){return e.z?[e.x,e.y,e.z]:[e.x,e.y]})}function l(e,o,n){return e.map(function(e){var t=e.map(function(e){return{x:e[0],y:e[1]}});if(t.length<4)throw new Error("Invalid polygon");for(var i,r=a(t,o,n).map(function(e){return[e.x,e.y]});(i=r).length<3||3===i.length&&i[2][0]===i[0][0]&&i[2][1]===i[0][1];)r=a(t,o-=.01*o,n).map(function(e){return[e.x,e.y]});return r[r.length-1][0]===r[0][0]&&r[r.length-1][1]===r[0][1]||r.push(r[0]),r})}t.exports=function(e,i,r){return"Feature"===e.type?s(n(e,i,r),e.properties):"FeatureCollection"===e.type?{type:"FeatureCollection",features:e.features.map(function(e){var t=n(e,i,r);return-1<o.indexOf(t.type)?s(t,e.properties):t})}:"GeometryCollection"===e.type?{type:"GeometryCollection",geometries:e.geometries.map(function(e){return-1<o.indexOf(e.type)?n({type:"Feature",geometry:e},i,r):e})}:e}},{"simplify-js":53}],33:[function(e,t,i){var r=e("jsts");t.exports=function(){for(var e=new r.io.GeoJSONReader,t=e.read(JSON.stringify(arguments[0].geometry)),i=1;i<arguments.length;i++)t=t.union(e.read(JSON.stringify(arguments[i].geometry)));return{type:"Feature",geometry:t=(new r.io.GeoJSONWriter).write(t),properties:arguments[0].properties}}},{jsts:43}],34:[function(e,t,i){var n=e("@turf/inside"),a=e("@turf/helpers").featureCollection;t.exports=function(e,t){for(var i=a([]),r=0;r<t.features.length;r++)for(var o=0;o<e.features.length;o++){n(e.features[o],t.features[r])&&i.features.push(e.features[o])}return i}},{"@turf/helpers":14,"@turf/inside":15}],35:[function(e,t,i){"use strict";t.exports=function(e){var t=e.length;if(0===t)return[];if(1===t)return[0];for(var i=e[0].length,r=[e[0]],o=[0],n=1;n<t;++n)if(r.push(e[n]),a(r,i)){if(o.push(n),o.length===i+1)return o}else r.pop();return o};var s=e("robust-orientation");function a(e,t){for(var i=new Array(t+1),r=0;r<e.length;++r)i[r]=e[r];for(r=0;r<=e.length;++r){for(var o=e.length;o<=t;++o){for(var n=new Array(t),a=0;a<t;++a)n[a]=Math.pow(o+1-r,a);i[o]=n}if(s.apply(void 0,i))return!0}return!1}},{"robust-orientation":48}],36:[function(e,t,i){"use strict";function r(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}i.INT_BITS=32,i.INT_MAX=2147483647,i.INT_MIN=-1<<31,i.sign=function(e){return(0<e)-(e<0)},i.abs=function(e){var t=e>>31;return(e^t)-t},i.min=function(e,t){return t^(e^t)&-(e<t)},i.max=function(e,t){return e^(e^t)&-(e<t)},i.isPow2=function(e){return!(e&e-1||!e)},i.log2=function(e){var t,i;return t=(65535<e)<<4,t|=i=(255<(e>>>=t))<<3,t|=i=(15<(e>>>=i))<<2,(t|=i=(3<(e>>>=i))<<1)|(e>>>=i)>>1},i.log10=function(e){return 1e9<=e?9:1e8<=e?8:1e7<=e?7:1e6<=e?6:1e5<=e?5:1e4<=e?4:1e3<=e?3:100<=e?2:10<=e?1:0},i.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},i.countTrailingZeros=r,i.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1},i.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},i.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var o=new Array(256);!function(e){for(var t=0;t<256;++t){var i=t,r=t,o=7;for(i>>>=1;i;i>>>=1)r<<=1,r|=1&i,--o;e[t]=r<<o&255}}(o),i.reverse=function(e){return o[255&e]<<24|o[e>>>8&255]<<16|o[e>>>16&255]<<8|o[e>>>24&255]},i.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},i.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},i.interleave3=function(e,t,i){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(i=1227133513&((i=3272356035&((i=251719695&((i=4278190335&((i&=1023)|i<<16))|i<<8))|i<<4))|i<<2))<<2},i.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},i.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},{}],37:[function(e,t,i){"use strict";var r=e("./lib/ch1d"),o=e("./lib/ch2d"),n=e("./lib/chnd");t.exports=function(e){var t=e.length;{if(0===t)return[];if(1===t)return[[0]]}var i=e[0].length;{if(0===i)return[];if(1===i)return r(e);if(2===i)return o(e)}return n(e,i)}},{"./lib/ch1d":38,"./lib/ch2d":39,"./lib/chnd":40}],38:[function(e,t,i){"use strict";t.exports=function(e){for(var t=0,i=0,r=1;r<e.length;++r)e[r][0]<e[t][0]&&(t=r),e[r][0]>e[i][0]&&(i=r);return t<i?[[t],[i]]:i<t?[[i],[t]]:[[t]]}},{}],39:[function(e,t,i){"use strict";t.exports=function(e){var t=s(e),i=t.length;if(i<=2)return[];for(var r=new Array(i),o=t[i-1],n=0;n<i;++n){var a=t[n];r[n]=[o,a],o=a}return r};var s=e("monotone-convex-hull-2d")},{"monotone-convex-hull-2d":45}],40:[function(e,t,i){"use strict";t.exports=function(t,i){try{return a(t,!0)}catch(e){var r=s(t);if(r.length<=i)return[];var o=function(e,t){for(var i=e.length,r=new Array(i),o=0;o<t.length;++o)r[o]=e[t[o]];for(var n=t.length,o=0;o<i;++o)t.indexOf(o)<0&&(r[n++]=e[o]);return r}(t,r),n=a(o,!0);return function(e,t){for(var i=e.length,r=t.length,o=0;o<i;++o)for(var n=e[o],a=0;a<n.length;++a){var s=n[a];if(s<r)n[a]=t[s];else{s-=r;for(var l=0;l<r;++l)s>=t[l]&&(s+=1);n[a]=s}}return e}(n,r)}};var a=e("incremental-convex-hull"),s=e("affine-hull")},{"affine-hull":35,"incremental-convex-hull":42}],41:[function(e,t,i){var r=e("@turf/bbox"),o=e("@turf/helpers").featureCollection,n=e("@turf/meta").featureEach,a=e("rbush");t.exports=function(e){var t=a(e);return t.insert=function(e){return e.bbox=e.bbox?e.bbox:r(e),a.prototype.insert.call(this,e)},t.load=function(e){var t=[];return n(e,function(e){e.bbox=e.bbox?e.bbox:r(e),t.push(e)}),a.prototype.load.call(this,t)},t.remove=function(e){return a.prototype.remove.call(this,e)},t.clear=function(){return a.prototype.clear.call(this)},t.search=function(e){var t=a.prototype.search.call(this,this.toBBox(e));return o(t)},t.collides=function(e){return a.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=a.prototype.all.call(this);return o(e)},t.toJSON=function(){return a.prototype.toJSON.call(this)},t.fromJSON=function(e){return a.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var t=e.bbox?e.bbox:r(e);return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},t}},{"@turf/bbox":6,"@turf/helpers":14,"@turf/meta":28,rbush:47}],42:[function(e,t,i){"use strict";t.exports=function(e,t){var i=e.length;if(0===i)throw new Error("Must have at least d+1 points");var r=e[0].length;if(i<=r)throw new Error("Must input at least d+1 points");var o=e.slice(0,r+1),n=C.apply(void 0,o);if(0===n)throw new Error("Input not in general position");for(var a=new Array(r+1),s=0;s<=r;++s)a[s]=s;n<0&&(a[0]=1,a[1]=0);for(var l=new A(a,new Array(r+1),!1),u=l.adjacent,c=new Array(r+2),s=0;s<=r;++s){for(var h=a.slice(),d=0;d<=r;++d)d===s&&(h[d]=-1);var m=h[0];h[0]=h[1],h[1]=m;var p=new A(h,new Array(r+1),!0);u[s]=p,c[s]=p}c[r+1]=l;for(var s=0;s<=r;++s)for(var h=u[s].vertices,g=u[s].adjacent,d=0;d<=r;++d){var f=h[d];if(f<0)g[d]=l;else for(var v=0;v<=r;++v)u[v].vertices.indexOf(f)<0&&(g[d]=u[v])}for(var _=new w(r,o,c),y=!!t,s=r+1;s<i;++s)_.insert(e[s],y);return _.boundary()};var C=e("robust-orientation"),r=e("simplicial-complex").compareCells;function A(e,t,i){this.vertices=e,this.adjacent=t,this.boundary=i,this.lastVisited=-1}function R(e,t,i){this.vertices=e,this.cell=t,this.index=i}function O(e,t){return r(e.vertices,t.vertices)}A.prototype.flip=function(){var e=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=e;var t=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=t};var n=[];function w(e,t,i){this.dimension=e,this.vertices=t,this.simplices=i,this.interior=i.filter(function(e){return!e.boundary}),this.tuple=new Array(e+1);for(var r=0;r<=e;++r)this.tuple[r]=this.vertices[r];var o=n[e];o||(o=n[e]=function(e){for(var t=["function orient(){var tuple=this.tuple;return test("],i=0;i<=e;++i)0<i&&t.push(","),t.push("tuple[",i,"]");t.push(")}return orient");var r=new Function("test",t.join("")),o=C[e+1];return o||(o=C),r(o)}(e)),this.orient=o}var o=w.prototype;o.handleBoundaryDegeneracy=function(e,t){var i=this.dimension,r=this.vertices.length-1,o=this.tuple,n=this.vertices,a=[e];for(e.lastVisited=-r;0<a.length;){(e=a.pop()).vertices;for(var s=e.adjacent,l=0;l<=i;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-r)){for(var c=u.vertices,h=0;h<=i;++h){var d=c[h];o[h]=d<0?t:n[d]}var m=this.orient();if(0<m)return u;u.lastVisited=-r,0===m&&a.push(u)}}}return null},o.walk=function(e,t){var i=this.vertices.length-1,r=this.dimension,o=this.vertices,n=this.tuple,a=t?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[a];e:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=r;++c)n[c]=o[l[c]];s.lastVisited=i;for(c=0;c<=r;++c){var h=u[c];if(!(h.lastVisited>=i)){var d=n[c];n[c]=e;var m=this.orient();if(n[c]=d,m<0){s=h;continue e}h.boundary?h.lastVisited=-i:h.lastVisited=i}}return}return s},o.addPeaks=function(e,t){var i=this.vertices.length-1,r=this.dimension,o=this.vertices,n=this.tuple,a=this.interior,s=this.simplices,l=[t];t.lastVisited=i,t.vertices[t.vertices.indexOf(-1)]=i,t.boundary=!1,a.push(t);for(var u=[];0<l.length;){var c=(t=l.pop()).vertices,h=t.adjacent,d=c.indexOf(i);if(!(d<0))for(var m=0;m<=r;++m)if(m!==d){var p=h[m];if(p.boundary&&!(p.lastVisited>=i)){var g=p.vertices;if(p.lastVisited!==-i){for(var f=0,v=0;v<=r;++v)g[v]<0?n[f=v]=e:n[v]=o[g[v]];if(0<this.orient()){g[f]=i,p.boundary=!1,a.push(p),l.push(p),p.lastVisited=i;continue}p.lastVisited=-i}var _=p.adjacent,y=c.slice(),C=h.slice(),w=new A(y,C,!0);s.push(w);var b=_.indexOf(t);if(!(b<0)){_[b]=w,C[d]=p,y[m]=-1,C[m]=t,(h[m]=w).flip();for(v=0;v<=r;++v){var E=y[v];if(!(E<0||E===i)){for(var S=new Array(r-1),P=0,x=0;x<=r;++x){var T=y[x];T<0||x===v||(S[P++]=T)}u.push(new R(S,w,v))}}}}}}u.sort(O);for(m=0;m+1<u.length;m+=2){var I=u[m],D=u[m+1],L=I.index,M=D.index;L<0||M<0||(I.cell.adjacent[I.index]=D.cell,D.cell.adjacent[D.index]=I.cell)}},o.insert=function(e,t){var i=this.vertices;i.push(e);var r=this.walk(e,t);if(r){for(var o=this.dimension,n=this.tuple,a=0;a<=o;++a){var s=r.vertices[a];n[a]=s<0?e:i[s]}var l=this.orient(n);l<0||(0!==l||(r=this.handleBoundaryDegeneracy(r,e)))&&this.addPeaks(e,r)}},o.boundary=function(){for(var e=this.dimension,t=[],i=this.simplices,r=i.length,o=0;o<r;++o){var n=i[o];if(n.boundary){for(var a=new Array(e),s=n.vertices,l=0,u=0,c=0;c<=e;++c)0<=s[c]?a[l++]=s[c]:u=1&c;if(u===(1&e)){var h=a[0];a[0]=a[1],a[1]=h}t.push(a)}}return t}},{"robust-orientation":48,"simplicial-complex":52}],43:[function(e,t,i){var r,o;r=this,o=function(e){"use strict";function t(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}function r(){}function h(){}function _(){}function i(){}function o(){}function n(){}function a(){}function y(e){this.name="RuntimeException",this.message=e,this.stack=(new Error).stack,Error.call(this,e)}function s(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e}function l(){if(0===arguments.length)y.call(this);else if(1===arguments.length){var e=arguments[0];y.call(this,e)}}function m(){}function C(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)C.call(this,0,0);else if(1===arguments.length){var e=arguments[0];C.call(this,e.x,e.y,e.z)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];C.call(this,t,i,C.NULL_ORDINATE)}else if(3===arguments.length){var r=arguments[0],o=arguments[1],n=arguments[2];this.x=r,this.y=o,this.z=n}}function u(){if(this.dimensionsToTest=2,0===arguments.length)u.call(this,2);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new h("only 2 or 3 dimensions may be specified");this.dimensionsToTest=e}}function c(){}function f(){}function d(e){this.message=e||""}function v(){}function p(e){this.message=e||""}function g(e){this.message=e||""}function w(){this.array_=[],arguments[0]instanceof f&&this.addAll(arguments[0])}function b(){if(w.apply(this),0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.ensureCapacity(e.length),this.add(e,!0)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.ensureCapacity(t.length),this.add(t,i)}}function E(){if(this.minx=null,this.maxx=null,this.miny=null,this.maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof C){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof E){var t=arguments[0];this.init(t)}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.init(i.x,r.x,i.y,r.y)}else if(4===arguments.length){var o=arguments[0],n=arguments[1],a=arguments[2],s=arguments[3];this.init(o,n,a,s)}}function S(){}function P(){S.call(this,"Projective point not representable on the Cartesian plane.")}function x(){}function T(e,t){return e.interfaces_&&-1<e.interfaces_().indexOf(t)}function I(){}function D(e){this.str=e}function L(e){this.value=e}function M(){}function A(){if(this.hi=0,(this.lo=0)===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof A){var t=arguments[0];this.init(t)}else if("string"==typeof arguments[0]){var i=arguments[0];A.call(this,A.parse(i))}}else if(2===arguments.length){var r=arguments[0],o=arguments[1];this.init(r,o)}}function R(){}function O(){}function N(){}function V(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],i=arguments[1];this.x=t,this.y=i,this.w=1}else if(arguments[0]instanceof V&&arguments[1]instanceof V){var r=arguments[0],o=arguments[1];this.x=r.y*o.w-o.y*r.w,this.y=o.x*r.w-r.x*o.w,this.w=r.x*o.y-o.x*r.y}else if(arguments[0]instanceof C&&arguments[1]instanceof C){var n=arguments[0],a=arguments[1];this.x=n.y-a.y,this.y=a.x-n.x,this.w=n.x*a.y-a.x*n.y}}else if(3===arguments.length){var s=arguments[0],l=arguments[1],u=arguments[2];this.x=s,this.y=l,this.w=u}else if(4===arguments.length){var c=arguments[0],h=arguments[1],d=arguments[2],m=arguments[3],p=c.y-h.y,g=h.x-c.x,f=c.x*h.y-h.x*c.y,v=d.y-m.y,_=m.x-d.x,y=d.x*m.y-m.x*d.y;this.x=g*y-_*f,this.y=v*f-p*y,this.w=p*_-v*g}}function F(){}function H(){}function G(){this.envelope=null,this.factory=null,this.SRID=null,this.userData=null;var e=arguments[0];this.factory=e,this.SRID=e.getSRID()}function k(){}function B(){}function j(){}function z(){}function W(){}function U(){}function q(){}function Y(){}function X(){}function J(){}function Q(){}function K(){}function $(){this.array_=[],arguments[0]instanceof f&&this.addAll(arguments[0])}function Z(e){return null==e?Hn:e.color}function ee(e){return null==e?null:e.parent}function te(e,t){null!==e&&(e.color=t)}function ie(e){return null==e?null:e.left}function re(e){return null==e?null:e.right}function oe(){this.root_=null,this.size_=0}function ne(){}function ae(){}function se(){this.array_=[],arguments[0]instanceof f&&this.addAll(arguments[0])}function le(){}function ue(){}function ce(){}function he(){}function de(){this.geometries=null;var e=arguments[0],t=arguments[1];if(G.call(this,t),null===e&&(e=[]),G.hasNullElements(e))throw new h("geometries must not contain null elements");this.geometries=e}function me(){var e=arguments[0],t=arguments[1];de.call(this,e,t)}function pe(){if(this.geom=null,this.geomFact=null,this.bnRule=null,this.endpointMap=null,1===arguments.length){var e=arguments[0];pe.call(this,e,B.MOD2_BOUNDARY_RULE)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.geom=t,this.geomFact=t.getFactory(),this.bnRule=i}}function ge(){this.count=null}function fe(){}function ve(){}function _e(){}function ye(){}function Ce(){}function we(){}function be(){}function Ee(){this.points=null;var e=arguments[0],t=arguments[1];G.call(this,t),this.init(e)}function Se(){}function Pe(){this.coordinates=null;var e=arguments[0],t=arguments[1];G.call(this,t),this.init(e)}function xe(){}function Te(){this.shell=null,this.holes=null;var e=arguments[0],t=arguments[1],i=arguments[2];if(G.call(this,i),null===e&&(e=this.getFactory().createLinearRing()),null===t&&(t=[]),G.hasNullElements(t))throw new h("holes must not contain null elements");if(e.isEmpty()&&G.hasNonEmptyElements(t))throw new h("shell is empty but holes are not");this.shell=e,this.holes=t}function Ie(){var e=arguments[0],t=arguments[1];de.call(this,e,t)}function De(){if(arguments[0]instanceof C&&arguments[1]instanceof ze){var e=arguments[0],t=arguments[1];De.call(this,t.getCoordinateSequenceFactory().create(e),t)}else if(T(arguments[0],O)&&arguments[1]instanceof ze){var i=arguments[0],r=arguments[1];Ee.call(this,i,r),this.validateConstruction()}}function Le(){var e=arguments[0],t=arguments[1];de.call(this,e,t)}function Me(){if(this.factory=null,this.isUserDataCopied=!1,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.factory=e}}function Ae(){}function Re(){}function Oe(){}function Ne(){}function Ve(){if(this.dimension=3,this.coordinates=null,1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];Ve.call(this,e,3)}else if(Number.isInteger(arguments[0])){var t=arguments[0];this.coordinates=new Array(t).fill(null);for(var i=0;i<t;i++)this.coordinates[i]=new C}else if(T(arguments[0],O)){var r=arguments[0];if(null===r)return this.coordinates=new Array(0).fill(null),null;this.dimension=r.getDimension(),this.coordinates=new Array(r.size()).fill(null);for(i=0;i<this.coordinates.length;i++)this.coordinates[i]=r.getCoordinateCopy(i)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var o=arguments[0],n=arguments[1];this.coordinates=o,this.dimension=n,null===o&&(this.coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var a=arguments[0],s=arguments[1];this.coordinates=new Array(a).fill(null),this.dimension=s;for(i=0;i<a;i++)this.coordinates[i]=new C}}function Fe(){}function He(i,r,o){var n=[0],a=!1;return i.push(n),{next:function(){var e,t=n[0];return!a&&t<r.length?(e=o?[r[t],o[t]]:r[t],n[0]++):(a=!0,i.splice(i.indexOf(n),1)),{done:a,value:e}}}}function Ge(){return this._values.length}function ke(){this.map_=new zn}function Be(){if(this.modelType=null,this.scale=null,0===arguments.length)this.modelType=Be.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof je){var e=arguments[0];(this.modelType=e)===Be.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var t=arguments[0];this.modelType=Be.FIXED,this.setScale(t)}else if(arguments[0]instanceof Be){var i=arguments[0];this.modelType=i.modelType,this.scale=i.scale}}function je(){this.name=null;var e=arguments[0];this.name=e,je.nameToTypeMap.put(e,this)}function ze(){if(this.precisionModel=null,this.coordinateSequenceFactory=null,this.SRID=null,0===arguments.length)ze.call(this,new Be,0);else if(1===arguments.length){if(T(arguments[0],F)){var e=arguments[0];ze.call(this,new Be,0,e)}else if(arguments[0]instanceof Be){var t=arguments[0];ze.call(this,t,0,ze.getDefaultCoordinateSequenceFactory())}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];ze.call(this,i,r,ze.getDefaultCoordinateSequenceFactory())}else if(3===arguments.length){var o=arguments[0],n=arguments[1],a=arguments[2];this.precisionModel=o,this.coordinateSequenceFactory=a,this.SRID=n}}function We(e){this.geometryFactory=e||new ze}function Ue(e){this.parser=new We(e)}function qe(){this.result=null,this.inputLines=Array(2).fill().map(function(){return Array(2)}),this.intPt=new Array(2).fill(null),this.intLineIndex=null,this._isProper=null,this.pa=null,this.pb=null,this.precisionModel=null,this.intPt[0]=new C,this.intPt[1]=new C,this.pa=this.intPt[0],this.pb=this.intPt[1],this.result=0}function Ye(){qe.apply(this)}function Xe(){}function Je(){this.p=null,this.crossingCount=0,this.isPointOnSegment=!1;var e=arguments[0];this.p=e}function Qe(){}function Ke(){if(this.p0=null,this.p1=null,0===arguments.length)Ke.call(this,new C,new C);else if(1===arguments.length){var e=arguments[0];Ke.call(this,e.p0,e.p1)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.p0=t,this.p1=i}else if(4===arguments.length){var r=arguments[0],o=arguments[1],n=arguments[2],a=arguments[3];Ke.call(this,new C(r,o),new C(n,a))}}function $e(){if(this.matrix=null,0===arguments.length)this.matrix=Array(3).fill().map(function(){return Array(3)}),this.setAll(ue.FALSE);else if(1===arguments.length)if("string"==typeof arguments[0]){var e=arguments[0];$e.call(this),this.set(e)}else if(arguments[0]instanceof $e){var t=arguments[0];$e.call(this),this.matrix[x.INTERIOR][x.INTERIOR]=t.matrix[x.INTERIOR][x.INTERIOR],this.matrix[x.INTERIOR][x.BOUNDARY]=t.matrix[x.INTERIOR][x.BOUNDARY],this.matrix[x.INTERIOR][x.EXTERIOR]=t.matrix[x.INTERIOR][x.EXTERIOR],this.matrix[x.BOUNDARY][x.INTERIOR]=t.matrix[x.BOUNDARY][x.INTERIOR],this.matrix[x.BOUNDARY][x.BOUNDARY]=t.matrix[x.BOUNDARY][x.BOUNDARY],this.matrix[x.BOUNDARY][x.EXTERIOR]=t.matrix[x.BOUNDARY][x.EXTERIOR],this.matrix[x.EXTERIOR][x.INTERIOR]=t.matrix[x.EXTERIOR][x.INTERIOR],this.matrix[x.EXTERIOR][x.BOUNDARY]=t.matrix[x.EXTERIOR][x.BOUNDARY],this.matrix[x.EXTERIOR][x.EXTERIOR]=t.matrix[x.EXTERIOR][x.EXTERIOR]}}function Ze(){this.areaBasePt=null,this.triangleCent3=new C,this.areasum2=0,this.cg3=new C,this.lineCentSum=new C,this.totalLength=0,this.ptCount=0,this.ptCentSum=new C;var e=arguments[0];this.areaBasePt=null,this.add(e)}function et(e){this.message=e||""}function tt(){this.array_=[]}function it(){this.treeSet=new se,this.list=new w}function rt(){if(this.geomFactory=null,this.inputPts=null,1===arguments.length){var e=arguments[0];rt.call(this,rt.extractCoordinates(e),e.getFactory())}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.inputPts=it.filterCoordinates(t),this.geomFactory=i}}function ot(){this.origin=null;var e=arguments[0];this.origin=e}function nt(){this.inputGeom=null,this.factory=null,this.pruneEmptyGeometry=!0,this.preserveGeometryCollectionType=!0,this.preserveCollections=!1,this.preserveType=!1}function at(){if(this.snapTolerance=0,this.srcPts=null,this.seg=new Ke,this.allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Ee&&"number"==typeof arguments[1]){var e=arguments[0],t=arguments[1];at.call(this,e.getCoordinates(),t)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var i=arguments[0],r=arguments[1];this.srcPts=i,this._isClosed=at.isClosed(i),this.snapTolerance=r}}function st(){this.srcGeom=null;var e=arguments[0];this.srcGeom=e}function lt(){if(nt.apply(this),this.snapTolerance=null,this.snapPts=null,this.isSelfSnap=!1,2===arguments.length){var e=arguments[0],t=arguments[1];this.snapTolerance=e,this.snapPts=t}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this.snapTolerance=i,this.snapPts=r,this.isSelfSnap=o}}function ut(){this.isFirst=!0,this.commonMantissaBitsCount=53,this.commonBits=0,this.commonSignExp=null}function ct(){this.commonCoord=null,this.ccFilter=new ht}function ht(){this.commonBitsX=new ut,this.commonBitsY=new ut}function dt(){this.trans=null;var e=arguments[0];this.trans=e}function mt(){this.parent=null,this.atStart=null,this.max=null,this.index=null,this.subcollectionIterator=null;var e=arguments[0];this.parent=e,this.atStart=!0,this.index=0,this.max=e.getNumGeometries()}function pt(){if(this.boundaryRule=B.OGC_SFS_BOUNDARY_RULE,this.isIn=null,this.numBoundaries=null,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(null===e)throw new h("Rule must be non-null");this.boundaryRule=e}}function gt(){}function ft(){}function vt(){this.pts=null,this.data=null;var e=arguments[0],t=arguments[1];this.pts=e,this.data=t}function _t(){}function yt(){this.bounds=null,this.item=null;var e=arguments[0],t=arguments[1];this.bounds=e,this.item=t}function Ct(){this._size=null,this.items=null,this._size=0,this.items=new w,this.items.add(null)}function wt(){}function bt(){}function Et(){if(this.childBoundables=new w,this.bounds=null,this.level=null,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.level=e}}function St(){this.boundable1=null,this.boundable2=null,this._distance=null,this.itemDistance=null;var e=arguments[0],t=arguments[1],i=arguments[2];this.boundable1=e,this.boundable2=t,this.itemDistance=i,this._distance=this.distance()}function Pt(){if(this.root=null,this.built=!1,this.itemBoundables=new w,this.nodeCapacity=null,0===arguments.length)Pt.call(this,Pt.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var e=arguments[0];m.isTrue(1<e,"Node capacity must be greater than 1"),this.nodeCapacity=e}}function xt(){}function Tt(){if(0===arguments.length)Tt.call(this,Tt.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var e=arguments[0];Pt.call(this,e)}}function It(){var e=arguments[0];Et.call(this,e)}function Dt(){}function Lt(){this.segString=null,this.coord=null,this.segmentIndex=null,this.segmentOctant=null,this._isInterior=null;var e=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3];this.segString=e,this.coord=new C(t),this.segmentIndex=i,this.segmentOctant=r,this._isInterior=!t.equals2D(e.getCoordinate(i))}function Mt(){this.nodeMap=new oe,this.edge=null;var e=arguments[0];this.edge=e}function At(){this.nodeList=null,this.edge=null,this.nodeIt=null,this.currNode=null,this.nextNode=null;var e=arguments[this.currSegIndex=0];this.nodeList=e,this.edge=e.getEdge(),this.nodeIt=e.iterator(),this.readNextNode()}function Rt(){}function Ot(){this.nodeList=new Mt(this),this.pts=null,this.data=null;var e=arguments[0],t=arguments[1];this.pts=e,this.data=t}function Nt(){this.tempEnv1=new E,this.tempEnv2=new E,this.overlapSeg1=new Ke,this.overlapSeg2=new Ke}function Vt(){this.pts=null,this.start=null,this.end=null,this.env=null,this.context=null,this.id=null;var e=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3];this.pts=e,this.start=t,this.end=i,this.context=r}function Ft(){}function Ht(){}function Gt(){}function kt(){if(this.segInt=null,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setSegmentIntersector(e)}}function Bt(){if(this.monoChains=new w,this.index=new Tt,this.idCounter=0,this.nodedSegStrings=null,(this.nOverlaps=0)===arguments.length);else if(1===arguments.length){var e=arguments[0];kt.call(this,e)}}function jt(){Nt.apply(this),this.si=null;var e=arguments[0];this.si=e}function zt(){if(this.pt=null,1===arguments.length){var e=arguments[0];y.call(this,e)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];y.call(this,zt.msgWithCoord(t,i)),this.name="TopologyException",this.pt=new C(i)}}function Wt(){}function Ut(){this.findAllIntersections=!1,this.isCheckEndSegmentsOnly=!1,this.li=null,this.interiorIntersection=null,this.intSegments=null,this.intersections=new w,this.intersectionCount=0,this.keepIntersections=!0;var e=arguments[0];this.li=e,this.interiorIntersection=null}function qt(){this.li=new Ye,this.segStrings=null,this.findAllIntersections=!1,this.segInt=null,this._isValid=!0;var e=arguments[0];this.segStrings=e}function Yt(){this.nv=null;var e=arguments[0];this.nv=new qt(Yt.toSegmentStrings(e))}function Xt(){this.mapOp=null;var e=arguments[0];this.mapOp=e}function Jt(){}function Qt(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var t=arguments[0];this.init(1),this.location[Jt.ON]=t}else if(arguments[0]instanceof Qt){var i=arguments[0];if(this.init(i.location.length),null!==i)for(var r=0;r<this.location.length;r++)this.location[r]=i.location[r]}}else if(3===arguments.length){var o=arguments[0],n=arguments[1],a=arguments[2];this.init(3),this.location[Jt.ON]=o,this.location[Jt.LEFT]=n,this.location[Jt.RIGHT]=a}}function Kt(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Qt(e),this.elt[1]=new Qt(e)}else if(arguments[0]instanceof Kt){var t=arguments[0];this.elt[0]=new Qt(t.elt[0]),this.elt[1]=new Qt(t.elt[1])}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.elt[0]=new Qt(x.NONE),this.elt[1]=new Qt(x.NONE),this.elt[i].setLocation(r)}else if(3===arguments.length){var o=arguments[0],n=arguments[1],a=arguments[2];this.elt[0]=new Qt(o,n,a),this.elt[1]=new Qt(o,n,a)}else if(4===arguments.length){var s=arguments[0],l=arguments[1],u=arguments[2],c=arguments[3];this.elt[0]=new Qt(x.NONE,x.NONE,x.NONE),this.elt[1]=new Qt(x.NONE,x.NONE,x.NONE),this.elt[s].setLocations(l,u,c)}}function $t(){this.startDe=null,this.maxNodeDegree=-1,this.edges=new w,this.pts=new w,this.label=new Kt(x.NONE),this.ring=null,this._isHole=null,this.shell=null,this.holes=new w,this.geometryFactory=null;var e=arguments[0],t=arguments[1];this.geometryFactory=t,this.computePoints(e),this.computeRing()}function Zt(){var e=arguments[0],t=arguments[1];$t.call(this,e,t)}function ei(){var e=arguments[0],t=arguments[1];$t.call(this,e,t)}function ti(){if(this.label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.label=e}}function ii(){ti.apply(this),this.coord=null,this.edges=null;var e=arguments[0],t=arguments[1];this.coord=e,this.edges=t,this.label=new Kt(0,x.NONE)}function ri(){this.nodeMap=new oe,this.nodeFact=null;var e=arguments[0];this.nodeFact=e}function oi(){if(this.edge=null,this.label=null,this.node=null,this.p0=null,this.p1=null,this.dx=null,this.dy=null,this.quadrant=null,1===arguments.length){var e=arguments[0];this.edge=e}else if(3===arguments.length){var t=arguments[0],i=arguments[1],r=arguments[2];oi.call(this,t,i,r,null)}else if(4===arguments.length){var o=arguments[0],n=arguments[1],a=arguments[2],s=arguments[3];oi.call(this,o),this.init(n,a),this.label=s}}function ni(){this._isForward=null,this._isInResult=!1,this._isVisited=!1,this.sym=null,this.next=null,this.nextMin=null,this.edgeRing=null,this.minEdgeRing=null,this.depth=[0,-999,-999];var e=arguments[0],t=arguments[1];if(oi.call(this,e),this._isForward=t)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var i=e.getNumPoints()-1;this.init(e.getCoordinate(i),e.getCoordinate(i-1))}this.computeDirectedLabel()}function ai(){}function si(){if(this.edges=new w,this.nodes=null,this.edgeEndList=new w,0===arguments.length)this.nodes=new ri(new ai);else if(1===arguments.length){var e=arguments[0];this.nodes=new ri(e)}}function li(){this.geometryFactory=null,this.shellList=new w;var e=arguments[0];this.geometryFactory=e}function ui(){this.op=null,this.geometryFactory=null,this.ptLocator=null,this.lineEdgesList=new w,this.resultLineList=new w;var e=arguments[0],t=arguments[1],i=arguments[2];this.op=e,this.geometryFactory=t,this.ptLocator=i}function ci(){this.op=null,this.geometryFactory=null,this.resultPointList=new w;var e=arguments[0],t=arguments[1];arguments[2],this.op=e,this.geometryFactory=t}function hi(){}function di(){this.geom=null;var e=arguments[0];this.geom=e}function mi(){this.edgeMap=new oe,this.edgeList=null,this.ptInAreaLocation=[x.NONE,x.NONE]}function pi(){mi.apply(this),this.resultAreaEdgeList=null,this.label=null,this.SCANNING_FOR_INCOMING=1,this.LINKING_TO_OUTGOING=2}function gi(){ai.apply(this)}function fi(){this.mce=null,this.chainIndex=null;var e=arguments[0],t=arguments[1];this.mce=e,this.chainIndex=t}function vi(){if(this.label=null,this.xValue=null,this.eventType=null,this.insertEvent=null,this.deleteEventIndex=null,this.obj=null,2===arguments.length){var e=arguments[0],t=arguments[1];this.eventType=vi.DELETE,this.xValue=e,this.insertEvent=t}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this.eventType=vi.INSERT,this.label=i,this.xValue=r,this.obj=o}}function _i(){}function yi(){this._hasIntersection=!1,this.hasProper=!1,this.hasProperInterior=!1,this.properIntersectionPoint=null,this.li=null,this.includeProper=null,this.recordIsolated=null,this.isSelfIntersection=null,this.numIntersections=0,this.numTests=0,this.bdyNodes=null,this._isDone=!1,this.isDoneWhenProperInt=!1;var e=arguments[0],t=arguments[1],i=arguments[2];this.li=e,this.includeProper=t,this.recordIsolated=i}function Ci(){_i.apply(this),this.events=new w,this.nOverlaps=null}function wi(){this.min=_.POSITIVE_INFINITY,this.max=_.NEGATIVE_INFINITY}function bi(){}function Ei(){wi.apply(this),this.item=null;var e=arguments[0],t=arguments[1],i=arguments[2];this.min=e,this.max=t,this.item=i}function Si(){wi.apply(this),this.node1=null,this.node2=null;var e=arguments[0],t=arguments[1];this.node1=e,this.node2=t,this.buildExtent(this.node1,this.node2)}function Pi(){this.leaves=new w,this.root=null,this.level=0}function xi(){if(this.lines=null,this.isForcedToLineString=!1,1===arguments.length){var e=arguments[0];this.lines=e}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.lines=t,this.isForcedToLineString=i}}function Ti(){this.items=new w}function Ii(){this.index=null;var e=arguments[0];if(!T(e,xe))throw new h("Argument must be Polygonal");this.index=new Li(e)}function Di(){this.counter=null;var e=arguments[0];this.counter=e}function Li(){this.index=new Pi;var e=arguments[0];this.init(e)}function Mi(){this.coord=null,this.segmentIndex=null,this.dist=null;var e=arguments[0],t=arguments[1],i=arguments[2];this.coord=new C(e),this.segmentIndex=t,this.dist=i}function Ai(){this.nodeMap=new oe,this.edge=null;var e=arguments[0];this.edge=e}function Ri(){}function Oi(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new E,this.env2=new E;var e=arguments[0];this.e=e,this.pts=e.getCoordinates();var t=new Ri;this.startIndex=t.getChainStartIndices(this.pts)}function Ni(){this.depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var t=0;t<3;t++)this.depth[e][t]=Ni.NULL_VALUE}function Vi(){if(ti.apply(this),this.pts=null,this.env=null,this.eiList=new Ai(this),this.name=null,this.mce=null,this._isIsolated=!0,this.depth=new Ni,this.depthDelta=0,1===arguments.length){var e=arguments[0];Vi.call(this,e,null)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.pts=t,this.label=i}}function Fi(){if(si.apply(this),this.parentGeom=null,this.lineEdgeMap=new ke,this.boundaryNodeRule=null,this.useBoundaryDeterminationRule=!0,this.argIndex=null,this.boundaryNodes=null,this._hasTooFewPoints=!1,this.invalidPoint=null,this.areaPtLocator=null,this.ptLocator=new pt,2===arguments.length){var e=arguments[0],t=arguments[1];Fi.call(this,e,t,B.OGC_SFS_BOUNDARY_RULE)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this.argIndex=i,this.parentGeom=r,this.boundaryNodeRule=o,null!==r&&this.add(r)}}function Hi(){if(this.li=new Ye,this.resultPrecisionModel=null,this.arg=null,1===arguments.length){var e=arguments[0];this.setComputationPrecision(e.getPrecisionModel()),this.arg=new Array(1).fill(null),this.arg[0]=new Fi(0,e)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];Hi.call(this,t,i,B.OGC_SFS_BOUNDARY_RULE)}else if(3===arguments.length){var r=arguments[0],o=arguments[1],n=arguments[2];0<=r.getPrecisionModel().compareTo(o.getPrecisionModel())?this.setComputationPrecision(r.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this.arg=new Array(2).fill(null),this.arg[0]=new Fi(0,r,n),this.arg[1]=new Fi(1,o,n)}}function Gi(){this.pts=null,this._orientation=null;var e=arguments[0];this.pts=e,this._orientation=Gi.orientation(e)}function ki(){this.edges=new w,this.ocaMap=new oe}function Bi(){this.ptLocator=new pt,this.geomFact=null,this.resultGeom=null,this.graph=null,this.edgeList=new ki,this.resultPolyList=new w,this.resultLineList=new w,this.resultPointList=new w;var e=arguments[0],t=arguments[1];Hi.call(this,e,t),this.graph=new si(new gi),this.geomFact=e.getFactory()}function ji(){this.geom=new Array(2).fill(null),this.snapTolerance=null,this.cbr=null;var e=arguments[0],t=arguments[1];this.geom[0]=e,this.geom[1]=t,this.computeSnapTolerance()}function zi(){this.geom=new Array(2).fill(null);var e=arguments[0],t=arguments[1];this.geom[0]=e,this.geom[1]=t}function Wi(){this.factory=null,this.interiorPoint=null;var e=arguments[this.maxWidth=0];this.factory=e.getFactory(),this.add(e)}function Ui(){this.poly=null,this.centreY=null,this.hiY=_.MAX_VALUE,this.loY=-_.MAX_VALUE;var e=arguments[0];this.poly=e,this.hiY=e.getEnvelopeInternal().getMaxY(),this.loY=e.getEnvelopeInternal().getMinY(),this.centreY=Wi.avg(this.loY,this.hiY)}function qi(){this.centroid=null,this.minDistance=_.MAX_VALUE,this.interiorPoint=null;var e=arguments[0];this.centroid=e.getCentroid().getCoordinate(),this.addInterior(e),null===this.interiorPoint&&this.addEndpoints(e)}function Yi(){this.centroid=null,this.minDistance=_.MAX_VALUE,this.interiorPoint=null;var e=arguments[0];this.centroid=e.getCentroid().getCoordinate(),this.add(e)}function Xi(){this.tempEnv1=new E,this.selectedSegment=new Ke}function Ji(){this.items=new w,this.subnode=[null,null]}function Qi(){if(this.min=null,this.max=null,0===arguments.length)this.min=0,this.max=0;else if(1===arguments.length){var e=arguments[0];this.init(e.min,e.max)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.init(t,i)}}function Ki(){}function $i(){this.pt=0,this.level=0,this.interval=null;var e=arguments[0];this.computeKey(e)}function Zi(){Ji.apply(this),this.interval=null,this.centre=null,this.level=null;var e=arguments[0],t=arguments[1];this.interval=e,this.level=t,this.centre=(e.getMin()+e.getMax())/2}function er(){}function tr(){Ji.apply(this)}function ir(){this.root=null,this.minExtent=1,this.root=new tr}function rr(){}function or(){this.ring=null,this.tree=null,this.crossings=0,this.interval=new Qi;var e=arguments[0];this.ring=e,this.buildIndex()}function nr(){Xi.apply(this),this.mcp=null,this.p=null;var e=arguments[0],t=arguments[1];this.mcp=e,this.p=t}function ar(){}function sr(){this.p0=null,this.p1=null,this.p2=null;var e=arguments[0],t=arguments[1],i=arguments[2];this.p0=e,this.p1=t,this.p2=i}function lr(){this.input=null,this.extremalPts=null,this.centre=null;var e=arguments[this.radius=0];this.input=e}function ur(){if(this.inputGeom=null,this.isConvex=null,this.convexHullPts=null,this.minBaseSeg=new Ke,this.minWidthPt=null,this.minPtIndex=null,this.minWidth=0,1===arguments.length){var e=arguments[0];ur.call(this,e,!1)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.inputGeom=t,this.isConvex=i}}function cr(){this.inputGeom=null,this.distanceTolerance=null;var e=arguments[0];this.inputGeom=e}function hr(){nt.apply(this),this.distanceTolerance=null;var e=arguments[0];this.distanceTolerance=e}function dr(){this._orig=null,this._sym=null,this._next=null;var e=arguments[0];this._orig=e}function mr(){this._isMarked=!1;var e=arguments[0];dr.call(this,e)}function pr(){this.vertexMap=new ke}function gr(){this._isStart=!1;var e=arguments[0];mr.call(this,e)}function fr(){pr.apply(this)}function vr(){this.result=null,this.factory=null,this.graph=null,this.lines=new w,this.nodeEdgeStack=new tt,this.ringStartEdge=null,this.graph=new fr}function _r(){this.items=new w,this.subnode=new Array(4).fill(null)}function yr(){this.pt=new C,this.level=0,this.env=null;var e=arguments[0];this.computeKey(e)}function Cr(){_r.apply(this),this.env=null,this.centrex=null,this.centrey=null,this.level=null;var e=arguments[0],t=arguments[1];this.env=e,this.level=t,this.centrex=(e.getMinX()+e.getMaxX())/2,this.centrey=(e.getMinY()+e.getMaxY())/2}function wr(){_r.apply(this)}function br(){this.root=null,this.minExtent=1,this.root=new wr}function Er(e){this.geometryFactory=e||new ze}function Sr(e){this.geometryFactory=e||new ze,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Er(this.geometryFactory)}function Pr(){this.parser=new Er(this.geometryFactory)}function xr(e){this.geometryFactory=e||new ze,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new We(this.geometryFactory)}function Tr(e){return[e.x,e.y]}function Ir(e,t){this.geometryFactory=e||new ze,this.ol=t||"undefined"!=typeof ol&&ol}function Dr(){if(this.noder=null,this.scaleFactor=null,this.offsetX=null,this.offsetY=null,this.isScaled=!1,2===arguments.length){var e=arguments[0],t=arguments[1];Dr.call(this,e,t,0,0)}else if(4===arguments.length){var i=arguments[0],r=arguments[1];arguments[2],arguments[3],this.noder=i,this.scaleFactor=r,this.isScaled=!this.isIntegerPrecision()}}function Lr(){if(this.inputGeom=null,this.isClosedEndpointsInInterior=!0,this.nonSimpleLocation=null,1===arguments.length){var e=arguments[0];this.inputGeom=e}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.inputGeom=t,this.isClosedEndpointsInInterior=!i.isInBoundary(2)}}function Mr(){this.pt=null,this.isClosed=null,this.degree=null;var e=arguments[0];this.pt=e,this.isClosed=!1,this.degree=0}function Ar(){if(this.quadrantSegments=Ar.DEFAULT_QUADRANT_SEGMENTS,this.endCapStyle=Ar.CAP_ROUND,this.joinStyle=Ar.JOIN_ROUND,this.mitreLimit=Ar.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this.simplifyFactor=Ar.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.setQuadrantSegments(t),this.setEndCapStyle(i)}else if(4===arguments.length){var r=arguments[0],o=arguments[1],n=arguments[2],a=arguments[3];this.setQuadrantSegments(r),this.setEndCapStyle(o),this.setJoinStyle(n),this.setMitreLimit(a)}}function Rr(){this.minIndex=-1,this.minCoord=null,this.minDe=null,this.orientedDe=null}function Or(){this.array_=[]}function Nr(){this.finder=null,this.dirEdgeList=new w,this.nodes=new w,this.rightMostCoord=null,this.env=null,this.finder=new Rr}function Vr(){this.inputLine=null,this.distanceTol=null,this.isDeleted=null,this.angleOrientation=Qe.COUNTERCLOCKWISE;var e=arguments[0];this.inputLine=e}function Fr(){this.ptList=null,this.precisionModel=null,this.minimimVertexDistance=0,this.ptList=new w}function Hr(){this.maxCurveSegmentError=0,this.filletAngleQuantum=null,this.closingSegLengthFactor=1,this.segList=null,this.distance=0,this.precisionModel=null,this.bufParams=null,this.li=null,this.s0=null,this.s1=null,this.s2=null,this.seg0=new Ke,this.seg1=new Ke,this.offset0=new Ke,this.offset1=new Ke,this.side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],t=arguments[1],i=arguments[2];this.precisionModel=e,this.bufParams=t,this.li=new Ye,this.filletAngleQuantum=Math.PI/2/t.getQuadrantSegments(),8<=t.getQuadrantSegments()&&t.getJoinStyle()===Ar.JOIN_ROUND&&(this.closingSegLengthFactor=Hr.MAX_CLOSING_SEG_LEN_FACTOR),this.init(i)}function Gr(){this.distance=0,this.precisionModel=null,this.bufParams=null;var e=arguments[0],t=arguments[1];this.precisionModel=e,this.bufParams=t}function kr(){this.subgraphs=null,this.seg=new Ke,this.cga=new Qe;var e=arguments[0];this.subgraphs=e}function Br(){this.upwardSeg=null,this.leftDepth=null;var e=arguments[0],t=arguments[1];this.upwardSeg=new Ke(e),this.leftDepth=t}function jr(){this.inputGeom=null,this.distance=null,this.curveBuilder=null,this.curveList=new w;var e=arguments[0],t=arguments[1],i=arguments[2];this.inputGeom=e,this.distance=t,this.curveBuilder=i}function zr(){this._hasIntersection=!1,this.hasProper=!1,this.hasProperInterior=!1,this.hasInterior=!1,this.properIntersectionPoint=null,this.li=null,this.isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0;var e=arguments[this.numTests=0];this.li=e}function Wr(){this.bufParams=null,this.workingPrecisionModel=null,this.workingNoder=null,this.geomFact=null,this.graph=null,this.edgeList=new ki;var e=arguments[0];this.bufParams=e}function Ur(){this.li=new Ye,this.segStrings=null;var e=arguments[0];this.segStrings=e}function qr(){this.li=null,this.pt=null,this.originalPt=null,this.ptScaled=null,this.p0Scaled=null,this.p1Scaled=null,this.scaleFactor=null,this.minx=null,this.maxx=null,this.miny=null,this.maxy=null,this.corner=new Array(4).fill(null),this.safeEnv=null;var e=arguments[0],t=arguments[1],i=arguments[2];if(this.originalPt=e,this.pt=e,this.scaleFactor=t,this.li=i,t<=0)throw new h("Scale factor must be non-zero");1!==t&&(this.pt=new C(this.scale(e.x),this.scale(e.y)),this.p0Scaled=new C,this.p1Scaled=new C),this.initCorners(this.pt)}function Yr(){this.index=null;var e=arguments[0];this.index=e}function Xr(){Xi.apply(this),this.hotPixel=null,this.parentEdge=null,this.hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],t=arguments[1],i=arguments[2];this.hotPixel=e,this.parentEdge=t,this.hotPixelVertexIndex=i}function Jr(){this.li=null,this.interiorIntersections=null;var e=arguments[0];this.li=e,this.interiorIntersections=new w}function Qr(){this.pm=null,this.li=null,this.scaleFactor=null,this.noder=null,this.pointSnapper=null,this.nodedSegStrings=null;var e=arguments[0];this.pm=e,this.li=new Ye,this.li.setPrecisionModel(e),this.scaleFactor=e.getScale()}function Kr(){if(this.argGeom=null,this.distance=null,this.bufParams=new Ar,this.resultGeometry=null,this.saveException=null,1===arguments.length){var e=arguments[0];this.argGeom=e}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.argGeom=t,this.bufParams=i}}function $r(){this.comps=null;var e=arguments[0];this.comps=e}function Zr(){if(this.component=null,this.segIndex=null,this.pt=null,2===arguments.length){var e=arguments[0],t=arguments[1];Zr.call(this,e,Zr.INSIDE_AREA,t)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this.component=i,this.segIndex=r,this.pt=o}}function eo(){this.pts=null;var e=arguments[0];this.pts=e}function to(){this.locations=null;var e=arguments[0];this.locations=e}function io(){if(this.geom=null,this.terminateDistance=0,this.ptLocator=new pt,this.minDistanceLocation=null,this.minDistance=_.MAX_VALUE,2===arguments.length){var e=arguments[0],t=arguments[1];io.call(this,e,t,0)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this.geom=new Array(2).fill(null),this.geom[0]=i,this.geom[1]=r,this.terminateDistance=o}}function ro(){this.factory=null,this.directedEdges=new w,this.coordinates=null;var e=arguments[0];this.factory=e}function oo(){this._isMarked=!1,this._isVisited=!1,this.data=null}function no(){oo.apply(this),this.parentEdge=null,this.from=null,this.to=null,this.p0=null,this.p1=null,this.sym=null,this.edgeDirection=null,this.quadrant=null,this.angle=null;var e=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3];this.from=e,this.to=t,this.edgeDirection=r,this.p0=e.getCoordinate(),this.p1=i;var o=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y;this.quadrant=Ft.quadrant(o,n),this.angle=Math.atan2(n,o)}function ao(){var e=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3];no.call(this,e,t,i,r)}function so(){if(oo.apply(this),this.dirEdge=null,0===arguments.length);else if(2===arguments.length){var e=arguments[0],t=arguments[1];this.setDirectedEdges(e,t)}}function lo(){this.outEdges=new w,this.sorted=!1}function uo(){if(oo.apply(this),this.pt=null,this.deStar=null,1===arguments.length){var e=arguments[0];uo.call(this,e,new lo)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.pt=t,this.deStar=i}}function co(){so.apply(this),this.line=null;var e=arguments[0];this.line=e}function ho(){this.nodeMap=new oe}function mo(){this.edges=new $,this.dirEdges=new $,this.nodeMap=new ho}function po(){mo.apply(this)}function go(){this.graph=new po,this.mergedLineStrings=null,this.factory=null,this.edgeStrings=null}function fo(){this.edgeRing=null,this.next=null,this.label=-1;var e=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3];no.call(this,e,t,i,r)}function vo(){so.apply(this),this.line=null;var e=arguments[0];this.line=e}function _o(){this.geometryFactory=new ze,this.geomGraph=null,this.disconnectedRingcoord=null;var e=arguments[0];this.geomGraph=e}function yo(){}function Co(){if(this.edgeEnds=new w,1===arguments.length){var e=arguments[0];Co.call(this,null,e)}else if(2===arguments.length){var t=(arguments[0],arguments[1]);oi.call(this,t.getEdge(),t.getCoordinate(),t.getDirectedCoordinate(),new Kt(t.getLabel())),this.insert(t)}}function wo(){mi.apply(this)}function bo(){var e=arguments[0],t=arguments[1];ii.call(this,e,t)}function Eo(){ai.apply(this)}function So(){this.nodes=new ri(new Eo)}function Po(){this.li=new Ye,this.geomGraph=null,this.nodeGraph=new So,this.invalidPoint=null;var e=arguments[0];this.geomGraph=e}function xo(){this.graph=null,this.rings=new w,this.totalEnv=new E,this.index=null,this.nestedPt=null;var e=arguments[0];this.graph=e}function To(){if(this.errorType=null,this.pt=null,1===arguments.length){var e=arguments[0];To.call(this,e,null)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.errorType=t,null!==i&&(this.pt=i.copy())}}function Io(){this.parentGeometry=null,this.isSelfTouchingRingFormingHoleValid=!1,this.validErr=null;var e=arguments[0];this.parentGeometry=e}function Do(){this.factory=null,this.deList=new w,this.lowestEdge=null,this.ring=null,this.ringPts=null,this.holes=null,this.shell=null,this._isHole=null,this._isProcessed=!1,this._isIncludedSet=!1,this._isIncluded=!1;var e=arguments[0];this.factory=e}function Lo(){}function Mo(){mo.apply(this),this.factory=null;var e=arguments[0];this.factory=e}function Ao(){if(this.lineStringAdder=new Ro(this),this.graph=null,this.dangles=new w,this.cutEdges=new w,this.invalidRingLines=new w,this.holeList=null,this.shellList=null,this.polyList=null,this.isCheckingRingsValid=!0,this.extractOnlyPolygonal=null,this.geomFactory=null,0===arguments.length)Ao.call(this,!1);else if(1===arguments.length){var e=arguments[0];this.extractOnlyPolygonal=e}}function Ro(){this.p=null;var e=arguments[0];this.p=e}function Oo(){this.li=new Ye,this.ptLocator=new pt,this.arg=null,this.nodes=new ri(new Eo),this.im=null,this.isolatedEdges=new w,this.invalidPoint=null;var e=arguments[0];this.arg=e}function No(){this.rectEnv=null;var e=arguments[0];this.rectEnv=e.getEnvelopeInternal()}function Vo(){this.li=new Ye,this.rectEnv=null,this.diagUp0=null,this.diagUp1=null,this.diagDown0=null,this.diagDown1=null;var e=arguments[0];this.rectEnv=e,this.diagUp0=new C(e.getMinX(),e.getMinY()),this.diagUp1=new C(e.getMaxX(),e.getMaxY()),this.diagDown0=new C(e.getMinX(),e.getMaxY()),this.diagDown1=new C(e.getMaxX(),e.getMinY())}function Fo(){this._isDone=!1}function Ho(){this.rectangle=null,this.rectEnv=null;var e=arguments[0];this.rectangle=e,this.rectEnv=e.getEnvelopeInternal()}function Go(){Fo.apply(this),this.rectEnv=null,this._intersects=!1;var e=arguments[0];this.rectEnv=e}function ko(){Fo.apply(this),this.rectSeq=null,this.rectEnv=null,this._containsPoint=!1;var e=arguments[0];this.rectSeq=e.getExteriorRing().getCoordinateSequence(),this.rectEnv=e.getEnvelopeInternal()}function Bo(){Fo.apply(this),this.rectEnv=null,this.rectIntersector=null,this.hasIntersection=!1,this.p0=new C,this.p1=new C;var e=arguments[0];this.rectEnv=e.getEnvelopeInternal(),this.rectIntersector=new Vo(this.rectEnv)}function jo(){if(this._relate=null,2===arguments.length){var e=arguments[0],t=arguments[1];Hi.call(this,e,t),this._relate=new Oo(this.arg)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];Hi.call(this,i,r,o),this._relate=new Oo(this.arg)}}function zo(){this.geomFactory=null,this.skipEmpty=!1,this.inputGeoms=null;var e=arguments[0];this.geomFactory=zo.extractFactory(e),this.inputGeoms=e}function Wo(){this.pointGeom=null,this.otherGeom=null,this.geomFact=null;var e=arguments[0],t=arguments[1];this.pointGeom=e,this.otherGeom=t,this.geomFact=t.getFactory()}function Uo(){this.sortIndex=-1,this.comps=null;var e=arguments[0],t=arguments[1];this.sortIndex=e,this.comps=t}function qo(){this.inputPolys=null,this.geomFactory=null;var e=arguments[0];this.inputPolys=e,null===this.inputPolys&&(this.inputPolys=new w)}function Yo(){if(this.polygons=new w,this.lines=new w,this.points=new w,this.geomFact=null,1===arguments.length){if(T(arguments[0],f)){var e=arguments[0];this.extract(e)}else if(arguments[0]instanceof G){var t=arguments[0];this.extract(t)}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.geomFact=r,this.extract(i)}}function Xo(){Me.CoordinateOperation.apply(this),this.targetPM=null,this.removeCollapsed=!0;var e=arguments[0],t=arguments[1];this.targetPM=e,this.removeCollapsed=t}function Jo(){this.targetPM=null,this.removeCollapsed=!0,this.changePrecisionModel=!1,this.isPointwise=!1;var e=arguments[0];this.targetPM=e}function Qo(){this.pts=null,this.usePt=null,this.distanceTolerance=null,this.seg=new Ke;var e=arguments[0];this.pts=e}function Ko(){this.inputGeom=null,this.distanceTolerance=null,this.isEnsureValidTopology=!0;var e=arguments[0];this.inputGeom=e}function $o(){nt.apply(this),this.isEnsureValidTopology=!0,this.distanceTolerance=null;var e=arguments[0],t=arguments[1];this.isEnsureValidTopology=e,this.distanceTolerance=t}function Zo(){if(this.parent=null,this.index=null,2===arguments.length){var e=arguments[0],t=arguments[1];Zo.call(this,e,t,null,-1)}else if(4===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],n=arguments[3];Ke.call(this,i,r),this.parent=o,this.index=n}}function en(){if(this.parentLine=null,this.segs=null,this.resultSegs=new w,this.minimumSize=null,1===arguments.length){var e=arguments[0];en.call(this,e,2)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.parentLine=t,this.minimumSize=i,this.init()}}function tn(){this.index=new br}function rn(){this.querySeg=null,this.items=new w;var e=arguments[0];this.querySeg=e}function on(){this.li=new Ye,this.inputIndex=new tn,this.outputIndex=new tn,this.line=null,this.linePts=null;var e=arguments[this.distanceTolerance=0],t=arguments[1];this.inputIndex=e,this.outputIndex=t}function nn(){this.inputIndex=new tn,this.outputIndex=new tn,this.distanceTolerance=0}function an(){this.inputGeom=null,this.lineSimplifier=new nn,this.linestringMap=null;var e=arguments[0];this.inputGeom=e}function sn(){nt.apply(this),this.linestringMap=null;var e=arguments[0];this.linestringMap=e}function ln(){this.tps=null;var e=arguments[0];this.tps=e}function un(){this.seg=null,this.segLen=null,this.splitPt=null;var e=arguments[this.minimumLen=0];this.seg=e,this.segLen=e.getLength()}function cn(){}function hn(){}function dn(){}function mn(){if(this.p=null,1===arguments.length){var e=arguments[0];this.p=new C(e)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.p=new C(t,i)}else if(3===arguments.length){var r=arguments[0],o=arguments[1],n=arguments[2];this.p=new C(r,o,n)}}function pn(){this._isOnConstraint=null,this.constraint=null;var e=arguments[0];mn.call(this,e)}function gn(){this._rot=null,this.vertex=null,this.next=null,this.data=null}function fn(){this.subdiv=null,this.isUsingTolerance=!1;var e=arguments[0];this.subdiv=e,this.isUsingTolerance=0<e.getTolerance()}function vn(){}function _n(){this.subdiv=null,this.lastEdge=null;var e=arguments[0];this.subdiv=e,this.init()}function yn(){if(this.seg=null,1===arguments.length){if("string"==typeof arguments[0]){var e=arguments[0];y.call(this,e)}else if(arguments[0]instanceof Ke){var t=arguments[0];y.call(this,"Locate failed to converge (at edge: "+t+"). Possible causes include invalid Subdivision topology or very close sites"),this.seg=new Ke(t)}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];y.call(this,yn.msgWithSpatial(i,r)),this.seg=new Ke(r)}}function Cn(){}function wn(){this.visitedKey=0,this.quadEdges=new w,this.startingEdge=null,this.tolerance=null,this.edgeCoincidenceTolerance=null,this.frameVertex=new Array(3).fill(null),this.frameEnv=null,this.locator=null,this.seg=new Ke,this.triEdges=new Array(3).fill(null);var e=arguments[0],t=arguments[1];this.tolerance=t,this.edgeCoincidenceTolerance=t/wn.EDGE_COINCIDENCE_TOL_FACTOR,this.createFrame(e),this.startingEdge=this.initSubdiv(),this.locator=new _n(this)}function bn(){}function En(){this.triList=new w}function Sn(){this.triList=new w}function Pn(){this.coordList=new b,this.triCoords=new w}function xn(){if(this.ls=null,this.data=null,2===arguments.length){var e=arguments[0],t=arguments[1];this.ls=new Ke(e,t)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this.ls=new Ke(i,r),this.data=o}else if(6===arguments.length){var n=arguments[0],a=arguments[1],s=arguments[2],l=arguments[3],u=arguments[4],c=arguments[5];xn.call(this,new C(n,a,s),new C(l,u,c))}else if(7===arguments.length){var h=arguments[0],d=arguments[1],m=arguments[2],p=arguments[3],g=arguments[4],f=arguments[5],v=arguments[6];xn.call(this,new C(h,d,m),new C(p,g,f),v)}}function Tn(){}function In(){if(this.p=null,this.data=null,this.left=null,this.right=null,this.count=null,2===arguments.length){var e=arguments[0],t=arguments[1];this.p=new C(e),this.left=null,this.right=null,this.count=1,this.data=t}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this.p=new C(i,r),this.left=null,this.right=null,this.count=1,this.data=o}}function Dn(){if(this.root=null,this.numberOfNodes=null,this.tolerance=null,0===arguments.length)Dn.call(this,0);else if(1===arguments.length){var e=arguments[0];this.tolerance=e}}function Ln(){this.tolerance=null,this.matchNode=null,this.matchDist=0,this.p=null;var e=arguments[0],t=arguments[1];this.p=e,this.tolerance=t}function Mn(){this.initialVertices=null,this.segVertices=null,this.segments=new w,this.subdiv=null,this.incDel=null,this.convexHull=null,this.splitFinder=new hn,this.kdt=null,this.vertexFactory=null,this.computeAreaEnv=null,this.splitPt=null,this.tolerance=null;var e=arguments[0],t=arguments[1];this.initialVertices=new w(e),this.tolerance=t,this.kdt=new Dn(t)}function An(){this.siteCoords=null,this.tolerance=0,this.subdiv=null}function Rn(){this.siteCoords=null,this.constraintLines=null,this.tolerance=0,this.subdiv=null,this.constraintVertexMap=new oe}function On(){this.siteCoords=null,this.tolerance=0,this.subdiv=null,this.clipEnv=null,this.diagramEnv=null}function Nn(){}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(e){if(null==this)throw new TypeError(this+" is not an object");var t=Object(this),i=Math.max(Math.min(t.length,9007199254740991),0)||0,r=1 in arguments&&parseInt(Number(arguments[1]),10)||0;r=r<0?Math.max(i+r,0):Math.min(r,i);var o=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:i;for(o=o<0?Math.max(i+arguments[2],0):Math.min(o,i);r<o;)t[r]=e,++r;return t},writable:!0}),Number.isFinite=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(e){return e!=e},Math.trunc=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)},t(r.prototype,{interfaces_:function(){return[]},getClass:function(){return r}}),r.equalsWithTolerance=function(e,t,i){return Math.abs(e-t)<=i},_.isNaN=function(e){return Number.isNaN(e)},_.doubleToLongBits=function(e){return e},_.longBitsToDouble=function(e){return e},_.isInfinite=function(e){return!Number.isFinite(e)},_.MAX_VALUE=Number.MAX_VALUE,(y.prototype=Object.create(Error.prototype)).constructor=Error,s(l,y),t(l.prototype,{interfaces_:function(){return[]},getClass:function(){return l}}),t(m.prototype,{interfaces_:function(){return[]},getClass:function(){return m}}),m.shouldNeverReachHere=function(){if(0===arguments.length)m.shouldNeverReachHere(null);else if(1===arguments.length){var e=arguments[0];throw new l("Should never reach here"+(null!==e?": "+e:""))}},m.isTrue=function(){if(1===arguments.length){var e=arguments[0];m.isTrue(e,null)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];if(!t)throw null===i?new l:new l(i)}},m.equals=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];m.equals(e,t,null)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];if(!r.equals(i))throw new l("Expected "+i+" but encountered "+r+(null!==o?": "+o:""))}},t(C.prototype,{setOrdinate:function(e,t){switch(e){case C.X:this.x=t;break;case C.Y:this.y=t;break;case C.Z:this.z=t;break;default:throw new h("Invalid ordinate index: "+e)}},equals2D:function(){if(1===arguments.length){var e=arguments[0];return this.x===e.x&&this.y===e.y}if(2===arguments.length){var t=arguments[0],i=arguments[1];return!!r.equalsWithTolerance(this.x,t.x,i)&&!!r.equalsWithTolerance(this.y,t.y,i)}},getOrdinate:function(e){switch(e){case C.X:return this.x;case C.Y:return this.y;case C.Z:return this.z}throw new h("Invalid ordinate index: "+e)},equals3D:function(e){return this.x===e.x&&this.y===e.y&&(this.z===e.z||_.isNaN(this.z)&&_.isNaN(e.z))},equals:function(e){return e instanceof C&&this.equals2D(e)},equalInZ:function(e,t){return r.equalsWithTolerance(this.z,e.z,t)},compareTo:function(e){var t=e;return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0},clone:function(){try{return null}catch(e){if(e instanceof CloneNotSupportedException)return m.shouldNeverReachHere("this shouldn't happen because this class is Cloneable"),null;throw e}},copy:function(){return new C(this)},toString:function(){return"("+this.x+", "+this.y+", "+this.z+")"},distance3D:function(e){var t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return Math.sqrt(t*t+i*i+r*r)},distance:function(e){var t=this.x-e.x,i=this.y-e.y;return Math.sqrt(t*t+i*i)},hashCode:function(){var e=17;return 37*(e=37*e+C.hashCode(this.x))+C.hashCode(this.y)},setCoordinate:function(e){this.x=e.x,this.y=e.y,this.z=e.z},interfaces_:function(){return[i,o,a]},getClass:function(){return C}}),C.hashCode=function(){if(1===arguments.length){var e=arguments[0],t=_.doubleToLongBits(e);return Math.trunc(t^t>>>32)}},t(u.prototype,{compare:function(e,t){var i=e,r=t,o=u.compare(i.x,r.x);if(0!==o)return o;var n=u.compare(i.y,r.y);return 0!==n?n:this.dimensionsToTest<=2?0:u.compare(i.z,r.z)},interfaces_:function(){return[n]},getClass:function(){return u}}),u.compare=function(e,t){return e<t?-1:t<e?1:_.isNaN(e)?_.isNaN(t)?0:-1:_.isNaN(t)?1:0},C.DimensionalComparator=u,C.serialVersionUID=0x5cbf2c235c7e5800,C.NULL_ORDINATE=_.NaN,C.X=0,C.Y=1,C.Z=2,c.prototype.hasNext=function(){},c.prototype.next=function(){},c.prototype.remove=function(){},f.prototype.add=function(){},f.prototype.addAll=function(){},f.prototype.isEmpty=function(){},f.prototype.iterator=function(){},f.prototype.size=function(){},f.prototype.toArray=function(){},f.prototype.remove=function(){},(d.prototype=new Error).name="IndexOutOfBoundsException",((v.prototype=Object.create(f.prototype)).constructor=v).prototype.get=function(){},v.prototype.set=function(){},v.prototype.isEmpty=function(){},(p.prototype=new Error).name="NoSuchElementException",(g.prototype=new Error).name="OperationNotSupported",((w.prototype=Object.create(v.prototype)).constructor=w).prototype.ensureCapacity=function(){},w.prototype.interfaces_=function(){return[v,f]},w.prototype.add=function(e){return 1===arguments.length?this.array_.push(e):this.array_.splice(e,arguments[1]),!0},w.prototype.clear=function(){this.array_=[]},w.prototype.addAll=function(e){for(var t=e.iterator();t.hasNext();)this.add(t.next());return!0},w.prototype.set=function(e,t){var i=this.array_[e];return this.array_[e]=t,i},w.prototype.iterator=function(){return new Vn(this)},w.prototype.get=function(e){if(e<0||e>=this.size())throw new d;return this.array_[e]},w.prototype.isEmpty=function(){return 0===this.array_.length},w.prototype.size=function(){return this.array_.length},w.prototype.toArray=function(){for(var e=[],t=0,i=this.array_.length;t<i;t++)e.push(this.array_[t]);return e},w.prototype.remove=function(e){for(var t=!1,i=0,r=this.array_.length;i<r;i++)if(this.array_[i]===e){this.array_.splice(i,1),t=!0;break}return t};var Vn=function(e){this.arrayList_=e,this.position_=0};Vn.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new p;return this.arrayList_.get(this.position_++)},Vn.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},Vn.prototype.set=function(e){return this.arrayList_.set(this.position_-1,e)},Vn.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},s(b,w),t(b.prototype,{getCoordinate:function(e){return this.get(e)},addAll:function(){if(2!==arguments.length)return w.prototype.addAll.apply(this,arguments);for(var e=arguments[0],t=arguments[1],i=!1,r=e.iterator();r.hasNext();)this.add(r.next(),t),i=!0;return i},clone:function(){for(var e=w.prototype.clone.call(this),t=0;t<this.size();t++)e.add(t,this.get(t).copy());return e},toCoordinateArray:function(){return this.toArray(b.coordArrayType)},add:function(){if(1===arguments.length){var e=arguments[0];w.prototype.add.call(this,e)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var t=arguments[0],i=arguments[1];return this.add(t,i,!0),!0}if(arguments[0]instanceof C&&"boolean"==typeof arguments[1]){var r=arguments[0];if(!arguments[1]&&1<=this.size())if(this.get(this.size()-1).equals2D(r))return null;w.prototype.add.call(this,r)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],n=arguments[1];return this.add(o,n),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var a=arguments[0],s=arguments[1];if(arguments[2])for(var l=0;l<a.length;l++)this.add(a[l],s);else for(l=a.length-1;0<=l;l--)this.add(a[l],s);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof C){var u=arguments[0],c=arguments[1];if(!arguments[2]){var h=this.size();if(0<h){if(0<u)if(this.get(u-1).equals2D(c))return null;if(u<h)if(this.get(u).equals2D(c))return null}}w.prototype.add.call(this,u,c)}}else if(4===arguments.length){var d=arguments[0],m=arguments[1],p=arguments[2],g=arguments[3],f=1;g<p&&(f=-1);for(l=p;l!==g;l+=f)this.add(d[l],m);return!0}},closeRing:function(){0<this.size()&&this.add(new C(this.get(0)),!1)},interfaces_:function(){return[]},getClass:function(){return b}}),b.coordArrayType=new Array(0).fill(null),t(E.prototype,{getArea:function(){return this.getWidth()*this.getHeight()},equals:function(e){if(!(e instanceof E))return!1;var t=e;return this.isNull()?t.isNull():this.maxx===t.getMaxX()&&this.maxy===t.getMaxY()&&this.minx===t.getMinX()&&this.miny===t.getMinY()},intersection:function(e){if(this.isNull()||e.isNull()||!this.intersects(e))return new E;var t=this.minx>e.minx?this.minx:e.minx,i=this.miny>e.miny?this.miny:e.miny;return new E(t,this.maxx<e.maxx?this.maxx:e.maxx,i,this.maxy<e.maxy?this.maxy:e.maxy)},isNull:function(){return this.maxx<this.minx},getMaxX:function(){return this.maxx},covers:function(){if(1===arguments.length){if(arguments[0]instanceof C){var e=arguments[0];return this.covers(e.x,e.y)}if(arguments[0]instanceof E){var t=arguments[0];return!this.isNull()&&!t.isNull()&&t.getMinX()>=this.minx&&t.getMaxX()<=this.maxx&&t.getMinY()>=this.miny&&t.getMaxY()<=this.maxy}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];return!this.isNull()&&i>=this.minx&&i<=this.maxx&&r>=this.miny&&r<=this.maxy}},intersects:function(){if(1===arguments.length){if(arguments[0]instanceof E){var e=arguments[0];return!this.isNull()&&!e.isNull()&&!(e.minx>this.maxx||e.maxx<this.minx||e.miny>this.maxy||e.maxy<this.miny)}if(arguments[0]instanceof C){var t=arguments[0];return this.intersects(t.x,t.y)}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];return!this.isNull()&&!(i>this.maxx||i<this.minx||r>this.maxy||r<this.miny)}},getMinY:function(){return this.miny},getMinX:function(){return this.minx},expandToInclude:function(){if(1===arguments.length){if(arguments[0]instanceof C){var e=arguments[0];this.expandToInclude(e.x,e.y)}else if(arguments[0]instanceof E){var t=arguments[0];if(t.isNull())return null;this.isNull()?(this.minx=t.getMinX(),this.maxx=t.getMaxX(),this.miny=t.getMinY(),this.maxy=t.getMaxY()):(t.minx<this.minx&&(this.minx=t.minx),t.maxx>this.maxx&&(this.maxx=t.maxx),t.miny<this.miny&&(this.miny=t.miny),t.maxy>this.maxy&&(this.maxy=t.maxy))}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.isNull()?(this.minx=i,this.maxx=i,this.miny=r,this.maxy=r):(i<this.minx&&(this.minx=i),i>this.maxx&&(this.maxx=i),r<this.miny&&(this.miny=r),r>this.maxy&&(this.maxy=r))}},minExtent:function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e<t?e:t},getWidth:function(){return this.isNull()?0:this.maxx-this.minx},compareTo:function(e){var t=e;return this.isNull()?t.isNull()?0:-1:t.isNull()?1:this.minx<t.minx?-1:this.minx>t.minx?1:this.miny<t.miny?-1:this.miny>t.miny?1:this.maxx<t.maxx?-1:this.maxx>t.maxx?1:this.maxy<t.maxy?-1:this.maxy>t.maxy?1:0},translate:function(e,t){return this.isNull()?null:void this.init(this.getMinX()+e,this.getMaxX()+e,this.getMinY()+t,this.getMaxY()+t)},toString:function(){return"Env["+this.minx+" : "+this.maxx+", "+this.miny+" : "+this.maxy+"]"},setToNull:function(){this.minx=0,this.maxx=-1,this.miny=0,this.maxy=-1},getHeight:function(){return this.isNull()?0:this.maxy-this.miny},maxExtent:function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return t<e?e:t},expandBy:function(){if(1===arguments.length){var e=arguments[0];this.expandBy(e,e)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];if(this.isNull())return null;this.minx-=t,this.maxx+=t,this.miny-=i,this.maxy+=i,(this.minx>this.maxx||this.miny>this.maxy)&&this.setToNull()}},contains:function(){if(1===arguments.length){if(arguments[0]instanceof E){var e=arguments[0];return this.covers(e)}if(arguments[0]instanceof C){var t=arguments[0];return this.covers(t)}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];return this.covers(i,r)}},centre:function(){return this.isNull()?null:new C((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},init:function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof C){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof E){var t=arguments[0];this.minx=t.minx,this.maxx=t.maxx,this.miny=t.miny,this.maxy=t.maxy}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.init(i.x,r.x,i.y,r.y)}else if(4===arguments.length){var o=arguments[0],n=arguments[1],a=arguments[2],s=arguments[3];o<n?(this.minx=o,this.maxx=n):(this.minx=n,this.maxx=o),a<s?(this.miny=a,this.maxy=s):(this.miny=s,this.maxy=a)}},getMaxY:function(){return this.maxy},distance:function(e){if(this.intersects(e))return 0;var t=0;this.maxx<e.minx?t=e.minx-this.maxx:this.minx>e.maxx&&(t=this.minx-e.maxx);var i=0;return this.maxy<e.miny?i=e.miny-this.maxy:this.miny>e.maxy&&(i=this.miny-e.maxy),0===t?i:0===i?t:Math.sqrt(t*t+i*i)},hashCode:function(){var e=17;return 37*(e=37*(e=37*(e=37*e+C.hashCode(this.minx))+C.hashCode(this.maxx))+C.hashCode(this.miny))+C.hashCode(this.maxy)},interfaces_:function(){return[i,a]},getClass:function(){return E}}),E.intersects=function(){if(3===arguments.length){var e=arguments[0],t=arguments[1],i=arguments[2];return i.x>=(e.x<t.x?e.x:t.x)&&i.x<=(e.x>t.x?e.x:t.x)&&i.y>=(e.y<t.y?e.y:t.y)&&i.y<=(e.y>t.y?e.y:t.y)}if(4===arguments.length){var r=arguments[0],o=arguments[1],n=arguments[2],a=arguments[3],s=Math.min(n.x,a.x),l=Math.max(n.x,a.x),u=Math.min(r.x,o.x),c=Math.max(r.x,o.x);return!(l<u||c<s||(s=Math.min(n.y,a.y),l=Math.max(n.y,a.y),u=Math.min(r.y,o.y),c=Math.max(r.y,o.y),l<u||c<s))}},E.serialVersionUID=0x51845cd552189800,s(P,S),t(P.prototype,{interfaces_:function(){return[]},getClass:function(){return P}}),t(x.prototype,{interfaces_:function(){return[]},getClass:function(){return x}}),x.toLocationSymbol=function(e){switch(e){case x.EXTERIOR:return"e";case x.BOUNDARY:return"b";case x.INTERIOR:return"i";case x.NONE:return"-"}throw new h("Unknown location value: "+e)},x.INTERIOR=0,x.BOUNDARY=1,x.EXTERIOR=2,x.NONE=-1,t(I.prototype,{interfaces_:function(){return[]},getClass:function(){return I}}),I.log10=function(e){var t=Math.log(e);return _.isInfinite(t)?t:_.isNaN(t)?t:t/I.LOG_10},I.min=function(e,t,i,r){var o=e;return t<o&&(o=t),i<o&&(o=i),r<o&&(o=r),o},I.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var e=arguments[0],t=arguments[1],i=arguments[2];return e<t?t:i<e?i:e}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],o=arguments[1],n=arguments[2];return r<o?o:n<r?n:r}},I.wrap=function(e,t){return e<0?t- -e%t:e%t},I.max=function(){if(3===arguments.length){var e=arguments[0],t=arguments[1],i=arguments[2];return(r=e)<t&&(r=t),r<i&&(r=i),r}if(4===arguments.length){var r,o=arguments[0],n=arguments[1],a=arguments[2],s=arguments[3];return(r=o)<n&&(r=n),r<a&&(r=a),r<s&&(r=s),r}},I.average=function(e,t){return(e+t)/2},I.LOG_10=Math.log(10),D.prototype.append=function(e){this.str+=e},D.prototype.setCharAt=function(e,t){this.str=this.str.substr(0,e)+t+this.str.substr(e+1)},D.prototype.toString=function(e){return this.str},L.prototype.intValue=function(){return this.value},L.prototype.compareTo=function(e){return this.value<e?-1:this.value>e?1:0},L.isNaN=function(e){return Number.isNaN(e)},M.isWhitespace=function(e){return e<=32&&0<=e||127==e},M.toUpperCase=function(e){return e.toUpperCase()},t(A.prototype,{le:function(e){return this.hi<e.hi||this.hi===e.hi&&this.lo<=e.lo},extractSignificantDigits:function(e,t){var i=this.abs(),r=A.magnitude(i.hi),o=A.TEN.pow(r);(i=i.divide(o)).gt(A.TEN)?(i=i.divide(A.TEN),r+=1):i.lt(A.ONE)&&(i=i.multiply(A.TEN),r-=1);for(var n=r+1,a=new D,s=A.MAX_PRINT_DIGITS-1,l=0;l<=s;l++){e&&l===n&&a.append(".");var u=Math.trunc(i.hi);if(u<0)break;var c=!1,h=0;h=9<u?(c=!0,"9"):"0"+u,a.append(h),i=i.subtract(A.valueOf(u)).multiply(A.TEN),c&&i.selfAdd(A.TEN);var d=!0,m=A.magnitude(i.hi);if(m<0&&Math.abs(m)>=s-l&&(d=!1),!d)break}return t[0]=r,a.toString()},sqr:function(){return this.multiply(this)},doubleValue:function(){return this.hi+this.lo},subtract:function(){if(arguments[0]instanceof A){var e=arguments[0];return this.add(e.negate())}if("number"==typeof arguments[0]){var t=arguments[0];return this.add(-t)}},equals:function(){if(1===arguments.length){var e=arguments[0];return this.hi===e.hi&&this.lo===e.lo}},isZero:function(){return 0===this.hi&&0===this.lo},selfSubtract:function(){if(arguments[0]instanceof A){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e.hi,-e.lo)}if("number"==typeof arguments[0]){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}},getSpecialNumberString:function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},min:function(e){return this.le(e)?this:e},selfDivide:function(){if(1===arguments.length){if(arguments[0]instanceof A){var e=arguments[0];return this.selfDivide(e.hi,e.lo)}if("number"==typeof arguments[0]){var t=arguments[0];return this.selfDivide(t,0)}}else if(2===arguments.length){var i,r,o,n,a=arguments[0],s=arguments[1],l=null,u=null,c=null,h=null;return o=this.hi/a,h=(l=(c=A.SPLIT*o)-(l=c-o))*(u=(h=A.SPLIT*a)-(u=h-a))-(n=o*a)+l*(r=a-u)+(i=o-l)*u+i*r,h=o+(c=(this.hi-n-h+this.lo-o*s)/a),this.hi=h,this.lo=o-h+c,this}},dump:function(){return"DD<"+this.hi+", "+this.lo+">"},divide:function(){if(arguments[0]instanceof A){var e,t,i,r,o=arguments[0],n=null,a=null,s=null,l=null;return e=(i=this.hi/o.hi)-(n=(s=A.SPLIT*i)-(n=s-i)),l=n*(a=(l=A.SPLIT*o.hi)-(a=l-o.hi))-(r=i*o.hi)+n*(t=o.hi-a)+e*a+e*t,new A(l=i+(s=(this.hi-r-l+this.lo-i*o.lo)/o.hi),i-l+s)}if("number"==typeof arguments[0]){var u=arguments[0];return _.isNaN(u)?A.createNaN():A.copy(this).selfDivide(u,0)}},ge:function(e){return this.hi>e.hi||this.hi===e.hi&&this.lo>=e.lo},pow:function(e){if(0===e)return A.valueOf(1);var t=new A(this),i=A.valueOf(1),r=Math.abs(e);if(1<r)for(;0<r;)r%2==1&&i.selfMultiply(t),0<(r/=2)&&(t=t.sqr());else i=t;return e<0?i.reciprocal():i},ceil:function(){if(this.isNaN())return A.NaN;var e=Math.ceil(this.hi),t=0;return e===this.hi&&(t=Math.ceil(this.lo)),new A(e,t)},compareTo:function(e){var t=e;return this.hi<t.hi?-1:this.hi>t.hi?1:this.lo<t.lo?-1:this.lo>t.lo?1:0},rint:function(){return this.isNaN()?this:this.add(.5).floor()},setValue:function(){if(arguments[0]instanceof A){var e=arguments[0];return this.init(e),this}if("number"==typeof arguments[0]){var t=arguments[0];return this.init(t),this}},max:function(e){return this.ge(e)?this:e},sqrt:function(){if(this.isZero())return A.valueOf(0);if(this.isNegative())return A.NaN;var e=1/Math.sqrt(this.hi),t=this.hi*e,i=A.valueOf(t),r=this.subtract(i.sqr()).hi*(.5*e);return i.add(r)},selfAdd:function(){if(1===arguments.length){if(arguments[0]instanceof A){var e=arguments[0];return this.selfAdd(e.hi,e.lo)}if("number"==typeof arguments[0]){var t=arguments[0],i=null,r=null,o=null,n=null,a=null,s=null;return n=(o=this.hi+t)-(a=o-this.hi),r=(s=(n=t-a+(this.hi-n))+this.lo)+(o-(i=o+s)),this.hi=i+r,this.lo=r+(i-this.hi),this}}else if(2===arguments.length){var l,u=arguments[0],c=arguments[1],h=(i=null,r=null,null);o=null,n=null,a=null,s=null;o=this.hi+u,l=this.lo+c,n=o-(a=o-this.hi),h=l-(s=l-this.lo);var d=(i=o+(a=(n=u-a+(this.hi-n))+l))+(a=(h=c-s+(this.lo-h))+(r=a+(o-i))),m=a+(i-d);return this.hi=d,this.lo=m,this}},selfMultiply:function(){if(1===arguments.length){if(arguments[0]instanceof A){var e=arguments[0];return this.selfMultiply(e.hi,e.lo)}if("number"==typeof arguments[0]){var t=arguments[0];return this.selfMultiply(t,0)}}else if(2===arguments.length){var i,r,o=arguments[0],n=arguments[1],a=null,s=null,l=null,u=null;a=(l=A.SPLIT*this.hi)-this.hi,u=A.SPLIT*o,a=l-a,i=this.hi-a,s=u-o;var c=(l=this.hi*o)+(u=a*(s=u-s)-l+a*(r=o-s)+i*s+i*r+(this.hi*n+this.lo*o)),h=u+(a=l-c);return this.hi=c,this.lo=h,this}},selfSqr:function(){return this.selfMultiply(this)},floor:function(){if(this.isNaN())return A.NaN;var e=Math.floor(this.hi),t=0;return e===this.hi&&(t=Math.floor(this.lo)),new A(e,t)},negate:function(){return this.isNaN()?this:new A(-this.hi,-this.lo)},clone:function(){try{return null}catch(e){if(e instanceof CloneNotSupportedException)return null;throw e}},multiply:function(){if(arguments[0]instanceof A){var e=arguments[0];return e.isNaN()?A.createNaN():A.copy(this).selfMultiply(e)}if("number"==typeof arguments[0]){var t=arguments[0];return _.isNaN(t)?A.createNaN():A.copy(this).selfMultiply(t,0)}},isNaN:function(){return _.isNaN(this.hi)},intValue:function(){return Math.trunc(this.hi)},toString:function(){var e=A.magnitude(this.hi);return-3<=e&&e<=20?this.toStandardNotation():this.toSciNotation()},toStandardNotation:function(){var e=this.getSpecialNumberString();if(null!==e)return e;var t=new Array(1).fill(null),i=this.extractSignificantDigits(!0,t),r=t[0]+1,o=i;if("."===i.charAt(0))o="0"+i;else if(r<0)o="0."+A.stringOfChar("0",-r)+i;else if(-1===i.indexOf(".")){var n=r-i.length;o=i+A.stringOfChar("0",n)+".0"}return this.isNegative()?"-"+o:o},reciprocal:function(){var e,t,i,r,o=null,n=null,a=null,s=null;e=(i=1/this.hi)-(o=(a=A.SPLIT*i)-(o=a-i)),n=(s=A.SPLIT*this.hi)-this.hi;var l=i+(a=(1-(r=i*this.hi)-(s=o*(n=s-n)-r+o*(t=this.hi-n)+e*n+e*t)-i*this.lo)/this.hi);return new A(l,i-l+a)},toSciNotation:function(){if(this.isZero())return A.SCI_NOT_ZERO;var e=this.getSpecialNumberString();if(null!==e)return e;var t=new Array(1).fill(null),i=this.extractSignificantDigits(!1,t),r=A.SCI_NOT_EXPONENT_CHAR+t[0];if("0"===i.charAt(0))throw new IllegalStateException("Found leading zero: "+i);var o="";1<i.length&&(o=i.substring(1));var n=i.charAt(0)+"."+o;return this.isNegative()?"-"+n+r:n+r},abs:function(){return this.isNaN()?A.NaN:this.isNegative()?this.negate():new A(this)},isPositive:function(){return 0<this.hi||0===this.hi&&0<this.lo},lt:function(e){return this.hi<e.hi||this.hi===e.hi&&this.lo<e.lo},add:function(){if(arguments[0]instanceof A){var e=arguments[0];return A.copy(this).selfAdd(e)}if("number"==typeof arguments[0]){var t=arguments[0];return A.copy(this).selfAdd(t)}},init:function(){if(1===arguments.length){if("number"==typeof arguments[0]){var e=arguments[0];this.hi=e,this.lo=0}else if(arguments[0]instanceof A){var t=arguments[0];this.hi=t.hi,this.lo=t.lo}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.hi=i,this.lo=r}},gt:function(e){return this.hi>e.hi||this.hi===e.hi&&this.lo>e.lo},isNegative:function(){return this.hi<0||0===this.hi&&this.lo<0},trunc:function(){return this.isNaN()?A.NaN:this.isPositive()?this.floor():this.ceil()},signum:function(){return 0<this.hi?1:this.hi<0?-1:0<this.lo?1:this.lo<0?-1:0},interfaces_:function(){return[a,i,o]},getClass:function(){return A}}),A.sqr=function(e){return A.valueOf(e).selfMultiply(e)},A.valueOf=function(){if("string"==typeof arguments[0]){var e=arguments[0];return A.parse(e)}if("number"==typeof arguments[0])return new A(arguments[0])},A.sqrt=function(e){return A.valueOf(e).sqrt()},A.parse=function(e){for(var t=0,i=e.length;M.isWhitespace(e.charAt(t));)t++;var r=!1;if(t<i){var o=e.charAt(t);"-"!==o&&"+"!==o||(t++,"-"===o&&(r=!0))}for(var n=new A,a=0,s=0,l=0;!(i<=t);){var u=e.charAt(t);if(t++,M.isDigit(u)){var c=u-"0";n.selfMultiply(A.TEN),n.selfAdd(c),a++}else{if("."!==u){if("e"!==u&&"E"!==u)throw new NumberFormatException("Unexpected character '"+u+"' at position "+t+" in string "+e);var h=e.substring(t);try{l=L.parseInt(h)}catch(t){throw t instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+h+" in string "+e):t}break}s=a}}var d=n,m=a-s-l;if(0===m)d=n;else if(0<m){var p=A.TEN.pow(m);d=n.divide(p)}else if(m<0){p=A.TEN.pow(-m);d=n.multiply(p)}return r?d.negate():d},A.createNaN=function(){return new A(_.NaN,_.NaN)},A.copy=function(e){return new A(e)},A.magnitude=function(e){var t=Math.abs(e),i=Math.log(t)/Math.log(10),r=Math.trunc(Math.floor(i));return 10*Math.pow(10,r)<=t&&(r+=1),r},A.stringOfChar=function(e,t){for(var i=new D,r=0;r<t;r++)i.append(e);return i.toString()},A.PI=new A(3.141592653589793,12246467991473532e-32),A.TWO_PI=new A(6.283185307179586,24492935982947064e-32),A.PI_2=new A(1.5707963267948966,6123233995736766e-32),A.E=new A(2.718281828459045,14456468917292502e-32),A.NaN=new A(_.NaN,_.NaN),A.EPS=123259516440783e-46,A.SPLIT=134217729,A.MAX_PRINT_DIGITS=32,A.TEN=A.valueOf(10),A.ONE=A.valueOf(1),A.SCI_NOT_EXPONENT_CHAR="E",A.SCI_NOT_ZERO="0.0E0",t(R.prototype,{interfaces_:function(){return[]},getClass:function(){return R}}),R.orientationIndex=function(e,t,i){var r=R.orientationIndexFilter(e,t,i);if(r<=1)return r;var o=A.valueOf(t.x).selfAdd(-e.x),n=A.valueOf(t.y).selfAdd(-e.y),a=A.valueOf(i.x).selfAdd(-t.x),s=A.valueOf(i.y).selfAdd(-t.y);return o.selfMultiply(s).selfSubtract(n.selfMultiply(a)).signum()},R.signOfDet2x2=function(e,t,i,r){return e.multiply(r).selfSubtract(t.multiply(i)).signum()},R.intersection=function(e,t,i,r){var o=A.valueOf(r.y).selfSubtract(i.y).selfMultiply(A.valueOf(t.x).selfSubtract(e.x)),n=A.valueOf(r.x).selfSubtract(i.x).selfMultiply(A.valueOf(t.y).selfSubtract(e.y)),a=o.subtract(n),s=A.valueOf(r.x).selfSubtract(i.x).selfMultiply(A.valueOf(e.y).selfSubtract(i.y)),l=A.valueOf(r.y).selfSubtract(i.y).selfMultiply(A.valueOf(e.x).selfSubtract(i.x)),u=s.subtract(l).selfDivide(a).doubleValue(),c=A.valueOf(e.x).selfAdd(A.valueOf(t.x).selfSubtract(e.x).selfMultiply(u)).doubleValue(),h=A.valueOf(t.x).selfSubtract(e.x).selfMultiply(A.valueOf(e.y).selfSubtract(i.y)),d=A.valueOf(t.y).selfSubtract(e.y).selfMultiply(A.valueOf(e.x).selfSubtract(i.x)),m=h.subtract(d).selfDivide(a).doubleValue();return new C(c,A.valueOf(i.y).selfAdd(A.valueOf(r.y).selfSubtract(i.y).selfMultiply(m)).doubleValue())},R.orientationIndexFilter=function(e,t,i){var r=null,o=(e.x-i.x)*(t.y-i.y),n=(e.y-i.y)*(t.x-i.x),a=o-n;if(0<o){if(n<=0)return R.signum(a);r=o+n}else{if(!(o<0))return R.signum(a);if(0<=n)return R.signum(a);r=-o-n}var s=R.DP_SAFE_EPSILON*r;return s<=a||s<=-a?R.signum(a):2},R.signum=function(e){return 0<e?1:e<0?-1:0},R.DP_SAFE_EPSILON=1e-15,t(O.prototype,{setOrdinate:function(e,t,i){},size:function(){},getOrdinate:function(e,t){},getCoordinate:function(){1===arguments.length?arguments[0]:2===arguments.length&&(arguments[0],arguments[1])},getCoordinateCopy:function(e){},getDimension:function(){},getX:function(e){},clone:function(){},expandEnvelope:function(e){},copy:function(){},getY:function(e){},toCoordinateArray:function(){},interfaces_:function(){return[o]},getClass:function(){return O}}),O.X=0,O.Y=1,O.Z=2,O.M=3,N.arraycopy=function(e,t,i,r,o){for(var n=0,a=t;a<t+o;a++)i[r+n]=e[a],n++},N.getProperty=function(e){return{"line.separator":"\n"}[e]},t(V.prototype,{getY:function(){var e=this.y/this.w;if(_.isNaN(e)||_.isInfinite(e))throw new P;return e},getX:function(){var e=this.x/this.w;if(_.isNaN(e)||_.isInfinite(e))throw new P;return e},getCoordinate:function(){var e=new C;return e.x=this.getX(),e.y=this.getY(),e},interfaces_:function(){return[]},getClass:function(){return V}}),V.intersection=function(e,t,i,r){var o=e.y-t.y,n=t.x-e.x,a=e.x*t.y-t.x*e.y,s=i.y-r.y,l=r.x-i.x,u=i.x*r.y-r.x*i.y,c=o*l-s*n,h=(n*u-l*a)/c,d=(s*a-o*u)/c;if(_.isNaN(h)||_.isInfinite(h)||_.isNaN(d)||_.isInfinite(d))throw new P;return new C(h,d)},t(F.prototype,{create:function(){1===arguments.length?arguments[0]instanceof Array?arguments[0]:T(arguments[0],O)&&arguments[0]:2===arguments.length&&(arguments[0],arguments[1])},interfaces_:function(){return[]},getClass:function(){return F}}),t(H.prototype,{filter:function(e){},interfaces_:function(){return[]},getClass:function(){return H}}),t(G.prototype,{isGeometryCollection:function(){return this.getSortIndex()===G.SORTINDEX_GEOMETRYCOLLECTION},getFactory:function(){return this.factory},getGeometryN:function(e){return this},getArea:function(){return 0},isRectangle:function(){return!1},equals:function(){if(1===arguments.length){if(arguments[0]instanceof G){var e=arguments[0];return null!==e&&this.equalsTopo(e)}if(arguments[0]instanceof Object){var t=arguments[0];if(!(t instanceof G))return!1;var i=t;return this.equalsExact(i)}}},equalsExact:function(e){return this===e||this.equalsExact(e,0)},geometryChanged:function(){this.apply(G.geometryChangedFilter)},geometryChangedAction:function(){this.envelope=null},equalsNorm:function(e){return null!==e&&this.norm().equalsExact(e.norm())},getLength:function(){return 0},getNumGeometries:function(){return 1},compareTo:function(){if(1===arguments.length){var e=arguments[0],t=e;return this.getSortIndex()!==t.getSortIndex()?this.getSortIndex()-t.getSortIndex():this.isEmpty()&&t.isEmpty()?0:this.isEmpty()?-1:t.isEmpty()?1:this.compareToSameClass(e)}if(2===arguments.length){var i=arguments[0],r=arguments[1];t=i;return this.getSortIndex()!==t.getSortIndex()?this.getSortIndex()-t.getSortIndex():this.isEmpty()&&t.isEmpty()?0:this.isEmpty()?-1:t.isEmpty()?1:this.compareToSameClass(i,r)}},getUserData:function(){return this.userData},getSRID:function(){return this.SRID},getEnvelope:function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},checkNotGeometryCollection:function(e){if(e.getSortIndex()===G.SORTINDEX_GEOMETRYCOLLECTION)throw new h("This method does not support GeometryCollection arguments")},equal:function(e,t,i){return 0===i?e.equals(t):e.distance(t)<=i},norm:function(){var e=this.copy();return e.normalize(),e},getPrecisionModel:function(){return this.factory.getPrecisionModel()},getEnvelopeInternal:function(){return null===this.envelope&&(this.envelope=this.computeEnvelopeInternal()),new E(this.envelope)},setSRID:function(e){this.SRID=e},setUserData:function(e){this.userData=e},compare:function(e,t){for(var i=e.iterator(),r=t.iterator();i.hasNext()&&r.hasNext();){var o=i.next(),n=r.next(),a=o.compareTo(n);if(0!==a)return a}return i.hasNext()?1:r.hasNext()?-1:0},hashCode:function(){return this.getEnvelopeInternal().hashCode()},isGeometryCollectionOrDerived:function(){return this.getSortIndex()===G.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===G.SORTINDEX_MULTIPOINT||this.getSortIndex()===G.SORTINDEX_MULTILINESTRING||this.getSortIndex()===G.SORTINDEX_MULTIPOLYGON},interfaces_:function(){return[o,i,a]},getClass:function(){return G}}),G.hasNonEmptyElements=function(e){for(var t=0;t<e.length;t++)if(!e[t].isEmpty())return!0;return!1},G.hasNullElements=function(e){for(var t=0;t<e.length;t++)if(null===e[t])return!0;return!1},G.serialVersionUID=0x799ea46522854c00,G.SORTINDEX_POINT=0,G.SORTINDEX_MULTIPOINT=1,G.SORTINDEX_LINESTRING=2,G.SORTINDEX_LINEARRING=3,G.SORTINDEX_MULTILINESTRING=4,G.SORTINDEX_POLYGON=5,G.SORTINDEX_MULTIPOLYGON=6,G.SORTINDEX_GEOMETRYCOLLECTION=7,G.geometryChangedFilter={interfaces_:function(){return[H]},filter:function(e){e.geometryChangedAction()}},t(k.prototype,{filter:function(e){},interfaces_:function(){return[]},getClass:function(){return k}}),t(B.prototype,{isInBoundary:function(e){},interfaces_:function(){return[]},getClass:function(){return B}}),t(j.prototype,{isInBoundary:function(e){return e%2==1},interfaces_:function(){return[B]},getClass:function(){return j}}),t(z.prototype,{isInBoundary:function(e){return 0<e},interfaces_:function(){return[B]},getClass:function(){return z}}),t(W.prototype,{isInBoundary:function(e){return 1<e},interfaces_:function(){return[B]},getClass:function(){return W}}),t(U.prototype,{isInBoundary:function(e){return 1===e},interfaces_:function(){return[B]},getClass:function(){return U}}),B.Mod2BoundaryNodeRule=j,B.EndPointBoundaryNodeRule=z,B.MultiValentEndPointBoundaryNodeRule=W,B.MonoValentEndPointBoundaryNodeRule=U,B.MOD2_BOUNDARY_RULE=new j,B.ENDPOINT_BOUNDARY_RULE=new z,B.MULTIVALENT_ENDPOINT_BOUNDARY_RULE=new W,B.MONOVALENT_ENDPOINT_BOUNDARY_RULE=new U,B.OGC_SFS_BOUNDARY_RULE=B.MOD2_BOUNDARY_RULE,t(q.prototype,{interfaces_:function(){return[]},getClass:function(){return q}}),q.isRing=function(e){return!(e.length<4||!e[0].equals2D(e[e.length-1]))},q.ptNotInList=function(e,t){for(var i=0;i<e.length;i++){var r=e[i];if(q.indexOf(r,t)<0)return r}return null},q.scroll=function(e,t){var i=q.indexOf(t,e);if(i<0)return null;var r=new Array(e.length).fill(null);N.arraycopy(e,i,r,0,e.length-i),N.arraycopy(e,0,r,e.length-i,i),N.arraycopy(r,0,e,0,e.length)},q.equals=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];if(e===t)return!0;if(null===e||null===t)return!1;if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!e[i].equals(t[i]))return!1;return!0}if(3===arguments.length){var r=arguments[0],o=arguments[1],n=arguments[2];if(r===o)return!0;if(null===r||null===o)return!1;if(r.length!==o.length)return!1;for(i=0;i<r.length;i++)if(0!==n.compare(r[i],o[i]))return!1;return!0}},q.intersection=function(e,t){for(var i=new b,r=0;r<e.length;r++)t.intersects(e[r])&&i.add(e[r],!0);return i.toCoordinateArray()},q.hasRepeatedPoints=function(e){for(var t=1;t<e.length;t++)if(e[t-1].equals(e[t]))return!0;return!1},q.removeRepeatedPoints=function(e){return q.hasRepeatedPoints(e)?new b(e,!1).toCoordinateArray():e},q.reverse=function(e){for(var t=e.length-1,i=Math.trunc(t/2),r=0;r<=i;r++){var o=e[r];e[r]=e[t-r],e[t-r]=o}},q.removeNull=function(e){for(var t=0,i=0;i<e.length;i++)null!==e[i]&&t++;var r=new Array(t).fill(null);if(0===t)return r;var o=0;for(i=0;i<e.length;i++)null!==e[i]&&(r[o++]=e[i]);return r},q.copyDeep=function(){if(1===arguments.length){for(var e=arguments[0],t=new Array(e.length).fill(null),i=0;i<e.length;i++)t[i]=new C(e[i]);return t}if(5===arguments.length){var r=arguments[0],o=arguments[1],n=arguments[2],a=arguments[3],s=arguments[4];for(i=0;i<s;i++)n[a+i]=new C(r[o+i])}},q.isEqualReversed=function(e,t){for(var i=0;i<e.length;i++){var r=e[i],o=t[e.length-i-1];if(0!==r.compareTo(o))return!1}return!0},q.envelope=function(e){for(var t=new E,i=0;i<e.length;i++)t.expandToInclude(e[i]);return t},q.toCoordinateArray=function(e){return e.toArray(q.coordArrayType)},q.atLeastNCoordinatesOrNothing=function(e,t){return t.length>=e?t:[]},q.indexOf=function(e,t){for(var i=0;i<t.length;i++)if(e.equals(t[i]))return i;return-1},q.increasingDirection=function(e){for(var t=0;t<Math.trunc(e.length/2);t++){var i=e.length-1-t,r=e[t].compareTo(e[i]);if(0!==r)return r}return 1},q.compare=function(e,t){for(var i=0;i<e.length&&i<t.length;){var r=e[i].compareTo(t[i]);if(0!==r)return r;i++}return i<t.length?-1:i<e.length?1:0},q.minCoordinate=function(e){for(var t=null,i=0;i<e.length;i++)(null===t||0<t.compareTo(e[i]))&&(t=e[i]);return t},q.extract=function(e,t,i){t=I.clamp(t,0,e.length);var r=(i=I.clamp(i,-1,e.length))-t+1;i<0&&(r=0),t>=e.length&&(r=0),i<t&&(r=0);var o=new Array(r).fill(null);if(0===r)return o;for(var n=0,a=t;a<=i;a++)o[n++]=e[a];return o},t(Y.prototype,{compare:function(e,t){return q.compare(e,t)},interfaces_:function(){return[n]},getClass:function(){return Y}}),t(X.prototype,{compare:function(e,t){var i=e,r=t;if(i.length<r.length)return-1;if(i.length>r.length)return 1;if(0===i.length)return 0;var o=q.compare(i,r);return q.isEqualReversed(i,r)?0:o},OLDcompare:function(e,t){var i=e,r=t;if(i.length<r.length)return-1;if(i.length>r.length)return 1;if(0===i.length)return 0;for(var o=q.increasingDirection(i),n=q.increasingDirection(r),a=0<o?0:i.length-1,s=0<n?0:i.length-1,l=0;l<i.length;l++){var u=i[a].compareTo(r[s]);if(0!==u)return u;a+=o,s+=n}return 0},interfaces_:function(){return[n]},getClass:function(){return X}}),q.ForwardComparator=Y,q.BidirectionalComparator=X,q.coordArrayType=new Array(0).fill(null),J.prototype.get=function(){},J.prototype.put=function(){},J.prototype.size=function(){},J.prototype.values=function(){},J.prototype.entrySet=function(){},Q.prototype=new J,(K.prototype=new f).contains=function(){},($.prototype=new K).contains=function(e){for(var t=0,i=this.array_.length;t<i;t++){if(this.array_[t]===e)return!0}return!1},$.prototype.add=function(e){return!this.contains(e)&&(this.array_.push(e),!0)},$.prototype.addAll=function(e){for(var t=e.iterator();t.hasNext();)this.add(t.next());return!0},$.prototype.remove=function(e){throw new javascript.util.OperationNotSupported},$.prototype.size=function(){return this.array_.length},$.prototype.isEmpty=function(){return 0===this.array_.length},$.prototype.toArray=function(){for(var e=[],t=0,i=this.array_.length;t<i;t++)e.push(this.array_[t]);return e},$.prototype.iterator=function(){return new Fn(this)};var Fn=function(e){this.hashSet_=e,this.position_=0};Fn.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new p;return this.hashSet_.array_[this.position_++]},Fn.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},Fn.prototype.remove=function(){throw new g};var Hn=0;(oe.prototype=new Q).get=function(e){for(var t=this.root_;null!==t;){var i=e.compareTo(t.key);if(i<0)t=t.left;else{if(!(0<i))return t.value;t=t.right}}return null},oe.prototype.put=function(e,t){if(null===this.root_)return this.root_={key:e,value:t,left:null,right:null,parent:null,color:Hn,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var i,r,o=this.root_;do{if(i=o,(r=e.compareTo(o.key))<0)o=o.left;else{if(!(0<r)){var n=o.value;return o.value=t,n}o=o.right}}while(null!==o);var a={key:e,left:null,right:null,value:t,parent:i,color:Hn,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?i.left=a:i.right=a,this.fixAfterInsertion(a),this.size_++,null},oe.prototype.fixAfterInsertion=function(e){for(e.color=1;null!=e&&e!=this.root_&&1==e.parent.color;){var t;if(ee(e)==ie(ee(ee(e))))1==Z(t=re(ee(ee(e))))?(te(ee(e),Hn),te(t,Hn),te(ee(ee(e)),1),e=ee(ee(e))):(e==re(ee(e))&&(e=ee(e),this.rotateLeft(e)),te(ee(e),Hn),te(ee(ee(e)),1),this.rotateRight(ee(ee(e))));else 1==Z(t=ie(ee(ee(e))))?(te(ee(e),Hn),te(t,Hn),te(ee(ee(e)),1),e=ee(ee(e))):(e==ie(ee(e))&&(e=ee(e),this.rotateRight(e)),te(ee(e),Hn),te(ee(ee(e)),1),this.rotateLeft(ee(ee(e))))}this.root_.color=Hn},oe.prototype.values=function(){var e=new w,t=this.getFirstEntry();if(null!==t)for(e.add(t.value);null!==(t=oe.successor(t));)e.add(t.value);return e},oe.prototype.entrySet=function(){var e=new $,t=this.getFirstEntry();if(null!==t)for(e.add(t);null!==(t=oe.successor(t));)e.add(t);return e},oe.prototype.rotateLeft=function(e){if(null!=e){var t=e.right;e.right=t.left,null!=t.left&&(t.left.parent=e),t.parent=e.parent,null==e.parent?this.root_=t:e.parent.left==e?e.parent.left=t:e.parent.right=t,(t.left=e).parent=t}},oe.prototype.rotateRight=function(e){if(null!=e){var t=e.left;e.left=t.right,null!=t.right&&(t.right.parent=e),t.parent=e.parent,null==e.parent?this.root_=t:e.parent.right==e?e.parent.right=t:e.parent.left=t,(t.right=e).parent=t}},oe.prototype.getFirstEntry=function(){var e=this.root_;if(null!=e)for(;null!=e.left;)e=e.left;return e},oe.successor=function(e){if(null===e)return null;if(null!==e.right){for(var t=e.right;null!==t.left;)t=t.left;return t}t=e.parent;for(var i=e;null!==t&&i===t.right;)t=(i=t).parent;return t},oe.prototype.size=function(){return this.size_},t(ne.prototype,{interfaces_:function(){return[]},getClass:function(){return ne}}),ae.prototype=new K,(se.prototype=new ae).contains=function(e){for(var t=0,i=this.array_.length;t<i;t++){if(0===this.array_[t].compareTo(e))return!0}return!1},se.prototype.add=function(e){if(this.contains(e))return!1;for(var t=0,i=this.array_.length;t<i;t++){if(1===this.array_[t].compareTo(e))return this.array_.splice(t,0,e),!0}return this.array_.push(e),!0},se.prototype.addAll=function(e){for(var t=e.iterator();t.hasNext();)this.add(t.next());return!0},se.prototype.remove=function(e){throw new g},se.prototype.size=function(){return this.array_.length},se.prototype.isEmpty=function(){return 0===this.array_.length},se.prototype.toArray=function(){for(var e=[],t=0,i=this.array_.length;t<i;t++)e.push(this.array_[t]);return e},se.prototype.iterator=function(){return new Gn(this)};var Gn=function(e){this.treeSet_=e,this.position_=0};Gn.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new p;return this.treeSet_.array_[this.position_++]},Gn.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Gn.prototype.remove=function(){throw new g},le.sort=function(){var e,t,i,r,o=arguments[0];if(1===arguments.length)return r=function(e,t){return e.compareTo(t)},void o.sort(r);if(2===arguments.length)i=arguments[1],r=function(e,t){return i.compare(e,t)},o.sort(r);else{if(3===arguments.length){(t=o.slice(arguments[1],arguments[2])).sort();var n=o.slice(0,arguments[1]).concat(t,o.slice(arguments[2],o.length));for(o.splice(0,o.length),e=0;e<n.length;e++)o.push(n[e]);return}if(4===arguments.length){for(t=o.slice(arguments[1],arguments[2]),i=arguments[3],r=function(e,t){return i.compare(e,t)},t.sort(r),n=o.slice(0,arguments[1]).concat(t,o.slice(arguments[2],o.length)),o.splice(0,o.length),e=0;e<n.length;e++)o.push(n[e]);return}}},le.asList=function(e){for(var t=new w,i=0,r=e.length;i<r;i++)t.add(e[i]);return t},t(ue.prototype,{interfaces_:function(){return[]},getClass:function(){return ue}}),ue.toDimensionSymbol=function(e){switch(e){case ue.FALSE:return ue.SYM_FALSE;case ue.TRUE:return ue.SYM_TRUE;case ue.DONTCARE:return ue.SYM_DONTCARE;case ue.P:return ue.SYM_P;case ue.L:return ue.SYM_L;case ue.A:return ue.SYM_A}throw new h("Unknown dimension value: "+e)},ue.toDimensionValue=function(e){switch(M.toUpperCase(e)){case ue.SYM_FALSE:return ue.FALSE;case ue.SYM_TRUE:return ue.TRUE;case ue.SYM_DONTCARE:return ue.DONTCARE;case ue.SYM_P:return ue.P;case ue.SYM_L:return ue.L;case ue.SYM_A:return ue.A}throw new h("Unknown dimension symbol: "+e)},ue.P=0,ue.L=1,ue.A=2,ue.FALSE=-1,ue.TRUE=-2,ue.DONTCARE=-3,ue.SYM_FALSE="F",ue.SYM_TRUE="T",ue.SYM_DONTCARE="*",ue.SYM_P="0",ue.SYM_L="1",ue.SYM_A="2",t(ce.prototype,{filter:function(e){},interfaces_:function(){return[]},getClass:function(){return ce}}),t(he.prototype,{filter:function(e,t){},isDone:function(){},isGeometryChanged:function(){},interfaces_:function(){return[]},getClass:function(){return he}}),s(de,G),t(de.prototype,{computeEnvelopeInternal:function(){for(var e=new E,t=0;t<this.geometries.length;t++)e.expandToInclude(this.geometries[t].getEnvelopeInternal());return e},getGeometryN:function(e){return this.geometries[e]},getSortIndex:function(){return G.SORTINDEX_GEOMETRYCOLLECTION},getCoordinates:function(){for(var e=new Array(this.getNumPoints()).fill(null),t=-1,i=0;i<this.geometries.length;i++)for(var r=this.geometries[i].getCoordinates(),o=0;o<r.length;o++)e[++t]=r[o];return e},getArea:function(){for(var e=0,t=0;t<this.geometries.length;t++)e+=this.geometries[t].getArea();return e},equalsExact:function(){if(2!==arguments.length)return G.prototype.equalsExact.apply(this,arguments);var e=arguments[0],t=arguments[1];if(!this.isEquivalentClass(e))return!1;var i=e;if(this.geometries.length!==i.geometries.length)return!1;for(var r=0;r<this.geometries.length;r++)if(!this.geometries[r].equalsExact(i.geometries[r],t))return!1;return!0},normalize:function(){for(var e=0;e<this.geometries.length;e++)this.geometries[e].normalize();le.sort(this.geometries)},getCoordinate:function(){return this.isEmpty()?null:this.geometries[0].getCoordinate()},getBoundaryDimension:function(){for(var e=ue.FALSE,t=0;t<this.geometries.length;t++)e=Math.max(e,this.geometries[t].getBoundaryDimension());return e},getDimension:function(){for(var e=ue.FALSE,t=0;t<this.geometries.length;t++)e=Math.max(e,this.geometries[t].getDimension());return e},getLength:function(){for(var e=0,t=0;t<this.geometries.length;t++)e+=this.geometries[t].getLength();return e},getNumPoints:function(){for(var e=0,t=0;t<this.geometries.length;t++)e+=this.geometries[t].getNumPoints();return e},getNumGeometries:function(){return this.geometries.length},reverse:function(){for(var e=this.geometries.length,t=new Array(e).fill(null),i=0;i<this.geometries.length;i++)t[i]=this.geometries[i].reverse();return this.getFactory().createGeometryCollection(t)},compareToSameClass:function(){if(1===arguments.length){var e=arguments[0],t=new se(le.asList(this.geometries)),i=new se(le.asList(e.geometries));return this.compare(t,i)}if(2===arguments.length){for(var r=arguments[0],o=arguments[1],n=r,a=this.getNumGeometries(),s=n.getNumGeometries(),l=0;l<a&&l<s;){var u=this.getGeometryN(l),c=n.getGeometryN(l),h=u.compareToSameClass(c,o);if(0!==h)return h;l++}return l<a?1:l<s?-1:0}},apply:function(){if(T(arguments[0],k))for(var e=arguments[0],t=0;t<this.geometries.length;t++)this.geometries[t].apply(e);else if(T(arguments[0],he)){var i=arguments[0];if(0===this.geometries.length)return null;for(t=0;t<this.geometries.length&&(this.geometries[t].apply(i),!i.isDone());t++);i.isGeometryChanged()&&this.geometryChanged()}else if(T(arguments[0],ce)){var r=arguments[0];r.filter(this);for(t=0;t<this.geometries.length;t++)this.geometries[t].apply(r)}else if(T(arguments[0],H)){var o=arguments[0];o.filter(this);for(t=0;t<this.geometries.length;t++)this.geometries[t].apply(o)}},getBoundary:function(){return this.checkNotGeometryCollection(this),m.shouldNeverReachHere(),null},clone:function(){var e=G.prototype.clone.call(this);e.geometries=new Array(this.geometries.length).fill(null);for(var t=0;t<this.geometries.length;t++)e.geometries[t]=this.geometries[t].clone();return e},getGeometryType:function(){return"GeometryCollection"},copy:function(){for(var e=new Array(this.geometries.length).fill(null),t=0;t<e.length;t++)e[t]=this.geometries[t].copy();return new de(e,this.factory)},isEmpty:function(){for(var e=0;e<this.geometries.length;e++)if(!this.geometries[e].isEmpty())return!1;return!0},interfaces_:function(){return[]},getClass:function(){return de}}),de.serialVersionUID=-0x4f07bcb1f857d800,s(me,de),t(me.prototype,{getSortIndex:function(){return G.SORTINDEX_MULTILINESTRING},equalsExact:function(){if(2!==arguments.length)return de.prototype.equalsExact.apply(this,arguments);var e=arguments[0],t=arguments[1];return!!this.isEquivalentClass(e)&&de.prototype.equalsExact.call(this,e,t)},getBoundaryDimension:function(){return this.isClosed()?ue.FALSE:0},isClosed:function(){if(this.isEmpty())return!1;for(var e=0;e<this.geometries.length;e++)if(!this.geometries[e].isClosed())return!1;return!0},getDimension:function(){return 1},reverse:function(){for(var e=this.geometries.length,t=new Array(e).fill(null),i=0;i<this.geometries.length;i++)t[e-1-i]=this.geometries[i].reverse();return this.getFactory().createMultiLineString(t)},getBoundary:function(){return new pe(this).getBoundary()},getGeometryType:function(){return"MultiLineString"},copy:function(){for(var e=new Array(this.geometries.length).fill(null),t=0;t<e.length;t++)e[t]=this.geometries[t].copy();return new me(e,this.factory)},interfaces_:function(){return[ne]},getClass:function(){return me}}),me.serialVersionUID=0x7155d2ab4afa8000,t(pe.prototype,{boundaryMultiLineString:function(e){if(this.geom.isEmpty())return this.getEmptyMultiPoint();var t=this.computeBoundaryCoordinates(e);return 1===t.length?this.geomFact.createPoint(t[0]):this.geomFact.createMultiPointFromCoords(t)},getBoundary:function(){return this.geom instanceof Ee?this.boundaryLineString(this.geom):this.geom instanceof me?this.boundaryMultiLineString(this.geom):this.geom.getBoundary()},boundaryLineString:function(e){return this.geom.isEmpty()?this.getEmptyMultiPoint():e.isClosed()?this.bnRule.isInBoundary(2)?e.getStartPoint():this.geomFact.createMultiPoint():this.geomFact.createMultiPoint([e.getStartPoint(),e.getEndPoint()])},getEmptyMultiPoint:function(){return this.geomFact.createMultiPoint()},computeBoundaryCoordinates:function(e){var t=new w;this.endpointMap=new oe;for(var i=0;i<e.getNumGeometries();i++){var r=e.getGeometryN(i);0!==r.getNumPoints()&&(this.addEndpoint(r.getCoordinateN(0)),this.addEndpoint(r.getCoordinateN(r.getNumPoints()-1)))}for(var o=this.endpointMap.entrySet().iterator();o.hasNext();){var n=o.next(),a=n.getValue().count;this.bnRule.isInBoundary(a)&&t.add(n.getKey())}return q.toCoordinateArray(t)},addEndpoint:function(e){var t=this.endpointMap.get(e);null===t&&(t=new ge,this.endpointMap.put(e,t)),t.count++},interfaces_:function(){return[]},getClass:function(){return pe}}),pe.getBoundary=function(){return 1===arguments.length?new pe(arguments[0]).getBoundary():2===arguments.length?new pe(arguments[0],arguments[1]).getBoundary():void 0},t(ge.prototype,{interfaces_:function(){return[]},getClass:function(){return ge}}),t(we.prototype,{interfaces_:function(){return[]},getClass:function(){return we}}),we.chars=function(e,t){for(var i=new Array(t).fill(null),r=0;r<t;r++)i[r]=e;return new String(i)},we.getStackTrace=function(){if(1===arguments.length){var e=arguments[0],t=new _e,i=new fe(t);return e.printStackTrace(i),t.toString()}if(2===arguments.length){for(var r=arguments[0],o=arguments[1],n="",a=new Ce(new ve(we.getStackTrace(r))),s=0;s<o;s++)try{n+=a.readLine()+we.NEWLINE}catch(e){if(!(e instanceof ye))throw e;m.shouldNeverReachHere()}return n}},we.split=function(e,t){for(var i=t.length,r=new w,o=""+e,n=o.indexOf(t);0<=n;){var a=o.substring(0,n);r.add(a),n=(o=o.substring(n+i)).indexOf(t)}0<o.length&&r.add(o);for(var s=new Array(r.size()).fill(null),l=0;l<s.length;l++)s[l]=r.get(l);return s},we.toString=function(){if(1===arguments.length){var e=arguments[0];return we.SIMPLE_ORDINATE_FORMAT.format(e)}},we.spaces=function(e){return we.chars(" ",e)},we.NEWLINE=N.getProperty("line.separator"),we.SIMPLE_ORDINATE_FORMAT=new function(){}("0.#"),t(be.prototype,{interfaces_:function(){return[]},getClass:function(){return be}}),be.copyCoord=function(e,t,i,r){for(var o=Math.min(e.getDimension(),i.getDimension()),n=0;n<o;n++)i.setOrdinate(r,n,e.getOrdinate(t,n))},be.isRing=function(e){var t=e.size();return 0===t||!(t<=3)&&e.getOrdinate(0,O.X)===e.getOrdinate(t-1,O.X)&&e.getOrdinate(0,O.Y)===e.getOrdinate(t-1,O.Y)},be.isEqual=function(e,t){var i=e.size();if(i!==t.size())return!1;for(var r=Math.min(e.getDimension(),t.getDimension()),o=0;o<i;o++)for(var n=0;n<r;n++){var a=e.getOrdinate(o,n),s=t.getOrdinate(o,n);if(!(e.getOrdinate(o,n)===t.getOrdinate(o,n)||_.isNaN(a)&&_.isNaN(s)))return!1}return!0},be.extend=function(e,t,i){var r=e.create(i,t.getDimension()),o=t.size();if(be.copy(t,0,r,0,o),0<o)for(var n=o;n<i;n++)be.copy(t,o-1,r,n,1);return r},be.reverse=function(e){for(var t=e.size()-1,i=Math.trunc(t/2),r=0;r<=i;r++)be.swap(e,r,t-r)},be.swap=function(e,t,i){if(t===i)return null;for(var r=0;r<e.getDimension();r++){var o=e.getOrdinate(t,r);e.setOrdinate(t,r,e.getOrdinate(i,r)),e.setOrdinate(i,r,o)}},be.copy=function(e,t,i,r,o){for(var n=0;n<o;n++)be.copyCoord(e,t+n,i,r+n)},be.toString=function(){if(1===arguments.length){var e=arguments[0],t=e.size();if(0===t)return"()";var i=e.getDimension(),r=new D;r.append("(");for(var o=0;o<t;o++){0<o&&r.append(" ");for(var n=0;n<i;n++)0<n&&r.append(","),r.append(we.toString(e.getOrdinate(o,n)))}return r.append(")"),r.toString()}},be.ensureValidRing=function(e,t){var i=t.size();return 0===i?t:i<=3?be.createClosedRing(e,t,4):t.getOrdinate(0,O.X)===t.getOrdinate(i-1,O.X)&&t.getOrdinate(0,O.Y)===t.getOrdinate(i-1,O.Y)?t:be.createClosedRing(e,t,i+1)},be.createClosedRing=function(e,t,i){var r=e.create(i,t.getDimension()),o=t.size();be.copy(t,0,r,0,o);for(var n=o;n<i;n++)be.copy(t,0,r,n,1);return r},s(Ee,G),t(Ee.prototype,{computeEnvelopeInternal:function(){return this.isEmpty()?new E:this.points.expandEnvelope(new E)},isRing:function(){return this.isClosed()&&this.isSimple()},getSortIndex:function(){return G.SORTINDEX_LINESTRING},getCoordinates:function(){return this.points.toCoordinateArray()},equalsExact:function(){if(2!==arguments.length)return G.prototype.equalsExact.apply(this,arguments);var e=arguments[0],t=arguments[1];if(!this.isEquivalentClass(e))return!1;var i=e;if(this.points.size()!==i.points.size())return!1;for(var r=0;r<this.points.size();r++)if(!this.equal(this.points.getCoordinate(r),i.points.getCoordinate(r),t))return!1;return!0},normalize:function(){for(var e=0;e<Math.trunc(this.points.size()/2);e++){var t=this.points.size()-1-e;if(!this.points.getCoordinate(e).equals(this.points.getCoordinate(t)))return 0<this.points.getCoordinate(e).compareTo(this.points.getCoordinate(t))&&be.reverse(this.points),null}},getCoordinate:function(){return this.isEmpty()?null:this.points.getCoordinate(0)},getBoundaryDimension:function(){return this.isClosed()?ue.FALSE:0},isClosed:function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},getEndPoint:function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},getDimension:function(){return 1},getLength:function(){return Qe.computeLength(this.points)},getNumPoints:function(){return this.points.size()},reverse:function(){var e=this.points.copy();return be.reverse(e),this.getFactory().createLineString(e)},compareToSameClass:function(){if(1===arguments.length){for(var e=arguments[0],t=0,i=0;t<this.points.size()&&i<e.points.size();){var r=this.points.getCoordinate(t).compareTo(e.points.getCoordinate(i));if(0!==r)return r;t++,i++}return t<this.points.size()?1:i<e.points.size()?-1:0}if(2===arguments.length){e=arguments[0];return arguments[1].compare(this.points,e.points)}},apply:function(){if(T(arguments[0],k))for(var e=arguments[0],t=0;t<this.points.size();t++)e.filter(this.points.getCoordinate(t));else if(T(arguments[0],he)){var i=arguments[0];if(0===this.points.size())return null;for(t=0;t<this.points.size()&&(i.filter(this.points,t),!i.isDone());t++);i.isGeometryChanged()&&this.geometryChanged()}else if(T(arguments[0],ce)){arguments[0].filter(this)}else if(T(arguments[0],H)){arguments[0].filter(this)}},getBoundary:function(){return new pe(this).getBoundary()},isEquivalentClass:function(e){return e instanceof Ee},clone:function(){var e=G.prototype.clone.call(this);return e.points=this.points.clone(),e},getCoordinateN:function(e){return this.points.getCoordinate(e)},getGeometryType:function(){return"LineString"},copy:function(){return new Ee(this.points.copy(),this.factory)},getCoordinateSequence:function(){return this.points},isEmpty:function(){return 0===this.points.size()},init:function(e){if(null===e&&(e=this.getFactory().getCoordinateSequenceFactory().create([])),1===e.size())throw new h("Invalid number of points in LineString (found "+e.size()+" - must be 0 or >= 2)");this.points=e},isCoordinate:function(e){for(var t=0;t<this.points.size();t++)if(this.points.getCoordinate(t).equals(e))return!0;return!1},getStartPoint:function(){return this.isEmpty()?null:this.getPointN(0)},getPointN:function(e){return this.getFactory().createPoint(this.points.getCoordinate(e))},interfaces_:function(){return[ne]},getClass:function(){return Ee}}),Ee.serialVersionUID=0x2b2b51ba435c8e00,t(Se.prototype,{interfaces_:function(){return[]},getClass:function(){return Se}}),s(Pe,G),t(Pe.prototype,{computeEnvelopeInternal:function(){if(this.isEmpty())return new E;var e=new E;return e.expandToInclude(this.coordinates.getX(0),this.coordinates.getY(0)),e},getSortIndex:function(){return G.SORTINDEX_POINT},getCoordinates:function(){return this.isEmpty()?[]:[this.getCoordinate()]},equalsExact:function(){if(2!==arguments.length)return G.prototype.equalsExact.apply(this,arguments);var e=arguments[0],t=arguments[1];return!!this.isEquivalentClass(e)&&(!(!this.isEmpty()||!e.isEmpty())||this.isEmpty()===e.isEmpty()&&this.equal(e.getCoordinate(),this.getCoordinate(),t))},normalize:function(){},getCoordinate:function(){return 0!==this.coordinates.size()?this.coordinates.getCoordinate(0):null},getBoundaryDimension:function(){return ue.FALSE},getDimension:function(){return 0},getNumPoints:function(){return this.isEmpty()?0:1},reverse:function(){return this.copy()},getX:function(){if(null===this.getCoordinate())throw new IllegalStateException("getX called on empty Point");return this.getCoordinate().x},compareToSameClass:function(){if(1===arguments.length){var e=arguments[0];return this.getCoordinate().compareTo(e.getCoordinate())}if(2===arguments.length){e=arguments[0];return arguments[1].compare(this.coordinates,e.coordinates)}},apply:function(){if(T(arguments[0],k)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this.getCoordinate())}else if(T(arguments[0],he)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.coordinates,0),t.isGeometryChanged()&&this.geometryChanged()}else if(T(arguments[0],ce)){arguments[0].filter(this)}else if(T(arguments[0],H)){arguments[0].filter(this)}},getBoundary:function(){return this.getFactory().createGeometryCollection(null)},clone:function(){var e=G.prototype.clone.call(this);return e.coordinates=this.coordinates.clone(),e},getGeometryType:function(){return"Point"},copy:function(){return new Pe(this.coordinates.copy(),this.factory)},getCoordinateSequence:function(){return this.coordinates},getY:function(){if(null===this.getCoordinate())throw new IllegalStateException("getY called on empty Point");return this.getCoordinate().y},isEmpty:function(){return 0===this.coordinates.size()},init:function(e){null===e&&(e=this.getFactory().getCoordinateSequenceFactory().create([])),m.isTrue(e.size()<=1),this.coordinates=e},isSimple:function(){return!0},interfaces_:function(){return[Se]},getClass:function(){return Pe}}),Pe.serialVersionUID=0x44077bad161cbc00,t(xe.prototype,{interfaces_:function(){return[]},getClass:function(){return xe}}),s(Te,G),t(Te.prototype,{computeEnvelopeInternal:function(){return this.shell.getEnvelopeInternal()},getSortIndex:function(){return G.SORTINDEX_POLYGON},getCoordinates:function(){if(this.isEmpty())return[];for(var e=new Array(this.getNumPoints()).fill(null),t=-1,i=this.shell.getCoordinates(),r=0;r<i.length;r++)e[++t]=i[r];for(var o=0;o<this.holes.length;o++)for(var n=this.holes[o].getCoordinates(),a=0;a<n.length;a++)e[++t]=n[a];return e},getArea:function(){var e=0;e+=Math.abs(Qe.signedArea(this.shell.getCoordinateSequence()));for(var t=0;t<this.holes.length;t++)e-=Math.abs(Qe.signedArea(this.holes[t].getCoordinateSequence()));return e},isRectangle:function(){if(0!==this.getNumInteriorRing())return!1;if(null===this.shell)return!1;if(5!==this.shell.getNumPoints())return!1;for(var e=this.shell.getCoordinateSequence(),t=this.getEnvelopeInternal(),i=0;i<5;i++){if((n=e.getX(i))!==t.getMinX()&&n!==t.getMaxX())return!1;if((a=e.getY(i))!==t.getMinY()&&a!==t.getMaxY())return!1}var r=e.getX(0),o=e.getY(0);for(i=1;i<=4;i++){var n,a;if((n=e.getX(i))!==r===((a=e.getY(i))!==o))return!1;r=n,o=a}return!0},equalsExact:function(){if(2!==arguments.length)return G.prototype.equalsExact.apply(this,arguments);var e=arguments[0],t=arguments[1];if(!this.isEquivalentClass(e))return!1;var i=e,r=this.shell,o=i.shell;if(!r.equalsExact(o,t))return!1;if(this.holes.length!==i.holes.length)return!1;for(var n=0;n<this.holes.length;n++)if(!this.holes[n].equalsExact(i.holes[n],t))return!1;return!0},normalize:function(){if(0===arguments.length){this.normalize(this.shell,!0);for(var e=0;e<this.holes.length;e++)this.normalize(this.holes[e],!1);le.sort(this.holes)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];if(t.isEmpty())return null;var r=new Array(t.getCoordinates().length-1).fill(null);N.arraycopy(t.getCoordinates(),0,r,0,r.length);var o=q.minCoordinate(t.getCoordinates());q.scroll(r,o),N.arraycopy(r,0,t.getCoordinates(),0,r.length),t.getCoordinates()[r.length]=r[0],Qe.isCCW(t.getCoordinates())===i&&q.reverse(t.getCoordinates())}},getCoordinate:function(){return this.shell.getCoordinate()},getNumInteriorRing:function(){return this.holes.length},getBoundaryDimension:function(){return 1},getDimension:function(){return 2},getLength:function(){var e=0;e+=this.shell.getLength();for(var t=0;t<this.holes.length;t++)e+=this.holes[t].getLength();return e},getNumPoints:function(){for(var e=this.shell.getNumPoints(),t=0;t<this.holes.length;t++)e+=this.holes[t].getNumPoints();return e},reverse:function(){var e=this.copy();e.shell=this.shell.copy().reverse(),e.holes=new Array(this.holes.length).fill(null);for(var t=0;t<this.holes.length;t++)e.holes[t]=this.holes[t].copy().reverse();return e},convexHull:function(){return this.getExteriorRing().convexHull()},compareToSameClass:function(){if(1===arguments.length){var e=arguments[0],t=this.shell,i=e.shell;return t.compareToSameClass(i)}if(2===arguments.length){var r=arguments[0],o=arguments[1],n=r,a=(t=this.shell,i=n.shell,t.compareToSameClass(i,o));if(0!==a)return a;for(var s=this.getNumInteriorRing(),l=n.getNumInteriorRing(),u=0;u<s&&u<l;){var c=this.getInteriorRingN(u),h=n.getInteriorRingN(u),d=c.compareToSameClass(h,o);if(0!==d)return d;u++}return u<s?1:u<l?-1:0}},apply:function(){if(T(arguments[0],k)){var e=arguments[0];this.shell.apply(e);for(var t=0;t<this.holes.length;t++)this.holes[t].apply(e)}else if(T(arguments[0],he)){var i=arguments[0];if(this.shell.apply(i),!i.isDone())for(t=0;t<this.holes.length&&(this.holes[t].apply(i),!i.isDone());t++);i.isGeometryChanged()&&this.geometryChanged()}else if(T(arguments[0],ce)){arguments[0].filter(this)}else if(T(arguments[0],H)){var r=arguments[0];r.filter(this),this.shell.apply(r);for(t=0;t<this.holes.length;t++)this.holes[t].apply(r)}},getBoundary:function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var e=new Array(this.holes.length+1).fill(null);e[0]=this.shell;for(var t=0;t<this.holes.length;t++)e[t+1]=this.holes[t];return e.length<=1?this.getFactory().createLinearRing(e[0].getCoordinateSequence()):this.getFactory().createMultiLineString(e)},clone:function(){var e=G.prototype.clone.call(this);e.shell=this.shell.clone(),e.holes=new Array(this.holes.length).fill(null);for(var t=0;t<this.holes.length;t++)e.holes[t]=this.holes[t].clone();return e},getGeometryType:function(){return"Polygon"},copy:function(){for(var e=this.shell.copy(),t=new Array(this.holes.length).fill(null),i=0;i<t.length;i++)t[i]=this.holes[i].copy();return new Te(e,t,this.factory)},getExteriorRing:function(){return this.shell},isEmpty:function(){return this.shell.isEmpty()},getInteriorRingN:function(e){return this.holes[e]},interfaces_:function(){return[xe]},getClass:function(){return Te}}),Te.serialVersionUID=-0x307ffefd8dc97200,s(Ie,de),t(Ie.prototype,{getSortIndex:function(){return G.SORTINDEX_MULTIPOINT},isValid:function(){return!0},equalsExact:function(){if(2!==arguments.length)return de.prototype.equalsExact.apply(this,arguments);var e=arguments[0],t=arguments[1];return!!this.isEquivalentClass(e)&&de.prototype.equalsExact.call(this,e,t)},getCoordinate:function(){if(1!==arguments.length)return de.prototype.getCoordinate.apply(this,arguments);var e=arguments[0];return this.geometries[e].getCoordinate()},getBoundaryDimension:function(){return ue.FALSE},getDimension:function(){return 0},getBoundary:function(){return this.getFactory().createGeometryCollection(null)},getGeometryType:function(){return"MultiPoint"},copy:function(){for(var e=new Array(this.geometries.length).fill(null),t=0;t<e.length;t++)e[t]=this.geometries[t].copy();return new Ie(e,this.factory)},interfaces_:function(){return[Se]},getClass:function(){return Ie}}),Ie.serialVersionUID=-0x6fb1ed4162e0fc00,s(De,Ee),t(De.prototype,{getSortIndex:function(){return G.SORTINDEX_LINEARRING},getBoundaryDimension:function(){return ue.FALSE},isClosed:function(){return!!this.isEmpty()||Ee.prototype.isClosed.call(this)},reverse:function(){var e=this.points.copy();return be.reverse(e),this.getFactory().createLinearRing(e)},validateConstruction:function(){if(!this.isEmpty()&&!Ee.prototype.isClosed.call(this))throw new h("Points of LinearRing do not form a closed linestring");if(1<=this.getCoordinateSequence().size()&&this.getCoordinateSequence().size()<De.MINIMUM_VALID_SIZE)throw new h("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},getGeometryType:function(){return"LinearRing"},copy:function(){return new De(this.points.copy(),this.factory)},interfaces_:function(){return[]},getClass:function(){return De}}),De.MINIMUM_VALID_SIZE=4,De.serialVersionUID=-0x3b229e262367a600,s(Le,de),t(Le.prototype,{getSortIndex:function(){return G.SORTINDEX_MULTIPOLYGON},equalsExact:function(){if(2!==arguments.length)return de.prototype.equalsExact.apply(this,arguments);var e=arguments[0],t=arguments[1];return!!this.isEquivalentClass(e)&&de.prototype.equalsExact.call(this,e,t)},getBoundaryDimension:function(){return 1},getDimension:function(){return 2},reverse:function(){for(var e=this.geometries.length,t=new Array(e).fill(null),i=0;i<this.geometries.length;i++)t[i]=this.geometries[i].reverse();return this.getFactory().createMultiPolygon(t)},getBoundary:function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var e=new w,t=0;t<this.geometries.length;t++)for(var i=this.geometries[t].getBoundary(),r=0;r<i.getNumGeometries();r++)e.add(i.getGeometryN(r));var o=new Array(e.size()).fill(null);return this.getFactory().createMultiLineString(e.toArray(o))},getGeometryType:function(){return"MultiPolygon"},copy:function(){for(var e=new Array(this.geometries.length).fill(null),t=0;t<e.length;t++)e[t]=this.geometries[t].copy();return new Le(e,this.factory)},interfaces_:function(){return[xe]},getClass:function(){return Le}}),Le.serialVersionUID=-0x7a5aa1369171980,t(Me.prototype,{setCopyUserData:function(e){this.isUserDataCopied=e},edit:function(e,t){if(null===e)return null;var i=this.editInternal(e,t);return this.isUserDataCopied&&i.setUserData(e.getUserData()),i},editInternal:function(e,t){return null===this.factory&&(this.factory=e.getFactory()),e instanceof de?this.editGeometryCollection(e,t):e instanceof Te?this.editPolygon(e,t):e instanceof Pe?t.edit(e,this.factory):e instanceof Ee?t.edit(e,this.factory):(m.shouldNeverReachHere("Unsupported Geometry class: "+e.getClass().getName()),null)},editGeometryCollection:function(e,t){for(var i=t.edit(e,this.factory),r=new w,o=0;o<i.getNumGeometries();o++){var n=this.edit(i.getGeometryN(o),t);null===n||n.isEmpty()||r.add(n)}return i.getClass()===Ie?this.factory.createMultiPoint(r.toArray([])):i.getClass()===me?this.factory.createMultiLineString(r.toArray([])):i.getClass()===Le?this.factory.createMultiPolygon(r.toArray([])):this.factory.createGeometryCollection(r.toArray([]))},editPolygon:function(e,t){var i=t.edit(e,this.factory);if(null===i&&(i=this.factory.createPolygon(null)),i.isEmpty())return i;var r=this.edit(i.getExteriorRing(),t);if(null===r||r.isEmpty())return this.factory.createPolygon();for(var o=new w,n=0;n<i.getNumInteriorRing();n++){var a=this.edit(i.getInteriorRingN(n),t);null===a||a.isEmpty()||o.add(a)}return this.factory.createPolygon(r,o.toArray([]))},interfaces_:function(){return[]},getClass:function(){return Me}}),Me.GeometryEditorOperation=Ae,t(Re.prototype,{edit:function(e,t){return e},interfaces_:function(){return[Ae]},getClass:function(){return Re}}),t(Oe.prototype,{edit:function(e,t){var i=this.editCoordinates(e.getCoordinates(),e);return null===i?e:e instanceof De?t.createLinearRing(i):e instanceof Ee?t.createLineString(i):e instanceof Pe?0<i.length?t.createPoint(i[0]):t.createPoint():e},interfaces_:function(){return[Ae]},getClass:function(){return Oe}}),t(Ne.prototype,{edit:function(e,t){return e instanceof De?t.createLinearRing(this.edit(e.getCoordinateSequence(),e)):e instanceof Ee?t.createLineString(this.edit(e.getCoordinateSequence(),e)):e instanceof Pe?t.createPoint(this.edit(e.getCoordinateSequence(),e)):e},interfaces_:function(){return[Ae]},getClass:function(){return Ne}}),Me.NoOpGeometryOperation=Re,Me.CoordinateOperation=Oe,Me.CoordinateSequenceOperation=Ne,t(Ve.prototype,{setOrdinate:function(e,t,i){switch(t){case O.X:this.coordinates[e].x=i;break;case O.Y:this.coordinates[e].y=i;break;case O.Z:this.coordinates[e].z=i;break;default:throw new h("invalid ordinateIndex")}},size:function(){return this.coordinates.length},getOrdinate:function(e,t){switch(t){case O.X:return this.coordinates[e].x;case O.Y:return this.coordinates[e].y;case O.Z:return this.coordinates[e].z}return _.NaN},getCoordinate:function(){if(1===arguments.length){var e=arguments[0];return this.coordinates[e]}if(2===arguments.length){var t=arguments[0],i=arguments[1];i.x=this.coordinates[t].x,i.y=this.coordinates[t].y,i.z=this.coordinates[t].z}},getCoordinateCopy:function(e){return new C(this.coordinates[e])},getDimension:function(){return this.dimension},getX:function(e){return this.coordinates[e].x},clone:function(){for(var e=new Array(this.size()).fill(null),t=0;t<this.coordinates.length;t++)e[t]=this.coordinates[t].clone();return new Ve(e,this.dimension)},expandEnvelope:function(e){for(var t=0;t<this.coordinates.length;t++)e.expandToInclude(this.coordinates[t]);return e},copy:function(){for(var e=new Array(this.size()).fill(null),t=0;t<this.coordinates.length;t++)e[t]=this.coordinates[t].copy();return new Ve(e,this.dimension)},toString:function(){if(0<this.coordinates.length){var e=new D(17*this.coordinates.length);e.append("("),e.append(this.coordinates[0]);for(var t=1;t<this.coordinates.length;t++)e.append(", "),e.append(this.coordinates[t]);return e.append(")"),e.toString()}return"()"},getY:function(e){return this.coordinates[e].y},toCoordinateArray:function(){return this.coordinates},interfaces_:function(){return[O,a]},getClass:function(){return Ve}}),Ve.serialVersionUID=-0xcb44a778db18e00,t(Fe.prototype,{readResolve:function(){return Fe.instance()},create:function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new Ve(arguments[0]);if(T(arguments[0],O))return new Ve(arguments[0])}else if(2===arguments.length){var e=arguments[0],t=arguments[1];return 3<t&&(t=3),t<2?new Ve(e):new Ve(e,t)}},interfaces_:function(){return[F,a]},getClass:function(){return Fe}}),Fe.instance=function(){return Fe.instanceObject},Fe.serialVersionUID=-0x38e49fa6cf6f2e00,Fe.instanceObject=new Fe;var kn,Bn=Object.defineProperty,jn=function(e,t){function i(e){return this&&this.constructor===i?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=t,void(e&&function(e){this.add?e.forEach(this.add,this):e.forEach(function(e){this.set(e[0],e[1])},this)}.call(this,e))):new i(e)}return t||Bn(e,"size",{get:Ge}),(e.constructor=i).prototype=e,i}({delete:function(e){return this.has(e)&&(this._keys.splice(kn,1),this._values.splice(kn,1),this._itp.forEach(function(e){kn<e[0]&&e[0]--})),-1<kn},has:function(e){return function(e,t){if(this.objectOnly&&t!==Object(t))throw new TypeError("Invalid value used as weak collection key");if(t!=t||0===t)for(kn=e.length;kn--&&(i=e[kn])!==(r=t)&&(i==i||r==r););else kn=e.indexOf(t);var i,r;return-1<kn}.call(this,this._keys,e)},get:function(e){return this.has(e)?this._values[kn]:void 0},set:function(e,t){return this.has(e)?this._values[kn]=t:this._values[this._keys.push(e)-1]=t,this},keys:function(){return He(this._itp,this._keys)},values:function(){return He(this._itp,this._values)},entries:function(){return He(this._itp,this._keys,this._values)},forEach:function(e,t){for(var i=this.entries();;){var r=i.next();if(r.done)break;e.call(t,r.value[1],r.value[0],this)}},clear:function(){(this._keys||0).length=this._values.length=0}}),zn="undefined"!=typeof Map&&Map.prototype.values?Map:jn;(ke.prototype=new J).get=function(e){return this.map_.get(e)||null},ke.prototype.put=function(e,t){return this.map_.set(e,t),t},ke.prototype.values=function(){for(var e=new w,t=this.map_.values(),i=t.next();!i.done;)e.add(i.value),i=t.next();return e},ke.prototype.entrySet=function(){var t=new $;return this.map_.entries().forEach(function(e){return t.add(e)}),t},ke.prototype.size=function(){return this.map_.size()},t(Be.prototype,{equals:function(e){if(!(e instanceof Be))return!1;var t=e;return this.modelType===t.modelType&&this.scale===t.scale},compareTo:function(e){var t=e,i=this.getMaximumSignificantDigits(),r=t.getMaximumSignificantDigits();return new L(i).compareTo(new L(r))},getScale:function(){return this.scale},isFloating:function(){return this.modelType===Be.FLOATING||this.modelType===Be.FLOATING_SINGLE},getType:function(){return this.modelType},toString:function(){var e="UNKNOWN";return this.modelType===Be.FLOATING?e="Floating":this.modelType===Be.FLOATING_SINGLE?e="Floating-Single":this.modelType===Be.FIXED&&(e="Fixed (Scale="+this.getScale()+")"),e},makePrecise:function(){if("number"==typeof arguments[0]){var e=arguments[0];return _.isNaN(e)?e:this.modelType!==Be.FLOATING_SINGLE&&this.modelType===Be.FIXED?Math.round(e*this.scale)/this.scale:e}if(arguments[0]instanceof C){var t=arguments[0];if(this.modelType===Be.FLOATING)return null;t.x=this.makePrecise(t.x),t.y=this.makePrecise(t.y)}},getMaximumSignificantDigits:function(){var e=16;return this.modelType===Be.FLOATING?e=16:this.modelType===Be.FLOATING_SINGLE?e=6:this.modelType===Be.FIXED&&(e=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),e},setScale:function(e){this.scale=Math.abs(e)},interfaces_:function(){return[a,i]},getClass:function(){return Be}}),Be.mostPrecise=function(e,t){return 0<=e.compareTo(t)?e:t},t(je.prototype,{readResolve:function(){return je.nameToTypeMap.get(this.name)},toString:function(){return this.name},interfaces_:function(){return[a]},getClass:function(){return je}}),je.serialVersionUID=-552860263173159e4,je.nameToTypeMap=new ke,Be.Type=je,Be.serialVersionUID=0x6bee6404e9a25c00,Be.FIXED=new je("FIXED"),Be.FLOATING=new je("FLOATING"),Be.FLOATING_SINGLE=new je("FLOATING SINGLE"),Be.maximumPreciseValue=9007199254740992,t(ze.prototype,{toGeometry:function(e){return e.isNull()?this.createPoint(null):e.getMinX()===e.getMaxX()&&e.getMinY()===e.getMaxY()?this.createPoint(new C(e.getMinX(),e.getMinY())):e.getMinX()===e.getMaxX()||e.getMinY()===e.getMaxY()?this.createLineString([new C(e.getMinX(),e.getMinY()),new C(e.getMaxX(),e.getMaxY())]):this.createPolygon(this.createLinearRing([new C(e.getMinX(),e.getMinY()),new C(e.getMinX(),e.getMaxY()),new C(e.getMaxX(),e.getMaxY()),new C(e.getMaxX(),e.getMinY()),new C(e.getMinX(),e.getMinY())]),null)},createLineString:function(){if(0===arguments.length)return this.createLineString(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];return this.createLineString(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(T(arguments[0],O))return new Ee(arguments[0],this)}},createMultiLineString:function(){return 0===arguments.length?new me(null,this):1===arguments.length?new me(arguments[0],this):void 0},buildGeometry:function(e){for(var t=null,i=!1,r=!1,o=e.iterator();o.hasNext();){var n=o.next(),a=n.getClass();null===t&&(t=a),a!==t&&(i=!0),n.isGeometryCollectionOrDerived()&&(r=!0)}if(null===t)return this.createGeometryCollection();if(i||r)return this.createGeometryCollection(ze.toGeometryArray(e));var s=e.iterator().next();if(1<e.size()){if(s instanceof Te)return this.createMultiPolygon(ze.toPolygonArray(e));if(s instanceof Ee)return this.createMultiLineString(ze.toLineStringArray(e));if(s instanceof Pe)return this.createMultiPoint(ze.toPointArray(e));m.shouldNeverReachHere("Unhandled class: "+s.getClass().getName())}return s},createMultiPointFromCoords:function(e){return this.createMultiPoint(null!==e?this.getCoordinateSequenceFactory().create(e):null)},createPoint:function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof C){var e=arguments[0];return this.createPoint(null!==e?this.getCoordinateSequenceFactory().create([e]):null)}if(T(arguments[0],O))return new Pe(arguments[0],this)}},getCoordinateSequenceFactory:function(){return this.coordinateSequenceFactory},createPolygon:function(){if(0===arguments.length)return new Te(null,null,this);if(1===arguments.length){if(T(arguments[0],O)){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof Array){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof De){var i=arguments[0];return this.createPolygon(i,null)}}else if(2===arguments.length){return new Te(arguments[0],arguments[1],this)}},getSRID:function(){return this.SRID},createGeometryCollection:function(){return 0===arguments.length?new de(null,this):1===arguments.length?new de(arguments[0],this):void 0},createGeometry:function(e){return new Me(this).edit(e,{edit:function(){if(2===arguments.length){var e=arguments[0];return arguments[1],this.coordinateSequenceFactory.create(e)}}})},getPrecisionModel:function(){return this.precisionModel},createLinearRing:function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];return this.createLinearRing(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(T(arguments[0],O))return new De(arguments[0],this)}},createMultiPolygon:function(){return 0===arguments.length?new Le(null,this):1===arguments.length?new Le(arguments[0],this):void 0},createMultiPoint:function(){if(0===arguments.length)return new Ie(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new Ie(arguments[0],this);if(arguments[0]instanceof Array){var e=arguments[0];return this.createMultiPoint(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(T(arguments[0],O)){var t=arguments[0];if(null===t)return this.createMultiPoint(new Array(0).fill(null));for(var i=new Array(t.size()).fill(null),r=0;r<t.size();r++){var o=this.getCoordinateSequenceFactory().create(1,t.getDimension());be.copy(t,r,o,0,1),i[r]=this.createPoint(o)}return this.createMultiPoint(i)}}},interfaces_:function(){return[a]},getClass:function(){return ze}}),ze.toMultiPolygonArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},ze.toGeometryArray=function(e){if(null===e)return null;var t=new Array(e.size()).fill(null);return e.toArray(t)},ze.getDefaultCoordinateSequenceFactory=function(){return Fe.instance()},ze.toMultiLineStringArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},ze.toLineStringArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},ze.toMultiPointArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},ze.toLinearRingArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},ze.toPointArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},ze.toPolygonArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},ze.createPointFromInternalCoord=function(e,t){return t.getPrecisionModel().makePrecise(e),t.getFactory().createPoint(e)},ze.serialVersionUID=-0x5ea75f2051eeb400;var Wn={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/};t(We.prototype,{read:function(e){var t,i,r;e=e.replace(/[\n\r]/g," ");var o=Wn.typeStr.exec(e);if(-1!==e.search("EMPTY")&&((o=Wn.emptyTypeStr.exec(e))[2]=void 0),o&&(i=o[1].toLowerCase(),r=o[2],qn[i]&&(t=qn[i].apply(this,[r]))),void 0===t)throw new Error("Could not parse WKT "+e);return t},write:function(e){return this.extractGeometry(e)},extractGeometry:function(e){var t=e.getGeometryType().toLowerCase();if(!Un[t])return null;var i=t.toUpperCase();return e.isEmpty()?i+" EMPTY":i+"("+Un[t].apply(this,[e])+")"}});var Un={coordinate:function(e){return e.x+" "+e.y},point:function(e){return Un.coordinate.call(this,e.coordinates.coordinates[0])},multipoint:function(e){for(var t=[],i=0,r=e.geometries.length;i<r;++i)t.push("("+Un.point.apply(this,[e.geometries[i]])+")");return t.join(",")},linestring:function(e){for(var t=[],i=0,r=e.points.coordinates.length;i<r;++i)t.push(Un.coordinate.apply(this,[e.points.coordinates[i]]));return t.join(",")},linearring:function(e){for(var t=[],i=0,r=e.points.coordinates.length;i<r;++i)t.push(Un.coordinate.apply(this,[e.points.coordinates[i]]));return t.join(",")},multilinestring:function(e){for(var t=[],i=0,r=e.geometries.length;i<r;++i)t.push("("+Un.linestring.apply(this,[e.geometries[i]])+")");return t.join(",")},polygon:function(e){var t=[];t.push("("+Un.linestring.apply(this,[e.shell])+")");for(var i=0,r=e.holes.length;i<r;++i)t.push("("+Un.linestring.apply(this,[e.holes[i]])+")");return t.join(",")},multipolygon:function(e){for(var t=[],i=0,r=e.geometries.length;i<r;++i)t.push("("+Un.polygon.apply(this,[e.geometries[i]])+")");return t.join(",")},geometrycollection:function(e){for(var t=[],i=0,r=e.geometries.length;i<r;++i)t.push(this.extractGeometry(e.geometries[i]));return t.join(",")}},qn={point:function(e){if(void 0===e)return this.geometryFactory.createPoint();var t=e.trim().split(Wn.spaces);return this.geometryFactory.createPoint(new C(Number.parseFloat(t[0]),Number.parseFloat(t[1])))},multipoint:function(e){if(void 0===e)return this.geometryFactory.createMultiPoint();for(var t,i=e.trim().split(","),r=[],o=0,n=i.length;o<n;++o)t=i[o].replace(Wn.trimParens,"$1"),r.push(qn.point.apply(this,[t]));return this.geometryFactory.createMultiPoint(r)},linestring:function(e){if(void 0===e)return this.geometryFactory.createLineString();for(var t,i=e.trim().split(","),r=[],o=0,n=i.length;o<n;++o)t=i[o].trim().split(Wn.spaces),r.push(new C(Number.parseFloat(t[0]),Number.parseFloat(t[1])));return this.geometryFactory.createLineString(r)},linearring:function(e){if(void 0===e)return this.geometryFactory.createLinearRing();for(var t,i=e.trim().split(","),r=[],o=0,n=i.length;o<n;++o)t=i[o].trim().split(Wn.spaces),r.push(new C(Number.parseFloat(t[0]),Number.parseFloat(t[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(e){if(void 0===e)return this.geometryFactory.createMultiLineString();for(var t,i=e.trim().split(Wn.parenComma),r=[],o=0,n=i.length;o<n;++o)t=i[o].replace(Wn.trimParens,"$1"),r.push(qn.linestring.apply(this,[t]));return this.geometryFactory.createMultiLineString(r)},polygon:function(e){if(void 0===e)return this.geometryFactory.createPolygon();for(var t,i,r,o,n=e.trim().split(Wn.parenComma),a=[],s=0,l=n.length;s<l;++s)t=n[s].replace(Wn.trimParens,"$1"),i=qn.linestring.apply(this,[t]),r=this.geometryFactory.createLinearRing(i.points),0===s?o=r:a.push(r);return this.geometryFactory.createPolygon(o,a)},multipolygon:function(e){if(void 0===e)return this.geometryFactory.createMultiPolygon();for(var t,i=e.trim().split(Wn.doubleParenComma),r=[],o=0,n=i.length;o<n;++o)t=i[o].replace(Wn.trimParens,"$1"),r.push(qn.polygon.apply(this,[t]));return this.geometryFactory.createMultiPolygon(r)},geometrycollection:function(e){if(void 0===e)return this.geometryFactory.createGeometryCollection();for(var t=(e=e.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),i=[],r=0,o=t.length;r<o;++r)i.push(this.read(t[r]));return this.geometryFactory.createGeometryCollection(i)}};t(Ue.prototype,{write:function(e){return this.parser.write(e)}}),t(Ue,{toLineString:function(e,t){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+e.x+" "+e.y+", "+t.x+" "+t.y+" )"}}),t(qe.prototype,{getIndexAlongSegment:function(e,t){return this.computeIntLineIndex(),this.intLineIndex[e][t]},getTopologySummary:function(){var e=new D;return this.isEndPoint()&&e.append(" endpoint"),this._isProper&&e.append(" proper"),this.isCollinear()&&e.append(" collinear"),e.toString()},computeIntersection:function(e,t,i,r){this.inputLines[0][0]=e,this.inputLines[0][1]=t,this.inputLines[1][0]=i,this.inputLines[1][1]=r,this.result=this.computeIntersect(e,t,i,r)},getIntersectionNum:function(){return this.result},computeIntLineIndex:function(){if(0===arguments.length)null===this.intLineIndex&&(this.intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var e=arguments[0],t=this.getEdgeDistance(e,0);this.getEdgeDistance(e,1)<t?(this.intLineIndex[e][0]=0,this.intLineIndex[e][1]=1):(this.intLineIndex[e][0]=1,this.intLineIndex[e][1]=0)}},isProper:function(){return this.hasIntersection()&&this._isProper},setPrecisionModel:function(e){this.precisionModel=e},isInteriorIntersection:function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var e=arguments[0],t=0;t<this.result;t++)if(!this.intPt[t].equals2D(this.inputLines[e][0])&&!this.intPt[t].equals2D(this.inputLines[e][1]))return!0;return!1}},getIntersection:function(e){return this.intPt[e]},isEndPoint:function(){return this.hasIntersection()&&!this._isProper},hasIntersection:function(){return this.result!==qe.NO_INTERSECTION},getEdgeDistance:function(e,t){return qe.computeEdgeDistance(this.intPt[t],this.inputLines[e][0],this.inputLines[e][1])},isCollinear:function(){return this.result===qe.COLLINEAR_INTERSECTION},toString:function(){return Ue.toLineString(this.inputLines[0][0],this.inputLines[0][1])+" - "+Ue.toLineString(this.inputLines[1][0],this.inputLines[1][1])+this.getTopologySummary()},getEndpoint:function(e,t){return this.inputLines[e][t]},isIntersection:function(e){for(var t=0;t<this.result;t++)if(this.intPt[t].equals2D(e))return!0;return!1},getIntersectionAlongSegment:function(e,t){return this.computeIntLineIndex(),this.intPt[this.intLineIndex[e][t]]},interfaces_:function(){return[]},getClass:function(){return qe}}),qe.computeEdgeDistance=function(e,t,i){var r=Math.abs(i.x-t.x),o=Math.abs(i.y-t.y),n=-1;if(e.equals(t))n=0;else if(e.equals(i))n=o<r?r:o;else{var a=Math.abs(e.x-t.x),s=Math.abs(e.y-t.y);0!==(n=o<r?a:s)||e.equals(t)||(n=Math.max(a,s))}return m.isTrue(!(0===n&&!e.equals(t)),"Bad distance calculation"),n},qe.nonRobustComputeEdgeDistance=function(e,t,i){var r=e.x-t.x,o=e.y-t.y,n=Math.sqrt(r*r+o*o);return m.isTrue(!(0===n&&!e.equals(t)),"Invalid distance calculation"),n},qe.DONT_INTERSECT=0,qe.DO_INTERSECT=1,qe.COLLINEAR=2,qe.NO_INTERSECTION=0,qe.POINT_INTERSECTION=1,qe.COLLINEAR_INTERSECTION=2,s(Ye,qe),t(Ye.prototype,{isInSegmentEnvelopes:function(e){var t=new E(this.inputLines[0][0],this.inputLines[0][1]),i=new E(this.inputLines[1][0],this.inputLines[1][1]);return t.contains(e)&&i.contains(e)},computeIntersection:function(){if(3!==arguments.length)return qe.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],t=arguments[1],i=arguments[2];return this._isProper=!1,E.intersects(t,i,e)&&0===Qe.orientationIndex(t,i,e)&&0===Qe.orientationIndex(i,t,e)?(this._isProper=!0,(e.equals(t)||e.equals(i))&&(this._isProper=!1),this.result=qe.POINT_INTERSECTION,null):void(this.result=qe.NO_INTERSECTION)},normalizeToMinimum:function(e,t,i,r,o){o.x=this.smallestInAbsValue(e.x,t.x,i.x,r.x),o.y=this.smallestInAbsValue(e.y,t.y,i.y,r.y),e.x-=o.x,e.y-=o.y,t.x-=o.x,t.y-=o.y,i.x-=o.x,i.y-=o.y,r.x-=o.x,r.y-=o.y},safeHCoordinateIntersection:function(t,i,r,o){var n=null;try{n=V.intersection(t,i,r,o)}catch(e){if(!(e instanceof P))throw e;n=Ye.nearestEndpoint(t,i,r,o)}return n},intersection:function(e,t,i,r){var o=this.intersectionWithNormalization(e,t,i,r);return this.isInSegmentEnvelopes(o)||(o=new C(Ye.nearestEndpoint(e,t,i,r))),null!==this.precisionModel&&this.precisionModel.makePrecise(o),o},smallestInAbsValue:function(e,t,i,r){var o=e,n=Math.abs(o);return Math.abs(t)<n&&(o=t,n=Math.abs(t)),Math.abs(i)<n&&(o=i,n=Math.abs(i)),Math.abs(r)<n&&(o=r),o},checkDD:function(e,t,i,r,o){var n=R.intersection(e,t,i,r),a=this.isInSegmentEnvelopes(n);N.out.println("DD in env = "+a+" --------------------- "+n),1e-4<o.distance(n)&&N.out.println("Distance = "+o.distance(n))},intersectionWithNormalization:function(e,t,i,r){var o=new C(e),n=new C(t),a=new C(i),s=new C(r),l=new C;this.normalizeToEnvCentre(o,n,a,s,l);var u=this.safeHCoordinateIntersection(o,n,a,s);return u.x+=l.x,u.y+=l.y,u},computeCollinearIntersection:function(e,t,i,r){var o=E.intersects(e,t,i),n=E.intersects(e,t,r),a=E.intersects(i,r,e),s=E.intersects(i,r,t);return o&&n?(this.intPt[0]=i,this.intPt[1]=r,qe.COLLINEAR_INTERSECTION):a&&s?(this.intPt[0]=e,this.intPt[1]=t,qe.COLLINEAR_INTERSECTION):o&&a?(this.intPt[0]=i,this.intPt[1]=e,!i.equals(e)||n||s?qe.COLLINEAR_INTERSECTION:qe.POINT_INTERSECTION):o&&s?(this.intPt[0]=i,this.intPt[1]=t,!i.equals(t)||n||a?qe.COLLINEAR_INTERSECTION:qe.POINT_INTERSECTION):n&&a?(this.intPt[0]=r,this.intPt[1]=e,!r.equals(e)||o||s?qe.COLLINEAR_INTERSECTION:qe.POINT_INTERSECTION):n&&s?(this.intPt[0]=r,this.intPt[1]=t,!r.equals(t)||o||a?qe.COLLINEAR_INTERSECTION:qe.POINT_INTERSECTION):qe.NO_INTERSECTION},normalizeToEnvCentre:function(e,t,i,r,o){var n=e.x<t.x?e.x:t.x,a=e.y<t.y?e.y:t.y,s=e.x>t.x?e.x:t.x,l=e.y>t.y?e.y:t.y,u=i.x<r.x?i.x:r.x,c=i.y<r.y?i.y:r.y,h=i.x>r.x?i.x:r.x,d=i.y>r.y?i.y:r.y,m=((u<n?n:u)+(s<h?s:h))/2,p=((c<a?a:c)+(l<d?l:d))/2;o.x=m,o.y=p,e.x-=o.x,e.y-=o.y,t.x-=o.x,t.y-=o.y,i.x-=o.x,i.y-=o.y,r.x-=o.x,r.y-=o.y},computeIntersect:function(e,t,i,r){if(this._isProper=!1,!E.intersects(e,t,i,r))return qe.NO_INTERSECTION;var o=Qe.orientationIndex(e,t,i),n=Qe.orientationIndex(e,t,r);if(0<o&&0<n||o<0&&n<0)return qe.NO_INTERSECTION;var a=Qe.orientationIndex(i,r,e),s=Qe.orientationIndex(i,r,t);return 0<a&&0<s||a<0&&s<0?qe.NO_INTERSECTION:0===o&&0===n&&0===a&&0===s?this.computeCollinearIntersection(e,t,i,r):(0===o||0===n||0===a||0===s?(this._isProper=!1,e.equals2D(i)||e.equals2D(r)?this.intPt[0]=e:t.equals2D(i)||t.equals2D(r)?this.intPt[0]=t:0===o?this.intPt[0]=new C(i):0===n?this.intPt[0]=new C(r):0===a?this.intPt[0]=new C(e):0===s&&(this.intPt[0]=new C(t))):(this._isProper=!0,this.intPt[0]=this.intersection(e,t,i,r)),qe.POINT_INTERSECTION)},interfaces_:function(){return[]},getClass:function(){return Ye}}),Ye.nearestEndpoint=function(e,t,i,r){var o=e,n=Qe.distancePointLine(e,i,r),a=Qe.distancePointLine(t,i,r);return a<n&&(n=a,o=t),(a=Qe.distancePointLine(i,e,t))<n&&(n=a,o=i),(a=Qe.distancePointLine(r,e,t))<n&&(n=a,o=r),o},t(Xe.prototype,{interfaces_:function(){return[]},getClass:function(){return Xe}}),Xe.orientationIndex=function(e,t,i){var r=t.x-e.x,o=t.y-e.y,n=i.x-t.x,a=i.y-t.y;return Xe.signOfDet2x2(r,o,n,a)},Xe.signOfDet2x2=function(e,t,i,r){var o=null,n=null,a=null;if(o=1,0===e||0===r)return 0===t||0===i?0:0<t?0<i?-o:o:0<i?o:-o;if(0===t||0===i)return 0<r?0<e?o:-o:0<e?-o:o;if(0<t?0<r?t<=r||(o=-o,n=e,e=i,i=n,n=t,t=r,r=n):r=t<=-r?(o=-o,i=-i,-r):(n=e,e=-i,i=n,n=t,t=-r,n):0<r?-t<=r?(o=-o,e=-e,t=-t):(n=-e,e=i,i=n,n=-t,t=r,r=n):r=r<=t?(e=-e,t=-t,i=-i,-r):(o=-o,n=-e,e=-i,i=n,n=-t,t=-r,n),0<e){if(!(0<i))return o;if(!(e<=i))return o}else{if(0<i)return-o;if(!(i<=e))return-o;o=-o,e=-e,i=-i}for(;;){if(1,(r-=(a=Math.floor(i/e))*t)<0)return-o;if(t<r)return o;if((i-=a*e)+i<e){if(t<r+r)return o}else{if(r+r<t)return-o;i=e-i,r=t-r,o=-o}if(0===r)return 0===i?0:-o;if(0===i)return o;if((t-=(a=Math.floor(e/i))*r)<0)return o;if(r<t)return-o;if((e-=a*i)+e<i){if(r<t+t)return-o}else{if(t+t<r)return o;e=i-e,t=r-t,o=-o}if(0===t)return 0===e?0:o;if(0===e)return-o}},t(Je.prototype,{countSegment:function(e,t){if(e.x<this.p.x&&t.x<this.p.x)return null;if(this.p.x===t.x&&this.p.y===t.y)return this.isPointOnSegment=!0,null;if(e.y===this.p.y&&t.y===this.p.y){var i=e.x,r=t.x;return r<i&&(i=t.x,r=e.x),this.p.x>=i&&this.p.x<=r&&(this.isPointOnSegment=!0),null}if(e.y>this.p.y&&t.y<=this.p.y||t.y>this.p.y&&e.y<=this.p.y){var o=e.x-this.p.x,n=e.y-this.p.y,a=t.x-this.p.x,s=t.y-this.p.y,l=Xe.signOfDet2x2(o,n,a,s);if(0===l)return this.isPointOnSegment=!0,null;s<n&&(l=-l),0<l&&this.crossingCount++}},isPointInPolygon:function(){return this.getLocation()!==x.EXTERIOR},getLocation:function(){return this.isPointOnSegment?x.BOUNDARY:this.crossingCount%2==1?x.INTERIOR:x.EXTERIOR},isOnSegment:function(){return this.isPointOnSegment},interfaces_:function(){return[]},getClass:function(){return Je}}),Je.locatePointInRing=function(){if(arguments[0]instanceof C&&T(arguments[1],O)){for(var e=arguments[0],t=arguments[1],i=new Je(e),r=new C,o=new C,n=1;n<t.size();n++)if(t.getCoordinate(n,r),t.getCoordinate(n-1,o),i.countSegment(r,o),i.isOnSegment())return i.getLocation();return i.getLocation()}if(arguments[0]instanceof C&&arguments[1]instanceof Array){var a=arguments[0],s=arguments[1];for(i=new Je(a),n=1;n<s.length;n++){r=s[n],o=s[n-1];if(i.countSegment(r,o),i.isOnSegment())return i.getLocation()}return i.getLocation()}},t(Qe.prototype,{interfaces_:function(){return[]},getClass:function(){return Qe}}),Qe.orientationIndex=function(e,t,i){return R.orientationIndex(e,t,i)},Qe.signedArea=function(){if(arguments[0]instanceof Array){var e=arguments[0];if(e.length<3)return 0;for(var t=0,i=e[0].x,r=1;r<e.length-1;r++){var o=e[r].x-i,n=e[r+1].y;t+=o*(e[r-1].y-n)}return t/2}if(T(arguments[0],O)){var a=arguments[0],s=a.size();if(s<3)return 0;var l=new C,u=new C,c=new C;a.getCoordinate(0,u),a.getCoordinate(1,c);i=u.x;c.x-=i;for(t=0,r=1;r<s-1;r++)l.y=u.y,u.x=c.x,u.y=c.y,a.getCoordinate(r+1,c),c.x-=i,t+=u.x*(l.y-c.y);return t/2}},Qe.distanceLineLine=function(e,t,i,r){if(e.equals(t))return Qe.distancePointLine(e,i,r);if(i.equals(r))return Qe.distancePointLine(r,e,t);var o=!1;if(E.intersects(e,t,i,r)){var n=(t.x-e.x)*(r.y-i.y)-(t.y-e.y)*(r.x-i.x);if(0===n)o=!0;else{var a=(e.y-i.y)*(r.x-i.x)-(e.x-i.x)*(r.y-i.y),s=((e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y))/n,l=a/n;(l<0||1<l||s<0||1<s)&&(o=!0)}}else o=!0;return o?I.min(Qe.distancePointLine(e,i,r),Qe.distancePointLine(t,i,r),Qe.distancePointLine(i,e,t),Qe.distancePointLine(r,e,t)):0},Qe.isPointInRing=function(e,t){return Qe.locatePointInRing(e,t)!==x.EXTERIOR},Qe.computeLength=function(e){var t=e.size();if(t<=1)return 0;var i=0,r=new C;e.getCoordinate(0,r);for(var o=r.x,n=r.y,a=1;a<t;a++){e.getCoordinate(a,r);var s=r.x,l=r.y,u=s-o,c=l-n;i+=Math.sqrt(u*u+c*c),o=s,n=l}return i},Qe.isCCW=function(e){var t=e.length-1;if(t<3)throw new h("Ring has fewer than 4 points, so orientation cannot be determined");for(var i=e[0],r=0,o=1;o<=t;o++){var n=e[o];n.y>i.y&&(i=n,r=o)}for(var a=r;(a-=1)<0&&(a=t),e[a].equals2D(i)&&a!==r;);for(var s=r;e[s=(s+1)%t].equals2D(i)&&s!==r;);var l=e[a],u=e[s];if(l.equals2D(i)||u.equals2D(i)||l.equals2D(u))return!1;var c=Qe.computeOrientation(l,i,u);return 0===c?l.x>u.x:0<c},Qe.locatePointInRing=function(e,t){return Je.locatePointInRing(e,t)},Qe.distancePointLinePerpendicular=function(e,t,i){var r=(i.x-t.x)*(i.x-t.x)+(i.y-t.y)*(i.y-t.y),o=((t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y))/r;return Math.abs(o)*Math.sqrt(r)},Qe.computeOrientation=function(e,t,i){return Qe.orientationIndex(e,t,i)},Qe.distancePointLine=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];if(0===t.length)throw new h("Line array must contain at least one vertex");for(var i=e.distance(t[0]),r=0;r<t.length-1;r++){var o=Qe.distancePointLine(e,t[r],t[r+1]);o<i&&(i=o)}return i}if(3===arguments.length){var n=arguments[0],a=arguments[1],s=arguments[2];if(a.x===s.x&&a.y===s.y)return n.distance(a);var l=(s.x-a.x)*(s.x-a.x)+(s.y-a.y)*(s.y-a.y),u=((n.x-a.x)*(s.x-a.x)+(n.y-a.y)*(s.y-a.y))/l;if(u<=0)return n.distance(a);if(1<=u)return n.distance(s);var c=((a.y-n.y)*(s.x-a.x)-(a.x-n.x)*(s.y-a.y))/l;return Math.abs(c)*Math.sqrt(l)}},Qe.isOnLine=function(e,t){for(var i=new Ye,r=1;r<t.length;r++){var o=t[r-1],n=t[r];if(i.computeIntersection(e,o,n),i.hasIntersection())return!0}return!1},Qe.RIGHT=Qe.CLOCKWISE=-1,Qe.LEFT=Qe.COUNTERCLOCKWISE=1,Qe.STRAIGHT=Qe.COLLINEAR=0,t(Ke.prototype,{minX:function(){return Math.min(this.p0.x,this.p1.x)},orientationIndex:function(){if(arguments[0]instanceof Ke){var e=arguments[0],t=Qe.orientationIndex(this.p0,this.p1,e.p0),i=Qe.orientationIndex(this.p0,this.p1,e.p1);return 0<=t&&0<=i?Math.max(t,i):t<=0&&i<=0?Math.max(t,i):0}if(arguments[0]instanceof C){var r=arguments[0];return Qe.orientationIndex(this.p0,this.p1,r)}},toGeometry:function(e){return e.createLineString([this.p0,this.p1])},isVertical:function(){return this.p0.x===this.p1.x},equals:function(e){if(!(e instanceof Ke))return!1;var t=e;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)},intersection:function(e){var t=new Ye;return t.computeIntersection(this.p0,this.p1,e.p0,e.p1),t.hasIntersection()?t.getIntersection(0):null},project:function(){if(arguments[0]instanceof C){var e=arguments[0];if(e.equals(this.p0)||e.equals(this.p1))return new C(e);var t=this.projectionFactor(e),i=new C;return i.x=this.p0.x+t*(this.p1.x-this.p0.x),i.y=this.p0.y+t*(this.p1.y-this.p0.y),i}if(arguments[0]instanceof Ke){var r=arguments[0],o=this.projectionFactor(r.p0),n=this.projectionFactor(r.p1);if(1<=o&&1<=n)return null;if(o<=0&&n<=0)return null;var a=this.project(r.p0);o<0&&(a=this.p0),1<o&&(a=this.p1);var s=this.project(r.p1);return n<0&&(s=this.p0),1<n&&(s=this.p1),new Ke(a,s)}},normalize:function(){this.p1.compareTo(this.p0)<0&&this.reverse()},angle:function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},getCoordinate:function(e){return 0===e?this.p0:this.p1},distancePerpendicular:function(e){return Qe.distancePointLinePerpendicular(e,this.p0,this.p1)},minY:function(){return Math.min(this.p0.y,this.p1.y)},midPoint:function(){return Ke.midPoint(this.p0,this.p1)},projectionFactor:function(e){if(e.equals(this.p0))return 0;if(e.equals(this.p1))return 1;var t=this.p1.x-this.p0.x,i=this.p1.y-this.p0.y,r=t*t+i*i;return r<=0?_.NaN:((e.x-this.p0.x)*t+(e.y-this.p0.y)*i)/r},closestPoints:function(e){var t=this.intersection(e);if(null!==t)return[t,t];var i=new Array(2).fill(null),r=_.MAX_VALUE,o=null,n=this.closestPoint(e.p0);r=n.distance(e.p0),i[0]=n,i[1]=e.p0;var a=this.closestPoint(e.p1);(o=a.distance(e.p1))<r&&(r=o,i[0]=a,i[1]=e.p1);var s=e.closestPoint(this.p0);(o=s.distance(this.p0))<r&&(r=o,i[0]=this.p0,i[1]=s);var l=e.closestPoint(this.p1);return(o=l.distance(this.p1))<r&&(r=o,i[0]=this.p1,i[1]=l),i},closestPoint:function(e){var t=this.projectionFactor(e);return 0<t&&t<1?this.project(e):this.p0.distance(e)<this.p1.distance(e)?this.p0:this.p1},maxX:function(){return Math.max(this.p0.x,this.p1.x)},getLength:function(){return this.p0.distance(this.p1)},compareTo:function(e){var t=e,i=this.p0.compareTo(t.p0);return 0!==i?i:this.p1.compareTo(t.p1)},reverse:function(){var e=this.p0;this.p0=this.p1,this.p1=e},equalsTopo:function(e){return this.p0.equals(e.p0)&&this.p1.equals(e.p1)||this.p0.equals(e.p1)&&this.p1.equals(e.p0)},lineIntersection:function(e){try{return V.intersection(this.p0,this.p1,e.p0,e.p1)}catch(e){if(!(e instanceof P))throw e}return null},maxY:function(){return Math.max(this.p0.y,this.p1.y)},pointAlongOffset:function(e,t){var i=this.p0.x+e*(this.p1.x-this.p0.x),r=this.p0.y+e*(this.p1.y-this.p0.y),o=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,a=Math.sqrt(o*o+n*n),s=0,l=0;if(0!==t){if(a<=0)throw new IllegalStateException("Cannot compute offset from zero-length line segment");s=t*o/a,l=t*n/a}return new C(i-l,r+s)},setCoordinates:function(){if(1===arguments.length){var e=arguments[0];this.setCoordinates(e.p0,e.p1)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.p0.x=t.x,this.p0.y=t.y,this.p1.x=i.x,this.p1.y=i.y}},segmentFraction:function(e){var t=this.projectionFactor(e);return t<0?t=0:(1<t||_.isNaN(t))&&(t=1),t},toString:function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},isHorizontal:function(){return this.p0.y===this.p1.y},distance:function(){if(arguments[0]instanceof Ke){var e=arguments[0];return Qe.distanceLineLine(this.p0,this.p1,e.p0,e.p1)}if(arguments[0]instanceof C){var t=arguments[0];return Qe.distancePointLine(t,this.p0,this.p1)}},pointAlong:function(e){var t=new C;return t.x=this.p0.x+e*(this.p1.x-this.p0.x),t.y=this.p0.y+e*(this.p1.y-this.p0.y),t},hashCode:function(){var e=java.lang.Double.doubleToLongBits(this.p0.x);e^=31*java.lang.Double.doubleToLongBits(this.p0.y);var t=Math.trunc(e)^Math.trunc(e>>32),i=java.lang.Double.doubleToLongBits(this.p1.x);return i^=31*java.lang.Double.doubleToLongBits(this.p1.y),t^(Math.trunc(i)^Math.trunc(i>>32))},interfaces_:function(){return[i,a]},getClass:function(){return Ke}}),Ke.midPoint=function(e,t){return new C((e.x+t.x)/2,(e.y+t.y)/2)},Ke.serialVersionUID=0x2d2172135f411c00,t($e.prototype,{isIntersects:function(){return!this.isDisjoint()},isCovers:function(){return($e.isTrue(this.matrix[x.INTERIOR][x.INTERIOR])||$e.isTrue(this.matrix[x.INTERIOR][x.BOUNDARY])||$e.isTrue(this.matrix[x.BOUNDARY][x.INTERIOR])||$e.isTrue(this.matrix[x.BOUNDARY][x.BOUNDARY]))&&this.matrix[x.EXTERIOR][x.INTERIOR]===ue.FALSE&&this.matrix[x.EXTERIOR][x.BOUNDARY]===ue.FALSE},isCoveredBy:function(){return($e.isTrue(this.matrix[x.INTERIOR][x.INTERIOR])||$e.isTrue(this.matrix[x.INTERIOR][x.BOUNDARY])||$e.isTrue(this.matrix[x.BOUNDARY][x.INTERIOR])||$e.isTrue(this.matrix[x.BOUNDARY][x.BOUNDARY]))&&this.matrix[x.INTERIOR][x.EXTERIOR]===ue.FALSE&&this.matrix[x.BOUNDARY][x.EXTERIOR]===ue.FALSE},set:function(){if(1===arguments.length)for(var e=arguments[0],t=0;t<e.length;t++){var i=Math.trunc(t/3),r=t%3;this.matrix[i][r]=ue.toDimensionValue(e.charAt(t))}else if(3===arguments.length){var o=arguments[0],n=arguments[1],a=arguments[2];this.matrix[o][n]=a}},isContains:function(){return $e.isTrue(this.matrix[x.INTERIOR][x.INTERIOR])&&this.matrix[x.EXTERIOR][x.INTERIOR]===ue.FALSE&&this.matrix[x.EXTERIOR][x.BOUNDARY]===ue.FALSE},setAtLeast:function(){if(1===arguments.length)for(var e=arguments[0],t=0;t<e.length;t++){var i=Math.trunc(t/3),r=t%3;this.setAtLeast(i,r,ue.toDimensionValue(e.charAt(t)))}else if(3===arguments.length){var o=arguments[0],n=arguments[1],a=arguments[2];this.matrix[o][n]<a&&(this.matrix[o][n]=a)}},setAtLeastIfValid:function(e,t,i){0<=e&&0<=t&&this.setAtLeast(e,t,i)},isWithin:function(){return $e.isTrue(this.matrix[x.INTERIOR][x.INTERIOR])&&this.matrix[x.INTERIOR][x.EXTERIOR]===ue.FALSE&&this.matrix[x.BOUNDARY][x.EXTERIOR]===ue.FALSE},isTouches:function(e,t){return t<e?this.isTouches(t,e):(e===ue.A&&t===ue.A||e===ue.L&&t===ue.L||e===ue.L&&t===ue.A||e===ue.P&&t===ue.A||e===ue.P&&t===ue.L)&&this.matrix[x.INTERIOR][x.INTERIOR]===ue.FALSE&&($e.isTrue(this.matrix[x.INTERIOR][x.BOUNDARY])||$e.isTrue(this.matrix[x.BOUNDARY][x.INTERIOR])||$e.isTrue(this.matrix[x.BOUNDARY][x.BOUNDARY]))},isOverlaps:function(e,t){return e===ue.P&&t===ue.P||e===ue.A&&t===ue.A?$e.isTrue(this.matrix[x.INTERIOR][x.INTERIOR])&&$e.isTrue(this.matrix[x.INTERIOR][x.EXTERIOR])&&$e.isTrue(this.matrix[x.EXTERIOR][x.INTERIOR]):e===ue.L&&t===ue.L&&1===this.matrix[x.INTERIOR][x.INTERIOR]&&$e.isTrue(this.matrix[x.INTERIOR][x.EXTERIOR])&&$e.isTrue(this.matrix[x.EXTERIOR][x.INTERIOR])},isEquals:function(e,t){return e===t&&$e.isTrue(this.matrix[x.INTERIOR][x.INTERIOR])&&this.matrix[x.INTERIOR][x.EXTERIOR]===ue.FALSE&&this.matrix[x.BOUNDARY][x.EXTERIOR]===ue.FALSE&&this.matrix[x.EXTERIOR][x.INTERIOR]===ue.FALSE&&this.matrix[x.EXTERIOR][x.BOUNDARY]===ue.FALSE},toString:function(){for(var e=new D("123456789"),t=0;t<3;t++)for(var i=0;i<3;i++)e.setCharAt(3*t+i,ue.toDimensionSymbol(this.matrix[t][i]));return e.toString()},setAll:function(e){for(var t=0;t<3;t++)for(var i=0;i<3;i++)this.matrix[t][i]=e},get:function(e,t){return this.matrix[e][t]},transpose:function(){var e=this.matrix[1][0];return this.matrix[1][0]=this.matrix[0][1],this.matrix[0][1]=e,e=this.matrix[2][0],this.matrix[2][0]=this.matrix[0][2],this.matrix[0][2]=e,e=this.matrix[2][1],this.matrix[2][1]=this.matrix[1][2],this.matrix[1][2]=e,this},matches:function(e){if(9!==e.length)throw new h("Should be length 9: "+e);for(var t=0;t<3;t++)for(var i=0;i<3;i++)if(!$e.matches(this.matrix[t][i],e.charAt(3*t+i)))return!1;return!0},add:function(e){for(var t=0;t<3;t++)for(var i=0;i<3;i++)this.setAtLeast(t,i,e.get(t,i))},isDisjoint:function(){return this.matrix[x.INTERIOR][x.INTERIOR]===ue.FALSE&&this.matrix[x.INTERIOR][x.BOUNDARY]===ue.FALSE&&this.matrix[x.BOUNDARY][x.INTERIOR]===ue.FALSE&&this.matrix[x.BOUNDARY][x.BOUNDARY]===ue.FALSE},isCrosses:function(e,t){return e===ue.P&&t===ue.L||e===ue.P&&t===ue.A||e===ue.L&&t===ue.A?$e.isTrue(this.matrix[x.INTERIOR][x.INTERIOR])&&$e.isTrue(this.matrix[x.INTERIOR][x.EXTERIOR]):e===ue.L&&t===ue.P||e===ue.A&&t===ue.P||e===ue.A&&t===ue.L?$e.isTrue(this.matrix[x.INTERIOR][x.INTERIOR])&&$e.isTrue(this.matrix[x.EXTERIOR][x.INTERIOR]):e===ue.L&&t===ue.L&&0===this.matrix[x.INTERIOR][x.INTERIOR]},interfaces_:function(){return[o]},getClass:function(){return $e}}),$e.matches=function(){if(Number.isInteger(arguments[0])&&"string"==typeof arguments[1]){var e=arguments[0],t=arguments[1];return t===ue.SYM_DONTCARE||t===ue.SYM_TRUE&&(0<=e||e===ue.TRUE)||t===ue.SYM_FALSE&&e===ue.FALSE||t===ue.SYM_P&&e===ue.P||t===ue.SYM_L&&e===ue.L||t===ue.SYM_A&&e===ue.A}if("string"==typeof arguments[0]&&"string"==typeof arguments[1]){var i=arguments[0],r=arguments[1];return new $e(i).matches(r)}},$e.isTrue=function(e){return 0<=e||e===ue.TRUE};var Yn=Object.freeze({Coordinate:C,CoordinateList:b,Envelope:E,LineSegment:Ke,GeometryFactory:ze,Geometry:G,Point:Pe,LineString:Ee,LinearRing:De,Polygon:Te,GeometryCollection:de,MultiPoint:Ie,MultiLineString:me,MultiPolygon:Le,Dimension:ue,IntersectionMatrix:$e,PrecisionModel:Be});t(Ze.prototype,{addPoint:function(e){this.ptCount+=1,this.ptCentSum.x+=e.x,this.ptCentSum.y+=e.y},setBasePoint:function(e){null===this.areaBasePt&&(this.areaBasePt=e)},addLineSegments:function(e){for(var t=0,i=0;i<e.length-1;i++){var r=e[i].distance(e[i+1]);if(0!==r){t+=r;var o=(e[i].x+e[i+1].x)/2;this.lineCentSum.x+=r*o;var n=(e[i].y+e[i+1].y)/2;this.lineCentSum.y+=r*n}}this.totalLength+=t,0===t&&0<e.length&&this.addPoint(e[0])},addHole:function(e){for(var t=Qe.isCCW(e),i=0;i<e.length-1;i++)this.addTriangle(this.areaBasePt,e[i],e[i+1],t);this.addLineSegments(e)},getCentroid:function(){var e=new C;if(0<Math.abs(this.areasum2))e.x=this.cg3.x/3/this.areasum2,e.y=this.cg3.y/3/this.areasum2;else if(0<this.totalLength)e.x=this.lineCentSum.x/this.totalLength,e.y=this.lineCentSum.y/this.totalLength;else{if(!(0<this.ptCount))return null;e.x=this.ptCentSum.x/this.ptCount,e.y=this.ptCentSum.y/this.ptCount}return e},addShell:function(e){0<e.length&&this.setBasePoint(e[0]);for(var t=!Qe.isCCW(e),i=0;i<e.length-1;i++)this.addTriangle(this.areaBasePt,e[i],e[i+1],t);this.addLineSegments(e)},addTriangle:function(e,t,i,r){var o=r?1:-1;Ze.centroid3(e,t,i,this.triangleCent3);var n=Ze.area2(e,t,i);this.cg3.x+=o*n*this.triangleCent3.x,this.cg3.y+=o*n*this.triangleCent3.y,this.areasum2+=o*n},add:function(){if(arguments[0]instanceof Te){var e=arguments[0];this.addShell(e.getExteriorRing().getCoordinates());for(var t=0;t<e.getNumInteriorRing();t++)this.addHole(e.getInteriorRingN(t).getCoordinates())}else if(arguments[0]instanceof G){var i=arguments[0];if(i.isEmpty())return null;if(i instanceof Pe)this.addPoint(i.getCoordinate());else if(i instanceof Ee)this.addLineSegments(i.getCoordinates());else if(i instanceof Te){var r=i;this.add(r)}else if(i instanceof de){var o=i;for(t=0;t<o.getNumGeometries();t++)this.add(o.getGeometryN(t))}}},interfaces_:function(){return[]},getClass:function(){return Ze}}),Ze.area2=function(e,t,i){return(t.x-e.x)*(i.y-e.y)-(i.x-e.x)*(t.y-e.y)},Ze.centroid3=function(e,t,i,r){return r.x=e.x+t.x+i.x,r.y=e.y+t.y+i.y,null},Ze.getCentroid=function(e){return new Ze(e).getCentroid()},(et.prototype=new Error).name="EmptyStackException",(tt.prototype=new v).add=function(e){return this.array_.push(e),!0},tt.prototype.get=function(e){if(e<0||e>=this.size())throw new IndexOutOfBoundsException;return this.array_[e]},tt.prototype.push=function(e){return this.array_.push(e),e},tt.prototype.pop=function(e){if(0===this.array_.length)throw new et;return this.array_.pop()},tt.prototype.peek=function(){if(0===this.array_.length)throw new et;return this.array_[this.array_.length-1]},tt.prototype.empty=function(){return 0===this.array_.length},tt.prototype.isEmpty=function(){return this.empty()},tt.prototype.search=function(e){return this.array_.indexOf(e)},tt.prototype.size=function(){return this.array_.length},tt.prototype.toArray=function(){for(var e=[],t=0,i=this.array_.length;t<i;t++)e.push(this.array_[t]);return e},t(it.prototype,{filter:function(e){this.treeSet.contains(e)||(this.list.add(e),this.treeSet.add(e))},getCoordinates:function(){var e=new Array(this.list.size()).fill(null);return this.list.toArray(e)},interfaces_:function(){return[k]},getClass:function(){return it}}),it.filterCoordinates=function(e){for(var t=new it,i=0;i<e.length;i++)t.filter(e[i]);return t.getCoordinates()},t(rt.prototype,{preSort:function(e){for(var t=null,i=1;i<e.length;i++)(e[i].y<e[0].y||e[i].y===e[0].y&&e[i].x<e[0].x)&&(t=e[0],e[0]=e[i],e[i]=t);return le.sort(e,1,e.length,new ot(e[0])),e},computeOctRing:function(e){var t=this.computeOctPts(e),i=new b;return i.add(t,!1),i.size()<3?null:(i.closeRing(),i.toCoordinateArray())},lineOrPolygon:function(e){if(3===(e=this.cleanRing(e)).length)return this.geomFactory.createLineString([e[0],e[1]]);var t=this.geomFactory.createLinearRing(e);return this.geomFactory.createPolygon(t,null)},cleanRing:function(e){m.equals(e[0],e[e.length-1]);for(var t=new w,i=null,r=0;r<=e.length-2;r++){var o=e[r],n=e[r+1];o.equals(n)||null!==i&&this.isBetween(i,o,n)||(t.add(o),i=o)}t.add(e[e.length-1]);var a=new Array(t.size()).fill(null);return t.toArray(a)},isBetween:function(e,t,i){if(0!==Qe.computeOrientation(e,t,i))return!1;if(e.x!==i.x){if(e.x<=t.x&&t.x<=i.x)return!0;if(i.x<=t.x&&t.x<=e.x)return!0}if(e.y!==i.y){if(e.y<=t.y&&t.y<=i.y)return!0;if(i.y<=t.y&&t.y<=e.y)return!0}return!1},reduce:function(e){var t=this.computeOctRing(e);if(null===t)return e;for(var i=new se,r=0;r<t.length;r++)i.add(t[r]);for(r=0;r<e.length;r++)Qe.isPointInRing(e[r],t)||i.add(e[r]);var o=q.toCoordinateArray(i);return o.length<3?this.padArray3(o):o},getConvexHull:function(){if(0===this.inputPts.length)return this.geomFactory.createGeometryCollection(null);if(1===this.inputPts.length)return this.geomFactory.createPoint(this.inputPts[0]);if(2===this.inputPts.length)return this.geomFactory.createLineString(this.inputPts);var e=this.inputPts;50<this.inputPts.length&&(e=this.reduce(this.inputPts));var t=this.preSort(e),i=this.grahamScan(t),r=this.toCoordinateArray(i);return this.lineOrPolygon(r)},padArray3:function(e){for(var t=new Array(3).fill(null),i=0;i<t.length;i++)i<e.length?t[i]=e[i]:t[i]=e[0];return t},computeOctPts:function(e){for(var t=new Array(8).fill(null),i=0;i<t.length;i++)t[i]=e[0];for(var r=1;r<e.length;r++)e[r].x<t[0].x&&(t[0]=e[r]),e[r].x-e[r].y<t[1].x-t[1].y&&(t[1]=e[r]),e[r].y>t[2].y&&(t[2]=e[r]),e[r].x+e[r].y>t[3].x+t[3].y&&(t[3]=e[r]),e[r].x>t[4].x&&(t[4]=e[r]),e[r].x-e[r].y>t[5].x-t[5].y&&(t[5]=e[r]),e[r].y<t[6].y&&(t[6]=e[r]),e[r].x+e[r].y<t[7].x+t[7].y&&(t[7]=e[r]);return t},toCoordinateArray:function(e){for(var t=new Array(e.size()).fill(null),i=0;i<e.size();i++){var r=e.get(i);t[i]=r}return t},grahamScan:function(e){var t=null,i=new tt;t=i.push(e[0]),t=i.push(e[1]),t=i.push(e[2]);for(var r=3;r<e.length;r++){for(t=i.pop();!i.empty()&&0<Qe.computeOrientation(i.peek(),t,e[r]);)t=i.pop();t=i.push(t),t=i.push(e[r])}return t=i.push(e[0]),i},interfaces_:function(){return[]},getClass:function(){return rt}}),rt.extractCoordinates=function(e){var t=new it;return e.apply(t),t.getCoordinates()},t(ot.prototype,{compare:function(e,t){var i=e,r=t;return ot.polarCompare(this.origin,i,r)},interfaces_:function(){return[n]},getClass:function(){return ot}}),ot.polarCompare=function(e,t,i){var r=t.x-e.x,o=t.y-e.y,n=i.x-e.x,a=i.y-e.y,s=Qe.computeOrientation(e,t,i);if(s===Qe.COUNTERCLOCKWISE)return 1;if(s===Qe.CLOCKWISE)return-1;var l=r*r+o*o,u=n*n+a*a;return l<u?-1:u<l?1:0},rt.RadialComparator=ot,t(nt.prototype,{transformPoint:function(e,t){return this.factory.createPoint(this.transformCoordinates(e.getCoordinateSequence(),e))},transformPolygon:function(e,t){var i=!0,r=this.transformLinearRing(e.getExteriorRing(),e);null!==r&&r instanceof De&&!r.isEmpty()||(i=!1);for(var o=new w,n=0;n<e.getNumInteriorRing();n++){var a=this.transformLinearRing(e.getInteriorRingN(n),e);null===a||a.isEmpty()||(a instanceof De||(i=!1),o.add(a))}if(i)return this.factory.createPolygon(r,o.toArray([]));var s=new w;return null!==r&&s.add(r),s.addAll(o),this.factory.buildGeometry(s)},createCoordinateSequence:function(e){return this.factory.getCoordinateSequenceFactory().create(e)},getInputGeometry:function(){return this.inputGeom},transformMultiLineString:function(e,t){for(var i=new w,r=0;r<e.getNumGeometries();r++){var o=this.transformLineString(e.getGeometryN(r),e);null!==o&&(o.isEmpty()||i.add(o))}return this.factory.buildGeometry(i)},transformCoordinates:function(e,t){return this.copy(e)},transformLineString:function(e,t){return this.factory.createLineString(this.transformCoordinates(e.getCoordinateSequence(),e))},transformMultiPoint:function(e,t){for(var i=new w,r=0;r<e.getNumGeometries();r++){var o=this.transformPoint(e.getGeometryN(r),e);null!==o&&(o.isEmpty()||i.add(o))}return this.factory.buildGeometry(i)},transformMultiPolygon:function(e,t){for(var i=new w,r=0;r<e.getNumGeometries();r++){var o=this.transformPolygon(e.getGeometryN(r),e);null!==o&&(o.isEmpty()||i.add(o))}return this.factory.buildGeometry(i)},copy:function(e){return e.copy()},transformGeometryCollection:function(e,t){for(var i=new w,r=0;r<e.getNumGeometries();r++){var o=this.transform(e.getGeometryN(r));null!==o&&(this.pruneEmptyGeometry&&o.isEmpty()||i.add(o))}return this.preserveGeometryCollectionType?this.factory.createGeometryCollection(ze.toGeometryArray(i)):this.factory.buildGeometry(i)},transform:function(e){if(this.inputGeom=e,this.factory=e.getFactory(),e instanceof Pe)return this.transformPoint(e,null);if(e instanceof Ie)return this.transformMultiPoint(e,null);if(e instanceof De)return this.transformLinearRing(e,null);if(e instanceof Ee)return this.transformLineString(e,null);if(e instanceof me)return this.transformMultiLineString(e,null);if(e instanceof Te)return this.transformPolygon(e,null);if(e instanceof Le)return this.transformMultiPolygon(e,null);if(e instanceof de)return this.transformGeometryCollection(e,null);throw new h("Unknown Geometry subtype: "+e.getClass().getName())},transformLinearRing:function(e,t){var i=this.transformCoordinates(e.getCoordinateSequence(),e);if(null===i)return this.factory.createLinearRing(null);var r=i.size();return 0<r&&r<4&&!this.preserveType?this.factory.createLineString(i):this.factory.createLinearRing(i)},interfaces_:function(){return[]},getClass:function(){return nt}}),t(at.prototype,{snapVertices:function(e,t){for(var i=this._isClosed?e.size()-1:e.size(),r=0;r<i;r++){var o=e.get(r),n=this.findSnapForVertex(o,t);null!==n&&(e.set(r,new C(n)),0===r&&this._isClosed&&e.set(e.size()-1,new C(n)))}},findSnapForVertex:function(e,t){for(var i=0;i<t.length;i++){if(e.equals2D(t[i]))return null;if(e.distance(t[i])<this.snapTolerance)return t[i]}return null},snapTo:function(e){var t=new b(this.srcPts);return this.snapVertices(t,e),this.snapSegments(t,e),t.toCoordinateArray()},snapSegments:function(e,t){if(0===t.length)return null;var i=t.length;t[0].equals2D(t[t.length-1])&&(i=t.length-1);for(var r=0;r<i;r++){var o=t[r],n=this.findSegmentIndexToSnap(o,e);0<=n&&e.add(n+1,new C(o),!1)}},findSegmentIndexToSnap:function(e,t){for(var i=_.MAX_VALUE,r=-1,o=0;o<t.size()-1;o++){if(this.seg.p0=t.get(o),this.seg.p1=t.get(o+1),this.seg.p0.equals2D(e)||this.seg.p1.equals2D(e)){if(this.allowSnappingToSourceVertices)continue;return-1}var n=this.seg.distance(e);n<this.snapTolerance&&n<i&&(i=n,r=o)}return r},setAllowSnappingToSourceVertices:function(e){this.allowSnappingToSourceVertices=e},interfaces_:function(){return[]},getClass:function(){return at}}),at.isClosed=function(e){return!(e.length<=1)&&e[0].equals2D(e[e.length-1])},t(st.prototype,{snapTo:function(e,t){return new lt(t,this.extractTargetCoordinates(e)).transform(this.srcGeom)},snapToSelf:function(e,t){var i=new lt(e,this.extractTargetCoordinates(this.srcGeom),!0).transform(this.srcGeom),r=i;return t&&T(r,xe)&&(r=i.buffer(0)),r},computeSnapTolerance:function(e){return this.computeMinimumSegmentLength(e)/10},extractTargetCoordinates:function(e){for(var t=new se,i=e.getCoordinates(),r=0;r<i.length;r++)t.add(i[r]);return t.toArray(new Array(0).fill(null))},computeMinimumSegmentLength:function(e){for(var t=_.MAX_VALUE,i=0;i<e.length-1;i++){var r=e[i].distance(e[i+1]);r<t&&(t=r)}return t},interfaces_:function(){return[]},getClass:function(){return st}}),st.snap=function(e,t,i){var r=new Array(2).fill(null),o=new st(e);r[0]=o.snapTo(t,i);var n=new st(t);return r[1]=n.snapTo(r[0],i),r},st.computeOverlaySnapTolerance=function(){if(1===arguments.length){var e=arguments[0],t=st.computeSizeBasedSnapTolerance(e),i=e.getPrecisionModel();if(i.getType()===Be.FIXED){var r=1/i.getScale()*2/1.415;t<r&&(t=r)}return t}if(2===arguments.length){var o=arguments[0],n=arguments[1];return Math.min(st.computeOverlaySnapTolerance(o),st.computeOverlaySnapTolerance(n))}},st.computeSizeBasedSnapTolerance=function(e){var t=e.getEnvelopeInternal();return Math.min(t.getHeight(),t.getWidth())*st.SNAP_PRECISION_FACTOR},st.snapToSelf=function(e,t,i){return new st(e).snapToSelf(t,i)},st.SNAP_PRECISION_FACTOR=1e-9,s(lt,nt),t(lt.prototype,{snapLine:function(e,t){var i=new at(e,this.snapTolerance);return i.setAllowSnappingToSourceVertices(this.isSelfSnap),i.snapTo(t)},transformCoordinates:function(e,t){var i=e.toCoordinateArray(),r=this.snapLine(i,this.snapPts);return this.factory.getCoordinateSequenceFactory().create(r)},interfaces_:function(){return[]},getClass:function(){return lt}}),t(ut.prototype,{getCommon:function(){return _.longBitsToDouble(this.commonBits)},add:function(e){var t=_.doubleToLongBits(e);return this.isFirst?(this.commonBits=t,this.commonSignExp=ut.signExpBits(this.commonBits),this.isFirst=!1,null):ut.signExpBits(t)!==this.commonSignExp?(this.commonBits=0,null):(this.commonMantissaBitsCount=ut.numCommonMostSigMantissaBits(this.commonBits,t),void(this.commonBits=ut.zeroLowerBits(this.commonBits,64-(12+this.commonMantissaBitsCount))))},toString:function(){if(1===arguments.length){var e=arguments[0],t=_.longBitsToDouble(e),i="0000000000000000000000000000000000000000000000000000000000000000"+Long.toBinaryString(e),r=i.substring(i.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+t+" ]"}},interfaces_:function(){return[]},getClass:function(){return ut}}),ut.getBit=function(e,t){return 0!=(e&1<<t)?1:0},ut.signExpBits=function(e){return e>>52},ut.zeroLowerBits=function(e,t){return e&~((1<<t)-1)},ut.numCommonMostSigMantissaBits=function(e,t){for(var i=0,r=52;0<=r;r--){if(ut.getBit(e,r)!==ut.getBit(t,r))return i;i++}return 52},t(ct.prototype,{addCommonBits:function(e){var t=new dt(this.commonCoord);e.apply(t),e.geometryChanged()},removeCommonBits:function(e){if(0===this.commonCoord.x&&0===this.commonCoord.y)return e;var t=new C(this.commonCoord);t.x=-t.x,t.y=-t.y;var i=new dt(t);return e.apply(i),e.geometryChanged(),e},getCommonCoordinate:function(){return this.commonCoord},add:function(e){e.apply(this.ccFilter),this.commonCoord=this.ccFilter.getCommonCoordinate()},interfaces_:function(){return[]},getClass:function(){return ct}}),t(ht.prototype,{filter:function(e){this.commonBitsX.add(e.x),this.commonBitsY.add(e.y)},getCommonCoordinate:function(){return new C(this.commonBitsX.getCommon(),this.commonBitsY.getCommon())},interfaces_:function(){return[k]},getClass:function(){return ht}}),t(dt.prototype,{filter:function(e,t){var i=e.getOrdinate(t,0)+this.trans.x,r=e.getOrdinate(t,1)+this.trans.y;e.setOrdinate(t,0,i),e.setOrdinate(t,1,r)},isDone:function(){return!1},isGeometryChanged:function(){return!0},interfaces_:function(){return[he]},getClass:function(){return dt}}),ct.CommonCoordinateFilter=ht,ct.Translater=dt,t(mt.prototype,{next:function(){if(this.atStart)return this.atStart=!1,mt.isAtomic(this.parent)&&this.index++,this.parent;if(null!==this.subcollectionIterator){if(this.subcollectionIterator.hasNext())return this.subcollectionIterator.next();this.subcollectionIterator=null}if(this.index>=this.max)throw new p;var e=this.parent.getGeometryN(this.index++);return e instanceof de?(this.subcollectionIterator=new mt(e),this.subcollectionIterator.next()):e},remove:function(){throw new UnsupportedOperationException(this.getClass().getName())},hasNext:function(){if(this.atStart)return!0;if(null!==this.subcollectionIterator){if(this.subcollectionIterator.hasNext())return!0;this.subcollectionIterator=null}return!(this.index>=this.max)},interfaces_:function(){return[c]},getClass:function(){return mt}}),mt.isAtomic=function(e){return!(e instanceof de)},t(pt.prototype,{locateInternal:function(){if(arguments[0]instanceof C&&arguments[1]instanceof Te){var e=arguments[0],t=arguments[1];if(t.isEmpty())return x.EXTERIOR;var i=t.getExteriorRing(),r=this.locateInPolygonRing(e,i);if(r===x.EXTERIOR)return x.EXTERIOR;if(r===x.BOUNDARY)return x.BOUNDARY;for(var o=0;o<t.getNumInteriorRing();o++){var n=t.getInteriorRingN(o),a=this.locateInPolygonRing(e,n);if(a===x.INTERIOR)return x.EXTERIOR;if(a===x.BOUNDARY)return x.BOUNDARY}return x.INTERIOR}if(arguments[0]instanceof C&&arguments[1]instanceof Ee){var s=arguments[0],l=arguments[1];if(!l.getEnvelopeInternal().intersects(s))return x.EXTERIOR;var u=l.getCoordinates();return l.isClosed()||!s.equals(u[0])&&!s.equals(u[u.length-1])?Qe.isOnLine(s,u)?x.INTERIOR:x.EXTERIOR:x.BOUNDARY}if(arguments[0]instanceof C&&arguments[1]instanceof Pe){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?x.INTERIOR:x.EXTERIOR}},locateInPolygonRing:function(e,t){return t.getEnvelopeInternal().intersects(e)?Qe.locatePointInRing(e,t.getCoordinates()):x.EXTERIOR},intersects:function(e,t){return this.locate(e,t)!==x.EXTERIOR},updateLocationInfo:function(e){e===x.INTERIOR&&(this.isIn=!0),e===x.BOUNDARY&&this.numBoundaries++},computeLocation:function(e,t){if(t instanceof Pe&&this.updateLocationInfo(this.locateInternal(e,t)),t instanceof Ee)this.updateLocationInfo(this.locateInternal(e,t));else if(t instanceof Te)this.updateLocationInfo(this.locateInternal(e,t));else if(t instanceof me)for(var i=t,r=0;r<i.getNumGeometries();r++){var o=i.getGeometryN(r);this.updateLocationInfo(this.locateInternal(e,o))}else if(t instanceof Le){var n=t;for(r=0;r<n.getNumGeometries();r++){var a=n.getGeometryN(r);this.updateLocationInfo(this.locateInternal(e,a))}}else if(t instanceof de)for(var s=new mt(t);s.hasNext();){var l=s.next();l!==t&&this.computeLocation(e,l)}},locate:function(e,t){return t.isEmpty()?x.EXTERIOR:t instanceof Ee?this.locateInternal(e,t):t instanceof Te?this.locateInternal(e,t):(this.isIn=!1,this.numBoundaries=0,this.computeLocation(e,t),this.boundaryRule.isInBoundary(this.numBoundaries)?x.BOUNDARY:0<this.numBoundaries||this.isIn?x.INTERIOR:x.EXTERIOR)},interfaces_:function(){return[]},getClass:function(){return pt}}),t(gt.prototype,{interfaces_:function(){return[]},getClass:function(){return gt}}),gt.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var e=arguments[0],t=arguments[1];if(0===e&&0===t)throw new h("Cannot compute the octant for point ( "+e+", "+t+" )");var i=Math.abs(e),r=Math.abs(t);return 0<=e?0<=t?r<=i?0:1:r<=i?7:6:0<=t?r<=i?3:2:r<=i?4:5}if(arguments[0]instanceof C&&arguments[1]instanceof C){var o=arguments[0],n=arguments[1],a=n.x-o.x,s=n.y-o.y;if(0===a&&0===s)throw new h("Cannot compute the octant for two identical points "+o);return gt.octant(a,s)}},t(ft.prototype,{getCoordinates:function(){},size:function(){},getCoordinate:function(e){},isClosed:function(){},setData:function(e){},getData:function(){},interfaces_:function(){return[]},getClass:function(){return ft}}),t(vt.prototype,{getCoordinates:function(){return this.pts},size:function(){return this.pts.length},getCoordinate:function(e){return this.pts[e]},isClosed:function(){return this.pts[0].equals(this.pts[this.pts.length-1])},getSegmentOctant:function(e){return e===this.pts.length-1?-1:gt.octant(this.getCoordinate(e),this.getCoordinate(e+1))},setData:function(e){this.data=e},getData:function(){return this.data},toString:function(){return Ue.toLineString(new Ve(this.pts))},interfaces_:function(){return[ft]},getClass:function(){return vt}}),t(_t.prototype,{getBounds:function(){},interfaces_:function(){return[]},getClass:function(){return _t}}),t(yt.prototype,{getItem:function(){return this.item},getBounds:function(){return this.bounds},interfaces_:function(){return[_t,a]},getClass:function(){return yt}}),t(Ct.prototype,{poll:function(){if(this.isEmpty())return null;var e=this.items.get(1);return this.items.set(1,this.items.get(this._size)),this._size-=1,this.reorder(1),e},size:function(){return this._size},reorder:function(e){for(var t=null,i=this.items.get(e);2*e<=this._size&&((t=2*e)!==this._size&&this.items.get(t+1).compareTo(this.items.get(t))<0&&t++,this.items.get(t).compareTo(i)<0);e=t)this.items.set(e,this.items.get(t));this.items.set(e,i)},clear:function(){this._size=0,this.items.clear()},isEmpty:function(){return 0===this._size},add:function(e){this.items.add(null),this._size+=1;var t=this._size;for(this.items.set(0,e);e.compareTo(this.items.get(Math.trunc(t/2)))<0;t/=2)this.items.set(t,this.items.get(Math.trunc(t/2)));this.items.set(t,e)},interfaces_:function(){return[]},getClass:function(){return Ct}}),t(wt.prototype,{visitItem:function(e){},interfaces_:function(){return[]},getClass:function(){return wt}}),t(bt.prototype,{insert:function(e,t){},remove:function(e,t){},query:function(){1===arguments.length?arguments[0]:2===arguments.length&&(arguments[0],arguments[1])},interfaces_:function(){return[]},getClass:function(){return bt}}),t(Et.prototype,{getLevel:function(){return this.level},size:function(){return this.childBoundables.size()},getChildBoundables:function(){return this.childBoundables},addChildBoundable:function(e){m.isTrue(null===this.bounds),this.childBoundables.add(e)},isEmpty:function(){return this.childBoundables.isEmpty()},getBounds:function(){return null===this.bounds&&(this.bounds=this.computeBounds()),this.bounds},interfaces_:function(){return[_t,a]},getClass:function(){return Et}}),Et.serialVersionUID=0x5a1e55ec41369800;var Xn={reverseOrder:function(){return{compare:function(e,t){return t.compareTo(e)}}},min:function(e){return Xn.sort(e),e.get(0)},sort:function(e,t){var i=e.toArray();t?le.sort(i,t):le.sort(i);for(var r=e.iterator(),o=0,n=i.length;o<n;o++)r.next(),r.set(i[o])},singletonList:function(e){var t=new w;return t.add(e),t}};t(St.prototype,{expandToQueue:function(e,t){var i=St.isComposite(this.boundable1),r=St.isComposite(this.boundable2);if(i&&r)return St.area(this.boundable1)>St.area(this.boundable2)?this.expand(this.boundable1,this.boundable2,e,t):this.expand(this.boundable2,this.boundable1,e,t),null;if(i)return this.expand(this.boundable1,this.boundable2,e,t),null;if(r)return this.expand(this.boundable2,this.boundable1,e,t),null;throw new h("neither boundable is composite")},isLeaves:function(){return!(St.isComposite(this.boundable1)||St.isComposite(this.boundable2))},compareTo:function(e){var t=e;return this._distance<t._distance?-1:this._distance>t._distance?1:0},expand:function(e,t,i,r){for(var o=e.getChildBoundables().iterator();o.hasNext();){var n=new St(o.next(),t,this.itemDistance);n.getDistance()<r&&i.add(n)}},getBoundable:function(e){return 0===e?this.boundable1:this.boundable2},getDistance:function(){return this._distance},distance:function(){return this.isLeaves()?this.itemDistance.distance(this.boundable1,this.boundable2):this.boundable1.getBounds().distance(this.boundable2.getBounds())},interfaces_:function(){return[i]},getClass:function(){return St}}),St.area=function(e){return e.getBounds().getArea()},St.isComposite=function(e){return e instanceof Et},t(Pt.prototype,{getNodeCapacity:function(){return this.nodeCapacity},lastNode:function(e){return e.get(e.size()-1)},size:function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this.root));if(1===arguments.length){for(var e=0,t=arguments[0].getChildBoundables().iterator();t.hasNext();){var i=t.next();i instanceof Et?e+=this.size(i):i instanceof yt&&(e+=1)}return e}},removeItem:function(e,t){for(var i=null,r=e.getChildBoundables().iterator();r.hasNext();){var o=r.next();o instanceof yt&&o.getItem()===t&&(i=o)}return null!==i&&(e.getChildBoundables().remove(i),!0)},itemsTree:function(){if(0===arguments.length){this.build();var e=this.itemsTree(this.root);return null===e?new w:e}if(1===arguments.length){for(var t=arguments[0],i=new w,r=t.getChildBoundables().iterator();r.hasNext();){var o=r.next();if(o instanceof Et){var n=this.itemsTree(o);null!==n&&i.add(n)}else o instanceof yt?i.add(o.getItem()):m.shouldNeverReachHere()}return i.size()<=0?null:i}},insert:function(e,t){m.isTrue(!this.built,"Cannot insert items into an STR packed R-tree after it has been built."),this.itemBoundables.add(new yt(e,t))},boundablesAtLevel:function(){if(1===arguments.length){var e=arguments[0],t=new w;return this.boundablesAtLevel(e,this.root,t),t}if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];if(m.isTrue(-2<i),r.getLevel()===i)return o.add(r),null;for(var n=r.getChildBoundables().iterator();n.hasNext();){var a=n.next();a instanceof Et?this.boundablesAtLevel(i,a,o):(m.isTrue(a instanceof yt),-1===i&&o.add(a))}return null}},query:function(){if(1===arguments.length){var e=arguments[0];this.build();var t=new w;return this.isEmpty()||this.getIntersectsOp().intersects(this.root.getBounds(),e)&&this.query(e,this.root,t),t}if(2===arguments.length){var i=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this.root.getBounds(),i)&&this.query(i,this.root,r)}else if(3===arguments.length)if(T(arguments[2],wt)&&arguments[0]instanceof Object&&arguments[1]instanceof Et)for(var o=arguments[0],n=arguments[1],a=arguments[2],s=n.getChildBoundables(),l=0;l<s.size();l++){var u=s.get(l);this.getIntersectsOp().intersects(u.getBounds(),o)&&(u instanceof Et?this.query(o,u,a):u instanceof yt?a.visitItem(u.getItem()):m.shouldNeverReachHere())}else if(T(arguments[2],v)&&arguments[0]instanceof Object&&arguments[1]instanceof Et){var c=arguments[0],h=arguments[1],d=arguments[2];for(s=h.getChildBoundables(),l=0;l<s.size();l++){u=s.get(l);this.getIntersectsOp().intersects(u.getBounds(),c)&&(u instanceof Et?this.query(c,u,d):u instanceof yt?d.add(u.getItem()):m.shouldNeverReachHere())}}},build:function(){return this.built?null:(this.root=this.itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this.itemBoundables,-1),this.itemBoundables=null,void(this.built=!0))},getRoot:function(){return this.build(),this.root},remove:function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this.root.getBounds(),e)&&this.remove(e,this.root,t)}if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],n=this.removeItem(r,o);if(n)return!0;for(var a=null,s=r.getChildBoundables().iterator();s.hasNext();){var l=s.next();if(this.getIntersectsOp().intersects(l.getBounds(),i)&&l instanceof Et&&(n=this.remove(i,l,o))){a=l;break}}return null!==a&&a.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(a),n}},createHigherLevels:function(e,t){m.isTrue(!e.isEmpty());var i=this.createParentBoundables(e,t+1);return 1===i.size()?i.get(0):this.createHigherLevels(i,t+1)},depth:function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this.root));if(1===arguments.length){for(var e=0,t=arguments[0].getChildBoundables().iterator();t.hasNext();){var i=t.next();if(i instanceof Et){var r=this.depth(i);e<r&&(e=r)}}return e+1}},createParentBoundables:function(e,t){m.isTrue(!e.isEmpty());var i=new w;i.add(this.createNode(t));var r=new w(e);Xn.sort(r,this.getComparator());for(var o=r.iterator();o.hasNext();){var n=o.next();this.lastNode(i).getChildBoundables().size()===this.getNodeCapacity()&&i.add(this.createNode(t)),this.lastNode(i).addChildBoundable(n)}return i},isEmpty:function(){return this.built?this.root.isEmpty():this.itemBoundables.isEmpty()},interfaces_:function(){return[a]},getClass:function(){return Pt}}),Pt.compareDoubles=function(e,t){return t<e?1:e<t?-1:0},Pt.IntersectsOp=function(){},Pt.serialVersionUID=-0x35ef64c82d4c5400,Pt.DEFAULT_NODE_CAPACITY=10,t(xt.prototype,{distance:function(e,t){},interfaces_:function(){return[]},getClass:function(){return xt}}),s(Tt,Pt),t(Tt.prototype,{createParentBoundablesFromVerticalSlices:function(e,t){m.isTrue(0<e.length);for(var i=new w,r=0;r<e.length;r++)i.addAll(this.createParentBoundablesFromVerticalSlice(e[r],t));return i},createNode:function(e){return new It(e)},size:function(){return 0===arguments.length?Pt.prototype.size.call(this):Pt.prototype.size.apply(this,arguments)},insert:function(){if(2!==arguments.length)return Pt.prototype.insert.apply(this,arguments);var e=arguments[0],t=arguments[1];return e.isNull()?null:void Pt.prototype.insert.call(this,e,t)},getIntersectsOp:function(){return Tt.intersectsOp},verticalSlices:function(e,t){for(var i=Math.trunc(Math.ceil(e.size()/t)),r=new Array(t).fill(null),o=e.iterator(),n=0;n<t;n++){r[n]=new w;for(var a=0;o.hasNext()&&a<i;){var s=o.next();r[n].add(s),a++}}return r},query:function(){if(1===arguments.length){var e=arguments[0];return Pt.prototype.query.call(this,e)}if(2===arguments.length){var t=arguments[0],i=arguments[1];Pt.prototype.query.call(this,t,i)}else if(3===arguments.length)if(T(arguments[2],wt)&&arguments[0]instanceof Object&&arguments[1]instanceof Et){var r=arguments[0],o=arguments[1],n=arguments[2];Pt.prototype.query.call(this,r,o,n)}else if(T(arguments[2],v)&&arguments[0]instanceof Object&&arguments[1]instanceof Et){var a=arguments[0],s=arguments[1],l=arguments[2];Pt.prototype.query.call(this,a,s,l)}},getComparator:function(){return Tt.yComparator},createParentBoundablesFromVerticalSlice:function(e,t){return Pt.prototype.createParentBoundables.call(this,e,t)},remove:function(){if(2!==arguments.length)return Pt.prototype.remove.apply(this,arguments);var e=arguments[0],t=arguments[1];return Pt.prototype.remove.call(this,e,t)},depth:function(){return 0===arguments.length?Pt.prototype.depth.call(this):Pt.prototype.depth.apply(this,arguments)},createParentBoundables:function(e,t){m.isTrue(!e.isEmpty());var i=Math.trunc(Math.ceil(e.size()/this.getNodeCapacity())),r=new w(e);Xn.sort(r,Tt.xComparator);var o=this.verticalSlices(r,Math.trunc(Math.ceil(Math.sqrt(i))));return this.createParentBoundablesFromVerticalSlices(o,t)},nearestNeighbour:function(){if(1===arguments.length){if(T(arguments[0],xt)){var e=arguments[0],t=new St(this.getRoot(),this.getRoot(),e);return this.nearestNeighbour(t)}if(arguments[0]instanceof St){var i=arguments[0];return this.nearestNeighbour(i,_.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof Tt&&T(arguments[1],xt)){var r=arguments[0],o=arguments[1];t=new St(this.getRoot(),r.getRoot(),o);return this.nearestNeighbour(t)}if(arguments[0]instanceof St&&"number"==typeof arguments[1]){var n=arguments[0],a=arguments[1],s=null,l=new Ct;for(l.add(n);!l.isEmpty()&&0<a;){var u=l.poll(),c=u.getDistance();if(a<=c)break;u.isLeaves()?(a=c,s=u):u.expandToQueue(l,a)}return[s.getBoundable(0).getItem(),s.getBoundable(1).getItem()]}}else if(3===arguments.length){var h=arguments[0],d=arguments[1],m=arguments[2],p=new yt(h,d);t=new St(this.getRoot(),p,m);return this.nearestNeighbour(t)[0]}},interfaces_:function(){return[bt,a]},getClass:function(){return Tt}}),Tt.centreX=function(e){return Tt.avg(e.getMinX(),e.getMaxX())},Tt.avg=function(e,t){return(e+t)/2},Tt.centreY=function(e){return Tt.avg(e.getMinY(),e.getMaxY())},s(It,Et),t(It.prototype,{computeBounds:function(){for(var e=null,t=this.getChildBoundables().iterator();t.hasNext();){var i=t.next();null===e?e=new E(i.getBounds()):e.expandToInclude(i.getBounds())}return e},interfaces_:function(){return[]},getClass:function(){return It}}),Tt.STRtreeNode=It,Tt.serialVersionUID=0x39920f7d5f261e0,Tt.xComparator={interfaces_:function(){return[n]},compare:function(e,t){return Pt.compareDoubles(Tt.centreX(e.getBounds()),Tt.centreX(t.getBounds()))}},Tt.yComparator={interfaces_:function(){return[n]},compare:function(e,t){return Pt.compareDoubles(Tt.centreY(e.getBounds()),Tt.centreY(t.getBounds()))}},Tt.intersectsOp={interfaces_:function(){return[IntersectsOp]},intersects:function(e,t){return e.intersects(t)}},Tt.DEFAULT_NODE_CAPACITY=10,t(Dt.prototype,{interfaces_:function(){return[]},getClass:function(){return Dt}}),Dt.relativeSign=function(e,t){return e<t?-1:t<e?1:0},Dt.compare=function(e,t,i){if(t.equals2D(i))return 0;var r=Dt.relativeSign(t.x,i.x),o=Dt.relativeSign(t.y,i.y);switch(e){case 0:return Dt.compareValue(r,o);case 1:return Dt.compareValue(o,r);case 2:return Dt.compareValue(o,-r);case 3:return Dt.compareValue(-r,o);case 4:return Dt.compareValue(-r,-o);case 5:return Dt.compareValue(-o,-r);case 6:return Dt.compareValue(-o,r);case 7:return Dt.compareValue(r,-o)}return m.shouldNeverReachHere("invalid octant value"),0},Dt.compareValue=function(e,t){return e<0?-1:0<e?1:t<0?-1:0<t?1:0},t(Lt.prototype,{getCoordinate:function(){return this.coord},print:function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex)},compareTo:function(e){var t=e;return this.segmentIndex<t.segmentIndex?-1:this.segmentIndex>t.segmentIndex?1:this.coord.equals2D(t.coord)?0:Dt.compare(this.segmentOctant,this.coord,t.coord)},isEndPoint:function(e){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===e},isInterior:function(){return this._isInterior},interfaces_:function(){return[i]},getClass:function(){return Lt}}),t(Mt.prototype,{getSplitCoordinates:function(){var e=new b;this.addEndpoints();for(var t=this.iterator(),i=t.next();t.hasNext();){var r=t.next();this.addEdgeCoordinates(i,r,e),i=r}return e.toCoordinateArray()},addCollapsedNodes:function(){var e=new w;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var t=e.iterator();t.hasNext();){var i=t.next().intValue();this.add(this.edge.getCoordinate(i),i)}},print:function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();){t.next().print(e)}},findCollapsesFromExistingVertices:function(e){for(var t=0;t<this.edge.size()-2;t++){var i=this.edge.getCoordinate(t),r=(this.edge.getCoordinate(t+1),this.edge.getCoordinate(t+2));i.equals2D(r)&&e.add(new L(t+1))}},addEdgeCoordinates:function(e,t,i){t.segmentIndex,e.segmentIndex;var r=this.edge.getCoordinate(t.segmentIndex),o=t.isInterior()||!t.coord.equals2D(r);i.add(new C(e.coord),!1);for(var n=e.segmentIndex+1;n<=t.segmentIndex;n++)i.add(this.edge.getCoordinate(n));o&&i.add(new C(t.coord))},iterator:function(){return this.nodeMap.values().iterator()},addSplitEdges:function(e){this.addEndpoints(),this.addCollapsedNodes();for(var t=this.iterator(),i=t.next();t.hasNext();){var r=t.next(),o=this.createSplitEdge(i,r);e.add(o),i=r}},findCollapseIndex:function(e,t,i){if(!e.coord.equals2D(t.coord))return!1;var r=t.segmentIndex-e.segmentIndex;return t.isInterior()||r--,1===r&&(i[0]=e.segmentIndex+1,!0)},findCollapsesFromInsertedNodes:function(e){for(var t=new Array(1).fill(null),i=this.iterator(),r=i.next();i.hasNext();){var o=i.next();this.findCollapseIndex(r,o,t)&&e.add(new L(t[0])),r=o}},getEdge:function(){return this.edge},addEndpoints:function(){var e=this.edge.size()-1;this.add(this.edge.getCoordinate(0),0),this.add(this.edge.getCoordinate(e),e)},createSplitEdge:function(e,t){var i=t.segmentIndex-e.segmentIndex+2,r=this.edge.getCoordinate(t.segmentIndex),o=t.isInterior()||!t.coord.equals2D(r);o||i--;var n=new Array(i).fill(null),a=0;n[a++]=new C(e.coord);for(var s=e.segmentIndex+1;s<=t.segmentIndex;s++)n[a++]=this.edge.getCoordinate(s);return o&&(n[a]=new C(t.coord)),new Ot(n,this.edge.getData())},add:function(e,t){var i=new Lt(this.edge,e,t,this.edge.getSegmentOctant(t)),r=this.nodeMap.get(i);return null!==r?(m.isTrue(r.coord.equals2D(e),"Found equal nodes with different coordinates"),r):(this.nodeMap.put(i,i),i)},checkSplitEdgesCorrectness:function(e){var t=this.edge.getCoordinates(),i=e.get(0).getCoordinate(0);if(!i.equals2D(t[0]))throw new y("bad split edge start point at "+i);var r=e.get(e.size()-1).getCoordinates(),o=r[r.length-1];if(!o.equals2D(t[t.length-1]))throw new y("bad split edge end point at "+o)},interfaces_:function(){return[]},getClass:function(){return Mt}}),t(At.prototype,{next:function(){return null===this.currNode?(this.currNode=this.nextNode,this.currSegIndex=this.currNode.segmentIndex,this.readNextNode(),this.currNode):null===this.nextNode?null:this.nextNode.segmentIndex===this.currNode.segmentIndex?(this.currNode=this.nextNode,this.currSegIndex=this.currNode.segmentIndex,this.readNextNode(),this.currNode):(this.nextNode.segmentIndex,this.currNode.segmentIndex,null)},remove:function(){throw new UnsupportedOperationException(this.getClass().getName())},hasNext:function(){return null!==this.nextNode},readNextNode:function(){this.nodeIt.hasNext()?this.nextNode=this.nodeIt.next():this.nextNode=null},interfaces_:function(){return[c]},getClass:function(){return At}}),t(Rt.prototype,{addIntersection:function(e,t){},interfaces_:function(){return[ft]},getClass:function(){return Rt}}),t(Ot.prototype,{getCoordinates:function(){return this.pts},size:function(){return this.pts.length},getCoordinate:function(e){return this.pts[e]},isClosed:function(){return this.pts[0].equals(this.pts[this.pts.length-1])},getSegmentOctant:function(e){return e===this.pts.length-1?-1:this.safeOctant(this.getCoordinate(e),this.getCoordinate(e+1))},setData:function(e){this.data=e},safeOctant:function(e,t){return e.equals2D(t)?0:gt.octant(e,t)},getData:function(){return this.data},addIntersection:function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];this.addIntersectionNode(e,t)}else if(4===arguments.length){var i=arguments[0],r=arguments[1],o=(arguments[2],arguments[3]),n=new C(i.getIntersection(o));this.addIntersection(n,r)}},toString:function(){return Ue.toLineString(new Ve(this.pts))},getNodeList:function(){return this.nodeList},addIntersectionNode:function(e,t){var i=t,r=i+1;if(r<this.pts.length){var o=this.pts[r];e.equals2D(o)&&(i=r)}return this.nodeList.add(e,i)},addIntersections:function(e,t,i){for(var r=0;r<e.getIntersectionNum();r++)this.addIntersection(e,t,i,r)},interfaces_:function(){return[Rt]},getClass:function(){return Ot}}),Ot.getNodedSubstrings=function(){if(1===arguments.length){var e=arguments[0],t=new w;return Ot.getNodedSubstrings(e,t),t}if(2===arguments.length)for(var i=arguments[0],r=arguments[1],o=i.iterator();o.hasNext();){o.next().getNodeList().addSplitEdges(r)}},t(Nt.prototype,{overlap:function(){if(2===arguments.length)arguments[0],arguments[1];else if(4===arguments.length){var e=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3];e.getLineSegment(t,this.overlapSeg1),i.getLineSegment(r,this.overlapSeg2),this.overlap(this.overlapSeg1,this.overlapSeg2)}},interfaces_:function(){return[]},getClass:function(){return Nt}}),t(Vt.prototype,{getLineSegment:function(e,t){t.p0=this.pts[e],t.p1=this.pts[e+1]},computeSelect:function(e,t,i,r){var o=this.pts[t],n=this.pts[i];if(r.tempEnv1.init(o,n),i-t==1)return r.select(this,t),null;if(!e.intersects(r.tempEnv1))return null;var a=Math.trunc((t+i)/2);t<a&&this.computeSelect(e,t,a,r),a<i&&this.computeSelect(e,a,i,r)},getCoordinates:function(){for(var e=new Array(this.end-this.start+1).fill(null),t=0,i=this.start;i<=this.end;i++)e[t++]=this.pts[i];return e},computeOverlaps:function(e,t){this.computeOverlapsInternal(this.start,this.end,e,e.start,e.end,t)},setId:function(e){this.id=e},select:function(e,t){this.computeSelect(e,this.start,this.end,t)},getEnvelope:function(){if(null===this.env){var e=this.pts[this.start],t=this.pts[this.end];this.env=new E(e,t)}return this.env},getEndIndex:function(){return this.end},getStartIndex:function(){return this.start},getContext:function(){return this.context},getId:function(){return this.id},computeOverlapsInternal:function(e,t,i,r,o,n){var a=this.pts[e],s=this.pts[t],l=i.pts[r],u=i.pts[o];if(t-e==1&&o-r==1)return n.overlap(this,e,i,r),null;if(n.tempEnv1.init(a,s),n.tempEnv2.init(l,u),!n.tempEnv1.intersects(n.tempEnv2))return null;var c=Math.trunc((e+t)/2),h=Math.trunc((r+o)/2);e<c&&(r<h&&this.computeOverlapsInternal(e,c,i,r,h,n),h<o&&this.computeOverlapsInternal(e,c,i,h,o,n)),c<t&&(r<h&&this.computeOverlapsInternal(c,t,i,r,h,n),h<o&&this.computeOverlapsInternal(c,t,i,h,o,n))},interfaces_:function(){return[]},getClass:function(){return Vt}}),t(Ft.prototype,{interfaces_:function(){return[]},getClass:function(){return Ft}}),Ft.isNorthern=function(e){return e===Ft.NE||e===Ft.NW},Ft.isOpposite=function(e,t){return e!==t&&2===(e-t+4)%4},Ft.commonHalfPlane=function(e,t){if(e===t)return e;if(2===(e-t+4)%4)return-1;var i=e<t?e:t;return 0===i&&3===(t<e?e:t)?3:i},Ft.isInHalfPlane=function(e,t){return t===Ft.SE?e===Ft.SE||e===Ft.SW:e===t||e===t+1},Ft.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var e=arguments[0],t=arguments[1];if(0===e&&0===t)throw new h("Cannot compute the quadrant for point ( "+e+", "+t+" )");return 0<=e?0<=t?Ft.NE:Ft.SE:0<=t?Ft.NW:Ft.SW}if(arguments[0]instanceof C&&arguments[1]instanceof C){var i=arguments[0],r=arguments[1];if(r.x===i.x&&r.y===i.y)throw new h("Cannot compute the quadrant for two identical points "+i);return r.x>=i.x?r.y>=i.y?Ft.NE:Ft.SE:r.y>=i.y?Ft.NW:Ft.SW}},Ft.NE=0,Ft.NW=1,Ft.SW=2,Ft.SE=3,t(Ht.prototype,{interfaces_:function(){return[]},getClass:function(){return Ht}}),Ht.getChainStartIndices=function(e){var t=0,i=new w;i.add(new L(t));do{var r=Ht.findChainEnd(e,t);i.add(new L(r)),t=r}while(t<e.length-1);return Ht.toIntArray(i)},Ht.findChainEnd=function(e,t){for(var i=t;i<e.length-1&&e[i].equals2D(e[i+1]);)i++;if(i>=e.length-1)return e.length-1;for(var r=Ft.quadrant(e[i],e[i+1]),o=t+1;o<e.length;){if(!e[o-1].equals2D(e[o]))if(Ft.quadrant(e[o-1],e[o])!==r)break;o++}return o-1},Ht.getChains=function(){if(1===arguments.length){var e=arguments[0];return Ht.getChains(e,null)}if(2===arguments.length){for(var t=arguments[0],i=arguments[1],r=new w,o=Ht.getChainStartIndices(t),n=0;n<o.length-1;n++){var a=new Vt(t,o[n],o[n+1],i);r.add(a)}return r}},Ht.toIntArray=function(e){for(var t=new Array(e.size()).fill(null),i=0;i<t.length;i++)t[i]=e.get(i).intValue();return t},t(Gt.prototype,{computeNodes:function(e){},getNodedSubstrings:function(){},interfaces_:function(){return[]},getClass:function(){return Gt}}),t(kt.prototype,{setSegmentIntersector:function(e){this.segInt=e},interfaces_:function(){return[Gt]},getClass:function(){return kt}}),s(Bt,kt),t(Bt.prototype,{getMonotoneChains:function(){return this.monoChains},getNodedSubstrings:function(){return Ot.getNodedSubstrings(this.nodedSegStrings)},getIndex:function(){return this.index},add:function(e){for(var t=Ht.getChains(e.getCoordinates(),e).iterator();t.hasNext();){var i=t.next();i.setId(this.idCounter++),this.index.insert(i.getEnvelope(),i),this.monoChains.add(i)}},computeNodes:function(e){for(var t=(this.nodedSegStrings=e).iterator();t.hasNext();)this.add(t.next());this.intersectChains()},intersectChains:function(){for(var e=new jt(this.segInt),t=this.monoChains.iterator();t.hasNext();)for(var i=t.next(),r=this.index.query(i.getEnvelope()).iterator();r.hasNext();){var o=r.next();if(o.getId()>i.getId()&&(i.computeOverlaps(o,e),this.nOverlaps++),this.segInt.isDone())return null}},interfaces_:function(){return[]},getClass:function(){return Bt}}),s(jt,Nt),t(jt.prototype,{overlap:function(){if(4!==arguments.length)return Nt.prototype.overlap.apply(this,arguments);var e=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3],o=e.getContext(),n=i.getContext();this.si.processIntersections(o,t,n,r)},interfaces_:function(){return[]},getClass:function(){return jt}}),Bt.SegmentOverlapAction=jt,s(zt,y),t(zt.prototype,{getCoordinate:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return zt}}),zt.msgWithCoord=function(e,t){return null!==t?e+" [ "+t+" ]":e},t(Wt.prototype,{processIntersections:function(e,t,i,r){},isDone:function(){},interfaces_:function(){return[]},getClass:function(){return Wt}}),t(Ut.prototype,{getInteriorIntersection:function(){return this.interiorIntersection},setCheckEndSegmentsOnly:function(e){this.isCheckEndSegmentsOnly=e},getIntersectionSegments:function(){return this.intSegments},count:function(){return this.intersectionCount},getIntersections:function(){return this.intersections},setFindAllIntersections:function(e){this.findAllIntersections=e},setKeepIntersections:function(e){this.keepIntersections=e},processIntersections:function(e,t,i,r){if(!this.findAllIntersections&&this.hasIntersection())return null;if(e===i&&t===r)return null;if(this.isCheckEndSegmentsOnly&&!(this.isEndSegment(e,t)||this.isEndSegment(i,r)))return null;var o=e.getCoordinates()[t],n=e.getCoordinates()[t+1],a=i.getCoordinates()[r],s=i.getCoordinates()[r+1];this.li.computeIntersection(o,n,a,s),this.li.hasIntersection()&&this.li.isInteriorIntersection()&&(this.intSegments=new Array(4).fill(null),this.intSegments[0]=o,this.intSegments[1]=n,this.intSegments[2]=a,this.intSegments[3]=s,this.interiorIntersection=this.li.getIntersection(0),this.keepIntersections&&this.intersections.add(this.interiorIntersection),this.intersectionCount++)},isEndSegment:function(e,t){return 0===t||t>=e.size()-2},hasIntersection:function(){return null!==this.interiorIntersection},isDone:function(){return!this.findAllIntersections&&null!==this.interiorIntersection},interfaces_:function(){return[Wt]},getClass:function(){return Ut}}),Ut.createAllIntersectionsFinder=function(e){var t=new Ut(e);return t.setFindAllIntersections(!0),t},Ut.createAnyIntersectionFinder=function(e){return new Ut(e)},Ut.createIntersectionCounter=function(e){var t=new Ut(e);return t.setFindAllIntersections(!0),t.setKeepIntersections(!1),t},t(qt.prototype,{execute:function(){return null!==this.segInt?null:void this.checkInteriorIntersections()},getIntersections:function(){return this.segInt.getIntersections()},isValid:function(){return this.execute(),this._isValid},setFindAllIntersections:function(e){this.findAllIntersections=e},checkInteriorIntersections:function(){this._isValid=!0,this.segInt=new Ut(this.li),this.segInt.setFindAllIntersections(this.findAllIntersections);var e=new Bt;if(e.setSegmentIntersector(this.segInt),e.computeNodes(this.segStrings),this.segInt.hasIntersection())return this._isValid=!1,null},checkValid:function(){if(this.execute(),!this._isValid)throw new zt(this.getErrorMessage(),this.segInt.getInteriorIntersection())},getErrorMessage:function(){if(this._isValid)return"no intersections found";var e=this.segInt.getIntersectionSegments();return"found non-noded intersection between "+Ue.toLineString(e[0],e[1])+" and "+Ue.toLineString(e[2],e[3])},interfaces_:function(){return[]},getClass:function(){return qt}}),qt.computeIntersections=function(e){var t=new qt(e);return t.setFindAllIntersections(!0),t.isValid(),t.getIntersections()},t(Yt.prototype,{checkValid:function(){this.nv.checkValid()},interfaces_:function(){return[]},getClass:function(){return Yt}}),Yt.toSegmentStrings=function(e){for(var t=new w,i=e.iterator();i.hasNext();){var r=i.next();t.add(new vt(r.getCoordinates(),r))}return t},Yt.checkValid=function(e){new Yt(e).checkValid()},t(Xt.prototype,{map:function(e){for(var t=new w,i=0;i<e.getNumGeometries();i++){var r=this.mapOp.map(e.getGeometryN(i));r.isEmpty()||t.add(r)}return e.getFactory().createGeometryCollection(ze.toGeometryArray(t))},interfaces_:function(){return[]},getClass:function(){return Xt}}),Xt.map=function(e,t){return new Xt(t).map(e)},t(Jt.prototype,{interfaces_:function(){return[]},getClass:function(){return Jt}}),Jt.opposite=function(e){return e===Jt.LEFT?Jt.RIGHT:e===Jt.RIGHT?Jt.LEFT:e},Jt.ON=0,Jt.LEFT=1,Jt.RIGHT=2,t(Qt.prototype,{setAllLocations:function(e){for(var t=0;t<this.location.length;t++)this.location[t]=e},isNull:function(){for(var e=0;e<this.location.length;e++)if(this.location[e]!==x.NONE)return!1;return!0},setAllLocationsIfNull:function(e){for(var t=0;t<this.location.length;t++)this.location[t]===x.NONE&&(this.location[t]=e)},isLine:function(){return 1===this.location.length},merge:function(e){if(e.location.length>this.location.length){var t=new Array(3).fill(null);t[Jt.ON]=this.location[Jt.ON],t[Jt.LEFT]=x.NONE,t[Jt.RIGHT]=x.NONE,this.location=t}for(var i=0;i<this.location.length;i++)this.location[i]===x.NONE&&i<e.location.length&&(this.location[i]=e.location[i])},getLocations:function(){return this.location},flip:function(){if(this.location.length<=1)return null;var e=this.location[Jt.LEFT];this.location[Jt.LEFT]=this.location[Jt.RIGHT],this.location[Jt.RIGHT]=e},toString:function(){var e=new D;return 1<this.location.length&&e.append(x.toLocationSymbol(this.location[Jt.LEFT])),e.append(x.toLocationSymbol(this.location[Jt.ON])),1<this.location.length&&e.append(x.toLocationSymbol(this.location[Jt.RIGHT])),e.toString()},setLocations:function(e,t,i){this.location[Jt.ON]=e,this.location[Jt.LEFT]=t,this.location[Jt.RIGHT]=i},get:function(e){return e<this.location.length?this.location[e]:x.NONE},isArea:function(){return 1<this.location.length},isAnyNull:function(){for(var e=0;e<this.location.length;e++)if(this.location[e]===x.NONE)return!0;return!1},setLocation:function(){if(1===arguments.length){var e=arguments[0];this.setLocation(Jt.ON,e)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.location[t]=i}},init:function(e){this.location=new Array(e).fill(null),this.setAllLocations(x.NONE)},isEqualOnSide:function(e,t){return this.location[t]===e.location[t]},allPositionsEqual:function(e){for(var t=0;t<this.location.length;t++)if(this.location[t]!==e)return!1;return!0},interfaces_:function(){return[]},getClass:function(){return Qt}}),t(Kt.prototype,{getGeometryCount:function(){var e=0;return this.elt[0].isNull()||e++,this.elt[1].isNull()||e++,e},setAllLocations:function(e,t){this.elt[e].setAllLocations(t)},isNull:function(e){return this.elt[e].isNull()},setAllLocationsIfNull:function(){if(1===arguments.length){var e=arguments[0];this.setAllLocationsIfNull(0,e),this.setAllLocationsIfNull(1,e)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.elt[t].setAllLocationsIfNull(i)}},isLine:function(e){return this.elt[e].isLine()},merge:function(e){for(var t=0;t<2;t++)null===this.elt[t]&&null!==e.elt[t]?this.elt[t]=new Qt(e.elt[t]):this.elt[t].merge(e.elt[t])},flip:function(){this.elt[0].flip(),this.elt[1].flip()},getLocation:function(){if(1===arguments.length){var e=arguments[0];return this.elt[e].get(Jt.ON)}if(2===arguments.length){var t=arguments[0],i=arguments[1];return this.elt[t].get(i)}},toString:function(){var e=new D;return null!==this.elt[0]&&(e.append("A:"),e.append(this.elt[0].toString())),null!==this.elt[1]&&(e.append(" B:"),e.append(this.elt[1].toString())),e.toString()},isArea:function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var e=arguments[0];return this.elt[e].isArea()}},isAnyNull:function(e){return this.elt[e].isAnyNull()},setLocation:function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];this.elt[e].setLocation(Jt.ON,t)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this.elt[i].setLocation(r,o)}},isEqualOnSide:function(e,t){return this.elt[0].isEqualOnSide(e.elt[0],t)&&this.elt[1].isEqualOnSide(e.elt[1],t)},allPositionsEqual:function(e,t){return this.elt[e].allPositionsEqual(t)},toLine:function(e){this.elt[e].isArea()&&(this.elt[e]=new Qt(this.elt[e].location[0]))},interfaces_:function(){return[]},getClass:function(){return Kt}}),Kt.toLineLabel=function(e){for(var t=new Kt(x.NONE),i=0;i<2;i++)t.setLocation(i,e.getLocation(i));return t},t($t.prototype,{computeRing:function(){if(null!==this.ring)return null;for(var e=new Array(this.pts.size()).fill(null),t=0;t<this.pts.size();t++)e[t]=this.pts.get(t);this.ring=this.geometryFactory.createLinearRing(e),this._isHole=Qe.isCCW(this.ring.getCoordinates())},isIsolated:function(){return 1===this.label.getGeometryCount()},computePoints:function(e){var t=this.startDe=e,i=!0;do{if(null===t)throw new zt("Found null DirectedEdge");if(t.getEdgeRing()===this)throw new zt("Directed Edge visited twice during ring-building at "+t.getCoordinate());this.edges.add(t);var r=t.getLabel();m.isTrue(r.isArea()),this.mergeLabel(r),this.addPoints(t.getEdge(),t.isForward(),i),i=!1,this.setEdgeRing(t,this),t=this.getNext(t)}while(t!==this.startDe)},getLinearRing:function(){return this.ring},getCoordinate:function(e){return this.pts.get(e)},computeMaxNodeDegree:function(){this.maxNodeDegree=0;var e=this.startDe;do{var t=e.getNode().getEdges().getOutgoingDegree(this);t>this.maxNodeDegree&&(this.maxNodeDegree=t),e=this.getNext(e)}while(e!==this.startDe);this.maxNodeDegree*=2},addPoints:function(e,t,i){var r=e.getCoordinates();if(t){var o=1;i&&(o=0);for(var n=o;n<r.length;n++)this.pts.add(r[n])}else{o=r.length-2;i&&(o=r.length-1);for(n=o;0<=n;n--)this.pts.add(r[n])}},isHole:function(){return this._isHole},setInResult:function(){for(var e=this.startDe;e.getEdge().setInResult(!0),(e=e.getNext())!==this.startDe;);},containsPoint:function(e){var t=this.getLinearRing();if(!t.getEnvelopeInternal().contains(e))return!1;if(!Qe.isPointInRing(e,t.getCoordinates()))return!1;for(var i=this.holes.iterator();i.hasNext();){if(i.next().containsPoint(e))return!1}return!0},addHole:function(e){this.holes.add(e)},isShell:function(){return null===this.shell},getLabel:function(){return this.label},getEdges:function(){return this.edges},getMaxNodeDegree:function(){return this.maxNodeDegree<0&&this.computeMaxNodeDegree(),this.maxNodeDegree},getShell:function(){return this.shell},mergeLabel:function(){if(1===arguments.length){var e=arguments[0];this.mergeLabel(e,0),this.mergeLabel(e,1)}else if(2===arguments.length){var t=arguments[0],i=arguments[1],r=t.getLocation(i,Jt.RIGHT);if(r===x.NONE)return null;if(this.label.getLocation(i)===x.NONE)return this.label.setLocation(i,r),null}},setShell:function(e){null!==(this.shell=e)&&e.addHole(this)},toPolygon:function(e){for(var t=new Array(this.holes.size()).fill(null),i=0;i<this.holes.size();i++)t[i]=this.holes.get(i).getLinearRing();return e.createPolygon(this.getLinearRing(),t)},interfaces_:function(){return[]},getClass:function(){return $t}}),s(Zt,$t),t(Zt.prototype,{setEdgeRing:function(e,t){e.setMinEdgeRing(t)},getNext:function(e){return e.getNextMin()},interfaces_:function(){return[]},getClass:function(){return Zt}}),s(ei,$t),t(ei.prototype,{buildMinimalRings:function(){var e=new w,t=this.startDe;do{if(null===t.getMinEdgeRing()){var i=new Zt(t,this.geometryFactory);e.add(i)}t=t.getNext()}while(t!==this.startDe);return e},setEdgeRing:function(e,t){e.setEdgeRing(t)},linkDirectedEdgesForMinimalEdgeRings:function(){var e=this.startDe;do{e.getNode().getEdges().linkMinimalDirectedEdges(this),e=e.getNext()}while(e!==this.startDe)},getNext:function(e){return e.getNext()},interfaces_:function(){return[]},getClass:function(){return ei}}),t(ti.prototype,{setVisited:function(e){this._isVisited=e},setInResult:function(e){this._isInResult=e},isCovered:function(){return this._isCovered},isCoveredSet:function(){return this._isCoveredSet},setLabel:function(e){this.label=e},getLabel:function(){return this.label},setCovered:function(e){this._isCovered=e,this._isCoveredSet=!0},updateIM:function(e){m.isTrue(2<=this.label.getGeometryCount(),"found partial label"),this.computeIM(e)},isInResult:function(){return this._isInResult},isVisited:function(){return this._isVisited},interfaces_:function(){return[]},getClass:function(){return ti}}),s(ii,ti),t(ii.prototype,{isIncidentEdgeInResult:function(){for(var e=this.getEdges().getEdges().iterator();e.hasNext();){if(e.next().getEdge().isInResult())return!0}return!1},isIsolated:function(){return 1===this.label.getGeometryCount()},getCoordinate:function(){return this.coord},print:function(e){e.println("node "+this.coord+" lbl: "+this.label)},computeIM:function(e){},computeMergedLocation:function(e,t){var i=x.NONE;if(i=this.label.getLocation(t),!e.isNull(t)){var r=e.getLocation(t);i!==x.BOUNDARY&&(i=r)}return i},setLabel:function(){if(2!==arguments.length)return ti.prototype.setLabel.apply(this,arguments);var e=arguments[0],t=arguments[1];null===this.label?this.label=new Kt(e,t):this.label.setLocation(e,t)},getEdges:function(){return this.edges},mergeLabel:function(){if(arguments[0]instanceof ii){var e=arguments[0];this.mergeLabel(e.label)}else if(arguments[0]instanceof Kt)for(var t=arguments[0],i=0;i<2;i++){var r=this.computeMergedLocation(t,i);this.label.getLocation(i)===x.NONE&&this.label.setLocation(i,r)}},add:function(e){this.edges.insert(e),e.setNode(this)},setLabelBoundary:function(e){if(null===this.label)return null;var t=x.NONE;null!==this.label&&(t=this.label.getLocation(e));var i=null;switch(t){case x.BOUNDARY:i=x.INTERIOR;break;case x.INTERIOR:i=x.BOUNDARY;break;default:i=x.BOUNDARY}this.label.setLocation(e,i)},interfaces_:function(){return[]},getClass:function(){return ii}}),t(ri.prototype,{find:function(e){return this.nodeMap.get(e)},addNode:function(){if(arguments[0]instanceof C){var e=arguments[0];return null===(t=this.nodeMap.get(e))&&(t=this.nodeFact.createNode(e),this.nodeMap.put(e,t)),t}if(arguments[0]instanceof ii){var t,i=arguments[0];return null===(t=this.nodeMap.get(i.getCoordinate()))?(this.nodeMap.put(i.getCoordinate(),i),i):(t.mergeLabel(i),t)}},print:function(e){for(var t=this.iterator();t.hasNext();){t.next().print(e)}},iterator:function(){return this.nodeMap.values().iterator()},values:function(){return this.nodeMap.values()},getBoundaryNodes:function(e){for(var t=new w,i=this.iterator();i.hasNext();){var r=i.next();r.getLabel().getLocation(e)===x.BOUNDARY&&t.add(r)}return t},add:function(e){var t=e.getCoordinate();this.addNode(t).add(e)},interfaces_:function(){return[]},getClass:function(){return ri}}),t(oi.prototype,{compareDirection:function(e){return this.dx===e.dx&&this.dy===e.dy?0:this.quadrant>e.quadrant?1:this.quadrant<e.quadrant?-1:Qe.computeOrientation(e.p0,e.p1,this.p1)},getDy:function(){return this.dy},getCoordinate:function(){return this.p0},setNode:function(e){this.node=e},print:function(e){var t=Math.atan2(this.dy,this.dx),i=this.getClass().getName(),r=i.lastIndexOf("."),o=i.substring(r+1);e.print(" "+o+": "+this.p0+" - "+this.p1+" "+this.quadrant+":"+t+" "+this.label)},compareTo:function(e){var t=e;return this.compareDirection(t)},getDirectedCoordinate:function(){return this.p1},getDx:function(){return this.dx},getLabel:function(){return this.label},getEdge:function(){return this.edge},getQuadrant:function(){return this.quadrant},getNode:function(){return this.node},toString:function(){var e=Math.atan2(this.dy,this.dx),t=this.getClass().getName(),i=t.lastIndexOf(".");return" "+t.substring(i+1)+": "+this.p0+" - "+this.p1+" "+this.quadrant+":"+e+" "+this.label},computeLabel:function(e){},init:function(e,t){this.p0=e,this.p1=t,this.dx=t.x-e.x,this.dy=t.y-e.y,this.quadrant=Ft.quadrant(this.dx,this.dy),m.isTrue(!(0===this.dx&&0===this.dy),"EdgeEnd with identical endpoints found")},interfaces_:function(){return[i]},getClass:function(){return oi}}),s(ni,oi),t(ni.prototype,{getNextMin:function(){return this.nextMin},getDepth:function(e){return this.depth[e]},setVisited:function(e){this._isVisited=e},computeDirectedLabel:function(){this.label=new Kt(this.edge.getLabel()),this._isForward||this.label.flip()},getNext:function(){return this.next},setDepth:function(e,t){if(-999!==this.depth[e]&&this.depth[e]!==t)throw new zt("assigned depths do not match",this.getCoordinate());this.depth[e]=t},isInteriorAreaEdge:function(){for(var e=!0,t=0;t<2;t++)this.label.isArea(t)&&this.label.getLocation(t,Jt.LEFT)===x.INTERIOR&&this.label.getLocation(t,Jt.RIGHT)===x.INTERIOR||(e=!1);return e},setNextMin:function(e){this.nextMin=e},print:function(e){oi.prototype.print.call(this,e),e.print(" "+this.depth[Jt.LEFT]+"/"+this.depth[Jt.RIGHT]),e.print(" ("+this.getDepthDelta()+")"),this._isInResult&&e.print(" inResult")},setMinEdgeRing:function(e){this.minEdgeRing=e},isLineEdge:function(){var e=this.label.isLine(0)||this.label.isLine(1),t=!this.label.isArea(0)||this.label.allPositionsEqual(0,x.EXTERIOR),i=!this.label.isArea(1)||this.label.allPositionsEqual(1,x.EXTERIOR);return e&&t&&i},setEdgeRing:function(e){this.edgeRing=e},getMinEdgeRing:function(){return this.minEdgeRing},getDepthDelta:function(){var e=this.edge.getDepthDelta();return this._isForward||(e=-e),e},setInResult:function(e){this._isInResult=e},getSym:function(){return this.sym},isForward:function(){return this._isForward},getEdge:function(){return this.edge},printEdge:function(e){this.print(e),e.print(" "),this._isForward?this.edge.print(e):this.edge.printReverse(e)},setSym:function(e){this.sym=e},setVisitedEdge:function(e){this.setVisited(e),this.sym.setVisited(e)},setEdgeDepths:function(e,t){var i=this.getEdge().getDepthDelta();this._isForward||(i=-i);var r=1;e===Jt.LEFT&&(r=-1);var o=Jt.opposite(e),n=t+i*r;this.setDepth(e,t),this.setDepth(o,n)},getEdgeRing:function(){return this.edgeRing},isInResult:function(){return this._isInResult},setNext:function(e){this.next=e},isVisited:function(){return this._isVisited},interfaces_:function(){return[]},getClass:function(){return ni}}),ni.depthFactor=function(e,t){return e===x.EXTERIOR&&t===x.INTERIOR?1:e===x.INTERIOR&&t===x.EXTERIOR?-1:0},t(ai.prototype,{createNode:function(e){return new ii(e,null)},interfaces_:function(){return[]},getClass:function(){return ai}}),t(si.prototype,{printEdges:function(e){e.println("Edges:");for(var t=0;t<this.edges.size();t++){e.println("edge "+t+":");var i=this.edges.get(t);i.print(e),i.eiList.print(e)}},find:function(e){return this.nodes.find(e)},addNode:function(){if(arguments[0]instanceof ii){var e=arguments[0];return this.nodes.addNode(e)}if(arguments[0]instanceof C){var t=arguments[0];return this.nodes.addNode(t)}},getNodeIterator:function(){return this.nodes.iterator()},linkResultDirectedEdges:function(){for(var e=this.nodes.iterator();e.hasNext();){e.next().getEdges().linkResultDirectedEdges()}},debugPrintln:function(e){N.out.println(e)},isBoundaryNode:function(e,t){var i=this.nodes.find(t);if(null===i)return!1;var r=i.getLabel();return null!==r&&r.getLocation(e)===x.BOUNDARY},linkAllDirectedEdges:function(){for(var e=this.nodes.iterator();e.hasNext();){e.next().getEdges().linkAllDirectedEdges()}},matchInSameDirection:function(e,t,i,r){return!!e.equals(i)&&Qe.computeOrientation(e,t,r)===Qe.COLLINEAR&&Ft.quadrant(e,t)===Ft.quadrant(i,r)},getEdgeEnds:function(){return this.edgeEndList},debugPrint:function(e){N.out.print(e)},getEdgeIterator:function(){return this.edges.iterator()},findEdgeInSameDirection:function(e,t){for(var i=0;i<this.edges.size();i++){var r=this.edges.get(i),o=r.getCoordinates();if(this.matchInSameDirection(e,t,o[0],o[1]))return r;if(this.matchInSameDirection(e,t,o[o.length-1],o[o.length-2]))return r}return null},insertEdge:function(e){this.edges.add(e)},findEdgeEnd:function(e){for(var t=this.getEdgeEnds().iterator();t.hasNext();){var i=t.next();if(i.getEdge()===e)return i}return null},addEdges:function(e){for(var t=e.iterator();t.hasNext();){var i=t.next();this.edges.add(i);var r=new ni(i,!0),o=new ni(i,!1);r.setSym(o),o.setSym(r),this.add(r),this.add(o)}},add:function(e){this.nodes.add(e),this.edgeEndList.add(e)},getNodes:function(){return this.nodes.values()},findEdge:function(e,t){for(var i=0;i<this.edges.size();i++){var r=this.edges.get(i),o=r.getCoordinates();if(e.equals(o[0])&&t.equals(o[1]))return r}return null},interfaces_:function(){return[]},getClass:function(){return si}}),si.linkResultDirectedEdges=function(e){for(var t=e.iterator();t.hasNext();){t.next().getEdges().linkResultDirectedEdges()}},t(li.prototype,{sortShellsAndHoles:function(e,t,i){for(var r=e.iterator();r.hasNext();){var o=r.next();o.isHole()?i.add(o):t.add(o)}},computePolygons:function(e){for(var t=new w,i=e.iterator();i.hasNext();){var r=i.next().toPolygon(this.geometryFactory);t.add(r)}return t},placeFreeHoles:function(e,t){for(var i=t.iterator();i.hasNext();){var r=i.next();if(null===r.getShell()){var o=this.findEdgeRingContaining(r,e);if(null===o)throw new zt("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(o)}}},buildMinimalEdgeRings:function(e,t,i){for(var r=new w,o=e.iterator();o.hasNext();){var n=o.next();if(2<n.getMaxNodeDegree()){n.linkDirectedEdgesForMinimalEdgeRings();var a=n.buildMinimalRings(),s=this.findShell(a);null!==s?(this.placePolygonHoles(s,a),t.add(s)):i.addAll(a)}else r.add(n)}return r},containsPoint:function(e){for(var t=this.shellList.iterator();t.hasNext();){if(t.next().containsPoint(e))return!0}return!1},buildMaximalEdgeRings:function(e){for(var t=new w,i=e.iterator();i.hasNext();){var r=i.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var o=new ei(r,this.geometryFactory);t.add(o),o.setInResult()}}return t},placePolygonHoles:function(e,t){for(var i=t.iterator();i.hasNext();){var r=i.next();r.isHole()&&r.setShell(e)}},getPolygons:function(){return this.computePolygons(this.shellList)},findEdgeRingContaining:function(e,t){for(var i=e.getLinearRing(),r=i.getEnvelopeInternal(),o=i.getCoordinateN(0),n=null,a=null,s=t.iterator();s.hasNext();){var l=s.next(),u=l.getLinearRing(),c=u.getEnvelopeInternal();null!==n&&(a=n.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(r)&&Qe.isPointInRing(o,u.getCoordinates())&&(h=!0),h&&(null===n||a.contains(c))&&(n=l)}return n},findShell:function(e){for(var t=0,i=null,r=e.iterator();r.hasNext();){var o=r.next();o.isHole()||(i=o,t++)}return m.isTrue(t<=1,"found two shells in MinimalEdgeRing list"),i},add:function(){if(1===arguments.length){var e=arguments[0];this.add(e.getEdgeEnds(),e.getNodes())}else if(2===arguments.length){var t=arguments[0],i=arguments[1];si.linkResultDirectedEdges(i);var r=this.buildMaximalEdgeRings(t),o=new w,n=this.buildMinimalEdgeRings(r,this.shellList,o);this.sortShellsAndHoles(n,this.shellList,o),this.placeFreeHoles(this.shellList,o)}},interfaces_:function(){return[]},getClass:function(){return li}}),t(ui.prototype,{collectLines:function(e){for(var t=this.op.getGraph().getEdgeEnds().iterator();t.hasNext();){var i=t.next();this.collectLineEdge(i,e,this.lineEdgesList),this.collectBoundaryTouchEdge(i,e,this.lineEdgesList)}},labelIsolatedLine:function(e,t){var i=this.ptLocator.locate(e.getCoordinate(),this.op.getArgGeometry(t));e.getLabel().setLocation(t,i)},build:function(e){return this.findCoveredLineEdges(),this.collectLines(e),this.buildLines(e),this.resultLineList},collectLineEdge:function(e,t,i){var r=e.getLabel(),o=e.getEdge();e.isLineEdge()&&(e.isVisited()||!Bi.isResultOfOp(r,t)||o.isCovered()||(i.add(o),e.setVisitedEdge(!0)))},findCoveredLineEdges:function(){for(var e=this.op.getGraph().getNodes().iterator();e.hasNext();){e.next().getEdges().findCoveredLineEdges()}for(var t=this.op.getGraph().getEdgeEnds().iterator();t.hasNext();){var i=t.next(),r=i.getEdge();if(i.isLineEdge()&&!r.isCoveredSet()){var o=this.op.isCoveredByA(i.getCoordinate());r.setCovered(o)}}},labelIsolatedLines:function(e){for(var t=e.iterator();t.hasNext();){var i=t.next(),r=i.getLabel();i.isIsolated()&&(r.isNull(0)?this.labelIsolatedLine(i,0):this.labelIsolatedLine(i,1))}},buildLines:function(e){for(var t=this.lineEdgesList.iterator();t.hasNext();){var i=t.next(),r=(i.getLabel(),this.geometryFactory.createLineString(i.getCoordinates()));this.resultLineList.add(r),i.setInResult(!0)}},collectBoundaryTouchEdge:function(e,t,i){var r=e.getLabel();return e.isLineEdge()?null:e.isVisited()?null:e.isInteriorAreaEdge()?null:e.getEdge().isInResult()?null:(m.isTrue(!(e.isInResult()||e.getSym().isInResult())||!e.getEdge().isInResult()),void(Bi.isResultOfOp(r,t)&&t===Bi.INTERSECTION&&(i.add(e.getEdge()),e.setVisitedEdge(!0))))},interfaces_:function(){return[]},getClass:function(){return ui}}),t(ci.prototype,{filterCoveredNodeToPoint:function(e){var t=e.getCoordinate();if(!this.op.isCoveredByLA(t)){var i=this.geometryFactory.createPoint(t);this.resultPointList.add(i)}},extractNonCoveredResultNodes:function(e){for(var t=this.op.getGraph().getNodes().iterator();t.hasNext();){var i=t.next();if(!(i.isInResult()||i.isIncidentEdgeInResult()||0!==i.getEdges().getDegree()&&e!==Bi.INTERSECTION)){var r=i.getLabel();Bi.isResultOfOp(r,e)&&this.filterCoveredNodeToPoint(i)}}},build:function(e){return this.extractNonCoveredResultNodes(e),this.resultPointList},interfaces_:function(){return[]},getClass:function(){return ci}}),t(hi.prototype,{locate:function(e){},interfaces_:function(){return[]},getClass:function(){return hi}}),t(di.prototype,{locate:function(e){return di.locate(e,this.geom)},interfaces_:function(){return[hi]},getClass:function(){return di}}),di.isPointInRing=function(e,t){return!!t.getEnvelopeInternal().intersects(e)&&Qe.isPointInRing(e,t.getCoordinates())},di.containsPointInPolygon=function(e,t){if(t.isEmpty())return!1;var i=t.getExteriorRing();if(!di.isPointInRing(e,i))return!1;for(var r=0;r<t.getNumInteriorRing();r++){var o=t.getInteriorRingN(r);if(di.isPointInRing(e,o))return!1}return!0},di.containsPoint=function(e,t){if(t instanceof Te)return di.containsPointInPolygon(e,t);if(t instanceof de)for(var i=new mt(t);i.hasNext();){var r=i.next();if(r!==t&&di.containsPoint(e,r))return!0}return!1},di.locate=function(e,t){return t.isEmpty()?x.EXTERIOR:di.containsPoint(e,t)?x.INTERIOR:x.EXTERIOR},t(mi.prototype,{getNextCW:function(e){this.getEdges();var t=this.edgeList.indexOf(e),i=t-1;return 0===t&&(i=this.edgeList.size()-1),this.edgeList.get(i)},propagateSideLabels:function(e){for(var t=x.NONE,i=this.iterator();i.hasNext();){(n=(o=i.next()).getLabel()).isArea(e)&&n.getLocation(e,Jt.LEFT)!==x.NONE&&(t=n.getLocation(e,Jt.LEFT))}if(t===x.NONE)return null;var r=t;for(i=this.iterator();i.hasNext();){var o,n;if((n=(o=i.next()).getLabel()).getLocation(e,Jt.ON)===x.NONE&&n.setLocation(e,Jt.ON,r),n.isArea(e)){var a=n.getLocation(e,Jt.LEFT),s=n.getLocation(e,Jt.RIGHT);if(s!==x.NONE){if(s!==r)throw new zt("side location conflict",o.getCoordinate());a===x.NONE&&m.shouldNeverReachHere("found single null side (at "+o.getCoordinate()+")"),r=a}else m.isTrue(n.getLocation(e,Jt.LEFT)===x.NONE,"found single null side"),n.setLocation(e,Jt.RIGHT,r),n.setLocation(e,Jt.LEFT,r)}}},getCoordinate:function(){var e=this.iterator();return e.hasNext()?e.next().getCoordinate():null},print:function(e){N.out.println("EdgeEndStar: "+this.getCoordinate());for(var t=this.iterator();t.hasNext();){t.next().print(e)}},isAreaLabelsConsistent:function(e){return this.computeEdgeEndLabels(e.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},checkAreaLabelsConsistent:function(e){var t=this.getEdges();if(t.size()<=0)return!0;var i=t.size()-1,r=t.get(i).getLabel().getLocation(e,Jt.LEFT);m.isTrue(r!==x.NONE,"Found unlabelled area edge");for(var o=r,n=this.iterator();n.hasNext();){var a=n.next().getLabel();m.isTrue(a.isArea(e),"Found non-area edge");var s=a.getLocation(e,Jt.LEFT),l=a.getLocation(e,Jt.RIGHT);if(s===l)return!1;if(l!==o)return!1;o=s}return!0},findIndex:function(e){this.iterator();for(var t=0;t<this.edgeList.size();t++){if(this.edgeList.get(t)===e)return t}return-1},iterator:function(){return this.getEdges().iterator()},getEdges:function(){return null===this.edgeList&&(this.edgeList=new w(this.edgeMap.values())),this.edgeList},getLocation:function(e,t,i){return this.ptInAreaLocation[e]===x.NONE&&(this.ptInAreaLocation[e]=di.locate(t,i[e].getGeometry())),this.ptInAreaLocation[e]},toString:function(){var e=new D;e.append("EdgeEndStar: "+this.getCoordinate()),e.append("\n");for(var t=this.iterator();t.hasNext();){var i=t.next();e.append(i),e.append("\n")}return e.toString()},computeEdgeEndLabels:function(e){for(var t=this.iterator();t.hasNext();){t.next().computeLabel(e)}},computeLabelling:function(e){this.computeEdgeEndLabels(e[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var t=[!1,!1],i=this.iterator();i.hasNext();)for(var r=(n=i.next()).getLabel(),o=0;o<2;o++)r.isLine(o)&&r.getLocation(o)===x.BOUNDARY&&(t[o]=!0);for(i=this.iterator();i.hasNext();){var n;for(r=(n=i.next()).getLabel(),o=0;o<2;o++)if(r.isAnyNull(o)){var a=x.NONE;if(t[o])a=x.EXTERIOR;else{var s=n.getCoordinate();a=this.getLocation(o,s,e)}r.setAllLocationsIfNull(o,a)}}},getDegree:function(){return this.edgeMap.size()},insertEdgeEnd:function(e,t){this.edgeMap.put(e,t),this.edgeList=null},interfaces_:function(){return[]},getClass:function(){return mi}}),s(pi,mi),t(pi.prototype,{linkResultDirectedEdges:function(){this.getResultAreaEdges();for(var e=null,t=null,i=this.SCANNING_FOR_INCOMING,r=0;r<this.resultAreaEdgeList.size();r++){var o=this.resultAreaEdgeList.get(r),n=o.getSym();if(o.getLabel().isArea())switch(null===e&&o.isInResult()&&(e=o),i){case this.SCANNING_FOR_INCOMING:if(!n.isInResult())continue;t=n,i=this.LINKING_TO_OUTGOING;break;case this.LINKING_TO_OUTGOING:if(!o.isInResult())continue;t.setNext(o),i=this.SCANNING_FOR_INCOMING}}if(i===this.LINKING_TO_OUTGOING){if(null===e)throw new zt("no outgoing dirEdge found",this.getCoordinate());m.isTrue(e.isInResult(),"unable to link last incoming dirEdge"),t.setNext(e)}},insert:function(e){var t=e;this.insertEdgeEnd(t,t)},getRightmostEdge:function(){var e=this.getEdges(),t=e.size();if(t<1)return null;var i=e.get(0);if(1===t)return i;var r=e.get(t-1),o=i.getQuadrant(),n=r.getQuadrant();return Ft.isNorthern(o)&&Ft.isNorthern(n)?i:Ft.isNorthern(o)||Ft.isNorthern(n)?0!==i.getDy()?i:0!==r.getDy()?r:(m.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},print:function(e){N.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var t=this.iterator();t.hasNext();){var i=t.next();e.print("out "),i.print(e),e.println(),e.print("in "),i.getSym().print(e),e.println()}},getResultAreaEdges:function(){if(null!==this.resultAreaEdgeList)return this.resultAreaEdgeList;this.resultAreaEdgeList=new w;for(var e=this.iterator();e.hasNext();){var t=e.next();(t.isInResult()||t.getSym().isInResult())&&this.resultAreaEdgeList.add(t)}return this.resultAreaEdgeList},updateLabelling:function(e){for(var t=this.iterator();t.hasNext();){var i=t.next().getLabel();i.setAllLocationsIfNull(0,e.getLocation(0)),i.setAllLocationsIfNull(1,e.getLocation(1))}},linkAllDirectedEdges:function(){this.getEdges();for(var e=null,t=null,i=this.edgeList.size()-1;0<=i;i--){var r=this.edgeList.get(i),o=r.getSym();null===t&&(t=o),null!==e&&o.setNext(e),e=r}t.setNext(e)},computeDepths:function(){if(1===arguments.length){var e=arguments[0],t=this.findIndex(e),i=(e.getLabel(),e.getDepth(Jt.LEFT)),r=e.getDepth(Jt.RIGHT),o=this.computeDepths(t+1,this.edgeList.size(),i);if(this.computeDepths(0,t,o)!==r)throw new zt("depth mismatch at "+e.getCoordinate())}else if(3===arguments.length){for(var n=arguments[0],a=arguments[1],s=arguments[2],l=n;l<a;l++){var u=this.edgeList.get(l);u.getLabel(),u.setEdgeDepths(Jt.RIGHT,s),s=u.getDepth(Jt.LEFT)}return s}},mergeSymLabels:function(){for(var e=this.iterator();e.hasNext();){var t=e.next();t.getLabel().merge(t.getSym().getLabel())}},linkMinimalDirectedEdges:function(e){for(var t=null,i=null,r=this.SCANNING_FOR_INCOMING,o=this.resultAreaEdgeList.size()-1;0<=o;o--){var n=this.resultAreaEdgeList.get(o),a=n.getSym();switch(null===t&&n.getEdgeRing()===e&&(t=n),r){case this.SCANNING_FOR_INCOMING:if(a.getEdgeRing()!==e)continue;i=a,r=this.LINKING_TO_OUTGOING;break;case this.LINKING_TO_OUTGOING:if(n.getEdgeRing()!==e)continue;i.setNextMin(n),r=this.SCANNING_FOR_INCOMING}}r===this.LINKING_TO_OUTGOING&&(m.isTrue(null!==t,"found null for first outgoing dirEdge"),m.isTrue(t.getEdgeRing()===e,"unable to link last incoming dirEdge"),i.setNextMin(t))},getOutgoingDegree:function(){if(0===arguments.length){for(var e=0,t=this.iterator();t.hasNext();){t.next().isInResult()&&e++}return e}if(1===arguments.length){var i=arguments[0];for(e=0,t=this.iterator();t.hasNext();){t.next().getEdgeRing()===i&&e++}return e}},getLabel:function(){return this.label},findCoveredLineEdges:function(){for(var e=x.NONE,t=this.iterator();t.hasNext();){var i=(o=t.next()).getSym();if(!o.isLineEdge()){if(o.isInResult()){e=x.INTERIOR;break}if(i.isInResult()){e=x.EXTERIOR;break}}}if(e===x.NONE)return null;var r=e;for(t=this.iterator();t.hasNext();){var o;i=(o=t.next()).getSym();o.isLineEdge()?o.getEdge().setCovered(r===x.INTERIOR):(o.isInResult()&&(r=x.EXTERIOR),i.isInResult()&&(r=x.INTERIOR))}},computeLabelling:function(e){mi.prototype.computeLabelling.call(this,e),this.label=new Kt(x.NONE);for(var t=this.iterator();t.hasNext();)for(var i=t.next().getEdge().getLabel(),r=0;r<2;r++){var o=i.getLocation(r);o!==x.INTERIOR&&o!==x.BOUNDARY||this.label.setLocation(r,x.INTERIOR)}},interfaces_:function(){return[]},getClass:function(){return pi}}),s(gi,ai),t(gi.prototype,{createNode:function(e){return new ii(e,new pi)},interfaces_:function(){return[]},getClass:function(){return gi}}),t(fi.prototype,{computeIntersections:function(e,t){this.mce.computeIntersectsForChain(this.chainIndex,e.mce,e.chainIndex,t)},interfaces_:function(){return[]},getClass:function(){return fi}}),t(vi.prototype,{isDelete:function(){return this.eventType===vi.DELETE},setDeleteEventIndex:function(e){this.deleteEventIndex=e},getObject:function(){return this.obj},compareTo:function(e){var t=e;return this.xValue<t.xValue?-1:this.xValue>t.xValue?1:this.eventType<t.eventType?-1:this.eventType>t.eventType?1:0},getInsertEvent:function(){return this.insertEvent},isInsert:function(){return this.eventType===vi.INSERT},isSameLabel:function(e){return null!==this.label&&this.label===e.label},getDeleteEventIndex:function(){return this.deleteEventIndex},interfaces_:function(){return[i]},getClass:function(){return vi}}),vi.INSERT=1,vi.DELETE=2,t(_i.prototype,{interfaces_:function(){return[]},getClass:function(){return _i}}),t(yi.prototype,{isTrivialIntersection:function(e,t,i,r){if(e===i&&1===this.li.getIntersectionNum()){if(yi.isAdjacentSegments(t,r))return!0;if(e.isClosed()){var o=e.getNumPoints()-1;if(0===t&&r===o||0===r&&t===o)return!0}}return!1},getProperIntersectionPoint:function(){return this.properIntersectionPoint},setIsDoneIfProperInt:function(e){this.isDoneWhenProperInt=e},hasProperInteriorIntersection:function(){return this.hasProperInterior},isBoundaryPointInternal:function(e,t){for(var i=t.iterator();i.hasNext();){var r=i.next().getCoordinate();if(e.isIntersection(r))return!0}return!1},hasProperIntersection:function(){return this.hasProper},hasIntersection:function(){return this._hasIntersection},isDone:function(){return this._isDone},isBoundaryPoint:function(e,t){return!(null===t||!this.isBoundaryPointInternal(e,t[0])&&!this.isBoundaryPointInternal(e,t[1]))},setBoundaryNodes:function(e,t){this.bdyNodes=new Array(2).fill(null),this.bdyNodes[0]=e,this.bdyNodes[1]=t},addIntersections:function(e,t,i,r){if(e===i&&t===r)return null;this.numTests++;var o=e.getCoordinates()[t],n=e.getCoordinates()[t+1],a=i.getCoordinates()[r],s=i.getCoordinates()[r+1];this.li.computeIntersection(o,n,a,s),this.li.hasIntersection()&&(this.recordIsolated&&(e.setIsolated(!1),i.setIsolated(!1)),this.numIntersections++,this.isTrivialIntersection(e,t,i,r)||(this._hasIntersection=!0,!this.includeProper&&this.li.isProper()||(e.addIntersections(this.li,t,0),i.addIntersections(this.li,r,1)),this.li.isProper()&&(this.properIntersectionPoint=this.li.getIntersection(0).copy(),this.hasProper=!0,this.isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this.li,this.bdyNodes)||(this.hasProperInterior=!0))))},interfaces_:function(){return[]},getClass:function(){return yi}}),yi.isAdjacentSegments=function(e,t){return 1===Math.abs(e-t)},s(Ci,_i),t(Ci.prototype,{prepareEvents:function(){Xn.sort(this.events);for(var e=0;e<this.events.size();e++){var t=this.events.get(e);t.isDelete()&&t.getInsertEvent().setDeleteEventIndex(e)}},computeIntersections:function(){if(1===arguments.length){var e=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var t=0;t<this.events.size();t++){var i=this.events.get(t);if(i.isInsert()&&this.processOverlaps(t,i.getDeleteEventIndex(),i,e),e.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof yi&&T(arguments[0],v)&&T(arguments[1],v)){var r=arguments[0],o=arguments[1],n=arguments[2];this.addEdges(r,r),this.addEdges(o,o),this.computeIntersections(n)}else if("boolean"==typeof arguments[2]&&T(arguments[0],v)&&arguments[1]instanceof yi){var a=arguments[0],s=arguments[1];arguments[2]?this.addEdges(a,null):this.addEdges(a),this.computeIntersections(s)}},addEdge:function(e,t){for(var i=e.getMonotoneChainEdge(),r=i.getStartIndexes(),o=0;o<r.length-1;o++){var n=new fi(i,o),a=new vi(t,i.getMinX(o),n);this.events.add(a),this.events.add(new vi(i.getMaxX(o),a))}},processOverlaps:function(e,t,i,r){for(var o=i.getObject(),n=e;n<t;n++){var a=this.events.get(n);if(a.isInsert()){var s=a.getObject();i.isSameLabel(a)||(o.computeIntersections(s,r),this.nOverlaps++)}}},addEdges:function(){if(1===arguments.length)for(var e=arguments[0].iterator();e.hasNext();){var t=e.next();this.addEdge(t,t)}else if(2===arguments.length){var i=arguments[0],r=arguments[1];for(e=i.iterator();e.hasNext();){t=e.next();this.addEdge(t,r)}}},interfaces_:function(){return[]},getClass:function(){return Ci}}),t(wi.prototype,{getMin:function(){return this.min},intersects:function(e,t){return!(this.min>t||this.max<e)},getMax:function(){return this.max},toString:function(){return Ue.toLineString(new C(this.min,0),new C(this.max,0))},interfaces_:function(){return[]},getClass:function(){return wi}}),t(bi.prototype,{compare:function(e,t){var i=e,r=t,o=(i.min+i.max)/2,n=(r.min+r.max)/2;return o<n?-1:n<o?1:0},interfaces_:function(){return[n]},getClass:function(){return bi}}),wi.NodeComparator=bi,s(Ei,wi),t(Ei.prototype,{query:function(e,t,i){return this.intersects(e,t)?void i.visitItem(this.item):null},interfaces_:function(){return[]},getClass:function(){return Ei}}),s(Si,wi),t(Si.prototype,{buildExtent:function(e,t){this.min=Math.min(e.min,t.min),this.max=Math.max(e.max,t.max)},query:function(e,t,i){return this.intersects(e,t)?(null!==this.node1&&this.node1.query(e,t,i),void(null!==this.node2&&this.node2.query(e,t,i))):null},interfaces_:function(){return[]},getClass:function(){return Si}}),t(Pi.prototype,{buildTree:function(){Xn.sort(this.leaves,new IntervalRTreeNode.NodeComparator);for(var e=this.leaves,t=null,i=new w;;){if(this.buildLevel(e,i),1===i.size())return i.get(0);t=e,e=i,i=t}},insert:function(e,t,i){if(null!==this.root)throw new IllegalStateException("Index cannot be added to once it has been queried");this.leaves.add(new Ei(e,t,i))},query:function(e,t,i){this.init(),this.root.query(e,t,i)},buildRoot:function(){return null!==this.root?null:void(this.root=this.buildTree())},printNode:function(e){N.out.println(Ue.toLineString(new C(e.min,this.level),new C(e.max,this.level)))},init:function(){return null!==this.root?null:void this.buildRoot()},buildLevel:function(e,t){this.level++,t.clear();for(var i=0;i<e.size();i+=2){var r=e.get(i);if(null===(i+1<e.size()?e.get(i):null))t.add(r);else{var o=new Si(e.get(i),e.get(i+1));t.add(o)}}},interfaces_:function(){return[]},getClass:function(){return Pi}}),t(xi.prototype,{filter:function(e){if(this.isForcedToLineString&&e instanceof De){var t=e.getFactory().createLineString(e.getCoordinateSequence());return this.lines.add(t),null}e instanceof Ee&&this.lines.add(e)},setForceToLineString:function(e){this.isForcedToLineString=e},interfaces_:function(){return[H]},getClass:function(){return xi}}),xi.getGeometry=function(){if(1===arguments.length){var e=arguments[0];return e.getFactory().buildGeometry(xi.getLines(e))}if(2===arguments.length){var t=arguments[0],i=arguments[1];return t.getFactory().buildGeometry(xi.getLines(t,i))}},xi.getLines=function(){if(1===arguments.length){var e=arguments[0];return xi.getLines(e,!1)}if(2===arguments.length){if(T(arguments[0],f)&&T(arguments[1],f)){for(var t=arguments[0],i=arguments[1],r=t.iterator();r.hasNext();){var o=r.next();xi.getLines(o,i)}return i}if(arguments[0]instanceof G&&"boolean"==typeof arguments[1]){var n=arguments[0],a=arguments[1],s=new w;return n.apply(new xi(s,a)),s}if(arguments[0]instanceof G&&T(arguments[1],f)){var l=arguments[0],u=arguments[1];return l instanceof Ee?u.add(l):l.apply(new xi(u)),u}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&T(arguments[0],f)&&T(arguments[1],f)){var c=arguments[0],h=arguments[1],d=arguments[2];for(r=c.iterator();r.hasNext();){o=r.next();xi.getLines(o,h,d)}return h}if("boolean"==typeof arguments[2]&&arguments[0]instanceof G&&T(arguments[1],f)){var m=arguments[0],p=arguments[1],g=arguments[2];return m.apply(new xi(p,g)),p}}},t(Ti.prototype,{visitItem:function(e){this.items.add(e)},getItems:function(){return this.items},interfaces_:function(){return[wt]},getClass:function(){return Ti}}),t(Ii.prototype,{locate:function(e){var t=new Je(e),i=new Di(t);return this.index.query(e.y,e.y,i),t.getLocation()},interfaces_:function(){return[hi]},getClass:function(){return Ii}}),t(Di.prototype,{visitItem:function(e){var t=e;this.counter.countSegment(t.getCoordinate(0),t.getCoordinate(1))},interfaces_:function(){return[wt]},getClass:function(){return Di}}),t(Li.prototype,{init:function(e){for(var t=xi.getLines(e).iterator();t.hasNext();){var i=t.next().getCoordinates();this.addLine(i)}},addLine:function(e){for(var t=1;t<e.length;t++){var i=new Ke(e[t-1],e[t]),r=Math.min(i.p0.y,i.p1.y),o=Math.max(i.p0.y,i.p1.y);this.index.insert(r,o,i)}},query:function(){if(2===arguments.length){var e=arguments[0],t=arguments[1],i=new Ti;return this.index.query(e,t,i),i.getItems()}if(3===arguments.length){var r=arguments[0],o=arguments[1],n=arguments[2];this.index.query(r,o,n)}},interfaces_:function(){return[]},getClass:function(){return Li}}),Ii.SegmentVisitor=Di,Ii.IntervalIndexedGeometry=Li,t(Mi.prototype,{getSegmentIndex:function(){return this.segmentIndex},getCoordinate:function(){return this.coord},print:function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex),e.println(" dist = "+this.dist)},compareTo:function(e){var t=e;return this.compare(t.segmentIndex,t.dist)},isEndPoint:function(e){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===e},toString:function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},getDistance:function(){return this.dist},compare:function(e,t){return this.segmentIndex<e?-1:this.segmentIndex>e?1:this.dist<t?-1:this.dist>t?1:0},interfaces_:function(){return[i]},getClass:function(){return Mi}}),t(Ai.prototype,{print:function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();){t.next().print(e)}},iterator:function(){return this.nodeMap.values().iterator()},addSplitEdges:function(e){this.addEndpoints();for(var t=this.iterator(),i=t.next();t.hasNext();){var r=t.next(),o=this.createSplitEdge(i,r);e.add(o),i=r}},addEndpoints:function(){var e=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[e],e,0)},createSplitEdge:function(e,t){var i=t.segmentIndex-e.segmentIndex+2,r=this.edge.pts[t.segmentIndex],o=0<t.dist||!t.coord.equals2D(r);o||i--;var n=new Array(i).fill(null),a=0;n[a++]=new C(e.coord);for(var s=e.segmentIndex+1;s<=t.segmentIndex;s++)n[a++]=this.edge.pts[s];return o&&(n[a]=t.coord),new Vi(n,new Kt(this.edge.label))},add:function(e,t,i){var r=new Mi(e,t,i),o=this.nodeMap.get(r);return null!==o?o:(this.nodeMap.put(r,r),r)},isIntersection:function(e){for(var t=this.iterator();t.hasNext();){if(t.next().coord.equals(e))return!0}return!1},interfaces_:function(){return[]},getClass:function(){return Ai}}),t(Ri.prototype,{getChainStartIndices:function(e){var t=0,i=new w;i.add(new L(t));do{var r=this.findChainEnd(e,t);i.add(new L(r)),t=r}while(t<e.length-1);return Ri.toIntArray(i)},findChainEnd:function(e,t){for(var i=Ft.quadrant(e[t],e[t+1]),r=t+1;r<e.length;){if(Ft.quadrant(e[r-1],e[r])!==i)break;r++}return r-1},interfaces_:function(){return[]},getClass:function(){return Ri}}),Ri.toIntArray=function(e){for(var t=new Array(e.size()).fill(null),i=0;i<t.length;i++)t[i]=e.get(i).intValue();return t},t(Oi.prototype,{getCoordinates:function(){return this.pts},getMaxX:function(e){var t=this.pts[this.startIndex[e]].x,i=this.pts[this.startIndex[e+1]].x;return i<t?t:i},getMinX:function(e){var t=this.pts[this.startIndex[e]].x,i=this.pts[this.startIndex[e+1]].x;return t<i?t:i},computeIntersectsForChain:function(){if(4===arguments.length){var e=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[e],this.startIndex[e+1],t,t.startIndex[i],t.startIndex[i+1],r)}else if(6===arguments.length){var o=arguments[0],n=arguments[1],a=arguments[2],s=arguments[3],l=arguments[4],u=arguments[5],c=this.pts[o],h=this.pts[n],d=a.pts[s],m=a.pts[l];if(n-o==1&&l-s==1)return u.addIntersections(this.e,o,a.e,s),null;if(this.env1.init(c,h),this.env2.init(d,m),!this.env1.intersects(this.env2))return null;var p=Math.trunc((o+n)/2),g=Math.trunc((s+l)/2);o<p&&(s<g&&this.computeIntersectsForChain(o,p,a,s,g,u),g<l&&this.computeIntersectsForChain(o,p,a,g,l,u)),p<n&&(s<g&&this.computeIntersectsForChain(p,n,a,s,g,u),g<l&&this.computeIntersectsForChain(p,n,a,g,l,u))}},getStartIndexes:function(){return this.startIndex},computeIntersects:function(e,t){for(var i=0;i<this.startIndex.length-1;i++)for(var r=0;r<e.startIndex.length-1;r++)this.computeIntersectsForChain(i,e,r,t)},interfaces_:function(){return[]},getClass:function(){return Oi}}),t(Ni.prototype,{getDepth:function(e,t){return this.depth[e][t]},setDepth:function(e,t,i){this.depth[e][t]=i},isNull:function(){if(0===arguments.length){for(var e=0;e<2;e++)for(var t=0;t<3;t++)if(this.depth[e][t]!==Ni.NULL_VALUE)return!1;return!0}if(1===arguments.length){var i=arguments[0];return this.depth[i][1]===Ni.NULL_VALUE}if(2===arguments.length){var r=arguments[0],o=arguments[1];return this.depth[r][o]===Ni.NULL_VALUE}},normalize:function(){for(var e=0;e<2;e++)if(!this.isNull(e)){var t=this.depth[e][1];this.depth[e][2]<t&&(t=this.depth[e][2]),t<0&&(t=0);for(var i=1;i<3;i++){var r=0;this.depth[e][i]>t&&(r=1),this.depth[e][i]=r}}},getDelta:function(e){return this.depth[e][Jt.RIGHT]-this.depth[e][Jt.LEFT]},getLocation:function(e,t){return this.depth[e][t]<=0?x.EXTERIOR:x.INTERIOR},toString:function(){return"A: "+this.depth[0][1]+","+this.depth[0][2]+" B: "+this.depth[1][1]+","+this.depth[1][2]},add:function(){if(1===arguments.length)for(var e=arguments[0],t=0;t<2;t++)for(var i=1;i<3;i++){var r=e.getLocation(t,i);r!==x.EXTERIOR&&r!==x.INTERIOR||(this.isNull(t,i)?this.depth[t][i]=Ni.depthAtLocation(r):this.depth[t][i]+=Ni.depthAtLocation(r))}else if(3===arguments.length){var o=arguments[0],n=arguments[1];arguments[2]===x.INTERIOR&&this.depth[o][n]++}},interfaces_:function(){return[]},getClass:function(){return Ni}}),Ni.depthAtLocation=function(e){return e===x.EXTERIOR?0:e===x.INTERIOR?1:Ni.NULL_VALUE},Ni.NULL_VALUE=-1,s(Vi,ti),t(Vi.prototype,{getDepth:function(){return this.depth},getCollapsedEdge:function(){var e=new Array(2).fill(null);return e[0]=this.pts[0],e[1]=this.pts[1],new Vi(e,Kt.toLineLabel(this.label))},isIsolated:function(){return this._isIsolated},getCoordinates:function(){return this.pts},setIsolated:function(e){this._isIsolated=e},setName:function(e){this.name=e},equals:function(e){if(!(e instanceof Vi))return!1;var t=e;if(this.pts.length!==t.pts.length)return!1;for(var i=!0,r=!0,o=this.pts.length,n=0;n<this.pts.length;n++)if(this.pts[n].equals2D(t.pts[n])||(i=!1),this.pts[n].equals2D(t.pts[--o])||(r=!1),!i&&!r)return!1;return!0},getCoordinate:function(){if(0===arguments.length)return 0<this.pts.length?this.pts[0]:null;if(1===arguments.length){var e=arguments[0];return this.pts[e]}},print:function(e){e.print("edge "+this.name+": "),e.print("LINESTRING (");for(var t=0;t<this.pts.length;t++)0<t&&e.print(","),e.print(this.pts[t].x+" "+this.pts[t].y);e.print(") "+this.label+" "+this.depthDelta)},computeIM:function(e){Vi.updateIM(this.label,e)},isCollapsed:function(){return!!this.label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},isClosed:function(){return this.pts[0].equals(this.pts[this.pts.length-1])},getMaximumSegmentIndex:function(){return this.pts.length-1},getDepthDelta:function(){return this.depthDelta},getNumPoints:function(){return this.pts.length},printReverse:function(e){e.print("edge "+this.name+": ");for(var t=this.pts.length-1;0<=t;t--)e.print(this.pts[t]+" ");e.println("")},getMonotoneChainEdge:function(){return null===this.mce&&(this.mce=new Oi(this)),this.mce},getEnvelope:function(){if(null===this.env){this.env=new E;for(var e=0;e<this.pts.length;e++)this.env.expandToInclude(this.pts[e])}return this.env},addIntersection:function(e,t,i,r){var o=new C(e.getIntersection(r)),n=t,a=e.getEdgeDistance(i,r),s=n+1;if(s<this.pts.length){var l=this.pts[s];o.equals2D(l)&&(n=s,a=0)}this.eiList.add(o,n,a)},toString:function(){var e=new D;e.append("edge "+this.name+": "),e.append("LINESTRING (");for(var t=0;t<this.pts.length;t++)0<t&&e.append(","),e.append(this.pts[t].x+" "+this.pts[t].y);return e.append(") "+this.label+" "+this.depthDelta),e.toString()},isPointwiseEqual:function(e){if(this.pts.length!==e.pts.length)return!1;for(var t=0;t<this.pts.length;t++)if(!this.pts[t].equals2D(e.pts[t]))return!1;return!0},setDepthDelta:function(e){this.depthDelta=e},getEdgeIntersectionList:function(){return this.eiList},addIntersections:function(e,t,i){for(var r=0;r<e.getIntersectionNum();r++)this.addIntersection(e,t,i,r)},interfaces_:function(){return[]},getClass:function(){return Vi}}),Vi.updateIM=function(){if(2!==arguments.length)return ti.prototype.updateIM.apply(this,arguments);var e=arguments[0],t=arguments[1];t.setAtLeastIfValid(e.getLocation(0,Jt.ON),e.getLocation(1,Jt.ON),1),e.isArea()&&(t.setAtLeastIfValid(e.getLocation(0,Jt.LEFT),e.getLocation(1,Jt.LEFT),2),t.setAtLeastIfValid(e.getLocation(0,Jt.RIGHT),e.getLocation(1,Jt.RIGHT),2))},s(Fi,si),t(Fi.prototype,{insertBoundaryPoint:function(e,t){var i=this.nodes.addNode(t).getLabel(),r=1;i.getLocation(e,Jt.ON)===x.BOUNDARY&&r++;var o=Fi.determineBoundary(this.boundaryNodeRule,r);i.setLocation(e,o)},computeSelfNodes:function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];return this.computeSelfNodes(e,t,!1)}if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],n=new yi(i,!0,!1);n.setIsDoneIfProperInt(o);var a=this.createEdgeSetIntersector(),s=this.parentGeom instanceof De||this.parentGeom instanceof Te||this.parentGeom instanceof Le,l=r||!s;return a.computeIntersections(this.edges,n,l),this.addSelfIntersectionNodes(this.argIndex),n}},computeSplitEdges:function(e){for(var t=this.edges.iterator();t.hasNext();){t.next().eiList.addSplitEdges(e)}},computeEdgeIntersections:function(e,t,i){var r=new yi(t,i,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),e.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this.edges,e.edges,r),r},getGeometry:function(){return this.parentGeom},getBoundaryNodeRule:function(){return this.boundaryNodeRule},hasTooFewPoints:function(){return this._hasTooFewPoints},addPoint:function(){if(arguments[0]instanceof Pe){var e=arguments[0].getCoordinate();this.insertPoint(this.argIndex,e,x.INTERIOR)}else if(arguments[0]instanceof C){var t=arguments[0];this.insertPoint(this.argIndex,t,x.INTERIOR)}},addPolygon:function(e){this.addPolygonRing(e.getExteriorRing(),x.EXTERIOR,x.INTERIOR);for(var t=0;t<e.getNumInteriorRing();t++){var i=e.getInteriorRingN(t);this.addPolygonRing(i,x.INTERIOR,x.EXTERIOR)}},addEdge:function(e){this.insertEdge(e);var t=e.getCoordinates();this.insertPoint(this.argIndex,t[0],x.BOUNDARY),this.insertPoint(this.argIndex,t[t.length-1],x.BOUNDARY)},addLineString:function(e){var t=q.removeRepeatedPoints(e.getCoordinates());if(t.length<2)return this._hasTooFewPoints=!0,this.invalidPoint=t[0],null;var i=new Vi(t,new Kt(this.argIndex,x.INTERIOR));this.lineEdgeMap.put(e,i),this.insertEdge(i),m.isTrue(2<=t.length,"found LineString with single point"),this.insertBoundaryPoint(this.argIndex,t[0]),this.insertBoundaryPoint(this.argIndex,t[t.length-1])},getInvalidPoint:function(){return this.invalidPoint},getBoundaryPoints:function(){for(var e=this.getBoundaryNodes(),t=new Array(e.size()).fill(null),i=0,r=e.iterator();r.hasNext();){var o=r.next();t[i++]=o.getCoordinate().copy()}return t},getBoundaryNodes:function(){return null===this.boundaryNodes&&(this.boundaryNodes=this.nodes.getBoundaryNodes(this.argIndex)),this.boundaryNodes},addSelfIntersectionNode:function(e,t,i){return this.isBoundaryNode(e,t)?null:void(i===x.BOUNDARY&&this.useBoundaryDeterminationRule?this.insertBoundaryPoint(e,t):this.insertPoint(e,t,i))},addPolygonRing:function(e,t,i){if(e.isEmpty())return null;var r=q.removeRepeatedPoints(e.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this.invalidPoint=r[0],null;var o=t,n=i;Qe.isCCW(r)&&(o=i,n=t);var a=new Vi(r,new Kt(this.argIndex,x.BOUNDARY,o,n));this.lineEdgeMap.put(e,a),this.insertEdge(a),this.insertPoint(this.argIndex,r[0],x.BOUNDARY)},insertPoint:function(e,t,i){var r=this.nodes.addNode(t),o=r.getLabel();null===o?r.label=new Kt(e,i):o.setLocation(e,i)},createEdgeSetIntersector:function(){return new Ci},addSelfIntersectionNodes:function(e){for(var t=this.edges.iterator();t.hasNext();)for(var i=t.next(),r=i.getLabel().getLocation(e),o=i.eiList.iterator();o.hasNext();){var n=o.next();this.addSelfIntersectionNode(e,n.coord,r)}},add:function(){if(1!==arguments.length)return si.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof Le&&(this.useBoundaryDeterminationRule=!1),e instanceof Te)this.addPolygon(e);else if(e instanceof Ee)this.addLineString(e);else if(e instanceof Pe)this.addPoint(e);else if(e instanceof Ie)this.addCollection(e);else if(e instanceof me)this.addCollection(e);else if(e instanceof Le)this.addCollection(e);else{if(!(e instanceof de))throw new UnsupportedOperationException(e.getClass().getName());this.addCollection(e)}},addCollection:function(e){for(var t=0;t<e.getNumGeometries();t++){var i=e.getGeometryN(t);this.add(i)}},locate:function(e){return T(this.parentGeom,xe)&&50<this.parentGeom.getNumGeometries()?(null===this.areaPtLocator&&(this.areaPtLocator=new Ii(this.parentGeom)),this.areaPtLocator.locate(e)):this.ptLocator.locate(e,this.parentGeom)},findEdge:function(){if(1!==arguments.length)return si.prototype.findEdge.apply(this,arguments);var e=arguments[0];return this.lineEdgeMap.get(e)},interfaces_:function(){return[]},getClass:function(){return Fi}}),Fi.determineBoundary=function(e,t){return e.isInBoundary(t)?x.BOUNDARY:x.INTERIOR},t(Hi.prototype,{getArgGeometry:function(e){return this.arg[e].getGeometry()},setComputationPrecision:function(e){this.resultPrecisionModel=e,this.li.setPrecisionModel(this.resultPrecisionModel)},interfaces_:function(){return[]},getClass:function(){return Hi}}),t(Gi.prototype,{compareTo:function(e){var t=e;return Gi.compareOriented(this.pts,this._orientation,t.pts,t._orientation)},interfaces_:function(){return[i]},getClass:function(){return Gi}}),Gi.orientation=function(e){return 1===q.increasingDirection(e)},Gi.compareOriented=function(e,t,i,r){for(var o=t?1:-1,n=r?1:-1,a=t?e.length:-1,s=r?i.length:-1,l=t?0:e.length-1,u=r?0:i.length-1;;){var c=e[l].compareTo(i[u]);if(0!==c)return c;var h=(l+=o)===a,d=(u+=n)===s;if(h&&!d)return-1;if(!h&&d)return 1;if(h&&d)return 0}},t(ki.prototype,{print:function(e){e.print("MULTILINESTRING ( ");for(var t=0;t<this.edges.size();t++){var i=this.edges.get(t);0<t&&e.print(","),e.print("(");for(var r=i.getCoordinates(),o=0;o<r.length;o++)0<o&&e.print(","),e.print(r[o].x+" "+r[o].y);e.println(")")}e.print(") ")},addAll:function(e){for(var t=e.iterator();t.hasNext();)this.add(t.next())},findEdgeIndex:function(e){for(var t=0;t<this.edges.size();t++)if(this.edges.get(t).equals(e))return t;return-1},iterator:function(){return this.edges.iterator()},getEdges:function(){return this.edges},get:function(e){return this.edges.get(e)},findEqualEdge:function(e){var t=new Gi(e.getCoordinates());return this.ocaMap.get(t)},add:function(e){this.edges.add(e);var t=new Gi(e.getCoordinates());this.ocaMap.put(t,e)},interfaces_:function(){return[]},getClass:function(){return ki}}),s(Bi,Hi),t(Bi.prototype,{insertUniqueEdge:function(e){var t=this.edgeList.findEqualEdge(e);if(null!==t){var i=t.getLabel(),r=e.getLabel();t.isPointwiseEqual(e)||(r=new Kt(e.getLabel())).flip();var o=t.getDepth();o.isNull()&&o.add(i),o.add(r),i.merge(r)}else this.edgeList.add(e)},getGraph:function(){return this.graph},cancelDuplicateResultEdges:function(){for(var e=this.graph.getEdgeEnds().iterator();e.hasNext();){var t=e.next(),i=t.getSym();t.isInResult()&&i.isInResult()&&(t.setInResult(!1),i.setInResult(!1))}},isCoveredByLA:function(e){return!!this.isCovered(e,this.resultLineList)||!!this.isCovered(e,this.resultPolyList)},computeGeometry:function(e,t,i,r){var o=new w;return o.addAll(e),o.addAll(t),o.addAll(i),o.isEmpty()?Bi.createEmptyResult(r,this.arg[0].getGeometry(),this.arg[1].getGeometry(),this.geomFact):this.geomFact.buildGeometry(o)},mergeSymLabels:function(){for(var e=this.graph.getNodes().iterator();e.hasNext();){e.next().getEdges().mergeSymLabels()}},isCovered:function(e,t){for(var i=t.iterator();i.hasNext();){var r=i.next();if(this.ptLocator.locate(e,r)!==x.EXTERIOR)return!0}return!1},replaceCollapsedEdges:function(){for(var e=new w,t=this.edgeList.iterator();t.hasNext();){var i=t.next();i.isCollapsed()&&(t.remove(),e.add(i.getCollapsedEdge()))}this.edgeList.addAll(e)},updateNodeLabelling:function(){for(var e=this.graph.getNodes().iterator();e.hasNext();){var t=e.next(),i=t.getEdges().getLabel();t.getLabel().merge(i)}},getResultGeometry:function(e){return this.computeOverlay(e),this.resultGeom},insertUniqueEdges:function(e){for(var t=e.iterator();t.hasNext();){var i=t.next();this.insertUniqueEdge(i)}},computeOverlay:function(e){this.copyPoints(0),this.copyPoints(1),this.arg[0].computeSelfNodes(this.li,!1),this.arg[1].computeSelfNodes(this.li,!1),this.arg[0].computeEdgeIntersections(this.arg[1],this.li,!0);var t=new w;this.arg[0].computeSplitEdges(t),this.arg[1].computeSplitEdges(t),this.insertUniqueEdges(t),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Yt.checkValid(this.edgeList.getEdges()),this.graph.addEdges(this.edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(e),this.cancelDuplicateResultEdges();var i=new li(this.geomFact);i.add(this.graph),this.resultPolyList=i.getPolygons();var r=new ui(this,this.geomFact,this.ptLocator);this.resultLineList=r.build(e);var o=new ci(this,this.geomFact,this.ptLocator);this.resultPointList=o.build(e),this.resultGeom=this.computeGeometry(this.resultPointList,this.resultLineList,this.resultPolyList,e)},labelIncompleteNode:function(e,t){var i=this.ptLocator.locate(e.getCoordinate(),this.arg[t].getGeometry());e.getLabel().setLocation(t,i)},copyPoints:function(e){for(var t=this.arg[e].getNodeIterator();t.hasNext();){var i=t.next();this.graph.addNode(i.getCoordinate()).setLabel(e,i.getLabel().getLocation(e))}},findResultAreaEdges:function(e){for(var t=this.graph.getEdgeEnds().iterator();t.hasNext();){var i=t.next(),r=i.getLabel();r.isArea()&&!i.isInteriorAreaEdge()&&Bi.isResultOfOp(r.getLocation(0,Jt.RIGHT),r.getLocation(1,Jt.RIGHT),e)&&i.setInResult(!0)}},computeLabelsFromDepths:function(){for(var e=this.edgeList.iterator();e.hasNext();){var t=e.next(),i=t.getLabel(),r=t.getDepth();if(!r.isNull()){r.normalize();for(var o=0;o<2;o++)i.isNull(o)||!i.isArea()||r.isNull(o)||(0===r.getDelta(o)?i.toLine(o):(m.isTrue(!r.isNull(o,Jt.LEFT),"depth of LEFT side has not been initialized"),i.setLocation(o,Jt.LEFT,r.getLocation(o,Jt.LEFT)),m.isTrue(!r.isNull(o,Jt.RIGHT),"depth of RIGHT side has not been initialized"),i.setLocation(o,Jt.RIGHT,r.getLocation(o,Jt.RIGHT))))}}},computeLabelling:function(){for(var e=this.graph.getNodes().iterator();e.hasNext();){e.next().getEdges().computeLabelling(this.arg)}this.mergeSymLabels(),this.updateNodeLabelling()},labelIncompleteNodes:function(){for(var e=this.graph.getNodes().iterator();e.hasNext();){var t=e.next(),i=t.getLabel();t.isIsolated()&&(0,i.isNull(0)?this.labelIncompleteNode(t,0):this.labelIncompleteNode(t,1)),t.getEdges().updateLabelling(i)}},isCoveredByA:function(e){return!!this.isCovered(e,this.resultPolyList)},interfaces_:function(){return[]},getClass:function(){return Bi}}),Bi.overlayOp=function(e,t,i){return new Bi(e,t).getResultGeometry(i)},Bi.intersection=function(e,t){if(e.isEmpty()||t.isEmpty())return Bi.createEmptyResult(Bi.INTERSECTION,e,t,e.getFactory());if(e.isGeometryCollection()){var i=t;return Xt.map(e,{interfaces_:function(){return[MapOp]},map:function(e){return e.intersection(i)}})}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),zi.overlayOp(e,t,Bi.INTERSECTION)},Bi.symDifference=function(e,t){if(e.isEmpty()||t.isEmpty()){if(e.isEmpty()&&t.isEmpty())return Bi.createEmptyResult(Bi.SYMDIFFERENCE,e,t,e.getFactory());if(e.isEmpty())return t.copy();if(t.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),zi.overlayOp(e,t,Bi.SYMDIFFERENCE)},Bi.resultDimension=function(e,t,i){var r=t.getDimension(),o=i.getDimension(),n=-1;switch(e){case Bi.INTERSECTION:n=Math.min(r,o);break;case Bi.UNION:n=Math.max(r,o);break;case Bi.DIFFERENCE:n=r;break;case Bi.SYMDIFFERENCE:n=Math.max(r,o)}return n},Bi.createEmptyResult=function(e,t,i,r){var o=null;switch(Bi.resultDimension(e,t,i)){case-1:o=r.createGeometryCollection(new Array(0).fill(null));break;case 0:o=r.createPoint();break;case 1:o=r.createLineString();break;case 2:o=r.createPolygon()}return o},Bi.difference=function(e,t){return e.isEmpty()?Bi.createEmptyResult(Bi.DIFFERENCE,e,t,e.getFactory()):t.isEmpty()?e.copy():(e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),zi.overlayOp(e,t,Bi.DIFFERENCE))},Bi.isResultOfOp=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1],i=e.getLocation(0),r=e.getLocation(1);return Bi.isResultOfOp(i,r,t)}if(3===arguments.length){var o=arguments[0],n=arguments[1],a=arguments[2];switch(o===x.BOUNDARY&&(o=x.INTERIOR),n===x.BOUNDARY&&(n=x.INTERIOR),a){case Bi.INTERSECTION:return o===x.INTERIOR&&n===x.INTERIOR;case Bi.UNION:return o===x.INTERIOR||n===x.INTERIOR;case Bi.DIFFERENCE:return o===x.INTERIOR&&n!==x.INTERIOR;case Bi.SYMDIFFERENCE:return o===x.INTERIOR&&n!==x.INTERIOR||o!==x.INTERIOR&&n===x.INTERIOR}return!1}},Bi.INTERSECTION=1,Bi.UNION=2,Bi.DIFFERENCE=3,Bi.SYMDIFFERENCE=4,t(ji.prototype,{selfSnap:function(e){return new st(e).snapTo(e,this.snapTolerance)},removeCommonBits:function(e){this.cbr=new ct,this.cbr.add(e[0]),this.cbr.add(e[1]);var t=new Array(2).fill(null);return t[0]=this.cbr.removeCommonBits(e[0].copy()),t[1]=this.cbr.removeCommonBits(e[1].copy()),t},prepareResult:function(e){return this.cbr.addCommonBits(e),e},getResultGeometry:function(e){var t=this.snap(this.geom),i=Bi.overlayOp(t[0],t[1],e);return this.prepareResult(i)},checkValid:function(e){e.isValid()||N.out.println("Snapped geometry is invalid")},computeSnapTolerance:function(){this.snapTolerance=st.computeOverlaySnapTolerance(this.geom[0],this.geom[1])},snap:function(e){var t=this.removeCommonBits(e);return st.snap(t[0],t[1],this.snapTolerance)},interfaces_:function(){return[]},getClass:function(){return ji}}),ji.overlayOp=function(e,t,i){return new ji(e,t).getResultGeometry(i)},ji.union=function(e,t){return ji.overlayOp(e,t,Bi.UNION)},ji.intersection=function(e,t){return ji.overlayOp(e,t,Bi.INTERSECTION)},ji.symDifference=function(e,t){return ji.overlayOp(e,t,Bi.SYMDIFFERENCE)},ji.difference=function(e,t){return ji.overlayOp(e,t,Bi.DIFFERENCE)},t(zi.prototype,{getResultGeometry:function(e){var t=null,i=!1,r=null;try{t=Bi.overlayOp(this.geom[0],this.geom[1],e);i=!0}catch(e){if(!(e instanceof y))throw e;r=e}if(!i)try{t=ji.overlayOp(this.geom[0],this.geom[1],e)}catch(e){throw e instanceof y?r:e}return t},interfaces_:function(){return[]},getClass:function(){return zi}}),zi.overlayOp=function(e,t,i){return new zi(e,t).getResultGeometry(i)},zi.union=function(e,t){return zi.overlayOp(e,t,Bi.UNION)},zi.intersection=function(e,t){return zi.overlayOp(e,t,Bi.INTERSECTION)},zi.symDifference=function(e,t){return zi.overlayOp(e,t,Bi.SYMDIFFERENCE)},zi.difference=function(e,t){return zi.overlayOp(e,t,Bi.DIFFERENCE)},t(Wi.prototype,{addPolygon:function(e){if(e.isEmpty())return null;var t=null,i=0,r=this.horizontalBisector(e);if(0===r.getLength())i=0,t=r.getCoordinate();else{var o=zi.overlayOp(r,e,Bi.INTERSECTION),n=this.widestGeometry(o);i=n.getEnvelopeInternal().getWidth(),t=Wi.centre(n.getEnvelopeInternal())}(null===this.interiorPoint||i>this.maxWidth)&&(this.interiorPoint=t,this.maxWidth=i)},getInteriorPoint:function(){return this.interiorPoint},widestGeometry:function(){if(arguments[0]instanceof de){var e=arguments[0];if(e.isEmpty())return e;for(var t=e.getGeometryN(0),i=1;i<e.getNumGeometries();i++)e.getGeometryN(i).getEnvelopeInternal().getWidth()>t.getEnvelopeInternal().getWidth()&&(t=e.getGeometryN(i));return t}if(arguments[0]instanceof G){var r=arguments[0];return r instanceof de?this.widestGeometry(r):r}},horizontalBisector:function(e){var t=e.getEnvelopeInternal(),i=Ui.getBisectorY(e);return this.factory.createLineString([new C(t.getMinX(),i),new C(t.getMaxX(),i)])},add:function(e){if(e instanceof Te)this.addPolygon(e);else if(e instanceof de)for(var t=e,i=0;i<t.getNumGeometries();i++)this.add(t.getGeometryN(i))},interfaces_:function(){return[]},getClass:function(){return Wi}}),Wi.centre=function(e){return new C(Wi.avg(e.getMinX(),e.getMaxX()),Wi.avg(e.getMinY(),e.getMaxY()))},Wi.avg=function(e,t){return(e+t)/2},t(Ui.prototype,{updateInterval:function(e){e<=this.centreY?e>this.loY&&(this.loY=e):e>this.centreY&&e<this.hiY&&(this.hiY=e)},getBisectorY:function(){this.process(this.poly.getExteriorRing());for(var e=0;e<this.poly.getNumInteriorRing();e++)this.process(this.poly.getInteriorRingN(e));return Wi.avg(this.hiY,this.loY)},process:function(e){for(var t=e.getCoordinateSequence(),i=0;i<t.size();i++){var r=t.getY(i);this.updateInterval(r)}},interfaces_:function(){return[]},getClass:function(){return Ui}}),Ui.getBisectorY=function(e){return new Ui(e).getBisectorY()},Wi.SafeBisectorFinder=Ui,t(qi.prototype,{addEndpoints:function(){if(arguments[0]instanceof G){var e=arguments[0];if(e instanceof Ee)this.addEndpoints(e.getCoordinates());else if(e instanceof de)for(var t=e,i=0;i<t.getNumGeometries();i++)this.addEndpoints(t.getGeometryN(i))}else if(arguments[0]instanceof Array){var r=arguments[0];this.add(r[0]),this.add(r[r.length-1])}},getInteriorPoint:function(){return this.interiorPoint},addInterior:function(){if(arguments[0]instanceof G){var e=arguments[0];if(e instanceof Ee)this.addInterior(e.getCoordinates());else if(e instanceof de)for(var t=e,i=0;i<t.getNumGeometries();i++)this.addInterior(t.getGeometryN(i))}else if(arguments[0]instanceof Array){var r=arguments[0];for(i=1;i<r.length-1;i++)this.add(r[i])}},add:function(e){var t=e.distance(this.centroid);t<this.minDistance&&(this.interiorPoint=new C(e),this.minDistance=t)},interfaces_:function(){return[]},getClass:function(){return qi}}),t(Yi.prototype,{getInteriorPoint:function(){return this.interiorPoint},add:function(){if(arguments[0]instanceof G){var e=arguments[0];if(e instanceof Pe)this.add(e.getCoordinate());else if(e instanceof de)for(var t=e,i=0;i<t.getNumGeometries();i++)this.add(t.getGeometryN(i))}else if(arguments[0]instanceof C){var r=arguments[0],o=r.distance(this.centroid);o<this.minDistance&&(this.interiorPoint=new C(r),this.minDistance=o)}},interfaces_:function(){return[]},getClass:function(){return Yi}}),t(Xi.prototype,{select:function(){if(1===arguments.length)arguments[0];else if(2===arguments.length){var e=arguments[0],t=arguments[1];e.getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},interfaces_:function(){return[]},getClass:function(){return Xi}}),t(Ji.prototype,{hasChildren:function(){for(var e=0;e<2;e++)if(null!==this.subnode[e])return!0;return!1},isPrunable:function(){return!(this.hasChildren()||this.hasItems())},addAllItems:function(e){e.addAll(this.items);for(var t=0;t<2;t++)null!==this.subnode[t]&&this.subnode[t].addAllItems(e);return e},size:function(){for(var e=0,t=0;t<2;t++)null!==this.subnode[t]&&(e+=this.subnode[t].size());return e+this.items.size()},addAllItemsFromOverlapping:function(e,t){return null===e||this.isSearchMatch(e)?(t.addAll(this.items),null!==this.subnode[0]&&this.subnode[0].addAllItemsFromOverlapping(e,t),void(null!==this.subnode[1]&&this.subnode[1].addAllItemsFromOverlapping(e,t))):null},hasItems:function(){return!this.items.isEmpty()},remove:function(e,t){if(!this.isSearchMatch(e))return!1;for(var i=!1,r=0;r<2;r++)if(null!==this.subnode[r]&&(i=this.subnode[r].remove(e,t))){this.subnode[r].isPrunable()&&(this.subnode[r]=null);break}return i||(i=this.items.remove(t))},getItems:function(){return this.items},depth:function(){for(var e=0,t=0;t<2;t++)if(null!==this.subnode[t]){var i=this.subnode[t].depth();e<i&&(e=i)}return e+1},nodeSize:function(){for(var e=0,t=0;t<2;t++)null!==this.subnode[t]&&(e+=this.subnode[t].nodeSize());return e+1},add:function(e){this.items.add(e)},interfaces_:function(){return[]},getClass:function(){return Ji}}),Ji.getSubnodeIndex=function(e,t){var i=-1;return e.min>=t&&(i=1),e.max<=t&&(i=0),i},t(Qi.prototype,{expandToInclude:function(e){e.max>this.max&&(this.max=e.max),e.min<this.min&&(this.min=e.min)},getWidth:function(){return this.max-this.min},overlaps:function(){if(1===arguments.length){var e=arguments[0];return this.overlaps(e.min,e.max)}if(2===arguments.length){var t=arguments[0],i=arguments[1];return!(this.min>i||this.max<t)}},getMin:function(){return this.min},toString:function(){return"["+this.min+", "+this.max+"]"},contains:function(){if(1===arguments.length){if(arguments[0]instanceof Qi){var e=arguments[0];return this.contains(e.min,e.max)}if("number"==typeof arguments[0]){var t=arguments[0];return t>=this.min&&t<=this.max}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];return i>=this.min&&r<=this.max}},init:function(e,t){this.min=e,(this.max=t)<e&&(this.min=t,this.max=e)},getMax:function(){return this.max},interfaces_:function(){return[]},getClass:function(){return Qi}}),Ki.exponent=function(e){return function(e,t){var i,r,o,n,a={32:8,64:11}[e];if(n||(i=t<0||1/t<0,isFinite(t)||(n={32:{d:127,c:128,b:0,a:0},64:{d:32752,c:0,b:0,a:0}}[e],i&&(n.d+=1<<e/4-1),r=Math.pow(2,a)-1,o=0)),!n){for(r={32:127,64:1023}[e],o=Math.abs(t);2<=o;)r++,o/=2;for(;o<1&&0<r;)r--,o*=2;r<=0&&(o/=2),32===e&&254<r&&(n={d:i?255:127,c:128,b:0,a:0},r=Math.pow(2,a)-1,o=0)}return r}(64,e)-1023},Ki.powerOf2=function(e){return Math.pow(2,e)},t($i.prototype,{getInterval:function(){return this.interval},getLevel:function(){return this.level},computeKey:function(e){for(this.level=$i.computeLevel(e),this.interval=new Qi,this.computeInterval(this.level,e);!this.interval.contains(e);)this.level+=1,this.computeInterval(this.level,e)},computeInterval:function(e,t){var i=Ki.powerOf2(e);this.pt=Math.floor(t.getMin()/i)*i,this.interval.init(this.pt,this.pt+i)},getPoint:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return $i}}),$i.computeLevel=function(e){var t=e.getWidth();return Ki.exponent(t)+1},s(Zi,Ji),t(Zi.prototype,{getInterval:function(){return this.interval},find:function(e){var t=Ji.getSubnodeIndex(e,this.centre);return-1===t?this:null===this.subnode[t]?this:this.subnode[t].find(e)},insert:function(e){m.isTrue(null===this.interval||this.interval.contains(e.interval));var t=Ji.getSubnodeIndex(e.interval,this.centre);if(e.level===this.level-1)this.subnode[t]=e;else{var i=this.createSubnode(t);i.insert(e),this.subnode[t]=i}},isSearchMatch:function(e){return e.overlaps(this.interval)},getSubnode:function(e){return null===this.subnode[e]&&(this.subnode[e]=this.createSubnode(e)),this.subnode[e]},getNode:function(e){var t=Ji.getSubnodeIndex(e,this.centre);return-1===t?this:this.getSubnode(t).getNode(e)},createSubnode:function(e){var t=0,i=0;switch(e){case 0:t=this.interval.getMin(),i=this.centre;break;case 1:t=this.centre,i=this.interval.getMax()}return new Zi(new Qi(t,i),this.level-1)},interfaces_:function(){return[]},getClass:function(){return Zi}}),Zi.createNode=function(e){var t=new $i(e);return new Zi(t.getInterval(),t.getLevel())},Zi.createExpanded=function(e,t){var i=new Qi(t);null!==e&&i.expandToInclude(e.interval);var r=Zi.createNode(i);return null!==e&&r.insert(e),r},t(er.prototype,{interfaces_:function(){return[]},getClass:function(){return er}}),er.isZeroWidth=function(e,t){var i=t-e;if(0===i)return!0;var r=Math.max(Math.abs(e),Math.abs(t));return Ki.exponent(i/r)<=er.MIN_BINARY_EXPONENT},er.MIN_BINARY_EXPONENT=-50,s(tr,Ji),t(tr.prototype,{insert:function(e,t){var i=Ji.getSubnodeIndex(e,tr.origin);if(-1===i)return this.add(t),null;var r=this.subnode[i];if(null===r||!r.getInterval().contains(e)){var o=Zi.createExpanded(r,e);this.subnode[i]=o}this.insertContained(this.subnode[i],e,t)},isSearchMatch:function(e){return!0},insertContained:function(e,t,i){m.isTrue(e.getInterval().contains(t));(er.isZeroWidth(t.getMin(),t.getMax())?e.find(t):e.getNode(t)).add(i)},interfaces_:function(){return[]},getClass:function(){return tr}}),tr.origin=0,t(ir.prototype,{size:function(){return null!==this.root?this.root.size():0},insert:function(e,t){this.collectStats(e);var i=ir.ensureExtent(e,this.minExtent);this.root.insert(i,t)},query:function(){if(1===arguments.length){if("number"==typeof arguments[0]){var e=arguments[0];return this.query(new Qi(e,e))}if(arguments[0]instanceof Qi){var t=arguments[0],i=new w;return this.query(t,i),i}}else if(2===arguments.length){var r=arguments[0],o=arguments[1];this.root.addAllItemsFromOverlapping(r,o)}},iterator:function(){var e=new w;return this.root.addAllItems(e),e.iterator()},remove:function(e,t){var i=ir.ensureExtent(e,this.minExtent);return this.root.remove(i,t)},collectStats:function(e){var t=e.getWidth();t<this.minExtent&&0<t&&(this.minExtent=t)},depth:function(){return null!==this.root?this.root.depth():0},nodeSize:function(){return null!==this.root?this.root.nodeSize():0},interfaces_:function(){return[]},getClass:function(){return ir}}),ir.ensureExtent=function(e,t){var i=e.getMin(),r=e.getMax();return i!==r?e:(i===r&&(r=(i-=t/2)+t/2),new Qi(i,r))},t(rr.prototype,{isInside:function(e){},interfaces_:function(){return[]},getClass:function(){return rr}}),t(or.prototype,{testLineSegment:function(e,t){var i,r,o,n,a=t.p0,s=t.p1;i=a.x-e.x,r=a.y-e.y,o=s.x-e.x,n=s.y-e.y,(0<r&&n<=0||0<n&&r<=0)&&(0<Xe.signOfDet2x2(i,r,o,n)/(n-r)&&this.crossings++)},buildIndex:function(){this.tree=new ir;for(var e=q.removeRepeatedPoints(this.ring.getCoordinates()),t=Ht.getChains(e),i=0;i<t.size();i++){var r=t.get(i),o=r.getEnvelope();this.interval.min=o.getMinY(),this.interval.max=o.getMaxY(),this.tree.insert(this.interval,r)}},testMonotoneChain:function(e,t,i){i.select(e,t)},isInside:function(e){this.crossings=0;var t=new E(_.NEGATIVE_INFINITY,_.POSITIVE_INFINITY,e.y,e.y);this.interval.min=e.y,this.interval.max=e.y;for(var i=this.tree.query(this.interval),r=new nr(this,e),o=i.iterator();o.hasNext();){var n=o.next();this.testMonotoneChain(t,r,n)}return this.crossings%2==1},interfaces_:function(){return[rr]},getClass:function(){return or}}),s(nr,Xi),t(nr.prototype,{select:function(){if(1!==arguments.length)return Xi.prototype.select.apply(this,arguments);var e=arguments[0];this.mcp.testLineSegment(this.p,e)},interfaces_:function(){return[]},getClass:function(){return nr}}),or.MCSelecter=nr,t(ar.prototype,{interfaces_:function(){return[]},getClass:function(){return ar}}),ar.toDegrees=function(e){return 180*e/Math.PI},ar.normalize=function(e){for(;e>Math.PI;)e-=ar.PI_TIMES_2;for(;e<=-Math.PI;)e+=ar.PI_TIMES_2;return e},ar.angle=function(){if(1===arguments.length){var e=arguments[0];return Math.atan2(e.y,e.x)}if(2===arguments.length){var t=arguments[0],i=arguments[1],r=i.x-t.x,o=i.y-t.y;return Math.atan2(o,r)}},ar.isAcute=function(e,t,i){var r=e.x-t.x,o=e.y-t.y;return 0<r*(i.x-t.x)+o*(i.y-t.y)},ar.isObtuse=function(e,t,i){var r=e.x-t.x,o=e.y-t.y;return r*(i.x-t.x)+o*(i.y-t.y)<0},ar.interiorAngle=function(e,t,i){var r=ar.angle(t,e),o=ar.angle(t,i);return Math.abs(o-r)},ar.normalizePositive=function(e){if(e<0){for(;e<0;)e+=ar.PI_TIMES_2;ar.PI_TIMES_2<=e&&(e=0)}else{for(;ar.PI_TIMES_2<=e;)e-=ar.PI_TIMES_2;e<0&&(e=0)}return e},ar.angleBetween=function(e,t,i){var r=ar.angle(t,e),o=ar.angle(t,i);return ar.diff(r,o)},ar.diff=function(e,t){var i=null;return(i=e<t?t-e:e-t)>Math.PI&&(i=2*Math.PI-i),i},ar.toRadians=function(e){return e*Math.PI/180},ar.getTurn=function(e,t){var i=Math.sin(t-e);return 0<i?ar.COUNTERCLOCKWISE:i<0?ar.CLOCKWISE:ar.NONE},ar.angleBetweenOriented=function(e,t,i){var r=ar.angle(t,e),o=ar.angle(t,i)-r;return o<=-Math.PI?o+ar.PI_TIMES_2:o>Math.PI?o-ar.PI_TIMES_2:o},ar.PI_TIMES_2=2*Math.PI,ar.PI_OVER_2=Math.PI/2,ar.PI_OVER_4=Math.PI/4,ar.COUNTERCLOCKWISE=Qe.COUNTERCLOCKWISE,ar.CLOCKWISE=Qe.CLOCKWISE,ar.NONE=Qe.COLLINEAR,t(sr.prototype,{area:function(){return sr.area(this.p0,this.p1,this.p2)},signedArea:function(){return sr.signedArea(this.p0,this.p1,this.p2)},interpolateZ:function(e){if(null===e)throw new h("Supplied point is null.");return sr.interpolateZ(e,this.p0,this.p1,this.p2)},longestSideLength:function(){return sr.longestSideLength(this.p0,this.p1,this.p2)},isAcute:function(){return sr.isAcute(this.p0,this.p1,this.p2)},circumcentre:function(){return sr.circumcentre(this.p0,this.p1,this.p2)},area3D:function(){return sr.area3D(this.p0,this.p1,this.p2)},centroid:function(){return sr.centroid(this.p0,this.p1,this.p2)},inCentre:function(){return sr.inCentre(this.p0,this.p1,this.p2)},interfaces_:function(){return[]},getClass:function(){return sr}}),sr.area=function(e,t,i){return Math.abs(((i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y))/2)},sr.signedArea=function(e,t,i){return((i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y))/2},sr.det=function(e,t,i,r){return e*r-t*i},sr.interpolateZ=function(e,t,i,r){var o=t.x,n=t.y,a=i.x-o,s=r.x-o,l=i.y-n,u=r.y-n,c=a*u-s*l,h=e.x-o,d=e.y-n,m=(u*h-s*d)/c,p=(-l*h+a*d)/c;return t.z+m*(i.z-t.z)+p*(r.z-t.z)},sr.longestSideLength=function(e,t,i){var r=e.distance(t),o=t.distance(i),n=i.distance(e),a=r;return a<o&&(a=o),a<n&&(a=n),a},sr.isAcute=function(e,t,i){return!!ar.isAcute(e,t,i)&&!!ar.isAcute(t,i,e)&&!!ar.isAcute(i,e,t)},sr.circumcentre=function(e,t,i){var r=i.x,o=i.y,n=e.x-r,a=e.y-o,s=t.x-r,l=t.y-o,u=2*sr.det(n,a,s,l);return new C(r-sr.det(a,n*n+a*a,l,s*s+l*l)/u,o+sr.det(n,n*n+a*a,s,s*s+l*l)/u)},sr.perpendicularBisector=function(e,t){var i=t.x-e.x,r=t.y-e.y;return new V(new V(e.x+i/2,e.y+r/2,1),new V(e.x-r+i/2,e.y+i+r/2,1))},sr.angleBisector=function(e,t,i){var r=t.distance(e),o=r/(r+t.distance(i)),n=i.x-e.x,a=i.y-e.y;return new C(e.x+o*n,e.y+o*a)},sr.area3D=function(e,t,i){var r=t.x-e.x,o=t.y-e.y,n=t.z-e.z,a=i.x-e.x,s=i.y-e.y,l=i.z-e.z,u=o*l-n*s,c=n*a-r*l,h=r*s-o*a,d=u*u+c*c+h*h;return Math.sqrt(d)/2},sr.centroid=function(e,t,i){return new C((e.x+t.x+i.x)/3,(e.y+t.y+i.y)/3)},sr.inCentre=function(e,t,i){var r=t.distance(i),o=e.distance(i),n=e.distance(t),a=r+o+n;return new C((r*e.x+o*t.x+n*i.x)/a,(r*e.y+o*t.y+n*i.y)/a)},t(lr.prototype,{getRadius:function(){return this.compute(),this.radius},getDiameter:function(){switch(this.compute(),this.extremalPts.length){case 0:return this.input.getFactory().createLineString();case 1:return this.input.getFactory().createPoint(this.centre)}var e=this.extremalPts[0],t=this.extremalPts[1];return this.input.getFactory().createLineString([e,t])},getExtremalPoints:function(){return this.compute(),this.extremalPts},computeCirclePoints:function(){if(this.input.isEmpty())return this.extremalPts=new Array(0).fill(null),null;if(1===this.input.getNumPoints()){var e=this.input.getCoordinates();return this.extremalPts=[new C(e[0])],null}var t=this.input.convexHull().getCoordinates();e=t;if(t[0].equals2D(t[t.length-1])&&(e=new Array(t.length-1).fill(null),q.copyDeep(t,0,e,0,t.length-1)),e.length<=2)return this.extremalPts=q.copyDeep(e),null;for(var i=lr.lowestPoint(e),r=lr.pointWitMinAngleWithX(e,i),o=0;o<e.length;o++){var n=lr.pointWithMinAngleWithSegment(e,i,r);if(ar.isObtuse(i,n,r))return this.extremalPts=[new C(i),new C(r)],null;if(ar.isObtuse(n,i,r))i=n;else{if(!ar.isObtuse(n,r,i))return this.extremalPts=[new C(i),new C(r),new C(n)],null;r=n}}m.shouldNeverReachHere("Logic failure in Minimum Bounding Circle algorithm!")},compute:function(){return null!==this.extremalPts?null:(this.computeCirclePoints(),this.computeCentre(),void(null!==this.centre&&(this.radius=this.centre.distance(this.extremalPts[0]))))},getFarthestPoints:function(){switch(this.compute(),this.extremalPts.length){case 0:return this.input.getFactory().createLineString();case 1:return this.input.getFactory().createPoint(this.centre)}var e=this.extremalPts[0],t=this.extremalPts[this.extremalPts.length-1];return this.input.getFactory().createLineString([e,t])},getCircle:function(){if(this.compute(),null===this.centre)return this.input.getFactory().createPolygon();var e=this.input.getFactory().createPoint(this.centre);return 0===this.radius?e:e.buffer(this.radius)},getCentre:function(){return this.compute(),this.centre},computeCentre:function(){switch(this.extremalPts.length){case 0:this.centre=null;break;case 1:this.centre=this.extremalPts[0];break;case 2:this.centre=new C((this.extremalPts[0].x+this.extremalPts[1].x)/2,(this.extremalPts[0].y+this.extremalPts[1].y)/2);break;case 3:this.centre=sr.circumcentre(this.extremalPts[0],this.extremalPts[1],this.extremalPts[2])}},interfaces_:function(){return[]},getClass:function(){return lr}}),lr.pointWitMinAngleWithX=function(e,t){for(var i=_.MAX_VALUE,r=null,o=0;o<e.length;o++){var n=e[o];if(n!==t){var a=n.x-t.x,s=n.y-t.y;s<0&&(s=-s);var l=s/Math.sqrt(a*a+s*s);l<i&&(i=l,r=n)}}return r},lr.lowestPoint=function(e){for(var t=e[0],i=1;i<e.length;i++)e[i].y<t.y&&(t=e[i]);return t},lr.pointWithMinAngleWithSegment=function(e,t,i){for(var r=_.MAX_VALUE,o=null,n=0;n<e.length;n++){var a=e[n];if(a!==t&&a!==i){var s=ar.angleBetween(t,a,i);s<r&&(r=s,o=a)}}return o},t(ur.prototype,{getWidthCoordinate:function(){return this.computeMinimumDiameter(),this.minWidthPt},getSupportingSegment:function(){return this.computeMinimumDiameter(),this.inputGeom.getFactory().createLineString([this.minBaseSeg.p0,this.minBaseSeg.p1])},getDiameter:function(){if(this.computeMinimumDiameter(),null===this.minWidthPt)return this.inputGeom.getFactory().createLineString(null);var e=this.minBaseSeg.project(this.minWidthPt);return this.inputGeom.getFactory().createLineString([e,this.minWidthPt])},computeWidthConvex:function(e){this.convexHullPts=e instanceof Te?e.getExteriorRing().getCoordinates():e.getCoordinates(),0===this.convexHullPts.length?(this.minWidth=0,this.minWidthPt=null,this.minBaseSeg=null):1===this.convexHullPts.length?(this.minWidth=0,this.minWidthPt=this.convexHullPts[0],this.minBaseSeg.p0=this.convexHullPts[0],this.minBaseSeg.p1=this.convexHullPts[0]):2===this.convexHullPts.length||3===this.convexHullPts.length?(this.minWidth=0,this.minWidthPt=this.convexHullPts[0],this.minBaseSeg.p0=this.convexHullPts[0],this.minBaseSeg.p1=this.convexHullPts[1]):this.computeConvexRingMinDiameter(this.convexHullPts)},computeConvexRingMinDiameter:function(e){this.minWidth=_.MAX_VALUE;for(var t=1,i=new Ke,r=0;r<e.length-1;r++)i.p0=e[r],i.p1=e[r+1],t=this.findMaxPerpDistance(e,i,t)},computeMinimumDiameter:function(){if(null!==this.minWidthPt)return null;if(this.isConvex)this.computeWidthConvex(this.inputGeom);else{var e=new rt(this.inputGeom).getConvexHull();this.computeWidthConvex(e)}},getLength:function(){return this.computeMinimumDiameter(),this.minWidth},findMaxPerpDistance:function(e,t,i){for(var r=t.distancePerpendicular(e[i]),o=r,n=i,a=n;r<=o;)r=o,a=ur.nextIndex(e,n=a),o=t.distancePerpendicular(e[a]);return r<this.minWidth&&(this.minPtIndex=n,this.minWidth=r,this.minWidthPt=e[this.minPtIndex],this.minBaseSeg=new Ke(t)),n},getMinimumRectangle:function(){if(this.computeMinimumDiameter(),0===this.minWidth)return this.minBaseSeg.p0.equals2D(this.minBaseSeg.p1)?this.inputGeom.getFactory().createPoint(this.minBaseSeg.p0):this.minBaseSeg.toGeometry(this.inputGeom.getFactory());for(var e=this.minBaseSeg.p1.x-this.minBaseSeg.p0.x,t=this.minBaseSeg.p1.y-this.minBaseSeg.p0.y,i=_.MAX_VALUE,r=-_.MAX_VALUE,o=_.MAX_VALUE,n=-_.MAX_VALUE,a=0;a<this.convexHullPts.length;a++){var s=ur.computeC(e,t,this.convexHullPts[a]);r<s&&(r=s),s<i&&(i=s);var l=ur.computeC(-t,e,this.convexHullPts[a]);n<l&&(n=l),l<o&&(o=l)}var u=ur.computeSegmentForLine(-e,-t,n),c=ur.computeSegmentForLine(-e,-t,o),h=ur.computeSegmentForLine(-t,e,r),d=ur.computeSegmentForLine(-t,e,i),m=h.lineIntersection(u),p=d.lineIntersection(u),g=d.lineIntersection(c),f=h.lineIntersection(c),v=this.inputGeom.getFactory().createLinearRing([m,p,g,f,m]);return this.inputGeom.getFactory().createPolygon(v,null)},interfaces_:function(){return[]},getClass:function(){return ur}}),ur.nextIndex=function(e,t){return++t>=e.length&&(t=0),t},ur.computeC=function(e,t,i){return e*i.y-t*i.x},ur.getMinimumDiameter=function(e){return new ur(e).getDiameter()},ur.getMinimumRectangle=function(e){return new ur(e).getMinimumRectangle()},ur.computeSegmentForLine=function(e,t,i){var r=null,o=null;return o=Math.abs(t)>Math.abs(e)?(r=new C(0,i/t),new C(1,i/t-e/t)):(r=new C(i/e,0),new C(i/e-t/e,1)),new Ke(r,o)};var Jn=Object.freeze({Centroid:Ze,CGAlgorithms:Qe,ConvexHull:rt,InteriorPointArea:Wi,InteriorPointLine:qi,InteriorPointPoint:Yi,RobustLineIntersector:Ye,MCPointInRing:or,MinimumBoundingCircle:lr,MinimumDiameter:ur});t(cr.prototype,{getResultGeometry:function(){return new hr(this.distanceTolerance).transform(this.inputGeom)},setDistanceTolerance:function(e){if(e<=0)throw new h("Tolerance must be positive");this.distanceTolerance=e},interfaces_:function(){return[]},getClass:function(){return cr}}),cr.densifyPoints=function(e,t,i){for(var r=new Ke,o=new b,n=0;n<e.length-1;n++){r.p0=e[n],r.p1=e[n+1],o.add(r.p0,!1);var a=r.getLength(),s=Math.trunc(a/t)+1;if(1<s)for(var l=a/s,u=1;u<s;u++){var c=u*l/a,h=r.pointAlong(c);i.makePrecise(h),o.add(h,!1)}}return o.add(e[e.length-1],!1),o.toCoordinateArray()},cr.densify=function(e,t){var i=new cr(e);return i.setDistanceTolerance(t),i.getResultGeometry()},s(hr,nt),t(hr.prototype,{transformMultiPolygon:function(e,t){var i=nt.prototype.transformMultiPolygon.call(this,e,t);return this.createValidArea(i)},transformPolygon:function(e,t){var i=nt.prototype.transformPolygon.call(this,e,t);return t instanceof Le?i:this.createValidArea(i)},transformCoordinates:function(e,t){var i=e.toCoordinateArray(),r=cr.densifyPoints(i,this.distanceTolerance,t.getPrecisionModel());return t instanceof Ee&&1===r.length&&(r=new Array(0).fill(null)),this.factory.getCoordinateSequenceFactory().create(r)},createValidArea:function(e){return e.buffer(0)},interfaces_:function(){return[]},getClass:function(){return hr}}),cr.DensifyTransformer=hr;var Qn=Object.freeze({Densifier:cr});t(dr.prototype,{find:function(e){var t=this;do{if(null===t)return null;if(t.dest().equals2D(e))return t;t=t.oNext()}while(t!==this);return null},dest:function(){return this._sym._orig},oNext:function(){return this._sym._next},insert:function(e){if(this.oNext()===this)return this.insertAfter(e),null;var t=this.compareTo(e),i=this;do{var r=i.oNext();if(r.compareTo(e)!==t||r===this)return i.insertAfter(e),null;i=r}while(i!==this);m.shouldNeverReachHere()},insertAfter:function(e){m.equals(this._orig,e.orig());var t=this.oNext();this._sym.setNext(e),e.sym().setNext(t)},degree:function(){for(var e=0,t=this;e++,(t=t.oNext())!==this;);return e},equals:function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];return this._orig.equals2D(e)&&this._sym._orig.equals(t)}},deltaY:function(){return this._sym._orig.y-this._orig.y},sym:function(){return this._sym},prev:function(){return this._sym.next()._sym},compareAngularDirection:function(e){var t=this.deltaX(),i=this.deltaY(),r=e.deltaX(),o=e.deltaY();if(t===r&&i===o)return 0;var n=Ft.quadrant(t,i),a=Ft.quadrant(r,o);return a<n?1:n<a?-1:Qe.computeOrientation(e._orig,e.dest(),this.dest())},prevNode:function(){for(var e=this;2===e.degree();)if((e=e.prev())===this)return null;return e},compareTo:function(e){var t=e;return this.compareAngularDirection(t)},next:function(){return this._next},setSym:function(e){this._sym=e},orig:function(){return this._orig},toString:function(){return"HE("+this._orig.x+" "+this._orig.y+", "+this._sym._orig.x+" "+this._sym._orig.y+")"},setNext:function(e){this._next=e},init:function(e){this.setSym(e),e.setSym(this),this.setNext(e),e.setNext(this)},deltaX:function(){return this._sym._orig.x-this._orig.x},interfaces_:function(){return[]},getClass:function(){return dr}}),dr.init=function(e,t){if(null!==e._sym||null!==t._sym||null!==e._next||null!==t._next)throw new IllegalStateException("Edges are already initialized");return e.init(t),e},dr.create=function(e,t){var i=new dr(e),r=new dr(t);return i.init(r),i},s(mr,dr),t(mr.prototype,{mark:function(){this._isMarked=!0},setMark:function(e){this._isMarked=e},isMarked:function(){return this._isMarked},interfaces_:function(){return[]},getClass:function(){return mr}}),mr.setMarkBoth=function(e,t){e.setMark(t),e.sym().setMark(t)},mr.isMarked=function(e){return e.isMarked()},mr.setMark=function(e,t){e.setMark(t)},mr.markBoth=function(e){e.mark(),e.sym().mark()},mr.mark=function(e){e.mark()},t(pr.prototype,{insert:function(e,t,i){var r=this.create(e,t);null!==i?i.insert(r):this.vertexMap.put(e,r);var o=this.vertexMap.get(t);return null!==o?o.insert(r.sym()):this.vertexMap.put(t,r.sym()),r},create:function(e,t){var i=this.createEdge(e),r=this.createEdge(t);return dr.init(i,r),i},createEdge:function(e){return new dr(e)},addEdge:function(e,t){if(!pr.isValidEdge(e,t))return null;var i=this.vertexMap.get(e),r=null;return null!==i&&(r=i.find(t)),null!==r?r:this.insert(e,t,i)},getVertexEdges:function(){return this.vertexMap.values()},findEdge:function(e,t){var i=this.vertexMap.get(e);return null===i?null:i.find(t)},interfaces_:function(){return[]},getClass:function(){return pr}}),pr.isValidEdge=function(e,t){return 0!==t.compareTo(e)},s(gr,mr),t(gr.prototype,{setStart:function(){this._isStart=!0},isStart:function(){return this._isStart},interfaces_:function(){return[]},getClass:function(){return gr}}),s(fr,pr),t(fr.prototype,{createEdge:function(e){return new gr(e)},interfaces_:function(){return[]},getClass:function(){return fr}}),t(vr.prototype,{addLine:function(e){this.lines.add(this.factory.createLineString(e.toCoordinateArray()))},updateRingStartEdge:function(e){return e.isStart()||(e=e.sym()).isStart()?null===this.ringStartEdge?(this.ringStartEdge=e,null):void(e.orig().compareTo(this.ringStartEdge.orig())<0&&(this.ringStartEdge=e)):null},getResult:function(){return null===this.result&&this.computeResult(),this.result},process:function(e){var t=e.prevNode();null===t&&(t=e),this.stackEdges(t),this.buildLines()},buildRing:function(e){var t=new b,i=e;for(t.add(i.orig().copy(),!1);2===i.sym().degree();){var r=i.next();if(r===e)break;t.add(r.orig().copy(),!1),i=r}t.add(i.dest().copy(),!1),this.addLine(t)},buildLine:function(e){var t=new b,i=e;for(this.ringStartEdge=null,mr.markBoth(i),t.add(i.orig().copy(),!1);2===i.sym().degree();){this.updateRingStartEdge(i);var r=i.next();if(r===e)return this.buildRing(this.ringStartEdge),null;t.add(r.orig().copy(),!1),mr.markBoth(i=r)}t.add(i.dest().copy(),!1),this.stackEdges(i.sym()),this.addLine(t)},stackEdges:function(e){for(var t=e;mr.isMarked(t)||this.nodeEdgeStack.add(t),(t=t.oNext())!==e;);},computeResult:function(){for(var e=this.graph.getVertexEdges().iterator();e.hasNext();){var t=e.next();mr.isMarked(t)||this.process(t)}this.result=this.factory.buildGeometry(this.lines)},buildLines:function(){for(;!this.nodeEdgeStack.empty();){var e=this.nodeEdgeStack.pop();mr.isMarked(e)||this.buildLine(e)}},add:function(){if(arguments[0]instanceof G)arguments[0].apply({interfaces_:function(){return[H]},filter:function(e){e instanceof Ee&&this.add(e)}});else if(T(arguments[0],f))for(var e=arguments[0].iterator();e.hasNext();){var t=e.next();this.add(t)}else if(arguments[0]instanceof Ee){var i=arguments[0];null===this.factory&&(this.factory=i.getFactory());var r=i.getCoordinateSequence(),o=!1;for(e=1;e<r.size();e++){var n=this.graph.addEdge(r.getCoordinate(e-1),r.getCoordinate(e));null!==n&&(o||(n.setStart(),o=!0))}}},interfaces_:function(){return[]},getClass:function(){return vr}}),vr.dissolve=function(e){var t=new vr;return t.add(e),t.getResult()};var Kn=Object.freeze({LineDissolver:vr}),$n=Object.freeze({GeometryGraph:Fi});t(_r.prototype,{hasChildren:function(){for(var e=0;e<4;e++)if(null!==this.subnode[e])return!0;return!1},isPrunable:function(){return!(this.hasChildren()||this.hasItems())},addAllItems:function(e){e.addAll(this.items);for(var t=0;t<4;t++)null!==this.subnode[t]&&this.subnode[t].addAllItems(e);return e},getNodeCount:function(){for(var e=0,t=0;t<4;t++)null!==this.subnode[t]&&(e+=this.subnode[t].size());return e+1},size:function(){for(var e=0,t=0;t<4;t++)null!==this.subnode[t]&&(e+=this.subnode[t].size());return e+this.items.size()},addAllItemsFromOverlapping:function(e,t){if(!this.isSearchMatch(e))return null;t.addAll(this.items);for(var i=0;i<4;i++)null!==this.subnode[i]&&this.subnode[i].addAllItemsFromOverlapping(e,t)},visitItems:function(e,t){for(var i=this.items.iterator();i.hasNext();)t.visitItem(i.next())},hasItems:function(){return!this.items.isEmpty()},remove:function(e,t){if(!this.isSearchMatch(e))return!1;for(var i=!1,r=0;r<4;r++)if(null!==this.subnode[r]&&(i=this.subnode[r].remove(e,t))){this.subnode[r].isPrunable()&&(this.subnode[r]=null);break}return i||(i=this.items.remove(t))},visit:function(e,t){if(!this.isSearchMatch(e))return null;this.visitItems(e,t);for(var i=0;i<4;i++)null!==this.subnode[i]&&this.subnode[i].visit(e,t)},getItems:function(){return this.items},depth:function(){for(var e=0,t=0;t<4;t++)if(null!==this.subnode[t]){var i=this.subnode[t].depth();e<i&&(e=i)}return e+1},isEmpty:function(){var e=!0;this.items.isEmpty()||(e=!1);for(var t=0;t<4;t++)null!==this.subnode[t]&&(this.subnode[t].isEmpty()||(e=!1));return e},add:function(e){this.items.add(e)},interfaces_:function(){return[a]},getClass:function(){return _r}}),_r.getSubnodeIndex=function(e,t,i){var r=-1;return e.getMinX()>=t&&(e.getMinY()>=i&&(r=3),e.getMaxY()<=i&&(r=1)),e.getMaxX()<=t&&(e.getMinY()>=i&&(r=2),e.getMaxY()<=i&&(r=0)),r},t(yr.prototype,{getLevel:function(){return this.level},computeKey:function(){if(1===arguments.length){var e=arguments[0];for(this.level=yr.computeQuadLevel(e),this.env=new E,this.computeKey(this.level,e);!this.env.contains(e);)this.level+=1,this.computeKey(this.level,e)}else if(2===arguments.length){var t=arguments[0],i=arguments[1],r=Ki.powerOf2(t);this.pt.x=Math.floor(i.getMinX()/r)*r,this.pt.y=Math.floor(i.getMinY()/r)*r,this.env.init(this.pt.x,this.pt.x+r,this.pt.y,this.pt.y+r)}},getEnvelope:function(){return this.env},getCentre:function(){return new C((this.env.getMinX()+this.env.getMaxX())/2,(this.env.getMinY()+this.env.getMaxY())/2)},getPoint:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return yr}}),yr.computeQuadLevel=function(e){var t=e.getWidth(),i=e.getHeight();return Ki.exponent(i<t?t:i)+1},s(Cr,_r),t(Cr.prototype,{find:function(e){var t=_r.getSubnodeIndex(e,this.centrex,this.centrey);return-1===t?this:null===this.subnode[t]?this:this.subnode[t].find(e)},isSearchMatch:function(e){return this.env.intersects(e)},getSubnode:function(e){return null===this.subnode[e]&&(this.subnode[e]=this.createSubnode(e)),this.subnode[e]},getEnvelope:function(){return this.env},getNode:function(e){var t=_r.getSubnodeIndex(e,this.centrex,this.centrey);return-1===t?this:this.getSubnode(t).getNode(e)},createSubnode:function(e){var t=0,i=0,r=0,o=0;switch(e){case 0:t=this.env.getMinX(),i=this.centrex,r=this.env.getMinY(),o=this.centrey;break;case 1:t=this.centrex,i=this.env.getMaxX(),r=this.env.getMinY(),o=this.centrey;break;case 2:t=this.env.getMinX(),i=this.centrex,r=this.centrey,o=this.env.getMaxY();break;case 3:t=this.centrex,i=this.env.getMaxX(),r=this.centrey,o=this.env.getMaxY()}return new Cr(new E(t,i,r,o),this.level-1)},insertNode:function(e){m.isTrue(null===this.env||this.env.contains(e.env));var t=_r.getSubnodeIndex(e.env,this.centrex,this.centrey);if(e.level===this.level-1)this.subnode[t]=e;else{var i=this.createSubnode(t);i.insertNode(e),this.subnode[t]=i}},interfaces_:function(){return[]},getClass:function(){return Cr}}),Cr.createNode=function(e){var t=new yr(e);return new Cr(t.getEnvelope(),t.getLevel())},Cr.createExpanded=function(e,t){var i=new E(t);null!==e&&i.expandToInclude(e.env);var r=Cr.createNode(i);return null!==e&&r.insertNode(e),r},s(wr,_r),t(wr.prototype,{insert:function(e,t){var i=_r.getSubnodeIndex(e,wr.origin.x,wr.origin.y);if(-1===i)return this.add(t),null;var r=this.subnode[i];if(null===r||!r.getEnvelope().contains(e)){var o=Cr.createExpanded(r,e);this.subnode[i]=o}this.insertContained(this.subnode[i],e,t)},isSearchMatch:function(e){return!0},insertContained:function(e,t,i){m.isTrue(e.getEnvelope().contains(t));var r=er.isZeroWidth(t.getMinX(),t.getMaxX()),o=er.isZeroWidth(t.getMinY(),t.getMaxY());(r||o?e.find(t):e.getNode(t)).add(i)},interfaces_:function(){return[]},getClass:function(){return wr}}),wr.origin=new C(0,0),t(br.prototype,{size:function(){return null!==this.root?this.root.size():0},insert:function(e,t){this.collectStats(e);var i=br.ensureExtent(e,this.minExtent);this.root.insert(i,t)},query:function(){if(1===arguments.length){var e=arguments[0],t=new Ti;return this.query(e,t),t.getItems()}if(2===arguments.length){var i=arguments[0],r=arguments[1];this.root.visit(i,r)}},queryAll:function(){var e=new w;return this.root.addAllItems(e),e},remove:function(e,t){var i=br.ensureExtent(e,this.minExtent);return this.root.remove(i,t)},collectStats:function(e){var t=e.getWidth();t<this.minExtent&&0<t&&(this.minExtent=t);var i=e.getHeight();i<this.minExtent&&0<i&&(this.minExtent=i)},depth:function(){return null!==this.root?this.root.depth():0},isEmpty:function(){return null===this.root},interfaces_:function(){return[bt,a]},getClass:function(){return br}}),br.ensureExtent=function(e,t){var i=e.getMinX(),r=e.getMaxX(),o=e.getMinY(),n=e.getMaxY();return i!==r&&o!==n?e:(i===r&&(r=(i-=t/2)+t/2),o===n&&(n=(o-=t/2)+t/2),new E(i,r,o,n))},br.serialVersionUID=-0x678b60c967a25400;var Zn=Object.freeze({Quadtree:br}),ea=Object.freeze({STRtree:Tt}),ta=Object.freeze({quadtree:Zn,strtree:ea}),ia=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"];t(Er.prototype,{read:function(e){var t,i=(t="string"==typeof e?JSON.parse(e):e).type;if(!ra[i])throw new Error("Unknown GeoJSON type: "+t.type);return-1!==ia.indexOf(i)?ra[i].apply(this,[t.coordinates]):"GeometryCollection"===i?ra[i].apply(this,[t.geometries]):ra[i].apply(this,[t])},write:function(e){var t=e.getGeometryType();if(!oa[t])throw new Error("Geometry is not supported");return oa[t].apply(this,[e])}});var ra={Feature:function(e){var t={};for(var i in e)t[i]=e[i];if(e.geometry){var r=e.geometry.type;if(!ra[r])throw new Error("Unknown GeoJSON type: "+e.type);t.geometry=this.read(e.geometry)}return e.bbox&&(t.bbox=ra.bbox.apply(this,[e.bbox])),t},FeatureCollection:function(e){var t={};if(e.features){t.features=[];for(var i=0;i<e.features.length;++i)t.features.push(this.read(e.features[i]))}return e.bbox&&(t.bbox=this.parse.bbox.apply(this,[e.bbox])),t},coordinates:function(e){for(var t=[],i=0;i<e.length;++i){var r=e[i];t.push(new C(r[0],r[1]))}return t},bbox:function(e){return this.geometryFactory.createLinearRing([new C(e[0],e[1]),new C(e[2],e[1]),new C(e[2],e[3]),new C(e[0],e[3]),new C(e[0],e[1])])},Point:function(e){var t=new C(e[0],e[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(e){for(var t=[],i=0;i<e.length;++i)t.push(ra.Point.apply(this,[e[i]]));return this.geometryFactory.createMultiPoint(t)},LineString:function(e){var t=ra.coordinates.apply(this,[e]);return this.geometryFactory.createLineString(t)},MultiLineString:function(e){for(var t=[],i=0;i<e.length;++i)t.push(ra.LineString.apply(this,[e[i]]));return this.geometryFactory.createMultiLineString(t)},Polygon:function(e){for(var t=ra.coordinates.apply(this,[e[0]]),i=this.geometryFactory.createLinearRing(t),r=[],o=1;o<e.length;++o){var n=e[o],a=ra.coordinates.apply(this,[n]),s=this.geometryFactory.createLinearRing(a);r.push(s)}return this.geometryFactory.createPolygon(i,r)},MultiPolygon:function(e){for(var t=[],i=0;i<e.length;++i){var r=e[i];t.push(ra.Polygon.apply(this,[r]))}return this.geometryFactory.createMultiPolygon(t)},GeometryCollection:function(e){for(var t=[],i=0;i<e.length;++i){var r=e[i];t.push(this.read(r))}return this.geometryFactory.createGeometryCollection(t)}},oa={coordinate:function(e){return[e.x,e.y]},Point:function(e){return{type:"Point",coordinates:oa.coordinate.apply(this,[e.getCoordinate()])}},MultiPoint:function(e){for(var t=[],i=0;i<e.geometries.length;++i){var r=e.geometries[i],o=oa.Point.apply(this,[r]);t.push(o.coordinates)}return{type:"MultiPoint",coordinates:t}},LineString:function(e){for(var t=[],i=e.getCoordinates(),r=0;r<i.length;++r){var o=i[r];t.push(oa.coordinate.apply(this,[o]))}return{type:"LineString",coordinates:t}},MultiLineString:function(e){for(var t=[],i=0;i<e.geometries.length;++i){var r=e.geometries[i],o=oa.LineString.apply(this,[r]);t.push(o.coordinates)}return{type:"MultiLineString",coordinates:t}},Polygon:function(e){var t=[],i=oa.LineString.apply(this,[e.shell]);t.push(i.coordinates);for(var r=0;r<e.holes.length;++r){var o=e.holes[r],n=oa.LineString.apply(this,[o]);t.push(n.coordinates)}return{type:"Polygon",coordinates:t}},MultiPolygon:function(e){for(var t=[],i=0;i<e.geometries.length;++i){var r=e.geometries[i],o=oa.Polygon.apply(this,[r]);t.push(o.coordinates)}return{type:"MultiPolygon",coordinates:t}},GeometryCollection:function(e){for(var t=[],i=0;i<e.geometries.length;++i){var r=e.geometries[i],o=r.getGeometryType();t.push(oa[o].apply(this,[r]))}return{type:"GeometryCollection",geometries:t}}};t(Sr.prototype,{read:function(e){var t=this.parser.read(e);return this.precisionModel.getType()===Be.FIXED&&this.reducePrecision(t),t},reducePrecision:function(e){var t,i;if(e.coordinate)this.precisionModel.makePrecise(e.coordinate);else if(e.points)for(t=0,i=e.points.length;t<i;t++)this.precisionModel.makePrecise(e.points[t]);else if(e.geometries)for(t=0,i=e.geometries.length;t<i;t++)this.reducePrecision(e.geometries[t])}}),t(Pr.prototype,{write:function(e){return this.parser.write(e)}}),t(xr.prototype,{read:function(e){var t=this.parser.read(e);return this.precisionModel.getType()===Be.FIXED&&this.reducePrecision(t),t},reducePrecision:function(e){if(e.coordinate)this.precisionModel.makePrecise(e.coordinate);else if(e.points)for(var t=0,i=e.points.coordinates.length;t<i;t++)this.precisionModel.makePrecise(e.points.coordinates[t]);else if(e.geometries)for(var r=0,o=e.geometries.length;r<o;r++)this.reducePrecision(e.geometries[r])}}),t(Ir.prototype,{read:function(e){var t=this.ol;return e instanceof t.geom.Point?this.convertFromPoint(e):e instanceof t.geom.LineString?this.convertFromLineString(e):e instanceof t.geom.LinearRing?this.convertFromLinearRing(e):e instanceof t.geom.Polygon?this.convertFromPolygon(e):e instanceof t.geom.MultiPoint?this.convertFromMultiPoint(e):e instanceof t.geom.MultiLineString?this.convertFromMultiLineString(e):e instanceof t.geom.MultiPolygon?this.convertFromMultiPolygon(e):e instanceof t.geom.GeometryCollection?this.convertFromCollection(e):void 0},convertFromPoint:function(e){var t=e.getCoordinates();return this.geometryFactory.createPoint(new C(t[0],t[1]))},convertFromLineString:function(e){return this.geometryFactory.createLineString(e.getCoordinates().map(function(e){return new C(e[0],e[1])}))},convertFromLinearRing:function(e){return this.geometryFactory.createLinearRing(e.getCoordinates().map(function(e){return new C(e[0],e[1])}))},convertFromPolygon:function(e){for(var t=e.getLinearRings(),i=null,r=[],o=0;o<t.length;o++){var n=this.convertFromLinearRing(t[o]);0===o?i=n:r.push(n)}return this.geometryFactory.createPolygon(i,r)},convertFromMultiPoint:function(e){var t=e.getPoints().map(function(e){return this.convertFromPoint(e)},this);return this.geometryFactory.createMultiPoint(t)},convertFromMultiLineString:function(e){var t=e.getLineStrings().map(function(e){return this.convertFromLineString(e)},this);return this.geometryFactory.createMultiLineString(t)},convertFromMultiPolygon:function(e){var t=e.getPolygons().map(function(e){return this.convertFromPolygon(e)},this);return this.geometryFactory.createMultiPolygon(t)},convertFromCollection:function(e){var t=e.getGeometries().map(function(e){return this.read(e)},this);return this.geometryFactory.createGeometryCollection(t)},write:function(e){return"Point"===e.getGeometryType()?this.convertToPoint(e.getCoordinate()):"LineString"===e.getGeometryType()?this.convertToLineString(e):"LinearRing"===e.getGeometryType()?this.convertToLinearRing(e):"Polygon"===e.getGeometryType()?this.convertToPolygon(e):"MultiPoint"===e.getGeometryType()?this.convertToMultiPoint(e):"MultiLineString"===e.getGeometryType()?this.convertToMultiLineString(e):"MultiPolygon"===e.getGeometryType()?this.convertToMultiPolygon(e):"GeometryCollection"===e.getGeometryType()?this.convertToCollection(e):void 0},convertToPoint:function(e){return new this.ol.geom.Point([e.x,e.y])},convertToLineString:function(e){var t=e.points.coordinates.map(Tr);return new this.ol.geom.LineString(t)},convertToLinearRing:function(e){var t=e.points.coordinates.map(Tr);return new this.ol.geom.LinearRing(t)},convertToPolygon:function(e){for(var t=[e.shell.points.coordinates.map(Tr)],i=0;i<e.holes.length;i++)t.push(e.holes[i].points.coordinates.map(Tr));return new this.ol.geom.Polygon(t)},convertToMultiPoint:function(e){return new this.ol.geom.MultiPoint(e.getCoordinates().map(Tr))},convertToMultiLineString:function(e){for(var t=[],i=0;i<e.geometries.length;i++)t.push(this.convertToLineString(e.geometries[i]).getCoordinates());return new this.ol.geom.MultiLineString(t)},convertToMultiPolygon:function(e){for(var t=[],i=0;i<e.geometries.length;i++)t.push(this.convertToPolygon(e.geometries[i]).getCoordinates());return new this.ol.geom.MultiPolygon(t)},convertToCollection:function(e){for(var t=[],i=0;i<e.geometries.length;i++){var r=e.geometries[i];t.push(this.write(r))}return new this.ol.geom.GeometryCollection(t)}});var na=Object.freeze({GeoJSONReader:Sr,GeoJSONWriter:Pr,OL3Parser:Ir,WKTReader:xr,WKTWriter:Ue});t(Dr.prototype,{rescale:function(){if(T(arguments[0],f))for(var e=arguments[0].iterator();e.hasNext();){var t=e.next();this.rescale(t.getCoordinates())}else if(arguments[0]instanceof Array){var i=arguments[0];2===i.length&&(new C(i[0]),new C(i[1]));for(e=0;e<i.length;e++)i[e].x=i[e].x/this.scaleFactor+this.offsetX,i[e].y=i[e].y/this.scaleFactor+this.offsetY;2===i.length&&i[0].equals2D(i[1])&&N.out.println(i)}},scale:function(){if(T(arguments[0],f)){for(var e=arguments[0],t=new w,i=e.iterator();i.hasNext();){var r=i.next();t.add(new Ot(this.scale(r.getCoordinates()),r.getData()))}return t}if(arguments[0]instanceof Array){var o=arguments[0],n=new Array(o.length).fill(null);for(i=0;i<o.length;i++)n[i]=new C(Math.round((o[i].x-this.offsetX)*this.scaleFactor),Math.round((o[i].y-this.offsetY)*this.scaleFactor),o[i].z);return q.removeRepeatedPoints(n)}},isIntegerPrecision:function(){return 1===this.scaleFactor},getNodedSubstrings:function(){var e=this.noder.getNodedSubstrings();return this.isScaled&&this.rescale(e),e},computeNodes:function(e){var t=e;this.isScaled&&(t=this.scale(e)),this.noder.computeNodes(t)},interfaces_:function(){return[Gt]},getClass:function(){return Dr}});var aa=Object.freeze({MCIndexNoder:Bt,ScaledNoder:Dr,SegmentString:ft});t(Lr.prototype,{isSimpleMultiPoint:function(e){if(e.isEmpty())return!0;for(var t=new se,i=0;i<e.getNumGeometries();i++){var r=e.getGeometryN(i).getCoordinate();if(t.contains(r))return this.nonSimpleLocation=r,!1;t.add(r)}return!0},isSimplePolygonal:function(e){for(var t=xi.getLines(e).iterator();t.hasNext();){var i=t.next();if(!this.isSimpleLinearGeometry(i))return!1}return!0},hasClosedEndpointIntersection:function(e){for(var t=new oe,i=e.getEdgeIterator();i.hasNext();){var r=i.next(),o=(r.getMaximumSegmentIndex(),r.isClosed()),n=r.getCoordinate(0);this.addEndpoint(t,n,o);var a=r.getCoordinate(r.getNumPoints()-1);this.addEndpoint(t,a,o)}for(i=t.values().iterator();i.hasNext();){var s=i.next();if(s.isClosed&&2!==s.degree)return this.nonSimpleLocation=s.getCoordinate(),!0}return!1},getNonSimpleLocation:function(){return this.nonSimpleLocation},isSimpleLinearGeometry:function(e){if(e.isEmpty())return!0;var t=new Fi(0,e),i=new Ye,r=t.computeSelfNodes(i,!0);return!(r.hasIntersection()&&(r.hasProperIntersection()?(this.nonSimpleLocation=r.getProperIntersectionPoint(),1):this.hasNonEndpointIntersection(t)||this.isClosedEndpointsInInterior&&this.hasClosedEndpointIntersection(t)))},hasNonEndpointIntersection:function(e){for(var t=e.getEdgeIterator();t.hasNext();)for(var i=t.next(),r=i.getMaximumSegmentIndex(),o=i.getEdgeIntersectionList().iterator();o.hasNext();){var n=o.next();if(!n.isEndPoint(r))return this.nonSimpleLocation=n.getCoordinate(),!0}return!1},addEndpoint:function(e,t,i){var r=e.get(t);null===r&&(r=new Mr(t),e.put(t,r)),r.addEndpoint(i)},computeSimple:function(e){return this.nonSimpleLocation=null,!!e.isEmpty()||(e instanceof Ee?this.isSimpleLinearGeometry(e):e instanceof me?this.isSimpleLinearGeometry(e):e instanceof Ie?this.isSimpleMultiPoint(e):T(e,xe)?this.isSimplePolygonal(e):!(e instanceof de)||this.isSimpleGeometryCollection(e))},isSimple:function(){return this.nonSimpleLocation=null,this.computeSimple(this.inputGeom)},isSimpleGeometryCollection:function(e){for(var t=0;t<e.getNumGeometries();t++){var i=e.getGeometryN(t);if(!this.computeSimple(i))return!1}return!0},interfaces_:function(){return[]},getClass:function(){return Lr}}),t(Mr.prototype,{addEndpoint:function(e){this.degree++,this.isClosed|=e},getCoordinate:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return Mr}}),Lr.EndpointInfo=Mr,t(Ar.prototype,{getEndCapStyle:function(){return this.endCapStyle},isSingleSided:function(){return this._isSingleSided},setQuadrantSegments:function(e){this.quadrantSegments=e,0===this.quadrantSegments&&(this.joinStyle=Ar.JOIN_BEVEL),this.quadrantSegments<0&&(this.joinStyle=Ar.JOIN_MITRE,this.mitreLimit=Math.abs(this.quadrantSegments)),e<=0&&(this.quadrantSegments=1),this.joinStyle!==Ar.JOIN_ROUND&&(this.quadrantSegments=Ar.DEFAULT_QUADRANT_SEGMENTS)},getJoinStyle:function(){return this.joinStyle},setJoinStyle:function(e){this.joinStyle=e},setSimplifyFactor:function(e){this.simplifyFactor=e<0?0:e},getSimplifyFactor:function(){return this.simplifyFactor},getQuadrantSegments:function(){return this.quadrantSegments},setEndCapStyle:function(e){this.endCapStyle=e},getMitreLimit:function(){return this.mitreLimit},setMitreLimit:function(e){this.mitreLimit=e},setSingleSided:function(e){this._isSingleSided=e},interfaces_:function(){return[]},getClass:function(){return Ar}}),Ar.bufferDistanceError=function(e){var t=Math.PI/2/e;return 1-Math.cos(t/2)},Ar.CAP_ROUND=1,Ar.CAP_FLAT=2,Ar.CAP_SQUARE=3,Ar.JOIN_ROUND=1,Ar.JOIN_MITRE=2,Ar.JOIN_BEVEL=3,Ar.DEFAULT_QUADRANT_SEGMENTS=8,Ar.DEFAULT_MITRE_LIMIT=5,Ar.DEFAULT_SIMPLIFY_FACTOR=.01,t(Rr.prototype,{getCoordinate:function(){return this.minCoord},getRightmostSide:function(e,t){var i=this.getRightmostSideOfSegment(e,t);return i<0&&(i=this.getRightmostSideOfSegment(e,t-1)),i<0&&(this.minCoord=null,this.checkForRightmostCoordinate(e)),i},findRightmostEdgeAtVertex:function(){var e=this.minDe.getEdge().getCoordinates();m.isTrue(0<this.minIndex&&this.minIndex<e.length,"rightmost point expected to be interior vertex of edge");var t=e[this.minIndex-1],i=e[this.minIndex+1],r=Qe.computeOrientation(this.minCoord,i,t),o=!1;t.y<this.minCoord.y&&i.y<this.minCoord.y&&r===Qe.COUNTERCLOCKWISE?o=!0:t.y>this.minCoord.y&&i.y>this.minCoord.y&&r===Qe.CLOCKWISE&&(o=!0),o&&(this.minIndex=this.minIndex-1)},getRightmostSideOfSegment:function(e,t){var i=e.getEdge().getCoordinates();if(t<0||t+1>=i.length)return-1;if(i[t].y===i[t+1].y)return-1;var r=Jt.LEFT;return i[t].y<i[t+1].y&&(r=Jt.RIGHT),r},getEdge:function(){return this.orientedDe},checkForRightmostCoordinate:function(e){for(var t=e.getEdge().getCoordinates(),i=0;i<t.length-1;i++)(null===this.minCoord||t[i].x>this.minCoord.x)&&(this.minDe=e,this.minIndex=i,this.minCoord=t[i])},findRightmostEdgeAtNode:function(){var e=this.minDe.getNode().getEdges();this.minDe=e.getRightmostEdge(),this.minDe.isForward()||(this.minDe=this.minDe.getSym(),this.minIndex=this.minDe.getEdge().getCoordinates().length-1)},findEdge:function(e){for(var t=e.iterator();t.hasNext();){var i=t.next();i.isForward()&&this.checkForRightmostCoordinate(i)}m.isTrue(0!==this.minIndex||this.minCoord.equals(this.minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this.minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this.orientedDe=this.minDe,this.getRightmostSide(this.minDe,this.minIndex)===Jt.LEFT&&(this.orientedDe=this.minDe.getSym())},interfaces_:function(){return[]},getClass:function(){return Rr}}),Or.prototype.addLast=function(e){this.array_.push(e)},Or.prototype.removeFirst=function(){return this.array_.shift()},Or.prototype.isEmpty=function(){return 0===this.array_.length},t(Nr.prototype,{clearVisitedEdges:function(){for(var e=this.dirEdgeList.iterator();e.hasNext();){e.next().setVisited(!1)}},getRightmostCoordinate:function(){return this.rightMostCoord},computeNodeDepth:function(e){for(var t=null,i=e.getEdges().iterator();i.hasNext();){if((r=i.next()).isVisited()||r.getSym().isVisited()){t=r;break}}if(null===t)throw new zt("unable to find edge to compute depths at "+e.getCoordinate());e.getEdges().computeDepths(t);for(i=e.getEdges().iterator();i.hasNext();){var r;(r=i.next()).setVisited(!0),this.copySymDepths(r)}},computeDepth:function(e){this.clearVisitedEdges();var t=this.finder.getEdge();t.getNode(),t.getLabel(),t.setEdgeDepths(Jt.RIGHT,e),this.copySymDepths(t),this.computeDepths(t)},create:function(e){this.addReachable(e),this.finder.findEdge(this.dirEdgeList),this.rightMostCoord=this.finder.getCoordinate()},findResultEdges:function(){for(var e=this.dirEdgeList.iterator();e.hasNext();){var t=e.next();1<=t.getDepth(Jt.RIGHT)&&t.getDepth(Jt.LEFT)<=0&&!t.isInteriorAreaEdge()&&t.setInResult(!0)}},computeDepths:function(e){var t=new $,i=new Or,r=e.getNode();for(i.addLast(r),t.add(r),e.setVisited(!0);!i.isEmpty();){var o=i.removeFirst();t.add(o),this.computeNodeDepth(o);for(var n=o.getEdges().iterator();n.hasNext();){var a=n.next().getSym();if(!a.isVisited()){var s=a.getNode();t.contains(s)||(i.addLast(s),t.add(s))}}}},compareTo:function(e){var t=e;return this.rightMostCoord.x<t.rightMostCoord.x?-1:this.rightMostCoord.x>t.rightMostCoord.x?1:0},getEnvelope:function(){if(null===this.env){for(var e=new E,t=this.dirEdgeList.iterator();t.hasNext();)for(var i=t.next().getEdge().getCoordinates(),r=0;r<i.length-1;r++)e.expandToInclude(i[r]);this.env=e}return this.env},addReachable:function(e){var t=new tt;for(t.add(e);!t.empty();){var i=t.pop();this.add(i,t)}},copySymDepths:function(e){var t=e.getSym();t.setDepth(Jt.LEFT,e.getDepth(Jt.RIGHT)),t.setDepth(Jt.RIGHT,e.getDepth(Jt.LEFT))},add:function(e,t){e.setVisited(!0),this.nodes.add(e);for(var i=e.getEdges().iterator();i.hasNext();){var r=i.next();this.dirEdgeList.add(r);var o=r.getSym().getNode();o.isVisited()||t.push(o)}},getNodes:function(){return this.nodes},getDirectedEdges:function(){return this.dirEdgeList},interfaces_:function(){return[i]},getClass:function(){return Nr}}),t(Vr.prototype,{isDeletable:function(e,t,i,r){var o=this.inputLine[e],n=this.inputLine[t],a=this.inputLine[i];return!!this.isConcave(o,n,a)&&!!this.isShallow(o,n,a,r)&&this.isShallowSampled(o,n,e,i,r)},deleteShallowConcavities:function(){for(var e=1,t=(this.inputLine.length,this.findNextNonDeletedIndex(e)),i=this.findNextNonDeletedIndex(t),r=!1;i<this.inputLine.length;){var o=!1;this.isDeletable(e,t,i,this.distanceTol)&&(this.isDeleted[t]=Vr.DELETE,r=o=!0),e=o?i:t,t=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(t)}return r},isShallowConcavity:function(e,t,i,r){return Qe.computeOrientation(e,t,i)===this.angleOrientation&&Qe.distancePointLine(t,e,i)<r},isShallowSampled:function(e,t,i,r,o){var n=Math.trunc((r-i)/Vr.NUM_PTS_TO_CHECK);n<=0&&(n=1);for(var a=i;a<r;a+=n)if(!this.isShallow(e,t,this.inputLine[a],o))return!1;return!0},isConcave:function(e,t,i){var r=Qe.computeOrientation(e,t,i)===this.angleOrientation;return r},simplify:function(e){this.distanceTol=Math.abs(e),e<0&&(this.angleOrientation=Qe.CLOCKWISE),this.isDeleted=new Array(this.inputLine.length).fill(null);for(;this.deleteShallowConcavities(););return this.collapseLine()},findNextNonDeletedIndex:function(e){for(var t=e+1;t<this.inputLine.length&&this.isDeleted[t]===Vr.DELETE;)t++;return t},isShallow:function(e,t,i,r){return Qe.distancePointLine(t,e,i)<r},collapseLine:function(){for(var e=new b,t=0;t<this.inputLine.length;t++)this.isDeleted[t]!==Vr.DELETE&&e.add(this.inputLine[t]);return e.toCoordinateArray()},interfaces_:function(){return[]},getClass:function(){return Vr}}),Vr.simplify=function(e,t){return new Vr(e).simplify(t)},Vr.INIT=0,Vr.DELETE=1,Vr.KEEP=1,Vr.NUM_PTS_TO_CHECK=10,t(Fr.prototype,{getCoordinates:function(){return this.ptList.toArray(Fr.COORDINATE_ARRAY_TYPE)},setPrecisionModel:function(e){this.precisionModel=e},addPt:function(e){var t=new C(e);return this.precisionModel.makePrecise(t),this.isRedundant(t)?null:void this.ptList.add(t)},reverse:function(){},addPts:function(e,t){if(t)for(var i=0;i<e.length;i++)this.addPt(e[i]);else for(i=e.length-1;0<=i;i--)this.addPt(e[i])},isRedundant:function(e){if(this.ptList.size()<1)return!1;var t=this.ptList.get(this.ptList.size()-1);return e.distance(t)<this.minimimVertexDistance},toString:function(){return(new ze).createLineString(this.getCoordinates()).toString()},closeRing:function(){if(this.ptList.size()<1)return null;var e=new C(this.ptList.get(0)),t=this.ptList.get(this.ptList.size()-1);return 2<=this.ptList.size()&&this.ptList.get(this.ptList.size()-2),e.equals(t)?null:void this.ptList.add(e)},setMinimumVertexDistance:function(e){this.minimimVertexDistance=e},interfaces_:function(){return[]},getClass:function(){return Fr}}),Fr.COORDINATE_ARRAY_TYPE=new Array(0).fill(null),t(Hr.prototype,{addNextSegment:function(e,t){if(this.s0=this.s1,this.s1=this.s2,this.s2=e,this.seg0.setCoordinates(this.s0,this.s1),this.computeOffsetSegment(this.seg0,this.side,this.distance,this.offset0),this.seg1.setCoordinates(this.s1,this.s2),this.computeOffsetSegment(this.seg1,this.side,this.distance,this.offset1),this.s1.equals(this.s2))return null;var i=Qe.computeOrientation(this.s0,this.s1,this.s2),r=i===Qe.CLOCKWISE&&this.side===Jt.LEFT||i===Qe.COUNTERCLOCKWISE&&this.side===Jt.RIGHT;0===i?this.addCollinear(t):r?this.addOutsideTurn(i,t):this.addInsideTurn(i,t)},addLineEndCap:function(e,t){var i=new Ke(e,t),r=new Ke;this.computeOffsetSegment(i,Jt.LEFT,this.distance,r);var o=new Ke;this.computeOffsetSegment(i,Jt.RIGHT,this.distance,o);var n=t.x-e.x,a=t.y-e.y,s=Math.atan2(a,n);switch(this.bufParams.getEndCapStyle()){case Ar.CAP_ROUND:this.segList.addPt(r.p1),this.addFilletArc(t,s+Math.PI/2,s-Math.PI/2,Qe.CLOCKWISE,this.distance),this.segList.addPt(o.p1);break;case Ar.CAP_FLAT:this.segList.addPt(r.p1),this.segList.addPt(o.p1);break;case Ar.CAP_SQUARE:var l=new C;l.x=Math.abs(this.distance)*Math.cos(s),l.y=Math.abs(this.distance)*Math.sin(s);var u=new C(r.p1.x+l.x,r.p1.y+l.y),c=new C(o.p1.x+l.x,o.p1.y+l.y);this.segList.addPt(u),this.segList.addPt(c)}},getCoordinates:function(){return this.segList.getCoordinates()},addMitreJoin:function(e,t,i,r){var o=!0,n=null;try{n=V.intersection(t.p0,t.p1,i.p0,i.p1),(r<=0?1:n.distance(e)/Math.abs(r))>this.bufParams.getMitreLimit()&&(o=!1)}catch(e){if(!(e instanceof P))throw e;n=new C(0,0),o=!1}o?this.segList.addPt(n):this.addLimitedMitreJoin(t,i,r,this.bufParams.getMitreLimit())},addFilletCorner:function(e,t,i,r,o){var n=t.x-e.x,a=t.y-e.y,s=Math.atan2(a,n),l=i.x-e.x,u=i.y-e.y,c=Math.atan2(u,l);r===Qe.CLOCKWISE?s<=c&&(s+=2*Math.PI):c<=s&&(s-=2*Math.PI),this.segList.addPt(t),this.addFilletArc(e,s,c,r,o),this.segList.addPt(i)},addOutsideTurn:function(e,t){return this.offset0.p1.distance(this.offset1.p0)<this.distance*Hr.OFFSET_SEGMENT_SEPARATION_FACTOR?(this.segList.addPt(this.offset0.p1),null):void(this.bufParams.getJoinStyle()===Ar.JOIN_MITRE?this.addMitreJoin(this.s1,this.offset0,this.offset1,this.distance):this.bufParams.getJoinStyle()===Ar.JOIN_BEVEL?this.addBevelJoin(this.offset0,this.offset1):(t&&this.segList.addPt(this.offset0.p1),this.addFilletCorner(this.s1,this.offset0.p1,this.offset1.p0,e,this.distance),this.segList.addPt(this.offset1.p0)))},createSquare:function(e){this.segList.addPt(new C(e.x+this.distance,e.y+this.distance)),this.segList.addPt(new C(e.x+this.distance,e.y-this.distance)),this.segList.addPt(new C(e.x-this.distance,e.y-this.distance)),this.segList.addPt(new C(e.x-this.distance,e.y+this.distance)),this.segList.closeRing()},addSegments:function(e,t){this.segList.addPts(e,t)},addFirstSegment:function(){this.segList.addPt(this.offset1.p0)},addLastSegment:function(){this.segList.addPt(this.offset1.p1)},initSideSegments:function(e,t,i){this.s1=e,this.s2=t,this.side=i,this.seg1.setCoordinates(e,t),this.computeOffsetSegment(this.seg1,i,this.distance,this.offset1)},addLimitedMitreJoin:function(e,t,i,r){var o=this.seg0.p1,n=ar.angle(o,this.seg0.p0),a=(ar.angle(o,this.seg1.p1),ar.angleBetweenOriented(this.seg0.p0,o,this.seg1.p1))/2,s=ar.normalize(n+a),l=ar.normalize(s+Math.PI),u=r*i,c=i-u*Math.abs(Math.sin(a)),h=new Ke(o,new C(o.x+u*Math.cos(l),o.y+u*Math.sin(l))),d=h.pointAlongOffset(1,c),m=h.pointAlongOffset(1,-c);this.side===Jt.LEFT?(this.segList.addPt(d),this.segList.addPt(m)):(this.segList.addPt(m),this.segList.addPt(d))},computeOffsetSegment:function(e,t,i,r){var o=t===Jt.LEFT?1:-1,n=e.p1.x-e.p0.x,a=e.p1.y-e.p0.y,s=Math.sqrt(n*n+a*a),l=o*i*n/s,u=o*i*a/s;r.p0.x=e.p0.x-u,r.p0.y=e.p0.y+l,r.p1.x=e.p1.x-u,r.p1.y=e.p1.y+l},addFilletArc:function(e,t,i,r,o){var n=r===Qe.CLOCKWISE?-1:1,a=Math.abs(t-i),s=Math.trunc(a/this.filletAngleQuantum+.5);if(s<1)return null;var l;l=a/s;for(var u=0,c=new C;u<a;){var h=t+n*u;c.x=e.x+o*Math.cos(h),c.y=e.y+o*Math.sin(h),this.segList.addPt(c),u+=l}},addInsideTurn:function(e,t){if(this.li.computeIntersection(this.offset0.p0,this.offset0.p1,this.offset1.p0,this.offset1.p1),this.li.hasIntersection())this.segList.addPt(this.li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this.offset0.p1.distance(this.offset1.p0)<this.distance*Hr.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this.segList.addPt(this.offset0.p1);else{if(this.segList.addPt(this.offset0.p1),0<this.closingSegLengthFactor){var i=new C((this.closingSegLengthFactor*this.offset0.p1.x+this.s1.x)/(this.closingSegLengthFactor+1),(this.closingSegLengthFactor*this.offset0.p1.y+this.s1.y)/(this.closingSegLengthFactor+1));this.segList.addPt(i);var r=new C((this.closingSegLengthFactor*this.offset1.p0.x+this.s1.x)/(this.closingSegLengthFactor+1),(this.closingSegLengthFactor*this.offset1.p0.y+this.s1.y)/(this.closingSegLengthFactor+1));this.segList.addPt(r)}else this.segList.addPt(this.s1);this.segList.addPt(this.offset1.p0)}},createCircle:function(e){var t=new C(e.x+this.distance,e.y);this.segList.addPt(t),this.addFilletArc(e,0,2*Math.PI,-1,this.distance),this.segList.closeRing()},addBevelJoin:function(e,t){this.segList.addPt(e.p1),this.segList.addPt(t.p0)},init:function(e){this.distance=e,this.maxCurveSegmentError=e*(1-Math.cos(this.filletAngleQuantum/2)),this.segList=new Fr,this.segList.setPrecisionModel(this.precisionModel),this.segList.setMinimumVertexDistance(e*Hr.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},addCollinear:function(e){this.li.computeIntersection(this.s0,this.s1,this.s1,this.s2),2<=this.li.getIntersectionNum()&&(this.bufParams.getJoinStyle()===Ar.JOIN_BEVEL||this.bufParams.getJoinStyle()===Ar.JOIN_MITRE?(e&&this.segList.addPt(this.offset0.p1),this.segList.addPt(this.offset1.p0)):this.addFilletCorner(this.s1,this.offset0.p1,this.offset1.p0,Qe.CLOCKWISE,this.distance))},closeRing:function(){this.segList.closeRing()},hasNarrowConcaveAngle:function(){return this._hasNarrowConcaveAngle},interfaces_:function(){return[]},getClass:function(){return Hr}}),Hr.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,Hr.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,Hr.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,Hr.MAX_CLOSING_SEG_LEN_FACTOR=80,t(Gr.prototype,{getOffsetCurve:function(e,t){if(0===(this.distance=t))return null;var i=t<0,r=Math.abs(t),o=this.getSegGen(r);e.length<=1?this.computePointCurve(e[0],o):this.computeOffsetCurve(e,i,o);var n=o.getCoordinates();return i&&q.reverse(n),n},computeSingleSidedBufferCurve:function(e,t,i){var r=this.simplifyTolerance(this.distance);if(t){i.addSegments(e,!0);var o=Vr.simplify(e,-r),n=o.length-1;i.initSideSegments(o[n],o[n-1],Jt.LEFT),i.addFirstSegment();for(var a=n-2;0<=a;a--)i.addNextSegment(o[a],!0)}else{i.addSegments(e,!1);var s=Vr.simplify(e,r),l=s.length-1;i.initSideSegments(s[0],s[1],Jt.LEFT),i.addFirstSegment();for(a=2;a<=l;a++)i.addNextSegment(s[a],!0)}i.addLastSegment(),i.closeRing()},computeRingBufferCurve:function(e,t,i){var r=this.simplifyTolerance(this.distance);t===Jt.RIGHT&&(r=-r);var o=Vr.simplify(e,r),n=o.length-1;i.initSideSegments(o[n-1],o[0],t);for(var a=1;a<=n;a++){var s=1!==a;i.addNextSegment(o[a],s)}i.closeRing()},computeLineBufferCurve:function(e,t){var i=this.simplifyTolerance(this.distance),r=Vr.simplify(e,i),o=r.length-1;t.initSideSegments(r[0],r[1],Jt.LEFT);for(var n=2;n<=o;n++)t.addNextSegment(r[n],!0);t.addLastSegment(),t.addLineEndCap(r[o-1],r[o]);var a=Vr.simplify(e,-i),s=a.length-1;t.initSideSegments(a[s],a[s-1],Jt.LEFT);for(n=s-2;0<=n;n--)t.addNextSegment(a[n],!0);t.addLastSegment(),t.addLineEndCap(a[1],a[0]),t.closeRing()},computePointCurve:function(e,t){switch(this.bufParams.getEndCapStyle()){case Ar.CAP_ROUND:t.createCircle(e);break;case Ar.CAP_SQUARE:t.createSquare(e)}},getLineCurve:function(e,t){if((this.distance=t)<0&&!this.bufParams.isSingleSided())return null;if(0===t)return null;var i=Math.abs(t),r=this.getSegGen(i);if(e.length<=1)this.computePointCurve(e[0],r);else if(this.bufParams.isSingleSided()){var o=t<0;this.computeSingleSidedBufferCurve(e,o,r)}else this.computeLineBufferCurve(e,r);return r.getCoordinates()},getBufferParameters:function(){return this.bufParams},simplifyTolerance:function(e){return e*this.bufParams.getSimplifyFactor()},getRingCurve:function(e,t,i){if(this.distance=i,e.length<=2)return this.getLineCurve(e,i);if(0===i)return Gr.copyCoordinates(e);var r=this.getSegGen(i);return this.computeRingBufferCurve(e,t,r),r.getCoordinates()},computeOffsetCurve:function(e,t,i){var r=this.simplifyTolerance(this.distance);if(t){var o=Vr.simplify(e,-r),n=o.length-1;i.initSideSegments(o[n],o[n-1],Jt.LEFT),i.addFirstSegment();for(var a=n-2;0<=a;a--)i.addNextSegment(o[a],!0)}else{var s=Vr.simplify(e,r),l=s.length-1;i.initSideSegments(s[0],s[1],Jt.LEFT),i.addFirstSegment();for(a=2;a<=l;a++)i.addNextSegment(s[a],!0)}i.addLastSegment()},getSegGen:function(e){return new Hr(this.precisionModel,this.bufParams,e)},interfaces_:function(){return[]},getClass:function(){return Gr}}),Gr.copyCoordinates=function(e){for(var t=new Array(e.length).fill(null),i=0;i<t.length;i++)t[i]=new C(e[i]);return t},t(kr.prototype,{findStabbedSegments:function(){if(1===arguments.length){for(var e=arguments[0],t=new w,i=this.subgraphs.iterator();i.hasNext();){var r=i.next(),o=r.getEnvelope();e.y<o.getMinY()||e.y>o.getMaxY()||this.findStabbedSegments(e,r.getDirectedEdges(),t)}return t}if(3===arguments.length)if(T(arguments[2],v)&&arguments[0]instanceof C&&arguments[1]instanceof ni){var n=arguments[0],a=arguments[1],s=arguments[2],l=a.getEdge().getCoordinates();for(i=0;i<l.length-1;i++){if(this.seg.p0=l[i],this.seg.p1=l[i+1],this.seg.p0.y>this.seg.p1.y&&this.seg.reverse(),!(Math.max(this.seg.p0.x,this.seg.p1.x)<n.x||this.seg.isHorizontal()||n.y<this.seg.p0.y||n.y>this.seg.p1.y||Qe.computeOrientation(this.seg.p0,this.seg.p1,n)===Qe.RIGHT)){var u=a.getDepth(Jt.LEFT);this.seg.p0.equals(l[i])||(u=a.getDepth(Jt.RIGHT));var c=new Br(this.seg,u);s.add(c)}}}else if(T(arguments[2],v)&&arguments[0]instanceof C&&T(arguments[1],v)){var h=arguments[0],d=arguments[1],m=arguments[2];for(i=d.iterator();i.hasNext();){var p=i.next();p.isForward()&&this.findStabbedSegments(h,p,m)}}},getDepth:function(e){var t=this.findStabbedSegments(e);return 0===t.size()?0:Xn.min(t).leftDepth},interfaces_:function(){return[]},getClass:function(){return kr}}),t(Br.prototype,{compareTo:function(e){var t=e;if(this.upwardSeg.minX()>=t.upwardSeg.maxX())return 1;if(this.upwardSeg.maxX()<=t.upwardSeg.minX())return-1;var i=this.upwardSeg.orientationIndex(t.upwardSeg);return 0!==i?i:0!==(i=-1*t.upwardSeg.orientationIndex(this.upwardSeg))?i:this.upwardSeg.compareTo(t.upwardSeg)},compareX:function(e,t){var i=e.p0.compareTo(t.p0);return 0!==i?i:e.p1.compareTo(t.p1)},toString:function(){return this.upwardSeg.toString()},interfaces_:function(){return[i]},getClass:function(){return Br}}),kr.DepthSegment=Br,t(jr.prototype,{addPoint:function(e){if(this.distance<=0)return null;var t=e.getCoordinates(),i=this.curveBuilder.getLineCurve(t,this.distance);this.addCurve(i,x.EXTERIOR,x.INTERIOR)},addPolygon:function(e){var t=this.distance,i=Jt.LEFT;this.distance<0&&(t=-this.distance,i=Jt.RIGHT);var r=e.getExteriorRing(),o=q.removeRepeatedPoints(r.getCoordinates());if(this.distance<0&&this.isErodedCompletely(r,this.distance))return null;if(this.distance<=0&&o.length<3)return null;this.addPolygonRing(o,t,i,x.EXTERIOR,x.INTERIOR);for(var n=0;n<e.getNumInteriorRing();n++){var a=e.getInteriorRingN(n),s=q.removeRepeatedPoints(a.getCoordinates());0<this.distance&&this.isErodedCompletely(a,-this.distance)||this.addPolygonRing(s,t,Jt.opposite(i),x.INTERIOR,x.EXTERIOR)}},isTriangleErodedCompletely:function(e,t){var i=new sr(e[0],e[1],e[2]),r=i.inCentre();return Qe.distancePointLine(r,i.p0,i.p1)<Math.abs(t)},addLineString:function(e){if(this.distance<=0&&!this.curveBuilder.getBufferParameters().isSingleSided())return null;var t=q.removeRepeatedPoints(e.getCoordinates()),i=this.curveBuilder.getLineCurve(t,this.distance);this.addCurve(i,x.EXTERIOR,x.INTERIOR)},addCurve:function(e,t,i){if(null===e||e.length<2)return null;var r=new Ot(e,new Kt(0,x.BOUNDARY,t,i));this.curveList.add(r)},getCurves:function(){return this.add(this.inputGeom),this.curveList},addPolygonRing:function(e,t,i,r,o){if(0===t&&e.length<De.MINIMUM_VALID_SIZE)return null;var n=r,a=o;e.length>=De.MINIMUM_VALID_SIZE&&Qe.isCCW(e)&&(n=o,a=r,i=Jt.opposite(i));var s=this.curveBuilder.getRingCurve(e,i,t);this.addCurve(s,n,a)},add:function(e){if(e.isEmpty())return null;if(e instanceof Te)this.addPolygon(e);else if(e instanceof Ee)this.addLineString(e);else if(e instanceof Pe)this.addPoint(e);else if(e instanceof Ie)this.addCollection(e);else if(e instanceof me)this.addCollection(e);else if(e instanceof Le)this.addCollection(e);else{if(!(e instanceof de))throw new UnsupportedOperationException(e.getClass().getName());this.addCollection(e)}},isErodedCompletely:function(e,t){var i=e.getCoordinates();if(i.length<4)return t<0;if(4===i.length)return this.isTriangleErodedCompletely(i,t);var r=e.getEnvelopeInternal(),o=Math.min(r.getHeight(),r.getWidth());return t<0&&2*Math.abs(t)>o},addCollection:function(e){for(var t=0;t<e.getNumGeometries();t++){var i=e.getGeometryN(t);this.add(i)}},interfaces_:function(){return[]},getClass:function(){return jr}}),t(zr.prototype,{isTrivialIntersection:function(e,t,i,r){if(e===i&&1===this.li.getIntersectionNum()){if(zr.isAdjacentSegments(t,r))return!0;if(e.isClosed()){var o=e.size()-1;if(0===t&&r===o||0===r&&t===o)return!0}}return!1},getProperIntersectionPoint:function(){return this.properIntersectionPoint},hasProperInteriorIntersection:function(){return this.hasProperInterior},getLineIntersector:function(){return this.li},hasProperIntersection:function(){return this.hasProper},processIntersections:function(e,t,i,r){if(e===i&&t===r)return null;this.numTests++;var o=e.getCoordinates()[t],n=e.getCoordinates()[t+1],a=i.getCoordinates()[r],s=i.getCoordinates()[r+1];this.li.computeIntersection(o,n,a,s),this.li.hasIntersection()&&(this.numIntersections++,this.li.isInteriorIntersection()&&(this.numInteriorIntersections++,this.hasInterior=!0),this.isTrivialIntersection(e,t,i,r)||(this._hasIntersection=!0,e.addIntersections(this.li,t,0),i.addIntersections(this.li,r,1),this.li.isProper()&&(this.numProperIntersections++,this.hasProper=!0,this.hasProperInterior=!0)))},hasIntersection:function(){return this._hasIntersection},isDone:function(){return!1},hasInteriorIntersection:function(){return this.hasInterior},interfaces_:function(){return[Wt]},getClass:function(){return zr}}),zr.isAdjacentSegments=function(e,t){return 1===Math.abs(e-t)},t(Wr.prototype,{setWorkingPrecisionModel:function(e){this.workingPrecisionModel=e},insertUniqueEdge:function(e){var t=this.edgeList.findEqualEdge(e);if(null!==t){var i=t.getLabel(),r=e.getLabel();t.isPointwiseEqual(e)||(r=new Kt(e.getLabel())).flip(),i.merge(r);var o=Wr.depthDelta(r),n=t.getDepthDelta()+o;t.setDepthDelta(n)}else this.edgeList.add(e),e.setDepthDelta(Wr.depthDelta(e.getLabel()))},buildSubgraphs:function(e,t){for(var i=new w,r=e.iterator();r.hasNext();){var o=r.next(),n=o.getRightmostCoordinate(),a=new kr(i).getDepth(n);o.computeDepth(a),o.findResultEdges(),i.add(o),t.add(o.getDirectedEdges(),o.getNodes())}},createSubgraphs:function(e){for(var t=new w,i=e.getNodes().iterator();i.hasNext();){var r=i.next();if(!r.isVisited()){var o=new Nr;o.create(r),t.add(o)}}return Xn.sort(t,Xn.reverseOrder()),t},createEmptyResultGeometry:function(){return this.geomFact.createPolygon()},getNoder:function(e){if(null!==this.workingNoder)return this.workingNoder;var t=new Bt,i=new Ye;return i.setPrecisionModel(e),t.setSegmentIntersector(new zr(i)),t},buffer:function(e,t){var i=this.workingPrecisionModel;null===i&&(i=e.getPrecisionModel()),this.geomFact=e.getFactory();var r=new jr(e,t,new Gr(i,this.bufParams)).getCurves();if(r.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(r,i),this.graph=new si(new gi),this.graph.addEdges(this.edgeList.getEdges());var o=this.createSubgraphs(this.graph),n=new li(this.geomFact);this.buildSubgraphs(o,n);var a=n.getPolygons();return a.size()<=0?this.createEmptyResultGeometry():this.geomFact.buildGeometry(a)},computeNodedEdges:function(e,t){var i=this.getNoder(t);i.computeNodes(e);for(var r=i.getNodedSubstrings().iterator();r.hasNext();){var o=r.next(),n=o.getCoordinates();if(2!==n.length||!n[0].equals2D(n[1])){var a=o.getData(),s=new Vi(o.getCoordinates(),new Kt(a));this.insertUniqueEdge(s)}}},setNoder:function(e){this.workingNoder=e},interfaces_:function(){return[]},getClass:function(){return Wr}}),Wr.depthDelta=function(e){var t=e.getLocation(0,Jt.LEFT),i=e.getLocation(0,Jt.RIGHT);return t===x.INTERIOR&&i===x.EXTERIOR?1:t===x.EXTERIOR&&i===x.INTERIOR?-1:0},Wr.convertSegStrings=function(e){for(var t=new ze,i=new w;e.hasNext();){var r=e.next(),o=t.createLineString(r.getCoordinates());i.add(o)}return t.buildGeometry(i)},t(Ur.prototype,{checkEndPtVertexIntersections:function(){if(0===arguments.length)for(var e=this.segStrings.iterator();e.hasNext();){var t=e.next().getCoordinates();this.checkEndPtVertexIntersections(t[0],this.segStrings),this.checkEndPtVertexIntersections(t[t.length-1],this.segStrings)}else if(2===arguments.length){var i=arguments[0];for(e=arguments[1].iterator();e.hasNext();){t=e.next().getCoordinates();for(var r=1;r<t.length-1;r++)if(t[r].equals(i))throw new y("found endpt/interior pt intersection at index "+r+" :pt "+i)}}},checkInteriorIntersections:function(){if(0===arguments.length)for(var e=this.segStrings.iterator();e.hasNext();)for(var t=e.next(),i=this.segStrings.iterator();i.hasNext();){var r=i.next();this.checkInteriorIntersections(t,r)}else if(2===arguments.length)for(var o=arguments[0],n=arguments[1],a=o.getCoordinates(),s=n.getCoordinates(),l=0;l<a.length-1;l++)for(var u=0;u<s.length-1;u++)this.checkInteriorIntersections(o,l,n,u);else if(4===arguments.length){var c=arguments[0],h=arguments[1],d=arguments[2],m=arguments[3];if(c===d&&h===m)return null;var p=c.getCoordinates()[h],g=c.getCoordinates()[h+1],f=d.getCoordinates()[m],v=d.getCoordinates()[m+1];if(this.li.computeIntersection(p,g,f,v),this.li.hasIntersection()&&(this.li.isProper()||this.hasInteriorIntersection(this.li,p,g)||this.hasInteriorIntersection(this.li,f,v)))throw new y("found non-noded intersection at "+p+"-"+g+" and "+f+"-"+v)}},checkValid:function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},checkCollapses:function(){if(0===arguments.length)for(var e=this.segStrings.iterator();e.hasNext();){var t=e.next();this.checkCollapses(t)}else if(1===arguments.length){var i=arguments[0].getCoordinates();for(e=0;e<i.length-2;e++)this.checkCollapse(i[e],i[e+1],i[e+2])}},hasInteriorIntersection:function(e,t,i){for(var r=0;r<e.getIntersectionNum();r++){var o=e.getIntersection(r);if(!o.equals(t)&&!o.equals(i))return!0}return!1},checkCollapse:function(e,t,i){if(e.equals(i))throw new y("found non-noded collapse at "+Ur.fact.createLineString([e,t,i]))},interfaces_:function(){return[]},getClass:function(){return Ur}}),Ur.fact=new ze,t(qr.prototype,{intersectsScaled:function(e,t){var i=Math.min(e.x,t.x),r=Math.max(e.x,t.x),o=Math.min(e.y,t.y),n=Math.max(e.y,t.y),a=this.maxx<i||this.minx>r||this.maxy<o||this.miny>n;if(a)return!1;var s=this.intersectsToleranceSquare(e,t);return m.isTrue(!(a&&s),"Found bad envelope test"),s},initCorners:function(e){this.minx=e.x-.5,this.maxx=e.x+.5,this.miny=e.y-.5,this.maxy=e.y+.5,this.corner[0]=new C(this.maxx,this.maxy),this.corner[1]=new C(this.minx,this.maxy),this.corner[2]=new C(this.minx,this.miny),this.corner[3]=new C(this.maxx,this.miny)},intersects:function(e,t){return 1===this.scaleFactor?this.intersectsScaled(e,t):(this.copyScaled(e,this.p0Scaled),this.copyScaled(t,this.p1Scaled),this.intersectsScaled(this.p0Scaled,this.p1Scaled))},scale:function(e){return Math.round(e*this.scaleFactor)},getCoordinate:function(){return this.originalPt},copyScaled:function(e,t){t.x=this.scale(e.x),t.y=this.scale(e.y)},getSafeEnvelope:function(){if(null===this.safeEnv){var e=qr.SAFE_ENV_EXPANSION_FACTOR/this.scaleFactor;this.safeEnv=new E(this.originalPt.x-e,this.originalPt.x+e,this.originalPt.y-e,this.originalPt.y+e)}return this.safeEnv},intersectsPixelClosure:function(e,t){return this.li.computeIntersection(e,t,this.corner[0],this.corner[1]),!!(this.li.hasIntersection()||(this.li.computeIntersection(e,t,this.corner[1],this.corner[2]),this.li.hasIntersection()||(this.li.computeIntersection(e,t,this.corner[2],this.corner[3]),this.li.hasIntersection()||(this.li.computeIntersection(e,t,this.corner[3],this.corner[0]),this.li.hasIntersection()))))},intersectsToleranceSquare:function(e,t){var i=!1,r=!1;return this.li.computeIntersection(e,t,this.corner[0],this.corner[1]),!!(this.li.isProper()||(this.li.computeIntersection(e,t,this.corner[1],this.corner[2]),this.li.isProper()||(this.li.hasIntersection()&&(i=!0),this.li.computeIntersection(e,t,this.corner[2],this.corner[3]),this.li.isProper()||(this.li.hasIntersection()&&(r=!0),this.li.computeIntersection(e,t,this.corner[3],this.corner[0]),this.li.isProper()||i&&r||e.equals(this.pt)||t.equals(this.pt)))))},addSnappedNode:function(e,t){var i=e.getCoordinate(t),r=e.getCoordinate(t+1);return!!this.intersects(i,r)&&(e.addIntersection(this.getCoordinate(),t),!0)},interfaces_:function(){return[]},getClass:function(){return qr}}),qr.SAFE_ENV_EXPANSION_FACTOR=.75,t(Yr.prototype,{snap:function(){if(1===arguments.length){var e=arguments[0];return this.snap(e,null,-1)}if(3===arguments.length){var t=arguments[0],i=arguments[1],r=arguments[2],o=t.getSafeEnvelope(),n=new Xr(t,i,r);return this.index.query(o,{interfaces_:function(){return[wt]},visitItem:function(e){e.select(o,n)}}),n.isNodeAdded()}},interfaces_:function(){return[]},getClass:function(){return Yr}}),s(Xr,Xi),t(Xr.prototype,{isNodeAdded:function(){return this._isNodeAdded},select:function(){if(2!==arguments.length)return Xi.prototype.select.apply(this,arguments);var e=arguments[0],t=arguments[1],i=e.getContext();return null!==this.parentEdge&&i===this.parentEdge&&t===this.hotPixelVertexIndex?null:void(this._isNodeAdded=this.hotPixel.addSnappedNode(i,t))},interfaces_:function(){return[]},getClass:function(){return Xr}}),Yr.HotPixelSnapAction=Xr,t(Jr.prototype,{processIntersections:function(e,t,i,r){if(e===i&&t===r)return null;var o=e.getCoordinates()[t],n=e.getCoordinates()[t+1],a=i.getCoordinates()[r],s=i.getCoordinates()[r+1];if(this.li.computeIntersection(o,n,a,s),this.li.hasIntersection()&&this.li.isInteriorIntersection()){for(var l=0;l<this.li.getIntersectionNum();l++)this.interiorIntersections.add(this.li.getIntersection(l));e.addIntersections(this.li,t,0),i.addIntersections(this.li,r,1)}},isDone:function(){return!1},getInteriorIntersections:function(){return this.interiorIntersections},interfaces_:function(){return[Wt]},getClass:function(){return Jr}}),t(Qr.prototype,{checkCorrectness:function(e){var t=new Ur(Ot.getNodedSubstrings(e));try{t.checkValid()}catch(e){if(!(e instanceof S))throw e;e.printStackTrace()}},getNodedSubstrings:function(){return Ot.getNodedSubstrings(this.nodedSegStrings)},snapRound:function(e,t){var i=this.findInteriorIntersections(e,t);this.computeIntersectionSnaps(i),this.computeVertexSnaps(e)},findInteriorIntersections:function(e,t){var i=new Jr(t);return this.noder.setSegmentIntersector(i),this.noder.computeNodes(e),i.getInteriorIntersections()},computeVertexSnaps:function(){if(T(arguments[0],f))for(var e=arguments[0].iterator();e.hasNext();){var t=e.next();this.computeVertexSnaps(t)}else if(arguments[0]instanceof Ot)for(var i=arguments[0],r=i.getCoordinates(),o=0;o<r.length;o++){var n=new qr(r[o],this.scaleFactor,this.li);this.pointSnapper.snap(n,i,o)&&i.addIntersection(r[o],o)}},computeNodes:function(e){this.nodedSegStrings=e,this.noder=new Bt,this.pointSnapper=new Yr(this.noder.getIndex()),this.snapRound(e,this.li)},computeIntersectionSnaps:function(e){for(var t=e.iterator();t.hasNext();){var i=new qr(t.next(),this.scaleFactor,this.li);this.pointSnapper.snap(i)}},interfaces_:function(){return[Gt]},getClass:function(){return Qr}}),t(Kr.prototype,{bufferFixedPrecision:function(e){var t=new Dr(new Qr(new Be(1)),e.getScale()),i=new Wr(this.bufParams);i.setWorkingPrecisionModel(e),i.setNoder(t),this.resultGeometry=i.buffer(this.argGeom,this.distance)},bufferReducedPrecision:function(){if(0===arguments.length){for(var e=Kr.MAX_PRECISION_DIGITS;0<=e;e--){try{this.bufferReducedPrecision(e)}catch(e){if(!(e instanceof zt))throw e;this.saveException=e}if(null!==this.resultGeometry)return null}throw this.saveException}if(1===arguments.length){var t=arguments[0],i=new Be(Kr.precisionScaleFactor(this.argGeom,this.distance,t));this.bufferFixedPrecision(i)}},computeGeometry:function(){if(this.bufferOriginalPrecision(),null!==this.resultGeometry)return null;var e=this.argGeom.getFactory().getPrecisionModel();e.getType()===Be.FIXED?this.bufferFixedPrecision(e):this.bufferReducedPrecision()},setQuadrantSegments:function(e){this.bufParams.setQuadrantSegments(e)},bufferOriginalPrecision:function(){try{var e=new Wr(this.bufParams);this.resultGeometry=e.buffer(this.argGeom,this.distance)}catch(e){if(!(e instanceof y))throw e;this.saveException=e}},getResultGeometry:function(e){return this.distance=e,this.computeGeometry(),this.resultGeometry},setEndCapStyle:function(e){this.bufParams.setEndCapStyle(e)},interfaces_:function(){return[]},getClass:function(){return Kr}}),Kr.bufferOp=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];return new Kr(e).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof G&&"number"==typeof arguments[1]){var i=arguments[0],r=arguments[1],o=arguments[2];return(s=new Kr(i)).setQuadrantSegments(o),s.getResultGeometry(r)}if(arguments[2]instanceof Ar&&arguments[0]instanceof G&&"number"==typeof arguments[1]){var n=arguments[0],a=arguments[1];return(s=new Kr(n,arguments[2])).getResultGeometry(a)}}else if(4===arguments.length){var s,l=arguments[0],u=arguments[1],c=arguments[2],h=arguments[3];return(s=new Kr(l)).setQuadrantSegments(c),s.setEndCapStyle(h),s.getResultGeometry(u)}},Kr.precisionScaleFactor=function(e,t,i){var r=e.getEnvelopeInternal(),o=I.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(0<t?t:0),n=i-Math.trunc(Math.log(o)/Math.log(10)+1);return Math.pow(10,n)},Kr.CAP_ROUND=Ar.CAP_ROUND,Kr.CAP_BUTT=Ar.CAP_FLAT,Kr.CAP_FLAT=Ar.CAP_FLAT,Kr.CAP_SQUARE=Ar.CAP_SQUARE,Kr.MAX_PRECISION_DIGITS=12;var sa=Object.freeze({BufferOp:Kr,BufferParameters:Ar});t($r.prototype,{filter:function(e){e instanceof Te&&this.comps.add(e)},interfaces_:function(){return[ce]},getClass:function(){return $r}}),$r.getPolygons=function(){if(1===arguments.length){var e=arguments[0];return $r.getPolygons(e,new w)}if(2===arguments.length){var t=arguments[0],i=arguments[1];return t instanceof Te?i.add(t):t instanceof de&&t.apply(new $r(i)),i}},t(Zr.prototype,{isInsideArea:function(){return this.segIndex===Zr.INSIDE_AREA},getCoordinate:function(){return this.pt},getGeometryComponent:function(){return this.component},getSegmentIndex:function(){return this.segIndex},interfaces_:function(){return[]},getClass:function(){return Zr}}),Zr.INSIDE_AREA=-1,t(eo.prototype,{filter:function(e){e instanceof Pe&&this.pts.add(e)},interfaces_:function(){return[ce]},getClass:function(){return eo}}),eo.getPoints=function(){if(1===arguments.length){var e=arguments[0];return e instanceof Pe?Xn.singletonList(e):eo.getPoints(e,new w)}if(2===arguments.length){var t=arguments[0],i=arguments[1];return t instanceof Pe?i.add(t):t instanceof de&&t.apply(new eo(i)),i}},t(to.prototype,{filter:function(e){(e instanceof Pe||e instanceof Ee||e instanceof Te)&&this.locations.add(new Zr(e,0,e.getCoordinate()))},interfaces_:function(){return[ce]},getClass:function(){return to}}),to.getLocations=function(e){var t=new w;return e.apply(new to(t)),t},t(io.prototype,{computeContainmentDistance:function(){if(0===arguments.length){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this.minDistance<=this.terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(2===arguments.length){var t=arguments[0],i=arguments[1],r=1-t,o=$r.getPolygons(this.geom[t]);if(0<o.size()){var n=to.getLocations(this.geom[r]);if(this.computeContainmentDistance(n,o,i),this.minDistance<=this.terminateDistance)return this.minDistanceLocation[r]=i[0],this.minDistanceLocation[t]=i[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&T(arguments[0],v)&&T(arguments[1],v)){for(var a=arguments[0],s=arguments[1],l=arguments[2],u=0;u<a.size();u++)for(var c=a.get(u),h=0;h<s.size();h++)if(this.computeContainmentDistance(c,s.get(h),l),this.minDistance<=this.terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Zr&&arguments[1]instanceof Te){var d=arguments[0],m=arguments[1],p=arguments[2],g=d.getCoordinate();if(x.EXTERIOR!==this.ptLocator.locate(g,m))return p[this.minDistance=0]=d,p[1]=new Zr(m,g),null}},computeMinDistanceLinesPoints:function(e,t,i){for(var r=0;r<e.size();r++)for(var o=e.get(r),n=0;n<t.size();n++){var a=t.get(n);if(this.computeMinDistance(o,a,i),this.minDistance<=this.terminateDistance)return null}},computeFacetDistance:function(){var e=new Array(2).fill(null),t=xi.getLines(this.geom[0]),i=xi.getLines(this.geom[1]),r=eo.getPoints(this.geom[0]),o=eo.getPoints(this.geom[1]);return this.computeMinDistanceLines(t,i,e),this.updateMinDistance(e,!1),this.minDistance<=this.terminateDistance?null:(e[0]=null,e[1]=null,this.computeMinDistanceLinesPoints(t,o,e),this.updateMinDistance(e,!1),this.minDistance<=this.terminateDistance?null:(e[0]=null,e[1]=null,this.computeMinDistanceLinesPoints(i,r,e),this.updateMinDistance(e,!0),this.minDistance<=this.terminateDistance?null:(e[0]=null,e[1]=null,this.computeMinDistancePoints(r,o,e),void this.updateMinDistance(e,!1))))},nearestLocations:function(){return this.computeMinDistance(),this.minDistanceLocation},updateMinDistance:function(e,t){return null===e[0]?null:void(t?(this.minDistanceLocation[0]=e[1],this.minDistanceLocation[1]=e[0]):(this.minDistanceLocation[0]=e[0],this.minDistanceLocation[1]=e[1]))},nearestPoints:function(){return this.computeMinDistance(),[this.minDistanceLocation[0].getCoordinate(),this.minDistanceLocation[1].getCoordinate()]},computeMinDistance:function(){if(0===arguments.length){if(null!==this.minDistanceLocation)return null;if(this.minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this.minDistance<=this.terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof Ee&&arguments[1]instanceof Pe){var e=arguments[0],t=arguments[1],i=arguments[2];if(e.getEnvelopeInternal().distance(t.getEnvelopeInternal())>this.minDistance)return null;for(var r=e.getCoordinates(),o=t.getCoordinate(),n=0;n<r.length-1;n++){if((d=Qe.distancePointLine(o,r[n],r[n+1]))<this.minDistance){this.minDistance=d;var a=new Ke(r[n],r[n+1]).closestPoint(o);i[0]=new Zr(e,n,a),i[1]=new Zr(t,0,o)}if(this.minDistance<=this.terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Ee&&arguments[1]instanceof Ee){var s=arguments[0],l=arguments[1],u=arguments[2];if(s.getEnvelopeInternal().distance(l.getEnvelopeInternal())>this.minDistance)return null;r=s.getCoordinates();var c=l.getCoordinates();for(n=0;n<r.length-1;n++)for(var h=0;h<c.length-1;h++){var d;if((d=Qe.distanceLineLine(r[n],r[n+1],c[h],c[h+1]))<this.minDistance){this.minDistance=d;var m=new Ke(r[n],r[n+1]),p=new Ke(c[h],c[h+1]),g=m.closestPoints(p);u[0]=new Zr(s,n,g[0]),u[1]=new Zr(l,h,g[1])}if(this.minDistance<=this.terminateDistance)return null}}},computeMinDistancePoints:function(e,t,i){for(var r=0;r<e.size();r++)for(var o=e.get(r),n=0;n<t.size();n++){var a=t.get(n),s=o.getCoordinate().distance(a.getCoordinate());if(s<this.minDistance&&(this.minDistance=s,i[0]=new Zr(o,0,o.getCoordinate()),i[1]=new Zr(a,0,a.getCoordinate())),this.minDistance<=this.terminateDistance)return null}},distance:function(){if(null===this.geom[0]||null===this.geom[1])throw new h("null geometries are not supported");return this.geom[0].isEmpty()||this.geom[1].isEmpty()?0:(this.computeMinDistance(),this.minDistance)},computeMinDistanceLines:function(e,t,i){for(var r=0;r<e.size();r++)for(var o=e.get(r),n=0;n<t.size();n++){var a=t.get(n);if(this.computeMinDistance(o,a,i),this.minDistance<=this.terminateDistance)return null}},interfaces_:function(){return[]},getClass:function(){return io}}),io.distance=function(e,t){return new io(e,t).distance()},io.isWithinDistance=function(e,t,i){return new io(e,t,i).distance()<=i},io.nearestPoints=function(e,t){return new io(e,t).nearestPoints()};var la=Object.freeze({DistanceOp:io});t(ro.prototype,{getCoordinates:function(){if(null===this.coordinates){for(var e=0,t=0,i=new b,r=this.directedEdges.iterator();r.hasNext();){var o=r.next();o.getEdgeDirection()?e++:t++,i.add(o.getEdge().getLine().getCoordinates(),!1,o.getEdgeDirection())}this.coordinates=i.toCoordinateArray(),e<t&&q.reverse(this.coordinates)}return this.coordinates},toLineString:function(){return this.factory.createLineString(this.getCoordinates())},add:function(e){this.directedEdges.add(e)},interfaces_:function(){return[]},getClass:function(){return ro}}),t(oo.prototype,{setVisited:function(e){this._isVisited=e},isMarked:function(){return this._isMarked},setData:function(e){this.data=e},getData:function(){return this.data},setMarked:function(e){this._isMarked=e},getContext:function(){return this.data},isVisited:function(){return this._isVisited},setContext:function(e){this.data=e},interfaces_:function(){return[]},getClass:function(){return oo}}),oo.getComponentWithVisitedState=function(e,t){for(;e.hasNext();){var i=e.next();if(i.isVisited()===t)return i}return null},oo.setVisited=function(e,t){for(;e.hasNext();){e.next().setVisited(t)}},oo.setMarked=function(e,t){for(;e.hasNext();){e.next().setMarked(t)}},s(no,oo),t(no.prototype,{isRemoved:function(){return null===this.parentEdge},compareDirection:function(e){return this.quadrant>e.quadrant?1:this.quadrant<e.quadrant?-1:Qe.computeOrientation(e.p0,e.p1,this.p1)},getCoordinate:function(){return this.from.getCoordinate()},print:function(e){var t=this.getClass().getName(),i=t.lastIndexOf("."),r=t.substring(i+1);e.print(" "+r+": "+this.p0+" - "+this.p1+" "+this.quadrant+":"+this.angle)},getDirectionPt:function(){return this.p1},getAngle:function(){return this.angle},compareTo:function(e){var t=e;return this.compareDirection(t)},getFromNode:function(){return this.from},getSym:function(){return this.sym},setEdge:function(e){this.parentEdge=e},remove:function(){this.sym=null,this.parentEdge=null},getEdge:function(){return this.parentEdge},getQuadrant:function(){return this.quadrant},setSym:function(e){this.sym=e},getToNode:function(){return this.to},getEdgeDirection:function(){return this.edgeDirection},interfaces_:function(){return[i]},getClass:function(){return no}}),no.toEdges=function(e){for(var t=new w,i=e.iterator();i.hasNext();)t.add(i.next().parentEdge);return t},s(ao,no),t(ao.prototype,{getNext:function(){return 2!==this.getToNode().getDegree()?null:this.getToNode().getOutEdges().getEdges().get(0)===this.getSym()?this.getToNode().getOutEdges().getEdges().get(1):(m.isTrue(this.getToNode().getOutEdges().getEdges().get(1)===this.getSym()),this.getToNode().getOutEdges().getEdges().get(0))},interfaces_:function(){return[]},getClass:function(){return ao}}),s(so,oo),t(so.prototype,{isRemoved:function(){return null===this.dirEdge},setDirectedEdges:function(e,t){this.dirEdge=[e,t],e.setEdge(this),t.setEdge(this),e.setSym(t),t.setSym(e),e.getFromNode().addOutEdge(e),t.getFromNode().addOutEdge(t)},getDirEdge:function(){if(Number.isInteger(arguments[0])){var e=arguments[0];return this.dirEdge[e]}if(arguments[0]instanceof uo){var t=arguments[0];return this.dirEdge[0].getFromNode()===t?this.dirEdge[0]:this.dirEdge[1].getFromNode()===t?this.dirEdge[1]:null}},remove:function(){this.dirEdge=null},getOppositeNode:function(e){return this.dirEdge[0].getFromNode()===e?this.dirEdge[0].getToNode():this.dirEdge[1].getFromNode()===e?this.dirEdge[1].getToNode():null},interfaces_:function(){return[]},getClass:function(){return so}}),t(lo.prototype,{getNextEdge:function(e){var t=this.getIndex(e);return this.outEdges.get(this.getIndex(t+1))},getCoordinate:function(){var e=this.iterator();return e.hasNext()?e.next().getCoordinate():null},iterator:function(){return this.sortEdges(),this.outEdges.iterator()},sortEdges:function(){this.sorted||(Xn.sort(this.outEdges),this.sorted=!0)},remove:function(e){this.outEdges.remove(e)},getEdges:function(){return this.sortEdges(),this.outEdges},getNextCWEdge:function(e){var t=this.getIndex(e);return this.outEdges.get(this.getIndex(t-1))},getIndex:function(){if(arguments[0]instanceof so){var e=arguments[0];this.sortEdges();for(var t=0;t<this.outEdges.size();t++){if(this.outEdges.get(t).getEdge()===e)return t}return-1}if(arguments[0]instanceof no){var i=arguments[0];this.sortEdges();for(t=0;t<this.outEdges.size();t++){if(this.outEdges.get(t)===i)return t}return-1}if(Number.isInteger(arguments[0])){var r=arguments[0]%this.outEdges.size();return r<0&&(r+=this.outEdges.size()),r}},add:function(e){this.outEdges.add(e),this.sorted=!1},getDegree:function(){return this.outEdges.size()},interfaces_:function(){return[]},getClass:function(){return lo}}),s(uo,oo),t(uo.prototype,{isRemoved:function(){return null===this.pt},addOutEdge:function(e){this.deStar.add(e)},getCoordinate:function(){return this.pt},getOutEdges:function(){return this.deStar},remove:function(){if(0===arguments.length)this.pt=null;else if(1===arguments.length){var e=arguments[0];this.deStar.remove(e)}},getIndex:function(e){return this.deStar.getIndex(e)},getDegree:function(){return this.deStar.getDegree()},interfaces_:function(){return[]},getClass:function(){return uo}}),uo.getEdgesBetween=function(e,t){var i=new $(no.toEdges(e.getOutEdges().getEdges())),r=no.toEdges(t.getOutEdges().getEdges());return i.retainAll(r),i},s(co,so),t(co.prototype,{getLine:function(){return this.line},interfaces_:function(){return[]},getClass:function(){return co}}),t(ho.prototype,{find:function(e){return this.nodeMap.get(e)},iterator:function(){return this.nodeMap.values().iterator()},remove:function(e){return this.nodeMap.remove(e)},values:function(){return this.nodeMap.values()},add:function(e){return this.nodeMap.put(e.getCoordinate(),e),e},interfaces_:function(){return[]},getClass:function(){return ho}}),t(mo.prototype,{findNodesOfDegree:function(e){for(var t=new w,i=this.nodeIterator();i.hasNext();){var r=i.next();r.getDegree()===e&&t.add(r)}return t},dirEdgeIterator:function(){return this.dirEdges.iterator()},edgeIterator:function(){return this.edges.iterator()},remove:function(){if(arguments[0]instanceof so){var e=arguments[0];this.remove(e.getDirEdge(0)),this.remove(e.getDirEdge(1)),this.edges.remove(e),e.remove()}else if(arguments[0]instanceof no){var t=arguments[0];null!==(o=t.getSym())&&o.setSym(null),t.getFromNode().remove(t),t.remove(),this.dirEdges.remove(t)}else if(arguments[0]instanceof uo){for(var i=arguments[0],r=i.getOutEdges().getEdges().iterator();r.hasNext();){var o,n=r.next();null!==(o=n.getSym())&&this.remove(o),this.dirEdges.remove(n);var a=n.getEdge();null!==a&&this.edges.remove(a)}this.nodeMap.remove(i.getCoordinate()),i.remove()}},findNode:function(e){return this.nodeMap.find(e)},getEdges:function(){return this.edges},nodeIterator:function(){return this.nodeMap.iterator()},contains:function(){if(arguments[0]instanceof so){var e=arguments[0];return this.edges.contains(e)}if(arguments[0]instanceof no){var t=arguments[0];return this.dirEdges.contains(t)}},add:function(){if(arguments[0]instanceof uo){var e=arguments[0];this.nodeMap.add(e)}else if(arguments[0]instanceof so){var t=arguments[0];this.edges.add(t),this.add(t.getDirEdge(0)),this.add(t.getDirEdge(1))}else if(arguments[0]instanceof no){var i=arguments[0];this.dirEdges.add(i)}},getNodes:function(){return this.nodeMap.values()},interfaces_:function(){return[]},getClass:function(){return mo}}),s(po,mo),t(po.prototype,{addEdge:function(e){if(e.isEmpty())return null;var t=q.removeRepeatedPoints(e.getCoordinates());if(t.length<=1)return null;var i=t[0],r=t[t.length-1],o=this.getNode(i),n=this.getNode(r),a=new ao(o,n,t[1],!0),s=new ao(n,o,t[t.length-2],!1),l=new co(e);l.setDirectedEdges(a,s),this.add(l)},getNode:function(e){var t=this.findNode(e);return null===t&&(t=new uo(e),this.add(t)),t},interfaces_:function(){return[]},getClass:function(){return po}}),t(go.prototype,{buildEdgeStringsForUnprocessedNodes:function(){for(var e=this.graph.getNodes().iterator();e.hasNext();){var t=e.next();t.isMarked()||(m.isTrue(2===t.getDegree()),this.buildEdgeStringsStartingAt(t),t.setMarked(!0))}},buildEdgeStringsForNonDegree2Nodes:function(){for(var e=this.graph.getNodes().iterator();e.hasNext();){var t=e.next();2!==t.getDegree()&&(this.buildEdgeStringsStartingAt(t),t.setMarked(!0))}},buildEdgeStringsForObviousStartNodes:function(){this.buildEdgeStringsForNonDegree2Nodes()},getMergedLineStrings:function(){return this.merge(),this.mergedLineStrings},buildEdgeStringsStartingAt:function(e){for(var t=e.getOutEdges().iterator();t.hasNext();){var i=t.next();i.getEdge().isMarked()||this.edgeStrings.add(this.buildEdgeStringStartingWith(i))}},merge:function(){if(null!==this.mergedLineStrings)return null;oo.setMarked(this.graph.nodeIterator(),!1),oo.setMarked(this.graph.edgeIterator(),!1),this.edgeStrings=new w,this.buildEdgeStringsForObviousStartNodes(),this.buildEdgeStringsForIsolatedLoops(),this.mergedLineStrings=new w;for(var e=this.edgeStrings.iterator();e.hasNext();){var t=e.next();this.mergedLineStrings.add(t.toLineString())}},buildEdgeStringStartingWith:function(e){for(var t=new ro(this.factory),i=e;t.add(i),i.getEdge().setMarked(!0),null!==(i=i.getNext())&&i!==e;);return t},add:function(){if(arguments[0]instanceof G)arguments[0].apply({interfaces_:function(){return[H]},filter:function(e){e instanceof Ee&&this.add(e)}});else if(T(arguments[0],f)){var e=arguments[0];this.mergedLineStrings=null;for(var t=e.iterator();t.hasNext();){var i=t.next();this.add(i)}}else if(arguments[0]instanceof Ee){var r=arguments[0];null===this.factory&&(this.factory=r.getFactory()),this.graph.addEdge(r)}},buildEdgeStringsForIsolatedLoops:function(){this.buildEdgeStringsForUnprocessedNodes()},interfaces_:function(){return[]},getClass:function(){return go}});var ua=Object.freeze({LineMerger:go}),ca=Object.freeze({OverlayOp:Bi});s(fo,no),t(fo.prototype,{getNext:function(){return this.next},isInRing:function(){return null!==this.edgeRing},setRing:function(e){this.edgeRing=e},setLabel:function(e){this.label=e},getLabel:function(){return this.label},setNext:function(e){this.next=e},getRing:function(){return this.edgeRing},interfaces_:function(){return[]},getClass:function(){return fo}}),s(vo,so),t(vo.prototype,{getLine:function(){return this.line},interfaces_:function(){return[]},getClass:function(){return vo}}),t(_o.prototype,{visitInteriorRing:function(e,t){var i=e.getCoordinates(),r=i[0],o=_o.findDifferentPoint(i,r),n=t.findEdgeInSameDirection(r,o),a=t.findEdgeEnd(n),s=null;a.getLabel().getLocation(0,Jt.RIGHT)===x.INTERIOR?s=a:a.getSym().getLabel().getLocation(0,Jt.RIGHT)===x.INTERIOR&&(s=a.getSym()),m.isTrue(null!==s,"unable to find dirEdge with Interior on RHS"),this.visitLinkedDirectedEdges(s)},visitShellInteriors:function(e,t){if(e instanceof Te){var i=e;this.visitInteriorRing(i.getExteriorRing(),t)}if(e instanceof Le)for(var r=e,o=0;o<r.getNumGeometries();o++){i=r.getGeometryN(o);this.visitInteriorRing(i.getExteriorRing(),t)}},getCoordinate:function(){return this.disconnectedRingcoord},setInteriorEdgesInResult:function(e){for(var t=e.getEdgeEnds().iterator();t.hasNext();){var i=t.next();i.getLabel().getLocation(0,Jt.RIGHT)===x.INTERIOR&&i.setInResult(!0)}},visitLinkedDirectedEdges:function(e){for(var t=e,i=e;m.isTrue(null!==i,"found null Directed Edge"),i.setVisited(!0),(i=i.getNext())!==t;);},buildEdgeRings:function(e){for(var t=new w,i=e.iterator();i.hasNext();){var r=i.next();if(r.isInResult()&&null===r.getEdgeRing()){var o=new ei(r,this.geometryFactory);o.linkDirectedEdgesForMinimalEdgeRings();var n=o.buildMinimalRings();t.addAll(n)}}return t},hasUnvisitedShellEdge:function(e){for(var t=0;t<e.size();t++){var i=e.get(t);if(!i.isHole()){var r=i.getEdges(),o=r.get(0);if(o.getLabel().getLocation(0,Jt.RIGHT)===x.INTERIOR)for(var n=0;n<r.size();n++)if(!(o=r.get(n)).isVisited())return this.disconnectedRingcoord=o.getCoordinate(),!0}}return!1},isInteriorsConnected:function(){var e=new w;this.geomGraph.computeSplitEdges(e);var t=new si(new gi);t.addEdges(e),this.setInteriorEdgesInResult(t),t.linkResultDirectedEdges();var i=this.buildEdgeRings(t.getEdgeEnds());return this.visitShellInteriors(this.geomGraph.getGeometry(),t),!this.hasUnvisitedShellEdge(i)},interfaces_:function(){return[]},getClass:function(){return _o}}),_o.findDifferentPoint=function(e,t){for(var i=0;i<e.length;i++)if(!e[i].equals(t))return e[i];return null},t(yo.prototype,{createEdgeEndForNext:function(e,t,i,r){var o=i.segmentIndex+1;if(o>=e.getNumPoints()&&null===r)return null;var n=e.getCoordinate(o);null!==r&&r.segmentIndex===i.segmentIndex&&(n=r.coord);var a=new oi(e,i.coord,n,new Kt(e.getLabel()));t.add(a)},createEdgeEndForPrev:function(e,t,i,r){var o=i.segmentIndex;if(0===i.dist){if(0===o)return null;o--}var n=e.getCoordinate(o);null!==r&&r.segmentIndex>=o&&(n=r.coord);var a=new Kt(e.getLabel());a.flip();var s=new oi(e,i.coord,n,a);t.add(s)},computeEdgeEnds:function(){if(1===arguments.length){for(var e=arguments[0],t=new w,i=e;i.hasNext();){var r=i.next();this.computeEdgeEnds(r,t)}return t}if(2===arguments.length){var o=arguments[0],n=arguments[1],a=o.getEdgeIntersectionList();a.addEndpoints();var s=a.iterator(),l=null,u=null;if(!s.hasNext())return null;for(var c=s.next();l=u,u=c,c=null,s.hasNext()&&(c=s.next()),null!==u&&(this.createEdgeEndForPrev(o,n,u,l),this.createEdgeEndForNext(o,n,u,c)),null!==u;);}},interfaces_:function(){return[]},getClass:function(){return yo}}),s(Co,oi),t(Co.prototype,{insert:function(e){this.edgeEnds.add(e)},print:function(e){e.println("EdgeEndBundle--\x3e Label: "+this.label);for(var t=this.iterator();t.hasNext();){t.next().print(e),e.println()}},iterator:function(){return this.edgeEnds.iterator()},getEdgeEnds:function(){return this.edgeEnds},computeLabelOn:function(e,t){for(var i=0,r=!1,o=this.iterator();o.hasNext();){(n=o.next().getLabel().getLocation(e))===x.BOUNDARY&&i++,n===x.INTERIOR&&(r=!0)}var n=x.NONE;r&&(n=x.INTERIOR),0<i&&(n=Fi.determineBoundary(t,i)),this.label.setLocation(e,n)},computeLabelSide:function(e,t){for(var i=this.iterator();i.hasNext();){var r=i.next();if(r.getLabel().isArea()){var o=r.getLabel().getLocation(e,t);if(o===x.INTERIOR)return this.label.setLocation(e,t,x.INTERIOR),null;o===x.EXTERIOR&&this.label.setLocation(e,t,x.EXTERIOR)}}},getLabel:function(){return this.label},computeLabelSides:function(e){this.computeLabelSide(e,Jt.LEFT),this.computeLabelSide(e,Jt.RIGHT)},updateIM:function(e){Vi.updateIM(this.label,e)},computeLabel:function(e){for(var t=!1,i=this.iterator();i.hasNext();){i.next().getLabel().isArea()&&(t=!0)}this.label=t?new Kt(x.NONE,x.NONE,x.NONE):new Kt(x.NONE);for(var r=0;r<2;r++)this.computeLabelOn(r,e),t&&this.computeLabelSides(r)},interfaces_:function(){return[]},getClass:function(){return Co}}),s(wo,mi),t(wo.prototype,{updateIM:function(e){for(var t=this.iterator();t.hasNext();){t.next().updateIM(e)}},insert:function(e){var t=this.edgeMap.get(e);null===t?(t=new Co(e),this.insertEdgeEnd(e,t)):t.insert(e)},interfaces_:function(){return[]},getClass:function(){return wo}}),s(bo,ii),t(bo.prototype,{updateIMFromEdges:function(e){this.edges.updateIM(e)},computeIM:function(e){e.setAtLeastIfValid(this.label.getLocation(0),this.label.getLocation(1),0)},interfaces_:function(){return[]},getClass:function(){return bo}}),s(Eo,ai),t(Eo.prototype,{createNode:function(e){return new bo(e,new wo)},interfaces_:function(){return[]},getClass:function(){return Eo}}),t(So.prototype,{insertEdgeEnds:function(e){for(var t=e.iterator();t.hasNext();){var i=t.next();this.nodes.add(i)}},getNodeIterator:function(){return this.nodes.iterator()},copyNodesAndLabels:function(e,t){for(var i=e.getNodeIterator();i.hasNext();){var r=i.next();this.nodes.addNode(r.getCoordinate()).setLabel(t,r.getLabel().getLocation(t))}},build:function(e){this.computeIntersectionNodes(e,0),this.copyNodesAndLabels(e,0);var t=(new yo).computeEdgeEnds(e.getEdgeIterator());this.insertEdgeEnds(t)},computeIntersectionNodes:function(e,t){for(var i=e.getEdgeIterator();i.hasNext();)for(var r=i.next(),o=r.getLabel().getLocation(t),n=r.getEdgeIntersectionList().iterator();n.hasNext();){var a=n.next(),s=this.nodes.addNode(a.coord);o===x.BOUNDARY?s.setLabelBoundary(t):s.getLabel().isNull(t)&&s.setLabel(t,x.INTERIOR)}},interfaces_:function(){return[]},getClass:function(){return So}}),t(Po.prototype,{isNodeEdgeAreaLabelsConsistent:function(){for(var e=this.nodeGraph.getNodeIterator();e.hasNext();){var t=e.next();if(!t.getEdges().isAreaLabelsConsistent(this.geomGraph))return this.invalidPoint=t.getCoordinate().copy(),!1}return!0},getInvalidPoint:function(){return this.invalidPoint},hasDuplicateRings:function(){for(var e=this.nodeGraph.getNodeIterator();e.hasNext();)for(var t=e.next().getEdges().iterator();t.hasNext();){var i=t.next();if(1<i.getEdgeEnds().size())return this.invalidPoint=i.getEdge().getCoordinate(0),!0}return!1},isNodeConsistentArea:function(){var e=this.geomGraph.computeSelfNodes(this.li,!0,!0);return e.hasProperIntersection()?(this.invalidPoint=e.getProperIntersectionPoint(),!1):(this.nodeGraph.build(this.geomGraph),this.isNodeEdgeAreaLabelsConsistent())},interfaces_:function(){return[]},getClass:function(){return Po}}),t(xo.prototype,{buildIndex:function(){this.index=new Tt;for(var e=0;e<this.rings.size();e++){var t=this.rings.get(e),i=t.getEnvelopeInternal();this.index.insert(i,t)}},getNestedPoint:function(){return this.nestedPt},isNonNested:function(){this.buildIndex();for(var e=0;e<this.rings.size();e++)for(var t=this.rings.get(e),i=t.getCoordinates(),r=this.index.query(t.getEnvelopeInternal()),o=0;o<r.size();o++){var n=r.get(o),a=n.getCoordinates();if(t!==n&&t.getEnvelopeInternal().intersects(n.getEnvelopeInternal())){var s=Io.findPtNotNode(i,n,this.graph);if(null!==s)if(Qe.isPointInRing(s,a))return this.nestedPt=s,!1}}return!0},add:function(e){this.rings.add(e),this.totalEnv.expandToInclude(e.getEnvelopeInternal())},interfaces_:function(){return[]},getClass:function(){return xo}}),t(To.prototype,{getErrorType:function(){return this.errorType},getMessage:function(){return To.errMsg[this.errorType]},getCoordinate:function(){return this.pt},toString:function(){var e="";return null!==this.pt&&(e=" at or near point "+this.pt),this.getMessage()+e},interfaces_:function(){return[]},getClass:function(){return To}}),To.ERROR=0,To.REPEATED_POINT=1,To.HOLE_OUTSIDE_SHELL=2,To.NESTED_HOLES=3,To.DISCONNECTED_INTERIOR=4,To.SELF_INTERSECTION=5,To.RING_SELF_INTERSECTION=6,To.NESTED_SHELLS=7,To.DUPLICATE_RINGS=8,To.TOO_FEW_POINTS=9,To.INVALID_COORDINATE=10,To.RING_NOT_CLOSED=11,To.errMsg=["Topology Validation Error","Repeated Point","Hole lies outside shell","Holes are nested","Interior is disconnected","Self-intersection","Ring Self-intersection","Nested shells","Duplicate Rings","Too few distinct points in geometry component","Invalid Coordinate","Ring is not closed"],t(Io.prototype,{checkInvalidCoordinates:function(){if(arguments[0]instanceof Array){for(var e=arguments[0],t=0;t<e.length;t++)if(!Io.isValid(e[t]))return this.validErr=new To(To.INVALID_COORDINATE,e[t]),null}else if(arguments[0]instanceof Te){var i=arguments[0];if(this.checkInvalidCoordinates(i.getExteriorRing().getCoordinates()),null!==this.validErr)return null;for(t=0;t<i.getNumInteriorRing();t++)if(this.checkInvalidCoordinates(i.getInteriorRingN(t).getCoordinates()),null!==this.validErr)return null}},checkHolesNotNested:function(e,t){for(var i=new xo(t),r=0;r<e.getNumInteriorRing();r++){var o=e.getInteriorRingN(r);i.add(o)}i.isNonNested()||(this.validErr=new To(To.NESTED_HOLES,i.getNestedPoint()))},checkConsistentArea:function(e){var t=new Po(e);return t.isNodeConsistentArea()?void(t.hasDuplicateRings()&&(this.validErr=new To(To.DUPLICATE_RINGS,t.getInvalidPoint()))):(this.validErr=new To(To.SELF_INTERSECTION,t.getInvalidPoint()),null)},isValid:function(){return this.checkValid(this.parentGeometry),null===this.validErr},checkShellInsideHole:function(e,t,i){var r=e.getCoordinates(),o=t.getCoordinates(),n=Io.findPtNotNode(r,t,i);if(null!==n&&!Qe.isPointInRing(n,o))return n;var a=Io.findPtNotNode(o,e,i);return null===a?(m.shouldNeverReachHere("points in shell and hole appear to be equal"),null):Qe.isPointInRing(a,r)?a:null},checkNoSelfIntersectingRings:function(e){for(var t=e.getEdgeIterator();t.hasNext();){var i=t.next();if(this.checkNoSelfIntersectingRing(i.getEdgeIntersectionList()),null!==this.validErr)return null}},checkConnectedInteriors:function(e){var t=new _o(e);t.isInteriorsConnected()||(this.validErr=new To(To.DISCONNECTED_INTERIOR,t.getCoordinate()))},checkNoSelfIntersectingRing:function(e){for(var t=new se,i=!0,r=e.iterator();r.hasNext();){var o=r.next();if(i)i=!1;else{if(t.contains(o.coord))return this.validErr=new To(To.RING_SELF_INTERSECTION,o.coord),null;t.add(o.coord)}}},checkHolesInShell:function(e,t){for(var i=e.getExteriorRing(),r=new or(i),o=0;o<e.getNumInteriorRing();o++){var n=e.getInteriorRingN(o),a=Io.findPtNotNode(n.getCoordinates(),i,t);if(null===a)return null;if(!r.isInside(a))return this.validErr=new To(To.HOLE_OUTSIDE_SHELL,a),null}},checkTooFewPoints:function(e){if(e.hasTooFewPoints())return this.validErr=new To(To.TOO_FEW_POINTS,e.getInvalidPoint()),null},getValidationError:function(){return this.checkValid(this.parentGeometry),this.validErr},checkValid:function(){if(arguments[0]instanceof Pe){var e=arguments[0];this.checkInvalidCoordinates(e.getCoordinates())}else if(arguments[0]instanceof Ie){var t=arguments[0];this.checkInvalidCoordinates(t.getCoordinates())}else if(arguments[0]instanceof De){var i=arguments[0];if(this.checkInvalidCoordinates(i.getCoordinates()),null!==this.validErr)return null;if(this.checkClosedRing(i),null!==this.validErr)return null;var r=new Fi(0,i);if(this.checkTooFewPoints(r),null!==this.validErr)return null;var o=new Ye;r.computeSelfNodes(o,!0,!0),this.checkNoSelfIntersectingRings(r)}else if(arguments[0]instanceof Ee){var n=arguments[0];if(this.checkInvalidCoordinates(n.getCoordinates()),null!==this.validErr)return null;r=new Fi(0,n);this.checkTooFewPoints(r)}else if(arguments[0]instanceof Te){var a=arguments[0];if(this.checkInvalidCoordinates(a),null!==this.validErr)return null;if(this.checkClosedRings(a),null!==this.validErr)return null;r=new Fi(0,a);if(this.checkTooFewPoints(r),null!==this.validErr)return null;if(this.checkConsistentArea(r),null!==this.validErr)return null;if(!this.isSelfTouchingRingFormingHoleValid&&(this.checkNoSelfIntersectingRings(r),null!==this.validErr))return null;if(this.checkHolesInShell(a,r),null!==this.validErr)return null;if(this.checkHolesNotNested(a,r),null!==this.validErr)return null;this.checkConnectedInteriors(r)}else if(arguments[0]instanceof Le){for(var s=arguments[0],l=0;l<s.getNumGeometries();l++){var u=s.getGeometryN(l);if(this.checkInvalidCoordinates(u),null!==this.validErr)return null;if(this.checkClosedRings(u),null!==this.validErr)return null}r=new Fi(0,s);if(this.checkTooFewPoints(r),null!==this.validErr)return null;if(this.checkConsistentArea(r),null!==this.validErr)return null;if(!this.isSelfTouchingRingFormingHoleValid&&(this.checkNoSelfIntersectingRings(r),null!==this.validErr))return null;for(l=0;l<s.getNumGeometries();l++){u=s.getGeometryN(l);if(this.checkHolesInShell(u,r),null!==this.validErr)return null}for(l=0;l<s.getNumGeometries();l++){u=s.getGeometryN(l);if(this.checkHolesNotNested(u,r),null!==this.validErr)return null}if(this.checkShellsNotNested(s,r),null!==this.validErr)return null;this.checkConnectedInteriors(r)}else if(arguments[0]instanceof de){var c=arguments[0];for(l=0;l<c.getNumGeometries();l++){var h=c.getGeometryN(l);if(this.checkValid(h),null!==this.validErr)return null}}else if(arguments[0]instanceof G){var d=arguments[0];if(this.validErr=null,d.isEmpty())return null;if(d instanceof Pe)this.checkValid(d);else if(d instanceof Ie)this.checkValid(d);else if(d instanceof De)this.checkValid(d);else if(d instanceof Ee)this.checkValid(d);else if(d instanceof Te)this.checkValid(d);else if(d instanceof Le)this.checkValid(d);else{if(!(d instanceof de))throw new UnsupportedOperationException(d.getClass().getName());this.checkValid(d)}}},setSelfTouchingRingFormingHoleValid:function(e){this.isSelfTouchingRingFormingHoleValid=e},checkShellNotNested:function(e,t,i){var r=e.getCoordinates(),o=t.getExteriorRing(),n=o.getCoordinates(),a=Io.findPtNotNode(r,o,i);if(null===a)return null;if(!Qe.isPointInRing(a,n))return null;if(t.getNumInteriorRing()<=0)return this.validErr=new To(To.NESTED_SHELLS,a),null;for(var s=null,l=0;l<t.getNumInteriorRing();l++){var u=t.getInteriorRingN(l);if(null===(s=this.checkShellInsideHole(e,u,i)))return null}this.validErr=new To(To.NESTED_SHELLS,s)},checkClosedRings:function(e){if(this.checkClosedRing(e.getExteriorRing()),null!==this.validErr)return null;for(var t=0;t<e.getNumInteriorRing();t++)if(this.checkClosedRing(e.getInteriorRingN(t)),null!==this.validErr)return null},checkClosedRing:function(e){if(!e.isClosed()){var t=null;1<=e.getNumPoints()&&(t=e.getCoordinateN(0)),this.validErr=new To(To.RING_NOT_CLOSED,t)}},checkShellsNotNested:function(e,t){for(var i=0;i<e.getNumGeometries();i++)for(var r=e.getGeometryN(i).getExteriorRing(),o=0;o<e.getNumGeometries();o++)if(i!==o){var n=e.getGeometryN(o);if(this.checkShellNotNested(r,n,t),null!==this.validErr)return null}},interfaces_:function(){return[]},getClass:function(){return Io}}),Io.findPtNotNode=function(e,t,i){for(var r=i.findEdge(t).getEdgeIntersectionList(),o=0;o<e.length;o++){var n=e[o];if(!r.isIntersection(n))return n}return null},Io.isValid=function(){if(arguments[0]instanceof G)return new Io(arguments[0]).isValid();if(arguments[0]instanceof C){var e=arguments[0];return!(_.isNaN(e.x)||_.isInfinite(e.x)||_.isNaN(e.y)||_.isInfinite(e.y))}},t(Do.prototype,{isIncluded:function(){return this._isIncluded},getCoordinates:function(){if(null===this.ringPts){for(var e=new b,t=this.deList.iterator();t.hasNext();){var i=t.next(),r=i.getEdge();Do.addEdge(r.getLine().getCoordinates(),i.getEdgeDirection(),e)}this.ringPts=e.toCoordinateArray()}return this.ringPts},isIncludedSet:function(){return this._isIncludedSet},isValid:function(){return this.getCoordinates(),!(this.ringPts.length<=3)&&(this.getRing(),Io.isValid(this.ring))},build:function(e){for(var t=e;this.add(t),t.setRing(this),t=t.getNext(),m.isTrue(null!==t,"found null DE in ring"),m.isTrue(t===e||!t.isInRing(),"found DE already in ring"),t!==e;);},isOuterHole:function(){return!!this._isHole&&!this.hasShell()},getPolygon:function(){var e=null;if(null!==this.holes){e=new Array(this.holes.size()).fill(null);for(var t=0;t<this.holes.size();t++)e[t]=this.holes.get(t)}return this.factory.createPolygon(this.ring,e)},isHole:function(){return this._isHole},isProcessed:function(){return this._isProcessed},addHole:function(){if(arguments[0]instanceof De){var e=arguments[0];null===this.holes&&(this.holes=new w),this.holes.add(e)}else if(arguments[0]instanceof Do){var t=arguments[0];t.setShell(this);var i=t.getRing();null===this.holes&&(this.holes=new w),this.holes.add(i)}},setIncluded:function(e){this._isIncluded=e,this._isIncludedSet=!0},getOuterHole:function(){if(this.isHole())return null;for(var e=0;e<this.deList.size();e++){var t=this.deList.get(e).getSym().getRing();if(t.isOuterHole())return t}return null},computeHole:function(){var e=this.getRing();this._isHole=Qe.isCCW(e.getCoordinates())},hasShell:function(){return null!==this.shell},isOuterShell:function(){return null!==this.getOuterHole()},getLineString:function(){return this.getCoordinates(),this.factory.createLineString(this.ringPts)},toString:function(){return Ue.toLineString(new Ve(this.getCoordinates()))},getShell:function(){return this.isHole()?this.shell:this},add:function(e){this.deList.add(e)},getRing:function(){if(null!==this.ring)return this.ring;this.getCoordinates(),this.ringPts.length<3&&N.out.println(this.ringPts);try{this.ring=this.factory.createLinearRing(this.ringPts)}catch(e){if(!(e instanceof S))throw e;N.out.println(this.ringPts)}return this.ring},updateIncluded:function(){if(this.isHole())return null;for(var e=0;e<this.deList.size();e++){var t=this.deList.get(e).getSym().getRing().getShell();if(null!==t&&t.isIncludedSet())return this.setIncluded(!t.isIncluded()),null}},setShell:function(e){this.shell=e},setProcessed:function(e){this._isProcessed=e},interfaces_:function(){return[]},getClass:function(){return Do}}),Do.findDirEdgesInRing=function(e){for(var t=e,i=new w;i.add(t),t=t.getNext(),m.isTrue(null!==t,"found null DE in ring"),m.isTrue(t===e||!t.isInRing(),"found DE already in ring"),t!==e;);return i},Do.addEdge=function(e,t,i){if(t)for(var r=0;r<e.length;r++)i.add(e[r],!1);else for(r=e.length-1;0<=r;r--)i.add(e[r],!1)},Do.findEdgeRingContaining=function(e,t){for(var i=e.getRing(),r=i.getEnvelopeInternal(),o=i.getCoordinateN(0),n=null,a=null,s=t.iterator();s.hasNext();){var l=s.next(),u=l.getRing(),c=u.getEnvelopeInternal();if(!c.equals(r)&&c.contains(r)){o=q.ptNotInList(i.getCoordinates(),u.getCoordinates());var h=!1;Qe.isPointInRing(o,u.getCoordinates())&&(h=!0),h&&(null===n||a.contains(c))&&(a=(n=l).getRing().getEnvelopeInternal())}}return n},t(Lo.prototype,{compare:function(e,t){var i=t;return e.getRing().getEnvelope().compareTo(i.getRing().getEnvelope())},interfaces_:function(){return[n]},getClass:function(){return Lo}}),Do.EnvelopeComparator=Lo,s(Mo,mo),t(Mo.prototype,{findEdgeRing:function(e){var t=new Do(this.factory);return t.build(e),t},computeDepthParity:function(){if(0===arguments.length)for(;;){return null}else 1===arguments.length&&arguments[0]},computeNextCWEdges:function(){for(var e=this.nodeIterator();e.hasNext();){var t=e.next();Mo.computeNextCWEdges(t)}},addEdge:function(e){if(e.isEmpty())return null;var t=q.removeRepeatedPoints(e.getCoordinates());if(t.length<2)return null;var i=t[0],r=t[t.length-1],o=this.getNode(i),n=this.getNode(r),a=new fo(o,n,t[1],!0),s=new fo(n,o,t[t.length-2],!1),l=new vo(e);l.setDirectedEdges(a,s),this.add(l)},deleteCutEdges:function(){this.computeNextCWEdges(),Mo.findLabeledEdgeRings(this.dirEdges);for(var e=new w,t=this.dirEdges.iterator();t.hasNext();){var i=t.next();if(!i.isMarked()){var r=i.getSym();if(i.getLabel()===r.getLabel()){i.setMarked(!0),r.setMarked(!0);var o=i.getEdge();e.add(o.getLine())}}}return e},getEdgeRings:function(){this.computeNextCWEdges(),Mo.label(this.dirEdges,-1);var e=Mo.findLabeledEdgeRings(this.dirEdges);this.convertMaximalToMinimalEdgeRings(e);for(var t=new w,i=this.dirEdges.iterator();i.hasNext();){var r=i.next();if(!r.isMarked()&&!r.isInRing()){var o=this.findEdgeRing(r);t.add(o)}}return t},getNode:function(e){var t=this.findNode(e);return null===t&&(t=new uo(e),this.add(t)),t},convertMaximalToMinimalEdgeRings:function(e){for(var t=e.iterator();t.hasNext();){var i=t.next(),r=i.getLabel(),o=Mo.findIntersectionNodes(i,r);if(null!==o)for(var n=o.iterator();n.hasNext();){var a=n.next();Mo.computeNextCCWEdges(a,r)}}},deleteDangles:function(){for(var e=this.findNodesOfDegree(1),t=new $,i=new tt,r=e.iterator();r.hasNext();)i.push(r.next());for(;!i.isEmpty();){var o=i.pop();Mo.deleteAllEdges(o);for(r=o.getOutEdges().getEdges().iterator();r.hasNext();){var n=r.next();n.setMarked(!0);var a=n.getSym();null!==a&&a.setMarked(!0);var s=n.getEdge();t.add(s.getLine());var l=n.getToNode();1===Mo.getDegreeNonDeleted(l)&&i.push(l)}}return t},interfaces_:function(){return[]},getClass:function(){return Mo}}),Mo.findLabeledEdgeRings=function(e){for(var t=new w,i=1,r=e.iterator();r.hasNext();){var o=r.next();if(!(o.isMarked()||0<=o.getLabel())){t.add(o);var n=Do.findDirEdgesInRing(o);Mo.label(n,i),i++}}return t},Mo.getDegreeNonDeleted=function(e){for(var t=0,i=e.getOutEdges().getEdges().iterator();i.hasNext();){i.next().isMarked()||t++}return t},Mo.deleteAllEdges=function(e){for(var t=e.getOutEdges().getEdges().iterator();t.hasNext();){var i=t.next();i.setMarked(!0);var r=i.getSym();null!==r&&r.setMarked(!0)}},Mo.label=function(e,t){for(var i=e.iterator();i.hasNext();){i.next().setLabel(t)}},Mo.computeNextCWEdges=function(e){for(var t=null,i=null,r=e.getOutEdges().getEdges().iterator();r.hasNext();){var o=r.next();if(!o.isMarked()){if(null===t&&(t=o),null!==i)i.getSym().setNext(o);i=o}}null!==i&&i.getSym().setNext(t)},Mo.computeNextCCWEdges=function(e,t){for(var i=null,r=null,o=e.getOutEdges().getEdges(),n=o.size()-1;0<=n;n--){var a=o.get(n),s=a.getSym(),l=null;a.getLabel()===t&&(l=a);var u=null;s.getLabel()===t&&(u=s),null===l&&null===u||(null!==u&&(r=u),null!==l&&(null!==r&&(r.setNext(l),r=null),null===i&&(i=l)))}null!==r&&(m.isTrue(null!==i),r.setNext(i))},Mo.getDegree=function(e,t){for(var i=0,r=e.getOutEdges().getEdges().iterator();r.hasNext();){r.next().getLabel()===t&&i++}return i},Mo.findIntersectionNodes=function(e,t){var i=e,r=null;do{var o=i.getFromNode();1<Mo.getDegree(o,t)&&(null===r&&(r=new w),r.add(o)),i=i.getNext(),m.isTrue(null!==i,"found null DE in ring"),m.isTrue(i===e||!i.isInRing(),"found DE already in ring")}while(i!==e);return r},t(Ao.prototype,{getGeometry:function(){return null===this.geomFactory&&(this.geomFactory=new ze),this.polygonize(),this.extractOnlyPolygonal?this.geomFactory.buildGeometry(this.polyList):this.geomFactory.createGeometryCollection(ze.toGeometryArray(this.polyList))},getInvalidRingLines:function(){return this.polygonize(),this.invalidRingLines},findValidRings:function(e,t,i){for(var r=e.iterator();r.hasNext();){var o=r.next();o.isValid()?t.add(o):i.add(o.getLineString())}},polygonize:function(){if(null!==this.polyList)return null;if(this.polyList=new w,null===this.graph)return null;this.dangles=this.graph.deleteDangles(),this.cutEdges=this.graph.deleteCutEdges();var e=this.graph.getEdgeRings(),t=new w;this.invalidRingLines=new w,this.isCheckingRingsValid?this.findValidRings(e,t,this.invalidRingLines):t=e,this.findShellsAndHoles(t),Ao.assignHolesToShells(this.holeList,this.shellList),Xn.sort(this.shellList,new Do.EnvelopeComparator);var i=!0;this.extractOnlyPolygonal&&(Ao.findDisjointShells(this.shellList),i=!1),this.polyList=Ao.extractPolygons(this.shellList,i)},getDangles:function(){return this.polygonize(),this.dangles},getCutEdges:function(){return this.polygonize(),this.cutEdges},getPolygons:function(){return this.polygonize(),this.polyList},add:function(){if(T(arguments[0],f))for(var e=arguments[0].iterator();e.hasNext();){var t=e.next();this.add(t)}else if(arguments[0]instanceof Ee){var i=arguments[0];this.geomFactory=i.getFactory(),null===this.graph&&(this.graph=new Mo(this.geomFactory)),this.graph.addEdge(i)}else if(arguments[0]instanceof G){arguments[0].apply(this.lineStringAdder)}},setCheckRingsValid:function(e){this.isCheckingRingsValid=e},findShellsAndHoles:function(e){this.holeList=new w,this.shellList=new w;for(var t=e.iterator();t.hasNext();){var i=t.next();i.computeHole(),i.isHole()?this.holeList.add(i):this.shellList.add(i)}},interfaces_:function(){return[]},getClass:function(){return Ao}}),Ao.findOuterShells=function(e){for(var t=e.iterator();t.hasNext();){var i=t.next(),r=i.getOuterHole();null===r||r.isProcessed()||(i.setIncluded(!0),r.setProcessed(!0))}},Ao.extractPolygons=function(e,t){for(var i=new w,r=e.iterator();r.hasNext();){var o=r.next();(t||o.isIncluded())&&i.add(o.getPolygon())}return i},Ao.assignHolesToShells=function(e,t){for(var i=e.iterator();i.hasNext();){var r=i.next();Ao.assignHoleToShell(r,t)}},Ao.assignHoleToShell=function(e,t){var i=Do.findEdgeRingContaining(e,t);null!==i&&i.addHole(e)},Ao.findDisjointShells=function(e){Ao.findOuterShells(e);var t=null;do{t=!1;for(var i=e.iterator();i.hasNext();){var r=i.next();r.isIncludedSet()||(r.updateIncluded(),r.isIncludedSet()||(t=!0))}}while(t)},t(Ro.prototype,{filter:function(e){e instanceof Ee&&this.p.add(e)},interfaces_:function(){return[H]},getClass:function(){return Ro}}),Ao.LineStringAdder=Ro;var ha=Object.freeze({Polygonizer:Ao});t(Oo.prototype,{insertEdgeEnds:function(e){for(var t=e.iterator();t.hasNext();){var i=t.next();this.nodes.add(i)}},computeProperIntersectionIM:function(e,t){var i=this.arg[0].getGeometry().getDimension(),r=this.arg[1].getGeometry().getDimension(),o=e.hasProperIntersection(),n=e.hasProperInteriorIntersection();2===i&&2===r?o&&t.setAtLeast("212101212"):2===i&&1===r?(o&&t.setAtLeast("FFF0FFFF2"),n&&t.setAtLeast("1FFFFF1FF")):1===i&&2===r?(o&&t.setAtLeast("F0FFFFFF2"),n&&t.setAtLeast("1F1FFFFFF")):1===i&&1===r&&n&&t.setAtLeast("0FFFFFFFF")},labelIsolatedEdges:function(e,t){for(var i=this.arg[e].getEdgeIterator();i.hasNext();){var r=i.next();r.isIsolated()&&(this.labelIsolatedEdge(r,t,this.arg[t].getGeometry()),this.isolatedEdges.add(r))}},labelIsolatedEdge:function(e,t,i){if(0<i.getDimension()){var r=this.ptLocator.locate(e.getCoordinate(),i);e.getLabel().setAllLocations(t,r)}else e.getLabel().setAllLocations(t,x.EXTERIOR)},computeIM:function(){var e=new $e;if(e.set(x.EXTERIOR,x.EXTERIOR,2),!this.arg[0].getGeometry().getEnvelopeInternal().intersects(this.arg[1].getGeometry().getEnvelopeInternal()))return this.computeDisjointIM(e),e;this.arg[0].computeSelfNodes(this.li,!1),this.arg[1].computeSelfNodes(this.li,!1);var t=this.arg[0].computeEdgeIntersections(this.arg[1],this.li,!1);this.computeIntersectionNodes(0),this.computeIntersectionNodes(1),this.copyNodesAndLabels(0),this.copyNodesAndLabels(1),this.labelIsolatedNodes(),this.computeProperIntersectionIM(t,e);var i=new yo,r=i.computeEdgeEnds(this.arg[0].getEdgeIterator());this.insertEdgeEnds(r);var o=i.computeEdgeEnds(this.arg[1].getEdgeIterator());return this.insertEdgeEnds(o),this.labelNodeEdges(),this.labelIsolatedEdges(0,1),this.labelIsolatedEdges(1,0),this.updateIM(e),e},labelNodeEdges:function(){for(var e=this.nodes.iterator();e.hasNext();){e.next().getEdges().computeLabelling(this.arg)}},copyNodesAndLabels:function(e){for(var t=this.arg[e].getNodeIterator();t.hasNext();){var i=t.next();this.nodes.addNode(i.getCoordinate()).setLabel(e,i.getLabel().getLocation(e))}},labelIntersectionNodes:function(e){for(var t=this.arg[e].getEdgeIterator();t.hasNext();)for(var i=t.next(),r=i.getLabel().getLocation(e),o=i.getEdgeIntersectionList().iterator();o.hasNext();){var n=o.next(),a=this.nodes.find(n.coord);a.getLabel().isNull(e)&&(r===x.BOUNDARY?a.setLabelBoundary(e):a.setLabel(e,x.INTERIOR))}},labelIsolatedNode:function(e,t){var i=this.ptLocator.locate(e.getCoordinate(),this.arg[t].getGeometry());e.getLabel().setAllLocations(t,i)},computeIntersectionNodes:function(e){for(var t=this.arg[e].getEdgeIterator();t.hasNext();)for(var i=t.next(),r=i.getLabel().getLocation(e),o=i.getEdgeIntersectionList().iterator();o.hasNext();){var n=o.next(),a=this.nodes.addNode(n.coord);r===x.BOUNDARY?a.setLabelBoundary(e):a.getLabel().isNull(e)&&a.setLabel(e,x.INTERIOR)}},labelIsolatedNodes:function(){for(var e=this.nodes.iterator();e.hasNext();){var t=e.next(),i=t.getLabel();m.isTrue(0<i.getGeometryCount(),"node with empty label found"),t.isIsolated()&&(i.isNull(0)?this.labelIsolatedNode(t,0):this.labelIsolatedNode(t,1))}},updateIM:function(e){for(var t=this.isolatedEdges.iterator();t.hasNext();){t.next().updateIM(e)}for(var i=this.nodes.iterator();i.hasNext();){var r=i.next();r.updateIM(e),r.updateIMFromEdges(e)}},computeDisjointIM:function(e){var t=this.arg[0].getGeometry();t.isEmpty()||(e.set(x.INTERIOR,x.EXTERIOR,t.getDimension()),e.set(x.BOUNDARY,x.EXTERIOR,t.getBoundaryDimension()));var i=this.arg[1].getGeometry();i.isEmpty()||(e.set(x.EXTERIOR,x.INTERIOR,i.getDimension()),e.set(x.EXTERIOR,x.BOUNDARY,i.getBoundaryDimension()))},interfaces_:function(){return[]},getClass:function(){return Oo}}),t(No.prototype,{isContainedInBoundary:function(e){if(e instanceof Te)return!1;if(e instanceof Pe)return this.isPointContainedInBoundary(e);if(e instanceof Ee)return this.isLineStringContainedInBoundary(e);for(var t=0;t<e.getNumGeometries();t++){var i=e.getGeometryN(t);if(!this.isContainedInBoundary(i))return!1}return!0},isLineSegmentContainedInBoundary:function(e,t){if(e.equals(t))return this.isPointContainedInBoundary(e);if(e.x===t.x){if(e.x===this.rectEnv.getMinX()||e.x===this.rectEnv.getMaxX())return!0}else if(e.y===t.y&&(e.y===this.rectEnv.getMinY()||e.y===this.rectEnv.getMaxY()))return!0;return!1},isLineStringContainedInBoundary:function(e){for(var t=e.getCoordinateSequence(),i=new C,r=new C,o=0;o<t.size()-1;o++)if(t.getCoordinate(o,i),t.getCoordinate(o+1,r),!this.isLineSegmentContainedInBoundary(i,r))return!1;return!0},isPointContainedInBoundary:function(){if(arguments[0]instanceof Pe){var e=arguments[0];return this.isPointContainedInBoundary(e.getCoordinate())}if(arguments[0]instanceof C){var t=arguments[0];return t.x===this.rectEnv.getMinX()||t.x===this.rectEnv.getMaxX()||t.y===this.rectEnv.getMinY()||t.y===this.rectEnv.getMaxY()}},contains:function(e){return!!this.rectEnv.contains(e.getEnvelopeInternal())&&!this.isContainedInBoundary(e)},interfaces_:function(){return[]},getClass:function(){return No}}),No.contains=function(e,t){return new No(e).contains(t)},t(Vo.prototype,{intersects:function(e,t){var i=new E(e,t);if(!this.rectEnv.intersects(i))return!1;if(this.rectEnv.intersects(e))return!0;if(this.rectEnv.intersects(t))return!0;if(0<e.compareTo(t)){var r=e;e=t,t=r}var o=!1;return t.y>e.y&&(o=!0),o?this.li.computeIntersection(e,t,this.diagDown0,this.diagDown1):this.li.computeIntersection(e,t,this.diagUp0,this.diagUp1),!!this.li.hasIntersection()},interfaces_:function(){return[]},getClass:function(){return Vo}}),t(Fo.prototype,{applyTo:function(e){for(var t=0;t<e.getNumGeometries()&&!this._isDone;t++){var i=e.getGeometryN(t);if(i instanceof de)this.applyTo(i);else if(this.visit(i),this.isDone())return this._isDone=!0,null}},interfaces_:function(){return[]},getClass:function(){return Fo}}),t(Ho.prototype,{intersects:function(e){if(!this.rectEnv.intersects(e.getEnvelopeInternal()))return!1;var t=new Go(this.rectEnv);if(t.applyTo(e),t.intersects())return!0;var i=new ko(this.rectangle);if(i.applyTo(e),i.containsPoint())return!0;var r=new Bo(this.rectangle);return r.applyTo(e),!!r.intersects()},interfaces_:function(){return[]},getClass:function(){return Ho}}),Ho.intersects=function(e,t){return new Ho(e).intersects(t)},s(Go,Fo),t(Go.prototype,{isDone:function(){return!0===this._intersects},visit:function(e){var t=e.getEnvelopeInternal();return this.rectEnv.intersects(t)?this.rectEnv.contains(t)?(this._intersects=!0,null):t.getMinX()>=this.rectEnv.getMinX()&&t.getMaxX()<=this.rectEnv.getMaxX()?(this._intersects=!0,null):t.getMinY()>=this.rectEnv.getMinY()&&t.getMaxY()<=this.rectEnv.getMaxY()?(this._intersects=!0,null):void 0:null},intersects:function(){return this._intersects},interfaces_:function(){return[]},getClass:function(){return Go}}),s(ko,Fo),t(ko.prototype,{isDone:function(){return!0===this._containsPoint},visit:function(e){if(!(e instanceof Te))return null;var t=e.getEnvelopeInternal();if(!this.rectEnv.intersects(t))return null;for(var i=new C,r=0;r<4;r++)if(this.rectSeq.getCoordinate(r,i),t.contains(i)&&di.containsPointInPolygon(i,e))return this._containsPoint=!0,null},containsPoint:function(){return this._containsPoint},interfaces_:function(){return[]},getClass:function(){return ko}}),s(Bo,Fo),t(Bo.prototype,{intersects:function(){return this.hasIntersection},isDone:function(){return!0===this.hasIntersection},visit:function(e){var t=e.getEnvelopeInternal();if(!this.rectEnv.intersects(t))return null;var i=xi.getLines(e);this.checkIntersectionWithLineStrings(i)},checkIntersectionWithLineStrings:function(e){for(var t=e.iterator();t.hasNext();){var i=t.next();if(this.checkIntersectionWithSegments(i),this.hasIntersection)return null}},checkIntersectionWithSegments:function(e){for(var t=e.getCoordinateSequence(),i=1;i<t.size();i++)if(t.getCoordinate(i-1,this.p0),t.getCoordinate(i,this.p1),this.rectIntersector.intersects(this.p0,this.p1))return this.hasIntersection=!0,null},interfaces_:function(){return[]},getClass:function(){return Bo}}),s(jo,Hi),t(jo.prototype,{getIntersectionMatrix:function(){return this._relate.computeIM()},interfaces_:function(){return[]},getClass:function(){return jo}}),jo.covers=function(e,t){return!!e.getEnvelopeInternal().covers(t.getEnvelopeInternal())&&(!!e.isRectangle()||jo.relate(e,t).isCovers())},jo.intersects=function(e,t){return!!e.getEnvelopeInternal().intersects(t.getEnvelopeInternal())&&(e.isRectangle()?Ho.intersects(e,t):t.isRectangle()?Ho.intersects(t,e):jo.relate(e,t).isIntersects())},jo.touches=function(e,t){return!!e.getEnvelopeInternal().intersects(t.getEnvelopeInternal())&&jo.relate(e,t).isTouches(e.getDimension(),t.getDimension())},jo.within=function(e,t){return t.contains(e)},jo.coveredBy=function(e,t){return jo.covers(t,e)},jo.relate=function(){if(2===arguments.length)return new jo(arguments[0],arguments[1]).getIntersectionMatrix();if(3===arguments.length){if("string"==typeof arguments[2]&&arguments[0]instanceof G&&arguments[1]instanceof G){var e=arguments[0],t=arguments[1],i=arguments[2];return jo.relateWithCheck(e,t).matches(i)}if(T(arguments[2],B)&&arguments[0]instanceof G&&arguments[1]instanceof G)return new jo(arguments[0],arguments[1],arguments[2]).getIntersectionMatrix()}},jo.overlaps=function(e,t){return!!e.getEnvelopeInternal().intersects(t.getEnvelopeInternal())&&jo.relate(e,t).isOverlaps(e.getDimension(),t.getDimension())},jo.disjoint=function(e,t){return!e.intersects(t)},jo.relateWithCheck=function(e,t){return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),jo.relate(e,t)},jo.crosses=function(e,t){return!!e.getEnvelopeInternal().intersects(t.getEnvelopeInternal())&&jo.relate(e,t).isCrosses(e.getDimension(),t.getDimension())},jo.contains=function(e,t){return!!e.getEnvelopeInternal().contains(t.getEnvelopeInternal())&&(e.isRectangle()?No.contains(e,t):jo.relate(e,t).isContains())};var da=Object.freeze({RelateOp:jo});t(zo.prototype,{extractElements:function(e,t){if(null===e)return null;for(var i=0;i<e.getNumGeometries();i++){var r=e.getGeometryN(i);this.skipEmpty&&r.isEmpty()||t.add(r)}},combine:function(){for(var e=new w,t=this.inputGeoms.iterator();t.hasNext();){var i=t.next();this.extractElements(i,e)}return 0===e.size()?null!==this.geomFactory?this.geomFactory.createGeometryCollection(null):null:this.geomFactory.buildGeometry(e)},interfaces_:function(){return[]},getClass:function(){return zo}}),zo.combine=function(){if(1===arguments.length)return new zo(arguments[0]).combine();if(2===arguments.length){var e=arguments[0],t=arguments[1];return new zo(zo.createList(e,t)).combine()}if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];return new zo(zo.createList(i,r,o)).combine()}},zo.extractFactory=function(e){return e.isEmpty()?null:e.iterator().next().getFactory()},zo.createList=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];return(i=new w).add(e),i.add(t),i}if(3===arguments.length){var i,r=arguments[0],o=arguments[1],n=arguments[2];return(i=new w).add(r),i.add(o),i.add(n),i}},t(Wo.prototype,{union:function(){for(var e=new pt,t=new se,i=0;i<this.pointGeom.getNumGeometries();i++){var r=this.pointGeom.getGeometryN(i).getCoordinate();e.locate(r,this.otherGeom)===x.EXTERIOR&&t.add(r)}if(0===t.size())return this.otherGeom;var o,n=q.toCoordinateArray(t);return o=1===n.length?this.geomFact.createPoint(n[0]):this.geomFact.createMultiPointFromCoords(n),zo.combine(o,this.otherGeom)},interfaces_:function(){return[]},getClass:function(){return Wo}}),Wo.union=function(e,t){return new Wo(e,t).union()},t(Uo.prototype,{filter:function(e){-1!==this.sortIndex&&e.getSortIndex()!==this.sortIndex||this.comps.add(e)},interfaces_:function(){return[ce]},getClass:function(){return Uo}}),Uo.extract=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];return Uo.extract(e,t,new w)}if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];return i.getSortIndex()===r?o.add(i):i instanceof de&&i.apply(new Uo(r,o)),o}},t(qo.prototype,{reduceToGeometries:function(e){for(var t=new w,i=e.iterator();i.hasNext();){var r=i.next(),o=null;T(r,v)?o=this.unionTree(r):r instanceof G&&(o=r),t.add(o)}return t},extractByEnvelope:function(e,t,i){for(var r=new w,o=0;o<t.getNumGeometries();o++){var n=t.getGeometryN(o);n.getEnvelopeInternal().intersects(e)?r.add(n):i.add(n)}return this.geomFactory.buildGeometry(r)},unionOptimized:function(e,t){var i=e.getEnvelopeInternal(),r=t.getEnvelopeInternal();if(!i.intersects(r))return zo.combine(e,t);if(e.getNumGeometries()<=1&&t.getNumGeometries()<=1)return this.unionActual(e,t);var o=i.intersection(r);return this.unionUsingEnvelopeIntersection(e,t,o)},union:function(){if(null===this.inputPolys)throw new IllegalStateException("union() method cannot be called twice");if(this.inputPolys.isEmpty())return null;this.geomFactory=this.inputPolys.iterator().next().getFactory();for(var e=new Tt(qo.STRTREE_NODE_CAPACITY),t=this.inputPolys.iterator();t.hasNext();){var i=t.next();e.insert(i.getEnvelopeInternal(),i)}this.inputPolys=null;var r=e.itemsTree();return this.unionTree(r)},binaryUnion:function(){if(1===arguments.length){var e=arguments[0];return this.binaryUnion(e,0,e.size())}if(3===arguments.length){var t=arguments[0],i=arguments[1],r=arguments[2];if(r-i<=1){var o=qo.getGeometry(t,i);return this.unionSafe(o,null)}if(r-i==2)return this.unionSafe(qo.getGeometry(t,i),qo.getGeometry(t,i+1));var n=Math.trunc((r+i)/2),a=(o=this.binaryUnion(t,i,n),this.binaryUnion(t,n,r));return this.unionSafe(o,a)}},repeatedUnion:function(e){for(var t=null,i=e.iterator();i.hasNext();){var r=i.next();t=null===t?r.copy():t.union(r)}return t},unionSafe:function(e,t){return null===e&&null===t?null:null===e?t.copy():null===t?e.copy():this.unionOptimized(e,t)},unionActual:function(e,t){return qo.restrictToPolygons(e.union(t))},unionTree:function(e){var t=this.reduceToGeometries(e);return this.binaryUnion(t)},unionUsingEnvelopeIntersection:function(e,t,i){var r=new w,o=this.extractByEnvelope(i,e,r),n=this.extractByEnvelope(i,t,r),a=this.unionActual(o,n);return r.add(a),zo.combine(r)},bufferUnion:function(){if(1===arguments.length){var e=arguments[0];return e.get(0).getFactory().buildGeometry(e).buffer(0)}if(2===arguments.length){var t=arguments[0],i=arguments[1];return t.getFactory().createGeometryCollection([t,i]).buffer(0)}},interfaces_:function(){return[]},getClass:function(){return qo}}),qo.restrictToPolygons=function(e){if(T(e,xe))return e;var t=$r.getPolygons(e);return 1===t.size()?t.get(0):e.getFactory().createMultiPolygon(ze.toPolygonArray(t))},qo.getGeometry=function(e,t){return t>=e.size()?null:e.get(t)},qo.union=function(e){return new qo(e).union()},qo.STRTREE_NODE_CAPACITY=4,t(Yo.prototype,{unionNoOpt:function(e){var t=this.geomFact.createPoint();return zi.overlayOp(e,t,Bi.UNION)},unionWithNull:function(e,t){return null===e&&null===t?null:null===t?e:null===e?t:e.union(t)},extract:function(){if(T(arguments[0],f))for(var e=arguments[0].iterator();e.hasNext();){var t=e.next();this.extract(t)}else if(arguments[0]instanceof G){var i=arguments[0];null===this.geomFact&&(this.geomFact=i.getFactory()),Uo.extract(i,G.SORTINDEX_POLYGON,this.polygons),Uo.extract(i,G.SORTINDEX_LINESTRING,this.lines),Uo.extract(i,G.SORTINDEX_POINT,this.points)}},union:function(){if(null===this.geomFact)return null;var e=null;if(0<this.points.size()){var t=this.geomFact.buildGeometry(this.points);e=this.unionNoOpt(t)}var i=null;if(0<this.lines.size()){var r=this.geomFact.buildGeometry(this.lines);i=this.unionNoOpt(r)}var o=null;0<this.polygons.size()&&(o=qo.union(this.polygons));var n=this.unionWithNull(i,o),a=null;return a=null===e?n:null===n?e:Wo.union(e,n),null===a?this.geomFact.createGeometryCollection():a},interfaces_:function(){return[]},getClass:function(){return Yo}}),Yo.union=function(){if(1===arguments.length){if(T(arguments[0],f))return new Yo(arguments[0]).union();if(arguments[0]instanceof G)return new Yo(arguments[0]).union()}else if(2===arguments.length){return new Yo(arguments[0],arguments[1]).union()}};var ma=Object.freeze({UnaryUnionOp:Yo}),pa=Object.freeze({IsValidOp:Io,ConsistentAreaTester:Po}),ga=Object.freeze({BoundaryOp:pe,IsSimpleOp:Lr,buffer:sa,distance:la,linemerge:ua,overlay:ca,polygonize:ha,relate:da,union:ma,valid:pa});s(Xo,Me.CoordinateOperation),t(Xo.prototype,{editCoordinates:function(e,t){if(0===e.length)return null;for(var i=new Array(e.length).fill(null),r=0;r<e.length;r++){var o=new C(e[r]);this.targetPM.makePrecise(o),i[r]=o}var n=new b(i,!1).toCoordinateArray(),a=0;t instanceof Ee&&(a=2),t instanceof De&&(a=4);var s=i;return this.removeCollapsed&&(s=null),n.length<a?s:n},interfaces_:function(){return[]},getClass:function(){return Xo}}),t(Jo.prototype,{fixPolygonalTopology:function(e){var t=e;this.changePrecisionModel||(t=this.changePM(e,this.targetPM));var i=t.buffer(0),r=i;return this.changePrecisionModel||(r=this.changePM(i,e.getPrecisionModel())),r},reducePointwise:function(e){var t=null;this.changePrecisionModel?t=new Me(this.createFactory(e.getFactory(),this.targetPM)):t=new Me;var i=this.removeCollapsed;return 2<=e.getDimension()&&(i=!0),t.edit(e,new Xo(this.targetPM,i))},changePM:function(e,t){return this.createEditor(e.getFactory(),t).edit(e,new Me.NoOpGeometryOperation)},setRemoveCollapsedComponents:function(e){this.removeCollapsed=e},createFactory:function(e,t){return new ze(t,e.getSRID(),e.getCoordinateSequenceFactory())},setChangePrecisionModel:function(e){this.changePrecisionModel=e},reduce:function(e){var t=this.reducePointwise(e);return this.isPointwise?t:T(t,xe)?t.isValid()?t:this.fixPolygonalTopology(t):t},setPointwise:function(e){this.isPointwise=e},createEditor:function(e,t){return e.getPrecisionModel()===t?new Me:new Me(this.createFactory(e,t))},interfaces_:function(){return[]},getClass:function(){return Jo}}),Jo.reduce=function(e,t){return new Jo(t).reduce(e)},Jo.reducePointwise=function(e,t){var i=new Jo(t);return i.setPointwise(!0),i.reduce(e)};var fa=Object.freeze({GeometryPrecisionReducer:Jo});t(Qo.prototype,{simplifySection:function(e,t){if(e+1===t)return null;this.seg.p0=this.pts[e],this.seg.p1=this.pts[t];for(var i=-1,r=e,o=e+1;o<t;o++){var n=this.seg.distance(this.pts[o]);i<n&&(i=n,r=o)}if(i<=this.distanceTolerance)for(o=e+1;o<t;o++)this.usePt[o]=!1;else this.simplifySection(e,r),this.simplifySection(r,t)},setDistanceTolerance:function(e){this.distanceTolerance=e},simplify:function(){this.usePt=new Array(this.pts.length).fill(null);for(var e=0;e<this.pts.length;e++)this.usePt[e]=!0;this.simplifySection(0,this.pts.length-1);var t=new b;for(e=0;e<this.pts.length;e++)this.usePt[e]&&t.add(new C(this.pts[e]));return t.toCoordinateArray()},interfaces_:function(){return[]},getClass:function(){return Qo}}),Qo.simplify=function(e,t){var i=new Qo(e);return i.setDistanceTolerance(t),i.simplify()},t(Ko.prototype,{setEnsureValid:function(e){this.isEnsureValidTopology=e},getResultGeometry:function(){return this.inputGeom.isEmpty()?this.inputGeom.copy():new $o(this.isEnsureValidTopology,this.distanceTolerance).transform(this.inputGeom)},setDistanceTolerance:function(e){if(e<0)throw new h("Tolerance must be non-negative");this.distanceTolerance=e},interfaces_:function(){return[]},getClass:function(){return Ko}}),Ko.simplify=function(e,t){var i=new Ko(e);return i.setDistanceTolerance(t),i.getResultGeometry()},s($o,nt),t($o.prototype,{transformPolygon:function(e,t){if(e.isEmpty())return null;var i=nt.prototype.transformPolygon.call(this,e,t);return t instanceof Le?i:this.createValidArea(i)},createValidArea:function(e){return this.isEnsureValidTopology?e.buffer(0):e},transformCoordinates:function(e,t){var i,r=e.toCoordinateArray();return i=0===r.length?new Array(0).fill(null):Qo.simplify(r,this.distanceTolerance),this.factory.getCoordinateSequenceFactory().create(i)},transformMultiPolygon:function(e,t){var i=nt.prototype.transformMultiPolygon.call(this,e,t);return this.createValidArea(i)},transformLinearRing:function(e,t){var i=t instanceof Te,r=nt.prototype.transformLinearRing.call(this,e,t);return!i||r instanceof De?r:null},interfaces_:function(){return[]},getClass:function(){return $o}}),Ko.DPTransformer=$o,s(Zo,Ke),t(Zo.prototype,{getIndex:function(){return this.index},getParent:function(){return this.parent},interfaces_:function(){return[]},getClass:function(){return Zo}}),t(en.prototype,{addToResult:function(e){this.resultSegs.add(e)},asLineString:function(){return this.parentLine.getFactory().createLineString(en.extractCoordinates(this.resultSegs))},getResultSize:function(){var e=this.resultSegs.size();return 0===e?0:e+1},getParent:function(){return this.parentLine},getSegment:function(e){return this.segs[e]},getParentCoordinates:function(){return this.parentLine.getCoordinates()},getMinimumSize:function(){return this.minimumSize},asLinearRing:function(){return this.parentLine.getFactory().createLinearRing(en.extractCoordinates(this.resultSegs))},getSegments:function(){return this.segs},init:function(){var e=this.parentLine.getCoordinates();this.segs=new Array(e.length-1).fill(null);for(var t=0;t<e.length-1;t++){var i=new Zo(e[t],e[t+1],this.parentLine,t);this.segs[t]=i}},getResultCoordinates:function(){return en.extractCoordinates(this.resultSegs)},interfaces_:function(){return[]},getClass:function(){return en}}),en.extractCoordinates=function(e){for(var t=new Array(e.size()+1).fill(null),i=null,r=0;r<e.size();r++)i=e.get(r),t[r]=i.p0;return t[t.length-1]=i.p1,t},t(tn.prototype,{remove:function(e){this.index.remove(new E(e.p0,e.p1),e)},add:function(){if(arguments[0]instanceof en)for(var e=arguments[0].getSegments(),t=0;t<e.length;t++){var i=e[t];this.add(i)}else if(arguments[0]instanceof Ke){var r=arguments[0];this.index.insert(new E(r.p0,r.p1),r)}},query:function(e){var t=new E(e.p0,e.p1),i=new rn(e);return this.index.query(t,i),i.getItems()},interfaces_:function(){return[]},getClass:function(){return tn}}),t(rn.prototype,{visitItem:function(e){var t=e;E.intersects(t.p0,t.p1,this.querySeg.p0,this.querySeg.p1)&&this.items.add(e)},getItems:function(){return this.items},interfaces_:function(){return[wt]},getClass:function(){return rn}}),t(on.prototype,{flatten:function(e,t){var i=new Ke(this.linePts[e],this.linePts[t]);return this.remove(this.line,e,t),this.outputIndex.add(i),i},hasBadIntersection:function(e,t,i){return!!this.hasBadOutputIntersection(i)||!!this.hasBadInputIntersection(e,t,i)},setDistanceTolerance:function(e){this.distanceTolerance=e},simplifySection:function(e,t,i){i+=1;var r=new Array(2).fill(null);if(e+1===t){var o=this.line.getSegment(e);return this.line.addToResult(o),null}var n=!0;this.line.getResultSize()<this.line.getMinimumSize()&&(i+1<this.line.getMinimumSize()&&(n=!1));var a=new Array(1).fill(null),s=this.findFurthestPoint(this.linePts,e,t,a);a[0]>this.distanceTolerance&&(n=!1);var l=new Ke;if(l.p0=this.linePts[e],l.p1=this.linePts[t],r[0]=e,r[1]=t,this.hasBadIntersection(this.line,r,l)&&(n=!1),n){o=this.flatten(e,t);return this.line.addToResult(o),null}this.simplifySection(e,s,i),this.simplifySection(s,t,i)},hasBadOutputIntersection:function(e){for(var t=this.outputIndex.query(e).iterator();t.hasNext();){var i=t.next();if(this.hasInteriorIntersection(i,e))return!0}return!1},findFurthestPoint:function(e,t,i,r){var o=new Ke;o.p0=e[t],o.p1=e[i];for(var n=-1,a=t,s=t+1;s<i;s++){var l=e[s],u=o.distance(l);n<u&&(n=u,a=s)}return r[0]=n,a},simplify:function(e){this.line=e,this.linePts=e.getParentCoordinates(),this.simplifySection(0,this.linePts.length-1,0)},remove:function(e,t,i){for(var r=t;r<i;r++){var o=e.getSegment(r);this.inputIndex.remove(o)}},hasInteriorIntersection:function(e,t){return this.li.computeIntersection(e.p0,e.p1,t.p0,t.p1),this.li.isInteriorIntersection()},hasBadInputIntersection:function(e,t,i){for(var r=this.inputIndex.query(i).iterator();r.hasNext();){var o=r.next();if(this.hasInteriorIntersection(o,i)){if(on.isInLineSection(e,t,o))continue;return!0}}return!1},interfaces_:function(){return[]},getClass:function(){return on}}),on.isInLineSection=function(e,t,i){if(i.getParent()!==e.getParent())return!1;var r=i.getIndex();return r>=t[0]&&r<t[1]},t(nn.prototype,{setDistanceTolerance:function(e){this.distanceTolerance=e},simplify:function(e){for(var t=e.iterator();t.hasNext();)this.inputIndex.add(t.next());for(t=e.iterator();t.hasNext();){var i=new on(this.inputIndex,this.outputIndex);i.setDistanceTolerance(this.distanceTolerance),i.simplify(t.next())}},interfaces_:function(){return[]},getClass:function(){return nn}}),t(an.prototype,{getResultGeometry:function(){return this.inputGeom.isEmpty()?this.inputGeom.copy():(this.linestringMap=new ke,this.inputGeom.apply(new ln(this)),this.lineSimplifier.simplify(this.linestringMap.values()),new sn(this.linestringMap).transform(this.inputGeom))},setDistanceTolerance:function(e){if(e<0)throw new h("Tolerance must be non-negative");this.lineSimplifier.setDistanceTolerance(e)},interfaces_:function(){return[]},getClass:function(){return an}}),an.simplify=function(e,t){var i=new an(e);return i.setDistanceTolerance(t),i.getResultGeometry()},s(sn,nt),t(sn.prototype,{transformCoordinates:function(e,t){if(0===e.size())return null;if(t instanceof Ee){var i=this.linestringMap.get(t);return this.createCoordinateSequence(i.getResultCoordinates())}return nt.prototype.transformCoordinates.call(this,e,t)},interfaces_:function(){return[]},getClass:function(){return sn}}),t(ln.prototype,{filter:function(e){if(e instanceof Ee){var t=e;if(t.isEmpty())return null;var i=t.isClosed()?4:2,r=new en(t,i);this.tps.linestringMap.put(t,r)}},interfaces_:function(){return[H]},getClass:function(){return ln}}),an.LineStringTransformer=sn,an.LineStringMapBuilderFilter=ln;var va=Object.freeze({DouglasPeuckerSimplifier:Ko,TopologyPreservingSimplifier:an});t(un.prototype,{splitAt:function(){if(1===arguments.length){var e=arguments[0],t=this.minimumLen/this.segLen;if(e.distance(this.seg.p0)<this.minimumLen)return this.splitPt=this.seg.pointAlong(t),null;if(e.distance(this.seg.p1)<this.minimumLen)return this.splitPt=un.pointAlongReverse(this.seg,t),null;this.splitPt=e}else if(2===arguments.length){var i=arguments[0],r=arguments[1],o=this.getConstrainedLength(i)/this.segLen;r.equals2D(this.seg.p0)?this.splitPt=this.seg.pointAlong(o):this.splitPt=un.pointAlongReverse(this.seg,o)}},setMinimumLength:function(e){this.minimumLen=e},getConstrainedLength:function(e){return e<this.minimumLen?this.minimumLen:e},getSplitPoint:function(){return this.splitPt},interfaces_:function(){return[]},getClass:function(){return un}}),un.pointAlongReverse=function(e,t){var i=new C;return i.x=e.p1.x-t*(e.p1.x-e.p0.x),i.y=e.p1.y-t*(e.p1.y-e.p0.y),i},t(cn.prototype,{findSplitPoint:function(e,t){},interfaces_:function(){return[]},getClass:function(){return cn}}),t(hn.prototype,{findSplitPoint:function(e,t){var i=e.getLineSegment(),r=i.getLength()/2,o=new un(i),n=hn.projectedSplitPoint(e,t),a=2*n.distance(t)*.8;return r<a&&(a=r),o.setMinimumLength(a),o.splitAt(n),o.getSplitPoint()},interfaces_:function(){return[cn]},getClass:function(){return hn}}),hn.projectedSplitPoint=function(e,t){return e.getLineSegment().project(t)},t(dn.prototype,{interfaces_:function(){return[]},getClass:function(){return dn}}),dn.triArea=function(e,t,i){return(t.x-e.x)*(i.y-e.y)-(t.y-e.y)*(i.x-e.x)},dn.isInCircleDDNormalized=function(e,t,i,r){var o=A.valueOf(e.x).selfSubtract(r.x),n=A.valueOf(e.y).selfSubtract(r.y),a=A.valueOf(t.x).selfSubtract(r.x),s=A.valueOf(t.y).selfSubtract(r.y),l=A.valueOf(i.x).selfSubtract(r.x),u=A.valueOf(i.y).selfSubtract(r.y),c=o.multiply(s).selfSubtract(a.multiply(n)),h=a.multiply(u).selfSubtract(l.multiply(s)),d=l.multiply(n).selfSubtract(o.multiply(u)),m=o.multiply(o).selfAdd(n.multiply(n)),p=a.multiply(a).selfAdd(s.multiply(s)),g=l.multiply(l).selfAdd(u.multiply(u));return 0<m.selfMultiply(h).selfAdd(p.selfMultiply(d)).selfAdd(g.selfMultiply(c)).doubleValue()},dn.checkRobustInCircle=function(e,t,i,r){var o=dn.isInCircleNonRobust(e,t,i,r),n=dn.isInCircleDDSlow(e,t,i,r),a=dn.isInCircleCC(e,t,i,r),s=sr.circumcentre(e,t,i);N.out.println("p radius diff a = "+Math.abs(r.distance(s)-e.distance(s))/e.distance(s)),o===n&&o===a||(N.out.println("inCircle robustness failure (double result = "+o+", DD result = "+n+", CC result = "+a+")"),N.out.println(Ue.toLineString(new Ve([e,t,i,r]))),N.out.println("Circumcentre = "+Ue.toPoint(s)+" radius = "+e.distance(s)),N.out.println("p radius diff a = "+Math.abs(r.distance(s)/e.distance(s)-1)),N.out.println("p radius diff b = "+Math.abs(r.distance(s)/t.distance(s)-1)),N.out.println("p radius diff c = "+Math.abs(r.distance(s)/i.distance(s)-1)),N.out.println())},dn.isInCircleDDFast=function(e,t,i,r){var o=A.sqr(e.x).selfAdd(A.sqr(e.y)).selfMultiply(dn.triAreaDDFast(t,i,r)),n=A.sqr(t.x).selfAdd(A.sqr(t.y)).selfMultiply(dn.triAreaDDFast(e,i,r)),a=A.sqr(i.x).selfAdd(A.sqr(i.y)).selfMultiply(dn.triAreaDDFast(e,t,r)),s=A.sqr(r.x).selfAdd(A.sqr(r.y)).selfMultiply(dn.triAreaDDFast(e,t,i));return 0<o.selfSubtract(n).selfAdd(a).selfSubtract(s).doubleValue()},dn.isInCircleCC=function(e,t,i,r){var o=sr.circumcentre(e,t,i),n=e.distance(o);return r.distance(o)-n<=0},dn.isInCircleNormalized=function(e,t,i,r){var o=e.x-r.x,n=e.y-r.y,a=t.x-r.x,s=t.y-r.y,l=i.x-r.x,u=i.y-r.y;return 0<(o*o+n*n)*(a*u-l*s)+(a*a+s*s)*(l*n-o*u)+(l*l+u*u)*(o*s-a*n)},dn.isInCircleDDSlow=function(e,t,i,r){var o=A.valueOf(r.x),n=A.valueOf(r.y),a=A.valueOf(e.x),s=A.valueOf(e.y),l=A.valueOf(t.x),u=A.valueOf(t.y),c=A.valueOf(i.x),h=A.valueOf(i.y),d=a.multiply(a).add(s.multiply(s)).multiply(dn.triAreaDDSlow(l,u,c,h,o,n)),m=l.multiply(l).add(u.multiply(u)).multiply(dn.triAreaDDSlow(a,s,c,h,o,n)),p=c.multiply(c).add(h.multiply(h)).multiply(dn.triAreaDDSlow(a,s,l,u,o,n)),g=o.multiply(o).add(n.multiply(n)).multiply(dn.triAreaDDSlow(a,s,l,u,c,h));return 0<d.subtract(m).add(p).subtract(g).doubleValue()},dn.isInCircleNonRobust=function(e,t,i,r){return 0<(e.x*e.x+e.y*e.y)*dn.triArea(t,i,r)-(t.x*t.x+t.y*t.y)*dn.triArea(e,i,r)+(i.x*i.x+i.y*i.y)*dn.triArea(e,t,r)-(r.x*r.x+r.y*r.y)*dn.triArea(e,t,i)},dn.isInCircleRobust=function(e,t,i,r){return dn.isInCircleNormalized(e,t,i,r)},dn.triAreaDDSlow=function(e,t,i,r,o,n){return i.subtract(e).multiply(n.subtract(t)).subtract(r.subtract(t).multiply(o.subtract(e)))},dn.triAreaDDFast=function(e,t,i){var r=A.valueOf(t.x).selfSubtract(e.x).selfMultiply(A.valueOf(i.y).selfSubtract(e.y)),o=A.valueOf(t.y).selfSubtract(e.y).selfMultiply(A.valueOf(i.x).selfSubtract(e.x));return r.selfSubtract(o)},t(mn.prototype,{circleCenter:function(t,i){var r=new mn(this.getX(),this.getY()),e=new V(this.bisector(r,t),this.bisector(t,i)),o=null;try{o=new mn(e.getX(),e.getY())}catch(e){if(!(e instanceof P))throw e;N.err.println("a: "+r+" b: "+t+" c: "+i),N.err.println(e)}return o},dot:function(e){return this.p.x*e.getX()+this.p.y*e.getY()},magn:function(){return Math.sqrt(this.p.x*this.p.x+this.p.y*this.p.y)},getZ:function(){return this.p.z},bisector:function(e,t){var i=t.getX()-e.getX(),r=t.getY()-e.getY();return new V(new V(e.getX()+i/2,e.getY()+r/2,1),new V(e.getX()-r+i/2,e.getY()+i+r/2,1))},equals:function(){if(1===arguments.length){var e=arguments[0];return this.p.x===e.getX()&&this.p.y===e.getY()}if(2===arguments.length){var t=arguments[0],i=arguments[1];return this.p.distance(t.getCoordinate())<i}},getCoordinate:function(){return this.p},isInCircle:function(e,t,i){return dn.isInCircleRobust(e.p,t.p,i.p,this.p)},interpolateZValue:function(e,t,i){var r=e.getX(),o=e.getY(),n=t.getX()-r,a=i.getX()-r,s=t.getY()-o,l=i.getY()-o,u=n*l-a*s,c=this.getX()-r,h=this.getY()-o,d=(l*c-a*h)/u,m=(-s*c+n*h)/u;return e.getZ()+d*(t.getZ()-e.getZ())+m*(i.getZ()-e.getZ())},midPoint:function(e){return new mn((this.p.x+e.getX())/2,(this.p.y+e.getY())/2,(this.p.z+e.getZ())/2)},rightOf:function(e){return this.isCCW(e.dest(),e.orig())},isCCW:function(e,t){return 0<(e.p.x-this.p.x)*(t.p.y-this.p.y)-(e.p.y-this.p.y)*(t.p.x-this.p.x)},getX:function(){return this.p.x},crossProduct:function(e){return this.p.x*e.getY()-this.p.y*e.getX()},setZ:function(e){this.p.z=e},times:function(e){return new mn(e*this.p.x,e*this.p.y)},cross:function(){return new mn(this.p.y,-this.p.x)},leftOf:function(e){return this.isCCW(e.orig(),e.dest())},toString:function(){return"POINT ("+this.p.x+" "+this.p.y+")"},sub:function(e){return new mn(this.p.x-e.getX(),this.p.y-e.getY())},getY:function(){return this.p.y},classify:function(e,t){var i=t.sub(e),r=this.sub(e),o=i.crossProduct(r);return 0<o?mn.LEFT:o<0?mn.RIGHT:i.getX()*r.getX()<0||i.getY()*r.getY()<0?mn.BEHIND:i.magn()<r.magn()?mn.BEYOND:e.equals(this)?mn.ORIGIN:t.equals(this)?mn.DESTINATION:mn.BETWEEN},sum:function(e){return new mn(this.p.x+e.getX(),this.p.y+e.getY())},distance:function(e,t){return Math.sqrt(Math.pow(t.getX()-e.getX(),2)+Math.pow(t.getY()-e.getY(),2))},circumRadiusRatio:function(e,t){var i=this.circleCenter(e,t),r=this.distance(i,e),o=this.distance(this,e),n=this.distance(e,t);return n<o&&(o=n),(n=this.distance(t,this))<o&&(o=n),r/o},interfaces_:function(){return[]},getClass:function(){return mn}}),mn.interpolateZ=function(){if(3===arguments.length){var e=arguments[0],t=arguments[1],i=arguments[2],r=t.distance(i),o=e.distance(t),n=i.z-t.z;return t.z+n*(o/r)}if(4===arguments.length){var a=arguments[0],s=arguments[1],l=arguments[2],u=arguments[3],c=s.x,h=s.y,d=l.x-c,m=u.x-c,p=l.y-h,g=u.y-h,f=d*g-m*p,v=a.x-c,_=a.y-h,y=(g*v-m*_)/f,C=(-p*v+d*_)/f;return s.z+y*(l.z-s.z)+C*(u.z-s.z)}},mn.LEFT=0,mn.RIGHT=1,mn.BEYOND=2,mn.BEHIND=3,mn.BETWEEN=4,mn.ORIGIN=5,mn.DESTINATION=6,s(pn,mn),t(pn.prototype,{getConstraint:function(){return this.constraint},setOnConstraint:function(e){this._isOnConstraint=e},merge:function(e){e._isOnConstraint&&(this._isOnConstraint=!0,this.constraint=e.constraint)},isOnConstraint:function(){return this._isOnConstraint},setConstraint:function(e){this._isOnConstraint=!0,this.constraint=e},interfaces_:function(){return[]},getClass:function(){return pn}}),t(gn.prototype,{equalsNonOriented:function(e){return!!this.equalsOriented(e)||!!this.equalsOriented(e.sym())},toLineSegment:function(){return new Ke(this.vertex.getCoordinate(),this.dest().getCoordinate())},dest:function(){return this.sym().orig()},oNext:function(){return this.next},equalsOriented:function(e){return!(!this.orig().getCoordinate().equals2D(e.orig().getCoordinate())||!this.dest().getCoordinate().equals2D(e.dest().getCoordinate()))},dNext:function(){return this.sym().oNext().sym()},lPrev:function(){return this.next.sym()},rPrev:function(){return this.sym().oNext()},rot:function(){return this._rot},oPrev:function(){return this._rot.next._rot},sym:function(){return this._rot._rot},setOrig:function(e){this.vertex=e},lNext:function(){return this.invRot().oNext().rot()},getLength:function(){return this.orig().getCoordinate().distance(this.dest().getCoordinate())},invRot:function(){return this._rot.sym()},setDest:function(e){this.sym().setOrig(e)},setData:function(e){this.data=e},getData:function(){return this.data},delete:function(){this._rot=null},orig:function(){return this.vertex},rNext:function(){return this._rot.next.invRot()},toString:function(){var e=this.vertex.getCoordinate(),t=this.dest().getCoordinate();return Ue.toLineString(e,t)},isLive:function(){return null!==this._rot},getPrimary:function(){return this.orig().getCoordinate().compareTo(this.dest().getCoordinate())<=0?this:this.sym()},dPrev:function(){return this.invRot().oNext().invRot()},setNext:function(e){this.next=e},interfaces_:function(){return[]},getClass:function(){return gn}}),gn.makeEdge=function(e,t){var i=new gn,r=new gn,o=new gn,n=new gn;((((i._rot=r)._rot=o)._rot=n)._rot=i).setNext(i),r.setNext(n),o.setNext(o),n.setNext(r);var a=i;return a.setOrig(e),a.setDest(t),a},gn.swap=function(e){var t=e.oPrev(),i=e.sym().oPrev();gn.splice(e,t),gn.splice(e.sym(),i),gn.splice(e,t.lNext()),gn.splice(e.sym(),i.lNext()),e.setOrig(t.dest()),e.setDest(i.dest())},gn.splice=function(e,t){var i=e.oNext().rot(),r=t.oNext().rot(),o=t.oNext(),n=e.oNext(),a=r.oNext(),s=i.oNext();e.setNext(o),t.setNext(n),i.setNext(a),r.setNext(s)},gn.connect=function(e,t){var i=gn.makeEdge(e.dest(),t.orig());return gn.splice(i,e.lNext()),gn.splice(i.sym(),t),i},t(fn.prototype,{insertSite:function(e){var t=this.subdiv.locate(e);if(this.subdiv.isVertexOfEdge(t,e))return t;this.subdiv.isOnEdge(t,e.getCoordinate())&&(t=t.oPrev(),this.subdiv.delete(t.oNext()));var i=this.subdiv.makeEdge(t.orig(),e);gn.splice(i,t);for(var r=i;(t=(i=this.subdiv.connect(t,i.sym())).oPrev()).lNext()!==r;);for(;;){var o=t.oPrev();if(o.dest().rightOf(t)&&e.isInCircle(t.orig(),o.dest(),t.dest()))gn.swap(t),t=t.oPrev();else{if(t.oNext()===r)return i;t=t.oNext().lPrev()}}},insertSites:function(e){for(var t=e.iterator();t.hasNext();){var i=t.next();this.insertSite(i)}},interfaces_:function(){return[]},getClass:function(){return fn}}),t(vn.prototype,{locate:function(e){},interfaces_:function(){return[]},getClass:function(){return vn}}),t(_n.prototype,{init:function(){this.lastEdge=this.findEdge()},locate:function(e){this.lastEdge.isLive()||this.init();var t=this.subdiv.locateFromEdge(e,this.lastEdge);return this.lastEdge=t},findEdge:function(){return this.subdiv.getEdges().iterator().next()},interfaces_:function(){return[vn]},getClass:function(){return _n}}),s(yn,y),t(yn.prototype,{getSegment:function(){return this.seg},interfaces_:function(){return[]},getClass:function(){return yn}}),yn.msgWithSpatial=function(e,t){return null!==t?e+" [ "+t+" ]":e},t(Cn.prototype,{visit:function(e){},interfaces_:function(){return[]},getClass:function(){return Cn}}),t(wn.prototype,{getTriangleVertices:function(e){var t=new Sn;return this.visitTriangles(t,e),t.getTriangleVertices()},isFrameVertex:function(e){return!!e.equals(this.frameVertex[0])||!!e.equals(this.frameVertex[1])||!!e.equals(this.frameVertex[2])},isVertexOfEdge:function(e,t){return!(!t.equals(e.orig(),this.tolerance)&&!t.equals(e.dest(),this.tolerance))},connect:function(e,t){var i=gn.connect(e,t);return this.quadEdges.add(i),i},getVoronoiCellPolygon:function(e,t){var i=new w,r=e;do{var o=e.rot().orig().getCoordinate();i.add(o),e=e.oPrev()}while(e!==r);var n=new b;n.addAll(i,!1),n.closeRing(),n.size()<4&&(N.out.println(n),n.add(n.get(n.size()-1),!0));var a=n.toCoordinateArray(),s=t.createPolygon(t.createLinearRing(a),null),l=r.orig();return s.setUserData(l.getCoordinate()),s},setLocator:function(e){this.locator=e},initSubdiv:function(){var e=this.makeEdge(this.frameVertex[0],this.frameVertex[1]),t=this.makeEdge(this.frameVertex[1],this.frameVertex[2]);gn.splice(e.sym(),t);var i=this.makeEdge(this.frameVertex[2],this.frameVertex[0]);return gn.splice(t.sym(),i),gn.splice(i.sym(),e),e},isFrameBorderEdge:function(e){var t=new Array(3).fill(null);wn.getTriangleEdges(e,t);var i=new Array(3).fill(null);wn.getTriangleEdges(e.sym(),i);var r=e.lNext().dest();if(this.isFrameVertex(r))return!0;var o=e.sym().lNext().dest();return!!this.isFrameVertex(o)},makeEdge:function(e,t){var i=gn.makeEdge(e,t);return this.quadEdges.add(i),i},visitTriangles:function(e,t){this.visitedKey++;var i=new tt;i.push(this.startingEdge);for(var r=new $;!i.empty();){var o=i.pop();if(!r.contains(o)){var n=this.fetchTriangleToVisit(o,i,t,r);null!==n&&e.visit(n)}}},isFrameEdge:function(e){return!(!this.isFrameVertex(e.orig())&&!this.isFrameVertex(e.dest()))},isOnEdge:function(e,t){return this.seg.setCoordinates(e.orig().getCoordinate(),e.dest().getCoordinate()),this.seg.distance(t)<this.edgeCoincidenceTolerance},getEnvelope:function(){return new E(this.frameEnv)},createFrame:function(e){var t,i=e.getWidth(),r=e.getHeight();t=r<i?10*i:10*r,this.frameVertex[0]=new mn((e.getMaxX()+e.getMinX())/2,e.getMaxY()+t),this.frameVertex[1]=new mn(e.getMinX()-t,e.getMinY()-t),this.frameVertex[2]=new mn(e.getMaxX()+t,e.getMinY()-t),this.frameEnv=new E(this.frameVertex[0].getCoordinate(),this.frameVertex[1].getCoordinate()),this.frameEnv.expandToInclude(this.frameVertex[2].getCoordinate())},getTriangleCoordinates:function(e){var t=new Pn;return this.visitTriangles(t,e),t.getTriangles()},getVertices:function(e){for(var t=new $,i=this.quadEdges.iterator();i.hasNext();){var r=i.next(),o=r.orig();!e&&this.isFrameVertex(o)||t.add(o);var n=r.dest();!e&&this.isFrameVertex(n)||t.add(n)}return t},fetchTriangleToVisit:function(e,t,i,r){var o=e,n=0,a=!1;do{this.triEdges[n]=o,this.isFrameEdge(o)&&(a=!0);var s=o.sym();r.contains(s)||t.push(s),r.add(o),n++,o=o.lNext()}while(o!==e);return a&&!i?null:this.triEdges},getEdges:function(){if(0===arguments.length)return this.quadEdges;if(1===arguments.length){for(var e=arguments[0],t=this.getPrimaryEdges(!1),i=new Array(t.size()).fill(null),r=0,o=t.iterator();o.hasNext();){var n=o.next();i[r++]=e.createLineString([n.orig().getCoordinate(),n.dest().getCoordinate()])}return e.createMultiLineString(i)}},getVertexUniqueEdges:function(e){for(var t=new w,i=new $,r=this.quadEdges.iterator();r.hasNext();){var o=r.next(),n=o.orig();i.contains(n)||(i.add(n),!e&&this.isFrameVertex(n)||t.add(o));var a=o.sym(),s=a.orig();i.contains(s)||(i.add(s),!e&&this.isFrameVertex(s)||t.add(a))}return t},getTriangleEdges:function(e){var t=new En;return this.visitTriangles(t,e),t.getTriangleEdges()},getPrimaryEdges:function(e){this.visitedKey++;var t=new w,i=new tt;i.push(this.startingEdge);for(var r=new $;!i.empty();){var o=i.pop();if(!r.contains(o)){var n=o.getPrimary();!e&&this.isFrameEdge(n)||t.add(n),i.push(o.oNext()),i.push(o.sym().oNext()),r.add(o),r.add(o.sym())}}return t},delete:function(e){gn.splice(e,e.oPrev()),gn.splice(e.sym(),e.sym().oPrev());var t=e.sym(),i=e.rot(),r=e.rot().sym();this.quadEdges.remove(e),this.quadEdges.remove(t),this.quadEdges.remove(i),this.quadEdges.remove(r),e.delete(),t.delete(),i.delete(),r.delete()},locateFromEdge:function(e,t){for(var i=0,r=this.quadEdges.size(),o=t;;){if(r<++i)throw new yn(o.toLineSegment());if(e.equals(o.orig())||e.equals(o.dest()))break;if(e.rightOf(o))o=o.sym();else if(e.rightOf(o.oNext())){if(e.rightOf(o.dPrev()))break;o=o.dPrev()}else o=o.oNext()}return o},getTolerance:function(){return this.tolerance},getVoronoiCellPolygons:function(e){this.visitTriangles(new bn,!0);for(var t=new w,i=this.getVertexUniqueEdges(!1).iterator();i.hasNext();){var r=i.next();t.add(this.getVoronoiCellPolygon(r,e))}return t},getVoronoiDiagram:function(e){var t=this.getVoronoiCellPolygons(e);return e.createGeometryCollection(ze.toGeometryArray(t))},getTriangles:function(e){for(var t=this.getTriangleCoordinates(!1),i=new Array(t.size()).fill(null),r=0,o=t.iterator();o.hasNext();){var n=o.next();i[r++]=e.createPolygon(e.createLinearRing(n),null)}return e.createGeometryCollection(i)},insertSite:function(e){var t=this.locate(e);if(e.equals(t.orig(),this.tolerance)||e.equals(t.dest(),this.tolerance))return t;var i=this.makeEdge(t.orig(),e);gn.splice(i,t);for(var r=i;(t=(i=this.connect(t,i.sym())).oPrev()).lNext()!==r;);return r},locate:function(){if(1===arguments.length){if(arguments[0]instanceof mn){var e=arguments[0];return this.locator.locate(e)}if(arguments[0]instanceof C){var t=arguments[0];return this.locator.locate(new mn(t))}}else if(2===arguments.length){var i=arguments[0],r=arguments[1],o=this.locator.locate(new mn(i));if(null===o)return null;var n=o;o.dest().getCoordinate().equals2D(i)&&(n=o.sym());var a=n;do{if(a.dest().getCoordinate().equals2D(r))return a;a=a.oNext()}while(a!==n);return null}},interfaces_:function(){return[]},getClass:function(){return wn}}),wn.getTriangleEdges=function(e,t){if(t[0]=e,t[1]=t[0].lNext(),t[2]=t[1].lNext(),t[2].lNext()!==t[0])throw new h("Edges do not form a triangle")},t(bn.prototype,{visit:function(e){for(var t=e[0].orig().getCoordinate(),i=e[1].orig().getCoordinate(),r=e[2].orig().getCoordinate(),o=new mn(sr.circumcentre(t,i,r)),n=0;n<3;n++)e[n].rot().setOrig(o)},interfaces_:function(){return[Cn]},getClass:function(){return bn}}),t(En.prototype,{getTriangleEdges:function(){return this.triList},visit:function(e){this.triList.add(e.clone())},interfaces_:function(){return[Cn]},getClass:function(){return En}}),t(Sn.prototype,{visit:function(e){this.triList.add([e[0].orig(),e[1].orig(),e[2].orig()])},getTriangleVertices:function(){return this.triList},interfaces_:function(){return[Cn]},getClass:function(){return Sn}}),t(Pn.prototype,{checkTriangleSize:function(e){2<=e.length?Ue.toLineString(e[0],e[1]):1<=e.length&&Ue.toPoint(e[0])},visit:function(e){this.coordList.clear();for(var t=0;t<3;t++){var i=e[t].orig();this.coordList.add(i.getCoordinate())}if(0<this.coordList.size()){this.coordList.closeRing();var r=this.coordList.toCoordinateArray();if(4!==r.length)return null;this.triCoords.add(r)}},getTriangles:function(){return this.triCoords},interfaces_:function(){return[Cn]},getClass:function(){return Pn}}),wn.TriangleCircumcentreVisitor=bn,wn.TriangleEdgesListVisitor=En,wn.TriangleVertexListVisitor=Sn,wn.TriangleCoordinatesVisitor=Pn,wn.EDGE_COINCIDENCE_TOL_FACTOR=1e3,t(xn.prototype,{getLineSegment:function(){return this.ls},getEndZ:function(){return this.ls.getCoordinate(1).z},getStartZ:function(){return this.ls.getCoordinate(0).z},intersection:function(e){return this.ls.intersection(e.getLineSegment())},getStart:function(){return this.ls.getCoordinate(0)},getEnd:function(){return this.ls.getCoordinate(1)},getEndY:function(){return this.ls.getCoordinate(1).y},getStartX:function(){return this.ls.getCoordinate(0).x},equalsTopo:function(e){return this.ls.equalsTopo(e.getLineSegment())},getStartY:function(){return this.ls.getCoordinate(0).y},setData:function(e){this.data=e},getData:function(){return this.data},getEndX:function(){return this.ls.getCoordinate(1).x},toString:function(){return this.ls.toString()},interfaces_:function(){return[]},getClass:function(){return xn}}),t(Tn.prototype,{visit:function(e){},interfaces_:function(){return[]},getClass:function(){return Tn}}),t(In.prototype,{isRepeated:function(){return 1<this.count},getRight:function(){return this.right},getCoordinate:function(){return this.p},setLeft:function(e){this.left=e},getX:function(){return this.p.x},getData:function(){return this.data},getCount:function(){return this.count},getLeft:function(){return this.left},getY:function(){return this.p.y},increment:function(){this.count=this.count+1},setRight:function(e){this.right=e},interfaces_:function(){return[]},getClass:function(){return In}}),t(Dn.prototype,{insert:function(){if(1===arguments.length){var e=arguments[0];return this.insert(e,null)}if(2===arguments.length){var t=arguments[0],i=arguments[1];if(null===this.root)return this.root=new In(t,i),this.root;if(0<this.tolerance){var r=this.findBestMatchNode(t);if(null!==r)return r.increment(),r}return this.insertExact(t,i)}},query:function(){var e,t,i=arguments,r=this;if(1===arguments.length){var o=arguments[0],n=new w;return this.query(o,n),n}if(2===arguments.length)if(arguments[0]instanceof E&&T(arguments[1],v))e=i[0],t=i[1],r.queryNode(r.root,e,!0,{interfaces_:function(){return[Tn]},visit:function(e){t.add(e)}});else if(arguments[0]instanceof E&&T(arguments[1],Tn)){var a=arguments[0],s=arguments[1];this.queryNode(this.root,a,!0,s)}},queryNode:function(e,t,i,r){if(null===e)return null;var o=null,n=null,a=null,s=(a=i?(o=t.getMinX(),n=t.getMaxX(),e.getX()):(o=t.getMinY(),n=t.getMaxY(),e.getY()))<=n;o<a&&this.queryNode(e.getLeft(),t,!i,r),t.contains(e.getCoordinate())&&r.visit(e),s&&this.queryNode(e.getRight(),t,!i,r)},findBestMatchNode:function(e){var t=new Ln(e,this.tolerance);return this.query(t.queryEnvelope(),t),t.getNode()},isEmpty:function(){return null===this.root},insertExact:function(e,t){for(var i=this.root,r=this.root,o=!0,n=!0;null!==i;){if(null!==i)if(e.distance(i.getCoordinate())<=this.tolerance)return i.increment(),i;n=o?e.x<i.getX():e.y<i.getY(),r=i,i=n?i.getLeft():i.getRight(),o=!o}this.numberOfNodes=this.numberOfNodes+1;var a=new In(e,t);return n?r.setLeft(a):r.setRight(a),a},interfaces_:function(){return[]},getClass:function(){return Dn}}),Dn.toCoordinates=function(){if(1===arguments.length){var e=arguments[0];return Dn.toCoordinates(e,!1)}if(2===arguments.length){for(var t=arguments[0],i=arguments[1],r=new b,o=t.iterator();o.hasNext();)for(var n=o.next(),a=i?n.getCount():1,s=0;s<a;s++)r.add(n.getCoordinate(),!0);return r.toCoordinateArray()}},t(Ln.prototype,{visit:function(e){var t=this.p.distance(e.getCoordinate());if(!(t<=this.tolerance))return null;var i=!1;(null===this.matchNode||t<this.matchDist||null!==this.matchNode&&t===this.matchDist&&e.getCoordinate().compareTo(this.matchNode.getCoordinate())<1)&&(i=!0),i&&(this.matchNode=e,this.matchDist=t)},queryEnvelope:function(){var e=new E(this.p);return e.expandBy(this.tolerance),e},getNode:function(){return this.matchNode},interfaces_:function(){return[Tn]},getClass:function(){return Ln}}),Dn.BestMatchVisitor=Ln,t(Mn.prototype,{getInitialVertices:function(){return this.initialVertices},getKDT:function(){return this.kdt},enforceConstraints:function(){this.addConstraintVertices();for(var e=0;0<this.enforceGabriel(this.segments)&&++e<Mn.MAX_SPLIT_ITER;);},insertSites:function(e){for(var t=e.iterator();t.hasNext();){var i=t.next();this.insertSite(i)}},getVertexFactory:function(){return this.vertexFactory},getPointArray:function(){for(var e=new Array(this.initialVertices.size()+this.segVertices.size()).fill(null),t=0,i=this.initialVertices.iterator();i.hasNext();){var r=i.next();e[t++]=r.getCoordinate()}for(var o=this.segVertices.iterator();o.hasNext();){r=o.next();e[t++]=r.getCoordinate()}return e},setConstraints:function(e,t){this.segments=e,this.segVertices=t},computeConvexHull:function(){var e=new ze,t=new rt(this.getPointArray(),e);this.convexHull=t.getConvexHull()},addConstraintVertices:function(){this.computeConvexHull(),this.insertSites(this.segVertices)},findNonGabrielPoint:function(e){var t=e.getStart(),i=e.getEnd(),r=new C((t.x+i.x)/2,(t.y+i.y)/2),o=t.distance(r),n=new E(r);n.expandBy(o);for(var a=this.kdt.query(n),s=null,l=_.MAX_VALUE,u=a.iterator();u.hasNext();){var c=u.next().getCoordinate();if(!c.equals2D(t)&&!c.equals2D(i)){var h=r.distance(c);if(h<o){(null===s||h<l)&&(s=c,l=h)}}}return s},getConstraintSegments:function(){return this.segments},setSplitPointFinder:function(e){this.splitFinder=e},getConvexHull:function(){return this.convexHull},getTolerance:function(){return this.tolerance},enforceGabriel:function(e){for(var t=new w,i=0,r=new w,o=e.iterator();o.hasNext();){var n=o.next(),a=this.findNonGabrielPoint(n);if(null!==a){this.splitPt=this.splitFinder.findSplitPoint(n,a);var s=this.createVertex(this.splitPt,n),l=(this.insertSite(s),new xn(n.getStartX(),n.getStartY(),n.getStartZ(),s.getX(),s.getY(),s.getZ(),n.getData())),u=new xn(s.getX(),s.getY(),s.getZ(),n.getEndX(),n.getEndY(),n.getEndZ(),n.getData());t.add(l),t.add(u),r.add(n),i+=1}}return e.removeAll(r),e.addAll(t),i},createVertex:function(){if(1===arguments.length){var e=arguments[0],t=null;return null!==this.vertexFactory?this.vertexFactory.createVertex(e,null):new pn(e)}if(2===arguments.length){var i=arguments[0],r=arguments[1];t=null;return(t=null!==this.vertexFactory?this.vertexFactory.createVertex(i,r):new pn(i)).setOnConstraint(!0),t}},getSubdivision:function(){return this.subdiv},computeBoundingBox:function(){var e=Mn.computeVertexEnvelope(this.initialVertices),t=Mn.computeVertexEnvelope(this.segVertices),i=new E(e);i.expandToInclude(t);var r=.2*i.getWidth(),o=.2*i.getHeight(),n=Math.max(r,o);this.computeAreaEnv=new E(i),this.computeAreaEnv.expandBy(n)},setVertexFactory:function(e){this.vertexFactory=e},formInitialDelaunay:function(){this.computeBoundingBox(),this.subdiv=new wn(this.computeAreaEnv,this.tolerance),this.subdiv.setLocator(new _n(this.subdiv)),this.incDel=new fn(this.subdiv),this.insertSites(this.initialVertices)},insertSite:function(){if(arguments[0]instanceof pn){var e=arguments[0],t=this.kdt.insert(e.getCoordinate(),e);if(t.isRepeated()){var i=t.getData();return i.merge(e),i}return this.incDel.insertSite(e),e}if(arguments[0]instanceof C){var r=arguments[0];this.insertSite(this.createVertex(r))}},interfaces_:function(){return[]},getClass:function(){return Mn}}),Mn.computeVertexEnvelope=function(e){for(var t=new E,i=e.iterator();i.hasNext();){var r=i.next();t.expandToInclude(r.getCoordinate())}return t},Mn.MAX_SPLIT_ITER=99,t(An.prototype,{create:function(){if(null!==this.subdiv)return null;var e=An.envelope(this.siteCoords),t=An.toVertices(this.siteCoords);this.subdiv=new wn(e,this.tolerance),new fn(this.subdiv).insertSites(t)},setTolerance:function(e){this.tolerance=e},setSites:function(){if(arguments[0]instanceof G){var e=arguments[0];this.siteCoords=An.extractUniqueCoordinates(e)}else if(T(arguments[0],f)){var t=arguments[0];this.siteCoords=An.unique(q.toCoordinateArray(t))}},getEdges:function(e){return this.create(),this.subdiv.getEdges(e)},getSubdivision:function(){return this.create(),this.subdiv},getTriangles:function(e){return this.create(),this.subdiv.getTriangles(e)},interfaces_:function(){return[]},getClass:function(){return An}}),An.extractUniqueCoordinates=function(e){if(null===e)return new b;var t=e.getCoordinates();return An.unique(t)},An.envelope=function(e){for(var t=new E,i=e.iterator();i.hasNext();){var r=i.next();t.expandToInclude(r)}return t},An.unique=function(e){var t=q.copyDeep(e);return le.sort(t),new b(t,!1)},An.toVertices=function(e){for(var t=new w,i=e.iterator();i.hasNext();){var r=i.next();t.add(new mn(r))}return t},t(Rn.prototype,{createSiteVertices:function(e){for(var t=new w,i=e.iterator();i.hasNext();){var r=i.next();this.constraintVertexMap.containsKey(r)||t.add(new pn(r))}return t},create:function(){if(null!==this.subdiv)return null;var e=An.envelope(this.siteCoords),t=new w;null!==this.constraintLines&&(e.expandToInclude(this.constraintLines.getEnvelopeInternal()),this.createVertices(this.constraintLines),t=Rn.createConstraintSegments(this.constraintLines));var i=new Mn(this.createSiteVertices(this.siteCoords),this.tolerance);i.setConstraints(t,new w(this.constraintVertexMap.values())),i.formInitialDelaunay(),i.enforceConstraints(),this.subdiv=i.getSubdivision()},setTolerance:function(e){this.tolerance=e},setConstraints:function(e){this.constraintLines=e},setSites:function(e){this.siteCoords=An.extractUniqueCoordinates(e)},getEdges:function(e){return this.create(),this.subdiv.getEdges(e)},getSubdivision:function(){return this.create(),this.subdiv},getTriangles:function(e){return this.create(),this.subdiv.getTriangles(e)},createVertices:function(e){for(var t=e.getCoordinates(),i=0;i<t.length;i++){var r=new pn(t[i]);this.constraintVertexMap.put(t[i],r)}},interfaces_:function(){return[]},getClass:function(){return Rn}}),Rn.createConstraintSegments=function(){if(1===arguments.length){for(var e=arguments[0],t=xi.getLines(e),i=new w,r=t.iterator();r.hasNext();){var o=r.next();Rn.createConstraintSegments(o,i)}return i}if(2===arguments.length){var n=arguments[0],a=arguments[1],s=n.getCoordinates();for(r=1;r<s.length;r++)a.add(new xn(s[r-1],s[r]))}},t(On.prototype,{create:function(){if(null!==this.subdiv)return null;var e=An.envelope(this.siteCoords);this.diagramEnv=e;var t=Math.max(this.diagramEnv.getWidth(),this.diagramEnv.getHeight());this.diagramEnv.expandBy(t),null!==this.clipEnv&&this.diagramEnv.expandToInclude(this.clipEnv);var i=An.toVertices(this.siteCoords);this.subdiv=new wn(e,this.tolerance),new fn(this.subdiv).insertSites(i)},getDiagram:function(e){this.create();var t=this.subdiv.getVoronoiDiagram(e);return On.clipGeometryCollection(t,this.diagramEnv)},setTolerance:function(e){this.tolerance=e},setSites:function(){if(arguments[0]instanceof G){var e=arguments[0];this.siteCoords=An.extractUniqueCoordinates(e)}else if(T(arguments[0],f)){var t=arguments[0];this.siteCoords=An.unique(q.toCoordinateArray(t))}},setClipEnvelope:function(e){this.clipEnv=e},getSubdivision:function(){return this.create(),this.subdiv},interfaces_:function(){return[]},getClass:function(){return On}}),On.clipGeometryCollection=function(e,t){for(var i=e.getFactory().toGeometry(t),r=new w,o=0;o<e.getNumGeometries();o++){var n=e.getGeometryN(o),a=null;t.contains(n.getEnvelopeInternal())?a=n:t.intersects(n.getEnvelopeInternal())&&(a=i.intersection(n)).setUserData(n.getUserData()),null===a||a.isEmpty()||r.add(a)}return e.getFactory().createGeometryCollection(ze.toGeometryArray(r))};var _a=Object.freeze({Vertex:mn}),ya=Object.freeze({ConformingDelaunayTriangulationBuilder:Rn,DelaunayTriangulationBuilder:An,VoronoiDiagramBuilder:On,quadedge:_a});t(Nn.prototype,{interfaces_:function(){return[]},getClass:function(){return Nn}}),Nn.union=function(e,t){if(e.isEmpty()||t.isEmpty()){if(e.isEmpty()&&t.isEmpty())return Bi.createEmptyResult(Bi.UNION,e,t,e.getFactory());if(e.isEmpty())return t.copy();if(t.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),zi.overlayOp(e,t,Bi.UNION)},t(G.prototype,{equalsTopo:function(e){return!!this.getEnvelopeInternal().equals(e.getEnvelopeInternal())&&jo.relate(this,e).isEquals(this.getDimension(),e.getDimension())},union:function(){if(0===arguments.length)return Yo.union(this);if(1===arguments.length){var e=arguments[0];return Nn.union(this,e)}},isValid:function(){return Io.isValid(this)},intersection:function(e){if(this.isEmpty()||e.isEmpty())return Bi.createEmptyResult(Bi.INTERSECTION,this,e,this.factory);if(this.isGeometryCollection()){var t=e;return Xt.map(this,{interfaces_:function(){return[MapOp]},map:function(e){return e.intersection(t)}})}return this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(e),zi.overlayOp(this,e,Bi.INTERSECTION)},covers:function(e){return jo.covers(this,e)},coveredBy:function(e){return jo.coveredBy(this,e)},touches:function(e){return jo.touches(this,e)},intersects:function(e){return jo.intersects(this,e)},within:function(e){return jo.within(this,e)},overlaps:function(e){return jo.overlaps(this,e)},disjoint:function(e){return jo.disjoint(this,e)},crosses:function(e){return jo.crosses(this,e)},buffer:function(){if(1===arguments.length){var e=arguments[0];return Kr.bufferOp(this,e)}if(2===arguments.length){var t=arguments[0],i=arguments[1];return Kr.bufferOp(this,t,i)}if(3===arguments.length){var r=arguments[0],o=arguments[1],n=arguments[2];return Kr.bufferOp(this,r,o,n)}},convexHull:function(){return new rt(this).getConvexHull()},relate:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return jo.relate.apply(jo,[this].concat(t))},getCentroid:function(){if(this.isEmpty())return this.factory.createPoint();var e=Ze.getCentroid(this);return this.createPointFromInternalCoord(e,this)},getInteriorPoint:function(){if(this.isEmpty())return this.factory.createPoint();var e=null,t=this.getDimension();if(0===t)e=new Yi(this).getInteriorPoint();else if(1===t){e=new qi(this).getInteriorPoint()}else{e=new Wi(this).getInteriorPoint()}return this.createPointFromInternalCoord(e,this)},symDifference:function(e){if(this.isEmpty()||e.isEmpty()){if(this.isEmpty()&&e.isEmpty())return Bi.createEmptyResult(Bi.SYMDIFFERENCE,this,e,this.factory);if(this.isEmpty())return e.copy();if(e.isEmpty())return this.copy()}return this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(e),zi.overlayOp(this,e,Bi.SYMDIFFERENCE)},createPointFromInternalCoord:function(e,t){return t.getPrecisionModel().makePrecise(e),t.getFactory().createPoint(e)},toText:function(){return(new Ue).write(this)},toString:function(){this.toText()},contains:function(e){return jo.contains(this,e)},difference:function(e){return this.isEmpty()?Bi.createEmptyResult(Bi.DIFFERENCE,this,e,this.factory):e.isEmpty()?this.copy():(this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(e),zi.overlayOp(this,e,Bi.DIFFERENCE))},isSimple:function(){return new Lr(this).isSimple()},isWithinDistance:function(e,t){return!(t<this.getEnvelopeInternal().distance(e.getEnvelopeInternal()))&&io.isWithinDistance(this,e,t)},distance:function(e){return io.distance(this,e)},isEquivalentClass:function(e){return this.getClass()===e.getClass()}});e.version="1.3.0 (6e65adb)",e.algorithm=Jn,e.densify=Qn,e.dissolve=Kn,e.geom=Yn,e.geomgraph=$n,e.index=ta,e.io=na,e.noding=aa,e.operation=ga,e.precision=fa,e.simplify=va,e.triangulate=ya,Object.defineProperty(e,"__esModule",{value:!0})},"object"==(void 0===i?"undefined":_typeof2(i))&&void 0!==t?o(i):o(r.jsts=r.jsts||{})},{}],44:[function(e,t,i){"use strict";function r(e,t,i){var r,o,n,a,s,l=e.length,u=d(e[0],t),c=[];for(i||(i=[]),r=1;r<l;r++){for(o=e[r-1],a=s=d(n=e[r],t);;){if(!(u|a)){c.push(o),a!==s?(c.push(n),r<l-1&&(i.push(c),c=[])):r===l-1&&c.push(n);break}if(u&a)break;u?u=d(o=h(o,n,u,t),t):a=d(n=h(o,n,a,t),t)}u=s}return c.length&&i.push(c),i}function h(e,t,i,r){return 8&i?[e[0]+(t[0]-e[0])*(r[3]-e[1])/(t[1]-e[1]),r[3]]:4&i?[e[0]+(t[0]-e[0])*(r[1]-e[1])/(t[1]-e[1]),r[1]]:2&i?[r[2],e[1]+(t[1]-e[1])*(r[2]-e[0])/(t[0]-e[0])]:1&i?[r[0],e[1]+(t[1]-e[1])*(r[0]-e[0])/(t[0]-e[0])]:null}function d(e,t){var i=0;return e[0]<t[0]?i|=1:e[0]>t[2]&&(i|=2),e[1]<t[1]?i|=4:e[1]>t[3]&&(i|=8),i}((t.exports=r).polyline=r).polygon=function(e,t){var i,r,o,n,a,s,l;for(r=1;r<=8;r*=2){for(i=[],o=e[e.length-1],n=!(d(o,t)&r),a=0;a<e.length;a++)s=e[a],(l=!(d(s,t)&r))!==n&&i.push(h(o,s,r,t)),l&&i.push(s),o=s,n=l;if(!(e=i).length)break}return i}},{}],45:[function(e,t,i){"use strict";t.exports=function(r){var e=r.length;if(e<3){for(var t=new Array(e),i=0;i<e;++i)t[i]=i;return 2===e&&r[0][0]===r[1][0]&&r[0][1]===r[1][1]?[0]:t}for(var o=new Array(e),i=0;i<e;++i)o[i]=i;o.sort(function(e,t){var i=r[e][0]-r[t][0];return i||r[e][1]-r[t][1]});for(var n=[o[0],o[1]],a=[o[0],o[1]],i=2;i<e;++i){for(var s=o[i],l=r[s],u=n.length;1<u&&m(r[n[u-2]],r[n[u-1]],l)<=0;)u-=1,n.pop();for(n.push(s),u=a.length;1<u&&0<=m(r[a[u-2]],r[a[u-1]],l);)u-=1,a.pop();a.push(s)}for(var t=new Array(a.length+n.length-2),c=0,i=0,h=n.length;i<h;++i)t[c++]=n[i];for(var d=a.length-2;0<d;--d)t[c++]=a[d];return t};var m=e("robust-orientation")[3]},{"robust-orientation":48}],46:[function(e,t,i){"use strict";function f(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function v(e,t){return e<t?-1:t<e?1:0}t.exports=function e(t,i,r,o,n){r=r||0;o=o||t.length-1;n=n||v;for(;r<o;){if(600<o-r){var a=o-r+1,s=i-r+1,l=Math.log(a),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1),h=Math.max(r,Math.floor(i-s*u/a+c)),d=Math.min(o,Math.floor(i+(a-s)*u/a+c));e(t,i,h,d,n)}var m=t[i],p=r,g=o;for(f(t,r,i),0<n(t[o],m)&&f(t,r,o);p<g;){for(f(t,p,g),p++,g--;n(t[p],m)<0;)p++;for(;0<n(t[g],m);)g--}0===n(t[r],m)?f(t,r,g):f(t,++g,o),g<=i&&(r=g+1),i<=g&&(o=g-1)}}},{}],47:[function(e,t,i){"use strict";t.exports=r;var s=e("quickselect");function r(e,t){if(!(this instanceof r))return new r(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&this._initFormat(t),this.clear()}function c(e,t,i){if(!i)return t.indexOf(e);for(var r=0;r<t.length;r++)if(i(e,t[r]))return r;return-1}function m(e,t){v(e,0,e.children.length,t,e)}function v(e,t,i,r,o){o||(o=g(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(var n,a=t;a<i;a++)n=e.children[a],h(o,e.leaf?r(n):n);return o}function h(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function n(e,t){return e.minX-t.minX}function a(e,t){return e.minY-t.minY}function _(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function d(e){return e.maxX-e.minX+(e.maxY-e.minY)}function p(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function u(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function g(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function f(e,t,i,r,o){for(var n,a=[t,i];a.length;)(i=a.pop())-(t=a.pop())<=r||(n=t+Math.ceil((i-t)/r/2)*r,s(e,n,t,i,o),a.push(t,n,n,i))}r.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],r=this.toBBox;if(!u(e,t))return i;for(var o,n,a,s,l=[];t;){for(o=0,n=t.children.length;o<n;o++)a=t.children[o],u(e,s=t.leaf?r(a):a)&&(t.leaf?i.push(a):p(e,s)?this._all(a,i):l.push(a));t=l.pop()}return i},collides:function(e){var t=this.data,i=this.toBBox;if(!u(e,t))return!1;for(var r,o,n,a,s=[];t;){for(r=0,o=t.children.length;r<o;r++)if(n=t.children[r],u(e,a=t.leaf?i(n):n)){if(t.leaf||p(e,a))return!0;s.push(n)}t=s.pop()}return!1},load:function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}var r=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var o=this.data;this.data=r,r=o}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=g([]),this},remove:function(e,t){if(!e)return this;for(var i,r,o,n,a=this.data,s=this.toBBox(e),l=[],u=[];a||l.length;){if(a||(a=l.pop(),r=l[l.length-1],i=u.pop(),n=!0),a.leaf&&-1!==(o=c(e,a.children,t)))return a.children.splice(o,1),l.push(a),this._condense(l),this;n||a.leaf||!p(a,s)?r?(i++,a=r.children[i],n=!1):a=null:(l.push(a),u.push(i),i=0,a=(r=a).children[0])}return this},toBBox:function(e){return e},compareMinX:n,compareMinY:a,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},_build:function(e,t,i,r){var o,n=i-t+1,a=this._maxEntries;if(n<=a)return m(o=g(e.slice(t,i+1)),this.toBBox),o;r||(r=Math.ceil(Math.log(n)/Math.log(a)),a=Math.ceil(n/Math.pow(a,r-1))),(o=g([])).leaf=!1,o.height=r;var s,l,u,c,h=Math.ceil(n/a),d=h*Math.ceil(Math.sqrt(a));for(f(e,t,i,d,this.compareMinX),s=t;s<=i;s+=d)for(f(e,s,u=Math.min(s+d-1,i),h,this.compareMinY),l=s;l<=u;l+=h)c=Math.min(l+h-1,u),o.children.push(this._build(e,l,c,r-1));return m(o,this.toBBox),o},_chooseSubtree:function(e,t,i,r){for(var o,n,a,s,l,u,c,h,d,m;r.push(t),!t.leaf&&r.length-1!==i;){for(c=h=1/0,o=0,n=t.children.length;o<n;o++)l=_(a=t.children[o]),d=e,m=a,(u=(Math.max(m.maxX,d.maxX)-Math.min(m.minX,d.minX))*(Math.max(m.maxY,d.maxY)-Math.min(m.minY,d.minY))-l)<h?(h=u,c=l<c?l:c,s=a):u===h&&l<c&&(c=l,s=a);t=s||t.children[0]}return t},_insert:function(e,t,i){var r=this.toBBox,o=i?e:r(e),n=[],a=this._chooseSubtree(o,this.data,t,n);for(a.children.push(e),h(a,o);0<=t&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(o,n,t)},_split:function(e,t){var i=e[t],r=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,r);var n=this._chooseSplitIndex(i,o,r),a=g(i.children.splice(n,i.children.length-n));a.height=i.height,a.leaf=i.leaf,m(i,this.toBBox),m(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(e,t){this.data=g([e,t]),this.data.height=e.height+1,this.data.leaf=!1,m(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var r,o,n,a,s,l,u,c,h,d,m,p,g,f;for(l=u=1/0,r=t;r<=i-t;r++)o=v(e,0,r,this.toBBox),n=v(e,r,i,this.toBBox),h=o,d=n,void 0,m=Math.max(h.minX,d.minX),p=Math.max(h.minY,d.minY),g=Math.min(h.maxX,d.maxX),f=Math.min(h.maxY,d.maxY),a=Math.max(0,g-m)*Math.max(0,f-p),s=_(o)+_(n),a<l?(l=a,c=r,u=s<u?s:u):a===l&&s<u&&(u=s,c=r);return c},_chooseSplitAxis:function(e,t,i){var r=e.leaf?this.compareMinX:n,o=e.leaf?this.compareMinY:a;this._allDistMargin(e,t,i,r)<this._allDistMargin(e,t,i,o)&&e.children.sort(r)},_allDistMargin:function(e,t,i,r){e.children.sort(r);var o,n,a=this.toBBox,s=v(e,0,t,a),l=v(e,i-t,i,a),u=d(s)+d(l);for(o=t;o<i-t;o++)n=e.children[o],h(s,e.leaf?a(n):n),u+=d(s);for(o=i-t-1;t<=o;o--)n=e.children[o],h(l,e.leaf?a(n):n),u+=d(l);return u},_adjustParentBBoxes:function(e,t,i){for(var r=i;0<=r;r--)h(t[r],e)},_condense:function(e){for(var t,i=e.length-1;0<=i;i--)0===e[i].children.length?0<i?(t=e[i-1].children).splice(t.indexOf(e[i]),1):this.clear():m(e[i],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}},{quickselect:46}],48:[function(e,n,t){"use strict";var c=e("two-product"),h=e("robust-sum"),d=e("robust-scale"),m=e("robust-subtract");function p(e,t){for(var i=new Array(e.length-1),r=1;r<e.length;++r)for(var o=i[r-1]=new Array(e.length-1),n=0,a=0;n<e.length;++n)n!==t&&(o[a++]=e[r][n]);return i}function g(e){if(1===e.length)return e[0];if(2===e.length)return["sum(",e[0],",",e[1],")"].join("");var t=e.length>>1;return["sum(",g(e.slice(0,t)),",",g(e.slice(t)),")"].join("")}function f(e){if(2===e.length)return[["sum(prod(",e[0][0],",",e[1][1],"),prod(-",e[0][1],",",e[1][0],"))"].join("")];for(var t=[],i=0;i<e.length;++i)t.push(["scale(",g(f(p(e,i))),",",(r=i,1&r?"-":""),e[0][i],")"].join(""));return t;var r}function a(e){for(var t=[],i=[],r=function(e){for(var t=new Array(e),i=0;i<e;++i){t[i]=new Array(e);for(var r=0;r<e;++r)t[i][r]=["m",r,"[",e-i-1,"]"].join("")}return t}(e),o=[],n=0;n<e;++n)0==(1&n)?t.push.apply(t,f(p(r,n))):i.push.apply(i,f(p(r,n))),o.push("m"+n);var a=g(t),s=g(i),l="orientation"+e+"Exact",u=["function ",l,"(",o.join(),"){var p=",a,",n=",s,",d=sub(p,n);return d[d.length-1];};return ",l].join("");return new Function("sum","prod","scale","sub",u)(h,c,d,m)}var l=a(3),w=a(4),s=[function(){return 0},function(){return 0},function(e,t){return t[0]-e[0]},function(e,t,i){var r,o=(e[1]-i[1])*(t[0]-i[0]),n=(e[0]-i[0])*(t[1]-i[1]),a=o-n;if(0<o){if(n<=0)return a;r=o+n}else{if(!(o<0))return a;if(0<=n)return a;r=-(o+n)}var s=33306690738754716e-32*r;return s<=a||a<=-s?a:l(e,t,i)},function(e,t,i,r){var o=e[0]-r[0],n=t[0]-r[0],a=i[0]-r[0],s=e[1]-r[1],l=t[1]-r[1],u=i[1]-r[1],c=e[2]-r[2],h=t[2]-r[2],d=i[2]-r[2],m=n*u,p=a*l,g=a*s,f=o*u,v=o*l,_=n*s,y=c*(m-p)+h*(g-f)+d*(v-_),C=7771561172376103e-31*((Math.abs(m)+Math.abs(p))*Math.abs(c)+(Math.abs(g)+Math.abs(f))*Math.abs(h)+(Math.abs(v)+Math.abs(_))*Math.abs(d));return C<y||C<-y?y:w(e,t,i,r)}];!function(){for(;s.length<=5;)s.push(a(s.length));for(var e=[],t=["slow"],i=0;i<=5;++i)e.push("a"+i),t.push("o"+i);var r=["function getOrientation(",e.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(i=2;i<=5;++i)r.push("case ",i,":return o",i,"(",e.slice(0,i).join(),");");r.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),t.push(r.join(""));var o=Function.apply(void 0,t);for(n.exports=o.apply(void 0,[function(e){var t=s[e.length];return t||(t=s[e.length]=a(e.length)),t.apply(void 0,e)}].concat(s)),i=0;i<=5;++i)n.exports[i]=s[i]}()},{"robust-scale":49,"robust-subtract":50,"robust-sum":51,"two-product":54}],49:[function(e,t,i){"use strict";var g=e("two-product"),f=e("two-sum");t.exports=function(e,t){var i=e.length;if(1===i){var r=g(e[0],t);return r[0]?r:[r[1]]}var o=new Array(2*i),n=[.1,.1],a=[.1,.1],s=0;g(e[0],t,n),n[0]&&(o[s++]=n[0]);for(var l=1;l<i;++l){g(e[l],t,a);var u=n[1];f(u,a[0],n),n[0]&&(o[s++]=n[0]);var c=a[1],h=n[1],d=c+h,m=d-c,p=h-m;n[1]=d,p&&(o[s++]=p)}n[1]&&(o[s++]=n[1]);0===s&&(o[s++]=0);return o.length=s,o}},{"two-product":54,"two-sum":55}],50:[function(e,t,i){"use strict";t.exports=function(e,t){var i=0|e.length,r=0|t.length;if(1===i&&1===r)return function(e,t){var i=e+t,r=i-e,o=e-(i-r)+(t-r);if(o)return[o,i];return[i]}(e[0],-t[0]);var o,n,a=new Array(i+r),s=0,l=0,u=0,c=Math.abs,h=e[l],d=c(h),m=-t[u],p=c(m);d<p?(n=h,(l+=1)<i&&(h=e[l],d=c(h))):(n=m,(u+=1)<r&&(m=-t[u],p=c(m)));l<i&&d<p||r<=u?(o=h,(l+=1)<i&&(h=e[l],d=c(h))):(o=m,(u+=1)<r&&(m=-t[u],p=c(m)));var g,f,v=o+n,_=v-o,y=n-_,C=y,w=v;for(;l<i&&u<r;)d<p?(o=h,(l+=1)<i&&(h=e[l],d=c(h))):(o=m,(u+=1)<r&&(m=-t[u],p=c(m))),(y=(n=C)-(_=(v=o+n)-o))&&(a[s++]=y),C=w-((g=w+v)-(f=g-w))+(v-f),w=g;for(;l<i;)(y=(n=C)-(_=(v=(o=h)+n)-o))&&(a[s++]=y),C=w-((g=w+v)-(f=g-w))+(v-f),w=g,(l+=1)<i&&(h=e[l]);for(;u<r;)(y=(n=C)-(_=(v=(o=m)+n)-o))&&(a[s++]=y),C=w-((g=w+v)-(f=g-w))+(v-f),w=g,(u+=1)<r&&(m=-t[u]);C&&(a[s++]=C);w&&(a[s++]=w);s||(a[s++]=0);return a.length=s,a}},{}],51:[function(e,t,i){"use strict";t.exports=function(e,t){var i=0|e.length,r=0|t.length;if(1===i&&1===r)return function(e,t){var i=e+t,r=i-e,o=e-(i-r)+(t-r);if(o)return[o,i];return[i]}(e[0],t[0]);var o,n,a=new Array(i+r),s=0,l=0,u=0,c=Math.abs,h=e[l],d=c(h),m=t[u],p=c(m);d<p?(n=h,(l+=1)<i&&(h=e[l],d=c(h))):(n=m,(u+=1)<r&&(m=t[u],p=c(m)));l<i&&d<p||r<=u?(o=h,(l+=1)<i&&(h=e[l],d=c(h))):(o=m,(u+=1)<r&&(m=t[u],p=c(m)));var g,f,v=o+n,_=v-o,y=n-_,C=y,w=v;for(;l<i&&u<r;)d<p?(o=h,(l+=1)<i&&(h=e[l],d=c(h))):(o=m,(u+=1)<r&&(m=t[u],p=c(m))),(y=(n=C)-(_=(v=o+n)-o))&&(a[s++]=y),C=w-((g=w+v)-(f=g-w))+(v-f),w=g;for(;l<i;)(y=(n=C)-(_=(v=(o=h)+n)-o))&&(a[s++]=y),C=w-((g=w+v)-(f=g-w))+(v-f),w=g,(l+=1)<i&&(h=e[l]);for(;u<r;)(y=(n=C)-(_=(v=(o=m)+n)-o))&&(a[s++]=y),C=w-((g=w+v)-(f=g-w))+(v-f),w=g,(u+=1)<r&&(m=t[u]);C&&(a[s++]=C);w&&(a[s++]=w);s||(a[s++]=0);return a.length=s,a}},{}],52:[function(e,t,i){"use strict";var p=e("bit-twiddle"),h=e("union-find");function g(e,t){var i=e.length,r=e.length-t.length,o=Math.min;if(r)return r;switch(i){case 0:return 0;case 1:return e[0]-t[0];case 2:return(s=e[0]+e[1]-t[0]-t[1])||o(e[0],e[1])-o(t[0],t[1]);case 3:var n=e[0]+e[1],a=t[0]+t[1];if(s=n+e[2]-(a+t[2]))return s;var s,l=o(e[0],e[1]),u=o(t[0],t[1]);return(s=o(l,e[2])-o(u,t[2]))||o(l+e[2],n)-o(u+t[2],a);default:var c=e.slice(0);c.sort();var h=t.slice(0);h.sort();for(var d=0;d<i;++d)if(r=c[d]-h[d])return r;return 0}}function n(e,t){return g(e[0],t[0])}function d(e,t){if(t){for(var i=e.length,r=new Array(i),o=0;o<i;++o)r[o]=[e[o],t[o]];r.sort(n);for(o=0;o<i;++o)e[o]=r[o][0],t[o]=r[o][1];return e}return e.sort(g),e}function m(e){if(0===e.length)return[];for(var t=1,i=e.length,r=1;r<i;++r){var o=e[r];if(g(o,e[r-1])){if(r===t){t++;continue}e[t++]=o}}return e.length=t,e}function f(e,t){for(var i=0,r=e.length-1,o=-1;i<=r;){var n=i+r>>1,a=g(e[n],t);a<=0?(0===a&&(o=n),i=n+1):0<a&&(r=n-1)}return o}function l(e,t){for(var i=new Array(e.length),r=0,o=i.length;r<o;++r)i[r]=[];for(var n=[],a=(r=0,t.length);r<a;++r)for(var s=t[r],l=s.length,u=1,c=1<<l;u<c;++u){n.length=p.popCount(u);for(var h=0,d=0;d<l;++d)u&1<<d&&(n[h++]=s[d]);var m=f(e,n);if(!(m<0))for(;i[m++].push(r),!(m>=e.length||0!==g(e[m],n)););}return i}function v(e,t){if(t<0)return[];for(var i=[],r=(1<<t+1)-1,o=0;o<e.length;++o)for(var n=e[o],a=r;a<1<<n.length;a=p.nextCombination(a)){for(var s=new Array(t+1),l=0,u=0;u<n.length;++u)a&1<<u&&(s[l++]=n[u]);i.push(s)}return d(i)}i.dimension=function(e){for(var t=0,i=Math.max,r=0,o=e.length;r<o;++r)t=i(t,e[r].length);return t-1},i.countVertices=function(e){for(var t=-1,i=Math.max,r=0,o=e.length;r<o;++r)for(var n=e[r],a=0,s=n.length;a<s;++a)t=i(t,n[a]);return t+1},i.cloneCells=function(e){for(var t=new Array(e.length),i=0,r=e.length;i<r;++i)t[i]=e[i].slice(0);return t},i.compareCells=g,i.normalize=d,i.unique=m,i.findCell=f,i.incidence=l,i.dual=function(e,t){if(!t)return l(m(v(e,0)),e);for(var i=new Array(t),r=0;r<t;++r)i[r]=[];r=0;for(var o=e.length;r<o;++r)for(var n=e[r],a=0,s=n.length;a<s;++a)i[n[a]].push(r);return i},i.explode=function(e){for(var t=[],i=0,r=e.length;i<r;++i)for(var o=e[i],n=0|o.length,a=1,s=1<<n;a<s;++a){for(var l=[],u=0;u<n;++u)a>>>u&1&&l.push(o[u]);t.push(l)}return d(t)},i.skeleton=v,i.boundary=function(e){for(var t=[],i=0,r=e.length;i<r;++i)for(var o=e[i],n=0,a=o.length;n<a;++n){for(var s=new Array(o.length-1),l=0,u=0;l<a;++l)l!==n&&(s[u++]=o[l]);t.push(s)}return d(t)},i.connectedComponents=function(e,t){return t?function(e,t){for(var i=new h(t),r=0;r<e.length;++r)for(var o=e[r],n=0;n<o.length;++n)for(var a=n+1;a<o.length;++a)i.link(o[n],o[a]);var s=[],l=i.ranks;for(r=0;r<l.length;++r)l[r]=-1;for(r=0;r<e.length;++r){var u=i.find(e[r][0]);l[u]<0?(l[u]=s.length,s.push([e[r].slice(0)])):s[l[u]].push(e[r].slice(0))}return s}(e,t):function(e){for(var t=m(d(v(e,0))),i=new h(t.length),r=0;r<e.length;++r)for(var o=e[r],n=0;n<o.length;++n)for(var a=f(t,[o[n]]),s=n+1;s<o.length;++s)i.link(a,f(t,[o[s]]));var l=[],u=i.ranks;for(r=0;r<u.length;++r)u[r]=-1;for(r=0;r<e.length;++r){var c=i.find(f(t,[e[r][0]]));u[c]<0?(u[c]=l.length,l.push([e[r].slice(0)])):l[u[c]].push(e[r].slice(0))}return l}(e)}},{"bit-twiddle":36,"union-find":56}],53:[function(e,t,i){!function(){"use strict";function d(e,t,i){var r=t.x,o=t.y,n=i.x-r,a=i.y-o;if(0!==n||0!==a){var s=((e.x-r)*n+(e.y-o)*a)/(n*n+a*a);1<s?(r=i.x,o=i.y):0<s&&(r+=n*s,o+=a*s)}return(n=e.x-r)*n+(a=e.y-o)*a}function e(e,t,i){var r=void 0!==t?t*t:1;return e=function(e,t){var i,r,o,n,a=e.length,s=new("undefined"!=typeof Uint8Array?Uint8Array:Array)(a),l=0,u=a-1,c=[],h=[];for(s[l]=s[u]=1;u;){for(r=0,i=l+1;i<u;i++)r<(o=d(e[i],e[l],e[u]))&&(n=i,r=o);t<r&&(s[n]=1,c.push(l,n,n,u)),u=c.pop(),l=c.pop()}for(i=0;i<a;i++)s[i]&&h.push(e[i]);return h}(e=i?e:function(e,t){for(var i,r,o,n,a,s=e[0],l=[s],u=1,c=e.length;u<c;u++)i=e[u],o=s,n=(r=i).x-o.x,a=r.y-o.y,t<n*n+a*a&&(l.push(i),s=i);return s!==i&&l.push(i),l}(e,r),r)}void 0!==t?t.exports=e:"undefined"!=typeof self?self.simplify=e:window.simplify=e}()},{}],54:[function(e,t,i){"use strict";t.exports=function(e,t,i){var r=e*t,o=h*e,n=o-(o-e),a=e-n,s=h*t,l=s-(s-t),u=t-l,c=a*u-(r-n*l-a*l-n*u);if(i)return i[0]=c,i[1]=r,i;return[c,r]};var h=+(Math.pow(2,27)+1)},{}],55:[function(e,t,i){"use strict";t.exports=function(e,t,i){var r=e+t,o=r-e,n=t-o,a=e-(r-o);if(i)return i[0]=a+n,i[1]=r,i;return[a+n,r]}},{}],56:[function(e,t,i){"use strict";function r(e){this.roots=new Array(e),this.ranks=new Array(e);for(var t=0;t<e;++t)this.roots[t]=t,this.ranks[t]=0}var o=(t.exports=r).prototype;Object.defineProperty(o,"length",{get:function(){return this.roots.length}}),o.makeSet=function(){var e=this.roots.length;return this.roots.push(e),this.ranks.push(0),e},o.find=function(e){for(var t=e,i=this.roots;i[e]!==e;)e=i[e];for(;i[t]!==e;){var r=i[t];i[t]=e,t=r}return e},o.link=function(e,t){var i=this.find(e),r=this.find(t);if(i!==r){var o=this.ranks,n=this.roots,a=o[i],s=o[r];a<s?n[i]=r:s<a?n[r]=i:++o[n[r]=i]}}},{}]},{},[1])(1)}),function(e){if("object"===("undefined"==typeof exports?"undefined":_typeof2(exports))&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define("SGWorld/Const/turf-plugin",[],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).turf=e()}}(function(){var o,n;return function n(a,s,l){function u(i,e){if(!s[i]){if(!a[i]){var t="function"==typeof require&&require;if(!e&&t)return t(i,!0);if(c)return c(i,!0);var r=new Error("Cannot find module '"+i+"'");throw r.code="MODULE_NOT_FOUND",r}var o=s[i]={exports:{}};a[i][0].call(o.exports,function(e){var t=a[i][1][e];return u(t||e)},o,o.exports,n,a,s,l)}return s[i].exports}for(var c="function"==typeof require&&require,e=0;e<l.length;e++)u(l[e]);return u}({1:[function(e,t,i){t.exports={lineIntersect:e("@turf/line-intersect"),bboxClip:e("@turf/bbox-clip"),polygonToLineString:e("@turf/polygon-to-linestring"),meta:o,invariant:n}},{"@turf/bbox-clip":2,"@turf/line-intersect":7,"@turf/polygon-to-linestring":17}],2:[function(e,t,i){var r=e("@turf/helpers"),s=e("lineclip");n=e("@turf/invariant");var l=e("@turf/invariant").getCoords,u=r.lineString,c=r.multiLineString,h=r.polygon,d=r.multiPolygon;function m(e,t){for(var i=[],r=0;r<e.length;r++){var o=s.polygon(e[r],t);0<o.length&&(o[0][0]===o[o.length-1][0]&&o[0][1]===o[o.length-1][1]||o.push(o[0]),i.push(o))}return i}t.exports=function(e,t){var i,r=(i=e).geometry?i.geometry.type:i.type,o=l(e),n=e.properties;switch(r){case"LineString":case"MultiLineString":var a=[];return"LineString"===r&&(o=[o]),o.forEach(function(e){s(e,t,a)}),1===a.length?u(a[0],n):c(a,n);case"Polygon":return h(m(o,t),n);case"MultiPolygon":return d(o.map(function(e){return m(e,t)}),n);default:throw new Error("geometry "+r+" not supported")}}},{"@turf/helpers":3,"@turf/invariant":4,lineclip:21}],3:[function(e,t,i){function n(e,t){if(!e)throw new Error("No geometry passed");return{type:"Feature",properties:t||{},geometry:e}}var r={miles:3960,nauticalmiles:3441.145,degrees:57.2957795,radians:1,inches:250905600,yards:6969600,meters:6373e3,metres:6373e3,kilometers:6373,kilometres:6373,feet:20908792.65};t.exports={feature:n,featureCollection:function(e){if(!e)throw new Error("No features passed");return{type:"FeatureCollection",features:e}},geometryCollection:function(e,t){if(!e)throw new Error("No geometries passed");return n({type:"GeometryCollection",geometries:e},t)},point:function(e,t){if(!e)throw new Error("No coordinates passed");if(void 0===e.length)throw new Error("Coordinates must be an array");if(e.length<2)throw new Error("Coordinates must be at least 2 numbers long");if("number"!=typeof e[0]||"number"!=typeof e[1])throw new Error("Coordinates must numbers");return n({type:"Point",coordinates:e},t)},multiPoint:function(e,t){if(!e)throw new Error("No coordinates passed");return n({type:"MultiPoint",coordinates:e},t)},lineString:function(e,t){if(!e)throw new Error("No coordinates passed");return n({type:"LineString",coordinates:e},t)},multiLineString:function(e,t){if(!e)throw new Error("No coordinates passed");return n({type:"MultiLineString",coordinates:e},t)},polygon:function(e,t){if(!e)throw new Error("No coordinates passed");for(var i=0;i<e.length;i++){var r=e[i];if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<r[r.length-1].length;o++)if(r[r.length-1][o]!==r[0][o])throw new Error("First and last Position are not equivalent.")}return n({type:"Polygon",coordinates:e},t)},multiPolygon:function(e,t){if(!e)throw new Error("No coordinates passed");return n({type:"MultiPolygon",coordinates:e},t)},radiansToDistance:function(e,t){var i=r[t||"kilometers"];if(void 0===i)throw new Error("Invalid unit");return e*i},distanceToRadians:function(e,t){var i=r[t||"kilometers"];if(void 0===i)throw new Error("Invalid unit");return e/i},distanceToDegrees:function(e,t){var i=r[t||"kilometers"];if(void 0===i)throw new Error("Invalid unit");return e/i*57.2958}}},{}],4:[function(e,t,i){function r(e){if(!e)throw new Error("No obj passed");var t;if(e.length?t=e:e.coordinates?t=e.coordinates:e.geometry&&e.geometry.coordinates&&(t=e.geometry.coordinates),t)return o(t),t;throw new Error("No valid coordinates")}function o(e){if(1<e.length&&"number"==typeof e[0]&&"number"==typeof e[1])return!0;if(Array.isArray(e[0])&&e[0].length)return o(e[0]);throw new Error("coordinates must only contain numbers")}t.exports={geojsonType:function(e,t,i){if(!t||!i)throw new Error("type and name required");if(!e||e.type!==t)throw new Error("Invalid input to "+i+": must be a "+t+", given "+e.type)},collectionOf:function(e,t,i){if(!e)throw new Error("No featureCollection passed");if(!i)throw new Error(".collectionOf() requires a name");if(!e||"FeatureCollection"!==e.type)throw new Error("Invalid input to "+i+", FeatureCollection required");for(var r=0;r<e.features.length;r++){var o=e.features[r];if(!o||"Feature"!==o.type||!o.geometry)throw new Error("Invalid input to "+i+", Feature with geometry required");if(!o.geometry||o.geometry.type!==t)throw new Error("Invalid input to "+i+": must be a "+t+", given "+o.geometry.type)}},featureOf:function(e,t,i){if(!e)throw new Error("No feature passed");if(!i)throw new Error(".featureOf() requires a name");if(!e||"Feature"!==e.type||!e.geometry)throw new Error("Invalid input to "+i+", Feature with geometry required");if(!e.geometry||e.geometry.type!==t)throw new Error("Invalid input to "+i+": must be a "+t+", given "+e.geometry.type)},getCoord:function(e){if(!e)throw new Error("No obj passed");var t=r(e);if(1<t.length&&"number"==typeof t[0]&&"number"==typeof t[1])return t;throw new Error("Coordinate is not a valid Point")},getCoords:r,containsNumber:o}},{}],5:[function(e,t,i){o=e("@turf/meta");var r=e("@turf/meta").coordEach;t.exports=function(e){var t=[1/0,1/0,-1/0,-1/0];return r(e,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}},{"@turf/meta":16}],6:[function(e,t,i){function n(e,t){if(!e)throw new Error("No geometry passed");return{type:"Feature",properties:t||{},geometry:e}}t.exports.feature=n,t.exports.point=function(e,t){if(!e)throw new Error("No coordinates passed");if(void 0===e.length)throw new Error("Coordinates must be an array");if(e.length<2)throw new Error("Coordinates must be at least 2 numbers long");if("number"!=typeof e[0]||"number"!=typeof e[1])throw new Error("Coordinates must numbers");return n({type:"Point",coordinates:e},t)},t.exports.polygon=function(e,t){if(!e)throw new Error("No coordinates passed");for(var i=0;i<e.length;i++){var r=e[i];if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<r[r.length-1].length;o++)if(r[r.length-1][o]!==r[0][o])throw new Error("First and last Position are not equivalent.")}return n({type:"Polygon",coordinates:e},t)},t.exports.lineString=function(e,t){if(!e)throw new Error("No coordinates passed");return n({type:"LineString",coordinates:e},t)},t.exports.featureCollection=function(e){if(!e)throw new Error("No features passed");return{type:"FeatureCollection",features:e}},t.exports.multiLineString=function(e,t){if(!e)throw new Error("No coordinates passed");return n({type:"MultiLineString",coordinates:e},t)},t.exports.multiPoint=function(e,t){if(!e)throw new Error("No coordinates passed");return n({type:"MultiPoint",coordinates:e},t)},t.exports.multiPolygon=function(e,t){if(!e)throw new Error("No coordinates passed");return n({type:"MultiPolygon",coordinates:e},t)},t.exports.geometryCollection=function(e,t){if(!e)throw new Error("No geometries passed");return n({type:"GeometryCollection",geometries:e},t)};var r={miles:3960,nauticalmiles:3441.145,degrees:57.2957795,radians:1,inches:250905600,yards:6969600,meters:6373e3,metres:6373e3,kilometers:6373,kilometres:6373,feet:20908792.65};t.exports.radiansToDistance=function(e,t){var i=r[t||"kilometers"];if(void 0===i)throw new Error("Invalid unit");return e*i},t.exports.distanceToRadians=function(e,t){var i=r[t||"kilometers"];if(void 0===i)throw new Error("Invalid unit");return e/i},t.exports.distanceToDegrees=function(e,t){var i=r[t||"kilometers"];if(void 0===i)throw new Error("Invalid unit");return e/i*57.2958}},{}],7:[function(e,t,i){var r=e("@turf/helpers"),o=e("@turf/meta"),n=e("@turf/line-segment"),v=e("@turf/invariant").getCoords,a=e("geojson-rbush"),_=r.point,s=r.featureCollection,l=o.featureEach;function u(e,t){var i=v(e),r=v(t);if(2!==i.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==r.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=i[0][0],n=i[0][1],a=i[1][0],s=i[1][1],l=r[0][0],u=r[0][1],c=r[1][0],h=r[1][1],d=(h-u)*(a-o)-(c-l)*(s-n),m=(c-l)*(n-u)-(h-u)*(o-l),p=(a-o)*(n-u)-(s-n)*(o-l);if(0===d)return null;var g=m/d,f=p/d;return 0<=g&&g<=1&&0<=f&&f<=1?_([o+g*(a-o),n+g*(s-n)]):null}t.exports=function(e,t){var r=[];if("LineString"===e.geometry.type&&"LineString"===t.geometry.type&&2===e.geometry.coordinates.length&&2===t.geometry.coordinates.length){var i=u(e,t);return i&&r.push(i),s(r)}var o=a();return o.load(n(t)),l(n(e),function(i){l(o.search(i),function(e){var t=u(i,e);t&&r.push(t)})}),s(r)}},{"@turf/helpers":8,"@turf/invariant":9,"@turf/line-segment":11,"@turf/meta":10,"geojson-rbush":20}],8:[function(e,t,i){arguments[4][3][0].apply(i,arguments)},{dup:3}],9:[function(e,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],10:[function(e,t,i){function _(e,t,i){var r,o,n,a,s,l,u,c,h,d,m=0,p=0,g="FeatureCollection"===e.type,f="Feature"===e.type,v=g?e.features.length:1;for(r=0;r<v;r++)for(u=(d="GeometryCollection"===(h=g?e.features[r].geometry:f?e.geometry:e).type)?h.geometries.length:1,a=0;a<u;a++)if(c=(l=d?h.geometries[a]:h).coordinates,m=!i||"Polygon"!==l.type&&"MultiPolygon"!==l.type?0:1,"Point"===l.type)t(c,p),p++;else if("LineString"===l.type||"MultiPoint"===l.type)for(o=0;o<c.length;o++)t(c[o],p),p++;else if("Polygon"===l.type||"MultiLineString"===l.type)for(o=0;o<c.length;o++)for(n=0;n<c[o].length-m;n++)t(c[o][n],p),p++;else if("MultiPolygon"===l.type)for(o=0;o<c.length;o++)for(n=0;n<c[o].length;n++)for(s=0;s<c[o][n].length-m;s++)t(c[o][n][s],p),p++;else{if("GeometryCollection"!==l.type)throw new Error("Unknown Geometry Type");for(o=0;o<l.geometries.length;o++)_(l.geometries[o],t,i)}}function n(e,t){var i;switch(e.type){case"FeatureCollection":for(i=0;i<e.features.length;i++)t(e.features[i].properties,i);break;case"Feature":t(e.properties,0)}}function a(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var i=0;i<e.features.length;i++)t(e.features[i],i)}function s(e,t){var i,r,o,n,a,s,l,u=0,c="FeatureCollection"===e.type,h="Feature"===e.type,d=c?e.features.length:1;for(i=0;i<d;i++)for(a=(l="GeometryCollection"===(s=c?e.features[i].geometry:h?e.geometry:e).type)?s.geometries.length:1,o=0;o<a;o++)if("Point"===(n=l?s.geometries[o]:s).type||"LineString"===n.type||"MultiPoint"===n.type||"Polygon"===n.type||"MultiLineString"===n.type||"MultiPolygon"===n.type)t(n,u),u++;else{if("GeometryCollection"!==n.type)throw new Error("Unknown Geometry Type");for(r=0;r<n.geometries.length;r++)t(n.geometries[r],u),u++}}t.exports={coordEach:_,coordReduce:function(e,i,r,t){var o=r;return _(e,function(e,t){o=0===t&&void 0===r?e:i(o,e,t)},t),o},propEach:n,propReduce:function(e,i,r){var o=r;return n(e,function(e,t){o=0===t&&void 0===r?e:i(o,e,t)}),o},featureEach:a,featureReduce:function(e,i,r){var o=r;return a(e,function(e,t){o=0===t&&void 0===r?e:i(o,e,t)}),o},coordAll:function(e){var t=[];return _(e,function(e){t.push(e)}),t},geomEach:s,geomReduce:function(e,i,r){var o=r;return s(e,function(e,t){o=0===t&&void 0===r?e:i(o,e,t)}),o}}},{}],11:[function(e,t,i){var n=e("@turf/flatten"),a=e("@turf/meta").featureEach,h=e("@turf/helpers").lineString,s=e("@turf/helpers").featureCollection,l=e("@turf/invariant").getCoords;t.exports=function(e){var r=[],o=0;return a(e,function(e){a(n(e),function(i){var e=[];switch(i.geometry?i.geometry.type:i.type){case"Polygon":e=l(i);break;case"LineString":e=[l(i)]}e.forEach(function(e){var t,u,c;(t=e,u=i.properties,c=[],t.reduce(function(e,t){var i,r,o,n,a,s,l=h([e,t],u);return l.bbox=(r=t,o=(i=e)[0],n=i[1],a=r[0],s=r[1],[o<a?o:a,n<s?n:s,a<o?o:a,s<n?n:s]),c.push(l),t}),c).forEach(function(e){e.id=o,r.push(e),o++})})})}),s(r)}},{"@turf/flatten":12,"@turf/helpers":13,"@turf/invariant":14,"@turf/meta":15}],12:[function(e,t,i){var u=e("@turf/meta").featureEach,c=e("@turf/meta").geomEach,h=e("@turf/invariant").getCoords,r=e("@turf/helpers"),d=r.point,m=r.lineString,p=r.polygon,g=r.featureCollection;function f(e){var i,t,r,o,n,a,s,l;switch(e.geometry?e.geometry.type:e.type){case"MultiPoint":return l=[],h(s=e).forEach(function(e){l.push(d(e,s.properties))}),g(l);case"MultiPolygon":return a=[],h(n=e).forEach(function(e){a.push(p(e,n.properties))}),g(a);case"MultiLineString":return o=[],h(r=e).forEach(function(e){o.push(m(e,r.properties))}),g(o);case"FeatureCollection":return t=[],u(e,function(e){switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":u(f(e),function(e){t.push(e)});break;default:t.push(e)}}),g(t);case"GeometryCollection":return i=[],c(e,function(e){switch(e.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":u(f(e),function(e){i.push(e)});break;default:var t={type:"Feature",properties:{},geometry:e};i.push(t)}}),g(i);case"Point":case"LineString":case"Polygon":return g([e])}}t.exports=f},{"@turf/helpers":13,"@turf/invariant":14,"@turf/meta":15}],13:[function(e,t,i){arguments[4][3][0].apply(i,arguments)},{dup:3}],14:[function(e,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],15:[function(e,t,i){arguments[4][10][0].apply(i,arguments)},{dup:10}],16:[function(e,t,i){function _(e,t,i){var r,o,n,a,s,l,u,c,h,d,m=0,p=0,g="FeatureCollection"===e.type,f="Feature"===e.type,v=g?e.features.length:1;for(r=0;r<v;r++)for(u=(d="GeometryCollection"===(h=g?e.features[r].geometry:f?e.geometry:e).type)?h.geometries.length:1,a=0;a<u;a++)if(c=(l=d?h.geometries[a]:h).coordinates,m=!i||"Polygon"!==l.type&&"MultiPolygon"!==l.type?0:1,"Point"===l.type)t(c,p),p++;else if("LineString"===l.type||"MultiPoint"===l.type)for(o=0;o<c.length;o++)t(c[o],p),p++;else if("Polygon"===l.type||"MultiLineString"===l.type)for(o=0;o<c.length;o++)for(n=0;n<c[o].length-m;n++)t(c[o][n],p),p++;else if("MultiPolygon"===l.type)for(o=0;o<c.length;o++)for(n=0;n<c[o].length;n++)for(s=0;s<c[o][n].length-m;s++)t(c[o][n][s],p),p++;else{if("GeometryCollection"!==l.type)throw new Error("Unknown Geometry Type");for(o=0;o<l.geometries.length;o++)_(l.geometries[o],t,i)}}function n(e,t){var i;switch(e.type){case"FeatureCollection":for(i=0;i<e.features.length;i++)t(e.features[i].properties,i);break;case"Feature":t(e.properties,0)}}function a(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var i=0;i<e.features.length;i++)t(e.features[i],i)}function s(e,t){var i,r,o,n,a,s,l,u=0,c="FeatureCollection"===e.type,h="Feature"===e.type,d=c?e.features.length:1;for(i=0;i<d;i++)for(a=(l="GeometryCollection"===(s=c?e.features[i].geometry:h?e.geometry:e).type)?s.geometries.length:1,o=0;o<a;o++)if("Point"===(n=l?s.geometries[o]:s).type||"LineString"===n.type||"MultiPoint"===n.type||"Polygon"===n.type||"MultiLineString"===n.type||"MultiPolygon"===n.type)t(n,u),u++;else{if("GeometryCollection"!==n.type)throw new Error("Unknown Geometry Type");for(r=0;r<n.geometries.length;r++)t(n.geometries[r],u),u++}}t.exports.coordEach=_,t.exports.coordReduce=function(e,i,r,t){var o=r;return _(e,function(e,t){o=0===t&&void 0===r?e:i(o,e,t)},t),o},t.exports.propEach=n,t.exports.propReduce=function(e,i,r){var o=r;return n(e,function(e,t){o=0===t&&void 0===r?e:i(o,e,t)}),o},t.exports.featureEach=a,t.exports.featureReduce=function(e,i,r){var o=r;return a(e,function(e,t){o=0===t&&void 0===r?e:i(o,e,t)}),o},t.exports.coordAll=function(e){var t=[];return _(e,function(e){t.push(e)}),t},t.exports.geomEach=s,t.exports.geomReduce=function(e,i,r){var o=r;return s(e,function(e,t){o=0===t&&void 0===r?e:i(o,e,t)}),o}},{}],17:[function(e,t,i){var a=e("@turf/invariant").getCoords,r=e("@turf/helpers"),o=r.lineString,n=r.multiLineString,s=r.featureCollection;function l(e,t){return 1<e.length?n(e,t):o(e[0],t)}t.exports=function(e){var t,i=(t=e).geometry?t.geometry.type:t.type,r=a(e),o=e.properties;if(!r.length)throw new Error("polygon must contain coordinates");switch(i){case"Polygon":return s([l(r,o)]);case"MultiPolygon":var n=[];return r.forEach(function(e){n.push(l(e,o))}),s(n);default:throw new Error("geom "+i+" not supported")}}},{"@turf/helpers":18,"@turf/invariant":19}],18:[function(e,t,i){arguments[4][3][0].apply(i,arguments)},{dup:3}],19:[function(e,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],20:[function(e,t,i){var r=e("@turf/bbox"),o=e("@turf/helpers").featureCollection,n=e("@turf/meta").featureEach,a=e("rbush");t.exports=function(e){var t=a(e);return t.insert=function(e){return e.bbox=e.bbox?e.bbox:r(e),a.prototype.insert.call(this,e)},t.load=function(e){var t=[];return n(e,function(e){e.bbox=e.bbox?e.bbox:r(e),t.push(e)}),a.prototype.load.call(this,t)},t.remove=function(e){return a.prototype.remove.call(this,e)},t.clear=function(){return a.prototype.clear.call(this)},t.search=function(e){var t=a.prototype.search.call(this,this.toBBox(e));return o(t)},t.collides=function(e){return a.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=a.prototype.all.call(this);return o(e)},t.toJSON=function(){return a.prototype.toJSON.call(this)},t.fromJSON=function(e){return a.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var t=e.bbox?e.bbox:r(e);return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},t}},{"@turf/bbox":5,"@turf/helpers":6,"@turf/meta":16,rbush:23}],21:[function(e,t,i){"use strict";function r(e,t,i){var r,o,n,a,s,l=e.length,u=d(e[0],t),c=[];for(i||(i=[]),r=1;r<l;r++){for(o=e[r-1],a=s=d(n=e[r],t);;){if(!(u|a)){c.push(o),a!==s?(c.push(n),r<l-1&&(i.push(c),c=[])):r===l-1&&c.push(n);break}if(u&a)break;u?u=d(o=h(o,n,u,t),t):a=d(n=h(o,n,a,t),t)}u=s}return c.length&&i.push(c),i}function h(e,t,i,r){return 8&i?[e[0]+(t[0]-e[0])*(r[3]-e[1])/(t[1]-e[1]),r[3]]:4&i?[e[0]+(t[0]-e[0])*(r[1]-e[1])/(t[1]-e[1]),r[1]]:2&i?[r[2],e[1]+(t[1]-e[1])*(r[2]-e[0])/(t[0]-e[0])]:1&i?[r[0],e[1]+(t[1]-e[1])*(r[0]-e[0])/(t[0]-e[0])]:null}function d(e,t){var i=0;return e[0]<t[0]?i|=1:e[0]>t[2]&&(i|=2),e[1]<t[1]?i|=4:e[1]>t[3]&&(i|=8),i}((t.exports=r).polyline=r).polygon=function(e,t){var i,r,o,n,a,s,l;for(r=1;r<=8;r*=2){for(i=[],o=e[e.length-1],n=!(d(o,t)&r),a=0;a<e.length;a++)s=e[a],(l=!(d(s,t)&r))!==n&&i.push(h(o,s,r,t)),l&&i.push(s),o=s,n=l;if(!(e=i).length)break}return i}},{}],22:[function(e,t,i){"use strict";function f(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function v(e,t){return e<t?-1:t<e?1:0}t.exports=function e(t,i,r,o,n){r=r||0;o=o||t.length-1;n=n||v;for(;r<o;){if(600<o-r){var a=o-r+1,s=i-r+1,l=Math.log(a),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1),h=Math.max(r,Math.floor(i-s*u/a+c)),d=Math.min(o,Math.floor(i+(a-s)*u/a+c));e(t,i,h,d,n)}var m=t[i],p=r,g=o;for(f(t,r,i),0<n(t[o],m)&&f(t,r,o);p<g;){for(f(t,p,g),p++,g--;n(t[p],m)<0;)p++;for(;0<n(t[g],m);)g--}0===n(t[r],m)?f(t,r,g):f(t,++g,o),g<=i&&(r=g+1),i<=g&&(o=g-1)}}},{}],23:[function(e,t,i){"use strict";t.exports=r;var s=e("quickselect");function r(e,t){if(!(this instanceof r))return new r(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&this._initFormat(t),this.clear()}function c(e,t,i){if(!i)return t.indexOf(e);for(var r=0;r<t.length;r++)if(i(e,t[r]))return r;return-1}function m(e,t){v(e,0,e.children.length,t,e)}function v(e,t,i,r,o){o||(o=g(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(var n,a=t;a<i;a++)n=e.children[a],h(o,e.leaf?r(n):n);return o}function h(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function n(e,t){return e.minX-t.minX}function a(e,t){return e.minY-t.minY}function _(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function d(e){return e.maxX-e.minX+(e.maxY-e.minY)}function p(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function u(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function g(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function f(e,t,i,r,o){for(var n,a=[t,i];a.length;)(i=a.pop())-(t=a.pop())<=r||(n=t+Math.ceil((i-t)/r/2)*r,s(e,n,t,i,o),a.push(t,n,n,i))}r.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],r=this.toBBox;if(!u(e,t))return i;for(var o,n,a,s,l=[];t;){for(o=0,n=t.children.length;o<n;o++)a=t.children[o],u(e,s=t.leaf?r(a):a)&&(t.leaf?i.push(a):p(e,s)?this._all(a,i):l.push(a));t=l.pop()}return i},collides:function(e){var t=this.data,i=this.toBBox;if(!u(e,t))return!1;for(var r,o,n,a,s=[];t;){for(r=0,o=t.children.length;r<o;r++)if(n=t.children[r],u(e,a=t.leaf?i(n):n)){if(t.leaf||p(e,a))return!0;s.push(n)}t=s.pop()}return!1},load:function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}var r=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var o=this.data;this.data=r,r=o}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=g([]),this},remove:function(e,t){if(!e)return this;for(var i,r,o,n,a=this.data,s=this.toBBox(e),l=[],u=[];a||l.length;){if(a||(a=l.pop(),r=l[l.length-1],i=u.pop(),n=!0),a.leaf&&-1!==(o=c(e,a.children,t)))return a.children.splice(o,1),l.push(a),this._condense(l),this;n||a.leaf||!p(a,s)?r?(i++,a=r.children[i],n=!1):a=null:(l.push(a),u.push(i),i=0,a=(r=a).children[0])}return this},toBBox:function(e){return e},compareMinX:n,compareMinY:a,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},_build:function(e,t,i,r){var o,n=i-t+1,a=this._maxEntries;if(n<=a)return m(o=g(e.slice(t,i+1)),this.toBBox),o;r||(r=Math.ceil(Math.log(n)/Math.log(a)),a=Math.ceil(n/Math.pow(a,r-1))),(o=g([])).leaf=!1,o.height=r;var s,l,u,c,h=Math.ceil(n/a),d=h*Math.ceil(Math.sqrt(a));for(f(e,t,i,d,this.compareMinX),s=t;s<=i;s+=d)for(f(e,s,u=Math.min(s+d-1,i),h,this.compareMinY),l=s;l<=u;l+=h)c=Math.min(l+h-1,u),o.children.push(this._build(e,l,c,r-1));return m(o,this.toBBox),o},_chooseSubtree:function(e,t,i,r){for(var o,n,a,s,l,u,c,h,d,m;r.push(t),!t.leaf&&r.length-1!==i;){for(c=h=1/0,o=0,n=t.children.length;o<n;o++)l=_(a=t.children[o]),d=e,m=a,(u=(Math.max(m.maxX,d.maxX)-Math.min(m.minX,d.minX))*(Math.max(m.maxY,d.maxY)-Math.min(m.minY,d.minY))-l)<h?(h=u,c=l<c?l:c,s=a):u===h&&l<c&&(c=l,s=a);t=s||t.children[0]}return t},_insert:function(e,t,i){var r=this.toBBox,o=i?e:r(e),n=[],a=this._chooseSubtree(o,this.data,t,n);for(a.children.push(e),h(a,o);0<=t&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(o,n,t)},_split:function(e,t){var i=e[t],r=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,r);var n=this._chooseSplitIndex(i,o,r),a=g(i.children.splice(n,i.children.length-n));a.height=i.height,a.leaf=i.leaf,m(i,this.toBBox),m(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(e,t){this.data=g([e,t]),this.data.height=e.height+1,this.data.leaf=!1,m(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var r,o,n,a,s,l,u,c,h,d,m,p,g,f;for(l=u=1/0,r=t;r<=i-t;r++)o=v(e,0,r,this.toBBox),n=v(e,r,i,this.toBBox),h=o,d=n,void 0,m=Math.max(h.minX,d.minX),p=Math.max(h.minY,d.minY),g=Math.min(h.maxX,d.maxX),f=Math.min(h.maxY,d.maxY),a=Math.max(0,g-m)*Math.max(0,f-p),s=_(o)+_(n),a<l?(l=a,c=r,u=s<u?s:u):a===l&&s<u&&(u=s,c=r);return c},_chooseSplitAxis:function(e,t,i){var r=e.leaf?this.compareMinX:n,o=e.leaf?this.compareMinY:a;this._allDistMargin(e,t,i,r)<this._allDistMargin(e,t,i,o)&&e.children.sort(r)},_allDistMargin:function(e,t,i,r){e.children.sort(r);var o,n,a=this.toBBox,s=v(e,0,t,a),l=v(e,i-t,i,a),u=d(s)+d(l);for(o=t;o<i-t;o++)n=e.children[o],h(s,e.leaf?a(n):n),u+=d(s);for(o=i-t-1;t<=o;o--)n=e.children[o],h(l,e.leaf?a(n):n),u+=d(l);return u},_adjustParentBBoxes:function(e,t,i){for(var r=i;0<=r;r--)h(t[r],e)},_condense:function(e){for(var t,i=e.length-1;0<=i;i--)0===e[i].children.length?0<i?(t=e[i-1].children).splice(t.indexOf(e[i]),1):this.clear():m(e[i],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}},{quickselect:22}]},{},[1])(1)}),define("SGWorld/Core/turf",["../Const/turf","../Const/turf-plugin"],function(p,e){for(var t in e)p[t]||(p[t]=e[t]);var n=p;function s(e,t,i){void 0===i&&(i={});var r={type:"Feature"};return(0===i.id||i.id)&&(r.id=i.id),i.bbox&&(r.bbox=i.bbox),r.properties=t||{},r.geometry=e,r}function r(e,t,i){return void 0===i&&(i={}),s({type:"Point",coordinates:e},t,i)}function a(e,t,i){void 0===i&&(i={});for(var r=0,o=e;r<o.length;r++){var n=o[r];if(n.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<n[n.length-1].length;a++)if(n[n.length-1][a]!==n[0][a])throw new Error("First and last Position are not equivalent.")}return s({type:"Polygon",coordinates:e},t,i)}function o(e,t,i){if(void 0===i&&(i={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return s({type:"LineString",coordinates:e},t,i)}function l(e,t){void 0===t&&(t={});var i={type:"FeatureCollection"};return t.id&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.features=e,i}function u(e,t,i){return void 0===i&&(i={}),s({type:"MultiLineString",coordinates:e},t,i)}function c(e,t,i){return void 0===i&&(i={}),s({type:"MultiPoint",coordinates:e},t,i)}function h(e,t,i){return void 0===i&&(i={}),s({type:"MultiPolygon",coordinates:e},t,i)}function d(e,t){void 0===t&&(t="kilometers");var i=n.factors[t];if(!i)throw new Error(t+" units is invalid");return e*i}function m(e,t){void 0===t&&(t="kilometers");var i=n.factors[t];if(!i)throw new Error(t+" units is invalid");return e/i}function i(e){return 180*(e%(2*Math.PI))/Math.PI}function g(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)&&!/^\s*$/.test(e)}function f(e,t,i){var r=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var o=0,n=t.length-1;o<t.length;n=o++){var a=t[o][0],s=t[o][1],l=t[n][0],u=t[n][1];if(e[1]*(a-l)+s*(l-e[0])+u*(e[0]-a)==0&&(a-e[0])*(l-e[0])<=0&&(s-e[1])*(u-e[1])<=0)return!i;s>e[1]!=u>e[1]&&e[0]<(l-a)*(e[1]-s)/(u-s)+a&&(r=!r)}return r}n.earthRadius=6371008.8,n.factors={centimeters:100*n.earthRadius,centimetres:100*n.earthRadius,degrees:n.earthRadius/111325,feet:3.28084*n.earthRadius,inches:39.37*n.earthRadius,kilometers:n.earthRadius/1e3,kilometres:n.earthRadius/1e3,meters:n.earthRadius,metres:n.earthRadius,miles:n.earthRadius/1609.344,millimeters:1e3*n.earthRadius,millimetres:1e3*n.earthRadius,nauticalmiles:n.earthRadius/1852,radians:1,yards:n.earthRadius/1.0936},n.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/n.earthRadius,yards:1/1.0936},n.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},n.feature=s,n.geometry=function(e,t,i){switch(void 0===i&&(i={}),e){case"Point":return r(t).geometry;case"LineString":return o(t).geometry;case"Polygon":return a(t).geometry;case"MultiPoint":return c(t).geometry;case"MultiLineString":return u(t).geometry;case"MultiPolygon":return h(t).geometry;default:throw new Error(e+" is invalid")}},n.point=r,n.points=function(e,t,i){return void 0===i&&(i={}),l(e.map(function(e){return r(e,t)}),i)},n.polygon=a,n.polygons=function(e,t,i){return void 0===i&&(i={}),l(e.map(function(e){return a(e,t)}),i)},n.lineString=o,n.lineStrings=function(e,t,i){return void 0===i&&(i={}),l(e.map(function(e){return o(e,t)}),i)},n.featureCollection=l,n.multiLineString=u,n.multiPoint=c,n.multiPolygon=h,n.geometryCollection=function(e,t,i){return void 0===i&&(i={}),s({type:"GeometryCollection",geometries:e},t,i)},n.round=function(e,t){if(void 0===t&&(t=0),t&&!(0<=t))throw new Error("precision must be a positive number");var i=Math.pow(10,t||0);return Math.round(e*i)/i},n.radiansToLength=d,n.lengthToRadians=m,n.lengthToDegrees=function(e,t){return i(m(e,t))},n.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},n.radiansToDegrees=i,n.degreesToRadians=function(e){return e%360*Math.PI/180},n.convertLength=function(e,t,i){if(void 0===t&&(t="kilometers"),void 0===i&&(i="kilometers"),!(0<=e))throw new Error("length must be a positive number");return d(m(e,t),i)},n.convertArea=function(e,t,i){if(void 0===t&&(t="meters"),void 0===i&&(i="kilometers"),!(0<=e))throw new Error("area must be a positive number");var r=n.areaFactors[t];if(!r)throw new Error("invalid original units");var o=n.areaFactors[i];if(!o)throw new Error("invalid final units");return e/r*o},n.isNumber=g,n.isObject=function(e){return!!e&&e.constructor===Object},n.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(e){if(!g(e))throw new Error("bbox must only contain numbers")})},n.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(void 0===e?"undefined":_typeof2(e)))throw new Error("id must be a number or a string")},n.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},n.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},n.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},n.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},n.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},n.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},n.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")},n.lineEquals=function(e,t){var i=e.length==t.length;if(i)for(var r=0;r<e.length;r++)if(e[r][0]!=t[r][0]||e[r][1]!=t[r][1]){i=!1;break}return i},n.polygonEquals=function(e,t){var i=p.getCoords(e),r=p.getCoords(t),o=i.length==r.length;if(o)for(var n=0;n<i.length&&(o=p.lineEquals(i[n],r[n]));n++);return o},n.removeDuplicate=function(e){var r=[];return p.featureEach(e,function(e){if("Polygon"==e.geometry.type){for(var t=!1,i=0;i<r.length;i++)if(p.polygonEquals(e,r[i])){t=!0;break}t||r.push(e)}else r.push(e)}),r=p.featureCollection(r)},p.pointInPolygon=function(e,t){"Feature"==e.type&&(e=p.featureCollection([e])),"Feature"==t.type&&(t=p.featureCollection([t]));var i=p.within(e,t);return!(!i||!i.features.length)},p.pointToPolygonDistance=function(t,e,i){var r=p.polygonToLine(e);if("Feature"==r.type)return"LineString"==r.geometry.type?p.pointToLineDistance(t,r,i):p.pointToMultiLineDistance(t,r,i);if("FeatureCollection"==r.type){var o=Number.MAX_VALUE,n=r;if(p.featureEach(n,function(e){o="LineString"==e.geometry.type?Math.min(p.pointToLineDistance(t,r,i),o):Math.min(p.pointToMultiLineDistance(t,r,i),o)}),o==Number.MAX_VALUE)return;return o}},p.pointToMultiPolygonDistance=function(i,e,r){var t=p.getCoords(e),o=Number.MAX_VALUE;if(t.forEach(function(e){a=p.polygon(e);var t=p.pointToPolygonDistance(i,a,r);o=Math.min(t,o)}),t=[],o!=Number.MAX_VALUE)return o},p.pointToMultiLineDistance=function(i,e,r){e.features&&(e=e.features[0]);var t=p.getCoords(e),o=null,n=Number.MAX_VALUE;if(t.forEach(function(e){o=p.lineString(e);var t=p.pointToLineDistance(i,o,r);n=Math.min(t,n)}),t=[],n!=Number.MAX_VALUE)return n},p.pointToFeatureDistance=function(e,t,i){var r=void 0;switch(t.geometry.type){case"Point":r=p.distance(e,t,i);break;case"MultiPoint":var o=p.getCoords(t),n=[];o.forEach(function(e){n.push(p.point(e))}),n=p.featureCollection(n),nearest=p.nearestPoint(e,n),n=[],r=nearest.properties.distanceToPoint;break;case"LineString":r=p.pointToLineDistance(e,t,i);break;case"MultiLineString":r=p.pointToMultiLineDistance(e,t,i);break;case"Polygon":r=p.pointToPolygonDistance(e,t,i);break;case"MultiPolygon":r=p.pointToMultiPolygonDistance(e,t,i)}return r},n.getCoord=function(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&2<=e.length&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")},n.getGeom=function(e){return"Feature"===e.type?e.geometry:e},n.booleanPointInPolygon=function(e,t,i){if(void 0===i&&(i={}),!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");var r,o,n=p.getCoord(e),a=p.getGeom(t),s=a.type,l=t.bbox,u=a.coordinates;if(l&&0==(r=n,(o=l)[0]<=r[0]&&o[1]<=r[1]&&o[2]>=r[0]&&o[3]>=r[1]))return!1;"Polygon"===s&&(u=[u]);for(var c=!1,h=0;h<u.length&&!c;h++)if(f(n,u[h][0],i.ignoreBoundary)){for(var d=!1,m=1;m<u[h].length&&!d;)f(n,u[h][m],!i.ignoreBoundary)&&(d=!0),m++;d||(c=!0)}return c},p.polygonToLineString&&(p.polygonToLine=p.polygonToLineString);var v=p.helpers;function _(e,t,i){if(void 0===i&&(i={}),!0===i.final)return(_(t,e)+180)%360;var r=y.getCoord(e),o=y.getCoord(t),n=v.degreesToRadians(r[0]),a=v.degreesToRadians(o[0]),s=v.degreesToRadians(r[1]),l=v.degreesToRadians(o[1]),u=Math.sin(a-n)*Math.cos(l),c=Math.cos(s)*Math.sin(l)-Math.sin(s)*Math.cos(l)*Math.cos(a-n);return v.radiansToDegrees(Math.atan2(u,c))}n.distance=function(e,t,i){void 0===i&&(i={});var r=p.getCoord(e),o=p.getCoord(t),n=v.degreesToRadians(o[1]-r[1]),a=v.degreesToRadians(o[0]-r[0]),s=v.degreesToRadians(r[1]),l=v.degreesToRadians(o[1]),u=Math.pow(Math.sin(n/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(l);return v.radiansToLength(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),i.units)},n.bearing=_;var y=p.invariant,C=p.meta,w=p.helpers;function b(e,u){C.geomEach(e,function(e,t,i,r,o){var n,a=null===e?null:e.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==u(w.feature(e,i,{bbox:r,id:o}),t,0)&&void 0}switch(a){case"MultiPoint":n="Point";break;case"MultiLineString":n="LineString";break;case"MultiPolygon":n="Polygon"}for(var s=0;s<e.coordinates.length;s++){var l={type:n,coordinates:e.coordinates[s]};if(!1===u(w.feature(l,i),t,s))return!1}})}function E(e,p){C.flattenEach(e,function(a,s,l){var u=0;if(a.geometry){var e=a.geometry.type;if("Point"!==e&&"MultiPoint"!==e){var c,h=0,d=0,m=0;return!1!==C.coordEach(a,function(e,t,i,r,o){if(void 0===c||h<s||d<r||m<o)return c=e,h=s,d=r,m=o,void(u=0);var n=w.lineString([c,e],a.properties);if(!1===p(n,s,l,o,u))return!1;u++,c=e})&&void 0}}})}function S(e,t){return e[0]*t[0]+e[1]*t[1]}function P(e,t,i){return"planar"===i.method?x(e,t,i):I(e,t,i)}function x(e,t,i){var r;return void 0===i&&(i={}),180<(r=i.final?T(y.getCoord(t),y.getCoord(e)):T(y.getCoord(e),y.getCoord(t)))?-(360-r):r}function T(e,t){var i=v.degreesToRadians(e[1]),r=v.degreesToRadians(t[1]),o=v.degreesToRadians(t[0]-e[0]);o>Math.PI&&(o-=2*Math.PI),o<-Math.PI&&(o+=2*Math.PI);var n=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),a=Math.atan2(o,n);return(v.radiansToDegrees(a)+360)%360}function I(e,t,i){void 0===i&&(i={});var r=y.getCoord(e),o=y.getCoord(t);o[0]+=180<o[0]-r[0]?-360:180<r[0]-o[0]?360:0;var n=function(e,t,i){var r=i=void 0===i?v.earthRadius:Number(i),o=e[1]*Math.PI/180,n=t[1]*Math.PI/180,a=n-o,s=Math.abs(t[0]-e[0])*Math.PI/180;s>Math.PI&&(s-=2*Math.PI);var l=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),u=1e-11<Math.abs(l)?a/l:Math.cos(o);return Math.sqrt(a*a+u*u*s*s)*r}(r,o);return v.convertLength(n,"meters",i.units)}return p.meta.flattenEach=b,p.meta.flattenReduce=function(e,r,o){var n=o;return b(e,function(e,t,i){n=0===t&&0===i&&void 0===o?e:r(n,e,t,i)}),n},p.meta.segmentEach=E,p.meta.segmentReduce=function(e,n,a){var s=a,l=!1;return E(e,function(e,t,i,r,o){s=!1===l&&void 0===a?e:n(s,e,t,i,r,o),l=!0}),s},n.pointToLineDistance=function(e,t,o){if("FeatureCollection"==t.type&&t.features&&(t=t.features[0]),void 0===o&&(o={}),o.method||(o.method="geodesic"),o.units||(o.units="kilometers"),!e)throw new Error("pt is required");if(Array.isArray(e)?e=v.point(e):"Point"===e.type?e=v.feature(e):y.featureOf(e,"Point","point"),!t)throw new Error("line is required");Array.isArray(t)?t=v.lineString(t):"LineString"===t.type?t=v.feature(t):y.featureOf(t,"LineString","line");var n=1/0,a=e.geometry.coordinates;return C.segmentEach(t,function(e){var t=e.geometry.coordinates[0],i=e.geometry.coordinates[1],r=function(e,t,i,r){var o=[i[0]-t[0],i[1]-t[1]],n=S([e[0]-t[0],e[1]-t[1]],o);if(n<=0)return P(e,t,{method:r.method,units:"degrees"});var a=S(o,o);if(a<=n)return P(e,i,{method:r.method,units:"degrees"});var s=n/a,l=[t[0]+s*o[0],t[1]+s*o[1]];return P(e,l,{method:r.method,units:"degrees"})}(a,t,i,o);r<n&&(n=r)}),v.convertLength(n,"degrees",o.units)},n.rhumbBearing=x,n.rhumbDistance=I,p}),define("SGWorld/VectorTileProvider/VectorTileProvider2",[],function(){"use strict";function i(e,t){this._viewer=e,this._cesium=t,this._quadtree=void 0,this._tilingScheme=new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._reTilesKey=[],this._state=!0,this._reTiles=[],this._levelZeroMaximumError=Cesium.QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme),this.cartographicLimitRectangle=Cesium.Rectangle.clone(Cesium.Rectangle.MAX_VALUE),i.prototype.ready||Object.defineProperties(i.prototype,{quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}}})}return i.prototype.update=function(e){this._quadtree.beginFrame(e);try{null!=this.cs&&null==this.cs||this._quadtree.render(e)}catch(e){}this._quadtree.endFrame(e)},i.prototype.static=function(e){this.cs=e},i.prototype.initialize=function(e){},i.prototype.beginUpdate=function(e){},i.prototype.endUpdate=function(e){},i.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)},i.prototype.loadTile=function(e,t){},i.prototype.computeTileVisibility=function(e,t,i){var r=this.computeDistanceToTile(e,t);return r<500&&title.data.geometryPrimitive&&(this._viewer.entities.remove(title.data.geometryPrimitive),title.data.geometryPrimitive=void 0),1},i.prototype.canRefine=function(e,t,i){return e.level<16},i.prototype.showTileThisFrame=function(e,t,i,r){e.data.geometryPrimitive&&this._state&&e.data.geometryPrimitive.update(t,i,r)},i.prototype.computeDistanceToTile=function(e,t){var i,r,o,n,a,s,l,u,c,h,d=(i=e,this.terrainProvider,void 0===(r=i.data)&&(r=i.data=new Cesium.GlobeSurfaceTile),void 0===r.tileBoundingRegion&&(r.tileBoundingRegion=new Cesium.TileBoundingRegion({computeBoundingVolumes:!1,rectangle:i.rectangle,ellipsoid:i.tilingScheme.ellipsoid,minimumHeight:0,maximumHeight:0})),i),m=e.data,p=m.tileBoundingRegion;if(void 0===d)return 9999999999;if(m.boundingVolumeSourceTile!==d){m.boundingVolumeSourceTile=d;var g=e.rectangle;g&&g.width<Cesium.Math.PI_OVER_TWO+Cesium.Math.EPSILON5&&(m.orientedBoundingBox=Cesium.OrientedBoundingBox.fromRectangle(e.rectangle,p.minimumHeight,p.maximumHeight,e.tilingScheme.ellipsoid,m.orientedBoundingBox),m.occludeePointInScaledSpace=(o=this,n=m.orientedBoundingBox.center,a=e.rectangle,s=p.maximumHeight,l=m.occludeePointInScaledSpace,u=o.quadtree._occluders.ellipsoid,c=u.ellipsoid,h=[new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3],Cesium.Cartesian3.fromRadians(a.west,a.south,s,c,h[0]),Cesium.Cartesian3.fromRadians(a.east,a.south,s,c,h[1]),Cesium.Cartesian3.fromRadians(a.west,a.north,s,c,h[2]),Cesium.Cartesian3.fromRadians(a.east,a.north,s,c,h[3]),u.computeHorizonCullingPoint(n,h,l)))}var f=p.minimumHeight,v=p.maximumHeight;if(m.boundingVolumeSourceTile!==e){var _=t.camera.positionCartographic.height,y=Math.abs(_-f);Math.abs(_-v)<y?(p.minimumHeight=f,p.maximumHeight=f):(p.minimumHeight=v,p.maximumHeight=v)}var C=p.distanceToCamera(t);return p.minimumHeight=f,p.maximumHeight=v,C},i.prototype.isDestroyed=function(){return!1},i.prototype.destroy=function(){return Cesium.destroyObject(this)},i.prototype.remove=function(){this.destroy()},i.prototype.setStatus=function(e){this._state=e},i}),define("SGWorld/Creator/VectorGeoJsonFeatureLayer",["../Core/Core","./Color","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min","../Core/jquery","../VectorTileProvider/VectorTileProvider","../VectorTileProvider/GeoJSONVectorTileProvider","../VectorTileProvider/GeoJSONVectorTileProvider1","../Core/LonLatProjection","../Core/turf","../VectorTileProvider/VectorTileProvider2"],function(Core,Color,tree,loadsh,$,VectorTileProvider,GeoJSONVectorTileProvider,GeoJSONVectorTileProvider1,LonLatProjection,turf,VectorTileProvider2){"use strict";function _(e,t){this._viewer=e,this._cesium=t,this._core=new Core,this._color=new Color(this._viewer,this._cesium),this._tree=tree,this.item={show:!0},this._option=void 0,this._primitive=void 0,this._Provider=void 0,this.Legend=[],this.datas=[],this.entity=null,this.primitve=[],this.probj=[],this.PrimitiveData=[],this.loadFinishKey=[],this.loadAllKey=[],this.PrimitiveObj={key:"",data:{}},this.start=0,this.Primitivekey=[],this.tilesLength=0,this.returnCount=0,this._primitiveByTile={},this._primitiveCollection=new this._cesium.PrimitiveCollection,this.img=null,this._defaultStyle=null,this._canvas=null,this._context=null,this._cache=!1,this._forceRefreshPrvimitive=null}function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function _getLoadLevelTile(e,t){var i=[];return e.level>=t?_getParentLevelTile(e,t,i):_getAllChildLevelTile(e,t,i),i}function _getParentLevelTile(e,t,i){for(var r=e,o=0;o<30;o++){if(r.level==t)return i.push({x:r.x,y:r.y,level:r.level}),!0;r=r.parent}return!0}function _getAllChildLevelTile(e,t,i){if(e.level==t)return i.push({x:e.x,y:e.y,level:e.level}),!0;if(e.level>t)return!1;for(var r=0;r<e.children.length;r++)_getAllChildLevelTile(e.children[r],t,i);return!0}var _typeof="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof2(e)};function drawContours(r,o,n,a,s,e,t,l,i){var u=0,c=[];if(e.map(function(e){if(!t||u<=0){var i=0;r.beginPath(),e.map(function(e){var t=o.project(e,n);0==i?r.moveTo(a+t.x,s+t.y):r.lineTo(a+t.x,s+t.y),i++}),t&&(r.closePath(),r.fill()),l&&r.stroke()}else c.push(e);u++}),t)return c;c=null}return _.prototype._serialize=function(e){var t=[],i=window.encodeURIComponent;for(var r in e){var o=e[r];"object"===(void 0===o?"undefined":_typeof(o))?t.push(i(r)+"="+i(JSON.stringify(o))):t.push(i(r)+"="+i(e[r]))}return t.join("&")},_.prototype.VectorGeoJsonFeatureLayer=function(e,t,g,i,r,o){var n=this._core.VectorSlice(t,this._cesium),a=new GeoJSONVectorTileProvider(this._viewer,this._cesium,n),f=this;(this._Provider=a)._loadTile=function(e){var t=new f._cesium.PrimitiveCollection,u=new f._cesium.PointPrimitiveCollection,c=new f._cesium.LabelCollection,h=new f._cesium.BillboardCollection,d=[],m=[],p=-1;return e.features.forEach(function(e){var t=[];if(null!=g.lable&&null==e.geometry.coordinates[0][0]){var i=0;if(null!=g.lable.height&&/^\[/.test(g.lable.height)&&/\]$/.test(g.lable.height)){var r=g.lable.height.replace(/\[/,"").replace(/\]/,"");i=parseFloat(e.properties[r])}var o=f._core.StyleContrast("lable",g.lable,f._cesium);o.fillColor=f._color.VectorColorTransformation(o.fillColor,e),o.outlineColor=f._color.VectorColorTransformation(o.outlineColor,e),o.backgroundColor=f._color.VectorColorTransformation(o.backgroundColor,e),o.text=f._core.Analysis(o.text,e),o.position=new f._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],i),c.add(o)}if(null!=g.billboard&&null==e.geometry.coordinates[0][0]){i=0;if(null!=(l=g.billboard).height&&/^\[/.test(l.height)&&/\]$/.test(l.height)){r=l.height.replace(/\[/,"").replace(/\]/,"");i=parseFloat(e.properties[r])}(n=f._core.StyleContrast("billboard",l,f._cesium)).position=new f._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],i),h.add(n)}if(null!=g.point&&null==e.geometry.coordinates[0][0]){i=0;if(null!=(l=g.point).height&&/^\[/.test(l.height)&&/\]$/.test(l.height)){r=l.height.replace(/\[/,"").replace(/\]/,"");i=parseFloat(e.properties[r])}(n=f._core.StyleContrast("point",l,f._cesium)).position=new f._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],i),n.color=f._color.VectorColorTransformation(n.color,e),n.outlineColor=f._color.VectorColorTransformation(n.outlineColor,e),u.add(n)}if(null!=g.polyline){i=0;if(null!=(l=g.polyline).height&&/^\[/.test(l.height)&&/\]$/.test(l.height)){r=l.height.replace(/\[/,"").replace(/\]/,"");i=parseFloat(e.properties[r])}var n=f._core.StyleContrast("polyline",l,f._cesium);if(p=n.classificationType,delete n.classificationType,Array.isArray(e.geometry.coordinates)&&0<e.geometry.coordinates.length)if(Array.isArray(e.geometry.coordinates[0][0]))for(var a=0;a<e.geometry.coordinates.length;a++){t=[],t=f._core.coordinate(t,e.geometry.coordinates[a]),n.positions=f._cesium.Cartesian3.fromDegreesArray(t);var s=f._core.createPolyline(n,p,e,f._cesium);d.push(s)}else{t=f._core.coordinate(t,e.geometry.coordinates),n.positions=f._cesium.Cartesian3.fromDegreesArray(t);s=f._core.createPolyline(n,p,e,f._cesium);d.push(s)}}if(null!=g.polygon){var l;i=0;if(null!=(l=g.polygon).height&&/^\[/.test(l.height)&&/\]$/.test(l.height)){r=l.height.replace(/\[/,"").replace(/\]/,"");i=parseFloat(e.properties[r])}if((n=f._core.StyleContrast("polygon",l,f._cesium)).material=f._color.VectorColorTransformation(n.material,e),p=n.classificationType,delete n.classificationType,Array.isArray(e.geometry.coordinates)&&0<e.geometry.coordinates.length)if(Array.isArray(e.geometry.coordinates[0][0]))for(a=0;a<e.geometry.coordinates.length;a++){t=[],e.geometry.coordinates[a].pop(),t=f._core.coordinate(t,e.geometry.coordinates[a]),n.polygonHierarchy=new f._cesium.PolygonHierarchy(f._cesium.Cartesian3.fromDegreesArray(t));s=f._core.createPolygon(n,p,e,f._cesium);m.push(s)}else{t=f._core.coordinate(t,e.geometry.coordinates),n.polygonHierarchy=new f._cesium.PolygonHierarchy(f._cesium.Cartesian3.fromDegreesArray(t));s=f._core.createPolygon(n,p,e,f._cesium);m.push(s)}}}),t.add(c),t.add(h),t.add(u),0<d.length&&(-1!=p?t.add(new f._cesium.GroundPolylinePrimitive({geometryInstances:d,classificationType:p,appearance:new f._cesium.PolylineMaterialAppearance})):t.add(new f._cesium.Primitive({geometryInstances:d,appearance:new f._cesium.PolylineMaterialAppearance}))),0<m.length&&(-1!=p?t.add(new f._cesium.GroundPrimitive({geometryInstances:m,classificationType:p,appearance:new f._cesium.PerInstanceColorAppearance({translucent:!0,vertexShaderSource:f._core.Shaders("vertexShaderSource"),fragmentShaderSource:f._core.Shaders("fragmentShaderSource")})})):t.add(new f._cesium.Primitive({geometryInstances:m,appearance:new f._cesium.PerInstanceColorAppearance({translucent:!0,vertexShaderSource:f._core.Shaders("vertexShaderSource"),fragmentShaderSource:f._core.Shaders("fragmentShaderSource")})}))),t},this.item=a._primitiveCollection,a.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(g.id)&&(g.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+g.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var s={id:g.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"Vector",item:this,url:t.url,style:g};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},_.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimizationxp=function(e,t,i,r,o,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var d={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},l=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams);var m=t.url+"?"+this._serialize(s.urlParams);this._Provider=new VectorTileProvider(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider.loadTile=function(e,t){!function(u,c,h){if(c.state===Cesium.QuadtreeTileLoadState.START){if(c.data={lines:[],geometryPrimitive:void 0},!(c.level>=i.level_min&&c.level<i.level_max&&h.item.show))return c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0;var e=m.replace(window.encodeURIComponent("{x}"),c.x).replace(window.encodeURIComponent("{y}"),c.y).replace(window.encodeURIComponent("{z}"),c.level);h._cache&&(e+="&"+h._core.getuid()),h._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return c.state=Cesium.QuadtreeTileLoadState.DONE,void(c.renderable=!0);var a=[];function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):s.push(e[t])}function t(){if(/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)){var e=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");d.extrudedHeight=parseFloat(l.properties[e])}if(d.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)){var t=h._option.material.replace(/\[/,"").replace(/\]/,"");d.material=l.properties[t],h._core.isHtmlColor(d.material)?d.material=h._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=h._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=h._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha))}else h._option.material&&(d.material=h._option.material),d.material&&(h._core.isHtmlColor(d.material)?d.material=h._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=h._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=h._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha)));if(2<=s.length){var i=h._cesium.Cartesian3.fromDegreesArray(s);d.polygonHierarchy=new h._cesium.PolygonHierarchy(i);var r=new h._cesium.PolygonGeometry(d),o=new h._cesium.GeometryInstance({id:l,geometry:r,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(d.material)}}),n="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue;h.Legend.push(n),a.push(o)}}h.Legend=[];for(var r=0;r<e.features.length;r++){var s=[],l=e.features[r];if(Array.isArray(l.geometry.coordinates)&&0<l.geometry.coordinates.length)if(Array.isArray(l.geometry.coordinates[0][0]))for(var o=0;o<l.geometry.coordinates.length;o++)s=[],l.geometry.coordinates[o].pop(),i(l.geometry.coordinates[o]),t();else i(l.geometry.coordinates),t()}0==a.length&&(c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0);var n=new h._cesium.Primitive({geometryInstances:a,appearance:new h._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:h._core.Shaders("vertexShaderSource"),fragmentShaderSource:h._core.Shaders("fragmentShaderSource")}),shadows:h._option.shadows});c.data.geometryPrimitive=n,c.state=Cesium.QuadtreeTileLoadState.LOADING,c.state===Cesium.QuadtreeTileLoadState.LOADING&&(c.data.geometryPrimitive.update(u,[]),c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0)},error:function(){null==c.count&&(c.count=0),c.count+=1,2<=c.count?(c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0):c.state=Cesium.QuadtreeTileLoadState.START}}),c.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,l)},this._primitive=new l._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var u=this._viewer.scene;u.primitives.add(this._primitive),u.primitivesQuadTrees&&u.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var c={id:d.id,name:e,checked:!0,pId:this._core.isnull(r)?0:r,type:"polygonLayer",item:this,url:t.url,style:i};return this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(r)?0:r),"function"==typeof n&&n(this.item),this},_.prototype.VolumeVectorGeoJsonFeatureLayerOptimization1ss=function(e,t,u,i,r,o){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(u)||this._core.isnull(u.material)||"["==u.material.toString().charAt(0)&&"]"==u.material.toString().charAt(u.material.length-1)||(this._core.isHtmlColor(u.material)?u.material=this._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=this._color.rgbaStringToRgbaObj(u.material)),1<u.material.r&&(u.material.r=u.material.r/255),1<u.material.g&&(u.material.g=u.material.g/255),1<u.material.b&&(u.material.b=u.material.b/255),1<u.material.a&&(u.material.a=u.material.a/255),u.material=this._color.createColor(u.material.r,u.material.g,u.material.b,u.material.a))),this._option=this._core.extend(n,u,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var c=[],d={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},m=this;this._urlTemplate=t.url+"?"+this._serialize(a.urlParams),this._Provider=new VectorTileProvider(this._viewer,this._cesium),this._Provider._normalTile=u.level_max-1,this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&m.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},!(t.level>=u.level_min&&t.level<u.level_max&&m.item.show))return t.state=m._cesium.QuadtreeTileLoadState.LOADING,void(t.state===m._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=m._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));var r=loadsh.filter(c,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=r.length&&r[0].data&&0<r[0].data.length)return t.data.geometryPrimitive=new m._cesium.Primitive({geometryInstances:r[0].data,appearance:new m._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:m._cesium.ShadowMode.ENABLED}),t.state=m._cesium.QuadtreeTileLoadState.LOADING,void(t.state===m._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=m._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));if(0<m.PrimitiveData.length)for(var o=0;o<m.PrimitiveData.length;o++)if(m.PrimitiveData[o].key==i)return void(m.Primitivekey.includes(i)||m.Primitivekey.push(i));if(!m.Primitivekey.includes(i)){m.Primitivekey.push(i),c.push({level:t.level,x:t.x,y:t.y,data:void 0});var n=m._option.level_min+(m._option.level_max-m._option.level_min)/2,a=_getLoadLevelTile(t,n);for(o=0;o<a.length;o++){var s=a[o],l="z"+s.level+"x"+s.x+"y"+s.y;m.loadAllKey.includes(l)||(m.loadAllKey.push(l),function(c){var e=m._urlTemplate.replace(window.encodeURIComponent("{x}"),c.x).replace(window.encodeURIComponent("{y}"),c.y).replace(window.encodeURIComponent("{z}"),c.level);m.tilesLength++,m._cache&&(e+="&"+m._core.getuid());var h="z"+c.level+"x"+c.x+"y"+c.y;m._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var a=[];function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):s.push(e[t])}function t(){if(/^\[/.test(m._option.extrudedHeight)&&/\]$/.test(m._option.extrudedHeight)){var e=m._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");d.extrudedHeight=parseFloat(l.properties[e])}if(d.material=m._option.material,/^\[/.test(m._option.material)&&/\]$/.test(m._option.material)){var t=m._option.material.replace(/\[/,"").replace(/\]/,"");d.material=l.properties[t],m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha))}else m._option.material&&(d.material=m._option.material),d.material&&(m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha)));if(2<=s.length){var i=m._cesium.Cartesian3.fromDegreesArray(s);d.polygonHierarchy=new m._cesium.PolygonHierarchy(i);var r=new m._cesium.PolygonGeometry(d),o=new m._cesium.GeometryInstance({id:l,geometry:r,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(d.material)}}),n="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue;m.Legend.push(n),a.push(o)}}m.Legend=[];for(var r=0;r<e.features.length;r++){var s=[],l=e.features[r];if(Array.isArray(l.geometry.coordinates)&&0<l.geometry.coordinates.length)if(Array.isArray(l.geometry.coordinates[0][0]))for(var o=0;o<l.geometry.coordinates.length;o++)s=[],l.geometry.coordinates[o].pop(),i(l.geometry.coordinates[o]),t();else i(l.geometry.coordinates),t()}if(0<a.length){var n=new m._cesium.Primitive({geometryInstances:a,appearance:new m._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:m._core.Shaders("vertexShaderSource"),fragmentShaderSource:m._core.Shaders("fragmentShaderSource")}),shadows:m._option.shadows}),u={level:c.level,key:h,data:n};m.probj.push(n),m.loadFinishKey.push(h),m.PrimitiveData.push(u),m._viewer.scene.primitives.add(n),m.returnCount++}},error:function(){},complete:function(e,t){}})}(s))}}}},this._primitive=new m._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var s=this._viewer.scene;s.primitives.add(this._primitive),s.primitivesQuadTrees&&s.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var l={id:d.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:u};this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item)},_.prototype.VolumeVectorGeoJsonFeatureLayerGis=function(e,t,n,i,r,o){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10};t.url,t.layer,t.upperLevelLimit,t.lowerLevelLimit,this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),this._cesium;this._core.isnull(n)||this._core.isnull(n.material)||"["==n.material.toString().charAt(0)&&"]"==n.material.toString().charAt(n.material.length-1)||(this._core.isHtmlColor(n.material)?n.material=this._color.colorFromHtmlColor(n.material):(/^rgb/.test(n.material)&&(n.material=this._color.rgbaStringToRgbaObj(n.material)),1<n.material.r&&(n.material.r=n.material.r/255),1<n.material.g&&(n.material.g=n.material.g/255),1<n.material.b&&(n.material.b=n.material.b/255),1<n.material.a&&(n.material.a=n.material.a/255),n.material=this._color.createColor(n.material.r,n.material.g,n.material.b,n.material.a))),this._option=this._core.extend(a,n,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var s=[],l=[],d={id:t.id,polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},m=this;this._urlTemplate=t.url+"/"+window.encodeURIComponent("{z}")+"/"+window.encodeURIComponent("{x}")+"/"+window.encodeURIComponent("{reverseY}")+".json",this._Provider=new VectorTileProvider(this._viewer,this._cesium),this._Provider._normalTile=n.level_max-1,this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&m.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},!(t.level>=n.level_min&&t.level<n.level_max&&m.item.show))return t.state=m._cesium.QuadtreeTileLoadState.LOADING,void(t.state===m._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=m._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));var r=loadsh.filter(s,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=r.length&&r[0].data&&0<r[0].data.length)return t.data.geometryPrimitive=new m._cesium.Primitive({geometryInstances:r[0].data,appearance:new m._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:m._cesium.ShadowMode.ENABLED}),t.state=m._cesium.QuadtreeTileLoadState.LOADING,void(t.state===m._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=m._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));if(0<m.PrimitiveData.length)for(var o=0;o<m.PrimitiveData.length;o++)if(m.PrimitiveData[o].key==i)return void(m.Primitivekey.includes(i)||m.Primitivekey.push(i));m.Primitivekey.includes(i)||(m.Primitivekey.push(i),s.push({level:t.level,x:t.x,y:t.y,data:void 0}),function(c){var e=c.tilingScheme.getNumberOfYTilesAtLevel(c.level)-c.y-1,t=m._urlTemplate.replace(window.encodeURIComponent("{x}"),c.x).replace(window.encodeURIComponent("{reverseY}"),e).replace(window.encodeURIComponent("{z}"),c.level);m.tilesLength++;var h="z"+c.level+"x"+c.x+"y"+c.y;m._cache&&(t+="&"+m._core.getuid()),0<loadsh.filter(l,function(e){return e.url==t}).length||(l.push({url:t}),m._core.xhr({url:t,type:"get",dataType:"json",success:function(e){var s=[];function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):l.push(e[t])}function t(){if(d.extrudedHeight=parseFloat(m._option.extrudedHeight),/^\[/.test(m._option.extrudedHeight)&&/\]$/.test(m._option.extrudedHeight)){var e=m._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");d.extrudedHeight=3*parseFloat(u.properties[e])}if(d.material=m._option.material,/^\[/.test(m._option.material)&&/\]$/.test(m._option.material)){var t=m._option.material.replace(/\[/,"").replace(/\]/,"");d.material=u.properties[t],m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha))}else m._option.material&&(d.material=m._option.material),d.material&&(m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha)));var i=m._cesium.Color.WHITE;if(2<=l.length){var r=m._cesium.Cartesian3.fromDegreesArray(l);d.polygonHierarchy=new m._cesium.PolygonHierarchy(r);var o=new m._cesium.PolygonGeometry(d),n=new m._cesium.GeometryInstance({id:u,geometry:o,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(i)}}),a="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue;m.Legend.push(a),s.push(n)}}m.Legend=[];for(var r=0;r<e.features.length;r++){var l=[],u=e.features[r];if(Array.isArray(u.geometry.coordinates)&&0<u.geometry.coordinates.length)if(Array.isArray(u.geometry.coordinates[0][0]))for(var o=0;o<u.geometry.coordinates.length;o++)l=[],u.geometry.coordinates[o].pop(),i(u.geometry.coordinates[o]),t();else i(u.geometry.coordinates),t()}var n=new m._cesium.Primitive({geometryInstances:s,appearance:new m._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:m._core.Shaders("vertexShaderSource"),fragmentShaderSource:m._core.Shaders("fragmentShaderSource")}),shadows:m._option.shadows});m.probj.push(n);var a={level:c.level,key:h,data:n};m.loadFinishKey.push(h),m.PrimitiveData.push(a),m._viewer.scene.primitives.add(n),m.returnCount++;try{2==m.probj.length&&(m._viewer.scene.primitives.remove(m.probj[0]),m.probj.pop())}catch(e){}},error:function(){var e=m.Primitivekey.indexOf(h);-1<e&&m.Primitivekey.splice(e,1),s=loadsh.remove(s,function(e){return e.x==c.x&&e.y==c.y&&e.level==c.level})},complete:function(e,t){c.state=m._cesium.QuadtreeTileLoadState.LOADING,c.state===m._cesium.QuadtreeTileLoadState.LOADING&&(c.data.geometryPrimitive&&(c.state=m._cesium.QuadtreeTileLoadState.DONE),c.renderable=!0)}}))}(t))}},this._primitive=new m._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var u=this._viewer.scene;u.primitives.add(this._primitive),u.primitivesQuadTrees&&u.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var c={id:d.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:n};return this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},_.prototype.PointVectorGeoJsonFeatureLayerGis=function(e,t,h,i,r,o){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10};this._option=this._core.extend(n,h,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var a=[],s={id:t.id,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,arcType:this._cesium.ArcType.GEODESIC},d=this;this._urlTemplate=t.url+"/{z}/{x}/{reverseY}.json",this._Provider={},this._Provider1=new GeoJSONVectorTileProvider1(this._viewer,this._cesium,{url:this._urlTemplate},function(e){if(d.Level=d.getLevel(),d.Level<d._option.level_min){if(0<d.primitve.length){for(var t=0;t<d.primitve.length;t++)d._viewer.scene.primitives.remove(d.primitve[t]);d.primitve=[]}if(0<d.probj.length){for(t=0;t<d.probj.length;t++)d._viewer.scene.primitives.remove(d.probj[t]);d.probj=[]}a=[]}else{var s=new d._cesium.PrimitiveCollection,l=new d._cesium.PointPrimitiveCollection,u=new d._cesium.LabelCollection,c=new d._cesium.BillboardCollection;e.templateValues.z,e.templateValues.x,e.templateValues.reverseY;e.data={lines:[],geometryPrimitive:void 0};var i=e.url.replace("png","json");0<loadsh.filter(a,function(e){return e.url==i}).length||1!=d.start&&(a.push({url:i}),d._core.xhr({url:i,type:"get",dataType:"json",success:function(e){if(0!=e.features.length){d.Legend=[];for(var t=0;t<e.features.length;t++){var n=[],a=e.features[t];if(Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var i=0;i<a.geometry.coordinates.length;i++)n=[],a.geometry.coordinates[i].pop(),r(a.geometry.coordinates[i]),o();else r(a.geometry.coordinates),o()}0<u.length&&s.add(u),0<c.length&&s.add(c),0<l.length&&s.add(l),d.primitve.push(s),d.probj.push(s),d._viewer.scene.primitives.add(s),d.returnCount++;try{2==d.probj.length&&(d._viewer.scene.primitives.remove(d.probj[0]),d.probj.pop())}catch(e){}}function r(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?r(e[t]):n.push(e[t])}function o(){if(null!=h.lable){var e=0;if(null!=h.lable.height&&/^\[/.test(h.lable.height)&&/\]$/.test(h.lable.height)){var t=h.lable.height.replace(/\[/,"").replace(/\]/,"");e=parseFloat(a.properties[t])}var i=d._core.StyleContrast("lable",h.lable,d._cesium);i.fillColor=d._color.VectorColorTransformation(i.fillColor,a),i.outlineColor=d._color.VectorColorTransformation(i.outlineColor,a),i.backgroundColor=d._color.VectorColorTransformation(i.backgroundColor,a),i.text=d._core.Analysis(i.text,a),i.position=new d._cesium.Cartesian3.fromDegrees(n[0],n[1],e),u.add(i)}if(null!=h.billboard){e=0;if(null!=(r=h.billboard).height&&/^\[/.test(r.height)&&/\]$/.test(r.height)){t=r.height.replace(/\[/,"").replace(/\]/,"");e=parseFloat(a.properties[t])}(o=d._core.StyleContrast("billboard",r,d._cesium)).position=new d._cesium.Cartesian3.fromDegrees(n[0],n[1],e),c.add(o)}if(null!=h.point){var r,o;e=0;if(null!=(r=h.point).height&&/^\[/.test(r.height)&&/\]$/.test(r.height)){t=r.height.replace(/\[/,"").replace(/\]/,"");e=parseFloat(a.properties[t])}(o=d._core.StyleContrast("point",r,d._cesium)).position=new d._cesium.Cartesian3.fromDegrees(n[0],n[1],e),o.color=d._color.VectorColorTransformation(o.color,a),o.outlineColor=d._color.VectorColorTransformation(o.outlineColor,a),l.add(o)}}}}))}}),this.img=this._Provider1.ent,r||this.setVisibility(!1),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+s.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var l={id:s.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:h};return this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},_.prototype.PolylineVectorGeoJsonFeatureLayerGis=function(e,t,c,i,r,o){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10};this._option=this._core.extend(n,c,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var a=[],s={id:t.id,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,arcType:this._cesium.ArcType.GEODESIC},h=this;this._urlTemplate=t.url+"/{z}/{x}/{reverseY}.json",this._Provider={},this._Provider1=new GeoJSONVectorTileProvider1(this._viewer,this._cesium,{url:this._urlTemplate},function(e){if(h.Level=h.getLevel(),h.Level<h._option.level_min){if(0<h.primitve.length){for(var t=0;t<h.primitve.length;t++)h._viewer.scene.primitives.remove(h.primitve[t]);h.primitve=[]}if(0<h.probj.length){for(t=0;t<h.probj.length;t++)h._viewer.scene.primitives.remove(h.probj[t]);h.probj=[]}a=[]}else{var u=-1;e.templateValues.z,e.templateValues.x,e.templateValues.reverseY;e.data={lines:[],geometryPrimitive:void 0};var i=e.url.replace("png","json");0<loadsh.filter(a,function(e){return e.url==i}).length||1!=h.start&&(a.push({url:i}),h._core.xhr({url:i,type:"get",dataType:"json",success:function(e){if(0!=e.features.length){var a=[];h.Legend=[];for(var t=0;t<e.features.length;t++){var s=[],l=e.features[t];if(Array.isArray(l.geometry.coordinates)&&0<l.geometry.coordinates.length)if(Array.isArray(l.geometry.coordinates[0][0]))for(var i=0;i<l.geometry.coordinates.length;i++)s=[],l.geometry.coordinates[i].pop(),o(l.geometry.coordinates[i]),n();else o(l.geometry.coordinates),n()}var r=new h._cesium.Primitive({geometryInstances:a,appearance:new h._cesium.PolylineColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:h._option.shadows,classificationType:u});h.probj.push(r),h.primitve.push(r),h._viewer.scene.primitives.add(r),h.returnCount++;try{2==h.probj.length&&(h._viewer.scene.primitives.remove(h.probj[0]),h.probj.pop())}catch(e){}}function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):s.push(e[t])}function n(){var e=c;if(null!=e.height&&/^\[/.test(e.height)&&/\]$/.test(e.height)){var t=e.height.replace(/\[/,"").replace(/\]/,"");parseFloat(l.properties[t])}var i=h._core.StyleContrast("polyline",e,h._cesium);if(u=i.classificationType,delete i.classificationType,i.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)){var r=h._option.material.replace(/\[/,"").replace(/\]/,"");i.material=l.properties[r],h._core.isHtmlColor(i.material)?i.material=h._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=h._color.rgbaStringToRgbaObj(i.material)),1<i.material.red&&(i.material.red=i.material.red/255),1<i.material.green&&(i.material.green=i.material.green/255),1<i.material.blue&&(i.material.blue=i.material.blue/255),1<i.material.alpha&&(i.material.a=i.material.alpha/255),i.material=h._color.createColor(i.material.red,i.material.green,i.material.blue,i.material.alpha))}else h._option.material&&(i.material=h._option.material),i.material&&(h._core.isHtmlColor(i.material)?i.material=h._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=h._color.rgbaStringToRgbaObj(i.material)),1<i.material.red&&(i.material.red=i.material.red/255),1<i.material.green&&(i.material.green=i.material.green/255),1<i.material.blue&&(i.material.blue=i.material.blue/255),1<i.material.alpha&&(i.material.a=i.material.alpha/255),i.material=h._color.createColor(i.material.red,i.material.green,i.material.blue,i.material.alpha)));if(2<=s.length){i.positions=h._cesium.Cartesian3.fromDegreesArray(s);var o=new h._cesium.GeometryInstance({id:l,geometry:new h._cesium.PolylineGeometry(i),attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(i.material)}}),n="material:"+255*i.material.red+","+255*i.material.green+","+255*i.material.blue;h.Legend.push(n),a.push(o)}}}}))}}),this.img=this._Provider1.ent,r||this.setVisibility(!1),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+s.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var l={id:s.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:c};return this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},_.prototype.VolumeVectorGeoJsonFeatureLayerGisOptimization=function(e,t,i,r,o,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10};t.url,t.layer,t.upperLevelLimit,t.lowerLevelLimit,this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),this._cesium;this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var s=[],u={id:t.id,polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},c=this;this._urlTemplate=t.url+"/{z}/{x}/{reverseY}.json",this._Provider={},this._Provider1=new GeoJSONVectorTileProvider1(this._viewer,this._cesium,{url:this._urlTemplate},function(e){if(c.Level=c.getLevel(),c.Level<c._option.level_min){if(0<c.primitve.length){for(var t=0;t<c.primitve.length;t++)c._viewer.scene.primitives.remove(c.primitve[t]);c.primitve=[]}if(0<c.probj.length){for(t=0;t<c.probj.length;t++)c._viewer.scene.primitives.remove(c.probj[t]);c.probj=[]}s=[]}else{e.templateValues.z,e.templateValues.x,e.templateValues.reverseY;e.data={lines:[],geometryPrimitive:void 0};var i=e.url.replace("png","json");0<loadsh.filter(s,function(e){return e.url==i}).length||1!=c.start&&(s.push({url:i}),c._core.xhr({url:i,type:"get",dataType:"json",success:function(e){if(0!=e.features.length){var n=[];c.Legend=[];for(var t=0;t<e.features.length;t++){var a=[],s=e.features[t];if(Array.isArray(s.geometry.coordinates)&&0<s.geometry.coordinates.length)if(Array.isArray(s.geometry.coordinates[0][0]))for(var i=0;i<s.geometry.coordinates.length;i++)a=[],s.geometry.coordinates[i].pop(),o(s.geometry.coordinates[i]),l();else o(s.geometry.coordinates),l()}var r=new c._cesium.Primitive({geometryInstances:n,appearance:new c._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:c._core.Shaders("vertexShaderSource"),fragmentShaderSource:c._core.Shaders("fragmentShaderSource")}),shadows:c._option.shadows});c.primitve.push(r),c.probj.push(r),c._viewer.scene.primitives.add(r),c.returnCount++;try{2==c.probj.length&&(c._viewer.scene.primitives.remove(c.probj[0]),c.probj.pop())}catch(e){}}function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):a.push(e[t])}function l(){if(u.extrudedHeight=c._option.extrudedHeight,/^\[/.test(c._option.extrudedHeight)&&/\]$/.test(c._option.extrudedHeight)){var e=c._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");u.extrudedHeight=3*parseFloat(s.properties[e])}if(u.material=c._option.material,/^\[/.test(c._option.material)&&/\]$/.test(c._option.material)){var t=c._option.material.replace(/\[/,"").replace(/\]/,"");u.material=s.properties[t],c._core.isHtmlColor(u.material)?u.material=c._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=c._color.rgbaStringToRgbaObj(u.material)),1<u.material.red&&(u.material.red=u.material.red/255),1<u.material.green&&(u.material.green=u.material.green/255),1<u.material.blue&&(u.material.blue=u.material.blue/255),1<u.material.alpha&&(u.material.a=u.material.alpha/255),u.material=c._color.createColor(u.material.red,u.material.green,u.material.blue,u.material.alpha))}else c._option.material&&(u.material=c._option.material),u.material&&(c._core.isHtmlColor(u.material)?u.material=c._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=c._color.rgbaStringToRgbaObj(u.material)),1<u.material.red&&(u.material.red=u.material.red/255),1<u.material.green&&(u.material.green=u.material.green/255),1<u.material.blue&&(u.material.blue=u.material.blue/255),1<u.material.alpha&&(u.material.a=u.material.alpha/255),u.material=c._color.createColor(u.material.red,u.material.green,u.material.blue,u.material.alpha)));if(2<=a.length){var i=c._cesium.Cartesian3.fromDegreesArray(a);u.polygonHierarchy=new c._cesium.PolygonHierarchy(i);var r=new c._cesium.PolygonGeometry(u),o=new c._cesium.GeometryInstance({id:s,geometry:r,attributes:{color:new c._cesium.ColorGeometryInstanceAttribute.fromColor(u.material)}});u.material.red,u.material.green,u.material.blue;n.push(o)}}}}))}}),this.img=this._Provider1.ent,o||this.setVisibility(!1),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var l={id:u.id,name:e,checked:!0,pId:this._core.isnull(r)?0:r,type:"polygonLayer",item:this,url:t.url,style:i};return this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(r)?0:r),"function"==typeof n&&n(this.item),this},_.prototype.VolumeVectorGeoJsonFeatureLayerClassOptimization=function(e,t,d,i,r,o){var n={polygonHierarchy:void 0,height:0,extrudedHeight:999999,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(d)||this._core.isnull(d.material)||"["==d.material.toString().charAt(0)&&"]"==d.material.toString().charAt(d.material.length-1)||(this._core.isHtmlColor(d.material)?d.material=this._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=this._color.rgbaStringToRgbaObj(d.material)),1<d.material.r&&(d.material.r=d.material.r/255),1<d.material.g&&(d.material.g=d.material.g/255),1<d.material.b&&(d.material.b=d.material.b/255),1<d.material.a&&(d.material.a=d.material.a/255),d.material=this._color.createColor(d.material.r,d.material.g,d.material.b,d.material.a)));var m=this._core.extend(n,d,!0);null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var s=[],p=this;this._urlTemplate=t.url+"?"+this._serialize(a.urlParams),this._Provider=new VectorTileProvider(this._viewer,this._cesium),this._Provider._normalTile=d.level_max-1,this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&p.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},!(t.level>=d.level_min&&t.level<d.level_max&&p.item.show))return t.state=p._cesium.QuadtreeTileLoadState.LOADING,void(t.state===p._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=p._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));var r=loadsh.filter(s,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=r.length&&r[0].data&&0<r[0].data.length)return t.data.geometryPrimitive=new p._cesium.Primitive({geometryInstances:r[0].data,appearance:new p._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:p._cesium.ShadowMode.ENABLED}),t.state=p._cesium.QuadtreeTileLoadState.LOADING,void(t.state===p._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=p._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));if(0<p.PrimitiveData.length)for(var o=0;o<p.PrimitiveData.length;o++)if(p.PrimitiveData[o].key==i)return void p.Primitivekey.push(i);p.Primitivekey.includes(i)||(p.Primitivekey.push(i),s.push({level:t.level,x:t.x,y:t.y,data:void 0}),h=t,n=p._urlTemplate.replace(window.encodeURIComponent("{x}"),h.x).replace(window.encodeURIComponent("{y}"),h.y).replace(window.encodeURIComponent("{z}"),h.level),p.tilesLength++,p._cache&&(n+="&"+p._core.getuid()),p._core.xhr({url:n,type:"get",dataType:"json",success:function(e){var a=[];function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):(s.push(e[t]),2!==t||l||(l=!0))}function t(){var e=l?p._cesium.Cartesian3.fromDegreesArrayHeights(s):p._cesium.Cartesian3.fromDegreesArray(s);if(/^\[/.test(d.extrudedHeight)&&/\]$/.test(d.extrudedHeight)){var t=d.extrudedHeight.replace(/\[/,"").replace(/\]/,"");m.extrudedHeight=parseFloat(u.properties[t])}if(m.extrudedHeight=parseFloat(m.extrudedHeight),1==m.heightReference&&delete m.height,1==m.extrudedHeightReference&&delete m.extrudedHeight,/^\[/.test(d.material)&&/\]$/.test(d.material)){var i=d.material.replace(/\[/,"").replace(/\]/,"");m.material=u.properties[i],p._core.isHtmlColor(m.material)?m.material=p._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=p._color.rgbaStringToRgbaObj(m.material)),1<m.material.r&&(m.material.r=m.material.r/255),1<m.material.g&&(m.material.g=m.material.g/255),1<m.material.b&&(m.material.b=m.material.b/255),1<m.material.a&&(m.material.a=m.material.a/255),m.material=p._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))}m.polygonHierarchy=new p._cesium.PolygonHierarchy(e);var r=new p._cesium.PolygonGeometry(m);u.treeID=m.id,u.VectorType="polygon",u.VectorStyle={haveZ:l,extrudedHeight:m.extrudedHeight,positions:s,material:m.material};var o=new p._cesium.GeometryInstance({id:u,geometry:r,attributes:{color:new p._cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}}),n="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue;p.Legend.push(n),a.push(o)}p.Legend=[];for(var r=0;r<e.features.length;r++){var s=[],l=!1,u=e.features[r];if(Array.isArray(u.geometry.coordinates)&&0<u.geometry.coordinates.length)if(Array.isArray(u.geometry.coordinates[0][0]))for(var o=0;o<u.geometry.coordinates.length;o++)s=[],u.geometry.coordinates[o].pop(),i(u.geometry.coordinates[o]),t();else i(u.geometry.coordinates),t()}var n=new p._cesium.ClassificationPrimitive({geometryInstances:a,appearance:new p._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:p._core.Shaders("vertexShaderSource"),fragmentShaderSource:p._core.Shaders("fragmentShaderSource")}),classificationType:m.classificationType,shadows:p._cesium.ShadowMode.ENABLED});p.PrimitiveObj.data=n,p.PrimitiveObj.key=p.Primitivekey[p.returnCount];var c={level:h.level,key:p.Primitivekey[p.returnCount],data:n};p.loadFinishKey.push(p.Primitivekey[p.returnCount]),p.PrimitiveData.push(c),p._viewer.scene.primitives.add(n),p.returnCount++,p.returnCount>=p.tilesLength&&(p.returnCount=0,p.tilesLength=0,p.Primitivekey=[])},error:function(){s=loadsh.remove(s,function(e){return e.x==h.x&&e.y==h.y&&e.level==h.level})},complete:function(e,t){h.state=p._cesium.QuadtreeTileLoadState.LOADING,h.state===p._cesium.QuadtreeTileLoadState.LOADING&&(h.data.geometryPrimitive&&(h.state=p._cesium.QuadtreeTileLoadState.DONE),h.renderable=!0)}}))}var h,n},this._primitive=new p._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var l=this._viewer.scene,u=l.primitives;d&&d.time&&(this._Provider._availability=new p._cesium.TimeIntervalCollection([new p._cesium.TimeInterval({start:d.time.start?p._cesium.JulianDate.fromDate(new Date(d.time.start)):p._cesium.Iso8601.MINIMUM_VALUE,stop:d.time.end?p._cesium.JulianDate.fromDate(new Date(d.time.end)):p._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),u.add(this._primitive),l.primitivesQuadTrees&&l.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var c={id:m.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:d};return this._Provider.treeID=m.id,this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},_.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization2=function(e,t,i,r,o,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var d={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},l=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams);var u=t.url+"?"+this._serialize(s.urlParams);this._Provider=new VectorTileProvider(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider.loadTile=function(e,t){!function(a,c,h){if(c.state===Cesium.QuadtreeTileLoadState.START){if(c.data={lines:[],geometryPrimitive:void 0},!(c.level>=i.level_min&&c.level<i.level_max&&h.item.show))return c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0;var e=u.replace(window.encodeURIComponent("{x}"),c.x).replace(window.encodeURIComponent("{y}"),c.y).replace(window.encodeURIComponent("{z}"),c.level);h._cache&&(e+="&"+h._core.getuid()),h._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return c.state=Cesium.QuadtreeTileLoadState.DONE,void(c.renderable=!0);var s=new h._cesium.PrimitiveCollection;function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):l.push(e[t])}function t(){if(h._option.extrudedHeight&&(d.extrudedHeight=h._option.extrudedHeight),/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)){var e=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");d.extrudedHeight=parseFloat(u.properties[e])}if(d.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)){var t=h._option.material.replace(/\[/,"").replace(/\]/,"");d.material=u.properties[t],h._core.isHtmlColor(d.material)?d.material=h._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=h._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=h._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha))}else h._option.material&&(d.material=h._option.material),d.material&&(h._core.isHtmlColor(d.material)?d.material=h._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=h._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=h._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha)));if(2<=l.length){var i=h._cesium.Cartesian3.fromDegreesArray(l);d.polygonHierarchy=new h._cesium.PolygonHierarchy(i);var r=new h._cesium.PolygonGeometry(d),o=new h._cesium.GeometryInstance({id:u,geometry:r,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(d.material)}}),n=new h._cesium.ClassificationPrimitive({geometryInstances:o,appearance:new h._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:h._core.Shaders("vertexShaderSource"),fragmentShaderSource:h._core.Shaders("fragmentShaderSource")}),classificationType:h._option.classificationType}),a="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue;h.Legend.push(a),s.add(n)}}h.Legend=[];for(var r=0;r<e.features.length;r++){var l=[],u=e.features[r];if(Array.isArray(u.geometry.coordinates)&&0<u.geometry.coordinates.length)if(Array.isArray(u.geometry.coordinates[0][0]))for(var o=0;o<u.geometry.coordinates.length;o++)l=[],u.geometry.coordinates[o].pop(),i(u.geometry.coordinates[o]),t();else i(u.geometry.coordinates),t()}var n=s;c.data.geometryPrimitive=n,c.state=Cesium.QuadtreeTileLoadState.LOADING,c.state===Cesium.QuadtreeTileLoadState.LOADING&&(c.data.geometryPrimitive.update(a,[]),c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0)},error:function(){null==c.count&&(c.count=0),c.count+=1,2<=c.count?(c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0):c.state=Cesium.QuadtreeTileLoadState.START}}),c.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,l)},this._primitive=new l._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var c=this._viewer.scene;c.primitives.add(this._primitive),c.primitivesQuadTrees&&c.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var h={id:d.id,name:e,checked:!0,pId:this._core.isnull(r)?0:r,type:"polygonLayer",item:this,url:t.url,style:i};return this.setTreeobj(h),this._tree.insertGroupId(h,this._core.isnull(r)?0:r),"function"==typeof n&&n(this.item),this},_.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization3=function(e,t,i,r,o,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var d={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},l=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams);var m=t.url+"?"+this._serialize(s.urlParams);this._Provider=new VectorTileProvider(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider.loadTile=function(e,t){!function(u,c,h){if(c.state===Cesium.QuadtreeTileLoadState.START){if(c.data={lines:[],geometryPrimitive:void 0},!(c.level>=i.level_min&&c.level<i.level_max&&h.item.show))return c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0;var e=m.replace(window.encodeURIComponent("{x}"),c.x).replace(window.encodeURIComponent("{y}"),c.y).replace(window.encodeURIComponent("{z}"),c.level);h._cache&&(e+="&"+h._core.getuid()),h._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return c.state=Cesium.QuadtreeTileLoadState.DONE,void(c.renderable=!0);new h._cesium.PrimitiveCollection;h.Legend=[];var n=[];function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):a.push(e[t])}function t(){if(h._option.extrudedHeight&&(d.extrudedHeight=h._option.extrudedHeight),/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)){var e=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");d.extrudedHeight=parseFloat(s.properties[e])}if(d.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)){var t=h._option.material.replace(/\[/,"").replace(/\]/,"");d.material=s.properties[t],h._core.isHtmlColor(d.material)?d.material=h._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=h._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=h._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha))}else h._option.material&&(d.material=h._option.material),d.material&&(h._core.isHtmlColor(d.material)?d.material=h._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=h._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=h._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha)));if(2<=a.length){var i=h._cesium.Cartesian3.fromDegreesArray(a);d.polygonHierarchy=new h._cesium.PolygonHierarchy(i);var r=new h._cesium.PolygonGeometry(d),o=new h._cesium.GeometryInstance({id:s,geometry:r,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(d.material)}});n.push(o)}}for(var r=0;r<e.features.length;r++){var a=[],s=e.features[r];if(Array.isArray(s.geometry.coordinates)&&0<s.geometry.coordinates.length)if(Array.isArray(s.geometry.coordinates[0][0]))for(var o=0;o<s.geometry.coordinates.length;o++)a=[],s.geometry.coordinates[o].pop(),i(s.geometry.coordinates[o]),t();else i(s.geometry.coordinates),t()}var l=new h._cesium.ClassificationPrimitive1({geometryInstances:n,appearance:new h._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:h._core.Shaders("vertexShaderSource"),fragmentShaderSource:h._core.Shaders("fragmentShaderSource")}),classificationType:h._option.classificationType});c.data.geometryPrimitive=l,c.state=Cesium.QuadtreeTileLoadState.LOADING,c.state===Cesium.QuadtreeTileLoadState.LOADING&&(c.data.geometryPrimitive.update(u,[]),c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0)},error:function(){null==c.count&&(c.count=0),c.count+=1,2<=c.count?(c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0):c.state=Cesium.QuadtreeTileLoadState.START}}),c.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,l)},this._primitive=new l._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var u=this._viewer.scene;u.primitives.add(this._primitive),u.primitivesQuadTrees&&u.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var c={id:d.id,name:e,checked:!0,pId:this._core.isnull(r)?0:r,type:"polygonLayer",item:this,url:t.url,style:i};return this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(r)?0:r),"function"==typeof n&&n(this.item),this},_.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization=function(e,t,n,i,r,o){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(n)||this._core.isnull(n.material)||"["==n.material.toString().charAt(0)&&"]"==n.material.toString().charAt(n.material.length-1)||(this._core.isHtmlColor(n.material)?n.material=this._color.colorFromHtmlColor(n.material):(/^rgb/.test(n.material)&&(n.material=this._color.rgbaStringToRgbaObj(n.material)),1<n.material.r&&(n.material.r=n.material.r/255),1<n.material.g&&(n.material.g=n.material.g/255),1<n.material.b&&(n.material.b=n.material.b/255),1<n.material.a&&(n.material.a=n.material.a/255),n.material=this._color.createColor(n.material.r,n.material.g,n.material.b,n.material.a))),this._option=this._core.extend(a,n,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var l=[],d={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},m=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),this._Provider=new VectorTileProvider(this._viewer,this._cesium),this._Provider._normalTile=n.level_max-1,this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&m.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},!(t.level>=n.level_min&&t.level<n.level_max&&m.item.show))return t.state=m._cesium.QuadtreeTileLoadState.LOADING,void(t.state===m._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=m._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));var r=loadsh.filter(l,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=r.length&&r[0].data&&0<r[0].data.length)return t.data.geometryPrimitive=new m._cesium.Primitive({geometryInstances:r[0].data,appearance:new m._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:m._cesium.ShadowMode.ENABLED}),t.state=m._cesium.QuadtreeTileLoadState.LOADING,void(t.state===m._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=m._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));if(0<m.PrimitiveData.length)for(var o=0;o<m.PrimitiveData.length;o++)if(m.PrimitiveData[o].key==i)return void(m.Primitivekey.includes(i)||m.Primitivekey.push(i));m.Primitivekey.includes(i)||(m.Primitivekey.push(i),l.push({level:t.level,x:t.x,y:t.y,data:void 0}),function(c){var e=m._urlTemplate.replace(window.encodeURIComponent("{x}"),c.x).replace(window.encodeURIComponent("{y}"),c.y).replace(window.encodeURIComponent("{z}"),c.level);m.tilesLength++;var h="z"+c.level+"x"+c.x+"y"+c.y;m._cache&&(e+="&"+m._core.getuid()),m._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var s=new m._cesium.PrimitiveCollection;function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):l.push(e[t])}function t(){if(m._option.extrudedHeight&&(d.extrudedHeight=m._option.extrudedHeight),/^\[/.test(m._option.extrudedHeight)&&/\]$/.test(m._option.extrudedHeight)){var e=m._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");d.extrudedHeight=parseFloat(u.properties[e])}if(d.material=m._option.material,/^\[/.test(m._option.material)&&/\]$/.test(m._option.material)){var t=m._option.material.replace(/\[/,"").replace(/\]/,"");d.material=u.properties[t],m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha))}else m._option.material&&(d.material=m._option.material),d.material&&(m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha)));if(2<=l.length){var i=m._cesium.Cartesian3.fromDegreesArray(l);d.polygonHierarchy=new m._cesium.PolygonHierarchy(i);var r=new m._cesium.PolygonGeometry(d),o=new m._cesium.GeometryInstance({id:u,geometry:r,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(d.material)}}),n=new m._cesium.ClassificationPrimitive({geometryInstances:o,appearance:new m._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:m._core.Shaders("vertexShaderSource"),fragmentShaderSource:m._core.Shaders("fragmentShaderSource")}),classificationType:m._option.classificationType}),a="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue;m.Legend.push(a),s.add(n)}}m.Legend=[];for(var r=0;r<e.features.length;r++){var l=[],u=e.features[r];if(Array.isArray(u.geometry.coordinates)&&0<u.geometry.coordinates.length)if(Array.isArray(u.geometry.coordinates[0][0]))for(var o=0;o<u.geometry.coordinates.length;o++)l=[],u.geometry.coordinates[o].pop(),i(u.geometry.coordinates[o]),t();else i(u.geometry.coordinates),t()}var n=s;m.probj.push(n);var a={level:c.level,key:h,data:n};m.loadFinishKey.push(h),m.PrimitiveData.push(a),m._viewer.scene.primitives.add(n),m.returnCount++,m.removeObsoletePrimitives(c)},error:function(){var e=m.Primitivekey.indexOf(h);-1<e&&m.Primitivekey.splice(e,1),l=loadsh.remove(l,function(e){return e.x==c.x&&e.y==c.y&&e.level==c.level})},complete:function(e,t){c.state=m._cesium.QuadtreeTileLoadState.LOADING,c.state===m._cesium.QuadtreeTileLoadState.LOADING&&(c.data.geometryPrimitive&&(c.state=m._cesium.QuadtreeTileLoadState.DONE),c.renderable=!0)}})}(t))}},this._primitive=new m._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var u=this._viewer.scene;u.primitives.add(this._primitive),u.primitivesQuadTrees&&u.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var c={id:d.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:n};return this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},_.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization1=function(e,t,u,i,r,o){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(u)||this._core.isnull(u.material)||"["==u.material.toString().charAt(0)&&"]"==u.material.toString().charAt(u.material.length-1)||(this._core.isHtmlColor(u.material)?u.material=this._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=this._color.rgbaStringToRgbaObj(u.material)),1<u.material.r&&(u.material.r=u.material.r/255),1<u.material.g&&(u.material.g=u.material.g/255),1<u.material.b&&(u.material.b=u.material.b/255),1<u.material.a&&(u.material.a=u.material.a/255),u.material=this._color.createColor(u.material.r,u.material.g,u.material.b,u.material.a))),this._option=this._core.extend(n,u,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var c=[],d={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},m=this;this._urlTemplate=t.url+"?"+this._serialize(a.urlParams),this._Provider=new VectorTileProvider(this._viewer,this._cesium),this._Provider._normalTile=u.level_max-1,this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&m.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},!(t.level>=u.level_min&&t.level<u.level_max&&m.item.show))return t.state=m._cesium.QuadtreeTileLoadState.LOADING,void(t.state===m._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=m._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));var r=loadsh.filter(c,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=r.length&&r[0].data&&0<r[0].data.length)return t.data.geometryPrimitive=new m._cesium.Primitive({geometryInstances:r[0].data,appearance:new m._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:m._cesium.ShadowMode.ENABLED}),t.state=m._cesium.QuadtreeTileLoadState.LOADING,void(t.state===m._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=m._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));if(0<m.PrimitiveData.length)for(var o=0;o<m.PrimitiveData.length;o++)if(m.PrimitiveData[o].key==i)return void(m.Primitivekey.includes(i)||m.Primitivekey.push(i));if(!m.Primitivekey.includes(i)){m.Primitivekey.push(i),c.push({level:t.level,x:t.x,y:t.y,data:void 0});var n=m._option.level_min+Math.floor((m._option.level_max-m._option.level_min)/2),a=_getLoadLevelTile(t,n);for(o=0;o<a.length;o++){var s=a[o],l="z"+s.level+"x"+s.x+"y"+s.y;m.loadAllKey.includes(l)||(m.loadAllKey.push(l),function(c){var e=m._urlTemplate.replace(window.encodeURIComponent("{x}"),c.x).replace(window.encodeURIComponent("{y}"),c.y).replace(window.encodeURIComponent("{z}"),c.level);m.tilesLength++;var h="z"+c.level+"x"+c.x+"y"+c.y;m._cache&&(e+="&"+m._core.getuid()),m._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var a=[];function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):s.push(e[t])}function t(){if(m._option.extrudedHeight&&(d.extrudedHeight=m._option.extrudedHeight),/^\[/.test(m._option.extrudedHeight)&&/\]$/.test(m._option.extrudedHeight)){var e=m._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");d.extrudedHeight=parseFloat(l.properties[e])}if(d.material=m._option.material,/^\[/.test(m._option.material)&&/\]$/.test(m._option.material)){var t=m._option.material.replace(/\[/,"").replace(/\]/,"");d.material=l.properties[t],m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha))}else m._option.material&&(d.material=m._option.material),d.material&&(m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha)));if(2<=s.length){var i=m._cesium.Cartesian3.fromDegreesArray(s);d.polygonHierarchy=new m._cesium.PolygonHierarchy(i);var r=new m._cesium.PolygonGeometry(d),o=new m._cesium.GeometryInstance({id:l,geometry:r,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(d.material)}}),n="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue;m.Legend.push(n),a.push(o)}}m.Legend=[];for(var r=0;r<e.features.length;r++){var s=[],l=e.features[r];if(Array.isArray(l.geometry.coordinates)&&0<l.geometry.coordinates.length)if(Array.isArray(l.geometry.coordinates[0][0]))for(var o=0;o<l.geometry.coordinates.length;o++)s=[],l.geometry.coordinates[o].pop(),i(l.geometry.coordinates[o]),t();else i(l.geometry.coordinates),t()}if(0<a.length){var n=new m._cesium.GroundPrimitive({geometryInstances:a,appearance:new m._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:m._core.Shaders("vertexShaderSource"),fragmentShaderSource:m._core.Shaders("fragmentShaderSource")}),classificationType:m._option.classificationType,show:m.item.show});m.probj.push(n);var u={level:c.level,key:h,data:n};m.loadFinishKey.push(h),m.PrimitiveData.push(u),m._viewer.scene.primitives.add(n),m.returnCount++}},error:function(){},complete:function(e,t){}})}(s))}}}},this._primitive=new m._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var s=this._viewer.scene;s.primitives.add(this._primitive),s.primitivesQuadTrees&&s.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var l={id:d.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:u};return this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},_.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization2=function(e,t,i,r,o,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var d={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},l=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams);var m=t.url+"?"+this._serialize(s.urlParams);this._Provider=new VectorTileProvider(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider.loadTile=function(e,t){!function(u,c,h){if(c.state===Cesium.QuadtreeTileLoadState.START){if(c.data={lines:[],geometryPrimitive:void 0},!(c.level>=i.level_min&&c.level<i.level_max&&h.item.show))return c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0;var e=m.replace(window.encodeURIComponent("{x}"),c.x).replace(window.encodeURIComponent("{y}"),c.y).replace(window.encodeURIComponent("{z}"),c.level);h._cache&&(e+="&"+h._core.getuid()),h._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return c.state=Cesium.QuadtreeTileLoadState.DONE,void(c.renderable=!0);var a=[];function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):s.push(e[t])}function t(){if(h._option.extrudedHeight&&(d.extrudedHeight=h._option.extrudedHeight),/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)){var e=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");d.extrudedHeight=parseFloat(l.properties[e])}if(d.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)){var t=h._option.material.replace(/\[/,"").replace(/\]/,"");d.material=l.properties[t],h._core.isHtmlColor(d.material)?d.material=h._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=h._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=h._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha))}else h._option.material&&(d.material=h._option.material),d.material&&(h._core.isHtmlColor(d.material)?d.material=h._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=h._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=h._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha)));if(2<=s.length){var i=h._cesium.Cartesian3.fromDegreesArray(s);d.polygonHierarchy=new h._cesium.PolygonHierarchy(i);var r=new h._cesium.PolygonGeometry(d),o=new h._cesium.GeometryInstance({id:l,geometry:r,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(d.material)}}),n="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue;h.Legend.push(n),a.push(o)}}h.Legend=[];for(var r=0;r<e.features.length;r++){var s=[],l=e.features[r];if(Array.isArray(l.geometry.coordinates)&&0<l.geometry.coordinates.length)if(Array.isArray(l.geometry.coordinates[0][0]))for(var o=0;o<l.geometry.coordinates.length;o++)s=[],l.geometry.coordinates[o].pop(),i(l.geometry.coordinates[o]),t();else i(l.geometry.coordinates),t()}0==a.length&&(c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0);var n=new h._cesium.GroundPrimitive1({geometryInstances:a,appearance:new h._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:h._core.Shaders("vertexShaderSource"),fragmentShaderSource:h._core.Shaders("fragmentShaderSource")}),classificationType:h._option.classificationType});c.data.geometryPrimitive=n,c.state=Cesium.QuadtreeTileLoadState.LOADING,c.state===Cesium.QuadtreeTileLoadState.LOADING&&(c.data.geometryPrimitive.update1(u,[]),c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0)},error:function(){c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0}}),c.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,l)},this._primitive=new l._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var u=this._viewer.scene;u.primitives.add(this._primitive),u.primitivesQuadTrees&&u.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var c={id:d.id,name:e,checked:!0,pId:this._core.isnull(r)?0:r,type:"polygonLayer",item:this,url:t.url,style:i};return this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(r)?0:r),"function"==typeof n&&n(this.item),this},_.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization3=function(e,t,i,r,o,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var m={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},l=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams);var u=t.url+"?"+this._serialize(s.urlParams);this._Provider=new VectorTileProvider(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider.loadTile=function(e,t){!function(a,h,d){if(h.state===Cesium.QuadtreeTileLoadState.START){if(h.data={lines:[],geometryPrimitive:void 0},!(h.level>=i.level_min&&h.level<i.level_max&&d.item.show))return h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0;var e=u.replace(window.encodeURIComponent("{x}"),h.x).replace(window.encodeURIComponent("{y}"),h.y).replace(window.encodeURIComponent("{z}"),h.level);d._cache&&(e+="&"+d._core.getuid()),d._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var s=["#ffff00","#ffcc00","#ff3300","#ccff00","#cccc00","#99ff66","#999933","#66cc99","#6633ff","#33ffff","#3399cc","#009933","#ccccff","#ff99ff","#9966ff","#336699"];if(null==e)return h.state=Cesium.QuadtreeTileLoadState.DONE,void(h.renderable=!0);var l=[];function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):u.push(e[t])}function t(){if(d._option.extrudedHeight&&(m.extrudedHeight=d._option.extrudedHeight),/^\[/.test(d._option.extrudedHeight)&&/\]$/.test(d._option.extrudedHeight)){var e=d._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");m.extrudedHeight=parseFloat(c.properties[e])}if(m.material=d._option.material,/^\[/.test(d._option.material)&&/\]$/.test(d._option.material)){var t=d._option.material.replace(/\[/,"").replace(/\]/,"");m.material=c.properties[t],d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha))}else d._option.material&&(m.material=d._option.material),m.material&&(d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha)));if(2<=u.length){var i=d._cesium.Cartesian3.fromDegreesArray(u);m.polygonHierarchy=new d._cesium.PolygonHierarchy(i),0!=m.extrudedHeight&&"0"!=m.extrudedHeight&&null!=m.extrudedHeight&&null!=m.extrudedHeight||(m.extrudedHeight=1e4);var r=new d._cesium.PolygonGeometry(m),o=s[Math.floor(Math.random()*s.length)],n=new d._cesium.GeometryInstance({id:c,geometry:r,attributes:{color:d._cesium.ColorGeometryInstanceAttribute.fromColor(d._cesium.Color.fromCssColorString(o).withAlpha(.5))}}),a="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue;d.Legend.push(a),l.push(n)}}d.Legend=[];for(var r=0;r<e.features.length;r++){var u=[],c=e.features[r];if(Array.isArray(c.geometry.coordinates)&&0<c.geometry.coordinates.length)if(Array.isArray(c.geometry.coordinates[0][0]))for(var o=0;o<c.geometry.coordinates.length;o++)u=[],c.geometry.coordinates[o].pop(),i(c.geometry.coordinates[o]),t();else i(c.geometry.coordinates),t()}0==l.length&&(h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0);var n=new d._cesium.ClassificationPrimitive1({geometryInstances:l,classificationType:d._cesium.ClassificationType.BOTH});h.data.geometryPrimitive=n,h.state=Cesium.QuadtreeTileLoadState.LOADING,h.state===Cesium.QuadtreeTileLoadState.LOADING&&(h.data.geometryPrimitive.update(a,[]),h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0)},error:function(){h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0}}),h.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,l)},this._primitive=new l._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var c=this._viewer.scene;c.primitives.add(this._primitive),c.primitivesQuadTrees&&c.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var h={id:m.id,name:e,checked:!0,pId:this._core.isnull(r)?0:r,type:"polygonLayer",item:this,url:t.url,style:i};return this.setTreeobj(h),this._tree.insertGroupId(h,this._core.isnull(r)?0:r),"function"==typeof n&&n(this.item),this},_.prototype.createPointGeoJsonFeatureLayerProvider=function(e,t,l,i,r,o){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};(a=this)._core.isnull(l)||a._core.isnull(l.color)||/^\[/.test(l.color)&&"["==l.color.toString().charAt(0)&&"]"==l.color.toString().charAt(l.color.length-1)||(a._core.isHtmlColor(l.color)?l.color=a._color.colorFromHtmlColor(l.color):(/^rgb/.test(l.color)&&(l.color=a._color.rgbaStringToRgbaObj(l.color)),1<l.color.r&&(l.color.r=l.color.r/255),1<l.color.g&&(l.color.g=l.color.g/255),1<l.color.b&&(l.color.b=l.color.b/255),1<l.color.a&&(l.color.a=l.color.a/255),l.color=a._color.createColor(l.color.r,l.color.g,l.color.b,l.color.a))),a._core.isnull(l)||a._core.isnull(l.outlineColor)||/^\[/.test(l.outlineColor)&&"["==l.outlineColor.toString().charAt(0)&&"]"==l.outlineColor.toString().charAt(l.outlineColor.length-1)||(a._core.isHtmlColor(l.outlineColor)?l.outlineColor=a._color.colorFromHtmlColor(l.outlineColor):(/^rgb/.test(l.outlineColor)&&(l.outlineColor=a._color.rgbaStringToRgbaObj(l.outlineColor)),1<l.outlineColor.r&&(l.outlineColor.r=l.outlineColor.r/255),1<l.outlineColor.g&&(l.outlineColor.g=l.outlineColor.g/255),1<l.outlineColor.b&&(l.outlineColor.b=l.outlineColor.b/255),1<l.outlineColor.a&&(l.outlineColor.a=l.outlineColor.a/255),l.outlineColor=a._color.createColor(l.outlineColor.r,l.outlineColor.g,l.outlineColor.b,l.outlineColor.a)));var a=this;this._urlTemplate=t.url+"?"+this._serialize(n.urlParams);var u=t.url+"?"+this._serialize(n.urlParams);this._Provider=new VectorTileProvider(this._viewer,this._cesium),this._Provider._normalTile=l.level_max-1;var s={Name:"",text:"",font:" 30px sans-serif",pixelSize:10,style:a._cesium.LabelStyle.OUTLINE,fillColor:a._cesium.Color.WHITE,outlineColor:a._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new a._cesium.Color(.165,.165,.165,.8),backgroundPadding:new a._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:a._cesium.HorizontalOrigin.CENTER,verticalOrigin:a._cesium.VerticalOrigin.CENTER,eyeOffset:a._cesium.Cartesian3.ZERO,pixelOffset:a._cesium.Cartesian2.ZERO,heightReference:a._cesium.HeightReference.NONE,scaleByDistance:new a._cesium.NearFarScalar(0,0,1,1)};a._core.isnull(l)||a._core.isnull(l.backgroundColor)||/^\[/.test(l.backgroundColor)&&"["==l.backgroundColor.toString().charAt(0)&&"]"==l.backgroundColor.toString().charAt(l.backgroundColor.length-1)||(a._core.isHtmlColor(l.backgroundColor)?l.backgroundColor=a._color.colorFromHtmlColor(l.backgroundColor):(/^rgb/.test(l.backgroundColor)&&(l.backgroundColor=a._color.rgbaStringToRgbaObj(l.backgroundColor)),1<l.backgroundColor.r&&(l.backgroundColor.r=l.backgroundColor.r/255),1<l.backgroundColor.g&&(l.backgroundColor.g=l.backgroundColor.g/255),1<l.backgroundColor.b&&(l.backgroundColor.b=l.backgroundColor.b/255),1<l.backgroundColor.a&&(l.backgroundColor.a=l.backgroundColor.a/255),l.backgroundColor=a._color.createColor(l.backgroundColor.r,l.backgroundColor.g,l.backgroundColor.b,l.backgroundColor.a)));var c=a._core.extend(s,l,!0);a._core.isnull(l.near)&&(l.near=0),a._core.isnull(l.far)&&(l.far=999999999);var h=parseFloat(l.near),d=parseFloat(l.far),m=new a._cesium.DistanceDisplayCondition(h,d);c.distanceDisplayCondition=m,a._core.isnull(l.font_size)&&(l.font_size="30px"),a._core.isnull(l.font_family)&&(l.font_family=" sans-serif"),c.font=parseFloat(l.font_size)+"px "+l.font_family;l.material;this._Provider.loadTile=function(e,t){!function(t,i,s){if(i.state===Cesium.QuadtreeTileLoadState.START){if(i.data={lines:[],geometryPrimitive:void 0},!(i.level>=l.level_min&&i.level<l.level_max&&s.item.show))return i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0;var e=u.replace(window.encodeURIComponent("{x}"),i.x).replace(window.encodeURIComponent("{y}"),i.y).replace(window.encodeURIComponent("{z}"),i.level);s._cache&&(e+="&"+s._core.getuid()),s._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return i.state=Cesium.QuadtreeTileLoadState.DONE,void(i.renderable=!0);var a=new s._cesium.PointPrimitiveCollection;e.features.forEach(function(e){c.id=e;var t=0;if(/^\[/.test(c.pointHeight)&&/\]$/.test(c.pointHeight)){var i=c.pointHeight.replace(/\[/,"").replace(/\]/,"");t=parseFloat(e.properties[i])}else void 0!==c.pointHeight&&""!==c.pointHeight?t=parseFloat(c.pointHeight):null!=e.properties.height&&(t=parseFloat(e.properties.height));if(/^\[/.test(l.color)&&/\]$/.test(l.color)){var r=l.color.replace(/\[/,"").replace(/\]/,"");c.color=e.properties[r],s._core.isHtmlColor(c.color)?c.color=s._color.colorFromHtmlColor(c.color):(/^rgb/.test(c.color)&&(c.color=s._color.rgbaStringToRgbaObj(c.color)),1<c.color.r&&(c.color.r=c.color.r/255),1<c.color.g&&(c.color.g=c.color.g/255),1<c.color.b&&(c.color.b=c.color.b/255),1<c.color.a&&(c.color.a=c.color.a/255),c.color=s._color.createColor(c.color.r,c.color.g,c.color.b,c.color.a))}if(/^\[/.test(l.outlineColor)&&/\]$/.test(l.outlineColor)){r=l.outlineColor.replace(/\[/,"").replace(/\]/,"");c.outlineColor=e.properties[r],s._core.isHtmlColor(c.outlineColor)?c.outlineColor=s._color.colorFromHtmlColor(c.outlineColor):(/^rgb/.test(c.outlineColor)&&(c.outlineColor=s._color.rgbaStringToRgbaObj(c.outlineColor)),1<c.outlineColor.r&&(c.outlineColor.r=c.outlineColor.r/255),1<c.outlineColor.g&&(c.outlineColor.g=c.outlineColor.g/255),1<c.outlineColor.b&&(c.outlineColor.b=c.outlineColor.b/255),1<c.outlineColor.a&&(c.outlineColor.a=c.outlineColor.a/255),c.outlineColor=s._color.createColor(c.outlineColor.r,c.outlineColor.g,c.outlineColor.b,c.outlineColor.a))}c.position=new s._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),c.text=e.properties.name;var o={show:c.show,position:c.position,pixelSize:c.pixelSize,color:c.color,outlineColor:c.outlineColor,outlineWidth:c.outlineWidth,id:e};if(c.color&&c.color.red){var n="color:"+255*c.color.red+","+255*c.color.green+","+255*c.color.blue+";outlineColor:"+255*c.outlineColor.red+","+255*c.outlineColor.green+","+255*c.outlineColor.blue;s.Legend.push(n)}o.id.treeID=l.id,o.id.VectorType="point",o.id.VectorStyle={show:o.show,pointHeight:t,position:o.position,pixelSize:o.pixelSize,color:o.color,outlineColor:o.outlineColor,outlineWidth:o.outlineWidth},a.add(o)}),i.data.geometryPrimitive=a,i.state=Cesium.QuadtreeTileLoadState.LOADING,i.state===Cesium.QuadtreeTileLoadState.LOADING&&(i.data.geometryPrimitive.update(t,[]),i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0)},error:function(){null==i.count&&(i.count=0),i.count+=1,2<=i.count?(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0):i.state=Cesium.QuadtreeTileLoadState.START}}),i.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,a)},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});var p=this._viewer.scene,g=p.primitives;l&&l.time&&(this._Provider._availability=new a._cesium.TimeIntervalCollection([new a._cesium.TimeInterval({start:l.time.start?a._cesium.JulianDate.fromDate(new Date(l.time.start)):a._cesium.Iso8601.MINIMUM_VALUE,stop:l.time.end?a._cesium.JulianDate.fromDate(new Date(l.time.end)):a._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),g.add(this._primitive),p.primitivesQuadTrees&&p.primitivesQuadTrees.push(this._primitive),r?(this.item.show=!0,this.setVisibility(!0)):this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var f={id:l.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t.url,style:l};return this._Provider.treeID=l.id,this.setTreeobj(f),this._tree.insertGroupId(f,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},_.prototype.VolumeVectorGeoJsonFeatureLayerOptimization=function(e,t,i,r,o,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var m={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},l=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams);var u=t.url+"?"+this._serialize(s.urlParams);this._Provider=new VectorTileProvider(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider.loadTile=function(e,t){!function(c,h,d){if(h.state===Cesium.QuadtreeTileLoadState.START){if(h.data={lines:[],geometryPrimitive:void 0},!(h.level>=i.level_min&&h.level<i.level_max&&d.item.show))return h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0;var e=u.replace(window.encodeURIComponent("{x}"),h.x).replace(window.encodeURIComponent("{y}"),h.y).replace(window.encodeURIComponent("{z}"),h.level);d._cache&&(e+="&"+d._core.getuid()),d._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return h.state=Cesium.QuadtreeTileLoadState.DONE,void(h.renderable=!0);var a=[];function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):(s.push(e[t]),2!==t||l||(l=!0))}function t(){if(/^\[/.test(d._option.extrudedHeight)&&/\]$/.test(d._option.extrudedHeight)){var e=d._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");m.extrudedHeight=parseFloat(u.properties[e])}else d._option.extrudedHeight&&(m.extrudedHeight=parseFloat(d._option.extrudedHeight));if(m.material=d._option.material,/^\[/.test(d._option.material)&&/\]$/.test(d._option.material)){var t=d._option.material.replace(/\[/,"").replace(/\]/,"");m.material=u.properties[t],d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha))}else d._option.material&&(m.material=d._option.material),m.material&&(d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha)));if(2<=s.length){var i=l?d._cesium.Cartesian3.fromDegreesArrayHeights(s):d._cesium.Cartesian3.fromDegreesArray(s);m.polygonHierarchy=new d._cesium.PolygonHierarchy(i);var r=new d._cesium.PolygonGeometry(m);u.treeID=m.id,u.VectorType="polygon",u.VectorStyle={haveZ:l,extrudedHeight:m.extrudedHeight,positions:s,material:m.material};var o=new d._cesium.GeometryInstance({id:u,geometry:r,attributes:{color:new d._cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}}),n="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue;d.Legend.push(n),a.push(o)}}d.Legend=[];for(var r=0;r<e.features.length;r++){var s=[],l=!1,u=e.features[r];if(Array.isArray(u.geometry.coordinates)&&0<u.geometry.coordinates.length)if(Array.isArray(u.geometry.coordinates[0][0]))for(var o=0;o<u.geometry.coordinates.length;o++)s=[],u.geometry.coordinates[o].pop(),i(u.geometry.coordinates[o]),t();else i(u.geometry.coordinates),t()}0==a.length&&(h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0);var n=new d._cesium.Primitive({geometryInstances:a,appearance:new d._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:d._core.Shaders("vertexShaderSource"),fragmentShaderSource:d._core.Shaders("fragmentShaderSource")}),shadows:d._option.shadows});h.data.geometryPrimitive=n,h.state=Cesium.QuadtreeTileLoadState.LOADING,h.state===Cesium.QuadtreeTileLoadState.LOADING&&(h.data.geometryPrimitive.update(c,[]),h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0)},error:function(){h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0}}),h.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,l)},this._primitive=new l._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});var c=this._viewer.scene,h=c.primitives;i&&i.time&&(this._Provider._availability=new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:i.time.start?l._cesium.JulianDate.fromDate(new Date(i.time.start)):l._cesium.Iso8601.MINIMUM_VALUE,stop:i.time.end?l._cesium.JulianDate.fromDate(new Date(i.time.end)):l._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),h.add(this._primitive),c.primitivesQuadTrees&&c.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var d={id:m.id,name:e,checked:!0,pId:this._core.isnull(r)?0:r,type:"polygonLayer",item:this,url:t.url,style:i};return this._Provider.treeID=d.id,this.setTreeobj(d),this._tree.insertGroupId(d,this._core.isnull(r)?0:r),"function"==typeof n&&n(this.item),this},_.prototype.createModelGeoJsonFeatureLayerProvider0825=function(e,t,r,i,o,n){var a=this,s={url:"",color:a._cesium.Color.DARKSALMON,scale:2},l={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};a._core.isnull(r)||a._core.isnull(r.color)||/^\[/.test(r.color)&&"["==r.color.toString().charAt(0)&&"]"==r.color.toString().charAt(r.color.length-1)||(a._core.isHtmlColor(r.color)?r.color=a._color.colorFromHtmlColor(r.color):(/^rgb/.test(r.color)&&(r.color=a._color.rgbaStringToRgbaObj(r.color)),1<r.color.r&&(r.color.r=r.color.r/255),1<r.color.g&&(r.color.g=r.color.g/255),1<r.color.b&&(r.color.b=r.color.b/255),1<r.color.a&&(r.color.a=r.color.a/255),r.color=a._color.createColor(r.color.r,r.color.g,r.color.b,r.color.a)));var u=a._core.extend(s,r,!0);a._core.isnull(r.near)&&(r.near=0),a._core.isnull(r.far)&&(r.far=999999999);var c=parseFloat(r.near),h=parseFloat(r.far),d=new a._cesium.DistanceDisplayCondition(c,h);u.distanceDisplayCondition=d;r.material;this._urlTemplate=t.url+"?"+this._serialize(l.urlParams);var m=t.url+"?"+this._serialize(l.urlParams);this._Provider=new VectorTileProvider(this._viewer,this._cesium),this._Provider._normalTile=r.level_max-1,this._Provider._minimumHeight=parseFloat(u.height)||0,this._Provider.loadTile=function(t,i){if(i.state===Cesium.QuadtreeTileLoadState.START){if(i.data={lines:[],geometryPrimitive:void 0},!(i.level>=r.level_min&&i.level<r.level_max&&a.item.show))return i.state=Cesium.QuadtreeTileLoadState.DONE,void(i.renderable=!0);var e=m.replace(window.encodeURIComponent("{x}"),i.x).replace(window.encodeURIComponent("{y}"),i.y).replace(window.encodeURIComponent("{z}"),i.level);a._cache&&(e+="&"+a._core.getuid()),a._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return i.state=Cesium.QuadtreeTileLoadState.DONE,void(i.renderable=!0);var o=new a._cesium.PrimitiveCollection({isModel:!0});e.features.forEach(function(e){var t=(u.id=e).geometry.coordinates[2]||0;if(null!=e.properties.height&&(t=parseFloat(e.properties.height)),/^\[/.test(u.height)&&/\]$/.test(u.height)){var i=u.height.replace(/\[/,"").replace(/\]/,"");t+=parseFloat(e.properties[i])}else t+=parseFloat(u.height)||0;u.modelMatrix=a._cesium.Transforms.eastNorthUpToFixedFrame(a._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t));var r=a._cesium.Model.fromGltf({id:e,url:u.uri,color:u.color,modelMatrix:u.modelMatrix,scale:u.scale,heightReference:parseInt(u.heightReference),distanceDisplayCondition:u.distanceDisplayCondition});o.add(r)}),0==e.features.length&&(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0),i.data.geometryPrimitive=o,i.state=Cesium.QuadtreeTileLoadState.LOADING,i.state===Cesium.QuadtreeTileLoadState.LOADING&&(i.data.geometryPrimitive.update(t,[]),i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0)},error:function(){null==i.count&&(i.count=0),i.count+=1,2<=i.count?(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0):i.state=Cesium.QuadtreeTileLoadState.START}}),i.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new a._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var p=this._viewer.scene;p.primitives.add(this._primitive),p.primitivesQuadTrees&&p.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var g={id:u.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:r};return this.setTreeobj(g),this._tree.insertGroupId(g,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item),this},_.prototype.createModelGeoJsonFeatureLayerProvider=function(e,t,o,i,r,n){var a=this,s={url:"",color:a._cesium.Color.DARKSALMON,scale:2},l={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};a._core.isnull(o)||a._core.isnull(o.color)||/^\[/.test(o.color)&&"["==o.color.toString().charAt(0)&&"]"==o.color.toString().charAt(o.color.length-1)||(a._core.isHtmlColor(o.color)?o.color=a._color.colorFromHtmlColor(o.color):(/^rgb/.test(o.color)&&(o.color=a._color.rgbaStringToRgbaObj(o.color)),1<o.color.r&&(o.color.r=o.color.r/255),1<o.color.g&&(o.color.g=o.color.g/255),1<o.color.b&&(o.color.b=o.color.b/255),1<o.color.a&&(o.color.a=o.color.a/255),o.color=a._color.createColor(o.color.r,o.color.g,o.color.b,o.color.a)));var u=a._core.extend(s,o,!0);a._core.isnull(o.near)&&(o.near=0),a._core.isnull(o.far)&&(o.far=999999999);var c=parseFloat(o.near),h=parseFloat(o.far),d=new a._cesium.DistanceDisplayCondition(c,h);u.distanceDisplayCondition=d;o.material;this._urlTemplate=t.url+"?"+this._serialize(l.urlParams);var m=t.url+"?"+this._serialize(l.urlParams);this._Provider=new VectorTileProvider(this._viewer,this._cesium),this._Provider._normalTile=o.level_max-1,this._Provider._minimumHeight=parseFloat(u.height)||0,this._Provider.loadTile=function(i,r){if(r.state===Cesium.QuadtreeTileLoadState.START){if(r.data={lines:[],geometryPrimitive:void 0},!(r.level>=o.level_min&&r.level<o.level_max&&a.item.show))return r.state=Cesium.QuadtreeTileLoadState.DONE,void(r.renderable=!0);var e=m.replace(window.encodeURIComponent("{x}"),r.x).replace(window.encodeURIComponent("{y}"),r.y).replace(window.encodeURIComponent("{z}"),r.level);a._cache&&(e+="&"+a._core.getuid()),a._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return r.state=Cesium.QuadtreeTileLoadState.DONE,void(r.renderable=!0);var o=[];e.features.forEach(function(e){var t=(u.id=e).geometry.coordinates[2]||0;if(null!=e.properties.height&&(t=parseFloat(e.properties.height)),/^\[/.test(u.height)&&/\]$/.test(u.height)){var i=u.height.replace(/\[/,"").replace(/\]/,"");t+=parseFloat(e.properties[i])}else t+=parseFloat(u.height)||0;var r=a._cesium.Transforms.eastNorthUpToFixedFrame(a._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t));Cesium.Matrix4.multiplyByUniformScale(r,u.scale,r),o.push({modelMatrix:r,modelId:e})});var t=new Cesium.ModelInstanceCollectionzh({url:u.uri,instances:o,color:u.color});0==e.features.length&&(r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0),r.data.geometryPrimitive=t,r.state=Cesium.QuadtreeTileLoadState.LOADING,r.state===Cesium.QuadtreeTileLoadState.LOADING&&(r.data.geometryPrimitive.update(i,[]),r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0)},error:function(){null==r.count&&(r.count=0),r.count+=1,2<=r.count?(r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0):r.state=Cesium.QuadtreeTileLoadState.START}}),r.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var p=this._viewer.scene,g=p.primitives;o&&o.time&&(this._Provider._availability=new a._cesium.TimeIntervalCollection([new a._cesium.TimeInterval({start:o.time.start?a._cesium.JulianDate.fromDate(new Date(o.time.start)):a._cesium.Iso8601.MINIMUM_VALUE,stop:o.time.end?a._cesium.JulianDate.fromDate(new Date(o.time.end)):a._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),g.add(this._primitive),p.primitivesQuadTrees&&p.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var f={id:u.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:o};return this.setTreeobj(f),this._tree.insertGroupId(f,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item),this},_.prototype.VolumeVectorGeoJsonFeatureLayerOptimization1=function(e,t,a,i,r,o){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(a)||this._core.isnull(a.material)||"["==a.material.toString().charAt(0)&&"]"==a.material.toString().charAt(a.material.length-1)||(this._core.isHtmlColor(a.material)?a.material=this._color.colorFromHtmlColor(a.material):(/^rgb/.test(a.material)&&(a.material=this._color.rgbaStringToRgbaObj(a.material)),1<a.material.r&&(a.material.r=a.material.r/255),1<a.material.g&&(a.material.g=a.material.g/255),1<a.material.b&&(a.material.b=a.material.b/255),1<a.material.a&&(a.material.a=a.material.a/255),a.material=this._color.createColor(a.material.r,a.material.g,a.material.b,a.material.a))),this._option=this._core.extend(n,a,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var l=[],u={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},c=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),this._Provider=new VectorTileProvider(this._viewer,this._cesium),this._Provider._normalTile=a.level_max-1,c._defaultStyle={outlineColor:Cesium.Color.fromCssColorString("rgba(209,204,226,0)"),lineWidth:0,outline:!0,fill:!0,fillColor:Cesium.Color.fromCssColorString("rgba(220,20,60,1)"),fillShow:"nod",tileCacheSize:200,showMaker:!1,showCenterLabel:!0,fontColor:Cesium.Color.fromCssColorString("rgba(255,0,0,1)"),labelOffsetX:-10,labelOffsetY:-5,fontSize:13,fontFamily:"黑体",pointColor:Cesium.Color.fromCssColorString("rgba(255,0,0,0)"),centerLabelPropertyName:"NAME"},-1!=c._option.fill.indexOf("[")?c._defaultStyle.fillShow=c._option.fill:c._defaultStyle.fillColor=Cesium.Color.fromCssColorString(c._option.fill),this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&c.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},t.level>a.level_max+2&&0<c.probj.length)for(;0<c.probj.length;n++){c._viewer.entities.remove(c.probj[0]);var r=c.probj.indexOf(c.probj[0]);c.probj.splice(r,1)}if(!(t.level>=a.level_min&&t.level<a.level_max&&c.item.show))return t.state=c._cesium.QuadtreeTileLoadState.LOADING,void(t.state===c._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=c._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));var o=loadsh.filter(l,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=o.length&&o[0].data&&0<o[0].data.length)return t.data.geometryPrimitive=new c._cesium.Primitive({geometryInstances:o[0].data,appearance:new c._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:c._cesium.ShadowMode.ENABLED}),t.state=c._cesium.QuadtreeTileLoadState.LOADING,void(t.state===c._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=c._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));if(0<c.PrimitiveData.length)for(var n=0;n<c.PrimitiveData.length;n++)if(c.PrimitiveData[n].key==i)return void(c.Primitivekey.includes(i)||c.Primitivekey.push(i));c.Primitivekey.includes(i)||(c.Primitivekey.push(i),l.push({level:t.level,x:t.x,y:t.y,data:void 0}),function(o){var e=c._urlTemplate.replace(window.encodeURIComponent("{x}"),o.x).replace(window.encodeURIComponent("{y}"),o.y).replace(window.encodeURIComponent("{z}"),o.level);c.tilesLength++;var n="z"+o.level+"x"+o.x+"y"+o.y;c._cache&&(e+="&"+c._core.getuid());var a={xMin:Cesium.Math.toDegrees(o._rectangle.west),yMin:Cesium.Math.toDegrees(o._rectangle.south),xMax:Cesium.Math.toDegrees(o._rectangle.east),yMax:Cesium.Math.toDegrees(o._rectangle.north)};c._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var t=e;c._tileWidth=256,c._tileHeight=256,c.x=o._x,c.y=o._y,c.level=o._level,c._createCanvas(),c._drawGeojson(c._context,0,0,e,a,c._tileWidth,c._tileHeight,c._fill,c._outline,c.x,c.y,c.level);var i=c._viewer.entities.add({ids:t,name:"Rotating rectangle with rotating texture coordinate",rectangle:{coordinates:o.rectangle,material:new c._cesium.ImageMaterialProperty({image:c._canvas,transparent:!0}),zIndex:o.level,classificationType:c._cesium.ClassificationType.BOTH}});c.probj.push(i);var r={level:o.level,key:n,data:i};c.loadFinishKey.push(n),c.PrimitiveData.push(r),c.returnCount++,c.removeObsoleteEntitiesxp(o.rectangle)},error:function(){o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0}})}(t))}},this._primitive=new c._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var h=this._viewer.scene;h.primitives.add(this._primitive),h.primitivesQuadTrees&&h.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var d={id:u.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:a};return this.setTreeobj(d),this._tree.insertGroupId(d,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},_.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationtest=function(e,t,a,i,r,o){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(a)||this._core.isnull(a.material)||"["==a.material.toString().charAt(0)&&"]"==a.material.toString().charAt(a.material.length-1)||(this._core.isHtmlColor(a.material)?a.material=this._color.colorFromHtmlColor(a.material):(/^rgb/.test(a.material)&&(a.material=this._color.rgbaStringToRgbaObj(a.material)),1<a.material.r&&(a.material.r=a.material.r/255),1<a.material.g&&(a.material.g=a.material.g/255),1<a.material.b&&(a.material.b=a.material.b/255),1<a.material.a&&(a.material.a=a.material.a/255),a.material=this._color.createColor(a.material.r,a.material.g,a.material.b,a.material.a))),this._option=this._core.extend(n,a,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var l=[],u={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},c=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),this._Provider=new VectorTileProvider(this._viewer,this._cesium),this._Provider._normalTile=a.level_max-1,c._defaultStyle={outlineColor:Cesium.Color.fromCssColorString("rgba(209,204,226,0)"),lineWidth:0,outline:!0,fill:!0,fillColor:Cesium.Color.fromCssColorString("rgba(220,20,60,1)"),fillShow:"nod",tileCacheSize:200,showMaker:!1,showCenterLabel:!0,fontColor:Cesium.Color.fromCssColorString("rgba(255,0,0,1)"),labelOffsetX:-10,labelOffsetY:-5,fontSize:13,fontFamily:"黑体",pointColor:Cesium.Color.fromCssColorString("rgba(255,0,0,0)"),centerLabelPropertyName:"NAME"},-1!=c._option.fill.indexOf("[")?c._defaultStyle.fillShow=c._option.fill:c._defaultStyle.fillColor=Cesium.Color.fromCssColorString(c._option.fill),this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&c.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},t.level>a.level_max+2&&0<c.probj.length)for(;0<c.probj.length;n++){c._viewer.entities.remove(c.probj[0]);var r=c.probj.indexOf(c.probj[0]);c.probj.splice(r,1)}if(!(t.level>=a.level_min&&t.level<a.level_max&&c.item.show))return t.state=c._cesium.QuadtreeTileLoadState.LOADING,void(t.state===c._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=c._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));var o=loadsh.filter(l,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=o.length&&o[0].data&&0<o[0].data.length)return t.data.geometryPrimitive=new c._cesium.Primitive({geometryInstances:o[0].data,appearance:new c._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:c._cesium.ShadowMode.ENABLED}),t.state=c._cesium.QuadtreeTileLoadState.LOADING,void(t.state===c._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=c._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));if(0<c.PrimitiveData.length)for(var n=0;n<c.PrimitiveData.length;n++)if(c.PrimitiveData[n].key==i)return void(c.Primitivekey.includes(i)||c.Primitivekey.push(i));c.Primitivekey.includes(i)||(c.Primitivekey.push(i),l.push({level:t.level,x:t.x,y:t.y,data:void 0}),function(o){var e=c._urlTemplate.replace(window.encodeURIComponent("{x}"),o.x).replace(window.encodeURIComponent("{y}"),o.y).replace(window.encodeURIComponent("{z}"),o.level);c.tilesLength++;var n="z"+o.level+"x"+o.x+"y"+o.y;c._cache&&(e+="&"+c._core.getuid());Cesium.Math.toDegrees(o._rectangle.west),Cesium.Math.toDegrees(o._rectangle.south),Cesium.Math.toDegrees(o._rectangle.east),Cesium.Math.toDegrees(o._rectangle.north);c._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var t=e;c._tileWidth=256,c._tileHeight=256,c.x=o._x,c.y=o._y,c.level=o._level;var i=c._viewer.entities.add({ids:t,name:"Rotating rectangle with rotating texture coordinate",rectangle:{coordinates:o.rectangle,material:new c._cesium.ImageMaterialProperty({image:e,transparent:!0}),zIndex:o.level,classificationType:c._cesium.ClassificationType.BOTH}});c.probj.push(i);var r={level:o.level,key:n,data:i};c.loadFinishKey.push(n),c.PrimitiveData.push(r),c.returnCount++,c.removeObsoleteEntitiesxp(o.rectangle)},error:function(){o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0}})}(t))}},this._primitive=new c._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var h=this._viewer.scene;h.primitives.add(this._primitive),h.primitivesQuadTrees&&h.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var d={id:u.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:a};return this.setTreeobj(d),this._tree.insertGroupId(d,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},_.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest=function(e,t,i,r,o,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var p={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},l=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams);var u=t.url+"?"+this._serialize(s.urlParams);this._Provider=new VectorTileProvider(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider._minimumHeight=parseFloat(i.height||0),this._Provider.loadTile=function(e,t){!function(h,d,m){if(d.state===Cesium.QuadtreeTileLoadState.START){if(d.data={lines:[],geometryPrimitive:void 0},!(d.level>=i.level_min&&d.level<i.level_max&&m.item.show))return d.state=Cesium.QuadtreeTileLoadState.DONE,d.renderable=!0;var e=u.replace(window.encodeURIComponent("{x}"),d.x).replace(window.encodeURIComponent("{y}"),d.y).replace(window.encodeURIComponent("{z}"),d.level);m._cache&&(e+="&"+m._core.getuid()),m._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var t=loadsh.cloneDeep(e);if(t.features.length<=0)return d.state=Cesium.QuadtreeTileLoadState.DONE,void(d.renderable=!0);if(null==t)return d.state=Cesium.QuadtreeTileLoadState.DONE,void(d.renderable=!0);var a=[];function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):(s.push(e[t]),2!==t||l||(l=!0))}function r(){if(/^\[/.test(m._option.extrudedHeight)&&/\]$/.test(m._option.extrudedHeight)){var e=m._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");p.extrudedHeight=parseFloat(u.properties[e])}if(p.material=m._option.material,/^\[/.test(m._option.material)&&/\]$/.test(m._option.material)){var t=m._option.material.replace(/\[/,"").replace(/\]/,"");p.material=u.properties[t],m._core.isHtmlColor(p.material)?p.material=m._color.colorFromHtmlColor(p.material):(/^rgb/.test(p.material)&&(p.material=m._color.rgbaStringToRgbaObj(p.material)),1<p.material.red&&(p.material.red=p.material.red/255),1<p.material.green&&(p.material.green=p.material.green/255),1<p.material.blue&&(p.material.blue=p.material.blue/255),1<p.material.alpha&&(p.material.a=p.material.alpha/255),p.material=m._color.createColor(p.material.red,p.material.green,p.material.blue,p.material.alpha))}else m._option.material&&(p.material=m._option.material),p.material&&(m._core.isHtmlColor(p.material)?p.material=m._color.colorFromHtmlColor(p.material):(/^rgb/.test(p.material)&&(p.material=m._color.rgbaStringToRgbaObj(p.material)),1<p.material.red&&(p.material.red=p.material.red/255),1<p.material.green&&(p.material.green=p.material.green/255),1<p.material.blue&&(p.material.blue=p.material.blue/255),1<p.material.alpha&&(p.material.a=p.material.alpha/255),p.material=m._color.createColor(p.material.red,p.material.green,p.material.blue,p.material.alpha)));if(2<=s.length){var i=l?m._cesium.Cartesian3.fromDegreesArrayHeights(s):m._cesium.Cartesian3.fromDegreesArray(s);p.polygonHierarchy=new m._cesium.PolygonHierarchy(i);var r=new m._cesium.PolygonGeometry(p);u.treeID=p.id,u.VectorType="polygon",u.VectorStyle={haveZ:l,extrudedHeight:p.extrudedHeight,positions:s,material:p.material};var o=new m._cesium.GeometryInstance({id:u,geometry:r,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(p.material)}}),n="material:"+255*p.material.red+","+255*p.material.green+","+255*p.material.blue;m.Legend.push(n),a.push(o)}}m.Legend=[];for(var o=0;o<t.features.length;o++){var s=[],l=!1,u=t.features[o];if(Array.isArray(u.geometry.coordinates)&&0<u.geometry.coordinates.length)if(Array.isArray(u.geometry.coordinates[0][0]))for(var n=0;n<u.geometry.coordinates.length;n++)s=[],u.geometry.coordinates[n].pop(),i(u.geometry.coordinates[n]),r();else i(u.geometry.coordinates),r()}0==a.length&&(d.state=Cesium.QuadtreeTileLoadState.DONE,d.renderable=!0);var c=new m._cesium.GroundPrimitive({geometryInstances:a,appearance:new m._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:m._core.Shaders("vertexShaderSource"),fragmentShaderSource:m._core.Shaders("fragmentShaderSource")}),classificationType:m._cesium.ClassificationType.BOTH,shadows:m._option.shadows});m.probj.push(c),d.data.geometryPrimitive=c,d.state=Cesium.QuadtreeTileLoadState.LOADING,d.state===Cesium.QuadtreeTileLoadState.LOADING&&(d.data.geometryPrimitive.update(h,[]),d.state=Cesium.QuadtreeTileLoadState.DONE,d.renderable=!0)},error:function(){null==d.count&&(d.count=0),d.count+=1,2<=d.count?(d.state=Cesium.QuadtreeTileLoadState.DONE,d.renderable=!0):d.state=Cesium.QuadtreeTileLoadState.START}}),d.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,l)},this._primitive=new l._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});var c=this._viewer.scene;c.primitives.add(this._primitive),c.primitivesQuadTrees&&c.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(p.id)&&(p.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+p.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var h={id:p.id,name:e,checked:!0,pId:this._core.isnull(r)?0:r,type:"polygonLayer",item:this,url:t.url,style:i};return this._Provider.treeID=h.id,this.setTreeobj(h),this._tree.insertGroupId(h,this._core.isnull(r)?0:r),"function"==typeof n&&n(this.item),this},_.prototype.createGeojsonImage=function(url){Cesium.loadText("http://36.7.136.132:8090/geoserver/swagger/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=swagger%3A_20200410153959_JZ11&maxFeatures=50&outputFormat=application%2Fjson").then(function(geojson){geojson=eval("("+geojson+")");for(var i=0;i<geojson.features.length;i++)geojson.features[i].properties.nod=0==i?"rgba(255,255,0,1)":1==i?"rgba(220,20,60,1)":2==i?"rgba(75,0,130,1)":3==i?"rgba(0,0,255,1)":4==i?"rgba(30,144,255,1)":"rgba(50,205,50,1)";var turf=Cesium.turf,mask=null;try{var bufferedOuterProvider=new VectorTileImageryProvider({source:geojson,zIndex:99,removeDuplicate:!1,defaultStyle:{outlineColor:"rgba(209,204,226,1)",lineWidth:0,outline:!0,fill:!0,fillColor:"rgba(209,204,226,1)",fillShow:"[nod]",tileCacheSize:200,showMaker:!1,showCenterLabel:!0,fontColor:"rgba(255,0,0,1)",labelOffsetX:-10,labelOffsetY:-5,fontSize:13,fontFamily:"黑体",centerLabelPropertyName:"NAME"},maximumLevel:20,minimumLevel:15,simplify:!1}),bufferedOuterLayer;bufferedOuterProvider.readyPromise.then(function(){bufferedOuterLayer=viewer.imageryLayers.addImageryProvider(bufferedOuterProvider),Cesium.Camera.DEFAULT_VIEW_RECTANGLE=bufferedOuterProvider.rectangle})}catch(e){console.log(e)}})},_.prototype._drawGeojson=function(a,s,l,e,u,t,i,c,h,r,o,n){var d=this;if(void 0===c&&(c=!0),void 0===h&&(h=!0),c||h){void 0===t&&(t=a.canvas.width-s),void 0===i&&(i=a.canvas.height-l);var m=new LonLatProjection(t,i),p=this._defaultStyle,g={labelStroke:p.labelStroke,labelStrokeWidth:p.labelStrokeWidth,labelStrokeColor:p.labelStrokeColor,pointSize:p.pointSize,fontSize:p.fontSize,fontFamily:p.fontFamily,color:p.fontColor.toCssColorString(),backgroundColor:p.pointColor.toCssColorString(),pointStyle:p.pointStyle,ringRadius:p.ringRadius,circleLineWidth:p.circleLineWidth,showMaker:p.showMaker,showLabel:p.showLabel,labelOffsetX:p.labelOffsetX,labelOffsetY:p.labelOffsetY,markerSymbol:p.makerImage instanceof Image?p.makerImage:p.makerImageEl},f=[];d._styleFilter&&(turf.featureEach(e,function(e,t){d._styleFilter&&(p=d._defaultStyle.clone(),d._styleFilter(e,p,r,o,n),e.style=p)}),e.features.sort(function(e,t){return e.style&&e.style.lineDash?1:t.style&&t.style.lineDash?-1:0})),turf.featureEach(e,function(e,t){"Polygon"!=e.geometry.type&&"MultiPolygon"!=e.geometry.type||v(e)}),f&&f.length&&function(e,r,o,n,a,t){var i=e.canvas,s=e.getImageData(0,0,i.width,i.height),l=document.createElement("canvas");l.width=i.width,l.height=i.height;var u=l.getContext("2d"),c=[];t.map(function(e){u.clearRect(0,0,l.width,l.height),u.beginPath();var i=0;e.map(function(e){var t=r.project(e,o);0==i?u.moveTo(n+t.x,a+t.y):u.lineTo(n+t.x,a+t.y),i++}),u.closePath(),u.fillStyle="rgba(255,255,255,1)",u.fill(),c=u.getImageData(0,0,l.width,l.height).data;for(var t=3;t<c.length;t+=4)0<c[t]&&(s.data[t]=0)}),e.putImageData(s,0,0)}(a,m,u,s,l,f),turf.featureEach(e,function(e,t){"LineString"!=e.geometry.type&&"MultiLineString"!=e.geometry.type||v(e)}),turf.featureEach(e,function(e,t){"Point"!=e.geometry.type&&"MultiPoint"!=e.geometry.type||v(e)})}function v(e,t){if(d._styleFilter){if(0==(p=e.style).show)return;g={labelStroke:p.labelStroke,labelStrokeWidth:p.labelStrokeWidth,labelStrokeColor:p.labelStrokeColor,pointSize:p.pointSize,fontSize:p.fontSize,fontFamily:p.fontFamily,color:p.fontColor.toCssColorString(),backgroundColor:p.pointColor.toCssColorString(),pointStyle:p.pointStyle,ringRadius:p.ringRadius,circleLineWidth:p.circleLineWidth,showMaker:p.showMaker,showLabel:p.showLabel,labelOffsetX:p.labelOffsetX,labelOffsetY:p.labelOffsetY,markerSymbol:p.makerImage instanceof Image?p.makerImage:p.makerImageEl}}else p=d._defaultStyle;if(a.lineWidth=p.lineWidth,a.strokeStyle=p.outlineColor.toCssColorString(),a.fillStyle=p.fillColor.toCssColorString(),-1!=p.fillShow.indexOf("[")){var i=p.fillShow.replace("[","").replace("]","");a.fillStyle=e.properties[i]}if(p.lineDash&&a.setLineDash(p.lineDash),a.lineCap=p.lineCap,p.shadowColor&&p.shadowColor instanceof Cesium.Color?a.shadowColor=p.shadowColor.toCssColorString():a.shadowColor=p.shadowColor,a.shadowBlur=p.shadowBlur,a.shadowOffsetX=p.shadowOffsetX,a.shadowOffsetY=p.shadowOffsetY,a.miterLimit=p.miterLimit,a.lineJoin=p.lineJoin,"Point"==e.geometry.type)drawMarker(a,m,u,s,l,e,c,h,p.labelPropertyName,g);else if("Polygon"==e.geometry.type&&p.fill){var r=turf.getCoords(e),o=drawContours(a,m,u,s,l,r,!0,!1,p);o&&o.map(function(e){e.style=p,f.push(e)})}else if("MultiPolygon"==e.geometry.type&&p.fill){try{turf.getCoords(e).map(function(e){var t=drawContours(a,m,u,s,l,e,!0,!1,p);t&&t.map(function(e){e.style=p,f.push(e)})})}catch(e){}}else if("MultiLineString"==e.geometry.type)if(e.properties.isOutline&&!p.outline);else{r=turf.getCoords(e);drawContours(a,m,u,s,l,r,!1,!0,p),r=null}else if("LineString"==e.geometry.type)if(e.properties.isOutline&&!p.outline);else{var n=turf.getCoords(e);drawContours(a,m,u,s,l,r=[n],!1,!0,p),r=n=null}}},_.prototype._createCanvas=function(){this._canvas=document.createElement("canvas"),this._canvas.width=this._tileWidth,this._canvas.height=this._tileHeight,this._context=this._canvas.getContext("2d"),this._context.lineWidth=this._defaultStyle.lineWidth,this._context.strokeStyle=this._defaultStyle.outlineColor.toCssColorString(),this._context.fillStyle=this._defaultStyle.fillColor.toCssColorString()},_.prototype.getLegend=function(){var e=[];return null!=this.Legend&&(e=this._core.unique(this.Legend)),e},_.prototype.removeObsoletePrimitives1=function(e){},_.prototype.removeObsoletePrimitives=function(e){for(var t=this._viewer.scene.globe._surface._tilesToRender.map(function(e){return e.level}),i=Math.min.apply(Math,_toConsumableArray(t)),r=Math.max.apply(Math,_toConsumableArray(t)),o=this.PrimitiveData.length-1;0<=o;o--){var n=this.PrimitiveData[o];if(n.level<i||n.level>r)if(this._viewer.scene.primitives.remove(n.data))-1<(h=this.Primitivekey.indexOf(this.loadFinishKey[o]))&&this.Primitivekey.splice(h,1),this.PrimitiveData.splice(o,1),this.loadFinishKey.splice(o,1)}var a=[],s=e.parent;if(s&&s.parent){var l=s.parent;a.push(l)}var u=e.children;a=a.concat(u);for(o=0;o<u.length;o++){var c=u[o].children;a=a.concat(c)}for(o=0;o<a.length;o++)if(a[o]){var h,d="z"+a[o].level+"x"+a[o].x+"y"+a[o].y;if(-1<(h=this.loadFinishKey.indexOf(d)))if(this._viewer.scene.primitives.remove(this.PrimitiveData[h].data))-1<(h=this.Primitivekey.indexOf(d))&&this.Primitivekey.splice(h,1),this.PrimitiveData.splice(h,1),this.loadFinishKey.splice(h,1)}},_.prototype.removeObsoleteEntities=function(e){for(var t=this._viewer.scene.globe._surface._tilesToRender.map(function(e){return e.level}),i=Math.min.apply(Math,_toConsumableArray(t))-1,r=Math.max.apply(Math,_toConsumableArray(t))+1,o=this.PrimitiveData.length-1;0<=o;o--){var n=this.PrimitiveData[o];if(n.level<i||n.level>r)if(this._viewer.entities.remove(n.data))-1<(h=this.Primitivekey.indexOf(this.loadFinishKey[o]))&&this.Primitivekey.splice(h,1),this.PrimitiveData.splice(o,1),this.loadFinishKey.splice(o,1)}var a=[],s=e.parent;if(s&&s.parent){var l=s.parent;a.push(l)}var u=e.children;a=a.concat(u);for(o=0;o<u.length;o++){var c=u[o].children;a=a.concat(c)}for(o=0;o<a.length;o++)if(a[o]){var h,d="z"+a[o].level+"x"+a[o].x+"y"+a[o].y;if(-1<(h=this.loadFinishKey.indexOf(d)))if(this._viewer.entities.remove(this.PrimitiveData[h].data))-1<(h=this.Primitivekey.indexOf(d))&&this.Primitivekey.splice(h,1),this.PrimitiveData.splice(h,1),this.loadFinishKey.splice(h,1)}},_.prototype.removeObsoleteEntitiesxp=function(e){for(var t=this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(e.west),this._cesium.Math.toDegrees(e.south)),i=this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(e.east),this._cesium.Math.toDegrees(e.north)),r=0;r<this.probj.length;r++)this._cesium.Rectangle.contains(this.probj[r].rectangle.coordinates.getValue(),this._cesium.Cartographic.fromCartesian(t)),this._cesium.Rectangle.contains(this.probj[r].rectangle.coordinates.getValue(),this._cesium.Cartographic.fromCartesian(i));for(var o=this._viewer.camera.computeViewRectangle(),n=0;n<this.probj.length;n++){var a=this.probj[n].rectangle.coordinates.getValue(),s=this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(a.west),this._cesium.Math.toDegrees(a.south)),l=this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(a.east),this._cesium.Math.toDegrees(a.north)),u=this._cesium.Rectangle.contains(o,this._cesium.Cartographic.fromCartesian(s)),c=this._cesium.Rectangle.contains(o,this._cesium.Cartographic.fromCartesian(l));this.probj[n].show=!(!u&&!c)}},_.prototype.computeCircle=function(e){this._core.isnull(e)&&(e=4);for(var t=[],i=0;i<360;i++){var r=this._cesium.Math.toRadians(i);t.push(new this._cesium.Cartesian2(e*Math.cos(r),e*Math.sin(r)))}return t},_.prototype.setTreeobj=function(e){this.treeobj=e},_.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},_.prototype.deleteObject=function(){if(this._viewer.scene.primitives.remove(this.item),this.probj&&0<this.probj.length&&(this._viewer.scene.primitives.remove(this.probj[0]),this.probj.pop()),null!=this.img&&this._viewer.imageryLayers.remove(this.img),this.primitve&&0<this.primitve.length){for(var e=0;e<this.primitve.length;e++)this._viewer.scene.primitives.remove(this.primitve[e]);this.primitve=[]}this.loadAllKey&&0<this.loadAllKey.length&&(this.loadAllKey=[]);try{this._Provider.remove()}catch(e){}},_.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(e)}catch(e){}},_.prototype.getLevel=function(){var e,t,i=this._viewer.camera;if(i&&i.positionCartographic&&i.positionCartographic.height){var r=this._viewer.scene.globe.getHeight(i.positionCartographic);!r&&(r=0),e=i.positionCartographic.height-r,t=Math.round(80955.31/(1+Math.pow(e/91610.74,7096758e-11))-40467.74)}else t=0;return t},_.prototype.setVisibility=function(e){try{if(this.loadAllKey=[],null!=this.item&&null!=this.item.show&&(this.item.show=e),null!=this.img&&(this.img.show=e),this.primitve&&0<this.primitve.length)for(var t=0;t<this.primitve.length;t++)this.primitve[t].show=e;if(this._Provider&&this._Provider.setStatus&&this._Provider.setStatus(e),this.probj&&0<this.probj.length)for(t=0;t<this.probj.length;t++)this.probj[t].show=e}catch(e){}},_.prototype.edit=function(e,t){return this.isEditting=e,this.editoption=t,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},_.prototype.isCache=function(e){this._cache=e},_.prototype.forceRefresh=function(){try{for(var e=0;e<this._Provider.quadtree._levelZeroTiles.length;e++)this._Provider.quadtree._levelZeroTiles[e].freeResources()}catch(e){}},_}),define("SGWorld/Creator/CreateStraightArrow",["../Core/Core","./Color","../ProjectTree/treeSource","../Analysis/Cdcl/Cdcl"],function(i,e,t,r){"use strict";function o(e,t){this._core=new i,this.type="StraightArrow",this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this.viewer=e,this.cesium=t,this.handler=new t.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.pointImageUrl="../../img/point.png",this.fillMaterial=t.Color.fromCssColorString("#0000FF").withAlpha(.8),this.outlineMaterial=new t.PolylineDashMaterialProperty({dashLength:16,color:t.Color.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.firstPoint=null,this.floatPoint=null,this.arrowEntity=null,this.state=-1,this.selectPoint=null,this.clickStep=0,this.modifyHandler=null}return o.prototype.disable=function(){this.positions=[],this.firstPoint&&(this.viewer.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new this.cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},o.prototype.startDraw=function(){var i=this;this.state=1,this.handler.setInputAction(function(e){var t;(t=i._core.getCatesian3FromPXjt(e.position,i.viewer,i.cesium))&&(0==i.positions.length&&(i.firstPoint=i.creatPoint(t),i.firstPoint.type="firstPoint",i.floatPoint=i.creatPoint(t),i.floatPoint.type="floatPoint",i.positions.push(t)),3==i.positions.length&&(i.firstPoint.show=!1,i.floatPoint.show=!1,i.handler.destroy(),i.arrowEntity.objId=i.objId,i.state=-1),i.positions.push(t.clone()))},this.cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){var t;i.positions.length<1||(t=i._core.getCatesian3FromPXjt(e.endPosition,i.viewer,i.cesium))&&(i.floatPoint.position.setValue(t),2<=i.positions.length&&(i.cesium.defined(i.arrowEntity)?(i.positions.pop(),i.positions.push(t)):(i.positions.push(t),i.arrowEntity=i.showArrowOnMap(i.positions))))},this.cesium.ScreenSpaceEventType.MOUSE_MOVE)},o.prototype.startModify=function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;var r=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new this.cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(e){var t=r.viewer.scene.pick(e.position);if(r.cesium.defined(t)&&t.id?(r.clickStep++,t.id.objId||(r.selectPoint=t.id)):(r.modifyHandler.destroy(),r.modifyHandler=null,r.firstPoint.show=!1,r.floatPoint.show=!1,r.state=-1),2==r.clickStep){var i;if(r.clickStep=0,!(i=r._core.getCatesian3FromPXjt(e.position,r.viewer,r.cesium)))return;r.selectPoint&&(r.selectPoint.position.setValue(i),r.selectPoint=null)}},this.cesium.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){var t;r.selectPoint&&((t=r._core.getCatesian3FromPXjt(e.endPosition,r.viewer,r.cesium))&&(r.selectPoint.position.setValue(t),"firstPoint"==r.selectPoint.type&&(r.positions[1]=t),"floatPoint"==r.selectPoint.type&&(r.positions[2]=t)))},this.cesium.ScreenSpaceEventType.MOUSE_MOVE)},o.prototype.createByData=function(e){this.state=-1,this.positions=[];for(var t=[],i=0;i<e.length;i++){var r=this.cesium.Cartesian3.fromDegrees(e[i][0],e[i][1]);t.push(r)}this.positions=t,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=!1,this.floatPoint.show=!1,this.arrowEntity.objId=this.objId},o.prototype.clear=function(){this.state=0,this.firstPoint&&this.viewer.entities.remove(this.firstPoint),this.floatPoint&&this.viewer.entities.remove(this.floatPoint),this.arrowEntity&&this.viewer.entities.remove(this.arrowEntity),this.state=-1},o.prototype.getLnglats=function(){for(var e=[],t=0;t<this.positions.length;t++){var i=this.cartesianToLatlng(this.positions[t]);e.push(i)}return e},o.prototype.getPositions=function(){return this.positions},o.prototype.creatPoint=function(e){var t=this.viewer.entities.add({position:e,billboard:{image:this.pointImageUrl,verticalOrigin:this.cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}});return t.attr="editPoint",t},o.prototype.showArrowOnMap=function(l){var u=this;return this.viewer.entities.add({polygon:new u.cesium.PolygonGraphics({hierarchy:new u.cesium.CallbackProperty(function(){if(l.length<2)return null;var e=l[1],t=l[2],i=u.cartesianToLatlng(e),r=u.cartesianToLatlng(t),o=[],n=xp.algorithm.fineArrow([i[0],i[1]],[r[0],r[1]]);if(-1!=JSON.stringify(n).indexOf("null"))return[];for(var a=0;a<n.length;a++){var s=new u.cesium.Cartesian3(n[a].x,n[a].y,n[a].z);o.push(s)}return new u.cesium.PolygonHierarchy(o)},!1),show:!0,fill:!0,extrudedHeight:100,classificationType:u.cesium.ClassificationType.TERRAIN,material:u.fillMaterial})})},o.prototype.cartesianToLatlng=function(e){var t=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),i=this.cesium.Math.toDegrees(t.latitude);return[this.cesium.Math.toDegrees(t.longitude),i]},o}),define("SGWorld/Creator/PopupMessage",["../Core/Core","../ProjectTree/treeSource"],function(i,r){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=r}return e.prototype.createPopupMessage=function(e){var t=document.createElement("div");t.className="kz",t.id="kzmb",t.style.position="absolute",t.style.width="200px",t.style.height="500px",t.style.padding="15px",t.style.background="rgba(0, 0, 0, 0.5)",t.style.color="#fff",t.style.top="0px",t.style.right="0px",t.style.border="solid 2px #358ABA",document.body.appendChild(t);var i=document.createElement("div");t.id="bt",i.style.overflow="hidden",i.style.height="45px",i.style.height="100%",i.className="layui-form-item",i.style.borderBottom="solid 2px #358ABA";var r=document.createElement("span");r.textContent=e,i.appendChild(r),t.appendChild(i),this.getElement("bt","kzmb")},e.prototype.createPlotting=function(e,t){var i=document.createElement("main");i.id="kzmb",i.style.position="absolute",i.style.cursor="auto",i.style.left="0px",i.style.top="0px;",i.className="mainView",document.body.appendChild(i);var r=document.createElement("button");r.id="closeScene",r.setAttribute("aria-label","Close"),r.innerHTML="<span aria-hidden='true'>×</span>",r.onclick=closeScene,r.className="myModal-close",i.appendChild(r);var o=document.createElement("input");o.id="objectTab1",o.type="radio",o.setAttribute("checked",""),o.name="objectTab";var n=document.createElement("label");n.setAttribute("for","objectTab1"),n.id="objectLabel1",n.className="function-module-caption",n.innerHTML="二维",i.appendChild(o),i.appendChild(n);var a=document.createElement("input");a.id="objectTab2",a.type="radio",a.name="objectTab";var s=document.createElement("label");s.setAttribute("for","objectTab2"),s.id="objectLabel2",s.className="function-module-caption",s.innerHTML="三维",i.appendChild(a),i.appendChild(s);var l=document.createElement("section");l.id="objectContent1",i.appendChild(l);this.getBh(l,[{title:"点",src:"../../static/image/point/points.png",onclick:"labelDraw()"},{title:"线",src:"../../static/image/point/polyline.png",onclick:"polylineDraw()"},{title:"多边形",src:"../../static/image/point/polygon_clampToGround.png",onclick:"polygonDraw()"},{title:"矩形",src:"../../static/image/point/rectangle.png",onclick:"rectangleDraw()"},{title:"圆",src:"../../static/image/point/Cricle.png",onclick:"circleDraw()"}]);var u=document.createElement("section");u.id="objectContent2",i.appendChild(u);this.getBh(u,[{title:"立方体",src:"../../static/image/point/extrudedRectangle.png",onclick:"boxDraw()"},{title:"圆柱体",src:"../../static/image/point/extrudedCircle.png",onclick:"cylinderDraw()"},{title:"圆锥体",src:"../../static/image/point/Cone.png",onclick:"coneDraw()"},{title:"球体",src:"../../static/image/point/ellipsoid.png",onclick:"circleDraw()"},{title:"多边体",src:"../../static/image/point/Multilateral.png",onclick:"multilateralDraw()"}]),this.getElement("kzmb","kzmb")},e.prototype.getBh=function(e,t){var i="";i="<div class='function-module-content' style(height:'500px')><div class='function-module-sub-section'> <label class='function-module-sub-section-caption'>符号库</label><div id='icons' class='mark-list'>";for(var r=0;r<t.length;r++)i=i+"<div class='mark-list-item'><img title="+t[r].title+" src="+t[r].src+" id="+t[r].title+" onclick="+t[r].onclick+"></div>";i+="</div></div></div>",e.innerHTML=i},e.prototype.createMeasurement=function(e,t){var i=document.createElement("div");i.className="kz",i.id="kzmb",i.style.position="absolute",i.style.width="330px",i.style.height="500px",i.style.padding="15px",i.style.background="rgba(0, 0, 0, 0.5)",i.style.color="#fff",i.style.top="0px",i.style.right="0px",i.style.border="solid 2px #358ABA",document.body.appendChild(i);var r=document.createElement("div");r.id="bt",r.style.height="100%",r.style.overflow="hidden",r.style.height="25px",r.className="layui-form-item",r.style.borderBottom="solid 2px #358ABA";var o=document.createElement("span");o.textContent=e,r.appendChild(o),i.appendChild(r);var n=document.createElement("div");n.className="layui-tab-content",i.appendChild(n);var a=document.createElement("div");a.className="layui-tab-item layui-show",n.appendChild(a);var s=document.createElement("div");s.className="kind",a.appendChild(s);var l=document.createElement("ul");s.appendChild(l);var u=[{img:"../../img/bh/labels.png",text:"垂直高度",onclick:MeasurementVd},{img:"../../img/bh/labels.png",text:"海拔高度",onclick:MeasurementAltitude},{img:"../../img/bh/labels.png",text:"空间距离",onclick:MeasurementSpaceD},{img:"../../img/bh/labels.png",text:"水平距离",onclick:MeasurementHD},{img:"../../img/bh/labels.png",text:"三维面积",onclick:MeasurementThreeDSurfaceArea},{img:"../../img/bh/labels.png",text:"平面面积",onclick:MeasurementPlaneArea},{img:"../../img/bh/labels.png",text:"角度测量",onclick:MeasurementAngle}];this.getLi(l,u),"function"==typeof t&&t(),this.getElement("bt","kzmb")},e.prototype.getLi=function(e,t){for(var i=0;i<t.length;i++){var r=document.createElement("li");r.innerHTML='<img src="'+t[i].img+'" /><p>'+t[i].text+"</p>",r.onclick=t[i].onclick,e.appendChild(r)}},e.prototype.getElement=function(e,t){var n=0,a=0,i=document.getElementById(e);i.style.cursor="move";var s=document.getElementById(t),l=!1;i.onmousedown=function(e){e=e||window.event;n=e.clientX-s.offsetLeft,a=e.clientY-s.offsetTop,l=!0},document.onmousemove=function(e){if(l){var t=(e=e||window.event).clientX-n,i=e.clientY-a,r=document.documentElement.clientWidth-s.offsetWidth,o=document.documentElement.clientHeight-s.offsetHeight;t<0?t=0:r<t&&(t=r),i<0?i=0:o<i&&(i=o),s.style.left=t+"px",s.style.top=i+"px"}},document.onmouseup=function(){l=!1}},e.prototype.createPopupProp=function(e,t){layuiLayer.close(SmartEarthPopupData.layerProp);var i=t.width,r=t.height,o=t.fn||{};SmartEarthPopupData.propType=t.type;var n=null,a=null,s=null;for(var l in o)n="cancel"==l?o[l]:n,a="success"==l?o[l]:a,s="end"==l?o[l]:s;SmartEarthPopupData.layerProp=layuiLayer.open({title:e,type:2,skin:"other-class",shade:t.shade||0,shadeClose:!0,offset:t.offset||"r",resize:!1,area:["number"==typeof i?i+"px":i,"number"==typeof r?r+"px":r],content:SmartEarthRootUrl+t.url,success:function(e,t){a&&"function"==typeof a&&a(e,t)},cancel:function(){n&&"function"==typeof n&&n()},end:function(){s&&"function"==typeof s&&s()}})},e.prototype.createModelLibrary=function(e){layuiLayer.close(SmartEarthPopupData.ModelLibraryLayer),!e&&(e={});var t=e.width||342,i=e.height||"90%",r=e.offset||"r",o=e.fn||{},n=null,a=null,s=null;for(var l in o)n="cancel"==l?o[l]:n,a="success"==l?o[l]:a,s="end"==l?o[l]:s;SmartEarthPopupData.ModelLibraryLayer=layuiLayer.open({title:"模型库",type:2,skin:"other-class",shade:0,shadeClose:!0,offset:r,resize:!1,area:[t+"px","number"==typeof i?i+"px":i],content:SmartEarthRootUrl+"Workers/Model/ModelLibrary.html",success:function(e,t){a&&"function"==typeof a&&a(e,t)},cancel:function(){n&&"function"==typeof n&&n()},end:function(){s&&"function"==typeof s&&s()}})},e}),define("SGWorld/Creator/CreateAttackArrow",["../Core/Core","./Color","../ProjectTree/treeSource","../Analysis/Cdcl/Cdcl","../Navigate/getPosition","./PopupMessage"],function(r,e,a,t,o,n){"use strict";function i(e,t,i){this._core=new r,this.type="AttackArrow",this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this.viewer=e,this.cesium=t,this.pointImageUrl="../../img/point.png",this.handler=new this.cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.fillMaterial=t.Color.fromCssColorString(this._core.defaultValue(i.color,"rgba(255,0,0,0.6)")),this.outlineMaterial=new this.cesium.PolylineDashMaterialProperty({dashLength:16,color:t.Color.fromCssColorString(this._core.defaultValue(i.outlineColor,"rgba(255,0,0,0.6)"))}),this._getPosition=new o(this.viewer,this.cesium),this._popupmessage=new n(this._viewer,this._cesium),this.positions=[],this.state=-1,this.floatPoint=null,this.arrowEntity=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null}return i.prototype.disable=function(){this.positions=[],this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new this.cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null);for(var e=0;e<this.pointArr.length;e++)this.pointArr[e]&&this.viewer.entities.remove(this.pointArr[e]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},i.prototype.startDraw=function(o){var n=this;a.states=1,this.handler.setInputAction(function(e){var t;if(t=n._core.getCatesian3FromPXjt(e.position,n.viewer,n.cesium)){0==n.positions.length&&(n.floatPoint=n.creatPoint(t),n.floatPoint.show=!1,n.floatPoint.wz=-1),n.positions.push(t);var i=n.creatPoint(t);i.show=!1,2<n.positions.length?i.wz=n.positions.length-1:i.wz=n.positions.length,n.pointArr.push(i)}},this.cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){var t;n.positions.length<2||(t=n._core.getCatesian3FromPXjt(e.endPosition,n.viewer,n.cesium))&&(n.floatPoint.position.setValue(t),2<=n.positions.length&&(n.cesium.defined(n.arrowEntity)?(n.positions.pop(),n.positions.push(t)):(n.positions.push(t),n.arrowEntity=n.showArrowOnMap(n.positions),n.arrowEntity.objId=n.objId)))},this.cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(e){var t;if(t=n._core.getCatesian3FromPXjt(e.position,n.viewer,n.cesium)){for(var i=0;i<n.pointArr.length;i++)n.pointArr[i].show=!1;n.floatPoint.show=!1,n.viewer.entities.remove(n.floatPoint),n.floatPoint=null;var r=n.creatPoint(t);r.show=!1,r.wz=n.positions.length,n.pointArr.push(r),n._core.Entityadd(n),n.handler.destroy(),a.states=0,o&&o(n.arrowEntity)}},this.cesium.ScreenSpaceEventType.RIGHT_CLICK)},i.prototype.startDraw3D=function(o){var n=this;a.states=1,this.handler.setInputAction(function(e){var t;if(t=n._core.getCatesian3FromPXjt(e.position,n.viewer,n.cesium)){0==n.positions.length&&(n.floatPoint=n.creatPoint(t),n.floatPoint.show=!1,n.floatPoint.wz=-1),n.positions.push(t);var i=n.creatPoint(t);i.show=!1,2<n.positions.length?i.wz=n.positions.length-1:i.wz=n.positions.length,n.pointArr.push(i)}},this.cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){var t;n.positions.length<2||(t=n._core.getCatesian3FromPXjt(e.endPosition,n.viewer,n.cesium))&&(n.floatPoint.position.setValue(t),2<=n.positions.length&&(n.cesium.defined(n.arrowEntity)?(n.positions.pop(),n.positions.push(t)):(n.positions.push(t),n.arrowEntity=n.showArrowOnMap(n.positions,"3D"),n.arrowEntity.objId=n.objId)))},this.cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(e){var t;if(t=n._core.getCatesian3FromPXjt(e.position,n.viewer,n.cesium)){for(var i=0;i<n.pointArr.length;i++)n.pointArr[i].show=!1;n.floatPoint.show=!1,n.viewer.entities.remove(n.floatPoint),n.floatPoint=null;var r=n.creatPoint(t);r.show=!1,r.wz=n.positions.length,n.pointArr.push(r),n._core.Entityadd(n),n.handler.destroy(),a.states=0,o&&o(n.arrowEntity)}},this.cesium.ScreenSpaceEventType.RIGHT_CLICK)},i.prototype.startModify=function(d){if(0===a.states){this.state=2;for(var m,p,g=this,f=g.viewer,v=[],e=0;e<g.pointArr.length;e++)if(g.pointArr[e].show=!0,d.polygon&&d.polygon.extrudedHeight){var t=f.scene.globe.ellipsoid.cartesianToCartographic(g.pointArr[e].position.getValue()),i=g.cesium.Math.toDegrees(t.longitude),r=g.cesium.Math.toDegrees(t.latitude),o=t.height+d.polygon.extrudedHeight.getValue(),n=g.cesium.Cartesian3.fromDegrees(i,r,o);(m=f.entities.add({name:"box_point",position:n,point:{color:g.cesium.Color.YELLOW,pixelSize:12,outlineColor:g.cesium.Color.BLACK,outlineWidth:2,heightReference:g.cesium.HeightReference.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY}})).pointid=g.pointArr[e].id,v.push(m)}SmartEarthPopupData.editGraphic={entity:d,graphic:d.polygon,heightpoints:v},g._popupmessage.createPopupProp("属性编辑",{width:360,height:"90%",type:0<v.length?"ExtrudedPolygon":"GroundPolygon",fn:{success:function(e,t){g.layerIndex=t,SmartEarthPopupData.window=e.find("iframe")[0].contentWindow},end:function(){for(var e=0;e<g.pointArr.length;e++)g.pointArr[e].show=!1;g.floatPoint&&(g.floatPoint.show=!1),v.forEach(function(e){f.entities.remove(e)}),v=[],g.state=-1,g.modifyHandler&&g.modifyHandler.destroy(),g.modifyHandler=null,g.viewer.scene.screenSpaceCameraController.enableRotate=!0,g.viewer.scene.screenSpaceCameraController.enableZoom=!0}}}),g.viewer.scene.screenSpaceCameraController.enableRotate=!1,g.viewer.scene.screenSpaceCameraController.enableZoom=!1,this.modifyHandler||(this.modifyHandler=new this.cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(e){var t=g.viewer.scene.pick(e.position);if(g.cesium.defined(t)&&t.id&&(t.id.point||t.id.billboard))t.id.objId||("box_point"==t.id.name?(g.selectHeightPoint=t.id,p=t.id.position.getValue()):(g.selectPoint=t.id,m=v.filter(function(e){return e.pointid===t.id.id})[0]));else{for(var i=0;i<g.pointArr.length;i++)g.pointArr[i].show=!1;g.floatPoint&&(g.floatPoint.show=!1),v.forEach(function(e){f.entities.remove(e)}),v=[],g.state=-1,g.modifyHandler&&g.modifyHandler.destroy(),g.modifyHandler=null,g.viewer.scene.screenSpaceCameraController.enableRotate=!0,g.viewer.scene.screenSpaceCameraController.enableZoom=!0,window.layuiLayer.close(g.layerIndex)}},this.cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){var t;(t=g._core.getCatesian3FromPXjt(e.position,g.viewer,g.cesium))&&(g.selectPoint&&(g.selectPoint.position.setValue(t),g.selectPoint=null),g.selectHeightPoint&&(g.selectHeightPoint=void 0,p=void 0))},this.cesium.ScreenSpaceEventType.LEFT_UP),this.modifyHandler.setInputAction(function(e){if(n=g._core.getCatesian3FromPXjt(e.endPosition,g.viewer,g.cesium))if(g.selectPoint){if(g.selectPoint.position.setValue(n),g.positions[g.selectPoint.wz-1]=n,m){var t=f.scene.globe.ellipsoid.cartesianToCartographic(n),i=g.cesium.Math.toDegrees(t.longitude),r=g.cesium.Math.toDegrees(t.latitude),a=t.height+d.polygon.extrudedHeight.getValue();m.position=g.cesium.Cartesian3.fromDegrees(i,r,a)}}else{if(!g.selectHeightPoint)return;var o=f.camera.getPickRay(e.endPosition),n=f.scene.globe.pick(o,f.scene),s=g.cesium.Cartographic.fromCartesian(n),l=g.cesium.Math.toDegrees(s.longitude),u=g.cesium.Math.toDegrees(s.latitude),c=(t=g.cesium.Cartographic.fromCartesian(p),g.cesium.Math.toDegrees(t.longitude)),h=g.cesium.Math.toDegrees(t.latitude);a=g.Cdcl(u,l,h,c);v.forEach(function(e){var t=e.position._value,i=g.cesium.Cartographic.fromCartesian(t),r=g.cesium.Math.toDegrees(i.longitude),o=g.cesium.Math.toDegrees(i.latitude),n=g.cesium.Cartesian3.fromDegrees(r,o,a);e.position=n}),d.polygon.extrudedHeight=new g.cesium.CallbackProperty(function(){return a},!1),SmartEarthPopupData.window&&(SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]').value=parseInt(a))}},this.cesium.ScreenSpaceEventType.MOUSE_MOVE)}},i.prototype.createByData=function(e){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var t=[],i=0;i<e.length;i++){var r=this.cesium.Cartesian3.fromDegrees(e[i][0],e[i][1]);t.push(r)}this.positions=t;for(i=0;i<this.positions.length;i++){var o=this.creatPoint(this.positions[i]);o.show=!1,o.wz=i+1,this.pointArr.push(o)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},i.prototype.Cdcl=function(e,t,i,r){var o=Math.PI;function n(e){return e*o/180}var a,s,l,u,c=n((e+i)/2),h=n((e-i)/2),d=n((t-r)/2),m=Math.sin(h),p=Math.sin(d),g=Math.sin(c);return a=(m*=m)*(1-(p*=p))+(1-(g*=g))*p,s=(1-m)*(1-p)+g*p,2*(l=Math.atan(Math.sqrt(a/s)))*6378137*(1+1/298.257*((3*(u=Math.sqrt(a*s)/l)-1)/2/s*g*(1-m)-(3*u+1)/2/a*(1-g)*m))},i.prototype.clear=function(){for(var e=this.state=0;e<this.pointArr.length;e++)this.pointArr[e]&&this.viewer.entities.remove(this.pointArr[e]);this.floatPoint&&this.viewer.entities.remove(this.floatPoint),this.arrowEntity&&this.viewer.entities.remove(this.arrowEntity),this.state=-1},i.prototype.getLnglats=function(){for(var e=[],t=0;t<this.positions.length;t++){var i=this.cartesianToLatlng(this.positions[t]);e.push(i)}return e},i.prototype.getPositions=function(){return this.positions},i.prototype.creatPoint=function(e){var t=this.viewer.entities.add({position:e,point:{pixelSize:10,color:this.cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:this.cesium.Color.WHITE,heightReference:this.cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}});return t.attr="editPoint",t},i.prototype.showArrowOnMap=function(n,e){var a=this;return this.viewer.entities.add({polygon:new a.cesium.PolygonGraphics({hierarchy:new a.cesium.CallbackProperty(function(){if(n.length<3)return null;for(var e=[],t=0;t<n.length;t++){var i=a.cartesianToLatlng(n[t]);e.push(i)}var r=xp.algorithm.tailedAttackArrow(e),o=[];return-1==JSON.stringify(r.polygonalPoint).indexOf("null")&&(o=r.polygonalPoint),new a.cesium.PolygonHierarchy(o)},!1),show:!0,fill:!0,classificationType:a.cesium.ClassificationType.TERRAIN,extrudedHeight:"3D"===e?2e4:void 0,height:"3D"===e?0:void 0,material:a.fillMaterial})})},i.prototype.cartesianToLatlng=function(e){var t=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),i=this.cesium.Math.toDegrees(t.latitude);return[this.cesium.Math.toDegrees(t.longitude),i]},i}),define("SGWorld/Creator/CreatePincerArrow",["../Core/Core","./Color","../ProjectTree/treeSource","../Analysis/Cdcl/Cdcl"],function(i,e,t,r){"use strict";function o(e,t){this._core=new i,this.type="PincerArrow",this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this.viewer=e,this.cesium=t,this.handler=new this.cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.pointImageUrl="../../img/point.png",this.fillMaterial=this.cesium.Color.YELLOW.withAlpha(.8),this.outlineMaterial=new this.cesium.PolylineDashMaterialProperty({dashLength:16,color:this.cesium.Color.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null}return o.prototype.disable=function(){this.positions=[],this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new this.cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null);for(var e=0;e<this.pointArr.length;e++)this.pointArr[e]&&this.viewer.entities.remove(this.pointArr[e]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},o.prototype.startDraw=function(){var o=this;this.state=1,this.handler.setInputAction(function(e){var t;if(t=o._core.getCatesian3FromPXjt(e.position,o.viewer,o.cesium)){if(0==o.positions.length&&(o.floatPoint=o.creatPoint(t)),4<o.positions.length){(r=o.creatPoint(t)).wz=o.positions.length,o.pointArr.push(r);for(var i=0;i<o.pointArr.length;i++)o.pointArr[i].show=!1;return o.floatPoint&&(o.floatPoint.show=!1,o.viewer.entities.remove(o.floatPoint),o.floatPoint=null),o.handler.destroy(),void o._core.Entityadd(o)}o.positions.push(t);var r=o.creatPoint(t);2<o.positions.length?r.wz=o.positions.length-1:r.wz=o.positions.length,o.pointArr.push(r)}},this.cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){var t;o.positions.length<2||(t=o._core.getCatesian3FromPXjt(e.endPosition,o.viewer,o.cesium))&&(o.floatPoint.position.setValue(t),2<=o.positions.length&&(o.cesium.defined(o.arrowEntity)?(o.positions.pop(),o.positions.push(t)):(o.positions.push(t),o.arrowEntity=o.showArrowOnMap(o.positions),o.arrowEntity.objId=o.objId)))},this.cesium.ScreenSpaceEventType.MOUSE_MOVE)},o.prototype.startModify=function(){this.state=2;for(var o=this,e=0;e<o.pointArr.length;e++)o.pointArr[e].show=!0;this.modifyHandler||(this.modifyHandler=new this.cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(e){var t=o.viewer.scene.pick(e.position);if(o.cesium.defined(t)&&t.id)o.clickStep++,t.id.objId||(o.selectPoint=t.id);else{for(var i=0;i<o.pointArr.length;i++)o.pointArr[i].show=!1;o.state=-1,o.modifyHandler.destroy(),o.modifyHandler=null}if(2==o.clickStep){var r;if(o.clickStep=0,!(r=o._core.getCatesian3FromPXjt(e.position,o.viewer,o.cesium)))return;o.selectPoint&&(o.selectPoint.position.setValue(r),o.selectPoint=null)}},this.cesium.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){var t;(t=o._core.getCatesian3FromPXjt(e.endPosition,o.viewer,o.cesium))&&o.selectPoint&&(o.selectPoint.position.setValue(t),o.positions[o.selectPoint.wz-1]=t)},this.cesium.ScreenSpaceEventType.MOUSE_MOVE)},o.prototype.createByData=function(e){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var t=[],i=0;i<e.length;i++){var r=this.cesium.Cartesian3.fromDegrees(e[i][0],e[i][1]);t.push(r)}this.positions=t;for(i=0;i<this.positions.length;i++){var o=this.creatPoint(this.positions[i]);o.show=!1,o.wz=i+1,this.pointArr.push(o)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},o.prototype.clear=function(){for(var e=this.state=0;e<this.pointArr.length;e++)this.pointArr[e]&&this.viewer.entities.remove(this.pointArr[e]);this.floatPoint&&this.viewer.entities.remove(this.floatPoint),this.arrowEntity&&this.viewer.entities.remove(this.arrowEntity),this.state=-1},o.prototype.getLnglats=function(){for(var e=[],t=0;t<this.positions.length;t++){var i=this.cartesianToLatlng(this.positions[t]);e.push(i)}return e},o.prototype.getPositions=function(){return this.positions},o.prototype.creatPoint=function(e){return this.viewer.entities.add({position:e,billboard:{image:this.pointImageUrl,verticalOrigin:this.cesium.VerticalOrigin.BOTTOM}})},o.prototype.showArrowOnMap=function(n){var a=this;return this.viewer.entities.add({polygon:new a.cesium.PolygonGraphics({hierarchy:new a.cesium.CallbackProperty(function(){if(n.length<3)return null;for(var e=[],t=0;t<n.length;t++){var i=a.cartesianToLatlng(n[t]);e.push(i)}var r=xp.algorithm.doubleArrow(e),o=[];return-1==JSON.stringify(r.polygonalPoint).indexOf("null")&&(o=r.polygonalPoint),new a.cesium.PolygonHierarchy(o)},!1),show:!0,fill:!0,classificationType:a.cesium.ClassificationType.TERRAIN,extrudedHeight:100,material:a.fillMaterial})})},o.prototype.cartesianToLatlng=function(e){var t=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),i=this.cesium.Math.toDegrees(t.latitude);return[this.cesium.Math.toDegrees(t.longitude),i]},o}),define("SGWorld/Creator/VolumetricMeasure",["../configData","../Core/Core"],function(o,n){"use strict";function e(e,t){var i,r;this._viewer=e,this._cesium=t,this._scene=e.scene,this._tooltip=(i=e.container,(r=function(e){var t=document.getElementById("cesiumTipInfo"),i=document.querySelector("#cesiumTipInfo span");t||((t=document.createElement("DIV")).id="cesiumTipInfo",t.style.cssText="display: none;position: absolute;pointer-events: none;max-width: 250px;min-width: 100px;padding: 1px 1px 1px 18px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;",(i=document.createElement("span")).style.cssText="font-family:黑体;color:white;font-weight: bolder;font-size: 14px;",t.appendChild(i)),this._div=t,this._title=i,e.appendChild(t)}).prototype.setVisible=function(e){this._div.style.display=e?"block":"none"},r.prototype.showAt=function(e,t){e&&t&&(this.setVisible(!0),this._title.innerHTML=t,this._div.style.left=e.x+5+"px",this._div.style.top=e.y-this._div.clientHeight/2-5+"px")},new r(i)),this._core=new n,this._drawColor={point:t.Color.BLUE,polyline:t.Color.YELLOW,polygon:t.Color.YELLOW.withAlpha(.5)},this.loadingImg=window.SmartEarthRootUrl+o.loading,ie=t}var ie;e.prototype.cleanUp=function(){void 0!==this._prevEntity&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),void 0!==this._prevEntity1&&(this._viewer.entities.remove(this._prevEntity1),this._prevEntity1=void 0),void 0!==this._volumeLabel&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),void 0!==this._volumeLabel1&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this._tooltip.setVisible(!1)},e.prototype.startDrawing=function(e,t,c){var d,i=this,m=this._scene,p=this._tooltip,g=[],f=[];this._positions=f,e&&0<Object.keys(e).length&&(""!==e.point&&void 0!==e.point&&(this._drawColor.point=e.point),""!==e.polyline&&void 0!==e.polyline&&(this._drawColor.polyline=e.polyline),""!==e.polygon&&void 0!==e.polygon&&(this._drawColor.polygon=e.polygon),""!==e.loading&&void 0!==e.loading&&(this.loadingImg=e.loading));var h=this;this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading();var r=new this._cesium.ScreenSpaceEventHandler(m.canvas);this._mouseHandler=r,this.cleanUp(),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+o.draw);var v=void 0;function _(){return new ie.PolygonHierarchy(ie.Cartesian3.fromDegreesArray(g))}return r.setInputAction(function(e){if(null!=e.position){var t=m.camera.getPickRay(e.position),i=m.globe.pick(t,m);if(this._viewer.scene.pick(e.position)){var r=this._viewer.scene.pickPosition(e.position);r&&(i=r)}if(i){var o=ie.Cartographic.fromCartesian(i),n=ie.Math.toDegrees(o.longitude),a=ie.Math.toDegrees(o.latitude);if(0===g.length&&(g.push(n,a),f.push(i),d=i),4<=f.length){var s=ie.SceneTransforms.wgs84ToWindowCoordinates(this._viewer.scene,d);if(void 0!==s){var l=s.x-e.position.x,u=s.y-e.position.y;if(l*l+u*u<16)return g.splice(g.length-2,2),f.pop(),void this.stopDrawing(c)}}g.push(n,a),f.push(i),2!==f.length||v||(v=this._viewer.entities.add({name:"临时线",polyline:{positions:new ie.CallbackProperty(function(){return f},!1),clampToGround:!0,material:h._drawColor.polygon,width:3}})),3===f.length&&(v&&this._viewer.entities.remove(v),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new ie.PolygonHierarchy(ie.Cartesian3.fromDegreesArray(g)),material:h._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new ie.CallbackProperty(_,!1))}}}.bind(this),ie.ScreenSpaceEventType.LEFT_CLICK),r.setInputAction(function(e){var t=e.endPosition;if(null!=t)if(0===f.length)p.showAt(t,"点击开始绘制第一个点");else{var i=m.camera.getPickRay(t),r=m.globe.pick(i,m);if(this._viewer.scene.pick(t)){var o=this._viewer.scene.pickPosition(t);o&&(r=o),!0}if(r){var n=ie.Cartographic.fromCartesian(r),a=ie.Math.toDegrees(n.longitude),s=ie.Math.toDegrees(n.latitude);if(g.splice(g.length-2,2),f.pop(),g.push(a,s),f.push(r),p.showAt(t,"右键结束绘制"),3<=f.length&&4<=f.length){var l=ie.SceneTransforms.wgs84ToWindowCoordinates(this._viewer.scene,d);if(void 0!==l){var u=l.x-t.x,c=l.y-t.y,h=u*u+c*c;document.body.style.cursor=h<16?"pointer":"default"}}}}}.bind(this),ie.ScreenSpaceEventType.MOUSE_MOVE),r.setInputAction(function(e){this.end&&this.end()}.bind(this),ie.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){if(void 0!==i._mouseHandler&&(i._mouseHandler.destroy(),i._mouseHandler=void 0),i._core.mouse(i._viewer.container,0),i._tooltip.setVisible(!1),v&&i._viewer.entities.remove(v),i.end=void 0,f.length<3);else{if(i._prevEntity&&(i._prevEntity.polygon.hierarchy=ie.Cartesian3.fromDegreesArray(g)),"cancel"===e)return void(i._prevEntity&&i._viewer.entities.remove(i._prevEntity));i.stopDrawing(t,c)}},this},e.prototype.stopDrawing=function(o,n){var a=this;void 0!==this._mouseHandler&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),void 0!==this._volumeLabel&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),void 0!==this._volumeLabel1&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.isLoading(!0),setTimeout(function(){var e=a.computeCutVolume(o),t=e.maxHeight,i=e.minHeight;a._prevEntity.polygon.height=e.minHeight,a._prevEntity.polygon.heightReference=0,"function"==typeof n&&n(e);var r={polygon:{hierarchy:{positions:a._positions},height:i,extrudedHeight:t,closeTop:!1,closeBottom:!1,material:ie.Color.CYAN.withAlpha(.2),outline:!0,outlineColor:ie.Color.RED,outlineWidth:2}};a._prevEntity1=a._viewer.entities.add(r)},100)};var re=6378137;function oe(e,t,i,r){var o=i*Math.sin(r*Math.PI/180),n=i*Math.cos(r*Math.PI/180),a=6356725+21412*(90-t)/90;return[180*(o/(a*Math.cos(t*Math.PI/180))+e*Math.PI/180)/Math.PI,180*(n/a+t*Math.PI/180)/Math.PI]}function ne(e){return e*Math.PI/180}return e.prototype.computeCutVolume=function(e){for(var t,i,r,o,n,a,s,l,u,c,h,d,m,p,g=15e3,f=[],v=this._positions.length,_=0;_<v;_++)t=ie.Cartographic.fromCartesian(this._positions[_]),i=ie.Math.toDegrees(t.longitude),r=ie.Math.toDegrees(t.latitude),f.push(i,r),_===v-1&&f.push(i,r),o=this._scene.globe.getHeight(t),void 0!==(n=this._scene.sampleHeight(t))&&o<n&&(o=n),o<g&&(g=o);if("auto"===e){var y=0;for(_=0;_<f.length-2;_+=2)y+=(a=f[_],s=f[_+1],l=f[_+2],u=f[_+3],p=void 0,c=ne(s),h=ne(u),d=ne(u)-ne(s),m=ne(l)-ne(a),p=2*Math.asin(Math.sqrt(Math.pow(Math.sin(d/2),2)+Math.cos(c)*Math.cos(h)*Math.pow(Math.sin(m/2),2))),p*=re,p=Math.round(1e4*p)/1e4);e=2*y/f.length,e/=5}var C,w,b,E,S,P,x,T,I,D,L,M,A,R,O,N,V,F,H,G,k,B,j,z,W,U,q,Y,X=(C={lon:f[0],lat:f[1]},w=e,b=oe(C.lon,C.lat,w,0),E=ne(oe(C.lon,C.lat,w,90)[0])-ne(C.lon),(S=ne(b[1])-ne(C.lat))<E?E:S),J=new ie.PolygonGeometry.fromPositions({positions:this._positions,vertexFormat:ie.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:X}),Q=new ie.PolygonGeometry.createGeometry(J),K={fill:0,dig:0},$={fill:"立方米",dig:"立方米"},Z=0,ee={fill:1,dig:1};this.Triangulation=[];for(_=0;_<Q.indices.length;_+=3)P=Q.indices[_],x=Q.indices[_+1],T=Q.indices[_+2],H=new ie.Cartesian3(Q.attributes.position.values[3*P],Q.attributes.position.values[3*P+1],Q.attributes.position.values[3*P+2]),G=ie.Cartographic.fromCartesian(H),I=this._scene.globe.getHeight(G),void 0!==(M=this._scene.sampleHeight(G))&&I<M&&(I=M),O=ie.Cartesian3.fromRadians(G.longitude,G.latitude,0),Z<I&&(Z=I),H=new ie.Cartesian3(Q.attributes.position.values[3*x],Q.attributes.position.values[3*x+1],Q.attributes.position.values[3*x+2]),G=ie.Cartographic.fromCartesian(H),D=this._scene.globe.getHeight(G),void 0!==(A=this._scene.sampleHeight(G))&&D<A&&(D=A),N=ie.Cartesian3.fromRadians(G.longitude,G.latitude,0),Z<D&&(Z=D),H=new ie.Cartesian3(Q.attributes.position.values[3*T],Q.attributes.position.values[3*T+1],Q.attributes.position.values[3*T+2]),G=ie.Cartographic.fromCartesian(H),L=this._scene.globe.getHeight(G),void 0!==(R=this._scene.sampleHeight(G))&&L<R&&(L=R),V=ie.Cartesian3.fromRadians(G.longitude,G.latitude,0),Z<L&&(Z=L),B=O,j=N,z=V,void 0,W=ie.Cartesian3.distance(B,j),U=ie.Cartesian3.distance(j,z),q=ie.Cartesian3.distance(z,B),Y=(W+U+q)/2,k=Math.sqrt(Y*(Y-W)*(Y-U)*(Y-q)),this.Triangulation.push({bottomArea:k,height:[I,D,L]}),0<(F=(I-g+D-g+L-g)/3)?K.dig=K.dig+k*F*ee.dig:K.fill=K.fill-k*F*ee.fill,1e10<K.dig&&"立方米"===$.dig&&(K.dig=K.dig/1e9,$.dig="立方千米",ee.dig=1e-9),1e10<K.fill&&"立方米"===$.fill&&(K.fill=K.fill/1e9,$.fill="立方千米",ee.fill=1e-9);var te=function(e){for(var t=[],i=[],r=0,o=0,n=0;n<e.length;n++){var a=ie.Cartographic.fromCartesian(e[n]);r+=a.longitude,o+=a.latitude,t.push(a.longitude),i.push(a.latitude)}var s,l;return s=r/e.length,l=o/e.length,new ie.Cartographic(s,l)}(this._positions);return this._volumeLabel=this._viewer.entities.add({position:ie.Cartesian3.fromRadians(te.longitude,te.latitude,Z),label:{text:"挖方体积:"+K.dig.toFixed(4)+$.dig,pixelOffset:{x:0,y:-30},font:"16px 宋体",fillColor:ie.Color.GOLD,verticalOrigin:ie.VerticalOrigin.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ie.Cartesian3.fromRadians(te.longitude,te.latitude,Z),label:{text:"填方体积:"+K.fill.toFixed(4)+$.fill,pixelOffset:{x:0,y:-70},font:"16px 宋体",fillColor:ie.Color.GOLD,verticalOrigin:ie.VerticalOrigin.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this.isLoading(!1),{maxHeight:Z,minHeight:g,volume:K,unit:$,spacing:e}},e.prototype.addLoading=function(){var e=document.createElement("div");e.id="cesiumLoading",e.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";var t=document.createElement("img");t.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",t.src=this.loadingImg,e.appendChild(t),this.loading=e,this._viewer.container.appendChild(e)},e.prototype.isLoading=function(e){this.loading.style.display=e?"block":"none"},e.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0},e.prototype.addPoint=function(n){this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=null),this.addPointHandle=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.addPointHandle.setInputAction(function(e){var t,i=this._viewer.scene.camera.getPickRay(e.position);if(i&&(t=this._viewer.scene.globe.pick(i,this._viewer.scene)),this._viewer.scene.pick(e.position)){var r=this._viewer.scene.pickPosition(e.position);r&&(t=r)}if(t){var o=this._cesium.Cartographic.fromCartesian(t);this.addPointHandle.destroy(),this.addPointHandle=null,n&&"function"==typeof n&&n(o.height.toFixed(1))}}.bind(this),this._cesium.ScreenSpaceEventType.LEFT_CLICK)},e.prototype.setDatum=function(t,e){if(this.Triangulation&&0<this.Triangulation.length){var i,r,o,n={fill:0,dig:0},a={fill:"立方米",dig:"立方米"},s={fill:1,dig:1};this.Triangulation.forEach(function(e){i=e.bottomArea,r=e.height,0<(o=(r[0]-t+r[1]-t+r[2]-t)/3)?n.dig=n.dig+i*o*s.dig:n.fill=n.fill-i*o*s.fill,1e10<n.dig&&"立方米"===a.dig&&(n.dig=n.dig/1e9,a.dig="立方千米",s.dig=1e-9),1e10<n.fill&&"立方米"===a.fill&&(n.fill=n.fill/1e9,a.fill="立方千米",s.fill=1e-9)}),this._volumeLabel.label.text="挖方体积:"+n.dig.toFixed(4)+a.dig,this._volumeLabel1.label.text="填方体积:"+n.fill.toFixed(4)+a.fill,this._prevEntity.polygon.height=t,e&&"function"==typeof e&&e({volume:n,unit:a})}},e}),define("SGWorld/Creator/Hawkeye",["../Core/Core","../ProjectTree/treeSource"],function(i,r){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=r}return e.prototype.createHawkeye=function(e,t){var i=document.createElement("div");i.id="Hawkeye",i.style.position="absolute",i.style.width="15%",i.style.height="20%",i.style.bottom="0",i.style.right="0",i.style.pointerEvents="none",t&&(t.width&&(i.style.width=t.width),t.height&&(i.style.height=t.height),t.bottom&&(i.style.bottom=t.bottom),t.right&&(i.style.right=t.right),t.top&&(i.style.top=t.top,i.style.bottom="unset"),t.left&&(i.style.left=t.left,i.style.right="unset")),this._viewer.container.appendChild(i);var r=void 0;r=e.url?new this._cesium.SingleTileImageryProvider({url:e.url}):e.imageryProvider;var o=new this._cesium.Viewer("Hawkeye",{imageryProvider:r,baseLayerPicker:!1,shadows:!1,shouldAnimate:!0,animation:!0,scene3DOnly:!0,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1});o._cesiumWidget._creditContainer.style.display="none";var n=this,a=this._core.defaultValue(t&&t.height,1e4);function s(){var e=n._viewer.camera.position,t=Cesium.Cartographic.fromCartesian(e);t.height+=a,o.camera.setView({destination:Cesium.Cartographic.toCartesian(t),orientation:{heading:n._viewer.camera.heading,pitch:n._viewer.camera.pitch,roll:n._viewer.camera.roll}})}return n._viewer.scene.preRender.addEventListener(s),this.close=function(){n._viewer.scene.preRender.removeEventListener(s),o.destroy(),i.remove(),n.close=void 0},this},e}),define("SGWorld/Creator/MilitaryStandard",["../configData","../Core/Core","../ProjectTree/treeSource","../Navigate/getPosition","./PopupMessage"],function(g,i,se,r,o){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=se,this._getPosition=new r(this._viewer,this._cesium),this._popupmessage=new o(this._viewer,this._cesium),this.tooltip=this._core.CreateTooltip({id:"_jb"}),this.objectsToExclude=[],this.MilitaryStandardObj=[],this.drawHandler=void 0,this.editHandler=null,this.heightpointsId=[],this.state=0,this.isEditting=!1,this.editProp=!0}return e.prototype.createBezierline=function(o,t){var n,i=this,a=this,s=this._viewer,l=[],u=[],c=void 0,h="单击开始绘制";return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+g.draw),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(s.scene.canvas),se.states=1,this.drawHandler.setInputAction(function(e){h="左键添加点 右键结束";var t=e.position,i=a._createGeoPoints(s,[{x:t.x,y:t.y}]);0==l.length&&(l.push({x:i[0],y:i[1],z:i[2]}),u.push(i)),u.push(i),l.push({x:i[0],y:i[1],z:i[2]})},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){a._core.CreateTooltip(h,e.endPosition,!0);var t=e.endPosition;if(0<l.length)if(a._cesium.defined(c)){l.pop(),u.pop();r=a._createGeoPoints(s,[{x:t.x,y:t.y}]);l.push({x:r[0],y:r[1],z:r[2]}),u.push(r);i=a._createBezierPoints(l),r=[];i.forEach(function(e){r.push(e.x,e.y,l[0].z)}),n=a._cesium.Cartesian3.fromDegreesArrayHeights(r)}else{var i=a._createBezierPoints(l),r=[];i.forEach(function(e){r.push(e.x,e.y,l[0].z)}),n=a._cesium.Cartesian3.fromDegreesArrayHeights(r),(c=s.entities.add({name:"Bezierline",polyline:{positions:new a._cesium.CallbackProperty(function(){return n},!1),width:a._core.defaultValue(o.width,2),material:a._cesium.Color.fromCssColorString(a._core.defaultValue(o.color,"#ff0000"))}})).GeoType="Bezierline",a.MilitaryStandardObj.push(c.id)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(function(e){a.end&&a.end()},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=function(e){i.end=void 0,c&&(c.pottingPoint=u),a.drawHandler.destroy(),a._core.CreateTooltip(h,void 0,!1),a._core.mouse(a._viewer.container,0),setTimeout(function(){se.states=0},100),"cancel"!==e?t&&t(c):c&&(s.entities.remove(c),a.MilitaryStandardObj.pop())},this},e.prototype.createBezierArrow=function(o,t){var n,i=this,a=this,s=this._viewer,l="单击开始绘制",u=[],c=[],h=void 0;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),a._core.mouse(a._viewer.container,1,window.SmartEarthRootUrl+g.draw),se.states=1,a.drawHandler=new this._cesium.ScreenSpaceEventHandler(s.scene.canvas),a.drawHandler.setInputAction(function(e){l="左键添加点 右键结束";var t=e.position,i=a._createGeoPoints(s,[{x:t.x,y:t.y}]);0==u.length&&(u.push({x:i[0],y:i[1],z:i[2]}),c.push(i)),u.push({x:i[0],y:i[1],z:i[2]}),c.push(i)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),a.drawHandler.setInputAction(function(e){a._core.CreateTooltip(l,e.endPosition,!0);var t=e.endPosition;if(0<u.length)if(a._cesium.defined(h)){u.pop(),c.pop();r=a._createGeoPoints(s,[{x:t.x,y:t.y}]);u.push({x:r[0],y:r[1],z:r[2]}),c.push(r);i=a._createBezierPoints(u),r=[];i.forEach(function(e){r.push(e.x,e.y,u[0].z)}),n=a._cesium.Cartesian3.fromDegreesArrayHeights(r)}else{var i=a._createBezierPoints(u),r=[];i.forEach(function(e){r.push(e.x,e.y,u[0].z)}),n=a._cesium.Cartesian3.fromDegreesArrayHeights(r),(h=s.entities.add({name:"BezierArrow",polyline:{positions:new a._cesium.CallbackProperty(function(){return n},!1),width:a._core.defaultValue(o.width,5),material:new a._cesium.PolylineArrowMaterialProperty(a._cesium.Color.fromCssColorString(a._core.defaultValue(o.color,"#ff0000")))}})).GeoType="BezierArrow",a.MilitaryStandardObj.push(h.id)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),a.drawHandler.setInputAction(function(e){a.end&&a.end()},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=function(e){i.end=void 0,h&&(h.pottingPoint=c),a.drawHandler.destroy(),a._core.CreateTooltip(l,void 0,!1),a._core.mouse(a._viewer.container,0),setTimeout(function(){se.states=0},100),"cancel"!==e?t&&t(h):h&&(s.entities.remove(h),a.MilitaryStandardObj.pop())},this},e.prototype.createSwallowtailArrow=function(e,o,t){var n,i=this,a=e,s=this,l=this._viewer,u=void 0,c=[],h=[],d="单击开始绘制";return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),s._core.mouse(s._viewer.container,1,window.SmartEarthRootUrl+g.draw),se.states=1,s.drawHandler=new this._cesium.ScreenSpaceEventHandler(l.scene.canvas),s.drawHandler.setInputAction(function(e){var t=e.position;if(d="单击完成绘制",0==h.length){var i=s._createGeoPoints(l,[{x:t.x,y:t.y}]);h.push({x:i[0],y:i[1],z:i[2]},{x:i[0]+1e-7,y:i[1]+1e-7,z:i[2]}),c.push(i,i)}else 2==h.length&&s.end&&s.end()},this._cesium.ScreenSpaceEventType.LEFT_CLICK),s.drawHandler.setInputAction(function(e){s._core.CreateTooltip(d,e.endPosition,!0);var t=e.endPosition;if(1<h.length)if(s._cesium.defined(u)){h.pop(),c.pop();r=s._createGeoPoints(l,[{x:t.x,y:t.y}]);h.push({x:r[0],y:r[1],z:r[2]}),c.push(r);i=s._computeSwallowtailArrow(h),r=[];i.forEach(function(e){r.push(e.x,e.y,h[0].z)}),n=s._cesium.Cartesian3.fromDegreesArrayHeights(r)}else{u=s.plotingSwallowtailArrow(l,h,a,o);var i=s._computeSwallowtailArrow(h),r=[];i.forEach(function(e){r.push(e.x,e.y,h[0].z)}),n=s._cesium.Cartesian3.fromDegreesArrayHeights(r),u.polygon.hierarchy=new s._cesium.CallbackProperty(function(){return new s._cesium.PolygonHierarchy(n)},!1),u.GeoType="SwallowtailArrow",s.MilitaryStandardObj.push(u.id)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),s.drawHandler.setInputAction(function(e){s.end&&s.end()},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=function(e){i.end=void 0,u&&(u.pottingPoint=c),s._core.CreateTooltip(d,void 0,!1),s.drawHandler.destroy(),s._core.mouse(s._viewer.container,0),setTimeout(function(){se.states=0},100),"cancel"!==e?t&&t(u):u&&(l.entities.remove(u),s.MilitaryStandardObj.pop())},this},e.prototype.createStraightArrow=function(e,o,t){var n,i=this,a=e,s=this,l=this._viewer,u=[],c=void 0,h=[],d="单击开始绘制";return se.states=1,this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),s._core.mouse(s._viewer.container,1,window.SmartEarthRootUrl+g.draw),s.drawHandler=new this._cesium.ScreenSpaceEventHandler(l.scene.canvas),s.drawHandler.setInputAction(function(e){var t=e.position;if(d="单击完成绘制",0==u.length){var i=s._createGeoPoints(l,[{x:t.x,y:t.y}]);u.push({x:i[0],y:i[1],z:i[2]},{x:i[0]+1e-7,y:i[1]+1e-7,z:i[2]}),h.push(i,i)}else 2==u.length&&s.end&&s.end()},this._cesium.ScreenSpaceEventType.LEFT_CLICK),s.drawHandler.setInputAction(function(e){var t=e.endPosition;if(s._core.CreateTooltip(d,t,!0),1<u.length)if(s._cesium.defined(c)){u.pop(),h.pop();r=s._createGeoPoints(l,[{x:t.x,y:t.y}]);u.push({x:r[0],y:r[1],z:r[2]}),h.push(r);i=s.calculateMorePoints(u),r=[];i.forEach(function(e){r.push(e.x,e.y,u[0].z)}),n=s._cesium.Cartesian3.fromDegreesArrayHeights(r)}else{var i=s.calculateMorePoints(u),r=[];i.forEach(function(e){r.push(e.x,e.y,u[0].z)}),n=s._cesium.Cartesian3.fromDegreesArrayHeights(r),"polygon"==a?c=l.entities.add({name:"StraightArrow",polygon:{hierarchy:n,material:s._cesium.Color.fromCssColorString(s._core.defaultValue(o.color,"rgba(255,0,0,0.6)"))}}):"box"==a&&(c=l.entities.add({name:"StraightArrow",polygon:{hierarchy:n,material:s._cesium.Color.fromCssColorString(s._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),extrudedHeight:r[2]+s._core.defaultValue(o.extrudedHeight,200),height:r[2],outline:s._core.defaultValue(o.outline,!0),outlineColor:s._cesium.Color.fromCssColorString(s._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)"))}})),c.polygon.hierarchy=new s._cesium.CallbackProperty(function(){return new s._cesium.PolygonHierarchy(n)},!1),c.GeoType="StraightArrow",s.MilitaryStandardObj.push(c.id)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),s.drawHandler.setInputAction(function(e){s.end&&s.end()},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=function(e){i.end=void 0,c&&(c.pottingPoint=h),s._core.CreateTooltip(d,void 0,!1),s.drawHandler.destroy(),s._core.mouse(s._viewer.container,0),setTimeout(function(){se.states=0},100),"cancel"!==e?t&&t(c):c&&(l.entities.remove(c),s.MilitaryStandardObj.pop())},this},e.prototype.createRoundedRectangle=function(e,o,t){var n,i=this,a=e,s="单击开始绘制",l=this,u=this._viewer,c=[],h=[],d=void 0;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),l._core.mouse(l._viewer.container,1,window.SmartEarthRootUrl+g.draw),se.states=1,l.drawHandler=new this._cesium.ScreenSpaceEventHandler(u.scene.canvas),l.drawHandler.setInputAction(function(e){var t=e.position;if(s="单击完成绘制",0==c.length){var i=l._createGeoPoints(u,[{x:t.x,y:t.y}]);c.push({x:i[0],y:i[1],z:i[2]},{x:i[0]+1e-7,y:i[1]+1e-7,z:i[2]}),h.push(i,i)}else 2==c.length&&l.end&&l.end()},this._cesium.ScreenSpaceEventType.LEFT_CLICK),l.drawHandler.setInputAction(function(e){l._core.CreateTooltip(s,e.endPosition,!0);var t=e.endPosition;if(1<c.length)if(Cesium.defined(d)){c.pop(),h.pop();r=l._createGeoPoints(u,[{x:t.x,y:t.y}]);c.push({x:r[0],y:r[1],z:r[2]}),h.push(r);i=l._computeRoundedRectanglePoints(c),r=[];i.forEach(function(e){r.push(e.x,e.y,c[0].z)}),n=l._cesium.Cartesian3.fromDegreesArrayHeights(r)}else{var i=l._computeRoundedRectanglePoints(c),r=[];i.forEach(function(e){r.push(e.x,e.y,c[0].z)}),n=l._cesium.Cartesian3.fromDegreesArrayHeights(r),"polygon"==a?d=u.entities.add({name:"RoundedRectangle",polygon:{hierarchy:n,material:l._cesium.Color.fromCssColorString(l._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:l._core.defaultValue(o.outline,!0),outlineColor:l._cesium.Color.fromCssColorString(l._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)"))}}):"box"==a&&(d=u.entities.add({name:"RoundedRectangle",polygon:{hierarchy:n,material:l._cesium.Color.fromCssColorString(l._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:l._core.defaultValue(o.outline,!0),outlineColor:l._cesium.Color.fromCssColorString(l._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)")),extrudedHeight:r[2]+l._core.defaultValue(o.extrudedHeight,200),height:r[2]}})),d.polygon.hierarchy=new l._cesium.CallbackProperty(function(){return new l._cesium.PolygonHierarchy(n)},!1),d.GeoType="RoundedRectangle",l.MilitaryStandardObj.push(d.id)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),l.drawHandler.setInputAction(function(e){l.end&&l.end()},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=function(e){i.end=void 0,d&&(d.pottingPoint=h),l._core.CreateTooltip(s,void 0,!1),l.drawHandler.destroy(),l._core.mouse(l._viewer.container,0),setTimeout(function(){se.states=0},100),"cancel"!==e?t&&t(d):d&&(u.entities.remove(d),l.MilitaryStandardObj.pop())},this},e.prototype.createSector=function(e,o,t){var n,a,s,i=this,l=e,u="单击开始绘制",c=this._viewer,h=this,d=[],m=[];return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),h._core.mouse(h._viewer.container,1,window.SmartEarthRootUrl+g.draw),se.states=1,h.drawHandler=new this._cesium.ScreenSpaceEventHandler(c.scene.canvas),h.drawHandler.setInputAction(function(e){u="单击添加点";var t=e.position,i=h._createGeoPoints(c,[{x:t.x,y:t.y}]);0==d.length?(d.push({x:i[0],y:i[1],z:i[2]},{x:i[0],y:i[1],z:i[2]}),m.push(i,i)):2==d.length?(d.push({x:i[0],y:i[1],z:i[2]}),m.push(i)):3==d.length&&h.end&&h.end(),2!==m.length||a||(a=c.entities.add({name:"临时线",polyline:{positions:new Cesium.CallbackProperty(function(){return[Cesium.Cartesian3.fromDegrees(m[0][0],m[0][1]),Cesium.Cartesian3.fromDegrees(m[1][0],m[1][1])]},!1),clampToGround:!0,material:Cesium.Color.fromCssColorString(h._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),width:3}}))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),h.drawHandler.setInputAction(function(e){h._core.CreateTooltip(u,e.endPosition,!0);var t=e.endPosition;if(2===d.length){d.pop(),m.pop();var i=h._createGeoPoints(c,[{x:t.x,y:t.y}]);d.push({x:i[0],y:i[1],z:i[2]}),m.push(i)}if(2<d.length)if(a&&c.entities.remove(a),h._cesium.defined(n)){d.pop(),m.pop();i=h._createGeoPoints(c,[{x:t.x,y:t.y}]);d.push({x:i[0],y:i[1],z:i[2]}),m.push(i);r=h._computeSectorPoints(d),i=[];r.forEach(function(e){i.push(e.x,e.y,d[0].z)}),s=h._cesium.Cartesian3.fromDegreesArrayHeights(i)}else{var r=h._computeSectorPoints(d),i=[];r.forEach(function(e){i.push(e.x,e.y,d[0].z)}),s=h._cesium.Cartesian3.fromDegreesArrayHeights(i),"polygon"==l?n=c.entities.add({name:"Sector",polygon:{hierarchy:s,material:h._cesium.Color.fromCssColorString(h._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:h._core.defaultValue(o.outline,!0),outlineColor:h._cesium.Color.fromCssColorString(h._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)"))}}):"box"==l&&(n=c.entities.add({name:"Sector",polygon:{hierarchy:s,material:h._cesium.Color.fromCssColorString(h._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:h._core.defaultValue(o.outline,!0),outlineColor:h._cesium.Color.fromCssColorString(h._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)")),extrudedHeight:i[2]+h._core.defaultValue(o.extrudedHeight,200),height:i[2]}})),n.polygon.hierarchy=new h._cesium.CallbackProperty(function(){return new h._cesium.PolygonHierarchy(s)},!1),n.GeoType="Sector",h.MilitaryStandardObj.push(n.id)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),h.drawHandler.setInputAction(function(e){h.end&&h.end()},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=function(e){i.end=void 0,n&&(n.pottingPoint=m),h._core.CreateTooltip(u,void 0,!1),h.drawHandler.destroy(),h._core.mouse(h._viewer.container,0),a&&c.entities.remove(a),setTimeout(function(){se.states=0},100),"cancel"!==e?t&&t(n):n&&(c.entities.remove(n),h.MilitaryStandardObj.pop())},this},e.prototype.createBow=function(e,o,t){var n,i=this,a=e,s=this,l=this._viewer,u="单击开始绘制",c=[],h=[],d=void 0;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),s._core.mouse(s._viewer.container,1,window.SmartEarthRootUrl+g.draw),se.states=1,s.drawHandler=new this._cesium.ScreenSpaceEventHandler(l.scene.canvas),s.drawHandler.setInputAction(function(e){u="单击添加点";var t=e.position,i=s._createGeoPoints(l,[{x:t.x,y:t.y}]);0==c.length?(c.push({x:i[0],y:i[1],z:i[2]}),h.push(i)):1==c.length?(c.push({x:i[0],y:i[1],z:i[2]},{x:i[0]+1e-7,y:i[1]+1e-7,z:i[2]}),h.push(i,i)):3==c.length&&s.end&&s.end()},this._cesium.ScreenSpaceEventType.LEFT_CLICK),s.drawHandler.setInputAction(function(e){var t=e.endPosition;if(s._core.CreateTooltip(u,e.endPosition,!0),2<c.length)if(Cesium.defined(d)){c.pop(),h.pop();r=s._createGeoPoints(l,[{x:t.x,y:t.y}]);c.push({x:r[0],y:r[1],z:r[2]}),h.push(r);i=s._computeBowPoints(c),r=[];i.forEach(function(e){r.push(e.x,e.y,c[0].z)}),n=s._cesium.Cartesian3.fromDegreesArrayHeights(r)}else{var i=s._computeBowPoints(c),r=[];i.forEach(function(e){r.push(e.x,e.y,c[0].z)}),n=s._cesium.Cartesian3.fromDegreesArrayHeights(r),"polygon"==a?d=l.entities.add({name:"Bow",polygon:{hierarchy:n,material:s._cesium.Color.fromCssColorString(s._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:s._core.defaultValue(o.outline,!0),outlineColor:s._cesium.Color.fromCssColorString(s._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)"))}}):"box"==a&&(d=l.entities.add({name:"Bow",polygon:{hierarchy:n,material:s._cesium.Color.fromCssColorString(s._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:s._core.defaultValue(o.outline,!0),outlineColor:s._cesium.Color.fromCssColorString(s._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)")),extrudedHeight:r[2]+s._core.defaultValue(o.extrudedHeight,200),height:r[2]}})),d.polygon.hierarchy=new s._cesium.CallbackProperty(function(){return new s._cesium.PolygonHierarchy(n)},!1),d.GeoType="Bow",s.MilitaryStandardObj.push(d.id)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),s.drawHandler.setInputAction(function(e){s.end&&s.end()},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=function(e){i.end=void 0,d&&(d.pottingPoint=h),s._core.CreateTooltip(u,void 0,!1),s.drawHandler.destroy(),s._core.mouse(s._viewer.container,0),setTimeout(function(){se.states=0},100),"cancel"!==e?t&&t(d):d&&(l.entities.remove(d),s.MilitaryStandardObj.pop())},this},e.prototype.createPincerArrow=function(e,r,o){var n=e,a=this,s=this._viewer,l=[],u=[],c=void 0,h="单击开始绘制";this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),a._core.mouse(a._viewer.container,1,window.SmartEarthRootUrl+g.draw),se.states=1,a.drawHandler=new this._cesium.ScreenSpaceEventHandler(s.scene.canvas),a.drawHandler.setInputAction(function(e){var t,i=e.position;if(h="单击增加点",t=a._getPosition.getMousePosition(e)){if(4<l.length)return a._core.CreateTooltip(h,e.position,!1),c.pottingPoint=u,a.drawHandler.destroy(),a._core.mouse(a._viewer.container,0),setTimeout(function(){se.states=0},100),void(o&&o(c));l.push(t);var r=a._createGeoPoints(s,[{x:i.x,y:i.y}]);u.push(r)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),a.drawHandler.setInputAction(function(e){var t;if(!(l.length<2)&&(a._core.CreateTooltip(h,e.endPosition,!0),(t=a._getPosition.getMousePosition(e))&&2<=l.length))if(a._cesium.defined(c)){l.pop(),u.pop(),l.push(t);i=a._createGeoPoints(s,[e.endPosition]);u.push(i)}else{l.push(t);var i=a._createGeoPoints(s,[e.endPosition]);u.push(i),(c=a.showArrowOnMap(l,n,r)).GeoType="PincerArrow",a.MilitaryStandardObj.push(c.id)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE)},e.prototype.createAttackArrow=function(e,r,t){var o=e,n=this,a=this._viewer,s=[],l=[],u=void 0,c="单击开始绘制";this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),n._core.mouse(n._viewer.container,1,window.SmartEarthRootUrl+g.draw),se.states=1,n.drawHandler=new this._cesium.ScreenSpaceEventHandler(a.scene.canvas),n.drawHandler.setInputAction(function(e){var t;if(c="单击增加点",t=n._getPosition.getMousePosition(e)){s.push(t);var i=n._createGeoPoints(a,[e.position]);l.push(i)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),n.drawHandler.setInputAction(function(e){1<s.length&&(s.pop(),l.pop())},this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),n.drawHandler.setInputAction(function(e){var t;if(!(s.length<2)&&(n._core.CreateTooltip(c,e.endPosition,!0),(t=n._getPosition.getMousePosition(e))&&2<=s.length))if(n._cesium.defined(u)){s.pop(),l.pop(),s.push(t);i=n._createGeoPoints(a,[e.endPosition]);l.push(i)}else{s.push(t);var i=n._createGeoPoints(a,[e.endPosition]);l.push(i),(u=n.showAttackArrowOnMap(s,o,r)).GeoType="AttackArrow",n.MilitaryStandardObj.push(u.id)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),n.drawHandler.setInputAction(function(e){n._core.CreateTooltip(c,e.position,!1),u.pottingPoint=l,n.drawHandler.destroy(),n._core.mouse(n._viewer.container,0),setTimeout(function(){se.states=0},100),t&&t(u)},this._cesium.ScreenSpaceEventType.RIGHT_DOWN)},e.prototype.createHandlerPolygon=function(e,a,r){var s,l=e,u="单击开始绘制",c=this,h=this._viewer,d=[],m=[],p=void 0;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),c._core.mouse(c._viewer.container,1,window.SmartEarthRootUrl+g.draw),se.states=1,c.drawHandler=new this._cesium.ScreenSpaceEventHandler(h.scene.canvas),c.drawHandler.setInputAction(function(e){var t=e.position;if(u="单击完成绘制",0==d.length){var i=c._createGeoPoints(h,[{x:t.x,y:t.y}]);d.push({x:i[0],y:i[1],z:i[2]},{x:i[0]+1e-7,y:i[1]+1e-7,z:i[2]}),m.push(i,i)}else 2==d.length&&(c._core.CreateTooltip(u,t,!1),p.pottingPoint=m,setTimeout(function(){se.states=0},100),c.drawHandler.destroy(),c._core.mouse(c._viewer.container,0),r&&r(p))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),c.drawHandler.setInputAction(function(e){var t,i,r,o=e.endPosition;if(c._core.CreateTooltip(u,e.endPosition,!0),1<d.length)if(Cesium.defined(p)){d.pop(),m.pop();var n=c._createGeoPoints(h,[{x:o.x,y:o.y}]);d.push({x:n[0],y:n[1],z:n[2]}),m.push(n),i=c._computeGatheringPlacePoints(d),r=c.createCloseCardinal(i),t=c.calculatePointsFBZ3(r,100);n=[];t.forEach(function(e){n.push(e.x,e.y,d[0].z)}),s=n}else i=c._computeGatheringPlacePoints(d),r=c.createCloseCardinal(i),t=c.calculatePointsFBZ3(r,100),n=[],t.forEach(function(e){n.push(e.x,e.y,d[0].z)}),s=n,(p=c.plotingGatheringPlace(h,d,l,a)).polygon.hierarchy=new c._cesium.CallbackProperty(function(){return new c._cesium.PolygonHierarchy(c._cesium.Cartesian3.fromDegreesArrayHeights(s))},!1),p.GeoType="GatheringPlace",c.MilitaryStandardObj.push(p.id)},c._cesium.ScreenSpaceEventType.MOUSE_MOVE),d},e.prototype.plotingGatheringPlace=function(e,t,i,r){var o=this._computeGatheringPlacePoints(t),n=this.createCloseCardinal(o),a=this.calculatePointsFBZ3(n,100),s=this._createGeoPoints(e,a);return"polygon"==i?e.entities.add({name:"GatheringPlace",polygon:{hierarchy:this._cesium.Cartesian3.fromDegreesArrayHeights(s),material:this._cesium.Color.fromCssColorString(this._core.defaultValue(r.color,"rgba(255,0,0,0.6)")),outline:this._core.defaultValue(r.outline,!0),outlineColor:this._cesium.Color.fromCssColorString(this._core.defaultValue(r.outlineColor,"rgba(255,0,0,0.6)"))}}):e.entities.add({name:"GatheringPlace",polygon:{hierarchy:this._cesium.Cartesian3.fromDegreesArrayHeights(s),extrudedHeight:this._core.defaultValue(r.extrudedHeight,200)+s[2],height:s[2],material:this._cesium.Color.fromCssColorString(this._core.defaultValue(r.color,"rgba(255,0,0,0.6)")),outline:this._core.defaultValue(r.outline,!0),outlineColor:this._cesium.Color.fromCssColorString(this._core.defaultValue(r.outlineColor,"rgba(255,0,0,0.6)"))}})},e.prototype.open=function(e){var d=this,m=this._viewer,t=new FileReader;t.readAsText(e);var p=new d._cesium.EntityCollection;t.onload=function(){var e=JSON.parse(this.result).features,c=void 0,h=void 0;e.forEach(function(e){h=e.geometry.coordinates;var t=[];if("PincerArrow"==e.type){var i=xp.algorithm.doubleArrow(h),r=[];-1==JSON.stringify(i.polygonalPoint).indexOf("null")&&(r=i.polygonalPoint),c=r}else if("AttackArrow"==e.type){var o=xp.algorithm.tailedAttackArrow(h),n=[];-1==JSON.stringify(o.polygonalPoint).indexOf("null")&&(n=o.polygonalPoint),c=n}else if(h.forEach(function(e){t.push({x:e[0],y:e[1],z:e[2]})}),"StraightArrow"==e.type)c=d.calculateMorePoints(t);else if("RoundedRectangle"==e.type)c=d._computeRoundedRectanglePoints(t);else if("Sector"==e.type)c=d._computeSectorPoints(t);else if("Bow"==e.type)c=d._computeBowPoints(t);else if("GatheringPlace"==e.type){var a=d._computeGatheringPlacePoints(t),s=d.createCloseCardinal(a);c=d.calculatePointsFBZ3(s,100)}else"SwallowtailArrow"==e.type?c=d._computeSwallowtailArrow(t):"Bezierline"==e.type?c=d._createBezierPoints(t):"BezierArrow"==e.type&&(c=d._createBezierPoints(t));var l=void 0;l="AttackArrow"!==e.type&&"PincerArrow"!==e.type?(l=[],c.forEach(function(e){l.push(e.x,e.y,t[0].z)}),d._cesium.Cartesian3.fromDegreesArrayHeights(l)):c;var u=void 0;(u=0<=e.type.indexOf("Bezier")?m.entities.add({name:e.name,polyline:{positions:new d._cesium.CallbackProperty(function(){return l},!1),width:e.style.width,material:"BezierArrow"===e.type?new d._cesium.PolylineArrowMaterialProperty(new d._cesium.Color.fromCssColorString(e.style.fillColor.color).withAlpha(e.style.fillColor.alpha)):new d._cesium.Color.fromCssColorString(e.style.fillColor.color).withAlpha(e.style.fillColor.alpha)}}):m.entities.add({name:e.name,polygon:{hierarchy:new d._cesium.CallbackProperty(function(){return new d._cesium.PolygonHierarchy(l)},!1),fill:!0,extrudedHeight:void 0!==e.style.extrudedHeight?e.style.extrudedHeight+e.style.height:void 0,height:e.style.height,material:new d._cesium.Color.fromCssColorString(e.style.fillColor.color).withAlpha(e.style.fillColor.alpha),outline:e.style.outline,outlineColor:e.style.outlineColor?new d._cesium.Color.fromCssColorString(e.style.outlineColor.color).withAlpha(e.style.outlineColor.alpha):void 0}})).GeoType=e.type,u.pottingPoint=h,d.MilitaryStandardObj.push(u.id),p.add(u)}),m.flyTo(p),this.MilitaryStandardObj.length&&!this.editHandler&&this.edit(this.openEdit,this.editOption)}},e.prototype.clear=function(){var t=this._viewer;this.MilitaryStandardObj.forEach(function(e){t.entities.removeById(e)}),this.MilitaryStandardObj=[],window.layuiLayer.close(this.layerIndex),!this.MilitaryStandardObj.length&&this.editHandler&&this.edit(!1)},e.prototype.save=function(){var r,o=this._viewer,n={type:"FeatureCollection",features:[]},t=this;function a(e){return{color:t.colorHex("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),alpha:e.alpha}}this.MilitaryStandardObj.forEach(function(e){var t=o.entities.getById(e);if(t){r={type:t.GeoType,name:t.name,editType:""};var i=t.pottingPoint;t.polyline?(r.editType="GroundPolyline",r.geometry={type:"polyline",coordinates:i},r.style={fillColor:a(t.polyline.material.color._value),width:t.polyline.width.getValue()}):(r.editType="GroundPolygon",r.geometry={type:"polygon",coordinates:i},r.style={fillColor:a(t.polygon.material.color._value)},t.polygon.extrudedHeight&&(r.editType="ExtrudedPolygon",r.style.height=t.polygon.height.getValue(),r.style.extrudedHeight=t.polygon.extrudedHeight.getValue()-t.polygon.height.getValue(),t.polygon.outline&&(r.style.outline=t.polygon.outline.getValue()),t.polygon.outlineColor&&(r.style.outlineColor=a(t.polygon.outlineColor._value))))}n.features.push(r)});var e=JSON.stringify(n),i=new Blob([e],{type:"text/plain;charset=utf-8"});saveAs(i,"军标.json")},e.prototype.colorHex=function(e){var t=e;if(/^(rgb|RGB)/.test(t)){for(var i=t.replace(/(rgb|RGB)*/g,""),r=(i=i.replace("(","").replace(")","")).split(","),o="#",n=0;n<r.length;n++){var a=Number(r[n]).toString(16);"0"===(a=1===a.length?"0"+a:a)&&(a+=a),o+=a}return 7!==o.length&&(o=t),o}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t))return t;var s=t.replace(/#/,"").split("");if(6===s.length)return t;if(3===s.length){var l="#";for(n=0;n<s.length;n+=1)l+=s[n]+s[n];return l}},e.prototype.copyJb=function(e){var t;if("StraightArrow"==e.type||"SwallowtailArrow"==e.type||"PincerArrow"==e.type){var i={holes:[],positions:this.szposis(e.pos)};t=this._viewer.entities.add({name:"StraightArrow",polygon:{hierarchy:i,material:this._cesium.Color.RED.withAlpha(.5)}})}else"BezierArrow"==e.type?t=this._viewer.entities.add({name:"BezierArrow",polyline:{positions:this.szposis(e.pos),width:5,material:new this._cesium.PolylineArrowMaterialProperty(this._cesium.Color.RED)}}):e.img?t=this._viewer.entities.add({position:this.zfsz(e.pos),billboard:{image:e.img,show:!0}}):e.text&&(t=this._viewer.entities.add({position:this.zfsz(e.pos),label:{text:e.text,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,show:!0,showBackground:!1}}));return t._id=e.id,that.objectsToExclude.push(t),t},e.prototype.getEntityById=function(e){var t,i=this._viewer.entities.getById(e);return null!=i.polyline&&i.polyline?t={obj:i.polyline,type:i.name,posion:i.polyline.positions.getValue()}:null!=i.polygon&&i.polygon?t={obj:i.polygon,type:i.name,posion:i.polygon.hierarchy.getValue().positions}:null!=i.label&&i.label?t={obj:i.label,type:"lable",text:i.label.text.getValue(),posion:i.position.getValue()}:null!=i.billboard&&i.billboard&&(t={obj:i.billboard,type:"img",img:i.billboard.image.getValue(),posion:i.position.getValue()}),t},e.prototype.szposis=function(e){for(var t=[],i=e.split(",("),r=0;r<i.length;r++){var o=this.zfsz(i[r]);t.push(o)}return t},e.prototype.zfsz=function(e){for(var t=e.split(","),i=0;i<t.length;i++)-1!=t[i].indexOf("(")?t[i]=t[i].replace("(",""):-1!=t[i].indexOf(")")&&(t[i]=t[i].replace("(",""));return{x:parseFloat(t[0]),y:parseFloat(t[1]),z:parseFloat(t[2])}},e.prototype.showArrowOnMap=function(s,e,t){var i,l=this,r=l._viewer.scene.globe.ellipsoid.cartesianToCartographic(s[0]).height,o=function(){if(s.length<3)return null;for(var e=[],t=0;t<s.length;t++){var i=l._viewer.scene.globe.ellipsoid.cartesianToCartographic(s[t]),r=l._cesium.Math.toDegrees(i.latitude),o=l._cesium.Math.toDegrees(i.longitude);e.push([o,r])}var n=xp.algorithm.doubleArrow(e),a=[];return-1==JSON.stringify(n.polygonalPoint).indexOf("null")&&(a=n.polygonalPoint),new l._cesium.PolygonHierarchy(a)};return"polygon"==e?i=l._viewer.entities.add({name:"PincerArrow",polygon:new l._cesium.PolygonGraphics({hierarchy:new l._cesium.CallbackProperty(o,!1),show:!0,fill:!0,material:l._cesium.Color.fromCssColorString(l._core.defaultValue(t.color,"rgba(255,0,0,0.6)")),outline:l._core.defaultValue(t.outline,!0),outlineColor:l._cesium.Color.fromCssColorString(l._core.defaultValue(t.outlineColor,"rgba(255,0,0,0.6)"))})}):"box"==e&&(i=l._viewer.entities.add({name:"PincerArrow",polygon:new l._cesium.PolygonGraphics({hierarchy:new l._cesium.CallbackProperty(o,!1),show:!0,fill:!0,material:l._cesium.Color.fromCssColorString(l._core.defaultValue(t.color,"rgba(255,0,0,0.6)")),outline:l._core.defaultValue(t.outline,!0),outlineColor:l._cesium.Color.fromCssColorString(l._core.defaultValue(t.outlineColor,"rgba(255,0,0,0.6)")),extrudedHeight:r+l._core.defaultValue(t.extrudedHeight,200),height:r})})),i},e.prototype.showAttackArrowOnMap=function(n,e,t){var a=this,i=a._viewer.scene.globe.ellipsoid.cartesianToCartographic(n[0]).height;return this._viewer.entities.add({name:"AttackArrow",polygon:new a._cesium.PolygonGraphics({hierarchy:new a._cesium.CallbackProperty(function(){if(n.length<3)return null;for(var e=[],t=0;t<n.length;t++){var i=a.cartesianToLatlng(n[t]);e.push(i)}var r=xp.algorithm.tailedAttackArrow(e),o=[];return-1==JSON.stringify(r.polygonalPoint).indexOf("null")&&(o=r.polygonalPoint),new a._cesium.PolygonHierarchy(o)},!1),show:!0,fill:!0,classificationType:a._cesium.ClassificationType.TERRAIN,extrudedHeight:"box"===e?a._core.defaultValue(t.extrudedHeight,200)+i:void 0,height:"box"===e?i:void 0,material:a._cesium.Color.fromCssColorString(a._core.defaultValue(t.color,"rgba(255,0,0,0.6)")),outline:a._core.defaultValue(t.outline,!0),outlineColor:a._cesium.Color.fromCssColorString(a._core.defaultValue(t.outlineColor,"rgba(255,0,0,0.6)"))})})},e.prototype.cartesianToLatlng=function(e){var t=this._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),i=this._cesium.Math.toDegrees(t.latitude);return[this._cesium.Math.toDegrees(t.longitude),i]},e.prototype.getCatesian3FromPX=function(e,t){var i,r=this._viewer.scene.drillPick(e);this._viewer.render();for(var o=!0,n=0;n<r.length;n++)(r[n]&&r[n].primitive||r[n]instanceof this._cesium.Cesium3DTileFeature)&&(o=!0);if(o)i=this._viewer.scene.pickPosition(e);else{var a=this._viewer.camera.getPickRay(e);if(!a)return null;i=this._viewer.scene.globe.pick(a,this._viewer.scene)}return i},e.prototype._createGeoPoints=function(e,t){for(var i,r,o,n,a,s,l=[],u=0;u<t.length;u++)(i=e.camera.getPickRay(t[u]))&&(r=e.scene.globe.pick(i,e.scene)),r&&(o=this._cesium.Cartographic.fromCartesian(r),n=this._cesium.Math.toDegrees(o.longitude),a=this._cesium.Math.toDegrees(o.latitude),s=o.height,l.push(n,a,s));return l},e.prototype._createScreenPoints=function(e,t){for(var i,r=[],o=0;o<t.length;o++)i=e.scene.cartesianToCanvasCoordinates(t[o]),r.push(i);return r},e.prototype._createBezierPoints=function(e){for(var t=[],i=0;i<=100;i++){var r=this._computeBezierPoints(e,i/100);t.push(r)}return t},e.prototype._computeBezierPoints=function(e,t){for(var i=0,r=0,o=this._computeBinomial(e),n=0;n<e.length;n++){var a=e[n];i+=a.x*Math.pow(1-t,e.length-1-n)*Math.pow(t,n)*o[n],r+=a.y*Math.pow(1-t,e.length-1-n)*Math.pow(t,n)*o[n]}return{x:i,y:r}},e.prototype._computeBinomial=function(e){var t=e.length,i=[];i.push(1);for(var r=1;r<t-1;r++){for(var o=1,n=1,a=0;a<r;a++)o*=t-1-a,n*=r-a;i.push(o/n)}return i.push(1),i},e.prototype._computeGatheringPlacePoints=function(e){var t=[];if(2==e.length){var i=e[0],r=e[e.length-1],o={x:r.x-i.x,y:r.y-i.y},n=Math.sqrt(o.x*o.x+o.y*o.y),a=this.calculateVector(o,Math.PI/3,Math.sqrt(3)/12*n)[1],s={x:i.x+a.x,y:i.y+a.y},l={x:(i.x+r.x)/2,y:(i.y+r.y)/2},u=this.calculateVector(o,2*Math.PI/3,Math.sqrt(3)/12*n)[1],c={x:r.x+u.x,y:r.y+u.y},h=this.calculateVector(o,Math.PI/2,.5*n)[0],d={x:h.x+l.x,y:h.y+l.y},m=i,p=r;t.push(m,s,l,c,p,d)}return t},e.prototype.createCloseCardinal=function(e){if(null==e||e.length<3)return e;var t=e[0];e.push(t);for(var i=e,r=[],o=i.length-1,n=0;n<=o-1;n++){if(n==o-1)var a=i[o-1],s=i[0],l=i[1];else a=i[n],s=i[n+1],l=i[n+2];var u={x:void 0,y:void 0},c={x:void 0,y:void 0},h=s.x-a.x,d=s.y-a.y,m=l.x-s.x,p=l.y-s.y,g=Math.sqrt(h*h+d*d),f=Math.sqrt(m*m+p*p),v=h/g,_=d/g,y=m/f,C=p/f,w=v+y,b=_+C,E=Math.sqrt(w*w+b*b),S=w/E,P=b/E,x=(v*y+_*C)/1;Math.abs(1-x)<.005?(u.x=s.x-y*g*.4,u.y=s.y-C*g*.4,c.x=s.x+v*f*.4,c.y=s.y+_*f*.4):(u.x=s.x-S*g*.4,u.y=s.y-P*g*.4,c.x=s.x+S*f*.4,c.y=s.y+P*f*.4),n==o-1?(r[0]=s,r[1]=c,r[3*(o-2)+2+3]=u,r[3*(o-2)+2+4]=i[o]):(r[3*n+2+0]=u,r[3*n+2+1]=s,r[3*n+2+2]=c)}return r},e.prototype.calculatePointsFBZ3=function(e,t){t||(t=20);var i=[],r=.05;0<t&&(r=1/t);for(var o=0;o<e.length-3;){var n=e[o],a=e[o+1],s=e[o+2],l=e[o+3];i.push(n);for(var u=0;u<1;){var c={x:(1-u)*(1-u)*(1-u)*n.x+3*u*(1-u)*(1-u)*a.x+3*u*u*(1-u)*s.x+u*u*u*l.x,y:(1-u)*(1-u)*(1-u)*n.y+3*u*(1-u)*(1-u)*a.y+3*u*u*(1-u)*s.y+u*u*u*l.y};i.push(c),u+=r}(o+=3)>=e.length&&i.push(n)}i[i.length-1],e[e.length-1];return i},e.prototype.calculateVector=function(e,t,i){var r,o,n,a,s,l;t||(t=Math.PI/2),i||(i=1);var u=Math.sqrt(e.x*e.x+e.y*e.y);if(0==e.y)r=o=u*i*Math.cos(t)/e.x,0<e.x?a=-(n=Math.sqrt(i*i-r*r)):e.x<0&&(n=-(a=Math.sqrt(i*i-r*r))),s={x:r,y:n},l={x:o,y:a};else{var c=-e.x/e.y,h=i*u*Math.cos(t)/e.y,d=1+c*c,m=2*c*h,p=h*h-i*i;n=c*(r=(-m-Math.sqrt(m*m-4*d*p))/(2*d))+h,a=c*(o=(-m+Math.sqrt(m*m-4*d*p))/(2*d))+h,0<=e.y?(s={x:r,y:n},l={x:o,y:a}):e.y<0&&(s={x:o,y:a},l={x:r,y:n})}return[s,l]},e.prototype.plotingSwallowtailArrow=function(e,t,i,r){var o,n=this._computeSwallowtailArrow(t),a=[];return n.forEach(function(e){a.push(e.x,e.y,t[0].z)}),"polygon"==i?o=e.entities.add({name:"SwallowtailArrow",polygon:{hierarchy:this._cesium.Cartesian3.fromDegreesArrayHeights(a),material:this._cesium.Color.fromCssColorString(this._core.defaultValue(r.color,"rgba(255,0,0,0.6)"))}}):"box"==i&&(o=e.entities.add({name:"SwallowtailArrow",polygon:{hierarchy:this._cesium.Cartesian3.fromDegreesArrayHeights(a),material:this._cesium.Color.fromCssColorString(this._core.defaultValue(r.color,"rgba(255,0,0,0.6)")),extrudedHeight:a[2]+this._core.defaultValue(r.extrudedHeight,200),height:a[2],outline:this._core.defaultValue(r.outline,!0),outlineColor:this._cesium.Color.fromCssColorString(this._core.defaultValue(r.outlineColor,"rgba(255,0,0,0.6)"))}})),o},e.prototype._computeSwallowtailArrow=function(e){var t=e[0].x,i=e[0].y,r=e[1].x,o=e[1].y,n=(15.8*r+3.2*t)/19,a=(15.8*o+3.2*i)/19,s=new Array(7);return s[0]={x:r,y:o},s[1]={x:n+.265625*(o-a),y:a-.265625*(r-n)},s[2]={x:n+.078125*(o-a),y:a-.078125*(r-n)},s[3]={x:t+1.6/19*(o-i),y:i-1.6/19*(r-t)},s[4]={x:(3.2*r+15.8*t)/19,y:(3.2*o+15.8*i)/19},s[5]={x:t-1.6/19*(o-i),y:i+1.6/19*(r-t)},s[6]={x:n-.078125*(o-a),y:a+.078125*(r-n)},s[7]={x:n-.265625*(o-a),y:a+.265625*(r-n)},s},e.prototype.calculateMorePoints=function(e){var t;if(2<e.length){for(var i,r,o,n=0,a=0;a<e.length-1;a++)r=e[a],o=e[a+1],n+=Math.sqrt((o.y-r.y)*(o.y-r.y)+(o.x-r.x)*(o.x-r.x));i=n/6;for(var s=[],l=[],u={x:void 0,y:void 0},c={x:void 0,y:void 0},h=0;h<e.length-2;h++){var d,m,p=e[h],g=e[h+1],f=e[h+2],v={x:g.x-p.x,y:g.y-p.y},_={x:f.x-g.x,y:f.y-g.y},y=this.calculateVector(v,Math.PI/2,i/2),C=y[0],w=y[1],b=this.calculateVector(_,Math.PI/2,i/2),E=b[0],S=b[1],P={x:p.x+C.x,y:p.y+C.y},x={x:p.x+w.x,y:p.y+w.y},T={x:g.x+E.x,y:g.y+E.y},I={x:g.x+S.x,y:g.y+S.y},D=this.calculateIntersection(v,_,P,T),L=this.calculateIntersection(v,_,x,I);if(0==h)c=x,d={x:((u=P).x+D.x)/2,y:(u.y+D.y)/2},m={x:(c.x+L.x)/2,y:(c.y+L.y)/2},s.push(d),l.push(m);else{var M=s[s.length-1],A=l[l.length-1];d={x:(M.x+D.x)/2,y:(M.y+D.y)/2},m={x:(A.x+L.x)/2,y:(A.y+L.y)/2},s.push(d),l.push(m)}s.push(D),l.push(L)}var R,O,N=e[e.length-2],V=e[e.length-1],F={x:V.x-N.x,y:V.y-N.y},H=Math.sqrt(F.x*F.x+F.y*F.y),G=[],k={x:void 0,y:void 0},B={x:void 0,y:void 0},j={x:void 0,y:void 0},z={x:void 0,y:void 0},W={x:void 0,y:void 0},U={x:void 0,y:void 0},q=s[s.length-1],Y=l[l.length-1];if(H<=i)k=(G=this.calculateVector(F,Math.PI/2,i/2))[0],B=G[1],R={x:N.x+k.x,y:N.y+k.y},O={x:N.x+B.x,y:N.y+B.y},j={x:(q.x+R.x)/2,y:(q.y+R.y)/2},z={x:(Y.x+O.x)/2,y:(Y.y+O.y)/2},s.push(j),l.push(z),W={x:2*R.x-N.x,y:2*R.y-N.y},U={x:2*O.x-N.x,y:2*O.y-N.y};else{var X=V.x-N.x,J=V.y-N.y,Q=Math.sqrt(X*X+J*J),K=V.x-X*i/Q,$=V.y-J*i/Q;k=(G=this.calculateVector(F,Math.PI/2,i/2))[0],B=G[1],R={x:K+k.x,y:$+k.y},O={x:K+B.x,y:$+B.y},j={x:(q.x+R.x)/2,y:(q.y+R.y)/2},z={x:(Y.x+O.x)/2,y:(Y.y+O.y)/2},s.push(j),l.push(z),W={x:2*R.x-K,y:2*R.y-$},U={x:2*O.x-K,y:2*O.y-$}}var Z=[],ee=[];for(a=0;a<s.length-2;a++){var te=[],ie=[],re=s[a],oe=s[a+1],ne=s[a+2],ae=l[a],se=l[a+1],le=l[a+2];te.push(re,oe,ne),ie.push(ae,se,le);var ue=this._createBezierPoints(te),ce=this._createBezierPoints(ie);Z=Z.concat(ue),ee=ee.concat(ce)}(t=(t=[u]).concat(Z)).push(R),t.push(W),t.push(V),t.push(U),t.push(O),(t=t.concat(ee.reverse())).push(c)}else t=this.calculateTwoPoints(e);return t},e.prototype.calculateIntersection=function(e,t,i,r){var o,n;return n=e.y*t.x-e.x*t.y==0?0<e.x*t.x||0<e.y*t.y?(o=(i.x+r.x)/2,(i.y+r.y)/2):(o=r.x,r.y):(o=(e.x*t.x*(r.y-i.y)+i.x*e.y*t.x-r.x*t.y*e.x)/(e.y*t.x-e.x*t.y),0!=e.x?(o-i.x)*e.y/e.x+i.y:(o-r.x)*t.y/t.x+r.y),{x:o,y:n}},e.prototype.calculateTwoPoints=function(e){var t=e[0],i=e[1],r=[],o={x:i.x-t.x,y:i.y-t.y},n=Math.sqrt((i.x-t.x)*(i.x-t.x)+(i.y-t.y)*(i.y-t.y))/6,a=t.x+5*(i.x-t.x)/6,s=t.y+5*(i.y-t.y)/6,l=this.calculateVector(o,Math.PI/2,n/2),u=l[0],c=l[1],h={x:t.x+u.x,y:t.y+u.y},d={x:a+u.x,y:s+u.y},m={x:a+2*u.x,y:s+2*u.y},p={x:i.x,y:i.y},g={x:a+2*c.x,y:s+2*c.y},f={x:a+c.x,y:s+c.y},v={x:t.x+c.x,y:t.y+c.y};return r.push(h,d,m,p,g,f,v),r},e.prototype._computeRoundedRectanglePoints=function(e){for(var t=(e[0].x+e[1].x)/2,i=(e[0].y+e[1].y)/2,r=Math.abs(e[0].x-e[1].x),o=Math.abs(e[0].y-e[1].y),n=.1*Math.min(r,o),a=t-r/2+n,s=i-o/2+n,l=t+r/2-n,u=i-o/2+n,c=t+r/2-n,h=i+o/2-n,d=t-r/2+n,m=i+o/2-n,p=Math.PI/180,g=[],f=Math.PI,v=1.5*Math.PI,_=f,y=0;y<Math.abs(f-v);y+=p){var C=a+n*Math.cos(_),w=s+n*Math.sin(_);_=(_=(_+=p)<0?2*Math.PI+_:_)>2*Math.PI?2*Math.PI-_:_,g.push({x:C,y:w})}var b=g,E=3*Math.PI/2,S=2*Math.PI,P=E;for(y=0;y<Math.abs(E-S);y+=p){C=l+n*Math.cos(P),w=u+n*Math.sin(P);P=(P=(P+=p)<0?2*Math.PI+P:P)>2*Math.PI?2*Math.PI-P:P,b.push({x:C,y:w})}var x=b,T=.5*Math.PI,I=0;for(y=0;y<Math.abs(0-T);y+=p){C=c+n*Math.cos(I),w=h+n*Math.sin(I);I=(I=(I+=p)<0?2*Math.PI+I:I)>2*Math.PI?2*Math.PI-I:I,x.push({x:C,y:w})}var D=x,L=.5*Math.PI,M=Math.PI,A=L;for(y=0;y<Math.abs(L-M);y+=p){C=d+n*Math.cos(A),w=m+n*Math.sin(A);A=(A=(A+=p)<0?2*Math.PI+A:A)>2*Math.PI?2*Math.PI-A:A,D.push({x:C,y:w})}return D},e.prototype._computeSectorPoints=function(e){var t=this.calculateAngle(e[0],e[1]),i=this.calculateAngle(e[0],e[2]);i<t&&(i=2*Math.PI+i);for(var r=Math.PI/180,o=t,n=[e[0]],a=Math.sqrt((e[1].x-e[0].x)*(e[1].x-e[0].x)+(e[1].y-e[0].y)*(e[1].y-e[0].y)),s=0;s<Math.abs(t-i);s+=r){var l=e[0].x+a*Math.cos(o),u=e[0].y+a*Math.sin(o);o=(o=(o+=r)<0?2*Math.PI+o:o)>2*Math.PI?o-2*Math.PI:o,n.push({x:l,y:u})}return n},e.prototype.calculateAngle=function(e,t){var i={x:t.x-e.x,y:t.y-e.y},r=Math.atan2(i.y,i.x);return r<0&&(r+=2*Math.PI),r},e.prototype._computeBowPoints=function(e){var t=2*(e[1].x-e[0].x),i=2*(e[1].y-e[0].y),r=e[1].x*e[1].x+e[1].y*e[1].y-e[0].x*e[0].x-e[0].y*e[0].y,o=2*(e[2].x-e[1].x),n=2*(e[2].y-e[1].y),a=e[2].x*e[2].x+e[2].y*e[2].y-e[1].x*e[1].x-e[1].y*e[1].y,s=(r*n-a*i)/(t*n-o*i),l=(t*a-o*r)/(t*n-o*i),u={x:s,y:l},c=Math.sqrt((e[0].x-s)*(e[0].x-s)+(e[0].y-l)*(e[0].y-l)),h=this.calculateAngle(u,e[0]),d=this.calculateAngle(u,e[1]),m=this.calculateAngle(u,e[2]),p=Math.PI/180,g=void 0,f=[];if(h<m&&m<d||d<m&&m<h){g=h<d?h:d;for(var v=0;v<Math.abs(h-d);v+=p){var _=s+c*Math.cos(g),y=l+c*Math.sin(g);g=(g=(g+=p)<0?2*Math.PI+g:g)>2*Math.PI?2*Math.PI-g:g,f.push({x:_,y:y})}}else{g=d<h?h:d;for(v=0;v<2*Math.PI-Math.abs(h-d);v+=p){_=s+c*Math.cos(g),y=l+c*Math.sin(g);g=(g=(g+=p)<0?2*Math.PI+g:g)>2*Math.PI?g-2*Math.PI:g,f.push({x:_,y:y})}}return f},e.prototype.Cdcl=function(e,t,i,r){var o=Math.PI;function n(e){return e*o/180}var a,s,l,u,c=n((e+i)/2),h=n((e-i)/2),d=n((t-r)/2),m=Math.sin(h),p=Math.sin(d),g=Math.sin(c);return a=(m*=m)*(1-(p*=p))+(1-(g*=g))*p,s=(1-m)*(1-p)+g*p,2*(l=Math.atan(Math.sqrt(a/s)))*6378137*(1+1/298.257*((3*(u=Math.sqrt(a*s)/l)-1)/2/s*g*(1-m)-(3*u+1)/2/a*(1-g)*m))},e.prototype.createPoint=function(e,t){if(e)return this._viewer.entities.add({position:e,point:{pixelSize:10,color:this._cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},e.prototype.setEdit=function(e,t){void 0===e&&(e=!0),!t&&(t={}),this.editOption=t,this.openEdit=e},e.prototype.edit=function(e,_){var y=this,Z=this,ee=this._viewer;if(!_&&(_={}),void 0!==_.editProp&&(this.editProp=_.editProp),this.editHandler){for(var t in this.editHandler.destroy(),this.editHandler=void 0,se.pointsId)this._viewer.entities.removeById(se.pointsId[t]);se.pointsId=[]}if(void 0===e&&(e=!0),e){this.editHandler=new this._cesium.ScreenSpaceEventHandler(ee.scene.canvas);var te=void 0;this.isEditting=!1;var ie,re,oe=void 0,ne=void 0;for(var t in this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))Z.isEditting&&(ae(),Z.defaultEvent(!1));else if(!se.editVector){var t=e.position,i=ee.scene.pick(t);if(i&&i.id instanceof Cesium.Entity){var r=i.id;if(Z.isEditting||0!=se.states)if("box_point"==r.name||"polygon_point"==r.name||"move_point"==r.name){if(Z.defaultEvent(!1),"box_point"==r.name){ne=r.position.getValue();var o=Z._cesium.Cartographic.fromCartesian(ne);ne={lon:Z._cesium.Math.toDegrees(o.longitude),lat:Z._cesium.Math.toDegrees(o.latitude),height:o.height},ie="box_point"}else ie="move_point"==r.name?"move_point":"polygon_point";oe=r}else{if(te&&r.id===te.id)return;ae()}else{if(-1===Z.MilitaryStandardObj.indexOf(r.id))return;var n=(te=r).pottingPoint;if(!n)return;Z.isEditting=!0;var a=n,s={x:0,y:0,z:0};for(var l in a){var u=a[l];s.x+=u[0],s.y+=u[1],s.z+=u[2];var c,h=Z._cesium.Cartesian3.fromDegreesArrayHeights(u),d=ee.entities.add({name:"polygon_point",position:h[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(d.pottingPoint=u,se.pointsId.push(d.id),Z.objectsToExclude.push(d),te.polygon&&te.polygon.extrudedHeight){if(h.x)m=Z._cesium.Cartographic.fromCartesian(h);else var m=Z._cesium.Cartographic.fromCartesian(h[0]);var p=Z._cesium.Math.toDegrees(m.longitude),g=Z._cesium.Math.toDegrees(m.latitude),f=te.polygon.extrudedHeight.getValue(),v=Z._cesium.Cartesian3.fromDegrees(p,g,f);(c=ee.entities.add({name:"box_point",position:v,point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,heightReference:Z._cesium.HeightReference.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY}})).pottingPoint=u,c.pointid=d.id,Z.objectsToExclude.push(c),Z.heightpoints.push(c),Z.heightpointsId.push(c.id)}}s.x/=a.length,s.y/=a.length,s.z/=a.length,re=ee.entities.add({name:"move_point",position:Z._cesium.Cartesian3.fromDegrees(s.x,s.y,s.z),point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,heightReference:Z._cesium.HeightReference.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),SmartEarthPopupData.editGraphic={entity:te,graphic:te.polygon||te.polyline,heightpoints:Z.heightpoints},y.editProp&&(!_.editPropData&&(_.editPropData={}),Z._popupmessage.createPopupProp("属性编辑",{width:_.editPropData.width||360,height:_.editPropData.height||"90%",url:"Workers/prop/jb_prop.html",shade:_.editPropData.shade,offset:_.editPropData.offset,type:te.polyline?"GroundPolyline":0<Z.heightpoints.length?"ExtrudedPolygon":"GroundPolygon",fn:{success:function(e,t){_.editPropData.success&&_.editPropData.success(e,t),Z.layerIndex=t,SmartEarthPopupData.window=e.find("iframe")[0].contentWindow},end:function(){_.editPropData.end&&_.editPropData.end(),ae(),Z.layerIndex=void 0,SmartEarthPopupData.window=void 0}}}))}}else ae()}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))Z.isEditting&&(ae(),Z.defaultEvent(!1));else if(!se.editVector){var t=ee.scene.pick(e.endPosition);if(Z._cesium.defined(t))if(Z.isEditting&&!oe){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))return void(Z.isEditting&&(ae(),Z.defaultEvent(!1)));!t.id||"move_point"!==t.id.name&&"polygon_point"!==t.id.name?t.id&&"box_point"===t.id.name?Z.tooltip.showAt(e.endPosition,"拖拽修改高度"):t.id==te&&Z.tooltip.show(!1):Z.tooltip.showAt(e.endPosition,"拖拽修改位置")}else Z.isEditting||0!==se.states||(t.id&&-1<Z.MilitaryStandardObj.indexOf(t.id.id)?Z.tooltip.showAt(e.endPosition,"点击激活编辑,右键删除"):Z.tooltip.show(!1));else 0!=se.states||oe||Z.tooltip.show(!1);if(Z.isEditting&&oe){Z.tooltip.showAt(e.endPosition,"释放后完成修改");var i=e.startPosition;if((S=ee.camera.getPickRay(i))&&(P=ee.scene.globe.pick(S,ee.scene)),!P)return;var r=void 0;if("polygon_point"==ie){for(var o in oe.position=P,se.pointsId)if(se.pointsId[o]==oe.id){var n=ee.entities.getById(Z.heightpointsId[o]);if(!n)break;var a=Z._cesium.Cartographic.fromCartesian(P),s=Z._cesium.Math.toDegrees(a.longitude),l=Z._cesium.Math.toDegrees(a.latitude),u=Z._cesium.Cartographic.fromCartesian(n.position._value),c=a.height+u.height;n.position=Z._cesium.Cartesian3.fromDegrees(s,l,c)}var h=[],d=[],m=new Z._cesium.Cartesian3;for(var o in se.pointsId){var p=ee.entities.getById(se.pointsId[o]).position._value,g=Z._cesium.Cartographic.fromCartesian(p),f={x:Z._cesium.Math.toDegrees(g.longitude),y:Z._cesium.Math.toDegrees(g.latitude),z:g.height};h.push(f),d.push([f.x,f.y,f.z]),m.x+=p.x,m.y+=p.y,m.z+=p.z}if(m.x/=h.length,m.y/=h.length,m.z/=h.length,re&&(re.position=m),"StraightArrow"==te.GeoType)B=Z.calculateMorePoints(h);else if("RoundedRectangle"==te.GeoType)B=Z._computeRoundedRectanglePoints(h);else if("Sector"==te.GeoType)B=Z._computeSectorPoints(h);else if("Bow"==te.GeoType)B=Z._computeBowPoints(h);else if("GatheringPlace"==te.GeoType){var v=Z._computeGatheringPlacePoints(h),_=Z.createCloseCardinal(v);B=Z.calculatePointsFBZ3(_,100)}else if("SwallowtailArrow"==te.GeoType)B=Z._computeSwallowtailArrow(h);else if("Bezierline"==te.GeoType)B=Z._createBezierPoints(h);else if("BezierArrow"==te.GeoType)B=Z._createBezierPoints(h);else if("PincerArrow"==te.GeoType){var y=xp.algorithm.doubleArrow(d),C=[];-1==JSON.stringify(y.polygonalPoint).indexOf("null")&&(C=y.polygonalPoint),B=C}else if("AttackArrow"==te.GeoType){var w=xp.algorithm.tailedAttackArrow(d),b=[];-1==JSON.stringify(w.polygonalPoint).indexOf("null")&&(b=w.polygonalPoint),B=b}var E=void 0;E="AttackArrow"!==te.GeoType&&"PincerArrow"!==te.GeoType?(E=[],B.forEach(function(e){E.push(e.x,e.y,h[0].z)}),Z._cesium.Cartesian3.fromDegreesArrayHeights(E)):B,te.pottingPoint=d,0<=te.GeoType.indexOf("Bezier")?te.polyline.positions=new Z._cesium.CallbackProperty(function(){return E},!1):te.polygon.hierarchy=new Z._cesium.CallbackProperty(function(){return new Z._cesium.PolygonHierarchy(E)},!1)}else if("box_point"==ie){var S=ee.camera.getPickRay(e.endPosition),P=ee.scene.globe.pick(S,ee.scene),x=Z._cesium.Cartographic.fromCartesian(P),T=Z._cesium.Math.toDegrees(x.longitude),I=Z._cesium.Math.toDegrees(x.latitude),D=ne.lon,L=ne.lat;c=Z.Cdcl(I,T,L,D);for(var M in r=c,Z.heightpointsId){var A=ee.entities.getById(Z.heightpointsId[M]),R=A.position._value,O=Z._cesium.Cartographic.fromCartesian(R),N=Z._cesium.Math.toDegrees(O.longitude),V=Z._cesium.Math.toDegrees(O.latitude),F=Z._cesium.Cartesian3.fromDegrees(N,V,r);A.position=F}te.polygon.extrudedHeight=new Z._cesium.CallbackProperty(function(){return r},!1),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]').value=parseInt(r))}else{x=Z._cesium.Cartographic.fromCartesian(P),T=Z._cesium.Math.toDegrees(x.longitude),I=Z._cesium.Math.toDegrees(x.latitude);ne=oe.position.getValue();var H=Z._cesium.Cartographic.fromCartesian(ne),G=T-(D=(ne={lon:Z._cesium.Math.toDegrees(H.longitude),lat:Z._cesium.Math.toDegrees(H.latitude),height:H.height}).lon),k=I-(L=ne.lat);oe.position=P;var B;h=[],d=[];for(var o in se.pointsId){var j=void 0,z=void 0,W=ee.entities.getById(se.pointsId[o]);W&&(j=W.position.getValue(),z=Z._cesium.Cartographic.fromCartesian(j),j={lon:Z._cesium.Math.toDegrees(z.longitude),lat:Z._cesium.Math.toDegrees(z.latitude),height:z.height},W.position=Z._cesium.Cartesian3.fromDegrees(j.lon+G,j.lat+k,j.height),h.push({x:j.lon+G,y:j.lat+k,z:j.height}),d.push([j.lon+G,j.lat+k,j.height]));var U=ee.entities.getById(Z.heightpointsId[o]);U&&(j=U.position.getValue(),z=Z._cesium.Cartographic.fromCartesian(j),j={lon:Z._cesium.Math.toDegrees(z.longitude),lat:Z._cesium.Math.toDegrees(z.latitude),height:z.height},U.position=Z._cesium.Cartesian3.fromDegrees(j.lon+G,j.lat+k,j.height))}if("StraightArrow"==te.GeoType)B=Z.calculateMorePoints(h);else if("RoundedRectangle"==te.GeoType)B=Z._computeRoundedRectanglePoints(h);else if("Sector"==te.GeoType)B=Z._computeSectorPoints(h);else if("Bow"==te.GeoType)B=Z._computeBowPoints(h);else if("GatheringPlace"==te.GeoType){var q=Z._computeGatheringPlacePoints(h),Y=Z.createCloseCardinal(q);B=Z.calculatePointsFBZ3(Y,100)}else if("SwallowtailArrow"==te.GeoType)B=Z._computeSwallowtailArrow(h);else if("Bezierline"==te.GeoType)B=Z._createBezierPoints(h);else if("BezierArrow"==te.GeoType)B=Z._createBezierPoints(h);else if("PincerArrow"==te.GeoType){var X=xp.algorithm.doubleArrow(d),J=[];-1==JSON.stringify(X.polygonalPoint).indexOf("null")&&(J=X.polygonalPoint),B=J}else if("AttackArrow"==te.GeoType){var Q=xp.algorithm.tailedAttackArrow(d),K=[];-1==JSON.stringify(Q.polygonalPoint).indexOf("null")&&(K=Q.polygonalPoint),B=K}var $=void 0;$="AttackArrow"!==te.GeoType&&"PincerArrow"!==te.GeoType?($=[],B.forEach(function(e){$.push(e.x,e.y,h[0].z)}),Z._cesium.Cartesian3.fromDegreesArrayHeights($)):B,te.pottingPoint=d,0<=te.GeoType.indexOf("Bezier")?te.polyline.positions=new Z._cesium.CallbackProperty(function(){return $},!1):te.polygon.hierarchy=new Z._cesium.CallbackProperty(function(){return new Z._cesium.PolygonHierarchy($)},!1)}}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.editHandler.setInputAction(function(e){Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?Z.isEditting&&(ae(),Z.defaultEvent(!1)):se.editVector||(oe=void 0,Z.defaultEvent(!0))},this._cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))Z.isEditting&&(ae(),Z.defaultEvent(!1));else if(!se.editVector){var t=ee.scene.pick(e.position);if(Z._cesium.defined(t)&&0==se.states){var i=t.id;if(-1===Z.MilitaryStandardObj.indexOf(i.id))return;Z.delButton(!0,e.position,function(){ee.entities.removeById(i.id);var e=Z.MilitaryStandardObj.indexOf(i.id);Z.MilitaryStandardObj.splice(e,1),Z.delButton(!1),Z.tooltip.show(!1),ae(),!Z.MilitaryStandardObj.length&&Z.editHandler&&Z.edit(!1)})}}},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),Z.defaultEvent(!0),se.pointsId)ee.entities.removeById(se.pointsId[t]);for(var t in Z.heightpointsId)ee.entities.removeById(Z.heightpointsId[t]);Z.heightpointsId=[],Z.heightpoints=[],se.pointsId=[]}else ae();function ae(){for(var e in Z.defaultEvent(!0),se.pointsId)ee.entities.removeById(se.pointsId[e]);for(var e in Z.heightpointsId)ee.entities.removeById(Z.heightpointsId[e]);re&&ee.entities.remove(re),te=re=void 0,window.layuiLayer.close(Z.layerIndex),Z.isEditting=!1,se.pointsId=[],Z.heightpointsId=[],Z.heightpoints=[],Z.delButton(!1)}},e.prototype.spArray=function(e,t){var i,r=[];for(i=0;i<t.length;)r.push(t.slice(i,i+=e));return r},e.prototype.delButton=function(e,t,i){if(e){var r=document.getElementById("DeleteMilitaryStandardDelete");r||((r=document.createElement("button")).id="DeleteMilitaryStandardDelete",r.innerText="删除对象",r.style.cssText="height: 38px;\n line-height: 38px;\n padding: 0 18px;\n background-color: #052355;\n color: #fff;\n white-space: nowrap;\n text-align: center;\n font-size: 14px;\n border: none;\n border-radius: 2px;\n cursor: pointer;\n position: absolute;",this._viewer.container.appendChild(r)),r.style.display="block",r.style.top=t.y+"px",r.style.left=t.x+"px",r.onclick=i}else{var o=document.getElementById("DeleteMilitaryStandardDelete");o&&(o.style.display="none",o.onclick=null)}},e.prototype.defaultEvent=function(e){var t=this._viewer.scene;t.screenSpaceCameraController.enableRotate=e,t.screenSpaceCameraController.enableTranslate=e,t.screenSpaceCameraController.enableZoom=e,t.screenSpaceCameraController.enableTilt=e,t.screenSpaceCameraController.enableLook=e},e}),define("SGWorld/Creator/StraightArrowPerfect",["../Core/Core","../ProjectTree/treeSource","../Navigate/getPosition"],function(i,_,r){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this._tree=_,this._getPosition=new r(this._viewer,this._cesium),this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.state=0,this.gonPointArr=[],this.button=0,this.modifyPoint=null,this.gonPointStretchingArr=[]}return e.prototype.createStraightArrowTwoPerfect=function(){var c=this,h=this._viewer,d=new this._cesium.ScreenSpaceEventHandler(h.scene.canvas),m=[],p=void 0,g=[],f="单击开始绘制",v=0;return _.states=1,d.setInputAction(function(e){0<v&&(c._core.CreateTooltip(f,e.endPosition,!1),p.pottingPoint=g,_.states=0,d.destroy()),v+=1;var t=e.position;0==m.length&&m.push({x:t.x,y:t.y});var i=c._createGeoPoints(h,m);if(0<c.button){var r=c._cesium.Cartesian3.fromDegreesArray(i),o=r[0],n=c.createPoint(o,!1),a={x:(r[0].x+r[r.length-1].x)/2,y:(r[0].y+r[r.length-1].y)/2,z:(r[0].z+r[r.length-1].z)/2},s=c.createPointw(a,!1),l=r[r.length-1],u=c.createPoint(l,!1);c.gonPointArr.push(n),c.gonPointArr.push(s),c.gonPointArr.push(u)}c.button=c.button+1,g.push(i),m.push({x:t.x+1,y:t.y+1}),f="左击完成绘制"},this._cesium.ScreenSpaceEventType.LEFT_DOWN),d.setInputAction(function(e){var t=e.endPosition;if(c._core.CreateTooltip(f,e.endPosition,!0),1<m.length){var i=c.calculateMorePoints(m),r=c._createGeoPoints(h,i);if(c._cesium.defined(p)){m.pop(),m.push({x:t.x,y:t.y});i=c.calculateMorePoints(m),r=c._createGeoPoints(h,i);p.polygon.hierarchy=new c._cesium.CallbackProperty(function(){return new c._cesium.PolygonHierarchy(c._cesium.Cartesian3.fromDegreesArray(r))},!1)}else(p=h.entities.add({name:"StraightArrow",polygon:{hierarchy:c._cesium.Cartesian3.fromDegreesArray(r),material:c._cesium.Color.RED.withAlpha(.5),classificationType:c._cesium.ClassificationType.BOTH}})).objId=c.objId}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),d.setInputAction(function(e){c._core.CreateTooltip(f,e.endPosition,!1),p.pottingPoint=g,c.state=1,d.destroy()},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),this},e.prototype.calculateMorePoints=function(e){var t;if(2<e.length){for(var i,r,o,n=0,a=0;a<e.length-1;a++)r=e[a],o=e[a+1],n+=Math.sqrt((o.y-r.y)*(o.y-r.y)+(o.x-r.x)*(o.x-r.x));i=n/6;for(var s=[],l=[],u={x:void 0,y:void 0},c={x:void 0,y:void 0},h=0;h<e.length-2;h++){var d,m,p=e[h],g=e[h+1],f=e[h+2],v={x:g.x-p.x,y:g.y-p.y},_={x:f.x-g.x,y:f.y-g.y},y=this.calculateVector(v,Math.PI/2,i/2),C=y[0],w=y[1],b=this.calculateVector(_,Math.PI/2,i/2),E=b[0],S=b[1],P={x:p.x+C.x,y:p.y+C.y},x={x:p.x+w.x,y:p.y+w.y},T={x:g.x+E.x,y:g.y+E.y},I={x:g.x+S.x,y:g.y+S.y},D=this.calculateIntersection(v,_,P,T),L=this.calculateIntersection(v,_,x,I);if(0==h)c=x,d={x:((u=P).x+D.x)/2,y:(u.y+D.y)/2},m={x:(c.x+L.x)/2,y:(c.y+L.y)/2},s.push(d),l.push(m);else{var M=s[s.length-1],A=l[l.length-1];d={x:(M.x+D.x)/2,y:(M.y+D.y)/2},m={x:(A.x+L.x)/2,y:(A.y+L.y)/2},s.push(d),l.push(m)}s.push(D),l.push(L)}var R,O,N=e[e.length-2],V=e[e.length-1],F={x:V.x-N.x,y:V.y-N.y},H=Math.sqrt(F.x*F.x+F.y*F.y),G=[],k={x:void 0,y:void 0},B={x:void 0,y:void 0},j={x:void 0,y:void 0},z={x:void 0,y:void 0},W={x:void 0,y:void 0},U={x:void 0,y:void 0},q=s[s.length-1],Y=l[l.length-1];if(H<=i)k=(G=this.calculateVector(F,Math.PI/2,i/2))[0],B=G[1],R={x:N.x+k.x,y:N.y+k.y},O={x:N.x+B.x,y:N.y+B.y},j={x:(q.x+R.x)/2,y:(q.y+R.y)/2},z={x:(Y.x+O.x)/2,y:(Y.y+O.y)/2},s.push(j),l.push(z),W={x:2*R.x-N.x,y:2*R.y-N.y},U={x:2*O.x-N.x,y:2*O.y-N.y};else{var X=V.x-N.x,J=V.y-N.y,Q=Math.sqrt(X*X+J*J),K=V.x-X*i/Q,$=V.y-J*i/Q;k=(G=this.calculateVector(F,Math.PI/2,i/2))[0],B=G[1],R={x:K+k.x,y:$+k.y},O={x:K+B.x,y:$+B.y},j={x:(q.x+R.x)/2,y:(q.y+R.y)/2},z={x:(Y.x+O.x)/2,y:(Y.y+O.y)/2},s.push(j),l.push(z),W={x:2*R.x-K,y:2*R.y-$},U={x:2*O.x-K,y:2*O.y-$}}var Z=[],ee=[];for(a=0;a<s.length-2;a++){var te=[],ie=[],re=s[a],oe=s[a+1],ne=s[a+2],ae=l[a],se=l[a+1],le=l[a+2];te.push(re,oe,ne),ie.push(ae,se,le);var ue=this._createBezierPoints(te),ce=this._createBezierPoints(ie);Z=Z.concat(ue),ee=ee.concat(ce)}(t=(t=[u]).concat(Z)).push(R),t.push(W),t.push(V),t.push(U),t.push(O),(t=t.concat(ee.reverse())).push(c)}else t=this.calculateTwoPoints(e);return t},e.prototype.calculateVector=function(e,t,i){var r,o,n,a,s,l;t||(t=Math.PI/2),i||(i=1);var u=Math.sqrt(e.x*e.x+e.y*e.y);if(0==e.y)r=o=u*i*Math.cos(t)/e.x,0<e.x?a=-(n=Math.sqrt(i*i-r*r)):e.x<0&&(n=-(a=Math.sqrt(i*i-r*r))),s={x:r,y:n},l={x:o,y:a};else{var c=-e.x/e.y,h=i*u*Math.cos(t)/e.y,d=1+c*c,m=2*c*h,p=h*h-i*i;n=c*(r=(-m-Math.sqrt(m*m-4*d*p))/(2*d))+h,a=c*(o=(-m+Math.sqrt(m*m-4*d*p))/(2*d))+h,0<=e.y?(s={x:r,y:n},l={x:o,y:a}):e.y<0&&(s={x:o,y:a},l={x:r,y:n})}return[s,l]},e.prototype.calculateIntersection=function(e,t,i,r){var o,n;return n=e.y*t.x-e.x*t.y==0?0<e.x*t.x||0<e.y*t.y?(o=(i.x+r.x)/2,(i.y+r.y)/2):(o=r.x,r.y):(o=(e.x*t.x*(r.y-i.y)+i.x*e.y*t.x-r.x*t.y*e.x)/(e.y*t.x-e.x*t.y),0!=e.x?(o-i.x)*e.y/e.x+i.y:(o-r.x)*t.y/t.x+r.y),{x:o,y:n}},e.prototype._createBezierPoints=function(e){for(var t=[],i=0;i<=100;i++){var r=this._computeBezierPoints(e,i/100);t.push(r)}return t},e.prototype.calculateTwoPoints=function(e){var t=e[0],i=e[1],r=[],o={x:i.x-t.x,y:i.y-t.y},n=Math.sqrt((i.x-t.x)*(i.x-t.x)+(i.y-t.y)*(i.y-t.y))/6,a=t.x+5*(i.x-t.x)/6,s=t.y+5*(i.y-t.y)/6,l=this.calculateVector(o,Math.PI/2,n/2),u=l[0],c=l[1],h={x:t.x+u.x,y:t.y+u.y},d={x:a+u.x,y:s+u.y},m={x:a+2*u.x,y:s+2*u.y},p={x:i.x,y:i.y},g={x:a+2*c.x,y:s+2*c.y},f={x:a+c.x,y:s+c.y},v={x:t.x+c.x,y:t.y+c.y};return r.push(h,d,m,p,g,f,v),r},e.prototype._createGeoPoints=function(e,t){for(var i=[],r=0;r<t.length;r++){var o=this._viewer.scene.globe.ellipsoid,n=this._viewer.camera.pickEllipsoid(t[r],o),a=o.cartesianToCartographic(n),s=this._cesium.Math.toDegrees(a.longitude),l=this._cesium.Math.toDegrees(a.latitude);i.push(s),i.push(l)}return i},e.prototype.createPoint=function(e,t){if(e)return this._viewer.entities.add({position:e,point:{pixelSize:10,color:this._cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},e.prototype.createPointw=function(e,t){if(e)return this._viewer.entities.add({position:e,point:{pixelSize:10,color:this._cesium.Color.MAGENTA,outlineWidth:2,outlineColor:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},e.prototype.startModify=function(){var n="拖动修改位置,右击删除该点";if(1==this.state||2==this.state){this.modifyHandler||(this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas));for(var a=this,e=0;e<this.gonPointArr.length;e++){var t=this.gonPointArr[e];t&&(t.show=!0)}this.modifyHandler.setInputAction(function(e){var t=a.viewer.scene.pick(e.position);if(a._cesium.defined(t)&&t.id)t.id.objId||(a.modifyPoint=t.id,n="释放后完成修改"),a.forbidDrawWorld(!0);else{for(var i=0;i<a.gonPointArr.length;i++){var r=a.gonPointArr[i];r&&(r.show=!1)}a.modifyHandler&&(a.modifyHandler.destroy(),a.modifyHandler=null)}},a._cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){var t=a.viewer.scene.pick(e.endPosition);if(a._core.CreateTooltip(n,e.endPosition,!1),a._cesium.defined(t)&&t.id&&(t.id.objId||a._core.CreateTooltip(n,e.endPosition,!0)),!(a.positions.length<1)&&a.modifyPoint){var i=e.startPosition,r=a._viewer.scene.globe.ellipsoid,o=a._viewer.camera.pickEllipsoid(i,r);o&&a.modifyPoint.position.setValue(o)}},a._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){a.forbidDrawWorld(!1),a.modifyPoint&&(a.modifyPoint=null,n="拖动修改位置,右击删除该点")},a._cesium.ScreenSpaceEventType.LEFT_UP),this.modifyHandler.setInputAction(function(e){var t=$this.viewer.scene.pick(e.position);if(Cesium.defined(t)&&t.id&&!t.id.objId&&($this.forbidDrawWorld(!0),$this.modifyPoint=t.id,$this.modifyPoint.wz%2==0)){if(0<$this.modifyPoint.wz)if($this.modifyPoint.wz==$this.linePointArr.length-1)$this.viewer.entities.remove($this.modifyPoint),$this.viewer.entities.remove($this.linePointArr[$this.modifyPoint.wz-1]),$this.linePointArr.splice($this.modifyPoint.wz,1),$this.linePointArr.splice($this.modifyPoint.wz-1,1),$this.positions.splice($this.modifyPoint.wz,1),$this.positions.splice($this.modifyPoint.wz-1,1);else{var i=$this.linePointArr[$this.modifyPoint.wz-2].position.getValue(),r=$this.linePointArr[$this.modifyPoint.wz+2].position.getValue(),o={x:(r.x+i.x)/2,y:(r.y+i.y)/2,z:(r.z+i.z)/2},n=$this.createPointTemporary(o);$this.viewer.entities.remove($this.modifyPoint),$this.viewer.entities.remove($this.linePointArr[$this.modifyPoint.wz-1]),$this.viewer.entities.remove($this.linePointArr[$this.modifyPoint.wz+1]),$this.linePointArr[$this.modifyPoint.wz]=n,$this.positions[$this.modifyPoint.wz]=o,$this.linePointArr.splice($this.modifyPoint.wz-1,1),$this.linePointArr.splice($this.modifyPoint.wz,1),$this.positions.splice($this.modifyPoint.wz-1,1),$this.positions.splice($this.modifyPoint.wz,1)}else $this.viewer.entities.remove($this.modifyPoint),$this.viewer.entities.remove($this.linePointArr[1]),$this.linePointArr.splice(0,1),$this.linePointArr.splice(0,1),$this.positions.splice(0,1),$this.positions.splice(0,1);for(var a=0;a<$this.linePointArr.length;a++)$this.linePointArr[a].wz=a;$this.modifyPoint=null,$this.forbidDrawWorld(!1)}},a._cesium.ScreenSpaceEventType.RIGHT_CLICK)}},e.prototype.forbidDrawWorld=function(e){this.viewer.scene.screenSpaceCameraController.enableRotate=!e,this.viewer.scene.screenSpaceCameraController.enableTilt=!e,this.viewer.scene.screenSpaceCameraController.enableTranslate=!e,this.viewer.scene.screenSpaceCameraController.enableInputs=!e},e}),define("SGWorld/Creator/Billboard",["../Core/Core","./Color","../ProjectTree/treeSource"],function(i,h,r){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=r}return e.prototype.createBillboardbatch=function(e){for(var t={show:!0,position:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,eyeOffset:this._cesium.Cartesian3.ZERO,heightReference:this._cesium.HeightReference.NONE,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:this._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0},i=0;i<e.length;i++){var r=e[i];t.image=r.image;this._viewer.entities.add({name:"",position:this._cesium.Cartesian3.fromDegrees(r.log,r.lat,r.height),billboard:t})}return this},e.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show._value,t=null==this.item.box.dimensions?void 0:this.item.box.dimensions.getValue(),i=null==this.item.box.fill?void 0:this.item.box.fill._value,r=this.item.box.material;null!=r&&(r={color:null==r.color._value?void 0:"rgba("+r.color._value.red+","+r.color._value.green+","+r.color._value.blue+","+r.color._value.alpha+")",image:null==r.image?void 0:r.image._value,diffusemap:null==r.diffusemap?void 0:r.diffusemap._value,alphamap:null==r.alphamap?void 0:r.alphamap._value});var o=null==this.item.box.outline?void 0:this.item.box.outline._value,n=null==this.item.box.outlineColor?void 0:"rgba("+this.item.box.outlineColor._value.red+","+this.item.box.outlineColor._value.green+","+this.item.box.outlineColor._value.blue+","+this.item.box.outlineColor._value.alpha+")",a=null==this.item.box.outlineWidth?void 0:this.item.box.outlineWidth._value,s=this.item.box.distanceDisplayCondition,l=null==s?void 0:s._value.near,u=null==s?void 0:s._value.far,c=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"box",position:{x:this._cesium.Math.toDegrees(c.longitude),y:this._cesium.Math.toDegrees(c.latitude),z:this._cesium.Math.toDegrees(c.height)},treeobj:{name:this.treeobj.name},style:{show:e,dimensions:t,fill:i,material:r,outline:o,outlineColor:n,outlineWidth:a,near:l,far:u}}},e.prototype.setTreeobj=function(e){this.treeobj=e},e.prototype.setVisibility=function(e){this.item.show=e},e.prototype.setShow=function(e){try{this.item._box.show=e}catch(e){console.log(e)}return this},e.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},Object.defineProperties(e.prototype,{ColorAlpha:{get:function(){return this.item._box.color._value.alpha}},Scale:{get:function(){return this.item._box.scale}},Rotation:{get:function(){return this.item._box.rotation}},Width:{get:function(){return this.item._box.width}},Height:{get:function(){return this.item._box.heightReference}},Color:{get:function(){return this._color.toHtmlColor("rgb("+255*this.item._box.backgroundColor._value.red+","+255*this.item._box.backgroundColor._value.green+","+255*this.item._box.backgroundColor._value.blue+","+255*this.item._box.backgroundColor._value.alpha+")")}}}),e.prototype.CreateBox=function(e,t,i,r,o,n,a,s){this._postion=e;var l,u={dimensions:new this._cesium.Cartesian3(r,t,i),material:this._cesium.Color.YELLOW,outline:!0,outlineColor:this._cesium.Color.RED};o&&""!==o&&(u.outlineColor=new h(this._viewer,this._cesium).colorFromHtmlColor(o)),n&&""!==n&&(u.material=new h(this._viewer,this._cesium).colorFromHtmlColor(n)),(e.Yaw||e.Pitch||e.Roll)&&(l=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw),this._cesium.Math.toRadians(e.Pitch),this._cesium.Math.toRadians(e.Roll)))),this.item=this._viewer.entities.add({name:s,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),box:u,orientation:l});var c={id:this.item.id,name:s,pId:this._core.isnull(a)?0:a,type:"box",item:this};return this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(a)?0:a),this},Object.defineProperties(e.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{this._postion.Altitude=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}}}}),e}),define("SGWorld/Creator/KmlLayer",["../Core/Core","./Color","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min","../VectorTileProvider/GeoJSONVectorTileProvider"],function(i,r,o,e,t){"use strict";function n(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._color=new r(this._viewer,this._cesium),this._tree=o,this._Provider=void 0}return n.prototype.createKmlLayer=function(e,t,o){var i={camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas},n=t,a=(this._cesium.HeightReference.CLAMP_TO_GROUND,{show:!0,position:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,eyeOffset:this._cesium.Cartesian3.ZERO,heightReference:this._cesium.HeightReference.NONE,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,scale:1,image:n,imageSubRegion:void 0,color:this._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0}),s=this;this._cesium.KmlDataSource.load(e,i).then(function(e){e.entities;if("model"==o)for(var t=0;t<e.entities.values.length;t++){var i=e.entities.values[t];s._viewer.entities.add({name:"",position:i.position,model:{uri:n,heightReference:s._cesium.HeightReference.CLAMP_TO_GROUND,minimumPixelSize:128,maximumScale:20,scale:1,runAnimations:!1}})}else if("billboard"==o){var r=s._core.extend(a,option,!0);for(t=0;t<e.entities.values.length;t++){i=e.entities.values[t];r.position=i.position._value,billboardCollections.add(r)}s._viewer.scene.primitives.add(billboardCollections)}})},n.prototype.addKmlLayer=function(e,t,i,r){var o={camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas},n=this,a=t,s=void 0;a.id&&(s=a.id,a=a.url);var l=this._cesium.KmlDataSource.load(a,o);this._viewer.dataSources.add(l),l.then(function(e){n.item=e,i||n.setVisibility(!1),r&&"function"==typeof r&&r(e)});var u={id:s||this._core.getuid(),name:e,pId:0,type:"KML",item:this};return this.setTreeobj(u),this._tree.insertGroupId(u,0),this},n.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},n.prototype.deleteObject=function(){this._viewer.dataSources.remove(this.item)},n.prototype.setTreeobj=function(e){this.treeobj=e},n.prototype.setVisibility=function(e){null!=this.item&&(this.item.show=e)},n}),define("SGWorld/Creator/ModifyMesh",["../Core/Core","../ProjectTree/treeSource"],function(i,r){"use strict";var C;function e(e,t){this._viewer=e,this._cesium=t,C=t,e,this._core=new i,this._tree=r,this.texturePixel=1024}return e.prototype.createModifyMesh=function(e,t,i,r,o){var n=t.length,a=r.id||C.createGuid(),s=r.Level,l=new Array(n);l.fill(i);var u=Date.now(),c=C.Rectangle.fromCartesianArray(t),h=180*c.west/Math.PI,d=180*c.south/Math.PI,m=180*c.east/Math.PI,p=180*c.north/Math.PI,g=C.Cartesian3.fromDegrees(m,d),f=C.Cartesian3.fromDegrees(h,p),v=new C.PolygonGeometry({polygonHierarchy:new C.PolygonHierarchy(t)});void 0===r.modifyB3dmObjects&&(r.modifyB3dmObjects=[]);var _={id:a,show:!0,name:e,rectangle:c,polygonBounds:[g.x,g.y,g.z,f.x,f.y,f.z],modelBounds:null,polygonGeometry:v,vertices:t,polygon:t,height:i,meshObject:r,heights:l,timeStamp:u,image:this.createTexture(t),texture:null};r.modifyB3dmObjects.push(_),r.modifyMeshObject=_,this._viewer.scene.primitives.remove(r);var y=new C.Cesium3DTileset(r);return y.id=a,y.Level=s,(r=this._viewer.scene.primitives.add(y)).modifyB3dmObjects=[],r.modifyB3dmObjects.push(_),r.modifyMeshObject=_,this.changeTreeItem(a,r),this.item=r,this},e.prototype.changeTreeItem=function(e,t){var i=r.getSourceById(r.Source,e);i&&(i.item.item=t,i.item.sd=t,i.item.treeobj.item.item=t)},e.prototype.createTexture=function(e){var t=C.Rectangle.fromCartesianArray(e),i=180*t.west/Math.PI,r=180*t.south/Math.PI,o=180*t.east/Math.PI,n=180*t.north/Math.PI,a=new C.Rectangle(i,r,o,n),s=[],l=this;e.forEach(function(e){var t=e.longitude?e:C.Ellipsoid.WGS84.cartesianToCartographic(e);t=l.getPointRelativePosition(t,a,l.texturePixel,l.texturePixel),s.push([t.normalizedLongitude,t.normalizedLatitude])});var u=this.createCanvas(s,"#FF0000",l.texturePixel,l.texturePixel),c=new Image;return c.width=l.texturePixel,c.height=l.texturePixel,c.src=u.toDataURL("image/png"),c},e.prototype.createCanvas=function(e,t,i,r){var o=document.createElement("canvas");o.width=i,o.height=r;var n=o.getContext("2d");if(n.fillStyle="#000",n.fillRect(0,0,i,i),!(e.length<=0)){n.moveTo(e[0][0],e[0][1]);for(var a=0;a<e.length;a++)n.lineTo(e[a][0],e[a][1]);return n.fillStyle=t,n.fill(),o}},e.prototype.getPointRelativePosition=function(e,t,i,r){var o=t.east-t.west,n=t.north-t.south,a=180*e.longitude/Math.PI,s=180*e.latitude/Math.PI;return e.normalizedLongitude=(a-t.west)/o*i,e.normalizedLatitude=(s-t.south)/n*r,e},e.prototype.remove=function(){var e=this.item.id,t=this.item.Level;this._viewer.scene.primitives.remove(this.item),this.item.modifyB3dmObjects=void 0,this.item.modifyMeshObject=void 0;var i=new C.Cesium3DTileset(this.item);return i.id=e,i.Level=t,i=this._viewer.scene.primitives.add(i),this.changeTreeItem(e,i),i},e}),define("SGWorld/Creator/Thermodynamic",["../Core/Core","../ProjectTree/treeSource"],function(i,r){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=r}return e.prototype.createThermodynamic=function(e){var t=CesiumHeatmap.create(this._viewer,{west:70,south:10,east:140,north:50},{maxOpacity:.5,minOpacity:0,blur:.75});return t.setWGS84Data(0,100,e),this.item=t,this},e}),define("SGWorld/Creator/CZML",["../Core/Core","../ProjectTree/treeSource"],function(i,r){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=r}return e.prototype.addCZML=function(e,t,i){var r=this;!t&&(t={});var o=new this._cesium.CzmlDataSource;this._viewer.dataSources.add(o);this.item=o,this._option=t,this.item.process(e).then(function(e){r.Pretreatment(e,t),i&&"function"==typeof i&&i(e)});var n={id:this._core.getuid(),name:"新建CZML",pId:0,type:"CZML",item:this};return this.setTreeobj(n),this._tree.insertGroupId(n,0),this},e.prototype.process=function(e,t){var i=this;this.item&&this.item.process(e).then(function(e){i.Pretreatment(e,i._option),t&&"function"==typeof t&&t(e)})},e.prototype.Pretreatment=function(e,t){var o=this;e.entities.values.forEach(function(r){if(0===r.id.indexOf("Link_"))r.polyline.material=o._core.getLinkMaterial(t.linkColor,t.linkPointColor,t.linkTime);else if(0===r.id.indexOf("ConeRadar_"))r.cylinder.material=o._core.getConeRadarMaterial(t.coneRadarColor);else if(0===r.id.indexOf("MultiCircleScan_"))r.ellipse.material=o._core.getMultiCircleScanMaterial(t.multiCircleColor,t.multiCircleTime);else if(0===r.id.indexOf("SectorScan_")){var e=o._core.defaultValue(t.sectorScanAngle,45);r.ellipse.material=o._core.getSectorScanMaterial(t.sectorScanColor,e),r.ellipse.stRotation=new o._cesium.CallbackProperty(function(e,t){var i=r.orientation.getValue(e,t);return o._cesium.HeadingPitchRoll.fromQuaternion(i).heading-Math.PI/2},!1)}else 0===r.id.indexOf("CircleScan_")?r.ellipse.material=o._core.getCircleScanMaterial(t.circleScanColor,t.circleScanTime):0===r.id.indexOf("RadarScan_")&&(r.ellipse.material=o._core.getRadarScanMaterial(t.radarScanColor,t.radarScanTime))})},e.prototype.deleteObject=function(){this._viewer.dataSources.remove(this.item)},e.prototype.setTreeobj=function(e){this.treeobj=e},e.prototype.setVisibility=function(e){null!=this.item&&(this.item.show=e)},e}),define("SGWorld/Creator/Heatmap",["../Core/Core","../ProjectTree/treeSource"],function(i,r){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=r}return e.prototype.addHeatMap=function(e,t,i){!t&&(t={});var a=this._core.defaultValue(t.bounds,{west:70,south:10,east:140,north:50}),s=this._core.defaultValue(t.max,100),l=this._core.defaultValue(t.min,0),u=this._core.defaultValue(t.radius,80),r=this._core.defaultValue(t.num,100),o=CesiumHeatmap.create(this._viewer,a,{maxOpacity:this._core.defaultValue(t.maxOpacity,.5),minOpacity:this._core.defaultValue(t.minOpacity,0),blur:this._core.defaultValue(t.blur,.75)});this.item=o;var n=this._core.defaultValue(t.sourceData,function(e){for(var t=[],i=0;i<e;i++){var r=Math.random()*(a.east-a.west+1)+a.west,o=Math.random()*(a.north-a.south+1)+a.south,n=Math.random()*(s-l+1)+l;t.push({x:r,y:o,value:n,radius:u})}return t}(r));o.setWGS84Data(l,s,n),i&&"function"==typeof i&&i(o);var c={id:this._core.getuid(),name:e,pId:0,type:"Heatmap",item:this};return this.setTreeobj(c),this._tree.insertGroupId(c,0),this},e.prototype.deleteObject=function(){this.item&&this._viewer.entities.remove(this.item._layer)},e.prototype.setTreeobj=function(e){this.treeobj=e},e.prototype.setVisibility=function(e){null!=this.item&&this.item.show(e)},e}),define("SGWorld/Creator/ModelLibrary",["../configData","../Core/Core","../ProjectTree/treeSource","../Navigate/getPosition"],function(i,r,o,n){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new r,this._getPosition=new n(this._viewer,t),this._tree=o,this.rootUrl=i.ModelLibrary}return e.prototype.getLibraryData=function(){return{name:"ModelLibraryList",data:[{name:"车辆",data:[{name:"铲车",model:"chanche.gltf",img:"img/cc.png"},{name:"大货车",model:"dahuoche.gltf",img:"img/dhc.png"},{name:"电动车",model:"diandongche.gltf",img:"img/ddc.png"},{name:"海关车",model:"haiguanche.gltf",img:"img/hgc.png"},{name:"混泥土车",model:"hunnituche.gltf",img:"img/hntc.png"},{name:"货车11",model:"huoche11.gltf",img:"img/hc11.png"},{name:"交通工具5",model:"jiaotonggongju5.gltf",img:"img/jtgj5.png"},{name:"警车",model:"jingche.gltf",img:"img/jc.png"},{name:"军事装备",model:"junshizb.gltf",img:"img/jszb.png"},{name:"旅行车",model:"lvxingche.gltf",img:"img/lxc.png"},{name:"摩托车",model:"motuoche.gltf",img:"img/mtc.png"},{name:"汽车27",model:"qiche27.gltf",img:"img/qc27.png"},{name:"汽车28",model:"qiche28.gltf",img:"img/qc28.png"},{name:"汽车29",model:"qiche29.gltf",img:"img/qc29.png"},{name:"汽车30",model:"qiche30.gltf",img:"img/qc30.png"},{name:"汽车31",model:"qiche31.gltf",img:"img/qc31.png"},{name:"汽车32",model:"qiche32.gltf",img:"img/qc32.png"},{name:"汽车33",model:"qiche33.gltf",img:"img/qc33.png"},{name:"汽车39",model:"qiche39.gltf",img:"img/qc39.png"},{name:"坦克",model:"tanke.gltf",img:"img/tk.png"},{name:"土方车",model:"tufangche.glb",img:"img/tfc.png"},{name:"挖掘机",model:"wajueji.glb",img:"img/wjj.png"},{name:"消防车",model:"xiaofangche.gltf",img:"img/xfc.png"},{name:"小货车",model:"CesiumMilkTruck.gltf",img:"img/xhc.png"},{name:"小汽车",model:"qiche.gltf",img:"img/xqc.png"},{name:"有轨电车1",model:"dianche1.gltf",img:"img/ygdc1.png"},{name:"有轨电车2",model:"dianche2.gltf",img:"img/ygdc2.png"},{name:"越野车",model:"GroundVehicle.glb",img:"img/yyc.png"},{name:"渣土车",model:"zhatuche.gltf",img:"img/ztc.png"},{name:"自行车",model:"bike.gltf",img:"img/zxc.png"}]},{name:"火车及铁路",data:[{name:"车站",model:"station.glb",img:"img/cz.png"},{name:"电线架子",model:"jiazi.glb",img:"img/dxjz.png"},{name:"高铁车身",model:"body.glb",img:"img/gtcs.png"},{name:"高铁车头",model:"heada.glb",img:"img/gtct.png"},{name:"桥墩",model:"bridge.glb",img:"img/qd.png"},{name:"隧道",model:"suidao.glb",img:"img/sd.png"},{name:"铁路路基",model:"railway.glb",img:"img/tllj.png"}]},{name:"航空",data:[{name:"飞机",model:"feiji.glb",img:"img/fj.png"},{name:"火箭",model:"launchvehicle.glb",img:"img/hj.png"},{name:"军事装备_03",model:"junshizb.gltf",img:"img/jszb03.png"},{name:"军事装备_04",model:"junshizb.gltf",img:"img/jszb04.png"},{name:"军事装备_05",model:"junshizb5.gltf",img:"img/jszb05.png"},{name:"军事装备_06",model:"junshizb6.gltf",img:"img/jszb06.png"},{name:"军事装备_07",model:"junshizb7.gltf",img:"img/jszb07.png"},{name:"军事装备_10",model:"junshizb10.gltf",img:"img/jszb10.png"},{name:"客机",model:"Cesium_Air.glb",img:"img/kj.png"},{name:"热气球",model:"CesiumBalloon.glb",img:"img/rqq.png"},{name:"卫星雷达接收站",model:"leida.glb",img:"img/wxldjsz.png"},{name:"无人机",model:"wrj.glb",img:"img/wrj.png"},{name:"战机",model:"zhanji.glb",img:"img/zj.png"}]},{name:"航海",data:[{name:"船_42",model:"chuan42.gltf",img:"img/c42.png"},{name:"船_51",model:"chuan51.gltf",img:"img/c51.png"},{name:"港口高空设备_01",model:"shebei1.gltf",img:"img/gkgksb01.png"},{name:"港口高空设备_02",model:"shebei2.gltf",img:"img/gkgksb02.png"},{name:"港口起重机03",model:"qizhongji.gltf",img:"img/gkqzj03.png"},{name:"港口运输设施02",model:"yunshushebei.gltf",img:"img/gkysss02.png"},{name:"滚装船",model:"gunzhuangchuan.glb",img:"img/gzc.png"},{name:"航空母舰",model:"aircraft-carrier.gltf",img:"img/hkmj.png"},{name:"护卫舰",model:"aegis-destroyer.gltf",img:"img/hwj.png"},{name:"化工品船",model:"huagongpinchuan.glb",img:"img/hgpc.png"},{name:"集装箱船",model:"jizhuangxiangchuan.glb",img:"img/jzxc.png"},{name:"交通船",model:"jiaotong.glb",img:"img/jtc.png"},{name:"交通工具_轮船16",model:"lunchuan16.gltf",img:"img/lc16.png"},{name:"交通工具_轮船17",model:"lunchuan17.gltf",img:"img/lc17.png"},{name:"交通工具_轮船22",model:"lunchuan22.gltf",img:"img/lc22.png"},{name:"军事装备_08",model:"junshizb8.gltf",img:"img/jszb08.png"},{name:"煤炭船",model:"meitanchuan.glb",img:"img/mtchuan.png"},{name:"燃料船",model:"ranliaochuan.gltf",img:"img/rlc.png"},{name:"散货船",model:"kechuan.glb",img:"img/shc.png"},{name:"栓船柱_01",model:"zhuzi.gltf",img:"img/scz01.png"},{name:"水坝_22",model:"shuiba.gltf",img:"img/sb22.png"},{name:"铁矿船",model:"tiekuangchuan.glb",img:"img/tkc.png"},{name:"拖轮",model:"tuolun.glb",img:"img/tl.png"},{name:"油船",model:"youchuan.glb",img:"img/youc.png"},{name:"渔船",model:"yuchuan.glb",img:"img/yuc.png"},{name:"闸门",model:"zhamen.glb",img:"img/zm.png"}]},{name:"人物",data:[{name:"奔跑的消防员",model:"xiaofangyuan-run.gltf",img:"img/bpdxfy.png"},{name:"步行动画_人",model:"Cesium_Man.gltf",img:"img/bxdh_r.png"},{name:"工人",model:"gongren.glb",img:"img/gr.png"},{name:"行人",model:"walk.gltf",img:"img/xr.png"},{name:"消防员",model:"xiaofangyuan.glb",img:"img/xfy.png"},{name:"巡逻人员",model:"xunluoren.glb",img:"img/xlry.png"}]},{name:"街道小品",data:[{name:"工地大门",model:"damen.gltf",img:"img/gddm.png"},{name:"公共座椅01",model:"zuoyi1.gltf",img:"img/ggzy01.png"},{name:"公共座椅02",model:"zuoyi2.gltf",img:"img/ggzy02.png"},{name:"公交亭01",model:"gongjiaozhan1.gltf",img:"img/gjt01.png"},{name:"公交亭02",model:"gongjiaogting2.gltf",img:"img/gjt02.png"},{name:"广告牌001",model:"guanggaopai1.gltf",img:"img/ggp001.png"},{name:"广告牌01",model:"guanggao1.gltf",img:"img/ggp01.png"},{name:"广告牌005",model:"guanggaopai2.gltf",img:"img/ggp005.png"},{name:"红绿灯063",model:"honglvdeng1.gltf",img:"img/hld063.png"},{name:"红绿灯064",model:"honglvdeng2.gltf",img:"img/hld064.png"},{name:"红绿灯065",model:"honglvdeng3.gltf",img:"img/hld065.png"},{name:"减速带114",model:"jiansudai.gltf",img:"img/jsd114.png"},{name:"交通相关_99",model:"jiaotong3.gltf",img:"img/jtxg99.png"},{name:"交通相关_100",model:"jiaotong1.gltf",img:"img/jtxg100.png"},{name:"交通相关_109",model:"jiaotong2.gltf",img:"img/jtxg109.png"},{name:"交通相关_110",model:"jingzi.gltf",img:"img/jtxg110.png"},{name:"军事装备_11",model:"junshizb11.gltf",img:"img/jszb11.png"},{name:"垃圾桶048",model:"lajitong1.gltf",img:"img/ljt048.png"},{name:"垃圾桶049",model:"lajitong2.gltf",img:"img/ljt049.png"},{name:"垃圾桶053",model:"lajitong3.gltf",img:"img/ljt053.png"},{name:"垃圾桶L",model:"lajitongL.gltf",img:"img/ljtL.png"},{name:"垃圾桶大",model:"lajitongda.gltf",img:"img/ljtd.png"},{name:"垃圾箱_41",model:"lajitong4.gltf",img:"img/ljt41.png"},{name:"铁桥01",model:"tieqiao1.gltf",img:"img/tq01.png"},{name:"铁围栏",model:"weilan.gltf",img:"img/twl.png"},{name:"信号灯091",model:"honglvdeng01.gltf",img:"img/xhd091.png"},{name:"移动式厕所_33",model:"toilet.gltf",img:"img/ydscs33.png"},{name:"邮箱1",model:"youxiang1.gltf",img:"img/yx1.png"},{name:"邮箱2",model:"youxiang2.gltf",img:"img/yx2.png"},{name:"站牌083",model:"zhanpai1.gltf",img:"img/zp083.png"},{name:"站厅031",model:"zhanting.gltf",img:"img/zt031.png"},{name:"站厅034",model:"zhanting2.gltf",img:"img/zt034.png"},{name:"站厅035",model:"zhanting3.gltf",img:"img/zt035.png"},{name:"座椅01",model:"zuoyi1.gltf",img:"img/zy01.png"},{name:"座椅05",model:"zuoyi5.gltf",img:"img/zy05.png"}]},{name:"植物",data:[{name:"盆栽植物003",model:"pengzai3.gltf",img:"img/pzzw003.png"},{name:"盆栽植物016",model:"pengzai16.gltf",img:"img/pzzw016.png"},{name:"盆栽植物018",model:"pengzai18.gltf",img:"img/pzzw018.png"},{name:"盆栽植物027",model:"pengzai27.gltf",img:"img/pzzw027.png"},{name:"盆栽植物056",model:"pengzai56.gltf",img:"img/pzzw056.png"},{name:"盆栽植物057",model:"pengzai57.gltf",img:"img/pzzw057.png"},{name:"盆栽植物063",model:"pengzai63.gltf",img:"img/pzzw063.png"},{name:"盆栽植物065",model:"pengzai65.gltf",img:"img/pzzw065.png"},{name:"树_005",model:"tree005.glb",img:"img/s005.png"},{name:"树_008",model:"tree008.glb",img:"img/s008.png"},{name:"树_011",model:"tree011.gltf",img:"img/s011.png"},{name:"树_014",model:"tree014.gltf",img:"img/s014.png"},{name:"树_018",model:"tree018.gltf",img:"img/s018.png"},{name:"树_030",model:"tree030.gltf",img:"img/s030.png"},{name:"树_041",model:"tree041.gltf",img:"img/s041.png"},{name:"树_051",model:"tre051.gltf",img:"img/s051.png"},{name:"树_054",model:"tree054.gltf",img:"img/s054.png"},{name:"园艺植物_01",model:"yuanyizw1.gltf",img:"img/yyzw01.png"},{name:"园艺植物_07",model:"yuanyizw7.gltf",img:"img/yyzw07.png"},{name:"园艺植物_46",model:"yuanyizw46.gltf",img:"img/yyzw46.png"},{name:"植物_01",model:"zhiwu01.gltf",img:"img/zw01.png"},{name:"植物_03",model:"zhiwu03.gltf",img:"img/zw03.png"},{name:"植物_12",model:"zhiwu12.gltf",img:"img/zw12.png"},{name:"植物_13",model:"zhiwu13.gltf",img:"img/zw13.png"},{name:"植物_32",model:"zhiwu32.gltf",img:"img/zw32.png"},{name:"植物_38",model:"zhiwu38.gltf",img:"img/zw38.png"}]},{name:"建筑物",data:[{name:"别墅_02",model:"bieshu2.gltf",img:"img/loading2.png"},{name:"别墅_03",model:"bieshu3.gltf",img:"img/loading2.png"},{name:"别墅_04",model:"bieshu4.gltf",img:"img/loading2.png"},{name:"别墅_08",model:"bieshu8.gltf",img:"img/loading2.png"},{name:"别墅_09",model:"bieshu9.gltf",img:"img/loading2.png"},{name:"别墅_14",model:"bieshu14.gltf",img:"img/loading2.png"},{name:"城市模型_001",model:"citymodel1.gltf",img:"img/loading2.png"},{name:"城市模型_003",model:"citymodel3.gltf",img:"img/loading2.png"},{name:"城市模型_011",model:"citymodel11.gltf",img:"img/loading2.png"},{name:"城市模型_022",model:"citymodel22.gltf",img:"img/loading2.png"},{name:"城市模型_023",model:"citymodel23.gltf",img:"img/loading2.png"},{name:"城市模型_031",model:"citymodel31.gltf",img:"img/loading2.png"},{name:"城市模型_037",model:"citymodel37.gltf",img:"img/loading2.png"},{name:"城市模型_049",model:"citymodel49.gltf",img:"img/loading2.png"},{name:"城市模型_050",model:"citymodel50.gltf",img:"img/loading2.png"},{name:"城市模型_052",model:"citymodel52.gltf",img:"img/loading2.png"},{name:"城市模型_069",model:"citymodel69.gltf",img:"img/loading2.png"},{name:"城市模型_070",model:"citymodel70.gltf",img:"img/loading2.png"},{name:"城市模型_072",model:"citymodel72.gltf",img:"img/loading2.png"},{name:"城市模型_073",model:"citymodel73.gltf",img:"img/loading2.png"},{name:"城市模型_078",model:"citymodel78.gltf",img:"img/loading2.png"},{name:"工地建筑_L_06",model:"gongdijz.gltf",img:"img/loading2.png"},{name:"工地建筑_L_88",model:"gongdijz2.gltf",img:"img/loading2.png"},{name:"工业建筑_20",model:"gongyejz.gltf",img:"img/loading2.png"},{name:"欧式建筑_21",model:"obuild21.gltf",img:"img/loading2.png"},{name:"欧式建筑_23",model:"obuild23.gltf",img:"img/loading2.png"},{name:"欧式建筑_24",model:"obuild24.gltf",img:"img/loading2.png"},{name:"欧式建筑_25",model:"obuild25.gltf",img:"img/loading2.png"},{name:"欧式建筑_27",model:"obuild27.gltf",img:"img/loading2.png"},{name:"欧式建筑_29",model:"obuild29.gltf",img:"img/loading2.png"},{name:"欧式建筑_32",model:"obuild32.gltf",img:"img/loading2.png"},{name:"欧式建筑_35",model:"obuild35.gltf",img:"img/loading2.png"},{name:"棚子",model:"pengzi.gltf",img:"img/loading2.png"},{name:"商业建筑_39",model:"Commercial39.gltf",img:"img/loading2.png"},{name:"商业建筑_47",model:"Commercial47.gltf",img:"img/loading2.png"},{name:"商业建筑_54",model:"Commercial54.gltf",img:"img/loading2.png"},{name:"商业建筑_56",model:"Commercial56.gltf",img:"img/loading2.png"},{name:"商业建筑_61",model:"Commercial61.gltf",img:"img/loading2.png"},{name:"商业建筑_62",model:"Commercial62.gltf",img:"img/loading2.png"},{name:"商业建筑_63",model:"Commercial63.gltf",img:"img/loading2.png"},{name:"室内房间",model:"shinei.gltf",img:"img/loading2.png"},{name:"室内楼层",model:"flooroom.gltf",img:"img/loading2.png"},{name:"顺德粮仓_仓体",model:"cangti.gltf",img:"img/loading2.png"},{name:"中式建筑",model:"zsjz.gltf",img:"img/loading2.png"}]},{name:"电力设施",data:[{name:"电线塔",model:"tower.glb",img:"img/loading2.png"},{name:"电线塔_29",model:"xianta2.gltf",img:"img/loading2.png"},{name:"电线塔_30",model:"xianta.gltf",img:"img/loading2.png"},{name:"电箱_26",model:"dianxiang.gltf",img:"img/loading2.png"},{name:"发动机_45",model:"fadongji.gltf",img:"img/loading2.png"},{name:"风力发电机",model:"fengche.gltf",img:"img/loading2.png"},{name:"交通相关_路灯018",model:"ludeng18.gltf",img:"img/loading2.png"},{name:"交通相关_路灯023",model:"ludeng23.gltf",img:"img/loading2.png"},{name:"交通相关_路灯024",model:"ludeng24.gltf",img:"img/loading2.png"},{name:"交通相关_路灯025",model:"ludeng25.gltf",img:"img/loading2.png"},{name:"交通相关_路灯026",model:"ludeng26.gltf",img:"img/loading2.png"},{name:"交通相关_路灯027",model:"ludeng27.gltf",img:"img/loading2.png"},{name:"交通相关_路灯029",model:"ludeng29.gltf",img:"img/loading2.png"},{name:"室外照明_008",model:"shiwaizhaoming8.gltf",img:"img/loading2.png"},{name:"室外照明_036",model:"shiwaizhaoming36.gltf",img:"img/loading2.png"},{name:"室外照明_052",model:"shiwaizhaoming52.gltf",img:"img/loading2.png"},{name:"室外照明_069",model:"shiwaizhaoming69.gltf",img:"img/loading2.png"},{name:"室外照明_072",model:"shiwaizhaoming72.gltf",img:"img/loading2.png"},{name:"室外照明_073",model:"shiwaizhaoming73.gltf",img:"img/loading2.png"},{name:"室外照明_076",model:"shiwaizhaoming76.gltf",img:"img/loading2.png"},{name:"太阳能发电板",model:"taiyang.gltf",img:"img/loading2.png"},{name:"油田厂房_二层设备28",model:"shebei2.gltf",img:"img/loading2.png"},{name:"油田厂房_二层设备86",model:"shebei.gltf",img:"img/loading2.png"}]},{name:"测绘仪器",data:[{name:"RTK完整",model:"rtk.glb",img:"img/loading2.png"},{name:"棱镜",model:"lj.glb",img:"img/loading2.png"},{name:"全站仪",model:"qzy.glb",img:"img/loading2.png"},{name:"全站仪_无脚架",model:"qzy01.glb",img:"img/loading2.png"}]},{name:"超高机械",data:[{name:"储蓄罐_11",model:"chuxuguan11.gltf",img:"img/loading2.png"},{name:"镀锌钢板仓",model:"duxingangbancang.gltf",img:"img/loading2.png"},{name:"工业建筑_16",model:"gongyejianzhu16.gltf",img:"img/loading2.png"},{name:"井塔_36",model:"jingta36.gltf",img:"img/loading2.png"},{name:"井塔_49",model:"jingta49.gltf",img:"img/loading2.png"},{name:"木楼",model:"Wood_Tower.gltf",img:"img/loading2.png"},{name:"起重机_02",model:"qizhongji2.gltf",img:"img/loading2.png"},{name:"起重机_34",model:"qizhongji34.gltf",img:"img/loading2.png"},{name:"散货场取料机",model:"sanhuochangquliaoji.gltf",img:"img/loading2.png"},{name:"碎石机_42",model:"suishiji42.gltf",img:"img/loading2.png"}]},{name:"其他",data:[{name:"雕塑_002",model:"diaosu2.gltf",img:"img/loading2.png"},{name:"雕塑_009",model:"diaosu9.gltf",img:"img/loading2.png"},{name:"雕塑_039",model:"diaosu39.gltf",img:"img/loading2.png"},{name:"雕塑_048",model:"diaosu48.gltf",img:"img/loading2.png"},{name:"多层货架_12层",model:"duocenghuojia12.gltf",img:"img/loading2.png"},{name:"多层货架3",model:"duocenghuojia3.gltf",img:"img/loading2.png"},{name:"阀门_02",model:"famen2.gltf",img:"img/loading2.png"},{name:"家居配件_01",model:"jujiapeijian01.gltf",img:"img/loading2.png"},{name:"家居配件_04",model:"jujiapeijian04.gltf",img:"img/loading2.png"},{name:"家居配件_23",model:"jujiapeijian23.gltf",img:"img/loading2.png"},{name:"家居配件_24",model:"jujiapeijian24.gltf",img:"img/loading2.png"},{name:"家居配件_38",model:"jujiapeijian38.gltf",img:"img/loading2.png"},{name:"军事装备_09",model:"junshizhuangbei09.gltf",img:"img/loading2.png"},{name:"全方位探头",model:"quanfangweitantou.gltf",img:"img/loading2.png"},{name:"三轴",model:"sanzhou.gltf",img:"img/loading2.png"},{name:"手持监管设备",model:"shouchijianguanshebei.gltf",img:"img/loading2.png"},{name:"围栏_03",model:"weilan3.gltf",img:"img/loading2.png"}]}]}},e.prototype.drawModel=function(e,t,i){var r=this;if(!this.modelData){this.modelData=[];var o=this.getLibraryData(),n=this.rootUrl;o.data.forEach(function(t){var i=[];t.data.forEach(function(e){e.model?i.push(n+t.name+"/"+e.name+"/"+e.model):i.push(null)}),r.modelData.push(i)})}var a=this.modelData[e][t];if(a){this.drawModelHandler&&(this.drawModelHandler.destroy(),this.drawModelHandler=void 0),this.drawModelHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var s=this,l=void 0,u=this._core.CreateTooltip();this.drawModelHandler.setInputAction(function(e){if(l=s._getPosition.getMousePosition(e)){var t=s._viewer.entities.add({name:"Model",position:l,model:{uri:a,scale:1,minimumPixelSize:0,runAnimations:!0,color:s._cesium.Color.WHITE,distanceDisplayCondition:new s._cesium.DistanceDisplayCondition(0,1e8)}});s.drawModelHandler.destroy(),u.show(!1),s.drawModelHandler=void 0,i&&"function"==typeof i&&i(t)}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.drawModelHandler.setInputAction(function(e){u.showAt(e.endPosition,"点击放置模型")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE)}},e.prototype.deleteObject=function(){this.item&&this._viewer.entities.remove(this.item)},e.prototype.setTreeobj=function(e){this.treeobj=e},e.prototype.setVisibility=function(e){null!=this.item&&this.item.show(e)},e}),define("SGWorld/Creator/SimpleGraphic",["../configData","../Core/Core","../ProjectTree/treeSource","../Navigate/getPosition","./PopupMessage"],function(h,i,oe,r,o){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=oe,this._getPosition=new r(this._viewer,this._cesium),this._popupmessage=new o(this._viewer,this._cesium),this.tooltip=this._core.CreateTooltip(),this.objectsToExclude=[],this.SimpleGraphicObj=[],!oe.editPointID&&(oe.editPointID={edit:[],size:[],move:void 0,height:[],add:[]}),this.editProp=!1,this.PrimitiveCollection=new Cesium.PrimitiveCollection,e.scene.primitives.add(this.PrimitiveCollection),this.SizeData=[]}return e.prototype.createSimpleGraphic=function(e,t,i){var r=this,o=null;!t&&(t={});var n=function(e){r.SimpleGraphicObj.length&&!r.editHandler?r.edit(r.openEdit,r.editOption):!r.SimpleGraphicObj.length&&r.editHandler&&r.edit(!1),i&&i(e)};switch(this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+h.draw),e){case"point":o=this.createPoint(t,n);break;case"billboard":o=this.createBillboard(t,n);break;case"label":o=this.createLabel(t,n);break;case"model":o=this.createModel(t,n);break;case"polyline":o=this.createPolyline(t,n);break;case"polygon":o=this.createPolygon(t,n);break;case"triangle":o=this.createTriangle(t,n);break;case"polygon-rectangle":o=this.createPolygonRectangle(t,n);break;case"rectangle":o=this.createRectangle(t,n);break;case"circle":o=this.createCircle(t,n);break;case"ellipse":o=this.createEllipse(t,n);break;case"box":o=this.createBox(t,n);break;case"cylinder":o=this.createCylinder(t,n);break;case"cone":o=this.createCone(t,n);break;case"sphere":o=this.createSphere(t,n);break;case"polyhedron":o=this.createPolyhedron(t,n)}return o},e.prototype.addSimpleGraphic=function(e,t){var i=null;switch(!t&&(t={}),e){case"point":i=this.addPoint(t);break;case"billboard":i=this.addBillboard(t);break;case"label":i=this.addLabel(t);break;case"model":i=this.addModel(t);break;case"polyline":i=this.addPolyline(t);break;case"polylinePrimitive":i=this.addPolylinePrimitive(t);break;case"polygon":i=this.addPolygon(t);break;case"polygonPrimitive":i=this.addPolygonPrimitive(t);break;case"rectangle":i=this.addRectangle(t);break;case"circle":i=this.addCircle(t);break;case"ellipse":i=this.addEllipse(t);break;case"box":i=this.addBox(t);break;case"cylinder":i=this.addCylinder(t);break;case"cone":i=this.addCone(t);break;case"sphere":i=this.addSphere(t);break;case"polyhedron":i=this.addPolyhedron(t)}if(this.SimpleGraphicObj.length&&!this.editHandler&&this.edit(this.openEdit,this.editOption),void 0!==t.GroupID){var r={id:i.id,name:i.name,pId:t.GroupID,type:e,item:{item:i,setVisibility:function(e){i.show=e}}};-1<e.indexOf("Primitive")&&(r.id=t.id,r.name=t.name),oe.insertGroupId(r,t.GroupID)}return i},e.prototype.createPoint=function(r,o){var e=this,n=this,a=this._viewer;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(a.scene.canvas),oe.states=1,this.drawHandler.setInputAction(function(e){var t=n._getPosition.getMousePosition(e);if(t){var i=a.entities.add({id:n._core.getuid(),name:"Point",position:t,point:{pixelSize:16,color:n._cesium.Color.fromCssColorString(n._core.defaultValue(r.color,"#0000ff")),outlineWidth:n._core.defaultValue(r.outlineWidth,2),outlineColor:n._cesium.Color.fromCssColorString(n._core.defaultValue(r.outlineColor,"rgba(255,255,255,0.6)")),disableDepthTestDistance:n._core.defaultValue(r.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:n._core.defaultValue(r.distanceDisplayCondition,new n._cesium.DistanceDisplayCondition(0,1e8))}});n.SimpleGraphicObj.push(i.id),n.drawHandler.destroy(),n.drawHandler=void 0,n.tooltip.show(!1),setTimeout(function(){oe.states=0},100),n._core.mouse(n._viewer.container,0,"0"),o&&"function"==typeof o&&o(i)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){n.tooltip.showAt(e.endPosition,"点击绘制点")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(){e.end=void 0,n.drawHandler.destroy(),n.drawHandler=void 0,n.tooltip.show(!1),setTimeout(function(){oe.states=0},100),n._core.mouse(n._viewer.container,0,"0")},this},e.prototype.addPoint=function(e){var t=this,i=this._viewer.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"Point"),position:e.position,point:{pixelSize:t._core.defaultValue(e.pixelSize,16),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"#0000ff")),outlineWidth:t._core.defaultValue(e.outlineWidth,2),outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),heightReference:t._core.defaultValue(e.heightReference,1),scaleByDistance:t._core.defaultValue(e.scaleByDistance,void 0),disableDepthTestDistance:t._core.defaultValue(e.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(i.id),i},e.prototype.createBillboard=function(r,o){var e=this,n=this,a=this._viewer;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(a.scene.canvas),oe.states=1,this.drawHandler.setInputAction(function(e){var t=n._getPosition.getMousePosition(e);if(t){var i=a.entities.add({id:n._core.getuid(),name:"Billboard",position:t,billboard:{horizontalOrigin:n._cesium.HorizontalOrigin.CENTER,verticalOrigin:n._cesium.VerticalOrigin.BOTTOM,scale:n._core.defaultValue(r.scale,1),width:n._core.defaultValue(r.width,r.image?void 0:32),height:n._core.defaultValue(r.height,r.image?void 0:44),image:n._core.defaultValue(r.image,window.SmartEarthRootUrl+h.mark),color:n._cesium.Color.fromCssColorString(n._core.defaultValue(r.color,"#ffffff")),disableDepthTestDistance:n._core.defaultValue(r.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:n._core.defaultValue(r.distanceDisplayCondition,new n._cesium.DistanceDisplayCondition(0,1e8))}});n.SimpleGraphicObj.push(i.id),n.drawHandler.destroy(),n.drawHandler=void 0,n.tooltip.show(!1),setTimeout(function(){oe.states=0},100),n._core.mouse(n._viewer.container,0,"0"),o&&"function"==typeof o&&o(i)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){n.tooltip.showAt(e.endPosition,"点击绘制图标")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(){e.end=void 0,n.drawHandler.destroy(),n.drawHandler=void 0,n.tooltip.show(!1),setTimeout(function(){oe.states=0},100),n._core.mouse(n._viewer.container,0,"0")},this},e.prototype.addBillboard=function(e){var t=this,i=this._viewer.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"Billboard"),position:e.position,billboard:{horizontalOrigin:t._core.defaultValue(e.horizontalOrigin,t._cesium.HorizontalOrigin.CENTER),verticalOrigin:t._core.defaultValue(e.verticalOrigin,t._cesium.VerticalOrigin.BOTTOM),scale:t._core.defaultValue(e.scale,1),rotation:t._core.defaultValue(e.rotation,0),width:t._core.defaultValue(e.width,void 0),height:t._core.defaultValue(e.height,void 0),image:t._core.defaultValue(e.image,window.SmartEarthRootUrl+h.mark),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"#ffffff")),heightReference:t._core.defaultValue(e.heightReference,1),scaleByDistance:t._core.defaultValue(e.scaleByDistance,void 0),disableDepthTestDistance:t._core.defaultValue(e.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(i.id),i},e.prototype.createLabel=function(r,o){var e=this,n=this,a=this._viewer;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(a.scene.canvas),oe.states=1,this.drawHandler.setInputAction(function(e){var t=n._getPosition.getMousePosition(e);if(t){var i=a.entities.add({id:n._core.getuid(),name:"Label",position:t,label:{text:"新建文本",font:"24px 宋体",fillColor:n._cesium.Color.fromCssColorString(n._core.defaultValue(r.fillColor,"#ffffff")),scale:1,style:2,outlineColor:n._cesium.Color.BLACK,outlineWidth:0,showBackground:!1,backgroundColor:new n._cesium.Color(.165,.165,.165,.8),horizontalOrigin:n._cesium.HorizontalOrigin.CENTER,verticalOrigin:n._cesium.VerticalOrigin.CENTER,distanceDisplayCondition:n._core.defaultValue(r.distanceDisplayCondition,new n._cesium.DistanceDisplayCondition(0,1e8)),disableDepthTestDistance:Number.POSITIVE_INFINITY}});n.SimpleGraphicObj.push(i.id),n.drawHandler.destroy(),n.drawHandler=void 0,n.tooltip.show(!1),setTimeout(function(){oe.states=0},100),n._core.mouse(n._viewer.container,0,"0"),o&&"function"==typeof o&&o(i)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){n.tooltip.showAt(e.endPosition,"点击绘制文本")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(){e.end=void 0,n.drawHandler.destroy(),n.drawHandler=void 0,n.tooltip.show(!1),setTimeout(function(){oe.states=0},100),n._core.mouse(n._viewer.container,0,"0")},this},e.prototype.addLabel=function(e){var t=this,i=this._viewer.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"Label"),position:e.position,label:{text:t._core.defaultValue(e.text,"新建文本"),font:t._core.defaultValue(e.font,"24px 宋体"),scale:t._core.defaultValue(e.scale,1),style:t._core.defaultValue(e.style,2),fillColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.fillColor,"#ffffff")),outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"#000000")),outlineWidth:t._core.defaultValue(e.outlineWidth,0),showBackground:t._core.defaultValue(e.showBackground,!1),backgroundColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.backgroundColor,"rgba(42,42,42,0.8)")),heightReference:t._core.defaultValue(e.heightReference,1),horizontalOrigin:t._core.defaultValue(e.horizontalOrigin,t._cesium.HorizontalOrigin.CENTER),verticalOrigin:t._core.defaultValue(e.verticalOrigin,t._cesium.VerticalOrigin.CENTER),scaleByDistance:t._core.defaultValue(e.scaleByDistance,void 0),disableDepthTestDistance:t._core.defaultValue(e.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(i.id),i},e.prototype.createModel=function(r,o){var e=this,n=this,a=this._viewer;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(a.scene.canvas),oe.states=1,this.drawHandler.setInputAction(function(e){var t=n._getPosition.getMousePosition(e);if(t){var i=a.entities.add({id:n._core.getuid(),name:"Model",position:t,orientation:Cesium.Transforms.headingPitchRollQuaternion(t,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(n._core.defaultValue(r.heading,0)),Cesium.Math.toRadians(n._core.defaultValue(r.pitch,0)),Cesium.Math.toRadians(n._core.defaultValue(r.roll,0)))),model:{uri:n._core.defaultValue(r.url,h.testModel),scale:n._core.defaultValue(r.scale,1),minimumPixelSize:0,runAnimations:!0,colorBlendMode:n._core.defaultValue(r.colorBlendMode,void 0),color:n._cesium.Color.fromCssColorString(n._core.defaultValue(r.color,"#ffffff")),distanceDisplayCondition:n._core.defaultValue(r.distanceDisplayCondition,new n._cesium.DistanceDisplayCondition(0,1e8))}});i.heading=n._core.defaultValue(r.heading,0),i.pitch=n._core.defaultValue(r.pitch,0),i.roll=n._core.defaultValue(r.roll,0),n.SimpleGraphicObj.push(i.id),n.drawHandler.destroy(),n.drawHandler=void 0,n.tooltip.show(!1),setTimeout(function(){oe.states=0},100),n._core.mouse(n._viewer.container,0,"0"),o&&"function"==typeof o&&o(i)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){n.tooltip.showAt(e.endPosition,"点击绘制模型")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(){e.end=void 0,n.drawHandler.destroy(),n.drawHandler=void 0,n.tooltip.show(!1),setTimeout(function(){oe.states=0},100),n._core.mouse(n._viewer.container,0,"0")},this},e.prototype.addModel=function(e){var t=this,i=this._viewer.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"Model"),position:e.position,orientation:Cesium.Transforms.headingPitchRollQuaternion(e.position,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(t._core.defaultValue(e.heading,0)),Cesium.Math.toRadians(t._core.defaultValue(e.pitch,0)),Cesium.Math.toRadians(t._core.defaultValue(e.roll,0)))),model:{scale:t._core.defaultValue(e.scale,1),uri:t._core.defaultValue(e.url,h.testModel),minimumPixelSize:t._core.defaultValue(e.minimumPixelSize,0),runAnimations:t._core.defaultValue(e.runAnimations,!0),colorBlendMode:t._core.defaultValue(e.colorBlendMode,void 0),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"#ffffff")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return i.heading=t._core.defaultValue(e.heading,0),i.pitch=t._core.defaultValue(e.pitch,0),i.roll=t._core.defaultValue(e.roll,0),t.SimpleGraphicObj.push(i.id),i},e.prototype.createPolyline=function(i,t){var r=this,o=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(o.scene.canvas),oe.states=1;var n=[],a=void 0;return this.drawHandler.setInputAction(function(e){var t=r._getPosition.getMousePosition(e);t&&(0===n.length&&n.push(t.clone()),n.push(t),a||(a=o.entities.add({id:r._core.getuid(),name:"新建线",polyline:{positions:new r._cesium.CallbackProperty(function(){return n},!1),clampToGround:r._core.defaultValue(i.clampToGround,!0),material:new Cesium.PolylineOutlineMaterialProperty({color:r._cesium.Color.fromCssColorString(r._core.defaultValue(i.color,"rgba(0,255,0,0.6)")),outlineWidth:0,outlineColor:r._cesium.Color.WHITE.withAlpha(.6)}),width:r._core.defaultValue(i.width,3),distanceDisplayCondition:new r._cesium.DistanceDisplayCondition(0,1e8)}}),r.SimpleGraphicObj.push(a.id)),i.showSize&&r.showSizeData("polyline",[n[n.length-2],n[n.length-1]]))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){if(0===n.length)r.tooltip.showAt(e.endPosition,"点击开始绘制");else{r.tooltip.showAt(e.endPosition,"点击添加点,右键结束绘制");var t=r._getPosition.getMousePosition(e);if(!t)return;n.pop(),n.push(t),i.showSize&&(r.clearLastSizeData(),r.showSizeData("polyline",[n[n.length-2],n[n.length-1]]))}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){r.drawHandler.destroy(),r.drawHandler=void 0,r.tooltip.show(!1),r.clearAllSizeData(),setTimeout(function(){oe.states=0},100),r._core.mouse(r._viewer.container,0),r.end=void 0,"cancel"!==e?t&&"function"==typeof t&&t(a):a&&(o.entities.remove(a),r.SimpleGraphicObj.pop())},this.drawHandler.setInputAction(function(e){r.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},e.prototype.addPolyline=function(e){var t=this,i=this._viewer,r=e.positions,o=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建线"),polyline:{positions:new t._cesium.CallbackProperty(function(){return r},!1),clampToGround:t._core.defaultValue(e.clampToGround,!0),material:new Cesium.PolylineOutlineMaterialProperty({color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)")),outlineWidth:t._core.defaultValue(e.outlineWidth,0),outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)"))}),width:t._core.defaultValue(e.width,3),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(o.id),o},e.prototype.addPolylinePrimitive=function(e){var t=this,i=(this._viewer,e.positions),r=void 0;if(e.clampToGround)r=new t._cesium.GroundPolylineGeometry({positions:i,width:t._core.defaultValue(e.width,3)});else{var o=new Cesium.PolylineGeometry({positions:i,width:t._core.defaultValue(e.width,3)});r=Cesium.PolylineGeometry.createGeometry(o)}var n=t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)")),a=new Cesium.GeometryInstance({id:t._core.defaultValue(e.id,t._core.getuid()),geometry:r,attributes:{color:new t._cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),s=void 0,l=new t._cesium.PolylineColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0});return s=e.clampToGround?new t._cesium.GroundPolylinePrimitive({geometryInstances:a,appearance:l}):new t._cesium.Primitive({geometryInstances:a,appearance:l}),this.PrimitiveCollection.add(s),s},e.prototype.createPolygon=function(r,t){var o=this,i=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(i.scene.canvas),oe.states=1;var n=[],a=void 0,s=void 0;return this.drawHandler.setInputAction(function(e){var t=o._getPosition.getMousePosition(e);t&&(0===n.length&&n.push(t.clone()),n.push(t),2!==n.length||s||(r.clampToGround=o._core.defaultValue(r.clampToGround,!0),s=i.entities.add({name:"临时线",polyline:{positions:new o._cesium.CallbackProperty(function(){return n},!1),clampToGround:o._core.defaultValue(r.clampToGround,!0),material:new Cesium.PolylineOutlineMaterialProperty({color:o._cesium.Color.fromCssColorString(o._core.defaultValue(r.color,"rgba(0,255,0,0.6)")),outlineWidth:0,outlineColor:o._cesium.Color.WHITE.withAlpha(.6)}),width:3}})),3!==n.length||a||(s&&i.entities.remove(s),a=i.entities.add({id:o._core.getuid(),name:"新建面",polygon:{hierarchy:new o._cesium.CallbackProperty(function(){return new o._cesium.PolygonHierarchy(n)},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(r.color,"rgba(0,255,0,0.6)"))}),perPositionHeight:!o._core.defaultValue(r.clampToGround,!1),heightReference:r.clampToGround?1:0,outline:o._core.defaultValue(r.outline,!1),outlineColor:o._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}}),o.SimpleGraphicObj.push(a.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){if(0===n.length)o.tooltip.showAt(e.endPosition,"点击添加第一个点");else if(1===n.length){o.tooltip.showAt(e.endPosition,"点击添加第二个点");var t=o._getPosition.getMousePosition(e);if(!t)return;n.pop(),n.push(t)}else{o.tooltip.showAt(e.endPosition,"点击添加点,右键结束绘制");var i=o._getPosition.getMousePosition(e);if(!i)return;n.pop(),n.push(i),r.showSize&&(o.clearLastSizeData(),o.showSizeData("polygon",n))}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),s&&i.entities.remove(s),o.clearAllSizeData(),setTimeout(function(){oe.states=0},100),o._core.mouse(o._viewer.container,0,"0"),o.end=void 0,"cancel"!==e?t&&"function"==typeof t&&t(a):a&&(i.entities.remove(a),o.SimpleGraphicObj.pop())},this.drawHandler.setInputAction(function(e){o.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},e.prototype.createTriangle=function(i,t){var r=this,_=this,o=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(o.scene.canvas),oe.states=1;var n=[],a=void 0,s=void 0;function l(e,t){var i,r,o,n,a,s,l,u,c,h=[],d=_.toDegrees(e),m=_.toDegrees(t),p=(i=d.lat,r=d.lon,o=m.lat,n=m.lon,a=w(i),s=w(o),l=w(o)-w(i),u=w(n)-w(r),c=2*Math.asin(Math.sqrt(Math.pow(Math.sin(l/2),2)+Math.cos(a)*Math.cos(s)*Math.pow(Math.sin(u/2),2))),c*=y,c=Math.round(1e4*c)/1e4,{angle:_._core.TwoPointAzimuth(r,i,n,o),distance:c}),g=p.angle,f=p.distance;h.push(m.lon,m.lat);var v=C(d.lat,d.lon,f,g+120);return h.push(v[0],v[1]),v=C(d.lat,d.lon,f,g-120),h.push(v[0],v[1]),Cesium.Cartesian3.fromDegreesArray(h)}this.drawHandler.setInputAction(function(e){var t=_._getPosition.getMousePosition(e);t&&(a?(n=l(a,t),r.end()):n=[a=t,t,t],n.length&&!s&&(i.clampToGround=_._core.defaultValue(i.clampToGround,!0),s=o.entities.add({id:_._core.getuid(),name:"新建三角形",polygon:{hierarchy:new _._cesium.CallbackProperty(function(){return new _._cesium.PolygonHierarchy(n)},!1),material:new _._cesium.ImageMaterialProperty({image:null,repeat:new _._cesium.Cartesian2(1,1),color:_._cesium.Color.fromCssColorString(_._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),perPositionHeight:!_._core.defaultValue(i.clampToGround,!1),heightReference:i.clampToGround?1:0,outline:_._core.defaultValue(i.outline,!1),outlineColor:_._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new _._cesium.DistanceDisplayCondition(0,1e8)}}),_.SimpleGraphicObj.push(s.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){if(a){_.tooltip.showAt(e.endPosition,"再次点击结束绘制");var t=_._getPosition.getMousePosition(e);if(!t)return;n=l(a,t)}else _.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){_.drawHandler.destroy(),_.drawHandler=void 0,_.tooltip.show(!1),setTimeout(function(){oe.states=0},100),_._core.mouse(_._viewer.container,0),_.end=void 0,"cancel"!==e?t&&"function"==typeof t&&t(s):s&&(o.entities.remove(s),_.SimpleGraphicObj.pop())},this.drawHandler.setInputAction(function(e){_.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK);var y=6378137,u=6356725;function C(e,t,i,r){var o=i*Math.sin(r*Math.PI/180),n=i*Math.cos(r*Math.PI/180),a=u+(y-u)*(90-e)/90;return[180*(o/(a*Math.cos(e*Math.PI/180))+t*Math.PI/180)/Math.PI,180*(n/a+e*Math.PI/180)/Math.PI]}function w(e){return e*Math.PI/180}return this},e.prototype.createPolygonRectangle=function(i,t){var o=this,r=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),oe.states=1;var n=[],a=void 0,s=void 0,l=void 0;return this.drawHandler.setInputAction(function(e){var t=o._getPosition.getMousePosition(e);t&&(n.length?o.end():(s=e.position,n.push(t.clone(),t.clone(),t.clone(),t.clone())),a||(i.clampToGround=o._core.defaultValue(i.clampToGround,!0),a=r.entities.add({id:o._core.getuid(),name:"新建面",polygon:{hierarchy:new o._cesium.CallbackProperty(function(){return new o._cesium.PolygonHierarchy(n)},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),perPositionHeight:!o._core.defaultValue(i.clampToGround,!1),heightReference:i.clampToGround?1:0,outline:o._core.defaultValue(i.outline,!1),outlineColor:o._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}})))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){if(0===n.length)o.tooltip.showAt(e.endPosition,"点击开始绘制");else{o.tooltip.showAt(e.endPosition,"点击结束绘制"),s=Viewer.scene.cartesianToCanvasCoordinates(n[0]),l=e.endPosition;var t={x:s.x,y:l.y},i={x:l.x,y:s.y},r=o._getPosition.getMousePosition(t);r&&(n[1]=r),(r=o._getPosition.getMousePosition(l))&&(n[2]=r),(r=o._getPosition.getMousePosition(i))&&(n[3]=r)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),setTimeout(function(){oe.states=0},100),o._core.mouse(o._viewer.container,0,"0"),o.end=void 0,"cancel"!==e?t&&"function"==typeof t&&t(a,s,l):a&&r.entities.remove(a)},this},e.prototype.addPolygon=function(e){var t=this,i=this._viewer,r=e.positions,o=void 0;o=e.hierarchy?e.hierarchy:new t._cesium.PolygonHierarchy(r),e.clampToGround=t._core.defaultValue(e.clampToGround,!0);var n=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建面"),polygon:{hierarchy:new t._cesium.CallbackProperty(function(){return o},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),outline:t._core.defaultValue(e.outline,!1),outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),perPositionHeight:!t._core.defaultValue(e.clampToGround,!1),heightReference:e.clampToGround?1:0,distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(n.id),n},e.prototype.addPolygonPrimitive=function(e){var t=this,i=(this._viewer,e.positions),r=void 0;r=e.hierarchy?e.hierarchy:new t._cesium.PolygonHierarchy(i);var o=void 0,n=new t._cesium.PolygonGeometry({height:t._core.defaultValue(e.height,void 0),extrudedHeight:t._core.defaultValue(e.extrudedHeight,void 0),polygonHierarchy:r,vertexFormat:e.water?Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT:void 0}),a=t._cesium.PolygonGeometry.createGeometry(n),s=t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)")),l=new Cesium.GeometryInstance({id:t._core.defaultValue(e.id,t._core.getuid()),geometry:a,attributes:e.water?void 0:{color:new t._cesium.ColorGeometryInstanceAttribute.fromColor(s)}}),u=void 0;if(e.water)u=new Cesium.Primitive({geometryInstances:l,appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Water",uniforms:{baseWaterColor:e.watherColor||Cesium.Color.SKYBLUE.withAlpha(.6),blendColor:e.watherColor||Cesium.Color.SKYBLUE.withAlpha(.6),normalMap:e.url,frequency:e.frequency||1e3,animationSpeed:e.watherSpeed||.01,amplitude:e.amplitude||10}}})}),show:!0});else if(u=new t._cesium.Primitive({geometryInstances:l,appearance:new t._cesium.PerInstanceColorAppearance({translucent:!0}),shadows:e.shadows}),e.extrudedHeight){o=new Cesium.PrimitiveCollection;var c=new Cesium.PolygonOutlineGeometry({height:t._core.defaultValue(e.height,void 0),polygonHierarchy:r,extrudedHeight:e.extrudedHeight}),h=Cesium.PolygonOutlineGeometry.createGeometry(c),d=t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),m=new Cesium.GeometryInstance({id:t._core.defaultValue(e.id,t._core.getuid()),geometry:h,attributes:{color:new t._cesium.ColorGeometryInstanceAttribute.fromColor(d)}}),p=new t._cesium.Primitive({geometryInstances:m,appearance:new t._cesium.PolylineColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0})});o.add(u),o.add(p)}return!o&&(o=u),this.PrimitiveCollection.add(o),o},e.prototype.createRectangle=function(r,t){var i=this,o=this,n=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(n.scene.canvas),oe.states=1;var a=[],s=void 0;return this.drawHandler.setInputAction(function(e){var t=o._getPosition.getMousePosition(e);if(t&&(0===a.length?a.push(t,t):(a.pop(),a.push(t),o.end()),!s)){var i=o.toDegrees(a[0]);r.clampToGround=o._core.defaultValue(r.clampToGround,!0),(s=n.entities.add({id:o._core.getuid(),name:"新建矩形",rectangle:{coordinates:new o._cesium.CallbackProperty(function(){return o._cesium.Rectangle.fromCartesianArray(a)},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(r.color,"rgba(0,255,0,0.6)"))}),height:r.clampToGround?void 0:i.height,heightReference:r.clampToGround?1:0,outline:!0,outlineColor:o._cesium.Color.WHITE.withAlpha(.6),outlineWidth:1,distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}})).thisHeight=i.height,o.SimpleGraphicObj.push(s.id)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){if(0<a.length){o.tooltip.showAt(e.endPosition,"再次点击结束绘制");var t=o._getPosition.getMousePosition(e);t&&(a.pop(),a.push(t),r.showSize&&(o.clearLastSizeData(),o.showSizeData("rectangle",a)))}else o.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){i.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){oe.states=0},100),o._core.mouse(o._viewer.container,0,"0"),"cancel"!==e?t&&"function"==typeof t&&t(s):s&&(n.entities.remove(s),o.SimpleGraphicObj.pop())},this},e.prototype.addRectangle=function(e){var t=this,i=this._viewer,r=e.positions,o=void 0;o=e.coordinates?e.coordinates:t._cesium.Rectangle.fromCartesianArray(r);var n=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建矩形"),rectangle:{coordinates:new t._cesium.CallbackProperty(function(){return o},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),height:t._core.defaultValue(e.height,void 0),rotation:t._core.defaultValue(e.rotation,0),heightReference:t._core.defaultValue(e.heightReference,1),outline:t._core.defaultValue(e.outline,!1),outlineWidth:1,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(n.id),n},e.prototype.createCircle=function(r,t){var i=this,o=this,n=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(n.scene.canvas),oe.states=1;var a=[],s=void 0,l=0;return this.drawHandler.setInputAction(function(e){var t=o._getPosition.getMousePosition(e);if(t&&(0===a.length?a.push(t,t):(a[0]=t,l=o._cesium.Cartesian3.distance(a[0],a[1]),o.end()),!s)){var i=o.toDegrees(a[1]);r.clampToGround=o._core.defaultValue(r.clampToGround,!0),(s=n.entities.add({id:o._core.getuid(),name:"新建圆",position:a[1],ellipse:{semiMajorAxis:new o._cesium.CallbackProperty(function(){return l},!1),semiMinorAxis:new o._cesium.CallbackProperty(function(){return l},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(r.color,"rgba(0,255,0,0.6)"))}),height:r.clampToGround?void 0:i.height,heightReference:r.clampToGround?1:0,outline:!0,outlineWidth:1,outlineColor:o._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}})).thisHeight=i.height,o.SimpleGraphicObj.push(s.id)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){if(0<a.length){o.tooltip.showAt(e.endPosition,"再次点击结束绘制");var t=o._getPosition.getMousePosition(e);t&&(a[0]=t,l=o._cesium.Cartesian3.distance(a[0],a[1]),r.showSize&&(o.clearLastSizeData(),o.showSizeData("circle",a[1],l)))}else o.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){i.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){oe.states=0},100),o._core.mouse(o._viewer.container,0,"0"),"cancel"!==e?t&&"function"==typeof t&&t(s):s&&(n.entities.remove(s),o.SimpleGraphicObj.pop())},this},e.prototype.addCircle=function(e){var t=this,i=this._viewer,r=e.radius,o=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建圆"),position:e.position,ellipse:{semiMajorAxis:new t._cesium.CallbackProperty(function(){return r},!1),semiMinorAxis:new t._cesium.CallbackProperty(function(){return r},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),height:t._core.defaultValue(e.height,void 0),heightReference:t._core.defaultValue(e.heightReference,1),outline:t._core.defaultValue(e.outline,!1),outlineWidth:1,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(o.id),o},e.prototype.createEllipse=function(r,t){var i=this,o=this,n=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(n.scene.canvas),oe.states=1;var a=[],s=void 0,l=0;return this.drawHandler.setInputAction(function(e){var t=o._getPosition.getMousePosition(e);if(t&&(0===a.length?a.push(t,t):(a[0]=t,l=o._cesium.Cartesian3.distance(a[0],a[1]),o.end()),!s)){var i=o.toDegrees(a[1]);r.clampToGround=o._core.defaultValue(r.clampToGround,!0),(s=n.entities.add({id:o._core.getuid(),name:"新建椭圆",position:a[1],ellipse:{semiMajorAxis:new o._cesium.CallbackProperty(function(){return l},!1),semiMinorAxis:new o._cesium.CallbackProperty(function(){return l/2},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(r.color,"rgba(0,255,0,0.6)"))}),height:r.clampToGround?void 0:i.height,heightReference:r.clampToGround?1:0,outline:!0,outlineWidth:1,outlineColor:o._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}})).thisHeight=i.height,o.SimpleGraphicObj.push(s.id)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){if(0<a.length){o.tooltip.showAt(e.endPosition,"再次点击结束绘制");var t=o._getPosition.getMousePosition(e);t&&(a[0]=t,l=o._cesium.Cartesian3.distance(a[0],a[1]))}else o.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){i.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){oe.states=0},100),o._core.mouse(o._viewer.container,0,"0"),"cancel"!==e?t&&"function"==typeof t&&t(s):s&&(n.entities.remove(s),o.SimpleGraphicObj.pop())},this},e.prototype.addEllipse=function(e){var t=this,i=this._viewer,r=e.semiMajorAxis,o=e.semiMinorAxis,n=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建圆"),position:e.position,ellipse:{semiMajorAxis:new t._cesium.CallbackProperty(function(){return r},!1),semiMinorAxis:new t._cesium.CallbackProperty(function(){return o},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),height:t._core.defaultValue(e.height,void 0),heightReference:t._core.defaultValue(e.heightReference,1),outline:t._core.defaultValue(e.outline,!1),outlineWidth:1,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(n.id),n},e.prototype.createBox=function(n,t){var i=this,a=this,s=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(s.scene.canvas),oe.states=1;var l=[],u=void 0,c=[0,0,200];return this.drawHandler.setInputAction(function(e){var t=a._getPosition.getMouseDegrees(e);if(t){if(0===l.length)l.push(t,t);else{t.height=l[0].height,l[1]=t;var i=a.Cdcl(l[0].lat,l[0].lon,l[0].lat,l[1].lon),r=a.Cdcl(l[0].lat,l[0].lon,l[1].lat,l[0].lon),o={lon:(l[0].lon+l[1].lon)/2,lat:(l[0].lat+l[1].lat)/2};c&&(c[0]=i,c[1]=r),u.position=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,l[0].height+c[2]/2),a.end()}u||(u=s.entities.add({id:a._core.getuid(),name:"新建立方体",position:a._cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height),box:{dimensions:new a._cesium.CallbackProperty(function(){return a._cesium.Cartesian3.fromArray(c)},!1),material:new a._cesium.ImageMaterialProperty({image:null,repeat:new a._cesium.Cartesian2(1,1),color:a._cesium.Color.fromCssColorString(a._core.defaultValue(n.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:!0,outlineColor:a._cesium.Color.fromCssColorString(a._core.defaultValue(n.outlineColor,"rgba(255,255,255,0.6)")),shadows:a._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new a._cesium.DistanceDisplayCondition(0,1e8)}}),a.SimpleGraphicObj.push(u.id))}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){if(0<l.length){a.tooltip.showAt(e.endPosition,"再次点击结束绘制");var t=a._getPosition.getMouseDegrees(e);if(t){t.height=l[0].height,l[1]=t;var i=a.Cdcl(l[0].lat,l[0].lon,l[0].lat,l[1].lon),r=a.Cdcl(l[0].lat,l[0].lon,l[1].lat,l[0].lon),o={lon:(l[0].lon+l[1].lon)/2,lat:(l[0].lat+l[1].lat)/2};c&&(c[0]=i,c[1]=r),u.position=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,l[0].height+c[2]/2),n.showSize&&(a.clearLastSizeData(),a.showSizeData("box",u.position,c))}}else a.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){i.end=void 0,a.drawHandler.destroy(),a.drawHandler=void 0,a.tooltip.show(!1),a.clearAllSizeData(),setTimeout(function(){oe.states=0},100),a._core.mouse(a._viewer.container,0,"0"),"cancel"!==e?t&&"function"==typeof t&&t(u):u&&(s.entities.remove(u),a.SimpleGraphicObj.pop())},this},e.prototype.addBox=function(e){var t=this,i=this._viewer,r=e.dimensions,o=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建立方体"),position:e.position,box:{dimensions:new t._cesium.CallbackProperty(function(){return r},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:t._core.defaultValue(e.outline,!0),shadows:t._cesium.ShadowMode.ENABLED,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(o.id),o},e.prototype.createCylinder=function(r,t){var i=this,o=this,n=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(n.scene.canvas),oe.states=1;var a=[],s=void 0,l=0;return this.drawHandler.setInputAction(function(e){var t=o._getPosition.getMousePosition(e);if(t&&(0===a.length?a.push(t,t):(a[0]=t,l=o._cesium.Cartesian3.distance(a[0],a[1]),o.end()),!s)){var i=o.toDegrees(t);(s=n.entities.add({id:o._core.getuid(),name:"新建圆柱体",position:o._cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height+100),cylinder:{length:200,topRadius:new o._cesium.CallbackProperty(function(){return l},!1),bottomRadius:new o._cesium.CallbackProperty(function(){return l},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(r.color,"rgba(0,255,0,0.6)"))}),fill:!0,shadows:o._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8),outline:!0,outlineColor:o._cesium.Color.fromCssColorString(o._core.defaultValue(r.outlineColor,"rgba(255,255,255,0.6)"))}})).changeTop=!0,o.SimpleGraphicObj.push(s.id)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){if(0<a.length){o.tooltip.showAt(e.endPosition,"再次点击结束绘制");var t=o._getPosition.getMousePosition(e);t&&(a[0]=t,l=o._cesium.Cartesian3.distance(a[0],a[1]),r.showSize&&(o.clearLastSizeData(),o.showSizeData("cylinder",a[1],l,200)))}else o.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){i.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){oe.states=0},100),o._core.mouse(o._viewer.container,0,"0"),"cancel"!==e?t&&"function"==typeof t&&t(s):s&&(n.entities.remove(s),o.SimpleGraphicObj.pop())},this},e.prototype.addCylinder=function(e){var t=this,i=this._viewer,r=e.radius,o=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建圆柱体"),position:e.position,cylinder:{length:t._core.defaultValue(e.length,200),topRadius:new t._cesium.CallbackProperty(function(){return r},!1),bottomRadius:new t._cesium.CallbackProperty(function(){return r},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:t._core.defaultValue(e.outline,!0),shadows:t._cesium.ShadowMode.ENABLED,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return o.changeTop=!0,t.SimpleGraphicObj.push(o.id),o},e.prototype.createCone=function(r,t){var i=this,o=this,n=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(n.scene.canvas),oe.states=1;var a=[],s=void 0,l=0;return this.drawHandler.setInputAction(function(e){var t=o._getPosition.getMousePosition(e);if(t&&(0===a.length?a.push(t,t):(a[0]=t,l=o._cesium.Cartesian3.distance(a[0],a[1]),o.end()),!s)){var i=o.toDegrees(t);(s=n.entities.add({id:o._core.getuid(),name:"新建圆锥体",position:o._cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height+100),cylinder:{length:200,topRadius:0,bottomRadius:new o._cesium.CallbackProperty(function(){return l},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(r.color,"rgba(0,255,0,0.6)"))}),fill:!0,shadows:o._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8),outline:!0,outlineColor:o._cesium.Color.fromCssColorString(o._core.defaultValue(r.outlineColor,"rgba(255,255,255,0.6)"))}})).changeTop=!1,o.SimpleGraphicObj.push(s.id)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){if(0<a.length){o.tooltip.showAt(e.endPosition,"再次点击结束绘制");var t=o._getPosition.getMousePosition(e);t&&(a[0]=t,l=o._cesium.Cartesian3.distance(a[0],a[1]),r.showSize&&(o.clearLastSizeData(),o.showSizeData("cone",a[1],l,200)))}else o.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){i.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){oe.states=0},100),o._core.mouse(o._viewer.container,0,"0"),"cancel"!==e?t&&"function"==typeof t&&t(s):s&&(n.entities.remove(s),o.SimpleGraphicObj.pop())},this},e.prototype.addCone=function(e){var t=this,i=this._viewer,r=e.bottomRadius,o=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建圆锥体"),position:e.position,cylinder:{length:t._core.defaultValue(e.length,200),topRadius:t._core.defaultValue(e.topRadius,0),bottomRadius:new t._cesium.CallbackProperty(function(){return r},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:t._core.defaultValue(e.outline,!0),shadows:t._cesium.ShadowMode.ENABLED,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return o.changeTop=!1,t.SimpleGraphicObj.push(o.id),o},e.prototype.createSphere=function(i,r){var o=this,n=this,a=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(a.scene.canvas),oe.states=1;var s=[],l=void 0,u=0;return this.drawHandler.setInputAction(function(e){var t=n._getPosition.getMousePosition(e);t&&(0===s.length?s.push(t,t):(s[0]=t,u=n._cesium.Cartesian3.distance(s[0],s[1]),n.end()),l||((l=a.entities.add({id:n._core.getuid(),name:"新建球体",position:t.clone(),ellipsoid:{radii:new n._cesium.CallbackProperty(function(){return new Cesium.Cartesian3(u,u,u)},!1),material:new n._cesium.ImageMaterialProperty({image:null,repeat:new n._cesium.Cartesian2(1,1),color:n._cesium.Color.fromCssColorString(n._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),fill:!0,shadows:n._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new n._cesium.DistanceDisplayCondition(0,1e8),outline:!0,outlineColor:n._cesium.Color.fromCssColorString(n._core.defaultValue(i.outlineColor,"rgba(255,255,255,0.6)"))}})).isSphere=!0,n.SimpleGraphicObj.push(l.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){if(0<s.length){n.tooltip.showAt(e.endPosition,"再次点击结束绘制");var t=n._getPosition.getMousePosition(e);t&&(s[0]=t,u=n._cesium.Cartesian3.distance(s[0],s[1]),i.showSize&&(n.clearLastSizeData(),n.showSizeData("sphere",s[1],u)))}else n.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){if(o.end=void 0,n.drawHandler.destroy(),n.drawHandler=void 0,n.tooltip.show(!1),n.clearAllSizeData(),setTimeout(function(){oe.states=0},100),n._core.mouse(n._viewer.container,0,"0"),"cancel"!==e){var t=n.toDegrees(s[0]),i=n.toDegrees(s[1]);t.height=i.height,s[0]=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height),r&&"function"==typeof r&&r(l)}else l&&(a.entities.remove(l),n.SimpleGraphicObj.pop())},this},e.prototype.addSphere=function(e){var t=this,i=this._viewer,r=e.radius,o=void 0;o=e.radii?e.radii:new Cesium.Cartesian3(r,r,r);var n=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建球体"),position:e.position,ellipsoid:{radii:new t._cesium.CallbackProperty(function(){return o},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:t._core.defaultValue(e.outline,!0),shadows:t._cesium.ShadowMode.ENABLED,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return n.isSphere=!0,t.SimpleGraphicObj.push(n.id),n},e.prototype.createPolyhedron=function(r,t){var o=this,n=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(n.scene.canvas),oe.states=1;var a=[],s=void 0;return this.drawHandler.setInputAction(function(e){var t=o._getPosition.getMousePosition(e);if(t&&(1===a.length&&a.push(t.clone()),a.push(t),3===a.length&&!s)){var i=o.toDegrees(a[0]);s=n.entities.add({id:o._core.getuid(),name:"新建多边体",polygon:{hierarchy:new o._cesium.CallbackProperty(function(){return new o._cesium.PolygonHierarchy(a)},!1),extrudedHeight:i.height+200,height:i.height,material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(r.color,"rgba(0,255,0,0.6)"))}),fill:!0,shadows:o._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8),outline:!0,outlineColor:o._cesium.Color.fromCssColorString(o._core.defaultValue(r.outlineColor,"rgba(255,255,255,0.6)"))}}),o.SimpleGraphicObj.push(s.id)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){if(0===a.length)o.tooltip.showAt(e.endPosition,"点击添加第一个点");else if(1===a.length)o.tooltip.showAt(e.endPosition,"点击添加第二个点");else{o.tooltip.showAt(e.endPosition,"点击添加点,右键结束绘制");var t=o._getPosition.getMousePosition(e);if(!t)return;a.pop(),a.push(t),r.showSize&&(o.clearLastSizeData(),o.showSizeData("polyhedron",a,0,200))}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){oe.states=0},100),o._core.mouse(o._viewer.container,0,"0"),o.end=void 0,"cancel"!==e?t&&"function"==typeof t&&t(s):s&&(n.entities.remove(s),o.SimpleGraphicObj.pop())},this.drawHandler.setInputAction(function(e){o.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},e.prototype.addPolyhedron=function(e){var t=this,i=this._viewer,r=e.positions,o=t._core.defaultValue(e.height,0),n=void 0;n=e.hierarchy?e.hierarchy:new t._cesium.PolygonHierarchy(r);var a=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建多边体"),polygon:{hierarchy:new t._cesium.CallbackProperty(function(){return n},!1),extrudedHeight:t._core.defaultValue(e.extrudedHeight,o+200),height:o,material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),shadows:t._cesium.ShadowMode.ENABLED,fill:!0,outline:t._core.defaultValue(e.outline,!0),outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(a.id),a},e.prototype.toDegrees=function(e){var t=this._cesium.Cartographic.fromCartesian(e);return{lon:this._cesium.Math.toDegrees(t.longitude),lat:this._cesium.Math.toDegrees(t.latitude),height:t.height}},e.prototype.showSizeData=function(e,t,i,r){var o=this,n="",a=void 0;switch(e){case"polyline":var s=Cesium.Cartesian3.distance(t[0],t[1]);n=1e3<=s?(s/=1e3).toFixed(2)+"千米":s.toFixed(2)+"米",a=Cesium.Cartesian3.midpoint(t[0],t[1],new Cesium.Cartesian3);break;case"polygon":var l=[];a=new Cesium.Cartesian3,t.forEach(function(e){a=Cesium.Cartesian3.add(e,a,new Cesium.Cartesian3),l.push(o.toDegrees(e))}),a=Cesium.Cartesian3.divideByScalar(a,t.length,new Cesium.Cartesian3),n=this._core.getArea(l,t,Cesium);break;case"rectangle":var u=this.toDegrees(t[0]),c=this.toDegrees(t[1]),h=Cesium.Cartesian3.distance(t[0],Cesium.Cartesian3.fromDegrees(u.lon,c.lat,u.height))*Cesium.Cartesian3.distance(t[1],Cesium.Cartesian3.fromDegrees(u.lon,c.lat,u.height));n=1e6<=h?(h/=1e6).toFixed(2)+"平方千米":h.toFixed(2)+"平方米",a=Cesium.Cartesian3.midpoint(t[0],t[1],new Cesium.Cartesian3);break;case"circle":a=t,n=1e3<=i?"半径:"+(i/=1e3).toFixed(2)+"千米":"半径:"+i.toFixed(2)+"米";break;case"box":var d=[];i[0]<i[1]?(d.push(i[1]),d.push(i[0])):(d.push(i[0]),d.push(i[1])),d.push(i[2]);var m=["长:","\n宽:","\n高:"];d.forEach(function(e,t){n+=1e3<=e?m[t]+(e/=1e3).toFixed(2)+"千米":m[t]+e.toFixed(2)+"米"}),a=t;break;case"cylinder":case"cone":a=t,n=1e3<=i?"半径:"+(i/=1e3).toFixed(2)+"千米\n":"半径:"+i.toFixed(2)+"米\n",n+=1e3<=r?"高度:"+(r/=1e3).toFixed(2)+"千米":"高度:"+r.toFixed(2)+"米";break;case"sphere":a=t,n=1e3<=i?"半径:"+(i/=1e3).toFixed(2)+"千米":"半径:"+i.toFixed(2)+"米";break;case"polyhedron":l=[];a=new Cesium.Cartesian3,t.forEach(function(e){a=Cesium.Cartesian3.add(e,a,new Cesium.Cartesian3),l.push(o.toDegrees(e))}),a=Cesium.Cartesian3.divideByScalar(a,t.length,new Cesium.Cartesian3),n=1e3<=r?"高度:"+(r/=1e3).toFixed(2)+"千米":"高度:"+r.toFixed(2)+"米",n+="\n面积:"+this._core.getArea(l,t,Cesium)}var p=this._viewer.entities.add({position:a,label:{text:n,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});this.SizeData.push(p.id)},e.prototype.clearLastSizeData=function(){if(this.SizeData.length){var e=this.SizeData.pop();this._viewer.entities.removeById(e)}},e.prototype.clearAllSizeData=function(){var t=this;this.SizeData.forEach(function(e){t._viewer.entities.removeById(e)}),this.SizeData=[]},e.prototype.Cdcl=function(e,t,i,r){var o=Math.PI;function n(e){return e*o/180}var a,s,l,u,c=n((e+i)/2),h=n((e-i)/2),d=n((t-r)/2),m=Math.sin(h),p=Math.sin(d),g=Math.sin(c);return a=(m*=m)*(1-(p*=p))+(1-(g*=g))*p,s=(1-m)*(1-p)+g*p,2*(l=Math.atan(Math.sqrt(a/s)))*6378137*(1+1/298.257*((3*(u=Math.sqrt(a*s)/l)-1)/2/s*g*(1-m)-(3*u+1)/2/a*(1-g)*m))},e.prototype.setEdit=function(e,t){void 0===e&&(e=!0),!t&&(t={}),this.editOption=t,this.openEdit=e},e.prototype.edit=function(e,u){var n=this,Q=this,K=this._viewer;if(!u&&(u={}),void 0!==u.editProp&&(this.editProp=u.editProp),this.editHandler&&(this.editHandler.destroy(),this.editHandler=void 0),void 0===e&&(e=!0),e){var $,Z,ee,te;this.editHandler=new this._cesium.ScreenSpaceEventHandler(K.scene.canvas),this.isEditting=!1;var ie=void 0;this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))Q.isEditting&&(re(),Q.defaultEvent(!1));else if(!oe.editVector){var t=e.position,i=K.scene.pick(t);if(Q._cesium.defined(i)&&i.id instanceof Cesium.Entity){var r=i.id;if(Q.isEditting||0!=oe.states)if(r==$&&("point"===r.GeoType||"billboard"===r.GeoType||"label"===r.GeoType||"model"===r.GeoType)||"height_point"==r.name||"edit_point"==r.name||"move_point"==r.name||"add_point"==r.name||"size_point"==r.name)K.container.style.cursor="crosshair",Q.defaultEvent(!1),"height_point"==r.name?(ee={windowPosition:t,originHeight:Q._cesium.Cartographic.fromCartesian(r.position.getValue()).height},ie="height_point"):"move_point"==r.name?ie="move_point":"point"===r.GeoType||"billboard"===r.GeoType||"label"===r.GeoType||"model"===r.GeoType?(Q.tooltip.showAt(e.position,"释放后完成修改"),ie="move_point","model"===r.GeoType&&(r.show=!1)):"edit_point"==r.name?ie="edit_point":"add_point"==r.name?ie="add_point":"size_point"==r.name&&(ie="size_point"),Z=r;else{if($&&r.id===$.id)return;re()}else{if(-1===Q.SimpleGraphicObj.indexOf(r.id))return;if(void 0===($=r).GeoType){var o=Q.getEntityTypeAndObject($);$.GeoType=o.type}te=$.GeoType,Q.getSimpleGraphicData(te,$),"point"===te||"billboard"===te||"label"===te||"model"===te?(Q.isEditting=!0,Q.tooltip.showAt(e.position,"拖拽修改位置")):(Q.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint()),n.editProp&&(!u.editPropData&&(u.editPropData={}),Q._popupmessage.createPopupProp("属性编辑",{width:u.editPropData.width||360,height:u.editPropData.height||"90%",url:"Workers/prop/jdtx_prop.html",shade:u.editPropData.shade,offset:u.editPropData.offset,type:te,fn:{success:function(e,t){u.editPropData.success&&u.editPropData.success(e,t),SmartEarthPopupData.layerIndex=t,SmartEarthPopupData.window=e.find("iframe")[0].contentWindow},end:function(){u.editPropData.end&&u.editPropData.end(),re(),SmartEarthPopupData.layerIndex=void 0,SmartEarthPopupData.window=void 0}}}))}}else re()}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))Q.isEditting&&(re(),Q.defaultEvent(!1));else if(!oe.editVector){var t=K.scene.pick(e.endPosition);if(Q._cesium.defined(t))if(Q.isEditting&&!Z){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))return void(Q.isEditting&&(re(),Q.defaultEvent(!1)));"point"!==te&&"billboard"!==te&&"label"!==te&&"model"!==te||t.id!=$?t.id&&"edit_point"===t.id.name&&$.pottingPoint?"polyline"===te&&2<$.pottingPoint.length?Q.tooltip.showAt(e.endPosition,"拖拽修改位置,右键删除点"):"polygon"===te&&3<$.pottingPoint.length?Q.tooltip.showAt(e.endPosition,"拖拽修改位置,右键删除点"):Q.tooltip.showAt(e.endPosition,"拖拽修改位置"):!t.id||"move_point"!==t.id.name&&"size_point"!==t.id.name?t.id&&"add_point"===t.id.name?Q.tooltip.showAt(e.endPosition,"拖拽增加节点"):t.id&&"height_point"===t.id.name?Q.tooltip.showAt(e.endPosition,"拖拽修改高度"):t.id==$&&Q.tooltip.show(!1):Q.tooltip.showAt(e.endPosition,"拖拽修改位置"):Q.tooltip.showAt(e.endPosition,"拖拽修改位置,右键删除")}else Q.isEditting||0!==oe.states||(t.id&&-1<Q.SimpleGraphicObj.indexOf(t.id.id)?Q.tooltip.showAt(e.endPosition,"点击激活编辑,右键删除"):Q.tooltip.show(!1));else 0!=oe.states||Z||Q.tooltip.show(!1);if(Q.isEditting&&Z){Q.tooltip.showAt(e.endPosition,"释放后完成修改");var i=Q._getPosition.getMousePosition(e);if(!i&&"height_point"!==ie)return;if("edit_point"===ie){Z.position=i;var r=oe.editPointID.edit.indexOf(Z.id);if(void 0!==$[te].height){var o=Q.toDegrees(i);$.pottingPoint[r]=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,$[te].height.getValue()),Z.position=$.pottingPoint[r]}else $.pottingPoint[r]=i;if(0<oe.editPointID.height.length){var n=K.entities.getById(oe.editPointID.height[r]);if(n){var a=Q.toDegrees(i),s=Q._cesium.Cartographic.fromCartesian(n.position.getValue());n.position=Q._cesium.Cartesian3.fromDegrees(a.lon,a.lat,s.height)}}if(0<oe.editPointID.add.length){if(0<r){var l=K.entities.getById(oe.editPointID.add[r-1]);if(l){var u=K.entities.getById(oe.editPointID.edit[r-1]),c=K.entities.getById(oe.editPointID.edit[r]);l.position=Cesium.Cartesian3.midpoint(u.position.getValue(),c.position.getValue(),new Cesium.Cartesian3)}}if(r<$.pottingPoint.length-1){var h=K.entities.getById(oe.editPointID.add[r]);if(h){var d=K.entities.getById(oe.editPointID.edit[r]),m=K.entities.getById(oe.editPointID.edit[r+1]);h.position=Cesium.Cartesian3.midpoint(d.position.getValue(),m.position.getValue(),new Cesium.Cartesian3)}}if("polygon"===te&&(0===r||r===$.pottingPoint.length-1)){var p=K.entities.getById(oe.editPointID.add[oe.editPointID.add.length-1]);if(p){var g=K.entities.getById(oe.editPointID.edit[0]),f=K.entities.getById(oe.editPointID.edit[$.pottingPoint.length-1]);p.position=Cesium.Cartesian3.midpoint(g.position.getValue(),f.position.getValue(),new Cesium.Cartesian3)}}}var v=$.pottingPoint.concat([]),_=new Q._cesium.Cartesian3,y=v.length;v.forEach(function(e){_.x+=e.x,_.y+=e.y,_.z+=e.z}),_.x/=y,_.y/=y,_.z/=y,oe.editPointID.move&&(oe.editPointID.move.position=_),"polyline"!==te&&"polygon"!==te&&"rectangle"!==te||SmartEarthPopupData.editGraphic.setValue("positions",v)}else if("height_point"===ie){var C=oe.editPointID.height.indexOf(Z.id),w=K.entities.getById(oe.editPointID.edit[C]);"ellipse"!==te&&"cylinder"!==te&&"box"!==te||(w=oe.editPointID.move);var b=Q.toDegrees(w.position.getValue()),E=ee.originHeight-b.height,S=K.scene.cartesianToCanvasCoordinates(w.position.getValue()),P=(ee.windowPosition.y-e.endPosition.y)*E/Math.abs(S.y-ee.windowPosition.y),x=Math.abs(E+P);oe.editPointID.height.forEach(function(e){var t=K.entities.getById(e);if(t){var i=t.position.getValue(),r=Q.toDegrees(i);t.position=Q._cesium.Cartesian3.fromDegrees(r.lon,r.lat,x+b.height)}}),$[te].extrudedHeight?$[te].extrudedHeight=new Q._cesium.CallbackProperty(function(){return x+b.height},!1):"box"===te?SmartEarthPopupData.editGraphic.setValue("height",x):"cylinder"===te&&SmartEarthPopupData.editGraphic.setValue("length",x),SmartEarthPopupData.window&&(SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="extrudedHeight"]')&&(SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="extrudedHeight"]').value=parseFloat(x).toFixed(2)),SmartEarthPopupData.window.document.querySelector('.box input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.box input[name="height"]').value=parseFloat(x).toFixed(2)),SmartEarthPopupData.window.document.querySelector('.cylinder input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.cylinder input[name="height"]').value=parseFloat(x).toFixed(2)),SmartEarthPopupData.window.document.querySelector('.cone input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.cone input[name="height"]').value=parseFloat(x).toFixed(2)))}else if("add_point"===ie){var T=oe.editPointID.add.indexOf(Z.id);K.entities.remove(Z);var I=K.entities.add({name:"edit_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(oe.editPointID.edit.splice(T+1,0,I.id),$.pottingPoint.splice(T+1,0,i.clone()),0<oe.editPointID.height.length){var D=Q.toDegrees(i);D.height=$[te].extrudedHeight.getValue();var L=K.entities.add({name:"height_point",position:Q._cesium.Cartesian3.fromDegrees(D.lon,D.lat,D.height),point:{color:Q._cesium.Color.YELLOW,pixelSize:12,outlineColor:Q._cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});oe.editPointID.height.splice(T+1,0,L.id)}var M=Cesium.Cartesian3.midpoint($.pottingPoint[T],$.pottingPoint[T+1],new Cesium.Cartesian3),A=K.entities.add({name:"add_point",position:M,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),R=Cesium.Cartesian3.midpoint($.pottingPoint[T+1],$.pottingPoint[T+2===$.pottingPoint.length?0:T+2],new Cesium.Cartesian3),O=K.entities.add({name:"add_point",position:R,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});oe.editPointID.add.splice(T,1,A.id,O.id),Z=I,ie="edit_point";var N=$.pottingPoint.concat([]);"polyline"!==te&&"polygon"!==te||SmartEarthPopupData.editGraphic.setValue("positions",N)}else if("size_point"===ie){var V=oe.editPointID.move.position.getValue(),F=Q._cesium.Cartesian3.distance(V,i);if("ellipse"===te||"cylinder"===te||"ellipsoid"===te&&$.isSphere)SmartEarthPopupData.editGraphic.setValue("radius",F),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector("."+te+' input[name="radius"]')&&(SmartEarthPopupData.window.document.querySelector("."+te+' input[name="radius"]').value=parseFloat(F).toFixed(2));else if("box"===te){var H=90===Z.angle?"long":"width";SmartEarthPopupData.editGraphic.setValue(H,2*F),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.box input[name="'+H+'"]')&&(SmartEarthPopupData.window.document.querySelector('.box input[name="'+H+'"]').value=parseFloat(2*F).toFixed(2))}}else{if("point"===te||"billboard"===te||"label"===te||"model"===te)return Z.position=i,void(SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector("."+te+' input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector("."+te+' input[name="height"]').value=SmartEarthPopupData.editGraphic.getValue("pHeight").toFixed(2)));var G=Q.toDegrees(i);ee=Z.position.getValue();var k=Q.toDegrees(ee),B=G.lon-k.lon,j=G.lat-k.lat,z=G.height-k.height;if(Z.position=i,$[te].height){var W=Q.toDegrees(i).height;$[te].height=W,$.thisHeight=W}$.pottingPoint.forEach(function(e,t){var i,r=void 0,o=void 0,n=K.entities.getById(oe.editPointID.edit[t]);if(n||(n=K.entities.getById(oe.editPointID.size[t])),r=n?Q.toDegrees(n.position.getValue()):Q.toDegrees(e),i=Q._cesium.Cartesian3.fromDegrees(r.lon+B,r.lat+j,r.height+z),e.x=i.x,e.y=i.y,e.z=i.z,n&&(n.position=i),0<oe.editPointID.height.length){var a=K.entities.getById(oe.editPointID.height[t]);a&&(r=a.position.getValue(),o=Q._cesium.Cartographic.fromCartesian(r),r={lon:Q._cesium.Math.toDegrees(o.longitude),lat:Q._cesium.Math.toDegrees(o.latitude),height:o.height},a.position=Q._cesium.Cartesian3.fromDegrees(r.lon+B,r.lat+j,r.height+z))}if(0<oe.editPointID.add.length&&oe.editPointID.add[t]){var s=K.entities.getById(oe.editPointID.add[t]);s&&(r=Q.toDegrees(s.position.getValue()),s.position=Q._cesium.Cartesian3.fromDegrees(r.lon+B,r.lat+j,r.height+z))}});var U=$.pottingPoint.concat([]);if("polyline"===te||"polygon"===te||"rectangle"===te)SmartEarthPopupData.editGraphic.setValue("positions",U),0<oe.editPointID.height.length&&(SmartEarthPopupData.editGraphic.setValue("extrudedHeight",SmartEarthPopupData.editGraphic.getValue("extrudedHeight")+z),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]').value=parseFloat($[te].height.getValue()).toFixed(2))),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.rectangle input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.rectangle input[name="height"]').value=parseFloat($[te].height.getValue()).toFixed(2));else if("ellipse"===te)$.pottingPoint[1]=i,$.position=i.clone(),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.ellipse input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.ellipse input[name="height"]').value=parseFloat($[te].height.getValue()).toFixed(2));else if("box"===te){$.pottingPoint[2]=i;var q=$.box.dimensions.getValue(),Y=Q.toDegrees(i);$.position=Cesium.Cartesian3.fromDegrees(Y.lon,Y.lat,Y.height+q.z/2)}else if("cylinder"===te){$.pottingPoint[1]=i;var X=$.cylinder.length.getValue(),J=Q.toDegrees($.pottingPoint[1]);$.position=Cesium.Cartesian3.fromDegrees(J.lon,J.lat,J.height+X/2)}else"ellipsoid"===te&&($.pottingPoint[$.pottingPoint.length-1]=i,$.position=i.clone())}}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.editHandler.setInputAction(function(e){Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?Q.isEditting&&(re(),Q.defaultEvent(!1)):oe.editVector||(Z&&"model"===Z.GeoType&&(Z.show=!0),Z&&u.callBack&&u.callBack.updata&&u.callBack.updata(Z.name,$),K.container.style.cursor="default",Z=void 0,Q.defaultEvent(!0))},this._cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))Q.isEditting&&(re(),Q.defaultEvent(!1));else if(!oe.editVector){var t=K.scene.pick(e.position);if(Q._cesium.defined(t)&&0==oe.states){var i=t.id;if(-1<Q.SimpleGraphicObj.indexOf(i.id))Q.tooltip.show(!1),Q.delButton(!0,e.position,function(){i.treeobj&&oe.delete(i.treeobj.id,K,Q._cesium),K.entities.removeById(i.id);var e=Q.SimpleGraphicObj.indexOf(i.id);Q.SimpleGraphicObj.splice(e,1),Q.delButton(!1),Q.tooltip.show(!1),re(),!Q.SimpleGraphicObj.length&&Q.editHandler&&Q.edit(!1),u.callBack&&u.callBack.delete&&u.callBack.delete(i)});else if(-1<oe.editPointID.edit.indexOf(i.id)&&("polyline"===te&&2<oe.editPointID.edit.length||"polygon"===te&&3<oe.editPointID.edit.length)){var r=oe.editPointID.edit.indexOf(i.id);if(K.entities.removeById(i.id),oe.editPointID.edit.splice(r,1),0<oe.editPointID.height.length&&(K.entities.removeById(oe.editPointID.height[r]),oe.editPointID.height.splice(r,1)),$.pottingPoint.splice(r,1),0<oe.editPointID.add.length)if(oe.editPointID.add[r]){if(K.entities.removeById(oe.editPointID.add[r]),oe.editPointID.add.splice(r,1),0<=r-1){var o=K.entities.getById(oe.editPointID.add[r-1]);o&&(o.position=Cesium.Cartesian3.midpoint($.pottingPoint[r-1],$.pottingPoint[r===$.pottingPoint.length?0:r],new Cesium.Cartesian3))}else if(r-1==-1&&"polygon"===te){var n=K.entities.getById(oe.editPointID.add[oe.editPointID.add.length-1]);n&&(n.position=Cesium.Cartesian3.midpoint($.pottingPoint[0],$.pottingPoint[$.pottingPoint.length-1],new Cesium.Cartesian3))}}else K.entities.removeById(oe.editPointID.add[r-1]),oe.editPointID.add.pop();var a=new Q._cesium.Cartesian3,s=$.pottingPoint.length;$.pottingPoint.forEach(function(e){a.x+=e.x,a.y+=e.y,a.z+=e.z}),a.x/=s,a.y/=s,a.z/=s,oe.editPointID.move&&(oe.editPointID.move.position=a);var l=$.pottingPoint.concat([]);"polyline"!==te&&"polygon"!==te||SmartEarthPopupData.editGraphic.setValue("positions",l),Q.tooltip.show(!1),u.callBack&&u.callBack.updata&&u.callBack.updata(Z&&Z.name,$)}}}},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),re()}else re();function re(){Q.defaultEvent(!0),oe.editPointID.edit.forEach(function(e){K.entities.removeById(e)}),oe.editPointID.edit=[],oe.editPointID.height.forEach(function(e){K.entities.removeById(e)}),oe.editPointID.height=[],oe.editPointID.add.forEach(function(e){K.entities.removeById(e)}),oe.editPointID.add=[],oe.editPointID.size.forEach(function(e){K.entities.removeById(e)}),oe.editPointID.size=[],oe.editPointID.move&&K.entities.remove(oe.editPointID.move),oe.editPointID.move=void 0,te=$=void 0,window.layuiLayer.close(SmartEarthPopupData.layerIndex),SmartEarthPopupData.editGraphic={},Q.isEditting=!1,Q.delButton(!1)}},e.prototype.delButton=function(e,t,i){if(e){var r=document.getElementById("DeleteMilitaryStandardDelete");r||((r=document.createElement("button")).id="DeleteMilitaryStandardDelete",r.innerText="删除对象",r.style.cssText="height: 38px;\n line-height: 38px;\n padding: 0 18px;\n background-color: #052355;\n color: #fff;\n white-space: nowrap;\n text-align: center;\n font-size: 14px;\n border: none;\n border-radius: 2px;\n cursor: pointer;\n position: absolute;",this._viewer.container.appendChild(r)),r.style.display="block",r.style.top=t.y+"px",r.style.left=t.x+"px",r.onclick=i}else{var o=document.getElementById("DeleteMilitaryStandardDelete");o&&(o.style.display="none",o.onclick=null)}},e.prototype.defaultEvent=function(e){var t=this._viewer.scene;t.screenSpaceCameraController.enableRotate=e,t.screenSpaceCameraController.enableTranslate=e,t.screenSpaceCameraController.enableZoom=e,t.screenSpaceCameraController.enableTilt=e,t.screenSpaceCameraController.enableLook=e},e.prototype.GetDegreesFromA_D=function(e,t,i,r){var o=i*Math.sin(r*Math.PI/180),n=i*Math.cos(r*Math.PI/180),a=6356725+21412*(90-t)/90;return[180*(o/(a*Math.cos(t*Math.PI/180))+e*Math.PI/180)/Math.PI,180*(n/a+t*Math.PI/180)/Math.PI]},e.prototype.GetPositionFromA_D=function(e,t,i){var r=this.toDegrees(e),o=this.GetDegreesFromA_D(r.lon,r.lat,t,i);return this._cesium.Cartesian3.fromDegrees(o[0],o[1],r.height)},e.prototype.getEntityTypeAndObject=function(e){var t={type:"",object:null};return e&&(e.billboard?(t.type="billboard",t.object=e.billboard):e.box?(t.type="box",t.object=e.box):e.corridor?(t.type="corridor",t.object=e.corridor):e.cylinder?(t.type="cylinder",t.object=e.cylinder):e.ellipse?(t.type="ellipse",t.object=e.ellipse):e.ellipsoid?(t.type="ellipsoid",t.object=e.ellipsoid):e.label?(t.type="label",t.object=e.label):e.model?(t.type="model",t.object=e.model):e.path?(t.type="path",t.object=e.path):e.plane?(t.type="plane",t.object=e.plane):e.point?(t.type="point",t.object=e.point):e.polygon?(t.type="polygon",t.object=e.polygon):e.polyline?(t.type="polyline",t.object=e.polyline):e.polylineVolume?(t.type="polylineVolume",t.object=e.polylineVolume):e.rectangle?(t.type="rectangle",t.object=e.rectangle):e.wall&&(t.type="wall",t.object=e.wall)),t},e.prototype.getSimpleGraphicData=function(s,c){var e,h=this,d=this._viewer;if(SmartEarthPopupData.editGraphic={entity:c,type:s,graphic:c[s],getValue:function(e){if("position"===e||"name"===e||"id"===e||"orientation"===e||"heading"===e||"pitch"===e||"roll"===e)return this.entity[e]&&(this.entity[e].getValue?this.entity[e].getValue():this.entity[e]);if("radius"===e){if("ellipse"===this.type)return this.graphic.semiMajorAxis.getValue();if("ellipsoid"===this.type)return this.graphic.radii.getValue().x;if("cylinder"===this.type)return this.graphic.bottomRadius.getValue()}else{if("pHeight"!==e)return"repeat"===e?this.graphic.material[e]&&(this.graphic.material[e].getValue?this.graphic.material[e].getValue():this.graphic.material[e]):this.graphic[e]&&(this.graphic[e].getValue?this.graphic[e].getValue():this.graphic[e]);if(this.getValue("position")){var t=this.getValue("position");return Cesium.Cartographic.fromCartesian(t).height}}},changeHeightPoint:function(o){0<oe.editPointID.height.length&&oe.editPointID.height.forEach(function(e){var t=d.entities.getById(e);if(t){var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}})},changeEditPoint:function(o){0<oe.editPointID.edit.length&&oe.editPointID.edit.forEach(function(e){var t=d.entities.getById(e);if(t)if("clampToGround"===o)t.point.heightReference=1;else{t.point.heightReference=0;var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}}),0<oe.editPointID.size.length&&oe.editPointID.size.forEach(function(e){var t=d.entities.getById(e);if(t)if("clampToGround"===o)t.point.heightReference=1;else{t.point.heightReference=0;var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}}),0<oe.editPointID.add.length&&oe.editPointID.add.forEach(function(e){var t=d.entities.getById(e);if(t)if("clampToGround"===o)t.point.heightReference=1;else{t.point.heightReference=0;var i=t.position.getValue(),r=h.toDegrees(i);t.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,o)}});var e=oe.editPointID.move;if(e)if("clampToGround"===o)e.point.heightReference=1;else{e.point.heightReference=0;var t=e.position.getValue(),i=h.toDegrees(t);e.position=Cesium.Cartesian3.fromDegrees(i.lon,i.lat,o)}},clearAllEditPoint:function(){oe.editPointID.edit.forEach(function(e){d.entities.removeById(e)}),oe.editPointID.edit=[],oe.editPointID.height.forEach(function(e){d.entities.removeById(e)}),oe.editPointID.height=[],oe.editPointID.add.forEach(function(e){d.entities.removeById(e)}),oe.editPointID.add=[],oe.editPointID.size.forEach(function(e){d.entities.removeById(e)}),oe.editPointID.size=[],oe.editPointID.move&&d.entities.remove(oe.editPointID.move),oe.editPointID.move=void 0}},"billboard"===s||"point"===s||"label"===s||"model"===s){var t=SmartEarthPopupData.editGraphic.getValue("color")||SmartEarthPopupData.editGraphic.getValue("fillColor");t?v(t):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var i=SmartEarthPopupData.editGraphic.getValue("outlineColor");if(i?_(i):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),"label"===s){var r=SmartEarthPopupData.editGraphic.getValue("backgroundColor");r?(e=r,SmartEarthPopupData.editGraphic.backgroundColor=y("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.backgroundAlpha=100*e.alpha):(SmartEarthPopupData.editGraphic.backgroundColor="#000000",SmartEarthPopupData.editGraphic.backgroundAlpha=80)}SmartEarthPopupData.editGraphic.setValue=function(e,t){var i=this;if("position"===e&&this.entity.offset){this.entity.oP=t;var r=Cesium.Transforms.eastNorthUpToFixedFrame(this.entity.oP),o=new Cesium.Cartesian3(0,0,0);Cesium.Matrix4.multiplyByPoint(r,this.entity.offset,o),t=o}else if("offset"===e){!this.entity.oP&&(this.entity.oP=this.getValue("position")),this.entity.offset=t;var n=Cesium.Transforms.eastNorthUpToFixedFrame(this.entity.oP),a=new Cesium.Cartesian3(0,0,0);Cesium.Matrix4.multiplyByPoint(n,this.entity.offset,a),t=a,e="position"}if("position"===e||"name"===e)this.entity[e]=t;else if("autoRotate"===e&&"model"===this.type)void 0===this.entity.heading&&(this.entity.heading=0,this.entity.pitch=0,this.entity.roll=0),"number"==typeof t?(this.entity.orientation=new Cesium.CallbackProperty(function(){return i.entity.heading+=t,360<i.entity.heading&&(i.entity.heading-=360),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]').value=i.entity.heading),Cesium.Transforms.headingPitchRollQuaternion(i.getValue("position"),new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(i.entity.heading),Cesium.Math.toRadians(i.entity.pitch),Cesium.Math.toRadians(i.entity.roll)))},!1),SmartEarthPopupData.window&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]').disabled=!0),SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]').disabled=!0),SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]').disabled=!0))):!1===t&&(this.entity.orientation=Cesium.Transforms.headingPitchRollQuaternion(this.getValue("position"),new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this.entity.heading),Cesium.Math.toRadians(this.entity.pitch),Cesium.Math.toRadians(this.entity.roll))),SmartEarthPopupData.window&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]').disabled=!1),SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]').disabled=!1),SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]').disabled=!1)));else if("heading"!==e&&"pitch"!==e&&"roll"!==e||"model"!==this.type){if("color"===e||"outlineColor"===e||"backgroundColor"===e||"fillColor"===e)t=Cesium.Color.fromCssColorString(t);else if("fontSize"===e){var s=this.getValue("font");(s=s.split(" "))[0]=t,t=s.join(" ")}else{if("alpha"===e)return void("label"===this.type?this.graphic.fillColor._value.alpha=t:this.graphic.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("backgroundAlpha"===e)return void(this.graphic.backgroundColor._value.alpha=t);if("pHeight"===e&&this.getValue("position")){var l=this.getValue("position"),u=Cesium.Cartographic.fromCartesian(l);return u.height=t,void(this.entity.position=Cesium.Cartographic.toCartesian(u))}}this.graphic[e]=t}else this.entity[e]=t,this.entity.orientation=Cesium.Transforms.headingPitchRollQuaternion(this.getValue("position"),new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this.entity.heading),Cesium.Math.toRadians(this.entity.pitch),Cesium.Math.toRadians(this.entity.roll)))}}else if("polyline"===s){var o=SmartEarthPopupData.editGraphic.getValue("material");o.color?v(o.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),o.outlineColor?_(o.outlineColor):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e)return t=Cesium.Color.fromCssColorString(t),void(this.graphic.material[e]=t);if("outlineWidth"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.material.outlineColor._value.alpha=t);if("positions"===e)return void(this.graphic[e]=new Cesium.CallbackProperty(function(){return t},!1));this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("positions");return this.entity.pottingPoint=e},SmartEarthPopupData.editGraphic.updataEditPoint=function(){var s=this;this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var l=new Cesium.Cartesian3;e.forEach(function(e,t){var i=d.entities.add({name:"edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:s.graphic.heightReference&&s.graphic.heightReference.getValue()}});if(oe.editPointID.edit.push(i.id),void 0!==s.getValue("extrudedHeight")){var r=Cesium.Cartographic.fromCartesian(e),o={lon:Cesium.Math.toDegrees(r.longitude),lat:Cesium.Math.toDegrees(r.latitude),height:s.getValue("extrudedHeight")};if(s.getValue("height")){var n=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,s.getValue("height"));e.x=n.x,e.y=n.y,e.z=n.z,i.position=n,s.entity.pottingPoint[t]=n.clone()}var a=d.entities.add({name:"height_point",position:Cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});oe.editPointID.height.push(a.id)}l.x+=e.x,l.y+=e.y,l.z+=e.z}),l.x/=e.length,l.y/=e.length,l.z/=e.length,oe.editPointID.move=d.entities.add({name:"move_point",position:l,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(var t=0;t<e.length-1;t++){var i=Cesium.Cartesian3.midpoint(e[t],e[t+1],new Cesium.Cartesian3),r=d.entities.add({name:"add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});oe.editPointID.add.push(r.id)}}}}else if("polygon"===s){var n=SmartEarthPopupData.editGraphic.getValue("material");n.color?v(n.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var a=SmartEarthPopupData.editGraphic.getValue("outlineColor");a?_(a):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,i){var t=this;if("name"===e)this.entity[e]=i;else{if("color"===e||"outlineColor"===e){if(i=Cesium.Color.fromCssColorString(i),"color"===e)return void(this.graphic.material.color=i)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=i);if("alpha"===e)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=i);if("positions"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(i)},!1));if("hierarchy"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return i},!1));if("clampToGround"===e){var r=function(e,t,i){i?(e.perPositionHeight=!1,e.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(e.perPositionHeight=!0,e.heightReference=Cesium.HeightReference.NONE),0<oe.editPointID.edit.length&&!i&&t.forEach(function(e,t){var i=d.entities.getById(oe.editPointID.edit[t]);if(i){var r=i.position.getValue();e.x=r.x,e.y=r.y,e.z=r.z}}),e.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(t)},!1)};return this.graphic.hierarchy instanceof Cesium.CallbackProperty?(this.graphic.hierarchy=this.graphic.hierarchy.getValue(),setTimeout(function(){r(t.graphic,t.entity.pottingPoint,i)},100)):r(this.graphic,this.entity.pottingPoint,i),void(0<oe.editPointID.add.length&&oe.editPointID.add.forEach(function(e){var t=d.entities.getById(e);t&&(t.point.heightReference=i?1:0)}))}"extrudedHeight"===e?this.changeHeightPoint(i):"height"===e&&this.changeEditPoint(i)}this.graphic[e]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("hierarchy").positions.concat([]);if(void 0!==this.getValue("height")){var r=this.getValue("height");e.forEach(function(e){var t=h.toDegrees(e),i=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,r);e.x=i.x,e.y=i.y,e.z=i.z})}return this.entity.pottingPoint=e},SmartEarthPopupData.editGraphic.updataEditPoint=function(){var s=this;this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var l=new Cesium.Cartesian3;e.forEach(function(e,t){var i=d.entities.add({name:"edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:s.graphic.heightReference&&s.graphic.heightReference.getValue()}});if(oe.editPointID.edit.push(i.id),void 0!==s.getValue("extrudedHeight")){var r=Cesium.Cartographic.fromCartesian(e),o={lon:Cesium.Math.toDegrees(r.longitude),lat:Cesium.Math.toDegrees(r.latitude),height:s.getValue("extrudedHeight")};if(s.getValue("height")){var n=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,s.getValue("height"));e.x=n.x,e.y=n.y,e.z=n.z,i.position=n,s.entity.pottingPoint[t]=n.clone()}var a=d.entities.add({name:"height_point",position:Cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});oe.editPointID.height.push(a.id)}l.x+=e.x,l.y+=e.y,l.z+=e.z}),l.x/=e.length,l.y/=e.length,l.z/=e.length,oe.editPointID.move=d.entities.add({name:"move_point",position:l,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(var t=0;t<e.length-1;t++){var i=Cesium.Cartesian3.midpoint(e[t],e[t+1],new Cesium.Cartesian3),r=d.entities.add({name:"add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});oe.editPointID.add.push(r.id)}var o=Cesium.Cartesian3.midpoint(e[0],e[e.length-1],new Cesium.Cartesian3),n=d.entities.add({name:"add_point",position:o,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});oe.editPointID.add.push(n.id)}}}else if("ellipse"===s||"cylinder"===s||c.isSphere){var l=SmartEarthPopupData.editGraphic.getValue("material");l.color?v(l.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var u=SmartEarthPopupData.editGraphic.getValue("outlineColor");u?_(u):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){var i=this;if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("semiMajorAxis"===e)return void(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return t},!1));if("semiMinorAxis"===e)return void(this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return t},!1));if("radii"===e)return void(this.graphic.radii=new Cesium.CallbackProperty(function(){return t},!1));if("topRadius"===e)return void(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return t},!1));if("bottomRadius"===e)return void(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return t},!1));if("radius"===e){"ellipse"===this.type?(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return t},!1),this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return t},!1)):"ellipsoid"===this.type?null!==this.graphic.material.image.getValue()?this.graphic.radii=new Cesium.Cartesian3(t,t,t):this.graphic.radii=new Cesium.CallbackProperty(function(){return new Cesium.Cartesian3(t,t,t)},!1):"cylinder"===this.type&&(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return t},!1),this.entity.changeTop&&(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return t},!1)));var r=oe.editPointID.move.position.getValue(),o=h.GetPositionFromA_D(r,t,90);d.entities.getById(oe.editPointID.size[0]).position=o,c.pottingPoint[0]=o,c.pottingPoint[c.pottingPoint.length-1]=r;var n=d.entities.getById(oe.editPointID.height[0]);if(n){var a=h.toDegrees(o),s=h._cesium.Cartographic.fromCartesian(n.position.getValue());n.position=h._cesium.Cartesian3.fromDegrees(a.lon,a.lat,s.height)}return}if("cylinder"===this.type&&"length"===e){this.graphic.length=t;var l=h.toDegrees(this.entity.pottingPoint[1]);return this.entity.position=Cesium.Cartesian3.fromDegrees(l.lon,l.lat,l.height+t/2),void this.changeHeightPoint(l.height+t)}if("ellipse"===this.type&&"clampToGround"===e){var u=function(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);var r=t.semiMinorAxis.getValue();t.semiMinorAxis=new Cesium.CallbackProperty(function(){return r},!1),t.semiMajorAxis=new Cesium.CallbackProperty(function(){return r},!1)};return this.graphic.semiMinorAxis instanceof Cesium.CallbackProperty?(this.graphic.semiMinorAxis=this.graphic.semiMinorAxis.getValue(),this.graphic.semiMajorAxis=this.graphic.semiMajorAxis.getValue(),setTimeout(function(){u(i.entity,i.graphic,t)},100)):u(this.entity,this.graphic,t),void(t?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight))}"ellipse"===this.type&&"extrudedHeight"===e?this.changeHeightPoint(t):"ellipse"===this.type&&"height"===e&&(this.changeEditPoint(t),this.entity.thisHeight=t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("radius"),t=this.getValue("position");if("ellipse"===this.type||this.entity.isSphere){if("ellipse"===this.type&&void 0!==this.getValue("height")){var i=this.getValue("height"),r=h.toDegrees(t);t=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,i)}var o=h.GetPositionFromA_D(t,e,90);return this.entity.pottingPoint=[o,t],[o,t]}var n=h.toDegrees(t);t=Cesium.Cartesian3.fromDegrees(n.lon,n.lat,n.height-this.getValue("length")/2);var a=h.GetPositionFromA_D(t,e,90);return this.entity.pottingPoint=[a,t],[a,t]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var t=d.entities.add({name:"size_point",position:e[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});if(t.angle=90,oe.editPointID.size.push(t.id),void 0!==this.getValue("extrudedHeight")){var i=h.toDegrees(e[1]);i.height=this.getValue("extrudedHeight");var r=d.entities.add({name:"height_point",position:Cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});oe.editPointID.height.push(r.id)}else if("cylinder"===s){var o=h.toDegrees(e[1]),n=this.getValue("length"),a=d.entities.add({name:"height_point",position:Cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height+n),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});oe.editPointID.height.push(void 0,a.id)}oe.editPointID.move=d.entities.add({name:"move_point",position:e[1],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}}else if("rectangle"===s){var m=SmartEarthPopupData.editGraphic.getValue("material");m.color?v(m.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var p=SmartEarthPopupData.editGraphic.getValue("outlineColor");p?_(p):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){var i=this;if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("positions"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return Cesium.Rectangle.fromCartesianArray(t)},!1));if("coordinates"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return t},!1));if("clampToGround"===e){var r=function(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);var r=t.coordinates.getValue();t.coordinates=new Cesium.CallbackProperty(function(){return r},!1)};return this.graphic.coordinates instanceof Cesium.CallbackProperty?(this.graphic.coordinates=this.graphic.coordinates.getValue(),setTimeout(function(){r(i.entity,i.graphic,t)},100)):r(this.entity,this.graphic,t),void(t?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight))}"extrudedHeight"===e?this.changeHeightPoint(t):"height"===e&&(this.changeEditPoint(t),this.entity.thisHeight=t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("coordinates"),t=void 0,i=void 0,r=this.getValue("height");return i=(void 0!==r?t=Cesium.Cartesian3.fromRadians(e.west,e.north,r):(r=d.scene.sampleHeight(new Cesium.Cartographic(e.west,e.north,0),[this.entity]),t=Cesium.Cartesian3.fromRadians(e.west,e.north,r),r=d.scene.sampleHeight(new Cesium.Cartographic(e.east,e.south,0),[this.entity])),Cesium.Cartesian3.fromRadians(e.east,e.south,r)),this.entity.pottingPoint=[t,i],[t,i]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){var s=this;this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var l=new Cesium.Cartesian3;e.forEach(function(e,t){var i=d.entities.add({name:"edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:s.graphic.heightReference&&s.graphic.heightReference.getValue()}});if(oe.editPointID.edit.push(i.id),void 0!==s.getValue("extrudedHeight")){var r=Cesium.Cartographic.fromCartesian(e),o={lon:Cesium.Math.toDegrees(r.longitude),lat:Cesium.Math.toDegrees(r.latitude),height:s.getValue("extrudedHeight")};if(s.getValue("height")){var n=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,s.getValue("height"));e.x=n.x,e.y=n.y,e.z=n.z,i.position=n,s.entity.pottingPoint[t]=n.clone()}var a=d.entities.add({name:"height_point",position:Cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});oe.editPointID.height.push(a.id)}l.x+=e.x,l.y+=e.y,l.z+=e.z}),l.x/=e.length,l.y/=e.length,l.z/=e.length,oe.editPointID.move=d.entities.add({name:"move_point",position:l,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}}else if("box"===s){var g=SmartEarthPopupData.editGraphic.getValue("material");g.color?v(g.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);var f=SmartEarthPopupData.editGraphic.getValue("outlineColor");f?_(f):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("long"===e||"width"===e||"height"===e){var i=this.getValue("dimensions");if("long"===e?i.x=t:"width"===e?i.y=t:i.z=t,this.graphic.dimensions=new Cesium.CallbackProperty(function(){return i},!1),"long"===e||"width"===e){var r="long"===e?90:180,o="long"===e?0:1,n=oe.editPointID.move.position.getValue(),a=h.GetPositionFromA_D(n,t/2,r);d.entities.getById(oe.editPointID.size[o]).position=a,this.entity.pottingPoint[o]=a,this.entity.pottingPoint[this.entity.pottingPoint.length-1]=n}else{var s=h.toDegrees(oe.editPointID.move.position.getValue());this.entity.position=Cesium.Cartesian3.fromDegrees(s.lon,s.lat,s.height+t/2),this.changeHeightPoint(s.height+t)}return}if("dimensions"===e)return void(this.graphic.dimensions=new Cesium.CallbackProperty(function(){return t},!1))}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("dimensions"),t=this.getValue("position"),i=h.toDegrees(t);t=Cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height-e.z/2);var r=h.GetPositionFromA_D(t,e.x/2,90),o=h.GetPositionFromA_D(t,e.y/2,180);return this.entity.pottingPoint=[r,o,t],[r,o,t]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var e=this.getPottingPoint();if(e){var t=d.entities.add({name:"size_point",position:e[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});t.angle=90;var i=d.entities.add({name:"size_point",position:e[1],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});i.angle=180,oe.editPointID.size.push(t.id),oe.editPointID.size.push(i.id);var r=h.toDegrees(e[2]),o=this.getValue("dimensions"),n=d.entities.add({name:"height_point",position:Cesium.Cartesian3.fromDegrees(r.lon,r.lat,r.height+o.z),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});oe.editPointID.height.push(void 0,void 0,n.id),oe.editPointID.move=d.entities.add({name:"move_point",position:e[2],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}}else"corridor"===s||"ellipsoid"===s&&c.isSphere;function v(e){SmartEarthPopupData.editGraphic.fillColor=y("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.alpha=100*e.alpha}function _(e){SmartEarthPopupData.editGraphic.outlineColor=y("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.outlineAlpha=100*e.alpha}function y(e){var t=e;if(/^(rgb|RGB)/.test(t)){for(var i=t.replace(/(rgb|RGB)*/g,""),r=(i=i.replace("(","").replace(")","")).split(","),o="#",n=0;n<r.length;n++){var a=Number(r[n]).toString(16);"0"===(a=1===a.length?"0"+a:a)&&(a+=a),o+=a}return 7!==o.length&&(o=t),o}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t))return t;var s=t.replace(/#/,"").split("");if(6===s.length)return t;if(3===s.length){for(var l="#",u=0;u<s.length;u+=1)l+=s[u]+s[u];return l}}},e.prototype.getStyle=function(t){var e=void 0,i=void 0;i=this.getEntityTypeAndObject(t).type;var r=o("distanceDisplayCondition");function o(e){return"position"===e||"name"===e||"id"===e?t[e]&&(t[e].getValue?t[e].getValue():t[e]):"radius"!==e?"repeat"===e?t[i].material[e]&&(t[i].material[e].getValue?t[i].material[e].getValue():t[i].material[e]):t[i][e]&&(t[i][e].getValue?t[i][e].getValue():t[i][e]):"ellipse"===i?t[i].semiMajorAxis.getValue():"ellipsoid"===i?t[i].radii.getValue().x:"cylinder"===i?t[i].bottomRadius.getValue():void 0}return"point"===i?e={id:o("id"),name:o("name"),position:o("position"),pixelSize:o("pixelSize"),scaleByDistance:o("scaleByDistance"),color:o("color")&&o("color").toCssColorString(),outlineWidth:o("outlineWidth"),outlineColor:o("outlineColor")&&o("outlineColor").toCssColorString(),heightReference:o("heightReference"),distanceDisplayCondition:r&&{near:r.near,far:r.far}}:"billboard"===i?e={id:o("id"),name:o("name"),position:o("position"),image:o("image"),scale:o("scale"),scaleByDistance:o("scaleByDistance"),rotation:o("rotation"),width:o("width"),height:o("height"),color:o("color")&&o("color").toCssColorString(),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),heightReference:o("heightReference"),distanceDisplayCondition:r&&{near:r.near,far:r.far}}:"label"===i?e={id:o("id"),name:o("name"),position:o("position"),text:o("text"),font:o("font"),style:o("style"),scale:o("scale"),scaleByDistance:o("scaleByDistance"),fillColor:o("fillColor")&&o("fillColor").toCssColorString(),outlineColor:o("outlineColor")&&o("outlineColor").toCssColorString(),outlineWidth:o("outlineWidth"),showBackground:o("showBackground"),backgroundColor:o("backgroundColor")&&o("backgroundColor").toCssColorString(),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),heightReference:o("heightReference"),distanceDisplayCondition:r&&{near:r.near,far:r.far}}:"model"===i?e={id:o("id"),name:o("name"),position:o("position"),url:o("uri"),minimumPixelSize:o("minimumPixelSize"),runAnimations:o("runAnimations"),scale:o("scale"),color:o("color")&&o("color").toCssColorString(),heightReference:o("heightReference"),distanceDisplayCondition:r&&{near:r.near,far:r.far}}:"polyline"===i?e={id:o("id"),name:o("name"),positions:o("positions"),clampToGround:o("clampToGround"),color:o("material")&&o("material").color.toCssColorString(),outlineWidth:o("material")&&o("material").outlineWidth,outlineColor:o("material")&&o("material").outlineColor.toCssColorString(),width:o("width"),distanceDisplayCondition:r&&{near:r.near,far:r.far}}:"polylineVolume"===i||"corridor"===i||"wall"===i||"path"===i||"plane"===i||("polygon"===i?e={id:o("id"),name:o("name"),positions:o("hierarchy").positions,color:o("material")&&o("material").color.toCssColorString(),image:o("material")&&o("material").image,repeat:o("material")&&o("material").repeat,outlineColor:o("outlineColor")&&o("outlineColor").toCssColorString(),outline:o("outline"),perPositionHeight:o("perPositionHeight"),height:o("height"),extrudedHeight:o("extrudedHeight"),distanceDisplayCondition:r&&{near:r.near,far:r.far}}:"ellipse"===i?(e={id:o("id"),name:o("name"),position:o("position"),radius:o("radius"),semiMajorAxis:o("semiMajorAxis"),semiMinorAxis:o("semiMinorAxis"),color:o("material")&&o("material").color.toCssColorString(),image:o("material")&&o("material").image,repeat:o("material")&&o("material").repeat,outlineColor:o("outlineColor")&&o("outlineColor").toCssColorString(),outline:o("outline"),height:o("height"),heightReference:o("heightReference"),distanceDisplayCondition:r&&{near:r.near,far:r.far}},i="circle"):"rectangle"===i?e={id:o("id"),name:o("name"),coordinates:o("coordinates"),color:o("material")&&o("material").color.toCssColorString(),image:o("material")&&o("material").image,repeat:o("material")&&o("material").repeat,outlineColor:o("outlineColor")&&o("outlineColor").toCssColorString(),outline:o("outline"),height:o("height"),rotation:o("rotation"),heightReference:o("heightReference"),distanceDisplayCondition:r&&{near:r.near,far:r.far}}:"box"===i?e={id:o("id"),name:o("name"),position:o("position"),dimensions:o("dimensions"),color:o("material")&&o("material").color.toCssColorString(),image:o("material")&&o("material").image,repeat:o("material")&&o("material").repeat,outlineColor:o("outlineColor")&&o("outlineColor").toCssColorString(),outline:o("outline"),distanceDisplayCondition:r&&{near:r.near,far:r.far}}:"cylinder"===i?e={id:o("id"),name:o("name"),position:o("position"),radius:o("radius"),topRadius:o("topRadius"),bottomRadius:o("bottomRadius"),length:o("length"),color:o("material")&&o("material").color.toCssColorString(),image:o("material")&&o("material").image,repeat:o("material")&&o("material").repeat,outlineColor:o("outlineColor")&&o("outlineColor").toCssColorString(),outline:o("outline"),distanceDisplayCondition:r&&{near:r.near,far:r.far},changeTop:t.changeTop}:"ellipsoid"===i&&(e={id:o("id"),name:o("name"),position:o("position"),radius:o("radius"),radii:o("radii"),color:o("material")&&o("material").color.toCssColorString(),image:o("material")&&o("material").image,repeat:o("material")&&o("material").repeat,outlineColor:o("outlineColor")&&o("outlineColor").toCssColorString(),outline:o("outline"),distanceDisplayCondition:r&&{near:r.near,far:r.far},isSphere:t.isSphere})),e.type=i,e},e.prototype.addFeatures=function(e){var i=this,r=new i._cesium.EntityCollection;return e.forEach(function(e){if("polygon"===e.type&&void 0!==e.style.extrudedHeight?e.type:"cylinder"!==e.type||e.styles.changeTop||e.type,e.style&&e.style.id&&-1<i.SimpleGraphicObj.indexOf(e.style.id));else{var t=i.addSimpleGraphic(e.type,e.style);i.SimpleGraphicObj.push(t.id),r.add(t)}}),r},e.prototype.open=function(e,i){var r=this,o=this._viewer,t=new FileReader;t.readAsText(e),t.onload=function(){var e=JSON.parse(this.result).features,t=r.addFeatures(e);o.flyTo(t),i&&"function"==typeof i&&i(t)}},e.prototype.remove=function(e){var t=this._viewer,i=this.SimpleGraphicObj.indexOf(e);-1<i&&(t.entities.removeById(e),this.SimpleGraphicObj.splice(i,1),SmartEarthPopupData&&SmartEarthPopupData.editGraphic&&SmartEarthPopupData.editGraphic.getValue&&SmartEarthPopupData.editGraphic.getValue("id")===e&&(oe.editPointID.edit.forEach(function(e){t.entities.removeById(e)}),oe.editPointID.edit=[],oe.editPointID.height.forEach(function(e){t.entities.removeById(e)}),oe.editPointID.height=[],oe.editPointID.add.forEach(function(e){t.entities.removeById(e)}),oe.editPointID.add=[],oe.editPointID.size.forEach(function(e){t.entities.removeById(e)}),oe.editPointID.size=[],oe.editPointID.move&&t.entities.remove(oe.editPointID.move),oe.editPointID.move=void 0,window.layuiLayer.close(SmartEarthPopupData.layerIndex),SmartEarthPopupData.editGraphic={})),!this.SimpleGraphicObj.length&&this.editHandler&&this.edit(!1)},e.prototype.clear=function(){var t=this._viewer;this.SimpleGraphicObj.forEach(function(e){t.entities.removeById(e)}),this.SimpleGraphicObj=[],oe.editPointID.edit.forEach(function(e){t.entities.removeById(e)}),oe.editPointID.edit=[],oe.editPointID.height.forEach(function(e){t.entities.removeById(e)}),oe.editPointID.height=[],oe.editPointID.add.forEach(function(e){t.entities.removeById(e)}),oe.editPointID.add=[],oe.editPointID.size.forEach(function(e){t.entities.removeById(e)}),oe.editPointID.size=[],oe.editPointID.move&&t.entities.remove(oe.editPointID.move),oe.editPointID.move=void 0,window.layuiLayer.close(SmartEarthPopupData.layerIndex),SmartEarthPopupData.editGraphic={},!this.SimpleGraphicObj.length&&this.editHandler&&this.edit(!1)},e.prototype.save=function(e){var r=this._viewer,o={type:"FeatureCollection",features:[]},n=void 0,a=this;this.SimpleGraphicObj.forEach(function(e){var t=r.entities.getById(e);if(t){var i=a.getStyle(t);n={id:t.id,name:t.name,type:i.type,style:i}}o.features.push(n)});var t=JSON.stringify(o),i=new Blob([t],{type:"text/plain;charset=utf-8"});saveAs(i,e?e+".json":"标绘.json")},e.prototype.setRichtext=function(e,t){var i=this._core.getuid(),r=e.position.getValue(),o="0";if(e.treeobj&&(oe.delete(e.treeobj.id,this._viewer,this._cesium),o=e.treeobj.pId),this._viewer.entities.removeById(e.id),!this.pointPrimitive){var n,a,s;this.pointPrimitive=new this._cesium.PointPrimitiveCollection;var l=this;this._viewer.scene.preRender.addEventListener(function(){for(var e,t,i=0;i<l.pointPrimitive.length;i++){if(e=l.pointPrimitive.get(i),s=e.position,!(a=l._viewer.scene.cartesianToCanvasCoordinates(s)))return;n=document.getElementById(e.id),e.name||(e.name="泰瑞"),n||(n=(t=e.description?'<div id="'+e.id+'" style="position: absolute; width: 200px; height: 157px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+h.divpoint+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)"></div>\n <div class="content" style="position: inherit;font-size: 14px;top: 50px;left: 50px;width: 140px;text-align: left;color: rgba(255,255,255,1);">'+e.description+"</div> \n </div>":'<div id="'+e.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+h.divpoint1+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">'+e.name+"</div>\n </div>",$(".cesium-viewer").append(t),document.getElementById(e.id))),e.description?n.style.transform="matrix(1, 0, 0, 1, "+a.x+", "+(a.y-157)+")":n.style.transform="matrix(1, 0, 0, 1, "+a.x+", "+(a.y-134)+")",n&&(n.style.display=e.show?"block":"none")}})}var u=this.pointPrimitive.add({id:"DivPoint"+i,position:r,color:this._cesium.Color.YELLOW});u.name=e.name,u.description=t;var c={id:u.id,name:e.name,pId:o,type:"Point",item:this};return oe.insertGroupId(c,this._core.isnull(o)?0:o),this},e.prototype.setVisibility=function(e,t){if(this.pointPrimitive)for(var i,r=0;r<this.pointPrimitive.length;r++)if((i=this.pointPrimitive.get(r))&&i.id===t){i.show=e;break}},e.prototype.deleteObject=function(e){if(this.pointPrimitive)for(var t,i=0;i<this.pointPrimitive.length;i++)if((t=this.pointPrimitive.get(i))&&t.id===e){this.pointPrimitive.remove(t);var r=document.getElementById(e);r&&r.remove();break}},e.prototype.forceEndHanlder=function(){if(this.editHandler)try{this.editHandler.destroy(),this.editHandler=void 0}catch(e){}if(this.drawHandler)try{this.drawHandler.destroy(),this.drawHandler=void 0}catch(e){}},e}),define("SGWorld/Creator/SatelliteTrail",["../Core/Core","../configData"],function(i,c){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this.TrailEntitys=[]}function m(e){this.lon=0,this.lat=0,this.hei=e,this.phei=e/2,this.time=0}return e.prototype.createSatelliteTrail=function(t){var i=this;!t&&(t={});var e=this._viewer,r=new Cesium.JulianDate.fromDate(new Date),o=Cesium.JulianDate.addSeconds(r,3600,new Cesium.JulianDate);e.clock.startTime=t.start||r.clone(),e.clock.stopTime=t.stop||o.clone(),e.clock.currentTime=t.start||r.clone(),e.clock.clockRange=Cesium.ClockRange.LOOP_STOP,e.clock.multiplier=t.speed||2,this.flyHeight=t.height||7e5;var n=[];return t.path?n=t.path:this.getRandState(n,2),n.forEach(function(e){i.getStatePath(e,t)}),this},e.prototype.getStatePath=function(e,t){var i=this._viewer,r=i.clock.startTime.clone(),o=i.clock.stopTime.clone(),n=this.computeCirclularFlight(e,2),a=i.entities.add({availability:new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({start:r,stop:o})]),position:n,orientation:new Cesium.VelocityOrientationProperty(n),cylinder:{HeightReference:Cesium.HeightReference.CLAMP_TO_GROUND,length:this.flyHeight,topRadius:0,bottomRadius:this.flyHeight/2,material:this._core.getConeRadarMaterial(t.radarColor||"#00ff00"),outline:!1,numberOfVerticalLines:0}});a.position.setInterpolationOptions({interpolationDegree:5,interpolationAlgorithm:Cesium.LagrangePolynomialApproximation}),this.TrailEntitys.push(a);var s=this.computeCirclularFlight(e,1),l={availability:new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({start:r,stop:o})]),position:s,orientation:new Cesium.VelocityOrientationProperty(s),path:{resolution:1,material:new Cesium.PolylineGlowMaterialProperty({color:Cesium.Color.DEEPSKYBLUE}),width:t.width||5}};t.img?"object"===_typeof2(t.img)?l.billboard=t.img:"string"==typeof t.img&&(l.billboard={image:t.img,scale:t.scale}):l.model={uri:t.model||c.flyModel,minimumPixelSize:32,scale:t.scale};var u=i.entities.add(l);u.position.setInterpolationOptions({interpolationDegree:5,interpolationAlgorithm:Cesium.LagrangePolynomialApproximation}),this.TrailEntitys.push(u)},e.prototype.clear=function(){var t=this;this.TrailEntitys.forEach(function(e){t._viewer.entities.remove(e)}),this.TrailEntitys=[]},e.prototype.faster=function(){this._viewer.animation.viewModel.faster()},e.prototype.slower=function(){this._viewer.animation.viewModel.slower()},e.prototype.setSpeed=function(e){this._viewer.clock.multiplier=parseFloat(e)},e.prototype.isPause=function(e){this._viewer.clockViewModel.shouldAnimate=!e},e.prototype.computeCirclularFlight=function(e,t){var i=this._viewer.clock.startTime.clone(),r=new Cesium.SampledPositionProperty;if(1==t)for(var o=0;o<e.length;o++){var n=Cesium.JulianDate.addSeconds(i,e[o].time,new Cesium.JulianDate),a=Cesium.Cartesian3.fromDegrees(e[o].lon,e[o].lat,e[o].hei);r.addSample(n,a)}else if(2==t)for(var s=0;s<e.length;s++){var l=Cesium.JulianDate.addSeconds(i,e[s].time,new Cesium.JulianDate),u=Cesium.Cartesian3.fromDegrees(e[s].lon,e[s].lat,e[s].phei);r.addSample(l,u)}return r},e.prototype.getRandState=function(e,t){for(var i=this.flyHeight,r=0;r<t;r++){for(var o=[],n=Math.floor(180*Math.random()),a=0;a<=360;a+=30){var s=new m(i);a<=180?(s.lon=n,s.lat=a-90):(s.lon=n-180,s.lat=270-a),s.time=10*a,o.push(s)}e.push(o)}for(var l=0;l<t;l++){for(var u=[],c=Math.floor(180*Math.random())-90,h=-180;h<=180;h+=30){var d=new m(i);d.lon=h,d.lat=c,d.time=10*(h+180),u.push(d)}e.push(u)}},e}),define("SGWorld/Creator/ViewCone",["../configData","../Core/Core","../ProjectTree/treeSource","../Navigate/getPosition"],function(e,i,f,r){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=f,this._getPosition=new r(this._viewer,this._cesium),this.tooltip=this._core.CreateTooltip()}return t.prototype.createViewCone=function(h,d){!h&&(h={}),h=this._core.extend({roll:0,fov:60,near:1,fillColor:"rgba(0,255,0,0.1)",outlineColor:"rgba(0,255,0,1)"},h,!0),this._option=h,this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+e.draw);var m=this,p=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(p.scene.canvas),f.states=1;var g=[];return this.drawHandler.setInputAction(function(e){var t=m._getPosition.getMousePosition(e);if(t&&(0===g.length?g.push(t,t):(m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),setTimeout(function(){f.states=0},100),m._core.mouse(m._viewer.container,0,"0"),d&&"function"==typeof d&&d(m.item)),!m.item)){m.viewConeCamera=new Cesium.Camera(p.scene);var i=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(g[1],g[0],new Cesium.Cartesian3),new Cesium.Cartesian3);m.viewConeCamera.position=g[0],m.viewConeCamera.direction=i,m.viewConeCamera.frustum.fov=Cesium.Math.toRadians(h.fov),m.viewConeCamera.frustum.near=h.near,m.viewConeCamera.frustum.far=1;var r=new Cesium.Cartesian3,o=new Cesium.Matrix3,n=new Cesium.Quaternion,a=m.viewConeCamera.positionWC,s=m.viewConeCamera.upWC,l=m.viewConeCamera.rightWC;l=Cesium.Cartesian3.negate(l,r);var u=o;Cesium.Matrix3.setColumn(u,0,l,u),Cesium.Matrix3.setColumn(u,1,s,u),Cesium.Matrix3.setColumn(u,2,i,u);var c=Cesium.Quaternion.fromRotationMatrix(u,n);h.fill&&(m._planesPrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumGeometry({origin:a,orientation:c,frustum:m.viewConeCamera.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(h.fillColor))},id:h.id}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,flat:!0}),asynchronous:!1,allowPicking:!1})),m._outlinePrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({origin:a,orientation:c,frustum:m.viewConeCamera.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(h.outlineColor))},id:h.id}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,allowPicking:!1}),m.item=new Cesium.PrimitiveCollection,m._viewer.scene.primitives.add(m.item),m._outlinePrimitive&&m.item.add(m._outlinePrimitive),m._planesPrimitive&&m.item.add(m._planesPrimitive)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){if(0<g.length){m.tooltip.showAt(e.endPosition,"再次点击结束绘制");var t=m._getPosition.getMousePosition(e);t&&(g[1]=t,m.viewConeCamera.direction=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(g[1],g[0],new Cesium.Cartesian3),new Cesium.Cartesian3),m.updata({heading:Cesium.Math.toDegrees(m.viewConeCamera.heading),pitch:Cesium.Math.toDegrees(m.viewConeCamera.pitch),far:m._core.getSpaceDistancem(g,Cesium)}))}else m.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},t.prototype.addViewCone=function(e){var t={position:this._viewer.camera.position.clone(),heading:0,pitch:0,roll:0,fov:60,near:1,far:60,fillColor:"rgba(0,255,0,0.1)",outlineColor:"rgba(0,255,0,1)"};!e&&(e={}),e.position&&e.position.lon&&(e.position=Cesium.Cartesian3.fromDegrees(e.position.lon,e.position.lat,e.position.height)),e=this._core.extend(t,e,!0),this.viewConeCamera=new Cesium.Camera(this._viewer.scene),this.viewConeCamera.setView({destination:e.position,orientation:{heading:Cesium.Math.toRadians(e.heading),pitch:Cesium.Math.toRadians(e.pitch),roll:Cesium.Math.toRadians(e.roll)}}),this.viewConeCamera.frustum.fov=Cesium.Math.toRadians(e.fov),this.viewConeCamera.frustum.near=e.near,this.viewConeCamera.frustum.far=e.far;var i=new Cesium.Cartesian3,r=new Cesium.Matrix3,o=new Cesium.Quaternion,n=this.viewConeCamera.positionWC,a=this.viewConeCamera.directionWC,s=this.viewConeCamera.upWC,l=this.viewConeCamera.rightWC;l=Cesium.Cartesian3.negate(l,i);var u=r;Cesium.Matrix3.setColumn(u,0,l,u),Cesium.Matrix3.setColumn(u,1,s,u),Cesium.Matrix3.setColumn(u,2,a,u);var c=Cesium.Quaternion.fromRotationMatrix(u,o);return e.fill&&(this._planesPrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumGeometry({origin:n,orientation:c,frustum:this.viewConeCamera.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e.fillColor))},id:e.id}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,flat:!0}),asynchronous:!1,allowPicking:!1})),this._outlinePrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({origin:n,orientation:c,frustum:this.viewConeCamera.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e.outlineColor))},id:e.id}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,allowPicking:!1}),this._option=e,this.item=new Cesium.PrimitiveCollection,this._viewer.scene.primitives.add(this.item),this._outlinePrimitive&&this.item.add(this._outlinePrimitive),this._planesPrimitive&&this.item.add(this._planesPrimitive),this},t.prototype.updata=function(e){!e&&(e={}),e.position&&e.position.lon&&(e.position=Cesium.Cartesian3.fromDegrees(e.position.lon,e.position.lat,e.position.height)),e=this._core.extend(this._option,e,!0),this._outlinePrimitive&&this._outlinePrimitive.destroy(),this._planesPrimitive&&this._planesPrimitive.destroy(),this.item.removeAll(),this.viewConeCamera.setView({destination:e.position,orientation:{heading:Cesium.Math.toRadians(e.heading),pitch:Cesium.Math.toRadians(e.pitch),roll:Cesium.Math.toRadians(e.roll)}}),this.viewConeCamera.frustum.fov=Cesium.Math.toRadians(e.fov),this.viewConeCamera.frustum.near=e.near,this.viewConeCamera.frustum.far=e.far;var t=new Cesium.Cartesian3,i=new Cesium.Matrix3,r=new Cesium.Quaternion,o=this.viewConeCamera.positionWC,n=this.viewConeCamera.directionWC,a=this.viewConeCamera.upWC,s=this.viewConeCamera.rightWC;s=Cesium.Cartesian3.negate(s,t);var l=i;Cesium.Matrix3.setColumn(l,0,s,l),Cesium.Matrix3.setColumn(l,1,a,l),Cesium.Matrix3.setColumn(l,2,n,l);var u=Cesium.Quaternion.fromRotationMatrix(l,r);e.fill&&(this._planesPrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumGeometry({origin:o,orientation:u,frustum:this.viewConeCamera.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e.fillColor))},id:e.id}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,flat:!0}),asynchronous:!1,allowPicking:!1})),this._outlinePrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({origin:o,orientation:u,frustum:this.viewConeCamera.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e.outlineColor))},id:e.id}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,allowPicking:!1}),this._option=e,this.item.add(this._outlinePrimitive),this._planesPrimitive&&this.item.add(this._planesPrimitive)},t.prototype.destroy=function(){return this._outlinePrimitive&&this._outlinePrimitive.destroy(),this._planesPrimitive&&this._planesPrimitive.destroy(),this.item&&this._viewer.scene.primitives.removeAndDestroy(this.item),Cesium.destroyObject(this)},t}),define("SGWorld/S3MTiles/Enum/ContentState",[],function(){"use strict";return Object.freeze({UNLOADED:0,LOADING:1,PARSING:2,READY:3,FAILED:4})}),define("SGWorld/S3MTiles/Enum/S3MPixelFormat",[],function(){"use strict";return Object.freeze({LUMINANCE_8:1,LUMINANCE_16:2,ALPHA:3,ALPHA_4_LUMINANCE_4:4,LUMINANCE_ALPHA:5,RGB_565:6,BGR565:7,RGB:10,BGR:11,ARGB:12,ABGR:13,BGRA:14,WEBP:25,RGBA:28,DXT1:17,DXT2:18,DXT3:19,DXT4:20,DXT5:21})}),define("SGWorld/S3MTiles/Enum/S3MCompressType",[],function(){"use strict";return Object.freeze({encNONE:0,enrS3TCDXTN:14,enrPVRTPF_PVRTC2:19,enrPVRTPF_PVRTC:20,enrPVRTPF_PVRTC_4bpp:21,enrPVRTPF_ETC1:22})}),define("SGWorld/S3MTiles/Enum/VertexCompressOption",[],function(){"use strict";return Object.freeze({SVC_Vertex:1,SVC_Normal:2,SVC_VertexColor:4,SVC_SecondColor:8,SVC_TexutreCoord:16,SVC_TexutreCoordIsW:32})}),define("SGWorld/S3MTiles/S3ModelParser",["./Enum/S3MPixelFormat","./Enum/S3MCompressType","./Enum/VertexCompressOption","../pako_inflate"],function(e,t,n,s){"use strict";function i(){}var g=1,f=2;function y(e,t,i){var r=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var o=new Uint8Array(e,i,r);return{string:Cesium.getStringFromTypedArray(o),bytesOffset:i+=r}}function m(e,t,i,r){for(var o={},n=[],a=new Array(16),s=0;s<16;s++)a[s]=t.getFloat64(i,!0),i+=Float64Array.BYTES_PER_ELEMENT;o.matrix=a,o.skeletonNames=n;var l=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var u=0;u<l;u++){var c=y(e,t,i);n.push(c.string),i=c.bytesOffset}return r.push(o),i}function u(e,t,i,r){var o={};o.rangeList=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,o.rangeMode=t.getUint16(i,!0),i+=Uint16Array.BYTES_PER_ELEMENT;var n={};n.x=t.getFloat64(i,!0),i+=Float64Array.BYTES_PER_ELEMENT,n.y=t.getFloat64(i,!0),i+=Float64Array.BYTES_PER_ELEMENT,n.z=t.getFloat64(i,!0),i+=Float64Array.BYTES_PER_ELEMENT;var a=t.getFloat64(i,!0);i+=Float64Array.BYTES_PER_ELEMENT,o.boundingSphere={center:n,radius:a};var s=y(e,t,i),l=s.string;i=s.bytesOffset;var u=l.indexOf("Geometry");if(-1!==u){var c=l.substring(u);l=l.replace(c,"")}o.childTile=l,o.geodes=[];var h=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var d=0;d<h;d++)i=m(e,t,i,o.geodes);return r.push(o),i}function v(e,t,i,r){var o=t.getUint32(i,!0);if(r.verticesCount=o,(i+=Uint32Array.BYTES_PER_ELEMENT)<=0)return i;var n=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;var a=t.getUint16(i,!0);a=n*Float32Array.BYTES_PER_ELEMENT,i+=Uint16Array.BYTES_PER_ELEMENT;var s=o*n*Float32Array.BYTES_PER_ELEMENT,l=new Uint8Array(e,i,s);i+=s;var u=r.vertexAttributes,c=r.attrLocation;return c.aPosition=u.length,u.push({index:c.aPosition,typedArray:l,componentsPerAttribute:n,componentDatatype:Cesium.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:a,normalize:!1}),i}function _(e,t,i,r){var o=t.getUint32(i,!0);if(i+=Uint32Array.BYTES_PER_ELEMENT,o<=0)return i;var n=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;var a=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;var s=o*n*Float32Array.BYTES_PER_ELEMENT,l=new Uint8Array(e,i,s);i+=s;var u=r.vertexAttributes,c=r.attrLocation;return c.aNormal=u.length,u.push({index:c.aNormal,typedArray:l,componentsPerAttribute:n,componentDatatype:Cesium.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:a,normalize:!1}),i}function C(e,t,i,r){var o=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var n=r.verticesCount,a=void 0;if(0<o){t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT,i+=2*Uint8Array.BYTES_PER_ELEMENT;var s=o*Uint8Array.BYTES_PER_ELEMENT*4;a=new Uint8Array(e,i,s).slice(0,s),i+=s}else{a=new Uint8Array(4*n);for(var l=0;l<n;l++)a[4*l]=255,a[4*l+1]=255,a[4*l+2]=255,a[4*l+3]=255}var u=r.vertexAttributes,c=r.attrLocation;return c.aColor=u.length,u.push({index:c.aColor,typedArray:a,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.UNSIGNED_BYTE,offsetInBytes:0,strideInBytes:4,normalize:!0}),r.vertexColor=a,i}function w(e,t,i,r){var o=t.getUint32(i,!0);if(i+=Uint32Array.BYTES_PER_ELEMENT,o<=0)return i;t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT,i+=2*Uint8Array.BYTES_PER_ELEMENT;var n=o*Uint8Array.BYTES_PER_ELEMENT*4,a=new Uint8Array(e,i,n);i+=n;var s=r.vertexAttributes,l=r.attrLocation;return l.aSecondColor=s.length,s.push({index:l.aSecondColor,typedArray:a,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.UNSIGNED_BYTE,offsetInBytes:0,strideInBytes:4,normalize:!0}),i}function b(e,t,i,r){var o=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT,i+=Uint16Array.BYTES_PER_ELEMENT;for(var n=0;n<o;n++){var a=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var s=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;var l=a*s*Float32Array.BYTES_PER_ELEMENT,u=new Uint8Array(e,i,l);i+=l;var c="aTexCoord"+n,h=r.vertexAttributes,d=r.attrLocation;d[c]=h.length,h.push({index:d[c],typedArray:u,componentsPerAttribute:s,componentDatatype:Cesium.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:s*Float32Array.BYTES_PER_ELEMENT,normalize:!1})}return i}function E(e,t,i,r){var o=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT,i+=Uint16Array.BYTES_PER_ELEMENT;for(var n=r.vertexAttributes,a=r.attrLocation,s=0;s<o;s++){var l=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var u=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;var c=l*u*Float32Array.BYTES_PER_ELEMENT;if(17===u||29===u){var h=new Uint8Array(e,i,c);r.instanceCount=l,r.instanceMode=u,r.instanceBuffer=h,r.instanceIndex=1;var d=u*l*4,m=h.slice(0,d);r.vertexColorInstance=m;var p=void 0;17===u?(p=17*Float32Array.BYTES_PER_ELEMENT,a.uv2=n.length,n.push({index:a.uv2,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:p,instanceDivisor:1}),a.uv3=n.length,n.push({index:a.uv3,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:p,instanceDivisor:1}),a.uv4=n.length,n.push({index:a.uv4,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:p,instanceDivisor:1}),a.uv5=n.length,n.push({index:a.uv5,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:p,instanceDivisor:1}),a.uv6=n.length,n.push({index:a.uv6,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.UNSIGNED_BYTE,normalize:!0,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:p,instanceDivisor:1})):29===u&&(p=29*Float32Array.BYTES_PER_ELEMENT,a.uv1=n.length,n.push({index:a.uv1,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:p,instanceDivisor:1,byteLength:c}),a.uv2=n.length,n.push({index:a.uv2,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:p,instanceDivisor:1}),a.uv3=n.length,n.push({index:a.uv3,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:p,instanceDivisor:1}),a.uv4=n.length,n.push({index:a.uv4,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:p,instanceDivisor:1}),a.uv5=n.length,n.push({index:a.uv5,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:p,instanceDivisor:1}),a.uv6=n.length,n.push({index:a.uv6,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:20*Float32Array.BYTES_PER_ELEMENT,strideInBytes:p,instanceDivisor:1}),a.uv7=n.length,n.push({index:a.uv7,componentsPerAttribute:3,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:24*Float32Array.BYTES_PER_ELEMENT,strideInBytes:p,instanceDivisor:1}),a.uv8=n.length,n.push({index:a.uv8,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.UNSIGNED_BYTE,normalize:!0,offsetInBytes:27*Float32Array.BYTES_PER_ELEMENT,strideInBytes:p,instanceDivisor:1}),a.uv9=n.length,n.push({index:a.uv9,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.UNSIGNED_BYTE,normalize:!0,offsetInBytes:28*Float32Array.BYTES_PER_ELEMENT,strideInBytes:p,instanceDivisor:1}))}else{var g=l*u;r.instanceBounds=new Float32Array(g);for(var f=0;f<g;f++)r.instanceBounds[f]=t.getFloat32(i,!0)}i+=c}return i}function S(e,t,i,r){var o=t.getUint32(i,!0);return r.compressOptions=o,i+=Uint32Array.BYTES_PER_ELEMENT,i=(o&n.SVC_Vertex)===n.SVC_Vertex?function(e,t,i,r){var o=t.getUint32(i,!0);if(r.verticesCount=o,(i+=Uint32Array.BYTES_PER_ELEMENT)<=0)return i;var n=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;var a=t.getUint16(i,!0);a=n*Int16Array.BYTES_PER_ELEMENT,i+=Uint16Array.BYTES_PER_ELEMENT;var s=t.getFloat32(i,!0);i+=Float32Array.BYTES_PER_ELEMENT;var l={};l.x=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,l.y=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,l.z=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,l.w=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,r.vertCompressConstant=s,r.minVerticesValue=l;var u=o*n*Int16Array.BYTES_PER_ELEMENT,c=new Uint8Array(e,i,u);i+=u;var h=r.vertexAttributes,d=r.attrLocation;return d.aPosition=h.length,h.push({index:d.aPosition,typedArray:c,componentsPerAttribute:n,componentDatatype:Cesium.ComponentDatatype.SHORT,offsetInBytes:0,strideInBytes:a,normalize:!1}),i}(e,t,i,r):v(e,t,i,r),i=w(e,t,i=C(e,t,i=(o&n.SVC_Normal)===n.SVC_Normal?function(e,t,i,r){var o=t.getUint32(i,!0);if(i+=Uint32Array.BYTES_PER_ELEMENT,o<=0)return i;t.getUint16(i,!0),i+=Uint16Array.BYTES_PER_ELEMENT;var n=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;var a=2*o*Int16Array.BYTES_PER_ELEMENT,s=new Uint8Array(e,i,a);i+=a;var l=r.vertexAttributes,u=r.attrLocation;return u.aNormal=l.length,l.push({index:u.aNormal,typedArray:s,componentsPerAttribute:2,componentDatatype:Cesium.ComponentDatatype.SHORT,offsetInBytes:0,strideInBytes:n,normalize:!1}),i}(e,t,i,r):_(e,t,i,r),r),r),i=(o&n.SVC_TexutreCoord)===n.SVC_TexutreCoord?function(e,t,i,r){r.texCoordCompressConstant=[],r.minTexCoordValue=[];var o=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT,i+=Uint16Array.BYTES_PER_ELEMENT;for(var n=0;n<o;n++){var a=t.getUint8(i,!0);i+=Uint8Array.BYTES_PER_ELEMENT,i+=3*Uint8Array.BYTES_PER_ELEMENT;var s=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var l=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT,t.getUint16(i,!0),i+=Uint16Array.BYTES_PER_ELEMENT;var u=t.getFloat32(i,!0);i+=Float32Array.BYTES_PER_ELEMENT,r.texCoordCompressConstant.push(u);var c={};c.x=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,c.y=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,c.z=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,c.w=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,r.minTexCoordValue.push(c);var h=s*l*Int16Array.BYTES_PER_ELEMENT,d=new Uint8Array(e,i,h),m=(i+=h)%4;0!==m&&(i+=4-m);var p="aTexCoord"+n,g=r.vertexAttributes,f=r.attrLocation;if(f[p]=g.length,g.push({index:f[p],typedArray:d,componentsPerAttribute:l,componentDatatype:Cesium.ComponentDatatype.SHORT,offsetInBytes:0,strideInBytes:l*Int16Array.BYTES_PER_ELEMENT,normalize:!1}),a){h=s*Float32Array.BYTES_PER_ELEMENT;var v=new Uint8Array(e,i,h);i+=h,r.texCoordZMatrix=!0,f[p="aTexCoordZ"+n]=g.length,g.push({index:f[p],typedArray:v,componentsPerAttribute:1,componentDatatype:Cesium.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:Float32Array.BYTES_PER_ELEMENT,normalize:!1})}}return i}(e,t,i,r):b(e,t,i,r),(o&n.SVC_TexutreCoordIsW)===n.SVC_TexutreCoordIsW&&(r.textureCoordIsW=!0),i=E(e,t,i,r)}function P(e,t,i,r){var o=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var n=0;n<o;n++){var a={},s=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var l=t.getUint8(i,!0);i+=Uint8Array.BYTES_PER_ELEMENT;t.getUint8(i,!0);i+=Uint8Array.BYTES_PER_ELEMENT;var u=t.getUint8(i,!0);if(i+=Uint8Array.BYTES_PER_ELEMENT,i+=Uint8Array.BYTES_PER_ELEMENT,0<s){var c=null,h=void 0;1===l||3===l?(h=s*Uint32Array.BYTES_PER_ELEMENT,c=new Uint8Array(e,i,h)):(h=s*Uint16Array.BYTES_PER_ELEMENT,c=new Uint8Array(e,i,h),s%2!=0&&(h+=2)),a.indicesTypedArray=c,i+=h}a.indicesCount=s,a.indexType=l,a.primitiveType=u;var d=[],m=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var p=0;p<m;p++){var g=y(e,t,i),f=g.string;i=g.bytesOffset,d.push(f),a.materialCode=f}if(0!==i%4)i+=4-i%4;r.push(a)}return i}return i.parseBuffer=function(e){var t=0,i={version:void 0,groupNode:void 0,geoPackage:{},matrials:void 0,texturePackage:{}},r=new DataView(e);i.version=r.getFloat32(t,!0),t+=Float32Array.BYTES_PER_ELEMENT;r.getUint32(t,!0);t+=Uint32Array.BYTES_PER_ELEMENT;var o,n=(o=new Uint8Array(e,t),s.inflate(o).buffer);t=0;var a=(r=new DataView(n)).getUint32(t,!0);return function(e,t,i,r,o){if(1==(1&r)){t.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT;var n=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var a=0;a<n;a++){var s=y(e,t,i),l=s.string;i=s.bytesOffset;var u=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var c={};o[l].pickInfo=c;for(var h=o[l].vertexPackage.instanceIndex,d=0;d<u;d++){var m=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var p=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var g=[],f=0;f<p;f++){var v=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var _=1;-1===h&&(_=t.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT),g.push({vertexColorOffset:v,vertexColorCount:_})}c[m]=g}}}}(n,r,t=function(e,t,i,r){var o=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var n=new Uint8Array(e,i,o),a=Cesium.getStringFromTypedArray(n);return i+=o,r.materials=JSON.parse(a),i}(n,r,t=function(e,t,i,r){t.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT;var o=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var n=0;n<o;n++){var a=y(e,t,i),s=a.string,l=(i=a.bytesOffset)%4;0!==l&&(i+=4-l),t.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT;var u=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var c=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var h=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var d=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var m=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var p=new Uint8Array(e,i,d);i+=d,r[s]={id:s,width:u,height:c,compressType:h,nFormat:m,internalFormat:Cesium.PixelFormat.RGBA_DXT5,imageBuffer:p}}return i}(n,r,t=function(e,t,i,r){t.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT;var o,n,a,s=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var l=0;l<s;l++){var u=y(e,t,i),c=u.string,h=(i=u.bytesOffset)%4;0!==h&&(i+=4-h);var d=t.getUint32(i,!0);i+=Int32Array.BYTES_PER_ELEMENT;var m={vertexAttributes:[],attrLocation:{},instanceCount:0,instanceMode:0,instanceIndex:-1};d===g?i=E(o=e,n=t,b(o,n,w(o,n,C(o,n,_(o,n,v(o,n,i,a=m),a),a),a),a),a):d===f&&(i=S(e,t,i,m));var p=[];i=P(e,t,i,p),r[c]={vertexPackage:m,arrIndexPackage:p}}return i+=t.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT}(n,r,t=function(e,t,i,r){var o={},n=[];t.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT;var a=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var s=0;s<a;s++)i=u(e,t,i,n);o.pageLods=n;var l=i%4;return 0!==l&&(i+=4-l),r.groupNode=o,i}(n,r,t+=Uint32Array.BYTES_PER_ELEMENT,i),i.geoPackage),i.texturePackage),i),a,i.geoPackage),i},i}),define("SGWorld/S3MTiles/DDSTexture",[],function(){"use strict";function e(e,t,i){var r=e._gl;this.id=t,this._size=i.imageBuffer.length,this._context=e,this._width=i.width,this._height=i.height,this._texture=null,this._internalFormat=i.internalFormat,this._wrapS=Cesium.defaultValue(i.wrapS,Cesium.TextureWrap.CLAMP_TO_EDGE),this._wrapT=Cesium.defaultValue(i.wrapT,Cesium.TextureWrap.CLAMP_TO_EDGE),this.id=t,this._target=r.TEXTURE_2D,this._texture=r.createTexture(),r.bindTexture(r.TEXTURE_2D,this._texture);var o=0,n=0,a=function(e,t,i,r){var o=e.length,n=i,a=r,s=0;for(;;){var l=Cesium.PixelFormat.compressedTextureSizeInBytes(t,n,a);if(s+=l,a>>=1,0==(n>>=1)&&0==a)break;n=Math.max(n,1),a=Math.max(a,1)}return s===o}(i.imageBuffer,this._internalFormat,this._width,this._height),s=this._width,l=this._height;do{var u=Cesium.PixelFormat.compressedTextureSizeInBytes(this._internalFormat,s,l),c=new Uint8Array(i.imageBuffer.buffer,i.imageBuffer.byteOffset+o,u);r.compressedTexImage2D(r.TEXTURE_2D,n++,this._internalFormat,s,l,0,c),s=Math.max(s>>1,1),l=Math.max(l>>1,1),o+=u}while(o<i.imageBuffer.length&&a);1<n?(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_LINEAR)):(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR)),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),r.bindTexture(r.TEXTURE_2D,null)}return e.prototype.enable=function(){var e=this._context._gl;e.activeTexture(this._gl.TEXTURE0),e.bindTexture(this._target,this._texture)},e.prototype.disable=function(){this._context._gl.bindTexture(this._target,null)},e.prototype.isDestroyed=function(){return!1},e.prototype.destroy=function(){this._context._gl.deleteTexture(this._texture),this._texture=null,this.id=0,Cesium.destroyObject(this)},e}),define("SGWorld/S3MTiles/MaterialPass",[],function(){"use strict";function e(){this.ambientColor=new Cesium.Color,this.diffuseColor=new Cesium.Color,this.specularColor=new Cesium.Color(0,0,0,0),this.shininess=50,this.bTransparentSorting=!1,this.textures=[]}return e.prototype.isDestroyed=function(){return!1},e.prototype.destroy=function(){return destroyObject(this)},e}),define("SGWorld/S3MTiles/Shaders/S3MTilesVS",[],function(){"use strict";return"\n attribute vec4 aPosition;\n attribute vec4 aTexCoord0;\n #ifdef TexCoord2\n attribute vec4 aTexCoord1;\n #endif\n varying vec4 vTexCoord;\n attribute vec4 aColor;\n varying vec4 vColor;\n void main()\n {\n vTexCoord.xy = aTexCoord0.xy;\n #ifdef TexCoord2\n vTexCoord.zw = aTexCoord1.xy;\n #endif\n vColor = aColor;\n gl_Position = czm_modelViewProjection * vec4(aPosition.xyz, 1.0);\n }\n "}),define("SGWorld/S3MTiles/Shaders/S3MTilesFS",[],function(){"use strict";return"\n uniform sampler2D uTexture;\n #ifdef TexCoord2\n uniform sampler2D uTexture2;\n #endif\n uniform vec4 uDiffuseColor;\n uniform vec4 uAmbientColor;\n varying vec4 vColor;\n varying vec4 vTexCoord;\n void main()\n {\n vec4 color = vColor * texture2D(uTexture, vTexCoord.xy);\n #ifdef TexCoord2\n color *= texture2D(uTexture2, vTexCoord.zw);\n #endif\n gl_FragColor = czm_gammaCorrect(color);\n }\n "}),define("SGWorld/S3MTiles/S3MCreateVertexJob",[],function(){"use strict";function e(){this.context=void 0,this.model=void 0,this.index=void 0}return e.prototype.set=function(e,t,i){this.context=e,this.model=t,this.index=i},e.prototype.execute=function(){var e=this.context,t=this.index,i=this.model.vertexPackage,r=i.vertexAttributes[t];if(!Cesium.defined(r))throw new Cesium.DeveloperError("attribute is null");if(-1!==i.instanceIndex&&!Cesium.defined(this.model._instanceBuffer)){if(!Cesium.defined(i.instanceBuffer))throw new Cesium.DeveloperError("instance buffer is null");this.model.instanceBuffer=Cesium.Buffer.createVertexBuffer({context:e,typedArray:i.instanceBuffer,usage:Cesium.BufferUsage.STATIC_DRAW})}1!==r.instanceDivisor?Cesium.defined(r.vertexBuffer)||(r.vertexBuffer=Cesium.Buffer.createVertexBuffer({context:e,typedArray:r.typedArray,usage:Cesium.BufferUsage.STATIC_DRAW}),r.typedArray=null,delete r.typedArray):r.vertexBuffer=this.model.instanceBuffer},e}),define("SGWorld/S3MTiles/S3MCreateIndexJob",[],function(){"use strict";function e(){this.model=void 0,this.context=void 0,this.index=0}return e.prototype.set=function(e,t,i){this.model=t,this.context=e,this.index=i},e.prototype.execute=function(){var e=this.context,t=this.model.arrIndexPackage[this.index],i=this.model.vertexPackage.verticesCount;if(!Cesium.defined(t))throw new Cesium.DeveloperError("index package is null");if(!Cesium.defined(t.indexBuffer)){if(!Cesium.defined(t.indicesTypedArray))throw new Cesium.DeveloperError("index buffer is null");var r=Cesium.IndexDatatype.UNSIGNED_SHORT;(1===t.indexType||i>=Cesium.Math.SIXTY_FOUR_KILOBYTES)&&e.elementIndexUint&&(r=Cesium.IndexDatatype.UNSIGNED_INT),t.indexBuffer=Cesium.Buffer.createIndexBuffer({context:e,typedArray:t.indicesTypedArray,usage:Cesium.BufferUsage.STATIC_DRAW,indexDatatype:r}),t.indicesTypedArray=null,delete t.indicesTypedArray}},e}),define("SGWorld/S3MTiles/Factory/RenderEntity",["../S3MCreateVertexJob","../S3MCreateIndexJob"],function(e,t){"use strict";function i(e){this.layer=e.layer,this.vertexPackage=e.vertexPackage,this.arrIndexPackage=e.arrIndexPackage,this.vertexBufferToCreate=new Cesium.Queue,this.indexBufferToCreate=new Cesium.Queue;var t=void 0,i=void 0;for(t=0,i=this.vertexPackage.vertexAttributes.length;t<i;t++)this.vertexBufferToCreate.enqueue(t);for(t=0,i=this.arrIndexPackage.length;t<i;t++)this.indexBufferToCreate.enqueue(t);this.boundingVolume=e.boundingVolume,this.material=e.material,this.modelMatrix=e.modelMatrix,this.shaderProgram=void 0,this.vertexArray=void 0,this.colorCommand=void 0,this.ready=!1}var n=new e,a=new t;return i.prototype.createBuffers=function(e){!function(e,t){for(var i=e.layer.context,r=e.vertexBufferToCreate;r.length;){var o=r.peek();if(n.set(i,e,o),!t.jobScheduler.execute(n,Cesium.JobType.BUFFER))break;r.dequeue()}}(this,e),function(e,t){for(var i=e.layer.context,r=e.indexBufferToCreate;r.length;){var o=r.peek();if(a.set(i,e,o),!t.jobScheduler.execute(a,Cesium.JobType.BUFFER))break;r.dequeue()}}(this,e)},i.prototype.createCommand=Cesium.DeveloperError.throwInstantiationError,i.prototype.update=Cesium.DeveloperError.throwInstantiationError,i.prototype.isDestroyed=Cesium.DeveloperError.throwInstantiationError,i.prototype.destroy=Cesium.DeveloperError.throwInstantiationError,i}),define("SGWorld/S3MTiles/Factory/S3MCacheFileRenderEntity",["../Shaders/S3MTilesVS","../Shaders/S3MTilesFS","./RenderEntity"],function(m,p,t){"use strict";function e(e){t.call(this,e)}return(e.prototype=Object.create(t.prototype)).constructor=t,e.prototype.createCommand=function(){if(!Cesium.defined(this.colorCommand)){var e=this.layer.context,t=this.vertexPackage,i=this.arrIndexPackage,r=t.vertexAttributes,o=t.attrLocation;if(!(i.length<1)){var n,a,s,l,u,c,h=i[0],d=this.material;this.shaderProgram=(n=e,a=o,s=d,l=new Cesium.ShaderSource({sources:[m]}),u=new Cesium.ShaderSource({sources:[p]}),Cesium.defined(a.aNormal)&&(l.defines.push("VertexNormal"),u.defines.push("VertexNormal")),0<s.textures.length&&(l.defines.push("TexCoord"),u.defines.push("TexCoord")),2==s.textures.length&&(l.defines.push("TexCoord2"),u.defines.push("TexCoord2")),Cesium.ShaderProgram.fromCache({context:n,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:a})),this.vertexArray=new Cesium.VertexArray({context:e,attributes:r,indexBuffer:h.indexBuffer}),this.colorCommand=new Cesium.DrawCommand({primitiveType:h.primitiveType,modelMatrix:this.modelMatrix,boundingVolume:Cesium.BoundingSphere.clone(this.boundingVolume),pickId:"vSecondColor",vertexArray:this.vertexArray,shaderProgram:this.shaderProgram,pass:d.bTransparentSorting?Cesium.Pass.TRANSLUCENT:Cesium.Pass.CESIUM_3D_TILE,renderState:d.bTransparentSorting?Cesium.RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Cesium.DepthFunction.LESS_OR_EQUAL},blending:Cesium.BlendingState.ALPHA_BLEND}):Cesium.RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Cesium.DepthFunction.LESS_OR_EQUAL}})}),this.colorCommand.uniformMap=(c=d,{uTexture:function(){return c.textures[0]},uTextureWidth:function(){return c.textures[0]._width},uTexture2:function(){return c.textures[1]},uTexture2Width:function(){return c.textures[1]._width},uDiffuseColor:function(){return c.diffuseColor},uAmbientColor:function(){return c.ambientColor}}),this.vertexPackage=null,this.arrIndexPackage=null,this.ready=!0}}},e.prototype.update=function(e){if(!this.ready)return this.createBuffers(e),void this.createCommand(e);e.commandList.push(this.colorCommand)},e.prototype.isDestroyed=function(){return!1},e.prototype.destroy=function(){return this.shaderProgram=this.shaderProgram&&!this.shaderProgram.isDestroyed()&&this.shaderProgram.destroy(),this.vertexArray=this.vertexArray&&!this.vertexArray.isDestroyed()&&this.vertexArray.destroy(),this.colorCommand=void 0,this.vertexPackage=null,this.arrIndexPackage=null,Cesium.destroyObject(this)},e}),define("SGWorld/S3MTiles/Factory/S3MContentFactory",["./S3MCacheFileRenderEntity"],function(t){"use strict";return{OSGBFile:function(e){return new t(e)},OSGBCacheFile:function(e){return new t(e)}}}),define("SGWorld/S3MTiles/S3MContentParser",["./DDSTexture","./MaterialPass","./Factory/S3MContentFactory","./Enum/VertexCompressOption"],function(w,b,P,d){"use strict";function e(){}function x(e,t){var i=new Cesium.BoundingSphere,r=new Cesium.Cartesian3,o=e.vertexAttributes[0],n=o.componentsPerAttribute,a=Cesium.defined(e.nCompressOptions)&&(e.nCompressOptions&d.SVC_Vertex)===d.SVC_Vertex,s=1,l=void 0,u=void 0;u=a?(s=e.vertCompressConstant,l=new Cesium.Cartesian3(e.minVerticesValue.x,e.minVerticesValue.y,e.minVerticesValue.z),new Uint16Array(o.typedArray.buffer,o.typedArray.byteOffset,o.typedArray.byteLength/2)):new Float32Array(o.typedArray.buffer,o.typedArray.byteOffset,o.typedArray.byteLength/4);for(var c=[],h=0;h<e.verticesCount;h++)Cesium.Cartesian3.fromArray(u,n*h,r),a&&(r=Cesium.Cartesian3.multiplyByScalar(r,s,r),r=Cesium.Cartesian3.add(r,l,r)),c.push(Cesium.Cartesian3.clone(r));return Cesium.BoundingSphere.fromPoints(c,i),Cesium.BoundingSphere.transform(i,t,i),c.length=0,i}function h(e,t,i,r,o){for(var n={},a=r.geodes,s=0,l=a.length;s<l;s++){var u=a[s],c=u.matrix,h=Cesium.Matrix4.multiply(e.modelMatrix,c,new Cesium.Matrix4),d=void 0;Cesium.defined(o.boundingVolume)&&(d=new Cesium.BoundingSphere(o.boundingVolume.sphere.center,o.boundingVolume.sphere.radius),Cesium.BoundingSphere.transform(d,e.modelMatrix,d));for(var m=u.skeletonNames,p=0,g=m.length;p<g;p++){var f=m[p],v=t.geoPackage[f],_=v.vertexPackage,y=v.arrIndexPackage,C=v.pickInfo,w=void 0;0<y.length&&(w=i[y[0].materialCode]);var b=Cesium.defined(d)?d:x(_,h);n[f]=P[e.fileType]({layer:e,vertexPackage:_,arrIndexPackage:y,pickInfo:C,modelMatrix:h,boundingVolume:b,material:w})}}if(!Cesium.defined(o.boundingVolume)){var E=[];for(var S in n)n.hasOwnProperty(S)&&E.push(n[S].boundingVolume);o.boundingVolume=Cesium.BoundingSphere.fromBoundingSpheres(E)}o.geoMap=n}return e.parse=function(e,t){if(Cesium.defined(t))return function(e,t,i){for(var r=t.groupNode,o=[],n=0,a=r.pageLods.length;n<a;n++){var s={},l=r.pageLods[n];s.rangeMode=l.rangeMode,s.rangeDataList=l.childTile,s.rangeList=l.rangeList;var u=l.boundingSphere.center,c=l.boundingSphere.radius;""!==s.rangeDataList?s.boundingVolume={sphere:{center:new Cesium.Cartesian3(u.x,u.y,u.z),radius:c}}:s.isLeafTile=!0,h(e,t,i,l,s),o.push(s)}return o}(e,t,function(e,t){for(var i={},r=t.materials.material,o=0,n=r.length;o<n;o++){var a=r[o].material,s=a.id,l=new b;i[s]=l;var u=a.ambient;l.ambientColor=new Cesium.Color(u.r,u.g,u.b,u.a);var c=a.diffuse;l.diffuseColor=new Cesium.Color(c.r,c.g,c.b,c.a);var h=a.specular;l.specularColor=new Cesium.Color(h.r,h.g,h.b,h.a),l.shininess=a.shininess,l.bTransparentSorting=a.transparentsorting;for(var d=a.textureunitstates,m=d.length,p=0;p<m;p++){var g=d[p].textureunitstate,f=g.id,v=0===g.addressmode.u?Cesium.TextureWrap.REPEAT:Cesium.TextureWrap.CLAMP_TO_EDGE,_=0===g.addressmode.v?Cesium.TextureWrap.REPEAT:Cesium.TextureWrap.CLAMP_TO_EDGE;l.texMatrix=Cesium.Matrix4.unpack(g.texmodmatrix);var y=t.texturePackage[f];if(Cesium.defined(y)&&0<y.imageBuffer.byteLength){y.wrapS=v,y.wrapT=_;var C=new w(e,f,y);l.textures.push(C)}}}return i}(e.context,t))},e}),define("SGWorld/S3MTiles/S3MTile",["./Enum/ContentState","./S3ModelParser","./S3MContentParser"],function(u,s,l){"use strict";function c(e,t,i,r,o,n,a){this.layer=e,this.parent=t,this.fileName=r,this.isLeafTile=Cesium.defaultValue(a,!1),this.boundingVolume=this.createBoundingVolume(i,e.modelMatrix);var s=Cesium.Resource.createIfNeeded(e._baseResource);if(Cesium.defined(t))this.baseUri=t.baseUri;else{var l=new Cesium.Resource(r);this.baseUri=l.getBaseUri()}this.contentResource=s.getDerivedResource({url:r}),this.serverKey=Cesium.RequestScheduler.getServerKey(this.contentResource.getUrlComponent()),this.request=void 0,this.cacheNode=void 0,this.distanceToCamera=0,this.pixel=0,this.visibilityPlaneMask=0,this.visible=!1,this.children=[],this.lodRangeData=o,this.renderEntityMap=n,this.contentState=u.UNLOADED,this.readerable=!1,this.touchedFrame=0,this.requestedFrame=0,this.selectedFrame=0,this.priority=0}Object.defineProperties(c.prototype,{renderable:{get:function(){return Cesium.defined(this.renderEntityMap)}}});var h=new Cesium.Cartesian3;function r(e,t){return e.boundingVolume}return c.prototype.createBoundingVolume=function(e,t){return this.isLeafTile?new Cesium.TileBoundingSphere(e.center,e.radius):Cesium.defined(e.sphere)?function(e,t){var i=Cesium.Cartesian3.clone(e.center),r=e.radius;i=Cesium.Matrix4.multiplyByPoint(t,i,i);var o=Cesium.Matrix4.getScale(t,h);return r*=Cesium.Cartesian3.maximumComponent(o),new Cesium.TileBoundingSphere(i,r)}(e.sphere,t):Cesium.defined(e.box)?function(e,t){var i=new Cesium.Cartesian3(e.min.x,e.min.y,e.min.z);Cesium.Matrix4.multiplyByPoint(t,i,i);var r=new Cesium.Cartesian3(e.max.x,e.max.y,e.max.z);Cesium.Matrix4.multiplyByPoint(t,r,r);var o=Cesium.BoundingSphere.fromCornerPoints(i,r,new Cesium.BoundingSphere),n=o.center,a=o.radius,s=Cesium.Matrix4.getScale(t,h);return a*=Cesium.Cartesian3.maximumComponent(s),new Cesium.TileBoundingSphere(n,a)}(e.box,t):void 0},c.prototype.canTraverse=function(){return 0!==this.children.length&&!this.isLeafTile&&(!Cesium.defined(this.lodRangeData)||this.pixel>this.lodRangeData)},c.prototype.getPixel=function(e){var t=this.boundingVolume,i=t.radius,r=t.center,o=Cesium.Cartesian3.distance(e.camera.positionWC,r),n=e.context.drawingBufferHeight,a=.5*e.camera.frustum._fovy;return.5*n/Math.tan(a)*i/o},c.prototype.distanceToTile=function(e){return r(this).distanceToCamera(e)},c.prototype.visibility=function(e,t){var i=r(this);return e.cullingVolume.computeVisibilityWithPlaneMask(i,t)},c.prototype.updateVisibility=function(e){var t=this.parent,i=Cesium.defined(t)?t.visibilityPlaneMask:Cesium.CullingVolume.MASK_INDETERMINATE;this.distanceToCamera=this.distanceToTile(e),this.pixel=this.getPixel(e),this.visibilityPlaneMask=this.visibility(e,i),this.visible=this.visibilityPlaneMask!==Cesium.CullingVolume.MASK_OUTSIDE},c.prototype.requestContent=function(){var e,r=this,t=(this.layer,this.contentResource.clone()),i=new Cesium.Request({throttle:!0,throttleByServer:!0,type:Cesium.RequestType.TILES3D,priorityFunction:(e=this,function(){return e.priority}),serverKey:this.serverKey});this.request=i,t.request=i;var o=t.fetchArrayBuffer();if(!Cesium.defined(o))return!1;this.contentState=u.LOADING,this.contentReadyPromise=Cesium.when.defer();var n,a=(n=this,function(e){n.contentState=u.FAILED,n.contentReadyPromise.reject(e)});return o.then(function(e){if(r.isDestroyed())a();else{var t=s.parseBuffer(e),i=l.parse(r.layer,t);!function(e,t){for(var i=e.layer,r=t.length,o=0;o<r;o++){var n=t[o],a=n.boundingVolume,s=n.rangeDataList,l=new c(i,e,a,s=e.baseUri+s,n.rangeList,n.geoMap,n.isLeafTile);e.children.push(l),e.layer._cache.add(l)}}(r,i),r.selectedFrame=0,r.contentState=u.READY,r.contentReadyPromise.resolve(t)}}).otherwise(function(e){i.state!==Cesium.RequestState.CANCELLED?a(e):r.contentState=u.UNLOADED}),!0},c.prototype.update=function(e){var t=this.renderEntityMap;for(var i in t)t.hasOwnProperty(i)&&t[i].update(e)},c.prototype.free=function(){for(var e=0,t=this.children.length;e<t;e++){this.children[e].destroy()}this.children.length=0,this.contentState=u.UNLOADED},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){for(var e in this.renderEntityMap)this.renderEntityMap.hasOwnProperty(e)&&this.renderEntityMap[e].destroy();this.renderEntityMap=void 0;for(var t=0,i=this.children.length;t<i;t++){this.children[t].destroy()}return this.children.length=0,Cesium.destroyObject(this)},c}),define("SGWorld/S3MTiles/S3MLayerScheduler",["./Enum/ContentState"],function(m){"use strict";function e(){this._stack=[]}function l(e,t){return e.distanceToCamera-t.distanceToCamera}function p(e,t,i,r){var o=void 0,n=t.children,a=n.length;for(o=0;o<a;++o)n[o].updateVisibility(r);for(n.sort(l),o=0;o<a;++o){var s=n[o];s.visible&&i.push(s)}}return e.prototype.scheduler=function(e,t){e._requestTiles.length=0,e._selectedTiles.length=0;var i=this._stack;!function(e,t,i){for(var r=t.length=0,o=e._rootTiles.length;r<o;r++){var n=e._rootTiles[r];n.updateVisibility(i),n.visible&&t.push(n)}}(e,i,t),function(e,t,i){for(;t.length;){var r=t.pop();r.visible&&(c=e,d=i,(h=r).touchedFrame!==d.frameNumber&&(c._cache.touch(h),h.touchedFrame=d.frameNumber),r.canTraverse()?p(0,r,t,i):(s=e,u=i,(l=r).renderable&&(s._selectedTiles.push(l),l.selectedFrame=u.frameNumber),o=e,a=i,(n=r).requestedFrame===a.frameNumber||n.contentState!==m.UNLOADED||n.isLeafTile||(o._requestTiles.push(n),n.requestedFrame=a.frameNumber)))}var o,n,a,s,l,u,c,h,d}(e,i,t)},e}),define("SGWorld/S3MTiles/S3MLayerCache",[],function(){"use strict";function e(){this._list=new Cesium.DoublyLinkedList,this._sentinel=this._list.add(),this._trimTiles=!1}return e.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)},e.prototype.touch=function(e){var t=e.cacheNode;Cesium.defined(t)&&this._list.splice(this._sentinel,t)},e.prototype.add=function(e){Cesium.defined(e.cacheNode)||(e.cacheNode=this._list.add(e))},e.prototype.unloadTile=function(e,t,i){var r=t.cacheNode;Cesium.defined(r)&&(this._list.remove(r),t.cacheNode=void 0,i(e,t))},e.prototype.unloadTiles=function(e,t){var i=this._trimTiles;this._trimTiles=!1;for(var r=this._list,o=1024*e.maximumMemoryUsage*1024,n=this._sentinel,a=r.head;a!==n&&(e.totalMemoryUsageInBytes>o||i);){var s=a.item;a=a.next,s.isDestroyed(),this.unloadTile(e,s,t)}},e.prototype.trim=function(){this._trimTiles=!0},e}),define("SGWorld/S3MTiles/S3MTilesLayer",["./S3MTile","./S3MLayerScheduler","./S3MLayerCache"],function(h,t,i){"use strict";function e(e){e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),Cesium.Check.defined("options.url",e.url),Cesium.Check.defined("options.context",e.context),this.context=e.context,this._url=void 0,this._basePath=void 0,this._baseResource=void 0,this.modelMatrix=void 0,this.fileType=void 0,this._position=void 0,this._rectangle=void 0,this._rootTiles=[],this._schuduler=new t,this._requestTiles=[],this._selectedTiles=[],this._cache=new i,this._maximumMemoryUsage=-1,this._totalMemoryUsageInBytes=0,this._readyPromise=Cesium.when.defer(),this.loadConfig(e.url)}function o(e,t){return e.priority-t.priority}function r(e,t){}return Object.defineProperties(e.prototype,{ready:{get:function(){return 0<this._rootTiles.length}},readyPromise:{get:function(){return this._readyPromise}},rectangle:{get:function(){return this._rectangle}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes},set:function(e){this._totalMemoryUsageInBytes=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){this._maximumMemoryUsage=e}}}),e.prototype.loadConfig=function(e){var c=this;Cesium.when(e).then(function(e){var t,i=Cesium.Resource.createIfNeeded(e);return t=i.getBaseUri(!0),c._url=i.url,c._basePath=t,(c._baseResource=i).fetchJson()}).then(function(e){var t=e.extensions;c.fileType=t["s3m:FileType"];var i=e.position.x,r=e.position.y,o=e.position.z;c._position=Cesium.Cartesian3.fromDegrees(i,r,o),c.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(c._position),c._rectangle=Cesium.Rectangle.fromDegrees(e.geoBounds.left,e.geoBounds.bottom,e.geoBounds.right,e.geoBounds.top);for(var n=0,a=e.tiles.length;n<a;n++){var s=e.tiles[n].url,l={box:e.tiles[n].boundingbox},u=new h(c,void 0,l,s);c._cache.add(u),c._rootTiles.push(u)}c._readyPromise.resolve(c)}).otherwise(function(e){c._readyPromise.reject(e)})},e.prototype.prePassesUpdate=function(e){this.ready&&e.newFrame&&this._cache.reset()},e.prototype.update=function(e){var t;this.ready&&(this._schuduler.scheduler(this,e),function(e){var t=e._requestTiles,i=t.length;t.sort(o);for(var r=0;r<i;++r)t[r].requestContent()}(this),function(e,t){for(var i=e._selectedTiles,r=i.length,o=0;o<r;o++)i[o].update(t)}(this,e),(t=this)._cache.unloadTiles(t,r))},e}),define("SGWorld/Creator/VectorImgFeatureLayer",["../Core/Core","./Color","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min","../Core/jquery","../VectorTileProvider/VectorTileProvider","../VectorTileProvider/GeoJSONVectorTileProvider","../VectorTileProvider/GeoJSONVectorTileProvider1","../Core/LonLatProjection","../Core/turf","../VectorTileProvider/VectorTileProvider2"],function(i,r,o,e,t,m,n,a,s,l,u){"use strict";function c(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._color=new r(this._viewer,this._cesium),this._tree=o,this.item={show:!0},this._option=void 0,this._primitive=void 0,this._Provider=void 0}return c.prototype.CreateVectorImageFeatureLayer=function(e,t,i,l,r,o,n){var a={url:"",queryParameters:{layer:"",style:"",tilematrixset:"EPSG:4326",Service:"WMTS",Request:"GetTile",Version:"1.0.0",Format:"image/png",TileMatrix:"EPSG:4326:",TileCol:"",TileRow:""}};this._option=this._core.extend(a,t,!0),this._queryOption=i;var u=this._core.extend(a,t,!0),c=i;null==t&&console.log("options is required");var h=this;this._Provider=new m(this._viewer,this._cesium),this._Provider.loadTile=function(e,s){!function(r,o,n,e,a){if(s.state===Cesium.QuadtreeTileLoadState.START){if(s.data={lines:[],geometryPrimitive:void 0},!(s.level>=l.level_min&&s.level<l.level_max&&e.item.show))return s.state=Cesium.QuadtreeTileLoadState.DONE,s.renderable=!0;u.queryParameters.TileMatrix=u.queryParameters.tilematrixset+":"+r.level,u.queryParameters.TileCol=r.x,u.queryParameters.TileRow=r.y,new Cesium.Resource(u).fetchImage().then(function(e){var t=new Cesium.Rectangle(0,0,0,0),i=(a._tilingScheme.tileXYToRectangle(r.x,r.y,r.level,t),new Cesium.GroundPrimitive({geometryInstances:[{geometry:new Cesium.RectangleGeometry({rectangle:t})}],appearance:new Cesium.Appearance({material:new Cesium.Material({fabric:{type:"Image",uniforms:{image:e}}})})}));i.cusResource=n,s.data.geometryPrimitive=i,s.state=Cesium.QuadtreeTileLoadState.LOADING,s.state===Cesium.QuadtreeTileLoadState.LOADING&&(s.data.geometryPrimitive.update(o,[]),s.state=Cesium.QuadtreeTileLoadState.DONE,s.renderable=!0)},function(e){console.log(e)}),s.state=Cesium.QuadtreeTileLoadState.LOADING,s.state=Cesium.QuadtreeTileLoadState.LOADING}}(s,e,c,h,this)},this._primitive=new h._cesium.QuadtreePrimitivezh({tileProvider:this._Provider});var s=this._viewer.scene;s.primitives.add(this._primitive),s.primitivesQuadTrees&&s.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(t.id)&&(t.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+t.id);var d={id:t.id,name:e,checked:!0,pId:this._core.isnull(r)?0:r,type:"rasterLayer",item:this,options:this._option,queryOptions:this._queryOption};return this.setTreeobj(d),this._tree.insertGroupId(d,this._core.isnull(r)?0:r),"function"==typeof n&&n(this.item),this},c.prototype.setTreeobj=function(e){this.treeobj=e},c.prototype.setVisibility=function(e){try{this._Provider&&this._Provider.setStatus&&this._Provider.setStatus(e)}catch(e){}},c.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch(e){}},c}),define("SGWorld/Creator/TerrainModifier",[],function(){"use strict";var n,a;function e(e,t){this._viewer=e,this._cesium=t,n=t,a=e}return e.prototype.findDirectParent=function(e){try{var t=[];if(e.width==Math.PI)return null;for(var i=0;i<a.scene.globe._surface._tilesToRender.length;i++){var r=a.scene.globe._surface._tilesToRender[i],o=r._rectangle;n.Rectangle.intersection(o,e)&&t.push(r)}return t}catch(e){}return null},e.prototype.createTerrainModifier=function(e,t,i){var r=t.length,o=new Array(r);o.fill(i);var n=this._cesium.createGuid(),a=Date.now(),s=this._cesium.Rectangle.fromCartesianArray(t),l=this.findDirectParent(s);this._viewer.terrainProvider&&void 0===this._viewer.terrainProvider._modifyTerrainObjects&&(this._viewer.terrainProvider._modifyTerrainObjects=[]);var u=this._viewer,c={id:n,name:e,show:!0,rectangle:s,vertices:t,heights:o,timeStamp:a,remove:function(){if(u.terrainProvider&&u.terrainProvider._modifyTerrainObjects)for(var e=u.terrainProvider._modifyTerrainObjects.length-1;0<=e;e--){u.terrainProvider._modifyTerrainObjects[e].id==n&&u.terrainProvider._modifyTerrainObjects.splice(e,1)}if(l)try{for(e=0;e<l.length;e++)try{l[e]._parent.freeResources()}catch(e){}}catch(e){}}};if(this._viewer.terrainProvider._modifyTerrainObjects.push(c),l)try{for(var h=0;h<l.length;h++)try{l[h]._parent.freeResources()}catch(e){}}catch(e){}return c},e}),define("SGWorld/Core/Skip",[],function(){"use strict";function e(e){this.async=void 0===e||e}return e.prototype.getXmlHttpRequest=function(){return window.XMLHttpRequest?new XMLHttpRequest:window.ActiveXObject?new ActiveXObject("MsXml2.XmlHttp"):void 0},e.prototype.includeJsText=function(e,t){if(null!=e){var i=document.createElement("script");i.type="text/javascript",i.text=t,e.appendChild(i)}},e.prototype.includeJsSrc=function(e,t){if(null!=e){var i=document.createElement("script");i.type="text/javascript",i.src=t,e.appendChild(i)}},e.prototype.addJs=function(e,t){var i=this.getXmlHttpRequest(),r=this;i.onreadystatechange=function(){4===i.readyState&&(200===i.status||304===i.status?r.includeJsSrc(e,t):console.log("XML request error: "+i.statusText+" ("+i.status+")"))},i.open("GET",t,r.async),i.send(null),404===i.status?console.log(t+" is not found"):r.includeJsText(e,i.responseText)},e}),define("SGWorld/Creator/TdtLabel",["../Core/Core","../Core/Skip"],function(i,r){"use strict";function e(e,t){(this._viewer=e,this._cesium=t,this._core=new i,Cesium.GeoWTFS)||new r(!1).addJs(document.body,window.SmartEarthRootUrl+"Workers/cesiumTdt.js")}return e.prototype.GeoWTFS=function(e){!e&&(e={});var t=e.token||"837264f46e683ec982d452e78d71052e",i=e.url||"https://t{s}.tianditu.gov.cn/",r={viewer:this._viewer,subdomains:["0","1","2","3","4","5","6","7"],metadata:{boundBox:{minX:-180,minY:-90,maxX:180,maxY:90},minLevel:1,maxLevel:20},aotuCollide:!0,collisionPadding:[5,10,8,5],serverFirstStyle:!0,labelGraphics:{font:"28px sans-serif",fontSize:28,fillColor:Cesium.Color.WHITE,scale:.5,outlineColor:Cesium.Color.BLACK,outlineWidth:5,style:Cesium.LabelStyle.FILL_AND_OUTLINE,showBackground:!1,backgroundColor:Cesium.Color.RED,backgroundPadding:new Cesium.Cartesian2(10,10),horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,eyeOffset:Cesium.Cartesian3.ZERO,pixelOffset:new Cesium.Cartesian2(0,8),heightReference:1,disableDepthTestDistance:Number.POSITIVE_INFINITY},billboardGraphics:{horizontalOrigin:Cesium.HorizontalOrigin.RIGHT,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,eyeOffset:Cesium.Cartesian3.ZERO,pixelOffset:Cesium.Cartesian2.ZERO,alignedAxis:Cesium.Cartesian3.ZERO,color:Cesium.Color.WHITE,rotation:0,scale:1,width:18,height:18,heightReference:1,disableDepthTestDistance:Number.POSITIVE_INFINITY}};e=this._core.extend(r,e,!0);var o=new Cesium.GeoWTFS(e);return o.getTileUrl=function(){return i+"mapservice/GetTiles?lxys={z},{x},{y}&tk="+t},o.getIcoUrl=function(){return i+"mapservice/GetIcon?id={id}&tk="+t},o.initTDT([{x:6,y:1,level:2,boundBox:{minX:90,minY:0,maxX:135,maxY:45}},{x:7,y:1,level:2,boundBox:{minX:135,minY:0,maxX:180,maxY:45}},{x:6,y:0,level:2,boundBox:{minX:90,minY:45,maxX:135,maxY:90}},{x:7,y:0,level:2,boundBox:{minX:135,minY:45,maxX:180,maxY:90}},{x:5,y:1,level:2,boundBox:{minX:45,minY:0,maxX:90,maxY:45}},{x:4,y:1,level:2,boundBox:{minX:0,minY:0,maxX:45,maxY:45}},{x:5,y:0,level:2,boundBox:{minX:45,minY:45,maxX:90,maxY:90}},{x:4,y:0,level:2,boundBox:{minX:0,minY:45,maxX:45,maxY:90}},{x:6,y:2,level:2,boundBox:{minX:90,minY:-45,maxX:135,maxY:0}},{x:6,y:3,level:2,boundBox:{minX:90,minY:-90,maxX:135,maxY:-45}},{x:7,y:2,level:2,boundBox:{minX:135,minY:-45,maxX:180,maxY:0}},{x:5,y:2,level:2,boundBox:{minX:45,minY:-45,maxX:90,maxY:0}},{x:4,y:2,level:2,boundBox:{minX:0,minY:-45,maxX:45,maxY:0}},{x:3,y:1,level:2,boundBox:{minX:-45,minY:0,maxX:0,maxY:45}},{x:3,y:0,level:2,boundBox:{minX:-45,minY:45,maxX:0,maxY:90}},{x:2,y:0,level:2,boundBox:{minX:-90,minY:45,maxX:-45,maxY:90}},{x:0,y:1,level:2,boundBox:{minX:-180,minY:0,maxX:-135,maxY:45}},{x:1,y:0,level:2,boundBox:{minX:-135,minY:45,maxX:-90,maxY:90}},{x:0,y:0,level:2,boundBox:{minX:-180,minY:45,maxX:-135,maxY:90}}]),o},e}),define("SGWorld/Creator/Creator",["../Core/Core","./Label","./Circle","./Box","./Cone","./Color","./Point","./Polyline","./PolylineVolume","./Corridor","./Rectangle","./Polygon","./position","./ImageLabel","./wall","./FeatureLayer","./ImageryLayer","./GeoJsonFeatureLayer","./PolylineGeoJsonFeatureLayer","./PolygonGeoJsonFeatureLayer","./LabelGeoJsonFeatureLayer","./LabelGeoJsonFeatureLayercopy","./Ellipsoid","../ProjectTree/treeSource","./3DTileset","./dynamicObject","./Vector","./TerrainProvider","./MapGeoJsonFeatureLayer","./Terrain","./VolumeGeoJsonFeatureLayer","./PolygonVectorGeoJsonFeatureLayer","./WallGeoFeatureLayer","./PointModel","./SkyBox","./FlowField","./TrailLine","../VectorTileProvider/VectorTileProvider","./billboardGeoJsonFeatureLayer","./PolygonVectorTileLayerArcgis","./VectorEditing","./createPolyline","./createPolygon","./VectorGeoJsonFeatureLayer","./CreateStraightArrow","./CreateAttackArrow","./CreatePincerArrow","./VolumetricMeasure","./Hawkeye","./MilitaryStandard","./PopupMessage","./StraightArrowPerfect","./Billboard","./KmlLayer","./ModifyMesh","./Thermodynamic","./CZML","./Heatmap","./ModelLibrary","./SimpleGraphic","./SatelliteTrail","./ViewCone","../S3MTiles/S3MTilesLayer","./WorkerPool","./VectorImgFeatureLayer","./TerrainModifier","./TdtLabel"],function(i,s,u,c,d,o,r,a,n,l,m,p,h,g,f,v,_,y,C,w,e,b,E,S,t,P,x,T,I,D,L,M,A,R,O,N,V,F,H,G,k,B,j,z,W,U,q,Y,X,J,Q,K,$,Z,ee,te,ie,re,oe,ne,ae,se,le,ue,ce,he,de){"use strict";function me(e,t){if(this._viewer=e,this._cesium=t,this._core=new i,this._Label=new s(this._viewer,this._cesium),this._Circle=new u(this._viewer,this._cesium),this._Box=new c(this._viewer,this._cesium),this._Cone=new d(this._viewer,this._cesium),this._Color=new o(this._viewer,this._cesium),this._Polyline=new a(this._viewer,this._cesium),this._Rectangle=new m(this._viewer,this._cesium),this._Polygon=new p(this._viewer,this._cesium),this._ImageLabel=new g(this._viewer,this._cesium),this._FeatureLayer=new v(this._viewer,this._cesium),this._GeoJsonFeatureLayer=new y(this._viewer,this._cesium,this._ImageryProvidererid),this._Ellipsoid=new E(this._viewer,this._cesium),this._PointModel=new R(this._viewer,this._cesium),this._wall=new f(this._viewer,this._cesium),this._Terrain=new D(this._viewer,this._cesium),this._createdynamicObject=new P(this._viewer,this._cesium),this._createVector=new x(this._viewer,this._cesium),this._GeometryCreator,this._ImageryLayer=new _(this._viewer,this._cesium),this._TerrainProvider=new T(this._viewer,this._cesium),this._MapGeoJsonFeatureLayer=new I(this._viewer,this._cesium),this._VolumeGeoJsonFeatureLayer=void 0,this._PolygonVectorGeoJsonFeatureLayer=void 0,this._skyBox=new O(this._viewer,this._cesium),this._flowField=new N(this._viewer,this._cesium),this._vectorediting=new k(this._viewer,this._cesium),this.VectorGeoJsonFeatureLayer=new z(this._viewer,this._cesium),this._straightArrow=new J(this._viewer,this._cesium),this._SimpleGraphic=new ne(this._viewer,this._cesium),this._popupmessage=new Q(this._viewer,this._cesium),this.VectorImgFeatureLayer=new ce(this._viewer,this._cesium),this._TerrainModifier=new he(this._viewer,this._cesium),!t.Resource._Implementations.createImageSGS){var h=new ue({workerPath:window.SmartEarthRootUrl+"/Workers/nullValueRemoveWorker.js"});t.Resource._Implementations.createImageSGS=function(e,t,n){var a={r:0,g:0,b:0,a:255};if(-1<e.indexOf("nullvalue=")){var i=e.split("nullvalue=")[1].split("&")[0].split("%2C");a.r=i[0],a.g=i[1],a.b=i[2]}if(-1<e.indexOf("nulltolerance="))var s=e.split("nulltolerance=")[1].split("&")[0];var l=new Image,u=document.createElement("canvas"),c=u.getContext("2d");l.url=e,l.onload=function(){if(null!=l.url&&-1!=l.url.indexOf("nullvalue")){delete l.url,u.width=l.width,u.height=l.height,c.drawImage(l,0,0),l.imageProcesses=[];for(var e=l.width/8,t=l.height,i=0;i<8;i++){var r=i*e,o=c.getImageData(r,0,e,t).data;l.imageProcesses[i]=h.queueWorkItem({nullValue:a,nullTolerance:s,canvasData:o,width:e,height:t,startX:r})}Cesium.when.all(l.imageProcesses,function(e){for(var t=0;t<e.length;t++){for(var i=c.createImageData(e[t].width,e[t].height),r=0;r<e[t].canvasData.length;r++)i.data[r]=e[t].canvasData[r];c.putImageData(i,e[t].startX,0)}l.src=u.toDataURL(),n.resolve(l)}).otherwise(function(e){console.log(e)})}else n.resolve(l)},l.onerror=function(e){n.reject(e)},t&&(Cesium.TrustedServers.contains(e)?l.crossOrigin="use-credentials":l.crossOrigin=""),l.src=e}}}return me.prototype.create3DTilesets=function(e,t,i,r,o,n,a){var s=this._D3Tileset.create3DTilesets(e,t,i,r,o,n,a);return this._D3Tilesets||(this._D3Tilesets=[],this._3DTilesets=[]),this._D3Tilesets.push(s.item),s},me.prototype.set3DTilesetsAlpha=function(t){this._D3Tilesets&&this._D3Tilesets.forEach(function(e){e.style=0==t?new Cesium.Cesium3DTileStyle({show:!1}):1==t?new Cesium.Cesium3DTileStyle({show:!0}):new Cesium.Cesium3DTileStyle({color:"color('rgba(255,255,255,"+t+")')"})})},me.prototype.createTerrainModifier=function(e,t,i){return this._TerrainModifier.createTerrainModifier(e,t,i)},me.prototype.createS3MLayer=function(e,t,i){var r=new le({context:t._context,url:e});return t.primitives.add(r),r.readyPromise.then(function(){i&&i()}).otherwise(function(e){console.log(e)}),r},me.prototype.createCloudMap=function(e,t,i,r){return new p(this._viewer,this._cesium).createCloudMap(e,t,i,r)},me.prototype.addVideoPolygon=function(e,t){return new p(this._viewer,this._cesium).addVideoPolygon(e,t)},me.prototype.addVideoBox=function(e,t){return new p(this._viewer,this._cesium).addVideoBox(e,t)},me.prototype.CZML=function(e,t,i){return new ie(this._viewer,this._cesium).addCZML(e,t,i)},me.prototype.addHeatMap=function(e,t,i){return new re(this._viewer,this._cesium).addHeatMap(e,t,i)},me.prototype.createArrow=function(e,t,i){var r=null,o=void 0,n=void 0;switch(t?n="function"==typeof t?(o={},t):(o=t,i):o={},e){case"straightArrow":(r=new W(this._viewer,this._cesium)).startDraw(),this._core.Entityadd(r);break;case"attackArrow":(r=new U(this._viewer,this._cesium,o)).startDraw(n),this._core.Entityadd(r);break;case"attackArrow3D":(r=new U(this._viewer,this._cesium)).startDraw3D(n),this._core.Entityadd(r);break;case"pincerArrow":(r=new q(this._viewer,this._cesium)).startDraw(),this._core.Entityadd(r)}return r},me.prototype.militaryPlotting=function(e,t,i,r){var o=this._straightArrow,n=null,a=void 0,s=void 0;i?s="function"==typeof i?(a={},i):(a=i,r):a={};var l=function(e){o.MilitaryStandardObj.length&&!o.editHandler?o.edit(o.openEdit,o.editOption):!o.MilitaryStandardObj.length&&o.editHandler&&o.edit(!1),s&&s(e)};switch(e){case"StraightArrow":n=o.createStraightArrow(t,a,l);break;case"SwallowtailArrow":n=o.createSwallowtailArrow(t,a,l);break;case"PincerArrow":n=o.createPincerArrow(t,a,l);break;case"AttackArrow":n=o.createAttackArrow(t,a,l);break;case"GatheringPlace":n=o.createHandlerPolygon(t,a,l);break;case"RoundedRectangle":n=o.createRoundedRectangle(t,a,l);break;case"Sector":n=o.createSector(t,a,l);break;case"Bow":n=o.createBow(t,a,l);break;case"Bezierline":n=o.createBezierline(a,l);break;case"BezierArrow":n=o.createBezierArrow(a,l)}return n},me.prototype.MilitaryCopy=function(e){return this._straightArrow.copyJb(e)},me.prototype.NightMode=function(e){var t=this._viewer,i=t.imageryLayers.length,r=void 0,o=void 0;o=r=e?.15:1;for(var n=0;n<i;n++)t.imageryLayers.get(n).brightness=r;this._D3Tilesets&&this._D3Tilesets.forEach(function(e){e.imageBasedLightingFactor.x=o,e.imageBasedLightingFactor.y=o}),t.scene.skyAtmosphere.show=!e},me.prototype.SaveMilitaryStandard=function(){this._straightArrow.save()},me.prototype.OpenMilitaryStandard=function(e){this._straightArrow.open(e)},me.prototype.ClearMilitaryStandard=function(){this._straightArrow.clear()},me.prototype.getEntityById=function(e){return this._straightArrow.getEntityById(e)},me.prototype.StraightArrowPerfect=function(){var e=new K(this._viewer,this._cesium);this._core.Entityadd(e),e.createStraightArrowTwoPerfect()},me.prototype.startModify=function(e){this._straightArrow.edit(e)},me.prototype.createSimpleGraphic=function(e,t,i){return this._SimpleGraphic.createSimpleGraphic(e,t,i)},me.prototype.addSimpleGraphic=function(e,t,i){return this._SimpleGraphic.addSimpleGraphic(e,t,i)},me.prototype.GeoWTFS=function(e){return this._TdtLabel||(this._TdtLabel=new de(this._viewer,this._cesium)),this._TdtLabel.GeoWTFS(e)},me.prototype.createGeoJsonFeatureLayerProviderOptimization=function(e,t,i,r,o,n){var a=new z(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.VolumeVectorGeoJsonFeatureLayerOptimization(e,t,i,r,o,n)},me.prototype.createGeoJsonFeatureLayerProviderGisOptimization=function(e,t,i,r,o,n){var a=new z(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.VolumeVectorGeoJsonFeatureLayerGisOptimization(e,t,i,r,o,n)},me.prototype.VolumeVectorGeoJsonFeatureLayerGis=function(e,t,i,r,o,n){var a=new z(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.VolumeVectorGeoJsonFeatureLayerGis(e,t,i,r,o,n)},me.prototype.PointVectorGeoJsonFeatureLayerGis=function(e,t,i,r,o,n){var a=new z(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.PointVectorGeoJsonFeatureLayerGis(e,t,i,r,o,n)},me.prototype.PolylineVectorGeoJsonFeatureLayerGis=function(e,t,i,r,o,n){var a=new z(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.PolylineVectorGeoJsonFeatureLayerGis(e,t,i,r,o,n)},me.prototype.createGeoJsonFeatureLayerProviderClassOptimization=function(e,t,i,r,o,n){var a=new z(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.VolumeVectorGeoJsonFeatureLayerClassOptimization(e,t,i,r,o,n)},me.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization=function(e,t,i,r,o,n){var a=new z(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.VolumeVectorGeoJsonFeatureLayerOptimization1(e,t,i,r,o,n)},me.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimizationtest=function(e,t,i,r,o,n){var a=new z(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createVolumeVectorGeoJsonFeatureLayerDthOptimization(e,t,i,r,o,n)},me.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest=function(e,t,i,r,o,n){var a=new z(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest(e,t,i,r,o,n)},me.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationtest=function(e,t,i,r,o,n){var a=new z(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.VolumeVectorGeoJsonFeatureLayerOptimizationtest(e,t,i,r,o,n)},me.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization=function(e,t,i,r,o,n){var a=new z(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization(e,t,i,r,o,n)},me.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimizationxp=function(e,t,i,r,o,n){var a=new z(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createVolumeVectorGeoJsonFeatureLayerJCDthOptimizationxp(e,t,i,r,o,n)},me.prototype.createGeojsonImage=function(e){return new z(this._viewer,this._cesium).createGeojsonImage(e)},me.prototype.createGeoJsonFeatureLayerProvider=function(e,t,i,r,o,n){var a=new z(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.VectorGeoJsonFeatureLayer(e,t,i,r,o,n)},me.prototype.createGeojsonFeatureLayer=function(e,t,i,r,o,n){var a=new y(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createGeojsonFeatureLayer(e,t,i,r,o,n)},me.prototype.createGeojsonKmlFeatureLayer=function(e,t,i,r,o){var n=new y(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(i=S.selectedItem.id),i=this._core.isnull(i)?0:i,n.createGeojsonKmlFeatureLayer(e,t,i,r,o)},me.prototype.sfsterrainprovider=function(e,t,i,r,o){var n=new D(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(i=S.selectedItem.id),i=this._core.isnull(i)?0:i,n.createSFSTerrain(e,t,i,r,o)},me.prototype.sfsterrainprovider71=function(e,t,i,r,o){var n=new D(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(i=S.selectedItem.id),i=this._core.isnull(i)?0:i,n.createSFSTerrain71(e,t,i,r,o)},me.prototype.createTerrain=function(e,t,i,r,o){var n=new D(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(i=S.selectedItem.id),i=this._core.isnull(i)?0:i,n.createTerrain(e,t,i,r,o)},me.prototype.createTerrainLayer=function(e,t,i,r,o,n){var a=new D(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(i=S.selectedItem.id),i=this._core.isnull(i)?0:i,a.createTerrainLayer(e,t,i,r,o,n)},me.prototype.createArcGISTerrain=function(e,t,i,r,o){var n=new D(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(i=S.selectedItem.id),i=this._core.isnull(i)?0:i,n.createArcGISTerrain(e,t,i,r,o)},me.prototype.createCesiumTerrain=function(e,t,i,r){var o=new D(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(i=S.selectedItem.id),i=this._core.isnull(i)?0:i,o.createCesiumTerrain(e,t,i,r)},me.prototype.createVectorEditing=function(){return new k(this._viewer,this._cesium).createVectorEditing()},me.prototype.createDynamicObject=function(e,t,i){return this._createdynamicObject.Start(e,t,i)},me.prototype.addmodle=function(e){return this._createdynamicObject.addmodle(e)},me.prototype.createSatelliteTrail=function(e){return new ae(this._viewer,this._cesium).createSatelliteTrail(e)},me.prototype.executePauseFly3DPaths=function(){return this._createdynamicObject.executePauseFly3DPaths()},me.prototype.executePlayForwardFly3DPaths=function(){return this._createdynamicObject.executePlayForwardFly3DPaths()},me.prototype.executePlayReverseFly3DPaths=function(){return this._createdynamicObject.executePlayReverseFly3DPaths()},me.prototype.executeSignout=function(){return this._createdynamicObject.executeSignout()},me.prototype.createLabel=function(e,t,i,r,o){var n=new s(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,n.createLabel(e,t,i,r,o)},me.prototype.createPosition=function(e,t,i){return new h(this._viewer,this._cesium).createPosition(e,t,i)},me.prototype.createLocation=function(e,t,i){return this._Point.createLocation(e,t,i)},me.prototype.createPoint=function(e,t,i,r,o,n){return this._Point.createPoint(e,t,i,r,o,n)},me.prototype.createLonlat=function(e){return this._Point.createLonlat(e)},me.prototype.createDivPoint=function(e,t,i,r,o){return this._Point.createDivPoint(e,t,i,r,o)},me.prototype.createDivPointAndCallback=function(e,t,i,r,o,n){return this._Point.createDivPointAndCallback(e,t,i,r,o,n)},me.prototype.createRichTextPoint=function(e,t,i,r){return this._Point.createRichTextPoint(e,t,i,r)},me.prototype.SkyBox=function(e,t){return this._skyBox.SkyBox(e,t)},me.prototype.setSpaceBackground=function(e){return this._skyBox.setSpaceBackground(e)},me.prototype.createWindField=function(e,t){return this._flowField.createWindField(e,t)},me.prototype.createTrailLinePath=function(e,t,i){return this._trailLine.createPath(e,t,i)},me.prototype.createTrailLineWall=function(e,t){return this._trailLine.createWall(e,t)},me.prototype.createTrailLine=function(e,t){return this._trailLine.createLine(e,t)},me.prototype.createModel=function(e,t,i,r,o,n){return new R(this._viewer,this._cesium).createModel(e,t,i,r,o,n)},me.prototype.createModelEditable=function(e,t,i,r,o,n){return new R(this._viewer,this._cesium).createModelEditable(e,t,i,r,o,n)},me.prototype.createPointModel=function(e,t){return this._PointModel.createPointModel(e,t)},me.prototype.executePolyline=function(e){return new a(this._viewer,this._cesium).executePolyline(e)},me.prototype.executePolygon=function(e){return new p(this._viewer,this._cesium).executePolygon(e)},me.prototype.executeWall=function(e,t){return new f(this._viewer,this._cesium).executeWall(e,t)},me.prototype.createWall=function(e,t,i,r){return new f(this._viewer,this._cesium).createWall(e,t,i,r)},me.prototype.executePolyline1=function(e){return new a(this._viewer,this._cesium).executePolyline1(method)},me.prototype.createPolylineVolume=function(e,t,i,r,o){return new n(this._viewer,this._cesium).createPolylineVolume(e,t,i,r,o)},me.prototype.createCorridor=function(e,t,i,r){return new l(this._viewer,this._cesium).createCorridor(e,t,i,r)},me.prototype.createThermodynamic=function(e){return new te(this._viewer,this._cesium).createThermodynamic(e)},me.prototype.addViewCone=function(e){return new se(this._viewer,this._cesium).addViewCone(e)},me.prototype.createViewCone=function(e,t){return new se(this._viewer,this._cesium).createViewCone(e,t)},me.prototype.createModifyMesh=function(e,t,i,r,o){return new ee(this._viewer,this._cesium).createModifyMesh(e,t,i,r,o)},me.prototype.createModelModifier=function(r,o,n,a){var s=this,l=[];return this._D3Tilesets&&this._D3Tilesets.forEach(function(e,t){var i=s.createModifyMesh(r,o,n,e,a);s._D3Tilesets[t]=i.item,l.push(i)}),{remove:function(){l.forEach(function(e,t){s._D3Tilesets[t]=e.remove()}),l=[]}}},me.prototype.createPopupMessage=function(e){return new Q(this._viewer,this._cesium).createPopupMessage(e)},me.prototype.createMeasurement=function(e){return new Q(this._viewer,this._cesium).createMeasurement(e)},me.prototype.createPlotting=function(e){return new Q(this._viewer,this._cesium).createPlotting(e)},me.prototype.createPopupProp=function(e,t){return this._popupmessage.createPopupProp(e,t)},me.prototype.createModelLibrary=function(e){return this._popupmessage.createModelLibrary(e)},me.prototype.createHawkeye=function(e,t){return new X(this._viewer,this._cesium).createHawkeye(e,t)},me.prototype.createGeoJsonFeatureLayer=function(e,t,i,r,o){var n=new y(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,n.createGeoJsonFeatureLayer(e,t,i,r,o)},me.prototype.createBillboardGeoJsonFeature=function(e,t,i,r,o,n){var a=new y(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createBillboardGeoJsonFeature(e,t,i,r,o,n)},me.prototype.createBillboardPointGeoJsonFeatureLayer=function(e,t,i,r,o){var n=new H(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,n.createBillboardPointGeoJsonFeatureLayer(e,t,i,r,o)},me.prototype.createKmlLayer=function(e,t,i){return new Z(this._viewer,this._cesium).createKmlLayer(e,t,i)},me.prototype.addKmlLayer=function(e,t,i,r){return new Z(this._viewer,this._cesium).addKmlLayer(e,t,i,r)},me.prototype.createVolumeVectorGeoJsonFeatureLayerArcgis=function(e,t,i,r,o){var n=new G(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,n.createVolumeVectorGeoJsonFeatureLayer(e,t,i,r,o)},me.prototype.createBillboardGeoJsonFeatureLayerProvider=function(e,t,i,r,o,n){var a=new H(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createBillboardGeoJsonFeatureLayerProvider(e,t,i,r,o,n)},me.prototype.createPointGeojsonFeatureLayer=function(e,t,i,r,o,n){var a=new y(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createPointGeojsonFeatureLayer(e,t,i,r,o,n)},me.prototype.createCirclePointGeoJsonFeatureLayer=function(e,t,i,r,o){var n=new y(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,n.createCirclePointGeoJsonFeatureLayer(e,t,i,r,o)},me.prototype.createModelPointGeoJsonFeatureLayer=function(e,t,i,r,o,n){var a=new y(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createModelPointGeoJsonFeatureLayer(e,t,i,r,o,n)},me.prototype.createPrimitivLabelPointGeoJsonFeatureLayer=function(e,t,i,r,o){var n=new b(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,n.createLabelPointGeoJsonFeatureLayer(e,t,i,r,o)},me.prototype.createLabelPointGeoJsonFeatureLayer=function(e,t,i,r,o,n){var a=new y(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createLabelPointGeoJsonFeatureLayer(e,t,i,r,o,n)},me.prototype.createSXTLabelGeoJsonFeatureLayerProvider=function(e,t,i,r,o,n){var a=new b(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createSXTLabelGeoJsonFeatureLayerProvider(e,t,i,r,o,n)},me.prototype.createCustomCallbackGeoJsonFeatureLayerProvider=function(e,t,i,r,o,n,a){var s=new b(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,s.createCustomCallbackGeoJsonFeatureLayerProvider(e,t,i,r,o,a,n)},me.prototype.createLabelPolymerizationGeoJsonFeatureLayer=function(e,t,i,r,o){var n=new b(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,n.createLabelPolymerizationGeoJsonFeatureLayer(e,t,i,r,o)},me.prototype.createPointPolymerizationGeoJsonFeatureLayer=function(e,t,i,r,o,n){var a=new b(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createPointPolymerizationGeoJsonFeatureLayer(e,t,i,r,o,n)},me.prototype.createLabelpolymerizationGeoJsonFeatureLayer=function(e,t,i,r,o,n){var a=new b(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createLabelpolymerizationGeoJsonFeatureLayer(e,t,i,r,o,n)},me.prototype.createLabelpolymerizationGeoJsonFeatureLayers=function(e,t,i,r,o,n){var a=new b(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createLabelpolymerizationGeoJsonFeatureLayers(e,t,i,r,o,n)},me.prototype.createStreetscapeGeoJsonFeatureLayer=function(e,t,i,r,o,n){var a=new y(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createStreetscapeGeoJsonFeatureLayer(e,t,i,r,o,n)},me.prototype.createPrimitiveLabelGeoJsonFeatureLayerProvider=function(e,t,i,r,o,n){var a=new b(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createLabelGeoJsonFeatureLayerProvider(e,t,i,r,o,n)},me.prototype.createLabelImageGeoJsonFeatureLayerProvider=function(e,t,i,r,o,n){var a=new b(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createLabelImageGeoJsonFeatureLayerProvider(e,t,i,r,o,n)},me.prototype.createLabelImageGeoJsonFeatureLayerProvider1=function(e,t,i,r,o,n){var a=new b(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createLabelImageGeoJsonFeatureLayerProvider1(e,t,i,r,o,n)},me.prototype.createLabelRichtextGeoJsonFeatureLayerProvider=function(e,t,i,r,o,n){var a=new b(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createLabelRichtextGeoJsonFeatureLayerProvider(e,t,i,r,o,n)},me.prototype.createModelGeoJsonFeatureLayerProvider=function(e,t,i,r,o,n){var a=new z(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createModelGeoJsonFeatureLayerProvider(e,t,i,r,o,n)},me.prototype.createPointGeoJsonFeatureLayerProvider=function(e,t,i,r,o,n){var a=new z(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createPointGeoJsonFeatureLayerProvider(e,t,i,r,o,n)},me.prototype.createArcGisImageryLayer=function(e,t,i,r,o,n){var a=new _(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(i=S.selectedItem.id),i=this._core.isnull(i)?0:i,a.createArcGisImageryLayer(e,t,i,r,o,n)},me.prototype.createImageryLayerGrid=function(e){return new _(this._viewer,this._cesium).createImageryLayerGrid(e)},me.prototype.createWebMapServerImageLayer=function(e,t,i,r,o,n){var a=new _(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(i=S.selectedItem.id),i=this._core.isnull(i)?0:i,a.createWebMapServerImageLayer(e,t,i,r,o,n)},me.prototype.createWebMapTileServerImageLayer=function(e,t,i,r,o,n){var a=new _(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(i=S.selectedItem.id),i=this._core.isnull(i)?0:i,a.createWebMapTileServerImageLayer(e,t,i,r,o,n)},me.prototype.createUrlTemplateImageryProvider=function(e,t,i,r,o,n){var a=new _(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(i=S.selectedItem.id),i=this._core.isnull(i)?0:i,a.createUrlTemplateImageryProvider(e,t,i,r,o,n)},me.prototype.createCirclePointGeoJsonFeatureLayer=function(e,t,i,r,o){var n=new y(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,n.createCirclePointGeoJsonFeatureLayer(e,t,i,r,o)},me.prototype.createPolylineGeoJsonFeatureLayer=function(e,t,i,r,o,n){var a=new y(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createPolylineGeoJsonFeatureLayer(e,t,i,r,o,n)},me.prototype.createPrimitivePolylineGeoJsonFeatureLayer=function(e,t,i,r,o,n){var a=new C(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createPolylineGeoJsonFeatureLayer(e,t,i,r,o,n)},me.prototype.createPrimitiveGroundPolylineGeoJsonFeatureLayer=function(e,t,i,r,o,n){var a=new C(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createGroundPolylineGeoJsonFeatureLayer(e,t,i,r,o,n)},me.prototype.exectPointModel=function(e,t,i,r,o,n){var a=new R(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.exectPointModel(e,t,i,r,o,n)},me.prototype.createPolygonModel=function(e,t,i,r,o,n){var a=new R(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createPolygonModel(e,t,i,r,o,n)},me.prototype.modelMove=function(){return new R(this._viewer,this._cesium).modelMove()},me.prototype.createPrimitivePolylineVectorGeoJsonFeatureLayerProvider=function(e,t,i,r,o,n){var a=new C(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createPolylineVectorGeoJsonFeatureLayerProvider(e,t,i,r,o,n)},me.prototype.createPolylineVectorGeoJsonFeatureLayerProviderModel=function(e,t,i,r,o,n){var a=new C(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createPolylineVectorGeoJsonFeatureLayerProviderModel(e,t,i,r,o,n)},me.prototype.createpolylineVolumeGeojsonFeatureLayer=function(e,t,i,r,o,n){var a=new y(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createpolylineVolumeGeojsonFeatureLayer(e,t,i,r,o,n)},me.prototype.createpolylineVolumeGeojsonPrimitiveLayer=function(e,t,i,r,o,n){var a=new y(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createpolylineVolumeGeojsonPrimitiveLayer(e,t,i,r,o,n)},me.prototype.createVolumeGeoJsonFeatureLayer=function(e,t,i,r,o){var n=new L(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,n.createVolumeGeoJsonFeatureLayer(e,t,i,r,o)},me.prototype.createVolumeGeoJsonFeatureLayerProvider=function(e,t,i,r,o,n){var a=new L(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createVolumeGeoJsonFeatureLayerProvider(e,t,i,r,o,n)},me.prototype.createVolumeVectorGeoJsonFeatureLayerOptimizations=function(e,t,i,r,o,n){var a=new L(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createVolumeVectorGeoJsonFeatureLayerOptimization(e,t,i,r,o,n)},me.prototype.createVolumeVectorGeoJsonFeatureLayer=function(e,t,i,r,o,n){var a=new L(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createVolumeVectorGeoJsonFeatureLayer(e,t,i,r,o,n)},me.prototype.createPolygonVectorGeoJsonFeatureLayer=function(e,t,i,r,o,n){var a=new M(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createVolumeVectorGeoJsonFeatureLayer(e,t,i,r,o,n)},me.prototype.createVolumeVectorGeoJsonFeatureLayerOptimization=function(e,t,i,r,o,n){var a=new M(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createVolumeVectorGeoJsonFeatureLayerOptimization(e,t,i,r,o,n)},me.prototype.createVolumeVectorGeoJsonFeatureLayersd=function(e,t,i,r,o,n){var a=new M(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createVolumeVectorGeoJsonFeatureLayersd(e,t,i,r,o,n)},me.prototype.createWallGeoFeatureLayer=function(e,t,i,r,o,n){var a=new y(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createWallGeoFeatureLayer(e,t,i,r,o,n)},me.prototype.createWallPrimitiveGeoFeatureLayer=function(e,t,i,r,o,n){var a=new A(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createWallPrimitiveGeoFeatureLayer(e,t,i,r,o,n)},me.prototype.createWallGeoJsonFeatureLayerProvider=function(e,t,i,r,o,n){var a=new A(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createWallGeoJsonFeatureLayerProvider(e,t,i,r,o,n)},me.prototype.createImageryProvider=function(e,t,i,r,o,n,a){var s=new _(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,s.createImageryProvider(e,t,i,r,o,n,a)},me.prototype.createCacheImageryProvider=function(e,t,i,r,o,n){var a=new _(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(i=S.selectedItem.id),i=this._core.isnull(i)?0:i,a.createCacheImageryProvider(e,t,i,r,o,n)},me.prototype.createterrainProvider=function(e,t,i,r){return this._TerrainProvider.createterrainProvider(e,t,i,r)},me.prototype.createPolylineImageryProviderer=function(e,t,i,r){return this._ImageryLayer.createPolylineImageryProviderer(e,t,i,r)},me.prototype.createMVTWithStyle=function(e,t,i,r){return this._ImageryLayer.createMVTWithStyle(e,t,i,r)},me.prototype.createPolygonGeoJsonFeatureLayer=function(e,t,i,r,o,n){var a=new y(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createPolygonGeoJsonFeatureLayer(e,t,i,r,o,n)},me.prototype.createPolygonGeoJsonFeatureLayer1=function(e,t,i,r,o){var n=new w(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,n.createPolygonGeoJsonFeatureLayer(e,t,i,r,o)},me.prototype.createPolygonVectorGeoJsonFeatureLayerProvider=function(e,t,i,r,o,n){var a=new w(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createPolygonVectorGeoJsonFeatureLayerProvider(e,t,i,r,o,n)},me.prototype.createVolumeVectorGeoJsonFeatureLayerDth=function(e,t,i,r,o,n){var a=new M(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createVolumeVectorGeoJsonFeatureLayerDth(e,t,i,r,o,n)},me.prototype.createPolygonVectorGeoJsonFeatureLayerProviderModel=function(e,t,i,r,o,n){var a=new w(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createPolygonVectorGeoJsonFeatureLayerProviderModel(e,t,i,r,o,n)},me.prototype.createPolygonVectorGeoJsonFeatureLayerProviderls=function(e,t,i,r,o,n){var a=new w(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createPolygonVectorGeoJsonFeatureLayerProviderls(e,t,i,r,o,n)},me.prototype.createPolygonVectorGeoJsonFeatureLayerProviderlsd=function(e,t,i,r,o,n){var a=new w(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createPolygonVectorGeoJsonFeatureLayerProviderlsd(e,t,i,r,o,n)},me.prototype.createArcgisPolygonVectorGeoJsonFeatureLayerProviderls=function(e,t,i,r,o,n){var a=new w(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createArcgisPolygonVectorGeoJsonFeatureLayerProviderls(e,t,i,r,o,n)},me.prototype.createPolygonVectorFeatureLayerProvider=function(e,t,i,r,o){var n=new w(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,n.createPolygonVectorFeatureLayerProvider(e,t,i,r,o)},me.prototype.createPolygonVectorMonomerFeatureLayerProvider=function(e,t,i,r,o){var n=new w(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,n.createPolygonVectorMonomerFeatureLayerProvider(e,t,i,r,o)},me.prototype.createPolygonMapGeoJsonFeatureLayer=function(e,t,i,r,o,n){return this._MapGeoJsonFeatureLayer.createPolygonMapGeoJsonFeatureLayer(e,t,i,r,o,n)},me.prototype.createPointGeojsonFeatureLayer=function(e,t,i,r,o,n){var a=new y(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,a.createPointGeojsonFeatureLayer(e,t,i,r,o,n)},me.prototype.createGeoJsonDataSource=function(e,t,i,r,o){var n=new y(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,n.createGeoJsonDataSource(e,t,i,r,o)},me.prototype.DeleteObject=function(e){if(this._core.isnull(e._viewer))console.log("obj is null");else{for(var t in e.deleteObject(),e)delete e[t];e=void 0}},me.prototype.createCircle=function(e,t,i,r){return new u(this._viewer,this._cesium).createCircle(e,t,i,r)},me.prototype.CreateRectangle=function(e,t,i,r,o){return new m(this._viewer,this._cesium).CreateRectangle(e,t,i,r,o)},me.prototype.createBox=function(e,t,i,r){return(t=new c(this._viewer,this._cesium)).createBox(e,t,i,r)},me.prototype.createBillboardbatch=function(e){return new $(this._viewer,this._cesium).createBillboardbatch(e)},me.prototype.createCone=function(e,t,i,r){return new d(this._viewer,this._cesium).createCone(e,t,i,r)},me.prototype.createRectangularSensor=function(e,t,i,r){return new d(this._viewer,this._cesium).createRectangularSensor(e,t,i,r)},me.prototype.createRadarMaskScan=function(e,t,i,r){return new d(this._viewer,this._cesium).createRadarMaskScan(e,t,i,r)},me.prototype.createRadarMask=function(e,t,i,r){return new d(this._viewer,this._cesium).createRadarMask(e,t,i,r)},me.prototype.createConeRadar=function(e,t){return new d(this._viewer,this._cesium).createConeRadar(e,t)},me.prototype.createColor=function(e,t,i,r){return new o(this._viewer,this._cesium).createColor(e,t,i,r)},me.prototype.createPolyline=function(e,t,i,r,o){var n=new a(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,n.createPolyline(e,t,i,this._core.isnull(r)?0:r,o)},me.prototype.createLink=function(e,t,i){return new a(this._viewer,this._cesium).createLink(e,t,i)},me.prototype.createLinkPro=function(e,t,i){return new a(this._viewer,this._cesium).createLinkPro(e,t,i)},me.prototype.createLinkPros=function(e){return new a(this._viewer,this._cesium).createLinkPros(e)},me.prototype.createPolygon=function(e,t,i,r,o){var n=new p(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,n.createPolygon(e,t,i,r,o)},me.prototype.createSector=function(e,t,i,r,o){return new p(this._viewer,this._cesium).createSector(e,t,i,r,o)},me.prototype.executeEllipsoid=function(e,t,i,r){t=new E(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,t.createEllipsoid(e,t,i,r)},me.prototype.createImageLabel=function(e,t,i,r){var o=new g(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(i=S.selectedItem.id),i=this._core.isnull(i)?0:i,o.createImageLabel(e,t,i,r)},me.prototype.toHtmlColor=function(e){return this._Color.toHtmlColor(e)},me.prototype.CreateLabel=function(e,t,i,r,o,n){var a=new s(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(o=S.selectedItem.id),o=this._core.isnull(o)?0:o,a.CreateLabel(e,t,i,r,o,n)},me.prototype.CreateImageLabel=function(e,t,i,r,o){var n=new g(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,n.CreateImageLabel(e,t,i,r,o)},me.prototype.createImage=function(e,t,i,r,o){var n=new g(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,n.CreateImageLabel(e,t,i,r,o)},me.prototype.CreatePolyline=function(e,t,i,r,o){var n=new a(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(r=S.selectedItem.id),r=this._core.isnull(r)?0:r,n.CreatePolyline(e,t,i,r,o)},me.prototype.CreateCircle=function(e,t,i,r,o,n){var a=new u(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(o=S.selectedItem.id),o=this._core.isnull(o)?0:o,a.CreateCircle(e,t,i,r,o,n)},me.prototype.CreateEllipse=function(e,t,i,r,o,n,a,s){var l=new u(this._viewer,this._cesium);return this._core.isnull(a)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(a=S.selectedItem.id),a=this._core.isnull(a)?0:a,l.CreateEllipse(e,t,i,r,o,n,a,s)},me.prototype.CreateBox=function(e,t,i,r,o,n,a,s){var l=new c(this._viewer,this._cesium);return this._core.isnull(a)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(a=S.selectedItem.id),a=this._core.isnull(a)?0:a,l.CreateBox(e,t,i,r,o,n,a,s)},me.prototype.CreatePosition=function(e,t,i,r,o,n,a,s){return new h(this._viewer,this._cesium).CreatePosition(e,t,i,r,o,n,a,s)},me.prototype.createColor=function(e,t,i,r){return new o(this._viewer,this._cesium).CreateColor(e,t,i,r)},me.prototype.CreateCone=function(e,t,i,r,o,n,a,s){var l=new d(this._viewer,this._cesium);return this._core.isnull(a)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(a=S.selectedItem.id),a=this._core.isnull(a)?0:a,l.CreateCone(e,t,i,r,o,n,a,s)},me.prototype.CreateCylinder=function(e,t,i,r,o,n,a,s){var l=new d(this._viewer,this._cesium);return this._core.isnull(a)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(a=S.selectedItem.id),a=this._core.isnull(a)?0:a,l.CreateCylinder(e,t,i,r,o,n,a,s)},me.prototype.CreateSphere=function(e,t,i,r,o,n,a,s){var l=new E(this._viewer,this._cesium);return this._core.isnull(a)&&!this._core.isnull(S.selectedItem)&&"group"==S.selectedItem.type&&(a=S.selectedItem.id),a=this._core.isnull(a)?0:a,l.CreateSphere(e,t,i,r,o,n,a,s)},me.prototype.CreatePolylinePlus=function(e,t){var i=new B(this._viewer,this._cesium,e);return i.startCreate(t),this._core.Entityadd(i),i},me.prototype.CreatePolygonPlus=function(e,t){var i=new j(this._viewer,this._cesium,e);return i.startCreate(t),this._core.Entityadd(i),i},me.prototype.createPointOptimization=function(e,t){return new r(this._viewer,this._cesium).createPointOptimization(e,t)},me.prototype.createRectangleOptimization=function(e,t){return new m(this._viewer,this._cesium).createRectangleOptimization(e,t)},me.prototype.createCircleOptimization=function(e,t){return new u(this._viewer,this._cesium).createCircleOptimization(e,t)},me.prototype.createCylinderOptimization=function(e,t){return new d(this._viewer,this._cesium).createCylinderOptimization(e,t)},me.prototype.createPointOptimization=function(e,t){return new r(this._viewer,this._cesium).createPointOptimization(e,t)},me.prototype.CreatePolygonEdit=function(){return this._core.EntityEdit(this._viewer,this._cesium)},me.prototype.getModelLibrary=function(e){return!this._modelLibrary&&e&&(this._modelLibrary=new oe(e,Cesium)),this._modelLibrary},me.prototype.CreateVectorImageFeatureLayer=function(e,t,i,r,o,n,a){return this.VectorImgFeatureLayer.CreateVectorImageFeatureLayer(e,t,i,r,o,n,a)},me.prototype.createVolumetricMeasureTool=function(){return new Y(this._viewer,this._cesium)},Object.defineProperties(me.prototype,{SimpleGraphic:{get:function(){return this._SimpleGraphic}},MilitaryPlotting:{get:function(){return this._straightArrow}},_D3Tileset:{get:function(){return new t(this._viewer,this._cesium)}}}),Object.defineProperties(me.prototype,{_trailLine:{get:function(){return new V(this._viewer,this._cesium)}}}),Object.defineProperties(me.prototype,{_Point:{get:function(){return new r(this._viewer,this._cesium)}},GeometryCreator:{CreateLinearRingGeometry:function(e){return{}}}}),me}),define("SGWorld/Analysis/ElevationContour",["../Core/Core","../Creator/Color"],function(i,t){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i}return e.prototype.createElevationContour=function(e,t,i){var r=this;r.item={};r.item.selectedShading=t;e=e;var o,n=r._viewer.scene.globe;return e?("elevation"===t?(o=new r._cesium.Material({fabric:{type:"ElevationColorContour",materials:{contourMaterial:{type:"ElevationContour"},elevationRampMaterial:{type:"ElevationRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, elevationRampMaterial.alpha)"}},translucent:!1}),r.item.shadingUniforms=o.materials.elevationRampMaterial.uniforms,r.item.shadingUniforms.minimumHeight=r._core.defaultValue(i.min,-414),r.item.shadingUniforms.maximumHeight=r._core.defaultValue(i.max,8844),r.item.contourUniforms=o.materials.contourMaterial.uniforms):"slope"===t?(o=new r._cesium.Material({fabric:{type:"SlopeColorContour",materials:{contourMaterial:{type:"ElevationContour"},slopeRampMaterial:{type:"SlopeRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? slopeRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, slopeRampMaterial.alpha)"}},translucent:!1}),r.item.shadingUniforms=o.materials.slopeRampMaterial.uniforms,r.item.contourUniforms=o.materials.contourMaterial.uniforms):"aspect"===t?(o=new r._cesium.Material({fabric:{type:"AspectColorContour",materials:{contourMaterial:{type:"ElevationContour"},aspectRampMaterial:{type:"AspectRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? aspectRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, aspectRampMaterial.alpha)"}},translucent:!1}),r.item.shadingUniforms=o.materials.aspectRampMaterial.uniforms,r.item.contourUniforms=o.materials.contourMaterial.uniforms):(o=r._cesium.Material.fromType("ElevationContour"),r.item.contourUniforms=o.uniforms),r.item.contourUniforms.width=r._core.defaultValue(i.width,2),r.item.contourUniforms.spacing=r._core.defaultValue(i.spacing,150),r.item.contourUniforms.color=r._cesium.Color.fromCssColorString(r._core.defaultValue(i.lineColor,"#ff0000"))):"elevation"===t?(o=r._cesium.Material.fromType("ElevationRamp"),r.item.shadingUniforms=o.uniforms,r.item.shadingUniforms.minimumHeight=r._core.defaultValue(i.min,-414),r.item.shadingUniforms.maximumHeight=r._core.defaultValue(i.max,8844)):"slope"===t?(o=r._cesium.Material.fromType("SlopeRamp"),r.item.shadingUniforms=o.uniforms):"aspect"===t&&(o=r._cesium.Material.fromType("AspectRamp"),r.item.shadingUniforms=o.uniforms),"none"!==t&&(r.item.shadingUniforms.image=i?r._core.getColorRamp(t,i.colorArr,i.min,i.max):r._core.getColorRamp(t)),n.material=void 0,r._viewer.render(),n.material=o,r.item.material=n.material,this},e.prototype.executeMaterial=function(e){var t=this;t.item={};t.item.selectedShading=e,t.item.shadingUniforms={};var i,r=this._viewer.scene.globe;return"elevation"===t.item.selectedShading?(i=this._cesium.Material.fromType("ElevationRamp"),t.item.shadingUniforms=i.uniforms,t.item.shadingUniforms.minHeight=-414,t.item.shadingUniforms.maxHeight=8777):"slope"===t.item.selectedShading?(i=this._cesium.Material.fromType("SlopeRamp"),t.item.shadingUniforms=i.uniforms):"aspect"===t.item.selectedShading&&(i=this._cesium.Material.fromType("AspectRamp"),t.item.shadingUniforms=i.uniforms),"none"!==t.item.selectedShading&&(t.item.shadingUniforms.image=this._core.getColorRamp(t.item.selectedShading)),r.material=i,t.item.material=r.material,this},e.prototype.setSpacing=function(e){try{this.item.contourUniforms.spacing=parseFloat(e)}catch(e){console.log(e)}return this},e.prototype.setMaterialColor=function(e){try{this.item.contourUniforms.color=new t(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},e.prototype.setWidth=function(e){try{this.item.contourUniforms.width=parseFloat(e)}catch(e){console.log(e)}return this},e.prototype.executeContourMaterial=function(e){var t=this;t.item={};t.item.selectedShading=e;var i,r=t._viewer.scene.globe;return"elevation"===t.item.selectedShading?(i=new this._cesium.Material({fabric:{type:"ElevationColorContour",materials:{contourMaterial:{type:"ElevationContour"},elevationRampMaterial:{type:"ElevationRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, elevationRampMaterial.alpha)"}},translucent:!1}),t.item.shadingUniforms=i.materials.elevationRampMaterial.uniforms,t.item.shadingUniforms.minHeight=-414,t.item.shadingUniforms.maxHeight=8777,t.item.contourUniforms=i.materials.contourMaterial.uniforms):"slope"===t.item.selectedShading?(i=getSlopeContourMaterial(),t.item.shadingUniforms=i.materials.slopeRampMaterial.uniforms,t.item.contourUniforms=i.materials.contourMaterial.uniforms):"aspect"===t.item.selectedShading?(i=getAspectContourMaterial(),t.item.shadingUniforms=i.materials.aspectRampMaterial.uniforms,t.item.contourUniforms=i.materials.contourMaterial.uniforms):(i=this._cesium.Material.fromType("ElevationContour"),t.item.contourUniforms=i.uniforms),"none"!==t.item.selectedShading&&(t.item.shadingUniforms.image=this._core.getColorRamp(t.item.selectedShading)),t.item.contourUniforms.width=2,t.item.contourUniforms.spacing=150,t.item.contourUniforms.color=this._cesium.Color.fromRandom({alpha:1},this._cesium.Color.RED.clone()),r.material=i,t.item.material=r.material,this},Object.defineProperties(e.prototype,{elevation:{get:function(){return this.item},set:function(e){this.item=e}}}),e}),define("SGWorld/Analysis/Scopefieldvision",["../Creator/Color","../Core/Core","../ProjectTree/treeSource"],function(e,i,y){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=y,this._points=[],this._xjwz=null,this._polygonsd=[],this._rectangle=null}return t.prototype.executeScopefieldvision=function(){var g=this,i=function(){function e(e){this.options={name:"",polygon:{fill:!0,hierarchy:[],height:0,perPositionHeight:!0,heightReference:g._cesium.HeightReference.CLAMP_TO_GROUND,material:g._cesium.Color.YELLOW.withAlpha(.3)}},this.hierarchy=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new g._cesium.CallbackProperty(function(){return e.hierarchy},!1),this.polygon=g._viewer.entities.add(this.options),g.item=this.polygon},e}(),f=new this._cesium.ScreenSpaceEventHandler(g._viewer.scene.canvas),v=[],_=void 0;return f.setInputAction(function(e){var t=g._viewer.scene.camera.pickEllipsoid(e.position,g._viewer.scene.globe.ellipsoid);0==v.length&&v.push(t.clone()),v.push(t)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),f.setInputAction(function(e){var t=g._viewer.scene.camera.pickEllipsoid(e.endPosition,g._viewer.scene.globe.ellipsoid);2<=v.length&&(g._cesium.defined(_)?null!=t&&(v.pop(),t.y+=1+Math.random(),v.push(t)):_=new i(v))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),f.setInputAction(function(e){f.destroy();var t={polygon:{},positions:[],area:[]};t.polygon=_;for(var i=[],r=0;r<v.length;r++){var o=g._cesium.Cartographic.fromCartesian(v[r]),n=g._cesium.Math.toDegrees(o.longitude),a=g._cesium.Math.toDegrees(o.latitude),s=o.height;i.push({lon:n,lat:a,hei:s});var l=[n,a];g._polygonsd.push(l)}t.positions=i;var u=g._viewer.camera.heading,c=g._viewer.camera.pitch,h=g._viewer.camera.roll,d=g._viewer.camera.position.clone();g._xjwz={orientation:{heading:u,pitch:c,roll:h},position:d},g._viewer.scene.camera.moveEnd.addEventListener(function(){var e=g._viewer.camera.computeViewRectangle();if(e!=g._rectangle){var t=(g._rectangle=e).west/Math.PI*180,i=e.north/Math.PI*180,r=[(t+e.east/Math.PI*180)/2,(i+e.south/Math.PI*180)/2];g.exports(r,g._polygonsd)||null!=g._xjwz&&g._viewer.camera.setView({destination:g._xjwz.position,orientation:g._xjwz.orientation})}});var m=0;g._core.isnull(y.selectedItem)||"group"!=y.selectedItem.type||(m=y.selectedItem.id);var p=g._core.getuid();y.insertGroupId({id:p,name:"视野范围面"+p,pId:g._core.isnull(m)?0:m,type:"polygon",item:g},g._core.isnull(m)?0:m),"function"==typeof method&&method(t)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},t.prototype.exports=function(e,t){for(var i=e[0],r=e[1],o=!1,n=0,a=t.length-1;n<t.length;a=n++){var s=t[n][0],l=t[n][1],u=t[a][0],c=t[a][1];r<l!=r<c&&i<(u-s)*(r-l)/(c-l)+s&&(o=!o)}return o},t}),define("SGWorld/Command/execute",["../Analysis/Cdcl/Cdcl","../Core/Core","../ProjectTree/treeSource","../Creator/Polyline","../Creator/Polygon","../Creator/Box","../Creator/Ellipsoid","../Creator/Rectangle","../Creator/Circle","../Creator/Point","../Creator/Label","../Analysis/ElevationContour","../Analysis/Scopefieldvision","../Creator/dynamicObject","../Creator/Cone"],function(i,r,e,u,c,o,n,a,s,l,h,d,m,p,g){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._Cdcl=new i,this._core=new r,this._polyline=void 0,this._polygon=void 0,this._box=new o(e,t),this._ellipsoid=new n(e,t),this._rectangle=new a(e,t),this._circle=new s(e,t),this._point=new l(e,t),this._label=new h(e,t),this._dynamicObject=new p(e,t),this._elevationContour=new d(e,t),this._scopefieldvision=new m(e,t),this._cone=new g(e,t)}return t.prototype.execute=function(e,t,i,r){var o=this._viewer,n=this._cesium;this._polyline=new u(o,n),this._polygon=new c(o,n);this._core;if(0==e&&0==t)return this._polyline.executePolyline(i,r);if(4==e&&1==t)return this._elevationContour.executeContourMaterial(r);if(0==e&&1==t)return this._polygon.executePolygon(i,r);if(0==e&&11==t)return this._polygon.executePolygonvideo(r,i);if(1==e&&1==t)return this._box.executeBox(r);if(1==e&&2==t)return this._cone.executeCone(r);if(1==e&&3==t)return this._cone.executeCylinder(r);if(1==e&&4==t)return this._ellipsoid.executeEllipsoid(r);if(1==e&&5==t)return this._rectangle.createRectangle(i,r);if(1==e&&6==t)return this._circle.executeClircle(r);if(1==e&&7==t)return this._polygon.executeSector(r,i);if(1==e&&8==t)return this._box.executeExcavation(i,r);if(1==e&&9==t)return this._box.executeExcavation(i,r);if(1==e&&10==t)return this._circle.executeClirclews(r);if(1==e&&11==t)return this._point.executePoint(r,i);if(1==e&&12==t)return this._rectangle.createRectangledxkz(r);if(0==e&&2==t)return this._polyline.executeHorizontals(r,i);if(0==e&&3==t)return this._polygon.executePolygoncl(r,i);if(0==e&&4==t)return this._polyline.executeHorizontal(r,i);if(0==e&&10==t)return this._polyline.executePolyline1(r,i);if(0==e&&5==t)return this._polyline.executeHeightTe(r,i);if(0==e&&6==t)return this._polyline.executeAnge(r,i);if(0==e&&9==t)return this._polyline.executeAngeSd(r,i);if(0==e&&7==t);else{if(0==e&&8==t)return this._polygon.executePolygontdmj(r,i);if(0==e&&12==t)return this._polyline.executeAngle(r,i);if(0==e&&13==t)this._point.executePointp(r,i);else{if(2==e&&0==t)return this._polyline.executeProfile(i,r);if(2==e&&1==t)return this._polygon.executePolygonym(r);if(2==e&&2==t)return new c(o,n).executePolygonymsd(i,r);if(2==e&&3==t)return this._dynamicObject.executeFlycesium(r);if(2==e&&4==t)return this._polygon.executePolygonymsdtt(i,r);if(2==e&&5==t)return this._rectangle.createRectanglelbj(i,r);if(2==e&&6==t)return this._polyline.executeProfilePro(i,r);if(3==e&&0==t){if(""!=i&&null!=i){var a=new Date(i),s=n.JulianDate.fromDate(a);o.clock.currentTime=s.clone()}}else if(3==e&&1==t)this._viewer.animation.viewModel.faster();else if(3==e&&2==t)this._viewer.animation.viewModel.slower();else if(3==e&&3==t)this._viewer.animation.viewModel.playForwardViewModel.command();else if(3==e&&4==t)this._viewer.animation.viewModel.playReverseViewModel.command();else if(3==e&&5==t)this._viewer.animation.viewModel.pauseViewModel.command();else{if(3==e&&6==t){var l=n.Cartographic.fromCartesian(i);return{lon:n.Math.toDegrees(l.longitude),lat:n.Math.toDegrees(l.latitude),hei:l.height}}3==e&&7==t&&this._scopefieldvision.executeScopefieldvision()}}}},t}),define("SGWorld/Command/Command",["./execute"],function(i){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._execute=new i(this._viewer,this._cesium)}return e.prototype.execute=function(e,t,i,r){return this._execute.execute(e,t,i,r)},e}),define("SGWorld/Analysis/measureTerrainPerimeter",["./Cdcl/Cdcl"],function(r){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.measureTerrainPerimeter=function(e){var t=e[e.length-2],i=e[e.length-1];Math.abs(t.x-i.x),Math.abs(t.y-i.y);return r(t.y,t.x,i.y,i.x)},e}),define("SGWorld/Analysis/measureTerrainHeight",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.measureTerrainHeight=function(e){var t=e[e.length-2],i=e[e.length-1];Math.abs(t.x-i.x),Math.abs(t.y-i.y);return t.hit,i.hit,Math.abs(t.z-i.z)},e}),define("SGWorld/Analysis/Cdcl/Bearing",[],function(){"use strict";return function(e,t){var i=Math.PI/180,r=180/Math.PI,o=e.y*i,n=e.x*i,a=t.y*i,s=t.x*i,l=-Math.atan2(Math.sin(n-s)*Math.cos(a),Math.cos(o)*Math.sin(a)-Math.sin(o)*Math.cos(a)*Math.cos(n-s));return l<0&&(l+=2*Math.PI),l*=r}}),define("SGWorld/Analysis/Cdcl/Angle",["./Bearing"],function(o){"use strict";return function(e,t,i){var r=o(t,e)-o(t,i);return r<0&&(r+=360),r}}),define("SGWorld/Analysis/Cdcl/Mjcl",["./Angle"],function(l){return function(e){for(var t=Math.PI/180,i=(Math.PI,0),r=0;r<e.length;r++){var o=(r+1)%e.length,n=(r+2)%e.length;i+=l(e[r],e[o],e[n])}var a=180*(e.length-2),s=i-a;return 420<s?s=(i=360*e.length-i)-a:300<s&&s<420&&(s=Math.abs(360-s)),s*t*6371e3*6371e3}}),define("SGWorld/Analysis/measureTerrainArea",["./Cdcl/Mjcl"],function(t){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.measureTerrainArea=function(e){return t(e).toFixed(1)},e}),define("SGWorld/Analysis/measureTerrainkPerimeter",["./Cdcl/Cdcl"],function(n){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.measureTerrainkPerimeter=function(e){var t=e[e.length-2],i=e[e.length-1],r=(Math.abs(t.x-i.x),Math.abs(t.y-i.y),Math.abs(t.z-i.z)),o=n(t.y,t.z,i.y,i.z);return Math.sqrt(r*r+o*o)},e}),define("SGWorld/Analysis/createTerrainProfile",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.createTerrainProfile=function(e){for(var t=[],i=0;i<e.length;i++){var r=this._cesium.Ellipsoid.WGS84.cartesianToCartographic(e[i]);t.push(r.height)}return t},e}),define("SGWorld/Analysis/lineOfSight",["../configData","../Core/Core","../Creator/Color","../ProjectTree/treeSource"],function(t,i,e,r){"use strict";var C,p=1e-5*Math.PI/180;function o(e,t){e=e,C=t,this._cesium=t,this._viewer=e,this._core=new i,this._polylines=[],this._points=[],this._tree=r,this._interval=20}return o.prototype.createlineOfSight=function(c,o){var n=this,h=[],d=this;this._tree.starttemporaryItem(this._viewer);var m=[],p=[],a={polyline:[]};this._tree.removeHandler();var s=this._core.CreateTooltip();d.objectsToExclude=null;var g=void 0;this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+t.draw);var f=function(){function e(e){this.options={polyline:{show:!0,positions:[],material:d._cesium.Color.YELLOW,width:3,clampToGround:!1}},this.positionsp=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polyline.positions=new d._cesium.CallbackProperty(function(){return e.positionsp},!1),this.polyline=d._viewer.entities.add(this.options),d.item=this.polyline,d._tree.temporaryItem.obj.push(this.polyline),p.push(this.polyline)},e}();this._tree.handler=new d._cesium.ScreenSpaceEventHandler(d._viewer.scene.canvas);var v=[],_=void 0;if(0<this._points.length)for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e]);Math.PI;var y=[];this._tree.handler.setInputAction(function(e){var t,i=d._viewer.camera.getPickRay(e.position);if(t=d._viewer.scene.globe.pick(i,d._viewer.scene),d._viewer.scene.pick(e.position)){var r=d._viewer.scene.pickPosition(e.position);r&&(t=r)}if(t)if(0===v.length){v.push(t.clone(),t.clone());var o={leftX:e.position.x,leftY:e.position.y};y.push(o),g=t.clone()}else{o={rightX:e.position.x,rightY:e.position.y};y.push(o);var n={postion:v,entity:p,cartesian:y};m.push(n),y=[],_=void 0,v=[];g.clone();if(null!=c.height){var a=ellipsoid.cartesianToCartographic(g.clone()),s=C.Math.toDegrees(cartograhphic.latitude),l=C.Math.toDegrees(cartograhpinc.longitude),u=c.height;a=C.Cartographic.fromDegrees(l,s,u);ellipsoid.cartographicToCartesian(a)}v.push(g.clone()),v.push(g.clone()),_=new f(v),h.push(_)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){var t,i=d._viewer.camera.getPickRay(e.endPosition);if(t=d._viewer.scene.globe.pick(i,d._viewer.scene),d._viewer.scene.pick(e.endPosition)){var r=d._viewer.scene.pickPosition(e.endPosition);r&&(t=r)}t&&(0===v.length?s.showAt(e.endPosition,"点击添加视点"):s.showAt(e.endPosition,"点击添加目标视点,右键结束"),2<=v.length&&(d._cesium.defined(_)?null!=t&&(v.pop(),v.push(t)):(_=new f(v),h.push(_))))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);var l=0,u=0;return this._tree.handler.setInputAction(function(e){d.end&&d.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){if(s.show(!1),n.end=void 0,d._core.mouse(d._viewer.container,0),d._tree.endtemporaryItem(),d._tree.handler.destroy(),"cancel"!==e){for(var t=0;t<m.length;t++)if(0==t?(l=m[t].cartesian[0].leftX,u=m[t].cartesian[0].leftY,d.tsjx(m[t].postion,l,u,m[t].cartesian[1].rightX,m[t].cartesian[1].rightY,50,p,d._cesium,d._viewer)):d.tsjx(m[t].postion,l,u,m[t].cartesian[0].rightX,m[t].cartesian[0].rightY,50,p,d._cesium,d._viewer)){var i=d._viewer.entities.add({name:"polyline1",polyline:{positions:m[t].postion,width:3,material:d._cesium.Color.GREEN}});a.polyline.push(i)}else{i=d._viewer.entities.add({name:"polyline1",polyline:{positions:m[t].postion,width:3,material:d._cesium.Color.RED}});a.polyline.push(i)}v.pop(),d._polylines=a.polyline,d._tree.handler.destroy();for(r=0;r<p.length;r++)d._viewer.entities.remove(p[r]);""!=o&&null!=o&&"function"==typeof o&&o(a)}else for(var r=0;r<p.length;r++)d._viewer.entities.remove(p[r])},this},o.prototype.tsjx=function(e,t,i,r,o,n,a,s,l){var u={gcs:[],min:0,max:0,juli:0,cys:n},c=this._core.getSpaceDistancem(e,s);c<=100&&10<=c?n=parseInt(c/2):c<10&&0<c?n=parseInt(c/1):100<c&&(n=parseInt(c/10)),u.cys=n;for(var h,d,m=e[0],p=e[e.length-1],g=s.Cartographic.fromCartesian(m),f=s.Math.toDegrees(g.longitude),v=s.Math.toDegrees(g.latitude),_=(g.height,g.height),y=s.Cartographic.fromCartesian(p),C=s.Math.toDegrees(y.longitude),w=s.Math.toDegrees(y.latitude),b=(y.height,y.height),E=n,S=s.Math.lerp(f,C,1/E)-f,P=s.Math.lerp(v,w,1/E)-v,x=s.Math.lerp(_,b,1/E)-_,T=(s.Math.lerp(t,r,1/E),s.Math.lerp(i,o,1/E),!0),I=0;I<E-2;I++){var D=f+(I+1)*S,L=v+(I+1)*P,M=_+(I+1)*x;h=s.Cartesian3.fromDegrees(D,L,M),d=s.Cartographic.fromCartesian(h);var A=l.scene.globe.getHeight(d),R=l.scene.sampleHeight(d,a);if(R&&(A=R),A=parseFloat(A.toFixed(1)),(M=parseFloat(M.toFixed(1)))<A)return T=!1}return T},o.prototype.deleteObject=function(){if(0<this._points.length){this.objectsToExclude=null;for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e])}},o.prototype.InterpolateLineCartographic=function(e,t,i){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var r=[];r.push(new C.Cartographic(e.longitude,e.latitude));var o=Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2)),n=i&&"number"==typeof i?i:p;if(o<=n)return r.push(new C.Cartographic(t.longitude,t.latitude)),r;for(var a=o/n,s=(t.longitude-e.longitude)/a,l=(t.latitude-e.latitude)/a,u=0;u<a;u++){var c=e.longitude+(u+1)*s,h=e.latitude+(u+1)*l;r.push(new C.Cartographic(c,h))}return r.push(new C.Cartographic(t.longitude,t.latitude,t.height)),r},o.prototype.InterpolateLineCartographicxp=function(e,t,i){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var r=[];r.push(new C.Cartographic(e.longitude,e.latitude));var o=Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2)),n=i&&"number"==typeof i?i:p;if(o<=n)return r.push(new C.Cartographic(t.longitude,t.latitude)),r;for(var a=o/n,s=(t.longitude-e.longitude)/a,l=(t.latitude-e.latitude)/a,u=(t.height-e.height)/a,c=0;c<a;c++){var h=e.longitude+(c+1)*s,d=e.latitude+(c+1)*l,m=e.height+u*(c+1);r.push(new C.Cartographic(h,d,m))}return r.push(new C.Cartographic(t.longitude,t.latitude,t.height)),r},o.prototype.InterpolateLineHeightCartographic=function(e,t){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var i=[];i.push(new C.Cartographic(e.longitude,e.latitude,e.height));var r=Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2));if(r<=p)return i.push(new C.Cartographic(t.longitude,t.latitude,t.height)),i;for(var o=r/p,n=(t.longitude-e.longitude)/o,a=(t.latitude-e.latitude)/o,s=(t.height-e.height)/o,l=0;l<o;l++){var u=e.longitude+(l+1)*n,c=e.latitude+(l+1)*a,h=e.height+(l+1)*s;i.push(new C.Cartographic(u,c,h))}return i.push(new C.Cartographic(t.longitude,t.latitude,t.height)),i},o.prototype.InterpolateIndexLineHeightCartographic=function(e,t,i,r){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var o=(t.longitude-e.longitude)/i,n=(t.latitude-e.latitude)/i,a=(t.height-e.height)/i,s=e.longitude+r*o,l=e.latitude+r*n,u=e.height+r*a;return new C.Cartographic(s,l,u)},o.prototype.InterpolateIndexLineHeightCartographicxp=function(e,t,i,r){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var o=(t.longitude-e.longitude)/i,n=(t.latitude-e.latitude)/i,a=(t.height-e.height)/i,s=e.longitude+r*o,l=e.latitude+r*n,u=e.height+r*a;return new C.Cartographic(s,l,u)},o.prototype.Interpolate2IndexLineHeightCartographic=function(e,t,i,r){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var o=[];o.push(new C.Cartographic(e.longitude,e.latitude,e.height));for(var n=(t.longitude-e.longitude)/i,a=(t.latitude-e.latitude)/i,s=(t.height-e.height)/i,l=0;l<r;l++){var u=e.longitude+(l+1)*n,c=e.latitude+(l+1)*a,h=e.height+(l+1)*s;o.push(new C.Cartographic(u,c,h))}return o},o.prototype.CartographicPointsTerrainData=function(e,t){if(e.length&&0<e.length){var i=C.sampleTerrain(this._viewer.terrainProvider,11,e);C.when(i,function(e){t(e)})}},o.prototype.setVisibility=function(e){if(0<this._polylines.length)for(var t=0;t<this._polylines.length;t++)this._polylines[t].show=e},o.prototype.deleteObject=function(){if(0<this._polylines.length)for(var e=0;e<this._polylines.length;e++)this._viewer.entities.remove(this._polylines[e])},Object.defineProperties(o.prototype,{sight:{get:function(){return this.item.sight},set:function(e){this.item.sight=sight}}}),o}),define("SGWorld/Analysis/lineOfSights",["../Core/Core","../Creator/Color","../ProjectTree/treeSource"],function(i,e,t){"use strict";var p,g=1e-5*Math.PI/180;function r(e,t){e=e,p=t,this._cesium=t,this._viewer=e,this._core=new i}return r.prototype.createlineOfSights=function(e){""!=e&&null!=e&&e;var l,u=this,c=[],h={Sdistance:0,Vdistance:0,Hdistance:0,altitude:0,visual:!0},d=5e-5*Math.PI/180,m=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(u._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),(m=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene._imageryLayerCollection)).setInputAction(function(e){var t="目标点",i=u._viewer.camera.getPickRay(e.position),r=u._viewer.scene.globe.pick(i,u._viewer.scene);0==c.length&&(t="起始点"),c.push(r);u._viewer.entities.add({name:"通视分析",position:c[c.length-1],point:{pixelSize:5,color:u._cesium.Color.RED,outlineColor:u._cesium.Color.WHITE,outlineWidth:2},label:{text:t,show:!0,font:"18px sans-serif",fillColor:u._cesium.Color.GOLD,style:u._cesium.LabelStyle.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:u._cesium.VerticalOrigin.BOTTOM,pixelOffset:new u._cesium.Cartesian2(20,-20)}});if(1<c.length){h.Vdistance=u._core.getSpaceDistance(c,u._cesium),h.Vdistance=u._core.getHeight(c,u._cesium),h.Hdistance=u._core.getHorizontalDistance(c,u._cesium);var o=u._cesium.Cartographic.fromCartesian(c[0]).height;h.altitude=o,u.item=h,m.destroy();var n=p.Cartographic.fromCartesian(c[0]),a=p.Cartographic.fromCartesian(c[1]);null,l=u.InterpolateLineCartographicxp(n,a,d);var s=u.InterpolateLineCartographic(n,a,d);u.CartographicPointsTerrainData(s,function(e){if(0<e.length){var t=[];t[0]=c[0];for(var i=1;i<e.length-1;i++){var r=new p.Cartographic(l[i].longitude,l[i].latitude,l[i].height+15);if(e[i].height>=r.height){var o=p.Cartesian3.fromRadians(l[i].longitude,l[i].latitude,l[i].height);t.push(o),h.visual=!1}}if(t.push(c[1]),3<=t.length){var n=[],a=[];n[0]=t[0],n[1]=t[1],a[0]=t[1],a[1]=t[2];u._viewer.entities.add({name:"polyline1",polyline:{positions:n,width:5,material:u._cesium.Color.GREEN}}),u._viewer.entities.add({name:"polyline2",polyline:{positions:a,width:5,material:u._cesium.Color.RED}})}else if(t.length=2)u._viewer.entities.add({name:"polyline2",polyline:{positions:c,width:5,material:u._cesium.Color.GREEN}})}else alert("高程异常!")})}},this._cesium.ScreenSpaceEventType.LEFT_CLICK);!function(){var s,l,u,c,h;function e(e){if(h=e.viewer,s="attribute vec3 position3DHigh; attribute vec3 position3DLow; attribute vec4 color; varying vec4 v_color; attribute float batchId; void main() { vec4 p = czm_computePosition(); v_color =color; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; gl_PointSize=8.0; } ",l="varying vec4 v_color; void main() { float d = distance(gl_PointCoord, vec2(0.5,0.5)); if(d < 0.5){ gl_FragColor = v_color; }else{ discard; } } ",e.Cartesians&&2<=e.Cartesians.length){var t=[],i=[],r=[];if(e.Colors&&e.Colors.length===4*e.Cartesians.length){for(var o=0;o<e.Cartesians.length;o++)t.push(e.Cartesians[o].x),t.push(e.Cartesians[o].y),t.push(e.Cartesians[o].z);i=e.Colors}else for(o=0;o<e.Cartesians.length;o++)t.push(e.Cartesians[o].x),t.push(e.Cartesians[o].y),t.push(e.Cartesians[o].z),i.push(0),i.push(0),i.push(1),i.push(1);for(o=0;o<e.Cartesians.length;o++)r.push(o);this.positionArr=new Float64Array(t),this.colorArr=new Float32Array(i),this.indiceArr=new Uint16Array(r)}else{var n=p.Cartesian3.fromDegrees(0,0,-10),a=p.Cartesian3.fromDegrees(0,.001,-10);this.positionArr=new Float64Array([n.x,n.y,n.z,a.x,a.y,a.z]),this.colorArr=new Float32Array([0,0,1,1,0,0,1,1]),this.indiceArr=new Uint16Array([0,1])}u=d(this.positionArr,this.colorArr,this.indiceArr),c=m(l,s),this.primitive=h.scene.primitives.add(new p.Primitive({geometryInstances:new p.GeometryInstance({geometry:u}),appearance:c,asynchronous:!1}))}function d(e,t,i){return new p.Geometry({attributes:{position:new p.GeometryAttribute({componentDatatype:p.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),color:new p.GeometryAttribute({componentDatatype:p.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:t})},indices:i,primitiveType:p.PrimitiveType.POINTS,boundingSphere:p.BoundingSphere.fromVertices(e)})}function m(e,t){return new p.Appearance({renderState:{blending:p.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:!0},depthMask:!0},fragmentShaderSource:e,vertexShaderSource:t})}e.prototype.remove=function(){null!=this.primitive&&(h.scene.primitives.remove(this.primitive),this.primitive=null)},e.prototype.updateCartesianPosition=function(e){if(null!=this.primitive&&(h.scene.primitives.remove(this.primitive),!(e&&e.length<2))){if(e.length===this.positionArr.length/3){var t=e[0],i=e[1];this.positionArr=new Float64Array([t.x,t.y,t.z,i.x,i.y,i.z]),u=d(this.positionArr,this.colorArr,this.indiceArr)}else{for(var r=[],o=[],n=[],a=0;a<e.length;a++)r.push(e[a].x),r.push(e[a].y),r.push(e[a].z),o.push(0),o.push(0),o.push(1),o.push(1);for(a=0;a<e.length;a++)n.push(a);this.positionArr=new Float64Array(r),this.colorArr=new Float32Array(o),this.indiceArr=new Uint16Array(n),u=d(this.positionArr,this.colorArr,this.indiceArr),c=m(l,s)}this.primitive=h.scene.primitives.add(new p.Primitive({geometryInstances:new p.GeometryInstance({geometry:u}),appearance:c,asynchronous:!1}))}},e.prototype.updateCartesianPositionColor=function(e,t){if(t.length===4*e.length&&null!=this.primitive&&(h.scene.primitives.remove(this.primitive),!(e&&e.length<2))){if(e.length===this.positionArr.length/3){var i=e[0],r=e[1];this.positionArr=new Float64Array([i.x,i.y,i.z,r.x,r.y,r.z]),this.colorArr=new Float32Array(t),u=d(this.positionArr,this.colorArr,this.indiceArr)}else{for(var o=[],n=[],a=0;a<e.length;a++)o.push(e[a].x),o.push(e[a].y),o.push(e[a].z);for(a=0;a<e.length;a++)n.push(a);this.positionArr=new Float64Array(o),this.colorArr=new Float32Array(t),this.indiceArr=new Uint16Array(n),u=d(this.positionArr,this.colorArr,this.indiceArr),c=m(l,s)}this.primitive=h.scene.primitives.add(new p.Primitive({geometryInstances:new p.GeometryInstance({geometry:u}),appearance:c,asynchronous:!1}))}}}();return this},r.prototype.InterpolateLineCartographic=function(e,t,i){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var r=[];r.push(new p.Cartographic(e.longitude,e.latitude));var o=Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2)),n=i&&"number"==typeof i?i:g;if(o<=n)return r.push(new p.Cartographic(t.longitude,t.latitude)),r;for(var a=o/n,s=(t.longitude-e.longitude)/a,l=(t.latitude-e.latitude)/a,u=0;u<a;u++){var c=e.longitude+(u+1)*s,h=e.latitude+(u+1)*l;r.push(new p.Cartographic(c,h))}return r.push(new p.Cartographic(t.longitude,t.latitude,t.height)),r},r.prototype.InterpolateLineCartographicxp=function(e,t,i){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var r=[];r.push(new p.Cartographic(e.longitude,e.latitude));var o=Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2)),n=i&&"number"==typeof i?i:g;if(o<=n)return r.push(new p.Cartographic(t.longitude,t.latitude)),r;for(var a=o/n,s=(t.longitude-e.longitude)/a,l=(t.latitude-e.latitude)/a,u=(t.height-e.height)/a,c=0;c<a;c++){var h=e.longitude+(c+1)*s,d=e.latitude+(c+1)*l,m=e.height+u*(c+1);r.push(new p.Cartographic(h,d,m))}return r.push(new p.Cartographic(t.longitude,t.latitude,t.height)),r},r.prototype.InterpolateLineHeightCartographic=function(e,t){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var i=[];i.push(new p.Cartographic(e.longitude,e.latitude,e.height));var r=Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2));if(r<=g)return i.push(new p.Cartographic(t.longitude,t.latitude,t.height)),i;for(var o=r/g,n=(t.longitude-e.longitude)/o,a=(t.latitude-e.latitude)/o,s=(t.height-e.height)/o,l=0;l<o;l++){var u=e.longitude+(l+1)*n,c=e.latitude+(l+1)*a,h=e.height+(l+1)*s;i.push(new p.Cartographic(u,c,h))}return i.push(new p.Cartographic(t.longitude,t.latitude,t.height)),i},r.prototype.InterpolateIndexLineHeightCartographic=function(e,t,i,r){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var o=(t.longitude-e.longitude)/i,n=(t.latitude-e.latitude)/i,a=(t.height-e.height)/i,s=e.longitude+r*o,l=e.latitude+r*n,u=e.height+r*a;return new p.Cartographic(s,l,u)},r.prototype.InterpolateIndexLineHeightCartographicxp=function(e,t,i,r){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var o=(t.longitude-e.longitude)/i,n=(t.latitude-e.latitude)/i,a=(t.height-e.height)/i,s=e.longitude+r*o,l=e.latitude+r*n,u=e.height+r*a;return new p.Cartographic(s,l,u)},r.prototype.Interpolate2IndexLineHeightCartographic=function(e,t,i,r){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var o=[];o.push(new p.Cartographic(e.longitude,e.latitude,e.height));for(var n=(t.longitude-e.longitude)/i,a=(t.latitude-e.latitude)/i,s=(t.height-e.height)/i,l=0;l<r;l++){var u=e.longitude+(l+1)*n,c=e.latitude+(l+1)*a,h=e.height+(l+1)*s;o.push(new p.Cartographic(u,c,h))}return o},r.prototype.CartographicPointsTerrainData=function(e,t){if(e.length&&0<e.length){var i=p.sampleTerrain(this._viewer.terrainProvider,11,e);p.when(i,function(e){t(e)})}},Object.defineProperties(r.prototype,{sight:{get:function(){return this.item.sight},set:function(e){this.item.sight=sight}}}),r}),define("SGWorld/Analysis/terrainExaggeration",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.createterrainExaggeration=function(e){this._viewer.scene.globe.terrainExaggeration=e},e}),define("SGWorld/Analysis/curtaincontrast",["./Cdcl/Mjcl"],function(e){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this.leftIndex=void 0,this.rightIndex=void 0}t.prototype.curtainContrast=function(e,t){document.getElementById("slider")&&this.clear();var i=this._viewer.imageryLayers,r=this._viewer.scene;u._scene=r;var o=this._viewer.container,n=document.createElement("div");n.id="slider",n.style.position="absolute",n.style.cursor="e-resize",n.style.top=0,n.style.backgroundColor="#D3D3D3",n.style.width="8px",n.style.height="100%",n.style.zIndex="1000",o.appendChild(n);var a=i.get(e),s=i.get(t);this.leftIndex=e,this.rightIndex=t,a.splitDirection=this._cesium.ImagerySplitDirection.LEFT,s.splitDirection=this._cesium.ImagerySplitDirection.RIGHT;var l=document.getElementById("slider");r.imagerySplitPosition=l.offsetLeft/l.parentElement.offsetWidth,l.addEventListener("mousedown",h,!1),window.addEventListener("mouseup",c,!1),l.style.left="50%",u._scene.imagerySplitPosition=.5};var u={dragStartX:0,_scene:void 0};function c(){window.removeEventListener("mousemove",o,!1)}function h(e){var t=document.getElementById("slider");u.dragStartX=e.clientX-t.offsetLeft,window.addEventListener("mousemove",o,!1)}function o(e){var t=document.getElementById("slider"),i=(e.clientX-u.dragStartX)/t.parentElement.offsetWidth;t.style.left=100*i+"%",u._scene.imagerySplitPosition=i}return t.prototype.close=function(){var e=document.getElementById("slider");if(e){u._scene.imagerySplitPosition="0%",e.removeEventListener("mousedown",h,!1),window.removeEventListener("mouseup",c,!1),window.removeEventListener("mousemove",o,!1),e.remove();var t=this._viewer.imageryLayers,i=t.get(this.leftIndex),r=t.get(this.rightIndex);i.splitDirection=this._cesium.ImagerySplitDirection.NONE,r.splitDirection=this._cesium.ImagerySplitDirection.NONE,u._scene=void 0}},t}),define("SGWorld/Analysis/navigationMixin",["./Cdcl/Mjcl"],function(e){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this.dragStartX=0}return t.prototype.navigationMixin=function(){this._viewer.extend(this._cesium.viewerCesiumNavigationMixin,{})},t}),define("SGWorld/Analysis/indoormode",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._handler=null,this.setPointerLocker=!1}var n={_this:null,X_speedScale:1,Y_speedScale:.8,moveRate:.1,moveRates:[.1,.5,1],clickNum:1,movementX:0,movementY:0,moveFactor:0,enable_looking:!(e.prototype.createIndoormode=function(e){var t=this;if(null==t._handler){e&&e.undergroundMode&&(this.undergroundMode=e.undergroundMode);var i=t._viewer.scene,r=t._viewer.canvas;return r.setAttribute("tabindex","0"),r.focus(),r.onclick=function(){r.focus()},this.ellipsoid=i.globe.ellipsoid,i.screenSpaceCameraController.enableRotate=!1,i.screenSpaceCameraController.enableTranslate=!1,i.screenSpaceCameraController.enableZoom=!1,i.screenSpaceCameraController.enableTilt=!1,i.screenSpaceCameraController.enableLook=!1,t._handler=new t._cesium.ScreenSpaceEventHandler(r),n._this=this,n.Viewer=t._viewer,n.camera=t._viewer.camera,document.addEventListener("pointerlockchange",u,!1),document.addEventListener("mousemove",s,!1),document.addEventListener("keydown",c,!1),document.addEventListener("keyup",h,!1),document.addEventListener("click",o,!1),t._viewer.clock.onTick.addEventListener(l,t),t._viewer.container.requestPointerLock(),this}}),Viewer:null,camera:null},a={looking:!1,moveForward:!1,moveBackward:!1,moveUp:!1,moveDown:!1,moveLeft:!1,moveRight:!1};function o(e){1===e.button&&n.moveFactor<100&&(n.moveRate=n.moveRates[n.clickNum++],2<n.clickNum&&(n.clickNum=0))}function s(e){if(n.enable_looking){n.movementX=e.movementX,n.movementY=e.movementY;var t=n.Viewer.canvas.clientWidth,i=n.Viewer.canvas.clientHeight,r=n.movementX/t,o=-n.movementY/i;!n.camera.roll&&n.camera.pitch<0&&o<0?o=0:!n.camera.roll&&0<n.camera.pitch&&0<o&&(o=0),n.camera.rotate(n.camera.position,r*n.X_speedScale),n.camera.lookUp(o*n.Y_speedScale)}}function l(e){var t=this._viewer.camera,i=this._viewer.scene.globe.getHeight(t.positionCartographic),r=this.ellipsoid.cartesianToCartographic(t.position).height;n.moveFactor=r-i;var o=100<n.moveFactor?n.moveFactor/100:n.moveRate;a.moveForward&&t.moveForward(o),a.moveBackward&&t.moveBackward(o),a.moveUp&&t.moveUp(o),a.moveDown&&t.moveDown(o),a.moveLeft&&t.moveLeft(o),a.moveRight&&t.moveRight(o)}function u(){document.pointerLockElement?n.enable_looking=!0:n.enable_looking&&n._this.Indoormodeclose()}function c(e){var t=i(e.keyCode);void 0!==t&&(a[t]=!0)}function h(e){var t=i(e.keyCode);void 0!==t&&(a[t]=!1)}function i(e){switch(e){case"W".charCodeAt(0):return"moveForward";case"S".charCodeAt(0):return"moveBackward";case"Q".charCodeAt(0):return"moveUp";case"E".charCodeAt(0):return"moveDown";case"D".charCodeAt(0):return"moveRight";case"A".charCodeAt(0):return"moveLeft";default:return}}return e.prototype.Indoormodeclose=function(){if(this._handler.destroy(),this._handler=null,document.removeEventListener("keydown",c,!1),document.removeEventListener("keyup",h,!1),document.removeEventListener("pointerlockchange",u,!1),document.removeEventListener("mousemove",s,!1),document.removeEventListener("click",o,!1),this._viewer.clock.onTick.removeEventListener(l,this),document.exitPointerLock(),n.enable_looking=!1,document.body.style.cursor="default",this.undergroundMode)this.undergroundMode.isIndoor=!1,this.undergroundMode.attachMouseEvent(),this.undergroundMode=void 0;else{var e=this._viewer.scene;e.screenSpaceCameraController.enableRotate=!0,e.screenSpaceCameraController.enableTranslate=!0,e.screenSpaceCameraController.enableZoom=!0,e.screenSpaceCameraController.enableTilt=!0,e.screenSpaceCameraController.enableLook=!0}},e}),define("SGWorld/Analysis/weather",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.createWeather=function(e,t,i){var r=this._viewer.scene.postProcessStages,o=null,n=null,a=null,s=null,l={min:10,max:160},u={min:.5,max:3},c={min:-1,max:1},h={min:0,max:1},d={min:10,max:160},m={min:0,max:1},p={min:0,max:.7},g={min:.1,max:.9};switch(e){case"rain":if(o=i,this._viewer.scene.postProcessStages._stages.length&&this._viewer.scene.postProcessStages._stages.forEach(function(e){e&&"rain"===e.name&&r.remove(e)}),t){if(o?n={test1:i.test1,test2:i.test2,test3:i.test3,test4:i.test4}:(n={test1:7,test2:.3,test3:-.4,test4:1},o={test1:7,test2:.3,test3:-.4,test4:1}),n.test1=15*(10-parseFloat(n.test1))+10,n.test2=2.5*parseFloat(n.test2)+.5,n.test1>l.max||n.test1<l.min)return;if(n.test2>u.max||n.test2<u.min)return;if(n.test3>c.max||n.test3<c.min)return;if(n.test4>h.max||n.test4<h.min)return;n.test1=this.getValue(n.test1+""),n.test2=this.getValue(n.test2+""),n.test3=this.getValue(n.test3+""),n.test4=this.getValue(n.test4+"");var f=new this._cesium.PostProcessStage({name:"rain",fragmentShader:"uniform sampler2D colorTexture; \nvarying vec2 v_textureCoordinates;\n\nfloat hash(float x){\nreturn fract(sin(x*133.3)*13.13);\n}\n\nvoid main(void){\nfloat time = czm_frameNumber / "+n.test1+";\nvec2 resolution = czm_viewport.zw; \nvec2 uv=(gl_FragCoord.xy*"+n.test2+"-resolution.xy)/min(resolution.x,resolution.y); \nvec3 c=vec3(.6,.7,.8);\nfloat a="+n.test3+";\nfloat si=sin(a),co=cos(a);\nuv*=mat2(co,-si,si,co);\nuv*=length(uv+vec2(0,4.9))*.3+"+n.test4+";\nfloat v=1.-sin(hash(floor(uv.x*100.))*2.);\nfloat b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;\nc*=v*b; //屏幕上雨的颜色\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(c,1), 0.5); \n }"});r.add(f)}break;case"snow":if(a=i,this._viewer.scene.postProcessStages._stages.length&&this._viewer.scene.postProcessStages._stages.forEach(function(e){e&&"snow"===e.name&&r.remove(e)}),t){if(a?n={test1:i.test1,test2:i.test2,test3:i.test3,test4:i.test4}:(n={test1:7,test2:.1,test3:.5,test4:.5},a={test1:7,test2:.1,test3:.5,test4:.5}),n.test1=15*(10-parseFloat(n.test1))+10,n.test2=parseFloat(n.test2)/10,n.test3=.7*parseFloat(n.test3),n.test4=.8*(1-parseFloat(n.test4))+.1,parseFloat(n.test1)>d.max||parseFloat(n.test1)<d.min)return;if(parseFloat(n.test2)>m.max||parseFloat(n.test2)<m.min)return;if(parseFloat(n.test3)>p.max||parseFloat(n.test3)<p.min)return;if(parseFloat(n.test4)>g.max||parseFloat(n.test4)<g.min)return;n.test1=this.getValue(n.test1+""),n.test2=this.getValue(n.test2+""),n.test3=this.getValue(n.test3+""),n.test4=this.getValue(n.test4+"");var v=new this._cesium.PostProcessStage({name:"snow",fragmentShader:"uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nfloat snow(vec2 uv,float scale){\nfloat time = czm_frameNumber / "+n.test1+";\nfloat w=smoothstep(1.0,0.,-uv.y*(scale/10.0));if(w<"+n.test2+")return 0.;\nuv+=time/scale;uv.y+=time*2./scale;uv.x+=sin(uv.y+time*.5)/scale;\nuv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.,d;\np="+n.test3+"+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;d=length(p);k=min(d,k);\nk=smoothstep(0.,k,sin(f.x+f.y)*0.01);\nreturn k*w;\n}\nvoid main(void){\nvec2 resolution = czm_viewport.zw;\nvec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\nvec3 finalColor=vec3(0);\nfloat c = 0.0;\nc+=snow(uv,30.)*.0;\nc+=snow(uv,20.)*.0;\nc+=snow(uv,15.)*.0;\nc+=snow(uv,10.);\nc+=snow(uv,8.);\nc+=snow(uv,6.);\nc+=snow(uv,5.);\nfinalColor=(vec3(c)); //屏幕上雪的颜色\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(finalColor,1), "+n.test4+"); //将雪和三维场景融合\n}"});r.add(v)}break;case"fog":if(s=i,this._viewer.scene.postProcessStages._stages.length&&this._viewer.scene.postProcessStages._stages.forEach(function(e){e&&"fog"===e.name&&r.remove(e)}),t){if(s?n={distance:i.distance,color:i.color&&Cesium.Color.fromCssColorString(i.color)}:(n={distance:200,color:"#ffffff"},s={distance:200,color:"#ffffff"}),n.distance<10)return;var _=new Cesium.PostProcessStage({name:"fog",fragmentShader:"float getDistance(sampler2D depthTexture, vec2 texCoords) \n{ \n float depth = czm_unpackDepth(texture2D(depthTexture, texCoords)); \n if (depth == 0.0) { \n return czm_infinity; \n } \n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth); \n return -eyeCoordinate.z / eyeCoordinate.w; \n} \nfloat interpolateByDistance(vec4 nearFarScalar, float distance) \n{ \n float startDistance = nearFarScalar.x; \n float startValue = nearFarScalar.y; \n float endDistance = nearFarScalar.z; \n float endValue = nearFarScalar.w; \n float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); \n return mix(startValue, endValue, t); \n} \nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) \n{ \n return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); \n} \nuniform sampler2D colorTexture; \nuniform sampler2D depthTexture; \nuniform vec4 fogByDistance; \nuniform vec4 fogColor; \nvarying vec2 v_textureCoordinates; \nvoid main(void) \n{ \n float distance = getDistance(depthTexture, v_textureCoordinates); \n vec4 sceneColor = texture2D(colorTexture, v_textureCoordinates); \n float blendAmount = interpolateByDistance(fogByDistance, distance); \n vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount); \n gl_FragColor = alphaBlend(finalFogColor, sceneColor); \n} \n",uniforms:{fogByDistance:new Cesium.Cartesian4(10,0,n.distance||200,1),fogColor:n.color||Cesium.Color.WHITE}});r.add(_)}}},e.prototype.getValue=function(e){return""===e||"-"===e||"."===e||void 0===e?"0.0":("-"===e[e.length-1]&&(e=e.substr(0,e.length-1)),2<e.split(".").length?"0.0":e.split(".")[1]&&e.split(".")[1].length?e:parseFloat(e).toFixed(1))},e}),define("SGWorld/Analysis/Particle",["../configData","../Core/Core"],function(h,i){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this.Fireworks=[],this.Smog=[],this.Fountain=[],this.Flame=[]}return e.prototype.createParticleEffect=function(e,t,i,r){switch(this._viewer.clockViewModel.shouldAnimate||(this._viewer.clockViewModel.shouldAnimate=!0),e){case"fireworks":this.createFireworks(t,i,r);break;case"smog":this.createSmog(t,i,r);break;case"fountain":this.createFountain(t,i,r);break;case"flame":this.createFlame(t,i,r)}},e.prototype.removeParticleEffect=function(e){var t=this._viewer.scene;switch(e){case"fireworks":0<this.Fireworks.length&&(this.Fireworks.forEach(function(e){t.primitives.remove(e)}),this.Fireworks=[]);break;case"smog":0<this.Smog.length&&(this.Smog.forEach(function(e){t.primitives.remove(e)}),this.Smog=[]);break;case"fountain":0<this.Fountain.length&&(this.Fountain.forEach(function(e){t.primitives.remove(e)}),this.Fountain=[]);break;case"flame":0<this.Flame.length&&(this.Flame.forEach(function(e){t.primitives.remove(e)}),this.Flame=[])}},e.prototype.createFireworks=function(e,t,i){var c=this._viewer.scene,r=this._viewer,h=this._cesium;t||(t={}),h.Math.setRandomNumberSeed(315);var d,m=this.computeModelMatrix(e),p=new h.Cartesian3(0,0,100);var g=h.defaultValue(t.minSize,30),f=h.defaultValue(t.maxSize,100),o=h.defaultValue(t.size,7),v=new h.Cartesian2(o,o),_=10,n=h.defaultValue(t.num,20),y=new h.Matrix4;function a(e,t,i){var r=h.Cartesian3.add(p,e,new h.Cartesian3),o=h.Matrix4.fromTranslation(r,y),n=h.Matrix4.multiply(m,o,new h.Matrix4),a=h.Matrix4.inverseTransformation(n,n),s=h.Math.randomBetween(g,f),l=new h.Cartesian3,u=.7*((s-g)/(f-g))+.3;return c.primitives.add(new h.ParticleSystem({image:function(){if(!h.defined(d)){(d=document.createElement("canvas")).width=20,d.height=20;var e=d.getContext("2d");e.beginPath(),e.arc(8,8,8,0,h.Math.TWO_PI,!0),e.closePath(),e.fillStyle="rgb(255, 255, 255)",e.fill()}return d}(),startColor:t,endColor:t.withAlpha(0),particleLife:u,speed:100,imageSize:v,emissionRate:0,emitter:new h.SphereEmitter(.1),bursts:i,lifetime:_,updateCallback:function(e){var t=h.Matrix4.multiplyByPoint(a,e.position,l);h.Cartesian3.magnitudeSquared(t)>=s*s&&h.Cartesian3.clone(h.Cartesian3.ZERO,e.velocity)},modelMatrix:m,emitterModelMatrix:o}))}for(var s=[{minimumRed:.75,green:0,minimumBlue:.8,alpha:1},{red:0,minimumGreen:.75,minimumBlue:.8,alpha:1},{red:0,green:0,minimumBlue:.8,alpha:1},{minimumRed:.75,minimumGreen:.75,blue:0,alpha:1}],l=0;l<n;++l){for(var u=h.Math.randomBetween(-100,100),C=h.Math.randomBetween(-80,100),w=h.Math.randomBetween(-50,50),b=new h.Cartesian3(u,C,w),E=h.Color.fromRandom(s[l%s.length]),S=[],P=0;P<3;++P)S.push(new h.ParticleBurst({time:h.Math.nextRandomNumber()*_,minimum:400,maximum:400}));this.Fireworks.push(a(b,E,S))}if(i&&"function"==typeof i)i(this.Fireworks);else{var x=r.scene.camera,T=new h.Cartesian3(-300,0,0);x.lookAtTransform(m,T),x.lookAtTransform(h.Matrix4.IDENTITY);var I=h.Cartesian3.subtract(p,T,new h.Cartesian3);h.Cartesian3.normalize(I,I);var D=h.Math.PI_OVER_TWO-Math.acos(h.Cartesian3.dot(I,h.Cartesian3.UNIT_Z));x.lookUp(D)}},e.prototype.createSmog=function(e,r,t){this._viewer.scene;var o=this._viewer,n=this._cesium,a=this;r&&""!==r||(r={}),n.Math.setRandomNumberSeed(3);var s,l={image:window.SmartEarthRootUrl+h.smog,emissionRate:50,gravity:0,minimumParticleLife:1,maximumParticleLife:1.2,minimumSpeed:1,maximumSpeed:4,startScale:1,endScale:5,particleSize:1,lifetime:6};this._core.extend(l,r,!0);var u=new n.Cartesian3,i=function(i){var e=o.scene;s=e.primitives.add(new n.ParticleSystem({image:l.image,startColor:n.Color.LIGHTSEAGREEN.withAlpha(.7),endColor:n.Color.WHITE.withAlpha(0),startScale:l.startScale,endScale:l.endScale,sizeInMeters:!0,minimumParticleLife:l.minimumParticleLife,maximumParticleLife:l.maximumParticleLife,minimumSpeed:l.minimumSpeed,maximumSpeed:l.maximumSpeed,imageSize:new n.Cartesian2(l.particleSize,l.particleSize),emissionRate:l.emissionRate,lifetime:l.lifetime,emitter:new n.CircleEmitter(2),emitterModelMatrix:a.computeEmitterModelMatrix(r.translation,r.rotation),updateCallback:c})),l.type&&("圆形放射"===(t=l.type)?s.emitter=new n.CircleEmitter(2):"球体放射"===t?s.emitter=new n.SphereEmitter(2.5):"圆锥体放射"===t?s.emitter=new n.ConeEmitter(n.Math.toRadians(45)):"盒状放射"===t&&(s.emitter=new n.BoxEmitter(new n.Cartesian3(10,10,10))));var t;return o.scene.preUpdate.addEventListener(function(e,t){s&&(s.modelMatrix=a.computeModelMatrix(i,t),s.emitterModelMatrix=a.computeEmitterModelMatrix(r.translation,r.rotation))}),s}(e);function c(e,t){var i=e.position;n.Cartesian3.normalize(i,u),n.Cartesian3.multiplyByScalar(u,l.gravity*t,u),e.velocity=n.Cartesian3.add(e.velocity,u,e.velocity)}this.Smog.push(i),t&&"function"==typeof t&&t(this.Smog)},e.prototype.createFountain=function(i,r,e){this._viewer.scene;var t=this._viewer,o=this._cesium,n=this;r&&""!==r||(r={});var a={image:window.SmartEarthRootUrl+h.penquan,emissionRate:50,minimumParticleLife:3,maximumParticleLife:4,minimumSpeed:9,maximumSpeed:9.5,startScale:1,endScale:15,particleSize:1,lifetime:6,gravity:-3.5};this._core.extend(a,r,!0);var s,l=new o.Cartesian3,u=(s=t.scene.primitives.add(new o.ParticleSystem({image:a.image,startColor:new o.Color(1,1,1,.3),endColor:new o.Color(.8,.86,1,.4),startScale:a.startScale,endScale:a.endScale,minimumParticleLife:a.minimumParticleLife,maximumParticleLife:a.maximumParticleLife,minimumSpeed:a.minimumSpeed,maximumSpeed:a.maximumSpeed,imageSize:new o.Cartesian2(a.particleSize,2*a.particleSize),emissionRate:a.emissionRate,lifetime:a.lifetime,loop:!0,emitter:new o.ConeEmitter(o.Math.toRadians(o.defaultValue(a.angle,7))),updateCallback:c,sizeInMeters:!0})),t.scene.preUpdate.addEventListener(function(e,t){s&&(s.modelMatrix=n.computeModelMatrix(i,t),s.emitterModelMatrix=n.computeEmitterModelMatrix(r.translation,r.rotation))}),s);function c(e,t){var i=e.position;o.Cartesian3.normalize(i,l),o.Cartesian3.multiplyByScalar(l,a.gravity*t,l),e.velocity=o.Cartesian3.add(e.velocity,l,e.velocity)}this.Fountain.push(u),e&&"function"==typeof e&&e(this.Fountain)},e.prototype.createFlame=function(e,t,i){this._viewer.scene;var r=this._viewer,o=this._cesium,n=this;t&&""!==t||(t={});var a={image:window.SmartEarthRootUrl+h.fire,emissionRate:200,gravity:0,minimumParticleLife:1,maximumParticleLife:3,minimumSpeed:1,maximumSpeed:4,startScale:1,endScale:6,particleSize:1,lifetime:16};this._core.extend(a,t,!0);var s,l=(s=e,r.scene.primitives.add(new o.ParticleSystem({image:a.image,startColor:o.Color.RED.withAlpha(.7),endColor:o.Color.YELLOW.withAlpha(.3),startScale:a.startScale,endScale:a.endScale,minimumParticleLife:a.minimumParticleLife,maximumParticleLife:a.maximumParticleLife,minimumSpeed:a.minimumSpeed,maximumSpeed:a.maximumSpeed,imageSize:new o.Cartesian2(a.particleSize,a.particleSize),emissionRate:a.emissionRate,sizeInMeters:!0,lifetime:a.lifetime,emitter:new o.ConeEmitter(o.Math.toRadians(16)),modelMatrix:n.computeModelMatrix(s),emitterModelMatrix:n.computeEmitterModelMatrix(a.translation,a.rotation)})));this.Flame.push(l),i&&"function"==typeof i&&i(this.Flame)},e.prototype.computeModelMatrix=function(e,t){var i,r=this._cesium;return e instanceof r.Entity?e.computeModelMatrix(t,new r.Matrix4):e.x&&e.y?(i=e.x<=180&&-180<=e.x&&e.y<=90&&-90<=e.y?r.Cartesian3.fromDegrees(e.x,e.y,e.z||0):e,r.Transforms.eastNorthUpToFixedFrame(i)):void 0},e.prototype.computeEmitterModelMatrix=function(e,t){var i=this._cesium,r=new i.TranslationRotationScale,o=i.HeadingPitchRoll.fromDegrees(0,0,0);return r.translation=i.defaultValue(e,i.Cartesian3.fromElements(0,0,0)),r.rotation=i.Quaternion.fromHeadingPitchRoll(i.defaultValue(t,o)),i.Matrix4.fromTranslationRotationScale(r)},e}),define("SGWorld/Analysis/UndergroundMode",["../Core/Core","../ProjectTree/treeSource","./indoormode"],function(i,r,o){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=r,this._indoormode=new o(e,t),this._model=null,this._relativeHeight=-100,this._groundHeightAtCameraPosition=0,this._startMousePosition,this._mousePosition,this._cameraHeight,this._originalOption,this._alpha=.5,this._brightness=.3,this._depth=300,this._canvas=null,this.isIndoor=!1,this.isUndergroundMode=!1,this._flags={move:!1,vertical:!1,horizontally:!1,rotate:!1},this.moveSpeed=1}function n(e){var t=e._viewer.scene;e._viewer.canvas;e._tree&&e._tree.handler&&(e._tree.handler.destroy(),e._tree.handler=null),t.screenSpaceCameraController.enableRotate=!0,t.screenSpaceCameraController.enableTranslate=!0,t.screenSpaceCameraController.enableZoom=!0,t.screenSpaceCameraController.enableTilt=!0,t.screenSpaceCameraController.enableLook=!0}var a;return e.prototype.refreshGridLines=function(){var e=this._relativeHeight<0,t=this._viewer.camera,i=new this._cesium.Cartographic(t.positionCartographic.longitude,t.positionCartographic.latitude,-this._depth);if(this._model){var r=this.UndergroundGridLines(i,e);this._viewer.scene.primitives.remove(this._model),this._model=r}else this._model=this.UndergroundGridLines(i,e)},e.prototype.UndergroundModelOpen=function(e,t){if(!this._model){this._getOriginalOption();var i,r=this._viewer.camera,o=new this._cesium.Cartographic(r.positionCartographic.longitude,r.positionCartographic.latitude,-this._depth),n=new this._cesium.Cartographic(r.positionCartographic.longitude,r.positionCartographic.latitude,r.positionCartographic.height);this.destination=n,this.orientation={heading:r.heading,pitch:r.pitch,roll:0},this._cesium.ExpandBySmartEarth&&(this._cesium.ExpandBySmartEarth.underEarth.cullFace=!1,this._cesium.ExpandBySmartEarth.underEarth.enable=!0,this._cesium.ExpandBySmartEarth.underEarth.enableDepth=this._depth,this._cesium.ExpandBySmartEarth.underEarth.enableSkirt=!0),this._viewer.scene.globe.baseColor=this._cesium.Color.WHITE.withAlpha(0),i=e?(this._depth=this._cesium.defaultValue(e.depth,300),this._alpha=this._cesium.defaultValue(e.alpha,.5),this._brightness=this._cesium.defaultValue(e.brightness,.3),this.isEnterUnderground=this._cesium.defaultValue(e.isEnterUnderground,!0),this.isFlyToSky=this._cesium.defaultValue(e.isFlyToSky,!0),this._cesium.defaultValue(e.height,-100)):(this._depth=300,this._alpha=.5,this._brightness=.3,this.isEnterUnderground=!0,this.isFlyToSky=!0,-100),this.setLayerAlpha(this._alpha,this._brightness),this._viewer.scene.globe.depthTestAgainstTerrain=!0,this._viewer.scene.highDynamicRange=!1,this._viewer.scene.skyAtmosphere.show=!1,this._viewer.scene.skyBox.show=!1,this._viewer.scene.fog.enabled=!1,this._viewer.scene.backgroundColor=new this._cesium.Color(0,0,0,1),this._viewer.container.style.backgroundImage="unset",this.isUndergroundMode=!0,t?(this.isIndoor=!0,this._indoormode.createIndoormode({undergroundMode:this})):this.isIndoor=!1;var a=this._viewer.camera;o=new this._cesium.Cartographic(a.positionCartographic.longitude,a.positionCartographic.latitude,-this._depth);this._model=this.UndergroundGridLines(o,!0);return this._viewer.scene.preRender.addEventListener(this.getRelativeHeight,this),this.getRelativeHeight(),0<this._relativeHeight&&this.isEnterUnderground&&this.enterUnderground(i),this}},e.prototype.close=function(){if(this._model){this._viewer.scene.preRender.removeEventListener(this.getRelativeHeight,this),this.setLayerAlpha(this._originalOption.alpha,this._originalOption.brightness),this._viewer.scene.primitives.remove(this._model),this._cesium.ExpandBySmartEarth&&(this._cesium.ExpandBySmartEarth.underEarth.cullFace=void 0,this._cesium.ExpandBySmartEarth.underEarth.enable=!1,this._cesium.ExpandBySmartEarth.underEarth.enableDepth=0,this._cesium.ExpandBySmartEarth.underEarth.enableSkirt=!1),this._viewer.scene.globe.baseColor=this._cesium.Color.WHITE.withAlpha(1),this._viewer.scene.globe.depthTestAgainstTerrain=this._originalOption.depthTest,this._viewer.scene.skyBox&&(this._viewer.scene.skyBox.show=this._originalOption.skyBoxShow),this._viewer.scene.highDynamicRange=this._originalOption.highDynamicRange,this._viewer.scene.skyAtmosphere.show=this._originalOption.skyShow,this._viewer.scene.backgroundColor=this._originalOption.backgroundColor,this._viewer.container.style.backgroundImage=this._originalOption.backgroundImage,this._viewer.scene.fog.enabled=this._originalOption.fog,this.isUndergroundMode=!1,this._model=null,a=void 0;this._viewer.camera.positionCartographic;if(n(this),this.isFlyToSky){if(500<this._relativeHeight)return;this.flyToSky()}}},e.prototype._getOriginalOption=function(){var e={alpha:this._cesium.clone(this._viewer.imageryLayers._layers[0]&&this._viewer.imageryLayers._layers[0].alpha),brightness:this._cesium.clone(this._viewer.imageryLayers._layers[0]&&this._viewer.imageryLayers._layers[0].brightness),highDynamicRange:this._cesium.clone(this._viewer.scene.highDynamicRange),skyShow:this._cesium.clone(this._viewer.scene.skyAtmosphere.show),skyBoxShow:this._cesium.clone(this._viewer.scene.skyBox&&this._viewer.scene.skyBox.show),depthTest:this._cesium.clone(this._viewer.scene.globe.depthTestAgainstTerrain),backgroundColor:this._viewer.scene.backgroundColor.clone(),backgroundImage:this._viewer.container.style.backgroundImage,fog:this._viewer.scene.fog.enabled};this._viewer.scene.globe._surface&&this._viewer.scene.globe._surface._tileProvider&&this._viewer.scene.globe._surface._tileProvider._renderState&&(e.blending=this._cesium.clone(this._viewer.scene.globe._surface._tileProvider._renderState.blending)),this._originalOption=e},e.prototype.enterUnderground=function(e){var t=this._viewer.camera,i=new this._cesium.Cartographic(t.positionCartographic.longitude,t.positionCartographic.latitude,-this._depth);t.positionCartographic.height<=10||t.flyTo({destination:new this._cesium.Cartesian3.fromRadians(i.longitude,i.latitude,e||-this._depth/3),orientation:{heading:this._cesium.Math.toRadians(0),pitch:this._cesium.Math.toRadians(0),roll:0},complete:function(){}})},e.prototype.flyToSky=function(){var e=this._viewer.camera;this._viewer.camera.positionCartographic;10<=e.positionCartographic.height||this._viewer.camera.flyTo({destination:new this._cesium.Cartesian3.fromRadians(this.destination.longitude,this.destination.latitude,this.destination.height),orientation:{heading:this.orientation.heading,pitch:this.orientation.pitch,roll:0}})},e.prototype.setLayerAlpha=function(e,t){for(var i=this._viewer.imageryLayers.length,r=0;r<i;r++)this._viewer.imageryLayers.get(r).alpha=e,void 0!==t&&(this._viewer.imageryLayers.get(r).brightness=t);this._alpha=e,void 0!==t&&(this._brightness=t)},e.prototype.UndergroundGridLines=function(e,t){var i=e;e instanceof this._cesium.Cartesian3&&(i=this._viewer.scene.globe.ellipsoid.cartesianToCartographic(e));var r=new this._cesium.GeometryInstance({geometry:new this._cesium.EllipseGeometry({center:this._cesium.Cartesian3.fromRadians(i.longitude,i.latitude),height:i.height,semiMinorAxis:2e4,semiMajorAxis:2e4,vertexFormat:this._cesium.VertexFormat.POSITION_AND_ST}),id:"undergroundSurface"}),o=this._cesium.Material.fromType("Grid");o.uniforms.color=this._cesium.Color.WHITE.withAlpha(.3),o.uniforms.cellAlpha=.01,o.uniforms.lineCount=new this._cesium.Cartesian2(200,200),o.uniforms.lineThickness=new this._cesium.Cartesian2(1,1);var n=this._viewer.scene.primitives.add(new this._cesium.Primitive({geometryInstances:r,appearance:new this._cesium.EllipsoidSurfaceAppearance({material:o})}));return n.appearance.renderState.depthTest.enabled=!0,n.show=t,n},e.prototype.attachMouseEvent=function(){var r=this,e=this._viewer.scene;this._canvas=this._viewer.canvas,this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._canvas),this._canvas.setAttribute("tabindex","0"),this._canvas.onclick=function(){r._canvas.focus()},e.screenSpaceCameraController.enableRotate=!1,e.screenSpaceCameraController.enableTranslate=!1,e.screenSpaceCameraController.enableZoom=!1,e.screenSpaceCameraController.enableTilt=!1,e.screenSpaceCameraController.enableLook=!1,this._tree.handler.setInputAction(function(e){r._flags.move=!0,r._viewer.camera.pitch>r._cesium.Math.toRadians(5)?(r._flags.vertical=!0,r._startMousePosition=e.position):r._flags.horizontally=!0,r._viewer.camera.positionCartographic,r._cameraHeight=r._viewer.camera.positionCartographic.height},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this._tree.handler.setInputAction(function(e){r._flags.move=!0,r._flags.rotate=!0},this._cesium.ScreenSpaceEventType.MIDDLE_DOWN),this._tree.handler.setInputAction(function(e){r._flags.vertical||(r._startMousePosition=e.startPosition),r._mousePosition=e.endPosition,r.mouseMoveEvent()},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){r._flags.move=!1,r._flags.horizontally=!1,r._flags.vertical=!1},this._cesium.ScreenSpaceEventType.LEFT_UP),this._tree.handler.setInputAction(function(e){r._flags.move=!1,r._flags.rotate=!1},this._cesium.ScreenSpaceEventType.MIDDLE_UP);this._tree.handler.setInputAction(function(e){var t=r._viewer.camera,i=500<t.positionCartographic.height?t.positionCartographic.height/1e3:.1;t.pitch<0&&t.positionCartographic.height<-200&&0<e||0<t.pitch&&t.positionCartographic.height<-200&&e<0||t.zoomIn(e*i)},this._cesium.ScreenSpaceEventType.WHEEL)},e.prototype.mouseMoveEvent=function(){var e=200*this.moveSpeed,t=this._viewer.camera;if(this._flags.move){this._canvas.clientWidth;var i=this._canvas.clientHeight,r=this._mousePosition.x-this._startMousePosition.x,o=-(this._mousePosition.y-this._startMousePosition.y);this._flags.horizontally&&(t.moveLeft(2*r),t.moveBackward(2*o),t.setView({destination:this._cesium.Cartesian3.fromRadians(t.positionCartographic.longitude,t.positionCartographic.latitude,this._cameraHeight),orientation:{heading:t.heading,pitch:t.pitch,roll:t.roll}})),this._flags.vertical&&(o/=i,t.setView({destination:this._cesium.Cartesian3.fromRadians(t.positionCartographic.longitude,t.positionCartographic.latitude,this._cameraHeight-o*e),orientation:{heading:t.heading,pitch:t.pitch,roll:t.roll}})),this._flags.rotate&&(!t.roll&&t.pitch<0&&o<0?o=0:!t.roll&&0<t.pitch&&0<o&&(o=0),t.rotate(t.position,.001*r),t.lookUp(.001*o))}},e.prototype.getRelativeHeight=function(){var e=this._viewer.camera,t=this._viewer.scene.globe.getHeight(e.positionCartographic);if(this._groundHeightAtCameraPosition=t||this._groundHeightAtCameraPosition,this._relativeHeight=e.positionCartographic.height-this._groundHeightAtCameraPosition,this._relativeHeight<1){this._tree.handler||this.isIndoor||this.attachMouseEvent();var i=Math.abs(this._relativeHeight);this.moveSpeed=i<50?.25:i<100?.5:i<150?.75:1}else this._tree.handler&&!this.isIndoor&&n(this);!a&&(a=e.position.clone()),1e4<this._core.getSpaceDistancem([a,e.position],this._cesium)&&(a=e.position.clone(),this.refreshGridLines()),this._relativeHeight<0?this._model&&(this._model.show=!0):this._model&&(this._model.show=!1)},e.prototype.isHaveTerrain=function(){return!!(this._viewer.scene&&this._viewer.scene.terrainProvider&&this._viewer.scene.terrainProvider._layers)},e.prototype.setCesiumFov=function(e){this._viewer.camera.frustum.fov=this._cesium.Math.toRadians(e)},e}),define("SGWorld/Analysis/StreetView",["../Core/Core","../Core/jquery","../ProjectTree/treeSource"],function(i,e,r){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=r,this.isStreetView=!1,Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.isStreetView=!1),this.defaultSkyAtmosphere=!0,this.StreetViewSphere=[null,null],this.StreetViewSphere_Canvas=[null,null],this.StreetViewNavigation=[],this.StreetViewSphereIndex=0,this.URL={getInitImageByPosition:"",getInitImageInfoById:"",getInitImageById:"",getSecondImageById:"",getThirdImageById:""},this.CallBack={getInitImageByPositionCallBack:void 0,getImageInfoByIdCallBack:void 0,getInitImageByIdCallBack:void 0,getSecondImageByIdCallBack:void 0,getThirdImageByIdCallBack:void 0},this.StreetViewData={radius:5,defaultFov:60,fov:110,alpha:1,speedScale:1.5,lon:void 0,lat:void 0,height:0,HeadingPitchRoll:null,getImageTileID:"",linkImagesData:[],isTwoTextures:!1,isThreeTextures:!1,_handler:null,navigation_handler:null}}var n,a;t.prototype.StreetViewOpen=function(e,t,i){var r=this,o=this._viewer;if(!this.isStreetView){0<this.StreetViewSphere.length&&(this.StreetViewSphere.forEach(function(e){e&&o.entities.remove(e)}),this.StreetViewSphere=[null,null]),this.StreetViewData.linkImagesData=[],this.URL=this.extend(this.URL,t,!1),this.CallBack=this.extend(this.CallBack,t,!1),this.defaultSkyAtmosphere=!!o.scene.skyAtmosphere.show,o.scene.skyAtmosphere.show||(o.scene.skyAtmosphere.show=!0);var n=o.camera;this.getInitImageByPosition(e,function(e){r.isStreetView=!0,Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.isStreetView=!0),n.flyTo({destination:new r._cesium.Cartesian3.fromDegrees(r.StreetViewData.lon,r.StreetViewData.lat,r.StreetViewData.height),orientation:{heading:n.heading,pitch:n.pitch>r._cesium.Math.toRadians(45)||n.pitch<r._cesium.Math.toRadians(-45)?0:n.pitch,roll:0},duration:5,complete:function(){i&&"function"==typeof i&&i()}}),r.attachMouseEvent(),r.createNavigation(),r.StreetViewSphereIndex=0,r.StreetViewSphere_Canvas[r.StreetViewSphereIndex]=e,r.StreetViewSphere[r.StreetViewSphereIndex]=r.createScene(r.StreetViewData.lon,r.StreetViewData.lat,r.StreetViewData.height),r.StreetViewSphere[r.StreetViewSphereIndex].show=!0,r.StreetViewSphere[r.StreetViewSphereIndex].orientation=r._cesium.Transforms.headingPitchRollQuaternion(r._cesium.Cartesian3.fromDegrees(r.StreetViewData.lon,r.StreetViewData.lat,r.StreetViewData.height),new r._cesium.HeadingPitchRoll(r._cesium.Math.toRadians(r.StreetViewData.HeadingPitchRoll.heading),r._cesium.Math.toRadians(-r.StreetViewData.HeadingPitchRoll.roll),r._cesium.Math.toRadians(r.StreetViewData.HeadingPitchRoll.pitch))),r.getSecondTexturesFromAtlasFile(r.StreetViewData.getImageTileID,function(e){e.index===r.StreetViewSphereIndex&&(r.StreetViewSphere_Canvas[r.StreetViewSphereIndex]=e.canvas),r.StreetViewData.isTwoTextures=!0})})}return this},t.prototype.exit=function(){if(this.isStreetView){var e=this,t=this._viewer;0<this.StreetViewSphere.length&&(this.StreetViewSphere.forEach(function(e){e&&t.entities.remove(e)}),this.StreetViewSphere=[null,null],this.StreetViewSphere_Canvas=[null,null]),0<this.StreetViewNavigation.length&&(this.StreetViewNavigation.forEach(function(e){t.entities.remove(e)}),this.StreetViewNavigation=[]),this.setCesiumFov(this.StreetViewData.defaultFov),this.detachMouseEvent(),t.scene.skyAtmosphere.show=this.defaultSkyAtmosphere,this.isStreetView=!1,Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.isStreetView=!1);var i=t.camera.positionCartographic;t.camera.flyTo({destination:new this._cesium.Cartesian3.fromRadians(i.longitude,i.latitude,i.height+3e3),orientation:{heading:t.camera.heading,pitch:this._cesium.Math.toRadians(-90),roll:0},complete:function(){e.isStreetView=!1,Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.isStreetView=!1)}})}},t.prototype.extend=function(e,t,i){for(var r in t)t.hasOwnProperty(r)&&(e.hasOwnProperty(r)||i)&&(e[r]=t[r]);return e},t.prototype.getInitImageByPositionURL=function(e){var t;if(this.URL&&this.URL.getInitImageByPosition){var i,r=this.URL.getInitImageByPosition.split("{lon}");t=1<r[0].split("{lat}").length?(i=r[0].split("{lat}"))[0]+e.lat+i[1]+e.lon+r[1]:(i=r[1].split("{lat}"),r[0]+e.lon+i[0]+e.lat+i[1])}return t},t.prototype.getImageByIdURL=function(e,t){var i,r;switch(e){case"one":r=this.URL.getInitImageById;break;case"two":r=this.URL.getSecondImageById;break;case"three":r=this.URL.getThirdImageById;break;case"init":r=this.URL.getInitImageInfoById}if(r){var o=r.split("{id}");i=o[0]+t+o[1]}return i},t.prototype.getInitImageByPosition=function(e,n){var i=this,t=this.getInitImageByPositionURL(e);this._core.xhr({url:t,type:"get",dataType:"json",success:function(e){if(i.CallBack&&i.CallBack.getInitImageByPositionCallBack){"function"==typeof i.CallBack.getInitImageByPositionCallBack&&i.CallBack.getInitImageByPositionCallBack(i.StreetViewData,e);var t=i.getImageByIdURL("one",i.StreetViewData.getImageTileID),o=new Image;o.onload=function(){var e=o.width,t=o.height,i=document.createElement("canvas"),r=i.getContext("2d");i.height=t,i.width=e,r.translate(e,0),r.scale(-1,1),r.drawImage(o,0,0,e,t,0,0,e,t),"function"==typeof n&&n(i)},o.setAttribute("crossOrigin","Anonymous"),o.src=t}else console.log("the getInitImageByPositionCallBack is undefined!")},error:function(e,t,i){}})},t.prototype.getInitImage=function(e,o){var t=this.getImageByIdURL("one",e),n=new Image;n.onload=function(){var e=n.width,t=n.height,i=document.createElement("canvas"),r=i.getContext("2d");i.height=t,i.width=e,r.translate(e,0),r.scale(-1,1),r.drawImage(n,0,0,e,t,0,0,e,t),"function"==typeof o&&o(i)},n.setAttribute("crossOrigin","Anonymous"),n.src=t},t.prototype.getSecondTexturesFromAtlasFile=function(e,o){for(var n=this.StreetViewSphereIndex,t=this.getImageByIdURL("two",e),a=null,s=null,l=0,u=[],i=0;i<4;i++)for(var r=0;r<8;r++){var c=t+i+"-"+r,h=new Image;!function(e,t,r){r.onload=function(){var e=r.width,t=r.height;if(32==++l){null==a&&(a=document.createElement("canvas"),s=a.getContext("2d"),a.height=2048,a.width=4096,s.translate(4096,0),s.scale(-1,1));for(var i=0;i<u.length;i++)s.drawImage(u[i],0,0,e,t,e*(i%8),t*Math.floor(i/8),e,t);o({index:n,canvas:a})}}}(0,0,h),h.setAttribute("crossOrigin","Anonymous"),h.src=c,u.push(h)}},t.prototype.getThreeTexturesFromAtlasFile=function(e,o){for(var n=this.StreetViewSphereIndex,t=this.getImageByIdURL("three",e),a=null,s=null,l=0,u=[],i=0;i<8;i++)for(var r=0;r<16;r++){var c=t+i+"-"+r,h=new Image;!function(e,t,r){r.onload=function(){var e=r.width,t=r.height;if(128==++l){null==a&&(a=document.createElement("canvas"),s=a.getContext("2d"),a.height=4096,a.width=8192,s.translate(8192,0),s.scale(-1,1));for(var i=0;i<u.length;i++)s.drawImage(u[i],0,0,e,t,e*(i%16),t*Math.floor(i/16),e,t);o({index:n,canvas:a})}}}(0,0,h),h.setAttribute("crossOrigin","Anonymous"),h.src=c,u.push(h)}},t.prototype.InitSceneByID=function(t){var i=this,r=this._viewer;this.updateStreetSphereIndex(),this.StreetViewSphere[this.StreetViewSphereIndex]=this.createScene(this.StreetViewData.lon,this.StreetViewData.lat,this.StreetViewData.height),this.getInitImage(this.StreetViewData.getImageTileID,function(e){i.StreetViewSphere_Canvas[i.StreetViewSphereIndex]=e,setTimeout(function(){i.StreetViewSphere[i.StreetViewSphereIndex].show=!0},300)}),this.StreetViewData.isTwoTextures=!1,this.getImageInfoById(this.StreetViewData.getImageTileID,function(e){i.StreetViewData.linkImagesData=[],i.CallBack&&i.CallBack.getImageInfoByIdCallBack?("function"==typeof i.CallBack.getImageInfoByIdCallBack&&i.CallBack.getImageInfoByIdCallBack(i.StreetViewData,e),i.StreetViewSphere[i.StreetViewSphereIndex].position=i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),r.camera.cancelFlight(),r.camera.flyTo({destination:i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),orientation:{heading:r.camera.heading,pitch:r.camera.pitch,roll:0},duration:1.5}),setTimeout(function(){r.entities.remove(t),t=null},1300),i.StreetViewSphere[i.StreetViewSphereIndex].orientation=i._cesium.Transforms.headingPitchRollQuaternion(i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),new i._cesium.HeadingPitchRoll(i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.heading),i._cesium.Math.toRadians(-i.StreetViewData.HeadingPitchRoll.roll),i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.pitch))),i.getInitImage(i.StreetViewData.getImageTileID,function(e){i.StreetViewData.isTwoTextures||(i.StreetViewSphere_Canvas[i.StreetViewSphereIndex]=e)}),i.getSecondTexturesFromAtlasFile(i.StreetViewData.getImageTileID,function(e){e.index===i.StreetViewSphereIndex&&!1===i.StreetViewData.isTwoTextures&&(i.StreetViewSphere_Canvas[i.StreetViewSphereIndex]=e.canvas),i.StreetViewData.isTwoTextures=!0,i.StreetViewData.isThreeTextures=!1}),i.createNavigation()):console.log("the getImageInfoByIdCallBack is undefined!")})},t.prototype.getImageInfoById=function(e,t){var i=this.getImageByIdURL("init",e);this._core.xhr({url:i,type:"get",dataType:"json",success:function(e){"function"==typeof t&&t(e)}})},t.prototype.createScene=function(e,t,i){var r=this,o=this._viewer,n=this.StreetViewSphereIndex,a=new this._cesium.ImageMaterialProperty({image:new this._cesium.CallbackProperty(function(){return r.StreetViewSphere_Canvas[n]},!1),transparent:!0,color:this._cesium.Color.WHITE.withAlpha(this.StreetViewData.alpha)}),s={show:!1,position:this._cesium.Cartesian3.fromDegrees(e,t,i),ellipsoid:{radii:new this._cesium.Cartesian3(this.StreetViewData.radius,this.StreetViewData.radius,this.StreetViewData.radius),material:a}},l=o.entities.add(s);return l.geometryName="街景",l};var o=null,c=null,s={looking:!(t.prototype.detachMouseEvent=function(){var e=this._viewer.scene;this._viewer.canvas;this.StreetViewData._handler&&(this.StreetViewData._handler.destroy(),this.StreetViewData._handler=void 0),this.StreetViewData.navigation_handler&&(this.StreetViewData.navigation_handler.destroy(),this.StreetViewData.navigation_handler=void 0),this._viewer.clock.onTick.removeEventListener(this.streetSphere_onTick,this),e.screenSpaceCameraController.enableRotate=!0,e.screenSpaceCameraController.enableTranslate=!0,e.screenSpaceCameraController.enableZoom=!0,e.screenSpaceCameraController.enableTilt=!0,e.screenSpaceCameraController.enableLook=!0})};return t.prototype.attachMouseEvent=function(){var i=this;o=this._viewer.scene,c=this._viewer.canvas,this.StreetViewData._handler=new this._cesium.ScreenSpaceEventHandler(c),c.setAttribute("tabindex","0"),c.focus(),c.onclick=function(){c.focus()},setTimeout(function(){i.setCesiumFov(i.StreetViewData.fov)},4e3),o.screenSpaceCameraController.enableRotate=!1,o.screenSpaceCameraController.enableTranslate=!1,o.screenSpaceCameraController.enableZoom=!1,o.screenSpaceCameraController.enableTilt=!1,o.screenSpaceCameraController.enableLook=!1,this.StreetViewData._handler.setInputAction(function(e){s.looking=!0},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.StreetViewData._handler.setInputAction(function(e){s.looking&&(n=e.startPosition,a=e.endPosition,i.StreetView_mouseMove())},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.StreetViewData._handler.setInputAction(function(e){s.looking=!1},this._cesium.ScreenSpaceEventType.LEFT_UP),this.StreetViewData._handler.setInputAction(function(e){var t=i.StreetViewData.fov+e/-10;30<t&&t<120&&(i.StreetViewData.fov=t,i.setCesiumFov(i.StreetViewData.fov))},this._cesium.ScreenSpaceEventType.WHEEL),this._viewer.clock.onTick.addEventListener(i.StreetView_onTick,this)},t.prototype.StreetView_onTick=function(){var t=this;!this.StreetViewData.isThreeTextures&&this.StreetViewData.fov<50&&(this.StreetViewData.isThreeTextures=!0,this.getThreeTexturesFromAtlasFile(this.StreetViewData.getImageTileID,function(e){e.index===t.StreetViewSphereIndex&&(t.StreetViewSphere_Canvas[t.StreetViewSphereIndex]=e.canvas)}))},t.prototype.StreetView_mouseMove=function(){var e=this._viewer.camera;if(s.looking){var t=c.clientWidth,i=c.clientHeight,r=-(a.x-n.x)/t,o=(a.y-n.y)/i;!e.roll&&e.pitch<0&&o<0?o=0:!e.roll&&0<e.pitch&&0<o&&(o=0),e.rotate(e.position,r*this.StreetViewData.speedScale),e.lookUp(o*this.StreetViewData.speedScale)}},t.prototype.setOpacity=function(t){var i=this;this.StreetViewSphere.forEach(function(e){e&&(e.ellipsoid.material.color._value=i._cesium.Color.WHITE.withAlpha(t))}),this.StreetViewData.alpha=t},t.prototype.setCesiumFov=function(e){this._viewer.camera.frustum.fov=this._cesium.Math.toRadians(e)},t.prototype.MoveToLinkImage=function(e){e?(this.StreetViewData.lon=e.Position[0],this.StreetViewData.lat=e.Position[1],this.StreetViewData.height=e.Position[2],this.StreetViewData.getImageTileID=e.ImageID,this.InitSceneByID(this.StreetViewSphere[this.StreetViewSphereIndex])):alert("暂无街景数据")},t.prototype.updateStreetSphereIndex=function(){this.StreetViewSphereIndex=0===this.StreetViewSphereIndex?1:0},t.prototype.createNavigation=function(){var r=this,s=this._viewer;0<this.StreetViewNavigation.length&&(this.StreetViewNavigation.forEach(function(e){s.entities.remove(e)}),this.StreetViewNavigation=[]),this.StreetViewData.navigation_handler&&(this.StreetViewData.navigation_handler.destroy(),this.StreetViewData.navigation_handler=null);var i,m=6378137,l=6356725,o={lon:this.StreetViewData.lon,lat:this.StreetViewData.lat,height:this.StreetViewData.height-1};function p(e,t,i,r){var o=i*Math.sin(r*Math.PI/180),n=i*Math.cos(r*Math.PI/180),a=l+(m-l)*(90-t)/90;return[180*(o/(a*Math.cos(t*Math.PI/180))+e*Math.PI/180)/Math.PI,180*(n/a+t*Math.PI/180)/Math.PI]}function g(e){return e*Math.PI/180}function u(e,t,i){var r,o,n,a,s,l,u,c,h,d=(r=e.lon,o=e.lat,n=t.lon,a=t.lat,s=g(o),l=g(a),u=g(a)-g(o),c=g(n)-g(r),h=2*Math.asin(Math.sqrt(Math.pow(Math.sin(u/2),2)+Math.cos(s)*Math.cos(l)*Math.pow(Math.sin(c/2),2))),h*=m,h=Math.round(1e4*h)/1e4,{angle:0===u&&0<c?90:0===u&&c<0?270:u<0&&0===c?180:0<=u&&0===c?0:u<0&&0<c?180-180*Math.atan(c/-u)/Math.PI:u<0&&c<0?180+180*Math.atan(c/u)/Math.PI:0<u&&c<0?360-180*Math.atan(-c/u)/Math.PI:180*Math.atan(c/u)/Math.PI,distance:h});return p(e.lon,e.lat,d.distance,i-d.angle)}function n(e,t){var i=[],r=p(e.lon,e.lat,3.5,180*s.camera.heading/Math.PI),o={lon:r[0],lat:r[1]};r=p(r[0],r[1],1.1,0),i.push(r[0],r[1]),r=p(r[0],r[1],.5758,135),i.push(r[0],r[1]),r=p(r[0],r[1],.2,270),i.push(r[0],r[1]),r=p(r[0],r[1],.5,180),i.push(r[0],r[1]),r=p(r[0],r[1],.4,270),i.push(r[0],r[1]),r=p(r[0],r[1],.5,0),i.push(r[0],r[1]),r=p(r[0],r[1],.2,270),i.push(r[0],r[1]);for(var n,a=0;a<i.length-1;a+=2)n=u(o,{lon:i[a],lat:i[a+1]},t),i[a]=n[0],i[a+1]=n[1];return i}this.StreetViewData.linkImagesData.forEach(function(t){var e=n(o,t.NavigationAngle),i=s.entities.add({polygon:{hierarchy:new r._cesium.PolygonHierarchy(r._cesium.Cartesian3.fromDegreesArray(e)),fill:!0,outline:!0,outlineColor:r._cesium.Color.BLACK.withAlpha(.2),height:o.height}});i.geometryName="街景",i.polygon.hierarchy=new r._cesium.CallbackProperty(function(){var e=n(o,t.NavigationAngle);return new r._cesium.PolygonHierarchy(r._cesium.Cartesian3.fromDegreesArray(e))},!1),i.isNavigation=!0,i.linkImageData=t,r.StreetViewNavigation.push(i)}),r.StreetViewData.navigation_handler=new r._cesium.ScreenSpaceEventHandler(c),r.StreetViewData.navigation_handler.setInputAction(function(e){var t=s.scene.pick(e.position);r._cesium.defined(t)&&(t&&t.id&&t.id.isNavigation?(i&&(i.polygon.outlineColor=r._cesium.Color.BLACK.withAlpha(.5),i.polygon.material=r._cesium.Color.WHITE),(i=t.id).polygon.outlineColor=r._cesium.Color.BLUE,i.polygon.material=r._cesium.Color.WHITE.withAlpha(.9)):i&&(i.polygon.outlineColor=r._cesium.Color.BLACK.withAlpha(.5),i.polygon.material=r._cesium.Color.WHITE,i=void 0)),i&&r.MoveToLinkImage(i.linkImageData)},r._cesium.ScreenSpaceEventType.LEFT_CLICK)},t}),define("SGWorld/Analysis/Scan",["../Core/Core","../Core/jquery","../ProjectTree/treeSource"],function(i,e,r){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=r}return t.prototype.createCircleScan=function(e,t,i,r,o){var n,a=new this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height);this._position=e,n=i?this._cesium.Color.fromCssColorString(i):new Cesium.Color(1,0,0,1),this.item=this.AddCircleScanPostStage(a,this._cesium.defaultValue(t,1500),n,this._cesium.defaultValue(r,4e3),o);var s={id:this._core.getuid(),name:"新建扩散圆扫描",pId:0,type:"scan",item:this};return this.setTreeobj(s),this._tree.insertGroupId(s,0),this},t.prototype.createMultiCircleScan=function(e,t,i,r,o){var n,a=new this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height);this._position=e,n=i?this._cesium.Color.fromCssColorString(i):new Cesium.Color(1,0,0,1),this.item=this.AddCircleScanMultiPostStage(a,this._cesium.defaultValue(t,1500),n,this._cesium.defaultValue(r,4e3),o);var s={id:this._core.getuid(),name:"新建扩散圆扫描",pId:0,type:"scan",item:this};return this.setTreeobj(s),this._tree.insertGroupId(s,0),this},t.prototype.createRadarScan=function(e,t,i,r,o){var n,a=new this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height);this._position=e,n=i?this._cesium.Color.fromCssColorString(i):new Cesium.Color(1,0,0,1),this.item=this.AddRadarScanPostStage(a,this._cesium.defaultValue(t,1500),n,this._cesium.defaultValue(r,4e3),o);var s={id:this._core.getuid(),name:"新建雷达扫描",pId:0,type:"scan",item:this};return this.setTreeobj(s),this._tree.insertGroupId(s,0),this},t.prototype.createSectorScan=function(e,t,i,r,o,n,a){this._viewer;var s,l=this._cesium,u=new l.Cartesian3.fromDegrees(e.lon,e.lat,e.height);this._position=e,s=i?l.Color.fromCssColorString(i):new l.Color(1,0,0,1),this.item=this.AddSectorScanPostStage(u,l.defaultValue(t,1500),s,l.defaultValue(r,90),l.defaultValue(o,0),l.defaultValue(n,4e3),a);var c={id:this._core.getuid(),name:"新建扇形扩散扫描",pId:0,type:"scan",item:this};return this.setTreeobj(c),this._tree.insertGroupId(c,0),this},t.prototype.AddSectorScanPostStage=function(e,t,i,r,o,n,a){var s,l=this._viewer,u=this._cesium,c=this._core.defaultValue(this._position.height,0);if(!u.EllipsoidFadeMaterialProperty){var h=function(e,t,i){this._definitionChanged=new u.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.duration=i,this._angle=t,this._time=(new Date).getTime()};Object.defineProperties(h.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:u.createPropertyDescriptor("color"),angle:u.createPropertyDescriptor("angle")}),h.prototype.getType=function(e){return"EllipsoidFade"},h.prototype.getValue=function(e,t){return u.defined(t)||(t={}),t.color=u.Property.getValueOrClonedDefault(this._color,e,u.ColorWHITE,t.color),t.angle=this._angle,t},h.prototype.equals=function(e){return this===e||e instanceof h&&Property.equals(this._color,e._color)},u.EllipsoidFadeMaterialProperty=h,u.Material.EllipsoidFadeType="EllipsoidFade",u.Material.EllipsoidFadeSource="float getAngle(in vec2 dv)\n{\n if(dv.y == 0.0 && dv.x > 0.0)\n {\n return 90.0;\n }\n if(dv.y == 0.0 && dv.x < 0.0)\n {\n return 270.0;\n }\n float rAngle = atan(dv.x/dv.y) * 180.0 / 3.1415926;\n if(dv.x > 0.0)\n {\n if(dv.y < 0.0)\n {\n rAngle = 180.0 + rAngle;\n }\n }\n if(dv.x <= 0.0)\n {\n if(dv.y < 0.0)\n {\n rAngle = 180.0 + rAngle;\n }\n if(dv.y > 0.0)\n {\n rAngle = 360.0 + rAngle;\n }\n }\n return rAngle;\n}\nfloat ripple(float dist, float rippleIntensity, float rippleScale) {\n return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n float nowAngle = getAngle(st.xy-vec2(0.5, 0.5));\n if(nowAngle < angle)\n {\n material.alpha = 1.0 - dis/0.5;\n float intensity =step(0.001,ripple(dis, 100.0, 15.0));\n if(intensity == 1.0)\n {\n material.alpha = material.alpha/2.0;\n }\n }\n else{\n material.alpha = 0.0;\n discard;\n }\n return material;\n}",u.Material._materialCache.addMaterial(u.Material.EllipsoidFadeType,{fabric:{type:u.Material.EllipsoidFadeType,uniforms:{color:new u.Color(1,0,0,1),angle:90},source:u.Material.EllipsoidFadeSource},translucent:function(e){return!0}})}return s={name:"EllipsoidFade",position:e,ellipse:{height:a?void 0:c,semiMinorAxis:t,semiMajorAxis:t,stRotation:o*Math.PI/180,material:new u.EllipsoidFadeMaterialProperty(i,r,2e3)}},l.entities.add(s)},t.prototype.AddCircleScanPostStage=function(e,t,i,r,o){var n=this._viewer,a=this._cesium,s=this._core.defaultValue(this._position.height,0);if(!a.CircleScanMaterialProperty){var l=function(e,t){this._definitionChanged=new a.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.duration=t,this._time=(new Date).getTime()};Object.defineProperties(l.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:a.createPropertyDescriptor("color")}),l.prototype.getType=function(e){return"CircleScan"},l.prototype.getValue=function(e,t){return a.defined(t)||(t={}),t.color=a.Property.getValueOrClonedDefault(this._color,e,a.Color.WHITE,t.color),t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t},l.prototype.equals=function(e){return this===e||e instanceof l&&a.Property.equals(this._color,e._color)},a.CircleScanMaterialProperty=l,a.Material.CircleScanType="CircleScan",a.Material.CircleScanSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n if(dis<time){\n float f = dis / time;\n material.alpha = pow(f, 4.0);\n }else{\n material.alpha = 0.0;\n }\n return material;\n }",a.Material._materialCache.addMaterial(a.Material.CircleScanType,{fabric:{type:a.Material.CircleScanType,uniforms:{color:new a.Color(1,0,0,1),time:0},source:a.Material.CircleScanSource},translucent:function(e){return!0}})}var u={name:"CircleScan",position:e,ellipse:{height:o?void 0:s,semiMinorAxis:t,semiMajorAxis:t,material:new a.CircleScanMaterialProperty(i,r)}};return n.entities.add(u)},t.prototype.AddCircleScanMultiPostStage=function(e,t,i,r,o){var n=this._viewer,a=this._cesium,s=this._core.defaultValue(this._position.height,0);if(!a.CircleScanMultiMaterialProperty){var l=function(e,t){this._definitionChanged=new a.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.u_radius1=0,this.u_radius2=0,this.u_radius3=0,this.duration=t,this._time=(new Date).getTime()};Object.defineProperties(l.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:a.createPropertyDescriptor("color")}),l.prototype.getType=function(e){return"CircleScanMulti"},l.prototype.getValue=function(e,t){return a.defined(t)||(t={}),t.color=a.Property.getValueOrClonedDefault(this._color,e,a.Color.WHITE,t.color),t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t.time<1/3&&0===this.u_radius2&&0===this.u_radius1?this.u_radius3=t.time:t.time>=1/3&&t.time<2/3&&0===this.u_radius1?(this.u_radius3=t.time,this.u_radius2=this.u_radius3-1/3):t.time>=2/3?(this.u_radius3=t.time,this.u_radius2=this.u_radius3-1/3,this.u_radius1=this.u_radius3-2/3):t.time<1/3&&0!==this.u_radius2&&0!==this.u_radius1?(this.u_radius1=t.time,this.u_radius2=t.time+1/3,this.u_radius3=t.time+2/3):t.time>=1/3&&t.time<2/3&&0!==this.u_radius1&&(this.u_radius1=t.time-1/3,this.u_radius2=t.time,this.u_radius3=t.time+1/3),t.u_radius1=this.u_radius1,t.u_radius2=this.u_radius2,t.u_radius3=this.u_radius3,t},l.prototype.equals=function(e){return this===e||e instanceof l&&a.Property.equals(this._color,e._color)},a.CircleScanMultiMaterialProperty=l,a.Material.CircleScanMultiType="CircleScanMulti",a.Material.CircleScanMultiSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n dis = dis * 2.0;\n if(dis < u_radius1)\n\n {\n float f = dis / u_radius1;\n material.alpha = pow(f, 9.0);\n }else if(dis < u_radius2){\n float f = dis / u_radius2;\n material.alpha = pow(f, 9.0);\n }else if(dis < u_radius3){\n float f = dis / u_radius3;\n material.alpha = pow(f, 9.0);\n }else{\n material.alpha = 0.0;\n }\n return material;\n }",a.Material._materialCache.addMaterial(a.Material.CircleScanMultiType,{fabric:{type:a.Material.CircleScanMultiType,uniforms:{color:new a.Color(1,0,0,1),time:0,u_radius1:0,u_radius2:0,u_radius3:0},source:a.Material.CircleScanMultiSource},translucent:function(e){return!0}})}var u={name:"CircleScanMulti",position:e,ellipse:{height:o?void 0:s,semiMinorAxis:t,semiMajorAxis:t,material:new a.CircleScanMultiMaterialProperty(i,r)}};return n.entities.add(u)},t.prototype.AddRadarScanPostStage=function(e,t,i,r,o){var n=this._viewer,a=this._cesium,s=this._core.defaultValue(this._position.height,0);if(!a.RadarScanMaterialProperty){var l=function(e,t){this._definitionChanged=new a.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.duration=t,this._time=(new Date).getTime()};Object.defineProperties(l.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:a.createPropertyDescriptor("color")}),l.prototype.getType=function(e){return"RadarScan"},l.prototype.getValue=function(e,t){return a.defined(t)||(t={}),t.color=a.Property.getValueOrClonedDefault(this._color,e,a.Color.WHITE,t.color),t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t.angle1=360*t.time,t.angle2=360*t.time+60,360<t.angle2&&(t.angle2=t.angle2-360),t},l.prototype.equals=function(e){return this===e||e instanceof l&&a.Property.equals(this._color,e._color)},a.RadarScanMaterialProperty=l,a.Material.RadarScanType="RadarScan",a.Material.RadarScanSource="float getAngle(in vec2 dv)\n {\n if(dv.y == 0.0 && dv.x > 0.0)\n {\n return 90.0;\n }\n if(dv.y == 0.0 && dv.x < 0.0)\n {\n return 270.0;\n }\n float rAngle = atan(dv.x/dv.y) * 180.0 / 3.1415926;\n if(dv.x > 0.0)\n {\n if(dv.y < 0.0)\n {\n rAngle = 180.0 + rAngle;\n }\n }\n if(dv.x <= 0.0)\n {\n if(dv.y < 0.0)\n {\n rAngle = 180.0 + rAngle;\n }\n if(dv.y > 0.0)\n {\n rAngle = 360.0 + rAngle;\n }\n }\n return rAngle;\n }\n float ripple(float dist, float rippleIntensity, float rippleScale) {\n return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n }\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n float f = 0.0;\n float nowAngle = getAngle(st.xy-vec2(0.5, 0.5));\n if(nowAngle < angle2 && nowAngle > angle1)\n {\n f = (nowAngle - angle1) / 60.0;\n material.alpha = f;\n }else if(nowAngle < 360.0 && nowAngle > angle1 && angle2 < 60.0){\n f = (nowAngle - angle1) / 60.0;\n material.alpha = f;\n }else if(nowAngle < angle2 && nowAngle > 0.0 && angle2 < 60.0){\n f = (nowAngle + 360.0 - angle1) / 60.0;\n material.alpha = f;\n }else{\n material.alpha = 0.0;\n discard;\n }\n return material;\n }",a.Material._materialCache.addMaterial(a.Material.RadarScanType,{fabric:{type:a.Material.RadarScanType,uniforms:{color:new a.Color(1,0,0,1),time:0,angle2:0,angle1:0},source:a.Material.RadarScanSource},translucent:function(e){return!0}})}var u={name:"RadarScan",position:e,ellipse:{height:o?void 0:s,semiMinorAxis:t,semiMajorAxis:t,material:new a.RadarScanMaterialProperty(i,r)}};return n.entities.add(u)},t.prototype.remove=function(){this._viewer.entities.remove(this.item)},t.prototype.setTreeobj=function(e){this.treeobj=e},t.prototype.deleteObject=function(){this.item&&this._viewer.entities.remove(this.item)},t.prototype.setVisibility=function(e){this.item&&(this.item.show=e)},t}),define("SGWorld/Analysis/depthTestAgainstTerrain",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.depthTestAgainstTerrain=function(e){this._viewer.scene.globe.depthTestAgainstTerrain=e},e.prototype.show=function(){return this._viewer.scene.globe.depthTestAgainstTerrain},e}),define("SGWorld/Analysis/3Dviewshed",["../configData","../Core/Core","../Creator/Color","../ProjectTree/treeSource","../Navigate/getPosition"],function(i,r,e,t,o){"use strict";var n,a,m,p,s,g,f,E,S,v,P=[1,1e5];function l(e,t){if(!(v.canvas.width<=0||v.canvas.height<=0)){var i,r=v.camera.getPickRay(e);r&&(i=v.scene.globe.pick(r,v.scene));var o=v.scene.pick(e);if(o&&o.id instanceof Cesium.Entity&&(o=void 0),o){var n=v.scene.pickPosition(e);n&&(i=n)}return i}}function x(e,t){this._normalShadowMap=e.scene.shadowMap,v=e,Cesium.Scene.prototype.screenToWorld=l,this._viewer=e,this._cesium=t,this._core=new r,this._getPosition=new o(e,t),this._startPositionCartesian=null,this._startPositionCartographic=null,this._currentPosition=null,this._prevRadius=null,this._currentRadius=null,this._currentFovHorizontal=null,this._currentFovVertical=null,this._viewshedDirection=null,this._scratchCartesian3=new Cesium.Cartesian3,this._texture=null,this._canEnlarge=!1,this._viewshedPrimitive=null,this._eventListener=null,this._viewshedMap=void 0,this._firstTime=!0,this._editingMode=!1,this._isSliderClicked=!1,this._currentObject=void 0,this._setNewPosition=!1,this._setNewPositionCanDrag=!1,this._setNewName=!1,this._listControl=void 0,this._addingViewshedMode=!1,this._initialCameraParams={},this._isCancelledTerrain=!1,this._isCancelledPrimitives=!1,this._isSpherical=!1,this._occluder=void 0,this._horizonCullingDistanceFromPoint=void 0,this._mousePositionX=void 0,this._mousePositionY=void 0,this._zAxisNewPosition=void 0,this._startingRepoZHeight=void 0,this._viewshedCartoPos=void 0,this._propertiesChanged=!1,this._calculations=[],this._exposures=[],this._calculating=!1,this._calculatingExposure=!1,this.viewshedCalculateNormals=!1,this._txtUnit="meters_short",this.isLoadingScreenOn=!1,this._primitiveColor=Cesium.Color.WHITE,this._predefinedPrimitiveColors={BEYOND_THE_HORIZON:Cesium.Color.WHITE,DEFAULT:Cesium.Color.WHITE},this._layersStorage=null,this.getId=function(){return"Viewshed"},this.maxNumViewshed=8,n=53*Cesium.Math.RADIANS_PER_DEGREE,a=53*Cesium.Math.RADIANS_PER_DEGREE,m=6371010,p={ABOVE_SEA_LEVEL:0,ABOVE_GROUND_LEVEL:1,ABOVE_MODEL:2},void 0,s=new Cesium.Cartesian3,E=new Cesium.Matrix4,g=new Cesium.Cartesian4,f=new Cesium.Cartesian3,this,E=new Cesium.Matrix4,(S=new Array(4))[0]=new Cesium.Cartesian4(-1,-1,1,1),S[1]=new Cesium.Cartesian4(1,-1,1,1),S[2]=new Cesium.Cartesian4(1,1,1,1),S[3]=new Cesium.Cartesian4(-1,1,1,1)}return x.prototype.setOptions=function(e){this._currentObject={viewshedPrimitive:this._viewshedPrimitive,viewshedMap:this._viewshedMap,viewshedObjOptions:e||{}}},x.prototype.startDraw=function(e){var t=this;this._viewshedPrimitive&&(v.scene.primitives.remove(this._viewshedPrimitive),this._viewshedPrimitive=null),this._core.setDepthTest("open",this._viewer),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+i.draw),this._eventListener&&this._eventListener.destroy(),this._eventListener=new Cesium.ScreenSpaceEventHandler(v.scene.canvas),void 0===this._viewshedDefaultNamingArray&&(this._viewshedDefaultNamingArray=new Array(this.maxNumViewshed)),this._addingViewshedMode=!0,this._editingMode=!1,this._currentObject={viewshedPrimitive:this._viewshedPrimitive,viewshedMap:this._viewshedMap,viewshedObjOptions:e||{}},this._isSpherical=!1,this._setNewPosition=!1,"pc"!=this._core.getBrowser().pc?(this._eventListener.setInputAction($.proxy(this.setViewshedPositionMobile,this),Cesium.ScreenSpaceEventType.LEFT_CLICK),v.scene.preRender.addEventListener(this.onPreFrameMobile,this)):(this._eventListener.setInputAction($.proxy(this.setViewshedPosition,this),Cesium.ScreenSpaceEventType.LEFT_CLICK),v.scene.preRender.addEventListener(this.onPreFrame,this)),this.end=function(e){t.end=void 0,v.scene.preRender.removeEventListener(t.onPreFrame,t);try{v.scene.preRender.removeEventListener(t.onPreFrameMobile,t)}catch(e){}t._eventListener&&t._eventListener.destroy(),t._core.setDepthTest("close",t._viewer),t._core.mouse(t._viewer.container,0)}},x.prototype.close=function(){v.scene.preRender.removeEventListener(this.onPreFrame,this);try{v.scene.preRender.removeEventListener(this.onPreFrameMobile,this)}catch(e){}this._eventListener&&this._eventListener.destroy(),this._viewshedPrimitive&&(v.scene.primitives.remove(this._viewshedPrimitive),this._viewshedPrimitive=null);var e=v.scene,t={context:v.scene.context,lightCamera:e._sunCamera};e.shadowMap.destroy(),e.shadowMap=new Cesium.ShadowMap(t);var i=e.shadowMap;if(this._currentObject&&this._currentObject.viewshedObjOptions&&this._currentObject.viewshedObjOptions.color&&this._currentObject.viewshedObjOptions.color.default){var r=this._currentObject.viewshedObjOptions.color.default;i._color=new Cesium.Cartesian3(r.r,r.g,r.b)}i.enabled=!0,i.debugShow=!1,i.guid=void 0,i.show=!0,i.maximumDistance=1e4,i.debugCreateRenderStates(),i.dirty=!0,v.scene.globe.shadows=Cesium.ShadowMode.fromCastReceive(!0,!0),v.scene.globe.show=!0,e.skyAtmosphere.show=!0,v.scene.shadowMap=this._normalShadowMap,this._startPositionCartesian=null,this.resetAllVariables(),this._core.setDepthTest("close",this._viewer),this._core.mouse(this._viewer.container,0)},x.prototype.setVisibility=function(e){this._viewshedPrimitive.show=e,v.shadowMap.enabled=e},x.prototype.reset=function(){var e=v.scene,t={context:v.scene.context,lightCamera:e._sunCamera};e.shadowMap.destroy(),e.shadowMap=new Cesium.ShadowMap(t);var i=e.shadowMap;if(this._currentObject&&this._currentObject.viewshedObjOptions&&this._currentObject.viewshedObjOptions.color&&this._currentObject.viewshedObjOptions.color.default){var r=this._currentObject.viewshedObjOptions.color.default;i._color=new Cesium.Cartesian3(r.r,r.g,r.b)}i.enabled=!0,i.debugShow=!1,i.guid=void 0,i.show=!0,i.maximumDistance=1e4,i.debugCreateRenderStates(),i.dirty=!0,v.scene.globe.shadows=Cesium.ShadowMode.fromCastReceive(!0,!0),v.scene.globe.show=!0,e.skyAtmosphere.show=!0,v.scene.shadowMap=this._normalShadowMap},x.prototype.CreateViewshed=function(e,t,i,r){var o=v.scene,n=new Cesium.Camera(o),a=v.scene.context;n.frustum.fov=53*Math.PI/180,n.frustum.aspectRatio=1,n.frustum.near=1,n.frustum.far=t,n.lookAt(e,i);var s={context:a,lightCamera:n,cascadesEnabled:!1};o.shadowMap=new Cesium.ShadowMap(s);var l=o.shadowMap;r.color&&(l._viewshed_Back=new Cesium.Cartesian3(r.color.Back.r,r.color.Back.g,r.color.Back.b),l._viewshed_Fore=new Cesium.Cartesian3(r.color.Fore.r,r.color.Fore.g,r.color.Fore.b)),l.enabled=!0,l.debugShow=!1,l.guid=Cesium.createGuid(),l.show=!0,l.maximumDistance=1e4,l._pointLightRadius=t,l.debugCreateRenderStates(),l._distance=t,l.dirty=!0,v.scene.globe.shadows=Cesium.ShadowMode.fromCastReceive(!0,!0),v.scene.globe.show=!0,o.skyAtmosphere.show=!0;var u={};return u.position=e,u.distance=t,u.direction=i,u.viewshedObjOptions=r,u.guid=this._cesium.createGuid(),u.viewshedObjOptions.originalDirection=i,u.type="viewshed",u.viewshedMap=l,u},x.prototype.resetAllVariables=function(){this._startPositionCartesian=null,this._startPositionCartographic=null,this._currentPosition=null,this._currentRadius=null,this._currentFovHorizontal=null,this._currentFovVertical=null,this._setNewPosition=!1,this._currentObject=void 0,this._viewshedMap=void 0,this._canEnlarge=!1,this._zAxisNewPosition=void 0,this._viewshedDirection=null},x.prototype.setViewshedPosition=function(e){if(!this._setNewPosition)if(this._canEnlarge&&null!=this._viewshedPrimitive){if(this._canEnlarge=!1,this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),this._currentObject.viewshedObjOptions.end&&this._currentObject.viewshedObjOptions.end(),this._core.mouse(this._viewer.container,0),null!=this._viewshedMap&&null!=this._viewshedPrimitive){var t=this._viewshedPrimitive._camera;this._currentObject.viewshedObjOptions.initialHeading=t.heading,this._currentObject.viewshedObjOptions.initialPitch=t.pitch,this._currentObject.viewshedObjOptions.initialRoll=t.roll,this._currentObject.viewshedObjOptions.altitudeMethod=Cesium.defaultValue(this._currentObject.viewshedObjOptions.altitudeMethod,2);var i={displayName:this._currentObject.viewshedObjOptions.name,color:this._currentObject.viewshedObjOptions.color,hFOV:t.frustum.fov,vFOV:t.frustum.fovy,aspectRatio:t.frustum.aspectRatio,height:this._currentObject.viewshedObjOptions.height,distance:this._currentObject.viewshedObjOptions.distance,xPos:this._currentObject.viewshedObjOptions.xPos,yPos:this._currentObject.viewshedObjOptions.yPos,altitudeMethod:this._currentObject.viewshedObjOptions.altitudeMethod,pickHeight:this._currentObject.viewshedObjOptions.pickHeight,horizonCullingDistanceFromViewshed:this._horizonCullingDistanceFromPoint,initialHeading:this._currentObject.viewshedObjOptions.initialHeading,initialPitch:this._currentObject.viewshedObjOptions.initialPitch,initialRoll:this._currentObject.viewshedObjOptions.initialRoll},r=this.CreateViewshed(t.position,Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius),new Cesium.HeadingPitchRange(t.heading,t.pitch,.01),i);if(this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),-1==r)return;this.resetAllVariables(),this._currentObject=r;var o=v.scene.primitives._primitives,n=($.grep(o,function(e){return!0===e.isViewshed}),[]);if(o.forEach(function(e,t){e.isViewshed&&n.push(t)}),1<n.length){var a=n[n.length-2],s=v.scene.primitives._primitives[a];v.scene.primitives.remove(s)}}}else if(Cesium.defined(e)&&void 0!==this._currentObject){var l=this._getPosition.getMousePosition(e);if(void 0!==l){var u=0;this._startPositionCartographic=v.scene.globe.ellipsoid.cartesianToCartographic(l),this._currentObject.viewshedObjOptions.pickHeight=this._startPositionCartographic.height,void 0!==this._currentObject.viewshedObjOptions.height&&(u=this._currentObject.viewshedObjOptions.height);var c=new Cesium.Cartesian3.fromRadians(this._startPositionCartographic.longitude,this._startPositionCartographic.latitude,this._startPositionCartographic.height+0+u);this._startPositionCartesian=c;var h=this._startPositionCartesian,d=new Cesium.BoundingSphere(new Cesium.Cartesian3(0,0,0),m);this._occluder=new Cesium.Occluder(d,h),this._canEnlarge=!0,this._eventListener.setInputAction($.proxy(this.onMouseMove,this),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}}},x.prototype.setViewshedPositionMobile=function(e){if(!this._setNewPosition)if(this.onMouseMove(e),this.createViewshedCameraPrimitive(),this._canEnlarge&&null!=this._viewshedPrimitive){if(this._currentObject.viewshedObjOptions.end&&this._currentObject.viewshedObjOptions.end(),this._core.mouse(this._viewer.container,0),this.createViewshedMap(),null!=this._viewshedMap&&null!=this._viewshedPrimitive){var t=this._viewshedPrimitive._camera;this._currentObject.viewshedObjOptions.initialHeading=t.heading,this._currentObject.viewshedObjOptions.initialPitch=t.pitch,this._currentObject.viewshedObjOptions.initialRoll=t.roll,this._currentObject.viewshedObjOptions.altitudeMethod=Cesium.defaultValue(this._currentObject.viewshedObjOptions.altitudeMethod,2);var i={displayName:this._currentObject.viewshedObjOptions.name,color:this._currentObject.viewshedObjOptions.color,hFOV:t.frustum.fov,vFOV:t.frustum.fovy,aspectRatio:t.frustum.aspectRatio,height:this._currentObject.viewshedObjOptions.height,distance:this._currentObject.viewshedObjOptions.distance,xPos:this._currentObject.viewshedObjOptions.xPos,yPos:this._currentObject.viewshedObjOptions.yPos,altitudeMethod:this._currentObject.viewshedObjOptions.altitudeMethod,pickHeight:this._currentObject.viewshedObjOptions.pickHeight,horizonCullingDistanceFromViewshed:this._horizonCullingDistanceFromPoint,initialHeading:this._currentObject.viewshedObjOptions.initialHeading,initialPitch:this._currentObject.viewshedObjOptions.initialPitch,initialRoll:this._currentObject.viewshedObjOptions.initialRoll},r=this.CreateViewshed(t.position,Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius),new Cesium.HeadingPitchRange(t.heading,t.pitch,.01),i);if(this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),-1==r)return;this._currentObject=r;var o=v.scene.primitives._primitives,n=($.grep(o,function(e){return!0===e.isViewshed}),[]);if(o.forEach(function(e,t){e.isViewshed&&n.push(t)}),1<n.length){var a=n[n.length-2],s=v.scene.primitives._primitives[a];v.scene.primitives.remove(s)}}}else if(Cesium.defined(e)&&void 0!==this._currentObject){var l=this._getPosition.getMousePosition(e);if(void 0!==l){var u=0;this._startPositionCartographic=v.scene.globe.ellipsoid.cartesianToCartographic(l),this._currentObject.viewshedObjOptions.pickHeight=this._startPositionCartographic.height,void 0!==this._currentObject.viewshedObjOptions.height&&(u=this._currentObject.viewshedObjOptions.height);var c=new Cesium.Cartesian3.fromRadians(this._startPositionCartographic.longitude,this._startPositionCartographic.latitude,this._startPositionCartographic.height+0+u);this._startPositionCartesian||(this._startPositionCartesian=c);var h=this._startPositionCartesian,d=new Cesium.BoundingSphere(new Cesium.Cartesian3(0,0,0),m);this._occluder=new Cesium.Occluder(d,h),this._canEnlarge=!0,this._eventListener.setInputAction($.proxy(this.onMouseMove,this),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}}},x.prototype.onMouseMove=function(e){if(Cesium.defined(e)){var t={},i=this._getPosition.getMousePosition(e);if(null!=i){if(null!=t.pickPrimitive&&null!=t.pickPrimitive._camera)return;var r={};if(this._setNewPosition)if(this._setNewPositionCanDrag){var o=void 0,n=v.scene.globe.ellipsoid.cartesianToCartographic(i);if(this._currentObject.viewshedObjOptions.pickHeight=n.height,this._currentObject.viewshedObjOptions.terrainHeight=v.scene.globe.getHeight(n),this._zAxisNewPosition){var a=e.endPosition.y-this._startingRepoZ.y,s=-1*Cesium.Cartesian3.magnitude(Cesium.Cartesian3.subtract(this._currentObject.position,v.camera.position,this._scratchCartesian3),this._scratchCartesian3)*(a/v.canvas.height);null==this._viewshedCartoPos&&(this._viewshedCartoPos=new Cesium.Cartographic.fromCartesian(this._currentObject.position)),o=new Cesium.Cartesian3.fromRadians(this._viewshedCartoPos.longitude,this._viewshedCartoPos.latitude,this._viewshedCartoPos.height+s)}else o=this._currentObject.viewshedObjOptions.altitudeMethod==p.ABOVE_SEA_LEVEL?new Cesium.Cartesian3.fromRadians(n.longitude,n.latitude,this._startingRepoZHeight):i;this._newPosition=o}else{var l=i,u=Cesium.Matrix4.multiplyByVector(v.camera._viewMatrix,Cesium.Cartesian4.fromElements(l.x,l.y,l.z,1,g),g),c=Cesium.Matrix4.multiplyByVector(v.camera.frustum.projectionMatrix,u,g),h=Cesium.Cartesian3.divideByScalar(c,c.w,f),d=Math.floor((.5*h.x+.5)*v.canvas.width),m=Math.floor((.5*h.y+.5)*v.canvas.height);this._mousePositionX=d,this._mousePositionY=m}else{if(null==this._startPositionCartesian)return;if(Cesium.Cartesian3.subtract(i,this._startPositionCartesian,r),isNaN(r.x)||isNaN(r.y)||isNaN(r.z))return;this._viewshedDirection=Cesium.Cartesian3.normalize(r,this._scratchCartesian3),this._currentRadius=Cesium.Cartesian3.magnitude(r)}}else this._mousePositionX=void 0,this._mousePositionY=void 0}},x.prototype.createViewshedSpherePrimitive=function(e,t){try{var i=null!=e?e:this._startPositionCartesian,r=null!=t?t:this._currentRadius;if(r<=1)return!1;null!=this._viewshedPrimitive&&v.scene.primitives.remove(this._viewshedPrimitive);var o=Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(i),new Cesium.Cartesian3(0,0,0),E),n=new Cesium.GeometryInstance({geometry:new Cesium.SphereOutlineGeometry({radius:r,stackPartitions:8,slicePartitions:12}),modelMatrix:o,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1,1,1,.5))}});this._viewshedPrimitive=v.scene.primitives.add(new Cesium.Primitive({geometryInstances:n,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,renderState:{lineWidth:1}}),allowPicking:!1,asynchronous:!1}));var a=new Cesium.Camera(v.scene);a.position=i,a.direction=Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z,this._scratchCartesian3),this._viewshedPrimitive._camera=a}catch(e){return!1}return this._viewshedPrimitive},x.prototype.createViewshedCameraPrimitive=function(e){null!=this._viewshedPrimitive&&v.scene.primitives.remove(this._viewshedPrimitive);var t=new Cesium.Camera(v.scene);if(null!=this._startPositionCartesian)return t.position=null!=e?e:this._startPositionCartesian,null!=this._viewshedDirection&&!isNaN(this._viewshedDirection.x)&&!isNaN(this._viewshedDirection.y)&&(t.direction=this._viewshedDirection.clone(),t.up=v.scene.globe.ellipsoid.geodeticSurfaceNormal(t.position,s)),t.frustum.isViewshed=!0,t.frustum.fov=Cesium.defaultValue(this._currentObject.viewshedObjOptions.fov,n),t.frustum._fovy=Cesium.defaultValue(this._currentObject.viewshedObjOptions.fovy,a),t.frustum.aspectRatio=Math.tan(t.frustum.fov/2)/Math.tan(t.frustum._fovy/2),t.frustum.near=1,!(this._currentRadius<=1)&&(t.frustum.far=Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius),this._viewshedPrimitive=v.scene.primitives.add(new Cesium.DebugCameraPrimitive({camera:t,color:this._primitiveColor})),this._viewshedPrimitive._numFrustrums=0,this._viewshedPrimitive._outlineOnlyFrustum=!0,this._viewshedPrimitive.update=this.updateViewshedPrimitive,this._viewshedPrimitive)},x.prototype.createViewshedMap=function(){null==v.scene.viewsheds&&v.scene.viewsheds,null!=this._viewshedPrimitive._camera&&this._canEnlarge&&(null==this._viewshedMap?(this._viewshedMap=new Cesium.ShadowMap({context:v.scene.context,lightCamera:this._viewshedPrimitive._camera,enabled:1,isSpotLight:!0,fromLightSource:!0,isPointLight:!1,softShadows:!1}),this._viewshedMap.show=!0,this._viewshedMap.isPreviewMode=!0,this._viewshedMap.guid="SamplerViewshed",this._viewshedMap):(this._viewshedMap._lightCamera.direction=this._viewshedPrimitive._camera.direction,this._viewshedMap._lightCamera.frustum.far=Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius)))},x.prototype.updateViewshedPrimitive=function(e){if(this.show){if(this._updateOnChange&&(this._outlinePrimitive=this._outlinePrimitive&&this._outlinePrimitive.destroy()),!Cesium.defined(this._outlinePrimitive)){var t=this._camera,i=t.frustum,r=e.frustumSplits,o=r.length-1;(o=this._numFrustrums)<=0&&((r=P)[0]=this._camera.frustum.near,r[1]=this._camera.frustum.far,o=1);var n,a,s=this._camera.viewMatrix;if(Cesium.defined(t.frustum.fovy)){var l=this._camera.frustum.projectionMatrix,u=Cesium.Matrix4.multiply(l,s,E);a=Cesium.Matrix4.inverse(u,E)}else n=Cesium.Matrix4.inverseTransformation(s,E);var c,h=new Float64Array(12*(o+1)+3);for(c=0;c<o+1;++c)for(var d=0;d<4;++d){var m=Cesium.Cartesian4.clone(S[d],x[d]);if(Cesium.defined(a)){var p=1/(m=Cesium.Matrix4.multiplyByVector(a,m,m)).w;Cesium.Cartesian3.multiplyByScalar(m,p,m),Cesium.Cartesian3.subtract(m,this._camera.positionWC,m),Cesium.Cartesian3.normalize(m,m);var g=Cesium.Cartesian3.dot(this._camera.directionWC,m);Cesium.Cartesian3.multiplyByScalar(m,r[c]/g,m),Cesium.Cartesian3.add(m,this._camera.positionWC,m)}else{var f,v;Cesium.defined(i._offCenterFrustum)&&(i=i._offCenterFrustum),v=c===o?(f=r[c-1],r[c]):(f=r[c],r[c+1]),m.x=.5*(m.x*(i.right-i.left)+i.left+i.right),m.y=.5*(m.y*(i.top-i.bottom)+i.bottom+i.top),m.z=.5*(m.z*(f-v)-f-v),m.w=1,Cesium.Matrix4.multiplyByVector(n,m,m)}h[12*c+3*d]=m.x,h[12*c+3*d+1]=m.y,h[12*c+3*d+2]=m.z}h[12*o+12]=this._camera.positionWC.x,h[12*o+12+1]=this._camera.positionWC.y,h[12*o+12+2]=this._camera.positionWC.z;var _=new Cesium.BoundingSphere.fromVertices(h),y=new Cesium.GeometryAttributes;y.position=new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h});var C,w,b=new Uint16Array(8*(2*o+1+1));for(c=0;c<o+1;++c)w=4*c,b[C=8*c]=w,b[C+1]=w+1,b[C+2]=w+1,b[C+3]=w+2,b[C+4]=w+2,b[C+5]=w+3,b[C+6]=w+3,b[C+7]=w;for(c=0;c<o;++c)w=4*c,b[C=8*(o+1+c)]=w,b[C+1]=w+4,b[C+2]=w+1,b[C+3]=w+5,b[C+4]=w+2,b[C+5]=w+6,b[C+6]=w+3,b[C+7]=w+7;b[C+=8]=w+8,b[C+1]=w+1,b[C+2]=w+8,b[C+3]=w+2,b[C+4]=w+8,b[C+5]=w+3,b[C+6]=w+8,b[C+7]=w+4,this._outlinePrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:{attributes:y,indices:b,primitiveType:Cesium.PrimitiveType.LINES,boundingSphere:_},attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})}this._outlinePrimitive.isViewshedPart=!0,this._outlinePrimitive.update(e)}},x.prototype.getHorizonDistance=function(e){return Math.sqrt(Math.pow(m+e,2)-Math.pow(m,2))},x.prototype.onPreFrame=function(e){var t,i;if(null!=this._currentObject&&null!=this._currentObject.viewshedPrimitive&&null!=this._currentObject.viewshedMap){t=new Cesium.Cartographic.fromCartesian(this._currentObject.viewshedPrimitive._camera.position);var r=this.getHorizonDistance(t.height);this._currentObject.viewshedMap.horizonCullingDistanceFromViewshed=r,i=v.scene.globe.getHeight(t),this._currentObject.viewshedMap.isBelowGround=t.height<i+.5}if(null!=this._currentObject&&this._currentObject.viewshedMap,null!=this._newPosition&&this.toPreviewMode(this._currentObject),this._canEnlarge&&null!=this._currentRadius&&this._prevRadius!=this._currentRadius)this._prevRadius=this._currentRadius,(this._isSpherical?this.createViewshedSpherePrimitive():this.createViewshedCameraPrimitive())&&this.createViewshedMap();else if(null!=this._currentObject&&this._setNewPosition&&null!=this._mousePositionX&&null!=this._mousePositionY)if(this.getPosXAndY(),this._currentObject.viewshedObjOptions.isSpherical)this._currentObject.viewshedMap._lightCamera.position=this._newPosition,this._currentObject.viewshedPrimitive=this.createViewshedSpherePrimitive(this._newPosition,this._currentObject.distance);else if(this.checkIfMouseOnPosition(),null!=this._newPosition){if(this._currentObject.viewshedObjOptions.altitudeMethod==p.ABOVE_GROUND_LEVEL&&null==this._zAxisNewPosition){var o=Cesium.Cartographic.fromCartesian(this._newPosition.clone()),n=Cesium.Cartesian3.fromRadians(o.longitude,o.latitude,v.scene.globe.getHeight(o)+this._currentObject.startingAltitudeAboveGround);this._currentObject.viewshedPrimitive._camera.position=n}else if(this._currentObject.viewshedObjOptions.altitudeMethod==p.ABOVE_MODEL&&null==this._zAxisNewPosition){o=Cesium.Cartographic.fromCartesian(this._newPosition.clone()),n=Cesium.Cartesian3.fromRadians(o.longitude,o.latitude,o.height+this._currentObject.startingAltitudeAboveModel);this._currentObject.viewshedPrimitive._camera.position=n}else this._currentObject.viewshedPrimitive._camera.position=this._newPosition;this.adjustDirections()}},x.prototype.onPreFrameMobile=function(e){var t,i;if(null!=this._currentObject&&null!=this._currentObject.viewshedPrimitive&&null!=this._currentObject.viewshedMap){t=new Cesium.Cartographic.fromCartesian(this._currentObject.viewshedPrimitive._camera.position);var r=this.getHorizonDistance(t.height);this._currentObject.viewshedMap.horizonCullingDistanceFromViewshed=r,i=v.scene.globe.getHeight(t),this._currentObject.viewshedMap.isBelowGround=t.height<i+.5}if(null!=this._currentObject&&this._currentObject.viewshedMap,null!=this._newPosition&&this.toPreviewMode(this._currentObject),this._canEnlarge&&null!=this._currentRadius)this._prevRadius=this._currentRadius,(this._isSpherical?this.createViewshedSpherePrimitive():this.createViewshedCameraPrimitive())&&this.createViewshedMap();else if(null!=this._currentObject&&this._setNewPosition&&null!=this._mousePositionX&&null!=this._mousePositionY)if(this.getPosXAndY(),this._currentObject.viewshedObjOptions.isSpherical)this._currentObject.viewshedMap._lightCamera.position=this._newPosition,this._currentObject.viewshedPrimitive=this.createViewshedSpherePrimitive(this._newPosition,this._currentObject.distance);else if(this.checkIfMouseOnPosition(),null!=this._newPosition){if(this._currentObject.viewshedObjOptions.altitudeMethod==p.ABOVE_GROUND_LEVEL&&null==this._zAxisNewPosition){var o=Cesium.Cartographic.fromCartesian(this._newPosition.clone()),n=Cesium.Cartesian3.fromRadians(o.longitude,o.latitude,v.scene.globe.getHeight(o)+this._currentObject.startingAltitudeAboveGround);this._currentObject.viewshedPrimitive._camera.position=n}else if(this._currentObject.viewshedObjOptions.altitudeMethod==p.ABOVE_MODEL&&null==this._zAxisNewPosition){o=Cesium.Cartographic.fromCartesian(this._newPosition.clone()),n=Cesium.Cartesian3.fromRadians(o.longitude,o.latitude,o.height+this._currentObject.startingAltitudeAboveModel);this._currentObject.viewshedPrimitive._camera.position=n}else this._currentObject.viewshedPrimitive._camera.position=this._newPosition;this.adjustDirections()}},x}),define("SGWorld/Analysis/SkylineAnalysis",["../Creator/Color","../Core/Core"],function(i,r){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._color=new i(this._viewer,this._cesium),this._core=new r}return e.prototype.createSkylineAnalysis=function(e){this._core.isnull(e)||this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(/^rgb/.test(e)&&(e=this._color.rgbaStringToRgbaObj(e)),1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a))),this.clear(),this.defaultDepthTest=this._viewer.scene.globe.depthTestAgainstTerrain,this._viewer.scene.globe.depthTestAgainstTerrain=!0;var t=this._viewer.scene.postProcessStages.add(this._cesium.PostProcessStageLibrary.createSilhouetteStage());t.enabled=!0,t.uniforms.color=e,this.silhouette=t},e.prototype.clear=function(){this.silhouette&&this._viewer.scene.postProcessStages.remove(this.silhouette),this.defaultDepthTest&&(this._viewer.scene.globe.depthTestAgainstTerrain=this.defaultDepthTest)},e}),define("SGWorld/Analysis/BufferAnalysis",["../configData","../Core/Core","../Navigate/getPosition"],function(r,i,o){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._scene=e.scene,this._core=new i,this._getPosition=new o(e,t),this.num=100,this.buffs=[],this.tooltip=this._core.CreateTooltip()}return e.prototype.changeBurr=function(e){if(this.num=e,this.this_buff)switch(this.type){case"point":this.setPointBuff(this.num);break;case"polyline":this.setPolylineBuff(this.num);break;case"polygon":this.setPolygonBuff(this.num)}},e.prototype.DrawPoint=function(e,o){var t=this;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.this_buff&&this.this_buff.entity&&this._viewer.entities.remove(this.this_buff.entity);var n=this._viewer,a=this._cesium;return this.num=e||this.num,this.drawHandler=new a.ScreenSpaceEventHandler(n.scene.canvas),this.this_buff={entity:null,buff:null},this.type="point",this.positions=[],this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+r.draw),this.drawHandler.setInputAction(function(e){var t=this._getPosition.getMouseDegrees(e);if(t){var i=t.lon,r=t.lat;this.positions.push(i,r),this.this_buff.entity=n.entities.add({name:"新建缓冲点",position:a.Cartesian3.fromDegrees(i,r),point:{pixelSize:10,color:a.Color.YELLOW,outlineWidth:3,outlineColor:a.Color.YELLOW.withAlpha(.4),heightReference:1}}),this.buffs.push(this.this_buff.entity),this.this_buff.entity=void 0,this.setPointBuff(this.num),o&&"function"==typeof o&&o(t),this.end&&this.end()}}.bind(this),a.ScreenSpaceEventType.LEFT_CLICK),this.end=function(){t.tooltip.show(!1),t.drawHandler.destroy(),t._core.mouse(t._viewer.container,0),t.drawHandler=null,t.end=void 0},this.drawHandler.setInputAction(function(e){this.tooltip.showAt(e.endPosition,"点击绘制点")}.bind(this),a.ScreenSpaceEventType.MOUSE_MOVE),this},e.prototype.setPointBuff=function(e){var t=Cesium.turf.point(this.positions),i=this.getBuff(t,e);this.this_buff.buff||(this.this_buff.buff=this.addBufferPolyogn(i),this.buffs.push(this.this_buff.buff))},e.prototype.DrawPolyline=function(e,t){var i=this;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.this_buff&&this.this_buff.entity&&this._viewer.entities.remove(this.this_buff.entity);var o=this._viewer,n=this._cesium;this.num=e||this.num;var a=0;return this.drawHandler=new n.ScreenSpaceEventHandler(o.scene.canvas),this.this_buff={entity:null,buff:null},this.type="polyline",this.positions=[],this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+r.draw),this.drawHandler.setInputAction(function(e){var t=this._getPosition.getMouseDegrees(e);if(t){var i=t.lon,r=t.lat;this.positions.push(i,r),0===a&&(this.positions.push(i,r),this.this_buff.entity=o.entities.add({name:"新建缓冲线",polyline:{positions:n.Cartesian3.fromDegreesArray(this.positions),width:2,material:new n.ColorMaterialProperty(n.Color.YELLOW),clampToGround:!0,zIndex:1}}),this.this_buff.entity.polyline.positions=new n.CallbackProperty(function(){return n.Cartesian3.fromDegreesArray(this.positions)}.bind(this),!1)),a++}}.bind(this),n.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){this.end&&this.end()}.bind(this),n.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){return i.tooltip.show(!1),i.drawHandler.destroy(),i._core.mouse(i._viewer.container,0),i.drawHandler=null,i.end=void 0,"cancel"===e?(o.entities.remove(i.this_buff.entity),void(i.this_buff=void 0)):(i.positions.length<=4?(window.layuiLayer&&window.layuiLayer.msg("当前点数小于两点,请重新绘制"),o.entities.remove(i.this_buff.entity),i.this_buff=void 0):(i.positions.pop(),i.positions.pop(),i.this_buff.entity.polyline.positions=n.Cartesian3.fromDegreesArray(i.positions),i.buffs.push(i.this_buff.entity),i.this_buff.entity=void 0,i.positions=i.degreesArrayToPoints(i.positions),i.setPolylineBuff(i.num)),void(t&&"function"==typeof t&&t()))},this.drawHandler.setInputAction(function(e){if(0!==a){1===a?this.tooltip.showAt(e.endPosition,"点击绘制折线"):this.tooltip.showAt(e.endPosition,"右击结束绘制");var t=this._getPosition.getMouseDegrees(e);if(t){var i=t.lon,r=t.lat;this.positions.splice(this.positions.length-2,2),this.positions.push(i,r)}}else this.tooltip.showAt(e.endPosition,"点击开始绘制折线")}.bind(this),n.ScreenSpaceEventType.MOUSE_MOVE),this},e.prototype.setPolylineBuff=function(e){var t=Cesium.turf.lineString(this.positions),i=this.getBuff(t,e);this.this_buff.buff||(this.this_buff.buff=this.addBufferPolyogn(i),this.buffs.push(this.this_buff.buff))},e.prototype.DrawPolygon=function(e,t){var i=this;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.this_buff&&this.this_buff.entity&&this._viewer.entities.remove(this.this_buff.entity);var o=this._viewer,n=this._cesium;this.num=e||this.num;var a=0;this.drawHandler=new n.ScreenSpaceEventHandler(o.scene.canvas),this.this_buff={entity:null,buff:null},this.type="polygon",this.positions=[];var s=this;return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+r.draw),this.drawHandler.setInputAction(function(e){var t=this._getPosition.getMouseDegrees(e);if(t){var i=t.lon,r=t.lat;this.positions.push(i,r),0===a?(this.positions.push(i,r),this.this_buff.entity=o.entities.add({name:"临时线",polyline:{positions:new n.CallbackProperty(function(){return n.Cartesian3.fromDegreesArray(s.positions)},!1),clampToGround:!0,material:new n.ColorMaterialProperty(n.Color.YELLOW.withAlpha(.5)),width:3}})):1===a&&(this.this_buff.entity&&o.entities.remove(this.this_buff.entity),this.this_buff.entity=o.entities.add({name:"新建缓冲面",polygon:{hierarchy:new n.PolygonHierarchy(n.Cartesian3.fromDegreesArray(this.positions)),material:new n.ColorMaterialProperty(n.Color.YELLOW.withAlpha(.5)),zIndex:1}}),this.this_buff.entity.polygon.hierarchy=new n.CallbackProperty(function(){return new n.PolygonHierarchy(n.Cartesian3.fromDegreesArray(this.positions))}.bind(this),!1)),a++}}.bind(this),n.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){this.end&&this.end()}.bind(this),n.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){return i.tooltip.show(!1),i.drawHandler.destroy(),i._core.mouse(i._viewer.container,0),i.drawHandler=null,i.end=void 0,"cancel"===e?(o.entities.remove(i.this_buff.entity),void(i.this_buff=void 0)):(i.positions.length<=6?(window.layuiLayer&&window.layuiLayer.msg("当前点数小于三点,请重新绘制"),o.entities.remove(i.this_buff.entity),i.this_buff=void 0):(i.positions.pop(),i.positions.pop(),i.this_buff.entity.polygon.hierarchy=n.Cartesian3.fromDegreesArray(i.positions),i.buffs.push(i.this_buff.entity),i.this_buff.entity=void 0,i.positions=i.degreesArrayToPoints(i.positions),i.positions.push(i.positions[0]),i.setPolygonBuff(i.num)),void(t&&"function"==typeof t&&t()))},this.drawHandler.setInputAction(function(e){if(0!==a){a<3?this.tooltip.showAt(e.endPosition,"点击绘制多边形"):this.tooltip.showAt(e.endPosition,"右击结束绘制");var t=this._getPosition.getMouseDegrees(e);if(t){var i=t.lon,r=t.lat;this.positions.splice(this.positions.length-2,2),this.positions.push(i,r)}}else this.tooltip.showAt(e.endPosition,"点击开始绘制多边形")}.bind(this),n.ScreenSpaceEventType.MOUSE_MOVE),this},e.prototype.setPolygonBuff=function(e){var t=Cesium.turf.polygon([this.positions]),i=this.getBuff(t,e);this.this_buff.buff||(this.this_buff.buff=this.addBufferPolyogn(i),this.buffs.push(this.this_buff.buff))},e.prototype.getBuff=function(e,t){var i=Cesium.turf.buffer(e,t,{units:"meters"}).geometry.coordinates,r=this.pointsToDegreesArray(i[0]),o={positions:Cesium.Cartesian3.fromDegreesArray(r)};if(1<i.length){o.holes=[];for(var n,a=1;a<i.length;a++)r=this.pointsToDegreesArray(i[a]),n=Cesium.Cartesian3.fromDegreesArray(r),o.holes.push(n)}return o},e.prototype.pointsToDegreesArray=function(e){var t=[];return e.map(function(e){t.push(e[0]),t.push(e[1])}),t},e.prototype.degreesArrayToPoints=function(e){for(var t=[],i=0;i<e.length-1;i+=2)t.push([e[i],e[i+1]]);return t},e.prototype.addBufferPolyogn=function(e){var t,i=void 0;return t=e.positions,e.holes&&(i=[],e.holes.forEach(function(e){i.push(new Cesium.PolygonHierarchy(e))})),this._viewer.entities.add({polygon:{hierarchy:new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(t,i)},!1),material:Cesium.Color.RED.withAlpha(.6),zIndex:0}})},e.prototype.clearBuff=function(){var t=this._viewer;0<this.buffs.length&&(this.buffs.forEach(function(e){t.entities.remove(e)}),this.buffs.length=0)},e}),define("SGWorld/Analysis/TerrainExcavation",["../configData","../Core/Core"],function(P,i){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._scene=e.scene,this._core=new i,this.tooltip=this._core.CreateTooltip(),this.FlattenIsDraw=!1,this.wallArr=[],this.heightsort=[],this.FlattenPolygon=[],this.deepth=100}return e.prototype.CreatePolygon=function(e,l,u){var c=this;if(!this.FlattenIsDraw){this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.FlattenIsDraw=!0;var f=this._viewer,v=this._cesium;this.deepth=e||this.deepth,this.clear(),!l&&(l={});var h,o,d=[],m=[],p=null,g=0,_=this.heightsort,y=this.deepth,C=this.wallArr,w=this;this.drawHandler=new v.ScreenSpaceEventHandler(f.scene.canvas),this._core.setDepthTest("open",f);var b=this.tooltip,E=void 0;return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+P.draw),this.drawHandler.setInputAction(function(e){o=a(e.position);var t=v.Cartographic.fromCartesian(o),i=v.Math.toDegrees(t.longitude),r=v.Math.toDegrees(t.latitude);d.push(o),m.push(i,r,t.height),0===g?(d.push(o),m.push(i,r,t.height),E=f.entities.add({name:"临时线",polyline:{positions:new v.CallbackProperty(function(){return d},!1),clampToGround:!0,material:new v.ColorMaterialProperty(v.Color.YELLOW.withAlpha(.3)),width:3}})):1===g&&(E&&f.entities.remove(E),(h=f.entities.add({name:null,polygon:{hierarchy:new v.PolygonHierarchy(v.Cartesian3.fromDegreesArrayHeights(m)),material:v.Color.YELLOW.withAlpha(.3)}})).polygon.hierarchy=new v.CallbackProperty(n,!1)),g++},v.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){if(0!==g){1===g?b.showAt(e.endPosition,"点击添加第二个点"):b.showAt(e.endPosition,"右键结束绘制"),o=a(e.endPosition);var t=v.Cartographic.fromCartesian(o),i=v.Math.toDegrees(t.longitude),r=v.Math.toDegrees(t.latitude);m.splice(m.length-3,3),d.splice(d.length-1,1),d.push(o),m.push(i,r,t.height)}else b.showAt(e.endPosition,"左键点击开始绘制点")},v.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(function(e){this.end&&this.end()}.bind(this),v.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){if(b.show(!1),w._core.mouse(w._viewer.container,0),w.drawHandler.destroy(),E&&f.entities.remove(E),h&&f.entities.remove(h),c.FlattenIsDraw=!1,c.end=void 0,!("cancel"===e||d.length<3))if(g<2)g=0;else{g=0;for(var t=2;t<m.length;t+=3)_.push(m[t]);var i,r,o,n,a,s;_.sort(function(e,t){return e-t}),h=f.entities.add({name:null,polygon:{hierarchy:new v.CallbackProperty(function(){return new v.PolygonHierarchy(v.Cartesian3.fromDegreesArrayHeights(m))},!1),material:new v.ImageMaterialProperty({image:w._core.defaultValue(l.url,window.SmartEarthRootUrl+P.bottomplane),repeat:new v.Cartesian2(1,1)})}}),d.push(d[0]);for(t=0;t<d.length-1;t++)i=v.Cartographic.fromCartesian(d[t]),r=v.Cartographic.fromCartesian(d[t+1]),o=v.Math.toDegrees(i.longitude),a=v.Math.toDegrees(i.latitude),n=v.Math.toDegrees(r.longitude),s=v.Math.toDegrees(r.latitude),p=p?p>r.height?r.height:p:i.height>r.height?r.height:i.height,S(o,a,n,s,i.height,r.height);h.polygon.height=_[0]-y,c.FlattenPolygon.push(h),c.originHeight=_[0],function(e){var t=f.scene.globe,i=e.concat();i.splice(i.length-1,1);for(var r=0;r<i.length-1;r++)i[r].x===i[r+1].x&&i[r].y===i[r+1].y&&(i.splice(r,1),r--);var o=i.length;(function(e){if(3<=e.length){var t=(e[1].x-e[0].x)*(e[2].y-e[1].y)-(e[1].y-e[0].y)*(e[2].x-e[1].x);return!(0<t)}})(i)&&i.reverse();for(var n=[],r=0;r<o;++r){var a=(r+1)%o,s=v.Cartesian3.add(i[r],i[a],new v.Cartesian3);s=v.Cartesian3.multiplyByScalar(s,.5,s);var l=v.Cartesian3.normalize(s,new v.Cartesian3),u=v.Cartesian3.subtract(i[a],s,new v.Cartesian3);u=v.Cartesian3.normalize(u,u);var c=v.Cartesian3.cross(u,l,new v.Cartesian3);c=v.Cartesian3.normalize(c,c);var h=new v.Plane(c,0),d=v.Plane.getPointDistance(h,s);n.push(new v.ClippingPlane(c,d))}t.clippingPlanes=new v.ClippingPlaneCollection({planes:n})}(d),"function"==typeof u&&u()}},this}function n(){return new v.PolygonHierarchy(v.Cartesian3.fromDegreesArrayHeights(m))}function a(e){var t;if("EllipsoidTerrainProvider"===f.scene.terrainProvider.constructor.name)t=f.camera.pickEllipsoid(e,f.scene.globe.ellipsoid);else{var i=f.scene.camera.getPickRay(e);t=f.scene.globe.pick(i,f.scene)}if(f.scene.pick(e)){var r=f.scene.pickPosition(e);if(r){t=r;var o=v.Cartographic.fromCartesian(t),n=f.scene.globe.getHeight(o);o.height=n,t=v.Cartographic.toCartesian(o)}}return t}function S(e,t,i,r,o,n){var a,s=v.Math.lerp(e,i,1/160)-e,l=v.Math.lerp(t,r,1/160)-t,u=[],c=[],h=[];u.push(e,t),a=v.Cartesian3.fromDegrees(e,t),c.push(v.Cartographic.fromCartesian(a));for(var d=0;d<160;d++){var m=e+(d+1)*s,p=t+(d+1)*l;u.push(m,p),a=v.Cartesian3.fromDegrees(m,p),c.push(v.Cartographic.fromCartesian(a))}u.push(i,r),a=v.Cartesian3.fromDegrees(i,r),c.push(v.Cartographic.fromCartesian(a));var g=[];!function(e,t){var i=f.camera,r=[];if(function(){if(f.scene&&f.scene.terrainProvider&&f.scene.terrainProvider._layers)return!0;return!1}()){var o=v.sampleTerrainMostDetailed(f.terrainProvider,e);i.positionCartographic.height;v.when(o,function(e){e.forEach(function(e){r.push(e.height)}),"function"==typeof t&&t(r)})}else e.forEach(function(e){r.push(f.scene.globe.getHeight(e))}),"function"==typeof t&&t(r)}(c,function(e){if(e){for(h=e,d=0;d<h.length;d++)g.push(_[0]-y);t=u,i=h,r=g,(o=f.entities.add({wall:{positions:new v.CallbackProperty(function(){return v.Cartesian3.fromDegreesArray(t)},!1),maximumHeights:i,minimumHeights:r}})).wall.material=new v.ImageMaterialProperty({image:window.SmartEarthRootUrl+P.wall,repeat:new v.Cartesian2(1,1)}),C.push(o)}var t,i,r,o})}},e.prototype.setDeepth=function(i){var r=this;this.FlattenPolygon[0]&&this.FlattenPolygon[0].polygon.height.setValue(this.originHeight-i),this.wallArr.forEach(function(e){var t=e.wall.minimumHeights.getValue();(t=Array(t.length)).fill(r.originHeight-i),e.wall.minimumHeights.setValue(t)})},e.prototype.clear=function(){var t=this._viewer;if(0<this.wallArr.length){for(var e=0;e<this.wallArr.length;e++)t.entities.remove(this.wallArr[e]);this.wallArr=[]}t.scene.globe.clippingPlanes&&t.scene.globe.clippingPlanes.removeAll(),this.FlattenPolygon&&0<this.FlattenPolygon.length&&(this.FlattenPolygon.forEach(function(e){t.entities.remove(e)}),this.FlattenPolygon=[]),this.FlattenIsDraw=!1},e}),define("SGWorld/Analysis/ShadowsAnalysis",["../Core/Core","../Core/jquery"],function(i,t){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._scene=e.scene,this._core=new i,this.currentSpeed="1x",this.currentTime=null,this.currentPlayMode="1",this.timer=null}return e.prototype.createAnalysis=function(){return this.shadows=!0,this.currentSpeed=1,this.currentPlayMode="1",this.Forword(),this},e.prototype.setCurrentTime=function(e){var t=new Date(e),i=this._cesium.JulianDate.fromDate(t);this._viewer.clock.currentTime=i.clone()},e.prototype.getCurrentTime=function(e){this.currentSpeed=t(this._viewer.container).find(".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html(),clearInterval(this.timer),timer=null,timer=setInterval(function(){this.currentTime=function(e,t){var i=(e=e.replace(/January|Jan/,"01").replace(/February|Feb/,"02").replace(/March|Mar/,"03").replace(/April|Apr/,"04").replace(/May/,"05").replace(/June|Jun/,"06").replace(/July|Jul/,"07").replace(/August|Aug/,"08").replace(/September|Sept/,"09").replace(/October|Oct/,"10").replace(/November|Nov/,"11").replace(/December|Dec/,"12")).split(" ");e=i[2]+"-"+i[0]+"-"+i[1],t=t.split(" ")[0];var r=new Date(Date.parse(e+" "+t));return r=28800+(r=(r=r.getTime())/1e3),new Date(1e3*parseInt(r)).toLocaleString("chinese",{hour12:!1}).replace(/年|月|\//g,"-").replace(/日/g," ")}(this._viewer.animation.viewModel.dateLabel,this._viewer.animation.viewModel.timeLabel),e&&"function"==typeof e&&e(this.currentTime)},1e3)},e.prototype.SpeedIncress=function(e){this._viewer.animation.viewModel.faster(),this.currentSpeed=t(this._viewer.container).find(".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html(),e&&"function"==typeof e&&e(this.currentSpeed)},e.prototype.SpeedDecress=function(e){this._viewer.animation.viewModel.slower(),this.currentSpeed=t(this._viewer.container).find(".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html(),e&&"function"==typeof e&&e(this.currentSpeed)},e.prototype.Forword=function(e){this._viewer.animation.viewModel.playForwardViewModel.command(),this.currentPlayMode="1","-"==this.currentSpeed[0]&&(this.currentSpeed=this.currentSpeed.slice(1)),e&&"function"==typeof e&&e(this.currentSpeed)},e.prototype.Bacword=function(e){this._viewer.animation.viewModel.playReverseViewModel.command(),this.currentPlayMode="2","-"!==this.currentSpeed[0]&&(this.currentSpeed="-"+this.currentSpeed),e&&"function"==typeof e&&e(this.currentSpeed)},e.prototype.Pause=function(){this._viewer.animation.viewModel.pauseViewModel.command()},Object.defineProperties(e.prototype,{shadows:{get:function(){return this._viewer.shadows},set:function(e){this._viewer.shadows=e}},currentSpeed:{get:function(){return t(this._viewer.container).find(".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html()},set:function(e){e=e.toString().replace("x",""),this._viewer.clock.multiplier=parseFloat(e)}}}),e}),define("SGWorld/Analysis/Screenshot",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.createScreenshot=function(e){!e&&(e="png");for(var t=this._viewer.scene.canvas.toDataURL("image/"+e),i=atob(t.split(",")[1]),r=i.length,o=new Uint8Array(r),n=0;n<r;n++)o[n]=i.charCodeAt(n);var a=document.createElement("a");a.download="截图."+e,a.href=t,a.click()},e.prototype.createScreenshotCompared=function(e){var t=this._viewer.scene.canvas,i=t.toDataURL("image/png");layuiLayer.open({title:e||"截图对比",type:1,skin:"other-class",shade:0,shadeClose:!0,resize:!1,moveOut:!0,area:[.7*t.width+"px",.7*t.height+42+"px"],content:'<img src="'+i+'" style="height:100%;width:100%;">'})},e}),define("SGWorld/Analysis/PointFly",["../Navigate/getPosition","../Core/Core","../configData"],function(i,r,d){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._core=new r,this._getPosition=new i(e,t)}return e.prototype.setPointFly=function(r){var t=this;!r&&(r={});var o=this._core.CreateTooltip(),n=this._viewer,a=this,s=!1;r.pitch&&(r.pitch=Cesium.Math.toRadians(r.pitch));var l=void 0,u=void 0,c=function(){var e=Cesium.JulianDate.secondsDifference(n.clock.currentTime,n.clock.startTime),t=Cesium.Math.toRadians(12*e)+l;n.scene.camera.setView({destination:u,orientation:{heading:t,pitch:a.pitch}}),n.scene.camera.moveBackward(a.distance),0<=Cesium.JulianDate.compare(n.clock.currentTime,n.clock.stopTime)&&n.clock.onTick.removeEventListener(c)};this.drawHandler&&this.drawHandler.destroy(),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+d.draw);var h=void 0,i=new Cesium.ScreenSpaceEventHandler(n.scene.canvas);return i.setInputAction(function(e){if(s)a.end&&a.end();else{o.showAt(e.position,"点击结束绕飞"),s=!0;var t=a._getPosition.getMouseDegrees(e);u=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height),a.pitch=r.pitch||n.camera.pitch,a.distance=r.distance,a.distance||(a.distance=Cesium.Cartesian3.distance(n.camera.position,a._getPosition.getMousePosition(e))),l=n.camera.heading;var i=Cesium.JulianDate.fromDate(new Date);n.clock.startTime=i.clone(),n.clock.currentTime=i.clone(),n.clock.clockRange=Cesium.ClockRange.CLAMPED,n.clock.clockStep=Cesium.ClockStep.SYSTEM_CLOCK,n.clock.onTick.addEventListener(c),h=a._viewer.entities.add({id:a._core.getuid(),name:"定点",position:u,billboard:{horizontalOrigin:a._cesium.HorizontalOrigin.CENTER,verticalOrigin:a._cesium.VerticalOrigin.BOTTOM,scale:a._core.defaultValue(r.scale,1),image:a._core.defaultValue(r.image,window.SmartEarthRootUrl+d.mark),disableDepthTestDistance:Number.POSITIVE_INFINITY}})}},Cesium.ScreenSpaceEventType.LEFT_CLICK),i.setInputAction(function(e){!s&&o.showAt(e.endPosition,"点击选择定位点"),s&&o.showAt(e.endPosition,"点击结束绕飞")},Cesium.ScreenSpaceEventType.MOUSE_MOVE),i.setInputAction(function(e){a.distance-=e*a.distance/2e3,a.distance<1&&(a.distance=1)},Cesium.ScreenSpaceEventType.WHEEL),this.drawHandler=i,this.end=function(e){t.end=void 0,o.show(!1),i.destroy(),a._viewer.entities.remove(h),h=void 0,a._core.mouse(a._viewer.container,0),n.clock.onTick.removeEventListener(c),r.end&&r.end()},this},e}),define("SGWorld/Analysis/SunshineAnalysis",["../configData","../Core/Core","../ProjectTree/treeSource","../Navigate/getPosition","../Creator/PopupMessage"],function(i,r,u,o,e){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new r,this._tree=u,this._getPosition=new o(this._viewer,this._cesium),this.tooltip=this._core.CreateTooltip(),this.sunshineOption={},this.loadingImg=window.SmartEarthRootUrl+i.loading}return t.prototype.PointSunshineAnalysis=function(e,t){if(this._viewer.entities.remove(this._viewer.entities.getById("1")),this._viewer.entities.remove(this._viewer.entities.getById("point")),null==e)throw"无效参数";if("Cartesian3"!=e.constructor.name)throw"传入参数必须是三维坐标";this._viewer.scene.sun.show||(this._viewer.scene.sun.show=!0);var i=this._viewer.scene.context.uniformState.sunPositionWC,r=new Cesium.Cartesian3(i.x-e.x,i.y-e.y,i.z-e.z),o=Math.sqrt(r.x*r.x+r.y*r.y+r.z*r.z),n=new Cesium.Cartesian3(r.x/o,r.y/o,r.z/o),a=new Cesium.Cartesian3(e.x+200*n.x,e.y+200*n.y,e.z+200*n.z);this.pickFromRay(e,a,t)},t.prototype.sunshineAnalysisPoint=function(r,o){!r&&(r={}),this.sunshineOption=r;var n=this,a=this._viewer;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(a.scene.canvas),u.states=1,this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+i.draw),this.drawHandler.setInputAction(function(e){var t=n._getPosition.getMousePosition(e);if(n.PointSunshineAnalysis(t),t){var i=a.entities.add({id:n._core.getuid(),name:"Point",position:t,point:{pixelSize:16,color:n._cesium.Color.BLUE,outlineWidth:n._core.defaultValue(r.outlineWidth,2),outlineColor:n._cesium.Color.WHITE.withAlpha(.6),heightReference:n._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY,distanceDisplayCondition:new n._cesium.DistanceDisplayCondition(0,1e8)}});n.drawHandler.destroy(),n.drawHandler=void 0,n.tooltip.show(!1),setTimeout(function(){u.states=0},100),n._core.mouse(n._viewer.container,0,"0"),o&&"function"==typeof o&&o(i)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){n.tooltip.showAt(e.endPosition,"点击绘制点")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},t.prototype.sunshineAnalysisPolygon=function(r,t){!r&&(r={}),this.sunshineOption=r;var o=this,n=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.loading||this.addLoading(),this.remove(),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(n.scene.canvas),u.states=1;var a,s,l=[];return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+i.draw),this.drawHandler.setInputAction(function(e){var t=o._getPosition.getMousePosition(e);if(t){if(!l.length){var i=Cesium.Cartographic.fromCartesian(t);o.sunshineOption.defaultHeight=i.height,l.push(t)}l.push(t),2!==l.length||s||(s=n.entities.add({name:"临时线",polyline:{positions:new o._cesium.CallbackProperty(function(){return l},!1),clampToGround:!0,material:o._cesium.Color.LIME.withAlpha(.6),width:3}})),3!==l.length||a||(s&&n.entities.remove(s),r.clampToGround=o._core.defaultValue(r.clampToGround,!0),a=n.entities.add({id:o._core.getuid(),name:"新建面",polygon:{hierarchy:new o._cesium.CallbackProperty(function(){return new o._cesium.PolygonHierarchy(l)},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.LIME.withAlpha(.6)}),perPositionHeight:!o._core.defaultValue(r.clampToGround,!1),heightReference:r.clampToGround?1:0,outline:o._core.defaultValue(r.outline,!1),outlineColor:o._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}}))}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){if(0===l.length)o.tooltip.showAt(e.endPosition,"点击添加第一个点");else if(1===l.length)o.tooltip.showAt(e.endPosition,"点击添加第二个点");else{o.tooltip.showAt(e.endPosition,"点击添加点,右键结束绘制");var t=o._getPosition.getMousePosition(e);if(!t)return;l.pop(),l.push(t)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.end=void 0,setTimeout(function(){u.states=0},100),o._core.mouse(o._viewer.container,0,"0"),s&&n.entities.remove(s),a&&n.entities.remove(a),"cancel"===e||l.length<3||setTimeout(function(){o.analysis(a,r.start||"2019-09-17 13:00",r.end||"2019-09-17 15:00",r.interval||60,t)},100)},this.drawHandler.setInputAction(function(e){o.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},t.prototype.analysis=function(e,t,i,o,n){var a=new Date(t),s=new Date(i),l=0,u=this,r=this.sunshineOption.startHeight||this.sunshineOption.defaultHeight,c=u.getPoint(e,this.sunshineOption.spacing||10,r,r+u._core.defaultValue(this.sunshineOption.addHeight,30));this._viewer.scene.sun.show||(this._viewer.scene.sun.show=!0);var h=this._viewer.clock.currentTime.clone();function d(){var e,t,i=a.getTime()+6e4*o*l,r=new Date(i);s<r?(u.createPoint(c),u._viewer.clock.currentTime=h,u.isLoading(!1),n&&"function"==typeof n&&n(c)):(e=r,t=function(e){!function(e){for(var t=0;t<c.length;t++)u.Sunshine(c[t],e)?c[t].through++:c[t].out++}(e),l++,d()},u.SetTimeNow(e),setTimeout(function(){var e=u._viewer.scene.context.uniformState.sunPositionWC;t(e)},100))}1500<(s-a)/(6e4*o)*c.length?window.layuiLayer&&window.layuiLayer.msg("当前分析时间过长,是否继续分析?",{time:0,btn:["继续","取消"],btnAlign:"c",yes:function(e){layuiLayer.close(e),u.isLoading(!0),d()},btn2:function(){n&&"function"==typeof n&&n(c)}}):(u.isLoading(!0),d())},t.prototype.createPoint=function(e){this.ResultPoint=this._viewer.scene.primitives.add(new this._cesium.PointPrimitiveCollection);for(var t=0;t<e.length;t++){var i=e[t],r=e[t].through+e[t].out,o=e[t].out/r,n="";.7<=o?n=this._cesium.Color.BLUE:o<.7&&.3<=o?n=this._cesium.Color.YELLOW:o<.3&&(n=this._cesium.Color.RED);var a={id:{isshowderData:!0,data:"阴影率:"+100*(1-o)+"%"},position:this._cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height),color:n};this.ResultPoint.add(a)}this.showResultTooltip(!0)},t.prototype.showResultTooltip=function(e){if(this.ResultTooltipHandler&&(this.ResultTooltipHandler.destroy(),this.ResultTooltipHandler=void 0,this.tooltip.show(!1)),e){var i=this;this.ResultTooltipHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.ResultTooltipHandler.setInputAction(function(e){var t=i._viewer.scene.pick(e.position);t&&t.id&&t.id.isshowderData?i.tooltip.showAt(e.position,t.id.data):i.tooltip.show(!1)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.ResultTooltipHandler.setInputAction(function(e){i.tooltip.show(!1)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE)}},t.prototype.getPoint=function(e,t,i,r){for(var o=[],n=e.polygon.hierarchy.getValue().positions,a=0;a<n.length;a++){var s=this._cesium.Math.toDegrees(this._cesium.Cartographic.fromCartesian(n[a]).longitude),l=this._cesium.Math.toDegrees(this._cesium.Cartographic.fromCartesian(n[a]).latitude);o.push(s),o.push(l)}for(var u=this.getTheBottomPoint(o),c=this.scanningPolygon(u,t,t,o),h=[],d=(r-i)/t,m=0;m<d;m++)for(var p=0;p<c.length;p++){var g=c[p],f={lon:g.lon,lat:g.lat,height:i+t*m,through:0,out:0,color:""};h.push(f)}return h},t.prototype.getTheBottomPoint=function(e){for(var t=90,i=0,r=1;r<e.length;r+=2)t=t<e[r]?t:(i=r)&&e[r];return{lon:e[i-1],lat:e[i]}},t.prototype.scanningPolygon=function(e,t,i,r){for(var o,n,a,s,l,u=[],c=180,h=-180,d=-90,m=0;m<r.length;m+=2)d=d>r[m+1]?d:r[m+1],c=c<r[m]?c:r[m],h=h>r[m]?h:r[m];var p=this.GetPositionFromA_D(e.lat,e.lon,i,0);for(o=this.GetPositionFromA_D(e.lat,e.lon,t,90)[0]-e.lon,n=p[1]-e.lat,u.push({lon:e.lon,lat:e.lat}),(l={lon:e.lon,lat:e.lat}).lat+=n;l.lat<=d;l.lat+=n){for(a={lon:l.lon-o,lat:l.lat},s={lon:l.lon+o,lat:l.lat},this.IsInPolygon(l.lon,l.lat,r)&&u.push({lon:l.lon,lat:l.lat});a.lon>=c;a.lon-=o)this.IsInPolygon(a.lon,a.lat,r)&&u.push({lon:a.lon,lat:a.lat});for(;s.lon<=h;s.lon+=o)this.IsInPolygon(s.lon,s.lat,r)&&u.push({lon:s.lon,lat:s.lat})}return u},t.prototype.GetPositionFromA_D=function(e,t,i,r){var o=i*Math.sin(r*Math.PI/180),n=i*Math.cos(r*Math.PI/180),a=6356725+21412*(90-e)/90;return[180*(o/(a*Math.cos(e*Math.PI/180))+t*Math.PI/180)/Math.PI,180*(n/a+e*Math.PI/180)/Math.PI]},t.prototype.IsInPolygon=function(e,t,i){var r,o,n,a,s=0;if(i.length<6)return!1;i.push(i[0],i[1]);for(var l=0;l<i.length-2;l+=2)r=i[l],n=i[l+1],o=i[l+2],a=i[l+3],(n<=t&&t<a||a<=t&&t<n)&&0<Math.abs(n-a)&&r-(r-o)*(n-t)/(n-a)<=e&&s++;return s%2!=0},t.prototype.SetTimeNow=function(e){var t=new this._cesium.JulianDate.fromDate(e);this._viewer.clock.currentTime=t},t.prototype.Sunshine=function(e,t){var i=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height);return this.pickFromRay(i,t)},t.prototype.jiance=function(e,t){var i=!1,r=this._cesium.Cartographic.fromCartesian(e),o=this._cesium.Cartographic.fromCartesian(t),n=[],a={};a.longitude=r.longitude/Math.PI*180,a.latitude=r.latitude/Math.PI*180,a.czheight=r.height;var s={};s.longitude=o.longitude/Math.PI*180,s.latitude=o.latitude/Math.PI*180,s.czheight=o.height;for(var l=0;l<20;l++){var u={};u.longitude=this._cesium.Math.lerp(a.longitude,s.longitude,.01*(l+1)),u.latitude=this._cesium.Math.lerp(a.latitude,s.latitude,.01*(l+1)),u.czheight=a.czheight-.01*(a.czheight-s.czheight)*(l+1);var c=new this._cesium.Cartographic(this._cesium.Math.toRadians(u.longitude),this._cesium.Math.toRadians(u.latitude),0),h=this._viewer.scene.sampleHeight(c);this._cesium.Cartesian3.fromDegrees(u.longitude,u.latitude,h);u.zsheight=h,u.zsheight>u.czheight&&(i=!0),n.push(u)}return i},t.prototype.pickFromRay=function(e,t){var i=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t,e,new Cesium.Cartesian3),new Cesium.Cartesian3),r=new Cesium.Ray(e,i),o=this._viewer.scene.pickFromRay(r,[]),n=!1;return o&&o.object&&(n=!0),n},t.prototype.remove=function(){this.ResultPoint&&this._viewer.scene.primitives.remove(this.ResultPoint),this.ResultPoint=void 0,this.ResultTooltipHandler&&(this.ResultTooltipHandler.destroy(),this.ResultTooltipHandler=void 0,this.tooltip.show(!1)),this.showResultTooltip(!1)},t.prototype.addLoading=function(){var e=document.createElement("div");e.id="cesiumLoading",e.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";var t=document.createElement("img");t.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",t.src=this.loadingImg,e.appendChild(t),this.loading=e,this._viewer.container.appendChild(e)},t.prototype.isLoading=function(e){this.loading.style.display=e?"block":"none"},t.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0},t}),define("SGWorld/Analysis/Analysis",["./measureTerrainPerimeter","./measureTerrainHeight","./measureTerrainArea","./measureTerrainkPerimeter","./ElevationContour","./createTerrainProfile","./lineOfSight","./lineOfSights","./terrainExaggeration","./curtaincontrast","./navigationMixin","./indoormode","./weather","./Particle","./UndergroundMode","./StreetView","./Scan","./depthTestAgainstTerrain","./3Dviewshed","./SkylineAnalysis","./BufferAnalysis","./TerrainExcavation","./ShadowsAnalysis","./Screenshot","./PointFly","./SunshineAnalysis"],function(i,r,o,n,a,s,l,u,c,h,d,m,p,g,f,v,_,y,C,w,b,E,S,P,x,T){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._measureTerrainPerimeter=new i(this._viewer,this._cesium),this._measureTerrainHeight=new r(this._viewer,this._cesium),this._measureTerrainArea=new o(this._viewer,this._cesium),this._measureTerrainkPerimeter=new n(this._viewer,this._cesium),this._elevationContour=new a(this._viewer,this._cesium),this._createTerrainProfile=new s(this._viewer,this._cesium),this._createlineOfSight=new l(this._viewer,this._cesium),this._createlineOfSights=new u(this._viewer,this._cesium),this._createterrainExaggeration=new c(this._viewer,this._cesium),this._createcurtaincontrast=new h(this._viewer,this._cesium),this._createnavigationMixin=new d(this._viewer,this._cesium),this._createindoormode=new m(this._viewer,this._cesium),this._createWeather=new p(this._viewer,this._cesium),this._Particle=new g(this._viewer,this._cesium),this._UndergroundMode=new f(this._viewer,this._cesium),this._StreetView=new v(this._viewer,this._cesium),this._depthTestAgainstTerrain=new y(this._viewer,this._cesium),this._create3DViewshed=new C(this._viewer,this._cesium),this._skylineAnalysis=new w(this._viewer,this._cesium),this._bufferAnalysis=new b(this._viewer,this._cesium),this._terrainExcavation=new E(this._viewer,this._cesium),this._shadowsAnalysis=new S(this._viewer,this._cesium),this._screenshot=new P(this._viewer,this._cesium),this._PointFly=new x(this._viewer,this._cesium),this._SunshineAnalysis=new T(this._viewer,this._cesium)}return e.prototype.measureTerrainPerimeter=function(e){return this._measureTerrainPerimeter.measureTerrainPerimeter(e)},e.prototype.depthTestAgainstTerrain=function(e){return this._depthTestAgainstTerrain.depthTestAgainstTerrain(e)},e.prototype.DrawPointBuffer=function(e,t){return this._bufferAnalysis.DrawPoint(e,t)},e.prototype.DrawPolylineBuffer=function(e,t){return this._bufferAnalysis.DrawPolyline(e,t)},e.prototype.DrawPolygonBuffer=function(e,t){return this._bufferAnalysis.DrawPolygon(e,t)},e.prototype.TerrainExcavation=function(e,t,i){return this._terrainExcavation.CreatePolygon(e,t,i)},e.prototype.ShadowsAnalysis=function(){return this._shadowsAnalysis.createAnalysis()},e.prototype.createSkylineAnalysis=function(e){return this._skylineAnalysis.createSkylineAnalysis(e)},e.prototype.clearSkylineAnalysis=function(){return this._skylineAnalysis.clear()},e.prototype.createScreenshot=function(e){return this._screenshot.createScreenshot(e)},e.prototype.ScreenshotCompared=function(e){return this._screenshot.createScreenshotCompared(e)},e.prototype.setPointFly=function(e){return this._PointFly.setPointFly(e)},e.prototype.createCircleScan=function(e,t,i,r,o){return new _(this._viewer,this._cesium).createCircleScan(e,t,i,r,o)},e.prototype.createMultiCircleScan=function(e,t,i,r,o){return new _(this._viewer,this._cesium).createMultiCircleScan(e,t,i,r,o)},e.prototype.createSectorScan=function(e,t,i,r,o,n,a){return new _(this._viewer,this._cesium).createSectorScan(e,t,i,r,o,n,a)},e.prototype.createRadarScan=function(e,t,i,r,o){return new _(this._viewer,this._cesium).createRadarScan(e,t,i,r,o)},e.prototype.UndergroundModelOpen=function(e,t){return this._UndergroundMode.UndergroundModelOpen(e,t)},e.prototype.UndergroundModelClose=function(){return this._UndergroundMode.close()},e.prototype.StreetViewOpen=function(e,t,i){return this._StreetView.StreetViewOpen(e,t,i)},e.prototype.ExitStreetView=function(){return this._StreetView.exit()},e.prototype.createWeather=function(e,t,i){return this._createWeather.createWeather(e,t,i)},e.prototype.createParticleEffect=function(e,t,i,r){return this._Particle.createParticleEffect(e,t,i,r)},e.prototype.removeParticleEffect=function(e){return this._Particle.removeParticleEffect(e)},e.prototype.measureTerrainHeight=function(e){return this._measureTerrainHeight.measureTerrainHeight(e)},e.prototype.createindoormode=function(){return this._createindoormode.createIndoormode()},e.prototype.Indoormodeclose=function(){return this._createindoormode.Indoormodeclose()},e.prototype.createterrainExaggeration=function(e){return this._createterrainExaggeration.createterrainExaggeration(e)},e.prototype.createCurtainContrast=function(e,t){return this._createcurtaincontrast.curtainContrast(e,t)},e.prototype.clearCurtainContrast=function(){return this._createcurtaincontrast.close()},e.prototype.createnavigationMixin=function(){return this._createnavigationMixin.navigationMixin()},e.prototype.measureTerrainArea=function(e){return this._measureTerrainArea.measureTerrainArea(e)},e.prototype.measureTerrainkPerimeter=function(e){return this._measureTerrainkPerimeter.measureTerrainkPerimeter(e)},e.prototype.createElevationContour=function(e,t,i){return this._elevationContour.createElevationContour(e,t,i)},e.prototype.createTerrainProfile=function(e){return this._createTerrainProfile.createTerrainProfile(e)},e.prototype.create3DViewshed=function(e){return this._create3DViewshed.startDraw(e),this._create3DViewshed},e.prototype.set3DViewshedOptions=function(e){return this._create3DViewshed.setOptions(e),this._create3DViewshed},e.prototype.close3DViewshed=function(){return this._create3DViewshed.close()},e.prototype.createlineOfSight=function(e,t){return new l(this._viewer,this._cesium).createlineOfSight(e,t)},e.prototype.createlineOfSights=function(e){return this._createlineOfSights.createlineOfSights(e)},e.prototype.SunshineAnalysisPoint=function(e,t){return this._SunshineAnalysis.sunshineAnalysisPoint(e,t)},e.prototype.SunshineAnalysisPolygon=function(e,t){return this._SunshineAnalysis.sunshineAnalysisPolygon(e,t)},e}),define("SGWorld/ProjectTree/deleteItem",["./treeSource"],function(i){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._tree=i.getSource()}return e.prototype.deleteItem=function(e){i.delete(e,this._viewer,this._cesium)},e.prototype.testTreeSource=function(){console.log(this._tree)},e}),define("SGWorld/ProjectTree/Gettreeid/Gettreeid",["../treeSource"],function(n){return function(e,t){for(var i="",r=n.getSource(),o=0;o<r.length;o++)e==r[o].name&&r[o].pId==t&&(i=r[o].id);return i}}),define("SGWorld/ProjectTree/findItem",["./Gettreeid/Gettreeid","./treeSource","../../../node_modules/lodash/lodash.min"],function(e,n,a){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._tree=n.getSource()}return t.prototype.findItem=function(e){var t,i="",r=a.clone(this._tree);t=e.split("\\");for(var o=0;o<t.length;o++)if(r=n.getSourceByName(r,t[o]),o==t.length-1){if(r){i=r.id;break}i=""}else{if(!r){i="",r=null;break}r=r.children}return i},t}),define("SGWorld/ProjectTree/getItemName",["./treeSource"],function(i){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._tree=i.getSource()}return e.prototype.getItemName=function(e){var t=i.getSourceById(this._tree,e);return t?t.name:""},e}),define("SGWorld/ProjectTree/getVisibility",["./treeSource"],function(i){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._tree=i.getSource()}return e.prototype.getVisibility=function(e){var t=t=i.getSourceById(this._tree,e);if(t)return t.item.getVisibility()},e}),define("SGWorld/ProjectTree/setVisibility",["./treeSource"],function(i){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._tree=i.getSource()}return e.prototype.setVisibility=function(e,t){i.setVisibility(e,t,this._viewer,this._cesium)},e}),define("SGWorld/ProjectTree/renameGroup",["./treeSource"],function(o){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._tree=o.getSource()}return e.prototype.rename=function(e,t){var i=o.getSourceById(this._tree,e);i&&(i.name=t);var r=o.getTempSourceById(e);r&&(r.name=t)},e}),define("SGWorld/ProjectTree/getNextItem",["./treeSource"],function(i){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._tree=i.getSource()}return e.prototype.getNextItem=function(e,t){},e}),define("SGWorld/Creator/Wall",["./Color","../Core/Core","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min"],function(e,u,i,a){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new u,this._tree=i}t.prototype.createWall=function(e,t,i,r){var o={show:!0,minimumHeights:[100,100,100,100,100,100,100],maximumHeights:[2e3,2e3,2e3,2e3,2e3,2e3,2e3],material:this._cesium.Color.AQUA.withAlpha(1)};if(!this._core.isnull(i)){i=this._core.extend(o,i,!0);var n=new u;i&&"ImageMaterialProperty"==i.material?i.material=n.setImageMaterialProperty("../../img/arrow.png",this._cesium,0,i.id):i&&"DrawCanvasColorUpdown"==i.material&&(i.material=n.setImageMaterialProperty("../../img/arrow.png",this._cesium,1,i.id));var a=[];if(t[0].x||t[0].y)if(void 0!==t[0].z)for(s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s].x,t[s].y,t[s].z));else for(s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s].x,t[s].y));else if(2===t[0].length)for(var s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s][0],t[s][1]));else if(3===t[0].length)for(var s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s][0],t[s][1],t[s][2]));i.positions=a,void 0!==i.minHeight&&(i.minimumHeights=new Array(i.positions.length).fill(i.minHeight)),void 0!==i.maxHeight&&(i.maximumHeights=new Array(i.positions.length).fill(i.maxHeight));var l=this._viewer.entities.add({name:e,id:this._core.getuid(),wall:i});return l.positions=i.positions,this.item=l,this._tree.insertGroupId({id:l.id,name:e,pId:this._core.isnull(r)?0:r,type:"wall",item:this},this._core.isnull(r)?0:r),this}console.log("options is required")},t.prototype.executeWall=function(t,i){var l=[],r=void 0,u=this,o=function(){function e(e){this.options={id:u._core.getuid(),type:"wall",wall:{positions:[],minimumHeights:[2e3,2e3],maximumHeights:[1e3,1e3],material:u._core.setImageMaterialProperty("img/arrow.png",u._cesium,1)}},this.positions=e,this._init()}return e.prototype._init=function(){var s=this;this.options.wall.maximumHeights=new u._cesium.CallbackProperty(function(){for(var e=[],t=0;t<s.positions.length;t++)e.push(2e3);return e},!1),this.options.wall.minimumHeights=new u._cesium.CallbackProperty(function(){for(var e=[],t=0;t<s.positions.length;t++)e.push(1e3);return e},!1),this.options.wall.positions=new u._cesium.CallbackProperty(function(){for(var e=[],t=0;t<s.positions.length;t++){if(!l[t])return;var i=u._viewer.scene.globe.ellipsoid,r=new u._cesium.Cartesian3(l[t].x,l[t].y,l[t].z),o=i.cartesianToCartographic(r),n=u._cesium.Math.toDegrees(o.latitude),a=u._cesium.Math.toDegrees(o.longitude);o.height,e.push(a),e.push(n)}return u._cesium.Cartesian3.fromDegreesArray(e)},!1);var e=u._viewer.entities.add(this.options);u.item=e,u._tree.insertGroupId({id:this.options.id,name:t,pId:u._core.isnull(i)?0:i,type:"wall",item:u},u._core.isnull(i)?0:i)},e}(),n=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);n.setInputAction(function(e){var t=u._viewer.scene.camera.pickEllipsoid(e.position,u._viewer.scene.globe.ellipsoid);0==l.length&&l.push(a.clone(t)),l.push(a.clone(t))},u._cesium.ScreenSpaceEventType.LEFT_CLICK),n.setInputAction(function(e){var t=u._viewer.scene.camera.pickEllipsoid(e.endPosition,u._viewer.scene.globe.ellipsoid);1<=l.length&&(u._cesium.defined(r)?(l.pop(),l.push(t)):r=new o(l))},u._cesium.ScreenSpaceEventType.MOUSE_MOVE),n.setInputAction(function(e){n.destroy(),l.pop()},u._cesium.ScreenSpaceEventType.RIGHT_CLICK)};var n="a",s=0;return t.prototype.drawCanvasImage=function(e,t){var i=document.getElementById("canvas-"+n),r=i.getContext("2d"),o=new Image;return o.src="img/arrow.png",r.clearRect(0,0,700,100),o.onload=function(){s<=700?(r.drawImage(o,s,0),r.drawImage(o,s+100,0)):s=0,s+=5},n="a"===n?"b":"a",i},t.prototype.setVisibility=function(e){this.item.wall.show=e},t.prototype.getVisibility=function(){return this.item.wall.show},t.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},Object.defineProperties(t.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),Object.defineProperties(t.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),t.prototype.setItem=function(e){this.item=e},t.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(t.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(t.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(t.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(t.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Object.defineProperties(t.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(t.prototype,{wallTempOptions:{get:function(){return{positions:[],maximumHeights:[],minimumHeights:[],show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,granularity:this._cesium.Math.RADIANS_PER_DEGREE,shadows:ShadowMode.DISABLED,distanceDisplayCondition:null}}}}),t}),define("SGWorld/ProjectTree/getExitsObjectType",[],function(){return{none:-1,point:0,polyline:1,polygon:2,label:3,imageLabel:4,position:5,imageLayer:6,dynamicObject:7,D3titles:8,box:9,circle:10,cone:11,pointfeaturelayer:12,polylinefeaturelayer:13,polygonfeaturelayer:14,pointmodel:15,rectangle:16,ellipsoid:17,wall:18,polylinevolume:19}}),define("SGWorld/ProjectTree/getObject",["./treeSource","../Core/Core","../Creator/Point","../Creator/Wall","../Creator/PolylineVolume","../Creator/Rectangle","../Creator/Polyline","../Creator/Polygon","../Creator/Label","../Creator/ImageLabel","../Creator/Ellipsoid","../Creator/Cone","../Creator/Circle","../Creator/Box","../Creator/3DTileset","../Creator/GeoJsonFeatureLayer","../Creator/PointModel","../../../node_modules/lodash/lodash.min","./getExitsObjectType"],function(C,i,w,b,E,S,P,x,T,I,D,L,M,A,R,O,N,m,V){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._tree=C.getSource(),this._treeSource=C.Source,this._treeTemp=C.getTempSource(),this._tree1=C,this._core=new i}return e.prototype.getObject=function(e){var t=m.clone(this._tree),i=C.getSourceById(t,e);if(i)return i.item;var r=m.clone(C.PointSelectSource),o=C.getPointSelectSourceById(r,e);return o?o.item:void 0},e.prototype.getTreeItem=function(e){var t=m.clone(this._tree),i=C.getSourceById(t,e);if(i)return i;for(var r=this._viewer.dataSources,o=0;o<r.length;o++){var n=r.get(o).entities.getById(e);if(n){if(n.point&&(null==n.point.show||n.point.show._value)){(d=new w(this._viewer,this._cesium)).setItem(n);var a={id:this._core.getuid(),name:"",pId:0,type:"point",item:d};return C.pusPointSelectSource(a),a}if(n.label&&(null==n.label.show||n.label.show._value)){(d=new T(this._viewer,this._cesium)).setItem(n);a={id:this._core.getuid(),name:"",pId:0,type:"label",item:d};return C.pusPointSelectSource(a),a}if(n.box&&(null==n.box.show||n.box.show._value)){var s=new A(this._viewer,this._cesium);s.setItem(n);a={id:this._core.getuid(),name:"",pId:0,type:"box",item:s};return C.pusPointSelectSource(a),a}if(n.model&&(null==n.model.show||n.model.show._value)){(d=new model(this._viewer,this._cesium)).setItem(n);a={id:this._core.getuid(),name:"",pId:0,type:"model",item:d};return C.pusPointSelectSource(a),a}if(n.wall&&(null==n.wall.show||n.wall.show._value)){var l=new b(this._viewer,this._cesium);l.setItem(n);a={id:this._core.getuid(),name:"",pId:0,type:"wall",item:l};return C.pusPointSelectSource(a),a}if(n.polyline){var u=new P(this._viewer,this._cesium);u.setItem(n);a={id:this._core.getuid(),name:"",pId:0,type:"polyline",item:u};return C.pusPointSelectSource(a),a}if(n.polygon){var c=new x(this._viewer,this._cesium);c.setItem(n);a={id:this._core.getuid(),name:"",pId:0,type:"polygon",item:c};return C.pusPointSelectSource(a),a}if(n.rectangle){var h=new S(this._viewer,this._cesium);h.setItem(n);a={id:this._core.getuid(),name:"",pId:0,type:"rectangle",item:h};return C.pusPointSelectSource(a),a}if(n.billboard&&(null==n.billboard.show||n.billboard.show._value)){var d;(d=new I(this._viewer,this._cesium)).setItem(n);a={id:this._core.getuid(),name:"",pId:0,type:"billboard",item:d};return C.pusPointSelectSource(a),a}}}},e.prototype.updateItemId=function(e,t){var i=this._treeSource;if((o=C.getSourceById(i,e))&&(o.id=t,"group"==o.type&&o.children&&0<o.children.length))for(var r=0;r<o.children.length;r++)o.children[r].pId=t;var o;i=this._treeTemp;if((o=C.getSourceById(i,e))&&(o.id=t,"group"==o.type&&o.children&&0<o.children.length))for(r=0;r<o.children.length;r++)o.children[r].pId=t},e.prototype.unifiedProject=function(e,t){for(var i=0;i<t.length;i++)t[i].id=e[i].id,t[i].pId=t[i].pId,t[i].children&&0<t[i].children.length&&this.unifiedProject(e[i].children,t[i].children)},e.prototype.insertProjectTree=function(e,t,i,r,o){var n=!0;if(this._core.isnull(t)&&(t=this._core.getuid()),n=0!=o,V.none==i){var a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"unknown",item:null};C.insertGroupId(a,e)}else if(V.position==i){a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"unknown",item:null};C.insertGroupId(a,e)}else if(V.imageLayer==i){a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,checked:n,type:"unknown",item:null};C.insertGroupId(a,e)}else if(V.dynamicObject==i){a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"unknown",item:null};C.insertGroupId(a,e)}else if(V.point==i){(p=new w(this._viewer,this._cesium)).setItem(r);a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"point",item:p};p.setTreeobj(a),C.insertGroupId(a,e)}else if(V.polyline==i){var s=new P(this._viewer,this._cesium);s.setItem(r);a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"polyline",item:s};s.setTreeobj(a),C.insertGroupId(a,e)}else if(V.rectangle==i){var l=new S(this._viewer,this._cesium);l.setItem(r);a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"rectangle",item:l};l.setTreeobj(a),C.insertGroupId(a,e)}else if(V.ellipsoid==i){var u=new D(this._viewer,this._cesium);u.setItem(r);a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"ellipsoid",item:u};u.setTreeobj(a),C.insertGroupId(a,e)}else if(V.polygon==i){var c=new x(this._viewer,this._cesium);r._entity?(c.setItem(r._entity),c._points=r._points):c.setItem(r);a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"polygon",item:c};c.setTreeobj(a),C.insertGroupId(a,e)}else if(V.wall==i){var h=new b(this._viewer,this._cesium);h.setItem(r);a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"wall",item:h};h.setTreeobj(a),C.insertGroupId(a,e)}else if(V.polylinevolume==i){var d=new E(this._viewer,this._cesium);d.setItem(r);a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"polylinevolume",item:d};d.setTreeobj(a),C.insertGroupId(a,e)}else if(V.pointmodel==i){var m=new N(this._viewer,this._cesium);m.setItem(r);a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"pointmodel",item:m};m.setTreeobj(a),C.insertGroupId(a,e)}else if(V.label==i){(p=new T(this._viewer,this._cesium)).setItem(r);a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"label",item:p};p.setTreeobj(a),C.insertGroupId(a,e)}else if(V.imageLabel==i){var p;(p=new I(this._viewer,this._cesium)).setItem(r);a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,checked:n,type:"billboard",item:p};p.setTreeobj(a),C.insertGroupId(a,e)}else if(V.D3titles==i){var g=new R(this._viewer,this._cesium);g.setItem(r);a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"3DTilesets",item:g};g.setTreeobj(a),C.insertGroupId(a,e)}else if(V.box==i){var f=new A(this._viewer,this._cesium);f.setItem(r);a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"box",item:f};f.setTreeobj(a),C.insertGroupId(a,e)}else if(V.circle==i){var v=new M(this._viewer,this._cesium);v.setItem(r);a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"circle",item:v};v.setTreeobj(a),C.insertGroupId(a,e)}else if(V.cone==i){var _=new L(this._viewer,this._cesium);_.setItem(r);a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"cylinder",item:_};_.setTreeobj(a),C.insertGroupId(a,e)}else if(V.pointfeaturelayer==i){(y=new O(this._viewer,this._cesium)).setItem(r);a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"pointLayer",item:y};C.insertGroupId(a,e)}else if(V.pointfeaturelayer==i){(y=new O(this._viewer,this._cesium)).setItem(r);a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"polylineLayer",item:y};C.insertGroupId(a,e)}else if(V.polygonfeaturelayer==i){var y;(y=new O(this._viewer,this._cesium)).setItem(r);a={id:r&&r.id?r.id:this._core.getuid(),name:t,pId:e,type:"polygonLayer",item:y};C.insertGroupId(a,e)}return a},e}),define("SGWorld/ProjectTree/isGroup",["./treeSource","../../../node_modules/lodash/lodash.min"],function(r,o){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._tree=r.getSource()}return e.prototype.isGroup=function(e){var t=o.clone(this._tree),i=r.getSourceById(t,e);return!(!i||"group"!=i.type)},e}),define("SGWorld/ProjectTree/export",["./treeSource"],function(e){"use strict";function t(e,t){this._viewer=e,this._cesium=t}return t.prototype.exportMethod=function(e){for(var t=[],i=0;i<e.length;i++)if("function"==typeof e[i].item.export){var r=e[i].item.export();if(t.push(r),e[i].children&&e[i].children.length){var o=this.exportMethod(e[i].children);t.push(o)}}return t},t.prototype.export=function(){return this.exportMethod(e.Source)},t}),function(e,t){if("function"==typeof define&&define.amd)define("SGWorld/../../node_modules/file-saver/dist/FileSaver",[],t);else if("undefined"!=typeof exports)t();else{t(),e.FileSaver={}}}(this,function(){"use strict";var c="object"===("undefined"==typeof window?"undefined":_typeof2(window))&&window.window===window?window:"object"===("undefined"==typeof self?"undefined":_typeof2(self))&&self.self===self?self:"object"===("undefined"==typeof global?"undefined":_typeof2(global))&&global.global===global?global:void 0;function h(e,t,i){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){o(r.response,t,i)},r.onerror=function(){console.error("could not download file")},r.send()}function a(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&t.status<=299}function s(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(e){var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(i)}}var o=c.saveAs||("object"!==("undefined"==typeof window?"undefined":_typeof2(window))||window!==c?function(){}:"download"in HTMLAnchorElement.prototype?function(e,t,i){var r=c.URL||c.webkitURL,o=document.createElement("a");t=t||e.name||"download",o.download=t,o.rel="noopener","string"==typeof e?(o.href=e,o.origin!==location.origin?a(o.href)?h(e,t,i):s(o,o.target="_blank"):s(o)):(o.href=r.createObjectURL(e),setTimeout(function(){r.revokeObjectURL(o.href)},4e4),setTimeout(function(){s(o)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,i){if(t=t||e.name||"download","string"==typeof e)if(a(e))h(e,t,i);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){s(r)})}else navigator.msSaveOrOpenBlob((o=e,void 0===(n=i)?n={autoBom:!1}:"object"!==(void 0===n?"undefined":_typeof2(n))&&(console.warn("Deprecated: Expected third argument to be a object"),n={autoBom:!n}),n.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(o.type)?new Blob([String.fromCharCode(65279),o],{type:o.type}):o),t);var o,n}:function(e,t,i,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof e)return h(e,t,i);var o="application/octet-stream"===e.type,n=/constructor/i.test(c.HTMLElement)||c.safari,a=/CriOS\/[\d]+/.test(navigator.userAgent);if((a||o&&n)&&"object"===("undefined"==typeof FileReader?"undefined":_typeof2(FileReader))){var s=new FileReader;s.onloadend=function(){var e=s.result;e=a?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=e:location=e,r=null},s.readAsDataURL(e)}else{var l=c.URL||c.webkitURL,u=l.createObjectURL(e);r?r.location=u:location.href=u,r=null,setTimeout(function(){l.revokeObjectURL(u)},4e4)}});c.saveAs=o.saveAs=o,"undefined"!=typeof module&&(module.exports=o)}),define("SGWorld/ProjectTree/ProjectTree",["./createGroup","./deleteItem","./findItem","./getItemName","./getVisibility","./setVisibility","./renameGroup","./getNextItem","./getObject","./isGroup","./treeSource","../../../node_modules/lodash/lodash.min","../Creator/Creator","../Core/Core","./getExitsObjectType","./export","../../../node_modules/file-saver/dist/FileSaver"],function(r,o,n,a,s,l,u,c,h,d,m,t,p,g,e,f,i){"use strict";function v(e,t,i){this._viewer=e,this._cesium=t,this._tree=m.Source,this._createGroup=new r(this._viewer,this._cesium,this._tree),this._deleteItem=new o(this._viewer,this._cesium,this._tree),this._findItem=new n(this._viewer,this._cesium,this._tree),this._getItemName=new a(this._viewer,this._cesium,this._tree),this._getVisibility=new s(this._viewer,this._cesium,this._tree),this._setVisibility=new l(this._viewer,this._cesium,this._tree),this._renameGroup=new u(this._viewer,this._cesium,this._tree),this._getNextItem=new c(this._viewer,this._cesium,this._tree),this._isGroup=new d(this._viewer,this._cesium,this._tree),this._creator=new p(this._viewer,this._cesium),this._getObject=new h(this._viewer,this._cesium),this._exportTree=new f(this._viewer,this._cesium),this._core=new g,this.InitTree(i,0),this.InitRootImageLayerAndTerrainlayer()}return v.prototype.export=function(){var e=this._exportTree.export(),t=new Blob([JSON.stringify(e)],{type:""});return saveAs(t,"tree.json"),e},v.prototype.createGroup=function(e,t,i){return this._createGroup=new r(this._viewer,this._cesium),this._createGroup.createGroup(e,t,i)},v.prototype.changeGroup=function(e,t){this._createGroup.changeGroup(e,t)},v.prototype.starttemporaryItem=function(){return this._createGroup.starttemporaryItem()},v.prototype.pushtemporaryItem=function(e){this._createGroup.pushtemporaryItem(e)},v.prototype.pushStateItem=function(e){this._createGroup.pushStateItem(e)},v.prototype.endtemporaryItem=function(){this._createGroup.endtemporaryItem()},v.prototype.deleteItem=function(e){return this._deleteItem.deleteItem(e)},v.prototype.findItem=function(e){return this._findItem.findItem(e)},v.prototype.getItemName=function(e){return this._getItemName.getItemName(e)},v.prototype.getObject=function(e){return this._getObject.getObject(e)},v.prototype.getTreeItem=function(e){return this._getObject.getTreeItem(e)},v.prototype.updateItemId=function(e,t){return this._getObject.updateItemId(e,t)},v.prototype.getVisibility=function(e){return this._getVisibility.getVisibility(e)},v.prototype.setVisibility=function(e,t){return this._setVisibility.setVisibility(e,t)},v.prototype.rename=function(e,t){return this._renameGroup.rename(e,t)},v.prototype.getNextItem=function(e,t){return this._getNextItem.getNextItem(e)},v.prototype.isGroup=function(e){return this._isGroup.isGroup(e)},Object.defineProperties(v.prototype,{exitsObjectType:{get:function(){return e}}}),v.prototype.insertProjectTree=function(e,t,i,r,o,n){return this._core.isnull(e)&&!this._core.isnull(this._tree.selectedItem)&&"group"==this._tree.selectedItem.type&&(e=this._tree.selectedItem.id),e=this._core.isnull(e)?0:e,this._core.isnull(t)||(e=this.createGroup(t,!0,e)),this._getObject.insertProjectTree(e,i,r,o,n)},v.prototype.exitsGroup=function(e,t){return m.exitsGroup(e,t)},v.prototype.getTreeSource=function(){var e=t.cloneDeep(m.getSource());return m.removeItem(e)},v.prototype.unifiedProject=function(e,t){this._getObject.unifiedProject(e,t)},v.prototype.clearn=function(){m.clearn()},Object.defineProperties(v.prototype,{Source:{get:function(){return m.TempSource}}}),Object.defineProperties(v.prototype,{currentObj:{get:function(){return m.currentObj}}}),v.prototype.InitTree=function(e,t){if(e&&e.length)for(var i=0;i<e.length;i++){var r=e[i];switch(r.type){case"group":var o=this.createGroup(r.name,t);r.children&&r.children.length&&this.InitTree(r.children,o);break;case"label":this._creator.createLabel(r.position,r.text,r.option,t,r.description);break;case"imgLabel":this._creator.createImageLabel(r.position,r.imageLabel,t,r.description);break;case"polygon":this._creator.createPolygon(r.geometry,r.lineColor,r.altitudeType,t,r.description);break;case"polyline":this._creator.createPolyline(r.geometry,r.lineColor,r.altitudeType,t,r.description);break;case"box":this._creator.createBox(r.position,r.box,r.name,t,r.description);break;case"circle":this._creator.createCircle(r.position,r.circle,r.name,t,r.description);break;case"cone":this._creator.createCone(r.position,r.cylinder,r.name,r.description)}}},v.prototype.InitRootImageLayerAndTerrainlayer=function(){},Object.defineProperties(v.prototype,{selectedItem:{get:function(){return m.selectedItem},set:function(e){m.selectedItem=e}}}),v}),define("SGWorld/Const/LabelStyles",[],function(){"use strict";return{FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2}}),define("SGWorld/Const/HorizontalOrign",[],function(){"use strict";return{CENTER:0,LEFT:1,RIGHT:-1}}),define("SGWorld/Const/VerticalOrigin",[],function(){"use strict";return{CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1}}),define("SGWorld/Const/HeightReference",[],function(){"use strict";return{NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2}}),define("SGWorld/Const/ShadowMode",[],function(){"use strict";var i={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3,NUMBER_OF_SHADOW_MODES:4,castShadows:function(e){return e===i.ENABLED||e===i.CAST_ONLY},receiveShadows:function(e){return e===i.ENABLED||e===i.RECEIVE_ONLY},fromCastReceive:function(e,t){return e&&t?i.ENABLED:e?i.CAST_ONLY:t?i.RECEIVE_ONLY:i.DISABLED}};return i}),define("SGWorld/Coordinate/Coordinate",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.WGS84_to_Cartesian3=function(e){var t=this._cesium.Cartesian3.fromDegrees(e.longitude,e.latitude,e.height);return{x:t.x,y:t.y,z:t.z}},e.prototype.Cartesian3_to_WGS84=function(e){var t=new this._cesium.Cartesian3(e.x,e.y,e.z),i=this._cesium.Cartographic.fromCartesian(t);return{latitude:this._cesium.Math.toDegrees(i.latitude),longitude:this._cesium.Math.toDegrees(i.longitude),height:i.height}},e}),define("SGWorld/wfs/GmlParser",[],function(){"use strict";function e(e,t,i,r){this._extractAttributes=e,this._featureName=t||"featureMember",this._xy=r,this._gmlns=i||"http://www.opengis.net/gml",this._regExes={trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g}}return Object.defineProperties(e.prototype,{featureName:{get:function(){return this._featureName},set:function(e){this._featureName=e}},extractAttributes:{get:function(){return this._extractAttributes},set:function(e){this._extractAttributes=e}},xy:{get:function(){return this._xy}}}),e.prototype.getElementsByTagNameNS=function(e,t,i){var r=[];if(e.getElementsByTagNameNS)r=e.getElementsByTagNameNS(t,i);else for(var o,n,a=e.getElementsByTagName("*"),s=0,l=a.length;s<l;++s)n=(o=a[s]).prefix?o.prefix+":"+i:i,("*"==i||n==o.nodeName)&&("*"==t||t==o.namespaceURI)&&r.push(o);return r},e.prototype.read=function(e){for(var t=this.getElementsByTagNameNS(e.documentElement,this._gmlns,this.featureName),i=[],r=0;r<t.length;r++){var o=this.parseFeature(t[r]);o&&i.push(o)}return i},e.prototype.parseFeature=function(e){for(var t,i,r,o,n=["MultiPolygon","Polygon","MultiLineString","LineString","MultiPoint","Point","Envelope"],a=0;a<n.length;++a)if(t=n[a],0<(i=this.getElementsByTagNameNS(e,this._gmlns,t)).length){(o=this.parseGeometry[t.toLowerCase()])?r=o.apply(this,[i[0]]):console.log("unsupportedGeometryType:"+t);break}var s,l,u=this.getElementsByTagNameNS(e,this._gmlns,"Box");for(a=0;a<u.length;++a){var c=u[a],h=this.parseGeometry.box.apply(this,[c]),d=c.parentNode;"boundedBy"===(d.localName||d.nodeName.split(":").pop())?s=h:r=h.toGeometry()}this.extractAttributes&&(l=this.parseAttributes(e));var m={geometryType:t.toLowerCase(),positions:r,attributes:l};m.bounds=s;for(var p,g=e.firstChild;g&&(1!=g.nodeType||!(p=g.getAttribute("fid")||g.getAttribute("id")));)g=g.nextSibling;return m.fid=p,m},e.prototype.parseGeometry={point:function(e){var t,i=[];if(0<(t=this.getElementsByTagNameNS(e,this._gmlns,"pos")).length&&(i=t[0].firstChild.nodeValue.replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace)),0==i.length&&(0<(t=this.getElementsByTagNameNS(e,this._gmlns,"coordinates")).length&&(i=t[0].firstChild.nodeValue.replace(this._regExes.removeSpace,"").split(","))),0==i.length&&0<(t=this.getElementsByTagNameNS(e,this._gmlns,"coord")).length){var r=this.getElementsByTagNameNS(t[0],this._gmlns,"X"),o=this.getElementsByTagNameNS(t[0],this._gmlns,"Y");0<r.length&&0<o.length&&(i=[r[0].firstChild.nodeValue,o[0].firstChild.nodeValue])}return 2==i.length&&(i[2]=null),this.xy?[parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2])]:[parseFloat(i[1]),parseFloat(i[0]),parseFloat(i[2])]},multipoint:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"Point"),i=[];if(0<t.length)for(var r,o=0;o<t.length;++o)(r=this.parseGeometry.point.apply(this,[t[o]]))&&i.push(r);return i},linestring:function(e,t){var i,r=[],o=[];if(0<(i=this.getElementsByTagNameNS(e,this._gmlns,"posList")).length){r=this.getChildValue(i[0]).replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace);for(var n,a,s,l,u=parseInt(i[0].getAttribute("dimension")),c=0;c<r.length/u;++c)n=c*u,a=parseFloat(r[n]),s=parseFloat(r[n+1]),l=2==u?null:parseFloat(r[n+2]),this.xy?o.push(a,s,l):o.push(s,a,l)}if(0==r.length&&0<(i=this.getElementsByTagNameNS(e,this._gmlns,"coordinates")).length){var h=this.getChildValue(i[0]).replace(this._regExes.trimSpace,"").replace(this._regExes.trimComma,",").split(this._regExes.splitSpace);for(c=0;c<h.length;++c)2==(r=h[c].split(",")).length&&(r[2]=null),this.xy?o.push(parseFloat(r[0]),parseFloat(r[1]),parseFloat(r[2])):o.push(parseFloat(r[1]),parseFloat(r[0]),parseFloat(r[2]))}return o},multilinestring:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"LineString"),i=[];if(0<t.length)for(var r,o=0;o<t.length;++o)(r=this.parseGeometry.linestring.apply(this,[t[o]]))&&i.push(r);return i},polygon:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"LinearRing"),i=[];if(0<t.length)for(var r,o=0;o<t.length;++o)(r=this.parseGeometry.linestring.apply(this,[t[o],!0]))&&i.push(r);return i},multipolygon:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"Polygon"),i=[];if(0<t.length)for(var r,o=0;o<t.length;++o)(r=this.parseGeometry.polygon.apply(this,[t[o]]))&&i.push(r);return i},envelope:function(e){var t,i=[],r=this.getElementsByTagNameNS(e,this._gmlns,"lowerCorner");if(0<r.length){var o=[];if(0<r.length&&(o=r[0].firstChild.nodeValue.replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace)),2==o.length&&(o[2]=null),this.xy)var n=new OpenLayers_Geometry_Point(o[0],o[1],o[2]);else n=new OpenLayers_Geometry_Point(o[1],o[0],o[2])}var a=this.getElementsByTagNameNS(e,this._gmlns,"upperCorner");if(0<a.length){o=[];if(0<a.length&&(o=a[0].firstChild.nodeValue.replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace)),2==o.length&&(o[2]=null),this.xy)var s=new OpenLayers_Geometry_Point(o[0],o[1],o[2]);else s=new OpenLayers_Geometry_Point(o[1],o[0],o[2])}return n&&s&&(i.push([n.x,n.y,null]),i.push([s.x,n.y,null]),i.push([s.x,s.y,null]),i.push([n.x,s.y,null]),i.push([n.x,n.y,null]),t=new OpenLayers_Geometry_Polygon([[i]])),t},box:function(e){var t,i=this.getElementsByTagNameNS(e,this._gmlns,"coordinates"),r=null,o=null;if(0<i.length&&(2==(t=i[0].firstChild.nodeValue.split(" ")).length&&(r=t[0].split(","),o=t[1].split(","))),null!==r&&null!==o)return[parseFloat(r[0]),parseFloat(r[1]),null,parseFloat(o[0]),parseFloat(o[1]),null]}},e.prototype.parseAttributes=function(e){for(var t,i,r,o,n,a,s,l={},u=e.firstChild;u;){if(1==u.nodeType){for(t=u.childNodes,i=0;i<t.length;++i)1==(r=t[i]).nodeType&&(1==(o=r.childNodes).length?3!=(n=o[0]).nodeType&&4!=n.nodeType||(a=r.prefix?r.nodeName.split(":")[1]:r.nodeName,s=n.nodeValue.replace(this._regExes.trimSpace,""),l[a]=s):l[r.nodeName.split(":").pop()]=null);break}u=u.nextSibling}return l},e.prototype.getChildValue=function(e,t){var i=t||"";if(e)for(var r=e.firstChild;r;r=r.nextSibling)switch(r.nodeType){case 3:case 4:i+=r.nodeValue}return i},e}),define("SGWorld/wfs/TileManager1",["../Core/jquery"],function(n){"use strict";function r(){this._quadtree=void 0,this._loadTileEvent=new Cesium.Event,this._tilingScheme=new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._levelZeroMaximumError=Cesium.QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme),this.cartographicLimitRectangle=Cesium.Rectangle.clone(Cesium.Rectangle.MAX_VALUE),this._tileCache=[],this._primitivesWaitingToBeAddedToTheScene=[],this._pauseStreaming=!1,this._numTilesInLevel=[],this.STREAM_SPEED_IMIDIATE=0,this.STREAM_SPEED_FAST=1,this.STREAM_SPEED_NORMAL=2,this.STREAM_SPEED_SLOW=3,this._streamSpeed=this.STREAM_SPEED_NORMAL,r.prototype.ready||Object.defineProperties(r.prototype,{quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},loadTileEvent:{get:function(){return this._loadTileEvent}},pauseStreaming:{get:function(){return this._pauseStreaming},set:function(e){this._pauseStreaming=e}},streamSpeed:{get:function(){return this._streamSpeed},set:function(e){this._streamSpeed=e}},bestLevelAvailable:{get:function(){for(var e=0,t=0;t<22;t++)null!=this._numTilesInLevel[t]&&0<this._numTilesInLevel[t]&&e<t&&(e=t);return e}}})}function o(r,e,o){n.each(e._primitives,function(e,t){if(t instanceof Cesium.BillboardCollection){var i=t;e=d.indexOf(i);return i._parentCollection._primitiveOld=o,-1!==e?(r.scene.primitives.remove(d[e]._parentCollection),d[e]=i):d.push(i),!1}})}function a(e,t,i){e.scene.primitives.remove(i),t._onDestroyTilePrimitive=function(){e.scene.primitives.remove(i),this._onDestroyTilePrimitive=void 0}}function s(e,t,i,r){Cesium.when.all(t,function(){e.scene.primitives.remove(r)}),i._onDestroyTilePrimitive=function(){e.scene.primitives.remove(r),this._onDestroyTilePrimitive=void 0}}function l(e,t,i){s(e,n.map(t._primitives,function(e){return e.readyPromise}),t,i)}function u(e,t,i){s(e,n.map(t._primitives[0]._primitives,function(e){return e.readyPromise}),t,i)}function c(e,t,i){e.scene.primitives.remove(i)}function h(e,t,i){s(e,[t.readyPromise],t,i)}r.prototype.streamSpeedFactor=function(){switch(this._streamSpeed){case this.STREAM_SPEED_FAST:return 1;case this.STREAM_SPEED_NORMAL:return 3;case this.STREAM_SPEED_SLOW:return 20;default:return 3}};var d=[],m=0;r.prototype.onPreFrame=function(e,t){if(m++,!this._pauseStreaming){if(this._streamSpeed==this.STREAM_SPEED_IMIDIATE)for(;0<this._primitivesWaitingToBeAddedToTheScene.length;){var i=this._primitivesWaitingToBeAddedToTheScene.pop();e.primitives.add(i)}else if(0<this._primitivesWaitingToBeAddedToTheScene.length&&m%this.streamSpeedFactor()==0){(i=this._primitivesWaitingToBeAddedToTheScene.pop())._instanceIds&&100<i._instanceIds.length&&this.streamSpeed===this.STREAM_SPEED_FAST&&(this.streamSpeed=this.STREAM_SPEED_NORMAL),e.primitives.add(i)}n.each(d,function(e,t){t.ready&&this.viewer.scene.primitives.remove(t._parentCollection._primitiveOld)})}},r.prototype.updateForPick=function(e){};Math.PI;r.prototype.placeHolder=function(e,t){t=t||Cesium.Color.fromBytes(0,255,0,255);var i=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.RectangleOutlineGeometry({rectangle:e.rectangle,height:this.viewer.camera.positionCartographic.height-.99*TerraExplorer.internal.Navigate.HeightAboveGround}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(t)}}),appearance:new Cesium.PerInstanceColorAppearance({flat:!0})});e.data.primitive.add(i)},r.prototype.getTile=function(e){return this._tileCache[e]},r.prototype.getAllTiles=function(){var e=[];for(var t in this._tileCache)e.push(this._tileCache[t]);return e},r.prototype.addToScene=function(e){this._primitivesWaitingToBeAddedToTheScene.push(e)},r.prototype.removeFromScene=function(e){var t=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=t?(this._primitivesWaitingToBeAddedToTheScene[t].destroy(),this._primitivesWaitingToBeAddedToTheScene.splice(t,1)):this.viewer.scene.primitives.remove(e)},r.prototype.replaceInScene=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);if(-1!=i)this._primitivesWaitingToBeAddedToTheScene[i]=t;else switch(e.ID!=t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),null!=e._replacmentPrimitive&&this.viewer.scene.primitives.remove(e._replacmentPrimitive),e._replacmentPrimitive=t,this.viewer.scene.primitives.add(t),t.ID.split(":")[0]){case"billboards":o(this.viewer,t,e);break;case"labels":a(this.viewer,t,e);break;case"polygons":l(this.viewer,t,e);break;case"models":u(this.viewer,t,e);break;case"polylines":h(this.viewer,t,e);break;case"points":c(this.viewer,0,e);break;default:console.log("Error updating layer"),this.viewer.scene.primitives.remove(e)}};var p={billboards:o,labels:a,polygons:l,models:u,polylines:h,points:c};r.prototype.replaceInSceneNew=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);if(-1!=i)this._primitivesWaitingToBeAddedToTheScene[i]=t;else{e.ID!==t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),this.addToScene(t);var r=t.ID.split(":")[0],o=p[r];o?o(t,e):(console.log("Error updating layer"),this.viewer.scene.primitives.remove(e))}};var t=!(r.prototype.update=function(e){this._quadtree.beginFrame(e),this._quadtree.render(e),this._quadtree.endFrame(e)});return r.prototype.initialize=function(e){t||(this.viewer.scene.preRender.addEventListener(this.onPreFrame,this),t=!0)},r.prototype.beginUpdate=function(e){this.quadtree.beginFrame(e)},r.prototype.endUpdate=function(e){var t=this;e.afterRender.push(function(){t.quadtree.endFrame(e)})},r.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)},r.prototype.loadTile=function(e,t){var i=this;if(null==this._numTilesInLevel[t._level]&&(this._numTilesInLevel[t._level]=0),this._numTilesInLevel[t._level]++,t.state===Cesium.QuadtreeTileLoadState.START){t.data={primitive:new Cesium.PrimitiveCollection,wfsLayerData:[],id:Cesium.createGuid(),freeResources:function(){if(i._tileCache[t.data.id]&&i._numTilesInLevel[t._level]--,i._numTilesInLevel[t._level]<0&&(i._numTilesInLevel[t._level]=0),Cesium.defined(this.wfsLayerData)){for(var e in this.wfsLayerData)Cesium.defined(this.wfsLayerData[e])&&this.wfsLayerData[e].freeResources();this.wfsLayerData=void 0}Cesium.defined(this.primitive)&&(this.primitive.destroy(),this.primitive=void 0),delete i._tileCache[t.data.id]}},this._tileCache[t.data.id]=t;Math.abs(6371e3*(t.rectangle.south-t.rectangle.north));t.data.boundingSphere3D=Cesium.BoundingSphere.fromRectangle3D(t.rectangle),t.data.boundingSphere2D=Cesium.BoundingSphere.fromRectangle2D(t.rectangle,e.mapProjection);t.rectangle.west,t.rectangle.south,t.rectangle.east,t.rectangle.north;this.loadTileEvent.raiseEvent(t),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0}},r.prototype.computeTileVisibility=function(e,t,i){var r=this.computeDistanceToTile(e,t);if(e._distance=r,t.fog.enabled&&1<=Cesium.Math.fog(r,t.fog.density))return Cesium.Visibility.NONE;var o=e.data;o.tileBoundingRegion;if(void 0===o.boundingVolumeSourceTile)return Cesium.Visibility.PARTIAL;var n=t.cullingVolume,a=o.orientedBoundingBox;!a&&o.renderedMesh&&(a=o.renderedMesh.boundingSphere3D),o.clippedByBoundaries=!1;var s=function(e,t){if(t.west<t.east)return t;var i=Rectangle.clone(t,splitCartographicLimitRectangleScratch);return 0<Rectangle.center(e,rectangleCenterScratch).longitude?i.east=CesiumMath.PI:i.west=-CesiumMath.PI,i}(e.rectangle,this.cartographicLimitRectangle),l=new Cesium.Rectangle,u=Cesium.Rectangle.simpleIntersection(s,e.rectangle,l);if(!u)return Visibility.NONE;if(Cesium.Rectangle.equals(u,e.rectangle)||(o.clippedByBoundaries=!0),t.mode,Cesium.SceneMode.SCENE3D,!a)return Cesium.Intersect.INTERSECTING;var c=this._clippingPlanes;if(c&&c.enabled){var h=c.computeIntersectionWithBoundingVolume(a);if(e.isClipped=h!==Intersect.INSIDE,h===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE}var d=n.computeVisibility(a);if(d===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE;var m=t.mode===Cesium.SceneMode.SCENE3D&&t.camera.frustum instanceof Cesium.OrthographicFrustum;if(t.mode!==Cesium.SceneMode.SCENE3D||m||!i)return d;var p=o.occludeePointInScaledSpace;return p?i.ellipsoid.isScaledSpacePointVisible(p)?d:Cesium.Visibility.NONE:d},r.prototype.canRefine=function(e,t,i){return e.level<16},r.prototype.showTileThisFrame=function(e,t,i,r){e.data.geometryPrimitive&&e.data.geometryPrimitive.update(t,i,r)},r.prototype.computeDistanceToTile=function(e,t){var i,r,o,n,a,s,l,u,c,h,d=(i=e,this.terrainProvider,void 0===(r=i.data)&&(r=i.data=new Cesium.GlobeSurfaceTile),void 0===r.tileBoundingRegion&&(r.tileBoundingRegion=new Cesium.TileBoundingRegion({computeBoundingVolumes:!1,rectangle:i.rectangle,ellipsoid:i.tilingScheme.ellipsoid,minimumHeight:0,maximumHeight:0})),i),m=e.data,p=m.tileBoundingRegion;if(void 0===d)return 9999999999;if(m.boundingVolumeSourceTile!==d){m.boundingVolumeSourceTile=d;var g=e.rectangle;g&&g.width<Cesium.Math.PI_OVER_TWO+Cesium.Math.EPSILON5&&(m.orientedBoundingBox=Cesium.OrientedBoundingBox.fromRectangle(e.rectangle,p.minimumHeight,p.maximumHeight,e.tilingScheme.ellipsoid,m.orientedBoundingBox),m.occludeePointInScaledSpace=(o=this,n=m.orientedBoundingBox.center,a=e.rectangle,s=p.maximumHeight,l=m.occludeePointInScaledSpace,u=o.quadtree._occluders.ellipsoid,c=u.ellipsoid,h=[new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3],Cesium.Cartesian3.fromRadians(a.west,a.south,s,c,h[0]),Cesium.Cartesian3.fromRadians(a.east,a.south,s,c,h[1]),Cesium.Cartesian3.fromRadians(a.west,a.north,s,c,h[2]),Cesium.Cartesian3.fromRadians(a.east,a.north,s,c,h[3]),u.computeHorizonCullingPoint(n,h,l)))}var f=p.minimumHeight,v=p.maximumHeight;if(m.boundingVolumeSourceTile!==e){var _=t.camera.positionCartographic.height,y=Math.abs(_-f);Math.abs(_-v)<y?(p.minimumHeight=f,p.maximumHeight=f):(p.minimumHeight=v,p.maximumHeight=v)}var C=p.distanceToCamera(t);return p.minimumHeight=f,p.maximumHeight=v,C},r.prototype.isDestroyed=function(){return!1},r.prototype.destroy=function(){return Cesium.destroyObject(this)},r.prototype.remove=function(){this.destroy()},r.prototype.getInstance=function(e){if(0==Cesium.defined(e.TileManager)){var t=new r;(e.TileManager=t).viewer=e;var i=new Cesium.QuadtreePrimitive({tileProvider:e.TileManager,maximumScreenSpaceError:2});e.scene.primitives.add(i)}return e.TileManager},r}),define("SGWorld/wfs/WorkerPool",[],function(){"use strict";var e=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(e){if(e=e||[],!Cesium.defined(e.workerPath))throw new Cesium.DeveloperError("workerPath is required.");this._workerPath=e.workerPath,this._poolSize=Cesium.defaultValue(e.poolSize,16),this._workers=[],this._defered=[]});return Object.defineProperties(e.prototype,{errorEvent:{get:function(){return this.errorEvent}},poolSize:{get:function(){return this._poolSize}}}),e.prototype.queueWorkItem=function(e,t){for(var i=Cesium.when.defer(),r=null,o=999999,n=0;n<this._workers.length;n++){r=this._workers[n];this._workers[n].jobQueueSize<o&&(r=this._workers[n],o=this._workers[n].jobQueueSize)}if(0<o&&this._workers.length<this.poolSize){r=new Worker(this._workerPath);var a=this;r.addEventListener("message",function(e){a.onWorkerMessage(e)},!1),r.addEventListener("error",function(e){a.onWorkerError(e)},!1),r.jobQueueSize=0,this._workers.push(r),r.id=Cesium.createGuid()}e.workerId=r.id;var s=Cesium.createGuid();return e.deferedId=s,this._defered[s]=i,r.jobQueueSize++,r.postMessage(e,t),i},e.prototype.trimPool=function(e){var t=this;if(null==e)return null!=this.timerId&&clearTimeout(this.timerId),void(this.timerId=setTimeout(function(){t.trimPool(!0)},5e3));for(var i=0;i<this._workers.length;i++)0==this._workers[i].jobQueueSize&&(this._workers[i].terminate(),this._workers.splice(i,1),i--);this._workers.length?this.timerId=setTimeout(function(){t.trimPool(!0)},5e3):this.timerId=null},e.prototype.onWorkerMessage=function(e){var t=e.data,i=function(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return i}(this._workers,function(e){return e.id===t.workerId});null!=i&&(this._workers[i].jobQueueSize--,this.trimPool());var r=this._defered[t.deferedId];delete this._defered[t.deferedId],r.resolve(t)},e.prototype.onWorkerError=function(e){console.log(e)},e}),define("SGWorld/wfs/SimpleSqlParser",[],function(e){"use strict";function t(){}function p(e){return"string"==typeof e?e.replace(/^\s+/g,"").replace(/\s+$/g,""):e}function g(t,e){for(var i=!1,r=0,o="",n=0;n<e.length;n++)!i&&/['"`]/.test(e[n])?i=e[n]:i&&e[n]==i?i=!1:i||"("!=e[n]?!i&&")"==e[n]&&r--:r++,e[n]==t&&(0<r||i)?o+="######":o+=e[n];return e=(e=(e=o).split(t)).map(function(e){return p(e.replace(new RegExp("######","g"),t))})}function f(e){for(var t="#",i=e.length,r=0;r<i;r++)t+=e[r]+"#";return t}function v(e){for(var t="",i=e.length,r=1;r<i;r+=2)t+=e[r];return t}function o(e){this.source=e,this.cursor=0,this.currentChar="",this.readNextChar()}function _(e){this.lexer=new o(e),this.currentToken="",this.readNextToken()}function n(e,t){var i="";return void 0!==e.logic?(i=(i=e.terms.map(function(e){return n(e,!0)})).join(" "+e.logic+" "),void 0!==t&&(i="("+i+")")):void 0!==e.left?(i=e.left,void 0!==e.operator&&(i+=" "+e.operator,void 0!==e.right&&("IN"===e.operator?i+=" ("+e.right+")":i+=" "+e.right))):i=e,i}return t.sql2ast=function(o,e){function n(e,t){return t}null==e&&(e=!0);var t="###semi-colon###";o=(o=(o=(o=o.replace(/[("'`].*;.*[)"'`]/g,function(e){return e.replace(/;/g,t)})).replace(/;/g,"###EOR###")).split("###EOR###")[0]).replace(new RegExp(t,"g"),";");var i=["SELECT","FROM","DELETE FROM","INSERT INTO","UPDATE","JOIN","LEFT JOIN","RIGHT JOIN","INNER JOIN","ORDER BY","GROUP BY","HAVING","WHERE","LIMIT","VALUES","SET"],r=i.map(function(e){return e+" "}),a=(r=(r=r.concat(i.map(function(e){return e+"("}))).concat(r.map(function(e){return e.toLowerCase()}))).map(function(e){return e.replace("(","[\\(]")});o=o.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(e){return e.replace(new RegExp(a.join("|"),"gi"),f)});var s=[];r.forEach(function(e){var t,i=0;do{if(-1!=(t=o.indexOf(e,i))){var r=e.replace(/^((\w|\s)+?)\s?\(?$/i,n);i=t+(s[t]=r).length}}while(-1!=t)});var l=0;s.forEach(function(e,t){t<l?delete s[t]:(l=parseInt(t,10)+e.length,"JOIN"==e&&(s[t]="INNER JOIN"))});var u=a.slice(0);u=(u=u.map(function(e){return f(e)})).join("|");var c=o.split(new RegExp(a.join("|"),"i"));o=o.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(e){return e.replace(new RegExp(u,"gi"),v)}),c=c.map(function(e){return e.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(e){return e.replace(new RegExp(u,"gi"),v)})});var h=[];h.SELECT=function(e){var t=g(",",e);return t=t.filter(function(e){return""!==e}).map(function(e){return{name:e}})},h.SET=function(e){var t=g(",",e);return t=t.filter(function(e){return""!==e}).map(function(e){return{expression:e}})},h.FROM=h["DELETE FROM"]=h.UPDATE=function(e){var i=e.split(",");return(i=i.map(function(e){return p(e)})).forEach(function(e,t){""===e&&i.splice(t)}),i=i.map(function(e){var t=e.split(" AS "),i=t[1]||"";return 0===i.indexOf('"')&&i.lastIndexOf('"')==i.length-1&&(i=i.substring(1,i.length-1)),{table:t[0],as:i}})},h["LEFT JOIN"]=h.JOIN=h["INNER JOIN"]=h["RIGHT JOIN"]=function(e){var t=(e=e.split(" ON "))[0].split(" AS "),i={};return i.table=p(t[0]),i.as=p(t[1])||"",i.cond=p(e[1]),i},h.WHERE=function(e){return p(e)},h["ORDER BY"]=function(e){e=e.split(",");var o=[];return e.forEach(function(e,t){var i=/([A-Za-z0-9_\.]+)\s*(ASC|DESC){0,1}/gi;if(null!==(i=i.exec(e))){var r={};r.column=p(i[1]),r.order=p(i[2]),void 0===i[2]&&(r.order="ASC"),o.push(r)}}),o},h["GROUP BY"]=function(e){e=e.split(",");var o=[];return e.forEach(function(e,t){var i=/([A-Za-z0-9_\.]+)/gi;if(null!==(i=i.exec(e))){var r={};r.column=p(i[1]),o.push(r)}}),o},h.LIMIT=function(e){var t=/((\d+)\s*,\s*)?(\d+)/gi;void 0===(t=t.exec(e))[2]&&(t[2]=0);var i={};return i.nb=parseInt(p(t[3]),10),i.from=parseInt(p(t[2]),10),i},h["INSERT INTO"]=function(e){var t=/([A-Za-z0-9_\.]+)\s*(\(([A-Za-z0-9_\., ]+)\))?/gi;t=t.exec(e);var i={};return i.table=p(t[1]),void 0!==t[3]&&(i.columns=t[3].split(","),i.columns=i.columns.map(function(e){return p(e)})),i},h.VALUES=function(e){"("!=(e=p(e))[0]&&(e="("+e);var t=g(",",e),i=[];return t.forEach(function(e){e=g(",",e=e.replace(/^\(/g,"").replace(/\)$/g,"")),i.push(e)}),i};var d={},m=0;return s.forEach(function(e,t){if(e=e.toUpperCase(),m++,void 0!==h[e]){var i=h[e](c[m]);if(void 0!==d[e]){if("string"==typeof d[e]||void 0===d[e][0]){var r=d[e];d[e]=[],d[e].push(r)}d[e].push(i)}else d[e]=i}else console.log("Can't analyze statement \""+e+'"')}),void 0!==d["LEFT JOIN"]&&(void 0===d.JOIN&&(d.JOIN=[]),void 0!==d["LEFT JOIN"][0]?d["LEFT JOIN"].forEach(function(e){e.type="left",d.JOIN.push(e)}):(d["LEFT JOIN"].type="left",d.JOIN.push(d["LEFT JOIN"])),delete d["LEFT JOIN"]),void 0!==d["INNER JOIN"]&&(void 0===d.JOIN&&(d.JOIN=[]),void 0!==d["INNER JOIN"][0]?d["INNER JOIN"].forEach(function(e){e.type="inner",d.JOIN.push(e)}):(d["INNER JOIN"].type="inner",d.JOIN.push(d["INNER JOIN"])),delete d["INNER JOIN"]),void 0!==d["RIGHT JOIN"]&&(void 0===d.JOIN&&(d.JOIN=[]),void 0!==d["RIGHT JOIN"][0]?d["RIGHT JOIN"].forEach(function(e){e.type="right",d.JOIN.push(e)}):(d["RIGHT JOIN"].type="right",d.JOIN.push(d["RIGHT JOIN"])),delete d["RIGHT JOIN"]),e&&("string"==typeof d.WHERE&&(d.WHERE=_.parse(d.WHERE)),void 0!==d.JOIN&&d.JOIN.forEach(function(e,t){d.JOIN[t].cond=_.parse(e.cond)})),d},o.prototype={constructor:o,readNextChar:function(){"string"!=typeof this.source?this.currentChar="":this.currentChar=this.source[this.cursor++]||""},readNextToken:function(){return/\w|[-]/.test(this.currentChar)?this.readWord():/["'`]/.test(this.currentChar)?this.readString():/[()]/.test(this.currentChar)?this.readGroupSymbol():/[!=<>]/.test(this.currentChar)?this.readOperator():""===this.currentChar?{type:"eot",value:""}:(this.readNextChar(),{type:"empty",value:""})},readWord:function(){for(var e="",t=0,i=!1;/./.test(this.currentChar);){if(!i&&/['"`]/.test(this.currentChar))i=this.currentChar;else if(i&&this.currentChar==i)i=!1;else{if(!i){if(")"==this.currentChar&&t<=0)break;if("("==this.currentChar?t++:")"==this.currentChar&&t--,/[!=<>]/.test(this.currentChar))break}if(" "==this.currentChar&&t<=0)break}e+=this.currentChar,this.readNextChar()}return/^(AND|OR)$/i.test(e)?{type:"logic",value:e}:/^(IN|IS|NOT|LIKE)$/i.test(e)?{type:"operator",value:e}:{type:"word",value:e}},readString:function(){var e="",t=this.currentChar;for(e+=this.currentChar,this.readNextChar();this.currentChar!=t&&""!==this.currentChar;)e+=this.currentChar,this.readNextChar();return e+=this.currentChar,this.readNextChar(),"."==this.currentChar?(e+=this.currentChar,this.readNextChar(),{type:"word",value:e+=this.readString().value}):{type:"string",value:e}},readGroupSymbol:function(){var e=this.currentChar;return this.readNextChar(),{type:"group",value:e}},readOperator:function(){var e=this.currentChar;return this.readNextChar(),/[=<>]/.test(this.currentChar)&&(e+=this.currentChar,this.readNextChar()),{type:"operator",value:e}}},o.tokenize=function(e){var t=new o(e),i=[];do{var r=t.readNextToken();"empty"!=r.type&&i.push(r)}while(t.currentChar);return i},_.prototype={constructor:_,readNextToken:function(){for(this.currentToken=this.lexer.readNextToken();"empty"==this.currentToken.type;)this.currentToken=this.lexer.readNextToken();return this.currentToken},parseExpressionsRecursively:function(){return this.parseLogicalExpression()},parseLogicalExpression:function(){for(var e=this.parseConditionExpression();"logic"==this.currentToken.type;){var t=this.currentToken.value;this.readNextToken();var i=this.parseConditionExpression();if(void 0!==e.logic&&e.logic==t&&void 0!==e.terms)e.terms.push(i);else e={logic:t,terms:[e,i].slice(0)}}return e},parseConditionExpression:function(){var e=this.parseBaseExpression();if("operator"==this.currentToken.type){var t=this.currentToken.value;this.readNextToken(),"operator"==this.currentToken.type&&(t+=" "+this.currentToken.value,this.readNextToken()),e={operator:t,left:e,right:this.parseBaseExpression()}}return e},parseBaseExpression:function(){var e="";return"word"==this.currentToken.type||"string"==this.currentToken.type?(e=this.currentToken.value,this.readNextToken()):"group"==this.currentToken.type&&(this.readNextToken(),e=this.parseExpressionsRecursively(),this.readNextToken()),e}},_.parse=function(e){return new _(e).parseExpressionsRecursively()},t.ast2sql=function(e){function t(e){return void 0!==e.WHERE?" WHERE "+n(e.WHERE):""}var i,r;return void 0!==e.SELECT&&void 0!==e.FROM?(void 0!==(r=e).SELECT?"SELECT "+r.SELECT.map(function(e){return e.name}).join(", "):"")+function(e){if(void 0===e.FROM)return"";var t=" FROM ";return t+=e.FROM.map(function(e){var t=e.table;return""!==e.as&&(t+=" AS "+e.as),t}).join(", ")}(e)+function(e){if(void 0===e.JOIN)return"";var t="";return e.JOIN.forEach(function(e){t+=" "+e.type.toUpperCase()+" JOIN "+e.table,""!==e.as&&(t+=" AS "+e.as),t+=" ON "+n(e.cond)}),t}(e)+t(e)+function(e){if(void 0===e["GROUP BY"])return"";var t=" GROUP BY ";return t+=e["GROUP BY"].map(function(e){return e.column}).join(", ")}(e)+function(e){if(void 0===e["ORDER BY"])return"";var t=" ORDER BY ";return t+=e["ORDER BY"].map(function(e){return e.column+" "+e.order}).join(", ")}(e)+function(e){if(void 0!==e.LIMIT&&void 0!==e.LIMIT.nb&&0<parseInt(e.LIMIT.nb,10)){var t=" LIMIT ";return void 0!==e.LIMIT.from&&1<parseInt(e.LIMIT.from,10)&&(t+=e.LIMIT.from+","),t+=e.LIMIT.nb}return""}(e):void 0!==e["INSERT INTO"]?function(e){if(void 0===e["INSERT INTO"])return"";var t="INSERT INTO "+e["INSERT INTO"].table;return void 0!==e["INSERT INTO"].columns&&(t+=" (",t+=e["INSERT INTO"].columns.join(", "),t+=")"),t}(e)+function(e){if(void 0===e.VALUES)return"";var t=" VALUES ";return t+=e.VALUES.map(function(e){return"("+e.join(", ")+")"}).join(", ")}(e):void 0!==e.UPDATE?function(e){if(void 0===e.UPDATE)return"";var t="UPDATE ";return t+=e.UPDATE.map(function(e){var t=e.table;return""!==e.as&&(t+=" AS "+e.as),t}).join(", ")}(e)+(void 0!==(i=e).SET?" SET "+i.SET.map(function(e){return e.expression}).join(", "):"")+t(e):void 0!==e["DELETE FROM"]?function(e){if(void 0===e["DELETE FROM"])return"";var t="DELETE FROM ";return t+=e["DELETE FROM"].map(function(e){var t=e.table;return""!==e.as&&(t+=" AS "+e.as),t}).join(", ")}(e)+t(e):null},t.trim=p,t.protect=f,t.unprotect=v,t.protect_split=g,t.CondLexer=o,t.CondParser=_,t}),define("SGWorld/wfs/EntityCreator",[],function(){"use strict";function _(e){return 3*e/4}function x(e){var t,i=0;if(0===e.length)return i;for(t=0;t<e.length;t++)i=(i<<5)-i+e.charCodeAt(t),i|=0;return i}function o(e){for(var t=[],i=0;i<e.length;i++)for(var r=0;r<e[i].positions.length;r+=3)t.push(Cesium.Cartographic.fromDegrees(e[i].positions[r+0],e[i].positions[r+1],0));return t}function n(e,t,i,r){for(var o,n=0,a=0;a<e.length;a++){o=r?p:i(e[a]);for(var s=2;s<e[a].positions.length;s+=3){null==t[n].height&&(t[n].height=0),null==e[a].absoluteHeightPositions&&(e[a].absoluteHeightPositions=[]),e[a].absoluteHeightPositions[s-2]=e[a].positions[s-2],e[a].absoluteHeightPositions[s-1]=e[a].positions[s-1],e[a].absoluteHeightPositions[s-0]=e[a].positions[s-0];var l=r?0:e[a].positions[s];e[a].absoluteHeightPositions[s]=l+t[n].height+o,n++}}}function e(e,t){this._style=e||{},t.scene.onHoverShowTextArray={},t.scene._lastObjectShowOnText=null,this.setEyeOffset=function(e,t){void 0===t&&(t=0),e.eyeOffset=Cesium.DynamicEyeOffset(t)},this.viewer=t}function a(e,t){for(var i=e.length,r=0;r<i;r++){var o=t(e[r]);if("polygon"==e[r].geometryType||"multipolygon"==e[r].geometryType){for(var n=e[r],a=n.positions.length,s=0;s<a;s++){for(var l=n.positions[s],u=2;u<l.length;u+=3)l[u]+=o;n.positions[s]=l}e[r]=n}else{var c=e[r],h=c.positions.length;for(s=2;s<h;s+=3)c.positions[s]+=o;e[r]=c}}return e}function T(e,t){if(null==e.isQuery)if(null==e.originalInstanceIds){if(e.parentLayer.isExistRenderedFeatureId(t))return!1}else if(-1==e.originalInstanceIds.indexOf(t))return!1;return!0}function s(i){return function(e){var t=Number(i.applyConditionalClassification(i._style.altitudeOffset,e.attributes));return isNaN(t)&&(t=0),t}}function l(e){if("string"!=typeof e)return e;var t=Number(e);if(isNaN(t))return e;var i=t.toString(16);if(i.length<6&&null!=i)for(var r=i.length;r<6;)i="0"+i,r++;var o="#"+i,n=Cesium.Color.fromCssColorString(o);if(null!=n){var a=n.red;n.red=n.blue,n.blue=a}return n}function y(e){if(null!=e){var t=parseInt(e);if(null!=e.alpha||isNaN(t))return e;t<0&&(t&=16777215);var i=t.toString(16);if(i.length<6&&null!=i)for(var r=i.length;r<6;)i="0"+i,r++;var o="#"+i;o=o.substring(0,7);var n=Cesium.Color.fromCssColorString(o);if(null!=n){var a=n.red;n.red=n.blue,n.blue=a}return n}}function u(e){return isNaN(e)?e:parseFloat(e)}function c(e,i){var t,r=[];return $.each(e.attributeNames,function(e,t){r.push(u(i[t]))}),1===r.length?t=e.func(r[0]):2===e.attributeNames.length?t=e.func(r[0],r[1]):3===e.attributeNames.length?t=e.func(r[0],r[1],r[2]):4===e.attributeNames.length&&(t=e.func(r[0],r[1],r[2],r[3])),t}function h(e,t,i){return e.replace(new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),i)}var d=o,m=n,p=1;Object.defineProperties(e.prototype,{style:{get:function(){return this._style},set:function(e){this._style=e}}}),e.prototype.clonePartOfMultiFeature=function(e,t){return{positions:e.positions[t],attributes:e.attributes,fid:e.fid,geometryType:e.geometryType}},e.prototype.createPrimitiveFromWFSFeatures=function(e){new Cesium.PrimitiveCollection;for(var t=[],i=[],r=[],o=e.features.numPositions=0;o<e.features.length;o++){var n=e.features[o];switch(this.sanitizePositions(n.positions),e.features.numPositions+=n.positions.length,n.geometryType){case"polygon":t.push(n);break;case"multipolygon":for(var a=n.positions.length,s=0;s<a;s++)t.push(this.clonePartOfMultiFeature(n,s));break;case"linestring":i.push(n);break;case"multilinestring":for(a=n.positions.length,s=0;s<a;s++)i.push(this.clonePartOfMultiFeature(n,s));break;case"point":r.push(n);break;case"multipoint":for(a=n.positions.length,s=0;s<a;s++)r.push(this.clonePartOfMultiFeature(n,s))}}0<t.length?(e.features=t,this.createPolygonPrimitive(e)):0<i.length?(e.features=i,this.createLinestringPrimitive(e)):0<r.length&&(e.features=r,this.createPointPrimitive(e))},e.prototype.createPolygonPrimitive=function(i){var f=this,r=function(e){if(e.isQuery)e.onFinishedQuery(i);else{for(var t="",i=[],r=[],o=[],n=[],a=[],s=0;s<e.features.length;s++){var l=e.features[s];if(T(e,l.fid)){var u=l.absoluteHeightPositions?l.absoluteHeightPositions:l.positions,c=f.createPolygonOptions(u,l.attributes),h=f.createCommonOptions(l.attributes);if(l.absoluteHeightPositions&&delete l.absoluteHeightPositions,i.push(Cesium.BoundingSphere.fromPoints(c.hierarchy.positions)),!e.isQuery){if(c.outline){var d=f.createPolygonGeometryHelper(Cesium.PolygonOutlineGeometry,l,c.hierarchy,c.outlineColor,c.perPositionHeight,c.extrudedHeight,c.height);o.push(d)}if(c.fill){d=f.createPolygonGeometryHelper(Cesium.PolygonGeometry,l,c.hierarchy,c.material,c.perPositionHeight,c.extrudedHeight,c.height,c.wather);r.push(d)}e.parentLayer.addRenderedFeatureId(l.fid),t+=l.fid+";",n.push(l.fid),a.push(h.tooltip)}}}if(""!=t){var m,p=new Cesium.PrimitiveCollection,g=new Cesium.PerInstanceColorAppearance({flat:!0,translucent:c.material.alpha<1});new Cesium.PerInstanceColorAppearance({flat:!0,translucent:c.material.alpha<1});if(0<r.length)c.wather&&(g=new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Water",uniforms:{baseWaterColor:c.watherColor||new Cesium.Color(0,0,1,.5),blendColor:c.watherColor||new Cesium.Color(0,0,1,.5),normalMap:c.wather,frequency:c.frequency||1e3,animationSpeed:c.watherSpeed||.01,amplitude:c.amplitude||10}}})})),((m=c.clampToGround?new Cesium.GroundPrimitive({geometryInstances:r,appearance:g}):new Cesium.Primitive({geometryInstances:r,appearance:g}))._parentCollection=p).add(m);if(0<o.length)if(!c.clampToGround)((m=new Cesium.Primitive({geometryInstances:o,appearance:g}))._parentCollection=p).add(m);p.ID="polygons:"+x(t),p._instanceIds=n,p._tooltips=a,e.onFinishedCreatePrimitive(p,i)}}};if(3==this.style.altitudeMethod)i.features=a(i.features,s(f)),r(i);else{!0;var e=function(e){for(var t=[],i=e.length,r=0;r<i;r++)for(var o=e[r],n=o.positions.length,a=0;a<n;a++)for(var s=o.positions[a],l=0;l<s.length;l+=3)t.push(Cesium.Cartographic.fromDegrees(s[l+0],s[l+1],0));return t}(i.features),t=Cesium.sampleRenderedData(e,Cesium.SampleRenderedDataFlags.TERRAIN|Cesium.SampleRenderedDataFlags.FLOOR);Cesium.when(t,function(e){var t=2==f._style.altitudeMethod;(function(e,t,i,r){for(var o,n=0,a=0;a<e.length;a++){var s=e[a];o=r?p:i(s),null==s.absoluteHeightPositions&&(s.absoluteHeightPositions=[]);for(var l=0;l<s.positions.length;l++)for(var u=s.positions[l],c=s.absoluteHeightPositions[l]=[],h=2;h<u.length;h+=3){var d=r?0:u[h];null==t[n].height&&(t[n].height=0),c[h-2]=u[h-2],c[h-1]=u[h-1],c[h-0]=u[h-0],c[h]=d+t[n].height+o,n++}}})(i.features,e,s(f),t),r(i)})}},e.prototype.createPolygonGeometryHelper=function(e,t,i,r,o,n,a,s){var l=null!=n?Cesium.PerInstanceColorAppearance.VERTEX_FORMAT:Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT;(void 0!==s||void 0!==a)&&(l=Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT);var u=new e({polygonHierarchy:i,vertexFormat:l,perPositionHeight:void 0!==a?void 0:o,extrudedHeight:n,height:a});return new Cesium.GeometryInstance({geometry:u,id:t,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}})},e.prototype.createLinestringPrimitive=function(i){var f=this,r=function(e){if(e.isQuery)e.onFinishedQuery(r);else{for(var t,i="",r=[],o=[],n=[],a=new Cesium.PrimitiveCollection,s=0;s<e.features.length;s++){var l=e.features[s];if(T(e,l.fid)){var u=l.absoluteHeightPositions?l.absoluteHeightPositions:l.positions,c=f.createLinestringOptions(u,l.attributes),h=f.createCommonOptions(l.attributes);if(c.vertexFormat=t?Cesium.PerInstanceColorAppearance.VERTEX_FORMAT:Cesium.PolylineColorAppearance.VERTEX_FORMAT,l.absoluteHeightPositions&&delete l.absoluteHeightPositions,r.push(Cesium.BoundingSphere.fromPoints(c.positions)),!e.isQuery){var d,m;m=c.clampToGround?(d=new Cesium.GroundPolylineGeometry({positions:c.positions,width:c.width}),new Cesium.GeometryInstance({id:l,geometry:d,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(c.material)}})):(d=new Cesium.PolylineGeometry(c),new that._cesium.GeometryInstance({id:l,geometry:d,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(c.material)}})),e.parentLayer.addRenderedFeatureId(l.fid),i+=l.fid+";",o.push(l.fid),n.push(h.tooltip);var p=null;p=c.clampToGround?new Cesium.GroundPolylinePrimitive({geometryInstances:m,appearance:new Cesium.MaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:c.material}}}),faceForward:!0,flat:!1})}):new Cesium.Primitive({geometryInstances:m,appearance:new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:c.material}}})})}),a.add(p)}}}if(""!=i){var g=a;g.ID="polylines:"+x(i),g._instanceIds&&0===g._instanceIds.length&&(g._instanceIds=o),g._tooltips=n,e.onFinishedCreatePrimitive(g,r)}}};if(3==this.style.altitudeMethod)i.features=a(i.features,s(f)),r(i);else{!0;var e=o(i.features),t=Cesium.sampleRenderedData(e,Cesium.SampleRenderedDataFlags.TERRAIN|Cesium.SampleRenderedDataFlags.FLOOR);Cesium.when(t,function(e){var t=2==f._style.altitudeMethod;n(i.features,e,s(f),t),r(i)})}},e.prototype.createPointPrimitive=function(i){var P=this,r=function(e){if(e.isQuery)e.onFinishedQuery(o);else{for(var t,i="",r=[],o=[],n=[],a=new Cesium.LabelCollection({scene:P.viewer.scene}),s=new Cesium.PointPrimitiveCollection({scene:P.viewer.scene}),l=new Cesium.BillboardCollection({scene:P.viewer.scene}),u=new Cesium.PrimitiveCollection,c=new Cesium.PolylineCollection,h=0;h<e.features.length;h++){var d=e.features[h];if(T(e,d.fid)){var m=d.absoluteHeightPositions?d.absoluteHeightPositions:d.positions,p=P.createPointOptions(m,d.attributes),f=P.createCommonOptions(d.attributes);if(d.clampToGround=p.clampToGround,p.sgsPointPosition&&(d.sgsPointPosition=p.sgsPointPosition,delete p.sgsPointPosition),d.absoluteHeightPositions&&delete d.absoluteHeightPositions,o.push(Cesium.BoundingSphere.fromPoints([p.position])),!e.isQuery){if(p.label)if(p.label.position=p.position,p.label.id=d,P.setEyeOffset(p.label),null!=p.label.imageFile&&(p.label.image=P.applyConditionalClassification(p.label.imageFile,d.attributes),p.label.label=p.label,l.add(p.label),P.setEyeOffset(p.label,-5)),null!=p.label.imageFile&&null!=p.label.showText&&p.label.showText&&(P.viewer.scene.onHoverShowTextArray[p.label.id]=!0),null!=p.label.isBold&&p.label.isBold)a.add(g);else if(null!=p.label.isUnderline&&p.label.isUnderline){var v=null!=p.label.text.match(/[iljf1]/g)?p.label.text.match(/[iljf1]/g):[],_=p.label.text.length,y=Array(Math.ceil(_-.5*v.length)).join("_");t=$.extend({},p.label),null!=p.label.image&&delete p.label.image,t.position=p.label.position,t.id=p.label.id,t.text=y,t.alignment=null!=p.label.alignment?p.label.alignment:void 0,t.underline=!0,t.textRelativeToImage=null!=p.label.textRelativeToImage?p.label.textRelativeToImage:void 0;-1<p.label.font.indexOf("pt")?Number(p.label.font.split("pt")[0]):-1<p.label.font.indexOf("px")&&Number(p.label.font.split("px")[0]);t.pixelOffset=new Cesium.Cartesian2(0,-45),a.add(t)}else a.add(p.label);if(p.billboard&&(p.billboard.position=p.position,p.billboard.id=d,P.setEyeOffset(p.billboard),l.add(p.billboard)),p.model){p.model.url=p.model.uri,p.model.id=d;u.add(Cesium.Model.fromGltf(p.model))}if(p.point&&(p.point.position=p.position,p.point.id=d,P.setEyeOffset(p.point),s.add(p.point)),0!=p.lineToGround){var C=Cesium.Cartographic.fromCartesian(p.position),w=Cesium.Cartesian3.fromRadians(C.longitude,C.latitude,0);if(2==p.lineToGround){var b=p.lineToGroundLength/Cesium.Cartesian3.distance(p.position,w);Cesium.Cartesian3.lerp(p.position,w,b,w)}c.add({show:!0,width:1,positions:[p.position,w],material:Cesium.Material.fromType("Color",{color:p.lineToGroundColor})})}e.parentLayer.addRenderedFeatureId(d.fid),i+=d.fid+";",r.push(d.fid),n.push(f.tooltip)}}}if(""!=i){var E,S=new Cesium.PrimitiveCollection;0<a.length&&($.each(a._labels,function(e,t){t._type="Label"}),(a._billboardCollection._parentCollection=S).add(a),E="labels"),0<l.length&&($.each(l._billboards,function(e,t){t._type="Billboard"}),(l._parentCollection=S).add(l),E="billboards"),0<u.length&&($.each(u._primitives,function(e,t){t._type="Model",t._parentCollection=S}),S.add(u),E="models"),0<s.length&&($.each(s._pointPrimitives,function(e,t){t._type="Point"}),(s._parentCollection=S).add(s),E="points"),0<c.length&&($.each(c._polylines,function(e,t){t._type="L2G"}),(c._parentCollection=S).add(c),E="L2G"),S.ID=E+":"+x(i),S._instanceIds=r,S._tooltips=n,e.onFinishedCreatePrimitive(S,o)}}};if(3==this.style.altitudeMethod)i.features=a(i.features,s(P)),r(i);else{var e=d(i.features),t=Cesium.sampleRenderedData(e);Cesium.when(t,function(e){var t=2==P._style.altitudeMethod;m(i.features,e,s(P),t),r(i)}).otherwise(function(e){})}},e.prototype.createCommonOptions=function(e){var t={};return t.tooltip=this.applyConditionalClassification(this.style.tooltip,e),t},e.prototype.createPolygonOptions=function(e,t){var i=this.getPolygonStyle(this.style);i.polygon.hierarchy={positions:Cesium.Cartesian3.fromDegreesArrayHeights(e[0]),holes:[]};for(var r=1;r<e.length;r++)i.polygon.hierarchy.holes.push({positions:Cesium.Cartesian3.fromDegreesArrayHeights(e[r])});var o=this.applyConditionalClassification(i.polygon.material,t);if(i.polygon.material=l(o),null!=i.polygon.fill&&null!=i.polygon.fromKml){var n=this.applyConditionalClassification(i.polygon.fill,t);1<n&&(n/=100),i.polygon.material=new Cesium.Color(i.polygon.material.red,i.polygon.material.green,i.polygon.material.blue,n)}if(i.polygon.extrudedHeight&&i.polygon.extrudedHeight&&i.polygon.extrudedHeight.indexOf&&-1<i.polygon.extrudedHeight.indexOf("[")&&-1<i.polygon.extrudedHeight.defaultValue.indexOf("]")){o=t[i.polygon.extrudedHeight.defaultValue.substring(1,i.polygon.extrudedHeight.defaultValue.length-1)],o=parseInt(o);void 0!==o&&(i.polygon.extrudedHeight=3*o)}if(t.FSCALE){var a=this.getLevelDistance(t.FSCALE);i.polygon.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,a)}return o=this.applyConditionalClassification(i.polygon.outlineColor,t),i.polygon.outlineColor=l(o),i.polygon},e.prototype.translateLineWidth=function(e,t){var i=this.applyConditionalClassification(e.polyline.width,t);return 0<i?TerraExplorer.USE_CORRIDOR_FOR_LINE_WIDTH_IN_METERS?1<i&&(e.polyline.widthInMeters=!0,i*=.8,0<e.polyline.backgroundOpacity&&(i*=.8)):i=1<i?2:1:i<0?i=Math.min(5,Math.abs(i)):0==i&&(i=1),i},e.prototype.createLinestringOptions=function(e,t){var i=this.getLinestringStyle(this.style);i.id=t,i.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e);var r=this.applyConditionalClassification(i.polyline.material,t);if(i.polyline.material=l(r),null!=i.polyline.lineOpacity){var o=this.applyConditionalClassification(i.polyline.lineOpacity,t);1<o&&(o/=100),i.polyline.material=new Cesium.Color(i.polyline.material.red,i.polyline.material.green,i.polyline.material.blue,o)}if(i.polyline.far&&(i.polyline.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(void 0!==i.polyline.near?i.polyline.near:0,i.polyline.far)),t.FSCALE){var n=this.getLevelDistance(t.FSCALE);i.polyline.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,n)}return i.polyline.width=this.applyConditionalClassification(i.polyline.width,t),i.polyline},e.prototype.applyConditionalClassification=function(e,r){if(null!=e){if(null==e.defaultValue)return e;var o=u(e.defaultValue);if(void 0===e.classificationArray){if(!isNaN(o))return o;if(o instanceof Cesium.Color)return o}if(void 0!==e.attributeName){var t="["+e.attributeName+"]";if(o===t)o=r[e.attributeName];else if(e.multipleAttributeReplacementNeeded)for(name in r)o=h(o,"["+name+"]",r[name]);else o=h(o,t,r[e.attributeName]);return o}if(void 0!==e.classification)return o=c(e.classification,r);var n=e.classificationArray;return void 0!==n&&$(Object.keys(n)).each(function(e,t){var i=function(e,t){if(void 0!==e&&0!==e.condition.length){if(void 0===e.func)return u(e.value);var i=void 0;return!0===c(e,t)&&(i=u(e.value)),i}}(n[t],r);i&&(o=i)}),o}},e.prototype.createLineToGroundOptions=function(e,t){var i=this.applyConditionalClassification(e.lineToGround,t);if(null!=i&&0!=Number(i)){e.lineToGround=i;var r=this.applyConditionalClassification(e.lineToGroundColor,t);r=y(r),e.lineToGroundColor=r;var o=this.applyConditionalClassification(e.lineToGroundLength,t);e.lineToGroundLength=Number(o)}else e.lineToGround=0,e.lineToGroundColor=0,e.lineToGroundLength=0},e.prototype.createPointOptions=function(e,t){var i,r=this.getPointStyle(this.style);if(r.pointHeight?(r.position=Cesium.Cartesian3.fromDegrees(e[0],e[1],r.pointHeight),e[2]=r.pointHeight):r.position=Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),r.sgsPointPosition=e,r.id=t,r.label){var o=r.label.text;if(void 0!==o&&-1<o.defaultValue.indexOf("[")&&-1<o.defaultValue.indexOf("]")){var n=t[o.defaultValue.substring(1,o.defaultValue.length-1)];void 0!==n&&(r.label.text=n)}if(this.applyConditionalClassification(r.label.text,t)?r.label.text=this.applyConditionalClassification(r.label.text,t).toString():r.label.text=this.applyConditionalClassification(r.label.text,t),r.label.text=this.o(r.label.text)?this.s(r.label.text):r.label.text,-1<r.label.text.indexOf("[")&&-1<r.label.text.indexOf("]")&&(r.label.text=""),null!=r.label.family){var a=this.applyConditionalClassification(r.label.family,t),s=this.applyConditionalClassification(r.label.font,t);r.label.font=0<=s?_(s).toString()+"pt "+a:_((i=s,72*i/96*-1)).toString()+"pt "+a}if(r.label.fillColor=y(this.applyConditionalClassification(r.label.fillColor,t)),r.label.backgroundColor=y(this.applyConditionalClassification(r.label.backgroundColor,t)),null==r.label.backgroundColor&&(r.label.backgroundColor=new Cesium.Color(.165,.165,.165,0)),r.label.showBackground=!0,null!=r.label.showText)if((h=this.applyConditionalClassification(r.label.showText,t))&&1===Number(h)&&(r.label.onHoverShowText=!0),h&&null==viewer.scene.canvas.onHoverShowText){var l=viewer.scene;new Cesium.ScreenSpaceEventHandler(l.canvas).setInputAction(function(e){var t={};l.screenToWorld(e.endPosition,t);Cesium.defined(t.pickPrimitive)&&"Billboard"==t.pickPrimitive.constructor.name&&null!=t.pickPrimitive.label?null!=l.onHoverShowTextArray[t.pickPrimitive.label.id]&&(null!=l._lastObjectShowOnText&&l._lastObjectShowOnText.id!=t.pickPrimitive.label.id&&null!=l._lastObjectShowOnText.show&&(l._lastObjectShowOnText.show=!1),viewer.scene._lastObjectShowOnText=l.onHoverShowTextArray[t.pickPrimitive.label.id],null!=l._lastObjectShowOnText.show&&(viewer.scene._lastObjectShowOnText.show=!0)):null!=l._lastObjectShowOnText&&null!=l._lastObjectShowOnText.show&&(l._lastObjectShowOnText.show=!1)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),viewer.scene.canvas.onHoverShowText=!0}if(null!=r.label.textRelativeToImage&&null!=r.label.textAlignment&&(r.label.textRelativeToImage=this.applyConditionalClassification(r.label.textRelativeToImage,t),r.label.alignment=this.applyConditionalClassification(r.label.textAlignment,t)),null!=r.label.underline&&(r.label.isUnderline=this.applyConditionalClassification(r.label.underline,t)),null!=r.label.bold)1==this.applyConditionalClassification(r.label.bold,t)&&(r.label.font="bold "+r.label.font);if(null!=r.label.italic)1==this.applyConditionalClassification(r.label.italic,t)&&(r.label.font="italic "+r.label.font);if(null!=r.label.backgroundOpacity&&(r.label.backgroundColor.alpha=this.applyConditionalClassification(r.label.backgroundOpacity,t)),null!=r.label.minViewingHeight){var u=this.applyConditionalClassification(r.label.minViewingHeight,t),c=650*this.applyConditionalClassification(r.label.scaleMPP,t);r.label.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(u,c)}if(t.FSCALE){var h=this.getLevelDistance(t.FSCALE);r.label.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,h)}!r.label.disableDepthTestDistance&&(r.label.disableDepthTestDistance=1e3),r.clampToGround&&(r.label.heightReference=1)}if(r.billboard){if(r.billboard.sizeInMeters=!1,null!=r.billboard.imageColor){var d=this.applyConditionalClassification(r.billboard.imageColor,t);d=y(d),r.billboard.color=d}if(null!=r.billboard.imageOpacity&&null!=r.billboard.color.alpha&&(r.billboard.color.alpha=Number(this.applyConditionalClassification(r.billboard.imageOpacity,t))),r.billboard.image=this.applyConditionalClassification(r.billboard.image,t),null!=r.billboard.minViewingHeight){u=this.applyConditionalClassification(r.billboard.minViewingHeight,t),c=650*this.applyConditionalClassification(r.billboard.scaleMPP,t);r.billboard.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(u,c)}if(t.FSCALE){h=this.getLevelDistance(t.FSCALE);r.billboard.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,h)}r.billboard.link&&r.id&&"object"===_typeof2(r.id)&&(r.id.link=this.applyConditionalClassification(r.billboard.link,t)),!r.billboard.disableDepthTestDistance&&(r.billboard.disableDepthTestDistance=1e3),r.clampToGround&&(r.billboard.heightReference=1)}if(r.model){var m=function(e){var t=Number(e);return Cesium.defined(t)&&!isNaN(t)||(t=0),t};r.model.uri=this.applyClassification(r.model.uri,t),r.model.scale=m(this.applyClassification(r.model.scale,t));var p=m(this.applyClassification(r.model.heading,t)),g=m(this.applyClassification(r.model.pitch,t)),f=m(this.applyClassification(r.model.roll,t)),v=new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(p),Cesium.Math.toRadians(g),Cesium.Math.toRadians(f));r.model.modelMatrix=Cesium.Transforms.headingPitchRollToFixedFrame(r.position,v)}return this.createLineToGroundOptions(r,t),r},e.prototype.s=function(e){return e.split("").reverse().join("")},e.prototype.getLevelDistance=function(e){var t=2e7;switch(parseInt(e)){case 2:t=10123e3;break;case 3:t=7123e3;break;case 4:t=6321e3;break;case 5:t=5522e3;break;case 6:t=3436e3;break;case 7:t=539e3;break;case 8:t=305e3;break;case 9:t=18e4;break;case 10:t=133e3;break;case 11:t=1e5;break;case 12:t=76500;break;case 13:t=58200;break;case 14:t=23500;break;case 15:t=9600;break;case 16:t=4e3;break;case 17:t=2e3;break;case 18:t=1700;break;case 19:t=1500;break;case 20:t=1e3;break;case 21:t=500;break;case 22:t=200;break;case 23:t=100}return t},e.prototype.o=function(e){if(!e)return e;return new RegExp("^[^A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-﷾--]*[֑-߿יִ-﷽ﹰ-ﻼ]").test(e[0])},e.prototype.applyClassification=function(e,t){if("string"!==$.type(e))return e;if(null!=/(\[([^\]]+)\])/g.exec(e))for(var i in t)e=h(e,"["+i+"]",t[i]);"undefined"==e&&(e="");for(var r=/(\<([^\>]+)\>)/g,o=r.exec(e);null!=o;){try{var n=o[o.length-1],a=(0,eval)(n);e=e.replace(o[0],a)}catch(e){}o=r.exec(e)}return e},e.prototype.getPolygonStyle=function(e){return $.extend(!0,{},t.DEFAULT_POLYGON_STYLE,e)},e.prototype.getLinestringStyle=function(e){return $.extend(!0,{},t.DEFAULT_POLYLINE_STYLE,e)},e.prototype.getPointStyle=function(e){return null!=e.label?$.extend(!0,{},t.DEFAULT_LABEL_STYLE,e):null!=e.billboard?$.extend(!0,{},t.DEFAULT_BILLBOARD_STYLE,e):null!=e.model?$.extend(!0,{},t.DEFAULT_MODEL_STYLE,e):null==e.point?t.DEFAULT_POINT_STYLE:$.extend(!0,{},t.DEFAULT_POINT_STYLE,e)},e.prototype.sanitizePositions=function(e){for(var t=0;t<e.length;t++)e[t]instanceof Array?this.sanitizePositions(e[t]):isNaN(e[t])&&(e[t]=0)};var t={};return Object.defineProperties(t,{DEFAULT_POLYGON_STYLE:{get:function(){return{polygon:{perPositionHeight:!0,fill:0,material:Cesium.Color.GREEN,outline:!0,outlineColor:Cesium.Color.WHITE,outlineWidth:1}}}},DEFAULT_POLYLINE_STYLE:{get:function(){return{polyline:{material:Cesium.Color.WHITE,width:1}}}},DEFAULT_POINT_STYLE:{get:function(){return{point:{color:Cesium.Color.RED,pixelSize:5,outlineColor:Cesium.Color.WHITE,outlineWidth:2}}}},DEFAULT_LABEL_STYLE:{get:function(){return{label:{text:"Text",font:"18px arial",style:Cesium.LabelStyle.FILL,fillColor:Cesium.Color.WHITE,outlineColor:Cesium.Color.BLACK,outlineWidth:5,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,eyeOffset:Cesium.Cartesian3.ZERO,pixelOffset:new Cesium.Cartesian2(0,-50)}}}},DEFAULT_BILLBOARD_STYLE:{get:function(){return{billboard:{image:"./img/query.png",scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM}}}},DEFAULT_MODEL_STYLE:{get:function(){return{model:{uri:"./img/CesiumTexturedBoxTest.bgltf",scale:1e3}}}}}),e}),define("SGWorld/wfs/wfsLayer",["../Core/jquery","./GmlParser","./TileManager1","./WorkerPool","./SimpleSqlParser","./EntityCreator"],function($$,GmlParser,_TileManager,WorkerPool,simpleSqlParser,EntityCreator){"use strict";var TileManager;function Layer(e,t,i,r,o,n,a,s,l){var u=this;if(this._viewer=e,this._Viewer=e,u.G=65535,TileManager=new _TileManager,workerPool=new WorkerPool({workerPath:lj()}),!Cesium.sampleRenderedData){var c=function(e,t){for(var i=0;i<e.children.length;i++){if(e.children[i].state>=Cesium.QuadtreeTileLoadState.DONE&&(null!=e.children[i].data.terrainData._mesh||null!=e.children[i].data.terrainData._buffer)&&e.children[i].x==t.x&&e.children[i].y==t.y)return e.children[i]}},h=function(e,t){for(var i=e.tilingScheme,r=i.positionToTileXY(t,0),o=u._Viewer.scene.globe._surface.tileProvider.quadtree._levelZeroTiles,n=o[0].x==r.x&&o[0].y==r.y?o[0]:o[1],a=1;a<22;a++){r=i.positionToTileXY(t,a);var s=c(n,r);if(null==s)break;n=s}return n},d=function(e,t){var i;$.grep(u._Viewer.scene.primitives._primitives,function(e){return e instanceof Cesium.Cesium3DTileset});for(i=0;i<e.length;++i){var r=e[i],o=r instanceof Cesium.Cartographic,n=o?r:Cesium.Cartographic.fromCartesian(r);if(n.height=u.G,!o){var a=Cesium.Cartesian3.fromRadiansArrayHeights([n.longitude,n.latitude,n.height])[0];r.z=a.z}}return e},m=function(e,t){var i;for(i=0;i<t.length;++i){var r=t[i],o=h(e,r);r.height=o.data.terrainData.interpolateHeight(o.rectangle,r.longitude,r.latitude)}return t},p=function(e){this.value=new Float32Array([e])};Cesium.Resource&&(Cesium.loadText=Cesium.Resource.fetchText,Cesium.loadJson=Cesium.Resource.fetchJson,Cesium.loadBlob=Cesium.Resource.fetchBlob,Cesium.loadArrayBuffer=Cesium.Resource.fetchArrayBuffer,Cesium.loadImage=Cesium.Resource.fetchImage),p.fromZBias=function(e){if(!Cesium.defined(e))throw new DeveloperError("zbias is required.");return new p(e)},p.toValue=function(e,t){if(!Cesium.defined(e))throw new DeveloperError("zbias is required.");return Cesium.defined(t)?color.toBytes(t):new Float32Array(e)},p.equals=function(e,t){return e===t||Cesium.defined(e)&&Cesium.defined(t)&&e.value[0]===t.value[0]},p.defaultBias=function(){return p.fromZBias(15e-6)},Cesium.ZBiasGeometryInstanceAttribute=p,Cesium.ZBiasGeometryInstanceAttribute=p,Cesium.SampleRenderedDataFlags={TERRAIN:2,MESH:4,FLOOR:8},Cesium.DynamicEyeOffset=function(e){return void 0===e&&(e=0),new Cesium.Cartesian3(.001234321,0,e)},Cesium.sampleRenderedData=function(o,e){var t=2,i=4,r=8;null==e&&(e=t|i);var n=Cesium.when.defer(),a=[];t<e?o.forEach(function(e){a.push(Cesium.Cartographic.fromRadians(e.longitude,e.latitude,e.height))}):a=o;var s=[];e&t&&s.push(function(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var r=Cesium.when.defer();return function e(){t.ready?Cesium.when(m(t,i),function(e){r.resolve(e)}):setTimeout(e,10)}(),r.promise}(u._Viewer.terrainProvider,o));var l=0<(e&r);return e&(i|r)&&s.push(function(e,t){Cesium.Check.defined("positions",e);var i=Cesium.when.defer();return Cesium.when(d(e,t),function(e){i.resolve(e)}),i.promise}(a,l)),Cesium.when.all(s).then(function(e){if(1<s.length)for(var t=0;t<o.length;t++){var i=e[0][t],r=e[1][t];r.height!=u.G&&((i.height<r.height||l)&&(i.height=r.height))}n.resolve(e[0])}),n.promise},Cesium.sampleRenderedMesh=function(e,t){Cesium.Check.defined("positions",e);var i=Cesium.when.defer();return Cesium.when(d(e,t),function(e){i.resolve(e)}),i.promise},Cesium.sampleRenderedTerrain=function(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var r=Cesium.when.defer();return function e(){t.ready?Cesium.when(m(t,i),function(e){r.resolve(e)}):setTimeout(e,10)}(),r.promise},Cesium.QuadtreePrimitive.prototype.getRenderedBestLevelInfo=function(){var e=this.getRenderedLevelInfo(),t=0;for(var i in e)t<Number(i)&&(t=Number(i));return{bestLevel:t,count:e[t]}},Cesium.QuadtreePrimitive.prototype.getRenderedLevelInfo=function(){var t=[];return this._tilesToRender.forEach(function(e){null==t[e.level]&&(t[e.level]=0),t[e.level]++}),t}}o=o||{},this._level=r||{min:0,max:22},"number"==typeof this._level&&(this._level={min:r,max:22}),this._url=t,this._layerName=i,this._guid=Cesium.createGuid(),this._gmlParser=new GmlParser(!0,null,null,!0),this._tileManager=TileManager.getInstance(e),this._tileManager._loadTileEvent.addEventListener(Layer.prototype.loadTile,this),this._useWorkers=!0,this._layerDisplayName=n,this._showAttributesAsMessage=o.showAttributesAsMessage,delete o.showAttributesAsMessage,this._entityCreator=new EntityCreator(o,e),this._visible=!0,this._featuresMap={},this._boundingBox=void 0,this._geometryFieldName=void 0,this._operations={},this._subdomains=a,this.latLon=s,this._addedFeatures=[],this.simpleSqlParser=simpleSqlParser,this.myLayer=l,this._statistics={numberOfAddedFeatures:0,numberOfDeletedFeatures:0,numberOfAddePositions:0,numberOfDeletedPositions:0,getNumberOfCurrentlyRenderedFeatures:function(){return this.numberOfAddedFeatures-this.numberOfDeletedFeatures},getNumberOfCurrentlyRenderedPositions:function(){return this.numberOfAddePositions-this.numberOfDeletedPositions}},initLayerCapabilities(this),initFeatureType(this)}function ReplaceTagWithOriginalDomain(e,t){return-1!=e.indexOf("{s}")?null!=t&&0<t.length?e.replace("{s}",t[0]):console.error("Error - sTag with no subdomains."):e}function getXmlTag(e,t,i){var r=$$(e).find(t);return 0==r.length&&"wfs"===i.toLowerCase()&&(r=$$(e).find("wfs\\:"+t+","+t)),0<r.length?r:$$([])}function parseBBox(r,e){getXmlTag(e,"FeatureType","wfs").each(function(e,t){if(getXmlTag(t,"Name","wfs").text()!=r._layerName)return!0;var i=getXmlTag(t,"LatLongBoundingBox","wfs");return 1!==i.length||(r._boundingBox=Cesium.Rectangle.fromDegrees(parseFloat(i[0].attributes.minx.value),parseFloat(i[0].attributes.miny.value),parseFloat(i[0].attributes.maxx.value),parseFloat(i[0].attributes.maxy.value))),!1})}function queryStringExist(e){return-1<e.indexOf("?")?"&":"?"}function initLayerCapabilities(t){var e=t.cleanUrl(t._url).replace("{s}",t.sTag(t._layerName.length,t._layerName.length,t._level));e+=queryStringExist(e),e+="SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&outputFormat=GML2&typeName="+t._layerName;var i=Cesium.TrustedServers.contains(ReplaceTagWithOriginalDomain(t._url,t._subdomains));$$.ajax({dataType:"xml",xhrFields:{withCredentials:i},url:encodeURI(e),success:function(e){parseBBox(t,e),initAllowedOperations(t,e)}})}function initAllowedOperations(r,e){$$(e).find("FeatureType").each(function(e,t){if($$(t).children("Name").text()!=r._layerName)return!0;var i=$$(t).children("Operations");return 0==i.length||i.children().each(function(){r._operations[this.tagName.toLowerCase()]={}}),!1})}function initFeatureType(t){t.featureColumnNames=null;var e=t.cleanUrl(t._url).replace("{s}",t.sTag(t._layerName.length,t._layerName.length,t._level));e+=queryStringExist(e),e+="SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&typeName="+t._layerName;var i=Cesium.TrustedServers.contains(ReplaceTagWithOriginalDomain(t._url,t._subdomains));$$.ajax({dataType:"xml",xhrFields:{withCredentials:i},url:encodeURI(e),success:function(e){parseDescribeFeatureResponse(t,e)}})}function getWfsNamespace(xmlText,testElementName){if(null==xmlText)return null;try{var match=(new XMLSerializer).serializeToString(xmlText).match(eval("/[<]([a-z]+):"+testElementName+"[>]/i"));return null!=match?match[1]:null}catch(e){return!1}}function isElementNameExists(xmlText,testElementName){if(null==xmlText)return!1;try{var match=(new XMLSerializer).serializeToString(null!=xmlText.context?xmlText.context:xmlText).match(eval("/[<](([a-z]+):)?"+testElementName+"[^>]*[>]/i"));return null!=match}catch(e){return!1}}function parseDescribeFeatureResponse(o,e){var t=$$(e).find("[type^='gml:']");o._geometryFieldName=$$(t).attr("name"),o.geometryResponseData=e,o.wfsNamespace=getWfsNamespace(o.geometryResponseData,"sequence"),null==o.wfsNamespace&&(o.wfsNamespace="xsd"),o.sgSchemaExists=$$(o.geometryResponseData).find(o.wfsNamespace+"\\:schema").attr("xmlns:sfs"),o.sgSchemaExists||(o.sgSchemaExists=$$(o.geometryResponseData).find("schema").attr("xmlns:sfs"));var i=$$(o.geometryResponseData).find(o.wfsNamespace+"\\:sequence "+o.wfsNamespace+"\\:element");0==i.length&&(i=$$(o.geometryResponseData).find("sequence").find("element")),o.geomFields=[],i.each(function(){var e=$$(this),t=e.attr("name"),i=e.attr("type");if(null==i)i="string";else{var r=i.match(/.*[:](\w+)/);r&&(i=r[1])}o.geomFields.push({name:t,type:i})})}function sqlParserToWfs(e,t){if(e.operator){var i="";switch(e.operator.toLowerCase()){case"=":i="PropertyIsEqualTo";break;case"<>":i="PropertyIsNotEqualTo";break;case">":i="PropertyIsGreaterThan";break;case">=":i="PropertyIsGreaterThanOrEqualTo";break;case"<":i="PropertyIsLessThan";break;case"<=":i="PropertyIsLessThanOrEqualTo";break;case"like":i="PropertyIsLike"}var r=-1!=t.indexOf(e.right)?e.right:e.left,o="<ogc:"+i+("like"==e.operator.toLowerCase()?' wildCard="*" singleChar="*" escape="*"':"")+">";o+="<ogc:PropertyName>"+r+"</ogc:PropertyName>";var n=-1!=t.indexOf(e.right)?e.left:e.right,a=null==(n=n.replace(/^'|'$$/g,"")).match(/^[%]|[%]$$/);return"like"==e.operator.toLowerCase()&&a&&(n="%"+n+"%"),o+="<ogc:Literal>"+n+"</ogc:Literal>",o+="</ogc:"+i+">"}var s="and"==e.logic.toLowerCase()?"And":"Or";o="<ogc:"+s+">";return 2==e.terms.length?o+=sqlParserToWfs(e.terms[0],t):o+=sqlParserToWfs({logic:s,terms:e.terms.slice(0,e.terms.length-1)},t),o+=sqlParserToWfs(e.terms[e.terms.length-1],t),o+="</ogc:"+s+">"}function parseFeaturesResult(e){var r=[],t=$$(e).find("gml\\:featureMember");return 0==t.length&&(t=$$(e).find("featureMember")),t.each(function(){var e={},t=$$(this).children().first();e.layerId=t[0].nodeName,e.originFid=t.attr("fid"),e.fid=t.attr("fid"),null==e.fid&&(e.fid=-1);var i=e.fid.match(/[.]?(\d+)$$/);i&&(e.fid=i[1]),e.node=t[0],t.children().each(function(){e[this.nodeName]=this.innerHTML,null==e[this.nodeName]&&(e[this.nodeName]=$$(this).text())}),r.push(e)}),r}function internalBlockRequestPrimitiveFromPrimitive(e){return null==e?void 0:e.parentLayer?e:e._parentCollection?e._parentCollection:e.primitive&&e.primitive._parentCollection?e.primitive._parentCollection:void 0}Object.defineProperties(Layer.prototype,{LayerDisplayName:{get:function(){return this._layerDisplayName}},displayName:{get:function(){return this.LayerDisplayName}},guid:{get:function(){return this._guid}},Style:{get:function(){return this._entityCreator.style}},show:{get:function(){return this._visible},set:function(e){this.setVisibility(e)}},BoundingBox:{get:function(){return this._boundingBox}},Statistics:{get:function(){return this._statistics}}});var DEGREES_PER_RADIAN=180/Math.PI,RADIAN_PER_DEGREEE=1/DEGREES_PER_RADIAN,REQUEST_MAX_FEATURES=1e3,workerPool;function lj(){for(var e=document.scripts,t="./wfs/featurefetcherworker.js",i=0;i<e.length;i++){var r=e[i].src.split("/"),o=r[r.length-1];"SmartEarth.js"==o?t=e[i].outerHTML.split('"')[1].replace("SmartEarth.js","Workers/featurefetcherworker.js"):"SmartEarth.min.js"==o&&(t=e[i].outerHTML.split('"')[1].replace("SmartEarth.min.js","Workers/featurefetcherworker.js"))}return t}return Layer.prototype.getRequestMaxFeatures=function(){return REQUEST_MAX_FEATURES},Layer.prototype.isAttributeField=function(e,t){return!(!t||!e||""==e.toLowerCase()||"fid"==e.toLowerCase())&&("string"==t.toLowerCase()||"integer"==t.toLowerCase()||"double"==t.toLowerCase())},Layer.prototype.updateFeatures=function(e,r){if(e.length<=0)r();else{var t=this,i=[];$$(this.geomFields).each(function(){t.isAttributeField(this.name,this.type)&&i.push(this.name)});var o="<wfs:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>",n="";$$(e).each(function(){var e=this,t='<wfs:Update typeName="{lyaer_id}">'.replace("{lyaer_id}",this.layerId);$$(i).each(function(){t+="<wfs:Property><wfs:Name>"+this+"</wfs:Name><wfs:Value>"+e[this]+"</wfs:Value></wfs:Property>"}),t+='<ogc:Filter><ogc:FeatureId fid="'+e.originFid+'"/></ogc:Filter>',n+=t+="</wfs:Update>"}),o=o.replace("{wfs_updates}",n);var a="Failed to save changes to server",s=ReplaceTagWithOriginalDomain(this.cleanUrl(this._url),this._subdomains),l=Cesium.TrustedServers.contains(s);$$.ajax({dataType:"xml",type:"POST",data:o,xhrFields:{withCredentials:l},url:encodeURI(s),success:function(e){null!=(new XMLSerializer).serializeToString(e.documentElement).toLowerCase().match(/success\s*\//)?r():r(a)},error:function(e,t,i){r(a)},timeout:1e4})}},Layer.prototype.getFeatures=function(e,t,r){var i=this,o=[];$$(this.geomFields).each(function(){i.isAttributeField(this.name,this.type)&&o.push(this.name)});var n="<wfs:GetFeature version='1.0.0' service='WFS' username='' password='' maxFeatures='{REQUEST_MAX_FEATURES}' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> <wfs:Query typeName='{layer_name}'> {wfs_filter}</wfs:Query> </wfs:GetFeature>";n=(n=n.replace("{layer_name}",this._layerName)).replace("{REQUEST_MAX_FEATURES}",REQUEST_MAX_FEATURES);var a="";""!=e.replace(/[ ]/g,"")&&(a="<ogc:Filter xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'>",a+=sqlParserToWfs(i.simpleSqlParser.sql2ast("SELECT * FROM x WHERE "+e).WHERE,o),a+="</ogc:Filter>");n=n.replace("{wfs_filter}",a);var s=ReplaceTagWithOriginalDomain(this.cleanUrl(this._url),this._subdomains),l=Cesium.TrustedServers.contains(s);t.xhr=$$.ajax({url:encodeURI(s),type:"POST",data:n,dataType:"xml",xhrFields:{withCredentials:l},success:function(e){if(isElementNameExists($$(e),"FeatureCollection")){var t=parseFeaturesResult(e);r(t)}else r(null,TELang.i18n("layer_error_reading_features"))},error:function(e,t,i){r(null,e.statusText)},timeout:1e4})},Layer.prototype.getFeatureColumnNames=function(){if(this.featureColumnNames)return this.featureColumnNames;var e=$$(this.geometryResponseData).find(this.wfsNamespace+"\\:sequence "+this.wfsNamespace+"\\:element");0==e.length&&(e=$$(this.geometryResponseData).find("sequence").find("element"));var t=[];return e.each(function(){var e=$$(this);"geom"!=e.attr("name").toLowerCase()&&t.push(e.attr("name").toLowerCase())}),this.featureColumnNames=t,this.featureColumnNames},Layer.prototype.refresh=function(e){for(var t=this._tileManager.getAllTiles(),i=t.length,r=0;r<i;r++)t[r].data.wfsLayerData[this._guid]&&t[r].data.wfsLayerData[this._guid].freeResources(),this.loadTile(t[r]);e&&initFeatureType(this)},Layer.prototype.setVisibility=function(e){if(this._visible!=e)if(0==(this._visible=e))for(var t=(r=this._tileManager.getAllTiles()).length,i=0;i<t;i++)r[i].data.wfsLayerData[this._guid]&&r[i].data.wfsLayerData[this._guid].primitive&&(r[i].data.wfsLayerData[this._guid].primitive.show=!1);else{var r;for(t=(r=this._tileManager.getAllTiles()).length,i=0;i<t;i++)r[i].data.wfsLayerData[this._guid]&&(r[i].data.wfsLayerData[this._guid].primitive?r[i].data.wfsLayerData[this._guid].primitive.show=!0:this.loadTile(r[i]))}},Layer.prototype.loadTile=function(e){var t=this;e.data.wfsLayerData[this._guid]={id:e.data.id,primitive:void 0,freeResources:function(){Cesium.defined(this.xhr)&&(this.xhr.abort(),this.xhr=void 0),Cesium.defined(this.features)&&(t.removeFeaturesFromLayer(this.features),this.features=void 0),Cesium.defined(this.primitive)&&(t._tileManager.removeFromScene(this.primitive),this.primitive=void 0)}},this.show&&e.level>=this._level.min&&e.level<=this._level.max&&(this.statc=0,this._guide=this._guid,this.beginLoadWFSData(e))},Layer.prototype.isDestroyed=function(){return!1},Layer.prototype.destroy=function(){var e=this._tileManager.getAllTiles(),t=e.length;if(0<t)for(var i=0;i<t;i++)e[i].data.wfsLayerData[this._guid]&&e[i].data.wfsLayerData[this._guid].freeResources();return this._tileManager._loadTileEvent.removeEventListener(Layer.prototype.loadTile,this),Cesium.destroyObject(this)},Layer.prototype.sTag=function(e,t,i){if(null==this._subdomains)return"";var r=(e+t+i)%this._subdomains.length;return this._subdomains[r]},Layer.prototype.cleanUrl=function(e){return-1!=e.indexOf("?")?e.split("?")[0]:e},Layer.prototype.beginLoadWFSData=function(t){if((null==this.latLon||this.latLon)&&(null!=this.BoundingBox&&(0==this.BoundingBox.width||0==this.BoundingBox.height)&&(this.BoundingBox.east+=1,this.BoundingBox.north+=1,this.BoundingBox.beenModified=!0),void 0===this.BoundingBox||void 0!==Cesium.Rectangle.intersection(this.BoundingBox,t.rectangle))){var e=[DEGREES_PER_RADIAN*t.rectangle.west,DEGREES_PER_RADIAN*t.rectangle.south,DEGREES_PER_RADIAN*t.rectangle.east,DEGREES_PER_RADIAN*t.rectangle.north],i=this,r=this.cleanUrl(this._url).replace("{s}",this.sTag(t.x,t.y,t.level));r+=queryStringExist(r),r+="SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&outputFormat=GML2&typeName="+this._layerName+"&srsName=EPSG:4326&BBOX="+e.join(",");var o=Cesium.TrustedServers.contains(ReplaceTagWithOriginalDomain(this._url,this._subdomains));t.data.wfsLayerData[this._guid].xhr=$$.ajax({dataType:this._useWorkers?"text":"xml",url:encodeURI(r),cache:!0,xhrFields:{withCredentials:o},success:function(e){i.processWFSData(t,e)},error:function(e,t,i){"abort"!==i&&console.log("Failed to retrieve data from "+r+" :"+i)},complete:function(){t.data.wfsLayerData[i._guid].xhr=void 0}})}},Layer.prototype.processWFSData=function(e,t){if(e.data.wfsLayerData[this._guid].xhr=void 0,this._useWorkers){var i=this;workerPool.queueWorkItem({id:e.data.id,text:t,geometryFieldName:this._geometryFieldName}).then(function(e){i.addFeaturesToTile(e)})}else{var r=this._gmlParser.read(t);this.addFeaturesToTile({id:e.data.id,features:r})}},Layer.prototype.boundingSphereFromGML=function(e,i){var r=viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel,o=this;workerPool.queueWorkItem({id:"0",text:e,geometryFieldName:this._geometryFieldName}).then(function(e){var t={parentLayer:o,features:e.features,sampleTerrainLevel:r+1,isQuery:!0,onFinishedQuery:function(e){var t;0<e.length&&(t=Cesium.BoundingSphere.fromBoundingSpheres(e)),i(t)}};o._entityCreator.createPrimitiveFromWFSFeatures(t)})},Layer.prototype.boundingSphereFromFeature=function(e){var t,i={parentLayer:this,features:[e],sampleTerrainLevel:viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel+1,isQuery:!0,onFinishedQuery:function(e){0<e.length&&(t=Cesium.BoundingSphere.fromBoundingSpheres(e))}};return this._entityCreator.createPrimitiveFromWFSFeatures(i),t},Layer.prototype.addRenderedFeatureId=function(e){null==this._addedFeatures[e]&&(this._addedFeatures[e]=0),this._addedFeatures[e]++},Layer.prototype.removeRenderedFeatureId=function(e){null!=this._addedFeatures[e]&&this._addedFeatures[e]--,0==this._addedFeatures[e]&&(this._addedFeatures[e]=void 0)},Layer.prototype.isExistRenderedFeatureId=function(e){return null!=this._addedFeatures[e]},Layer.prototype.addFeaturesToTile=function(i,r){var o=this._tileManager.getTile(i.id);if(void 0!==o){var e=r?o.data.wfsLayerData[this._guid].primitive._instanceIds:void 0,n=this,t={parentLayer:this,originalInstanceIds:e,features:i.features,onFinishedCreatePrimitive:function(e){if(null!=i.features&&null!=o.data.wfsLayerData&&(o.data.wfsLayerData[n._guid].features=i.features,r||n.addFeaturesToLayer(o.data.wfsLayerData[n._guid].features),void 0===e.length||0<e.length)){var t=o.data.wfsLayerData[n._guid].primitive;e.show=n.show,(o.data.wfsLayerData[n._guid].primitive=e).parentLayer=n,e.parentTileId=i.id,e._guid=Cesium.createGuid(),r?n._tileManager.replaceInScene(t,e):n._tileManager.addToScene(e)}}};this._entityCreator.createPrimitiveFromWFSFeatures(t)}},Layer.prototype.addFeaturesToLayer=function(e){this._statistics.numberOfAddedFeatures+=e.length,this._statistics.numberOfAddePositions+=Cesium.defaultValue(e.numPositions,0);for(var t=e.length,i=0;i<t;i++)!1===Object.prototype.hasOwnProperty.call(this._featuresMap,e[i].fid)?this._featuresMap[e[i].fid]={refCount:1,feature:e[i]}:this._featuresMap[e[i].fid].refCount++},Layer.prototype.removeFeaturesFromLayer=function(e){this._statistics.numberOfDeletedFeatures+=e.length,this._statistics.numberOfDeletedPositions+=Cesium.defaultValue(e.numPositions,0);for(var t=e.length,i=0;i<t;i++)!1!==Object.prototype.hasOwnProperty.call(this._featuresMap,e[i].fid)&&(this._featuresMap[e[i].fid].refCount--,0===this._featuresMap[e[i].fid].refCount&&delete this._featuresMap[e[i].fid],this.removeRenderedFeatureId(e[i].fid))},Layer.prototype.getFeature=function(e){return!1===Object.prototype.hasOwnProperty.call(this._featuresMap,e)?null:this._featuresMap[e]},Layer.prototype.updateTile=function(e){var t=this._tileManager.getTile(e);void 0!==t&&(null==t.data.wfsLayerData[this._guid].features?this.loadTile(t):this.addFeaturesToTile(t.data.wfsLayerData[this._guid],!0))},Layer.blockRequestPrimitiveFromPrimitive=function(e){if(null!=e){var t=internalBlockRequestPrimitiveFromPrimitive(e);return null!=t||(e._labelCollection&&e._labelCollection._billboardCollection?t=internalBlockRequestPrimitiveFromPrimitive(e._labelCollection._billboardCollection):e._billboardCollection&&(t=internalBlockRequestPrimitiveFromPrimitive(e._billboardCollection))),t}},Layer.prototype.resetAttributesTable=function(){this.lastEditedCell=null,this.attrTblDialogMemo=null},Layer}),define("SGWorld/SGWorld",["./AttachEvent","./DetachEvent","./Navigate/Navigate","./Creator/Creator","./Command/Command","./Analysis/Analysis","./ProjectTree/ProjectTree","./Const/LabelStyles","./Const/HorizontalOrign","./Const/VerticalOrigin","./Const/HeightReference","./Const/ShadowMode","./Core/Core","./Coordinate/Coordinate","./VectorTileProvider/VectorTileProvider","./VectorTileProvider/GeoJSONVectorTileProvider","./wfs/wfsLayer"],function(i,r,e,t,o,n,a,s,l,u,c,h,E,d,m,p,g){"use strict";function f(e,t,i,r,o){this._core=new E,this._cesium=t||Cesium,!i&&(i={}),Cesium.Ion.defaultAccessToken=i.defaultAccessToken||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiY2RhMDMyYi1mODVkLTRkODAtYmI4MS0zZTY0OTM3OGExZWEiLCJpZCI6MjU5LCJpYXQiOjE2MTQ1OTIwNDZ9.0jO0HJaY0N1DrvfxPuuoDPWN_ebN2o2Ku2DrRC_P8qs";var n={baseLayerPicker:!1,shadows:!1,skyAtmosphere:new this._cesium.SkyAtmosphere,terrainShadows:this._cesium.ShadowMode.ENABLED,shouldAnimate:!0,animation:!0,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,imageryProviderViewModels:[],terrainProviderViewModels:[],contextOptions:{webgl:{preserveDrawingBuffer:!0},failIfMajorPerformanceCaveat:!1}};"string"==typeof i?n.imageryProvider=new this._cesium.SingleTileImageryProvider({url:i}):(i.url&&(n.imageryProvider=new this._cesium.SingleTileImageryProvider({url:i.url})),this._core.extend(n,i,!0)),n.imageryProvider||(n.imageryProvider=new Cesium.WebMapTileServiceImageryProvider({url:"http://{s}.tianditu.com/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=837264f46e683ec982d452e78d71052e",subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"],maximumLevel:18}));var a={destination:this._cesium.Cartesian3.fromDegrees(i.x?i.x:110,i.y?i.y:32,i.h?i.h:8e6),orientation:{heading:this._cesium.Math.toRadians(0),pitch:this._cesium.Math.toRadians(-90),roll:this._cesium.Math.toRadians(0)},duration:i.duration||.5};this._Viewer=new this._cesium.Viewer(e,n);this._Viewer.scene;if(this._tree=r,this._Viewer.scene.globe.baseColor=this._cesium.Color.WHITE,this._Viewer.shadowMap.size=2048,this._Viewer._cesiumWidget._creditContainer.style.display="none",this._Viewer.terrainShadows=this._cesium.ShadowMode.ENABLED,this._AttachEvent=void 0,this._DetachEvent=void 0,this._Analysis=void 0,this._Navigate=void 0,this._Creator=void 0,this._Command=void 0,this._ProjectTree=void 0,this._Coordinate=void 0,this._VectorTileProvider=void 0,""!=r&&null!=r){var s=r;if(""!=s&&null!=s){var l=s.x,u=s.y,c=s.z,h=0;null!=s.heading&&null!=s.heading&&(h=s.heading);var d=-90;null!=s.pitch&&null!=s.pitch&&(d=s.pitch);var m=0;null!=s.roll&&null!=s.roll&&(m=s.roll),a={destination:this._cesium.Cartesian3.fromDegrees(l,u,c),orientation:{heading:this._cesium.Math.toRadians(h),pitch:this._cesium.Math.toRadians(d),roll:this._cesium.Math.toRadians(m)},duration:i.duration||.5}}}if(this.Navigate.flyToPointsInterest(a,o),this._Viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),n.minViewHeight){var p=this;p.minViewHeight=n.minViewHeight;var g=0;this._Viewer.scene.preRender.addEventListener(function(){var e=p._Viewer.scene,t=p._Viewer.camera;if(t&&t.positionCartographic){var i,r,o=e.globe.getHeight(t.positionCartographic);g=o||g;var n=t.positionCartographic.height-g;r=p._Analysis&&(p._Analysis._UndergroundMode&&p._Analysis._UndergroundMode.isUndergroundMode||p._Analysis._StreetView&&p._Analysis._StreetView.isStreetView)?(i=t.positionCartographic.height<-200,-200):(i=n<p.minViewHeight,g+p.minViewHeight),i&&t.setView({destination:p._cesium.Cartesian3.fromRadians(t.positionCartographic.longitude,t.positionCartographic.latitude,r),orientation:{heading:t.heading,pitch:t.pitch<0?t.pitch:0,roll:0}})}},this)}if(Object.defineProperties(Cesium.Model.prototype,{_cachedGltf:{configurable:!0,set:function(e){this._vtxf_cachedGltf=e,this._vtxf_cachedGltf&&this._vtxf_cachedGltf._gltf&&function(a){if(a.extensionsUsed&&a.extensionsRequired){var e=a.extensionsUsed.indexOf("KHR_technique_webgl"),t=a.extensionsRequired.indexOf("KHR_technique_webgl");if(-1!==e){a.extensionsRequired.splice(t,1,"KHR_techniques_webgl"),a.extensionsUsed.splice(e,1,"KHR_techniques_webgl"),a.extensions=a.extensions||{},a.extensions.KHR_techniques_webgl={},a.extensions.KHR_techniques_webgl.programs=a.programs,a.extensions.KHR_techniques_webgl.shaders=a.shaders,a.extensions.KHR_techniques_webgl.techniques=a.techniques;var s=a.extensions.KHR_techniques_webgl.techniques;a.materials.forEach(function(e,t){a.materials[t].extensions.KHR_technique_webgl.values=a.materials[t].values,a.materials[t].extensions.KHR_techniques_webgl=a.materials[t].extensions.KHR_technique_webgl;var i=a.materials[t].extensions.KHR_techniques_webgl;for(var r in i.values){var o=s[i.technique].uniforms;for(var n in o)if(o[n]===r){i.values[n]=i.values[r],delete i.values[r];break}}}),s.forEach(function(e){for(var t in e.attributes){var i=e.attributes[t];e.attributes[t]=e.parameters[i]}for(var r in e.uniforms)i=e.uniforms[r],e.uniforms[r]=e.parameters[i]})}}}(this._vtxf_cachedGltf._gltf)},get:function(){return this._vtxf_cachedGltf}}}),Cesium.Resource&&(Cesium.loadText=Cesium.Resource.fetchText,Cesium.loadJson=Cesium.Resource.fetchJson,Cesium.loadBlob=Cesium.Resource.fetchBlob,Cesium.loadArrayBuffer=Cesium.Resource.fetchArrayBuffer,Cesium.loadImage=Cesium.Resource.fetchImage),Cesium.isArray||(Cesium.isArray=Array.isArray),Cesium.viewerCesiumNavigationMixin){var f={defaultResetView:Cesium.Rectangle.fromDegrees(80,22,130,50),enableCompass:!0,enableZoomControls:!0,enableDistanceLegend:!0,enableCompassOuterRing:!0};this._Viewer.extend(Cesium.viewerCesiumNavigationMixin,n.navigation||f)}!function(e){if(e.cesiumWidget._supportsImageRenderingPixelated&&window&&window.devicePixelRatio){for(var t=window.devicePixelRatio;2<=t;)t/=2;e.resolutionScale=t}}(this._Viewer);var v=this;function _(e,t){for(var i=0;i<e.children.length;i++){if(e.children[i].state>=Cesium.QuadtreeTileLoadState.DONE&&(null!=e.children[i].data.terrainData._mesh||null!=e.children[i].data.terrainData._buffer)&&e.children[i].x==t.x&&e.children[i].y==t.y)return e.children[i]}}function y(e,t){for(var i=e.tilingScheme,r=i.positionToTileXY(t,0),o=v._Viewer.scene.globe._surface.tileProvider.quadtree._levelZeroTiles,n=o[0].x==r.x&&o[0].y==r.y?o[0]:o[1],a=1;a<22;a++){var s=_(n,r=i.positionToTileXY(t,a));if(null==s)break;n=s}return n}function C(e,t){var i;$.grep(v._Viewer.scene.primitives._primitives,function(e){return e instanceof Cesium.Cesium3DTileset});for(i=0;i<e.length;++i){var r=e[i],o=r instanceof Cesium.Cartographic,n=o?r:Cesium.Cartographic.fromCartesian(r);if(n.height=v.G,!o){var a=Cesium.Cartesian3.fromRadiansArrayHeights([n.longitude,n.latitude,n.height])[0];r.z=a.z}}return e}function w(e,t){var i;for(i=0;i<t.length;++i){var r=t[i],o=y(e,r);r.height=o.data.terrainData.interpolateHeight(o.rectangle,r.longitude,r.latitude)}return t}function b(e){this.value=new Float32Array([e])}v.G=65535,b.fromZBias=function(e){if(!Cesium.defined(e))throw new DeveloperError("zbias is required.");return new b(e)},b.toValue=function(e,t){if(!Cesium.defined(e))throw new DeveloperError("zbias is required.");return Cesium.defined(t)?color.toBytes(t):new Float32Array(e)},b.equals=function(e,t){return e===t||Cesium.defined(e)&&Cesium.defined(t)&&e.value[0]===t.value[0]},b.defaultBias=function(){return b.fromZBias(15e-6)},this._cesium.ZBiasGeometryInstanceAttribute=b,this._cesium.SampleRenderedDataFlags={TERRAIN:2,MESH:4,FLOOR:8},this._cesium.DynamicEyeOffset=function(e){return void 0===e&&(e=0),new Cesium.Cartesian3(.001234321,0,e)},this._cesium.sampleRenderedData=function(o,e){var t=2,i=4,r=8;null==e&&(e=t|i);var n=Cesium.when.defer(),a=[];t<e?o.forEach(function(e){a.push(Cesium.Cartographic.fromRadians(e.longitude,e.latitude,e.height))}):a=o;var s=[];e&t&&s.push(function(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var r=Cesium.when.defer();return function e(){t.ready?Cesium.when(w(t,i),function(e){r.resolve(e)}):setTimeout(e,10)}(),r.promise}(v._Viewer.terrainProvider,o));var l=0<(e&r);return e&(i|r)&&s.push(function(e,t){Cesium.Check.defined("positions",e);var i=Cesium.when.defer();return Cesium.when(C(e),function(e){i.resolve(e)}),i.promise}(a)),Cesium.when.all(s).then(function(e){if(1<s.length)for(var t=0;t<o.length;t++){var i=e[0][t],r=e[1][t];r.height!=v.G&&((i.height<r.height||l)&&(i.height=r.height))}n.resolve(e[0])}),n.promise},this._cesium.sampleRenderedMesh=function(e,t){Cesium.Check.defined("positions",e);var i=Cesium.when.defer();return Cesium.when(C(e),function(e){i.resolve(e)}),i.promise},this._cesium.sampleRenderedTerrain=function(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var r=Cesium.when.defer();return function e(){t.ready?Cesium.when(w(t,i),function(e){r.resolve(e)}):setTimeout(e,10)}(),r.promise},this._cesium.QuadtreePrimitive.prototype.getRenderedBestLevelInfo=function(){var e=this.getRenderedLevelInfo(),t=0;for(var i in e)t<Number(i)&&(t=Number(i));return{bestLevel:t,count:e[t]}},this._cesium.QuadtreePrimitive.prototype.getRenderedLevelInfo=function(){var t=[];return this._tilesToRender.forEach(function(e){null==t[e.level]&&(t[e.level]=0),t[e.level]++}),t}}return Object.defineProperties(f.prototype,{Analysis:{get:function(){return null==this._Analysis&&(this._Analysis=new n(this._Viewer,this._cesium)),this._Analysis}},Navigate:{get:function(){return null==this._Navigate&&(this._Navigate=new e(this._Viewer,this._cesium,this._tree)),this._Navigate}},Creator:{get:function(){return null==this._Creator&&(this._Creator=new t(this._Viewer,this._cesium)),this._Creator}},Core:{get:function(){return null==this._Core&&(this._Core=new E),this._Core}},Command:{get:function(){return null==this._Command&&(this._Command=new o(this._Viewer,this._cesium)),this._Command}},ProjectTree:{get:function(){return null==this._ProjectTree&&(this._ProjectTree=new a(this._Viewer,this._cesium,this._tree)),this._ProjectTree}},Coordinate:{get:function(){return null==this._Coordinate&&(this._Coordinate=new d(this._Viewer,this._cesium)),this._Coordinate}},tree:{get:function(){return this._tree}},cesium:{get:function(){return this._cesium}},Viewer:{get:function(){return this._Viewer}},P1:{get:function(){return new a(this._Viewer,[1,2,3],this._cesium)}},P2:{get:function(){return new a(this._Viewer,[],this._cesium)}},LabelStyles:{get:function(){return s}},HorizontalOrign:{get:function(){return l}},VerticalOrigin:{get:function(){return u}},HeightReference:{get:function(){return c}},ShadowMode:{get:function(){return h}},VectorTileProvider:{get:function(){return null==this._VectorTileProvider&&(this._VectorTileProvider=new m(this._Viewer,this._cesium)),this._VectorTileProvider}},VectorTileProviderCopy:{get:function(){return null==this._VectorTileProviderCopy&&(this._VectorTileProviderCopy=new VectorTileProviderCopy(this._Viewer,this._cesium,{url:"http://192.168.1.40:8090/geoserver/gwc/service/wmts",urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:"skyline:nanjing",STYLE:"",TILEMATRIX:"EPSG:4326:{z}",TILEMATRIXSET:"EPSG:4326",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:18,lowerLevelLimit:16,rectangle:Cesium.Rectangle.fromDegrees(118.51721649800015,31.863232407499936,118.91648798400001,32.27649160409993),Cesium:Cesium})),this._VectorTileProviderCopy}}}),f.prototype.CreateWfs=function(e,t,i,r,o,n,a,s,l){return new g(e,t,i,r,o,n,a,s,l)},f.prototype.GeoJSONVectorTileProvider=function(e){return new p(this._Viewer,this._cesium,e)},f.prototype.AttachEvent=function(e,t){return null==this._AttachEvent&&(this._AttachEvent=new i(this._Viewer,this._cesium)),this._AttachEvent.AttachEvent(e,t)},f.prototype.DetachEvent=function(e,t){return null==this._DetachEvent&&(this._DetachEvent=new r(this._Viewer,this._cesium)),this._DetachEvent.DetachEvent(e,t)},f.prototype.RemoNormalCesiumLeftDoubleClick=function(){return null==this._DetachEvent&&(this._DetachEvent=new r(this._Viewer,this._cesium)),this._DetachEvent.RemoNormalCesiumLeftDoubleClick()},f.prototype.AttachOnLButtonDblClkEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new i(this._Viewer,this._cesium)),this._AttachEvent.AttachOnLButtonDblClkEvent(e)},f.prototype.AttachOnLButtonDownEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new i(this._Viewer,this._cesium)),this._AttachEvent.AttachOnLButtonDownEvent(e)},f.prototype.AttachOnLButtonUpEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new i(this._Viewer,this._cesium)),this._AttachEvent.AttachOnLButtonUpEvent(e)},f.prototype.AttachOnMButtonDblClkEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new i(this._Viewer,this._cesium)),this._AttachEvent.AttachOnMButtonDblClkEvent(e)},f.prototype.AttachOnMButtonDownEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new i(this._Viewer,this._cesium)),this._AttachEvent.AttachOnMButtonDownEvent(e)},f.prototype.AttachOnMButtonUpEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new i(this._Viewer,this._cesium)),this._AttachEvent.AttachOnMButtonUpEvent(e)},f.prototype.AttachOnMouseWheelEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new i(this._Viewer,this._cesium)),this._AttachEvent.AttachOnMouseWheelEvent(e)},f.prototype.AttachOnFrameEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new i(this._Viewer,this._cesium)),this._AttachEvent.AttachOnFrameEvent(e)},f.prototype.AttachOnRButtonDownEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new i(this._Viewer,this._cesium)),this._AttachEvent.AttachOnRButtonDownEvent(e)},f.prototype.AttachOnRButtonUpEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new i(this._Viewer,this._cesium)),this._AttachEvent.AttachOnRButtonUpEvent(e)},f.prototype.AttachCameraChangeEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new i(this._Viewer,this._cesium)),this._AttachEvent.AttachCameraChangeEvent(e)},f.prototype.CameraMoveEndEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new i(this._Viewer,this._cesium)),this._AttachEvent.CameraMoveEndEvent(e)},f.prototype.DetachEvent=function(e,t){return null==this._DetachEvent&&(this._DetachEvent=new r(this._Viewer,this._cesium)),this._DetachEvent.DetachEvent(e,t)},f.prototype.DetachEventAll=function(e){return null==this._DetachEvent&&(this._DetachEvent=new r(this._Viewer,this._cesium)),this._DetachEvent.DetachEventAll(e)},f.prototype.DetachCameraChangeEvent=function(e){return null==this._DetachEvent&&(this._DetachEvent=new r(this._Viewer,this._cesium)),this._DetachEvent.DetachCameraChangeEvent(e)},f}),define("SGWorld/Analysis/3DViewshed",["../configData","../Core/Core","../Creator/Color","../ProjectTree/treeSource","../Navigate/getPosition"],function(i,r,e,t,o){"use strict";var n,a,m,p,s,g,f,E,S,v,P=[1,1e5];function l(e,t){if(!(v.canvas.width<=0||v.canvas.height<=0)){var i,r=v.camera.getPickRay(e);r&&(i=v.scene.globe.pick(r,v.scene));var o=v.scene.pick(e);if(o&&o.id instanceof Cesium.Entity&&(o=void 0),o){var n=v.scene.pickPosition(e);n&&(i=n)}return i}}function x(e,t){this._normalShadowMap=e.scene.shadowMap,v=e,Cesium.Scene.prototype.screenToWorld=l,this._viewer=e,this._cesium=t,this._core=new r,this._getPosition=new o(e,t),this._startPositionCartesian=null,this._startPositionCartographic=null,this._currentPosition=null,this._prevRadius=null,this._currentRadius=null,this._currentFovHorizontal=null,this._currentFovVertical=null,this._viewshedDirection=null,this._scratchCartesian3=new Cesium.Cartesian3,this._texture=null,this._canEnlarge=!1,this._viewshedPrimitive=null,this._eventListener=null,this._viewshedMap=void 0,this._firstTime=!0,this._editingMode=!1,this._isSliderClicked=!1,this._currentObject=void 0,this._setNewPosition=!1,this._setNewPositionCanDrag=!1,this._setNewName=!1,this._listControl=void 0,this._addingViewshedMode=!1,this._initialCameraParams={},this._isCancelledTerrain=!1,this._isCancelledPrimitives=!1,this._isSpherical=!1,this._occluder=void 0,this._horizonCullingDistanceFromPoint=void 0,this._mousePositionX=void 0,this._mousePositionY=void 0,this._zAxisNewPosition=void 0,this._startingRepoZHeight=void 0,this._viewshedCartoPos=void 0,this._propertiesChanged=!1,this._calculations=[],this._exposures=[],this._calculating=!1,this._calculatingExposure=!1,this.viewshedCalculateNormals=!1,this._txtUnit="meters_short",this.isLoadingScreenOn=!1,this._primitiveColor=Cesium.Color.WHITE,this._predefinedPrimitiveColors={BEYOND_THE_HORIZON:Cesium.Color.WHITE,DEFAULT:Cesium.Color.WHITE},this._layersStorage=null,this.getId=function(){return"Viewshed"},this.maxNumViewshed=8,n=53*Cesium.Math.RADIANS_PER_DEGREE,a=53*Cesium.Math.RADIANS_PER_DEGREE,m=6371010,p={ABOVE_SEA_LEVEL:0,ABOVE_GROUND_LEVEL:1,ABOVE_MODEL:2},void 0,s=new Cesium.Cartesian3,E=new Cesium.Matrix4,g=new Cesium.Cartesian4,f=new Cesium.Cartesian3,this,E=new Cesium.Matrix4,(S=new Array(4))[0]=new Cesium.Cartesian4(-1,-1,1,1),S[1]=new Cesium.Cartesian4(1,-1,1,1),S[2]=new Cesium.Cartesian4(1,1,1,1),S[3]=new Cesium.Cartesian4(-1,1,1,1)}return x.prototype.setOptions=function(e){this._currentObject={viewshedPrimitive:this._viewshedPrimitive,viewshedMap:this._viewshedMap,viewshedObjOptions:e||{}}},x.prototype.startDraw=function(e){var t=this;this._viewshedPrimitive&&(v.scene.primitives.remove(this._viewshedPrimitive),this._viewshedPrimitive=null),this._core.setDepthTest("open",this._viewer),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+i.draw),this._eventListener&&this._eventListener.destroy(),this._eventListener=new Cesium.ScreenSpaceEventHandler(v.scene.canvas),void 0===this._viewshedDefaultNamingArray&&(this._viewshedDefaultNamingArray=new Array(this.maxNumViewshed)),this._addingViewshedMode=!0,this._editingMode=!1,this._currentObject={viewshedPrimitive:this._viewshedPrimitive,viewshedMap:this._viewshedMap,viewshedObjOptions:e||{}},this._isSpherical=!1,this._setNewPosition=!1,"pc"!=this._core.getBrowser().pc?(this._eventListener.setInputAction($.proxy(this.setViewshedPositionMobile,this),Cesium.ScreenSpaceEventType.LEFT_CLICK),v.scene.preRender.addEventListener(this.onPreFrameMobile,this)):(this._eventListener.setInputAction($.proxy(this.setViewshedPosition,this),Cesium.ScreenSpaceEventType.LEFT_CLICK),v.scene.preRender.addEventListener(this.onPreFrame,this)),this.end=function(e){t.end=void 0,v.scene.preRender.removeEventListener(t.onPreFrame,t);try{v.scene.preRender.removeEventListener(t.onPreFrameMobile,t)}catch(e){}t._eventListener&&t._eventListener.destroy(),t._core.setDepthTest("close",t._viewer),t._core.mouse(t._viewer.container,0)}},x.prototype.close=function(){v.scene.preRender.removeEventListener(this.onPreFrame,this);try{v.scene.preRender.removeEventListener(this.onPreFrameMobile,this)}catch(e){}this._eventListener&&this._eventListener.destroy(),this._viewshedPrimitive&&(v.scene.primitives.remove(this._viewshedPrimitive),this._viewshedPrimitive=null);var e=v.scene,t={context:v.scene.context,lightCamera:e._sunCamera};e.shadowMap.destroy(),e.shadowMap=new Cesium.ShadowMap(t);var i=e.shadowMap;if(this._currentObject&&this._currentObject.viewshedObjOptions&&this._currentObject.viewshedObjOptions.color&&this._currentObject.viewshedObjOptions.color.default){var r=this._currentObject.viewshedObjOptions.color.default;i._color=new Cesium.Cartesian3(r.r,r.g,r.b)}i.enabled=!0,i.debugShow=!1,i.guid=void 0,i.show=!0,i.maximumDistance=1e4,i.debugCreateRenderStates(),i.dirty=!0,v.scene.globe.shadows=Cesium.ShadowMode.fromCastReceive(!0,!0),v.scene.globe.show=!0,e.skyAtmosphere.show=!0,v.scene.shadowMap=this._normalShadowMap,this._startPositionCartesian=null,this.resetAllVariables(),this._core.setDepthTest("close",this._viewer),this._core.mouse(this._viewer.container,0)},x.prototype.setVisibility=function(e){this._viewshedPrimitive.show=e,v.shadowMap.enabled=e},x.prototype.reset=function(){var e=v.scene,t={context:v.scene.context,lightCamera:e._sunCamera};e.shadowMap.destroy(),e.shadowMap=new Cesium.ShadowMap(t);var i=e.shadowMap;if(this._currentObject&&this._currentObject.viewshedObjOptions&&this._currentObject.viewshedObjOptions.color&&this._currentObject.viewshedObjOptions.color.default){var r=this._currentObject.viewshedObjOptions.color.default;i._color=new Cesium.Cartesian3(r.r,r.g,r.b)}i.enabled=!0,i.debugShow=!1,i.guid=void 0,i.show=!0,i.maximumDistance=1e4,i.debugCreateRenderStates(),i.dirty=!0,v.scene.globe.shadows=Cesium.ShadowMode.fromCastReceive(!0,!0),v.scene.globe.show=!0,e.skyAtmosphere.show=!0,v.scene.shadowMap=this._normalShadowMap},x.prototype.CreateViewshed=function(e,t,i,r){var o=v.scene,n=new Cesium.Camera(o),a=v.scene.context;n.frustum.fov=53*Math.PI/180,n.frustum.aspectRatio=1,n.frustum.near=1,n.frustum.far=t,n.lookAt(e,i);var s={context:a,lightCamera:n,cascadesEnabled:!1};o.shadowMap=new Cesium.ShadowMap(s);var l=o.shadowMap;r.color&&(l._viewshed_Back=new Cesium.Cartesian3(r.color.Back.r,r.color.Back.g,r.color.Back.b),l._viewshed_Fore=new Cesium.Cartesian3(r.color.Fore.r,r.color.Fore.g,r.color.Fore.b)),l.enabled=!0,l.debugShow=!1,l.guid=Cesium.createGuid(),l.show=!0,l.maximumDistance=1e4,l._pointLightRadius=t,l.debugCreateRenderStates(),l._distance=t,l.dirty=!0,v.scene.globe.shadows=Cesium.ShadowMode.fromCastReceive(!0,!0),v.scene.globe.show=!0,o.skyAtmosphere.show=!0;var u={};return u.position=e,u.distance=t,u.direction=i,u.viewshedObjOptions=r,u.guid=this._cesium.createGuid(),u.viewshedObjOptions.originalDirection=i,u.type="viewshed",u.viewshedMap=l,u},x.prototype.resetAllVariables=function(){this._startPositionCartesian=null,this._startPositionCartographic=null,this._currentPosition=null,this._currentRadius=null,this._currentFovHorizontal=null,this._currentFovVertical=null,this._setNewPosition=!1,this._currentObject=void 0,this._viewshedMap=void 0,this._canEnlarge=!1,this._zAxisNewPosition=void 0,this._viewshedDirection=null},x.prototype.setViewshedPosition=function(e){if(!this._setNewPosition)if(this._canEnlarge&&null!=this._viewshedPrimitive){if(this._canEnlarge=!1,this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),this._currentObject.viewshedObjOptions.end&&this._currentObject.viewshedObjOptions.end(),this._core.mouse(this._viewer.container,0),null!=this._viewshedMap&&null!=this._viewshedPrimitive){var t=this._viewshedPrimitive._camera;this._currentObject.viewshedObjOptions.initialHeading=t.heading,this._currentObject.viewshedObjOptions.initialPitch=t.pitch,this._currentObject.viewshedObjOptions.initialRoll=t.roll,this._currentObject.viewshedObjOptions.altitudeMethod=Cesium.defaultValue(this._currentObject.viewshedObjOptions.altitudeMethod,2);var i={displayName:this._currentObject.viewshedObjOptions.name,color:this._currentObject.viewshedObjOptions.color,hFOV:t.frustum.fov,vFOV:t.frustum.fovy,aspectRatio:t.frustum.aspectRatio,height:this._currentObject.viewshedObjOptions.height,distance:this._currentObject.viewshedObjOptions.distance,xPos:this._currentObject.viewshedObjOptions.xPos,yPos:this._currentObject.viewshedObjOptions.yPos,altitudeMethod:this._currentObject.viewshedObjOptions.altitudeMethod,pickHeight:this._currentObject.viewshedObjOptions.pickHeight,horizonCullingDistanceFromViewshed:this._horizonCullingDistanceFromPoint,initialHeading:this._currentObject.viewshedObjOptions.initialHeading,initialPitch:this._currentObject.viewshedObjOptions.initialPitch,initialRoll:this._currentObject.viewshedObjOptions.initialRoll},r=this.CreateViewshed(t.position,Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius),new Cesium.HeadingPitchRange(t.heading,t.pitch,.01),i);if(this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),-1==r)return;this.resetAllVariables(),this._currentObject=r;var o=v.scene.primitives._primitives,n=($.grep(o,function(e){return!0===e.isViewshed}),[]);if(o.forEach(function(e,t){e.isViewshed&&n.push(t)}),1<n.length){var a=n[n.length-2],s=v.scene.primitives._primitives[a];v.scene.primitives.remove(s)}}}else if(Cesium.defined(e)&&void 0!==this._currentObject){var l=this._getPosition.getMousePosition(e);if(void 0!==l){var u=0;this._startPositionCartographic=v.scene.globe.ellipsoid.cartesianToCartographic(l),this._currentObject.viewshedObjOptions.pickHeight=this._startPositionCartographic.height,void 0!==this._currentObject.viewshedObjOptions.height&&(u=this._currentObject.viewshedObjOptions.height);var c=new Cesium.Cartesian3.fromRadians(this._startPositionCartographic.longitude,this._startPositionCartographic.latitude,this._startPositionCartographic.height+0+u);this._startPositionCartesian=c;var h=this._startPositionCartesian,d=new Cesium.BoundingSphere(new Cesium.Cartesian3(0,0,0),m);this._occluder=new Cesium.Occluder(d,h),this._canEnlarge=!0,this._eventListener.setInputAction($.proxy(this.onMouseMove,this),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}}},x.prototype.setViewshedPositionMobile=function(e){if(!this._setNewPosition)if(this.onMouseMove(e),this.createViewshedCameraPrimitive(),this._canEnlarge&&null!=this._viewshedPrimitive){if(this._currentObject.viewshedObjOptions.end&&this._currentObject.viewshedObjOptions.end(),this._core.mouse(this._viewer.container,0),this.createViewshedMap(),null!=this._viewshedMap&&null!=this._viewshedPrimitive){var t=this._viewshedPrimitive._camera;this._currentObject.viewshedObjOptions.initialHeading=t.heading,this._currentObject.viewshedObjOptions.initialPitch=t.pitch,this._currentObject.viewshedObjOptions.initialRoll=t.roll,this._currentObject.viewshedObjOptions.altitudeMethod=Cesium.defaultValue(this._currentObject.viewshedObjOptions.altitudeMethod,2);var i={displayName:this._currentObject.viewshedObjOptions.name,color:this._currentObject.viewshedObjOptions.color,hFOV:t.frustum.fov,vFOV:t.frustum.fovy,aspectRatio:t.frustum.aspectRatio,height:this._currentObject.viewshedObjOptions.height,distance:this._currentObject.viewshedObjOptions.distance,xPos:this._currentObject.viewshedObjOptions.xPos,yPos:this._currentObject.viewshedObjOptions.yPos,altitudeMethod:this._currentObject.viewshedObjOptions.altitudeMethod,pickHeight:this._currentObject.viewshedObjOptions.pickHeight,horizonCullingDistanceFromViewshed:this._horizonCullingDistanceFromPoint,initialHeading:this._currentObject.viewshedObjOptions.initialHeading,initialPitch:this._currentObject.viewshedObjOptions.initialPitch,initialRoll:this._currentObject.viewshedObjOptions.initialRoll},r=this.CreateViewshed(t.position,Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius),new Cesium.HeadingPitchRange(t.heading,t.pitch,.01),i);if(this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),-1==r)return;this._currentObject=r;var o=v.scene.primitives._primitives,n=($.grep(o,function(e){return!0===e.isViewshed}),[]);if(o.forEach(function(e,t){e.isViewshed&&n.push(t)}),1<n.length){var a=n[n.length-2],s=v.scene.primitives._primitives[a];v.scene.primitives.remove(s)}}}else if(Cesium.defined(e)&&void 0!==this._currentObject){var l=this._getPosition.getMousePosition(e);if(void 0!==l){var u=0;this._startPositionCartographic=v.scene.globe.ellipsoid.cartesianToCartographic(l),this._currentObject.viewshedObjOptions.pickHeight=this._startPositionCartographic.height,void 0!==this._currentObject.viewshedObjOptions.height&&(u=this._currentObject.viewshedObjOptions.height);var c=new Cesium.Cartesian3.fromRadians(this._startPositionCartographic.longitude,this._startPositionCartographic.latitude,this._startPositionCartographic.height+0+u);this._startPositionCartesian||(this._startPositionCartesian=c);var h=this._startPositionCartesian,d=new Cesium.BoundingSphere(new Cesium.Cartesian3(0,0,0),m);this._occluder=new Cesium.Occluder(d,h),this._canEnlarge=!0,this._eventListener.setInputAction($.proxy(this.onMouseMove,this),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}}},x.prototype.onMouseMove=function(e){if(Cesium.defined(e)){var t={},i=this._getPosition.getMousePosition(e);if(null!=i){if(null!=t.pickPrimitive&&null!=t.pickPrimitive._camera)return;var r={};if(this._setNewPosition)if(this._setNewPositionCanDrag){var o=void 0,n=v.scene.globe.ellipsoid.cartesianToCartographic(i);if(this._currentObject.viewshedObjOptions.pickHeight=n.height,this._currentObject.viewshedObjOptions.terrainHeight=v.scene.globe.getHeight(n),this._zAxisNewPosition){var a=e.endPosition.y-this._startingRepoZ.y,s=-1*Cesium.Cartesian3.magnitude(Cesium.Cartesian3.subtract(this._currentObject.position,v.camera.position,this._scratchCartesian3),this._scratchCartesian3)*(a/v.canvas.height);null==this._viewshedCartoPos&&(this._viewshedCartoPos=new Cesium.Cartographic.fromCartesian(this._currentObject.position)),o=new Cesium.Cartesian3.fromRadians(this._viewshedCartoPos.longitude,this._viewshedCartoPos.latitude,this._viewshedCartoPos.height+s)}else o=this._currentObject.viewshedObjOptions.altitudeMethod==p.ABOVE_SEA_LEVEL?new Cesium.Cartesian3.fromRadians(n.longitude,n.latitude,this._startingRepoZHeight):i;this._newPosition=o}else{var l=i,u=Cesium.Matrix4.multiplyByVector(v.camera._viewMatrix,Cesium.Cartesian4.fromElements(l.x,l.y,l.z,1,g),g),c=Cesium.Matrix4.multiplyByVector(v.camera.frustum.projectionMatrix,u,g),h=Cesium.Cartesian3.divideByScalar(c,c.w,f),d=Math.floor((.5*h.x+.5)*v.canvas.width),m=Math.floor((.5*h.y+.5)*v.canvas.height);this._mousePositionX=d,this._mousePositionY=m}else{if(null==this._startPositionCartesian)return;if(Cesium.Cartesian3.subtract(i,this._startPositionCartesian,r),isNaN(r.x)||isNaN(r.y)||isNaN(r.z))return;this._viewshedDirection=Cesium.Cartesian3.normalize(r,this._scratchCartesian3),this._currentRadius=Cesium.Cartesian3.magnitude(r)}}else this._mousePositionX=void 0,this._mousePositionY=void 0}},x.prototype.createViewshedSpherePrimitive=function(e,t){try{var i=null!=e?e:this._startPositionCartesian,r=null!=t?t:this._currentRadius;if(r<=1)return!1;null!=this._viewshedPrimitive&&v.scene.primitives.remove(this._viewshedPrimitive);var o=Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(i),new Cesium.Cartesian3(0,0,0),E),n=new Cesium.GeometryInstance({geometry:new Cesium.SphereOutlineGeometry({radius:r,stackPartitions:8,slicePartitions:12}),modelMatrix:o,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1,1,1,.5))}});this._viewshedPrimitive=v.scene.primitives.add(new Cesium.Primitive({geometryInstances:n,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,renderState:{lineWidth:1}}),allowPicking:!1,asynchronous:!1}));var a=new Cesium.Camera(v.scene);a.position=i,a.direction=Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z,this._scratchCartesian3),this._viewshedPrimitive._camera=a}catch(e){return!1}return this._viewshedPrimitive},x.prototype.createViewshedCameraPrimitive=function(e){null!=this._viewshedPrimitive&&v.scene.primitives.remove(this._viewshedPrimitive);var t=new Cesium.Camera(v.scene);if(null!=this._startPositionCartesian)return t.position=null!=e?e:this._startPositionCartesian,null!=this._viewshedDirection&&!isNaN(this._viewshedDirection.x)&&!isNaN(this._viewshedDirection.y)&&(t.direction=this._viewshedDirection.clone(),t.up=v.scene.globe.ellipsoid.geodeticSurfaceNormal(t.position,s)),t.frustum.isViewshed=!0,t.frustum.fov=Cesium.defaultValue(this._currentObject.viewshedObjOptions.fov,n),t.frustum._fovy=Cesium.defaultValue(this._currentObject.viewshedObjOptions.fovy,a),t.frustum.aspectRatio=Math.tan(t.frustum.fov/2)/Math.tan(t.frustum._fovy/2),t.frustum.near=1,!(this._currentRadius<=1)&&(t.frustum.far=Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius),this._viewshedPrimitive=v.scene.primitives.add(new Cesium.DebugCameraPrimitive({camera:t,color:this._primitiveColor})),this._viewshedPrimitive._numFrustrums=0,this._viewshedPrimitive._outlineOnlyFrustum=!0,this._viewshedPrimitive.update=this.updateViewshedPrimitive,this._viewshedPrimitive)},x.prototype.createViewshedMap=function(){null==v.scene.viewsheds&&v.scene.viewsheds,null!=this._viewshedPrimitive._camera&&this._canEnlarge&&(null==this._viewshedMap?(this._viewshedMap=new Cesium.ShadowMap({context:v.scene.context,lightCamera:this._viewshedPrimitive._camera,enabled:1,isSpotLight:!0,fromLightSource:!0,isPointLight:!1,softShadows:!1}),this._viewshedMap.show=!0,this._viewshedMap.isPreviewMode=!0,this._viewshedMap.guid="SamplerViewshed",this._viewshedMap):(this._viewshedMap._lightCamera.direction=this._viewshedPrimitive._camera.direction,this._viewshedMap._lightCamera.frustum.far=Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius)))},x.prototype.updateViewshedPrimitive=function(e){if(this.show){if(this._updateOnChange&&(this._outlinePrimitive=this._outlinePrimitive&&this._outlinePrimitive.destroy()),!Cesium.defined(this._outlinePrimitive)){var t=this._camera,i=t.frustum,r=e.frustumSplits,o=r.length-1;(o=this._numFrustrums)<=0&&((r=P)[0]=this._camera.frustum.near,r[1]=this._camera.frustum.far,o=1);var n,a,s=this._camera.viewMatrix;if(Cesium.defined(t.frustum.fovy)){var l=this._camera.frustum.projectionMatrix,u=Cesium.Matrix4.multiply(l,s,E);a=Cesium.Matrix4.inverse(u,E)}else n=Cesium.Matrix4.inverseTransformation(s,E);var c,h=new Float64Array(12*(o+1)+3);for(c=0;c<o+1;++c)for(var d=0;d<4;++d){var m=Cesium.Cartesian4.clone(S[d],x[d]);if(Cesium.defined(a)){var p=1/(m=Cesium.Matrix4.multiplyByVector(a,m,m)).w;Cesium.Cartesian3.multiplyByScalar(m,p,m),Cesium.Cartesian3.subtract(m,this._camera.positionWC,m),Cesium.Cartesian3.normalize(m,m);var g=Cesium.Cartesian3.dot(this._camera.directionWC,m);Cesium.Cartesian3.multiplyByScalar(m,r[c]/g,m),Cesium.Cartesian3.add(m,this._camera.positionWC,m)}else{var f,v;Cesium.defined(i._offCenterFrustum)&&(i=i._offCenterFrustum),v=c===o?(f=r[c-1],r[c]):(f=r[c],r[c+1]),m.x=.5*(m.x*(i.right-i.left)+i.left+i.right),m.y=.5*(m.y*(i.top-i.bottom)+i.bottom+i.top),m.z=.5*(m.z*(f-v)-f-v),m.w=1,Cesium.Matrix4.multiplyByVector(n,m,m)}h[12*c+3*d]=m.x,h[12*c+3*d+1]=m.y,h[12*c+3*d+2]=m.z}h[12*o+12]=this._camera.positionWC.x,h[12*o+12+1]=this._camera.positionWC.y,h[12*o+12+2]=this._camera.positionWC.z;var _=new Cesium.BoundingSphere.fromVertices(h),y=new Cesium.GeometryAttributes;y.position=new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h});var C,w,b=new Uint16Array(8*(2*o+1+1));for(c=0;c<o+1;++c)w=4*c,b[C=8*c]=w,b[C+1]=w+1,b[C+2]=w+1,b[C+3]=w+2,b[C+4]=w+2,b[C+5]=w+3,b[C+6]=w+3,b[C+7]=w;for(c=0;c<o;++c)w=4*c,b[C=8*(o+1+c)]=w,b[C+1]=w+4,b[C+2]=w+1,b[C+3]=w+5,b[C+4]=w+2,b[C+5]=w+6,b[C+6]=w+3,b[C+7]=w+7;b[C+=8]=w+8,b[C+1]=w+1,b[C+2]=w+8,b[C+3]=w+2,b[C+4]=w+8,b[C+5]=w+3,b[C+6]=w+8,b[C+7]=w+4,this._outlinePrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:{attributes:y,indices:b,primitiveType:Cesium.PrimitiveType.LINES,boundingSphere:_},attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})}this._outlinePrimitive.isViewshedPart=!0,this._outlinePrimitive.update(e)}},x.prototype.getHorizonDistance=function(e){return Math.sqrt(Math.pow(m+e,2)-Math.pow(m,2))},x.prototype.onPreFrame=function(e){var t,i;if(null!=this._currentObject&&null!=this._currentObject.viewshedPrimitive&&null!=this._currentObject.viewshedMap){t=new Cesium.Cartographic.fromCartesian(this._currentObject.viewshedPrimitive._camera.position);var r=this.getHorizonDistance(t.height);this._currentObject.viewshedMap.horizonCullingDistanceFromViewshed=r,i=v.scene.globe.getHeight(t),this._currentObject.viewshedMap.isBelowGround=t.height<i+.5}if(null!=this._currentObject&&this._currentObject.viewshedMap,null!=this._newPosition&&this.toPreviewMode(this._currentObject),this._canEnlarge&&null!=this._currentRadius&&this._prevRadius!=this._currentRadius)this._prevRadius=this._currentRadius,(this._isSpherical?this.createViewshedSpherePrimitive():this.createViewshedCameraPrimitive())&&this.createViewshedMap();else if(null!=this._currentObject&&this._setNewPosition&&null!=this._mousePositionX&&null!=this._mousePositionY)if(this.getPosXAndY(),this._currentObject.viewshedObjOptions.isSpherical)this._currentObject.viewshedMap._lightCamera.position=this._newPosition,this._currentObject.viewshedPrimitive=this.createViewshedSpherePrimitive(this._newPosition,this._currentObject.distance);else if(this.checkIfMouseOnPosition(),null!=this._newPosition){if(this._currentObject.viewshedObjOptions.altitudeMethod==p.ABOVE_GROUND_LEVEL&&null==this._zAxisNewPosition){var o=Cesium.Cartographic.fromCartesian(this._newPosition.clone()),n=Cesium.Cartesian3.fromRadians(o.longitude,o.latitude,v.scene.globe.getHeight(o)+this._currentObject.startingAltitudeAboveGround);this._currentObject.viewshedPrimitive._camera.position=n}else if(this._currentObject.viewshedObjOptions.altitudeMethod==p.ABOVE_MODEL&&null==this._zAxisNewPosition){o=Cesium.Cartographic.fromCartesian(this._newPosition.clone()),n=Cesium.Cartesian3.fromRadians(o.longitude,o.latitude,o.height+this._currentObject.startingAltitudeAboveModel);this._currentObject.viewshedPrimitive._camera.position=n}else this._currentObject.viewshedPrimitive._camera.position=this._newPosition;this.adjustDirections()}},x.prototype.onPreFrameMobile=function(e){var t,i;if(null!=this._currentObject&&null!=this._currentObject.viewshedPrimitive&&null!=this._currentObject.viewshedMap){t=new Cesium.Cartographic.fromCartesian(this._currentObject.viewshedPrimitive._camera.position);var r=this.getHorizonDistance(t.height);this._currentObject.viewshedMap.horizonCullingDistanceFromViewshed=r,i=v.scene.globe.getHeight(t),this._currentObject.viewshedMap.isBelowGround=t.height<i+.5}if(null!=this._currentObject&&this._currentObject.viewshedMap,null!=this._newPosition&&this.toPreviewMode(this._currentObject),this._canEnlarge&&null!=this._currentRadius)this._prevRadius=this._currentRadius,(this._isSpherical?this.createViewshedSpherePrimitive():this.createViewshedCameraPrimitive())&&this.createViewshedMap();else if(null!=this._currentObject&&this._setNewPosition&&null!=this._mousePositionX&&null!=this._mousePositionY)if(this.getPosXAndY(),this._currentObject.viewshedObjOptions.isSpherical)this._currentObject.viewshedMap._lightCamera.position=this._newPosition,this._currentObject.viewshedPrimitive=this.createViewshedSpherePrimitive(this._newPosition,this._currentObject.distance);else if(this.checkIfMouseOnPosition(),null!=this._newPosition){if(this._currentObject.viewshedObjOptions.altitudeMethod==p.ABOVE_GROUND_LEVEL&&null==this._zAxisNewPosition){var o=Cesium.Cartographic.fromCartesian(this._newPosition.clone()),n=Cesium.Cartesian3.fromRadians(o.longitude,o.latitude,v.scene.globe.getHeight(o)+this._currentObject.startingAltitudeAboveGround);this._currentObject.viewshedPrimitive._camera.position=n}else if(this._currentObject.viewshedObjOptions.altitudeMethod==p.ABOVE_MODEL&&null==this._zAxisNewPosition){o=Cesium.Cartographic.fromCartesian(this._newPosition.clone()),n=Cesium.Cartesian3.fromRadians(o.longitude,o.latitude,o.height+this._currentObject.startingAltitudeAboveModel);this._currentObject.viewshedPrimitive._camera.position=n}else this._currentObject.viewshedPrimitive._camera.position=this._newPosition;this.adjustDirections()}},x}),define("SGWorld/Analysis/Highvolume",["./Cdcl/Mjcl"],function(e){"use strict";function t(e,t){this._viewer=e,this._cesium=t}return t.prototype.Highvolume=function(e){var t=this._cesium.PostProcessStageLibrary.createEdgeDetectionStage();t.uniforms.color=this._cesium.Color.BLUE,t.uniforms.length=.01,t.selected=[],this._viewer.scene.postProcessStages.add(this._cesium.PostProcessStageLibrary.createSilhouetteStage([t]))},t}),define("SGWorld/Analysis/lineOfSight1",["../Core/Core","../Creator/Color","../ProjectTree/treeSource"],function(i,e,t){"use strict";var v,r,p=1e-5*Math.PI/180;function o(e,t){e=e,r=new(v=t).CesiumTerrainProvider({url:"http://192.168.1.39:8080/china"}),this._cesium=t,this._viewer=e,this._core=new i,this._points=[]}return o.prototype.createlineOfSightbws=function(e){var a,o=[],s=this,l=[],n=[],u=void 0,c=function(){function e(e){this.options={polyline:{show:!0,positions:[],width:1,material:s._cesium.Color.WHITESMOKE}},this.positionsp=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polyline.positions=new s._cesium.CallbackProperty(function(){return e.positionsp},!1),this.polyline=s._viewer.entities.add(this.options),s.item=this.polyline,n.push(this.polyline.id)},e}(),h=new s._cesium.ScreenSpaceEventHandler(s._viewer.scene.canvas),d=[],m=void 0,p=5e-5*Math.PI/180;h.setInputAction(function(e){var t=s._viewer.camera.getPickRay(e.position),i=s._viewer.scene.globe.pick(t,s._viewer.scene);if(0==d.length)d.push(i.clone()),d.push(i.clone()),u=i.clone();else{var r={postion:d,entity:n};l.push(r),m=void 0,(d=[]).push(u.clone()),d.push(u.clone()),m=new c(d),o.push(m)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),h.setInputAction(function(e){var t=s._viewer.camera.getPickRay(e.endPosition),i=s._viewer.scene.globe.pick(t,s._viewer.scene);2<=d.length&&(s._cesium.defined(m)?null!=i&&(d.pop(),i.y+=1+Math.random(),d.push(i)):(m=new c(d),o.push(m)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);var g=0;return h.setInputAction(function(e){for(var t=0;t<l.length;t++){var i=s._viewer.entities.getById(l[t].entity.id);s._viewer.entities.remove(i);var r=v.Cartographic.fromCartesian(l[t].postion[0]),o=v.Cartographic.fromCartesian(l[t].postion[1]);null,a=s.InterpolateLineCartographicxp(r,o,p);var n=s.InterpolateLineCartographic(r,o,p);s.CartographicPointsTerrainData(n,function(e){if(0<e.length){var t=[];t[0]=l[g].postion[0];for(var i=1;i<e.length-1;i++){var r=new v.Cartographic(a[i].longitude,a[i].latitude,a[i].height+15);if(e[i].height>=r.height){var o=v.Cartesian3.fromRadians(a[i].longitude,a[i].latitude,a[i].height);t.push(o);break}}if(t.push(l[g].postion[1]),3<=t.length)s._viewer.entities.add({name:"polyline2",polyline:{positions:l[g].postion,width:5,material:s._cesium.Color.RED}});else if(t.length=2)s._viewer.entities.add({name:"polylinee",polyline:{positions:l[g].postion,width:5,material:s._cesium.Color.BLUE}});g+=1}else alert("高程异常!")})}d.pop(),h.destroy()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},o.prototype.createlineOfSightZz=function(e){var o=[],d=this,m=[],p=[];d.objectsToExclude=null;var n=void 0,a=function(){function e(e){this.options={polyline:{show:!0,positions:[],width:1,material:d._cesium.Color.WHITESMOKE}},this.positionsp=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polyline.positions=new d._cesium.CallbackProperty(function(){return e.positionsp},!1),this.polyline=d._viewer.entities.add(this.options),d.item=this.polyline,p.push(this.polyline)},e}(),g=new d._cesium.ScreenSpaceEventHandler(d._viewer.scene.canvas),f=[],s=void 0;if(0<this._points.length)for(var t=0;t<this._points.length;t++)this._viewer.entities.remove(this._points[t]);Math.PI;g.setInputAction(function(e){var t=d._viewer.camera.getPickRay(e.position),i=d._viewer.scene.globe.pick(t,d._viewer.scene);if(0==f.length)f.push(i.clone()),f.push(i.clone()),n=i.clone();else{var r={postion:f,entity:p};m.push(r),s=void 0,(f=[]).push(n.clone()),f.push(n.clone()),s=new a(f),o.push(s)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),g.setInputAction(function(e){var t=d._viewer.camera.getPickRay(e.endPosition),i=d._viewer.scene.globe.pick(t,d._viewer.scene);2<=f.length&&(d._cesium.defined(s)?null!=i&&(f.pop(),i.y+=1+Math.random(),f.push(i)):(s=new a(f),o.push(s)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);return g.setInputAction(function(e){var t=d._viewer.entities.add(new d._cesium.Entity);d.objectsToExclude=[t];for(var i=0;i<m.length;i++){var r=!0,o=d._cesium.Cartesian3.normalize(v.Cartesian3.subtract(m[i].postion[1],m[i].postion[0],new d._cesium.Cartesian3),new d._cesium.Cartesian3),n=new d._cesium.Ray(m[0].postion[0],o);try{var a=d._viewer.scene.pickFromRay(n,d.objectsToExclude)}catch(e){r=!1}var s=[],l=[],u=0,c=0;try{a.position}catch(e){r=!1}null!=a&&r?(s.push(m[0].postion[0]),s.push(m[i].postion[1]),l.push(m[0].postion[0]),l.push(a.position),u=d._core.getHorizontalDistance(s,d._cesium),c=d._core.getHorizontalDistance(l,d._cesium),parseFloat(u)>parseFloat(c)?d._points.push(d._viewer.entities.add({name:"polyline1",polyline:{positions:m[i].postion,width:3,material:d._cesium.Color.RED}})):d._points.push(d._viewer.entities.add({polyline:{positions:m[i].postion,width:3,material:d._cesium.Color.BLUE}}))):d._points.push(d._viewer.entities.add({polyline:{positions:m[i].postion,width:3,material:d._cesium.Color.BLUE}}))}f.pop(),g.destroy();for(var h=0;h<p.length;h++)d._viewer.entities.remove(p[h])},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},o.prototype.createlineOfSight=function(e){var o=[],g=this,f=[],v=[];g.objectsToExclude=null;var n=void 0,a=function(){function e(e){this.options={polyline:{show:!0,positions:[],width:1,material:g._cesium.Color.WHITESMOKE}},this.positionsp=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polyline.positions=new g._cesium.CallbackProperty(function(){return e.positionsp},!1),this.polyline=g._viewer.entities.add(this.options),g.item=this.polyline,v.push(this.polyline)},e}(),_=new g._cesium.ScreenSpaceEventHandler(g._viewer.scene.canvas),y=[],s=void 0;if(0<this._points.length)for(var t=0;t<this._points.length;t++)this._viewer.entities.remove(this._points[t]);Math.PI;_.setInputAction(function(e){var t=g._viewer.camera.getPickRay(e.position),i=g._viewer.scene.globe.pick(t,g._viewer.scene);if(0==y.length)y.push(i.clone()),y.push(i.clone()),n=i.clone();else{var r={postion:y,entity:v};f.push(r),s=void 0,(y=[]).push(n.clone()),y.push(n.clone()),s=new a(y),o.push(s)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),_.setInputAction(function(e){var t=g._viewer.camera.getPickRay(e.endPosition),i=g._viewer.scene.globe.pick(t,g._viewer.scene);2<=y.length&&(g._cesium.defined(s)?null!=i&&(y.pop(),i.y+=1+Math.random(),y.push(i)):(s=new a(y),o.push(s)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);return _.setInputAction(function(e){var t=g._viewer.entities.add(new g._cesium.Entity);g.objectsToExclude=[t];for(var i=[],r=0;r<f.length;r++){i.push(f[r].postion[1]);var o=g._cesium.Cartographic.fromCartesian(f[r].postion[1]);g.objectsToExclude.push(g._viewer.entities.add({parent:t,name:r,position:g._cesium.Cartesian3.fromDegrees(g._cesium.Math.toDegrees(o.longitude),g._cesium.Math.toDegrees(o.latitude),30),ellipsoid:{radii:new g._cesium.Cartesian3(5,5,5),material:g._cesium.Color.RED}}))}for(var n=0;n<i.length;n++){var a=g._cesium.Cartesian3.normalize(g._cesium.Cartesian3.subtract(i[n],f[0].postion[0],new g._cesium.Cartesian3),new g._cesium.Cartesian3),s=new g._cesium.Ray(f[0].postion[0],a),l=g._viewer.scene.pickFromRay(s,g.objectsToExclude),u=[],c=[],h=0,d=0,m=[];m.push(f[0].postion[0]),m.push(i[n]),g._cesium.defined(l)&&g._cesium.defined(l.object)?(u.push(f[0].postion[0]),u.push(i[n]),c.push(f[0].postion[0]),c.push(l.position),h=g._core.getHorizontalDistance(u,g._cesium),d=g._core.getHorizontalDistance(c,g._cesium),parseFloat(h)>parseFloat(d)?g._points.push(g._viewer.entities.add({name:"polyline1",polyline:{positions:m,width:3,material:g._cesium.Color.RED}})):g._points.push(g._viewer.entities.add({polyline:{positions:m,width:3,material:g._cesium.Color.BLUE}}))):g._points.push(g._viewer.entities.add({polyline:{positions:m,width:3,material:g._cesium.Color.BLUE}}))}y.pop(),_.destroy();for(var p=0;p<v.length;p++)g._viewer.entities.remove(v[p])},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},o.prototype.deleteObject=function(){if(0<this._points.length){this.objectsToExclude=null;for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e])}},o.prototype.InterpolateLineCartographic=function(e,t,i){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var r=[];r.push(new v.Cartographic(e.longitude,e.latitude));var o=Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2)),n=i&&"number"==typeof i?i:p;if(o<=n)return r.push(new v.Cartographic(t.longitude,t.latitude)),r;for(var a=o/n,s=(t.longitude-e.longitude)/a,l=(t.latitude-e.latitude)/a,u=0;u<a;u++){var c=e.longitude+(u+1)*s,h=e.latitude+(u+1)*l;r.push(new v.Cartographic(c,h))}return r.push(new v.Cartographic(t.longitude,t.latitude,t.height)),r},o.prototype.InterpolateLineCartographicxp=function(e,t,i){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var r=[];r.push(new v.Cartographic(e.longitude,e.latitude));var o=Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2)),n=i&&"number"==typeof i?i:p;if(o<=n)return r.push(new v.Cartographic(t.longitude,t.latitude)),r;for(var a=o/n,s=(t.longitude-e.longitude)/a,l=(t.latitude-e.latitude)/a,u=(t.height-e.height)/a,c=0;c<a;c++){var h=e.longitude+(c+1)*s,d=e.latitude+(c+1)*l,m=e.height+u*(c+1);r.push(new v.Cartographic(h,d,m))}return r.push(new v.Cartographic(t.longitude,t.latitude,t.height)),r},o.prototype.InterpolateLineHeightCartographic=function(e,t){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var i=[];i.push(new v.Cartographic(e.longitude,e.latitude,e.height));var r=Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2));if(r<=p)return i.push(new v.Cartographic(t.longitude,t.latitude,t.height)),i;for(var o=r/p,n=(t.longitude-e.longitude)/o,a=(t.latitude-e.latitude)/o,s=(t.height-e.height)/o,l=0;l<o;l++){var u=e.longitude+(l+1)*n,c=e.latitude+(l+1)*a,h=e.height+(l+1)*s;i.push(new v.Cartographic(u,c,h))}return i.push(new v.Cartographic(t.longitude,t.latitude,t.height)),i},o.prototype.InterpolateIndexLineHeightCartographic=function(e,t,i,r){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var o=(t.longitude-e.longitude)/i,n=(t.latitude-e.latitude)/i,a=(t.height-e.height)/i,s=e.longitude+r*o,l=e.latitude+r*n,u=e.height+r*a;return new v.Cartographic(s,l,u)},o.prototype.InterpolateIndexLineHeightCartographicxp=function(e,t,i,r){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var o=(t.longitude-e.longitude)/i,n=(t.latitude-e.latitude)/i,a=(t.height-e.height)/i,s=e.longitude+r*o,l=e.latitude+r*n,u=e.height+r*a;return new v.Cartographic(s,l,u)},o.prototype.Interpolate2IndexLineHeightCartographic=function(e,t,i,r){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var o=[];o.push(new v.Cartographic(e.longitude,e.latitude,e.height));for(var n=(t.longitude-e.longitude)/i,a=(t.latitude-e.latitude)/i,s=(t.height-e.height)/i,l=0;l<r;l++){var u=e.longitude+(l+1)*n,c=e.latitude+(l+1)*a,h=e.height+(l+1)*s;o.push(new v.Cartographic(u,c,h))}return o},o.prototype.CartographicPointsTerrainData=function(e,t){if(e.length&&0<e.length){var i=v.sampleTerrain(r,11,e);v.when(i,function(e){t(e)})}},Object.defineProperties(o.prototype,{sight:{get:function(){return this.item.sight},set:function(e){this.item.sight=sight}}}),o}),define("SGWorld/Analysis/lineOfSightx",["../Core/Core","../Creator/Color","../ProjectTree/treeSource"],function(i,e,t){"use strict";var p,d=1e-5*Math.PI/180;function r(e,t){e=e,p=t,this._cesium=t,this._viewer=e,this._core=new i}return r.prototype.createlineOfSightx=function(e){""!=e&&null!=e&&e;var h=this,s=[],l=5e-5*Math.PI/180,u=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(h._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),(u=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene._imageryLayerCollection)).setInputAction(function(e){var t="目标点",i=h._viewer.camera.getPickRay(e.position),r=h._viewer.scene.globe.pick(i,h._viewer.scene);0==s.length&&(t="起始点"),s.push(r);h._viewer.entities.add({name:"通视分析",position:s[s.length-1],point:{pixelSize:5,color:h._cesium.Color.RED,outlineColor:h._cesium.Color.WHITE,outlineWidth:2},label:{text:t,show:!0,font:"18px sans-serif",fillColor:h._cesium.Color.GOLD,style:h._cesium.LabelStyle.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:h._cesium.VerticalOrigin.BOTTOM,pixelOffset:new h._cesium.Cartesian2(20,-20)}});if(1<s.length){u.destroy();var o=p.Cartographic.fromCartesian(s[0]),n=p.Cartographic.fromCartesian(s[1]),a=h.InterpolateLineCartographic(o,n,l);h.CartographicPointsTerrainData(a,function(e){if(0<e.length){for(var t=!0,i=[],r=[],o=1;o<e.length;o++){var n=!0;if(1<o){var a=new p.Cartographic(e[0].longitude,e[0].latitude,e[0].height+1.5);if(t)n=t=new h.InterpolateIndexLineHeightCartographic(a,e[o],o,o-1).height>=e[o-1].height;else for(var s=h.Interpolate2IndexLineHeightCartographic(a,e[o],o,o-1),l=0;l<s.length;l++){if(!(s[l].height>=e[l].height)){n=t=!1;break}n=t=!0}}var u=p.Cartesian3.fromRadians(e[o].longitude,e[o].latitude,e[o].height+.1);i.push(u),n?(r.push(0),r.push(0),r.push(1)):(r.push(1),r.push(0),r.push(0)),r.push(1)}var c=new d({viewer:h._viewer,Cartesians:i,Colors:r});primitiveKSY.push(c)}else alert("高程异常!")})}},this._cesium.ScreenSpaceEventType.LEFT_CLICK);var d=function(){var s,l,u,c,h;function e(e){if(h=e.viewer,s="attribute vec3 position3DHigh; attribute vec3 position3DLow; attribute vec4 color; varying vec4 v_color; attribute float batchId; void main() { vec4 p = czm_computePosition(); v_color =color; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; gl_PointSize=8.0; } ",l="varying vec4 v_color; void main() { float d = distance(gl_PointCoord, vec2(0.5,0.5)); if(d < 0.5){ gl_FragColor = v_color; }else{ discard; } } ",e.Cartesians&&2<=e.Cartesians.length){var t=[],i=[],r=[];if(e.Colors&&e.Colors.length===4*e.Cartesians.length){for(var o=0;o<e.Cartesians.length;o++)t.push(e.Cartesians[o].x),t.push(e.Cartesians[o].y),t.push(e.Cartesians[o].z);i=e.Colors}else for(o=0;o<e.Cartesians.length;o++)t.push(e.Cartesians[o].x),t.push(e.Cartesians[o].y),t.push(e.Cartesians[o].z),i.push(0),i.push(0),i.push(1),i.push(1);for(o=0;o<e.Cartesians.length;o++)r.push(o);this.positionArr=new Float64Array(t),this.colorArr=new Float32Array(i),this.indiceArr=new Uint16Array(r)}else{var n=p.Cartesian3.fromDegrees(0,0,-10),a=p.Cartesian3.fromDegrees(0,.001,-10);this.positionArr=new Float64Array([n.x,n.y,n.z,a.x,a.y,a.z]),this.colorArr=new Float32Array([0,0,1,1,0,0,1,1]),this.indiceArr=new Uint16Array([0,1])}u=d(this.positionArr,this.colorArr,this.indiceArr),c=m(l,s),this.primitive=h.scene.primitives.add(new p.Primitive({geometryInstances:new p.GeometryInstance({geometry:u}),appearance:c,asynchronous:!1}))}function d(e,t,i){return new p.Geometry({attributes:{position:new p.GeometryAttribute({componentDatatype:p.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),color:new p.GeometryAttribute({componentDatatype:p.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:t})},indices:i,primitiveType:p.PrimitiveType.POINTS,boundingSphere:p.BoundingSphere.fromVertices(e)})}function m(e,t){return new p.Appearance({renderState:{blending:p.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:!0},depthMask:!0},fragmentShaderSource:e,vertexShaderSource:t})}return e.prototype.remove=function(){null!=this.primitive&&(h.scene.primitives.remove(this.primitive),this.primitive=null)},e.prototype.updateCartesianPosition=function(e){if(null!=this.primitive&&(h.scene.primitives.remove(this.primitive),!(e&&e.length<2))){if(e.length===this.positionArr.length/3){var t=e[0],i=e[1];this.positionArr=new Float64Array([t.x,t.y,t.z,i.x,i.y,i.z]),u=d(this.positionArr,this.colorArr,this.indiceArr)}else{for(var r=[],o=[],n=[],a=0;a<e.length;a++)r.push(e[a].x),r.push(e[a].y),r.push(e[a].z),o.push(0),o.push(0),o.push(1),o.push(1);for(a=0;a<e.length;a++)n.push(a);this.positionArr=new Float64Array(r),this.colorArr=new Float32Array(o),this.indiceArr=new Uint16Array(n),u=d(this.positionArr,this.colorArr,this.indiceArr),c=m(l,s)}this.primitive=h.scene.primitives.add(new p.Primitive({geometryInstances:new p.GeometryInstance({geometry:u}),appearance:c,asynchronous:!1}))}},e.prototype.updateCartesianPositionColor=function(e,t){if(t.length===4*e.length&&null!=this.primitive&&(h.scene.primitives.remove(this.primitive),!(e&&e.length<2))){if(e.length===this.positionArr.length/3){var i=e[0],r=e[1];this.positionArr=new Float64Array([i.x,i.y,i.z,r.x,r.y,r.z]),this.colorArr=new Float32Array(t),u=d(this.positionArr,this.colorArr,this.indiceArr)}else{for(var o=[],n=[],a=0;a<e.length;a++)o.push(e[a].x),o.push(e[a].y),o.push(e[a].z);for(a=0;a<e.length;a++)n.push(a);this.positionArr=new Float64Array(o),this.colorArr=new Float32Array(t),this.indiceArr=new Uint16Array(n),u=d(this.positionArr,this.colorArr,this.indiceArr),c=m(l,s)}this.primitive=h.scene.primitives.add(new p.Primitive({geometryInstances:new p.GeometryInstance({geometry:u}),appearance:c,asynchronous:!1}))}},e}()},r.prototype.InterpolateLineCartographic=function(e,t,i){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var r=[];r.push(new p.Cartographic(e.longitude,e.latitude));var o=Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2)),n=i&&"number"==typeof i?i:d;if(o<=n)return r.push(new p.Cartographic(t.longitude,t.latitude)),r;for(var a=o/n,s=(t.longitude-e.longitude)/a,l=(t.latitude-e.latitude)/a,u=0;u<a;u++){var c=e.longitude+(u+1)*s,h=e.latitude+(u+1)*l;r.push(new p.Cartographic(c,h))}return r.push(new p.Cartographic(t.longitude,t.latitude,t.height)),r},r.prototype.InterpolateLineHeightCartographic=function(e,t){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var i=[];i.push(new p.Cartographic(e.longitude,e.latitude,e.height));var r=Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2));if(r<=d)return i.push(new p.Cartographic(t.longitude,t.latitude,t.height)),i;for(var o=r/d,n=(t.longitude-e.longitude)/o,a=(t.latitude-e.latitude)/o,s=(t.height-e.height)/o,l=0;l<o;l++){var u=e.longitude+(l+1)*n,c=e.latitude+(l+1)*a,h=e.height+(l+1)*s;i.push(new p.Cartographic(u,c,h))}return i.push(new p.Cartographic(t.longitude,t.latitude,t.height)),i},r.prototype.InterpolateIndexLineHeightCartographic=function(e,t,i,r){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var o=(t.longitude-e.longitude)/i,n=(t.latitude-e.latitude)/i,a=(t.height-e.height)/i,s=e.longitude+r*o,l=e.latitude+r*n,u=e.height+r*a;return new p.Cartographic(s,l,u)},r.prototype.Interpolate2IndexLineHeightCartographic=function(e,t,i,r){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var o=[];o.push(new p.Cartographic(e.longitude,e.latitude,e.height));for(var n=(t.longitude-e.longitude)/i,a=(t.latitude-e.latitude)/i,s=(t.height-e.height)/i,l=0;l<r;l++){var u=e.longitude+(l+1)*n,c=e.latitude+(l+1)*a,h=e.height+(l+1)*s;o.push(new p.Cartographic(u,c,h))}return o},r.prototype.CartographicPointsTerrainData=function(e,t){if(e.length&&0<e.length){var i=p.sampleTerrain(this._viewer.terrainProvider,11,e);p.when(i,function(e){t(e)})}},r}),define("SGWorld/Analysis/pointHandler",[],function(){"use strict";var e;function e(e,t){this._viewer=e,this._cesium=t}return(e=function(e){if(!(void 0)(e))throw new this._cesium.DeveloperError("viewer is required!");this.handler=new this._cesium.ScreenSpaceEventHandler(e.scene.canvas),this.viewer=e,this.isDrawing=!1,this.active=!1,this.drawCompletedEvent=new this._cesium.Event,this.markers=[],this.regions=[]}).prototype.activate=function(){this.active=!0;var t=this;this.handler.setInputAction(function(e){!function(e,t){var i=t;if(i&&i.active){var r=i.viewer,o=r.scene,n=o.pickPosition(e.position);if(n){var a=this._cesium.Cartographic.fromCartesian(n,o.globe.ellipsoid),s=this._cesium.Math.toDegrees(a.longitude),l=this._cesium.Math.toDegrees(a.latitude);if(a.height<0){var u=r.camera.pickEllipsoid(e.position,o.globe.ellipsoid),c=this._cesium.Cartographic.fromCartesian(u);s=this._cesium.Math.toDegrees(c.longitude),l=this._cesium.Math.toDegrees(c.latitude),n=this._cesium.Cartesian3.fromDegrees(s,l,0)}i.isDrawing=!0;var h=r.entities.add({position:n,point:{show:!0,color:this._cesium.Color.SKYBLUE,pixelSize:10,outlineColor:this._cesium.Color.YELLOW,outlineWidth:3}});i.markers.push(h),t.drawCompletedEvent.raiseEvent(h),t.deactivate()}}}(e,t)},this._cesium.ScreenSpaceEventType.LEFT_CLICK)},e.prototype.deactivate=function(){this.active=!1,this.isDrawing=!1,this.handler.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_CLICK)},e}),define("SGWorld/Analysis/Scan.PostProcessStage",["../Core/Core","../Core/jquery","../ProjectTree/treeSource"],function(i,e,r){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._tree=r}return t.prototype.createCircleScan=function(e,t,i,r){var o,n=new this._cesium.Cartographic.fromDegrees(e.lon,e.lat);o=i?this._cesium.Color.fromCssColorString(i):new Cesium.Color(1,0,0,1),this.item=this.AddCircleScanPostStage(n,this._cesium.defaultValue(t,1500),o,this._cesium.defaultValue(r,4e3));var a={id:this._core.getuid(),name:"新建扩散圆扫描",pId:0,type:"scan",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,0),this},t.prototype.createMultiCircleScan=function(e,t,i,r){var o,n=new this._cesium.Cartographic.fromDegrees(e.lon,e.lat);o=i?this._cesium.Color.fromCssColorString(i):new Cesium.Color(1,0,0,1),this.item=this.AddCircleScanMultiPostStage(n,this._cesium.defaultValue(t,1500),o,this._cesium.defaultValue(r,4e3));var a={id:this._core.getuid(),name:"新建扩散圆扫描",pId:0,type:"scan",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,0),this},t.prototype.createRadarScan=function(e,t,i,r){var o,n=new this._cesium.Cartographic.fromDegrees(e.lon,e.lat);o=i?this._cesium.Color.fromCssColorString(i):new Cesium.Color(1,0,0,1),this.item=this.AddRadarScanPostStage(n,this._cesium.defaultValue(t,1500),o,this._cesium.defaultValue(r,4e3));var a={id:this._core.getuid(),name:"新建雷达扫描",pId:0,type:"scan",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,0),this},t.prototype.createSectorScan=function(e,t,i,r,o,n){this._viewer;var a,s=this._cesium,l=new s.Cartographic.fromDegrees(e.lon,e.lat);a=i?s.Color.fromCssColorString(i):new s.Color(1,0,0,1),this.item=this.AddSectorScanPostStage(l,s.defaultValue(t,1500),a,r,o,s.defaultValue(n,4e3));var u={id:this._core.getuid(),name:"新建扇形扩散扫描",pId:0,type:"scan",item:this};return this.setTreeobj(u),this._tree.insertGroupId(u,0),this},t.prototype.AddSectorScanPostStage=function(e,t,i,r,o,n){var a=this._viewer,s=this._cesium,l=s.Cartographic.toCartesian(e),u=new s.Cartesian4(l.x,l.y,l.z,1),c=new s.Cartographic(e.longitude,e.latitude,e.height+500),h=s.Cartographic.toCartesian(c),d=new s.Cartesian4(h.x,h.y,h.z,1),m=((new Date).getTime(),new s.Cartesian4),p=new s.Cartesian4,g=new s.Cartesian3,f=new s.PostProcessStage({fragmentShader:"uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec4 u_scanCenterEC;\nuniform vec3 u_scanPlaneNormalEC;\nuniform float u_radius;\nuniform float u_maxRadius;\nuniform vec4 u_scanColor;\nuniform float u_angle;\nuniform float u_yaw;\nvec4 toEye(in vec2 uv, in float depth)\n {\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\nvec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)\n{\nvec3 v01 = point -planeOrigin;\nfloat d = dot(planeNormal, v01) ;\nreturn (point - planeNormal * d);\n}\nfloat getDepth(in vec4 depth)\n{\nfloat z_window = czm_unpackDepth(depth);\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nreturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\nfloat getAngle(in vec3 dv)\n{\n if(dv.y == 0.0 && dv.x > 0.0)\n {\n return 90.0;\n }\n if(dv.y == 0.0 && dv.x < 0.0)\n {\n return 270.0;\n }\n float angle = atan(dv.x/dv.y) * 180.0 / 3.1415926;\n if(dv.x > 0.0)\n {\n if(dv.y < 0.0)\n {\n angle = 180.0 + angle;\n }\n }\n if(dv.x <= 0.0)\n {\n if(dv.y < 0.0)\n {\n angle = 180.0 + angle;\n }\n if(dv.y > 0.0)\n {\n angle = 360.0 + angle;\n }\n }\n return angle;\n}\nfloat ripple(float dist, float rippleIntensity, float rippleScale) {\n return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n}\nvoid main()\n{\n gl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n float depth = getDepth( texture2D(depthTexture, v_textureCoordinates));\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\n float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\n if(dis < u_radius)\n {\n vec3 worldCoordi = (czm_inverseView * vec4(prjOnPlane,1.0)).xyz - (czm_inverseView * u_scanCenterEC).xyz; \n float angle = getAngle(worldCoordi);\n float maxAngle = fract((u_yaw + (u_angle/2.0))/360.0)*360.0;\n float minAngle = fract((u_yaw - (u_angle/2.0) + 360.0)/360.0)*360.0;\n bool showPixel = false; \n if(minAngle < maxAngle)\n {\n showPixel = angle > minAngle && angle < maxAngle;\n }\n else\n {\n showPixel = angle > minAngle || angle < maxAngle;\n }\n if(showPixel)\n {\n float f = dis / u_radius;\n f = 1.0 - f;\n gl_FragColor = mix(gl_FragColor, u_scanColor, f);\n float intensity =step(0.001,ripple(dis + 0.1, 0.1, 15.0));\n gl_FragColor.rgb += gl_FragColor.rgb * intensity;\n }\n }\n}\n",uniforms:{u_scanCenterEC:function(){return s.Matrix4.multiplyByVector(a.camera._viewMatrix,u,m)},u_scanPlaneNormalEC:function(){var e=s.Matrix4.multiplyByVector(a.camera._viewMatrix,u,m),t=s.Matrix4.multiplyByVector(a.camera._viewMatrix,d,p);return g.x=t.x-e.x,g.y=t.y-e.y,g.z=t.z-e.z,s.Cartesian3.normalize(g,g),g},u_radius:function(){return t},u_angle:function(){return r},u_yaw:function(){return o+150},u_maxRadius:t,u_scanColor:i}});return a.scene.postProcessStages.add(f)},t.prototype.AddCircleScanPostStage=function(e,t,i,r){var o=this._viewer,n=this._cesium,a=n.Cartographic.toCartesian(e),s=new n.Cartesian4(a.x,a.y,a.z,1),l=new n.Cartographic(e.longitude,e.latitude,e.height+500),u=n.Cartographic.toCartesian(l),c=new n.Cartesian4(u.x,u.y,u.z,1),h=(new Date).getTime(),d=new n.Cartesian4,m=new n.Cartesian4,p=new n.Cartesian3,g=new n.PostProcessStage({fragmentShader:"uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec4 u_scanCenterEC;\nuniform vec3 u_scanPlaneNormalEC;\nuniform float u_radius;\nuniform vec4 u_scanColor;\nvec4 toEye(in vec2 uv, in float depth)\n {\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\nvec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)\n{\nvec3 v01 = point -planeOrigin;\nfloat d = dot(planeNormal, v01) ;\nreturn (point - planeNormal * d);\n}\nfloat getDepth(in vec4 depth)\n{\nfloat z_window = czm_unpackDepth(depth);\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nreturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\nvoid main()\n{\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\nfloat depth = getDepth( texture2D(depthTexture, v_textureCoordinates));\nvec4 viewPos = toEye(v_textureCoordinates, depth);\nvec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\nfloat dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\nif(dis < u_radius)\n{\nfloat f = 1.0 -abs(u_radius - dis) / u_radius;\nf = pow(f, 4.0);\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}\n}\n",uniforms:{u_scanCenterEC:function(){return n.Matrix4.multiplyByVector(o.camera._viewMatrix,s,d)},u_scanPlaneNormalEC:function(){var e=n.Matrix4.multiplyByVector(o.camera._viewMatrix,s,d),t=n.Matrix4.multiplyByVector(o.camera._viewMatrix,c,m);return p.x=t.x-e.x,p.y=t.y-e.y,p.z=t.z-e.z,n.Cartesian3.normalize(p,p),p},u_radius:function(){return t*(((new Date).getTime()-h)%r)/r},u_scanColor:i}});return o.scene.postProcessStages.add(g)},t.prototype.AddCircleScanMultiPostStage=function(e,t,i,r){var o=this._viewer,n=this._cesium,a=n.Cartographic.toCartesian(e),s=new n.Cartesian4(a.x,a.y,a.z,1),l=new n.Cartographic(e.longitude,e.latitude,e.height+500),u=n.Cartographic.toCartesian(l),c=new n.Cartesian4(u.x,u.y,u.z,1),h=(new Date).getTime(),d=new n.Cartesian4,m=new n.Cartesian4,p=new n.Cartesian3,g=0,f=0,v=0,_=new n.PostProcessStage({fragmentShader:"uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec4 u_scanCenterEC;\nuniform vec3 u_scanPlaneNormalEC;\nuniform float u_radius1;\nuniform float u_radius2;\nuniform float u_radius3;\nuniform float u_maxRadius;\nuniform vec4 u_scanColor;\nvec4 toEye(in vec2 uv, in float depth)\n {\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\nvec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)\n{\nvec3 v01 = point -planeOrigin;\nfloat d = dot(planeNormal, v01) ;\nreturn (point - planeNormal * d);\n}\nfloat getDepth(in vec4 depth)\n{\nfloat z_window = czm_unpackDepth(depth);\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nreturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\nvoid main()\n{\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\nfloat depth = getDepth( texture2D(depthTexture, v_textureCoordinates));\nvec4 viewPos = toEye(v_textureCoordinates, depth);\nvec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\nfloat dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\nif(dis < u_radius1)\n{\nfloat f = dis / u_radius1;\nf = pow(f, 9.0);\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}else if(dis < u_radius2){\nfloat f = dis / u_radius2;\nf = pow(f, 9.0);\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}else if(dis < u_radius3){\nfloat f = dis / u_radius3;\nf = pow(f, 9.0);\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}\n}\n",uniforms:{u_scanCenterEC:function(){return n.Matrix4.multiplyByVector(o.camera._viewMatrix,s,d)},u_scanPlaneNormalEC:function(){var e=n.Matrix4.multiplyByVector(o.camera._viewMatrix,s,d),t=n.Matrix4.multiplyByVector(o.camera._viewMatrix,c,m);return p.x=t.x-e.x,p.y=t.y-e.y,p.z=t.z-e.z,n.Cartesian3.normalize(p,p),p},u_radius1:function(){return g},u_radius2:function(){return f},u_radius3:function(){var e=t*(((new Date).getTime()-h)%r)/r;return e<t/3&&0===f&&0===g?v=e:t/3<=e&&e<2*t/3&&0===g?f=(v=e)-t/3:2*t/3<=e?(f=(v=e)-t/3,g=v-2*t/3):e<t/3&&0!==f&&0!==g?(f=(g=e)+t/3,v=e+2*t/3):t/3<=e&&e<2*t/3&&0!==g&&(g=e-t/3,v=(f=e)+t/3),v},u_maxRadius:t,u_scanColor:i}});return o.scene.postProcessStages.add(_)},t.prototype.AddRadarScanPostStage=function(e,t,i,o){var n=this._viewer,a=this._cesium,r=a.Cartographic.toCartesian(e),s=new a.Cartesian4(r.x,r.y,r.z,1),l=new a.Cartographic(e.longitude,e.latitude,e.height+500),u=a.Cartographic.toCartesian(l),c=new a.Cartesian4(u.x,u.y,u.z,1),h=new a.Cartographic(e.longitude+a.Math.toRadians(.001),e.latitude,e.height),d=a.Cartographic.toCartesian(h),m=new a.Cartesian4(d.x,d.y,d.z,1),p=new a.Quaternion,g=new a.Matrix3,f=(new Date).getTime(),v=new a.Cartesian4,_=new a.Cartesian4,y=new a.Cartesian4,C=new a.Cartesian3,w=new a.Cartesian3,b=new a.PostProcessStage({fragmentShader:"uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec4 u_scanCenterEC;\nuniform vec3 u_scanPlaneNormalEC;\nuniform vec3 u_scanLineNormalEC;\nuniform float u_radius;\nuniform vec4 u_scanColor;\nvec4 toEye(in vec2 uv, in float depth)\n {\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\nbool isPointOnLineRight(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt)\n{\nvec3 v01 = testPt - ptOnLine;\nnormalize(v01);\nvec3 temp = cross(v01, lineNormal);\nfloat d = dot(temp, u_scanPlaneNormalEC);\nreturn d > 0.5;\n}\nvec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)\n{\nvec3 v01 = point -planeOrigin;\nfloat d = dot(planeNormal, v01) ;\nreturn (point - planeNormal * d);\n}\nfloat distancePointToLine(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt)\n{\nvec3 tempPt = pointProjectOnPlane(lineNormal, ptOnLine, testPt);\nreturn length(tempPt - ptOnLine);\n}\nfloat getDepth(in vec4 depth)\n{\nfloat z_window = czm_unpackDepth(depth);\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nreturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\nvoid main()\n{\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\nfloat depth = getDepth( texture2D(depthTexture, v_textureCoordinates));\nvec4 viewPos = toEye(v_textureCoordinates, depth);\nvec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\nfloat dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\nfloat twou_radius = u_radius * 2.0;\nif(dis < u_radius)\n{\nvec3 lineEndPt = vec3(u_scanCenterEC.xyz) + u_scanLineNormalEC * u_radius;\nfloat f = 0.0;\nif(isPointOnLineRight(u_scanCenterEC.xyz, u_scanLineNormalEC.xyz, prjOnPlane.xyz))\n{\nfloat dis1= length(prjOnPlane.xyz - lineEndPt);\nf = abs(twou_radius -dis1) / twou_radius;\nf = pow(f, 3.0);\n}\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}\n}\n",uniforms:{u_scanCenterEC:function(){return a.Matrix4.multiplyByVector(n.camera._viewMatrix,s,v)},u_scanPlaneNormalEC:function(){var e=a.Matrix4.multiplyByVector(n.camera._viewMatrix,s,v),t=a.Matrix4.multiplyByVector(n.camera._viewMatrix,c,_);return C.x=t.x-e.x,C.y=t.y-e.y,C.z=t.z-e.z,a.Cartesian3.normalize(C,C),C},u_radius:t,u_scanLineNormalEC:function(){var e=a.Matrix4.multiplyByVector(n.camera._viewMatrix,s,v),t=a.Matrix4.multiplyByVector(n.camera._viewMatrix,c,_),i=a.Matrix4.multiplyByVector(n.camera._viewMatrix,m,y);C.x=t.x-e.x,C.y=t.y-e.y,C.z=t.z-e.z,a.Cartesian3.normalize(C,C),w.x=i.x-e.x,w.y=i.y-e.y,w.z=i.z-e.z;var r=((new Date).getTime()-f)%o/o;return a.Quaternion.fromAxisAngle(C,r*a.Math.PI*2,p),a.Matrix3.fromQuaternion(p,g),a.Matrix3.multiplyByVector(g,w,w),a.Cartesian3.normalize(w,w),w},u_scanColor:i}});return n.scene.postProcessStages.add(b)},t.prototype.remove=function(){this._viewer.scene.postProcessStages.remove(this.item)},t.prototype.setTreeobj=function(e){this.treeobj=e},t.prototype.deleteObject=function(){this.item&&this._viewer.scene.postProcessStages.remove(this.item)},t.prototype.setVisibility=function(e){this.item&&(this.item.enabled=e)},t}),define("SGWorld/Application/Application",[],function(){return function(){}}),define("SGWorld/Command/defined",[],function(){"use strict";return function(e){return null!=e}}),define("SGWorld/Command/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),i=Object.defineProperties;return t&&e(i)||(i=function(e){return e}),i}),define("SGWorld/Core/Cartesian3_to_WGS84",[],function(){"use strict";return function(e){var t=new Cesium.Cartesian3(e.x,e.y,e.z),i=Cesium.Cartographic.fromCartesian(t);return{lat:Cesium.Math.toDegrees(i.latitude),lng:Cesium.Math.toDegrees(i.longitude),alt:i.height}}}),define("SGWorld/Core/DrawHelper",[],function(){"use strict";var b=function(){var p,i,r,h,o,n,a,s,c;function g(e){var t;this._scene=e.scene,this._viewer=e,this._cameraPosition=null,this._cameraHeading=null,this._cameraPitch=null,this._cameraRoll=null,this._tooltip=((t=function(){var e=document.createElement("DIV");e.className="twipsy right";var t=document.createElement("DIV");t.className="twipsy-arrow",e.appendChild(t);var i=document.createElement("DIV");i.className="twipsy-inner",e.appendChild(i),this._div=e,this._title=i,$(".cesium-viewer").append(e)}).prototype.setVisible=function(e){this._div.style.display=e?"block":"none"},t.prototype.showAt=function(e,t){e&&t&&(this.setVisible(!0),this._title.innerHTML=t,this._div.style.left=e.x+10+"px",this._div.style.top=e.y-this._div.clientHeight/2+"px")},new t),this._surfaces=[],this.initialiseHandlers(),this.enhancePrimitives(),p=Cesium.Ellipsoid.WGS84,(i=Cesium.Material.fromType(Cesium.Material.ColorType)).uniforms.color=new Cesium.Color(1,1,0,.5),r={ellipsoid:Cesium.Ellipsoid.WGS84,textureRotationAngle:0,height:0,asynchronous:!0,show:!0,debugShowBoundingVolume:!1},h=C(r,{appearance:new Cesium.EllipsoidSurfaceAppearance({aboveGround:!1}),material:i,granularity:Math.PI/180}),o=C(r,{}),n=C(r,{}),a=C(r,{}),s=C(h,{rotation:0}),c=C(r,{width:5,geodesic:!0,granularity:1e4,appearance:new Cesium.PolylineMaterialAppearance({aboveGround:!1}),material:i})}g.prototype.initialiseHandlers=function(){var i,r=this._scene,o=this,e=new Cesium.ScreenSpaceEventHandler(r.canvas);function t(e,t){if(1!=o._handlersMuted){var i=r.pick(t);i&&i.primitive&&i.primitive[e]&&i.primitive[e](t)}}e.setInputAction(function(e){t("leftClick",e.position)},Cesium.ScreenSpaceEventType.LEFT_CLICK),e.setInputAction(function(e){t("leftDoubleClick",e.position)},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),e.setInputAction(function(e){if(1!=o._handlersMuted){var t=r.pick(e.endPosition);!i||t&&i==t.primitive||((!i.isDestroyed||!i.isDestroyed())&&i.mouseOut(e.endPosition),i=null),t&&t.primitive&&((t=t.primitive).mouseOut&&(i=t),t.mouseMove&&t.mouseMove(e.endPosition))}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),e.setInputAction(function(e){t("leftUp",e.position)},Cesium.ScreenSpaceEventType.LEFT_UP),e.setInputAction(function(e){t("leftDown",e.position)},Cesium.ScreenSpaceEventType.LEFT_DOWN)},g.prototype.setListener=function(e,t,i){e[t]=i},g.prototype.muteHandlers=function(e){this._handlersMuted=e},g.prototype.registerEditableShape=function(t){var i=this;u(t,"mouseMove",function(e){t.setHighlighted(!0),t._editMode||i._tooltip.showAt(e,"点击编辑图形")}),u(t,"mouseOut",function(e){t.setHighlighted(!1),i._tooltip.setVisible(!1)}),u(t,"leftClick",function(e){t.setEditMode(!0)})},g.prototype.startDrawing=function(e){this.disableAllEditMode(),this.editCleanUp&&this.editCleanUp(),this.editCleanUp=e,this.muteHandlers(!0)},g.prototype.stopDrawing=function(){this.editCleanUp&&(this.editCleanUp(),this.editCleanUp=null),this.muteHandlers(!1)},g.prototype.disableAllHighlights=function(){this.setHighlighted(void 0)},g.prototype.setHighlighted=function(e){this._highlightedSurface&&!this._highlightedSurface.isDestroyed()&&this._highlightedSurface!=e&&this._highlightedSurface.setHighlighted(!1),this._highlightedSurface=e},g.prototype.disableAllEditMode=function(){this.setEdited(void 0)},g.prototype.setEdited=function(e){this._editedSurface&&!this._editedSurface.isDestroyed()&&this._editedSurface.setEditMode(!1),this._editedSurface=e};var t=function(){function e(){}return e.prototype.initialiseOptions=function(e){m(this,e),this._ellipsoid=void 0,this._granularity=void 0,this._height=void 0,this._textureRotationAngle=void 0,this._id=void 0,this._createPrimitive=!0,this._primitive=void 0,this._outlinePolygon=void 0},e.prototype.setAttribute=function(e,t){this[e]=t,this._createPrimitive=!0},e.prototype.getAttribute=function(e){return this[e]},e.prototype.update=function(e,t,i){if(!Cesium.defined(this.ellipsoid))throw new Cesium.DeveloperError("this.ellipsoid must be defined.");if(!Cesium.defined(this.appearance))throw new Cesium.DeveloperError("this.material must be defined.");if(this.granularity<0)throw new Cesium.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(this.show&&(this._createPrimitive||Cesium.defined(this._primitive))){if(this._createPrimitive||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){var r=this.getGeometry();if(!r)return;this._createPrimitive=!1,this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id,this._primitive=this._primitive&&this._primitive.destroy(),this._primitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:r,id:this.id,pickPrimitive:this}),appearance:this.appearance,asynchronous:this.asynchronous}),this._outlinePolygon=this._outlinePolygon&&this._outlinePolygon.destroy(),this.strokeColor&&this.getOutlineGeometry&&(this._outlinePolygon=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:this.getOutlineGeometry(),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)}}),appearance:new Cesium.PerInstanceColorAppearance({flat:!0,renderState:{depthTest:{enabled:!0},lineWidth:Math.min(this.strokeWidth)}})}))}var o=this._primitive;o.appearance.material=this.material,o.debugShowBoundingVolume=this.debugShowBoundingVolume,o.update(e,t,i),this._outlinePolygon&&this._outlinePolygon.update(e,t,i)}},e.prototype.isDestroyed=function(){return!1},e.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),Cesium.destroyObject(this)},e.prototype.setStrokeStyle=function(e,t){this.strokeColor&&this.strokeColor.equals(e)&&this.strokeWidth==t||(this._createPrimitive=!0,this.strokeColor=e,this.strokeWidth=t)},e}();g.ExtentPrimitive=function(){function e(e){if(!Cesium.defined(e.extent))throw new Cesium.DeveloperError("Extent is required");e=C(e,h),this.initialiseOptions(e),this.setExtent(e.extent)}return(e.prototype=new t).setExtent=function(e){this.setAttribute("extent",e)},e.prototype.getExtent=function(){return this.getAttribute("extent")},e.prototype.getGeometry=function(){if(Cesium.defined(this.extent))return new Cesium.RectangleGeometry({rectangle:this.extent,height:this.height,vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},e.prototype.getOutlineGeometry=function(){return new Cesium.RectangleOutlineGeometry({rectangle:this.extent})},e}(),g.PolygonPrimitive=function(){function e(e){e=C(e,h),this.initialiseOptions(e),this.isPolygon=!0}return(e.prototype=new t).setPositions=function(e){this.setAttribute("positions",e)},e.prototype.getPositions=function(){return this.getAttribute("positions")},e.prototype.getGeometry=function(){if(Cesium.defined(this.positions)&&!(this.positions.length<3))return Cesium.PolygonGeometry.fromPositions({positions:this.positions,height:this.height,vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},e.prototype.getOutlineGeometry=function(){return Cesium.PolygonOutlineGeometry.fromPositions({positions:this.getPositions()})},e}(),g.CirclePrimitive=function(){function e(e){if(!Cesium.defined(e.center)||!Cesium.defined(e.radius))throw new Cesium.DeveloperError("Center and radius are required");e=C(e,h),this.initialiseOptions(e),this.setRadius(e.radius)}return(e.prototype=new t).setCenter=function(e){this.setAttribute("center",e)},e.prototype.setRadius=function(e){this.setAttribute("radius",Math.max(.1,e))},e.prototype.getCenter=function(){return this.getAttribute("center")},e.prototype.getRadius=function(){return this.getAttribute("radius")},e.prototype.getGeometry=function(){if(Cesium.defined(this.center)&&Cesium.defined(this.radius))return new Cesium.CircleGeometry({center:this.center,radius:this.radius,height:this.height,vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},e.prototype.getOutlineGeometry=function(){return new Cesium.CircleOutlineGeometry({center:this.getCenter(),radius:this.getRadius()})},e}(),g.EllipsePrimitive=function(){function e(e){if(!(Cesium.defined(e.center)&&Cesium.defined(e.semiMajorAxis)&&Cesium.defined(e.semiMinorAxis)))throw new Cesium.DeveloperError("Center and semi major and semi minor axis are required");e=C(e,s),this.initialiseOptions(e)}return(e.prototype=new t).setCenter=function(e){this.setAttribute("center",e)},e.prototype.setSemiMajorAxis=function(e){e<this.getSemiMinorAxis()||this.setAttribute("semiMajorAxis",e)},e.prototype.setSemiMinorAxis=function(e){e>this.getSemiMajorAxis()||this.setAttribute("semiMinorAxis",e)},e.prototype.setRotation=function(e){return this.setAttribute("rotation",e)},e.prototype.getCenter=function(){return this.getAttribute("center")},e.prototype.getSemiMajorAxis=function(){return this.getAttribute("semiMajorAxis")},e.prototype.getSemiMinorAxis=function(){return this.getAttribute("semiMinorAxis")},e.prototype.getRotation=function(){return this.getAttribute("rotation")},e.prototype.getGeometry=function(){if(Cesium.defined(this.center)&&Cesium.defined(this.semiMajorAxis)&&Cesium.defined(this.semiMinorAxis))return new Cesium.EllipseGeometry({ellipsoid:this.ellipsoid,center:this.center,semiMajorAxis:this.semiMajorAxis,semiMinorAxis:this.semiMinorAxis,rotation:this.rotation,height:this.height,vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,granularity:this.granularity})},e.prototype.getOutlineGeometry=function(){return new Cesium.EllipseOutlineGeometry({center:this.getCenter(),semiMajorAxis:this.getSemiMajorAxis(),semiMinorAxis:this.getSemiMinorAxis(),rotation:this.getRotation()})},e}(),g.PolylinePrimitive=function(){function e(e){e=C(e,c),this.initialiseOptions(e)}return(e.prototype=new t).setPositions=function(e){this.setAttribute("positions",e)},e.prototype.setWidth=function(e){this.setAttribute("width",e)},e.prototype.setGeodesic=function(e){this.setAttribute("geodesic",e)},e.prototype.getPositions=function(){return this.getAttribute("positions")},e.prototype.getWidth=function(){return this.getAttribute("width")},e.prototype.getGeodesic=function(e){return this.getAttribute("geodesic")},e.prototype.getGeometry=function(){if(Cesium.defined(this.positions)&&!(this.positions.length<2))return new Cesium.PolylineGeometry({positions:this.positions,height:this.height,width:this.width<1?1:this.width,vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,ellipsoid:this.ellipsoid})},e}();var d={iconUrl:"Content/images/dragIcon.png",shiftX:0,shiftY:0},f={iconUrl:"Content/images/dragIcon.png",shiftX:0,shiftY:0},v={iconUrl:"Content/images/dragIconLight.png",shiftX:0,shiftY:0};function _(e){return p.cartographicArrayToCartesianArray([Cesium.Rectangle.northwest(e),Cesium.Rectangle.northeast(e),Cesium.Rectangle.southeast(e),Cesium.Rectangle.southwest(e)])}function y(e,t){var i=new Cesium.Rectangle;i.west=Math.min(e.longitude,t.longitude),i.east=Math.max(e.longitude,t.longitude),i.south=Math.min(e.latitude,t.latitude),i.north=Math.max(e.latitude,t.latitude);var r=Cesium.Math.EPSILON7;return i.east-i.west<r&&(i.east+=2*r),i.north-i.south<r&&(i.north+=2*r),i}function l(e,t){if(null==e||"object"!=(void 0===e?"undefined":_typeof2(e)))return e;if(e.constructor!=Object&&e.constructor!=Array)return e;if(e.constructor==Date||e.constructor==RegExp||e.constructor==Function||e.constructor==String||e.constructor==Number||e.constructor==Boolean)return new e.constructor(e);for(var i in t=t||new e.constructor,e)t[i]=void 0===t[i]?l(e[i],null):t[i];return t}function m(e,t){var i;for(i in e=e||{},t)void 0===e[i]&&(e[i]=l(t[i]))}function C(e,t){var i,r=l(e);for(i in t)void 0===r[i]&&(r[i]=l(t[i]));return r}function u(e,t,i){e[t]=i}function w(e){e._listeners={},e.addListener=function(e,t){return this._listeners[e]=this._listeners[e]||[],this._listeners[e].push(t),this._listeners[e].length},e.executeListeners=function(e,t){if(this._listeners[e.name]&&0<this._listeners[e.name].length)for(var i=0;i<this._listeners[e.name].length;i++)this._listeners[e.name][i](e);else t&&t(e)}}return g.prototype.createBillboardGroup=function(e,t,i){var r=new g.BillboardGroup(this,t);return r.addBillboards(e,i),r},(g.BillboardGroup=function(e,t){this._drawHelper=e,this._scene=e._scene,this._options=C(t,d);var i=new Cesium.BillboardCollection;this._scene.primitives.add(i),this._billboards=i,this._orderedBillboards=[]}).prototype.createBillboard=function(e,r){var o=this._billboards.add({show:!0,position:e,pixelOffset:new Cesium.Cartesian2(this._options.shiftX,this._options.shiftY),eyeOffset:new Cesium.Cartesian3(0,0,0),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,scale:1,image:this._options.iconUrl,color:new Cesium.Color(1,1,1,1)});function n(e){t.enableRotate=e}function a(){for(var e=0,t=s._orderedBillboards.length;e<t&&s._orderedBillboards[e]!=o;++e);return e}if(r){var s=this,t=this._scene.screenSpaceCameraController;if(r.dragHandlers){s=this;u(o,"leftDown",function(e){function i(e){t.destroy(),n(!0),r.dragHandlers.onDragEnd&&r.dragHandlers.onDragEnd(a(),e)}var t=new Cesium.ScreenSpaceEventHandler(s._scene.canvas);t.setInputAction(function(e){var t=s._scene.camera.pickEllipsoid(e.endPosition,p);t?function(e){o.position=e;for(var t=0,i=s._orderedBillboards.length;t<i&&s._orderedBillboards[t]!=o;++t);r.dragHandlers.onDrag&&r.dragHandlers.onDrag(a(),e)}(t):i(t)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),t.setInputAction(function(e){i(s._scene.camera.pickEllipsoid(e.position,p))},Cesium.ScreenSpaceEventType.LEFT_UP),n(!1),r.dragHandlers.onDragStart&&r.dragHandlers.onDragStart(a(),s._scene.camera.pickEllipsoid(e,p))})}r.onDoubleClick&&u(o,"leftDoubleClick",function(e){r.onDoubleClick(a())}),r.onClick&&u(o,"leftClick",function(e){r.onClick(a())}),r.tooltip&&(u(o,"mouseMove",function(e){s._drawHelper._tooltip.showAt(e,r.tooltip())}),u(o,"mouseOut",function(e){s._drawHelper._tooltip.setVisible(!1)}))}return o},g.BillboardGroup.prototype.insertBillboard=function(e,t,i){this._orderedBillboards.splice(e,0,this.createBillboard(t,i))},g.BillboardGroup.prototype.addBillboard=function(e,t){this._orderedBillboards.push(this.createBillboard(e,t))},g.BillboardGroup.prototype.addBillboards=function(e,t){for(var i=0;i<e.length;i++)this.addBillboard(e[i],t)},g.BillboardGroup.prototype.updateBillboardsPositions=function(e){for(var t=0;t<e.length;t++)this.getBillboard(t).position=e[t]},g.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length},g.BillboardGroup.prototype.getBillboard=function(e){return this._orderedBillboards[e]},g.BillboardGroup.prototype.removeBillboard=function(e){this._billboards.remove(this.getBillboard(e)),this._orderedBillboards.splice(e,1)},g.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()},g.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)},g.prototype.startDrawingMarker=function(i){i=C(i,d);this.startDrawing(function(){o.remove(),e.destroy(),a.setVisible(!1)});var r=this,n=this._scene,a=(n.primitives,this._tooltip),o=new g.BillboardGroup(this,i),e=new Cesium.ScreenSpaceEventHandler(n.canvas);e.setInputAction(function(e){if(null!=e.position){var t=n.camera.pickEllipsoid(e.position,p);t&&(o.addBillboard(t),r.stopDrawing(),i.callback(t))}},Cesium.ScreenSpaceEventType.LEFT_CLICK),e.setInputAction(function(e){var t,i,r=e.endPosition;if(null!=r){var o=n.camera.pickEllipsoid(r,p);o?a.showAt(r,"<p>点击添加标记 位置是: </p>"+((t=p.cartesianToCartographic(o)).longitude.toFixed(i||3)+", "+t.latitude.toFixed(i||3))):a.showAt(r,"<p>点击添加标记</p>")}},Cesium.ScreenSpaceEventType.MOUSE_MOVE)},g.prototype.startDrawingPolygon=function(e){e=C(e,h);this.startDrawingPolyshape(!0,e)},g.prototype.startDrawingPolyline=function(e){e=C(e,c);this.startDrawingPolyshape(!1,e)},g.prototype.startDrawingPolyshape=function(e,i){this.startDrawing(function(){t.remove(r),u.remove(),c.destroy(),a.setVisible(!1)});var r,o=this,n=this._scene,t=n.primitives,a=this._tooltip,s=e?3:2;(r=e?new b.PolygonPrimitive(i):new b.PolylinePrimitive(i)).asynchronous=!1,t.add(r);var l=[],u=new g.BillboardGroup(this,d),c=new Cesium.ScreenSpaceEventHandler(n.canvas);c.setInputAction(function(e){if(null!=e.position){var t=n.camera.pickEllipsoid(e.position,p);t&&(0==l.length&&(l.push(t.clone()),u.addBillboard(l[0]),o._viewer.camera&&(o._cameraPosition=o._viewer.camera.position,o._cameraHeading=o._viewer.camera.heading,o._cameraPitch=o._viewer.camera.pitch,o._cameraRoll=o._viewer.camera.roll)),l.length>=s&&(r.positions=l,r._createPrimitive=!0),l.push(t),u.addBillboard(t))}},Cesium.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(e){var t=e.endPosition;if(null!=t)if(0==l.length)a.showAt(t,"<p>添加第一个点</p>");else{var i=n.camera.pickEllipsoid(t,p);i&&(l.pop(),i.y+=1+Math.random(),l.push(i),l.length>=s&&(r.positions=l,r._createPrimitive=!0),u.getBillboard(l.length-1).position=i,a.showAt(t,"<p>添加一个新的坐标点 ("+l.length+")</p>"+(l.length>s?"<p>双击完成多边形绘制</p>":"")))}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),c.setInputAction(function(e){var t=e.position;if(null!=t){if(l.length<s+2)return;if(n.camera.pickEllipsoid(t,p)&&(o.stopDrawing(),"function"==typeof i.callback)){l.length;i.callback(l)}}},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)},g.prototype.startDrawingExtent=function(i){i=C(i,h);this.startDrawing(function(){null!=l&&n.remove(l),u.remove(),e.destroy(),a.setVisible(!1)});var r=this,o=this._scene,n=this._scene.primitives,a=this._tooltip,s=null,l=null,u=null,e=new Cesium.ScreenSpaceEventHandler(o.canvas);function c(e){null==l&&((l=new Cesium.Primitive).asynchronous=!1,n.add(l));var t=_(l.rectangle=e);null==u?(u=new g.BillboardGroup(r,d)).addBillboards(t):u.updateBillboardsPositions(t)}e.setInputAction(function(e){if(null!=e.position){var t=o.camera.pickEllipsoid(e.position,p);if(t)if(null==l)c(y(s=p.cartesianToCartographic(t),s));else r.stopDrawing(),"function"==typeof i.callback&&i.callback(y(s,p.cartesianToCartographic(t)))}},Cesium.ScreenSpaceEventType.LEFT_DOWN),e.setInputAction(function(e){var t=e.endPosition;if(null!=t)if(null==l)a.showAt(t,"<p>点击添加矩形坐标点</p>");else{var i=o.camera.pickEllipsoid(t,p);if(i)c(y(s,p.cartesianToCartographic(i))),a.showAt(t,"<p>拖动改变矩形大小</p><p>点击完成矩形绘制</p>")}},Cesium.ScreenSpaceEventType.MOUSE_MOVE)},g.prototype.startDrawingCircle=function(i){i=C(i,h);this.startDrawing(function(){null!=s&&n.remove(s),e.remove(),t.destroy(),a.setVisible(!1)});var r=this,o=this._scene,n=this._scene.primitives,a=this._tooltip,s=null,e=null,t=new Cesium.ScreenSpaceEventHandler(o.canvas);t.setInputAction(function(e){if(null!=e.position){var t=o.camera.pickEllipsoid(e.position,p);t&&(null==s?(s=new g.CirclePrimitive({center:t,radius:0,asynchronous:!1,material:i.material}),n.add(s)):("function"==typeof i.callback&&i.callback(s.getCenter(),s.getRadius()),r.stopDrawing()))}},Cesium.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(function(e){var t=e.endPosition;if(null!=t)if(null==s)a.showAt(t,"<p>添加圆心点</p>");else{var i=o.camera.pickEllipsoid(t,p);i&&s.setRadius(Cesium.Cartesian3.distance(s.getCenter(),i))}},Cesium.ScreenSpaceEventType.MOUSE_MOVE)},g.prototype.enhancePrimitives=function(){var m=this;function e(e){m._scene;this._highlighted&&this._highlighted==e||!0!==this._editMode&&((this._highlighted=e)?(m.setHighlighted(this),this._strokeColor=this.strokeColor,this.setStrokeStyle(Cesium.Color.fromCssColorString("white"),this.strokeWidth)):this._strokeColor?this.setStrokeStyle(this._strokeColor,this.strokeWidth):this.setStrokeStyle(void 0,void 0))}function i(e){if(this._editMode!=e)if(m.disableAllHighlights(),e){m.setEdited(this);var i=m._scene,r=this;if(null==this._markers){var o=new g.BillboardGroup(m,f),n=new g.BillboardGroup(m,v),a={dragHandlers:{onDrag:function(e,t){r.positions[e]=t,h(e,r.positions),r._createPrimitive=!0},onDragEnd:function(e,t){r._createPrimitive=!0,d()}},onDoubleClick:function(e){r.positions.length<4||(r.positions.splice(e,1),r._createPrimitive=!0,o.removeBillboard(e),n.removeBillboard(e),h(e,r.positions),d())},tooltip:function(){if(3<r.positions.length)return"双击移除该点"}};o.addBillboards(r.positions,a),this._markers=o;for(var t=[],s=0,l=r.positions.length+(this.isPolygon?0:-1);s<l;s++)t.push(c(s));var u={dragHandlers:{onDragStart:function(e,t){this.index=e+1,r.positions.splice(this.index,0,t),r._createPrimitive=!0},onDrag:function(e,t){r.positions[this.index]=t,r._createPrimitive=!0},onDragEnd:function(e,t){o.insertBillboard(this.index,t,a),n.getBillboard(this.index-1).position=c(this.index-1),n.insertBillboard(this.index,c(this.index),u),r._createPrimitive=!0,d()}},tooltip:function(){return"拖动添加一个新的点"}};n.addBillboards(t,u),this._editMarkers=n,this._globeClickhandler=new Cesium.ScreenSpaceEventHandler(i.canvas),this._globeClickhandler.setInputAction(function(e){var t=i.pick(e.position);t&&t.primitive||r.setEditMode(!1)},Cesium.ScreenSpaceEventType.LEFT_CLICK),o.setOnTop(),n.setOnTop()}this._editMode=!0}else null!=this._markers&&(this._markers.remove(),this._editMarkers.remove(),this._markers=null,this._editMarkers=null,this._globeClickhandler.destroy()),this._editMode=!1;function c(e){var t=r.positions;return p.cartographicToCartesian(new Cesium.EllipsoidGeodesic(p.cartesianToCartographic(t[e]),p.cartesianToCartographic(t[e<t.length-1?e+1:0])).interpolateUsingFraction(.5))}function h(e,t){var i=e-1<0?t.length-1:e-1;i<n.countBillboards()&&(n.getBillboard(i).position=c(i)),(i=e)<n.countBillboards()&&(n.getBillboard(i).position=c(i))}function d(){r.executeListeners({name:"onEdited",positions:r.positions})}}Cesium.Billboard.prototype.setEditable=function(){if(!this._editable){this._editable=!0;var o=this,n=this;u(o,"leftDown",function(e){function r(e){t.destroy(),i(!0),n.executeListeners({name:"dragEnd",positions:e})}var t=new Cesium.ScreenSpaceEventHandler(m._scene.canvas);t.setInputAction(function(e){var t,i=m._scene.camera.pickEllipsoid(e.endPosition,p);i?(t=i,o.position=t,n.executeListeners({name:"drag",positions:t})):r(i)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),t.setInputAction(function(e){r(m._scene.camera.pickEllipsoid(e.position,p))},Cesium.ScreenSpaceEventType.LEFT_UP),i(!1)}),w(o)}function i(e){m._scene.screenSpaceCameraController.enableRotate=e}},b.PolylinePrimitive.prototype.setEditable=function(){if(!this.setEditMode){this.isPolygon=!1,this.asynchronous=!1,m.registerEditableShape(this),this.setEditMode=i;var t=this.width;this.setHighlighted=function(e){!0!==this._editMode&&(e?(m.setHighlighted(this),this.setWidth(2*t)):this.setWidth(t))},this.getExtent=function(){return Cesium.Extent.fromCartographicArray(p.cartesianArrayToCartographicArray(this.positions))},w(this),this.setEditMode(!1)}},b.PolygonPrimitive.prototype.setEditable=function(){this.asynchronous=!1;m._scene;m.registerEditableShape(this),this.setEditMode=i,this.setHighlighted=e,w(this),this.setEditMode(!1)},b.ExtentPrimitive.prototype.setEditable=function(){if(!this.setEditMode){var o=this,i=m._scene;m.registerEditableShape(o),o.asynchronous=!1,o.setEditMode=function(e){if(this._editMode!=e)if(m.disableAllHighlights(),e){if(m.setEdited(this),null==this._markers){var r=new g.BillboardGroup(m,f),t={dragHandlers:{onDrag:function(e,t){var i=r.getBillboard((e+2)%4).position;o.setExtent(y(p.cartesianToCartographic(i),p.cartesianToCartographic(t))),r.updateBillboardsPositions(_(o.extent))},onDragEnd:function(e,t){o.executeListeners({name:"onEdited",extent:o.extent})}},tooltip:function(){return"拖动改变矩形中心点"}};r.addBillboards(_(o.extent),t),this._markers=r,this._globeClickhandler=new Cesium.ScreenSpaceEventHandler(i.canvas),this._globeClickhandler.setInputAction(function(e){var t=i.pick(e.position);t.isDestroyed()?t&&!t.isDestroyed()&&t.primitive||o.setEditMode(!1):t&&t.primitive||o.setEditMode(!1)},Cesium.ScreenSpaceEventType.LEFT_CLICK),r.setOnTop()}this._editMode=!0}else null!=this._markers&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},o.setHighlighted=e,w(o),o.setEditMode(!1)}},g.EllipsePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var n=this,a=m._scene;n.asynchronous=!1,m.registerEditableShape(n),n.setEditMode=function(e){if(this._editMode!=e)if(m.disableAllHighlights(),e){m.setEdited(this);var i=this;if(null==this._markers){var r=new g.BillboardGroup(m,f),t={dragHandlers:{onDrag:function(e,t){var i=Cesium.Cartesian3.distance(n.getCenter(),t);e%2==0?n.setSemiMajorAxis(i):n.setSemiMinorAxis(i),r.updateBillboardsPositions(o())},onDragEnd:function(e,t){n.executeListeners({name:"onEdited",center:n.getCenter(),semiMajorAxis:n.getSemiMajorAxis(),semiMinorAxis:n.getSemiMinorAxis(),rotation:0})}},tooltip:function(){return"Drag to change the excentricity and radius"}};r.addBillboards(o(),t),this._markers=r,this._globeClickhandler=new Cesium.ScreenSpaceEventHandler(a.canvas),this._globeClickhandler.setInputAction(function(e){var t=a.pick(e.position);t&&t.primitive||i.setEditMode(!1)},Cesium.ScreenSpaceEventType.LEFT_CLICK),r.setOnTop()}this._editMode=!0}else null!=this._markers&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1;function o(){return Cesium.Shapes.computeEllipseBoundary(p,n.getCenter(),n.getSemiMajorAxis(),n.getSemiMinorAxis(),n.getRotation()+Math.PI/2,Math.PI/2).splice(0,4)}},n.setHighlighted=e,w(n),n.setEditMode(!1)}},g.CirclePrimitive.prototype.getCircleCartesianCoordinates=function(e){for(var t,i=Cesium.CircleOutlineGeometry.createGeometry(new Cesium.CircleOutlineGeometry({ellipsoid:p,center:this.getCenter(),radius:this.getRadius(),granularity:e})),r=0,o=[];r<i.attributes.position.values.length;r+=3)t=i.attributes.position.values,o.push(new Cesium.Cartesian3(t[r],t[r+1],t[r+2]));return o},g.CirclePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var n=this,a=m._scene;n.asynchronous=!1,m.registerEditableShape(n),n.setEditMode=function(e){if(this._editMode!=e)if(m.disableAllHighlights(),e){m.setEdited(this);var i=this;if(null==this._markers){var r=new g.BillboardGroup(m,f),t={dragHandlers:{onDrag:function(e,t){n.setRadius(Cesium.Cartesian3.distance(n.getCenter(),t)),r.updateBillboardsPositions(o())},onDragEnd:function(e,t){n.executeListeners({name:"onEdited",center:n.getCenter(),radius:n.getRadius()})}},tooltip:function(){return"拖动改变圆半径"}};r.addBillboards(o(),t),this._markers=r,this._globeClickhandler=new Cesium.ScreenSpaceEventHandler(a.canvas),this._globeClickhandler.setInputAction(function(e){var t=a.pick(e.position);t&&t.primitive||i.setEditMode(!1)},Cesium.ScreenSpaceEventType.LEFT_CLICK),r.setOnTop()}this._editMode=!0}else null!=this._markers&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1;function o(){return i.getCircleCartesianCoordinates(Cesium.Math.PI_OVER_TWO)}},n.setHighlighted=e,w(n),n.setEditMode(!1)}}},g.DrawHelperWidget=function(s,e){if(!Cesium.defined(e.container))throw new Cesium.DeveloperError("Container is required");m(e,{markerIcon:"Content/images/glyphicons_242_google_maps.png",polylineIcon:"Content/images/glyphicons_097_vector_path_line.png",polygonIcon:"Content/images/glyphicons_096_vector_path_polygon.png",circleIcon:"Content/images/glyphicons_095_vector_path_circle.png",extentIcon:"Content/images/glyphicons_094_vector_path_square.png",clearIcon:"Content/images/glyphicons_067_cleaning.png",polylineDrawingOptions:c,polygonDrawingOptions:o,extentDrawingOptions:n,circleDrawingOptions:a});var i=this,l=document.createElement("DIV");function t(e,t,i,r){var o=document.createElement("DIV");o.className="button",o.title=i,l.appendChild(o),o.onclick=r;var n=document.createElement("SPAN");o.appendChild(n);var a=document.createElement("IMG");return a.src=t,n.appendChild(a),o}l.className="drawtoolbar",e.container.appendChild(l);var u=s._scene;t(0,e.markerIcon,"添加标记",function(){s.startDrawingMarker({callback:function(e){i.executeListeners({name:"markerCreated",position:e})}})}),t(0,e.polylineIcon,"画线",function(){s.startDrawingPolyline({callback:function(e){i.executeListeners({name:"polylineCreated",positions:e})}})}),t(0,e.polygonIcon,"画面",function(){s.startDrawingPolygon({callback:function(e){i.executeListeners({name:"polygonCreated",positions:e})}})}),t(0,e.extentIcon,"矩形",function(){s.startDrawingExtent({callback:function(e){i.executeListeners({name:"extentCreated",extent:e})}})}),t(0,e.circleIcon,"画圆",function(){s.startDrawingCircle({callback:function(e,t){i.executeListeners({name:"circleCreated",center:e,radius:t})}})});var r=document.createElement("DIV");r.className="divider",l.appendChild(r),t(0,e.clearIcon,"清除图形",function(){s.disableAllEditMode();for(var e=u.primitives,t=e.length,i=0;i<t;++i){var r=e.get(i);if(r)if(r.hasOwnProperty("type")&&"plot"==r.type)e.remove(r);else if(r._billboards){var o=r._billboards,n=o.length;if(0<n)for(var a=0;a<n;a++)"plot"==o[a]._id&&e.remove(r)}}}),w(this)},g.prototype.addToolbar=function(e,t){return t=C(t,{container:e}),new g.DrawHelperWidget(this,t)},g}()}),define("SGWorld/Core/JBAlgorithm",[],function(){"use strict";window.xp={version:"1.0.0"};var v="doublearrow",_=.25,y=.3,C=.85,w=.15,b={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},E={tailWidthFactor:.15,neckWidthFactor:.2,headWidthFactor:.25,headAngle:Math.PI/8.5,neckAngle:Math.PI/13};xp.algorithm={},xp.algorithm.doubleArrow=function(e){this.connPoint=null;var t={controlPoint:this.tempPoint4=null,polygonalPoint:null};if(!((s=(this.points=e).length)<2)){if(2==s)return e;var i,r,o=this.points[0],n=this.points[1],a=this.points[2],s=e.length;this.tempPoint4=3==s?xp.algorithm.getTempPoint4(o,n,a):this.points[3],this.connPoint=3==s||4==s?S.PlotUtils.mid(o,n):this.points[4],r=S.PlotUtils.isClockWise(o,n,a)?(i=xp.algorithm.getArrowPoints(o,this.connPoint,this.tempPoint4,!1),xp.algorithm.getArrowPoints(this.connPoint,n,a,!0)):(i=xp.algorithm.getArrowPoints(n,this.connPoint,a,!1),xp.algorithm.getArrowPoints(this.connPoint,o,this.tempPoint4,!0));var l=i.length,u=(l-5)/2,c=i.slice(0,u),h=i.slice(u,u+5),d=i.slice(u+5,l),m=r.slice(0,u),p=r.slice(u,u+5),g=r.slice(u+5,l);m=S.PlotUtils.getBezierPoints(m);var f=S.PlotUtils.getBezierPoints(g.concat(c.slice(1)));d=S.PlotUtils.getBezierPoints(d);var v=m.concat(p,f,h,d),_=xp.algorithm.array2Dto1D(v);t.controlPoint=[o,n,a,this.tempPoint4,this.connPoint],t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(_)}return t},xp.algorithm.threeArrow=function(e){this.connPoint=null,this.tempPoint4=null;var t={controlPoint:this.tempPoint5=null,polygonalPoint:null};if(2<=(i=(this.points=e).length)){if(2==i)return e;var i,r,o,n=this.points[0],a=this.points[1],s=this.points[2];3==(i=e.length)?(this.tempPoint4=xp.algorithm.getTempPoint4(n,a,s),this.tempPoint5=S.PlotUtils.mid(s,this.tempPoint4)):(this.tempPoint4=this.points[3],this.tempPoint5=this.points[4]),this.connPoint=i<6?S.PlotUtils.mid(n,a):this.points[5],o=S.PlotUtils.isClockWise(n,a,s)?(r=xp.algorithm.getArrowPoints(n,this.connPoint,this.tempPoint4,!1),xp.algorithm.getArrowPoints(this.connPoint,a,s,!0)):(r=xp.algorithm.getArrowPoints(a,this.connPoint,s,!1),xp.algorithm.getArrowPoints(this.connPoint,n,this.tempPoint4,!0));var l=r.length,u=(l-5)/2,c=r.slice(0,u),h=r.slice(u,u+5),d=r.slice(u+5,l),m=o.slice(0,u),p=o.slice(u,u+5),g=o.slice(u+5,l);m=S.PlotUtils.getBezierPoints(m);var f=S.PlotUtils.getBezierPoints(g.concat(c.slice(1)));d=S.PlotUtils.getBezierPoints(d);var v=m.concat(p,f,h,d),_=xp.algorithm.array2Dto1D(v);t.controlPoint=[n,a,s,this.tempPoint4,this.tempPoint5,this.connPoint],t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(_)}return t},xp.algorithm.array2Dto1D=function(e){var t=[];return e.forEach(function(e){t.push(e[0]),t.push(e[1])}),t},xp.algorithm.getArrowPoints=function(e,t,i,r){this.type=v,this.headHeightFactor=_,this.headWidthFactor=y,this.neckHeightFactor=C,this.neckWidthFactor=w;var o=S.PlotUtils.mid(e,t),n=S.PlotUtils.distance(o,i),a=S.PlotUtils.getThirdPoint(i,o,0,.3*n,!0),s=S.PlotUtils.getThirdPoint(i,o,0,.5*n,!0),l=[o,a=S.PlotUtils.getThirdPoint(o,a,S.Constants.HALF_PI,n/5,r),s=S.PlotUtils.getThirdPoint(o,s,S.Constants.HALF_PI,n/4,r),i],u=xp.algorithm.getArrowHeadPoints(l,this.headHeightFactor,this.headWidthFactor,this.neckHeightFactor,this.neckWidthFactor),c=u[0],h=u[4],d=S.PlotUtils.distance(e,t)/S.PlotUtils.getBaseLength(l)/2,m=xp.algorithm.getArrowBodyPoints(l,c,h,d),p=m.length,g=m.slice(0,p/2),f=m.slice(p/2,p);return g.push(c),f.push(h),(g=g.reverse()).push(t),(f=f.reverse()).push(e),g.reverse().concat(u,f)},xp.algorithm.getArrowHeadPoints=function(e,t,i){this.type=v,this.headHeightFactor=_,this.headWidthFactor=y,this.neckHeightFactor=C,this.neckWidthFactor=w;var r=S.PlotUtils.getBaseLength(e)*this.headHeightFactor,o=e[e.length-1],n=(S.PlotUtils.distance(t,i),r*this.headWidthFactor),a=r*this.neckWidthFactor,s=r*this.neckHeightFactor,l=S.PlotUtils.getThirdPoint(e[e.length-2],o,0,r,!0),u=S.PlotUtils.getThirdPoint(e[e.length-2],o,0,s,!0),c=S.PlotUtils.getThirdPoint(o,l,S.Constants.HALF_PI,n,!1),h=S.PlotUtils.getThirdPoint(o,l,S.Constants.HALF_PI,n,!0);return[S.PlotUtils.getThirdPoint(o,u,S.Constants.HALF_PI,a,!1),c,o,h,S.PlotUtils.getThirdPoint(o,u,S.Constants.HALF_PI,a,!0)]},xp.algorithm.getArrowBodyPoints=function(e,t,i,r){for(var o=S.PlotUtils.wholeDistance(e),n=S.PlotUtils.getBaseLength(e)*r,a=(n-S.PlotUtils.distance(t,i))/2,s=0,l=[],u=[],c=1;c<e.length-1;c++){var h=S.PlotUtils.getAngleOfThreePoints(e[c-1],e[c],e[c+1])/2,d=(n/2-(s+=S.PlotUtils.distance(e[c-1],e[c]))/o*a)/Math.sin(h),m=S.PlotUtils.getThirdPoint(e[c-1],e[c],Math.PI-h,d,!0),p=S.PlotUtils.getThirdPoint(e[c-1],e[c],h,d,!1);l.push(m),u.push(p)}return l.concat(u)},xp.algorithm.getTempPoint4=function(e,t,i){var r,o,n,a=S.PlotUtils.mid(e,t),s=S.PlotUtils.distance(a,i),l=S.PlotUtils.getAngleOfThreePoints(e,a,i);return l<S.Constants.HALF_PI?(r=s*Math.sin(l),o=s*Math.cos(l),n=S.PlotUtils.getThirdPoint(e,a,S.Constants.HALF_PI,r,!1),S.PlotUtils.getThirdPoint(a,n,S.Constants.HALF_PI,o,!0)):l>=S.Constants.HALF_PI&&l<Math.PI?(r=s*Math.sin(Math.PI-l),o=s*Math.cos(Math.PI-l),n=S.PlotUtils.getThirdPoint(e,a,S.Constants.HALF_PI,r,!1),S.PlotUtils.getThirdPoint(a,n,S.Constants.HALF_PI,o,!1)):l>=Math.PI&&l<1.5*Math.PI?(r=s*Math.sin(l-Math.PI),o=s*Math.cos(l-Math.PI),n=S.PlotUtils.getThirdPoint(e,a,S.Constants.HALF_PI,r,!0),S.PlotUtils.getThirdPoint(a,n,S.Constants.HALF_PI,o,!0)):(r=s*Math.sin(2*Math.PI-l),o=s*Math.cos(2*Math.PI-l),n=S.PlotUtils.getThirdPoint(e,a,S.Constants.HALF_PI,r,!0),S.PlotUtils.getThirdPoint(a,n,S.Constants.HALF_PI,o,!1))},xp.algorithm.tailedAttackArrow=function(e){e=xp.algorithm.dereplication(e),this.tailWidthFactor=b.tailWidthFactor,this.swallowTailFactor=b.swallowTailFactor,this.swallowTailPnt=b.swallowTailPnt;var t={controlPoint:null,polygonalPoint:null};if(!((p=(t.controlPoint=e).length)<2)){if(2==e.length)return t.polygonalPoint=e,t;var i=e,r=i[0],o=i[1];S.PlotUtils.isClockWise(i[0],i[1],i[2])&&(r=i[1],o=i[0]);var n=[S.PlotUtils.mid(r,o)].concat(i.slice(2)),a=xp.algorithm.getAttackArrowHeadPoints(n,r,o,b),s=a[0],l=a[4],u=S.PlotUtils.distance(r,o),c=S.PlotUtils.getBaseLength(n),h=c*this.tailWidthFactor*this.swallowTailFactor;this.swallowTailPnt=S.PlotUtils.getThirdPoint(n[1],n[0],0,h,!0);var d=u/c,m=xp.algorithm.getAttackArrowBodyPoints(n,s,l,d),p=m.length,g=[r].concat(m.slice(0,p/2));g.push(s);var f,v=[o].concat(m.slice(p/2,p));v.push(l),g=S.PlotUtils.getQBSplinePoints(g),v=S.PlotUtils.getQBSplinePoints(v),f=xp.algorithm.array2Dto1D(g.concat(a,v.reverse(),[this.swallowTailPnt,g[0]])),t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(f)}return t},xp.algorithm.getAttackArrowHeadPoints=function(e,t,i,r){this.headHeightFactor=r.headHeightFactor,this.headTailFactor=r.headTailFactor,this.headWidthFactor=r.headWidthFactor,this.neckWidthFactor=r.neckWidthFactor,this.neckHeightFactor=r.neckHeightFactor;var o=S.PlotUtils.getBaseLength(e),n=o*this.headHeightFactor,a=e[e.length-1];o=S.PlotUtils.distance(a,e[e.length-2]);var s=S.PlotUtils.distance(t,i);n>s*this.headTailFactor&&(n=s*this.headTailFactor);var l=n*this.headWidthFactor,u=n*this.neckWidthFactor,c=(n=o<n?o:n)*this.neckHeightFactor,h=S.PlotUtils.getThirdPoint(e[e.length-2],a,0,n,!0),d=S.PlotUtils.getThirdPoint(e[e.length-2],a,0,c,!0),m=S.PlotUtils.getThirdPoint(a,h,S.Constants.HALF_PI,l,!1),p=S.PlotUtils.getThirdPoint(a,h,S.Constants.HALF_PI,l,!0);return[S.PlotUtils.getThirdPoint(a,d,S.Constants.HALF_PI,u,!1),m,a,p,S.PlotUtils.getThirdPoint(a,d,S.Constants.HALF_PI,u,!0)]},xp.algorithm.getAttackArrowBodyPoints=function(e,t,i,r){for(var o=S.PlotUtils.wholeDistance(e),n=S.PlotUtils.getBaseLength(e)*r,a=(n-S.PlotUtils.distance(t,i))/2,s=0,l=[],u=[],c=1;c<e.length-1;c++){var h=S.PlotUtils.getAngleOfThreePoints(e[c-1],e[c],e[c+1])/2,d=(n/2-(s+=S.PlotUtils.distance(e[c-1],e[c]))/o*a)/Math.sin(h),m=S.PlotUtils.getThirdPoint(e[c-1],e[c],Math.PI-h,d,!0),p=S.PlotUtils.getThirdPoint(e[c-1],e[c],h,d,!1);l.push(m),u.push(p)}return l.concat(u)},xp.algorithm.dereplication=function(e){var t=e[e.length-1],i=!1,r=[];return r=e.filter(function(e){if(e[0]!=t[0]&&e[1]!=t[1])return e;i=!0}),i&&r.push(t),r},xp.algorithm.fineArrow=function(t,o){if(!(t.length<2||o.length<2)){var m=E.tailWidthFactor,f=E.neckWidthFactor,v=E.headWidthFactor,_=E.headAngle,y=E.neckAngle,C=[];return C[0]=t,C[1]=o,e=C[0],r=C[1],n=S.PlotUtils.getBaseLength(C),g=n*m,i=n*f,s=n*v,a=S.PlotUtils.getThirdPoint(r,e,S.Constants.HALF_PI,g,!0),l=S.PlotUtils.getThirdPoint(r,e,S.Constants.HALF_PI,g,!1),u=S.PlotUtils.getThirdPoint(e,r,_,s,!1),c=S.PlotUtils.getThirdPoint(e,r,_,s,!0),p=S.PlotUtils.getThirdPoint(e,r,y,i,!1),h=S.PlotUtils.getThirdPoint(e,r,y,i,!0),d=[],d.push(a[0],a[1],p[0],p[1],u[0],u[1],r[0],r[1],c[0],c[1],h[0],h[1],l[0],l[1],e[0],e[1]),Cesium.Cartesian3.fromDegreesArray(d)}};var S={version:"1.0.0",PlotUtils:{}};S.PlotUtils.distance=function(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))},S.PlotUtils.wholeDistance=function(e){for(var t=0,i=0;i<e.length-1;i++)t+=S.PlotUtils.distance(e[i],e[i+1]);return t},S.PlotUtils.getBaseLength=function(e){return Math.pow(S.PlotUtils.wholeDistance(e),.99)},S.PlotUtils.mid=function(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]},S.PlotUtils.getCircleCenterOfThreePoints=function(e,t,i){var r=[(e[0]+t[0])/2,(e[1]+t[1])/2],o=[r[0]-e[1]+t[1],r[1]+e[0]-t[0]],n=[(e[0]+i[0])/2,(e[1]+i[1])/2],a=[n[0]-e[1]+i[1],n[1]+e[0]-i[0]];return S.PlotUtils.getIntersectPoint(r,o,n,a)},S.PlotUtils.getIntersectPoint=function(e,t,i,r){if(e[1]==t[1]){var o=(r[0]-i[0])/(r[1]-i[1]),n=o*(e[1]-i[1])+i[0],a=e[1];return[n,a]}if(i[1]!=r[1])return s=(t[0]-e[0])/(t[1]-e[1]),o=(r[0]-i[0])/(r[1]-i[1]),[n=s*(a=(s*e[1]-e[0]-o*i[1]+i[0])/(s-o))-s*e[1]+e[0],a];var s=(t[0]-e[0])/(t[1]-e[1]);return[n=s*(i[1]-e[1])+e[0],a=i[1]]},S.PlotUtils.getAzimuth=function(e,t){var i,r=Math.asin(Math.abs(t[1]-e[1])/S.PlotUtils.distance(e,t));return t[1]>=e[1]&&t[0]>=e[0]?i=r+Math.PI:t[1]>=e[1]&&t[0]<e[0]?i=S.Constants.TWO_PI-r:t[1]<e[1]&&t[0]<e[0]?i=r:t[1]<e[1]&&t[0]>=e[0]&&(i=Math.PI-r),i},S.PlotUtils.getAngleOfThreePoints=function(e,t,i){var r=S.PlotUtils.getAzimuth(t,e)-S.PlotUtils.getAzimuth(t,i);return r<0?r+S.Constants.TWO_PI:r},S.PlotUtils.isClockWise=function(e,t,i){return(i[1]-e[1])*(t[0]-e[0])>(t[1]-e[1])*(i[0]-e[0])},S.PlotUtils.getPointOnLine=function(e,t,i){return[t[0]+e*(i[0]-t[0]),t[1]+e*(i[1]-t[1])]},S.PlotUtils.getCubicValue=function(e,t,i,r,o){var n=1-(e=Math.max(Math.min(e,1),0)),a=e*e,s=a*e,l=n*n,u=l*n;return[u*t[0]+3*l*e*i[0]+3*n*a*r[0]+s*o[0],u*t[1]+3*l*e*i[1]+3*n*a*r[1]+s*o[1]]},S.PlotUtils.getThirdPoint=function(e,t,i,r,o){var n=S.PlotUtils.getAzimuth(e,t),a=o?n+i:n-i,s=r*Math.cos(a),l=r*Math.sin(a);return[t[0]+s,t[1]+l]},S.PlotUtils.getArcPoints=function(e,t,i,r){var o,n,a=[],s=r-i;s=s<0?s+S.Constants.TWO_PI:s;for(var l=0;l<=S.Constants.FITTING_COUNT;l++){var u=i+s*l/S.Constants.FITTING_COUNT;o=e[0]+t*Math.cos(u),n=e[1]+t*Math.sin(u),a.push([o,n])}return a},S.PlotUtils.getBisectorNormals=function(e,t,i,r){var o=S.PlotUtils.getNormal(t,i,r),n=Math.sqrt(o[0]*o[0]+o[1]*o[1]),a=o[0]/n,s=o[1]/n,l=S.PlotUtils.distance(t,i),u=S.PlotUtils.distance(i,r);if(n>S.Constants.ZERO_TOLERANCE)if(S.PlotUtils.isClockWise(t,i,r)){var c=e*l,h=i[0]-c*s,d=i[1]+c*a,m=[h,d];c=e*u;var p=[h=i[0]+c*s,d=i[1]-c*a]}else c=e*l,m=[h=i[0]+c*s,d=i[1]-c*a],c=e*u,p=[h=i[0]-c*s,d=i[1]+c*a];else m=[h=i[0]+e*(t[0]-i[0]),d=i[1]+e*(t[1]-i[1])],p=[h=i[0]+e*(r[0]-i[0]),d=i[1]+e*(r[1]-i[1])];return[m,p]},S.PlotUtils.getNormal=function(e,t,i){var r=e[0]-t[0],o=e[1]-t[1],n=Math.sqrt(r*r+o*o);r/=n,o/=n;var a=i[0]-t[0],s=i[1]-t[1],l=Math.sqrt(a*a+s*s);return[r+(a/=l),o+(s/=l)]},S.PlotUtils.getCurvePoints=function(e,t){for(var i=[S.PlotUtils.getLeftMostControlPoint(t)],r=0;r<t.length-2;r++){var o=t[r],n=t[r+1],a=t[r+2],s=S.PlotUtils.getBisectorNormals(e,o,n,a);i=i.concat(s)}var l=S.PlotUtils.getRightMostControlPoint(t);i.push(l);var u=[];for(r=0;r<t.length-1;r++){o=t[r],n=t[r+1],u.push(o);for(e=0;e<S.Constants.FITTING_COUNT;e++){var c=S.PlotUtils.getCubicValue(e/S.Constants.FITTING_COUNT,o,i[2*r],i[2*r+1],n);u.push(c)}u.push(n)}return u},S.PlotUtils.getLeftMostControlPoint=function(e){var i=e[0],r=e[1],o=e[2],n=S.PlotUtils.getBisectorNormals(0,i,r,o)[0],a=S.PlotUtils.getNormal(i,r,o);if(Math.sqrt(a[0]*a[0]+a[1]*a[1])>S.Constants.ZERO_TOLERANCE)var s=S.PlotUtils.mid(i,r),l=i[0]-s[0],u=i[1]-s[1],c=2/S.PlotUtils.distance(i,r),h=-c*u,d=c*l,m=h*h-d*d,p=2*h*d,g=d*d-h*h,f=n[0]-s[0],v=n[1]-s[1],_=s[0]+m*f+p*v,y=s[1]+p*f+g*v;else _=i[0]+t*(r[0]-i[0]),y=i[1]+t*(r[1]-i[1]);return[_,y]},S.PlotUtils.getRightMostControlPoint=function(e){var i=e.length,r=e[i-3],o=e[i-2],n=e[i-1],a=S.PlotUtils.getBisectorNormals(0,r,o,n)[1],s=S.PlotUtils.getNormal(r,o,n);if(Math.sqrt(s[0]*s[0]+s[1]*s[1])>S.Constants.ZERO_TOLERANCE)var l=S.PlotUtils.mid(o,n),u=n[0]-l[0],c=n[1]-l[1],h=2/S.PlotUtils.distance(o,n),d=-h*c,m=h*u,p=d*d-m*m,g=2*d*m,f=m*m-d*d,v=a[0]-l[0],_=a[1]-l[1],y=l[0]+p*v+g*_,C=l[1]+g*v+f*_;else y=n[0]+t*(o[0]-n[0]),C=n[1]+t*(o[1]-n[1]);return[y,C]},S.PlotUtils.getBezierPoints=function(e){if(e.length<=2)return e;for(var t=[],i=e.length-1,r=0;r<=1;r+=.01){for(var o=0,n=0,a=0;a<=i;a++){var s=S.PlotUtils.getBinomialFactor(i,a),l=Math.pow(r,a),u=Math.pow(1-r,i-a);o+=s*l*u*e[a][0],n+=s*l*u*e[a][1]}t.push([o,n])}return t.push(e[i]),t},S.PlotUtils.getBinomialFactor=function(e,t){return S.PlotUtils.getFactorial(e)/(S.PlotUtils.getFactorial(t)*S.PlotUtils.getFactorial(e-t))},S.PlotUtils.getFactorial=function(e){if(e<=1)return 1;if(2==e)return 2;if(3==e)return 6;if(4==e)return 24;if(5==e)return 120;for(var t=1,i=1;i<=e;i++)t*=i;return t},S.PlotUtils.getQBSplinePoints=function(e){if(e.length<=2)return e;var t=[],i=e.length-2-1;t.push(e[0]);for(var r=0;r<=i;r++)for(var o=0;o<=1;o+=.05){for(var n=0,a=0,s=0;s<=2;s++){var l=S.PlotUtils.getQuadricBSplineFactor(s,o);n+=l*e[r+s][0],a+=l*e[r+s][1]}t.push([n,a])}return t.push(e[e.length-1]),t},S.PlotUtils.getQuadricBSplineFactor=function(e,t){return 0==e?Math.pow(t-1,2)/2:1==e?(-2*Math.pow(t,2)+2*t+1)/2:2==e?Math.pow(t,2)/2:0},S.Constants={TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,FITTING_COUNT:100,ZERO_TOLERANCE:1e-4}}),define("SGWorld/Core/WGS84_to_Cartesian3",[],function(){"use strict";return function(e){var t=Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.alt);return{x:t.x,y:t.y,z:t.z}}}),define("SGWorld/Creator/BoxGeoJsonFeatureLayer",["../Core/Core","./Color","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min"],function(i,r,o,e){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._color=new r(this._viewer,this._cesium),this._tree=o}return t.prototype.createBoxGeojsonFeatureLayer=function(e,t,i,r,s){var o={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,granularity:CesiumMath.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.charAt(0)&&"]"==i.material.charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a)));var l=this._core.extend(o,i,!0);null==t&&console.log("geojson is required");var n=null;n=t.then?t:this._cesium.GeoJsonDataSource.load(t);var u=this;return n.then(function(e){for(var t=e.entities.values,i=[],r=0;r<t.length;r++){var o=t[r];l.polygonHierarchy=new u._cesium.PolygonHierarchy(o.polyline.positions._value,[]);var n=new u._cesium.GeometryInstance({id:o,geometry:new u._cesium.PolygonGeometry(l),attributes:{color:new u._cesium.ColorGeometryInstanceAttribute.fromColor(l.material)}});i.push(n)}var a=u._viewer.scene.primitives.add(new u._cesium.Primitive({geometryInstances:i,appearance:new u._cesium.PerInstanceColorAppearance({translucent:!1}),shadows:u._cesium.ShadowMode.ENABLED}));a.show=l.show,u.item=a,"function"==typeof s&&s(a)}),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),this._tree.insertGroupId({id:l.id,name:e,checked:l.show,pId:this._core.isnull(r)?0:r,type:"polylineLayer",item:this},this._core.isnull(r)?0:r),this},t}),define("SGWorld/wfs/WfsLayer",["../Core/jquery","./GmlParser","./TileManager1","./WorkerPool","./SimpleSqlParser","./EntityCreator"],function($$,GmlParser,_TileManager,WorkerPool,simpleSqlParser,EntityCreator){"use strict";var TileManager;function Layer(e,t,i,r,o,n,a,s,l){var u=this;if(this._viewer=e,this._Viewer=e,u.G=65535,TileManager=new _TileManager,workerPool=new WorkerPool({workerPath:lj()}),!Cesium.sampleRenderedData){var c=function(e,t){for(var i=0;i<e.children.length;i++){if(e.children[i].state>=Cesium.QuadtreeTileLoadState.DONE&&(null!=e.children[i].data.terrainData._mesh||null!=e.children[i].data.terrainData._buffer)&&e.children[i].x==t.x&&e.children[i].y==t.y)return e.children[i]}},h=function(e,t){for(var i=e.tilingScheme,r=i.positionToTileXY(t,0),o=u._Viewer.scene.globe._surface.tileProvider.quadtree._levelZeroTiles,n=o[0].x==r.x&&o[0].y==r.y?o[0]:o[1],a=1;a<22;a++){r=i.positionToTileXY(t,a);var s=c(n,r);if(null==s)break;n=s}return n},d=function(e,t){var i;$.grep(u._Viewer.scene.primitives._primitives,function(e){return e instanceof Cesium.Cesium3DTileset});for(i=0;i<e.length;++i){var r=e[i],o=r instanceof Cesium.Cartographic,n=o?r:Cesium.Cartographic.fromCartesian(r);if(n.height=u.G,!o){var a=Cesium.Cartesian3.fromRadiansArrayHeights([n.longitude,n.latitude,n.height])[0];r.z=a.z}}return e},m=function(e,t){var i;for(i=0;i<t.length;++i){var r=t[i],o=h(e,r);r.height=o.data.terrainData.interpolateHeight(o.rectangle,r.longitude,r.latitude)}return t},p=function(e){this.value=new Float32Array([e])};Cesium.Resource&&(Cesium.loadText=Cesium.Resource.fetchText,Cesium.loadJson=Cesium.Resource.fetchJson,Cesium.loadBlob=Cesium.Resource.fetchBlob,Cesium.loadArrayBuffer=Cesium.Resource.fetchArrayBuffer,Cesium.loadImage=Cesium.Resource.fetchImage),p.fromZBias=function(e){if(!Cesium.defined(e))throw new DeveloperError("zbias is required.");return new p(e)},p.toValue=function(e,t){if(!Cesium.defined(e))throw new DeveloperError("zbias is required.");return Cesium.defined(t)?color.toBytes(t):new Float32Array(e)},p.equals=function(e,t){return e===t||Cesium.defined(e)&&Cesium.defined(t)&&e.value[0]===t.value[0]},p.defaultBias=function(){return p.fromZBias(15e-6)},Cesium.ZBiasGeometryInstanceAttribute=p,Cesium.ZBiasGeometryInstanceAttribute=p,Cesium.SampleRenderedDataFlags={TERRAIN:2,MESH:4,FLOOR:8},Cesium.DynamicEyeOffset=function(e){return void 0===e&&(e=0),new Cesium.Cartesian3(.001234321,0,e)},Cesium.sampleRenderedData=function(o,e){var t=2,i=4,r=8;null==e&&(e=t|i);var n=Cesium.when.defer(),a=[];t<e?o.forEach(function(e){a.push(Cesium.Cartographic.fromRadians(e.longitude,e.latitude,e.height))}):a=o;var s=[];e&t&&s.push(function(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var r=Cesium.when.defer();return function e(){t.ready?Cesium.when(m(t,i),function(e){r.resolve(e)}):setTimeout(e,10)}(),r.promise}(u._Viewer.terrainProvider,o));var l=0<(e&r);return e&(i|r)&&s.push(function(e,t){Cesium.Check.defined("positions",e);var i=Cesium.when.defer();return Cesium.when(d(e,t),function(e){i.resolve(e)}),i.promise}(a,l)),Cesium.when.all(s).then(function(e){if(1<s.length)for(var t=0;t<o.length;t++){var i=e[0][t],r=e[1][t];r.height!=u.G&&((i.height<r.height||l)&&(i.height=r.height))}n.resolve(e[0])}),n.promise},Cesium.sampleRenderedMesh=function(e,t){Cesium.Check.defined("positions",e);var i=Cesium.when.defer();return Cesium.when(d(e,t),function(e){i.resolve(e)}),i.promise},Cesium.sampleRenderedTerrain=function(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var r=Cesium.when.defer();return function e(){t.ready?Cesium.when(m(t,i),function(e){r.resolve(e)}):setTimeout(e,10)}(),r.promise},Cesium.QuadtreePrimitive.prototype.getRenderedBestLevelInfo=function(){var e=this.getRenderedLevelInfo(),t=0;for(var i in e)t<Number(i)&&(t=Number(i));return{bestLevel:t,count:e[t]}},Cesium.QuadtreePrimitive.prototype.getRenderedLevelInfo=function(){var t=[];return this._tilesToRender.forEach(function(e){null==t[e.level]&&(t[e.level]=0),t[e.level]++}),t}}o=o||{},this._level=r||{min:0,max:22},"number"==typeof this._level&&(this._level={min:r,max:22}),this._url=t,this._layerName=i,this._guid=Cesium.createGuid(),this._gmlParser=new GmlParser(!0,null,null,!0),this._tileManager=TileManager.getInstance(e),this._tileManager._loadTileEvent.addEventListener(Layer.prototype.loadTile,this),this._useWorkers=!0,this._layerDisplayName=n,this._showAttributesAsMessage=o.showAttributesAsMessage,delete o.showAttributesAsMessage,this._entityCreator=new EntityCreator(o,e),this._visible=!0,this._featuresMap={},this._boundingBox=void 0,this._geometryFieldName=void 0,this._operations={},this._subdomains=a,this.latLon=s,this._addedFeatures=[],this.simpleSqlParser=simpleSqlParser,this.myLayer=l,this._statistics={numberOfAddedFeatures:0,numberOfDeletedFeatures:0,numberOfAddePositions:0,numberOfDeletedPositions:0,getNumberOfCurrentlyRenderedFeatures:function(){return this.numberOfAddedFeatures-this.numberOfDeletedFeatures},getNumberOfCurrentlyRenderedPositions:function(){return this.numberOfAddePositions-this.numberOfDeletedPositions}},initLayerCapabilities(this),initFeatureType(this)}function ReplaceTagWithOriginalDomain(e,t){return-1!=e.indexOf("{s}")?null!=t&&0<t.length?e.replace("{s}",t[0]):console.error("Error - sTag with no subdomains."):e}function getXmlTag(e,t,i){var r=$$(e).find(t);return 0==r.length&&"wfs"===i.toLowerCase()&&(r=$$(e).find("wfs\\:"+t+","+t)),0<r.length?r:$$([])}function parseBBox(r,e){getXmlTag(e,"FeatureType","wfs").each(function(e,t){if(getXmlTag(t,"Name","wfs").text()!=r._layerName)return!0;var i=getXmlTag(t,"LatLongBoundingBox","wfs");return 1!==i.length||(r._boundingBox=Cesium.Rectangle.fromDegrees(parseFloat(i[0].attributes.minx.value),parseFloat(i[0].attributes.miny.value),parseFloat(i[0].attributes.maxx.value),parseFloat(i[0].attributes.maxy.value))),!1})}function queryStringExist(e){return-1<e.indexOf("?")?"&":"?"}function initLayerCapabilities(t){var e=t.cleanUrl(t._url).replace("{s}",t.sTag(t._layerName.length,t._layerName.length,t._level));e+=queryStringExist(e),e+="SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&outputFormat=GML2&typeName="+t._layerName;var i=Cesium.TrustedServers.contains(ReplaceTagWithOriginalDomain(t._url,t._subdomains));$$.ajax({dataType:"xml",xhrFields:{withCredentials:i},url:encodeURI(e),success:function(e){parseBBox(t,e),initAllowedOperations(t,e)}})}function initAllowedOperations(r,e){$$(e).find("FeatureType").each(function(e,t){if($$(t).children("Name").text()!=r._layerName)return!0;var i=$$(t).children("Operations");return 0==i.length||i.children().each(function(){r._operations[this.tagName.toLowerCase()]={}}),!1})}function initFeatureType(t){t.featureColumnNames=null;var e=t.cleanUrl(t._url).replace("{s}",t.sTag(t._layerName.length,t._layerName.length,t._level));e+=queryStringExist(e),e+="SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&typeName="+t._layerName;var i=Cesium.TrustedServers.contains(ReplaceTagWithOriginalDomain(t._url,t._subdomains));$$.ajax({dataType:"xml",xhrFields:{withCredentials:i},url:encodeURI(e),success:function(e){parseDescribeFeatureResponse(t,e)}})}function getWfsNamespace(xmlText,testElementName){if(null==xmlText)return null;try{var match=(new XMLSerializer).serializeToString(xmlText).match(eval("/[<]([a-z]+):"+testElementName+"[>]/i"));return null!=match?match[1]:null}catch(e){return!1}}function isElementNameExists(xmlText,testElementName){if(null==xmlText)return!1;try{var match=(new XMLSerializer).serializeToString(null!=xmlText.context?xmlText.context:xmlText).match(eval("/[<](([a-z]+):)?"+testElementName+"[^>]*[>]/i"));return null!=match}catch(e){return!1}}function parseDescribeFeatureResponse(o,e){var t=$$(e).find("[type^='gml:']");o._geometryFieldName=$$(t).attr("name"),o.geometryResponseData=e,o.wfsNamespace=getWfsNamespace(o.geometryResponseData,"sequence"),null==o.wfsNamespace&&(o.wfsNamespace="xsd"),o.sgSchemaExists=$$(o.geometryResponseData).find(o.wfsNamespace+"\\:schema").attr("xmlns:sfs"),o.sgSchemaExists||(o.sgSchemaExists=$$(o.geometryResponseData).find("schema").attr("xmlns:sfs"));var i=$$(o.geometryResponseData).find(o.wfsNamespace+"\\:sequence "+o.wfsNamespace+"\\:element");0==i.length&&(i=$$(o.geometryResponseData).find("sequence").find("element")),o.geomFields=[],i.each(function(){var e=$$(this),t=e.attr("name"),i=e.attr("type");if(null==i)i="string";else{var r=i.match(/.*[:](\w+)/);r&&(i=r[1])}o.geomFields.push({name:t,type:i})})}function sqlParserToWfs(e,t){if(e.operator){var i="";switch(e.operator.toLowerCase()){case"=":i="PropertyIsEqualTo";break;case"<>":i="PropertyIsNotEqualTo";break;case">":i="PropertyIsGreaterThan";break;case">=":i="PropertyIsGreaterThanOrEqualTo";break;case"<":i="PropertyIsLessThan";break;case"<=":i="PropertyIsLessThanOrEqualTo";break;case"like":i="PropertyIsLike"}var r=-1!=t.indexOf(e.right)?e.right:e.left,o="<ogc:"+i+("like"==e.operator.toLowerCase()?' wildCard="*" singleChar="*" escape="*"':"")+">";o+="<ogc:PropertyName>"+r+"</ogc:PropertyName>";var n=-1!=t.indexOf(e.right)?e.left:e.right,a=null==(n=n.replace(/^'|'$$/g,"")).match(/^[%]|[%]$$/);return"like"==e.operator.toLowerCase()&&a&&(n="%"+n+"%"),o+="<ogc:Literal>"+n+"</ogc:Literal>",o+="</ogc:"+i+">"}var s="and"==e.logic.toLowerCase()?"And":"Or";o="<ogc:"+s+">";return 2==e.terms.length?o+=sqlParserToWfs(e.terms[0],t):o+=sqlParserToWfs({logic:s,terms:e.terms.slice(0,e.terms.length-1)},t),o+=sqlParserToWfs(e.terms[e.terms.length-1],t),o+="</ogc:"+s+">"}function parseFeaturesResult(e){var r=[],t=$$(e).find("gml\\:featureMember");return 0==t.length&&(t=$$(e).find("featureMember")),t.each(function(){var e={},t=$$(this).children().first();e.layerId=t[0].nodeName,e.originFid=t.attr("fid"),e.fid=t.attr("fid"),null==e.fid&&(e.fid=-1);var i=e.fid.match(/[.]?(\d+)$$/);i&&(e.fid=i[1]),e.node=t[0],t.children().each(function(){e[this.nodeName]=this.innerHTML,null==e[this.nodeName]&&(e[this.nodeName]=$$(this).text())}),r.push(e)}),r}function internalBlockRequestPrimitiveFromPrimitive(e){return null==e?void 0:e.parentLayer?e:e._parentCollection?e._parentCollection:e.primitive&&e.primitive._parentCollection?e.primitive._parentCollection:void 0}Object.defineProperties(Layer.prototype,{LayerDisplayName:{get:function(){return this._layerDisplayName}},displayName:{get:function(){return this.LayerDisplayName}},guid:{get:function(){return this._guid}},Style:{get:function(){return this._entityCreator.style}},show:{get:function(){return this._visible},set:function(e){this.setVisibility(e)}},BoundingBox:{get:function(){return this._boundingBox}},Statistics:{get:function(){return this._statistics}}});var DEGREES_PER_RADIAN=180/Math.PI,RADIAN_PER_DEGREEE=1/DEGREES_PER_RADIAN,REQUEST_MAX_FEATURES=1e3,workerPool;function lj(){for(var e=document.scripts,t="./wfs/featurefetcherworker.js",i=0;i<e.length;i++){var r=e[i].src.split("/"),o=r[r.length-1];"SmartEarth.js"==o?t=e[i].outerHTML.split('"')[1].replace("SmartEarth.js","Workers/featurefetcherworker.js"):"SmartEarth.min.js"==o&&(t=e[i].outerHTML.split('"')[1].replace("SmartEarth.min.js","Workers/featurefetcherworker.js"))}return t}return Layer.prototype.getRequestMaxFeatures=function(){return REQUEST_MAX_FEATURES},Layer.prototype.isAttributeField=function(e,t){return!(!t||!e||""==e.toLowerCase()||"fid"==e.toLowerCase())&&("string"==t.toLowerCase()||"integer"==t.toLowerCase()||"double"==t.toLowerCase())},Layer.prototype.updateFeatures=function(e,r){if(e.length<=0)r();else{var t=this,i=[];$$(this.geomFields).each(function(){t.isAttributeField(this.name,this.type)&&i.push(this.name)});var o="<wfs:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>",n="";$$(e).each(function(){var e=this,t='<wfs:Update typeName="{lyaer_id}">'.replace("{lyaer_id}",this.layerId);$$(i).each(function(){t+="<wfs:Property><wfs:Name>"+this+"</wfs:Name><wfs:Value>"+e[this]+"</wfs:Value></wfs:Property>"}),t+='<ogc:Filter><ogc:FeatureId fid="'+e.originFid+'"/></ogc:Filter>',n+=t+="</wfs:Update>"}),o=o.replace("{wfs_updates}",n);var a="Failed to save changes to server",s=ReplaceTagWithOriginalDomain(this.cleanUrl(this._url),this._subdomains),l=Cesium.TrustedServers.contains(s);$$.ajax({dataType:"xml",type:"POST",data:o,xhrFields:{withCredentials:l},url:encodeURI(s),success:function(e){null!=(new XMLSerializer).serializeToString(e.documentElement).toLowerCase().match(/success\s*\//)?r():r(a)},error:function(e,t,i){r(a)},timeout:1e4})}},Layer.prototype.getFeatures=function(e,t,r){var i=this,o=[];$$(this.geomFields).each(function(){i.isAttributeField(this.name,this.type)&&o.push(this.name)});var n="<wfs:GetFeature version='1.0.0' service='WFS' username='' password='' maxFeatures='{REQUEST_MAX_FEATURES}' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> <wfs:Query typeName='{layer_name}'> {wfs_filter}</wfs:Query> </wfs:GetFeature>";n=(n=n.replace("{layer_name}",this._layerName)).replace("{REQUEST_MAX_FEATURES}",REQUEST_MAX_FEATURES);var a="";""!=e.replace(/[ ]/g,"")&&(a="<ogc:Filter xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'>",a+=sqlParserToWfs(i.simpleSqlParser.sql2ast("SELECT * FROM x WHERE "+e).WHERE,o),a+="</ogc:Filter>");n=n.replace("{wfs_filter}",a);var s=ReplaceTagWithOriginalDomain(this.cleanUrl(this._url),this._subdomains),l=Cesium.TrustedServers.contains(s);t.xhr=$$.ajax({url:encodeURI(s),type:"POST",data:n,dataType:"xml",xhrFields:{withCredentials:l},success:function(e){if(isElementNameExists($$(e),"FeatureCollection")){var t=parseFeaturesResult(e);r(t)}else r(null,TELang.i18n("layer_error_reading_features"))},error:function(e,t,i){r(null,e.statusText)},timeout:1e4})},Layer.prototype.getFeatureColumnNames=function(){if(this.featureColumnNames)return this.featureColumnNames;var e=$$(this.geometryResponseData).find(this.wfsNamespace+"\\:sequence "+this.wfsNamespace+"\\:element");0==e.length&&(e=$$(this.geometryResponseData).find("sequence").find("element"));var t=[];return e.each(function(){var e=$$(this);"geom"!=e.attr("name").toLowerCase()&&t.push(e.attr("name").toLowerCase())}),this.featureColumnNames=t,this.featureColumnNames},Layer.prototype.refresh=function(e){for(var t=this._tileManager.getAllTiles(),i=t.length,r=0;r<i;r++)t[r].data.wfsLayerData[this._guid]&&t[r].data.wfsLayerData[this._guid].freeResources(),this.loadTile(t[r]);e&&initFeatureType(this)},Layer.prototype.setVisibility=function(e){if(this._visible!=e)if(0==(this._visible=e))for(var t=(r=this._tileManager.getAllTiles()).length,i=0;i<t;i++)r[i].data.wfsLayerData[this._guid]&&r[i].data.wfsLayerData[this._guid].primitive&&(r[i].data.wfsLayerData[this._guid].primitive.show=!1);else{var r;for(t=(r=this._tileManager.getAllTiles()).length,i=0;i<t;i++)r[i].data.wfsLayerData[this._guid]&&(r[i].data.wfsLayerData[this._guid].primitive?r[i].data.wfsLayerData[this._guid].primitive.show=!0:this.loadTile(r[i]))}},Layer.prototype.loadTile=function(e){var t=this;e.data.wfsLayerData[this._guid]={id:e.data.id,primitive:void 0,freeResources:function(){Cesium.defined(this.xhr)&&(this.xhr.abort(),this.xhr=void 0),Cesium.defined(this.features)&&(t.removeFeaturesFromLayer(this.features),this.features=void 0),Cesium.defined(this.primitive)&&(t._tileManager.removeFromScene(this.primitive),this.primitive=void 0)}},this.show&&e.level>=this._level.min&&e.level<=this._level.max&&(this.statc=0,this._guide=this._guid,this.beginLoadWFSData(e))},Layer.prototype.isDestroyed=function(){return!1},Layer.prototype.destroy=function(){var e=this._tileManager.getAllTiles(),t=e.length;if(0<t)for(var i=0;i<t;i++)e[i].data.wfsLayerData[this._guid]&&e[i].data.wfsLayerData[this._guid].freeResources();return this._tileManager._loadTileEvent.removeEventListener(Layer.prototype.loadTile,this),Cesium.destroyObject(this)},Layer.prototype.sTag=function(e,t,i){if(null==this._subdomains)return"";var r=(e+t+i)%this._subdomains.length;return this._subdomains[r]},Layer.prototype.cleanUrl=function(e){return-1!=e.indexOf("?")?e.split("?")[0]:e},Layer.prototype.beginLoadWFSData=function(t){if((null==this.latLon||this.latLon)&&(null!=this.BoundingBox&&(0==this.BoundingBox.width||0==this.BoundingBox.height)&&(this.BoundingBox.east+=1,this.BoundingBox.north+=1,this.BoundingBox.beenModified=!0),void 0===this.BoundingBox||void 0!==Cesium.Rectangle.intersection(this.BoundingBox,t.rectangle))){var e=[DEGREES_PER_RADIAN*t.rectangle.west,DEGREES_PER_RADIAN*t.rectangle.south,DEGREES_PER_RADIAN*t.rectangle.east,DEGREES_PER_RADIAN*t.rectangle.north],i=this,r=this.cleanUrl(this._url).replace("{s}",this.sTag(t.x,t.y,t.level));r+=queryStringExist(r),r+="SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&outputFormat=GML2&typeName="+this._layerName+"&srsName=EPSG:4326&BBOX="+e.join(",");var o=Cesium.TrustedServers.contains(ReplaceTagWithOriginalDomain(this._url,this._subdomains));t.data.wfsLayerData[this._guid].xhr=$$.ajax({dataType:this._useWorkers?"text":"xml",url:encodeURI(r),cache:!0,xhrFields:{withCredentials:o},success:function(e){i.processWFSData(t,e)},error:function(e,t,i){"abort"!==i&&console.log("Failed to retrieve data from "+r+" :"+i)},complete:function(){t.data.wfsLayerData[i._guid].xhr=void 0}})}},Layer.prototype.processWFSData=function(e,t){if(e.data.wfsLayerData[this._guid].xhr=void 0,this._useWorkers){var i=this;workerPool.queueWorkItem({id:e.data.id,text:t,geometryFieldName:this._geometryFieldName}).then(function(e){i.addFeaturesToTile(e)})}else{var r=this._gmlParser.read(t);this.addFeaturesToTile({id:e.data.id,features:r})}},Layer.prototype.boundingSphereFromGML=function(e,i){var r=viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel,o=this;workerPool.queueWorkItem({id:"0",text:e,geometryFieldName:this._geometryFieldName}).then(function(e){var t={parentLayer:o,features:e.features,sampleTerrainLevel:r+1,isQuery:!0,onFinishedQuery:function(e){var t;0<e.length&&(t=Cesium.BoundingSphere.fromBoundingSpheres(e)),i(t)}};o._entityCreator.createPrimitiveFromWFSFeatures(t)})},Layer.prototype.boundingSphereFromFeature=function(e){var t,i={parentLayer:this,features:[e],sampleTerrainLevel:viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel+1,isQuery:!0,onFinishedQuery:function(e){0<e.length&&(t=Cesium.BoundingSphere.fromBoundingSpheres(e))}};return this._entityCreator.createPrimitiveFromWFSFeatures(i),t},Layer.prototype.addRenderedFeatureId=function(e){null==this._addedFeatures[e]&&(this._addedFeatures[e]=0),this._addedFeatures[e]++},Layer.prototype.removeRenderedFeatureId=function(e){null!=this._addedFeatures[e]&&this._addedFeatures[e]--,0==this._addedFeatures[e]&&(this._addedFeatures[e]=void 0)},Layer.prototype.isExistRenderedFeatureId=function(e){return null!=this._addedFeatures[e]},Layer.prototype.addFeaturesToTile=function(i,r){var o=this._tileManager.getTile(i.id);if(void 0!==o){var e=r?o.data.wfsLayerData[this._guid].primitive._instanceIds:void 0,n=this,t={parentLayer:this,originalInstanceIds:e,features:i.features,onFinishedCreatePrimitive:function(e){if(null!=i.features&&null!=o.data.wfsLayerData&&(o.data.wfsLayerData[n._guid].features=i.features,r||n.addFeaturesToLayer(o.data.wfsLayerData[n._guid].features),void 0===e.length||0<e.length)){var t=o.data.wfsLayerData[n._guid].primitive;e.show=n.show,(o.data.wfsLayerData[n._guid].primitive=e).parentLayer=n,e.parentTileId=i.id,e._guid=Cesium.createGuid(),r?n._tileManager.replaceInScene(t,e):n._tileManager.addToScene(e)}}};this._entityCreator.createPrimitiveFromWFSFeatures(t)}},Layer.prototype.addFeaturesToLayer=function(e){this._statistics.numberOfAddedFeatures+=e.length,this._statistics.numberOfAddePositions+=Cesium.defaultValue(e.numPositions,0);for(var t=e.length,i=0;i<t;i++)!1===Object.prototype.hasOwnProperty.call(this._featuresMap,e[i].fid)?this._featuresMap[e[i].fid]={refCount:1,feature:e[i]}:this._featuresMap[e[i].fid].refCount++},Layer.prototype.removeFeaturesFromLayer=function(e){this._statistics.numberOfDeletedFeatures+=e.length,this._statistics.numberOfDeletedPositions+=Cesium.defaultValue(e.numPositions,0);for(var t=e.length,i=0;i<t;i++)!1!==Object.prototype.hasOwnProperty.call(this._featuresMap,e[i].fid)&&(this._featuresMap[e[i].fid].refCount--,0===this._featuresMap[e[i].fid].refCount&&delete this._featuresMap[e[i].fid],this.removeRenderedFeatureId(e[i].fid))},Layer.prototype.getFeature=function(e){return!1===Object.prototype.hasOwnProperty.call(this._featuresMap,e)?null:this._featuresMap[e]},Layer.prototype.updateTile=function(e){var t=this._tileManager.getTile(e);void 0!==t&&(null==t.data.wfsLayerData[this._guid].features?this.loadTile(t):this.addFeaturesToTile(t.data.wfsLayerData[this._guid],!0))},Layer.blockRequestPrimitiveFromPrimitive=function(e){if(null!=e){var t=internalBlockRequestPrimitiveFromPrimitive(e);return null!=t||(e._labelCollection&&e._labelCollection._billboardCollection?t=internalBlockRequestPrimitiveFromPrimitive(e._labelCollection._billboardCollection):e._billboardCollection&&(t=internalBlockRequestPrimitiveFromPrimitive(e._billboardCollection))),t}},Layer.prototype.resetAttributesTable=function(){this.lastEditedCell=null,this.attrTblDialogMemo=null},Layer}),define("SGWorld/wfs/TileManager",[],function(){"use strict";function i(){this._quadtree=void 0,this._tilingScheme=new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._loadTileEvent=new Cesium.Event,this._levelZeroMaximumError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,128,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._tileCache=[],this._primitivesWaitingToBeAddedToTheScene=[],this._pauseStreaming=!1,this._numTilesInLevel=[],this.STREAM_SPEED_IMIDIATE=0,this.STREAM_SPEED_FAST=1,this.STREAM_SPEED_NORMAL=2,this.STREAM_SPEED_SLOW=3,this._streamSpeed=this.STREAM_SPEED_NORMAL}function r(e,r){$.each(e._primitives,function(e,t){if(t instanceof Cesium.BillboardCollection){var i=t;e=c.indexOf(i);return i._parentCollection._primitiveOld=r,-1!==e?(viewer.scene.primitives.remove(c[e]._parentCollection),c[e]=i):c.push(i),!1}})}function o(e,t){viewer.scene.primitives.remove(t),e._onDestroyTilePrimitive=function(){viewer.scene.primitives.remove(t),this._onDestroyTilePrimitive=void 0}}function n(e,t,i){Cesium.when.all(e,function(){viewer.scene.primitives.remove(i)}),t._onDestroyTilePrimitive=function(){viewer.scene.primitives.remove(i),this._onDestroyTilePrimitive=void 0}}function a(e,t){n($.map(e._primitives,function(e){return e.readyPromise}),e,t)}function s(e,t){n($.map(e._primitives[0]._primitives,function(e){return e.readyPromise}),e,t)}function l(e,t){viewer.scene.primitives.remove(t)}function u(e,t){n([e.readyPromise],e,t)}Object.defineProperties(i.prototype,{quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},loadTileEvent:{get:function(){return this._loadTileEvent}},pauseStreaming:{get:function(){return this._pauseStreaming},set:function(e){this._pauseStreaming=e}},streamSpeed:{get:function(){return this._streamSpeed},set:function(e){this._streamSpeed=e}},bestLevelAvailable:{get:function(){for(var e=0,t=0;t<22;t++)null!=this._numTilesInLevel[t]&&0<this._numTilesInLevel[t]&&e<t&&(e=t);return e}}}),i.prototype.streamSpeedFactor=function(){switch(this._streamSpeed){case this.STREAM_SPEED_FAST:return 1;case this.STREAM_SPEED_NORMAL:return 3;case this.STREAM_SPEED_SLOW:return 20;default:return 3}};var c=[],h=0,t=!(i.prototype.onPreFrame=function(e,t){if(h++,!this._pauseStreaming){if(this._streamSpeed==this.STREAM_SPEED_IMIDIATE)for(;0<this._primitivesWaitingToBeAddedToTheScene.length;){var i=this._primitivesWaitingToBeAddedToTheScene.pop();e.primitives.add(i)}else if(0<this._primitivesWaitingToBeAddedToTheScene.length&&h%this.streamSpeedFactor()==0){(i=this._primitivesWaitingToBeAddedToTheScene.pop())._instanceIds&&100<i._instanceIds.length&&this.streamSpeed===this.STREAM_SPEED_FAST&&(this.streamSpeed=this.STREAM_SPEED_NORMAL),e.primitives.add(i)}$.each(c,function(e,t){t.ready&&viewer.scene.primitives.remove(t._parentCollection._primitiveOld)})}});i.prototype.initialize=function(e){t||(viewer.scene.preRender.addEventListener(this.onPreFrame,this),t=!0)},i.prototype.beginUpdate=function(e){this.quadtree.beginFrame(e)},i.prototype.endUpdate=function(e){var t=this;e.afterRender.push(function(){t.quadtree.endFrame(e)})},i.prototype.updateForPick=function(e){},i.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)*this._quadtree.maximumScreenSpaceError};Math.PI;i.prototype.placeHolder=function(e,t){t=t||Cesium.Color.fromBytes(0,255,0,255);var i=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.RectangleOutlineGeometry({rectangle:e.rectangle,height:viewer.camera.positionCartographic.height-.99*TerraExplorer.internal.Navigate.HeightAboveGround}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(t)}}),appearance:new Cesium.PerInstanceColorAppearance({flat:!0})});e.data.primitive.add(i)},i.prototype.loadTile=function(e,t){var i=this;if(null==this._numTilesInLevel[t._level]&&(this._numTilesInLevel[t._level]=0),this._numTilesInLevel[t._level]++,t.state===Cesium.QuadtreeTileLoadState.START){t.data={primitive:new Cesium.PrimitiveCollection,wfsLayerData:[],id:Cesium.createGuid(),freeResources:function(){if(i._tileCache[t.data.id]&&i._numTilesInLevel[t._level]--,i._numTilesInLevel[t._level]<0&&(i._numTilesInLevel[t._level]=0),Cesium.defined(this.wfsLayerData)){for(var e in this.wfsLayerData)Cesium.defined(this.wfsLayerData[e])&&this.wfsLayerData[e].freeResources();this.wfsLayerData=void 0}Cesium.defined(this.primitive)&&(this.primitive.destroy(),this.primitive=void 0),delete i._tileCache[t.data.id]}},this._tileCache[t.data.id]=t;Math.abs(6371e3*(t.rectangle.south-t.rectangle.north));t.data.boundingSphere3D=Cesium.BoundingSphere.fromRectangle3D(t.rectangle),t.data.boundingSphere2D=Cesium.BoundingSphere.fromRectangle2D(t.rectangle,e.mapProjection);t.rectangle.west,t.rectangle.south,t.rectangle.east,t.rectangle.north;this.loadTileEvent.raiseEvent(t),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0}},i.prototype.getTile=function(e){return this._tileCache[e]},i.prototype.getAllTiles=function(){var e=[];for(var t in this._tileCache)e.push(this._tileCache[t]);return e},i.prototype.computeTileVisibility=function(e,t,i){var r,o=this.computeDistanceToTile(e,t);return e._distance=o,t.fog.enabled&&9<e._level&&1<=Cesium.Math.fog(o,t.fog.density)?Cesium.Visibility.NONE:(r=t.mode===Cesium.SceneMode.SCENE3D?e.data.boundingSphere3D:e.data.boundingSphere2D,t.cullingVolume.computeVisibility(r))},i.prototype.showTileThisFrame=function(e,t){e.data.primitive.update(t)},i.prototype.computeDistanceToTile=function(e,t){var i,r=new Cesium.Cartesian3;i=t.mode===Cesium.SceneMode.SCENE3D?e.data.boundingSphere3D:e.data.boundingSphere2D;var o=Cesium.Cartesian3.subtract(i.center,t.camera.positionWC,r),n=Cesium.Cartesian3.magnitude(o);return Math.max(1,n-TerraExplorer.internal.Navigate.GroundHeightAtCameraPosition)},i.prototype.isDestroyed=function(){return!1},i.prototype.destroy=function(){return Cesium.destroyObject(this)},i.prototype.getInstance=function(e){if(0==Cesium.defined(e.TileManager)){e.TileManager=new i;var t=new Cesium.QuadtreePrimitive({tileProvider:e.TileManager,maximumScreenSpaceError:2});e.scene.primitives.add(t)}return e.TileManager},i.prototype.addToScene=function(e){this._primitivesWaitingToBeAddedToTheScene.push(e)},i.prototype.removeFromScene=function(e){var t=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=t?(this._primitivesWaitingToBeAddedToTheScene[t].destroy(),this._primitivesWaitingToBeAddedToTheScene.splice(t,1)):viewer.scene.primitives.remove(e)},i.prototype.replaceInScene=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);if(-1!=i)this._primitivesWaitingToBeAddedToTheScene[i]=t;else switch(e.ID!=t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),null!=e._replacmentPrimitive&&viewer.scene.primitives.remove(e._replacmentPrimitive),e._replacmentPrimitive=t,viewer.scene.primitives.add(t),t.ID.split(":")[0]){case"billboards":r(t,e);break;case"labels":o(t,e);break;case"polygons":a(t,e);break;case"models":s(t,e);break;case"polylines":u(t,e);break;case"points":l(0,e);break;default:console.log("Error updating layer"),viewer.scene.primitives.remove(e)}};var d={billboards:r,labels:o,polygons:a,models:s,polylines:u,points:l};return i.prototype.replaceInSceneNew=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);if(-1!=i)this._primitivesWaitingToBeAddedToTheScene[i]=t;else{e.ID!==t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),this.addToScene(t);var r=t.ID.split(":")[0],o=d[r];o?o(t,e):(console.log("Error updating layer"),viewer.scene.primitives.remove(e))}},i}),define("SGWorld/Creator/CreateWfsFeatureLayer",["../wfs/WfsLayer","../wfs/TileManager"],function(u,i){"use strict";var r;function e(e,t){this._viewer=e,this._cesium=t,r=new i}return e.prototype.CreateWfsFeatureLayer=function(e,t,i,r,o,n,a,s,l){return new u(e,t,i,r,o,n,a,s,l)},e.prototype.initTileManager=function(){this._viewer.scene;var i=this._viewer;i.scene.preRender.addEventListener(function(e,t){r.getInstance(i).streamSpeed=2})},e}),define("SGWorld/Creator/deleteObject",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.deleteObject=function(e){this._viewer.entities.remove(e)},e}),define("SGWorld/Creator/SFSTerrainProvider copy 2",["./WorkerPool"],function(o){"use strict";var w,u=function(e,p,g,f){var v=[],_=void 0!==e[0].longitude;return e.forEach(function(e){var t,i,r,o,n,a,s,l,u,c,h,d=[],m=_?e:w.scene.globe.ellipsoid.cartesianToCartographic(e);t=m,r=g,o=f,n=(i=p).west,a=i.east,s=i.south,l=a-n,u=i.north-s,c=180*t.longitude/Math.PI,h=180*t.latitude/Math.PI,t.normalizedLongitude=(c-n)/l*r,t.normalizedLatitude=(h-s)/u*o,m=t,d.push(m.normalizedLongitude),d.push(m.normalizedLatitude),v.push(d)}),v},a=function(e,t,i){var r=t.west*Cesium.Math.DEGREES_PER_RADIAN,o=t.east*Cesium.Math.DEGREES_PER_RADIAN,n=t.south*Cesium.Math.DEGREES_PER_RADIAN,a=t.north*Cesium.Math.DEGREES_PER_RADIAN,s=new Cesium.Rectangle(r,n,o,a),l=u(e,s,32,32);return c(l,"#FF0000",32,32)},c=function(e,t,i,r,o){void 0===o&&((o=document.createElement("canvas")).width=i,o.height=r);var n=o.getContext("2d");if(!(e.length<=0)){n.moveTo(e[0][0],e[0][1]);for(var a=0;a<e.length;a++)n.lineTo(e[a][0],e[a][1]);return null!=t&&null!=t&&(n.fillStyle=t,n.fill()),o}};function s(e,t){return Math.floor(Math.random()*(t-e+1))+e}function b(e,o){var i=Cesium.when.defer(),n=[];return e.forEach(function(e){var t,i,r;n.push((t=e,i=o,r=Cesium.when.defer(),(s=a(t.vertices,i,t.heights[0])).timeStamp=t.timeStamp,s.mtHeight=t.heights,s.mtType=t.mtType,s.fromKML=t.fromKML,s.rect=t.rectangle,s.level=t.level,r.resolve(s),r))}),Cesium.when.all(n,function(e){e[0].lenght;if(1===e.length)i.resolve(e[0]);else{var t=e.sort(function(e,t){return t.timeStamp-e.timeStamp}),r=t.shift();t.forEach(function(i){r.forEach(function(e,t){e===s&&i[t]!==s&&(r[t]=i[t])})}),i.resolve(r)}}),i}var t=function(e,t){if(w=e,!Cesium.defined(t))throw new Cesium.DeveloperError("options is required.");this._errorEvent=new Cesium.Event,this._modelFloorMasks={},this._credit=t.credit,"string"==typeof this._credit&&(this._credit=new Cesium.Credit(this._credit)),t.heightMapWidth=Cesium.defaultValue(t.heightMapWidth,32),t.heightMapHeight=Cesium.defaultValue(t.heightMapHeight,32),this._options=t,this.readyPromise=Cesium.when.resolve(!0),this._subdomains=t.subdomains,t.firstRequestUrl=t.url.replace("{s}",this.sTag(0,0,0)),this._firstRequest=t.firstRequestUrl+"?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox=-90,-180,90,180&height=32&width=32&optimizedOnly=0&v=1&layers="+t.layerName+"&Styles=&Format=image/mpt";var i=this,r=t.pngOnly;void 0!==t.maxTerrainLevel&&isNaN(t.maxTerrainLevel)&&(t.maxTerrainLevel=void 0),this._maxTerrainLevel=Cesium.defaultValue(t.maxTerrainLevel,21),r?i.setFormatMPT(!1):$.ajax({url:this._firstRequest,success:function(e){if(!!(Cesium.defined(e.childNodes)&&0<e.childNodes.length))return i.setFormatMPT(!1),null;i.setFormatMPT(!0)},error:function(){return i.setFormatMPT(!1),null},async:!1}),this._urlTemplate=t.url+"?request=GetMap&Version=1.3.0&Service=WMS&v=1&CRS=EPSG:4326&bbox={south},{west},{north},{east}&height={height}&width={width}&optimizedOnly={optimizedOnly}&layers="+t.layerName+"&Styles=&Format=image/"+this._format,this._allElevationLayers=null,this._tilingScheme=new Cesium.GeographicTilingScheme,this._levelZeroMaximumGeometricError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,4*t.heightMapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._workerPool=new o({workerPath:function(){for(var e=document.scripts,t="./js/sfsterrainprovider/ParseElevationWorker.js",i=0;i<e.length;i++){var r=e[i].src.split("/"),o=r[r.length-1];"SmartEarth.js"==o?t=e[i].outerHTML.split('"')[1].replace("SmartEarth.js","Workers/ParseElevationWorker.js"):"SmartEarth.min.js"==o&&(t=e[i].outerHTML.split('"')[1].replace("SmartEarth.min.js","Workers/ParseElevationWorker.js"))}return t}()}),this._pendingRequests=0,this._requestGridSize=8,this._requestsCache={},this._requestsCacheKeys=[],this.errorEvent.addEventListener(function(e){},this)};return t._geometricErrorFactor=2,Object.defineProperties(t.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasVertexNormals:{get:function(){return!1}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},hasWaterMask:{get:function(){return!1}},heightMapHeight:{get:function(){return this._options.heightMapHeight}},heightMapWidth:{get:function(){return this._options.heightMapWidth}},pendingRequests:{get:function(){return this._pendingRequests}}}),t.prototype.setFormatMPT=function(e){if(!e||!this.pngOnly){var t=this._format;this._format=e?"mpt":"png",t!==this._format&&(this._isMPT=e,void 0!==this._urlTemplate&&(this._urlTemplate=this._urlTemplate.replace("image/"+t,"image/"+this._format)))}},t.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)*t._geometricErrorFactor},t.prototype.createKeyFromTile=function(e,t,i){return e+"_"+t+"_"+i},t.prototype.getTileDataAvailable=function(e,t,i){var r=Math.min(this._maxTerrainLevel,25);return!!this._isMPT||i<r},t.prototype.requestFactorForLevel=function(e){var t=Math.log(this._requestGridSize)/Math.log(2);return t=Math.min(t,e),Math.pow(2,t)},t.prototype.getRequestBaseTerrainUrl=function(e,t,i,r){return this.getRequestUrl(e,t,i,r)},t.prototype.getRequestElevationLayer=function(e,t,i){return this.getRequestUrl(e,t,i,!1,!0)},t.prototype.getRequestUrl=function(e,t,i,r,o){var n=i,a=null!=r?this.requestFactorForLevel(i):1,s=(e=null!=r?(e-e%a)/a:e,t=null!=r?(t-t%a)/a:t,i=null!=r?i-Math.log(a)/Math.log(2):i,this.tilingScheme.tileXYToNativeRectangle(e,t,i)),l=this.heightMapWidth*a==256&&r?1:0;return o&&(l=0),this._urlTemplate.replace("{south}",s.south).replace("{north}",s.north).replace("{west}",s.west).replace("{east}",s.east).replace("{optimizedOnly}",l).replace("{width}",this.heightMapWidth*a).replace("{height}",this.heightMapHeight*a).replace("{s}",this.sTag(e,t,i))+"&level="+i+"&origLevel="+n},t.prototype.isT_Inside_E=function(e,t){return e.west>=t.west*Cesium.Math.DEGREES_PER_RADIAN&&e.east<=t.east*Cesium.Math.DEGREES_PER_RADIAN&&e.south>=t.south*Cesium.Math.DEGREES_PER_RADIAN&&e.north<=t.north*Cesium.Math.DEGREES_PER_RADIAN},t.prototype.isT_Intersects_E=function(e,t){var i=e.west*Cesium.Math.RADIANS_PER_DEGREE,r=e.east*Cesium.Math.RADIANS_PER_DEGREE,o=e.south*Cesium.Math.RADIANS_PER_DEGREE,n=e.north*Cesium.Math.RADIANS_PER_DEGREE,a=new Cesium.Rectangle(i,o,r,n);return Cesium.Rectangle.intersection(a,t,new Cesium.Rectangle)},t.prototype.sTag=function(e,t,i){if(null==this._subdomains)return"";var r=(e+t+i)%this._subdomains.length;return this._subdomains[r]},t.prototype.refreshElevationLayer=function(e){e.rectangle&&void 0!==w.scene.globe._surface._levelZeroTiles&&this.findDirectParent(e.rectangle,!0).freeResources()},t.prototype.findDirectParent=function(e,t){var i=function e(t,i,r){var o=r?4.1:2.1;if(t._rectangle.width<=i.width*o&&Cesium.Rectangle.contains(t._rectangle,Cesium.Rectangle.center(i)))return t;for(var n=t.children.length,a=0;a<n;a++){var s=t.children[a];if(Cesium.Rectangle.contains(s._rectangle,Cesium.Rectangle.center(i)))return e(s,i,r)}return null};if(e.width==Math.PI)return null;for(var r=0;r<w.scene.globe._surface._levelZeroTiles.length;r++){var o=i(w.scene.globe._surface._levelZeroTiles[r],e,t);if(o)return o}return null},t.prototype.isTileAvailable=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(e,t,i,new Cesium.Rectangle),o=this.findDirectParent(r);if(o&&o.data&&o.data.terrainData){if(!(0<o.data.terrainData._childTileMask))return!1;for(var n=o.children.length,a=0;a<n;a++){var s=o.children[a];if(Cesium.Rectangle.equals(s._rectangle,r))return o.data.terrainData._childTileMask&1<<a}}return!0},t.prototype.markTileAsUnavailable=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(e,t,i,new Cesium.Rectangle),o=this.findDirectParent(r);o&&o.data&&o.data.terrainData&&0<o.data.terrainData._childTileMask&&$.each(o.children,function(e,t){if(Cesium.Rectangle.equals(t._rectangle,r)){switch(e){case 0:o.data.terrainData._childTileMask&=-5;break;case 1:o.data.terrainData._childTileMask&=-9;break;case 2:o.data.terrainData._childTileMask&=-2;break;case 3:o.data.terrainData._childTileMask&=-3}return!1}return!0})},t.prototype.requestBaseTerrainTileGeometry=function(e,t,i,r){return this.requestTileGeometryBuffers(e,t,i,r)},t.prototype.requestElevationLayerTileGeometry=function(e,t,i,r,o){return this.requestTileGeometryBuffers(e,t,i,r,o)},t.prototype.requestTileGeometryBuffers=function(e,t,i,r,o){var m=this,p={};p.requestedRectangle=this.tilingScheme.tileXYToNativeRectangle(e,t,i),p.layer=o;var n,a,s,l,g=Cesium.when.defer();return void 0===(l=this.requestTileHeightBuffer(e,t,i,r,void 0,o))?void 0:(n=this.requestTileHeightBuffer(e+1,t,i,r,!0,o),a=this.requestTileHeightBuffer(e,t+1,i,r,!0,o),s=this.requestTileHeightBuffer(e+1,t+1,i,r,!0,o),Cesium.when.all([l,n,a,s],function(e){if(null!=e[0].myReject&&e[0].myReject)g.reject();else{for(var t=m.heightMapWidth+1,i=m.heightMapHeight+1,r=new Float32Array(t*i),o=e[0].isFloor,n=0;n<t;n++)for(var a=0;a<i;a++){var s=n,l=a,u=0;a===t-1&&(l=0,u=1,o&&(u=0,l=t-2)),n===i-1&&(s=0,u=2);var c=n*t+a,h=s*m.heightMapWidth+l;null!==e[u]&&(null==e[u].myReject||!e[u].myReject)&&(r[c]=e[u][h])}null!=e[3].myReject&&e[3].myReject||(r[t*i-1]=e[3][0]);var d=m.arrayToHeightmapTerrainData(r,t,i,15);p.buffer=d,g.resolve(p)}}).otherwise(function(){g.reject()}),g)},t.prototype.requestTileGeometry=function(r,o,n,a){var s=this,l=[],u=s.tilingScheme.tileXYToNativeRectangle(r,o,n);null!=this._allElevationLayers&&0<this._allElevationLayers.length&&7<n?$(this._allElevationLayers).each(function(e,t){if(t.show){var i=t.rectangle;s.isT_Inside_E(u,i)?(s.setFormatMPT(!1),l.push(s.requestElevationLayerTileGeometry(r,o,n,a,t))):(null!=s.isT_Intersects_E(u,i)?(s.setFormatMPT(!1),l.push(s.requestElevationLayerTileGeometry(r,o,n,a,t))):s.setFormatMPT(!0),l.push(s.requestBaseTerrainTileGeometry(r,o,n,a)))}else s.setFormatMPT(!0),l.push(s.requestBaseTerrainTileGeometry(r,o,n,a))}):(s.setFormatMPT(!0),l.push(s.requestBaseTerrainTileGeometry(r,o,n,a)));var c=Cesium.when.defer();return Cesium.when.all(l,function(e){if(1===e.length)void 0!==e.layer&&console.log("missing scale and offset"),c.resolve(e[0].buffer);else if(1<e.length){var t=$.grep(e,function(e){return void 0!==e.layer}),i=$.grep(e,function(e){return void 0===e.layer});if(0===t.length)c.resolve(e[0].buffer);else{var r=t[t.length-1],o=i[i.length-1],n={tolerance:r.layer.nullTolerance,nullValueNumber:r.layer.nullValueNumber,verticesX:r.layer.polygonVerticesX,verticesY:r.layer.polygonVerticesY,scale:Cesium.defaultValue(r.layer.scale,1),offset:Cesium.defaultValue(r.layer.offset,0)};c.resolve(s.mergeBuffers(o.buffer,r.buffer,n,o.requestedRectangle))}}else c.reject()}).otherwise(function(){c.reject()}),c},t.prototype.mergeBuffers=function(e,t,i,r){var o,n,a,s,l,u=r.west,c=r.north,h=(r.east,r.south,r.width/33),d=r.height/33,m=i.scale,p=i.offset,g=i.nullValueNumber,f=i.tolerance,v=void 0!==g&&void 0!==f;if(v)var _=Cesium.defaultValue(i.nullValueNumber,0),y=Cesium.defaultValue(Number(i.tolerance),0);var C=new Float32Array(1089);for(o=0,l=c;o<33;o++,l+=d)for(n=0,s=u;n<33;n++,s+=h)C[a=33*o+n]=v?!t._buffer[a]||t._buffer[a]>=_-y&&t._buffer[a]<=_+y?e._buffer[a]:t._buffer[a]*m+p:t._buffer[a]?t._buffer[a]*m+p:e._buffer[a];return this.arrayToHeightmapTerrainData(C,33,33,15)},t.prototype.requestTileHeightBuffer=function(u,c,h,e,t,r){if(!isNaN(u+c+h)){Cesium.defined(e)&&!1!==e||(e=new Cesium.Request({defer:!0}));var i=0==e.defer;t=Cesium.defaultValue(i,!1);var o,d=Cesium.when.defer();if(void 0!==r)r.getUrlFromSTag=function(e,t,i){return void 0===r.subdomains?r.url:r.subdomains[0]+"/SG"},o=this.getRequestElevationLayer(u,c,h).replace(this._options.url,r.getUrlFromSTag(u,c,h)+"/Elevation").replace(this._options.layerName,r.name),"mpt"===r.format&&(o=o.replace("image/png","image/mpt"));else{o=this.getRequestBaseTerrainUrl(u,c,h,i||t);var m=w.terrainProvider.tilingScheme.tileXYToRectangle(u,c,h),n=w.terrainProvider._modifyTerrainObjects,a=Cesium.when.defer();if(void 0!==n){var s=[];if(n.forEach(function(e){e.show&&null!=Cesium.Rectangle.intersection(m,e.rectangle,new Cesium.Rectangle)&&s.push(e)}),0<s.length)if(1===s.length&&s[0].modelFloorBestLevel&&h>s[0].modelFloorBestLevel)a.resolve("NoMerge");else{var l=b(s,m);Cesium.when(l,function(e){a.resolve(e)}).otherwise(function(e){console.log(e)})}else a.resolve("NoMerge")}else a.resolve("NoMerge");var p=Cesium.when.defer(),g=$.grep([],function(e){return 0<e._selectedTiles.length});if(1===g.length&&g[0].level&&h>g[0].level)p.resolve("NoFloor");else{var f=!1;g.forEach(function(e){if(e.ready&&e.show&&void 0!==e.rootFloorRectangle&&void 0!==Cesium.Rectangle.intersection(m,e.rootFloorRectangle)){for(var t,i=new Uint16Array(1024),r=m.west,o=(m.south,(m.east-m.west)/32),n=(m.north-m.south)/32,a=0;a<32;a++)for(var s=0;s<32;s++){var l=r+o*s+o/2,u=m.north-n*a-n/2,c=new Cesium.Cartographic(l,u);t=65535;var h=e.getHRMTFP(e,c,!0);null!=h&&h.content&&h.content._model&&h.content._model.floor&&(t=h.content._model.floor.getHeight(c.longitude,c.latitude)),65535!==t&&(t+=1.5),i[32*a+s]=t}f=!0,p.resolve(i)}}),f||p.resolve("NoFloor")}w.scene.globe.ellipsoid}if(!1===this._requestsCache.hasOwnProperty(o)){if(this._requestsCache[o]={},this._requestsCacheKeys.push(o),100<this._requestsCacheKeys.length){for(var v=0;v<50;v++)delete this._requestsCache[this._requestsCacheKeys[v]];this._requestsCacheKeys.splice(0,50)}}else{var _=this._requestsCacheKeys.indexOf(o);this._requestsCacheKeys.splice(_,1),this._requestsCacheKeys.push(o)}var y=this._requestsCache[o];if(void 0!==y.dataLoaded||(y.dataLoaded=Cesium.Resource.fetchArrayBuffer(o),Cesium.defined(y.dataLoaded))){var C=this;return this._pendingRequests++,Cesium.when(y.dataLoaded,function(e){void 0===y.workerFinished&&(y.workerFinished=C._workerPool.queueWorkItem({buffer:e,isElevation:void 0!==r,level:h})),Cesium.when.all([y.workerFinished,a,p],function(e){var t=void 0!==e[1]&&"NoMerge"!==e[1],i=void 0!==e[2]&&"NoFloor"!==e[2];if(e[0].rejected){for(var r=C.heightMapWidth*C.heightMapHeight,o=new Int16Array(r),n=0;n<r;n++)o[n]=300;return 2<h&&(o.myReject=!0),d.resolve(o),d}var a=C.extractTileHeightBuffer(e[0].buffer,u,c,h);if(C._pendingRequests--,t)for(n=0;n<32;n++)for(var s=0;s<32;s++){var l=32*n+s;e[1].fromKML?a[l]=1===e[1][l]?a[l]:1==e[1].mtType?a[l]+e[1].mtHeight:2==e[1].mtType?Math.min(a[l],e[1].mtHeight):3==e[1].mtType?Math.max(a[l],e[1].mtHeight):e[1].mtHeight:a[l]=1===e[1][l]?a[l]:1==e[1].mtType?a[l]+e[1][l]:2==e[1].mtType?Math.min(a[l],e[1][l]):3==e[1].mtType?Math.max(a[l],e[1][l]):e[1][l]}if(i){for(n=0;n<32;n++)for(s=0;s<32;s++){a[l=32*n+s]=65535===e[2][l]?a[l]:e[2][l]}a.isFloor=!0}d.resolve(a)}).otherwise(function(){for(var e=C.heightMapWidth*C.heightMapHeight,t=new Int16Array(e),i=0;i<e;i++)t[i]=300;return 2<h&&(t.myReject=!0),d.resolve(t),d})}).otherwise(function(){C._pendingRequests--,d.reject()}),d}}},t.prototype.extractTileHeightBuffer=function(e,t,i,r){try{for(var o=this.requestFactorForLevel(r),n=t%o,a=i%o,s=new Int16Array(this.heightMapWidth*this.heightMapHeight),l=1e6,u=-1e5,c=0;c<this.heightMapHeight;c++)for(var h=0;h<this.heightMapWidth;h++){var d=c+a*this.heightMapHeight,m=h+n*this.heightMapWidth,p=c*this.heightMapWidth+h,g=d*this.heightMapWidth*o+m;e[g]>u&&(u=e[g]),e[g]<l&&(l=e[g]),s[p]=e[g]}}catch(e){console.log(e.message)}return s},t.prototype.arrayToHeightmapTerrainData=function(e,t,i,r){!1===Cesium.defined(e)&&(e=new Int16Array(t*i));var o={buffer:e,width:t,height:i,childTileMask:r};return new Cesium.HeightmapTerrainData(o)},t}),define("SGWorld/DateTime/Current",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}return e.prototype.currentTime=function(e){if(""!=e&&null!=e){var t=new Date(e),i=this.this._cesium.JulianDate.fromDate(t);this._viewer.clock.currentTime=i.clone()}return this},e.prototype.currentTimeFaster=function(){return this._viewer.animation.viewModel.faster(),this},e.prototype.currentTimeSlower=function(){return this._viewer.animation.viewModel.slower(),this},e.prototype.currentplayForwardViewModel=function(){return this._viewer.animation.viewModel.playForwardViewModel.command(),this},e.prototype.currentplayReverseViewModel=function(){return this._viewer.animation.viewModel.playReverseViewModel.command(),this},e.prototype.currentpauseViewModel=function(){return this._viewer.animation.viewModel.pauseViewModel.command(),this},e}),define("SGWorld/DateTime/DateTime",["./Current"],function(i){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._current=new i(this._viewer,this._cesium)}return e.prototype.currentTime=function(e){return new i(this._viewer,this._cesium).currentTime(e)},e.prototype.currentTimeFaster=function(){return new i(this._viewer,this._cesium).currentTimeFaster()},e.prototype.currentTimeSlower=function(){return new i(this._viewer,this._cesium).currentTimeSlower()},e.prototype.currentplayForwardViewModel=function(){return new i(this._viewer,this._cesium).currentplayForwardViewModel()},e.prototype.currentplayReverseViewModel=function(){return new i(this._viewer,this._cesium).currentplayReverseViewModel()},e.prototype.currentpauseViewModel=function(){return new i(this._viewer,this._cesium).currentpauseViewModel()},e}),define("SGWorld/ProjectTree/expandGroup",["./treeSource"],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t,this._tree=tree.getSource()}return e.prototype.deleteItem=function(e){},e}),define("SGWorld/Terrain/Terrain",[],function(){return function(){}}),define("SGWorld/VectorTileProvider/ArcgisNVectorTileProvider",[],function(){"use strict";var n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],r=!0,o=!1,n=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){o=!0,n=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw n}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof2(e)};function h(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function e(e,t,i){this._viewer=e,this._cesium=t,this._viewer=null,this._Cesium=i.Cesium,this._url=i.url,this._urlParams=i.urlParams,this._urlTemplate=this._url+"?"+this._serialize(this._urlParams),this._rectangle=i.rectangle,this._maximumLevel=i.maximumLevel||19,this._minimumLevel=i.minimumLevel||1,this._tilingScheme=i.tilingScheme||new this._Cesium.GeographicTilingScheme,this._tileRangeByLevel={},this._moveEndTimestamp=null,this._isRemoved=!1,this._isCameraMoving=!1,this._propertyToBeFiltered=null,this._valuesToBeFiltered=null,this._primitiveByTile={},this._tileKeys=[],this._lowerLevelLimit=i.lowerLevelLimit||1,this._upperLevelLimit=i.upperLevelLimit||null,this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._cameraMoveStartHandler=this._cameraMoveStartHandler.bind(this),this.heightById={};for(var r=this._radianToDegree(this._rectangle.west),o=this._radianToDegree(this._rectangle.south),n=this._radianToDegree(this._rectangle.east),a=this._radianToDegree(this._rectangle.north),s=this._minimumLevel;s<=this._maximumLevel;s++){var l=this._lonLatToTileInWGS84([r,o],s),u=this._lonLatToTileInWGS84([n,a],s),c=Math.min(l[0],u[0]),h=Math.max(l[0],u[0]),d=Math.min(l[1],u[1]),m=Math.max(l[1],u[1]);this._tileRangeByLevel[s]={minCol:d,maxCol:m,minRow:c,maxRow:h}}this._tileRangeByLevel[0]={minCol:0,maxCol:0,minRow:0,maxRow:0},this._primitiveCollection=new this._Cesium.PrimitiveCollection,this._stop=!1}return e.prototype._serialize=function(e){var t=[],i=window.encodeURIComponent;for(var r in e){var o=e[r];"object"===(void 0===o?"undefined":a(o))?t.push(i(r)+"="+i(JSON.stringify(o))):t.push(i(r)+"="+i(e[r]))}return t.join("&")},e.prototype._fetch=function(o){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(t,i){var r=new XMLHttpRequest;if(r.open(n.method||"GET",o),n.headers)for(var e in n.headers)r.setRequestHeader(e,n.headers[e]);r.onload=function(){if(4===r.readyState&&200===r.status)try{var e=JSON.parse(r.responseText);t(e)}catch(e){i(new Error("INVALID RESPONSE"))}},r.onerror=function(e){i(e)},r.onloadend=function(e){200!==e.target.status&&i(new Error("["+e.target.status+"]request failed: "+o))},r.send(n.body||null)})},e.prototype._lonLatToTileInWGS84=function(e,t){var i=n(e,2),r=i[0],o=i[1];return[Math.floor(Math.pow(2,t)*(90-o)/180),Math.floor(Math.pow(2,t)*(180+r)/180)]},e.prototype._radianToDegree=function(e){return e/Math.PI*180},e.prototype._isTileInRange=function(e){try{var t=this._tileRangeByLevel[e.level],i=t.minCol,r=t.maxCol,o=t.minRow,n=t.maxRow;return e.x>=i&&e.x<=r&&e.y>=o&&e.y<=n}catch(e){return!1}},e.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0},e.prototype._loadTile=function(e){var l=[],u=new this._Cesium.ColorGeometryInstanceAttribute(.75,.75,.75,1),c=this;return e.features.forEach(function(e){if(c._propertyToBeFiltered&&Array.isArray(c._valuesToBeFiltered)){var t=e.properties[c._propertyToBeFiltered];if(c._valuesToBeFiltered.includes(t))return}var i=e.geometry.type;if("Polygon"===i||"MultiPolygon"===i){var s=[];c.heightById[e.properties.house_id]=e.properties.height,e.geometry.coordinates.forEach(function(e,i){s.push([]),e.forEach(function(e){var t;2<e.length?e.forEach(function(e){var t;2<=e.length&&(t=s[i]).push.apply(t,h(e))}):(t=s[i]).push.apply(t,h(e))});var t=new c._Cesium.PolygonHierarchy(c._Cesium.Cartesian3.fromDegreesArray(s[i])),r=c._Cesium.BoundingSphere.fromPoints(t.positions).center,o=c._viewer.scene.globe.getHeight(c._Cesium.Cartographic.fromCartesian(r))||0,n=new c._Cesium.PolygonGeometry({polygonHierarchy:t,height:o,vertexFormat:c._Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,extrudedHeight:1e3}),a=new c._Cesium.GeometryInstance({geometry:n,attributes:{color:u}});l.push(a)})}else console.warn('GeoJSONVectorTileProvider: geometry type "'+e.geometry.type+'" detected, but is not going to be rendered')}),new this._Cesium.Primitive({allowPicking:!1,appearance:new this._Cesium.PerInstanceColorAppearance({translucent:!1}),geometryInstances:l})},e.prototype._cameraMoveEndHandler=function(){if(!this._stop){var r=this,o=Date.now(),e=this._viewer.scene.globe._surface._tilesToRender,t=e.map(function(e){return e.level}),i=Math.min.apply(Math,h(t)),n=Math.max.apply(Math,h(t));n<this._lowerLevelLimit&&(r._tileKeys=[],r._removeObsoletePrimitives(r._primitiveByTile,[]),e=[]),this._upperLevelLimit&&i>this._upperLevelLimit&&(r._tileKeys=[],r._removeObsoletePrimitives(r._primitiveByTile,[]),e=[]),2<n-i&&(e=e.filter(function(e){return e.level>=n-2})),e.sort(function(e,t){return-(e.level-t.level)}),e=e.filter(function(e){return r._isTileInRange(e)}),this._upperLevelLimit&&(e=this._refineTiles(e,this._upperLevelLimit)),this._isCameraMoving=!1,this._moveEndTimestamp=o;var a=[],s=0,l=0;e.forEach(function(e){var i="z"+e.level+"x"+e.x+"y"+e.y;if(a.push(i),r._tileKeys.push(i),!r._primitiveByTile[i]){var t=r._urlTemplate.replace(window.encodeURIComponent("{x}"),e.x).replace(window.encodeURIComponent("{y}"),e.y).replace(window.encodeURIComponent("{z}"),e.level);s++,r._fetch(t).then(function(e){if(r._isRemoved)throw new Error("DISCARD");if(r._isCameraMoving)throw new Error("DISCARD");if(o!==r._moveEndTimestamp)throw new Error("DISCARD");var t=r._loadTile(e);r._primitiveCollection.add(t),r._primitiveByTile[i]=t,s<=++l&&(r._tileKeys=a,r._removeObsoletePrimitives(r._primitiveByTile,a))}).catch(function(e){s<=++l&&(r._tileKeys=a,r._removeObsoletePrimitives(r._primitiveByTile,a)),e.message})}})}},e.prototype._refineTiles=function(e,c){var h=[],d=[];return e.forEach(function(e){var t="Z"+e.level+"X"+e.x+"Y"+e.y;if(e.level<c-1)d.includes(t)||(h.push(e),d.push(t));else if(e.level===c-1)for(var i=0;i<2;i++)for(var r=0;r<2;r++){var o="Z"+(e.level+1)+"X"+(2*e.x+i)+"Y"+(2*e.y+r);d.includes(o)||(h.push({x:2*e.x+i,y:2*e.y+r,level:e.level+1}),d.push(o))}else{var n=e.level-c;if(0===n)d.includes(t)||(h.push(e),d.push(t));else{var a=2*n,s=Math.floor(e.x/a),l=Math.floor(e.y/a),u="Z"+c+"X"+s+"Y"+l;d.includes(u)||(h.push({x:s,y:l,level:c}),d.push(u))}}}),h},e.prototype._removeObsoletePrimitives=function(e,t){var i=[];for(var r in 0<t.length&&(i=t),e){if(!i.includes(r))this._primitiveCollection.remove(e[r])&&delete e[r]}},e.prototype.addTo=function(e){this._viewer=e,this._viewer.scene.primitives.add(this._primitiveCollection),this._isRemoved=!1,this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.addEventListener(this._cameraMoveStartHandler),this._cameraMoveEndHandler()},e.prototype.remove=function(){if(this._viewer){for(var e in this._primitiveByTile)this._viewer.scene.primitives.remove(this._primitiveByTile[e]);this._primitiveByTile={},this._viewer.camera.moveEnd.removeEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.removeEventListener(this._cameraMoveStartHandler),this._viewer=null,this._isRemoved=!0}},e.prototype.setStatus=function(e){this._stop=e},e.prototype.isRemoved=function(){return this._isRemoved},e.prototype.filterBy=function(e,t,i){this._propertyToBeFiltered=e,this._valuesToBeFiltered=t},e.prototype.removeFilter=function(){this._propertyToBeFiltered=null,this._valuesToBeFiltered=null},e}),define("SGWorld/VectorTileProvider/VectorTileProvider1",[],function(){"use strict";function i(e,t){this._viewer=e,this._cesium=t,this._quadtree=void 0,this._tilingScheme=new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._levelZeroMaximumError=Cesium.QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme),this.cartographicLimitRectangle=Cesium.Rectangle.clone(Cesium.Rectangle.MAX_VALUE),i.prototype.ready||Object.defineProperties(i.prototype,{quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}}})}return i.prototype.update=function(e){this._quadtree.beginFrame(e),this._quadtree.render(e),this._quadtree.endFrame(e)},i.prototype.initialize=function(e){},i.prototype.beginUpdate=function(e){},i.prototype.endUpdate=function(e){},i.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)},i.prototype.loadTile=function(e,t){},i.prototype.computeTileVisibility=function(e,t,i){var r=this.computeDistanceToTile(e,t);if(e._distance=r,t.fog.enabled&&1<=Cesium.Math.fog(r,t.fog.density))return Cesium.Visibility.NONE;var o=e.data;o.tileBoundingRegion;if(void 0===o.boundingVolumeSourceTile)return Cesium.Visibility.PARTIAL;var n=t.cullingVolume,a=o.orientedBoundingBox;!a&&o.renderedMesh&&(a=o.renderedMesh.boundingSphere3D),o.clippedByBoundaries=!1;var s=function(e,t){if(t.west<t.east)return t;var i=Rectangle.clone(t,splitCartographicLimitRectangleScratch);return 0<Rectangle.center(e,rectangleCenterScratch).longitude?i.east=CesiumMath.PI:i.west=-CesiumMath.PI,i}(e.rectangle,this.cartographicLimitRectangle),l=new Cesium.Rectangle,u=Cesium.Rectangle.simpleIntersection(s,e.rectangle,l);if(!u)return Visibility.NONE;if(Cesium.Rectangle.equals(u,e.rectangle)||(o.clippedByBoundaries=!0),t.mode,Cesium.SceneMode.SCENE3D,!a)return Cesium.Intersect.INTERSECTING;var c=this._clippingPlanes;if(c&&c.enabled){var h=c.computeIntersectionWithBoundingVolume(a);if(e.isClipped=h!==Intersect.INSIDE,h===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE}var d=n.computeVisibility(a);if(d===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE;var m=t.mode===Cesium.SceneMode.SCENE3D&&t.camera.frustum instanceof Cesium.OrthographicFrustum;if(t.mode!==Cesium.SceneMode.SCENE3D||m||!i)return d;var p=o.occludeePointInScaledSpace;return p?i.ellipsoid.isScaledSpacePointVisible(p)?d:Cesium.Visibility.NONE:d},i.prototype.canRefine=function(e,t,i){return e.level<16},i.prototype.showTileThisFrame=function(e,t,i,r){e.data.geometryPrimitive&&e.data.geometryPrimitive.update(t,i,r)},i.prototype.computeDistanceToTile=function(e,t){var i,r,o,n,a,s,l,u,c,h,d=(i=e,this.terrainProvider,void 0===(r=i.data)&&(r=i.data=new Cesium.GlobeSurfaceTile),void 0===r.tileBoundingRegion&&(r.tileBoundingRegion=new Cesium.TileBoundingRegion({computeBoundingVolumes:!1,rectangle:i.rectangle,ellipsoid:i.tilingScheme.ellipsoid,minimumHeight:0,maximumHeight:0})),i),m=e.data,p=m.tileBoundingRegion;if(void 0===d)return 9999999999;if(m.boundingVolumeSourceTile!==d){m.boundingVolumeSourceTile=d;var g=e.rectangle;g&&g.width<Cesium.Math.PI_OVER_TWO+Cesium.Math.EPSILON5&&(m.orientedBoundingBox=Cesium.OrientedBoundingBox.fromRectangle(e.rectangle,p.minimumHeight,p.maximumHeight,e.tilingScheme.ellipsoid,m.orientedBoundingBox),m.occludeePointInScaledSpace=(o=this,n=m.orientedBoundingBox.center,a=e.rectangle,s=p.maximumHeight,l=m.occludeePointInScaledSpace,u=o.quadtree._occluders.ellipsoid,c=u.ellipsoid,h=[new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3],Cesium.Cartesian3.fromRadians(a.west,a.south,s,c,h[0]),Cesium.Cartesian3.fromRadians(a.east,a.south,s,c,h[1]),Cesium.Cartesian3.fromRadians(a.west,a.north,s,c,h[2]),Cesium.Cartesian3.fromRadians(a.east,a.north,s,c,h[3]),u.computeHorizonCullingPoint(n,h,l)))}var f=p.minimumHeight,v=p.maximumHeight;if(m.boundingVolumeSourceTile!==e){var _=t.camera.positionCartographic.height,y=Math.abs(_-f);Math.abs(_-v)<y?(p.minimumHeight=f,p.maximumHeight=f):(p.minimumHeight=v,p.maximumHeight=v)}var C=p.distanceToCamera(t);return p.minimumHeight=f,p.maximumHeight=v,C},i.prototype.isDestroyed=function(){return!1},i.prototype.destroy=function(){return Cesium.destroyObject(this)},i.prototype.remove=function(){this.destroy()},i}),define("SGWorld/VectorTileProviderPolymerization/ArcgisNVectorTileProvider",[],function(){"use strict";var n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],r=!0,o=!1,n=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){o=!0,n=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw n}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof2(e)};function h(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function e(e,t,i){this._viewer=e,this._cesium=t,this._viewer=null,this._Cesium=i.Cesium,this._url=i.url,this._urlParams=i.urlParams,this._urlTemplate=this._url+"?"+this._serialize(this._urlParams),this._rectangle=i.rectangle,this._maximumLevel=i.maximumLevel||19,this._minimumLevel=i.minimumLevel||1,this._tilingScheme=i.tilingScheme||new this._Cesium.GeographicTilingScheme,this._tileRangeByLevel={},this._moveEndTimestamp=null,this._isRemoved=!1,this._isCameraMoving=!1,this._propertyToBeFiltered=null,this._valuesToBeFiltered=null,this._primitiveByTile={},this._tileKeys=[],this._lowerLevelLimit=i.lowerLevelLimit||1,this._upperLevelLimit=i.upperLevelLimit||null,this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._cameraMoveStartHandler=this._cameraMoveStartHandler.bind(this),this.heightById={};for(var r=this._radianToDegree(this._rectangle.west),o=this._radianToDegree(this._rectangle.south),n=this._radianToDegree(this._rectangle.east),a=this._radianToDegree(this._rectangle.north),s=this._minimumLevel;s<=this._maximumLevel;s++){var l=this._lonLatToTileInWGS84([r,o],s),u=this._lonLatToTileInWGS84([n,a],s),c=Math.min(l[0],u[0]),h=Math.max(l[0],u[0]),d=Math.min(l[1],u[1]),m=Math.max(l[1],u[1]);this._tileRangeByLevel[s]={minCol:d,maxCol:m,minRow:c,maxRow:h}}this._tileRangeByLevel[0]={minCol:0,maxCol:0,minRow:0,maxRow:0},this._primitiveCollection=new this._Cesium.PrimitiveCollection,this._stop=!1}return e.prototype._serialize=function(e){var t=[],i=window.encodeURIComponent;for(var r in e){var o=e[r];"object"===(void 0===o?"undefined":a(o))?t.push(i(r)+"="+i(JSON.stringify(o))):t.push(i(r)+"="+i(e[r]))}return t.join("&")},e.prototype._fetch=function(o){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(t,i){var r=new XMLHttpRequest;if(r.open(n.method||"GET",o),n.headers)for(var e in n.headers)r.setRequestHeader(e,n.headers[e]);r.onload=function(){if(4===r.readyState&&200===r.status)try{var e=JSON.parse(r.responseText);t(e)}catch(e){i(new Error("INVALID RESPONSE"))}},r.onerror=function(e){i(e)},r.onloadend=function(e){200!==e.target.status&&i(new Error("["+e.target.status+"]request failed: "+o))},r.send(n.body||null)})},e.prototype._lonLatToTileInWGS84=function(e,t){var i=n(e,2),r=i[0],o=i[1];return[Math.floor(Math.pow(2,t)*(90-o)/180),Math.floor(Math.pow(2,t)*(180+r)/180)]},e.prototype._radianToDegree=function(e){return e/Math.PI*180},e.prototype._isTileInRange=function(e){try{var t=this._tileRangeByLevel[e.level],i=t.minCol,r=t.maxCol,o=t.minRow,n=t.maxRow;return e.x>=i&&e.x<=r&&e.y>=o&&e.y<=n}catch(e){return!1}},e.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0},e.prototype._loadTile=function(e){var l=[],u=new this._Cesium.ColorGeometryInstanceAttribute(.75,.75,.75,1),c=this;return e.features.forEach(function(e){if(c._propertyToBeFiltered&&Array.isArray(c._valuesToBeFiltered)){var t=e.properties[c._propertyToBeFiltered];if(c._valuesToBeFiltered.includes(t))return}var i=e.geometry.type;if("Polygon"===i||"MultiPolygon"===i){var s=[];c.heightById[e.properties.house_id]=e.properties.height,e.geometry.coordinates.forEach(function(e,i){s.push([]),e.forEach(function(e){var t;2<e.length?e.forEach(function(e){var t;2<=e.length&&(t=s[i]).push.apply(t,h(e))}):(t=s[i]).push.apply(t,h(e))});var t=new c._Cesium.PolygonHierarchy(c._Cesium.Cartesian3.fromDegreesArray(s[i])),r=c._Cesium.BoundingSphere.fromPoints(t.positions).center,o=c._viewer.scene.globe.getHeight(c._Cesium.Cartographic.fromCartesian(r))||0,n=new c._Cesium.PolygonGeometry({polygonHierarchy:t,height:o,vertexFormat:c._Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,extrudedHeight:1e3}),a=new c._Cesium.GeometryInstance({geometry:n,attributes:{color:u}});l.push(a)})}else console.warn('GeoJSONVectorTileProvider: geometry type "'+e.geometry.type+'" detected, but is not going to be rendered')}),new this._Cesium.Primitive({allowPicking:!1,appearance:new this._Cesium.PerInstanceColorAppearance({translucent:!1}),geometryInstances:l})},e.prototype._cameraMoveEndHandler=function(){if(!this._stop){var r=this,o=Date.now(),e=this._viewer.scene.globe._surface._tilesToRender,t=e.map(function(e){return e.level}),i=Math.min.apply(Math,h(t)),n=Math.max.apply(Math,h(t));n<this._lowerLevelLimit&&(r._tileKeys=[],r._removeObsoletePrimitives(r._primitiveByTile,[]),e=[]),this._upperLevelLimit&&i>this._upperLevelLimit&&(r._tileKeys=[],r._removeObsoletePrimitives(r._primitiveByTile,[]),e=[]),2<n-i&&(e=e.filter(function(e){return e.level>=n-2})),e.sort(function(e,t){return-(e.level-t.level)}),e=e.filter(function(e){return r._isTileInRange(e)}),this._upperLevelLimit&&(e=this._refineTiles(e,this._upperLevelLimit)),this._isCameraMoving=!1,this._moveEndTimestamp=o;var a=[],s=0,l=0;e.forEach(function(e){var i="z"+e.level+"x"+e.x+"y"+e.y;if(a.push(i),r._tileKeys.push(i),!r._primitiveByTile[i]){var t=r._urlTemplate.replace(window.encodeURIComponent("{x}"),e.x).replace(window.encodeURIComponent("{y}"),e.y).replace(window.encodeURIComponent("{z}"),e.level);s++,r._fetch(t).then(function(e){if(r._isRemoved)throw new Error("DISCARD");if(r._isCameraMoving)throw new Error("DISCARD");if(o!==r._moveEndTimestamp)throw new Error("DISCARD");var t=r._loadTile(e);r._primitiveCollection.add(t),r._primitiveByTile[i]=t,s<=++l&&(r._tileKeys=a,r._removeObsoletePrimitives(r._primitiveByTile,a))}).catch(function(e){s<=++l&&(r._tileKeys=a,r._removeObsoletePrimitives(r._primitiveByTile,a)),e.message})}})}},e.prototype._refineTiles=function(e,c){var h=[],d=[];return e.forEach(function(e){var t="Z"+e.level+"X"+e.x+"Y"+e.y;if(e.level<c-1)d.includes(t)||(h.push(e),d.push(t));else if(e.level===c-1)for(var i=0;i<2;i++)for(var r=0;r<2;r++){var o="Z"+(e.level+1)+"X"+(2*e.x+i)+"Y"+(2*e.y+r);d.includes(o)||(h.push({x:2*e.x+i,y:2*e.y+r,level:e.level+1}),d.push(o))}else{var n=e.level-c;if(0===n)d.includes(t)||(h.push(e),d.push(t));else{var a=2*n,s=Math.floor(e.x/a),l=Math.floor(e.y/a),u="Z"+c+"X"+s+"Y"+l;d.includes(u)||(h.push({x:s,y:l,level:c}),d.push(u))}}}),h},e.prototype._removeObsoletePrimitives=function(e,t){var i=[];for(var r in 0<t.length&&(i=t),e){if(!i.includes(r))this._primitiveCollection.remove(e[r])&&delete e[r]}},e.prototype.addTo=function(e){this._viewer=e,this._viewer.scene.primitives.add(this._primitiveCollection),this._isRemoved=!1,this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.addEventListener(this._cameraMoveStartHandler),this._cameraMoveEndHandler()},e.prototype.remove=function(){if(this._viewer){for(var e in this._primitiveByTile)this._viewer.scene.primitives.remove(this._primitiveByTile[e]);this._primitiveByTile={},this._viewer.camera.moveEnd.removeEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.removeEventListener(this._cameraMoveStartHandler),this._viewer=null,this._isRemoved=!0}},e.prototype.setStatus=function(e){this._stop=e},e.prototype.isRemoved=function(){return this._isRemoved},e.prototype.filterBy=function(e,t,i){this._propertyToBeFiltered=e,this._valuesToBeFiltered=t},e.prototype.removeFilter=function(){this._propertyToBeFiltered=null,this._valuesToBeFiltered=null},e}),define("SGWorld/VectorTileProviderPolymerization/GeoJSONVectorTileProvider1",[],function(){"use strict";var n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],r=!0,o=!1,n=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){o=!0,n=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw n}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof2(e)};function p(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function e(e,t,i){this._viewer=e,this._cesium=t,this._viewer=null,this.UrlData={output:i.output,resultmode:i.resultmode,uid:i.uid,st:i.st,words:i.words,area:i.area,callback:i.callback},this._Cesium=i.Cesium,this.cluster="city",this._url=i.url,this._urlParams=i.urlParams,this._urlTemplate=this._url+"?"+this._serialize(this._urlParams),this._rectangle=i.rectangle,this._maximumLevel=i.maximumLevel||19,this._minimumLevel=i.minimumLevel||1,this._tilingScheme=i.tilingScheme||new this._Cesium.GeographicTilingScheme,this._tileRangeByLevel={},this._moveEndTimestamp=null,this._isRemoved=!1,this._isCameraMoving=!1,this._propertyToBeFiltered=null,this._valuesToBeFiltered=null,this._primitiveByTile={},this._tileKeys=[],this._lowerLevelLimit=i.lowerLevelLimit||1,this._upperLevelLimit=i.upperLevelLimit||null,this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._cameraMoveStartHandler=this._cameraMoveStartHandler.bind(this),this.heightById={};for(var r=this._radianToDegree(this._rectangle.west),o=this._radianToDegree(this._rectangle.south),n=this._radianToDegree(this._rectangle.east),a=this._radianToDegree(this._rectangle.north),s=this._minimumLevel;s<=this._maximumLevel;s++){var l=this._lonLatToTileInWGS84([r,o],s),u=this._lonLatToTileInWGS84([n,a],s),c=Math.min(l[0],u[0]),h=Math.max(l[0],u[0]),d=Math.min(l[1],u[1]),m=Math.max(l[1],u[1]);this._tileRangeByLevel[s]={minCol:d,maxCol:m,minRow:c,maxRow:h}}this._tileRangeByLevel[0]={minCol:0,maxCol:0,minRow:0,maxRow:0},this._primitiveCollection=new this._Cesium.PrimitiveCollection,this._stop=!1}return e.prototype._serialize=function(e){var t=[],i=window.encodeURIComponent;for(var r in e){var o=e[r];"object"===(void 0===o?"undefined":a(o))?t.push(i(r)+"="+i(JSON.stringify(o))):t.push(i(r)+"="+i(e[r]))}return t.join("&")},e.prototype._fetch=function(o){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(t,i){var r=new XMLHttpRequest;if(r.open(n.method||"GET",o),n.headers)for(var e in n.headers)r.setRequestHeader(e,n.headers[e]);r.onload=function(){if(4===r.readyState&&200===r.status)try{var e=JSON.parse(r.responseText);t(e)}catch(e){i(new Error("INVALID RESPONSE"))}},r.onerror=function(e){i(e)},r.onloadend=function(e){200!==e.target.status&&i(new Error("["+e.target.status+"]request failed: "+o))},r.send(n.body||null)})},e.prototype._lonLatToTileInWGS84=function(e,t){var i=n(e,2),r=i[0],o=i[1];return[Math.floor(Math.pow(2,t)*(90-o)/180),Math.floor(Math.pow(2,t)*(180+r)/180)]},e.prototype._radianToDegree=function(e){return e/Math.PI*180},e.prototype._isTileInRange=function(e){try{var t=this._tileRangeByLevel[e.level],i=t.minCol,r=t.maxCol,o=t.minRow,n=t.maxRow;return e.x>=i&&e.x<=r&&e.y>=o&&e.y<=n}catch(e){return!1}},e.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0},e.prototype._loadTile=function(e){var l=[],u=new this._Cesium.ColorGeometryInstanceAttribute(.75,.75,.75,1),c=this;return e.features.forEach(function(e){if(c._propertyToBeFiltered&&Array.isArray(c._valuesToBeFiltered)){var t=e.properties[c._propertyToBeFiltered];if(c._valuesToBeFiltered.includes(t))return}var i=e.geometry.type;if("Polygon"===i||"MultiPolygon"===i){var s=[];c.heightById[e.properties.house_id]=e.properties.height,e.geometry.coordinates.forEach(function(e,i){s.push([]),e.forEach(function(e){var t;2<e.length?e.forEach(function(e){var t;2<=e.length&&(t=s[i]).push.apply(t,p(e))}):(t=s[i]).push.apply(t,p(e))});var t=new c._Cesium.PolygonHierarchy(c._Cesium.Cartesian3.fromDegreesArray(s[i])),r=c._Cesium.BoundingSphere.fromPoints(t.positions).center,o=c._viewer.scene.globe.getHeight(c._Cesium.Cartographic.fromCartesian(r))||0,n=new c._Cesium.PolygonGeometry({polygonHierarchy:t,height:o,vertexFormat:c._Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,extrudedHeight:1e3}),a=new c._Cesium.GeometryInstance({geometry:n,attributes:{color:u}});l.push(a)})}else console.warn('GeoJSONVectorTileProvider: geometry type "'+e.geometry.type+'" detected, but is not going to be rendered')}),new this._Cesium.Primitive({allowPicking:!1,appearance:new this._Cesium.PerInstanceColorAppearance({translucent:!1}),geometryInstances:l})},e.prototype._cameraMoveEndHandler=function(){if(!this._stop){var l=this,u=Date.now(),e=this._viewer.scene.globe._surface._tilesToRender,t=e.map(function(e){return e.level}),c=Math.min.apply(Math,p(t)),i=Math.max.apply(Math,p(t));i<this._lowerLevelLimit&&(l._tileKeys=[],l._removeObsoletePrimitives(l._primitiveByTile,[]),e=[]),this._upperLevelLimit&&c>this._upperLevelLimit&&(l._tileKeys=[],l._removeObsoletePrimitives(l._primitiveByTile,[]),e=[]),2<i-c&&(e=e.filter(function(e){return e.level>=i-2})),e.sort(function(e,t){return-(e.level-t.level)}),e=e.filter(function(e){return l._isTileInRange(e)}),this._upperLevelLimit&&(e=this._refineTiles(e,this._upperLevelLimit)),this._isCameraMoving=!1,this._moveEndTimestamp=u;var h=[],d=0,m=0;e.forEach(function(e){var i="z"+e.level+"x"+e.x+"y"+e.y;if(h.push(i),l._tileKeys.push(i),!l._primitiveByTile[i]){var t=l._viewer.camera.computeViewRectangle(),r=l._radianToDegree(t.west),o=l._radianToDegree(t.south),n=l._radianToDegree(t.east),a=l._radianToDegree(t.north);l.UrlData.area="RECT("+r+" "+o+","+n+" "+a+")";var s="";c<9?(l.cluster="city",l.UrlData.cluster=l.cluster,s=l._urlTemplate+"?output="+l.UrlData.output+"&resultmode="+l.UrlData.resultmode+"&uid="+l.UrlData.uid+"&st="+l.UrlData.st+"&words="+l.UrlData.words+"&area="+l.UrlData.area+"&cluster="+l.UrlData.cluster+"&callback="+l.UrlData.callback):9<c&&c<13?(l.cluster="county",l.UrlData.cluster=l.cluster,s=l._urlTemplate+"?output="+l.UrlData.output+"&resultmode="+l.UrlData.resultmode+"&uid="+l.UrlData.uid+"&st="+l.UrlData.st+"&words="+l.UrlData.words+"&area="+l.UrlData.area+"&cluster="+l.UrlData.cluster+"&callback="+l.UrlData.callback):13<=c&&(l.cluster="",s=l._urlTemplate+"?output="+l.UrlData.output+"&resultmode="+l.UrlData.resultmode+"&uid="+l.UrlData.uid+"&st="+l.UrlData.st+"&words="+l.UrlData.words+"&area="+l.UrlData.area+"&callback="+l.UrlData.callback),d++,l._fetch(s).then(function(e){if(l._isRemoved)throw new Error("DISCARD");if(l._isCameraMoving)throw new Error("DISCARD");if(u!==l._moveEndTimestamp)throw new Error("DISCARD");var t=l._loadTile(e);l._primitiveCollection.add(t),l._primitiveByTile[i]=t,d<=++m&&(l._tileKeys=h,l._removeObsoletePrimitives(l._primitiveByTile,h))}).catch(function(e){d<=++m&&(l._tileKeys=h,l._removeObsoletePrimitives(l._primitiveByTile,h)),e.message})}})}},e.prototype._refineTiles=function(e,c){var h=[],d=[];return e.forEach(function(e){var t="Z"+e.level+"X"+e.x+"Y"+e.y;if(e.level<c-1)d.includes(t)||(h.push(e),d.push(t));else if(e.level===c-1)for(var i=0;i<2;i++)for(var r=0;r<2;r++){var o="Z"+(e.level+1)+"X"+(2*e.x+i)+"Y"+(2*e.y+r);d.includes(o)||(h.push({x:2*e.x+i,y:2*e.y+r,level:e.level+1}),d.push(o))}else{var n=e.level-c;if(0===n)d.includes(t)||(h.push(e),d.push(t));else{var a=2*n,s=Math.floor(e.x/a),l=Math.floor(e.y/a),u="Z"+c+"X"+s+"Y"+l;d.includes(u)||(h.push({x:s,y:l,level:c}),d.push(u))}}}),h},e.prototype._removeObsoletePrimitives=function(e,t){var i=[];for(var r in 0<t.length&&(i=t),e){if(!i.includes(r))this._primitiveCollection.remove(e[r])&&delete e[r]}},e.prototype.addTo=function(e){this._viewer=e,this._viewer.scene.primitives.add(this._primitiveCollection),this._isRemoved=!1,this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.addEventListener(this._cameraMoveStartHandler),this._cameraMoveEndHandler()},e.prototype.remove=function(){if(this._viewer){for(var e in this._primitiveByTile)this._viewer.scene.primitives.remove(this._primitiveByTile[e]);this._primitiveByTile={},this._viewer.camera.moveEnd.removeEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.removeEventListener(this._cameraMoveStartHandler),this._viewer=null,this._isRemoved=!0}},e.prototype.setStatus=function(e){this._stop=e},e.prototype.isRemoved=function(){return this._isRemoved},e.prototype.filterBy=function(e,t,i){this._propertyToBeFiltered=e,this._valuesToBeFiltered=t},e.prototype.removeFilter=function(){this._propertyToBeFiltered=null,this._valuesToBeFiltered=null},e}),define("SGWorld/VectorTileProviderPolymerization/VectorTileProvider",[],function(){"use strict";function i(e,t){this._viewer=e,this._cesium=t,this._quadtree=void 0,this._tilingScheme=new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._levelZeroMaximumError=Cesium.QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme),this.cartographicLimitRectangle=Cesium.Rectangle.clone(Cesium.Rectangle.MAX_VALUE),i.prototype.ready||Object.defineProperties(i.prototype,{quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}}})}return i.prototype.update=function(e){this._quadtree.beginFrame(e),this._quadtree.endFrame(e)},i.prototype.initialize=function(e){},i.prototype.beginUpdate=function(e){},i.prototype.endUpdate=function(e){},i.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)},i.prototype.loadTile=function(e,t){},i.prototype.computeTileVisibility=function(e,t,i){var r=this.computeDistanceToTile(e,t);if(e._distance=r,t.fog.enabled&&1<=Cesium.Math.fog(r,t.fog.density))return Cesium.Visibility.NONE;var o=e.data;o.tileBoundingRegion;if(void 0===o.boundingVolumeSourceTile)return Cesium.Visibility.PARTIAL;var n=t.cullingVolume,a=o.orientedBoundingBox;!a&&o.renderedMesh&&(a=o.renderedMesh.boundingSphere3D),o.clippedByBoundaries=!1;var s=function(e,t){if(t.west<t.east)return t;var i=Rectangle.clone(t,splitCartographicLimitRectangleScratch);return 0<Rectangle.center(e,rectangleCenterScratch).longitude?i.east=CesiumMath.PI:i.west=-CesiumMath.PI,i}(e.rectangle,this.cartographicLimitRectangle),l=new Cesium.Rectangle,u=Cesium.Rectangle.simpleIntersection(s,e.rectangle,l);if(!u)return Visibility.NONE;if(Cesium.Rectangle.equals(u,e.rectangle)||(o.clippedByBoundaries=!0),t.mode,Cesium.SceneMode.SCENE3D,!a)return Cesium.Intersect.INTERSECTING;var c=this._clippingPlanes;if(c&&c.enabled){var h=c.computeIntersectionWithBoundingVolume(a);if(e.isClipped=h!==Intersect.INSIDE,h===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE}var d=n.computeVisibility(a);if(d===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE;var m=t.mode===Cesium.SceneMode.SCENE3D&&t.camera.frustum instanceof Cesium.OrthographicFrustum;if(t.mode!==Cesium.SceneMode.SCENE3D||m||!i)return d;var p=o.occludeePointInScaledSpace;return p?i.ellipsoid.isScaledSpacePointVisible(p)?d:Cesium.Visibility.NONE:d},i.prototype.canRefine=function(e,t,i){return e.level<16},i.prototype.showTileThisFrame=function(e,t,i,r){e.data.geometryPrimitive&&e.data.geometryPrimitive.update(t,i,r)},i.prototype.computeDistanceToTile=function(e,t){var i,r,o,n,a,s,l,u,c,h,d=(i=e,this.terrainProvider,void 0===(r=i.data)&&(r=i.data=new Cesium.GlobeSurfaceTile),void 0===r.tileBoundingRegion&&(r.tileBoundingRegion=new Cesium.TileBoundingRegion({computeBoundingVolumes:!1,rectangle:i.rectangle,ellipsoid:i.tilingScheme.ellipsoid,minimumHeight:0,maximumHeight:0})),i),m=e.data,p=m.tileBoundingRegion;if(void 0===d)return 9999999999;if(m.boundingVolumeSourceTile!==d){m.boundingVolumeSourceTile=d;var g=e.rectangle;g&&g.width<Cesium.Math.PI_OVER_TWO+Cesium.Math.EPSILON5&&(m.orientedBoundingBox=Cesium.OrientedBoundingBox.fromRectangle(e.rectangle,p.minimumHeight,p.maximumHeight,e.tilingScheme.ellipsoid,m.orientedBoundingBox),m.occludeePointInScaledSpace=(o=this,n=m.orientedBoundingBox.center,a=e.rectangle,s=p.maximumHeight,l=m.occludeePointInScaledSpace,u=o.quadtree._occluders.ellipsoid,c=u.ellipsoid,h=[new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3],Cesium.Cartesian3.fromRadians(a.west,a.south,s,c,h[0]),Cesium.Cartesian3.fromRadians(a.east,a.south,s,c,h[1]),Cesium.Cartesian3.fromRadians(a.west,a.north,s,c,h[2]),Cesium.Cartesian3.fromRadians(a.east,a.north,s,c,h[3]),u.computeHorizonCullingPoint(n,h,l)))}var f=p.minimumHeight,v=p.maximumHeight;if(m.boundingVolumeSourceTile!==e){var _=t.camera.positionCartographic.height,y=Math.abs(_-f);Math.abs(_-v)<y?(p.minimumHeight=f,p.maximumHeight=f):(p.minimumHeight=v,p.maximumHeight=v)}var C=p.distanceToCamera(t);return p.minimumHeight=f,p.maximumHeight=v,C},i.prototype.isDestroyed=function(){return!1},i.prototype.destroy=function(){return Cesium.destroyObject(this)},i.prototype.remove=function(){this.destroy()},i}),define("SGWorld/Version/Version",[],function(){return function(){}}),define("SGWorld/Wfs/EntityCreator",[],function(){"use strict";function _(e){return 3*e/4}function x(e){var t,i=0;if(0===e.length)return i;for(t=0;t<e.length;t++)i=(i<<5)-i+e.charCodeAt(t),i|=0;return i}function o(e){for(var t=[],i=0;i<e.length;i++)for(var r=0;r<e[i].positions.length;r+=3)t.push(Cesium.Cartographic.fromDegrees(e[i].positions[r+0],e[i].positions[r+1],0));return t}function n(e,t,i,r){for(var o,n=0,a=0;a<e.length;a++){o=r?p:i(e[a]);for(var s=2;s<e[a].positions.length;s+=3){null==t[n].height&&(t[n].height=0),null==e[a].absoluteHeightPositions&&(e[a].absoluteHeightPositions=[]),e[a].absoluteHeightPositions[s-2]=e[a].positions[s-2],e[a].absoluteHeightPositions[s-1]=e[a].positions[s-1],e[a].absoluteHeightPositions[s-0]=e[a].positions[s-0];var l=r?0:e[a].positions[s];e[a].absoluteHeightPositions[s]=l+t[n].height+o,n++}}}function e(e,t){this._style=e||{},t.scene.onHoverShowTextArray={},t.scene._lastObjectShowOnText=null,this.setEyeOffset=function(e,t){void 0===t&&(t=0),e.eyeOffset=Cesium.DynamicEyeOffset(t)},this.viewer=t}function a(e,t){for(var i=e.length,r=0;r<i;r++){var o=t(e[r]);if("polygon"==e[r].geometryType||"multipolygon"==e[r].geometryType){for(var n=e[r],a=n.positions.length,s=0;s<a;s++){for(var l=n.positions[s],u=2;u<l.length;u+=3)l[u]+=o;n.positions[s]=l}e[r]=n}else{var c=e[r],h=c.positions.length;for(s=2;s<h;s+=3)c.positions[s]+=o;e[r]=c}}return e}function T(e,t){if(null==e.isQuery)if(null==e.originalInstanceIds){if(e.parentLayer.isExistRenderedFeatureId(t))return!1}else if(-1==e.originalInstanceIds.indexOf(t))return!1;return!0}function s(i){return function(e){var t=Number(i.applyConditionalClassification(i._style.altitudeOffset,e.attributes));return isNaN(t)&&(t=0),t}}function l(e){if("string"!=typeof e)return e;var t=Number(e);if(isNaN(t))return e;var i=t.toString(16);if(i.length<6&&null!=i)for(var r=i.length;r<6;)i="0"+i,r++;var o="#"+i,n=Cesium.Color.fromCssColorString(o);if(null!=n){var a=n.red;n.red=n.blue,n.blue=a}return n}function y(e){if(null!=e){var t=parseInt(e);if(null!=e.alpha||isNaN(t))return e;t<0&&(t&=16777215);var i=t.toString(16);if(i.length<6&&null!=i)for(var r=i.length;r<6;)i="0"+i,r++;var o="#"+i;o=o.substring(0,7);var n=Cesium.Color.fromCssColorString(o);if(null!=n){var a=n.red;n.red=n.blue,n.blue=a}return n}}function u(e){return isNaN(e)?e:parseFloat(e)}function c(e,i){var t,r=[];return $.each(e.attributeNames,function(e,t){r.push(u(i[t]))}),1===r.length?t=e.func(r[0]):2===e.attributeNames.length?t=e.func(r[0],r[1]):3===e.attributeNames.length?t=e.func(r[0],r[1],r[2]):4===e.attributeNames.length&&(t=e.func(r[0],r[1],r[2],r[3])),t}function h(e,t,i){return e.replace(new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),i)}var d=o,m=n,p=1;Object.defineProperties(e.prototype,{style:{get:function(){return this._style},set:function(e){this._style=e}}}),e.prototype.clonePartOfMultiFeature=function(e,t){return{positions:e.positions[t],attributes:e.attributes,fid:e.fid,geometryType:e.geometryType}},e.prototype.createPrimitiveFromWFSFeatures=function(e){new Cesium.PrimitiveCollection;for(var t=[],i=[],r=[],o=e.features.numPositions=0;o<e.features.length;o++){var n=e.features[o];switch(this.sanitizePositions(n.positions),e.features.numPositions+=n.positions.length,n.geometryType){case"polygon":t.push(n);break;case"multipolygon":for(var a=n.positions.length,s=0;s<a;s++)t.push(this.clonePartOfMultiFeature(n,s));break;case"linestring":i.push(n);break;case"multilinestring":for(a=n.positions.length,s=0;s<a;s++)i.push(this.clonePartOfMultiFeature(n,s));break;case"point":r.push(n);break;case"multipoint":for(a=n.positions.length,s=0;s<a;s++)r.push(this.clonePartOfMultiFeature(n,s))}}0<t.length?(e.features=t,this.createPolygonPrimitive(e)):0<i.length?(e.features=i,this.createLinestringPrimitive(e)):0<r.length&&(e.features=r,this.createPointPrimitive(e))},e.prototype.createPolygonPrimitive=function(i){var f=this,r=function(e){if(e.isQuery)e.onFinishedQuery(i);else{for(var t="",i=[],r=[],o=[],n=[],a=[],s=0;s<e.features.length;s++){var l=e.features[s];if(T(e,l.fid)){var u=l.absoluteHeightPositions?l.absoluteHeightPositions:l.positions,c=f.createPolygonOptions(u,l.attributes),h=f.createCommonOptions(l.attributes);if(l.absoluteHeightPositions&&delete l.absoluteHeightPositions,i.push(Cesium.BoundingSphere.fromPoints(c.hierarchy.positions)),!e.isQuery){if(c.outline){var d=f.createPolygonGeometryHelper(Cesium.PolygonOutlineGeometry,l,c.hierarchy,c.outlineColor,c.perPositionHeight,c.extrudedHeight,c.height);o.push(d)}if(c.fill){d=f.createPolygonGeometryHelper(Cesium.PolygonGeometry,l,c.hierarchy,c.material,c.perPositionHeight,c.extrudedHeight,c.height,c.wather);r.push(d)}e.parentLayer.addRenderedFeatureId(l.fid),t+=l.fid+";",n.push(l.fid),a.push(h.tooltip)}}}if(""!=t){var m,p=new Cesium.PrimitiveCollection,g=new Cesium.PerInstanceColorAppearance({flat:!0,translucent:c.material.alpha<1});new Cesium.PerInstanceColorAppearance({flat:!0,translucent:c.material.alpha<1});if(0<r.length)c.wather&&(g=new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Water",uniforms:{baseWaterColor:c.watherColor||new Cesium.Color(0,0,1,.5),blendColor:c.watherColor||new Cesium.Color(0,0,1,.5),normalMap:c.wather,frequency:c.frequency||1e3,animationSpeed:c.watherSpeed||.01,amplitude:c.amplitude||10}}})})),((m=c.clampToGround?new Cesium.GroundPrimitive({geometryInstances:r,appearance:g}):new Cesium.Primitive({geometryInstances:r,appearance:g}))._parentCollection=p).add(m);if(0<o.length)if(!c.clampToGround)((m=new Cesium.Primitive({geometryInstances:o,appearance:g}))._parentCollection=p).add(m);p.ID="polygons:"+x(t),p._instanceIds=n,p._tooltips=a,e.onFinishedCreatePrimitive(p,i)}}};if(3==this.style.altitudeMethod)i.features=a(i.features,s(f)),r(i);else{!0;var e=function(e){for(var t=[],i=e.length,r=0;r<i;r++)for(var o=e[r],n=o.positions.length,a=0;a<n;a++)for(var s=o.positions[a],l=0;l<s.length;l+=3)t.push(Cesium.Cartographic.fromDegrees(s[l+0],s[l+1],0));return t}(i.features),t=Cesium.sampleRenderedData(e,Cesium.SampleRenderedDataFlags.TERRAIN|Cesium.SampleRenderedDataFlags.FLOOR);Cesium.when(t,function(e){var t=2==f._style.altitudeMethod;(function(e,t,i,r){for(var o,n=0,a=0;a<e.length;a++){var s=e[a];o=r?p:i(s),null==s.absoluteHeightPositions&&(s.absoluteHeightPositions=[]);for(var l=0;l<s.positions.length;l++)for(var u=s.positions[l],c=s.absoluteHeightPositions[l]=[],h=2;h<u.length;h+=3){var d=r?0:u[h];null==t[n].height&&(t[n].height=0),c[h-2]=u[h-2],c[h-1]=u[h-1],c[h-0]=u[h-0],c[h]=d+t[n].height+o,n++}}})(i.features,e,s(f),t),r(i)})}},e.prototype.createPolygonGeometryHelper=function(e,t,i,r,o,n,a,s){var l=null!=n?Cesium.PerInstanceColorAppearance.VERTEX_FORMAT:Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT;(void 0!==s||void 0!==a)&&(l=Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT);var u=new e({polygonHierarchy:i,vertexFormat:l,perPositionHeight:void 0!==a?void 0:o,extrudedHeight:n,height:a});return new Cesium.GeometryInstance({geometry:u,id:t,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}})},e.prototype.createLinestringPrimitive=function(i){var f=this,r=function(e){if(e.isQuery)e.onFinishedQuery(r);else{for(var t,i="",r=[],o=[],n=[],a=new Cesium.PrimitiveCollection,s=0;s<e.features.length;s++){var l=e.features[s];if(T(e,l.fid)){var u=l.absoluteHeightPositions?l.absoluteHeightPositions:l.positions,c=f.createLinestringOptions(u,l.attributes),h=f.createCommonOptions(l.attributes);if(c.vertexFormat=t?Cesium.PerInstanceColorAppearance.VERTEX_FORMAT:Cesium.PolylineColorAppearance.VERTEX_FORMAT,l.absoluteHeightPositions&&delete l.absoluteHeightPositions,r.push(Cesium.BoundingSphere.fromPoints(c.positions)),!e.isQuery){var d,m;m=c.clampToGround?(d=new Cesium.GroundPolylineGeometry({positions:c.positions,width:c.width}),new Cesium.GeometryInstance({id:l,geometry:d,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(c.material)}})):(d=new Cesium.PolylineGeometry(c),new that._cesium.GeometryInstance({id:l,geometry:d,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(c.material)}})),e.parentLayer.addRenderedFeatureId(l.fid),i+=l.fid+";",o.push(l.fid),n.push(h.tooltip);var p=null;p=c.clampToGround?new Cesium.GroundPolylinePrimitive({geometryInstances:m,appearance:new Cesium.MaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:c.material}}}),faceForward:!0,flat:!1})}):new Cesium.Primitive({geometryInstances:m,appearance:new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:c.material}}})})}),a.add(p)}}}if(""!=i){var g=a;g.ID="polylines:"+x(i),g._instanceIds&&0===g._instanceIds.length&&(g._instanceIds=o),g._tooltips=n,e.onFinishedCreatePrimitive(g,r)}}};if(3==this.style.altitudeMethod)i.features=a(i.features,s(f)),r(i);else{!0;var e=o(i.features),t=Cesium.sampleRenderedData(e,Cesium.SampleRenderedDataFlags.TERRAIN|Cesium.SampleRenderedDataFlags.FLOOR);Cesium.when(t,function(e){var t=2==f._style.altitudeMethod;n(i.features,e,s(f),t),r(i)})}},e.prototype.createPointPrimitive=function(i){var P=this,r=function(e){if(e.isQuery)e.onFinishedQuery(o);else{for(var t,i="",r=[],o=[],n=[],a=new Cesium.LabelCollection({scene:P.viewer.scene}),s=new Cesium.PointPrimitiveCollection({scene:P.viewer.scene}),l=new Cesium.BillboardCollection({scene:P.viewer.scene}),u=new Cesium.PrimitiveCollection,c=new Cesium.PolylineCollection,h=0;h<e.features.length;h++){var d=e.features[h];if(T(e,d.fid)){var m=d.absoluteHeightPositions?d.absoluteHeightPositions:d.positions,p=P.createPointOptions(m,d.attributes),f=P.createCommonOptions(d.attributes);if(d.clampToGround=p.clampToGround,p.sgsPointPosition&&(d.sgsPointPosition=p.sgsPointPosition,delete p.sgsPointPosition),d.absoluteHeightPositions&&delete d.absoluteHeightPositions,o.push(Cesium.BoundingSphere.fromPoints([p.position])),!e.isQuery){if(p.label)if(p.label.position=p.position,p.label.id=d,P.setEyeOffset(p.label),null!=p.label.imageFile&&(p.label.image=P.applyConditionalClassification(p.label.imageFile,d.attributes),p.label.label=p.label,l.add(p.label),P.setEyeOffset(p.label,-5)),null!=p.label.imageFile&&null!=p.label.showText&&p.label.showText&&(P.viewer.scene.onHoverShowTextArray[p.label.id]=!0),null!=p.label.isBold&&p.label.isBold)a.add(g);else if(null!=p.label.isUnderline&&p.label.isUnderline){var v=null!=p.label.text.match(/[iljf1]/g)?p.label.text.match(/[iljf1]/g):[],_=p.label.text.length,y=Array(Math.ceil(_-.5*v.length)).join("_");t=$.extend({},p.label),null!=p.label.image&&delete p.label.image,t.position=p.label.position,t.id=p.label.id,t.text=y,t.alignment=null!=p.label.alignment?p.label.alignment:void 0,t.underline=!0,t.textRelativeToImage=null!=p.label.textRelativeToImage?p.label.textRelativeToImage:void 0;-1<p.label.font.indexOf("pt")?Number(p.label.font.split("pt")[0]):-1<p.label.font.indexOf("px")&&Number(p.label.font.split("px")[0]);t.pixelOffset=new Cesium.Cartesian2(0,-45),a.add(t)}else a.add(p.label);if(p.billboard&&(p.billboard.position=p.position,p.billboard.id=d,P.setEyeOffset(p.billboard),l.add(p.billboard)),p.model){p.model.url=p.model.uri,p.model.id=d;u.add(Cesium.Model.fromGltf(p.model))}if(p.point&&(p.point.position=p.position,p.point.id=d,P.setEyeOffset(p.point),s.add(p.point)),0!=p.lineToGround){var C=Cesium.Cartographic.fromCartesian(p.position),w=Cesium.Cartesian3.fromRadians(C.longitude,C.latitude,0);if(2==p.lineToGround){var b=p.lineToGroundLength/Cesium.Cartesian3.distance(p.position,w);Cesium.Cartesian3.lerp(p.position,w,b,w)}c.add({show:!0,width:1,positions:[p.position,w],material:Cesium.Material.fromType("Color",{color:p.lineToGroundColor})})}e.parentLayer.addRenderedFeatureId(d.fid),i+=d.fid+";",r.push(d.fid),n.push(f.tooltip)}}}if(""!=i){var E,S=new Cesium.PrimitiveCollection;0<a.length&&($.each(a._labels,function(e,t){t._type="Label"}),(a._billboardCollection._parentCollection=S).add(a),E="labels"),0<l.length&&($.each(l._billboards,function(e,t){t._type="Billboard"}),(l._parentCollection=S).add(l),E="billboards"),0<u.length&&($.each(u._primitives,function(e,t){t._type="Model",t._parentCollection=S}),S.add(u),E="models"),0<s.length&&($.each(s._pointPrimitives,function(e,t){t._type="Point"}),(s._parentCollection=S).add(s),E="points"),0<c.length&&($.each(c._polylines,function(e,t){t._type="L2G"}),(c._parentCollection=S).add(c),E="L2G"),S.ID=E+":"+x(i),S._instanceIds=r,S._tooltips=n,e.onFinishedCreatePrimitive(S,o)}}};if(3==this.style.altitudeMethod)i.features=a(i.features,s(P)),r(i);else{var e=d(i.features),t=Cesium.sampleRenderedData(e);Cesium.when(t,function(e){var t=2==P._style.altitudeMethod;m(i.features,e,s(P),t),r(i)}).otherwise(function(e){})}},e.prototype.createCommonOptions=function(e){var t={};return t.tooltip=this.applyConditionalClassification(this.style.tooltip,e),t},e.prototype.createPolygonOptions=function(e,t){var i=this.getPolygonStyle(this.style);i.polygon.hierarchy={positions:Cesium.Cartesian3.fromDegreesArrayHeights(e[0]),holes:[]};for(var r=1;r<e.length;r++)i.polygon.hierarchy.holes.push({positions:Cesium.Cartesian3.fromDegreesArrayHeights(e[r])});var o=this.applyConditionalClassification(i.polygon.material,t);if(i.polygon.material=l(o),null!=i.polygon.fill&&null!=i.polygon.fromKml){var n=this.applyConditionalClassification(i.polygon.fill,t);1<n&&(n/=100),i.polygon.material=new Cesium.Color(i.polygon.material.red,i.polygon.material.green,i.polygon.material.blue,n)}if(i.polygon.extrudedHeight&&i.polygon.extrudedHeight&&i.polygon.extrudedHeight.indexOf&&-1<i.polygon.extrudedHeight.indexOf("[")&&-1<i.polygon.extrudedHeight.defaultValue.indexOf("]")){o=t[i.polygon.extrudedHeight.defaultValue.substring(1,i.polygon.extrudedHeight.defaultValue.length-1)],o=parseInt(o);void 0!==o&&(i.polygon.extrudedHeight=3*o)}if(t.FSCALE){var a=this.getLevelDistance(t.FSCALE);i.polygon.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,a)}return o=this.applyConditionalClassification(i.polygon.outlineColor,t),i.polygon.outlineColor=l(o),i.polygon},e.prototype.translateLineWidth=function(e,t){var i=this.applyConditionalClassification(e.polyline.width,t);return 0<i?TerraExplorer.USE_CORRIDOR_FOR_LINE_WIDTH_IN_METERS?1<i&&(e.polyline.widthInMeters=!0,i*=.8,0<e.polyline.backgroundOpacity&&(i*=.8)):i=1<i?2:1:i<0?i=Math.min(5,Math.abs(i)):0==i&&(i=1),i},e.prototype.createLinestringOptions=function(e,t){var i=this.getLinestringStyle(this.style);i.id=t,i.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e);var r=this.applyConditionalClassification(i.polyline.material,t);if(i.polyline.material=l(r),null!=i.polyline.lineOpacity){var o=this.applyConditionalClassification(i.polyline.lineOpacity,t);1<o&&(o/=100),i.polyline.material=new Cesium.Color(i.polyline.material.red,i.polyline.material.green,i.polyline.material.blue,o)}if(i.polyline.far&&(i.polyline.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(void 0!==i.polyline.near?i.polyline.near:0,i.polyline.far)),t.FSCALE){var n=this.getLevelDistance(t.FSCALE);i.polyline.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,n)}return i.polyline.width=this.applyConditionalClassification(i.polyline.width,t),i.polyline},e.prototype.applyConditionalClassification=function(e,r){if(null!=e){if(null==e.defaultValue)return e;var o=u(e.defaultValue);if(void 0===e.classificationArray){if(!isNaN(o))return o;if(o instanceof Cesium.Color)return o}if(void 0!==e.attributeName){var t="["+e.attributeName+"]";if(o===t)o=r[e.attributeName];else if(e.multipleAttributeReplacementNeeded)for(name in r)o=h(o,"["+name+"]",r[name]);else o=h(o,t,r[e.attributeName]);return o}if(void 0!==e.classification)return o=c(e.classification,r);var n=e.classificationArray;return void 0!==n&&$(Object.keys(n)).each(function(e,t){var i=function(e,t){if(void 0!==e&&0!==e.condition.length){if(void 0===e.func)return u(e.value);var i=void 0;return!0===c(e,t)&&(i=u(e.value)),i}}(n[t],r);i&&(o=i)}),o}},e.prototype.createLineToGroundOptions=function(e,t){var i=this.applyConditionalClassification(e.lineToGround,t);if(null!=i&&0!=Number(i)){e.lineToGround=i;var r=this.applyConditionalClassification(e.lineToGroundColor,t);r=y(r),e.lineToGroundColor=r;var o=this.applyConditionalClassification(e.lineToGroundLength,t);e.lineToGroundLength=Number(o)}else e.lineToGround=0,e.lineToGroundColor=0,e.lineToGroundLength=0},e.prototype.createPointOptions=function(e,t){var i,r=this.getPointStyle(this.style);if(r.pointHeight?(r.position=Cesium.Cartesian3.fromDegrees(e[0],e[1],r.pointHeight),e[2]=r.pointHeight):r.position=Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),r.sgsPointPosition=e,r.id=t,r.label){var o=r.label.text;if(void 0!==o&&-1<o.defaultValue.indexOf("[")&&-1<o.defaultValue.indexOf("]")){var n=t[o.defaultValue.substring(1,o.defaultValue.length-1)];void 0!==n&&(r.label.text=n)}if(this.applyConditionalClassification(r.label.text,t)?r.label.text=this.applyConditionalClassification(r.label.text,t).toString():r.label.text=this.applyConditionalClassification(r.label.text,t),r.label.text=this.o(r.label.text)?this.s(r.label.text):r.label.text,-1<r.label.text.indexOf("[")&&-1<r.label.text.indexOf("]")&&(r.label.text=""),null!=r.label.family){var a=this.applyConditionalClassification(r.label.family,t),s=this.applyConditionalClassification(r.label.font,t);r.label.font=0<=s?_(s).toString()+"pt "+a:_((i=s,72*i/96*-1)).toString()+"pt "+a}if(r.label.fillColor=y(this.applyConditionalClassification(r.label.fillColor,t)),r.label.backgroundColor=y(this.applyConditionalClassification(r.label.backgroundColor,t)),null==r.label.backgroundColor&&(r.label.backgroundColor=new Cesium.Color(.165,.165,.165,0)),r.label.showBackground=!0,null!=r.label.showText)if((h=this.applyConditionalClassification(r.label.showText,t))&&1===Number(h)&&(r.label.onHoverShowText=!0),h&&null==viewer.scene.canvas.onHoverShowText){var l=viewer.scene;new Cesium.ScreenSpaceEventHandler(l.canvas).setInputAction(function(e){var t={};l.screenToWorld(e.endPosition,t);Cesium.defined(t.pickPrimitive)&&"Billboard"==t.pickPrimitive.constructor.name&&null!=t.pickPrimitive.label?null!=l.onHoverShowTextArray[t.pickPrimitive.label.id]&&(null!=l._lastObjectShowOnText&&l._lastObjectShowOnText.id!=t.pickPrimitive.label.id&&null!=l._lastObjectShowOnText.show&&(l._lastObjectShowOnText.show=!1),viewer.scene._lastObjectShowOnText=l.onHoverShowTextArray[t.pickPrimitive.label.id],null!=l._lastObjectShowOnText.show&&(viewer.scene._lastObjectShowOnText.show=!0)):null!=l._lastObjectShowOnText&&null!=l._lastObjectShowOnText.show&&(l._lastObjectShowOnText.show=!1)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),viewer.scene.canvas.onHoverShowText=!0}if(null!=r.label.textRelativeToImage&&null!=r.label.textAlignment&&(r.label.textRelativeToImage=this.applyConditionalClassification(r.label.textRelativeToImage,t),r.label.alignment=this.applyConditionalClassification(r.label.textAlignment,t)),null!=r.label.underline&&(r.label.isUnderline=this.applyConditionalClassification(r.label.underline,t)),null!=r.label.bold)1==this.applyConditionalClassification(r.label.bold,t)&&(r.label.font="bold "+r.label.font);if(null!=r.label.italic)1==this.applyConditionalClassification(r.label.italic,t)&&(r.label.font="italic "+r.label.font);if(null!=r.label.backgroundOpacity&&(r.label.backgroundColor.alpha=this.applyConditionalClassification(r.label.backgroundOpacity,t)),null!=r.label.minViewingHeight){var u=this.applyConditionalClassification(r.label.minViewingHeight,t),c=650*this.applyConditionalClassification(r.label.scaleMPP,t);r.label.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(u,c)}if(t.FSCALE){var h=this.getLevelDistance(t.FSCALE);r.label.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,h)}!r.label.disableDepthTestDistance&&(r.label.disableDepthTestDistance=1e3),r.clampToGround&&(r.label.heightReference=1)}if(r.billboard){if(r.billboard.sizeInMeters=!1,null!=r.billboard.imageColor){var d=this.applyConditionalClassification(r.billboard.imageColor,t);d=y(d),r.billboard.color=d}if(null!=r.billboard.imageOpacity&&null!=r.billboard.color.alpha&&(r.billboard.color.alpha=Number(this.applyConditionalClassification(r.billboard.imageOpacity,t))),r.billboard.image=this.applyConditionalClassification(r.billboard.image,t),null!=r.billboard.minViewingHeight){u=this.applyConditionalClassification(r.billboard.minViewingHeight,t),c=650*this.applyConditionalClassification(r.billboard.scaleMPP,t);r.billboard.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(u,c)}if(t.FSCALE){h=this.getLevelDistance(t.FSCALE);r.billboard.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,h)}r.billboard.link&&r.id&&"object"===_typeof2(r.id)&&(r.id.link=this.applyConditionalClassification(r.billboard.link,t)),!r.billboard.disableDepthTestDistance&&(r.billboard.disableDepthTestDistance=1e3),r.clampToGround&&(r.billboard.heightReference=1)}if(r.model){var m=function(e){var t=Number(e);return Cesium.defined(t)&&!isNaN(t)||(t=0),t};r.model.uri=this.applyClassification(r.model.uri,t),r.model.scale=m(this.applyClassification(r.model.scale,t));var p=m(this.applyClassification(r.model.heading,t)),g=m(this.applyClassification(r.model.pitch,t)),f=m(this.applyClassification(r.model.roll,t)),v=new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(p),Cesium.Math.toRadians(g),Cesium.Math.toRadians(f));r.model.modelMatrix=Cesium.Transforms.headingPitchRollToFixedFrame(r.position,v)}return this.createLineToGroundOptions(r,t),r},e.prototype.s=function(e){return e.split("").reverse().join("")},e.prototype.getLevelDistance=function(e){var t=2e7;switch(parseInt(e)){case 2:t=10123e3;break;case 3:t=7123e3;break;case 4:t=6321e3;break;case 5:t=5522e3;break;case 6:t=3436e3;break;case 7:t=539e3;break;case 8:t=305e3;break;case 9:t=18e4;break;case 10:t=133e3;break;case 11:t=1e5;break;case 12:t=76500;break;case 13:t=58200;break;case 14:t=23500;break;case 15:t=9600;break;case 16:t=4e3;break;case 17:t=2e3;break;case 18:t=1700;break;case 19:t=1500;break;case 20:t=1e3;break;case 21:t=500;break;case 22:t=200;break;case 23:t=100}return t},e.prototype.o=function(e){if(!e)return e;return new RegExp("^[^A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-﷾--]*[֑-߿יִ-﷽ﹰ-ﻼ]").test(e[0])},e.prototype.applyClassification=function(e,t){if("string"!==$.type(e))return e;if(null!=/(\[([^\]]+)\])/g.exec(e))for(var i in t)e=h(e,"["+i+"]",t[i]);"undefined"==e&&(e="");for(var r=/(\<([^\>]+)\>)/g,o=r.exec(e);null!=o;){try{var n=o[o.length-1],a=(0,eval)(n);e=e.replace(o[0],a)}catch(e){}o=r.exec(e)}return e},e.prototype.getPolygonStyle=function(e){return $.extend(!0,{},t.DEFAULT_POLYGON_STYLE,e)},e.prototype.getLinestringStyle=function(e){return $.extend(!0,{},t.DEFAULT_POLYLINE_STYLE,e)},e.prototype.getPointStyle=function(e){return null!=e.label?$.extend(!0,{},t.DEFAULT_LABEL_STYLE,e):null!=e.billboard?$.extend(!0,{},t.DEFAULT_BILLBOARD_STYLE,e):null!=e.model?$.extend(!0,{},t.DEFAULT_MODEL_STYLE,e):null==e.point?t.DEFAULT_POINT_STYLE:$.extend(!0,{},t.DEFAULT_POINT_STYLE,e)},e.prototype.sanitizePositions=function(e){for(var t=0;t<e.length;t++)e[t]instanceof Array?this.sanitizePositions(e[t]):isNaN(e[t])&&(e[t]=0)};var t={};return Object.defineProperties(t,{DEFAULT_POLYGON_STYLE:{get:function(){return{polygon:{perPositionHeight:!0,fill:0,material:Cesium.Color.GREEN,outline:!0,outlineColor:Cesium.Color.WHITE,outlineWidth:1}}}},DEFAULT_POLYLINE_STYLE:{get:function(){return{polyline:{material:Cesium.Color.WHITE,width:1}}}},DEFAULT_POINT_STYLE:{get:function(){return{point:{color:Cesium.Color.RED,pixelSize:5,outlineColor:Cesium.Color.WHITE,outlineWidth:2}}}},DEFAULT_LABEL_STYLE:{get:function(){return{label:{text:"Text",font:"18px arial",style:Cesium.LabelStyle.FILL,fillColor:Cesium.Color.WHITE,outlineColor:Cesium.Color.BLACK,outlineWidth:5,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,eyeOffset:Cesium.Cartesian3.ZERO,pixelOffset:new Cesium.Cartesian2(0,-50)}}}},DEFAULT_BILLBOARD_STYLE:{get:function(){return{billboard:{image:"./img/query.png",scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM}}}},DEFAULT_MODEL_STYLE:{get:function(){return{model:{uri:"./img/CesiumTexturedBoxTest.bgltf",scale:1e3}}}}}),e}),define("SGWorld/Wfs/GmlParser",[],function(){"use strict";function e(e,t,i,r){this._extractAttributes=e,this._featureName=t||"featureMember",this._xy=r,this._gmlns=i||"http://www.opengis.net/gml",this._regExes={trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g}}return Object.defineProperties(e.prototype,{featureName:{get:function(){return this._featureName},set:function(e){this._featureName=e}},extractAttributes:{get:function(){return this._extractAttributes},set:function(e){this._extractAttributes=e}},xy:{get:function(){return this._xy}}}),e.prototype.getElementsByTagNameNS=function(e,t,i){var r=[];if(e.getElementsByTagNameNS)r=e.getElementsByTagNameNS(t,i);else for(var o,n,a=e.getElementsByTagName("*"),s=0,l=a.length;s<l;++s)n=(o=a[s]).prefix?o.prefix+":"+i:i,("*"==i||n==o.nodeName)&&("*"==t||t==o.namespaceURI)&&r.push(o);return r},e.prototype.read=function(e){for(var t=this.getElementsByTagNameNS(e.documentElement,this._gmlns,this.featureName),i=[],r=0;r<t.length;r++){var o=this.parseFeature(t[r]);o&&i.push(o)}return i},e.prototype.parseFeature=function(e){for(var t,i,r,o,n=["MultiPolygon","Polygon","MultiLineString","LineString","MultiPoint","Point","Envelope"],a=0;a<n.length;++a)if(t=n[a],0<(i=this.getElementsByTagNameNS(e,this._gmlns,t)).length){(o=this.parseGeometry[t.toLowerCase()])?r=o.apply(this,[i[0]]):console.log("unsupportedGeometryType:"+t);break}var s,l,u=this.getElementsByTagNameNS(e,this._gmlns,"Box");for(a=0;a<u.length;++a){var c=u[a],h=this.parseGeometry.box.apply(this,[c]),d=c.parentNode;"boundedBy"===(d.localName||d.nodeName.split(":").pop())?s=h:r=h.toGeometry()}this.extractAttributes&&(l=this.parseAttributes(e));var m={geometryType:t.toLowerCase(),positions:r,attributes:l};m.bounds=s;for(var p,g=e.firstChild;g&&(1!=g.nodeType||!(p=g.getAttribute("fid")||g.getAttribute("id")));)g=g.nextSibling;return m.fid=p,m},e.prototype.parseGeometry={point:function(e){var t,i=[];if(0<(t=this.getElementsByTagNameNS(e,this._gmlns,"pos")).length&&(i=t[0].firstChild.nodeValue.replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace)),0==i.length&&(0<(t=this.getElementsByTagNameNS(e,this._gmlns,"coordinates")).length&&(i=t[0].firstChild.nodeValue.replace(this._regExes.removeSpace,"").split(","))),0==i.length&&0<(t=this.getElementsByTagNameNS(e,this._gmlns,"coord")).length){var r=this.getElementsByTagNameNS(t[0],this._gmlns,"X"),o=this.getElementsByTagNameNS(t[0],this._gmlns,"Y");0<r.length&&0<o.length&&(i=[r[0].firstChild.nodeValue,o[0].firstChild.nodeValue])}return 2==i.length&&(i[2]=null),this.xy?[parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2])]:[parseFloat(i[1]),parseFloat(i[0]),parseFloat(i[2])]},multipoint:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"Point"),i=[];if(0<t.length)for(var r,o=0;o<t.length;++o)(r=this.parseGeometry.point.apply(this,[t[o]]))&&i.push(r);return i},linestring:function(e,t){var i,r=[],o=[];if(0<(i=this.getElementsByTagNameNS(e,this._gmlns,"posList")).length){r=this.getChildValue(i[0]).replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace);for(var n,a,s,l,u=parseInt(i[0].getAttribute("dimension")),c=0;c<r.length/u;++c)n=c*u,a=parseFloat(r[n]),s=parseFloat(r[n+1]),l=2==u?null:parseFloat(r[n+2]),this.xy?o.push(a,s,l):o.push(s,a,l)}if(0==r.length&&0<(i=this.getElementsByTagNameNS(e,this._gmlns,"coordinates")).length){var h=this.getChildValue(i[0]).replace(this._regExes.trimSpace,"").replace(this._regExes.trimComma,",").split(this._regExes.splitSpace);for(c=0;c<h.length;++c)2==(r=h[c].split(",")).length&&(r[2]=null),this.xy?o.push(parseFloat(r[0]),parseFloat(r[1]),parseFloat(r[2])):o.push(parseFloat(r[1]),parseFloat(r[0]),parseFloat(r[2]))}return o},multilinestring:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"LineString"),i=[];if(0<t.length)for(var r,o=0;o<t.length;++o)(r=this.parseGeometry.linestring.apply(this,[t[o]]))&&i.push(r);return i},polygon:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"LinearRing"),i=[];if(0<t.length)for(var r,o=0;o<t.length;++o)(r=this.parseGeometry.linestring.apply(this,[t[o],!0]))&&i.push(r);return i},multipolygon:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"Polygon"),i=[];if(0<t.length)for(var r,o=0;o<t.length;++o)(r=this.parseGeometry.polygon.apply(this,[t[o]]))&&i.push(r);return i},envelope:function(e){var t,i=[],r=this.getElementsByTagNameNS(e,this._gmlns,"lowerCorner");if(0<r.length){var o=[];if(0<r.length&&(o=r[0].firstChild.nodeValue.replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace)),2==o.length&&(o[2]=null),this.xy)var n=new OpenLayers_Geometry_Point(o[0],o[1],o[2]);else n=new OpenLayers_Geometry_Point(o[1],o[0],o[2])}var a=this.getElementsByTagNameNS(e,this._gmlns,"upperCorner");if(0<a.length){o=[];if(0<a.length&&(o=a[0].firstChild.nodeValue.replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace)),2==o.length&&(o[2]=null),this.xy)var s=new OpenLayers_Geometry_Point(o[0],o[1],o[2]);else s=new OpenLayers_Geometry_Point(o[1],o[0],o[2])}return n&&s&&(i.push([n.x,n.y,null]),i.push([s.x,n.y,null]),i.push([s.x,s.y,null]),i.push([n.x,s.y,null]),i.push([n.x,n.y,null]),t=new OpenLayers_Geometry_Polygon([[i]])),t},box:function(e){var t,i=this.getElementsByTagNameNS(e,this._gmlns,"coordinates"),r=null,o=null;if(0<i.length&&(2==(t=i[0].firstChild.nodeValue.split(" ")).length&&(r=t[0].split(","),o=t[1].split(","))),null!==r&&null!==o)return[parseFloat(r[0]),parseFloat(r[1]),null,parseFloat(o[0]),parseFloat(o[1]),null]}},e.prototype.parseAttributes=function(e){for(var t,i,r,o,n,a,s,l={},u=e.firstChild;u;){if(1==u.nodeType){for(t=u.childNodes,i=0;i<t.length;++i)1==(r=t[i]).nodeType&&(1==(o=r.childNodes).length?3!=(n=o[0]).nodeType&&4!=n.nodeType||(a=r.prefix?r.nodeName.split(":")[1]:r.nodeName,s=n.nodeValue.replace(this._regExes.trimSpace,""),l[a]=s):l[r.nodeName.split(":").pop()]=null);break}u=u.nextSibling}return l},e.prototype.getChildValue=function(e,t){var i=t||"";if(e)for(var r=e.firstChild;r;r=r.nextSibling)switch(r.nodeType){case 3:case 4:i+=r.nodeValue}return i},e}),define("SGWorld/Wfs/SimpleSqlParser",[],function(e){"use strict";function t(){}function p(e){return"string"==typeof e?e.replace(/^\s+/g,"").replace(/\s+$/g,""):e}function g(t,e){for(var i=!1,r=0,o="",n=0;n<e.length;n++)!i&&/['"`]/.test(e[n])?i=e[n]:i&&e[n]==i?i=!1:i||"("!=e[n]?!i&&")"==e[n]&&r--:r++,e[n]==t&&(0<r||i)?o+="######":o+=e[n];return e=(e=(e=o).split(t)).map(function(e){return p(e.replace(new RegExp("######","g"),t))})}function f(e){for(var t="#",i=e.length,r=0;r<i;r++)t+=e[r]+"#";return t}function v(e){for(var t="",i=e.length,r=1;r<i;r+=2)t+=e[r];return t}function o(e){this.source=e,this.cursor=0,this.currentChar="",this.readNextChar()}function _(e){this.lexer=new o(e),this.currentToken="",this.readNextToken()}function n(e,t){var i="";return void 0!==e.logic?(i=(i=e.terms.map(function(e){return n(e,!0)})).join(" "+e.logic+" "),void 0!==t&&(i="("+i+")")):void 0!==e.left?(i=e.left,void 0!==e.operator&&(i+=" "+e.operator,void 0!==e.right&&("IN"===e.operator?i+=" ("+e.right+")":i+=" "+e.right))):i=e,i}return t.sql2ast=function(o,e){function n(e,t){return t}null==e&&(e=!0);var t="###semi-colon###";o=(o=(o=(o=o.replace(/[("'`].*;.*[)"'`]/g,function(e){return e.replace(/;/g,t)})).replace(/;/g,"###EOR###")).split("###EOR###")[0]).replace(new RegExp(t,"g"),";");var i=["SELECT","FROM","DELETE FROM","INSERT INTO","UPDATE","JOIN","LEFT JOIN","RIGHT JOIN","INNER JOIN","ORDER BY","GROUP BY","HAVING","WHERE","LIMIT","VALUES","SET"],r=i.map(function(e){return e+" "}),a=(r=(r=r.concat(i.map(function(e){return e+"("}))).concat(r.map(function(e){return e.toLowerCase()}))).map(function(e){return e.replace("(","[\\(]")});o=o.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(e){return e.replace(new RegExp(a.join("|"),"gi"),f)});var s=[];r.forEach(function(e){var t,i=0;do{if(-1!=(t=o.indexOf(e,i))){var r=e.replace(/^((\w|\s)+?)\s?\(?$/i,n);i=t+(s[t]=r).length}}while(-1!=t)});var l=0;s.forEach(function(e,t){t<l?delete s[t]:(l=parseInt(t,10)+e.length,"JOIN"==e&&(s[t]="INNER JOIN"))});var u=a.slice(0);u=(u=u.map(function(e){return f(e)})).join("|");var c=o.split(new RegExp(a.join("|"),"i"));o=o.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(e){return e.replace(new RegExp(u,"gi"),v)}),c=c.map(function(e){return e.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(e){return e.replace(new RegExp(u,"gi"),v)})});var h=[];h.SELECT=function(e){var t=g(",",e);return t=t.filter(function(e){return""!==e}).map(function(e){return{name:e}})},h.SET=function(e){var t=g(",",e);return t=t.filter(function(e){return""!==e}).map(function(e){return{expression:e}})},h.FROM=h["DELETE FROM"]=h.UPDATE=function(e){var i=e.split(",");return(i=i.map(function(e){return p(e)})).forEach(function(e,t){""===e&&i.splice(t)}),i=i.map(function(e){var t=e.split(" AS "),i=t[1]||"";return 0===i.indexOf('"')&&i.lastIndexOf('"')==i.length-1&&(i=i.substring(1,i.length-1)),{table:t[0],as:i}})},h["LEFT JOIN"]=h.JOIN=h["INNER JOIN"]=h["RIGHT JOIN"]=function(e){var t=(e=e.split(" ON "))[0].split(" AS "),i={};return i.table=p(t[0]),i.as=p(t[1])||"",i.cond=p(e[1]),i},h.WHERE=function(e){return p(e)},h["ORDER BY"]=function(e){e=e.split(",");var o=[];return e.forEach(function(e,t){var i=/([A-Za-z0-9_\.]+)\s*(ASC|DESC){0,1}/gi;if(null!==(i=i.exec(e))){var r={};r.column=p(i[1]),r.order=p(i[2]),void 0===i[2]&&(r.order="ASC"),o.push(r)}}),o},h["GROUP BY"]=function(e){e=e.split(",");var o=[];return e.forEach(function(e,t){var i=/([A-Za-z0-9_\.]+)/gi;if(null!==(i=i.exec(e))){var r={};r.column=p(i[1]),o.push(r)}}),o},h.LIMIT=function(e){var t=/((\d+)\s*,\s*)?(\d+)/gi;void 0===(t=t.exec(e))[2]&&(t[2]=0);var i={};return i.nb=parseInt(p(t[3]),10),i.from=parseInt(p(t[2]),10),i},h["INSERT INTO"]=function(e){var t=/([A-Za-z0-9_\.]+)\s*(\(([A-Za-z0-9_\., ]+)\))?/gi;t=t.exec(e);var i={};return i.table=p(t[1]),void 0!==t[3]&&(i.columns=t[3].split(","),i.columns=i.columns.map(function(e){return p(e)})),i},h.VALUES=function(e){"("!=(e=p(e))[0]&&(e="("+e);var t=g(",",e),i=[];return t.forEach(function(e){e=g(",",e=e.replace(/^\(/g,"").replace(/\)$/g,"")),i.push(e)}),i};var d={},m=0;return s.forEach(function(e,t){if(e=e.toUpperCase(),m++,void 0!==h[e]){var i=h[e](c[m]);if(void 0!==d[e]){if("string"==typeof d[e]||void 0===d[e][0]){var r=d[e];d[e]=[],d[e].push(r)}d[e].push(i)}else d[e]=i}else console.log("Can't analyze statement \""+e+'"')}),void 0!==d["LEFT JOIN"]&&(void 0===d.JOIN&&(d.JOIN=[]),void 0!==d["LEFT JOIN"][0]?d["LEFT JOIN"].forEach(function(e){e.type="left",d.JOIN.push(e)}):(d["LEFT JOIN"].type="left",d.JOIN.push(d["LEFT JOIN"])),delete d["LEFT JOIN"]),void 0!==d["INNER JOIN"]&&(void 0===d.JOIN&&(d.JOIN=[]),void 0!==d["INNER JOIN"][0]?d["INNER JOIN"].forEach(function(e){e.type="inner",d.JOIN.push(e)}):(d["INNER JOIN"].type="inner",d.JOIN.push(d["INNER JOIN"])),delete d["INNER JOIN"]),void 0!==d["RIGHT JOIN"]&&(void 0===d.JOIN&&(d.JOIN=[]),void 0!==d["RIGHT JOIN"][0]?d["RIGHT JOIN"].forEach(function(e){e.type="right",d.JOIN.push(e)}):(d["RIGHT JOIN"].type="right",d.JOIN.push(d["RIGHT JOIN"])),delete d["RIGHT JOIN"]),e&&("string"==typeof d.WHERE&&(d.WHERE=_.parse(d.WHERE)),void 0!==d.JOIN&&d.JOIN.forEach(function(e,t){d.JOIN[t].cond=_.parse(e.cond)})),d},o.prototype={constructor:o,readNextChar:function(){"string"!=typeof this.source?this.currentChar="":this.currentChar=this.source[this.cursor++]||""},readNextToken:function(){return/\w|[-]/.test(this.currentChar)?this.readWord():/["'`]/.test(this.currentChar)?this.readString():/[()]/.test(this.currentChar)?this.readGroupSymbol():/[!=<>]/.test(this.currentChar)?this.readOperator():""===this.currentChar?{type:"eot",value:""}:(this.readNextChar(),{type:"empty",value:""})},readWord:function(){for(var e="",t=0,i=!1;/./.test(this.currentChar);){if(!i&&/['"`]/.test(this.currentChar))i=this.currentChar;else if(i&&this.currentChar==i)i=!1;else{if(!i){if(")"==this.currentChar&&t<=0)break;if("("==this.currentChar?t++:")"==this.currentChar&&t--,/[!=<>]/.test(this.currentChar))break}if(" "==this.currentChar&&t<=0)break}e+=this.currentChar,this.readNextChar()}return/^(AND|OR)$/i.test(e)?{type:"logic",value:e}:/^(IN|IS|NOT|LIKE)$/i.test(e)?{type:"operator",value:e}:{type:"word",value:e}},readString:function(){var e="",t=this.currentChar;for(e+=this.currentChar,this.readNextChar();this.currentChar!=t&&""!==this.currentChar;)e+=this.currentChar,this.readNextChar();return e+=this.currentChar,this.readNextChar(),"."==this.currentChar?(e+=this.currentChar,this.readNextChar(),{type:"word",value:e+=this.readString().value}):{type:"string",value:e}},readGroupSymbol:function(){var e=this.currentChar;return this.readNextChar(),{type:"group",value:e}},readOperator:function(){var e=this.currentChar;return this.readNextChar(),/[=<>]/.test(this.currentChar)&&(e+=this.currentChar,this.readNextChar()),{type:"operator",value:e}}},o.tokenize=function(e){var t=new o(e),i=[];do{var r=t.readNextToken();"empty"!=r.type&&i.push(r)}while(t.currentChar);return i},_.prototype={constructor:_,readNextToken:function(){for(this.currentToken=this.lexer.readNextToken();"empty"==this.currentToken.type;)this.currentToken=this.lexer.readNextToken();return this.currentToken},parseExpressionsRecursively:function(){return this.parseLogicalExpression()},parseLogicalExpression:function(){for(var e=this.parseConditionExpression();"logic"==this.currentToken.type;){var t=this.currentToken.value;this.readNextToken();var i=this.parseConditionExpression();if(void 0!==e.logic&&e.logic==t&&void 0!==e.terms)e.terms.push(i);else e={logic:t,terms:[e,i].slice(0)}}return e},parseConditionExpression:function(){var e=this.parseBaseExpression();if("operator"==this.currentToken.type){var t=this.currentToken.value;this.readNextToken(),"operator"==this.currentToken.type&&(t+=" "+this.currentToken.value,this.readNextToken()),e={operator:t,left:e,right:this.parseBaseExpression()}}return e},parseBaseExpression:function(){var e="";return"word"==this.currentToken.type||"string"==this.currentToken.type?(e=this.currentToken.value,this.readNextToken()):"group"==this.currentToken.type&&(this.readNextToken(),e=this.parseExpressionsRecursively(),this.readNextToken()),e}},_.parse=function(e){return new _(e).parseExpressionsRecursively()},t.ast2sql=function(e){function t(e){return void 0!==e.WHERE?" WHERE "+n(e.WHERE):""}var i,r;return void 0!==e.SELECT&&void 0!==e.FROM?(void 0!==(r=e).SELECT?"SELECT "+r.SELECT.map(function(e){return e.name}).join(", "):"")+function(e){if(void 0===e.FROM)return"";var t=" FROM ";return t+=e.FROM.map(function(e){var t=e.table;return""!==e.as&&(t+=" AS "+e.as),t}).join(", ")}(e)+function(e){if(void 0===e.JOIN)return"";var t="";return e.JOIN.forEach(function(e){t+=" "+e.type.toUpperCase()+" JOIN "+e.table,""!==e.as&&(t+=" AS "+e.as),t+=" ON "+n(e.cond)}),t}(e)+t(e)+function(e){if(void 0===e["GROUP BY"])return"";var t=" GROUP BY ";return t+=e["GROUP BY"].map(function(e){return e.column}).join(", ")}(e)+function(e){if(void 0===e["ORDER BY"])return"";var t=" ORDER BY ";return t+=e["ORDER BY"].map(function(e){return e.column+" "+e.order}).join(", ")}(e)+function(e){if(void 0!==e.LIMIT&&void 0!==e.LIMIT.nb&&0<parseInt(e.LIMIT.nb,10)){var t=" LIMIT ";return void 0!==e.LIMIT.from&&1<parseInt(e.LIMIT.from,10)&&(t+=e.LIMIT.from+","),t+=e.LIMIT.nb}return""}(e):void 0!==e["INSERT INTO"]?function(e){if(void 0===e["INSERT INTO"])return"";var t="INSERT INTO "+e["INSERT INTO"].table;return void 0!==e["INSERT INTO"].columns&&(t+=" (",t+=e["INSERT INTO"].columns.join(", "),t+=")"),t}(e)+function(e){if(void 0===e.VALUES)return"";var t=" VALUES ";return t+=e.VALUES.map(function(e){return"("+e.join(", ")+")"}).join(", ")}(e):void 0!==e.UPDATE?function(e){if(void 0===e.UPDATE)return"";var t="UPDATE ";return t+=e.UPDATE.map(function(e){var t=e.table;return""!==e.as&&(t+=" AS "+e.as),t}).join(", ")}(e)+(void 0!==(i=e).SET?" SET "+i.SET.map(function(e){return e.expression}).join(", "):"")+t(e):void 0!==e["DELETE FROM"]?function(e){if(void 0===e["DELETE FROM"])return"";var t="DELETE FROM ";return t+=e["DELETE FROM"].map(function(e){var t=e.table;return""!==e.as&&(t+=" AS "+e.as),t}).join(", ")}(e)+t(e):null},t.trim=p,t.protect=f,t.unprotect=v,t.protect_split=g,t.CondLexer=o,t.CondParser=_,t}),define("SGWorld/Wfs/TileManager",[],function(){"use strict";function i(){this._quadtree=void 0,this._tilingScheme=new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._loadTileEvent=new Cesium.Event,this._levelZeroMaximumError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,128,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._tileCache=[],this._primitivesWaitingToBeAddedToTheScene=[],this._pauseStreaming=!1,this._numTilesInLevel=[],this.STREAM_SPEED_IMIDIATE=0,this.STREAM_SPEED_FAST=1,this.STREAM_SPEED_NORMAL=2,this.STREAM_SPEED_SLOW=3,this._streamSpeed=this.STREAM_SPEED_NORMAL}function r(e,r){$.each(e._primitives,function(e,t){if(t instanceof Cesium.BillboardCollection){var i=t;e=c.indexOf(i);return i._parentCollection._primitiveOld=r,-1!==e?(viewer.scene.primitives.remove(c[e]._parentCollection),c[e]=i):c.push(i),!1}})}function o(e,t){viewer.scene.primitives.remove(t),e._onDestroyTilePrimitive=function(){viewer.scene.primitives.remove(t),this._onDestroyTilePrimitive=void 0}}function n(e,t,i){Cesium.when.all(e,function(){viewer.scene.primitives.remove(i)}),t._onDestroyTilePrimitive=function(){viewer.scene.primitives.remove(i),this._onDestroyTilePrimitive=void 0}}function a(e,t){n($.map(e._primitives,function(e){return e.readyPromise}),e,t)}function s(e,t){n($.map(e._primitives[0]._primitives,function(e){return e.readyPromise}),e,t)}function l(e,t){viewer.scene.primitives.remove(t)}function u(e,t){n([e.readyPromise],e,t)}Object.defineProperties(i.prototype,{quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},loadTileEvent:{get:function(){return this._loadTileEvent}},pauseStreaming:{get:function(){return this._pauseStreaming},set:function(e){this._pauseStreaming=e}},streamSpeed:{get:function(){return this._streamSpeed},set:function(e){this._streamSpeed=e}},bestLevelAvailable:{get:function(){for(var e=0,t=0;t<22;t++)null!=this._numTilesInLevel[t]&&0<this._numTilesInLevel[t]&&e<t&&(e=t);return e}}}),i.prototype.streamSpeedFactor=function(){switch(this._streamSpeed){case this.STREAM_SPEED_FAST:return 1;case this.STREAM_SPEED_NORMAL:return 3;case this.STREAM_SPEED_SLOW:return 20;default:return 3}};var c=[],h=0,t=!(i.prototype.onPreFrame=function(e,t){if(h++,!this._pauseStreaming){if(this._streamSpeed==this.STREAM_SPEED_IMIDIATE)for(;0<this._primitivesWaitingToBeAddedToTheScene.length;){var i=this._primitivesWaitingToBeAddedToTheScene.pop();e.primitives.add(i)}else if(0<this._primitivesWaitingToBeAddedToTheScene.length&&h%this.streamSpeedFactor()==0){(i=this._primitivesWaitingToBeAddedToTheScene.pop())._instanceIds&&100<i._instanceIds.length&&this.streamSpeed===this.STREAM_SPEED_FAST&&(this.streamSpeed=this.STREAM_SPEED_NORMAL),e.primitives.add(i)}$.each(c,function(e,t){t.ready&&viewer.scene.primitives.remove(t._parentCollection._primitiveOld)})}});i.prototype.initialize=function(e){t||(viewer.scene.preRender.addEventListener(this.onPreFrame,this),t=!0)},i.prototype.beginUpdate=function(e){this.quadtree.beginFrame(e)},i.prototype.endUpdate=function(e){var t=this;e.afterRender.push(function(){t.quadtree.endFrame(e)})},i.prototype.updateForPick=function(e){},i.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)*this._quadtree.maximumScreenSpaceError};Math.PI;i.prototype.placeHolder=function(e,t){t=t||Cesium.Color.fromBytes(0,255,0,255);var i=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.RectangleOutlineGeometry({rectangle:e.rectangle,height:viewer.camera.positionCartographic.height-.99*TerraExplorer.internal.Navigate.HeightAboveGround}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(t)}}),appearance:new Cesium.PerInstanceColorAppearance({flat:!0})});e.data.primitive.add(i)},i.prototype.loadTile=function(e,t){var i=this;if(null==this._numTilesInLevel[t._level]&&(this._numTilesInLevel[t._level]=0),this._numTilesInLevel[t._level]++,t.state===Cesium.QuadtreeTileLoadState.START){t.data={primitive:new Cesium.PrimitiveCollection,wfsLayerData:[],id:Cesium.createGuid(),freeResources:function(){if(i._tileCache[t.data.id]&&i._numTilesInLevel[t._level]--,i._numTilesInLevel[t._level]<0&&(i._numTilesInLevel[t._level]=0),Cesium.defined(this.wfsLayerData)){for(var e in this.wfsLayerData)Cesium.defined(this.wfsLayerData[e])&&this.wfsLayerData[e].freeResources();this.wfsLayerData=void 0}Cesium.defined(this.primitive)&&(this.primitive.destroy(),this.primitive=void 0),delete i._tileCache[t.data.id]}},this._tileCache[t.data.id]=t;Math.abs(6371e3*(t.rectangle.south-t.rectangle.north));t.data.boundingSphere3D=Cesium.BoundingSphere.fromRectangle3D(t.rectangle),t.data.boundingSphere2D=Cesium.BoundingSphere.fromRectangle2D(t.rectangle,e.mapProjection);t.rectangle.west,t.rectangle.south,t.rectangle.east,t.rectangle.north;this.loadTileEvent.raiseEvent(t),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0}},i.prototype.getTile=function(e){return this._tileCache[e]},i.prototype.getAllTiles=function(){var e=[];for(var t in this._tileCache)e.push(this._tileCache[t]);return e},i.prototype.computeTileVisibility=function(e,t,i){var r,o=this.computeDistanceToTile(e,t);return e._distance=o,t.fog.enabled&&9<e._level&&1<=Cesium.Math.fog(o,t.fog.density)?Cesium.Visibility.NONE:(r=t.mode===Cesium.SceneMode.SCENE3D?e.data.boundingSphere3D:e.data.boundingSphere2D,t.cullingVolume.computeVisibility(r))},i.prototype.showTileThisFrame=function(e,t){e.data.primitive.update(t)},i.prototype.computeDistanceToTile=function(e,t){var i,r=new Cesium.Cartesian3;i=t.mode===Cesium.SceneMode.SCENE3D?e.data.boundingSphere3D:e.data.boundingSphere2D;var o=Cesium.Cartesian3.subtract(i.center,t.camera.positionWC,r),n=Cesium.Cartesian3.magnitude(o);return Math.max(1,n-TerraExplorer.internal.Navigate.GroundHeightAtCameraPosition)},i.prototype.isDestroyed=function(){return!1},i.prototype.destroy=function(){return Cesium.destroyObject(this)},i.prototype.getInstance=function(e){if(0==Cesium.defined(e.TileManager)){e.TileManager=new i;var t=new Cesium.QuadtreePrimitive({tileProvider:e.TileManager,maximumScreenSpaceError:2});e.scene.primitives.add(t)}return e.TileManager},i.prototype.addToScene=function(e){this._primitivesWaitingToBeAddedToTheScene.push(e)},i.prototype.removeFromScene=function(e){var t=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=t?(this._primitivesWaitingToBeAddedToTheScene[t].destroy(),this._primitivesWaitingToBeAddedToTheScene.splice(t,1)):viewer.scene.primitives.remove(e)},i.prototype.replaceInScene=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);if(-1!=i)this._primitivesWaitingToBeAddedToTheScene[i]=t;else switch(e.ID!=t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),null!=e._replacmentPrimitive&&viewer.scene.primitives.remove(e._replacmentPrimitive),e._replacmentPrimitive=t,viewer.scene.primitives.add(t),t.ID.split(":")[0]){case"billboards":r(t,e);break;case"labels":o(t,e);break;case"polygons":a(t,e);break;case"models":s(t,e);break;case"polylines":u(t,e);break;case"points":l(0,e);break;default:console.log("Error updating layer"),viewer.scene.primitives.remove(e)}};var d={billboards:r,labels:o,polygons:a,models:s,polylines:u,points:l};return i.prototype.replaceInSceneNew=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);if(-1!=i)this._primitivesWaitingToBeAddedToTheScene[i]=t;else{e.ID!==t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),this.addToScene(t);var r=t.ID.split(":")[0],o=d[r];o?o(t,e):(console.log("Error updating layer"),viewer.scene.primitives.remove(e))}},i}),define("SGWorld/Wfs/TileManager1",["../Core/jquery"],function(n){"use strict";function r(){this._quadtree=void 0,this._loadTileEvent=new Cesium.Event,this._tilingScheme=new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._levelZeroMaximumError=Cesium.QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme),this.cartographicLimitRectangle=Cesium.Rectangle.clone(Cesium.Rectangle.MAX_VALUE),this._tileCache=[],this._primitivesWaitingToBeAddedToTheScene=[],this._pauseStreaming=!1,this._numTilesInLevel=[],this.STREAM_SPEED_IMIDIATE=0,this.STREAM_SPEED_FAST=1,this.STREAM_SPEED_NORMAL=2,this.STREAM_SPEED_SLOW=3,this._streamSpeed=this.STREAM_SPEED_NORMAL,r.prototype.ready||Object.defineProperties(r.prototype,{quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},loadTileEvent:{get:function(){return this._loadTileEvent}},pauseStreaming:{get:function(){return this._pauseStreaming},set:function(e){this._pauseStreaming=e}},streamSpeed:{get:function(){return this._streamSpeed},set:function(e){this._streamSpeed=e}},bestLevelAvailable:{get:function(){for(var e=0,t=0;t<22;t++)null!=this._numTilesInLevel[t]&&0<this._numTilesInLevel[t]&&e<t&&(e=t);return e}}})}function o(r,e,o){n.each(e._primitives,function(e,t){if(t instanceof Cesium.BillboardCollection){var i=t;e=d.indexOf(i);return i._parentCollection._primitiveOld=o,-1!==e?(r.scene.primitives.remove(d[e]._parentCollection),d[e]=i):d.push(i),!1}})}function a(e,t,i){e.scene.primitives.remove(i),t._onDestroyTilePrimitive=function(){e.scene.primitives.remove(i),this._onDestroyTilePrimitive=void 0}}function s(e,t,i,r){Cesium.when.all(t,function(){e.scene.primitives.remove(r)}),i._onDestroyTilePrimitive=function(){e.scene.primitives.remove(r),this._onDestroyTilePrimitive=void 0}}function l(e,t,i){s(e,n.map(t._primitives,function(e){return e.readyPromise}),t,i)}function u(e,t,i){s(e,n.map(t._primitives[0]._primitives,function(e){return e.readyPromise}),t,i)}function c(e,t,i){e.scene.primitives.remove(i)}function h(e,t,i){s(e,[t.readyPromise],t,i)}r.prototype.streamSpeedFactor=function(){switch(this._streamSpeed){case this.STREAM_SPEED_FAST:return 1;case this.STREAM_SPEED_NORMAL:return 3;case this.STREAM_SPEED_SLOW:return 20;default:return 3}};var d=[],m=0;r.prototype.onPreFrame=function(e,t){if(m++,!this._pauseStreaming){if(this._streamSpeed==this.STREAM_SPEED_IMIDIATE)for(;0<this._primitivesWaitingToBeAddedToTheScene.length;){var i=this._primitivesWaitingToBeAddedToTheScene.pop();e.primitives.add(i)}else if(0<this._primitivesWaitingToBeAddedToTheScene.length&&m%this.streamSpeedFactor()==0){(i=this._primitivesWaitingToBeAddedToTheScene.pop())._instanceIds&&100<i._instanceIds.length&&this.streamSpeed===this.STREAM_SPEED_FAST&&(this.streamSpeed=this.STREAM_SPEED_NORMAL),e.primitives.add(i)}n.each(d,function(e,t){t.ready&&this.viewer.scene.primitives.remove(t._parentCollection._primitiveOld)})}},r.prototype.updateForPick=function(e){};Math.PI;r.prototype.placeHolder=function(e,t){t=t||Cesium.Color.fromBytes(0,255,0,255);var i=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.RectangleOutlineGeometry({rectangle:e.rectangle,height:this.viewer.camera.positionCartographic.height-.99*TerraExplorer.internal.Navigate.HeightAboveGround}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(t)}}),appearance:new Cesium.PerInstanceColorAppearance({flat:!0})});e.data.primitive.add(i)},r.prototype.getTile=function(e){return this._tileCache[e]},r.prototype.getAllTiles=function(){var e=[];for(var t in this._tileCache)e.push(this._tileCache[t]);return e},r.prototype.addToScene=function(e){this._primitivesWaitingToBeAddedToTheScene.push(e)},r.prototype.removeFromScene=function(e){var t=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=t?(this._primitivesWaitingToBeAddedToTheScene[t].destroy(),this._primitivesWaitingToBeAddedToTheScene.splice(t,1)):this.viewer.scene.primitives.remove(e)},r.prototype.replaceInScene=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);if(-1!=i)this._primitivesWaitingToBeAddedToTheScene[i]=t;else switch(e.ID!=t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),null!=e._replacmentPrimitive&&this.viewer.scene.primitives.remove(e._replacmentPrimitive),e._replacmentPrimitive=t,this.viewer.scene.primitives.add(t),t.ID.split(":")[0]){case"billboards":o(this.viewer,t,e);break;case"labels":a(this.viewer,t,e);break;case"polygons":l(this.viewer,t,e);break;case"models":u(this.viewer,t,e);break;case"polylines":h(this.viewer,t,e);break;case"points":c(this.viewer,0,e);break;default:console.log("Error updating layer"),this.viewer.scene.primitives.remove(e)}};var p={billboards:o,labels:a,polygons:l,models:u,polylines:h,points:c};r.prototype.replaceInSceneNew=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);if(-1!=i)this._primitivesWaitingToBeAddedToTheScene[i]=t;else{e.ID!==t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),this.addToScene(t);var r=t.ID.split(":")[0],o=p[r];o?o(t,e):(console.log("Error updating layer"),this.viewer.scene.primitives.remove(e))}};var t=!(r.prototype.update=function(e){this._quadtree.beginFrame(e),this._quadtree.render(e),this._quadtree.endFrame(e)});return r.prototype.initialize=function(e){t||(this.viewer.scene.preRender.addEventListener(this.onPreFrame,this),t=!0)},r.prototype.beginUpdate=function(e){this.quadtree.beginFrame(e)},r.prototype.endUpdate=function(e){var t=this;e.afterRender.push(function(){t.quadtree.endFrame(e)})},r.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)},r.prototype.loadTile=function(e,t){var i=this;if(null==this._numTilesInLevel[t._level]&&(this._numTilesInLevel[t._level]=0),this._numTilesInLevel[t._level]++,t.state===Cesium.QuadtreeTileLoadState.START){t.data={primitive:new Cesium.PrimitiveCollection,wfsLayerData:[],id:Cesium.createGuid(),freeResources:function(){if(i._tileCache[t.data.id]&&i._numTilesInLevel[t._level]--,i._numTilesInLevel[t._level]<0&&(i._numTilesInLevel[t._level]=0),Cesium.defined(this.wfsLayerData)){for(var e in this.wfsLayerData)Cesium.defined(this.wfsLayerData[e])&&this.wfsLayerData[e].freeResources();this.wfsLayerData=void 0}Cesium.defined(this.primitive)&&(this.primitive.destroy(),this.primitive=void 0),delete i._tileCache[t.data.id]}},this._tileCache[t.data.id]=t;Math.abs(6371e3*(t.rectangle.south-t.rectangle.north));t.data.boundingSphere3D=Cesium.BoundingSphere.fromRectangle3D(t.rectangle),t.data.boundingSphere2D=Cesium.BoundingSphere.fromRectangle2D(t.rectangle,e.mapProjection);t.rectangle.west,t.rectangle.south,t.rectangle.east,t.rectangle.north;this.loadTileEvent.raiseEvent(t),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0}},r.prototype.computeTileVisibility=function(e,t,i){var r=this.computeDistanceToTile(e,t);if(e._distance=r,t.fog.enabled&&1<=Cesium.Math.fog(r,t.fog.density))return Cesium.Visibility.NONE;var o=e.data;o.tileBoundingRegion;if(void 0===o.boundingVolumeSourceTile)return Cesium.Visibility.PARTIAL;var n=t.cullingVolume,a=o.orientedBoundingBox;!a&&o.renderedMesh&&(a=o.renderedMesh.boundingSphere3D),o.clippedByBoundaries=!1;var s=function(e,t){if(t.west<t.east)return t;var i=Rectangle.clone(t,splitCartographicLimitRectangleScratch);return 0<Rectangle.center(e,rectangleCenterScratch).longitude?i.east=CesiumMath.PI:i.west=-CesiumMath.PI,i}(e.rectangle,this.cartographicLimitRectangle),l=new Cesium.Rectangle,u=Cesium.Rectangle.simpleIntersection(s,e.rectangle,l);if(!u)return Visibility.NONE;if(Cesium.Rectangle.equals(u,e.rectangle)||(o.clippedByBoundaries=!0),t.mode,Cesium.SceneMode.SCENE3D,!a)return Cesium.Intersect.INTERSECTING;var c=this._clippingPlanes;if(c&&c.enabled){var h=c.computeIntersectionWithBoundingVolume(a);if(e.isClipped=h!==Intersect.INSIDE,h===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE}var d=n.computeVisibility(a);if(d===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE;var m=t.mode===Cesium.SceneMode.SCENE3D&&t.camera.frustum instanceof Cesium.OrthographicFrustum;if(t.mode!==Cesium.SceneMode.SCENE3D||m||!i)return d;var p=o.occludeePointInScaledSpace;return p?i.ellipsoid.isScaledSpacePointVisible(p)?d:Cesium.Visibility.NONE:d},r.prototype.canRefine=function(e,t,i){return e.level<16},r.prototype.showTileThisFrame=function(e,t,i,r){e.data.geometryPrimitive&&e.data.geometryPrimitive.update(t,i,r)},r.prototype.computeDistanceToTile=function(e,t){var i,r,o,n,a,s,l,u,c,h,d=(i=e,this.terrainProvider,void 0===(r=i.data)&&(r=i.data=new Cesium.GlobeSurfaceTile),void 0===r.tileBoundingRegion&&(r.tileBoundingRegion=new Cesium.TileBoundingRegion({computeBoundingVolumes:!1,rectangle:i.rectangle,ellipsoid:i.tilingScheme.ellipsoid,minimumHeight:0,maximumHeight:0})),i),m=e.data,p=m.tileBoundingRegion;if(void 0===d)return 9999999999;if(m.boundingVolumeSourceTile!==d){m.boundingVolumeSourceTile=d;var g=e.rectangle;g&&g.width<Cesium.Math.PI_OVER_TWO+Cesium.Math.EPSILON5&&(m.orientedBoundingBox=Cesium.OrientedBoundingBox.fromRectangle(e.rectangle,p.minimumHeight,p.maximumHeight,e.tilingScheme.ellipsoid,m.orientedBoundingBox),m.occludeePointInScaledSpace=(o=this,n=m.orientedBoundingBox.center,a=e.rectangle,s=p.maximumHeight,l=m.occludeePointInScaledSpace,u=o.quadtree._occluders.ellipsoid,c=u.ellipsoid,h=[new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3],Cesium.Cartesian3.fromRadians(a.west,a.south,s,c,h[0]),Cesium.Cartesian3.fromRadians(a.east,a.south,s,c,h[1]),Cesium.Cartesian3.fromRadians(a.west,a.north,s,c,h[2]),Cesium.Cartesian3.fromRadians(a.east,a.north,s,c,h[3]),u.computeHorizonCullingPoint(n,h,l)))}var f=p.minimumHeight,v=p.maximumHeight;if(m.boundingVolumeSourceTile!==e){var _=t.camera.positionCartographic.height,y=Math.abs(_-f);Math.abs(_-v)<y?(p.minimumHeight=f,p.maximumHeight=f):(p.minimumHeight=v,p.maximumHeight=v)}var C=p.distanceToCamera(t);return p.minimumHeight=f,p.maximumHeight=v,C},r.prototype.isDestroyed=function(){return!1},r.prototype.destroy=function(){return Cesium.destroyObject(this)},r.prototype.remove=function(){this.destroy()},r.prototype.getInstance=function(e){if(0==Cesium.defined(e.TileManager)){var t=new r;(e.TileManager=t).viewer=e;var i=new Cesium.QuadtreePrimitive({tileProvider:e.TileManager,maximumScreenSpaceError:2});e.scene.primitives.add(i)}return e.TileManager},r}),define("SGWorld/Wfs/WorkerPool",[],function(){"use strict";var e=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(e){if(e=e||[],!Cesium.defined(e.workerPath))throw new Cesium.DeveloperError("workerPath is required.");this._workerPath=e.workerPath,this._poolSize=Cesium.defaultValue(e.poolSize,16),this._workers=[],this._defered=[]});return Object.defineProperties(e.prototype,{errorEvent:{get:function(){return this.errorEvent}},poolSize:{get:function(){return this._poolSize}}}),e.prototype.queueWorkItem=function(e,t){for(var i=Cesium.when.defer(),r=null,o=999999,n=0;n<this._workers.length;n++){r=this._workers[n];this._workers[n].jobQueueSize<o&&(r=this._workers[n],o=this._workers[n].jobQueueSize)}if(0<o&&this._workers.length<this.poolSize){r=new Worker(this._workerPath);var a=this;r.addEventListener("message",function(e){a.onWorkerMessage(e)},!1),r.addEventListener("error",function(e){a.onWorkerError(e)},!1),r.jobQueueSize=0,this._workers.push(r),r.id=Cesium.createGuid()}e.workerId=r.id;var s=Cesium.createGuid();return e.deferedId=s,this._defered[s]=i,r.jobQueueSize++,r.postMessage(e,t),i},e.prototype.trimPool=function(e){var t=this;if(null==e)return null!=this.timerId&&clearTimeout(this.timerId),void(this.timerId=setTimeout(function(){t.trimPool(!0)},5e3));for(var i=0;i<this._workers.length;i++)0==this._workers[i].jobQueueSize&&(this._workers[i].terminate(),this._workers.splice(i,1),i--);this._workers.length?this.timerId=setTimeout(function(){t.trimPool(!0)},5e3):this.timerId=null},e.prototype.onWorkerMessage=function(e){var t=e.data,i=function(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return i}(this._workers,function(e){return e.id===t.workerId});null!=i&&(this._workers[i].jobQueueSize--,this.trimPool());var r=this._defered[t.deferedId];delete this._defered[t.deferedId],r.resolve(t)},e.prototype.onWorkerError=function(e){console.log(e)},e}),define("SGWorld/Wfs/WfsLayer",["../Core/jquery","./GmlParser","./TileManager1","./WorkerPool","./SimpleSqlParser","./EntityCreator"],function($$,GmlParser,_TileManager,WorkerPool,simpleSqlParser,EntityCreator){"use strict";var TileManager;function Layer(e,t,i,r,o,n,a,s,l){var u=this;if(this._viewer=e,this._Viewer=e,u.G=65535,TileManager=new _TileManager,workerPool=new WorkerPool({workerPath:lj()}),!Cesium.sampleRenderedData){var c=function(e,t){for(var i=0;i<e.children.length;i++){if(e.children[i].state>=Cesium.QuadtreeTileLoadState.DONE&&(null!=e.children[i].data.terrainData._mesh||null!=e.children[i].data.terrainData._buffer)&&e.children[i].x==t.x&&e.children[i].y==t.y)return e.children[i]}},h=function(e,t){for(var i=e.tilingScheme,r=i.positionToTileXY(t,0),o=u._Viewer.scene.globe._surface.tileProvider.quadtree._levelZeroTiles,n=o[0].x==r.x&&o[0].y==r.y?o[0]:o[1],a=1;a<22;a++){r=i.positionToTileXY(t,a);var s=c(n,r);if(null==s)break;n=s}return n},d=function(e,t){var i;$.grep(u._Viewer.scene.primitives._primitives,function(e){return e instanceof Cesium.Cesium3DTileset});for(i=0;i<e.length;++i){var r=e[i],o=r instanceof Cesium.Cartographic,n=o?r:Cesium.Cartographic.fromCartesian(r);if(n.height=u.G,!o){var a=Cesium.Cartesian3.fromRadiansArrayHeights([n.longitude,n.latitude,n.height])[0];r.z=a.z}}return e},m=function(e,t){var i;for(i=0;i<t.length;++i){var r=t[i],o=h(e,r);r.height=o.data.terrainData.interpolateHeight(o.rectangle,r.longitude,r.latitude)}return t},p=function(e){this.value=new Float32Array([e])};Cesium.Resource&&(Cesium.loadText=Cesium.Resource.fetchText,Cesium.loadJson=Cesium.Resource.fetchJson,Cesium.loadBlob=Cesium.Resource.fetchBlob,Cesium.loadArrayBuffer=Cesium.Resource.fetchArrayBuffer,Cesium.loadImage=Cesium.Resource.fetchImage),p.fromZBias=function(e){if(!Cesium.defined(e))throw new DeveloperError("zbias is required.");return new p(e)},p.toValue=function(e,t){if(!Cesium.defined(e))throw new DeveloperError("zbias is required.");return Cesium.defined(t)?color.toBytes(t):new Float32Array(e)},p.equals=function(e,t){return e===t||Cesium.defined(e)&&Cesium.defined(t)&&e.value[0]===t.value[0]},p.defaultBias=function(){return p.fromZBias(15e-6)},Cesium.ZBiasGeometryInstanceAttribute=p,Cesium.ZBiasGeometryInstanceAttribute=p,Cesium.SampleRenderedDataFlags={TERRAIN:2,MESH:4,FLOOR:8},Cesium.DynamicEyeOffset=function(e){return void 0===e&&(e=0),new Cesium.Cartesian3(.001234321,0,e)},Cesium.sampleRenderedData=function(o,e){var t=2,i=4,r=8;null==e&&(e=t|i);var n=Cesium.when.defer(),a=[];t<e?o.forEach(function(e){a.push(Cesium.Cartographic.fromRadians(e.longitude,e.latitude,e.height))}):a=o;var s=[];e&t&&s.push(function(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var r=Cesium.when.defer();return function e(){t.ready?Cesium.when(m(t,i),function(e){r.resolve(e)}):setTimeout(e,10)}(),r.promise}(u._Viewer.terrainProvider,o));var l=0<(e&r);return e&(i|r)&&s.push(function(e,t){Cesium.Check.defined("positions",e);var i=Cesium.when.defer();return Cesium.when(d(e,t),function(e){i.resolve(e)}),i.promise}(a,l)),Cesium.when.all(s).then(function(e){if(1<s.length)for(var t=0;t<o.length;t++){var i=e[0][t],r=e[1][t];r.height!=u.G&&((i.height<r.height||l)&&(i.height=r.height))}n.resolve(e[0])}),n.promise},Cesium.sampleRenderedMesh=function(e,t){Cesium.Check.defined("positions",e);var i=Cesium.when.defer();return Cesium.when(d(e,t),function(e){i.resolve(e)}),i.promise},Cesium.sampleRenderedTerrain=function(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var r=Cesium.when.defer();return function e(){t.ready?Cesium.when(m(t,i),function(e){r.resolve(e)}):setTimeout(e,10)}(),r.promise},Cesium.QuadtreePrimitive.prototype.getRenderedBestLevelInfo=function(){var e=this.getRenderedLevelInfo(),t=0;for(var i in e)t<Number(i)&&(t=Number(i));return{bestLevel:t,count:e[t]}},Cesium.QuadtreePrimitive.prototype.getRenderedLevelInfo=function(){var t=[];return this._tilesToRender.forEach(function(e){null==t[e.level]&&(t[e.level]=0),t[e.level]++}),t}}o=o||{},this._level=r||{min:0,max:22},"number"==typeof this._level&&(this._level={min:r,max:22}),this._url=t,this._layerName=i,this._guid=Cesium.createGuid(),this._gmlParser=new GmlParser(!0,null,null,!0),this._tileManager=TileManager.getInstance(e),this._tileManager._loadTileEvent.addEventListener(Layer.prototype.loadTile,this),this._useWorkers=!0,this._layerDisplayName=n,this._showAttributesAsMessage=o.showAttributesAsMessage,delete o.showAttributesAsMessage,this._entityCreator=new EntityCreator(o,e),this._visible=!0,this._featuresMap={},this._boundingBox=void 0,this._geometryFieldName=void 0,this._operations={},this._subdomains=a,this.latLon=s,this._addedFeatures=[],this.simpleSqlParser=simpleSqlParser,this.myLayer=l,this._statistics={numberOfAddedFeatures:0,numberOfDeletedFeatures:0,numberOfAddePositions:0,numberOfDeletedPositions:0,getNumberOfCurrentlyRenderedFeatures:function(){return this.numberOfAddedFeatures-this.numberOfDeletedFeatures},getNumberOfCurrentlyRenderedPositions:function(){return this.numberOfAddePositions-this.numberOfDeletedPositions}},initLayerCapabilities(this),initFeatureType(this)}function ReplaceTagWithOriginalDomain(e,t){return-1!=e.indexOf("{s}")?null!=t&&0<t.length?e.replace("{s}",t[0]):console.error("Error - sTag with no subdomains."):e}function getXmlTag(e,t,i){var r=$$(e).find(t);return 0==r.length&&"wfs"===i.toLowerCase()&&(r=$$(e).find("wfs\\:"+t+","+t)),0<r.length?r:$$([])}function parseBBox(r,e){getXmlTag(e,"FeatureType","wfs").each(function(e,t){if(getXmlTag(t,"Name","wfs").text()!=r._layerName)return!0;var i=getXmlTag(t,"LatLongBoundingBox","wfs");return 1!==i.length||(r._boundingBox=Cesium.Rectangle.fromDegrees(parseFloat(i[0].attributes.minx.value),parseFloat(i[0].attributes.miny.value),parseFloat(i[0].attributes.maxx.value),parseFloat(i[0].attributes.maxy.value))),!1})}function queryStringExist(e){return-1<e.indexOf("?")?"&":"?"}function initLayerCapabilities(t){var e=t.cleanUrl(t._url).replace("{s}",t.sTag(t._layerName.length,t._layerName.length,t._level));e+=queryStringExist(e),e+="SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&outputFormat=GML2&typeName="+t._layerName;var i=Cesium.TrustedServers.contains(ReplaceTagWithOriginalDomain(t._url,t._subdomains));$$.ajax({dataType:"xml",xhrFields:{withCredentials:i},url:encodeURI(e),success:function(e){parseBBox(t,e),initAllowedOperations(t,e)}})}function initAllowedOperations(r,e){$$(e).find("FeatureType").each(function(e,t){if($$(t).children("Name").text()!=r._layerName)return!0;var i=$$(t).children("Operations");return 0==i.length||i.children().each(function(){r._operations[this.tagName.toLowerCase()]={}}),!1})}function initFeatureType(t){t.featureColumnNames=null;var e=t.cleanUrl(t._url).replace("{s}",t.sTag(t._layerName.length,t._layerName.length,t._level));e+=queryStringExist(e),e+="SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&typeName="+t._layerName;var i=Cesium.TrustedServers.contains(ReplaceTagWithOriginalDomain(t._url,t._subdomains));$$.ajax({dataType:"xml",xhrFields:{withCredentials:i},url:encodeURI(e),success:function(e){parseDescribeFeatureResponse(t,e)}})}function getWfsNamespace(xmlText,testElementName){if(null==xmlText)return null;try{var match=(new XMLSerializer).serializeToString(xmlText).match(eval("/[<]([a-z]+):"+testElementName+"[>]/i"));return null!=match?match[1]:null}catch(e){return!1}}function isElementNameExists(xmlText,testElementName){if(null==xmlText)return!1;try{var match=(new XMLSerializer).serializeToString(null!=xmlText.context?xmlText.context:xmlText).match(eval("/[<](([a-z]+):)?"+testElementName+"[^>]*[>]/i"));return null!=match}catch(e){return!1}}function parseDescribeFeatureResponse(o,e){var t=$$(e).find("[type^='gml:']");o._geometryFieldName=$$(t).attr("name"),o.geometryResponseData=e,o.wfsNamespace=getWfsNamespace(o.geometryResponseData,"sequence"),null==o.wfsNamespace&&(o.wfsNamespace="xsd"),o.sgSchemaExists=$$(o.geometryResponseData).find(o.wfsNamespace+"\\:schema").attr("xmlns:sfs"),o.sgSchemaExists||(o.sgSchemaExists=$$(o.geometryResponseData).find("schema").attr("xmlns:sfs"));var i=$$(o.geometryResponseData).find(o.wfsNamespace+"\\:sequence "+o.wfsNamespace+"\\:element");0==i.length&&(i=$$(o.geometryResponseData).find("sequence").find("element")),o.geomFields=[],i.each(function(){var e=$$(this),t=e.attr("name"),i=e.attr("type");if(null==i)i="string";else{var r=i.match(/.*[:](\w+)/);r&&(i=r[1])}o.geomFields.push({name:t,type:i})})}function sqlParserToWfs(e,t){if(e.operator){var i="";switch(e.operator.toLowerCase()){case"=":i="PropertyIsEqualTo";break;case"<>":i="PropertyIsNotEqualTo";break;case">":i="PropertyIsGreaterThan";break;case">=":i="PropertyIsGreaterThanOrEqualTo";break;case"<":i="PropertyIsLessThan";break;case"<=":i="PropertyIsLessThanOrEqualTo";break;case"like":i="PropertyIsLike"}var r=-1!=t.indexOf(e.right)?e.right:e.left,o="<ogc:"+i+("like"==e.operator.toLowerCase()?' wildCard="*" singleChar="*" escape="*"':"")+">";o+="<ogc:PropertyName>"+r+"</ogc:PropertyName>";var n=-1!=t.indexOf(e.right)?e.left:e.right,a=null==(n=n.replace(/^'|'$$/g,"")).match(/^[%]|[%]$$/);return"like"==e.operator.toLowerCase()&&a&&(n="%"+n+"%"),o+="<ogc:Literal>"+n+"</ogc:Literal>",o+="</ogc:"+i+">"}var s="and"==e.logic.toLowerCase()?"And":"Or";o="<ogc:"+s+">";return 2==e.terms.length?o+=sqlParserToWfs(e.terms[0],t):o+=sqlParserToWfs({logic:s,terms:e.terms.slice(0,e.terms.length-1)},t),o+=sqlParserToWfs(e.terms[e.terms.length-1],t),o+="</ogc:"+s+">"}function parseFeaturesResult(e){var r=[],t=$$(e).find("gml\\:featureMember");return 0==t.length&&(t=$$(e).find("featureMember")),t.each(function(){var e={},t=$$(this).children().first();e.layerId=t[0].nodeName,e.originFid=t.attr("fid"),e.fid=t.attr("fid"),null==e.fid&&(e.fid=-1);var i=e.fid.match(/[.]?(\d+)$$/);i&&(e.fid=i[1]),e.node=t[0],t.children().each(function(){e[this.nodeName]=this.innerHTML,null==e[this.nodeName]&&(e[this.nodeName]=$$(this).text())}),r.push(e)}),r}function internalBlockRequestPrimitiveFromPrimitive(e){return null==e?void 0:e.parentLayer?e:e._parentCollection?e._parentCollection:e.primitive&&e.primitive._parentCollection?e.primitive._parentCollection:void 0}Object.defineProperties(Layer.prototype,{LayerDisplayName:{get:function(){return this._layerDisplayName}},displayName:{get:function(){return this.LayerDisplayName}},guid:{get:function(){return this._guid}},Style:{get:function(){return this._entityCreator.style}},show:{get:function(){return this._visible},set:function(e){this.setVisibility(e)}},BoundingBox:{get:function(){return this._boundingBox}},Statistics:{get:function(){return this._statistics}}});var DEGREES_PER_RADIAN=180/Math.PI,RADIAN_PER_DEGREEE=1/DEGREES_PER_RADIAN,REQUEST_MAX_FEATURES=1e3,workerPool;function lj(){for(var e=document.scripts,t="./wfs/featurefetcherworker.js",i=0;i<e.length;i++){var r=e[i].src.split("/"),o=r[r.length-1];"SmartEarth.js"==o?t=e[i].outerHTML.split('"')[1].replace("SmartEarth.js","Workers/featurefetcherworker.js"):"SmartEarth.min.js"==o&&(t=e[i].outerHTML.split('"')[1].replace("SmartEarth.min.js","Workers/featurefetcherworker.js"))}return t}return Layer.prototype.getRequestMaxFeatures=function(){return REQUEST_MAX_FEATURES},Layer.prototype.isAttributeField=function(e,t){return!(!t||!e||""==e.toLowerCase()||"fid"==e.toLowerCase())&&("string"==t.toLowerCase()||"integer"==t.toLowerCase()||"double"==t.toLowerCase())},Layer.prototype.updateFeatures=function(e,r){if(e.length<=0)r();else{var t=this,i=[];$$(this.geomFields).each(function(){t.isAttributeField(this.name,this.type)&&i.push(this.name)});var o="<wfs:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>",n="";$$(e).each(function(){var e=this,t='<wfs:Update typeName="{lyaer_id}">'.replace("{lyaer_id}",this.layerId);$$(i).each(function(){t+="<wfs:Property><wfs:Name>"+this+"</wfs:Name><wfs:Value>"+e[this]+"</wfs:Value></wfs:Property>"}),t+='<ogc:Filter><ogc:FeatureId fid="'+e.originFid+'"/></ogc:Filter>',n+=t+="</wfs:Update>"}),o=o.replace("{wfs_updates}",n);var a="Failed to save changes to server",s=ReplaceTagWithOriginalDomain(this.cleanUrl(this._url),this._subdomains),l=Cesium.TrustedServers.contains(s);$$.ajax({dataType:"xml",type:"POST",data:o,xhrFields:{withCredentials:l},url:encodeURI(s),success:function(e){null!=(new XMLSerializer).serializeToString(e.documentElement).toLowerCase().match(/success\s*\//)?r():r(a)},error:function(e,t,i){r(a)},timeout:1e4})}},Layer.prototype.getFeatures=function(e,t,r){var i=this,o=[];$$(this.geomFields).each(function(){i.isAttributeField(this.name,this.type)&&o.push(this.name)});var n="<wfs:GetFeature version='1.0.0' service='WFS' username='' password='' maxFeatures='{REQUEST_MAX_FEATURES}' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> <wfs:Query typeName='{layer_name}'> {wfs_filter}</wfs:Query> </wfs:GetFeature>";n=(n=n.replace("{layer_name}",this._layerName)).replace("{REQUEST_MAX_FEATURES}",REQUEST_MAX_FEATURES);var a="";""!=e.replace(/[ ]/g,"")&&(a="<ogc:Filter xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'>",a+=sqlParserToWfs(i.simpleSqlParser.sql2ast("SELECT * FROM x WHERE "+e).WHERE,o),a+="</ogc:Filter>");n=n.replace("{wfs_filter}",a);var s=ReplaceTagWithOriginalDomain(this.cleanUrl(this._url),this._subdomains),l=Cesium.TrustedServers.contains(s);t.xhr=$$.ajax({url:encodeURI(s),type:"POST",data:n,dataType:"xml",xhrFields:{withCredentials:l},success:function(e){if(isElementNameExists($$(e),"FeatureCollection")){var t=parseFeaturesResult(e);r(t)}else r(null,TELang.i18n("layer_error_reading_features"))},error:function(e,t,i){r(null,e.statusText)},timeout:1e4})},Layer.prototype.getFeatureColumnNames=function(){if(this.featureColumnNames)return this.featureColumnNames;var e=$$(this.geometryResponseData).find(this.wfsNamespace+"\\:sequence "+this.wfsNamespace+"\\:element");0==e.length&&(e=$$(this.geometryResponseData).find("sequence").find("element"));var t=[];return e.each(function(){var e=$$(this);"geom"!=e.attr("name").toLowerCase()&&t.push(e.attr("name").toLowerCase())}),this.featureColumnNames=t,this.featureColumnNames},Layer.prototype.refresh=function(e){for(var t=this._tileManager.getAllTiles(),i=t.length,r=0;r<i;r++)t[r].data.wfsLayerData[this._guid]&&t[r].data.wfsLayerData[this._guid].freeResources(),this.loadTile(t[r]);e&&initFeatureType(this)},Layer.prototype.setVisibility=function(e){if(this._visible!=e)if(0==(this._visible=e))for(var t=(r=this._tileManager.getAllTiles()).length,i=0;i<t;i++)r[i].data.wfsLayerData[this._guid]&&r[i].data.wfsLayerData[this._guid].primitive&&(r[i].data.wfsLayerData[this._guid].primitive.show=!1);else{var r;for(t=(r=this._tileManager.getAllTiles()).length,i=0;i<t;i++)r[i].data.wfsLayerData[this._guid]&&(r[i].data.wfsLayerData[this._guid].primitive?r[i].data.wfsLayerData[this._guid].primitive.show=!0:this.loadTile(r[i]))}},Layer.prototype.loadTile=function(e){var t=this;e.data.wfsLayerData[this._guid]={id:e.data.id,primitive:void 0,freeResources:function(){Cesium.defined(this.xhr)&&(this.xhr.abort(),this.xhr=void 0),Cesium.defined(this.features)&&(t.removeFeaturesFromLayer(this.features),this.features=void 0),Cesium.defined(this.primitive)&&(t._tileManager.removeFromScene(this.primitive),this.primitive=void 0)}},this.show&&e.level>=this._level.min&&e.level<=this._level.max&&(this.statc=0,this._guide=this._guid,this.beginLoadWFSData(e))},Layer.prototype.isDestroyed=function(){return!1},Layer.prototype.destroy=function(){var e=this._tileManager.getAllTiles(),t=e.length;if(0<t)for(var i=0;i<t;i++)e[i].data.wfsLayerData[this._guid]&&e[i].data.wfsLayerData[this._guid].freeResources();return this._tileManager._loadTileEvent.removeEventListener(Layer.prototype.loadTile,this),Cesium.destroyObject(this)},Layer.prototype.sTag=function(e,t,i){if(null==this._subdomains)return"";var r=(e+t+i)%this._subdomains.length;return this._subdomains[r]},Layer.prototype.cleanUrl=function(e){return-1!=e.indexOf("?")?e.split("?")[0]:e},Layer.prototype.beginLoadWFSData=function(t){if((null==this.latLon||this.latLon)&&(null!=this.BoundingBox&&(0==this.BoundingBox.width||0==this.BoundingBox.height)&&(this.BoundingBox.east+=1,this.BoundingBox.north+=1,this.BoundingBox.beenModified=!0),void 0===this.BoundingBox||void 0!==Cesium.Rectangle.intersection(this.BoundingBox,t.rectangle))){var e=[DEGREES_PER_RADIAN*t.rectangle.west,DEGREES_PER_RADIAN*t.rectangle.south,DEGREES_PER_RADIAN*t.rectangle.east,DEGREES_PER_RADIAN*t.rectangle.north],i=this,r=this.cleanUrl(this._url).replace("{s}",this.sTag(t.x,t.y,t.level));r+=queryStringExist(r),r+="SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&outputFormat=GML2&typeName="+this._layerName+"&srsName=EPSG:4326&BBOX="+e.join(",");var o=Cesium.TrustedServers.contains(ReplaceTagWithOriginalDomain(this._url,this._subdomains));t.data.wfsLayerData[this._guid].xhr=$$.ajax({dataType:this._useWorkers?"text":"xml",url:encodeURI(r),cache:!0,xhrFields:{withCredentials:o},success:function(e){i.processWFSData(t,e)},error:function(e,t,i){"abort"!==i&&console.log("Failed to retrieve data from "+r+" :"+i)},complete:function(){t.data.wfsLayerData[i._guid].xhr=void 0}})}},Layer.prototype.processWFSData=function(e,t){if(e.data.wfsLayerData[this._guid].xhr=void 0,this._useWorkers){var i=this;workerPool.queueWorkItem({id:e.data.id,text:t,geometryFieldName:this._geometryFieldName}).then(function(e){i.addFeaturesToTile(e)})}else{var r=this._gmlParser.read(t);this.addFeaturesToTile({id:e.data.id,features:r})}},Layer.prototype.boundingSphereFromGML=function(e,i){var r=viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel,o=this;workerPool.queueWorkItem({id:"0",text:e,geometryFieldName:this._geometryFieldName}).then(function(e){var t={parentLayer:o,features:e.features,sampleTerrainLevel:r+1,isQuery:!0,onFinishedQuery:function(e){var t;0<e.length&&(t=Cesium.BoundingSphere.fromBoundingSpheres(e)),i(t)}};o._entityCreator.createPrimitiveFromWFSFeatures(t)})},Layer.prototype.boundingSphereFromFeature=function(e){var t,i={parentLayer:this,features:[e],sampleTerrainLevel:viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel+1,isQuery:!0,onFinishedQuery:function(e){0<e.length&&(t=Cesium.BoundingSphere.fromBoundingSpheres(e))}};return this._entityCreator.createPrimitiveFromWFSFeatures(i),t},Layer.prototype.addRenderedFeatureId=function(e){null==this._addedFeatures[e]&&(this._addedFeatures[e]=0),this._addedFeatures[e]++},Layer.prototype.removeRenderedFeatureId=function(e){null!=this._addedFeatures[e]&&this._addedFeatures[e]--,0==this._addedFeatures[e]&&(this._addedFeatures[e]=void 0)},Layer.prototype.isExistRenderedFeatureId=function(e){return null!=this._addedFeatures[e]},Layer.prototype.addFeaturesToTile=function(i,r){var o=this._tileManager.getTile(i.id);if(void 0!==o){var e=r?o.data.wfsLayerData[this._guid].primitive._instanceIds:void 0,n=this,t={parentLayer:this,originalInstanceIds:e,features:i.features,onFinishedCreatePrimitive:function(e){if(null!=i.features&&null!=o.data.wfsLayerData&&(o.data.wfsLayerData[n._guid].features=i.features,r||n.addFeaturesToLayer(o.data.wfsLayerData[n._guid].features),void 0===e.length||0<e.length)){var t=o.data.wfsLayerData[n._guid].primitive;e.show=n.show,(o.data.wfsLayerData[n._guid].primitive=e).parentLayer=n,e.parentTileId=i.id,e._guid=Cesium.createGuid(),r?n._tileManager.replaceInScene(t,e):n._tileManager.addToScene(e)}}};this._entityCreator.createPrimitiveFromWFSFeatures(t)}},Layer.prototype.addFeaturesToLayer=function(e){this._statistics.numberOfAddedFeatures+=e.length,this._statistics.numberOfAddePositions+=Cesium.defaultValue(e.numPositions,0);for(var t=e.length,i=0;i<t;i++)!1===Object.prototype.hasOwnProperty.call(this._featuresMap,e[i].fid)?this._featuresMap[e[i].fid]={refCount:1,feature:e[i]}:this._featuresMap[e[i].fid].refCount++},Layer.prototype.removeFeaturesFromLayer=function(e){this._statistics.numberOfDeletedFeatures+=e.length,this._statistics.numberOfDeletedPositions+=Cesium.defaultValue(e.numPositions,0);for(var t=e.length,i=0;i<t;i++)!1!==Object.prototype.hasOwnProperty.call(this._featuresMap,e[i].fid)&&(this._featuresMap[e[i].fid].refCount--,0===this._featuresMap[e[i].fid].refCount&&delete this._featuresMap[e[i].fid],this.removeRenderedFeatureId(e[i].fid))},Layer.prototype.getFeature=function(e){return!1===Object.prototype.hasOwnProperty.call(this._featuresMap,e)?null:this._featuresMap[e]},Layer.prototype.updateTile=function(e){var t=this._tileManager.getTile(e);void 0!==t&&(null==t.data.wfsLayerData[this._guid].features?this.loadTile(t):this.addFeaturesToTile(t.data.wfsLayerData[this._guid],!0))},Layer.blockRequestPrimitiveFromPrimitive=function(e){if(null!=e){var t=internalBlockRequestPrimitiveFromPrimitive(e);return null!=t||(e._labelCollection&&e._labelCollection._billboardCollection?t=internalBlockRequestPrimitiveFromPrimitive(e._labelCollection._billboardCollection):e._billboardCollection&&(t=internalBlockRequestPrimitiveFromPrimitive(e._billboardCollection))),t}},Layer.prototype.resetAttributesTable=function(){this.lastEditedCell=null,this.attrTblDialogMemo=null},Layer}),define("SGWorld/Window/Rect/Rect",[],function(){return function(){}}),define("SGWorld/Window/Window",["./Rect/Rect"],function(e){function t(){this._rect=null}return Object.defineProperties(t.prototype,{Rect:{get:function(){this._rect}}}),t}),define("SGWorld/Window/Project/Project",[],function(){return function(){}}),define("SmartEarth",["./SGWorld/AttachEvent","./SGWorld/configData","./SGWorld/CoordServices","./SGWorld/DetachEvent","./SGWorld/pako_inflate","./SGWorld/SGWorld","./SGWorld/Analysis/3DViewshed","./SGWorld/Analysis/Analysis","./SGWorld/Analysis/BufferAnalysis","./SGWorld/Analysis/createTerrainProfile","./SGWorld/Analysis/curtaincontrast","./SGWorld/Analysis/depthTestAgainstTerrain","./SGWorld/Analysis/ElevationContour","./SGWorld/Analysis/Highvolume","./SGWorld/Analysis/indoormode","./SGWorld/Analysis/lineOfSight","./SGWorld/Analysis/lineOfSight1","./SGWorld/Analysis/lineOfSights","./SGWorld/Analysis/lineOfSightx","./SGWorld/Analysis/measureTerrainArea","./SGWorld/Analysis/measureTerrainHeight","./SGWorld/Analysis/measureTerrainkPerimeter","./SGWorld/Analysis/measureTerrainPerimeter","./SGWorld/Analysis/navigationMixin","./SGWorld/Analysis/Particle","./SGWorld/Analysis/PointFly","./SGWorld/Analysis/pointHandler","./SGWorld/Analysis/Scan","./SGWorld/Analysis/Scan.PostProcessStage","./SGWorld/Analysis/Scopefieldvision","./SGWorld/Analysis/Screenshot","./SGWorld/Analysis/ShadowsAnalysis","./SGWorld/Analysis/SkylineAnalysis","./SGWorld/Analysis/StreetView","./SGWorld/Analysis/SunshineAnalysis","./SGWorld/Analysis/terrainExaggeration","./SGWorld/Analysis/TerrainExcavation","./SGWorld/Analysis/UndergroundMode","./SGWorld/Analysis/weather","./SGWorld/Application/Application","./SGWorld/Command/Command","./SGWorld/Command/defined","./SGWorld/Command/defineProperties","./SGWorld/Command/execute","./SGWorld/Const/HeightReference","./SGWorld/Const/HorizontalOrign","./SGWorld/Const/LabelStyles","./SGWorld/Const/ShadowMode","./SGWorld/Const/turf-plugin","./SGWorld/Const/turf","./SGWorld/Const/VerticalOrigin","./SGWorld/Coordinate/Coordinate","./SGWorld/Core/Cartesian3_to_WGS84","./SGWorld/Core/CIMServerTool","./SGWorld/Core/CombineEcharts","./SGWorld/Core/Core","./SGWorld/Core/DrawHelper","./SGWorld/Core/JBAlgorithm","./SGWorld/Core/jquery","./SGWorld/Core/LonLatProjection","./SGWorld/Core/pbf-dev","./SGWorld/Core/Recorder","./SGWorld/Core/Skip","./SGWorld/Core/tdtwmtsimageprovider","./SGWorld/Core/turf","./SGWorld/Core/vectortile","./SGWorld/Core/WGS84_to_Cartesian3","./SGWorld/Creator/3DTileset","./SGWorld/Creator/BaiduImageryProvider","./SGWorld/Creator/Billboard","./SGWorld/Creator/billboardGeoJsonFeatureLayer","./SGWorld/Creator/Box","./SGWorld/Creator/BoxGeoJsonFeatureLayer","./SGWorld/Creator/Circle","./SGWorld/Creator/Color","./SGWorld/Creator/Cone","./SGWorld/Creator/Corridor","./SGWorld/Creator/CreateAttackArrow","./SGWorld/Creator/CreatePincerArrow","./SGWorld/Creator/createPolygon","./SGWorld/Creator/createPolyline","./SGWorld/Creator/CreateStraightArrow","./SGWorld/Creator/CreateWfsFeatureLayer","./SGWorld/Creator/Creator","./SGWorld/Creator/CZML","./SGWorld/Creator/deleteObject","./SGWorld/Creator/dynamicObject","./SGWorld/Creator/Ellipsoid","./SGWorld/Creator/FeatureLayer","./SGWorld/Creator/FlowField","./SGWorld/Creator/GeoJsonFeatureLayer","./SGWorld/Creator/Hawkeye","./SGWorld/Creator/Heatmap","./SGWorld/Creator/ImageLabel","./SGWorld/Creator/ImageryLayer","./SGWorld/Creator/KmlLayer","./SGWorld/Creator/Label","./SGWorld/Creator/LabelGeoJsonFeatureLayer","./SGWorld/Creator/LabelGeoJsonFeatureLayercopy","./SGWorld/Creator/MapGeoJsonFeatureLayer","./SGWorld/Creator/MilitaryStandard","./SGWorld/Creator/ModelLibrary","./SGWorld/Creator/ModifyMesh","./SGWorld/Creator/Point","./SGWorld/Creator/PointModel","./SGWorld/Creator/Polygon","./SGWorld/Creator/PolygonGeoJsonFeatureLayer","./SGWorld/Creator/PolygonVectorGeoJsonFeatureLayer","./SGWorld/Creator/PolygonVectorTileLayerArcgis","./SGWorld/Creator/Polyline","./SGWorld/Creator/PolylineGeoJsonFeatureLayer","./SGWorld/Creator/PolylineVolume","./SGWorld/Creator/PopupMessage","./SGWorld/Creator/position","./SGWorld/Creator/Rectangle","./SGWorld/Creator/SatelliteTrail","./SGWorld/Creator/SFSTerrainProvider copy 2","./SGWorld/Creator/SFSTerrainProvider","./SGWorld/Creator/SFSTerrainProvider7.2.3","./SGWorld/Creator/SimpleGraphic","./SGWorld/Creator/SkyBox","./SGWorld/Creator/StraightArrowPerfect","./SGWorld/Creator/TdtLabel","./SGWorld/Creator/Terrain","./SGWorld/Creator/TerrainModifier","./SGWorld/Creator/TerrainProvider","./SGWorld/Creator/Thermodynamic","./SGWorld/Creator/TrailLine","./SGWorld/Creator/Vector","./SGWorld/Creator/VectorEditing","./SGWorld/Creator/VectorGeoJsonFeatureLayer","./SGWorld/Creator/VectorImgFeatureLayer","./SGWorld/Creator/ViewCone","./SGWorld/Creator/VolumeGeoJsonFeatureLayer","./SGWorld/Creator/VolumetricMeasure","./SGWorld/Creator/wall","./SGWorld/Creator/WallGeoFeatureLayer","./SGWorld/Creator/WorkerPool","./SGWorld/DateTime/Current","./SGWorld/DateTime/DateTime","./SGWorld/Navigate/flyTo","./SGWorld/Navigate/flyToObj","./SGWorld/Navigate/getPosition","./SGWorld/Navigate/jumpTo","./SGWorld/Navigate/Navigate","./SGWorld/Navigate/northfinger","./SGWorld/Navigate/setPosition","./SGWorld/Navigate/Stop","./SGWorld/Navigate/zoomIn","./SGWorld/Navigate/zoomOut","./SGWorld/ProjectTree/createGroup","./SGWorld/ProjectTree/deleteItem","./SGWorld/ProjectTree/expandGroup","./SGWorld/ProjectTree/export","./SGWorld/ProjectTree/findItem","./SGWorld/ProjectTree/getExitsObjectType","./SGWorld/ProjectTree/getItemName","./SGWorld/ProjectTree/getNextItem","./SGWorld/ProjectTree/getObject","./SGWorld/ProjectTree/getVisibility","./SGWorld/ProjectTree/isGroup","./SGWorld/ProjectTree/ProjectTree","./SGWorld/ProjectTree/renameGroup","./SGWorld/ProjectTree/setVisibility","./SGWorld/ProjectTree/treeSource","./SGWorld/S3MTiles/DDSTexture","./SGWorld/S3MTiles/MaterialPass","./SGWorld/S3MTiles/S3MContentParser","./SGWorld/S3MTiles/S3MCreateIndexJob","./SGWorld/S3MTiles/S3MCreateVertexJob","./SGWorld/S3MTiles/S3MLayerCache","./SGWorld/S3MTiles/S3MLayerScheduler","./SGWorld/S3MTiles/S3ModelParser","./SGWorld/S3MTiles/S3MTile","./SGWorld/S3MTiles/S3MTilesLayer","./SGWorld/Terrain/Terrain","./SGWorld/VectorTileProvider/ArcgisNVectorTileProvider","./SGWorld/VectorTileProvider/GeoJSONVectorTileProvider","./SGWorld/VectorTileProvider/GeoJSONVectorTileProvider1","./SGWorld/VectorTileProvider/VectorTileProvider","./SGWorld/VectorTileProvider/VectorTileProvider1","./SGWorld/VectorTileProvider/VectorTileProvider2","./SGWorld/VectorTileProvider/VectorTileProviderEntity","./SGWorld/VectorTileProviderPolymerization/ArcgisNVectorTileProvider","./SGWorld/VectorTileProviderPolymerization/GeoJSONVectorTileProvider","./SGWorld/VectorTileProviderPolymerization/GeoJSONVectorTileProvider1","./SGWorld/VectorTileProviderPolymerization/VectorTileProvider","./SGWorld/Version/Version","./SGWorld/Wfs/EntityCreator","./SGWorld/Wfs/GmlParser","./SGWorld/Wfs/SimpleSqlParser","./SGWorld/Wfs/TileManager","./SGWorld/Wfs/TileManager1","./SGWorld/Wfs/WfsLayer","./SGWorld/Wfs/WorkerPool","./SGWorld/Window/Window","./SGWorld/Analysis/Cdcl/Angle","./SGWorld/Analysis/Cdcl/Bearing","./SGWorld/Analysis/Cdcl/Cdcl","./SGWorld/Analysis/Cdcl/Mjcl","./SGWorld/ProjectTree/Gettreeid/Gettreeid","./SGWorld/S3MTiles/Enum/ContentState","./SGWorld/S3MTiles/Enum/S3MCompressType","./SGWorld/S3MTiles/Enum/S3MPixelFormat","./SGWorld/S3MTiles/Enum/VertexCompressOption","./SGWorld/S3MTiles/Factory/RenderEntity","./SGWorld/S3MTiles/Factory/S3MCacheFileRenderEntity","./SGWorld/S3MTiles/Factory/S3MContentFactory","./SGWorld/S3MTiles/Shaders/S3MTilesFS","./SGWorld/S3MTiles/Shaders/S3MTilesVS","./SGWorld/Window/Project/Project","./SGWorld/Window/Rect/Rect"],function(e,t,i,r,o,n,a,s,l,u,c,h,d,m,p,g,f,v,_,y,C,w,b,E,S,P,x,T,I,D,L,M,A,R,O,N,V,F,H,G,k,B,j,z,W,U,q,Y,X,J,Q,K,$,Z,ee,te,ie,re,oe,ne,ae,se,le,ue,ce,he,de,me,pe,ge,fe,ve,_e,ye,Ce,we,be,Ee,Se,Pe,xe,Te,Ie,De,Le,Me,Ae,Re,Oe,Ne,Ve,Fe,He,Ge,ke,Be,je,ze,We,Ue,qe,Ye,Xe,Je,Qe,Ke,$e,Ze,et,tt,it,rt,ot,nt,at,st,lt,ut,ct,ht,dt,mt,pt,gt,ft,vt,_t,yt,Ct,wt,bt,Et,St,Pt,xt,Tt,It,Dt,Lt,Mt,At,Rt,Ot,Nt,Vt,Ft,Ht,Gt,kt,Bt,jt,zt,Wt,Ut,qt,Yt,Xt,Jt,Qt,Kt,$t,Zt,ei,ti,ii,ri,oi,ni,ai,si,li,ui,ci,hi,di,mi,pi,gi,fi,vi,_i,yi,Ci,wi,bi,Ei,Si,Pi,xi,Ti,Ii,Di,Li,Mi,Ai,Ri,Oi,Ni,Vi,Fi,Hi,Gi,ki,Bi,ji,zi,Wi,Ui,qi,Yi,Xi,Ji){"use strict";var Qi={VERSION:"2021.5.24"};return Qi.AttachEvent=e,Qi.configData=t,Qi.CoordServices=i,Qi.DetachEvent=r,Qi.pako_inflate=o,Qi.SGWorld=n,Qi["3DViewshed"]=a,Qi.Analysis=s,Qi.BufferAnalysis=l,Qi.createTerrainProfile=u,Qi.curtaincontrast=c,Qi.depthTestAgainstTerrain=h,Qi.ElevationContour=d,Qi.Highvolume=m,Qi.indoormode=p,Qi.lineOfSight=g,Qi.lineOfSight1=f,Qi.lineOfSights=v,Qi.lineOfSightx=_,Qi.measureTerrainArea=y,Qi.measureTerrainHeight=C,Qi.measureTerrainkPerimeter=w,Qi.measureTerrainPerimeter=b,Qi.navigationMixin=E,Qi.Particle=S,Qi.PointFly=P,Qi.pointHandler=x,Qi.Scan=T,Qi["Scan.PostProcessStage"]=I,Qi.Scopefieldvision=D,Qi.Screenshot=L,Qi.ShadowsAnalysis=M,Qi.SkylineAnalysis=A,Qi.StreetView=R,Qi.SunshineAnalysis=O,Qi.terrainExaggeration=N,Qi.TerrainExcavation=V,Qi.UndergroundMode=F,Qi.weather=H,Qi.Application=G,Qi.Command=k,Qi.defined=B,Qi.defineProperties=j,Qi.execute=z,Qi.HeightReference=W,Qi.HorizontalOrign=U,Qi.LabelStyles=q,Qi.ShadowMode=Y,Qi["turf-plugin"]=X,Qi.turf=J,Qi.VerticalOrigin=Q,Qi.Coordinate=K,Qi.Cartesian3_to_WGS84=$,Qi.CIMServerTool=Z,Qi.CombineEcharts=ee,Qi.Core=te,Qi.DrawHelper=ie,Qi.JBAlgorithm=re,Qi.jquery=oe,Qi.LonLatProjection=ne,Qi["pbf-dev"]=ae,Qi.Recorder=se,Qi.Skip=le,Qi.tdtwmtsimageprovider=ue,Qi.turf=ce,Qi.vectortile=he,Qi.WGS84_to_Cartesian3=de,Qi["3DTileset"]=me,Qi.BaiduImageryProvider=pe,Qi.Billboard=ge,Qi.billboardGeoJsonFeatureLayer=fe,Qi.Box=ve,Qi.BoxGeoJsonFeatureLayer=_e,Qi.Circle=ye,Qi.Color=Ce,Qi.Cone=we,Qi.Corridor=be,Qi.CreateAttackArrow=Ee,Qi.CreatePincerArrow=Se,Qi.createPolygon=Pe,Qi.createPolyline=xe,Qi.CreateStraightArrow=Te,Qi.CreateWfsFeatureLayer=Ie,Qi.Creator=De,Qi.CZML=Le,Qi.deleteObject=Me,Qi.dynamicObject=Ae,Qi.Ellipsoid=Re,Qi.FeatureLayer=Oe,Qi.FlowField=Ne,Qi.GeoJsonFeatureLayer=Ve,Qi.Hawkeye=Fe,Qi.Heatmap=He,Qi.ImageLabel=Ge,Qi.ImageryLayer=ke,Qi.KmlLayer=Be,Qi.Label=je,Qi.LabelGeoJsonFeatureLayer=ze,Qi.LabelGeoJsonFeatureLayercopy=We,Qi.MapGeoJsonFeatureLayer=Ue,Qi.MilitaryStandard=qe,Qi.ModelLibrary=Ye,Qi.ModifyMesh=Xe,Qi.Point=Je,Qi.PointModel=Qe,Qi.Polygon=Ke,Qi.PolygonGeoJsonFeatureLayer=$e,Qi.PolygonVectorGeoJsonFeatureLayer=Ze,Qi.PolygonVectorTileLayerArcgis=et,Qi.Polyline=tt,Qi.PolylineGeoJsonFeatureLayer=it,Qi.PolylineVolume=rt,Qi.PopupMessage=ot,Qi.position=nt,Qi.Rectangle=at,Qi.SatelliteTrail=st,Qi["SFSTerrainProvider copy 2"]=lt,Qi.SFSTerrainProvider=ut,Qi["SFSTerrainProvider7.2.3"]=ct,Qi.SimpleGraphic=ht,Qi.SkyBox=dt,Qi.StraightArrowPerfect=mt,Qi.TdtLabel=pt,Qi.Terrain=gt,Qi.TerrainModifier=ft,Qi.TerrainProvider=vt,Qi.Thermodynamic=_t,Qi.TrailLine=yt,Qi.Vector=Ct,Qi.VectorEditing=wt,Qi.VectorGeoJsonFeatureLayer=bt,Qi.VectorImgFeatureLayer=Et,Qi.ViewCone=St,Qi.VolumeGeoJsonFeatureLayer=Pt,Qi.VolumetricMeasure=xt,Qi.wall=Tt,Qi.WallGeoFeatureLayer=It,Qi.WorkerPool=Dt,Qi.Current=Lt,Qi.DateTime=Mt,Qi.flyTo=At,Qi.flyToObj=Rt,Qi.getPosition=Ot,Qi.jumpTo=Nt,Qi.Navigate=Vt,Qi.northfinger=Ft,Qi.setPosition=Ht,Qi.Stop=Gt,Qi.zoomIn=kt,Qi.zoomOut=Bt,Qi.createGroup=jt,Qi.deleteItem=zt,Qi.expandGroup=Wt,Qi.export=Ut,Qi.findItem=qt,Qi.getExitsObjectType=Yt,Qi.getItemName=Xt,Qi.getNextItem=Jt,Qi.getObject=Qt,Qi.getVisibility=Kt,Qi.isGroup=$t,Qi.ProjectTree=Zt,Qi.renameGroup=ei,Qi.setVisibility=ti,Qi.treeSource=ii,Qi.DDSTexture=ri,Qi.MaterialPass=oi,Qi.S3MContentParser=ni,Qi.S3MCreateIndexJob=ai,Qi.S3MCreateVertexJob=si,Qi.S3MLayerCache=li,Qi.S3MLayerScheduler=ui,Qi.S3ModelParser=ci,Qi.S3MTile=hi,Qi.S3MTilesLayer=di,Qi.Terrain=mi,Qi.ArcgisNVectorTileProvider=pi,Qi.GeoJSONVectorTileProvider=gi,Qi.GeoJSONVectorTileProvider1=fi,Qi.VectorTileProvider=vi,Qi.VectorTileProvider1=_i,Qi.VectorTileProvider2=yi,Qi.VectorTileProviderEntity=Ci,Qi.ArcgisNVectorTileProvider=wi,Qi.GeoJSONVectorTileProvider=bi,Qi.GeoJSONVectorTileProvider1=Ei,Qi.VectorTileProvider=Si,Qi.Version=Pi,Qi.EntityCreator=xi,Qi.GmlParser=Ti,Qi.SimpleSqlParser=Ii,Qi.TileManager=Di,Qi.TileManager1=Li,Qi.WfsLayer=Mi,Qi.WorkerPool=Ai,Qi.Window=Ri,Qi.Angle=Oi,Qi.Bearing=Ni,Qi.Cdcl=Vi,Qi.Mjcl=Fi,Qi.Gettreeid=Hi,Qi.ContentState=Gi,Qi.S3MCompressType=ki,Qi.S3MPixelFormat=Bi,Qi.VertexCompressOption=ji,Qi.RenderEntity=zi,Qi.S3MCacheFileRenderEntity=Wi,Qi.S3MContentFactory=Ui,Qi.S3MTilesFS=qi,Qi.S3MTilesVS=Yi,Qi.Project=Xi,Qi.Rect=Ji,Qi}),require(["./SmartEarth","./SGWorld/Core/Skip"],function(e,t){"use strict";var i="undefined"!=typeof window?window:"undefined"!=typeof self?self:{};i.SmartEarth=e;var r=document.currentScript,o=r.src.indexOf("SmartEarth.js");o<0&&(o=r.src.indexOf("SmartEarth.min.js"));for(var n=r.src.substring(0,o),a=document.getElementsByTagName("link"),s=!1,l=!1,u=0;u<a.length;u++)-1!==a[u].href.indexOf("Cesium/Widgets/widgets.css")&&(s=!0),-1!==a[u].href.indexOf("layui.css")&&(l=!0);var c=document.createElement("link");if(c.rel="stylesheet",c.type="text/css",c.href=n+"Workers/css/smartearth.css",document.head.appendChild(c),!s){var h=document.createElement("link");h.rel="stylesheet",h.type="text/css",h.href=n+"Cesium/Widgets/widgets.css",document.head.appendChild(h)}if(!l){var d=document.createElement("link");d.rel="stylesheet",d.type="text/css",d.href=n+"Workers/layui/css/layui.css",document.head.appendChild(d)}i.SmartEarthRootUrl=n;var m=new t(!1);try{i.layer||m.addJs(document.body,n+"Workers/layui/lay/modules/layer.js"),i.SmartEarth.layuiLayer=i.layuiLayer=i.layer,m.addJs(document.body,n+"Workers/FileSaver.js"),i.CesiumHeatmap||m.addJs(document.body,n+"Workers/CesiumHeatmap.js"),i.Cesium&&!i.Cesium.viewerCesiumNavigationMixin&&m.addJs(document.body,n+"Workers/viewerCesiumNavigationMixin.js"),i.echarts||m.addJs(document.body,n+"Workers/echarts.min.js"),m.addJs(document.body,n+"Workers/polyfill.min.js")}catch(e){}i.SmartEarthPopupData={}},void 0,!0)}();
|