| | |
| | | flex: 1; |
| | | position: relative; |
| | | `,this.parentElement.append(this.rightContainer),this.defaultStyle={display:this.parentElement.style.display,flexDirection:this.parentElement.style.flexDirection,flex:this.parentElement.style.flex},this.parentElement.style.display="flex",this.parentElement.style.flexDirection="row",this.parentElement.style.flex=1,this.right=new qh("SDKSecondaryScreen",e),this.right.Navigate.Stop(),this.leftEvenListener()},Xh.prototype.leftEvenListener=function(){this.right._Viewer.camera.setView({destination:this.left._Viewer.camera.position.clone(),orientation:{heading:this.left._Viewer.camera.heading,pitch:this.left._Viewer.camera.pitch,roll:this.left._Viewer.camera.roll}})},Xh.prototype.rightEvenListener=function(){this.left._Viewer.camera.setView({destination:this.right._Viewer.camera.position.clone(),orientation:{heading:this.right._Viewer.camera.heading,pitch:this.right._Viewer.camera.pitch,roll:this.right._Viewer.camera.roll}})};let Zh,$h;function em(e,t){this._viewer=e,this._cesium=t,this._Color=new m(this._viewer,this._cesium),this._core=new f,this._getPosition=new y(this._viewer,this._cesium),this._tree=V,this._points=[],this._polylines=[],this.Streamerpath=new eh(this._viewer),this.Streamerwall=new oh(this._viewer)}function tm(e,t){this._viewer=e,this._cesium=t}function im(e,t){this._viewer=e,this._cesium=t,this._current=new tm(this._viewer,this._cesium)}Xh.prototype.addEvenListener=function(){this.leftContainer.onmouseover=()=>{Zh||(Zh=this.leftEvenListener.bind(this),this.left._Viewer.scene.preRender.addEventListener(Zh)),$h&&this.right._Viewer.scene.preRender.removeEventListener($h),$h=null},this.rightContainer.onmouseover=()=>{$h||($h=this.rightEvenListener.bind(this),this.right._Viewer.scene.preRender.addEventListener($h)),Zh&&this.left._Viewer.scene.preRender.removeEventListener(Zh),Zh=null}},Xh.prototype.removeEvenListener=function(){this.leftContainer.onmouseover=null,this.rightContainer.onmouseover=null,$h&&this.right._Viewer.scene.preRender.removeEventListener($h),Zh&&this.left._Viewer.scene.preRender.removeEventListener(Zh),$h=null,Zh=null},Xh.prototype.destroy=function(){this.removeEvenListener(),this.rightContainer.remove(),this.left=null,this.right=null,this.parentElement.style.display=this.defaultStyle.display,this.parentElement.style.flexDirection=this.defaultStyle.flexDirection,this.parentElement.style.flex=this.defaultStyle.flex,this.leftContainer.style.width="100%"},em.prototype.createPathLayer=function(e={}){var t={lineColor:e.color||"#0033FF",linewidth:e.width||5,pointColor:e.pointColor||"#FFFFFF",id:e.id||this._core.getuid(),near:e.near,far:e.far,speed:e.speed||1};let i=Cesium.GeoJsonDataSource.load(e.url);i.then(e=>{var i=e.entities.values;let o=[];for(let t=0;t<i.length;t++){let e=i[t];e.polyline?o.push(e.polyline.positions.getValue()):e.polygon&&o.push(e.polygon.hierarchy.getValue().positions)}this.Streamerpath.create({positions:o,...t})});e={id:t.id,name:"新建流光线图层",pId:0,type:"TrailLineLayer",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},em.prototype.createWallLayer=function(e={}){var t={color:e.color||"#0000ff",id:e.id||this._core.getuid(),speed:e.speed,height:e.height,minHeight:e.minHeight,near:e.near,far:e.far};let i=Cesium.GeoJsonDataSource.load(e.url);i.then(e=>{var i=e.entities.values;let o=[];for(let t=0;t<i.length;t++){let e=i[t];e.polyline?o.push(e.polyline.positions.getValue()):e.polygon&&o.push(e.polygon.hierarchy.getValue().positions)}this.Streamerwall.create({positions:o,...t})});e={id:t.id,name:"新建流动墙图层",pId:0,type:"TrailLineLayer",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},em.prototype.createPath=function(e,t,i){var o={time:3e3,LineColor:this._core.defaultValue((i="number"==typeof(i=i||{})?{time:i}:i).color,"#ff0000"),LinkImage:this._core.defaultValue(i.url,window.SmartEarthRootUrl+I.TrailLine),height:5e4,num:100,width:2,LightSpot:!1,alpha:.3},r=((o=this._core.extend(o,i,!0)).twoColor&&(m={color1:o.twoColor.color1||"#00ff00",color2:o.twoColor.color2||"#ff0000"}),o.LightSpot&&(m={LightSpot:!0,color:o.LightSpotColor||o.LineColor}),new te(o.LineColor,this._core.defaultValue(m,o.LinkImage),o.time)),n=(r.alpha=o.alpha,i.inflow);let a,s;for(var l=0;l<t.length;l++){n?(a=t[l],s=e):(s=t[l],a=e);for(var c=this.parabolaEquation({pt1:a,pt2:s,height:o.height,num:o.num}),u=[],h=0;h<c.length;h++)u.push(c[h][0],c[h][1],c[h][2]);this._polylines.push(this._viewer.entities.add({name:"PolylineTrailLink"+l,polyline:{positions:this._cesium.Cartesian3.fromDegreesArrayHeights(u),width:o.width,material:r,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,o.far||1/0)}}))}this.pathMaterial=r,o.static&&this.pathMaterial.setScale(0);var m={id:this._core.getuid(),name:"新建流动路径",pId:0,type:"TrailLine",item:this};return this.setTreeobj(m),this._tree.insertGroupId(m,0),this},em.prototype.createFlyingLine=function(e,t={}){var i={time:3e3,LineColor:this._core.defaultValue(t.color,"#ffffff"),LinkImage:this._core.defaultValue(t.url,window.SmartEarthRootUrl+I.TrailLine),minHeight:0,width:1,alpha:0},t={LightSpot:!0,color:(i=this._core.extend(i,t,!0)).LightSpotColor||i.LineColor},o=new te(i.LineColor,this._core.defaultValue(t,i.LinkImage),i.time);o.alpha=i.alpha;let r;e.forEach(e=>{r=[e.lon,e.lat,i.minHeight,e.lon,e.lat,e.height],this._polylines.push(this._viewer.entities.add({name:"FlyingLine",polyline:{positions:Cesium.Cartesian3.fromDegreesArrayHeights(r),width:i.width,material:o}}))});t={id:this._core.getuid(),name:"新建垂直飞线",pId:0,type:"TrailLine",item:this};return this.setTreeobj(t),this._tree.insertGroupId(t,0),this},em.prototype.createLine=function(e,t){var i={time:3e3,LineColor:this._core.defaultValue((t="number"==typeof(t=t||{})?{time:t}:t).color,"#ff0000"),LinkImage:this._core.defaultValue(t.url,window.SmartEarthRootUrl+I.TrailLine),width:10},t=new te((i=this._core.extend(i,t,!0)).LineColor,i.LinkImage,i.time),o=[];if(e[0].x||e[0].y)if(void 0!==e[0].z)if(-180<=e[0].x&&e[0].x<=180)for(r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x,e[r].y,e[r].z));else o=e;else for(r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x,e[r].y));else if(2===e[0].length)for(var r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0],e[r][1]));else if(3===e[0].length)for(var r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0],e[r][1],e[r][2]));this._polylines.push(this._viewer.entities.add({name:"PolylineTrail",polyline:{positions:o,width:i.width,material:t,clampToGround:i.clampToGround}}));t={id:this._core.getuid(),name:"新建流动线",pId:0,type:"TrailLine",item:this};return this.setTreeobj(t),this._tree.insertGroupId(t,0),this},em.prototype.createWall=function(e,t){var i={time:9e3,LineColor:this._core.defaultValue((t="number"==typeof(t=t||{})?{time:t}:t).color,this._cesium.Color.ORANGE),LinkImage:this._core.defaultValue(t.url,window.SmartEarthRootUrl+I.colors3)},t=new te((i=this._core.extend(i,t,!0)).LineColor,i.LinkImage,i.time||9e3),o=[];if(e[0].x||e[0].y)if(void 0!==e[0].z)if(-180<=e[0].x&&e[0].x<=180)for(r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x,e[r].y,e[r].z));else o=e;else for(r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x,e[r].y));else if(2===e[0].length)for(var r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0],e[r][1]));else if(3===e[0].length)for(var r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0],e[r][1],e[r][2]));this._polylines.push(this._viewer.entities.add({name:"WallTrail",wall:{positions:o,material:t,maximumHeights:i.maximumHeights,minimumHeights:i.minimumHeights}}));t={id:this._core.getuid(),name:"新建流动墙",pId:0,type:"TrailLine",item:this};return this.setTreeobj(t),this._tree.insertGroupId(t,0),this},em.prototype.parabolaEquation=function(e,t){var i=this._core.defaultValue(e.height,5e3),o=Math.abs(e.pt1.lon-e.pt2.lon)>Math.abs(e.pt1.lat-e.pt2.lat)?Math.abs(e.pt1.lon-e.pt2.lon):Math.abs(e.pt1.lat-e.pt2.lat),r=e.num&&50<e.num?e.num:50,n=[],a=o/r,s=e.pt1.height||0,l=e.pt2.height||0;if(Math.abs(e.pt1.lon-e.pt2.lon)>Math.abs(e.pt1.lat-e.pt2.lat)){var c=(e.pt2.lat-e.pt1.lat)/r;0<e.pt1.lon-e.pt2.lon&&(a=-a);for(var u=0;u<=r;u++){var h=i-4*Math.pow(-.5*o+Math.abs(a)*u,2)*i/Math.pow(o,2)+s+(l-s)*u/r,m=e.pt1.lon+a*u,d=e.pt1.lat+c*u;n.push([m,d,h])}}else{var p=(e.pt2.lon-e.pt1.lon)/r;0<e.pt1.lat-e.pt2.lat&&(a=-a);for(u=0;u<=r;u++){h=i-4*Math.pow(-.5*o+Math.abs(a)*u,2)*i/Math.pow(o,2)+s+(l-s)*u/r,m=e.pt1.lon+p*u,d=e.pt1.lat+a*u;n.push([m,d,h])}}return n},em.prototype.setThisPosition=function(e,t){var i;this.pathMaterial&&(i=this._cesium.Cartesian3.fromDegrees(e[0].lon,e[0].lat),e=this._cesium.Cartesian3.fromDegrees(e[1].lon,e[1].lat),t=this._cesium.Cartesian3.fromDegrees(t.lon,t.lat),e=this._core.getSpaceDistancem([i,e],this._cesium),i=this._core.getSpaceDistancem([i,t],this._cesium),this.pathMaterial.setScale(i/e))},em.prototype.clear=function(){if(0<this._points.length)for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e]);if(0<this._polylines.length)for(e=0;e<this._polylines.length;e++)this._viewer.entities.remove(this._polylines[e]);this._points=[],this._polylines=[],this.Streamerpath.removeAll(),this.Streamerwall.removeAll()},em.prototype.setTreeobj=function(e){this.treeobj=e},em.prototype.deleteObject=function(){this.clear()},em.prototype.setVisibility=function(e){if(0<this._points.length)for(var t=0;t<this._points.length;t++)this._points[t].show=e;if(0<this._polylines.length)for(t=0;t<this._polylines.length;t++)this._polylines[t].show=e;this.Streamerpath.show(e),this.Streamerwall.show(e)},tm.prototype.currentTime=function(e){return""!=e&&null!=e&&(e=new Date(e),e=this.this._cesium.JulianDate.fromDate(e),this._viewer.clock.currentTime=e.clone()),this},tm.prototype.currentTimeFaster=function(){return this._viewer.animation.viewModel.faster(),this},tm.prototype.currentTimeSlower=function(){return this._viewer.animation.viewModel.slower(),this},tm.prototype.currentplayForwardViewModel=function(){return this._viewer.animation.viewModel.playForwardViewModel.command(),this},tm.prototype.currentplayReverseViewModel=function(){return this._viewer.animation.viewModel.playReverseViewModel.command(),this},tm.prototype.currentpauseViewModel=function(){return this._viewer.animation.viewModel.pauseViewModel.command(),this},im.prototype.currentTime=function(e){return this._current.currentTime(e)},im.prototype.currentTimeFaster=function(){return this._current.currentTimeFaster()},im.prototype.currentTimeSlower=function(){return this._current.currentTimeSlower()},im.prototype.currentplayForwardViewModel=function(){return this._current.currentplayForwardViewModel()},im.prototype.currentplayReverseViewModel=function(){return this._current.currentplayReverseViewModel()},im.prototype.currentpauseViewModel=function(){return this._current.currentpauseViewModel()};let om={draw_tip_left:"左键开始绘制!",draw_tip_right:"右键结束绘制!",draw_tip_click:"点击继续绘制!",draw_tip_cancel:"再次点击结束绘制,右键取消!",draw_tip_first_point:"点击添加第一个点",draw_tip_state:"点击添加点,右键结束",draw_tip_info_radius:"半径",unit_m:"米",unit_km:"千米"};function rm(e){this._core=new f,this._lang=this._core.extend(om,e,!0)}rm.prototype.getStr=function(e){return this._lang[e]},rm.prototype.set=function(e){this._lang=this._core.extend(om,e,!0)},rm.prototype.get=function(){return this._lang};let nm="undefined"!=typeof window?window:"undefined"!=typeof self?self:{},am=document.currentScript&&document.currentScript.src;if(!am)try{throw Error("获取当前文件路径")}catch(e){e.fileName?am=e.fileName:e.stack?am=(e.stack.match(/at\s+(.*?):\d+:\d+/)||["",""])[1]:e.sourceURL&&(am=e.sourceURL)}let sm=(am=-1<am.indexOf("(")?am.split("(")[1]:am).indexOf("SmartEarth.js"),lm=(sm<0&&(sm=am.indexOf("SmartEarth.min.js")),nm.SmartEarthRootUrl);if(!lm){lm=sm<0?(sm=am.indexOf("Source/Main"),am.substring(0,sm)+"Build/"):am.substring(0,sm);let t=document.getElementsByTagName("link"),i=!1;for(let e=0;e<t.length;e++)-1!==t[e].href.indexOf("smartearth.css")&&(i=!0);if(!i){let e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.href=lm+"Workers/css/smartearth.css",document.head.appendChild(e)}let e=new oe(!1);try{nm.$||e.addJs(lm+"Workers/jquery-2.0.3.js"),nm.layer||e.addJs(lm+"Workers/layui/lay/modules/layer.js"),nm.layuiLayer=nm.layer,nm.Cesium_turf||(e.addJs(lm+"Workers/turf.min.js"),nm.Cesium_turf=nm.turf),e.addJs(lm+"Workers/polyfill.min.js")}catch(e){}nm.SmartEarthPopupData={}}function cm(e,t){this._viewer=e,this._cesium=t,this._tree=V.getSource()}nm.language=new rm,nm.SmartEarthRootUrl=lm,nm.logSmartEarthLog=e=>{var t=nm.SmartEarth&&nm.SmartEarth.VERSION,i=nm.SmartEarth&&nm.SmartEarth.COMPILETIME,o=nm.Cesium&&nm.Cesium.VERSION;let r=e===1/0||-1<am.indexOf("Source/Main")?"永久激活":new Date(e);e=` |
| | | %c |
| | | SmartEarth |
| | | %c |
| | | 版 本 号:${t} Cesium版本:${o} |
| | | 编译时间:${i} |
| | | 授权信息:${r="永久激活"!==r?`有效期至${r.getFullYear()}年${r.getMonth()+1}月${r.getDate()}日`:r}。 |
| | | 版权声明: SmartEarthSDK版权完全属于【泰瑞数创科技(北京)股份有限公司】 |
| | | |
| | | |
| | | |
| | | 在线示例:http://183.162.245.49:18076/sdkdemo_2022 |
| | | 接口文档:http://183.162.245.49:18076/sdkdemo_2022/api |
| | | `;return setTimeout(console.log.bind(console,e,"font:bold 50px 微软雅黑;color:#018aff;","color:#018aff;font-size:13px;font-family:微软雅黑"),0),-1<am.indexOf("Source/Main")},cm.prototype.deleteItem=function(e){};var um=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){var i=t,o=[],r=!0,t=!1,n=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(o.push(a.value),!i||o.length!==i);r=!0);}catch(e){t=!0,n=e}finally{try{!r&&s.return&&s.return()}finally{if(t)throw n}}return o}throw new TypeError("Invalid attempt to destructure non-iterable instance")},hm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function mm(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function dm(e,t,i){this._viewer=e,this._cesium=t,this._viewer=null,this._Cesium=i.Cesium,this._url=i.url,this._urlParams=i.urlParams,this._urlTemplate=this._url+"?"+this._serialize(this._urlParams),this._rectangle=i.rectangle,this._maximumLevel=i.maximumLevel||19,this._minimumLevel=i.minimumLevel||1,this._tilingScheme=i.tilingScheme||new this._Cesium.GeographicTilingScheme,this._tileRangeByLevel={},this._moveEndTimestamp=null,this._isRemoved=!1,this._isCameraMoving=!1,this._propertyToBeFiltered=null,this._valuesToBeFiltered=null,this._primitiveByTile={},this._tileKeys=[],this._lowerLevelLimit=i.lowerLevelLimit||1,this._upperLevelLimit=i.upperLevelLimit||null,this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._cameraMoveStartHandler=this._cameraMoveStartHandler.bind(this),this.heightById={};for(var o=this._radianToDegree(this._rectangle.west),r=this._radianToDegree(this._rectangle.south),n=this._radianToDegree(this._rectangle.east),a=this._radianToDegree(this._rectangle.north),s=this._minimumLevel;s<=this._maximumLevel;s++){var l=this._lonLatToTileInWGS84([o,r],s),c=this._lonLatToTileInWGS84([n,a],s),u=Math.min(l[0],c[0]),h=Math.max(l[0],c[0]),m=Math.min(l[1],c[1]),l=Math.max(l[1],c[1]);this._tileRangeByLevel[s]={minCol:m,maxCol:l,minRow:u,maxRow:h}}this._tileRangeByLevel[0]={minCol:0,maxCol:0,minRow:0,maxRow:0},this._primitiveCollection=new this._Cesium.PrimitiveCollection,this._stop=!1}function pm(){this._quadtree=void 0,this._tilingScheme=new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._loadTileEvent=new Cesium.Event,this._levelZeroMaximumError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,128,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._tileCache=[],this._primitivesWaitingToBeAddedToTheScene=[],this._pauseStreaming=!1,this._numTilesInLevel=[],this.STREAM_SPEED_IMIDIATE=0,this.STREAM_SPEED_FAST=1,this.STREAM_SPEED_NORMAL=2,this.STREAM_SPEED_SLOW=3,this._streamSpeed=this.STREAM_SPEED_NORMAL}function gm(e,i){$.each(e._primitives,function(e,t){if(t instanceof Cesium.BillboardCollection)return e=bm.indexOf(t=t),t._parentCollection._primitiveOld=i,-1!==e?(viewer.scene.primitives.remove(bm[e]._parentCollection),bm[e]=t):bm.push(t),!1})}function fm(e,t){viewer.scene.primitives.remove(t),e._onDestroyTilePrimitive=function(){viewer.scene.primitives.remove(t),this._onDestroyTilePrimitive=void 0}}function _m(e,t,i){Cesium.when.all(e,function(){viewer.scene.primitives.remove(i)}),t._onDestroyTilePrimitive=function(){viewer.scene.primitives.remove(i),this._onDestroyTilePrimitive=void 0}}function Cm(e,t){_m($.map(e._primitives,function(e){return e.readyPromise}),e,t)}function ym(e,t){_m($.map(e._primitives[0]._primitives,function(e){return e.readyPromise}),e,t)}function vm(e,t){viewer.scene.primitives.remove(t)}function wm(e,t){_m([e.readyPromise],e,t)}dm.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":hm(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},dm.prototype._fetch=function(r){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(t,i){var o=new XMLHttpRequest;if(o.open(n.method||"GET",r),n.headers)for(var e in n.headers)o.setRequestHeader(e,n.headers[e]);o.onload=function(){if(4===o.readyState&&200===o.status)try{var e=JSON.parse(o.responseText);t(e)}catch(e){i(new Error("INVALID RESPONSE"))}},o.onerror=function(e){i(e)},o.onloadend=function(e){200!==e.target.status&&i(new Error("["+e.target.status+"]request failed: "+r))},o.send(n.body||null)})},dm.prototype._lonLatToTileInWGS84=function(e,t){var e=um(e,2),i=e[0],e=e[1];return[Math.floor(Math.pow(2,t)*(90-e)/180),Math.floor(Math.pow(2,t)*(180+i)/180)]},dm.prototype._radianToDegree=function(e){return e/Math.PI*180},dm.prototype._isTileInRange=function(e){try{var t=this._tileRangeByLevel[e.level],i=t.minCol,o=t.maxCol,r=t.minRow,n=t.maxRow;return e.x>=i&&e.x<=o&&e.y>=r&&e.y<=n}catch(e){return!1}},dm.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0},dm.prototype._loadTile=function(e){var r=[],n=new this._Cesium.ColorGeometryInstanceAttribute(.75,.75,.75,1),a=this;return e.features.forEach(function(e){if(a._propertyToBeFiltered&&Array.isArray(a._valuesToBeFiltered)){var t=e.properties[a._propertyToBeFiltered];if(a._valuesToBeFiltered.includes(t))return}var o,t=e.geometry.type;"Polygon"===t||"MultiPolygon"===t?(o=[],a.heightById[e.properties.house_id]=e.properties.height,e.geometry.coordinates.forEach(function(e,i){o.push([]),e.forEach(function(e){var t;2<e.length?e.forEach(function(e){var t;2<=e.length&&(t=o[i]).push.apply(t,mm(e))}):(t=o[i]).push.apply(t,mm(e))});var e=new a._Cesium.PolygonHierarchy(a._Cesium.Cartesian3.fromDegreesArray(o[i])),t=a._Cesium.BoundingSphere.fromPoints(e.positions).center,t=a._viewer.scene.globe.getHeight(a._Cesium.Cartographic.fromCartesian(t))||0,e=new a._Cesium.PolygonGeometry({polygonHierarchy:e,height:t,vertexFormat:a._Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,extrudedHeight:1e3}),t=new a._Cesium.GeometryInstance({geometry:e,attributes:{color:n}});r.push(t)})):console.warn('GeoJSONVectorTileProvider: geometry type "'+e.geometry.type+'" detected, but is not going to be rendered')}),new this._Cesium.Primitive({allowPicking:!1,appearance:new this._Cesium.PerInstanceColorAppearance({translucent:!1}),geometryInstances:r})},dm.prototype._cameraMoveEndHandler=function(){var i,o,e,t,r,n,a,s,l;this._stop||(i=this,o=Date.now(),t=(e=this._viewer.scene.globe._surface._tilesToRender).map(function(e){return e.level}),r=Math.min.apply(Math,mm(t)),(n=Math.max.apply(Math,mm(t)))<this._lowerLevelLimit&&(i._tileKeys=[],i._removeObsoletePrimitives(i._primitiveByTile,[]),e=[]),this._upperLevelLimit&&r>this._upperLevelLimit&&(i._tileKeys=[],i._removeObsoletePrimitives(i._primitiveByTile,[]),e=[]),(e=2<n-r?e.filter(function(e){return e.level>=n-2}):e).sort(function(e,t){return-(e.level-t.level)}),e=e.filter(function(e){return i._isTileInRange(e)}),this._upperLevelLimit&&(e=this._refineTiles(e,this._upperLevelLimit)),this._isCameraMoving=!1,this._moveEndTimestamp=o,a=[],l=s=0,e.forEach(function(e){var t="z"+e.level+"x"+e.x+"y"+e.y;a.push(t),i._tileKeys.push(t),i._primitiveByTile[t]||(e=i._urlTemplate.replace(window.encodeURIComponent("{x}"),e.x).replace(window.encodeURIComponent("{y}"),e.y).replace(window.encodeURIComponent("{z}"),e.level),s++,i._fetch(e).then(function(e){if(i._isRemoved)throw new Error("DISCARD");if(i._isCameraMoving)throw new Error("DISCARD");if(o!==i._moveEndTimestamp)throw new Error("DISCARD");e=i._loadTile(e);i._primitiveCollection.add(e),i._primitiveByTile[t]=e,s<=++l&&(i._tileKeys=a,i._removeObsoletePrimitives(i._primitiveByTile,a))}).catch(function(e){s<=++l&&(i._tileKeys=a,i._removeObsoletePrimitives(i._primitiveByTile,a)),e.message}))}))},dm.prototype._refineTiles=function(e,s){var l=[],c=[];return e.forEach(function(e){var t="Z"+e.level+"X"+e.x+"Y"+e.y;if(e.level<s-1)c.includes(t)||(l.push(e),c.push(t));else if(e.level===s-1)for(var i=0;i<2;i++)for(var o=0;o<2;o++){var r="Z"+(e.level+1)+"X"+(2*e.x+i)+"Y"+(2*e.y+o);c.includes(r)||(l.push({x:2*e.x+i,y:2*e.y+o,level:e.level+1}),c.push(r))}else{var n,a=e.level-s;0==a?c.includes(t)||(l.push(e),c.push(t)):(t=2*a,a=Math.floor(e.x/t),t=Math.floor(e.y/t),c.includes(n="Z"+s+"X"+a+"Y"+t)||(l.push({x:a,y:t,level:s}),c.push(n)))}}),l},dm.prototype._removeObsoletePrimitives=function(e,t){var i,o=[];for(i in 0<t.length&&(o=t),e)o.includes(i)||this._primitiveCollection.remove(e[i])&&delete e[i]},dm.prototype.addTo=function(e){this._viewer=e,this._viewer.scene.primitives.add(this._primitiveCollection),this._isRemoved=!1,this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.addEventListener(this._cameraMoveStartHandler),this._cameraMoveEndHandler()},dm.prototype.remove=function(){if(this._viewer){for(var e in this._primitiveByTile)this._viewer.scene.primitives.remove(this._primitiveByTile[e]);this._primitiveByTile={},this._viewer.camera.moveEnd.removeEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.removeEventListener(this._cameraMoveStartHandler),this._viewer=null,this._isRemoved=!0}},dm.prototype.setStatus=function(e){this._stop=e},dm.prototype.isRemoved=function(){return this._isRemoved},dm.prototype.filterBy=function(e,t,i){this._propertyToBeFiltered=e,this._valuesToBeFiltered=t},dm.prototype.removeFilter=function(){this._propertyToBeFiltered=null,this._valuesToBeFiltered=null},Object.defineProperties(pm.prototype,{quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},loadTileEvent:{get:function(){return this._loadTileEvent}},pauseStreaming:{get:function(){return this._pauseStreaming},set:function(e){this._pauseStreaming=e}},streamSpeed:{get:function(){return this._streamSpeed},set:function(e){this._streamSpeed=e}},bestLevelAvailable:{get:function(){for(var e=0,t=0;t<22;t++)null!=this._numTilesInLevel[t]&&0<this._numTilesInLevel[t]&&e<t&&(e=t);return e}}}),pm.prototype.streamSpeedFactor=function(){switch(this._streamSpeed){case this.STREAM_SPEED_FAST:return 1;case this.STREAM_SPEED_NORMAL:return 3;case this.STREAM_SPEED_SLOW:return 20;default:return 3}};var bm=[],Tm=0,Sm=!(pm.prototype.onPreFrame=function(e,t){if(Tm++,!this._pauseStreaming){if(this._streamSpeed==this.STREAM_SPEED_IMIDIATE)for(;0<this._primitivesWaitingToBeAddedToTheScene.length;){var i=this._primitivesWaitingToBeAddedToTheScene.pop();e.primitives.add(i)}else 0<this._primitivesWaitingToBeAddedToTheScene.length&&Tm%this.streamSpeedFactor()==0&&((i=this._primitivesWaitingToBeAddedToTheScene.pop())._instanceIds&&100<i._instanceIds.length&&this.streamSpeed===this.STREAM_SPEED_FAST&&(this.streamSpeed=this.STREAM_SPEED_NORMAL),e.primitives.add(i));$.each(bm,function(e,t){t.ready&&viewer.scene.primitives.remove(t._parentCollection._primitiveOld)})}}),Em=(pm.prototype.initialize=function(e){Sm||(viewer.scene.preRender.addEventListener(this.onPreFrame,this),Sm=!0)},pm.prototype.beginUpdate=function(e){this.quadtree.beginFrame(e)},pm.prototype.endUpdate=function(e){var t=this;e.afterRender.push(function(){t.quadtree.endFrame(e)})},pm.prototype.updateForPick=function(e){},pm.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)*this._quadtree.maximumScreenSpaceError},Math.PI,pm.prototype.placeHolder=function(e,t){t=t||Cesium.Color.fromBytes(0,255,0,255);t=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.RectangleOutlineGeometry({rectangle:e.rectangle,height:viewer.camera.positionCartographic.height-.99*TerraExplorer.internal.Navigate.HeightAboveGround}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(t)}}),appearance:new Cesium.PerInstanceColorAppearance({flat:!0})});e.data.primitive.add(t)},pm.prototype.loadTile=function(e,t){var i=this;null==this._numTilesInLevel[t._level]&&(this._numTilesInLevel[t._level]=0),this._numTilesInLevel[t._level]++,t.state===Cesium.QuadtreeTileLoadState.START&&(t.data={primitive:new Cesium.PrimitiveCollection,wfsLayerData:[],id:Cesium.createGuid(),freeResources:function(){if(i._tileCache[t.data.id]&&i._numTilesInLevel[t._level]--,i._numTilesInLevel[t._level]<0&&(i._numTilesInLevel[t._level]=0),Cesium.defined(this.wfsLayerData)){for(var e in this.wfsLayerData)Cesium.defined(this.wfsLayerData[e])&&this.wfsLayerData[e].freeResources();this.wfsLayerData=void 0}Cesium.defined(this.primitive)&&(this.primitive.destroy(),this.primitive=void 0),delete i._tileCache[t.data.id]}},this._tileCache[t.data.id]=t,Math.abs(6371e3*(t.rectangle.south-t.rectangle.north)),t.data.boundingSphere3D=Cesium.BoundingSphere.fromRectangle3D(t.rectangle),t.data.boundingSphere2D=Cesium.BoundingSphere.fromRectangle2D(t.rectangle,e.mapProjection),t.rectangle.west,t.rectangle.south,t.rectangle.east,t.rectangle.north,this.loadTileEvent.raiseEvent(t),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)},pm.prototype.getTile=function(e){return this._tileCache[e]},pm.prototype.getAllTiles=function(){var e,t=[];for(e in this._tileCache)t.push(this._tileCache[e]);return t},pm.prototype.computeTileVisibility=function(e,t,i){var o=this.computeDistanceToTile(e,t);return e._distance=o,t.fog.enabled&&9<e._level&&1<=Cesium.Math.fog(o,t.fog.density)?Cesium.Visibility.NONE:(o=t.mode===Cesium.SceneMode.SCENE3D?e.data.boundingSphere3D:e.data.boundingSphere2D,t.cullingVolume.computeVisibility(o))},pm.prototype.showTileThisFrame=function(e,t){e.data.primitive.update(t)},pm.prototype.computeDistanceToTile=function(e,t){var i=new Cesium.Cartesian3,e=t.mode===Cesium.SceneMode.SCENE3D?e.data.boundingSphere3D:e.data.boundingSphere2D,e=Cesium.Cartesian3.subtract(e.center,t.camera.positionWC,i),t=Cesium.Cartesian3.magnitude(e);return Math.max(1,t-TerraExplorer.internal.Navigate.GroundHeightAtCameraPosition)},pm.prototype.isDestroyed=function(){return!1},pm.prototype.destroy=function(){return Cesium.destroyObject(this)},pm.prototype.getInstance=function(t){var i;return 0==Cesium.defined(t.TileManager)&&(t.TileManager=new e,i=new Cesium.QuadtreePrimitive({tileProvider:t.TileManager,maximumScreenSpaceError:2}),t.scene.primitives.add(i)),t.TileManager},pm.prototype.addToScene=function(e){this._primitivesWaitingToBeAddedToTheScene.push(e)},pm.prototype.removeFromScene=function(e){var t=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=t?(this._primitivesWaitingToBeAddedToTheScene[t].destroy(),this._primitivesWaitingToBeAddedToTheScene.splice(t,1)):viewer.scene.primitives.remove(e)},pm.prototype.replaceInScene=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);if(-1!=i)this._primitivesWaitingToBeAddedToTheScene[i]=t;else switch(e.ID!=t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),null!=e._replacmentPrimitive&&viewer.scene.primitives.remove(e._replacmentPrimitive),e._replacmentPrimitive=t,viewer.scene.primitives.add(t),t.ID.split(":")[0]){case"billboards":gm(t,e);break;case"labels":fm(t,e);break;case"polygons":Cm(t,e);break;case"models":ym(t,e);break;case"polylines":wm(t,e);break;case"points":vm(0,e);break;default:console.log("Error updating layer"),viewer.scene.primitives.remove(e)}},{billboards:gm,labels:fm,polygons:Cm,models:ym,polylines:wm,points:vm});pm.prototype.replaceInSceneNew=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=i?this._primitivesWaitingToBeAddedToTheScene[i]=t:(e.ID!==t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),this.addToScene(t),i=t.ID.split(":")[0],(i=Em[i])?i(t,e):(console.log("Error updating layer"),viewer.scene.primitives.remove(e)))};ni=Object.freeze({LUMINANCE_8:1,LUMINANCE_16:2,ALPHA:3,ALPHA_4_LUMINANCE_4:4,LUMINANCE_ALPHA:5,RGB_565:6,BGR565:7,RGB:10,BGR:11,ARGB:12,ABGR:13,BGRA:14,WEBP:25,RGBA:28,DXT1:17,DXT2:18,DXT3:19,DXT4:20,DXT5:21,CRN_DXT5:26,STANDARD_CRN:27});o.Analysis=O,o.Angle=xr,o.ArcgisNVectorTileProvider=dm,o.AttachEvent=Ih,o.BaiduImageryProvider=Ml,o.Bearing=Pr,o.Billboard=Bl,o.Box=B,o.BoxGeoJsonFeatureLayer=Vl,o.BufferAnalysis=Ai,o.CIMServerTool=ne,o.COMPILETIME="2022.12.26",o.CZML=uh,o.CameraPlaneVideo=Hl,o.CanvasField=rc,o.Cartesian2=function(e=0,t=0){this.x=e,this.y=t},o.Cartesian3=function(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i},o.Cartesian3_to_WGS84=function(e){return e=Cesium.Cartographic.fromCartesian(e),{lat:Cesium.Math.toDegrees(e.latitude),lon:Cesium.Math.toDegrees(e.longitude),height:e.height}},o.Cdcl=Tr,o.CesiumHeatmap=tn,o.CesiumHeatmapGL=on,o.CesiumRenderPass=mr,o.Circle=H,o.ClusterLayer=nc,o.Color=m,o.ColorAdjustment=sc,o.ColorAdjustmentFS=ac,o.CombineEcharts=re,o.Command=$r,o.Cone=j,o.ConicSensor=lc,o.ContentState=Ce,o.CoordTransform=he,o.Core=f,o.Corridor=cc,o.CreateWfsFeatureLayer=mu,o.Creator=Q,o.Current=tm,o.DDSTexture=et,o.DXTTextureDecode=Ee,o.DateTime=im,o.Degrees=function(e=0,t=0,i=0){this.lon=e,this.lat=t,this.height=i},o.Deprecated=Ir,o.DetachEvent=Ah,o.DivPoint=Ti,o.DoubleScreen=Xh,o.EdgeStage=dr,o.EffectCircle=wh,o.EffectCircleSource=vh,o.EffectConeBottomSource=Sh,o.EffectConeSource=Th,o.EffectCylinder=Eh,o.EffectCylinderSource=bh,o.ElevationContour=Yt,o.ElevationTool=hn,o.Ellipsoid=Fr,o.EntityCreator=ul,o.EventType=en,o.FieldIntensity=yh,o.FlowField=qu,o.GeoJSONVectorTileProvider=v,o.GeoJSONVectorTileProvider1=Li,o.GeoJSONVectorTileProviderPolymerization=Tu,o.GeoJsonFeatureLayer=w,o.Gettreeid=function(e,t){for(var i="",o=V.getSource(),r=0;r<o.length;r++)e==o[r].name&&o[r].pId==t&&(i=o[r].id);return i},o.GmlParser=bn,o.Hawkeye=ah,o.Heatmap=hh,o.Highvolume=Br,o.ImageLabel=gu,o.ImageryLayer=yu,o.InstanceMode=lt,o.JBAlgorithm=U,o.KmlLayer=sh,o.Label=G,o.LabelGeoJsonFeatureLayer=Su,o.LabelGeoJsonFeatureLayercopy=S,o.Language=rm,o.LonLatProjection=Mi,o.MaterialPass=tt,o.MilitaryStandard=K,o.Mjcl=Dr,o.ModelClipping=ch,o.ModelEdit=Jt,o.ModifyMesh=lh,o.Navigate=Hh,o.OperationType=Vt,o.Particle=xo,o.Point=L,o.PointFly=_r,o.PointModel=P,o.Polygon=M,o.PolygonGeoJsonFeatureLayer=Gi,o.PolygonVectorGeoJsonFeatureLayer=Ju,o.PolygonVectorTileLayerArcgis=mo,o.Polyline=R,o.PolylineGeoJsonFeatureLayer=Hi,o.PolylineLinkSource=Ut,o.PolylineTrailLinkMaterial=te,o.PolylineTrailLinkMaterialSource=ee,o.PolylineTrailLinkSource=Z,o.PolylineVolume=du,o.PopupMessage=Si,o.ProgramDefines=at,o.ProjectTree=q,o.RangeMode=bt,o.Recorder=ae,o.Rectangle=F,o.RenderEntity=ut,o.Road=nh,o.S3MCacheFileRenderEntity=pt,o.S3MCompressType={encNONE:0,enrS3TCDXTN:14,enrPVRTPF_PVRTC2:19,enrPVRTPF_PVRTC:20,enrPVRTPF_PVRTC_4bpp:21,enrPVRTPF_ETC1:22},o.S3MContentFactory=Ct,o.S3MContentParser=yt,o.S3MCreateIndexJob=nt,o.S3MCreateShaderProgramJob=ct,o.S3MCreateVertexJob=rt,o.S3MLayerCache=Bt,o.S3MLayerScheduler=Dt,o.S3MObliqueRenderEntity=_t,o.S3MPixelFormat=ni,o.S3MTile=Tt,o.S3MTilesFS=ot,o.S3MTilesLayer=Ht,o.S3MTilesNoLightFS=ft,o.S3MTilesNoLightVS=gt,o.S3MTilesVS=it,o.S3ModelParser=Me,o.SE3DTileset=A,o.SE3DTilesetFS=vr,o.SE3DTilesetVS=wr,o.SFSTerrainProvider=Ou,o.SFSTerrainProvider7_2_3=Au,o.SGWorld=qh,o.SatelliteTrail=mh,o.Scan=Ko,o.Scan_PostProcessStage=Vr,o.Screenshot=fr,o.ShadowPostProcess=nr,o.ShadowPostProcessFS=or,o.ShadowsAnalysis=gr,o.SightLine=yo,o.SimpleGraphic=x,o.SimpleSqlParser=Bn,o.Skip=oe,o.SkyBox=Qu,o.SkylineAnalysis=lr,o.Stop=Fh,o.StreamerPath=eh,o.StreamerPathFS=$u,o.StreamerWall=oh,o.StreamerWallFS=ih,o.StreetView=Io,o.StreetViewYZ=Bo,o.Style3D=Ft,o.SunshineAnalysis=Cr,o.TdtLabel=_h,o.Terrain=zu,o.TerrainExcavation=pr,o.TerrainModifier=gh,o.Tetrahedron=Ph,o.TileManager=pm,o.TileManager1=Tn,o.TrafficLight=xh,o.TrailLine=em,o.TrailLinePrimitive=rh,o.UndergroundGrid=Do,o.UndergroundMode=Rr,o.VERSION="2.3.0",o.VectorCesiumTerrainProvider=Vu,o.VectorGeoJsonFeatureLayer=E,o.VectorImgFeatureLayer=ph,o.VectorTileProvider=T,o.VertexCompressOption=st,o.Video=fh,o.ViewCone=ar,o.Viewshed=Zo,o.ViewshedPoss=sr,o.VolumeGeoJsonFeatureLayer=Wu,o.VolumetricMeasure=Sr,o.WFSTool=Ll,o.WGS84_to_Cartesian3=function(e){return Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height)},o.WMTSGetCapabilities=ge,o.WMTSTerrain=Uu,o.WallGeoFeatureLayer=go,o.WaterGeoJsonFeatureLayer=Ch,o.WfsLayer=W,o.WorkerPool=de,o.billboardGeoJsonFeatureLayer=Ii,o.clone=function e(t,i){if(null===t||"object"!=typeof t)return t;i=X(i,!1);var o,r,n=new t.constructor;for(o in t)t.hasOwnProperty(o)&&(r=t[o],i&&(r=e(r,i)),n[o]=r);return n},o.configData=I,o.createGroup=Ei,o.curtaincontrast=wo,o.czmlPathAnimation=Dh,o.decode=un,o.defaultValue=X,o.deleteItem=Gh,o.demolition=br,o.depthTestAgainstTerrain=Qo,o.dynamicObject=k,o.execute=Zr,o.expandGroup=cm,o.export=Qh,o.findItem=kh,o.flyTo=Fi,o.flyToObj=Rh,o.getExitsObjectType=Yh,o.getItemName=Nh,o.getNextItem=Wh,o.getObject=Jh,o.getPosition=y,o.getVisibility=jh,o.gradientColor=me,o.indoormode=Eo,o.isGroup=Kh,o.jumpTo=Oh,o.license=function(i){return new Promise((t,e)=>{yn({type:"get",url:i+"/licenseEncryption/getLicenseSecret",success(e){yn({type:"post",url:i+"/licenseEncryption/getLicenseDecrypt",headers:{"Content-Type":"application/json"},data:JSON.stringify({data:e.data}),success(e){t(e.data)},error(){t({success:!1,message:"暂无许可权限"})}})},error(){t({success:!1,message:"暂无许可权限"})}})})},o.lineOfSight=Mr,o.lodash=C,o.main=nm,o.measure=Er,o.meshopt_decoder_module=Ae,o.northfinger=Bh,o.pako_inflate=ye,o.pbf_dev=Ni,o.position=pu,o.renameGroup=zh,o.setPosition=Vh,o.setVisibility=Uh,o.tdtwmtsimageprovider=vn,o.treeSource=V,o.uuid=wn,o.vectortile=uo,o.wall=fu,o.weather=Po,o.zoomIn=Lh,o.zoomOut=Mh,Object.defineProperty(o,"__esModule",{value:!0})}); |