cesium_dev_kit 1.1.23 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -120,7 +120,7 @@ void main(void)
120
120
  vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);
121
121
  out_FragColor = alphaBlend(finalFogColor, sceneColor);
122
122
  }
123
- `;return this._viewer.scene.postProcessStages.add(new e.PostProcessStage({fragmentShader:t,uniforms:{fogByDistance:new e.Cartesian4(10,0,200,.3),fogColor:e.Color.AZURE}}))}}setDefSceneConfig(){this._viewer&&(this._viewer.scene.sun.show=false,this._viewer.scene.moon.show=false,this._viewer.scene.fxaa=true,this._viewer.scene.globe.depthTestAgainstTerrain=true,this._viewer.scene.undergroundMode=false,this._viewer.scene.terrainProvider.isCreateSkirt=false,this._viewer.scene.skyAtmosphere.show=false,this._viewer.scene.globe.showGroundAtmosphere=false,this._viewer.scene.globe.enableLighting=true,this._viewer.scene.fog.enabled=false,this._viewer.cesiumWidget.creditContainer.style.display="none");}setBloomLightScene(){this._viewer&&(this._viewer.scene.postProcessStages.bloom.enabled=true,this._viewer.scene.postProcessStages.bloom.uniforms.contrast=119,this._viewer.scene.postProcessStages.bloom.uniforms.brightness=-0.4,this._viewer.scene.postProcessStages.bloom.uniforms.glowOnly=false,this._viewer.scene.postProcessStages.bloom.uniforms.delta=.9,this._viewer.scene.postProcessStages.bloom.uniforms.sigma=3.78,this._viewer.scene.postProcessStages.bloom.uniforms.stepSize=5,this._viewer.scene.postProcessStages.bloom.uniforms.isSelected=false);}removePostProcessStage(t){t&&(Array.isArray(t)?t.forEach(r=>{this._viewer.scene.postProcessStages.contains(r)&&this._viewer.scene.postProcessStages.remove(r);}):this._viewer.scene.postProcessStages.contains(t)&&this._viewer.scene.postProcessStages.remove(t));}setView(t){if(this._viewer&&t&&t.position){if(t.distance){var r=new e.Cartesian3(0,t.distance,window.opt.distance);t.position=e.Cartesian3.add(t.position,r,new e.Cartesian3);}this._viewer.scene.camera.setView({destination:t.position,orientation:t.orientation||{heading:e.Math.toRadians(90),pitch:e.Math.toRadians(90),roll:e.Math.toRadians(0)}});}}flyTo(t){if(this._viewer&&t&&t.position){if(t.distance){var r=new e.Cartesian3(0,t.distance,0);t.position=e.Cartesian3.add(t.position,r,new e.Cartesian3);}this._viewer.scene.camera.flyTo({destination:t.position,orientation:t.orientation||{heading:e.Math.toRadians(90),pitch:e.Math.toRadians(90),roll:e.Math.toRadians(0)},easingFunction:t.easingFunction||e.EasingFunction.LINEAR_NONE,duration:t.duration||3,complete:t.callback});}}transformCartesianToWGS84(t){var r,a,i;if(this._viewer&&t){if(t.x===void 0&&(t.lng!==void 0||t.lon!==void 0))return {lng:Number((r=t.lng)!=null?r:t.lon),lat:Number(t.lat),alt:Number((i=(a=t.alt)!=null?a:t.height)!=null?i:0)};let o=e.Cartographic.fromCartesian(t);return {lng:e.Math.toDegrees(o.longitude),lat:e.Math.toDegrees(o.latitude),alt:o.height}}}transformWGS84ArrayToCartesianArray(t,r){if(this._viewer&&t){var a=this;return t?t.map(function(i){return a.transformWGS84ToCartesian(i,r)}):[]}}transformWGS84ToCartesian(t,r){if(this._viewer)return t?e.Cartesian3.fromDegrees(t.lng||t.lon,t.lat,t.alt=r||t.alt,e.Ellipsoid.WGS84):e.Cartesian3.ZERO}transformCartesianArrayToWGS84Array(t){if(this._viewer){var r=this;return t?t.map(function(a){return r.transformCartesianToWGS84(a)}).filter(function(a){return !!a}):[]}}transformWGS84ToCartographic(t){return t?e.Cartographic.fromDegrees(t.lng||t.lon,t.lat,t.alt):e.Cartographic.ZERO}lnglatArrayToCartesians(t){if(!t||t.length<1)return [];let r=[];for(let a=0;a<t.length;a++){let i=e.Cartesian3.fromDegrees(Number(t[a][0]),Number(t[a][1]),Number(t[a][2]||0));r.push(i);}return r}setCameraEotateHeading(t){if(t){let r=this._viewer,a=e.Cartesian3.fromDegrees(t.lng,t.lat,t.height),i=e.Math.toRadians(-30),o=360/30,l=5e3,s=e.JulianDate.fromDate(new Date);r.clock.startTime=s.clone(),r.clock.currentTime=s.clone(),r.clock.clockRange=e.ClockRange.CLAMPED,r.clock.clockStep=e.ClockStep.SYSTEM_CLOCK;let c=r.camera.heading,n=function(){let y=e.JulianDate.secondsDifference(r.clock.currentTime,r.clock.startTime),d=e.Math.toRadians(y*o)+c;r.scene.camera.setView({destination:a,orientation:{heading:d,pitch:i}}),r.scene.camera.moveBackward(l),e.JulianDate.compare(r.clock.currentTime,r.clock.stopTime)>=0&&r.clock.onTick.removeEventListener(n);};r.clock.onTick.addEventListener(n),K(this,()=>{r.clock.onTick.removeEventListener(n);});}}getCatesian3FromPX(t){if(this._viewer&&t){var r=this._viewer.scene.pick(t),a=null,i=false,o=false;if(r instanceof e.Cesium3DTileFeature&&(i=true),i&&(a=this._viewer.scene.pickPosition(t),a)){let s=e.Cartographic.fromCartesian(a);s.height<0&&(s.height=0);let c=e.Math.toDegrees(s.longitude),n=e.Math.toDegrees(s.latitude),h=s.height;a=this.transformWGS84ToCartesian({lng:c,lat:n,alt:h});}if(!r){var l=this._viewer.scene.camera.getPickRay(t);if(!l)return null;a=this._viewer.scene.globe.pick(l,this._viewer.scene),o=true;}if(r&&!i&&(a=this._viewer.scene.pickPosition(t),a)){let s=e.Cartographic.fromCartesian(a);s.height<0&&(s.height=0);let c=e.Math.toDegrees(s.longitude),n=e.Math.toDegrees(s.latitude),h=s.height;a=this.transformWGS84ToCartesian({lng:c,lat:n,alt:h});}if(!i&&!o&&!r&&(a=this._viewer.scene.camera.pickEllipsoid(t,this._viewer.scene.globe.ellipsoid)),a){let s=this.transformCartesianToWGS84(a);return s.alt<0&&(a=this.transformWGS84ToCartesian(s,.1)),a}return false}}getCameraPosition(){if(this._viewer){var t=this._viewer.scene.camera.pickEllipsoid(new e.Cartesian2(this._viewer.canvas.clientWidth/2,this._viewer.canvas.clientHeight/2));if(t){var r=e.Ellipsoid.WGS84.cartesianToCartographic(t),a=r.longitude*180/Math.PI,i=r.latitude*180/Math.PI,o=this._viewer.camera._direction,l=e.Math.toDegrees(o.x),s=e.Math.toDegrees(o.y),c=e.Math.toDegrees(o.z),n=this._viewer.camera.positionCartographic.height,h=e.Math.toDegrees(this._viewer.camera.heading),y=e.Math.toDegrees(this._viewer.camera.pitch),d=e.Math.toDegrees(this._viewer.camera.roll),x=this._viewer.camera.computeViewRectangle(),p=x.west/Math.PI*180,f=x.north/Math.PI*180,k=x.east/Math.PI*180,S=x.south/Math.PI*180,_=(p+k)/2,M=(f+S)/2;return {lon:a,lat:i,height:n,heading:h,pitch:y,roll:d,position:this._viewer.camera.position,cameraHeading:this._viewer.camera.heading,cameraPitch:this._viewer.camera.pitch,cameraRoll:this._viewer.camera.roll,center:{x:_,y:M},direction:new e.Cartesian3(l,s,c)}}}}pickUpPosition(t){return this.getCatesian3FromPX(t.position)}getHandlerClickPosition(t){if(this._viewer){let r=this._viewer.scene,a=this._viewer,i=r.camera.pickEllipsoid(t.position,r.globe.elliposid),o={cameraPosistion:a.camera.position,heading:a.camera.heading,pitch:a.camera.pitch,roll:a.camera.roll},l=e.Cartographic.fromCartesian(i);l.height<0&&(l.height=0);let s={alt:l.height,lat:e.Math.toDegrees(l.latitude),lon:e.Math.toDegrees(l.longitude)},c=r.pickPosition(t.position),n=e.Cartographic.fromCartesian(c),h={height:n.height,latitude:e.Math.toDegrees(n.latitude),longitude:e.Math.toDegrees(n.longitude)};return {wgs84Coor:s,graphicCoor:h,cameraPosition:o}}}updateCameraState(t){this._viewer.scene._screenSpaceCameraController.enableRotate=t,this._viewer.scene._screenSpaceCameraController.enableTranslate=t,this._viewer.scene._screenSpaceCameraController.enableZoom=t,this._viewer.scene._screenSpaceCameraController.enableTilt=t,this._viewer.scene._screenSpaceCameraController.enableLook=t;}bindHandleEvent({leftClick:t,mouseMove:r,doubleClick:a,leftDown:i,mouseWheel:o,leftUp:l}){if(this._viewer){var s=new e.ScreenSpaceEventHandler(this._viewer.canvas);K(this,()=>{s&&!s.isDestroyed()&&s.destroy();}),t&&s.setInputAction(function(c){t(c,s);},e.ScreenSpaceEventType.LEFT_CLICK),r&&s.setInputAction(function(c){r(c,s);},e.ScreenSpaceEventType.MOUSE_MOVE),a&&s.setInputAction(function(c){a(c,s);},e.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),i&&s.setInputAction(function(c){i(c,s);},e.ScreenSpaceEventType.LEFT_DOWN),o&&s.setInputAction(function(c){o(c,s);},e.ScreenSpaceEventType.WHEEL),l&&s.setInputAction(function(c){l(c,s);},e.ScreenSpaceEventType.LEFT_UP);}}bindHandelEvent(t){return this.bindHandleEvent(t)}getHandlePosition(t){if(this._viewer){var r=new e.ScreenSpaceEventHandler(this._viewer.scene.canvas),a=this;K(this,()=>{r&&!r.isDestroyed()&&r.destroy();}),r.setInputAction(function(i){var o=a._viewer.scene.camera.pickEllipsoid(i.endPosition,a._viewer.scene.globe.ellipsoid);typeof t=="function"&&t(a.transformCartesianToWGS84(o),r);},e.ScreenSpaceEventType.MOUSE_MOVE);}}getHandelPosition(t){return this.getHandlePosition(t)}saveSceneImages(){if(this._viewer){let l=function(s){for(var c=s.split(","),n=c[0].match(/:(.*?);/)[1],h=atob(c[1]),y=h.length,d=new Uint8Array(y);y--;)d[y]=h.charCodeAt(y);return new Blob([d],{type:n})};var t=this._viewer.scene.canvas,r=t.toDataURL("image/png").replace("image/png","image/octet-stream"),a=document.createElement("a"),i=l(r),o=URL.createObjectURL(i);a.download="scene.png",a.href=o,a.click();}}_installAmapImageryProvider(){let t="https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",r="https://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}";function a(i){return i.url=i.style==="img"?t:r,i.subdomains||(i.subdomains=["01","02","03","04"]),new e.UrlTemplateImageryProvider(i)}e.Scene.AmapImageryProvider=a;}_installTdtImageryProvider(){let t="https://{s}.tianditu.gov.cn/{layer}_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER={layer}&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk={key}";function r(a){return new e.WebMapTileServiceImageryProvider({url:t.replace(/\{layer\}/g,a.style||"vec").replace(/\{key\}/g,a.key||""),layer:a.style+"_w",style:"default",format:"tiles",tileMatrixSetID:"GoogleMapsCompatible",subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"],minimumLevel:0,maximumLevel:18})}e.Scene.TdtImageryProvider=r;}_installTencentImageryProvider(){let t="https://p2.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=229",r="https://rt3.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&type=vector&styleid=1";function a(i){return i.layer==="img"?(i.url||(i.url=t),i.subdomains||(i.subdomains=["0","1","2"]),i.customTags={sx(o,l,s,c){return l>>4},sy(o,l,s,c){return (1<<c)-s>>4}}):i.url||(i.url=r),new e.UrlTemplateImageryProvider(i)}e.Scene.TencentImageryProvider=a;}_installGoogleImageryProvider(){let t="https://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile",r="https://mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali",a="https://mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile";function i(o){return o.url=o.style==="img"?r:o.style==="ter"?a:t,o.subdomains||(o.subdomains=["1","2","3","4","5"]),new e.UrlTemplateImageryProvider(o)}e.Scene.GoogleImageryProvider=i;}_installGooGleImageryProvider(){return this._installGoogleImageryProvider()}_installBaiduImageryProvider(){var t="https://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}";function r(i){t=i.url||t,this._url=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._minimumLevel=1,this._tilingScheme=new e.WebMercatorTilingScheme({rectangleSouthwestInMeters:new e.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new e.Cartesian2(33554054,33746824)}),this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=i.style||"normal",this._ready=true;}Object.defineProperties(r.prototype,{url:{get(){return this._url}},token:{get(){return this._token}},tileWidth:{get(){if(!this.ready)throw new e.DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get(){if(!this.ready)throw new e.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get(){if(!this.ready)throw new e.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},minimumLevel:{get(){if(!this.ready)throw new e.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get(){if(!this.ready)throw new e.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get(){if(!this.ready)throw new e.DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},ready:{get(){return !!this._url}},credit:{get(){return this._credit}},readyPromise:{get(){return this._readyPromise.promise}},usingPrecachedTiles:{get(){return this._useTiles}},hasAlphaChannel:{get(){return true}},layers:{get(){return this._layers}}});function a(i,o,l,s,c){var n=i._url+"&x={x}&y={y}&z={z}&customid={style}",h=i._tilingScheme.getNumberOfXTilesAtLevel(s),y=i._tilingScheme.getNumberOfYTilesAtLevel(s);return n=n.replace("{x}",String(o-h/2)).replace("{y}",String(y/2-l-1)).replace("{z}",String(s)).replace("{style}",c),n}r.prototype.getTileCredits=function(i,o,l){},r.prototype.requestImage=function(i,o,l){if(!this.ready)throw new e.DeveloperError("requestImage must not be called before the imagery provider is ready.");var s=a(this,i,o,l,this._style);return e.ImageryProvider.loadImage(this,s)},e.Scene.BaiduImageryProvider=r;}_installGroundSkyBox(){var t=e.BoxGeometry,r=e.Cartesian3,a=e.defaultValue||Z,i=e.defined,o=e.destroyObject,l=e.DeveloperError,s=e.GeometryPipeline,c=e.Matrix3,n=e.Matrix4,h=e.Transforms,y=e.VertexFormat,d=e.BufferUsage,x=e.CubeMap,p=e.DrawCommand,f=e.loadCubeMap,k=e.RenderState,S=e.VertexArray,_=e.BlendingState,M=e.SceneMode,C=e.ShaderProgram,P=e.ShaderSource,A=`uniform samplerCube u_cubeMap;
123
+ `;return this._viewer.scene.postProcessStages.add(new e.PostProcessStage({fragmentShader:t,uniforms:{fogByDistance:new e.Cartesian4(10,0,200,.3),fogColor:e.Color.AZURE}}))}}setDefSceneConfig(){this._viewer&&(this._viewer.scene.sun.show=false,this._viewer.scene.moon.show=false,this._viewer.scene.fxaa=true,this._viewer.scene.globe.depthTestAgainstTerrain=true,this._viewer.scene.undergroundMode=false,this._viewer.scene.terrainProvider.isCreateSkirt=false,this._viewer.scene.skyAtmosphere.show=false,this._viewer.scene.globe.showGroundAtmosphere=false,this._viewer.scene.globe.enableLighting=true,this._viewer.scene.fog.enabled=false,this._viewer.cesiumWidget.creditContainer.style.display="none");}setBloomLightScene(){this._viewer&&(this._viewer.scene.postProcessStages.bloom.enabled=true,this._viewer.scene.postProcessStages.bloom.uniforms.contrast=119,this._viewer.scene.postProcessStages.bloom.uniforms.brightness=-0.4,this._viewer.scene.postProcessStages.bloom.uniforms.glowOnly=false,this._viewer.scene.postProcessStages.bloom.uniforms.delta=.9,this._viewer.scene.postProcessStages.bloom.uniforms.sigma=3.78,this._viewer.scene.postProcessStages.bloom.uniforms.stepSize=5,this._viewer.scene.postProcessStages.bloom.uniforms.isSelected=false);}removePostProcessStage(t){t&&(Array.isArray(t)?t.forEach(r=>{this._viewer.scene.postProcessStages.contains(r)&&this._viewer.scene.postProcessStages.remove(r);}):this._viewer.scene.postProcessStages.contains(t)&&this._viewer.scene.postProcessStages.remove(t));}setView(t){if(this._viewer&&t&&t.position){if(t.distance){var r=new e.Cartesian3(0,t.distance,window.opt.distance);t.position=e.Cartesian3.add(t.position,r,new e.Cartesian3);}this._viewer.scene.camera.setView({destination:t.position,orientation:t.orientation||{heading:e.Math.toRadians(90),pitch:e.Math.toRadians(90),roll:e.Math.toRadians(0)}});}}flyTo(t){if(this._viewer&&t&&t.position){if(t.distance){var r=new e.Cartesian3(0,t.distance,0);t.position=e.Cartesian3.add(t.position,r,new e.Cartesian3);}this._viewer.scene.camera.flyTo({destination:t.position,orientation:t.orientation||{heading:e.Math.toRadians(90),pitch:e.Math.toRadians(90),roll:e.Math.toRadians(0)},easingFunction:t.easingFunction||e.EasingFunction.LINEAR_NONE,duration:t.duration||3,complete:t.callback});}}transformCartesianToWGS84(t){var r,a,i;if(this._viewer&&t){if(t.x===void 0&&(t.lng!==void 0||t.lon!==void 0))return {lng:Number((r=t.lng)!=null?r:t.lon),lat:Number(t.lat),alt:Number((i=(a=t.alt)!=null?a:t.height)!=null?i:0)};let o=e.Cartographic.fromCartesian(t);return {lng:e.Math.toDegrees(o.longitude),lat:e.Math.toDegrees(o.latitude),alt:o.height}}}transformWGS84ArrayToCartesianArray(t,r){if(this._viewer&&t){var a=this;return t?t.map(function(i){return a.transformWGS84ToCartesian(i,r)}):[]}}transformWGS84ToCartesian(t,r){if(this._viewer)return t?e.Cartesian3.fromDegrees(t.lng||t.lon,t.lat,t.alt=r||t.alt,e.Ellipsoid.WGS84):e.Cartesian3.ZERO}transformCartesianArrayToWGS84Array(t){if(this._viewer){var r=this;return t?t.map(function(a){return r.transformCartesianToWGS84(a)}).filter(function(a){return !!a}):[]}}transformWGS84ToCartographic(t){return t?e.Cartographic.fromDegrees(t.lng||t.lon,t.lat,t.alt):e.Cartographic.ZERO}lnglatArrayToCartesians(t){if(!t||t.length<1)return [];let r=[];for(let a=0;a<t.length;a++){let i=e.Cartesian3.fromDegrees(Number(t[a][0]),Number(t[a][1]),Number(t[a][2]||0));r.push(i);}return r}setCameraEotateHeading(t){if(t){let r=this._viewer,a=e.Cartesian3.fromDegrees(t.lng,t.lat,t.height),i=e.Math.toRadians(-30),o=360/30,l=5e3,s=e.JulianDate.fromDate(new Date);r.clock.startTime=s.clone(),r.clock.currentTime=s.clone(),r.clock.clockRange=e.ClockRange.CLAMPED,r.clock.clockStep=e.ClockStep.SYSTEM_CLOCK;let c=r.camera.heading,n=function(){let y=e.JulianDate.secondsDifference(r.clock.currentTime,r.clock.startTime),d=e.Math.toRadians(y*o)+c;r.scene.camera.setView({destination:a,orientation:{heading:d,pitch:i}}),r.scene.camera.moveBackward(l),e.JulianDate.compare(r.clock.currentTime,r.clock.stopTime)>=0&&r.clock.onTick.removeEventListener(n);};r.clock.onTick.addEventListener(n),K(this,()=>{r.clock.onTick.removeEventListener(n);});}}getCatesian3FromPX(t){if(this._viewer&&t){var r=this._viewer.scene.pick(t),a=null,i=false,o=false;if(r instanceof e.Cesium3DTileFeature&&(i=true),i&&(a=this._viewer.scene.pickPosition(t),a)){let s=e.Cartographic.fromCartesian(a);s.height<0&&(s.height=0);let c=e.Math.toDegrees(s.longitude),n=e.Math.toDegrees(s.latitude),h=s.height;a=this.transformWGS84ToCartesian({lng:c,lat:n,alt:h});}if(!r){var l=this._viewer.scene.camera.getPickRay(t);if(!l)return null;a=this._viewer.scene.globe.pick(l,this._viewer.scene),o=true;}if(r&&!i&&(a=this._viewer.scene.pickPosition(t),a)){let s=e.Cartographic.fromCartesian(a);s.height<0&&(s.height=0);let c=e.Math.toDegrees(s.longitude),n=e.Math.toDegrees(s.latitude),h=s.height;a=this.transformWGS84ToCartesian({lng:c,lat:n,alt:h});}if(!i&&!o&&!r&&(a=this._viewer.scene.camera.pickEllipsoid(t,this._viewer.scene.globe.ellipsoid)),a){let s=this.transformCartesianToWGS84(a);return s.alt<0&&(a=this.transformWGS84ToCartesian(s,.1)),a}return false}}getCameraPosition(){if(this._viewer){var t=this._viewer.scene.camera.pickEllipsoid(new e.Cartesian2(this._viewer.canvas.clientWidth/2,this._viewer.canvas.clientHeight/2));if(t){var r=e.Ellipsoid.WGS84.cartesianToCartographic(t),a=r.longitude*180/Math.PI,i=r.latitude*180/Math.PI,o=this._viewer.camera._direction,l=e.Math.toDegrees(o.x),s=e.Math.toDegrees(o.y),c=e.Math.toDegrees(o.z),n=this._viewer.camera.positionCartographic.height,h=e.Math.toDegrees(this._viewer.camera.heading),y=e.Math.toDegrees(this._viewer.camera.pitch),d=e.Math.toDegrees(this._viewer.camera.roll),x=this._viewer.camera.computeViewRectangle(),p=x.west/Math.PI*180,f=x.north/Math.PI*180,E=x.east/Math.PI*180,S=x.south/Math.PI*180,_=(p+E)/2,M=(f+S)/2;return {lon:a,lat:i,height:n,heading:h,pitch:y,roll:d,position:this._viewer.camera.position,cameraHeading:this._viewer.camera.heading,cameraPitch:this._viewer.camera.pitch,cameraRoll:this._viewer.camera.roll,center:{x:_,y:M},direction:new e.Cartesian3(l,s,c)}}}}pickUpPosition(t){return this.getCatesian3FromPX(t.position)}getHandlerClickPosition(t){if(this._viewer){let r=this._viewer.scene,a=this._viewer,i=r.camera.pickEllipsoid(t.position,r.globe.elliposid),o={cameraPosistion:a.camera.position,heading:a.camera.heading,pitch:a.camera.pitch,roll:a.camera.roll},l=e.Cartographic.fromCartesian(i);l.height<0&&(l.height=0);let s={alt:l.height,lat:e.Math.toDegrees(l.latitude),lon:e.Math.toDegrees(l.longitude)},c=r.pickPosition(t.position),n=e.Cartographic.fromCartesian(c),h={height:n.height,latitude:e.Math.toDegrees(n.latitude),longitude:e.Math.toDegrees(n.longitude)};return {wgs84Coor:s,graphicCoor:h,cameraPosition:o}}}updateCameraState(t){this._viewer.scene._screenSpaceCameraController.enableRotate=t,this._viewer.scene._screenSpaceCameraController.enableTranslate=t,this._viewer.scene._screenSpaceCameraController.enableZoom=t,this._viewer.scene._screenSpaceCameraController.enableTilt=t,this._viewer.scene._screenSpaceCameraController.enableLook=t;}bindHandleEvent({leftClick:t,mouseMove:r,doubleClick:a,leftDown:i,mouseWheel:o,leftUp:l}){if(this._viewer){var s=new e.ScreenSpaceEventHandler(this._viewer.canvas);K(this,()=>{s&&!s.isDestroyed()&&s.destroy();}),t&&s.setInputAction(function(c){t(c,s);},e.ScreenSpaceEventType.LEFT_CLICK),r&&s.setInputAction(function(c){r(c,s);},e.ScreenSpaceEventType.MOUSE_MOVE),a&&s.setInputAction(function(c){a(c,s);},e.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),i&&s.setInputAction(function(c){i(c,s);},e.ScreenSpaceEventType.LEFT_DOWN),o&&s.setInputAction(function(c){o(c,s);},e.ScreenSpaceEventType.WHEEL),l&&s.setInputAction(function(c){l(c,s);},e.ScreenSpaceEventType.LEFT_UP);}}bindHandelEvent(t){return this.bindHandleEvent(t)}getHandlePosition(t){if(this._viewer){var r=new e.ScreenSpaceEventHandler(this._viewer.scene.canvas),a=this;K(this,()=>{r&&!r.isDestroyed()&&r.destroy();}),r.setInputAction(function(i){var o=a._viewer.scene.camera.pickEllipsoid(i.endPosition,a._viewer.scene.globe.ellipsoid);typeof t=="function"&&t(a.transformCartesianToWGS84(o),r);},e.ScreenSpaceEventType.MOUSE_MOVE);}}getHandelPosition(t){return this.getHandlePosition(t)}saveSceneImages(){if(this._viewer){let l=function(s){for(var c=s.split(","),n=c[0].match(/:(.*?);/)[1],h=atob(c[1]),y=h.length,d=new Uint8Array(y);y--;)d[y]=h.charCodeAt(y);return new Blob([d],{type:n})};var t=this._viewer.scene.canvas,r=t.toDataURL("image/png").replace("image/png","image/octet-stream"),a=document.createElement("a"),i=l(r),o=URL.createObjectURL(i);a.download="scene.png",a.href=o,a.click();}}_installAmapImageryProvider(){let t="https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",r="https://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}";function a(i){return i.url=i.style==="img"?t:r,i.subdomains||(i.subdomains=["01","02","03","04"]),new e.UrlTemplateImageryProvider(i)}e.Scene.AmapImageryProvider=a;}_installTdtImageryProvider(){let t="https://{s}.tianditu.gov.cn/{layer}_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER={layer}&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk={key}";function r(a){return new e.WebMapTileServiceImageryProvider({url:t.replace(/\{layer\}/g,a.style||"vec").replace(/\{key\}/g,a.key||""),layer:a.style+"_w",style:"default",format:"tiles",tileMatrixSetID:"GoogleMapsCompatible",subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"],minimumLevel:0,maximumLevel:18})}e.Scene.TdtImageryProvider=r;}_installTencentImageryProvider(){let t="https://p2.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=229",r="https://rt3.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&type=vector&styleid=1";function a(i){return i.layer==="img"?(i.url||(i.url=t),i.subdomains||(i.subdomains=["0","1","2"]),i.customTags={sx(o,l,s,c){return l>>4},sy(o,l,s,c){return (1<<c)-s>>4}}):i.url||(i.url=r),new e.UrlTemplateImageryProvider(i)}e.Scene.TencentImageryProvider=a;}_installGoogleImageryProvider(){let t="https://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile",r="https://mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali",a="https://mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile";function i(o){return o.url=o.style==="img"?r:o.style==="ter"?a:t,o.subdomains||(o.subdomains=["1","2","3","4","5"]),new e.UrlTemplateImageryProvider(o)}e.Scene.GoogleImageryProvider=i;}_installGooGleImageryProvider(){return this._installGoogleImageryProvider()}_installBaiduImageryProvider(){var t="https://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}";function r(i){t=i.url||t,this._url=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._minimumLevel=1,this._tilingScheme=new e.WebMercatorTilingScheme({rectangleSouthwestInMeters:new e.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new e.Cartesian2(33554054,33746824)}),this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=i.style||"normal",this._ready=true;}Object.defineProperties(r.prototype,{url:{get(){return this._url}},token:{get(){return this._token}},tileWidth:{get(){if(!this.ready)throw new e.DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get(){if(!this.ready)throw new e.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get(){if(!this.ready)throw new e.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},minimumLevel:{get(){if(!this.ready)throw new e.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get(){if(!this.ready)throw new e.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get(){if(!this.ready)throw new e.DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},ready:{get(){return !!this._url}},credit:{get(){return this._credit}},readyPromise:{get(){return this._readyPromise.promise}},usingPrecachedTiles:{get(){return this._useTiles}},hasAlphaChannel:{get(){return true}},layers:{get(){return this._layers}}});function a(i,o,l,s,c){var n=i._url+"&x={x}&y={y}&z={z}&customid={style}",h=i._tilingScheme.getNumberOfXTilesAtLevel(s),y=i._tilingScheme.getNumberOfYTilesAtLevel(s);return n=n.replace("{x}",String(o-h/2)).replace("{y}",String(y/2-l-1)).replace("{z}",String(s)).replace("{style}",c),n}r.prototype.getTileCredits=function(i,o,l){},r.prototype.requestImage=function(i,o,l){if(!this.ready)throw new e.DeveloperError("requestImage must not be called before the imagery provider is ready.");var s=a(this,i,o,l,this._style);return e.ImageryProvider.loadImage(this,s)},e.Scene.BaiduImageryProvider=r;}_installGroundSkyBox(){var t=e.BoxGeometry,r=e.Cartesian3,a=e.defaultValue||Z,i=e.defined,o=e.destroyObject,l=e.DeveloperError,s=e.GeometryPipeline,c=e.Matrix3,n=e.Matrix4,h=e.Transforms,y=e.VertexFormat,d=e.BufferUsage,x=e.CubeMap,p=e.DrawCommand,f=e.loadCubeMap,E=e.RenderState,S=e.VertexArray,_=e.BlendingState,M=e.SceneMode,C=e.ShaderProgram,P=e.ShaderSource,A=`uniform samplerCube u_cubeMap;
124
124
  in vec3 v_texCoord;
125
125
  void main()
126
126
  {
@@ -136,7 +136,7 @@ void main(void)
136
136
  gl_Position = czm_projection * vec4(p, 1.0);
137
137
  v_texCoord = position.xyz;
138
138
  }
139
- `,D=typeof n.getRotation=="function"?n.getRotation.bind(n):n.getMatrix3.bind(n);function I(T){this.sources=T.sources,this._sources=void 0,this.show=a(T.show,true),this._command=new p({modelMatrix:n.clone(n.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0;}var E=new c;I.prototype.update=function(T,O){var F=this;if(this.show&&!(T.mode!==M.SCENE3D&&T.mode!==M.MORPHING)&&T.passes.render){var G=T.context;if(this._sources!==this.sources){this._sources=this.sources;var B=this.sources;if(!i(B.positiveX)||!i(B.negativeX)||!i(B.positiveY)||!i(B.negativeY)||!i(B.positiveZ)||!i(B.negativeZ))throw new l("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof B.positiveX!=typeof B.negativeX||typeof B.positiveX!=typeof B.positiveY||typeof B.positiveX!=typeof B.negativeY||typeof B.positiveX!=typeof B.positiveZ||typeof B.positiveX!=typeof B.negativeZ)throw new l("this.sources properties must all be the same type.");typeof B.positiveX=="string"?f(G,this._sources).then(function(w){F._cubeMap=F._cubeMap&&F._cubeMap.destroy(),F._cubeMap=w;}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new x({context:G,source:B}));}var L=this._command;if(L.modelMatrix=h.eastNorthUpToFixedFrame(T.camera._positionWC),!i(L.vertexArray)){L.uniformMap={u_cubeMap(){return F._cubeMap},u_rotateMatrix(){return D(L.modelMatrix,E)}};var U=t.createGeometry(t.fromDimensions({dimensions:new r(2,2,2),vertexFormat:y.POSITION_ONLY})),j=this._attributeLocations=s.createAttributeLocations(U);L.vertexArray=S.fromGeometry({context:G,geometry:U,attributeLocations:j,bufferUsage:d._DRAW}),L.renderState=k.fromCache({blending:_.ALPHA_BLEND});}if(!i(L.shaderProgram)||this._useHdr!==O){var v=new P({defines:[O?"HDR":""],sources:[A]});L.shaderProgram=C.fromCache({context:G,vertexShaderSource:b,fragmentShaderSource:v,attributeLocations:this._attributeLocations}),this._useHdr=O;}if(i(this._cubeMap))return L}},I.prototype.isDestroyed=function(){return false},I.prototype.destroy=function(){var T=this._command;return T.vertexArray=T.vertexArray&&T.vertexArray.destroy(),T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),o(this)},e.Scene.GroundSkyBox=I;}removeHandlerByName(t=[]){t.forEach(r=>{this._viewer.screenSpaceEventHandler.removeInputAction(e.ScreenSpaceEventType[r]);});}}return g}var ie=$(_e);function xe(e,u,g,m){function t(r,a){let i={},o=q(a),l=[];if(Array.isArray(r))r.forEach(c=>{let n=q(c),h=new n(e,u,g,m);s(n,o),l.push(h);}),i=new o(e,u,g,m),l.forEach(c=>Object.assign(i,c)),l.forEach(c=>Q(c,i));else {let c=q(r),n=new c(e,u,g,m);s(c,o),i=new o(e,u,g,m),Object.assign(i,n),Q(n,i);}function s(c,n){let h=Object.getOwnPropertyNames(c.prototype);for(let y=0,d=h.length;y<d;y++)h[y]!=="constructor"&&(n.prototype[h[y]]=c.prototype[h[y]]);}return i}return t}function we({cesiumGlobal:e,threeGlobal:u,containerId:g,threeContainerId:m,viewerConfig:t={},extraConfig:r={},MapImageryList:a=[],defaultStatic:i,baseExtendsCom:o=[],extendsCom:l,extendsComName:s,viewer:c}){if(!e)throw new H("MISSING_CESIUM","\u7F3A\u5C11 Cesium \u5168\u5C40\u5BF9\u8C61\uFF0C\u8BF7\u4F20\u5165 cesiumGlobal\uFF08\u6216\u522B\u540D Cesium\uFF09\u3002");if(!g&&!c)throw new H("MISSING_VIEWER","\u7F3A\u5C11 containerId \u6216 viewer\uFF1A\u8BF7\u4F20\u5165\u6302\u8F7D\u5BB9\u5668 id\uFF0C\u6216\u76F4\u63A5\u4F20\u5165\u5DF2\u521B\u5EFA\u7684 viewer\u3002");let h=new W(e).init({containerId:g,viewerConfig:t,extraConfig:r,MapImageryList:a,viewer:c}),y=!c,p=xe(h,e,i,u?{threeGlobal:u,containerId:g,threeContainerId:m}:"")(o,l),f=false;return {viewer:h,[s]:p,dispose:()=>{if(!f){f=true;try{typeof p.destroy=="function"?p.destroy():ee(p);}catch(k){X(k,{scope:"singleImport.dispose"});}y&&oe(h);}}}}function se(e,u,g){function m(t){return we({...t,baseExtendsCom:e,extendsCom:u,extendsComName:g})}return m}var Se=`in vec3 position3DHigh;
139
+ `,D=typeof n.getRotation=="function"?n.getRotation.bind(n):n.getMatrix3.bind(n);function I(T){this.sources=T.sources,this._sources=void 0,this.show=a(T.show,true),this._command=new p({modelMatrix:n.clone(n.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0;}var k=new c;I.prototype.update=function(T,O){var F=this;if(this.show&&!(T.mode!==M.SCENE3D&&T.mode!==M.MORPHING)&&T.passes.render){var G=T.context;if(this._sources!==this.sources){this._sources=this.sources;var B=this.sources;if(!i(B.positiveX)||!i(B.negativeX)||!i(B.positiveY)||!i(B.negativeY)||!i(B.positiveZ)||!i(B.negativeZ))throw new l("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof B.positiveX!=typeof B.negativeX||typeof B.positiveX!=typeof B.positiveY||typeof B.positiveX!=typeof B.negativeY||typeof B.positiveX!=typeof B.positiveZ||typeof B.positiveX!=typeof B.negativeZ)throw new l("this.sources properties must all be the same type.");typeof B.positiveX=="string"?f(G,this._sources).then(function(w){F._cubeMap=F._cubeMap&&F._cubeMap.destroy(),F._cubeMap=w;}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new x({context:G,source:B}));}var L=this._command;if(L.modelMatrix=h.eastNorthUpToFixedFrame(T.camera._positionWC),!i(L.vertexArray)){L.uniformMap={u_cubeMap(){return F._cubeMap},u_rotateMatrix(){return D(L.modelMatrix,k)}};var U=t.createGeometry(t.fromDimensions({dimensions:new r(2,2,2),vertexFormat:y.POSITION_ONLY})),j=this._attributeLocations=s.createAttributeLocations(U);L.vertexArray=S.fromGeometry({context:G,geometry:U,attributeLocations:j,bufferUsage:d._DRAW}),L.renderState=E.fromCache({blending:_.ALPHA_BLEND});}if(!i(L.shaderProgram)||this._useHdr!==O){var v=new P({defines:[O?"HDR":""],sources:[A]});L.shaderProgram=C.fromCache({context:G,vertexShaderSource:b,fragmentShaderSource:v,attributeLocations:this._attributeLocations}),this._useHdr=O;}if(i(this._cubeMap))return L}},I.prototype.isDestroyed=function(){return false},I.prototype.destroy=function(){var T=this._command;return T.vertexArray=T.vertexArray&&T.vertexArray.destroy(),T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),o(this)},e.Scene.GroundSkyBox=I;}removeHandlerByName(t=[]){t.forEach(r=>{this._viewer.screenSpaceEventHandler.removeInputAction(e.ScreenSpaceEventType[r]);});}}return g}var ie=$(_e);function xe(e,u,g,m){function t(r,a){let i={},o=q(a),l=[];if(Array.isArray(r))r.forEach(c=>{let n=q(c),h=new n(e,u,g,m);s(n,o),l.push(h);}),i=new o(e,u,g,m),l.forEach(c=>Object.assign(i,c)),l.forEach(c=>Q(c,i));else {let c=q(r),n=new c(e,u,g,m);s(c,o),i=new o(e,u,g,m),Object.assign(i,n),Q(n,i);}function s(c,n){let h=Object.getOwnPropertyNames(c.prototype);for(let y=0,d=h.length;y<d;y++)h[y]!=="constructor"&&(n.prototype[h[y]]=c.prototype[h[y]]);}return i}return t}function we({cesiumGlobal:e,threeGlobal:u,containerId:g,threeContainerId:m,viewerConfig:t={},extraConfig:r={},MapImageryList:a=[],defaultStatic:i,baseExtendsCom:o=[],extendsCom:l,extendsComName:s,viewer:c}){if(!e)throw new H("MISSING_CESIUM","\u7F3A\u5C11 Cesium \u5168\u5C40\u5BF9\u8C61\uFF0C\u8BF7\u4F20\u5165 cesiumGlobal\uFF08\u6216\u522B\u540D Cesium\uFF09\u3002");if(!g&&!c)throw new H("MISSING_VIEWER","\u7F3A\u5C11 containerId \u6216 viewer\uFF1A\u8BF7\u4F20\u5165\u6302\u8F7D\u5BB9\u5668 id\uFF0C\u6216\u76F4\u63A5\u4F20\u5165\u5DF2\u521B\u5EFA\u7684 viewer\u3002");let h=new W(e).init({containerId:g,viewerConfig:t,extraConfig:r,MapImageryList:a,viewer:c}),y=!c,p=xe(h,e,i,u?{threeGlobal:u,containerId:g,threeContainerId:m}:"")(o,l),f=false;return {viewer:h,[s]:p,dispose:()=>{if(!f){f=true;try{typeof p.destroy=="function"?p.destroy():ee(p);}catch(E){X(E,{scope:"singleImport.dispose"});}y&&oe(h);}}}}function se(e,u,g){function m(t){return we({...t,baseExtendsCom:e,extendsCom:u,extendsComName:g})}return m}var Se=`in vec3 position3DHigh;
140
140
  in vec3 position3DLow;
141
141
  in float batchId;
142
142
  in vec3 position;
@@ -207,7 +207,7 @@ void main() {
207
207
  vec4 mixColor = vec4(mix(vec4(ratio), centerColor, ratio));
208
208
  out_FragColor = vec4(mix(wenli, mixColor, ratio));
209
209
  }
210
- `,le=Ce;var be=function(){var e={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},u=(function(){var o=function(c){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=c.xField||c.defaultXField,this._yField=c.yField||c.defaultYField,this._valueField=c.valueField||c.defaultValueField,c.radius&&(this._cfgRadius=c.radius);},l=e.defaultRadius;return o.prototype={_organiseData:function(s,c){var n=s[this._xField],h=s[this._yField],y=this._radi,d=this._data,x=this._max,p=this._min,f=s[this._valueField]||1,k=s.radius||this._cfgRadius||l;return d[n]||(d[n]=[],y[n]=[]),d[n][h]?d[n][h]+=f:(d[n][h]=f,y[n][h]=k),d[n][h]>x?(c?this.setDataMax(d[n][h]):this._max=d[n][h],false):{x:n,y:h,value:f,radius:k,min:p,max:x}},_unOrganizeData:function(){var s=[],c=this._data,n=this._radi;for(var h in c)for(var y in c[h])s.push({x:h,y,radius:n[h][y],value:c[h][y]});return {min:this._min,max:this._max,data:s}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max});},addData:function(){if(arguments[0].length>0)for(var s=arguments[0],c=s.length;c--;)this.addData.call(this,s[c]);else {var n=this._organiseData(arguments[0],true);n&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[n]});}return this},setData:function(s){var c=s.data,n=c.length;this._data=[],this._radi=[];for(var h=0;h<n;h++)this._organiseData(c[h],false);return this._max=s.max,this._min=s.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(s){return this._max=s,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(s){return this._min=s,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(s){this._coordinator=s;},_getInternalData:function(){return {max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},o})(),g=(function(){var o=function(n){var h=n.gradient||n.defaultGradient,y=document.createElement("canvas"),d=y.getContext("2d");y.width=256,y.height=1;var x=d.createLinearGradient(0,0,256,1);for(var p in h)x.addColorStop(p,h[p]);return d.fillStyle=x,d.fillRect(0,0,256,1),d.getImageData(0,0,256,1).data},l=function(n,h){var y=document.createElement("canvas"),d=y.getContext("2d"),x=n,p=n;if(y.width=y.height=n*2,h==1)d.beginPath(),d.arc(x,p,n,0,2*Math.PI,false),d.fillStyle="rgba(0,0,0,1)",d.fill();else {var f=d.createRadialGradient(x,p,n*h,x,p,n);f.addColorStop(0,"rgba(0,0,0,1)"),f.addColorStop(1,"rgba(0,0,0,0)"),d.fillStyle=f,d.fillRect(0,0,2*n,2*n);}return y},s=function(p){for(var h=[],y=p.min,d=p.max,x=p.radi,p=p.data,f=Object.keys(p),k=f.length;k--;)for(var S=f[k],_=Object.keys(p[S]),M=_.length;M--;){var C=_[M],P=p[S][C],A=x[S][C];h.push({x:S,y:C,value:P,radius:A});}return {min:y,max:d,data:h}};function c(n){var h=n.container,y=this.shadowCanvas=document.createElement("canvas"),d=this.canvas=n.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0];var p=getComputedStyle(n.container)||{};d.className="heatmap-canvas",this._width=d.width=y.width=n.width||+p.width.replace(/px/,""),this._height=d.height=y.height=n.height||+p.height.replace(/px/,""),this.shadowCtx=y.getContext("2d"),this.ctx=d.getContext("2d"),d.style.cssText=y.style.cssText="position:absolute;left:0;top:0;",h.style.position="relative",h.appendChild(d),this._palette=o(n),this._templates={},this._setStyles(n);}return c.prototype={renderPartial:function(n){n.data.length>0&&(this._drawAlpha(n),this._colorize());},renderAll:function(n){this._clear(),n.data.length>0&&(this._drawAlpha(s(n)),this._colorize());},_updateGradient:function(n){this._palette=o(n);},updateConfig:function(n){n.gradient&&this._updateGradient(n),this._setStyles(n);},setDimensions:function(n,h){this._width=n,this._height=h,this.canvas.width=this.shadowCanvas.width=n,this.canvas.height=this.shadowCanvas.height=h;},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height);},_setStyles:function(n){this._blur=n.blur==0?0:n.blur||n.defaultBlur,n.backgroundColor&&(this.canvas.style.backgroundColor=n.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=n.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=n.height||this._height,this._opacity=(n.opacity||0)*255,this._maxOpacity=(n.maxOpacity||n.defaultMaxOpacity)*255,this._minOpacity=(n.minOpacity||n.defaultMinOpacity)*255,this._useGradientOpacity=!!n.useGradientOpacity;},_drawAlpha:function(d){for(var h=this._min=d.min,y=this._max=d.max,d=d.data||[],x=d.length,p=1-this._blur;x--;){var f=d[x],k=f.x,S=f.y,_=f.radius,M=Math.min(f.value,y),C=k-_,P=S-_,A=this.shadowCtx,b;this._templates[_]?b=this._templates[_]:this._templates[_]=b=l(_,p);var D=(M-h)/(y-h);A.globalAlpha=D<.01?.01:D,A.drawImage(b,C,P),C<this._renderBoundaries[0]&&(this._renderBoundaries[0]=C),P<this._renderBoundaries[1]&&(this._renderBoundaries[1]=P),C+2*_>this._renderBoundaries[2]&&(this._renderBoundaries[2]=C+2*_),P+2*_>this._renderBoundaries[3]&&(this._renderBoundaries[3]=P+2*_);}},_colorize:function(){var n=this._renderBoundaries[0],h=this._renderBoundaries[1],y=this._renderBoundaries[2]-n,d=this._renderBoundaries[3]-h,x=this._width,p=this._height,f=this._opacity,k=this._maxOpacity,S=this._minOpacity,_=this._useGradientOpacity;n<0&&(n=0),h<0&&(h=0),n+y>x&&(y=x-n),h+d>p&&(d=p-h);for(var M=this.shadowCtx.getImageData(n,h,y,d),C=M.data,P=C.length,A=this._palette,b=3;b<P;b+=4){var D=C[b],I=D*4;if(I){var E;f>0?E=f:D<k?D<S?E=S:E=D:E=k,C[b-3]=A[I],C[b-2]=A[I+1],C[b-1]=A[I+2],C[b]=_?A[I+3]:E;}}this.ctx.putImageData(M,n,h),this._renderBoundaries=[1e3,1e3,0,0];},getValueAt:function(n){var h,y=this.shadowCtx,d=y.getImageData(n.x,n.y,1,1),x=d.data[3],p=this._max,f=this._min;return h=Math.abs(p-f)*(x/255)>>0,h},getDataURL:function(){return this.canvas.toDataURL()}},c})(),m=(function(){var o=false;return e.defaultRenderer==="canvas2d"&&(o=g),o})(),t={merge:function(){for(var i={},o=arguments.length,l=0;l<o;l++){var s=arguments[l];for(var c in s)i[c]=s[c];}return i}},r=(function(){var o=(function(){function n(){this.cStore={};}return n.prototype={on:function(h,y,d){var x=this.cStore;x[h]||(x[h]=[]),x[h].push(function(p){return y.call(d,p)});},emit:function(h,y){var d=this.cStore;if(d[h])for(var x=d[h].length,p=0;p<x;p++){var f=d[h][p];f(y);}}},n})(),l=function(c){var n=c._renderer,h=c._coordinator,y=c._store;h.on("renderpartial",n.renderPartial,n),h.on("renderall",n.renderAll,n),h.on("extremachange",function(d){c._config.onExtremaChange&&c._config.onExtremaChange({min:d.min,max:d.max,gradient:c._config.gradient||c._config.defaultGradient});}),y.setCoordinator(h);};function s(){var c=this._config=t.merge(e,arguments[0]||{});if(this._coordinator=new o,c.plugin){var n=c.plugin;if(e.plugins[n]){var h=e.plugins[n];this._renderer=new h.renderer(c),this._store=new h.store(c);}else throw new Error("Plugin '"+n+"' not found. Maybe it was not registered.")}else this._renderer=new m(c),this._store=new u(c);l(this);}return s.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(c){return this._config=t.merge(this._config,c),this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(c){return this._store.getValueAt?this._store.getValueAt(c):this._renderer.getValueAt?this._renderer.getValueAt(c):null}},s})(),a={create:function(i){return new r(i)},register:function(i,o){e.plugins[i]=o;}};return a},he=be();function Pe(){let e=null,g=function(m,t,r){m&&(this._viewer=m,e=t,te(this),this._installPrimitives());};return g.prototype={_installPrimitives:function(){this._installProbingPrimitive(),this._installTexturePrimitive(),this._installWaterPrimitive(),this._installPointsPrimitive(),this._installShadowPrimitive(),this._installArrowPolylinePrimitive(),this._installXyzAxisPrimitive(),this._installTetrahedronPrimitive();},_installTetrahedronPrimitive:function(){try{var m=e.Cartesian3,t=e.ComponentDatatype,r=e.PrimitiveType,a=e.BoundingSphere,i=e.GeometryAttribute,o=e.GeometryPipeline,l=e.Geometry,s=e.defined,c=e.RenderState,n=e.ShaderSource,h=e.ShaderProgram,y=e.DrawCommand,d=e.Pass,x=e.Appearance,p=e.BufferUsage,f=e.Color,k=e.VertexArray,S=e.buildModuleUrl,_=e.Matrix4,M=e.Matrix3,C=e.Texture,P=e.Resource,A=e.Transforms,b=e.defaultValue||Z,D=this._viewer,I=this.getDfSt(["primitive","TetrahedronPrimitive"])||"static/data/images/Textures/fence.png";let E=function(v){this.show=!0,this._command=void 0,this._enuMatrix=void 0,this._scaleMatrix=void 0,this._localPosition=v.position,this._createCommand=T,this._angle=0,this._distance=b(v.distance,1),this._setInterval=void 0,this._viewer=D,this._speed=b(v.speed,1),this._color=b(v.color,new f(1,1,0,.8)),this._scale=b(v.scale,new m(10,10,15)),this._texture=void 0,this._imageUrl=I,this._modelMatrix=U(this),this._height=j(this),L(this);};E.prototype.update=function(v){this.show&&(s(this._command)||(this._command=this._createCommand(v.context,this)),s(this._command)&&v.commandList.push(this._command));},E.prototype.isDestroyed=function(){return !1},E.prototype.destroy=function(){return s(this._command)&&(this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy()),destroyObject(this)},E.prototype.startAnimate=function(){let v=this;this._setInterval=setInterval(w,5);function w(){v._angle=v._angle+.01,Math.sin(v._angle)>0?v._height=.01:v._height=-.01;let R=new e.Cartesian3(0,0,v._height);_.multiplyByTranslation(v._modelMatrix,R,v._modelMatrix);let z=_.fromRotationTranslation(M.fromRotationZ(e.Math.toRadians(v._speed)));_.multiply(v._modelMatrix,z,v._modelMatrix);}},E.prototype.closeAnimate=function(){clearInterval(this._setInterval);};let T=function(v,w){var R=!1,z=!0,N=G(),J=B(),me=x.getDefaultRenderState(R,z,void 0),ue=c.fromCache(me),de=new n({sources:[N]}),ye=new n({sources:[J]}),pe={color:function(){return w._color},myImage:function(){return s(w._texture)?w._texture:w._viewer.scene.context.defaultTexture}};let ve={position:0,textureCoordinates:1};var ge=h.fromCache({context:v,vertexShaderSource:de,fragmentShaderSource:ye,attributeLocations:ve});return new y({vertexArray:O(v),primitiveType:r.TRIANGLES,renderState:ue,shaderProgram:ge,uniformMap:pe,owner:this,pass:d.TRANSLUCENT,modelMatrix:w._modelMatrix})},O=function(v){let w={position:0,textureCoordinates:1};var R=F(),z=new l({attributes:{position:new i({componentDatatype:t.FLOAT,componentsPerAttribute:3,values:R.positions}),textureCoordinates:new i({componentDatatype:t.FLOAT,componentsPerAttribute:2,values:R.sts})},indices:R.indices,primitiveType:r.TRIANGLES,boundingSphere:a.fromVertices(R.positions)}),N=o.computeNormal(z),J=k.fromGeometry({context:v,geometry:N,attributeLocations:w,bufferUsage:p.STATIC_DRAW});return J},F=function(){var v=new Float64Array(15);v[0]=0,v[1]=1,v[2]=0,v[3]=-1,v[4]=0,v[5]=0,v[6]=0,v[7]=-1,v[8]=0,v[9]=1,v[10]=0,v[11]=0,v[12]=0,v[13]=0,v[14]=-1;var w=new Uint16Array(18);w[0]=4,w[1]=2,w[2]=3,w[3]=4,w[4]=3,w[5]=0,w[6]=4,w[7]=0,w[8]=1,w[9]=4,w[10]=1,w[11]=2,w[12]=1,w[13]=2,w[14]=3,w[15]=1,w[16]=3,w[17]=0;var R=new Float32Array([0,0,1,0,1,1,0,1,.5,.5]);return {indices:w,positions:v,sts:R}},G=function(){var v=`#version 300 es
210
+ `,le=Ce;var be=function(){var e={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},u=(function(){var o=function(c){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=c.xField||c.defaultXField,this._yField=c.yField||c.defaultYField,this._valueField=c.valueField||c.defaultValueField,c.radius&&(this._cfgRadius=c.radius);},l=e.defaultRadius;return o.prototype={_organiseData:function(s,c){var n=s[this._xField],h=s[this._yField],y=this._radi,d=this._data,x=this._max,p=this._min,f=s[this._valueField]||1,E=s.radius||this._cfgRadius||l;return d[n]||(d[n]=[],y[n]=[]),d[n][h]?d[n][h]+=f:(d[n][h]=f,y[n][h]=E),d[n][h]>x?(c?this.setDataMax(d[n][h]):this._max=d[n][h],false):{x:n,y:h,value:f,radius:E,min:p,max:x}},_unOrganizeData:function(){var s=[],c=this._data,n=this._radi;for(var h in c)for(var y in c[h])s.push({x:h,y,radius:n[h][y],value:c[h][y]});return {min:this._min,max:this._max,data:s}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max});},addData:function(){if(arguments[0].length>0)for(var s=arguments[0],c=s.length;c--;)this.addData.call(this,s[c]);else {var n=this._organiseData(arguments[0],true);n&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[n]});}return this},setData:function(s){var c=s.data,n=c.length;this._data=[],this._radi=[];for(var h=0;h<n;h++)this._organiseData(c[h],false);return this._max=s.max,this._min=s.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(s){return this._max=s,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(s){return this._min=s,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(s){this._coordinator=s;},_getInternalData:function(){return {max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},o})(),g=(function(){var o=function(n){var h=n.gradient||n.defaultGradient,y=document.createElement("canvas"),d=y.getContext("2d");y.width=256,y.height=1;var x=d.createLinearGradient(0,0,256,1);for(var p in h)x.addColorStop(p,h[p]);return d.fillStyle=x,d.fillRect(0,0,256,1),d.getImageData(0,0,256,1).data},l=function(n,h){var y=document.createElement("canvas"),d=y.getContext("2d"),x=n,p=n;if(y.width=y.height=n*2,h==1)d.beginPath(),d.arc(x,p,n,0,2*Math.PI,false),d.fillStyle="rgba(0,0,0,1)",d.fill();else {var f=d.createRadialGradient(x,p,n*h,x,p,n);f.addColorStop(0,"rgba(0,0,0,1)"),f.addColorStop(1,"rgba(0,0,0,0)"),d.fillStyle=f,d.fillRect(0,0,2*n,2*n);}return y},s=function(p){for(var h=[],y=p.min,d=p.max,x=p.radi,p=p.data,f=Object.keys(p),E=f.length;E--;)for(var S=f[E],_=Object.keys(p[S]),M=_.length;M--;){var C=_[M],P=p[S][C],A=x[S][C];h.push({x:S,y:C,value:P,radius:A});}return {min:y,max:d,data:h}};function c(n){var h=n.container,y=this.shadowCanvas=document.createElement("canvas"),d=this.canvas=n.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0];var p=getComputedStyle(n.container)||{};d.className="heatmap-canvas",this._width=d.width=y.width=n.width||+p.width.replace(/px/,""),this._height=d.height=y.height=n.height||+p.height.replace(/px/,""),this.shadowCtx=y.getContext("2d"),this.ctx=d.getContext("2d"),d.style.cssText=y.style.cssText="position:absolute;left:0;top:0;",h.style.position="relative",h.appendChild(d),this._palette=o(n),this._templates={},this._setStyles(n);}return c.prototype={renderPartial:function(n){n.data.length>0&&(this._drawAlpha(n),this._colorize());},renderAll:function(n){this._clear(),n.data.length>0&&(this._drawAlpha(s(n)),this._colorize());},_updateGradient:function(n){this._palette=o(n);},updateConfig:function(n){n.gradient&&this._updateGradient(n),this._setStyles(n);},setDimensions:function(n,h){this._width=n,this._height=h,this.canvas.width=this.shadowCanvas.width=n,this.canvas.height=this.shadowCanvas.height=h;},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height);},_setStyles:function(n){this._blur=n.blur==0?0:n.blur||n.defaultBlur,n.backgroundColor&&(this.canvas.style.backgroundColor=n.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=n.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=n.height||this._height,this._opacity=(n.opacity||0)*255,this._maxOpacity=(n.maxOpacity||n.defaultMaxOpacity)*255,this._minOpacity=(n.minOpacity||n.defaultMinOpacity)*255,this._useGradientOpacity=!!n.useGradientOpacity;},_drawAlpha:function(d){for(var h=this._min=d.min,y=this._max=d.max,d=d.data||[],x=d.length,p=1-this._blur;x--;){var f=d[x],E=f.x,S=f.y,_=f.radius,M=Math.min(f.value,y),C=E-_,P=S-_,A=this.shadowCtx,b;this._templates[_]?b=this._templates[_]:this._templates[_]=b=l(_,p);var D=(M-h)/(y-h);A.globalAlpha=D<.01?.01:D,A.drawImage(b,C,P),C<this._renderBoundaries[0]&&(this._renderBoundaries[0]=C),P<this._renderBoundaries[1]&&(this._renderBoundaries[1]=P),C+2*_>this._renderBoundaries[2]&&(this._renderBoundaries[2]=C+2*_),P+2*_>this._renderBoundaries[3]&&(this._renderBoundaries[3]=P+2*_);}},_colorize:function(){var n=this._renderBoundaries[0],h=this._renderBoundaries[1],y=this._renderBoundaries[2]-n,d=this._renderBoundaries[3]-h,x=this._width,p=this._height,f=this._opacity,E=this._maxOpacity,S=this._minOpacity,_=this._useGradientOpacity;n<0&&(n=0),h<0&&(h=0),n+y>x&&(y=x-n),h+d>p&&(d=p-h);for(var M=this.shadowCtx.getImageData(n,h,y,d),C=M.data,P=C.length,A=this._palette,b=3;b<P;b+=4){var D=C[b],I=D*4;if(I){var k;f>0?k=f:D<E?D<S?k=S:k=D:k=E,C[b-3]=A[I],C[b-2]=A[I+1],C[b-1]=A[I+2],C[b]=_?A[I+3]:k;}}this.ctx.putImageData(M,n,h),this._renderBoundaries=[1e3,1e3,0,0];},getValueAt:function(n){var h,y=this.shadowCtx,d=y.getImageData(n.x,n.y,1,1),x=d.data[3],p=this._max,f=this._min;return h=Math.abs(p-f)*(x/255)>>0,h},getDataURL:function(){return this.canvas.toDataURL()}},c})(),m=(function(){var o=false;return e.defaultRenderer==="canvas2d"&&(o=g),o})(),t={merge:function(){for(var i={},o=arguments.length,l=0;l<o;l++){var s=arguments[l];for(var c in s)i[c]=s[c];}return i}},r=(function(){var o=(function(){function n(){this.cStore={};}return n.prototype={on:function(h,y,d){var x=this.cStore;x[h]||(x[h]=[]),x[h].push(function(p){return y.call(d,p)});},emit:function(h,y){var d=this.cStore;if(d[h])for(var x=d[h].length,p=0;p<x;p++){var f=d[h][p];f(y);}}},n})(),l=function(c){var n=c._renderer,h=c._coordinator,y=c._store;h.on("renderpartial",n.renderPartial,n),h.on("renderall",n.renderAll,n),h.on("extremachange",function(d){c._config.onExtremaChange&&c._config.onExtremaChange({min:d.min,max:d.max,gradient:c._config.gradient||c._config.defaultGradient});}),y.setCoordinator(h);};function s(){var c=this._config=t.merge(e,arguments[0]||{});if(this._coordinator=new o,c.plugin){var n=c.plugin;if(e.plugins[n]){var h=e.plugins[n];this._renderer=new h.renderer(c),this._store=new h.store(c);}else throw new Error("Plugin '"+n+"' not found. Maybe it was not registered.")}else this._renderer=new m(c),this._store=new u(c);l(this);}return s.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(c){return this._config=t.merge(this._config,c),this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(c){return this._store.getValueAt?this._store.getValueAt(c):this._renderer.getValueAt?this._renderer.getValueAt(c):null}},s})(),a={create:function(i){return new r(i)},register:function(i,o){e.plugins[i]=o;}};return a},he=be();function Pe(){let e=null,g=function(m,t,r){m&&(this._viewer=m,e=t,te(this),this._installPrimitives());};return g.prototype={_installPrimitives:function(){this._installProbingPrimitive(),this._installTexturePrimitive(),this._installWaterPrimitive(),this._installPointsPrimitive(),this._installShadowPrimitive(),this._installArrowPolylinePrimitive(),this._installXyzAxisPrimitive(),this._installTetrahedronPrimitive();},_installTetrahedronPrimitive:function(){try{var m=e.Cartesian3,t=e.ComponentDatatype,r=e.PrimitiveType,a=e.BoundingSphere,i=e.GeometryAttribute,o=e.GeometryPipeline,l=e.Geometry,s=e.defined,c=e.RenderState,n=e.ShaderSource,h=e.ShaderProgram,y=e.DrawCommand,d=e.Pass,x=e.Appearance,p=e.BufferUsage,f=e.Color,E=e.VertexArray,S=e.buildModuleUrl,_=e.Matrix4,M=e.Matrix3,C=e.Texture,P=e.Resource,A=e.Transforms,b=e.defaultValue||Z,D=this._viewer,I=this.getDfSt(["primitive","TetrahedronPrimitive"])||"static/data/images/Textures/fence.png";let k=function(v){this.show=!0,this._command=void 0,this._enuMatrix=void 0,this._scaleMatrix=void 0,this._localPosition=v.position,this._createCommand=T,this._angle=0,this._distance=b(v.distance,1),this._setInterval=void 0,this._viewer=D,this._speed=b(v.speed,1),this._color=b(v.color,new f(1,1,0,.8)),this._scale=b(v.scale,new m(10,10,15)),this._texture=void 0,this._imageUrl=I,this._modelMatrix=U(this),this._height=j(this),L(this);};k.prototype.update=function(v){this.show&&(s(this._command)||(this._command=this._createCommand(v.context,this)),s(this._command)&&v.commandList.push(this._command));},k.prototype.isDestroyed=function(){return !1},k.prototype.destroy=function(){return s(this._command)&&(this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy()),destroyObject(this)},k.prototype.startAnimate=function(){let v=this;this._setInterval=setInterval(w,5);function w(){v._angle=v._angle+.01,Math.sin(v._angle)>0?v._height=.01:v._height=-.01;let R=new e.Cartesian3(0,0,v._height);_.multiplyByTranslation(v._modelMatrix,R,v._modelMatrix);let z=_.fromRotationTranslation(M.fromRotationZ(e.Math.toRadians(v._speed)));_.multiply(v._modelMatrix,z,v._modelMatrix);}},k.prototype.closeAnimate=function(){clearInterval(this._setInterval);};let T=function(v,w){var R=!1,z=!0,N=G(),J=B(),me=x.getDefaultRenderState(R,z,void 0),ue=c.fromCache(me),de=new n({sources:[N]}),ye=new n({sources:[J]}),pe={color:function(){return w._color},myImage:function(){return s(w._texture)?w._texture:w._viewer.scene.context.defaultTexture}};let ve={position:0,textureCoordinates:1};var ge=h.fromCache({context:v,vertexShaderSource:de,fragmentShaderSource:ye,attributeLocations:ve});return new y({vertexArray:O(v),primitiveType:r.TRIANGLES,renderState:ue,shaderProgram:ge,uniformMap:pe,owner:this,pass:d.TRANSLUCENT,modelMatrix:w._modelMatrix})},O=function(v){let w={position:0,textureCoordinates:1};var R=F(),z=new l({attributes:{position:new i({componentDatatype:t.FLOAT,componentsPerAttribute:3,values:R.positions}),textureCoordinates:new i({componentDatatype:t.FLOAT,componentsPerAttribute:2,values:R.sts})},indices:R.indices,primitiveType:r.TRIANGLES,boundingSphere:a.fromVertices(R.positions)}),N=o.computeNormal(z),J=E.fromGeometry({context:v,geometry:N,attributeLocations:w,bufferUsage:p.STATIC_DRAW});return J},F=function(){var v=new Float64Array(15);v[0]=0,v[1]=1,v[2]=0,v[3]=-1,v[4]=0,v[5]=0,v[6]=0,v[7]=-1,v[8]=0,v[9]=1,v[10]=0,v[11]=0,v[12]=0,v[13]=0,v[14]=-1;var w=new Uint16Array(18);w[0]=4,w[1]=2,w[2]=3,w[3]=4,w[4]=3,w[5]=0,w[6]=4,w[7]=0,w[8]=1,w[9]=4,w[10]=1,w[11]=2,w[12]=1,w[13]=2,w[14]=3,w[15]=1,w[16]=3,w[17]=0;var R=new Float32Array([0,0,1,0,1,1,0,1,.5,.5]);return {indices:w,positions:v,sts:R}},G=function(){var v=`#version 300 es
211
211
  in vec3 position;
212
212
  in vec3 normal;
213
213
  in vec2 st;
@@ -257,7 +257,7 @@ void main() {
257
257
  out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
258
258
  #endif
259
259
  }
260
- `;return v},L=function(v){P.createIfNeeded(v._imageUrl).fetchImage().then(function(w){var R,z=v._viewer.scene.context;s(w.internalFormat)?R=new C({context:z,pixelFormat:w.internalFormat,width:w.naturalWidth,height:w.naturalHeight,source:{arrayBufferView:w.bufferView}}):R=new C({context:z,source:w}),v._texture=R;});},U=function(v){let w=A.eastNorthUpToFixedFrame(v._localPosition),R=_.fromScale(v._scale),z=_.multiply(w,R,new _);return v._scaleMatrix=R,v._enuMatrix=w,z},j=function(v){let w=m.fromElements(0,0,v._distance,new e.Cartesian3),R=e.Matrix4.multiplyByPoint(v._enuMatrix,w,new m),z=_.multiplyByPoint(v._viewer.scene.camera._viewMatrix,R,new m),N=_.multiplyByPoint(v._viewer.scene.camera.frustum.projectionMatrix,z,new m);return m.normalize(N,new m).z};e.Scene.TetrahedronPrimitive=E;}catch(E){console.log(E);}},_installXyzAxisPrimitive:function(){function m(t){this._viewer=t.viewer,this._model=t.model,this._matrix=t.matrix,this._radius=void 0,this._layer=new e.CustomDataSource("xyz-axis"),this._viewer.dataSources.add(this._layer),this._handler=new e.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._xyzState=false,this._xyzPid=void 0,this._builds();}m.prototype={_builds(){this._createAxisXYZ(),this._bindHandler();},remove(){this._layer._primitives.removeAll(),this._handler.destroy();},_createAxisXYZ:function(){this._model.readyPromise.then(t=>{let r=e.Matrix4.getTranslation(t.modelMatrix,new e.Cartesian3),a=t.boundingSphere,i=a.radius,o=new e.ArrowPolylinePrimitive({id:"axisZ",color:e.Color.RED,position:r,width:3,headWidth:5,length:i*2+50,headLength:10}),l=new e.ArrowPolylinePrimitive({id:"axisX",color:e.Color.GREEN,position:r,width:3,headWidth:5,length:i*2+50,headLength:10}),s=new e.ArrowPolylinePrimitive({id:"axisY",color:e.Color.BLUE,position:r,width:3,headWidth:5,length:i*2+50,headLength:10}),c=e.Matrix3.fromRotationY(e.Math.toRadians(90));this._rotationX=e.Matrix4.fromRotationTranslation(c),e.Matrix4.multiply(l.geometryInstances[0].modelMatrix,this._rotationX,l.geometryInstances[0].modelMatrix),e.Matrix4.multiply(l.geometryInstances[1].modelMatrix,this._rotationX,l.geometryInstances[1].modelMatrix);let n=e.Matrix3.fromRotationX(e.Math.toRadians(90));this._rotationY=e.Matrix4.fromRotationTranslation(n),e.Matrix4.multiply(s.geometryInstances[0].modelMatrix,this._rotationY,s.geometryInstances[0].modelMatrix),e.Matrix4.multiply(s.geometryInstances[1].modelMatrix,this._rotationY,s.geometryInstances[1].modelMatrix),this._layer._primitives.add(o),this._layer._primitives.add(l),this._layer._primitives.add(s),this._radius=a.radius,this._createAxisSphere();});},_createAxisSphere:function(){let t=[];for(let o=0;o<=360;o+=3){let l=Math.sin(e.Math.toRadians(o)),s=Math.cos(e.Math.toRadians(o)),c=this._radius*s,n=this._radius*l;t.push(new e.Cartesian3(c,n,0));}let r=this._createAxisSpheres("axisSphereZ",t,this._matrix,e.Color.RED);this._layer._primitives.add(r);let a=this._createAxisSpheres("axisSphereY",t,this._matrix,e.Color.GREEN);this._layer._primitives.add(a),e.Matrix4.multiply(a.geometryInstances.modelMatrix,this._rotationY,a.geometryInstances.modelMatrix);let i=this._createAxisSpheres("axisSphereX",t,this._matrix,e.Color.BLUE);this._layer._primitives.add(i),e.Matrix4.multiply(i.geometryInstances.modelMatrix,this._rotationX,i.geometryInstances.modelMatrix);},_createAxisSpheres:function(t,r,a,i){let o=new e.PolylineGeometry({positions:r,width:10}),l=new e.GeometryInstance({geometry:o,id:t,attributes:{color:e.ColorGeometryInstanceAttribute.fromColor(i)}});return new e.Primitive({geometryInstances:l,appearance:new e.PolylineColorAppearance({translucent:false}),modelMatrix:a})},_updateAxis(t){if(this._layer){let a=this._layer._primitives._primitives;for(let i=1,o=a.length;i<o;i++){let l=a[i],s=e.Matrix4.fromTranslation(new e.Cartesian3(t.x,t.y,t.z));e.Matrix4.multiply(l.modelMatrix,s,l.modelMatrix);}}let r=e.Matrix4.fromTranslation(new e.Cartesian3(t.x,t.y,t.z));e.Matrix4.multiply(this._model.modelMatrix,r,this._model.modelMatrix);},_updateAxisSphere(t){if(this._layer){let a=this._layer._primitives._primitives;for(let i=1,o=a.length;i<o;i++){let l=a[i],s=e.Matrix4.fromRotationTranslation(t);e.Matrix4.multiply(l.modelMatrix,s,l.modelMatrix);}}let r=e.Matrix4.fromRotationTranslation(t);e.Matrix4.multiply(this._model.modelMatrix,r,this._model.modelMatrix);},_bindHandler(){this._handler.setInputAction(t=>{if(this._xyzState&&this._xyzPid)switch(this._xyzPid){case "axisX-line":this._updateAxis({x:-1,y:0,z:0});break;case "axisY-line":this._updateAxis({x:0,y:-1,z:0});break;case "axisZ-line":this._updateAxis({x:0,y:0,z:-1});break;case "axisX-arrow":this._updateAxis({x:1,y:0,z:0});break;case "axisY-arrow":this._updateAxis({x:0,y:1,z:0});break;case "axisZ-arrow":this._updateAxis({x:0,y:0,z:1});break;case "axisSphereX":this._updateAxisSphere(e.Matrix3.fromRotationX(e.Math.toRadians(1)));break;case "axisSphereY":this._updateAxisSphere(e.Matrix3.fromRotationY(e.Math.toRadians(1)));break;case "axisSphereZ":this._updateAxisSphere(e.Matrix3.fromRotationZ(e.Math.toRadians(1)));break}},e.ScreenSpaceEventType.MOUSE_MOVE),this._handler.setInputAction(t=>{let r=viewer.scene.pick(t.position);r&&r.id&&(this._xyzPid=r.id,this._xyzState=true);},e.ScreenSpaceEventType.LEFT_DOWN),this._handler.setInputAction(()=>{this._xyzState=false,this._xyzPid=void 0;},e.ScreenSpaceEventType.LEFT_UP);}},e.Scene.XyzAxisPrimitive=m;},_installArrowPolylinePrimitive:function(){function m(r={}){this._color=r.color||e.Color.RED,this._width=r.width||3,this._headWidth=r.headWidth||2*this._width,this._length=r.length||300,this._headLength=r.headLength||10,this._inverse=r.inverse||false,this.position=r.position;let a=r.id,i=e.CylinderGeometry.createGeometry(new e.CylinderGeometry({length:this._length,topRadius:this._width,bottomRadius:this._width})),o=e.CylinderGeometry.createGeometry(new e.CylinderGeometry({length:this._headLength,topRadius:0,bottomRadius:this._headWidth})),l=(this._length+this._headLength)/2;return this._inverse&&(l=-l),t(o,[0,0,l]),new e.Primitive({modelMatrix:e.Transforms.eastNorthUpToFixedFrame(this.position),geometryInstances:[new e.GeometryInstance({id:a+"-line",geometry:i}),new e.GeometryInstance({id:a+"-arrow",geometry:o})],appearance:new e.MaterialAppearance({material:e.Material.fromType("Color",{color:this._color})})})}let t=function(r,a){let i=new e.Cartesian3;a.length?(i.x=a[0],i.y=a[1],i.z=a[2]):e.Cartesian3.clone(a,i);for(let o=0;o<r.attributes.position.values.length;o+=3)r.attributes.position.values[o]+=i.x,r.attributes.position.values[o+1]+=i.y,r.attributes.position.values[o+2]+=i.z;};e.Scene.ArrowPolylinePrimitive=m;},_installShadowPrimitive:function(){let m=e.defaultValue||Z,t=`in vec3 position;
260
+ `;return v},L=function(v){P.createIfNeeded(v._imageUrl).fetchImage().then(function(w){var R,z=v._viewer.scene.context;s(w.internalFormat)?R=new C({context:z,pixelFormat:w.internalFormat,width:w.naturalWidth,height:w.naturalHeight,source:{arrayBufferView:w.bufferView}}):R=new C({context:z,source:w}),v._texture=R;});},U=function(v){let w=A.eastNorthUpToFixedFrame(v._localPosition),R=_.fromScale(v._scale),z=_.multiply(w,R,new _);return v._scaleMatrix=R,v._enuMatrix=w,z},j=function(v){let w=m.fromElements(0,0,v._distance,new e.Cartesian3),R=e.Matrix4.multiplyByPoint(v._enuMatrix,w,new m),z=_.multiplyByPoint(v._viewer.scene.camera._viewMatrix,R,new m),N=_.multiplyByPoint(v._viewer.scene.camera.frustum.projectionMatrix,z,new m);return m.normalize(N,new m).z};e.Scene.TetrahedronPrimitive=k;}catch(k){console.log(k);}},_installXyzAxisPrimitive:function(){function m(t){this._viewer=t.viewer,this._model=t.model,this._matrix=t.matrix,this._radius=void 0,this._layer=new e.CustomDataSource("xyz-axis"),this._viewer.dataSources.add(this._layer),this._handler=new e.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._xyzState=false,this._xyzPid=void 0,this._builds();}m.prototype={_builds(){this._createAxisXYZ(),this._bindHandler();},remove(){this._layer._primitives.removeAll(),this._handler.destroy();},_createAxisXYZ:function(){this._model.readyPromise.then(t=>{let r=e.Matrix4.getTranslation(t.modelMatrix,new e.Cartesian3),a=t.boundingSphere,i=a.radius,o=new e.ArrowPolylinePrimitive({id:"axisZ",color:e.Color.RED,position:r,width:3,headWidth:5,length:i*2+50,headLength:10}),l=new e.ArrowPolylinePrimitive({id:"axisX",color:e.Color.GREEN,position:r,width:3,headWidth:5,length:i*2+50,headLength:10}),s=new e.ArrowPolylinePrimitive({id:"axisY",color:e.Color.BLUE,position:r,width:3,headWidth:5,length:i*2+50,headLength:10}),c=e.Matrix3.fromRotationY(e.Math.toRadians(90));this._rotationX=e.Matrix4.fromRotationTranslation(c),e.Matrix4.multiply(l.geometryInstances[0].modelMatrix,this._rotationX,l.geometryInstances[0].modelMatrix),e.Matrix4.multiply(l.geometryInstances[1].modelMatrix,this._rotationX,l.geometryInstances[1].modelMatrix);let n=e.Matrix3.fromRotationX(e.Math.toRadians(90));this._rotationY=e.Matrix4.fromRotationTranslation(n),e.Matrix4.multiply(s.geometryInstances[0].modelMatrix,this._rotationY,s.geometryInstances[0].modelMatrix),e.Matrix4.multiply(s.geometryInstances[1].modelMatrix,this._rotationY,s.geometryInstances[1].modelMatrix),this._layer._primitives.add(o),this._layer._primitives.add(l),this._layer._primitives.add(s),this._radius=a.radius,this._createAxisSphere();});},_createAxisSphere:function(){let t=[];for(let o=0;o<=360;o+=3){let l=Math.sin(e.Math.toRadians(o)),s=Math.cos(e.Math.toRadians(o)),c=this._radius*s,n=this._radius*l;t.push(new e.Cartesian3(c,n,0));}let r=this._createAxisSpheres("axisSphereZ",t,this._matrix,e.Color.RED);this._layer._primitives.add(r);let a=this._createAxisSpheres("axisSphereY",t,this._matrix,e.Color.GREEN);this._layer._primitives.add(a),e.Matrix4.multiply(a.geometryInstances.modelMatrix,this._rotationY,a.geometryInstances.modelMatrix);let i=this._createAxisSpheres("axisSphereX",t,this._matrix,e.Color.BLUE);this._layer._primitives.add(i),e.Matrix4.multiply(i.geometryInstances.modelMatrix,this._rotationX,i.geometryInstances.modelMatrix);},_createAxisSpheres:function(t,r,a,i){let o=new e.PolylineGeometry({positions:r,width:10}),l=new e.GeometryInstance({geometry:o,id:t,attributes:{color:e.ColorGeometryInstanceAttribute.fromColor(i)}});return new e.Primitive({geometryInstances:l,appearance:new e.PolylineColorAppearance({translucent:false}),modelMatrix:a})},_updateAxis(t){if(this._layer){let a=this._layer._primitives._primitives;for(let i=1,o=a.length;i<o;i++){let l=a[i],s=e.Matrix4.fromTranslation(new e.Cartesian3(t.x,t.y,t.z));e.Matrix4.multiply(l.modelMatrix,s,l.modelMatrix);}}let r=e.Matrix4.fromTranslation(new e.Cartesian3(t.x,t.y,t.z));e.Matrix4.multiply(this._model.modelMatrix,r,this._model.modelMatrix);},_updateAxisSphere(t){if(this._layer){let a=this._layer._primitives._primitives;for(let i=1,o=a.length;i<o;i++){let l=a[i],s=e.Matrix4.fromRotationTranslation(t);e.Matrix4.multiply(l.modelMatrix,s,l.modelMatrix);}}let r=e.Matrix4.fromRotationTranslation(t);e.Matrix4.multiply(this._model.modelMatrix,r,this._model.modelMatrix);},_bindHandler(){this._handler.setInputAction(t=>{if(this._xyzState&&this._xyzPid)switch(this._xyzPid){case "axisX-line":this._updateAxis({x:-1,y:0,z:0});break;case "axisY-line":this._updateAxis({x:0,y:-1,z:0});break;case "axisZ-line":this._updateAxis({x:0,y:0,z:-1});break;case "axisX-arrow":this._updateAxis({x:1,y:0,z:0});break;case "axisY-arrow":this._updateAxis({x:0,y:1,z:0});break;case "axisZ-arrow":this._updateAxis({x:0,y:0,z:1});break;case "axisSphereX":this._updateAxisSphere(e.Matrix3.fromRotationX(e.Math.toRadians(1)));break;case "axisSphereY":this._updateAxisSphere(e.Matrix3.fromRotationY(e.Math.toRadians(1)));break;case "axisSphereZ":this._updateAxisSphere(e.Matrix3.fromRotationZ(e.Math.toRadians(1)));break}},e.ScreenSpaceEventType.MOUSE_MOVE),this._handler.setInputAction(t=>{let r=viewer.scene.pick(t.position);r&&r.id&&(this._xyzPid=r.id,this._xyzState=true);},e.ScreenSpaceEventType.LEFT_DOWN),this._handler.setInputAction(()=>{this._xyzState=false,this._xyzPid=void 0;},e.ScreenSpaceEventType.LEFT_UP);}},e.Scene.XyzAxisPrimitive=m;},_installArrowPolylinePrimitive:function(){function m(r={}){this._color=r.color||e.Color.RED,this._width=r.width||3,this._headWidth=r.headWidth||2*this._width,this._length=r.length||300,this._headLength=r.headLength||10,this._inverse=r.inverse||false,this.position=r.position;let a=r.id,i=e.CylinderGeometry.createGeometry(new e.CylinderGeometry({length:this._length,topRadius:this._width,bottomRadius:this._width})),o=e.CylinderGeometry.createGeometry(new e.CylinderGeometry({length:this._headLength,topRadius:0,bottomRadius:this._headWidth})),l=(this._length+this._headLength)/2;return this._inverse&&(l=-l),t(o,[0,0,l]),new e.Primitive({modelMatrix:e.Transforms.eastNorthUpToFixedFrame(this.position),geometryInstances:[new e.GeometryInstance({id:a+"-line",geometry:i}),new e.GeometryInstance({id:a+"-arrow",geometry:o})],appearance:new e.MaterialAppearance({material:e.Material.fromType("Color",{color:this._color})})})}let t=function(r,a){let i=new e.Cartesian3;a.length?(i.x=a[0],i.y=a[1],i.z=a[2]):e.Cartesian3.clone(a,i);for(let o=0;o<r.attributes.position.values.length;o+=3)r.attributes.position.values[o]+=i.x,r.attributes.position.values[o+1]+=i.y,r.attributes.position.values[o+2]+=i.z;};e.Scene.ArrowPolylinePrimitive=m;},_installShadowPrimitive:function(){let m=e.defaultValue||Z,t=`in vec3 position;
261
261
  uniform mat4 u_modelViewMatrix;
262
262
  void main()
263
263
  {
@@ -268,7 +268,7 @@ void main() {
268
268
  {
269
269
  out_FragColor = u_bgColor;
270
270
  }
271
- `;function a(i){i=m(i,m.EMPTY_OBJECT);var o=i.scene;if(!e.defined(o))throw new e.DeveloperError("scene is required.");this._scene=o;var l=o._context;if(!e.defined(l))throw new e.DeveloperError("context is required.");if(!e.defined(i.viewerPosition))throw new e.DeveloperError("this view position is required.");this._viewerPosition=i.viewerPosition,this._positions=void 0,this._indices=void 0,this._drawLineCommand=void 0,this._depthCamera=new e.Camera(o),this._depthCamera.position=this._viewerPosition,this._direction=0,this._pitch=0,this._horizontalFov=m(i.horizontalFov,60),this._verticalFov=m(i.verticalFov,45),this._cameraUpdated=false,this._targetPoint=this._viewerPosition.clone();var s=new e.Cartesian3(0,0,100),c=e.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);e.Matrix4.multiplyByPoint(c,s,this._targetPoint),this._distance=100,this._cameraUpdated=false,this._modelMatrix=new e.Matrix4,this._shadowMap=new e.ShadowMap({context:l,enabled:true,lightCamera:this._depthCamera,cascadesEnabled:false}),this.show=true,this._invisiblyColor=e.Color.RED,this._visiblyColor=e.Color.GREEN,this._shadowMap.useCustomColor=true,this.shadowMap._customColor={invisibly:e.Color.RED,visibly:e.Color.GREEN},this._initialize=function(){this._positions=new Float32Array(633),this._indices=new Uint16Array(408);var n=this._indices,h=0;n[h++]=0,n[h++]=1,n[h++]=0,n[h++]=21,n[h++]=0,n[h++]=85,n[h++]=0,n[h++]=105;for(var y=0,d=0;d<5;++d){y++;for(var x=0;x<20;++x)n[h++]=y++,n[h++]=y;}y++;for(var p=0;p<20;++p)for(var f=0;f<5;++f)n[h++]=y,n[h++]=5+y++;this._initialized=true;},this._debugLightFrustum=void 0,this._debugShow=true;}Object.defineProperties(a.prototype,{shadowMap:{get:function(){return this._shadowMap}},debugLightFrustum:{get:function(){return this._debugLightFrustum}},debugShow:{get:function(){return this._debugShow},set:function(i){this.shadowMap.debugShow=i,this._debugShow=i;}},invisiblyColor:{get:function(){return this._invisiblyColor},set:function(i){this._invisiblyColor=i;var o=this.shadowMap;o._customColor.invisibly=i;}},visiblyColor:{get:function(){return this._visiblyColor},set:function(i){this._visiblyColor=i;var o=this.shadowMap;o._customColor.visibly=i;}},viewerPosition:{get:function(){return this._viewerPosition},set:function(i){this._viewerPosition=i,this._cameraUpdated=false;}},direction:{get:function(){return this._direction},set:function(i){this._direction=i,this._cameraUpdated=false;}},pitch:{get:function(){return this._pitch},set:function(i){this._pitch=i,this._cameraUpdated=false;}},horizontalFov:{get:function(){return this._horizontalFov},set:function(i){this._horizontalFov=i,this._cameraUpdated=false,this._hintLineUpdated=false;}},verticalFov:{get:function(){return this._verticalFov},set:function(i){this._verticalFov=i,this._cameraUpdated=false,this._hintLineUpdated=false;}},distance:{get:function(){return this._distance},set:function(i){this._distance=i,this._cameraUpdated=false;}}}),a.prototype.setDebugFrustumEffect=function(i,o){if(this.debugShow){var l=this.debugLightFrustum._planesPrimitives,s=this.debugLightFrustum._outlinePrimitives;l.forEach(function(c){c.show=i;}),s.forEach(function(c){c.show=o;});}},a.prototype.update=function(i){if(this.show){this._cameraUpdated||(this._updateCamera(),this.debugShow&&(e.defined(this.debugLightFrustum)||(this._debugLightFrustum=new e.DebugCameraPrimitive({camera:this._depthCamera,color:e.Color.YELLOW,updateOnChange:true}),this.setDebugFrustumEffect(false,true))));var o=i.frustumSplits[1];i.frustumSplits[1]=this._distance,this._debugLightFrustum.update(i),i.frustumSplits[1]=o,i.shadowMaps.push(this.shadowMap);}},a.prototype._updateCamera=function(){this._depthCamera.frustum.near=.001*this._distance,this._depthCamera.frustum.far=this._distance,this._depthCamera.frustum.fov=e.Math.toRadians(Math.max(this._horizontalFov,this._verticalFov)),this._depthCamera.frustum.aspectRatio=this._horizontalFov/this._verticalFov,this._depthCamera.setView({destination:this._viewerPosition,orientation:{heading:e.Math.toRadians(this._direction),pitch:e.Math.toRadians(this._pitch)}}),this._modelMatrix=this._depthCamera.inverseViewMatrix,this._cameraUpdated=true;},a.prototype.setPoseByTargetPoint=function(i){this.distance=e.Cartesian3.distance(this._viewerPosition,i);var o=new e.Cartesian3,l=e.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);e.Matrix4.inverse(l,l),e.Matrix4.multiplyByPoint(l,i,o),e.Cartesian3.normalize(o,o),this.direction=e.Math.toDegrees(Math.atan2(o.x,o.y)),this.pitch=e.Math.toDegrees(Math.asin(o.z));},a.prototype._updateHintLine=function(i){var o,l,s,c,n=this._positions,h=e.Math.toRadians(this._horizontalFov),y=e.Math.toRadians(this._verticalFov),d=Math.tan(.5*h),x=Math.tan(.5*y);l=this._distance*d,c=this._distance*x,o=-l,s=-c;var p=new e.Cartesian3(o,s,-this._distance),f=new e.Cartesian3(l,c,0);e.Matrix4.multiplyByPoint(this._modelMatrix,p,p),e.Matrix4.multiplyByPoint(this._modelMatrix,f,f);var k=e.BoundingSphere.fromCornerPoints(p,f);if(i.cullingVolume.computeVisibility(k)===Intersect.OUTSIDE)return void(this._valid=false);this._valid=true;var S=0;n[S++]=0,n[S++]=0,n[S++]=0;for(var _,M,C=Math.PI-.5*h,P=h/4,A=0;A<5;++A){_=C+A*P;for(var b=c/(this._distance/Math.cos(_)),D=Math.atan(b),I=-D,E=D/10,T=0;T<21;++T)M=I+T*E,n[S++]=this._distance*Math.cos(M)*Math.sin(_),n[S++]=this._distance*Math.sin(M),n[S++]=this._distance*Math.cos(M)*Math.cos(_);}P=h/20;for(var O=0;O<21;++O){_=C+O*P;for(var b=c/(this._distance/Math.cos(_)),D=Math.atan(b),I=-D,E=D/2,F=0;F<5;++F)M=I+F*E,n[S++]=this._distance*Math.cos(M)*Math.sin(_),n[S++]=this._distance*Math.sin(M),n[S++]=this._distance*Math.cos(M)*Math.cos(_);}var G=i.context,B=e.Buffer.createIndexBuffer({context:G,typedArray:new Uint32Array(this._indices),usage:e.BufferUsage.STATIC_DRAW,indexDatatype:IndexDatatype.UNSIGNED_INT}),L=e.Buffer.createVertexBuffer({context:G,typedArray:e.ComponentDatatype.createTypedArray(e.ComponentDatatype.FLOAT,this._positions),usage:e.BufferUsage.STATIC_DRAW}),U=[];U.push({index:0,vertexBuffer:L,componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:false});var j=new e.VertexArray({context:G,attributes:U,indexBuffer:B});if(e.defined(this._drawLineCommand))this._drawLineCommand.vertexArray.destroy(),this._drawLineCommand.vertexArray=j,this._drawLineCommand.modelMatrix=this._modelMatrix,this._drawLineCommand.boundingVolume=k;else {var v=e.ShaderProgram.fromCache({context:G,vertexShaderSource:t,fragmentShaderSource:r}),w=e.RenderState.fromCache({depthTest:{enabled:true}}),R=this,z={u_bgColor:function(){return R._lineColor},u_modelViewMatrix:function(){return G.uniformState.modelView}};this._drawLineCommand=new e.DrawCommand({boundingVolume:k,modelMatrix:R._modelMatrix,primitiveType:e.PrimitiveType.LINES,vertexArray:j,shaderProgram:v,castShadows:false,receiveShadows:false,uniformMap:z,renderState:w,pass:e.Pass.OPAQUE});}this._hintLineUpdated=true;},e.Scene.ShadowPrimitive=a;},_installPointsPrimitive:function(){function m(t){t&&t.viewer&&t.Cartesians&&(this._vertexShader=this.getVSPolylie(),this._fragmentShader=this.getFSPolyline(),this._geometry=null,this._appearance=null,this._viewer=t.viewer,this.build(t));}m.prototype={build:function(t){if(t.Cartesians&&t.Cartesians.length>=2){var r=[],a=[],i=[];if(t.Colors&&t.Colors.length===t.Cartesians.length*4){for(var o=0;o<t.Cartesians.length;o++)r.push(t.Cartesians[o].x),r.push(t.Cartesians[o].y),r.push(t.Cartesians[o].z);a=t.Colors;}else for(var l=0;l<t.Cartesians.length;l++)r.push(t.Cartesians[l].x),r.push(t.Cartesians[l].y),r.push(t.Cartesians[l].z),a.push(0),a.push(0),a.push(1),a.push(1);for(var s=0;s<t.Cartesians.length;s++)i.push(s);this.positionArr=new Float64Array(r),this.colorArr=new Float32Array(a),this.indiceArr=new Uint16Array(i);}else {var c=e.Cartesian3.fromDegrees(0,0,-10),n=e.Cartesian3.fromDegrees(0,.001,-10);this.positionArr=new Float64Array([c.x,c.y,c.z,n.x,n.y,n.z]),this.colorArr=new Float32Array([0,0,1,1,0,0,1,1]),this.indiceArr=new Uint16Array([0,1]);}this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader),this.primitive=this._viewer.scene.primitives.add(new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:false}));},getVSPolylie:function(){return "in vec3 position3DHigh; in vec3 position3DLow; in vec4 color; out vec4 v_color; in float batchId; void main() { vec4 p = czm_computePosition(); v_color =color; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; gl_PointSize=4.0; } "},getFSPolyline:function(){return "in vec4 v_color; void main() { float d = distance(gl_PointCoord, vec2(0.5,0.5)); if(d < 0.5){ out_FragColor = v_color; }else{ discard; } } "},createAppearence:function(t,r){return new e.Appearance({renderState:{blending:e.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:true},depthMask:true},fragmentShaderSource:t,vertexShaderSource:r})},createGeometry:function(t,r,a){return new e.Geometry({attributes:{position:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t}),color:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:r})},indices:a,primitiveType:e.PrimitiveType.POINTS,boundingSphere:e.BoundingSphere.fromVertices(t)})},remove:function(){this.primitive!=null&&(this._viewer.scene.primitives.remove(this.primitive),this.primitive=null);},updateCartesianPosition:function(t){if(this.primitive!=null){if(this._viewer.scene.primitives.remove(this.primitive),t&&t.length<2)return;if(t.length===this.positionArr.length/3){var r=t[0],a=t[1];this.positionArr=new Float64Array([r.x,r.y,r.z,a.x,a.y,a.z]),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr);}else {for(var i=[],o=[],l=[],s=0;s<t.length;s++)i.push(t[s].x),i.push(t[s].y),i.push(t[s].z),o.push(0),o.push(0),o.push(1),o.push(1);for(var c=0;c<t.length;c++)l.push(c);this.positionArr=new Float64Array(i),this.colorArr=new Float32Array(o),this.indiceArr=new Uint16Array(l),geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),appearance=this.createAppearence(this._fragmentShader,this._vertexShader);}this.primitive=this._viewer.scene.primitives.add(new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:false}));}else return},updateCartesianPositionColor:function(t,r){if(r.length===t.length*4)if(this.primitive!=null){if(viewer.scene.primitives.remove(this.primitive),t&&t.length<2)return;if(t.length===this.positionArr.length/3){var a=t[0],i=t[1];this.positionArr=new Float64Array([a.x,a.y,a.z,i.x,i.y,i.z]),this.colorArr=new Float32Array(r),geometry=CreateGeometry(this.positionArr,this.colorArr,this.indiceArr);}else {for(var o=[],l=[],s=0;s<t.length;s++)o.push(t[s].x),o.push(t[s].y),o.push(t[s].z);for(var s=0;s<t.length;s++)l.push(s);this.positionArr=new Float64Array(o),this.colorArr=new Float32Array(r),this.indiceArr=new Uint16Array(l),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader);}this.primitive=viewer.scene.primitives.add(new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:false}));}else return}},e.Scene.PointsPrimitive=m;},_installWaterPrimitive:function(){let m=this,t=function(r){this._positions=r.positions,this._url=r.img||this.getDfSt(["primitive","WaterPrimitive"])||"static/data/images/Textures/waterNormals.jpg",this._frequency=r.frequency||1e3,this._animationSpeed=r.animationSpeed||.01,this._amplitude=r.amplitude||10,this._extrudedHeight=r.extrudedHeight||0,this._viewer=m._viewer,this._fs=this.getFS();};t.prototype.build=function(){this._geometry=this._createGeometry(),this._appearance=this._createAppearence(),this.primitive=this._viewer.scene.primitives.add(new e.Primitive({allowPicking:false,geometryInstances:new e.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:false}));},t.prototype._createAppearence=function(){return new e.EllipsoidSurfaceAppearance({material:new e.Material({fabric:{type:"Water",uniforms:{normalMap:this._url,frequency:this._frequency,animationSpeed:this._animationSpeed,amplitude:this._amplitude}}}),fragmentShaderSource:this._fs})},t.prototype._createGeometry=function(){return new e.PolygonGeometry({polygonHierarchy:new e.PolygonHierarchy(e.Cartesian3.fromDegreesArray(this._positions)),extrudedHeight:this._extrudedHeight,perPositionHeight:true})},t.prototype.getFS=function(){var r=`
271
+ `;function a(i){i=m(i,m.EMPTY_OBJECT);var o=i.scene;if(!e.defined(o))throw new e.DeveloperError("scene is required.");this._scene=o;var l=o._context;if(!e.defined(l))throw new e.DeveloperError("context is required.");if(!e.defined(i.viewerPosition))throw new e.DeveloperError("this view position is required.");this._viewerPosition=i.viewerPosition,this._positions=void 0,this._indices=void 0,this._drawLineCommand=void 0,this._depthCamera=new e.Camera(o),this._depthCamera.position=this._viewerPosition,this._direction=0,this._pitch=0,this._horizontalFov=m(i.horizontalFov,60),this._verticalFov=m(i.verticalFov,45),this._cameraUpdated=false,this._targetPoint=this._viewerPosition.clone();var s=new e.Cartesian3(0,0,100),c=e.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);e.Matrix4.multiplyByPoint(c,s,this._targetPoint),this._distance=100,this._cameraUpdated=false,this._modelMatrix=new e.Matrix4,this._shadowMap=new e.ShadowMap({context:l,enabled:true,lightCamera:this._depthCamera,cascadesEnabled:false}),this.show=true,this._invisiblyColor=e.Color.RED,this._visiblyColor=e.Color.GREEN,this._shadowMap.useCustomColor=true,this.shadowMap._customColor={invisibly:e.Color.RED,visibly:e.Color.GREEN},this._initialize=function(){this._positions=new Float32Array(633),this._indices=new Uint16Array(408);var n=this._indices,h=0;n[h++]=0,n[h++]=1,n[h++]=0,n[h++]=21,n[h++]=0,n[h++]=85,n[h++]=0,n[h++]=105;for(var y=0,d=0;d<5;++d){y++;for(var x=0;x<20;++x)n[h++]=y++,n[h++]=y;}y++;for(var p=0;p<20;++p)for(var f=0;f<5;++f)n[h++]=y,n[h++]=5+y++;this._initialized=true;},this._debugLightFrustum=void 0,this._debugShow=true;}Object.defineProperties(a.prototype,{shadowMap:{get:function(){return this._shadowMap}},debugLightFrustum:{get:function(){return this._debugLightFrustum}},debugShow:{get:function(){return this._debugShow},set:function(i){this.shadowMap.debugShow=i,this._debugShow=i;}},invisiblyColor:{get:function(){return this._invisiblyColor},set:function(i){this._invisiblyColor=i;var o=this.shadowMap;o._customColor.invisibly=i;}},visiblyColor:{get:function(){return this._visiblyColor},set:function(i){this._visiblyColor=i;var o=this.shadowMap;o._customColor.visibly=i;}},viewerPosition:{get:function(){return this._viewerPosition},set:function(i){this._viewerPosition=i,this._cameraUpdated=false;}},direction:{get:function(){return this._direction},set:function(i){this._direction=i,this._cameraUpdated=false;}},pitch:{get:function(){return this._pitch},set:function(i){this._pitch=i,this._cameraUpdated=false;}},horizontalFov:{get:function(){return this._horizontalFov},set:function(i){this._horizontalFov=i,this._cameraUpdated=false,this._hintLineUpdated=false;}},verticalFov:{get:function(){return this._verticalFov},set:function(i){this._verticalFov=i,this._cameraUpdated=false,this._hintLineUpdated=false;}},distance:{get:function(){return this._distance},set:function(i){this._distance=i,this._cameraUpdated=false;}}}),a.prototype.setDebugFrustumEffect=function(i,o){if(this.debugShow){var l=this.debugLightFrustum._planesPrimitives,s=this.debugLightFrustum._outlinePrimitives;l.forEach(function(c){c.show=i;}),s.forEach(function(c){c.show=o;});}},a.prototype.update=function(i){if(this.show){this._cameraUpdated||(this._updateCamera(),this.debugShow&&(e.defined(this.debugLightFrustum)||(this._debugLightFrustum=new e.DebugCameraPrimitive({camera:this._depthCamera,color:e.Color.YELLOW,updateOnChange:true}),this.setDebugFrustumEffect(false,true))));var o=i.frustumSplits[1];i.frustumSplits[1]=this._distance,this._debugLightFrustum.update(i),i.frustumSplits[1]=o,i.shadowMaps.push(this.shadowMap);}},a.prototype._updateCamera=function(){this._depthCamera.frustum.near=.001*this._distance,this._depthCamera.frustum.far=this._distance,this._depthCamera.frustum.fov=e.Math.toRadians(Math.max(this._horizontalFov,this._verticalFov)),this._depthCamera.frustum.aspectRatio=this._horizontalFov/this._verticalFov,this._depthCamera.setView({destination:this._viewerPosition,orientation:{heading:e.Math.toRadians(this._direction),pitch:e.Math.toRadians(this._pitch)}}),this._modelMatrix=this._depthCamera.inverseViewMatrix,this._cameraUpdated=true;},a.prototype.setPoseByTargetPoint=function(i){this.distance=e.Cartesian3.distance(this._viewerPosition,i);var o=new e.Cartesian3,l=e.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);e.Matrix4.inverse(l,l),e.Matrix4.multiplyByPoint(l,i,o),e.Cartesian3.normalize(o,o),this.direction=e.Math.toDegrees(Math.atan2(o.x,o.y)),this.pitch=e.Math.toDegrees(Math.asin(o.z));},a.prototype._updateHintLine=function(i){var o,l,s,c,n=this._positions,h=e.Math.toRadians(this._horizontalFov),y=e.Math.toRadians(this._verticalFov),d=Math.tan(.5*h),x=Math.tan(.5*y);l=this._distance*d,c=this._distance*x,o=-l,s=-c;var p=new e.Cartesian3(o,s,-this._distance),f=new e.Cartesian3(l,c,0);e.Matrix4.multiplyByPoint(this._modelMatrix,p,p),e.Matrix4.multiplyByPoint(this._modelMatrix,f,f);var E=e.BoundingSphere.fromCornerPoints(p,f);if(i.cullingVolume.computeVisibility(E)===Intersect.OUTSIDE)return void(this._valid=false);this._valid=true;var S=0;n[S++]=0,n[S++]=0,n[S++]=0;for(var _,M,C=Math.PI-.5*h,P=h/4,A=0;A<5;++A){_=C+A*P;for(var b=c/(this._distance/Math.cos(_)),D=Math.atan(b),I=-D,k=D/10,T=0;T<21;++T)M=I+T*k,n[S++]=this._distance*Math.cos(M)*Math.sin(_),n[S++]=this._distance*Math.sin(M),n[S++]=this._distance*Math.cos(M)*Math.cos(_);}P=h/20;for(var O=0;O<21;++O){_=C+O*P;for(var b=c/(this._distance/Math.cos(_)),D=Math.atan(b),I=-D,k=D/2,F=0;F<5;++F)M=I+F*k,n[S++]=this._distance*Math.cos(M)*Math.sin(_),n[S++]=this._distance*Math.sin(M),n[S++]=this._distance*Math.cos(M)*Math.cos(_);}var G=i.context,B=e.Buffer.createIndexBuffer({context:G,typedArray:new Uint32Array(this._indices),usage:e.BufferUsage.STATIC_DRAW,indexDatatype:IndexDatatype.UNSIGNED_INT}),L=e.Buffer.createVertexBuffer({context:G,typedArray:e.ComponentDatatype.createTypedArray(e.ComponentDatatype.FLOAT,this._positions),usage:e.BufferUsage.STATIC_DRAW}),U=[];U.push({index:0,vertexBuffer:L,componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:false});var j=new e.VertexArray({context:G,attributes:U,indexBuffer:B});if(e.defined(this._drawLineCommand))this._drawLineCommand.vertexArray.destroy(),this._drawLineCommand.vertexArray=j,this._drawLineCommand.modelMatrix=this._modelMatrix,this._drawLineCommand.boundingVolume=E;else {var v=e.ShaderProgram.fromCache({context:G,vertexShaderSource:t,fragmentShaderSource:r}),w=e.RenderState.fromCache({depthTest:{enabled:true}}),R=this,z={u_bgColor:function(){return R._lineColor},u_modelViewMatrix:function(){return G.uniformState.modelView}};this._drawLineCommand=new e.DrawCommand({boundingVolume:E,modelMatrix:R._modelMatrix,primitiveType:e.PrimitiveType.LINES,vertexArray:j,shaderProgram:v,castShadows:false,receiveShadows:false,uniformMap:z,renderState:w,pass:e.Pass.OPAQUE});}this._hintLineUpdated=true;},e.Scene.ShadowPrimitive=a;},_installPointsPrimitive:function(){function m(t){t&&t.viewer&&t.Cartesians&&(this._vertexShader=this.getVSPolylie(),this._fragmentShader=this.getFSPolyline(),this._geometry=null,this._appearance=null,this._viewer=t.viewer,this.build(t));}m.prototype={build:function(t){if(t.Cartesians&&t.Cartesians.length>=2){var r=[],a=[],i=[];if(t.Colors&&t.Colors.length===t.Cartesians.length*4){for(var o=0;o<t.Cartesians.length;o++)r.push(t.Cartesians[o].x),r.push(t.Cartesians[o].y),r.push(t.Cartesians[o].z);a=t.Colors;}else for(var l=0;l<t.Cartesians.length;l++)r.push(t.Cartesians[l].x),r.push(t.Cartesians[l].y),r.push(t.Cartesians[l].z),a.push(0),a.push(0),a.push(1),a.push(1);for(var s=0;s<t.Cartesians.length;s++)i.push(s);this.positionArr=new Float64Array(r),this.colorArr=new Float32Array(a),this.indiceArr=new Uint16Array(i);}else {var c=e.Cartesian3.fromDegrees(0,0,-10),n=e.Cartesian3.fromDegrees(0,.001,-10);this.positionArr=new Float64Array([c.x,c.y,c.z,n.x,n.y,n.z]),this.colorArr=new Float32Array([0,0,1,1,0,0,1,1]),this.indiceArr=new Uint16Array([0,1]);}this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader),this.primitive=this._viewer.scene.primitives.add(new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:false}));},getVSPolylie:function(){return "in vec3 position3DHigh; in vec3 position3DLow; in vec4 color; out vec4 v_color; in float batchId; void main() { vec4 p = czm_computePosition(); v_color =color; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; gl_PointSize=4.0; } "},getFSPolyline:function(){return "in vec4 v_color; void main() { float d = distance(gl_PointCoord, vec2(0.5,0.5)); if(d < 0.5){ out_FragColor = v_color; }else{ discard; } } "},createAppearence:function(t,r){return new e.Appearance({renderState:{blending:e.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:true},depthMask:true},fragmentShaderSource:t,vertexShaderSource:r})},createGeometry:function(t,r,a){return new e.Geometry({attributes:{position:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t}),color:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:r})},indices:a,primitiveType:e.PrimitiveType.POINTS,boundingSphere:e.BoundingSphere.fromVertices(t)})},remove:function(){this.primitive!=null&&(this._viewer.scene.primitives.remove(this.primitive),this.primitive=null);},updateCartesianPosition:function(t){if(this.primitive!=null){if(this._viewer.scene.primitives.remove(this.primitive),t&&t.length<2)return;if(t.length===this.positionArr.length/3){var r=t[0],a=t[1];this.positionArr=new Float64Array([r.x,r.y,r.z,a.x,a.y,a.z]),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr);}else {for(var i=[],o=[],l=[],s=0;s<t.length;s++)i.push(t[s].x),i.push(t[s].y),i.push(t[s].z),o.push(0),o.push(0),o.push(1),o.push(1);for(var c=0;c<t.length;c++)l.push(c);this.positionArr=new Float64Array(i),this.colorArr=new Float32Array(o),this.indiceArr=new Uint16Array(l),geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),appearance=this.createAppearence(this._fragmentShader,this._vertexShader);}this.primitive=this._viewer.scene.primitives.add(new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:false}));}else return},updateCartesianPositionColor:function(t,r){if(r.length===t.length*4)if(this.primitive!=null){if(viewer.scene.primitives.remove(this.primitive),t&&t.length<2)return;if(t.length===this.positionArr.length/3){var a=t[0],i=t[1];this.positionArr=new Float64Array([a.x,a.y,a.z,i.x,i.y,i.z]),this.colorArr=new Float32Array(r),geometry=CreateGeometry(this.positionArr,this.colorArr,this.indiceArr);}else {for(var o=[],l=[],s=0;s<t.length;s++)o.push(t[s].x),o.push(t[s].y),o.push(t[s].z);for(var s=0;s<t.length;s++)l.push(s);this.positionArr=new Float64Array(o),this.colorArr=new Float32Array(r),this.indiceArr=new Uint16Array(l),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader);}this.primitive=viewer.scene.primitives.add(new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:false}));}else return}},e.Scene.PointsPrimitive=m;},_installWaterPrimitive:function(){let m=this,t=function(r){this._positions=r.positions,this._url=r.img||this.getDfSt(["primitive","WaterPrimitive"])||"static/data/images/Textures/waterNormals.jpg",this._frequency=r.frequency||1e3,this._animationSpeed=r.animationSpeed||.01,this._amplitude=r.amplitude||10,this._extrudedHeight=r.extrudedHeight||0,this._viewer=m._viewer,this._fs=this.getFS();};t.prototype.build=function(){this._geometry=this._createGeometry(),this._appearance=this._createAppearence(),this.primitive=this._viewer.scene.primitives.add(new e.Primitive({allowPicking:false,geometryInstances:new e.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:false}));},t.prototype._createAppearence=function(){return new e.EllipsoidSurfaceAppearance({material:new e.Material({fabric:{type:"Water",uniforms:{normalMap:this._url,frequency:this._frequency,animationSpeed:this._animationSpeed,amplitude:this._amplitude}}}),fragmentShaderSource:this._fs})},t.prototype._createGeometry=function(){return new e.PolygonGeometry({polygonHierarchy:new e.PolygonHierarchy(e.Cartesian3.fromDegreesArray(this._positions)),extrudedHeight:this._extrudedHeight,perPositionHeight:true})},t.prototype.getFS=function(){var r=`
272
272
  precision highp float;
273
273
  struct Light {
274
274
  vec3 position;
@@ -366,5 +366,5 @@ void main() {
366
366
  material.diffuse = color.rgb;
367
367
  material.alpha = a * color.a;
368
368
  return material;
369
- }`;return new e.Material({fabric:{type:"radarPrimitive",uniforms:{color:this._color,repeat:this._repeat,offset:this._offset,thickness:this._thickness},source:a},translucent:false})},r.prototype.remove=function(){this._preUpdate&&(this._viewer.scene.preUpdate.removeEventListener(this._preUpdate),this._preUpdate=null),this._radar&&(this._viewer.scene.primitives.remove(this._radar),this._radar=void 0);},r.prototype.destroy=function(){this.remove(),this._destroyed=true;},r.prototype.isDestroyed=function(){return this._destroyed===true},e.Scene.ProbingPrimitive=r;},_initCustomPrimitive:function(m){let t=e;function r({img:a,center:i,height1:o=0,height2:l=3e5,scale:s=.003}){this.drawCommand=null,this._texture=null,this._image=null,this.img=a,this.center=i,this.height1=o,this.height2=l,this.scale=s;}return r.prototype.update=function(a){this._destroyed!==true&&(this.drawCommand===null&&this.createDrawCommand(a.context),this._texture===null&&this.createTexture(a.context),a.commandList.push(this.drawCommand));},r.prototype.isDestroyed=function(){return this._destroyed===true},r.prototype.destroy=function(){this._texture&&!this._texture.isDestroyed()&&this._texture.destroy(),this._texture=null,this.drawCommand&&this.drawCommand.vertexArray&&!this.drawCommand.vertexArray.isDestroyed()&&this.drawCommand.vertexArray.destroy(),this.drawCommand=null,this._destroyed=true;},r.prototype.createTexture=function(a){this._image===null&&(this._image=new Image,this._image.src=this.img||"static/data/images/Textures/beautiful.jpg",this._image.onload=()=>{this._texture=new t.Texture({context:a,source:this._image});});},r.prototype.createDrawCommand=function(a){let i=this.createPyramidGeometry(),o=t.VertexArray.fromGeometry({context:a,geometry:i,attributeLocations:t.GeometryPipeline.createAttributeLocations(i)}),l=t.ShaderProgram.fromCache({context:a,vertexShaderSource:ce,fragmentShaderSource:le,attributeLocations:t.GeometryPipeline.createAttributeLocations(i)}),s=new t.Cartesian2(a.canvas.width,a.canvas.height),c={v1:()=>this.v1,v2:()=>this.v2,wenli:()=>this._texture!==null?this._texture:a.defaultTexture,iResolution:()=>s},n=t.RenderState.fromCache();this.drawCommand=new t.DrawCommand({vertexArray:o,shaderProgram:l,uniformMap:c,renderState:n,pass:t.Pass.OPAQUE});},r.prototype.createPyramidGeometry=function(){let a=this.height1,i=this.height2,o=this.scale,l=this.center||[104.057605,30.607196],s=f(l,[-o,o]),c=f(l,[o,o]),n=f(l,[-o,-o]),h=f(l,[o,o]),y=[],d=[0,1,3,0,1,2,0,2,4,0,3,4,1,2,3,2,3,4],x=[.5,.5,0,1,1,1,0,0,1,0];y.push(...p(l,a),...p(s),...p(c),...p(n),...p(h)),this.v1=new t.Cartesian3(...p(l,a)),this.v2=new t.Cartesian3(...p(l,i));function p(S,_=i){let M=t.Cartesian3.fromDegrees(...S,_);return [M.x,M.y,M.z]}function f(S,_){return [_[0]+S[0],_[1]+S[1]]}return new t.Geometry({attributes:{position:new t.GeometryAttribute({componentDatatype:t.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(y)}),st:new t.GeometryAttribute({componentDatatype:t.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(x)})},indices:d,boundingSphere:t.BoundingSphere.fromVertices(y)})},new r(m)},customPrimivive(m){return this._initCustomPrimitive(m)},_heatmap:function(){let m=null,t=1080,r=1920,a=[103.8258,30.58595,104.252263,30.87];return {getHeatmap({heatData:i,boundsArr:o,screenHeight:l,screenWidth:s}){a=o||a,l=l||t,s=s||r;let c=[];for(let h of i){let y=h.lng,d=h.lat,x=Math.round((y-a[0])/(a[2]-a[0])*r),p=t-Math.round((d-a[1])/(a[3]-a[1])*t);c.push({x,y:p,value:h.num});}return this.createHeatmap(c),this.createPrimitive()},createHeatmap(i){var o=document.createElement("div");o.setAttribute("style","width: "+r+"px; height: "+t+"px; margin: 0px; display: none;"),document.body.appendChild(o),m=he.create({container:o,radius:24,maxOpacity:1,minOpacity:.1,blur:.85,gradient:{".2":"blue",".4":"green",".6":"yellow",".8":"orange",".9":"red"}}),m.setData({min:0,max:100,data:i});},createPrimitive(){let i=new e.ImageMaterialProperty({image:m._renderer.canvas}),o=this.generateGeometryInstance(),l=new e.MaterialAppearance({material:e.Material.fromType(e.Material.ImageType,i.getValue(new e.JulianDate))}),s={geometryInstances:o,appearance:l,allowPicking:false,asynchronous:false,show:false};return new e.Primitive(s)},generateGeometryInstance(){let i=a[2]-a[0],o=a[3]-a[1],l=a[0],s=a[1],c=.001,n=.001,h=0,y=5,d=Math.floor(i/c),x=Math.floor(o/n),p=[];for(let P=0;P<x+1;P++){let A=[];for(let b=0;b<d+1;b++){let D=l+(b==d?i:b*c),I=s+(P==x?o:P*n),E={x:Math.round((D-l)/i*r),y:t-Math.round((I-s)/o*t)},T=m.getValueAt(E),O=m._renderer.ctx.getImageData(E.x,E.y,1,1).data;A.push([D,I,h+T*y,O.map(F=>F/255),[(D-l)/i,(I-s)/o]]);}p.push(A);}let f=[],k=[],S=[],_=[],C=0;for(let P=0;P<x;P++)for(let A=0;A<d;A++){let b=p[P][A],D=p[P][A+1],I=p[P+1][A+1],E=p[P+1][A];this.addVertices(b,f,S,_),this.addVertices(D,f,S,_),this.addVertices(I,f,S,_),this.addVertices(b,f,S,_),this.addVertices(I,f,S,_),this.addVertices(E,f,S,_),k.push(C+0,C+1,C+2,C+3,C+4,C+5),C+=6;}return new e.GeometryInstance({geometry:e.GeometryPipeline.computeNormal(this.generateGeometry(f,S,k,_))})},addVertices(i,o,l,s){let c=e.Cartesian3.fromDegrees(i[0],i[1],i[2]);o.push(c.x,c.y,c.z),l.push(i[3][0],i[3][1],i[3][2],i[3][3]),s.push(i[4][0],i[4][1]);},generateGeometry(i,o,l,s){var c=new e.GeometryAttributes({position:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:new Float64Array(i)}),color:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:new Float32Array(o)}),st:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(s)})});let n=e.BoundingSphere.fromVertices(i,new e.Cartesian3(0,0,0),3);return new e.Geometry({attributes:c,indices:l,primitiveType:e.PrimitiveType.TRIANGLES,boundingSphere:n})}}},createHeatmap3d(m){return this._heatmap().getHeatmap(m)}},g}var re=$(Pe);var tt=se([ie],re,"primitive");exports.Primitive=tt;//# sourceMappingURL=primitive.cjs.map
369
+ }`;return new e.Material({fabric:{type:"radarPrimitive",uniforms:{color:this._color,repeat:this._repeat,offset:this._offset,thickness:this._thickness},source:a},translucent:false})},r.prototype.remove=function(){this._preUpdate&&(this._viewer.scene.preUpdate.removeEventListener(this._preUpdate),this._preUpdate=null),this._radar&&(this._viewer.scene.primitives.remove(this._radar),this._radar=void 0);},r.prototype.destroy=function(){this.remove(),this._destroyed=true;},r.prototype.isDestroyed=function(){return this._destroyed===true},e.Scene.ProbingPrimitive=r;},_initCustomPrimitive:function(m){let t=e;function r({img:a,center:i,height1:o=0,height2:l=3e5,scale:s=.003}){this.drawCommand=null,this._texture=null,this._image=null,this.img=a,this.center=i,this.height1=o,this.height2=l,this.scale=s;}return r.prototype.update=function(a){this._destroyed!==true&&(this.drawCommand===null&&this.createDrawCommand(a.context),this._texture===null&&this.createTexture(a.context),a.commandList.push(this.drawCommand));},r.prototype.isDestroyed=function(){return this._destroyed===true},r.prototype.destroy=function(){this._texture&&!this._texture.isDestroyed()&&this._texture.destroy(),this._texture=null,this.drawCommand&&this.drawCommand.vertexArray&&!this.drawCommand.vertexArray.isDestroyed()&&this.drawCommand.vertexArray.destroy(),this.drawCommand=null,this._destroyed=true;},r.prototype.createTexture=function(a){this._image===null&&(this._image=new Image,this._image.src=this.img||"static/data/images/Textures/beautiful.jpg",this._image.onload=()=>{this._texture=new t.Texture({context:a,source:this._image});});},r.prototype.createDrawCommand=function(a){let i=this.createPyramidGeometry(),o=t.VertexArray.fromGeometry({context:a,geometry:i,attributeLocations:t.GeometryPipeline.createAttributeLocations(i)}),l=t.ShaderProgram.fromCache({context:a,vertexShaderSource:ce,fragmentShaderSource:le,attributeLocations:t.GeometryPipeline.createAttributeLocations(i)}),s=new t.Cartesian2(a.canvas.width,a.canvas.height),c={v1:()=>this.v1,v2:()=>this.v2,wenli:()=>this._texture!==null?this._texture:a.defaultTexture,iResolution:()=>s},n=t.RenderState.fromCache();this.drawCommand=new t.DrawCommand({vertexArray:o,shaderProgram:l,uniformMap:c,renderState:n,pass:t.Pass.OPAQUE});},r.prototype.createPyramidGeometry=function(){let a=this.height1,i=this.height2,o=this.scale,l=this.center||[104.057605,30.607196],s=f(l,[-o,o]),c=f(l,[o,o]),n=f(l,[-o,-o]),h=f(l,[o,o]),y=[],d=[0,1,3,0,1,2,0,2,4,0,3,4,1,2,3,2,3,4],x=[.5,.5,0,1,1,1,0,0,1,0];y.push(...p(l,a),...p(s),...p(c),...p(n),...p(h)),this.v1=new t.Cartesian3(...p(l,a)),this.v2=new t.Cartesian3(...p(l,i));function p(S,_=i){let M=t.Cartesian3.fromDegrees(...S,_);return [M.x,M.y,M.z]}function f(S,_){return [_[0]+S[0],_[1]+S[1]]}return new t.Geometry({attributes:{position:new t.GeometryAttribute({componentDatatype:t.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(y)}),st:new t.GeometryAttribute({componentDatatype:t.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(x)})},indices:d,boundingSphere:t.BoundingSphere.fromVertices(y)})},new r(m)},customPrimivive(m){return this._initCustomPrimitive(m)},_heatmap:function(){let m=null,t=1080,r=1920,a=[103.8258,30.58595,104.252263,30.87];return {getHeatmap({heatData:i,boundsArr:o,screenHeight:l,screenWidth:s}){a=o||a,l=l||t,s=s||r;let c=[];for(let h of i){let y=h.lng,d=h.lat,x=Math.round((y-a[0])/(a[2]-a[0])*r),p=t-Math.round((d-a[1])/(a[3]-a[1])*t);c.push({x,y:p,value:h.num});}return this.createHeatmap(c),this.createPrimitive()},createHeatmap(i){var o=document.createElement("div");o.setAttribute("style","width: "+r+"px; height: "+t+"px; margin: 0px; display: none;"),document.body.appendChild(o),m=he.create({container:o,radius:24,maxOpacity:1,minOpacity:.1,blur:.85,gradient:{".2":"blue",".4":"green",".6":"yellow",".8":"orange",".9":"red"}}),m.setData({min:0,max:100,data:i});},createPrimitive(){let i=new e.ImageMaterialProperty({image:m._renderer.canvas}),o=this.generateGeometryInstance(),l=new e.MaterialAppearance({material:e.Material.fromType(e.Material.ImageType,i.getValue(new e.JulianDate))}),s={geometryInstances:o,appearance:l,allowPicking:false,asynchronous:false,show:false};return new e.Primitive(s)},generateGeometryInstance(){let i=a[2]-a[0],o=a[3]-a[1],l=a[0],s=a[1],c=.001,n=.001,h=0,y=5,d=Math.floor(i/c),x=Math.floor(o/n),p=[];for(let P=0;P<x+1;P++){let A=[];for(let b=0;b<d+1;b++){let D=l+(b==d?i:b*c),I=s+(P==x?o:P*n),k={x:Math.round((D-l)/i*r),y:t-Math.round((I-s)/o*t)},T=m.getValueAt(k),O=m._renderer.ctx.getImageData(k.x,k.y,1,1).data;A.push([D,I,h+T*y,O.map(F=>F/255),[(D-l)/i,(I-s)/o]]);}p.push(A);}let f=[],E=[],S=[],_=[],C=0;for(let P=0;P<x;P++)for(let A=0;A<d;A++){let b=p[P][A],D=p[P][A+1],I=p[P+1][A+1],k=p[P+1][A];this.addVertices(b,f,S,_),this.addVertices(D,f,S,_),this.addVertices(I,f,S,_),this.addVertices(b,f,S,_),this.addVertices(I,f,S,_),this.addVertices(k,f,S,_),E.push(C+0,C+1,C+2,C+3,C+4,C+5),C+=6;}return new e.GeometryInstance({geometry:e.GeometryPipeline.computeNormal(this.generateGeometry(f,S,E,_))})},addVertices(i,o,l,s){let c=e.Cartesian3.fromDegrees(i[0],i[1],i[2]);o.push(c.x,c.y,c.z),l.push(i[3][0],i[3][1],i[3][2],i[3][3]),s.push(i[4][0],i[4][1]);},generateGeometry(i,o,l,s){var c=new e.GeometryAttributes({position:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:new Float64Array(i)}),color:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:new Float32Array(o)}),st:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(s)})});let n=e.BoundingSphere.fromVertices(i,new e.Cartesian3(0,0,0),3);return new e.Geometry({attributes:c,indices:l,primitiveType:e.PrimitiveType.TRIANGLES,boundingSphere:n})}}},createHeatmap3d(m){return this._heatmap().getHeatmap(m)}},g}var re=$(Pe);var tt=se([ie],re,"primitive");exports.Primitive=tt;//# sourceMappingURL=primitive.cjs.map
370
370
  //# sourceMappingURL=primitive.cjs.map