UNPKG

@soon-gis/effect

Version:

@soon-gis/effect 是 Cesium 的特效库,包含了很多特效

174 lines (170 loc) 665 kB
(function(E,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("cesium"),require("@turf/turf"),require("highcharts"),require("echarts"),require("markdown-it-sanitizer"),require("markdown-it"),require("hammerjs"),require("video.js")):typeof define=="function"&&define.amd?define(["exports","cesium","@turf/turf","highcharts","echarts","markdown-it-sanitizer","markdown-it","hammerjs","video.js"],e):(E=typeof globalThis<"u"?globalThis:E||self,e(E.Effect={},E.cesium,E.turf,E.highcharts,E.echarts$1,E.MarkdownItSanitizer,E.MarkdownIt,E.Hammer,E.videojs$1))})(this,function(E,e,Li,Ii,Ri,Hi,ki,Bi,Oi){"use strict";const oe=r=>r&&typeof r=="object"&&"default"in r?r:{default:r};function We(r){if(r&&r.__esModule)return r;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const i in r)if(i!=="default"){const n=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:()=>r[i]})}}return t.default=r,Object.freeze(t)}const w=We(Li),ue=We(Ri),Fi=oe(Hi),Wi=oe(ki),ze=oe(Bi),zi=oe(Oi);function Vi(){let r=document.createElement("canvas");r.width=512,r.height=512;let t=r.getContext("2d"),i=t.createRadialGradient(256,256,0,256,256,256);return i.addColorStop(.1,"rgba(255, 255, 255, 1.0)"),i.addColorStop(.2,"rgba(255, 255, 255, 0.0)"),i.addColorStop(.3,"rgba(255, 255, 255, 0.9)"),i.addColorStop(.5,"rgba(255, 255, 255, 0.0)"),i.addColorStop(.9,"rgba(255, 255, 255, 0.2)"),i.addColorStop(1,"rgba(255, 255, 255, 1.0)"),t.clearRect(0,0,512,512),t.beginPath(),t.arc(256,256,256,0,Math.PI*2,!0),t.fillStyle=i,t.fill(),t.restore(),r.toDataURL("image/png").replace("image/png","image/octet-stream")}function Ui(){let r=document.createElement("canvas");r.width=512,r.height=512;let t=r.getContext("2d");return t.clearRect(0,0,512,512),t.strokeStyle="rgb(255, 255, 0)",t.setLineDash([80,80]),t.lineWidth=30,t.arc(256,256,241,0,Math.PI*2,!0),t.stroke(),r.toDataURL("image/png").replace("image/png","image/octet-stream")}function ut(r){this._definitionChanged=new e.Event,this._color=void 0,this._colorSubscription=void 0,this.color=r}Object.defineProperties(ut.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:e.createPropertyDescriptor("color")}),ut.prototype.getType=function(r){return"ConeGlowBottomCircle"},ut.prototype.getValue=function(r,t){return e.defined(t)||(t={}),t.color=e.Property.getValueOrClonedDefault(this._color,r,e.Color.WHITE,t.color),t.image=e.Material.ConeGlowBottomCircleImage,t},ut.prototype.equals=function(r){return this===r||r instanceof ut&&e.Property.equals(this._color,r._color)};const Ve=ut;e.Material.ConeGlowBottomCircleType="ConeGlowBottomCircle",e.Material.ConeGlowBottomCircleImage=Vi(),e.Material.ConeGlowBottomCircleSource=`czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; vec4 colorImage = texture2D(image, vec2(st )); material.alpha = colorImage.a * color.a; material.diffuse = 1.5* color.rgb ; return material; }`,e.Material._materialCache.addMaterial(e.Material.ConeGlowBottomCircleType,{fabric:{type:e.Material.ConeGlowBottomCircleType,uniforms:{color:new e.Color(1,0,0,.5),image:e.Material.ConeGlowBottomCircleImage,time:0},source:e.Material.ConeGlowBottomCircleSource},translucent:function(r){return!0}});function yt(r){this._definitionChanged=new e.Event,this._color=void 0,this._colorSubscription=void 0,this.color=r}Object.defineProperties(yt.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:e.createPropertyDescriptor("color")}),yt.prototype.getType=function(r){return"ConeGlowBottomRotateCircle"},yt.prototype.getValue=function(r,t){return e.defined(t)||(t={}),t.color=e.Property.getValueOrClonedDefault(this._color,r,e.Color.WHITE,t.color),t.image=e.Material.ConeGlowBottomRotateCircleImage,t},yt.prototype.equals=function(r){return this===r||r instanceof yt&&e.Property.equals(this._color,r._color)};const Ue=yt;e.Material.ConeGlowBottomRotateCircleType="ConeGlowBottomRotateCircle",e.Material.ConeGlowBottomRotateCircleImage=Ui(),e.Material.ConeGlowBottomRotateCircleSource=`czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; vec4 colorImage = texture2D(image, vec2(st )); material.diffuse = 2.5 * color.rgb ; material.alpha = colorImage.a ; return material; }`,e.Material._materialCache.addMaterial(e.Material.ConeGlowBottomRotateCircleType,{fabric:{type:e.Material.ConeGlowBottomRotateCircleType,uniforms:{color:new e.Color(1,0,0,.5),image:e.Material.ConeGlowBottomRotateCircleImage,time:0},source:e.Material.ConeGlowBottomRotateCircleSource},translucent:function(r){return!0}});class Gi{constructor(t,i,n){this.viewer=t,this.position=i,this.style=n,this.height=n.height||300,this.bottomRadius=n.bottomRadius||30,this.color=n.color||e.Color.AQUA,this.circleHeight=e.Cartographic.fromCartesian(i).height,this.addCone(),this.addBottomCircle(),this.addBottomRotateCircle()}addCone(){var t=e.Matrix4.multiplyByTranslation(e.Transforms.eastNorthUpToFixedFrame(this.position),new e.Cartesian3(0,0,this.height*.5),new e.Matrix4),i=new e.CylinderGeometry({length:this.height,topRadius:0,bottomRadius:this.bottomRadius*.7,vertexFormat:e.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat}),n=new e.GeometryInstance({geometry:i,modelMatrix:t});this.cylinderPrimitive=this.viewer.scene.primitives.add(new e.Primitive({geometryInstances:[n],appearance:new e.MaterialAppearance({material:new e.Material({fabric:{type:"VtxfShader1",uniforms:{color:this.color,alpha:2},source:` uniform vec4 color; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; float dis = distance(st, vec2(0.5)); material.diffuse =2.9 * color.rgb; material.alpha = color.a * dis * alpha ; return material; } `},translucent:!1}),faceForward:!1,closed:!0})})),this.viewer.scene.preUpdate.addEventListener(this.preUpdateHandle,this)}preUpdateHandle(){this.cylinderPrimitive.appearance.material.uniforms.alpha+=.05,this.cylinderPrimitive.appearance.material.uniforms.alpha>2.5&&(this.cylinderPrimitive.appearance.material.uniforms.alpha=2)}addBottomCircle(){this.bottomCircle=this.viewer.entities.add({position:this.position,ellipse:{semiMinorAxis:this.bottomRadius*2,semiMajorAxis:this.bottomRadius*2,height:this.circleHeight,material:new Ve(this.color)}})}addBottomRotateCircle(){let t=360;this.bottomRotateCircle=this.viewer.entities.add({position:this.position,ellipse:{semiMinorAxis:this.bottomRadius*1.45,semiMajorAxis:this.bottomRadius*1.45,height:this.circleHeight,material:new Ue(this.color),stRotation:new e.CallbackProperty(i=>(t--,t<0&&(t=360),e.Math.toRadians(t)),!1)}})}remove(){this.viewer.scene.preUpdate.removeEventListener(this.preUpdateHandle,this),this.viewer.entities.remove(this.bottomRotateCircle),this.viewer.entities.remove(this.bottomCircle),this.viewer.scene.primitives.remove(this.cylinderPrimitive)}}function mt(r,t){this._definitionChanged=new e.Event,this.color=r||e.Color.YELLOW,this.speed=t||10}Object.defineProperties(mt.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:e.createPropertyDescriptor("color")}),mt.prototype.getType=function(r){return"Scanline"},mt.prototype.getValue=function(r,t){return e.defined(t)||(t={}),t.color=e.Property.getValueOrClonedDefault(this.color,r,e.Color.WHITE,t.color),t.speed=this.speed,t},mt.prototype.equals=function(r){return this===r||r instanceof mt&&e.Property.equals(this.color,r.color)&&e.Property.equals(this.speed,r.speed)};const Ge=mt;e.Material.ScanlineType="Scanline",e.Material.ScanlineSource=`uniform vec4 color; uniform float speed; float circle(vec2 uv, float r, float blur) { float d = length(uv) * 2.0; float c = smoothstep(r+blur, r, d); return c; } czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st - 0.5; material.diffuse =2.8 * color.rgb; material.emission = vec3(0); float t =fract(czm_frameNumber * speed / 1000.0); float s = 0.3; float radius1 = smoothstep(.0, s, t) * 0.5; float alpha1 = circle(st, radius1, 0.01) * circle(st, radius1, -0.01); float alpha2 = circle(st, radius1, 0.01 - radius1) * circle(st, radius1, 0.01); float radius2 = 0.5 + smoothstep(s, 1.0, t) * 0.5; float alpha3 = circle(st, radius1, radius2 + 0.01 - radius1) * circle(st, radius1, -0.01); material.alpha = smoothstep(1.0, s, t) * (alpha1 + alpha2*0.1 + alpha3*0.1); material.alpha *=color.a ; return material; } `,e.Material._materialCache.addMaterial(e.Material.ScanlineType,{fabric:{type:e.Material.ScanlineType,uniforms:{color:new e.Color(1,0,0,.5),time:0,speed:10},source:e.Material.ScanlineSource},translucent:function(r){return!0}});class Ni{constructor(t,i,n){this.viewer=t,this.position=i,n=n||{},this.radius=n.radius||200,this.color=n.color||e.Color.YELLOW,this.speed=n.speed||10,this.addEnt()}addEnt(){this.ent=this.viewer.entities.add({position:this.position,ellipse:{semiMinorAxis:this.radius,semiMajorAxis:this.radius,material:new Ge(this.color,this.speed),classificationType:e.ClassificationType.BOTH}})}remove(){this.viewer.remove(this.ent)}}class Qi{constructor(t,i,n){this.viewer=t,this.position=i,this.radius=n.radius,this.textureUrl=n.textureUrl,this.height=e.Cartographic.fromCartesian(i).height,this.entities=[],this.addEntities()}addEntities(){let t=0,i=[{range:this.radius,url:this.textureUrl+"/kedu.png",color:new e.Color(.4,.4,.4,.8)},{range:this.radius*.92,url:this.textureUrl+"/fangxiang.png",st:-.05,color:new e.Color(.4,.4,.4,.8)},{range:this.radius*.85,url:this.textureUrl+"/keduzhi.png",color:new e.Color(1,1,1,.2)},{range:this.radius,url:this.textureUrl+"/faguang.png",color:new e.Color(1,1,1,.5)}],n;i.forEach(o=>{n=this.viewer.entities.add({position:this.position,ellipse:{height:this.height,semiMajorAxis:o.range,semiMinorAxis:o.range,material:new e.ImageMaterialProperty({image:o.url,transparent:!0,color:o.color?o.color:new e.Color(1,1,1,.7)}),stRotation:o.st?o.st:0}}),this.entities.push(n)}),n=this.viewer.entities.add({position:this.position,ellipse:{height:this.height,semiMajorAxis:this.radius*.9,semiMinorAxis:this.radius*.9,material:new e.ImageMaterialProperty({image:this.textureUrl+"/banyuan.png",transparent:!0,color:new e.Color(.4,.4,.4,.4)}),stRotation:new e.CallbackProperty(function(){return t+=.005},!1)}}),this.entities.push(n)}remove(){this.entities.forEach(t=>{this.viewer.entities.remove(t)}),this.entities=void 0}}class Yi{constructor(t,i,n){this.viewer=t,this.feature=i,this.options=n||{bufCount:50,bufDis:20,color:e.Color.WHITE};let o=this.multipleRingBuffer(i,this.options.bufCount,this.options.bufDis);this.addRegionData(o,this.options.bufCount)}multipleRingBuffer(t,i,n){let o=[t];for(let s=1;s<=i;s++){let l=w.buffer(t,s*n,{units:"meters"});l.properties.opacity=(i-s)/i,o.push(l)}for(let s=o.length-1;s>0;s--){const l=o[s];o[s]=w.difference(l,o[s-1]),o[s].properties.opt=l.properties.opacity}return o=o.slice(-(o.length-1)),w.featureCollection([...o])}addRegionData(t,i){let n=e.GeoJsonDataSource.load(t),o=0;n.then(a=>{this.viewer.dataSources.add(a);let s=a.entities.values;for(let l=0;l<s.length;l++){let h=s[l];h.polygon.outline=!1,o=(i-l)/i*.8,h.polygon.material=this.options.color.withAlpha(o),h.alpha=o}this.dataSource=a}).otherwise(function(a){console.log(a)})}changeColor(t){let i=this.dataSource.entities.values;for(let n=0;n<i.length;n++){let o=i[n];o.polygon.material=t.withAlpha(o.alpha)}}remove(){this.viewer.dataSources.remove(this.dataSource)}}class Zi{constructor(t,i){var n=new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:t}),appearance:this.createMaterialAppearance(i)});return n}createMaterialAppearance(t){return new e.MaterialAppearance({material:new e.Material({fabric:{uniforms:{color:t,image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ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IPzSpe8JnrD7w5BOQlTAdJKHXwVN3eqJ5UMzfvzW1A7ahQy9xCl99VwzhhnYrIAJJqYNVTVYv15tttt6uxxWmwmxp5EMiWi111B7ph/QF1CwZVNrobItNgBtD4w5ghqYU97xNnMQlyT1XvQNItwD1xF6pHoqTtippM4AwgXtwJ98LbbUm6bwd2Mrvu3wMwNEvPQ4ev9Dpidb4HgNb3TcOL1B8oGR6nBhA65NQfQIpDHVOY0e26ITw1gMECBL6SVXpFklzPD7GsJ7YlM7LrZwAxb55yetximQqtP3AUrT9QoZWWuDBImvoD1qj+QGzDNKHPJFmuo5v4EDC0/sDgRUKHiCwI8p4BQEKnG09I5pnM8mSJpycxACzj2v/wixXLk6JTfwADYP2YHSuaMC3bDeoM4T43gGYRgxvGSeGBVDRmDmO/tHP9gX8GABdT4aBM6LURAAAAAElFTkSuQmCC",time:0},source:` czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; vec4 colorImage = texture2D(image, vec2(fract(st.t - time), st.t)); float powerRatio = fract(czm_frameNumber / 30.0) + 1.0; float alpha = pow(1.0 - st.t, powerRatio); material.alpha = colorImage.a * color.a *alpha; material.diffuse = 1.5 * color.rgb ; return material; } `},translucent:!0}),faceForward:!1,closed:!1})}}function J(r,t,i){let n=[];i=i||360;let o=parseInt(360/i);for(let a=0;a<=360;a+=o)n.push(_t(r[0],r[1],a,t));return n}function _t(r,t,i,n){let o=n*Math.sin(i*Math.PI/180),a=n*Math.cos(i*Math.PI/180),s=6356725+(6378137-6356725)*(90-t)/90,l=s*Math.cos(t*Math.PI/180),h=(o/l+r*Math.PI/180)*180/Math.PI,d=(a/s+t*Math.PI/180)*180/Math.PI;return[h,d]}function ji(r,t,i){let n=r.canvas,o=new Image;return o.src=n.toDataURL("image/png"),new Promise((a,s)=>{o.onload=function(){n=document.createElement("canvas"),n.width=i,n.height=t,n.getContext("2d").drawImage(o,0,0,n.width,n.height),a(n.toDataURL("image/jpeg"))}})}function _i(r){return{heading:r.camera.heading,pitch:r.camera.pitch,roll:r.camera.roll,x:r.camera.position.x,y:r.camera.position.y,z:r.camera.position.z}}function Xi(r){const t=e.Cartographic.fromCartesian(r);return[e.Math.toDegrees(t.longitude),e.Math.toDegrees(t.latitude),t.height]}function Ji(r){const t=e.Cartographic.fromCartesian(r);return[e.Math.toDegrees(t.longitude),e.Math.toDegrees(t.latitude)]}function Ki(r,t,i,n){let o=qi(r[0],r[1],t[0],t[1],i,n),a=[];for(let s in o)a.push(o[s][0]),a.push(o[s][1]),a.push(o[s][2]);return e.Cartesian3.fromDegreesArrayHeights(a)}function qi(r,t,i,n,o,a){let s=[t,0],l=[(n+t)/2,o],d=$i(s,l,[n,0],a),c=[];for(let v in d){let g=(i-r)*(d[v][0]-t)/(n-t)+r;c.push([g,d[v][0],d[v][1]])}return c}function $i(r,t,i,n){var o=[{x:r[0],y:r[1]},{x:t[0],y:t[1]},{x:i[0],y:i[1]}];return tn(o,n||100)}function tn(r,t){for(var i=[],n=0;n<t;n++){var o=en(r,n/t);i.push([o.x,o.y])}return i}function en(r,t){for(var i=r.length,n=0,o=0,a=function(h,d){for(var c=1,v=1;d>0;)c*=h,v*=d,h--,d--;return c/v},s=0;s<i;s++){var l=r[s];n+=l.x*Math.pow(1-t,i-1-s)*Math.pow(t,s)*a(i-1,s),o+=l.y*Math.pow(1-t,i-1-s)*Math.pow(t,s)*a(i-1,s)}return{x:n,y:o}}function nn(r,t,i){let n=Ne(r),o=n[0],a=n[1],s=n[2],l=Ne(t),h=l[0],d=l[1],c=l[2],v=(h-o)/i,g=(d-a)/i,A=(c-s)/i;for(var p=[],f=0;f<i;f++){var m=rn("rgb("+parseInt(v*f+o)+","+parseInt(g*f+a)+","+parseInt(A*f+s)+")");p.push(m)}return p}function Ne(i){var t=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/,i=i.toLowerCase();if(i&&t.test(i)){if(i.length===4){for(var n="#",o=1;o<4;o+=1)n+=i.slice(o,o+1).concat(i.slice(o,o+1));i=n}for(var a=[],o=1;o<7;o+=2)a.push(parseInt("0x"+i.slice(o,o+2)));return a}else return i}function rn(r){var t=r,i=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;if(/^(rgb|RGB)/.test(t)){for(var n=t.replace(/(?:\(|\)|rgb|RGB)*/g,"").split(","),o="#",a=0;a<n.length;a++){var s=Number(n[a]).toString(16);s=s<10?0+""+s:s,s==="0"&&(s+=s),o+=s}return o.length!==7&&(o=t),o}else if(i.test(t)){var l=t.replace(/#/,"").split("");if(l.length===6)return t;if(l.length===3){for(var h="#",a=0;a<l.length;a+=1)h+=l[a]+l[a];return h}}else return t}const on=Object.freeze(Object.defineProperty({__proto__:null,generateCirclePoints:J,getCirclePoint:_t,getSceneImage:ji,pickCamera:_i,cartesian3ToCoordinates:Xi,cartesian3ToLonLat:Ji,parabola:Ki,gradientColor:nn},Symbol.toStringTag,{value:"Module"}));class wt{constructor(t){this._definitionChanged=new e.Event,this._color=void 0,this._colorSubscription=void 0,this.color=t.color,this.img=t.img}}Object.defineProperties(wt.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:e.createPropertyDescriptor("color")}),wt.prototype.getType=function(r){return"CylinderGlowGradientWall"},wt.prototype.getValue=function(r,t){return e.defined(t)||(t={}),t.color=e.Property.getValueOrClonedDefault(this._color,r,e.Color.WHITE,t.color),t.image=this.img,t},wt.prototype.equals=function(r){return this===r||r instanceof wt&&e.Property.equals(this._color,r._color)},e.Material.CylinderGlowGradientWallType="CylinderGlowGradientWall",e.Material.CylinderGlowGradientWallSource=`czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; vec4 colorImage = texture2D(image, vec2(fract(st.t - time), st.t)); material.alpha = colorImage.a * color.a; material.diffuse = 1.9 * color.rgb ; return material; }`,e.Material._materialCache.addMaterial(e.Material.CylinderGlowGradientWallType,{fabric:{type:e.Material.CylinderGlowGradientWallType,uniforms:{color:new e.Color(1,0,0,.5),image:"",time:0},source:e.Material.CylinderGlowGradientWallSource},translucent:function(r){return!0}});class Ct{constructor(t){this._definitionChanged=new e.Event,this._color=void 0,this._colorSubscription=void 0,this.color=t.color,this.duration=t.duration,this._time=new Date().getTime(),this.img=t.img}}Object.defineProperties(Ct.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:e.createPropertyDescriptor("color")}),Ct.prototype.getType=function(r){return"CylinderGlowFlowWall"},Ct.prototype.getValue=function(r,t){return e.defined(t)||(t={}),t.color=e.Property.getValueOrClonedDefault(this._color,r,e.Color.WHITE,t.color),t.time=(new Date().getTime()-this._time)%this.duration/this.duration,t.image=this.img,t},Ct.prototype.equals=function(r){return this===r||r instanceof Ct&&e.Property.equals(this._color,r._color)&&this.duration==r.duration},e.Material.CylinderGlowFlowWallType="CylinderGlowFlowWall",e.Material.CylinderGlowFlowWallSource=`czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; vec4 colorImage = texture2D(image, vec2(fract(st.t - time), st.t)); material.alpha = colorImage.a * color.a; material.diffuse = 1.9 * color.rgb ; return material; }`,e.Material._materialCache.addMaterial(e.Material.CylinderGlowFlowWallType,{fabric:{type:e.Material.CylinderGlowFlowWallType,uniforms:{color:new e.Color(1,0,0,.5),image:"",time:0},source:e.Material.CylinderGlowFlowWallSource},translucent:function(r){return!0}});class ct{constructor(t){this._definitionChanged=new e.Event,this._color=void 0,this._colorSubscription=void 0,this.color=t.color,this.img=t.img}}Object.defineProperties(ct.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:e.createPropertyDescriptor("color")}),ct.prototype.getType=function(r){return"CylinderGlowCircle"},ct.prototype.getValue=function(r,t){return e.defined(t)||(t={}),t.color=e.Property.getValueOrClonedDefault(this._color,r,e.Color.WHITE,t.color),t.image=this.img,t},ct.prototype.equals=function(r){return this===r||r instanceof ct&&e.Property.equals(this._color,r._color)},e.Material.CylinderGlowCircleType="CylinderGlowCircle",e.Material.CylinderGlowCircleSource=`czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; vec4 colorImage = texture2D(image, vec2(st )); material.alpha = colorImage.a * color.a; material.diffuse = 1.5* color.rgb ; return material; }`,e.Material._materialCache.addMaterial(e.Material.CylinderGlowCircleType,{fabric:{type:e.Material.CylinderGlowCircleType,uniforms:{color:new e.Color(1,0,0,.5),image:"",time:0},source:e.Material.CylinderGlowCircleSource},translucent:function(r){return!0}});class an{constructor(t,i,n){this.viewer=t,n=n||{},this.radius=n.radius||100,this.cylinderHeight=n.cylinderHeight||200,this.bottomCircleHeight=e.Cartographic.fromCartesian(i).height,this.generatePositions(i),this.wallMaterial=new wt({color:n.fillColor||e.Color.WHITE,img:n.textureUrl+"/4.png"}),this.flowWallMaterial=new Ct({color:n.fillColor||e.Color.WHITE,duration:n.duration||1e3,img:n.textureUrl+"/3.png"}),this.innerCircleMaterial=new ct({color:n.bottomInnerCircleColor||e.Color.WHITE,img:n.textureUrl+"/1.png"}),this.outerrCircleMaterial=new ct({color:n.bottomOuterCircleColor||e.Color.WHITE,img:n.textureUrl+"/2.png"}),this.addWall(),this.addFlowWall(),this.addInnerCircle(i),this.addOuterCircle(i)}generatePositions(t){let i=e.Cartographic.fromCartesian(t);i.height<0&&(i.height=0);let n=[e.Math.toDegrees(i.longitude),e.Math.toDegrees(i.latitude),i.height],o=J([n[0],n[1]],this.radius),a=this.pointsToPositions(o,n[2]);this.setPositions(a)}pointsToPositions(t,i){let n=[];return t.map(o=>{n.push(e.Cartesian3.fromDegrees(o[0],o[1],i))}),n}setPositions(t){this.positions=t||[],this.initHeights()}initHeights(){let t=[],i=[];this.positions.forEach(n=>{const o=e.Cartographic.fromCartesian(n);t.push(o.height),i.push(o.height+this.cylinderHeight)}),this.minimumHeights=t,this.maximumHeights=i}addWall(){this.cylinderEntity=this.viewer.entities.add({wall:{positions:this.positions,minimumHeights:this.minimumHeights,maximumHeights:this.maximumHeights,material:this.wallMaterial}})}addFlowWall(){this.cylinderEntity1=this.viewer.entities.add({wall:{positions:this.positions,minimumHeights:this.minimumHeights,maximumHeights:this.maximumHeights,material:this.flowWallMaterial}})}addInnerCircle(t){this.innerCircle=this.viewer.entities.add({position:t,ellipse:{semiMinorAxis:this.radius*1.65,semiMajorAxis:this.radius*1.65,height:this.bottomCircleHeight,material:this.innerCircleMaterial}})}addOuterCircle(t){let i=360;this.outerCircle=this.viewer.entities.add({position:t,ellipse:{semiMinorAxis:this.radius*1.65,semiMajorAxis:this.radius*1.65,height:this.bottomCircleHeight,material:this.outerrCircleMaterial,stRotation:new e.CallbackProperty(n=>(i++,i<0&&(i=360),e.Math.toRadians(i)),!1)}})}remove(){this.viewer.entities.remove(this.cylinderEntity),this.viewer.entities.remove(this.cylinderEntity1),this.viewer.entities.remove(this.innerCircle),this.viewer.entities.remove(this.outerCircle)}}new e.Cartesian2;class sn{constructor(t,i,n){this.viewer=t,this.position=i,this.cssColor=n,this.initDom(),this.initEvent()}initDom(){this.$htmlContainer=document.createElement("div"),this.$htmlContainer.style="position:absolute;left:0px;bottom:0px;pointer-events: none";const t=document.createElement("div");t.classList.add("xt-animation-point"),t.style="color:"+this.cssColor||"red";const i=document.createElement("p");t.appendChild(i),this.$htmlContainer.appendChild(t),this.viewer.cesiumWidget.container.appendChild(this.$htmlContainer),this.viewer.scene.postRender.addEventListener(this.postRenderEvent,this)}initEvent(){this.viewer.scene.postRender.addEventListener(this.postRenderEventHandle,this)}postRenderEventHandle(){const t=this.viewer.scene.canvas.height,i=new e.Cartesian2;SceneTransforms.wgs84ToWindowCoordinates(this.viewer.scene,this.position,i),this.$htmlContainer.style.bottom=t-i.y+"px";const n=this.$htmlContainer.offsetWidth;this.$htmlContainer.style.left=i.x-n/2+"px";const o=this.viewer.camera.position;let a=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o).height,s=a;a+=this.viewer.scene.globe.ellipsoid.maximumRadius,Cartesian3.distance(o,this.position)>a?this.$htmlContainer.style.display="none":(this.$htmlContainer.style.display="block",s<8e4?this.$htmlContainer.style.display="block":this.$htmlContainer.style.display="none")}remove(){this.viewer.scene.postRender.removeEventListener(this.postRenderEventHandle,this),this.$htmlContainer.remove()}}class ln{constructor(t,i,n){this.viewer=t,this.style=n,this.position=i,this.extrudedHeight=e.defaultValue(n.height,1e3),this.u_color=e.defaultValue(n.color,e.Color.fromCssColorString("#00ffff")),this._show=e.defaultValue(n.show,!0),this._distanceDisplayCondition=e.defaultValue(n.distanceDisplayCondition,new e.DistanceDisplayConditionGeometryInstanceAttribute);var o=e.defaultValue(n.radius,100);this.topRadius=o/100,this.topRadius=this.topRadius>1?1:this.topRadius,this.inner_controlPoints=ae(this.position,o*.7),this.outer_controlPoints=ae(this.position,o),this.circular_clone_topPoints=ae(this.position,this.topRadius),this.circlePoints_2=ae(this.position,o*2),this.primitive1=null,this.primitive2=null,this.primitive3=null,this.primitive4=null,this.ringCanvas=this.drawRingCanvas(),this.gradientCircleCanvas=this.cirdrawGradientCircleCanvas(),this.draw()}draw(){var t=this;this.getParticleImage(function(){t.addOuter()}),this.addInner(),this.addCircle(),this.addRing()}addOuter(){var t=Ye(this.outer_controlPoints,this.circular_clone_topPoints,{height:this.extrudedHeight,distanceDisplayCondition:this._distanceDisplayCondition});this.primitive1=new e.Primitive({geometryInstances:t,appearance:new e.EllipsoidSurfaceAppearance({material:new e.Material({fabric:{uniforms:{u_color:this.u_color,image:this.image},source:`uniform vec4 u_color; czm_material czm_getMaterial(czm_materialInput materialInput){ czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; float time = fract(czm_frameNumber / 90.) ; vec2 new_st = fract(st-vec2(time,time)); vec4 color = texture2D(image,new_st); vec3 diffuse = color.rgb; float alpha = color.a; diffuse *= u_color.rgb; alpha *= u_color.a; alpha *= u_color.a; material.diffuse = diffuse; material.alpha = alpha * pow(1. - st.t,u_color.a); return material; }`}})}),asynchronous:!1}),this.viewer.scene.primitives.add(this.primitive1)}addInner(){var t=Ye(this.inner_controlPoints,this.circular_clone_topPoints,{height:this.extrudedHeight,color:this.v_color,distanceDisplayCondition:this._distanceDisplayCondition}),i=new e.EllipsoidSurfaceAppearance({material:new e.Material({fabric:{uniforms:{u_color:this.u_color},source:`uniform vec4 u_color; czm_material czm_getMaterial(czm_materialInput materialInput){ czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; float powerRatio = 1./(fract(czm_frameNumber / 30.0) + 1.) ; float alpha = pow(1. - st.t,powerRatio); vec4 color = vec4(u_color.rgb, alpha*u_color.a); material.diffuse = color.rgb; material.alpha = color.a; return material; }`}})});this.primitive2=new e.Primitive({geometryInstances:t,appearance:i,asynchronous:!1}),this.viewer.scene.primitives.add(this.primitive2)}addCircle(){var t=e.Cartographic.fromCartesian(this.position),i=Qe(this.circlePoints_2,{perPositionHeight:t.height>=1,distanceDisplayCondition:this._distanceDisplayCondition});this.primitive3=new e.Primitive({geometryInstances:i,appearance:new e.EllipsoidSurfaceAppearance({material:new e.Material({fabric:{uniforms:{u_color:this.u_color,image:this.gradientCircleCanvas},source:`czm_material czm_getMaterial(czm_materialInput materialInput){ czm_material material = czm_getDefaultMaterial(materialInput); vec4 tColor = u_color; vec2 st = materialInput.st; vec2 center = st - vec2(0.5,0.5); float length = length(center)/0.5; float time = 1. - abs(czm_frameNumber / 360. - 0.5); float param = 1. - step(length, 0.6);//\u5927\u4E8E0.6\u6A21\u7CCA\uFF0Crate = 0.6 float scale = param * length;// 0.6< length \u8FD4\u56DE0\uFF0C\u53CD\u4E4B\u8FD4\u56DE1. float alpha = param * (1.0 - abs(scale - 0.8) / 0.2);// 0.8 < length \u8FD4\u56DE0\uFF0C\u53CD\u4E4B\u8FD4\u56DE1. float param1 = step(length, 0.7);//\u5C0F\u4E8E0.5\u6A21\u7CCA float scale1 = param1 * length;// 0.6< length \u8FD4\u56DE0\uFF0C\u53CD\u4E4B\u8FD4\u56DE1. alpha += param1 * (1.0 - abs(scale1 - 0.35) / 0.35);// 0.8 < length \u8FD4\u56DE0\uFF0C\u53CD\u4E4B\u8FD4\u56DE1. material.diffuse = u_color.rgb * vec3(u_color.a); material.alpha = pow(alpha, 4.0); return material; }`}})}),asynchronous:!1}),this.viewer.scene.primitives.add(this.primitive3)}addRing(){var t=e.Cartographic.fromCartesian(this.position),i=Qe(this.circlePoints_2,{perPositionHeight:t.height>=1,distanceDisplayCondition:this._distanceDisplayCondition});this.primitive4=new e.Primitive({geometryInstances:i,appearance:new e.EllipsoidSurfaceAppearance({material:new e.Material({fabric:{uniforms:{u_color:this.u_color,image:this.ringCanvas},source:`czm_material czm_getMaterial(czm_materialInput materialInput){ czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; vec2 center = st - vec2(0.5,0.5); float time = -czm_frameNumber * 3.1415926 / 180.;//\u626B\u63CF\u901F\u5EA61\u5EA6 float sin_t = sin(time); float cos_t = cos(time); vec2 center_rotate = vec2(center.s*cos_t-center.t*sin_t+0.5,center.s*sin_t+center.t*cos_t+0.5); vec4 color = texture2D(image,center_rotate); vec3 tColor = color.rgb * u_color.rgb; tColor *= u_color.a; material.diffuse = tColor; float length = 2. - length(center)/0.5; material.alpha = color.a * pow(length, 0.5);//color.r = 0 \u62161 return material; }`}})}),asynchronous:!1}),this.viewer.scene.primitives.add(this.primitive4)}destroy(){this.primitive1&&this.viewer.scene.primitives.remove(this.primitive1),this.primitive2&&this.viewer.scene.primitives.remove(this.primitive2),this.primitive3&&this.viewer.scene.primitives.remove(this.primitive3),this.primitive4&&this.viewer.scene.primitives.remove(this.primitive4)}remove(){this.destroy()}getParticleImage(t){var i=new Image;i.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAEACAYAAADSoXR2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpV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GpLut9MCWU0S5bqkmdAa3LQEwcZDAfkZ3tthQfkwNkVeeD6kiuaUabcp6DpS9YyalrAdQ8bT1EFQVUabarND9fNuyB2gREYAABCAAAQhAAAIQoM770UgBXARCIr/koDogVlzgrWuxemBKd0m4JnBed0+5ZQ9gn3BK5LK+P4y5ewoB8DFiKO91COLFfwVuTCZV1hSoYw1APZCsFIkbN1Haaa87wwiKQe6eT27AEX6esPVVd8/kOOdAz/oz9FE0p+uGIKUeqE5C8xgSKiICEIAABCAAAQhAAAIQgAAEIAABCECA6AA+sbkREyDUUYlKD6ggZwzRkr8tewBhusisv+0in5qE/hFchoZTE0TL4p8sTbtIpyahQ4Ag5fKpSVBmfdDECvQTZjoM0U9N6KgkwH9xY7PXpPiCmq5yuaLVldHIO7jgNi5XfOEhCqNh9udHV/RnC5YAUDTftdV4/ivvwEoRVS9XXPWa1FIT5ird8jpSB+BDN3rO8AaGMnGy0I0QRYTvdk6NkOsucuhGCMAgI8Q0isaHbmAevNMhiD4P6iZhstANGiQE2PEGCRo2NcgAsQDwKnxWFdlT17/duWU1BJmuHz6A5bwbEsCScgh+qAHit3Jr1oooOPExdRBLbeJjSpuwuy30AAH+CDAAPH5ltESNYl4AAAAASUVORK5CYII=",i.onload=function(){this.image=this.drawCanvas(i),t&&t()}.bind(this)}drawCanvas(t){var i=document.createElement("canvas");i.width=64,i.height=256;var n=i.getContext("2d");return n.clearRect(0,0,64,256),n.drawImage(t,0,0),n.drawImage(t,33,0),i}drawRingCanvas(){var t=document.createElement("canvas");t.width=512,t.height=512;var i=t.getContext("2d");return i.fillStyle="rgba(255,255,255,0)",i.strokeStyle="rgba(255, 255, 255,255)",i.setLineDash([50,50]),i.lineWidth=30,i.beginPath(),i.arc(256,256,150,0,Math.PI*2,!0),i.stroke(),i.restore(),t}cirdrawGradientCircleCanvas(){var t=document.createElement("canvas");t.width=512,t.height=512;var i=t.getContext("2d"),n=i.createRadialGradient(256,256,0,256,256,256);return n.addColorStop(.1,"rgba(255, 255, 255, 1.0)"),n.addColorStop(.2,"rgba(255, 255, 255, 0.0)"),n.addColorStop(.3,"rgba(255, 255, 255, 0.9)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.0)"),n.addColorStop(.9,"rgba(255, 255, 255, 0.2)"),n.addColorStop(1,"rgba(255, 255, 255, 1.0)"),i.clearRect(0,0,512,512),i.beginPath(),i.arc(256,256,256,0,Math.PI*2,!0),i.fillStyle=n,i.fill(),i.restore(),t}get show(){return this._show}set show(t){this._show=t,this.primitive1&&(this.primitive1.show=t),this.primitive2&&(this.primitive2.show=t),this.primitive3&&(this.primitive3.show=t),this.primitive4&&(this.primitive4.show=t)}}function Qe(r,t){var i=new e.PolygonGeometry({polygonHierarchy:new e.PolygonHierarchy(r),perPositionHeight:t.perPositionHeight});return new e.GeometryInstance({geometry:i,attributes:{distanceDisplayCondition:t.distanceDisplayCondition}})}function Ye(r,t,i){for(var n=i.height,o=i.color||new e.Color(.5,.8,1,2),a=r.slice(),s=r.length,l=2*s,h=[],d=1/(s-1),c=[],v=[],g=0;g<s;g++){v.push(hn(t[g],n)),h.push(g*d),h.push(0);var A=g+1,p=(g+1)%s,f=l-A;c.push.apply(c,[f-1,f,g]),c.push.apply(c,[g,p,f-1])}for(var m=0;m<v.length;m++)a.push(v[s-m-1]),h.push(1-m*d),h.push(1);var C=new e.PolygonGeometry({polygonHierarchy:new e.PolygonHierarchy(a),perPositionHeight:!0});return C=e.PolygonGeometry.createGeometry(C),C.indices=c,C.attributes.st.values=h,new e.GeometryInstance({geometry:C,attributes:{color:e.ColorGeometryInstanceAttribute.fromColor(o),distanceDisplayCondition:i.distanceDisplayCondition}})}function hn(r,t){if(t=Number(t)||0,isNaN(t)||t==0)return r;if(r instanceof Array){for(var i=[],n=0,o=r.length;n<o;n++){var a=e.Cartographic.fromCartesian(r[n]),s=e.Cartesian3.fromRadians(a.longitude,a.latitude,a.height+t);i.push(s)}return i}else{var a=e.Cartographic.fromCartesian(r);return e.Cartesian3.fromRadians(a.longitude,a.latitude,a.height+t)}}function ae(r,t){for(var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:120,n=[],o=e.Transforms.eastNorthUpToFixedFrame(r),a=2*Math.PI/i,s=2*Math.PI*270/360,l=0;l<i;l++){var h=s-a*l,d=new e.Cartesian3(Math.sin(h)*t,Math.cos(h)*t,0);n.push(e.Matrix4.multiplyByPoint(o,d,new e.Cartesian3))}return n.push(n[0]),n}const dn={ConeGlow:Gi,ConeGlowExt:ln,Scanline:Ni,RotatingDial:Qi,HighlightBoundary:Yi,BreathingWallPrimitive:Zi,CylinderGlow:an,AnimatePoint:sn};class cn{constructor(t,i,n){this.viewer=t,this.tileset=i,this.clickHighlight=n.clickHighlight,this.color=n.color||"0.2, 0.5, 1.0, 1.0",this.glowRange=n.glowRange,this.axis=n.axis||"z",this.glowRangeHeight=n.glowRangeHeight||"100.0",this.shader=n.shader||this.getShader(),this.selctedFeature={},this.addEvent()}addEvent(){this.tileset.tileVisible.addEventListener(this.tileVisibleEventHandler,this),this.handler=new e.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.handler.setInputAction(t=>{if(!this.clickHighlight)return;let i=this.viewer.scene.pick(t.position);this.selctedFeature.feature&&(this.selctedFeature.feature.color=this.selctedFeature.color,this.selctedFeature.feature=void 0),i&&(this.selctedFeature.feature=i,this.selctedFeature.color=i.color,this.selctedFeature.feature.color=e.Color.YELLOW)},e.ScreenSpaceEventType.LEFT_CLICK)}tileVisibleEventHandler(t){let i=t.content,n=i.featuresLength;for(let o=0;o<n;o+=2){let s=i.getFeature(o).content._model;s&&s._sourcePrograms&&s._rendererResources&&(Object.keys(s._sourcePrograms).forEach(l=>{let h=s._sourcePrograms[l];this.originalShader||(this.originalShader=s._rendererResources.sourceShaders[h.fragmentShader]),s._rendererResources.sourceShaders[h.fragmentShader]=this.shader}),s._shouldRegenerateShaders=!0)}}updateStyle(t){this.clickHighlight=t.clickHighlight,this.color=t.color||"0.2, 0.5, 1.0, 1.0",this.glowRange=t.glowRange,this.axis=t.axis,this.glowRangeHeight=t.glowRangeHeight||"100.0",this.shader=t.shader||this.getShader()}getShader(){const t=this.axis;return this.glowRange?`varying vec3 v_positionEC; void main(void){ vec4 position = czm_inverseModelView * vec4(v_positionEC,1); // \u4F4D\u7F6E float glowRange =${this.glowRangeHeight}; // \u5149\u73AF\u7684\u79FB\u52A8\u8303\u56F4(\u9AD8\u5EA6) gl_FragColor = vec4(${this.color}); // \u989C\u8272 gl_FragColor *= vec4(vec3(position.${t} / glowRange), 1.0); // \u6E10\u53D8 // \u52A8\u6001\u5149\u73AF float time = fract(czm_frameNumber / 360.0); time = abs(time - 0.5) * 2.0; float diff = step(0.005, abs( clamp(position.${t} / glowRange, 0.0, 1.0) - time)); gl_FragColor.rgb += gl_FragColor.rgb * (1.0 - diff); } `:`varying vec3 v_positionEC; void main(void){ vec4 position = czm_inverseModelView * vec4(v_positionEC,1); // \u4F4D\u7F6E gl_FragColor = vec4(${this.color}); // \u989C\u8272 gl_FragColor *= vec4(vec3(position.${t} / glowRange), 1.0); // \u6E10\u53D8 } `}remove(){this.shader=this.originalShader,this.viewer.scene.requestRender(),this.selctedFeature.feature&&(this.selctedFeature.feature.color=this.selctedFeature.color,this.selctedFeature.feature=void 0),this.handler.destroy()}}class pn{constructor(t,i){return this.style=i||{},this.primitive=this.createPrimitive(t),this.primitive.updateColor=n=>{this.primitive.appearance.material.uniforms.color=n},this.primitive}createPrimitive(t){const i=new e.PolygonGeometry({polygonHierarchy:new e.PolygonHierarchy(t),extrudedHeight:this.style.extrudedHeight||20}),n=new e.GeometryInstance({geometry:i});return new e.Primitive({geometryInstances:[n],appearance:this.getAppear(),releaseGeometryInstances:!1,compressVertices:!1})}getAppear(){return new e.MaterialAppearance({material:new e.Material({fabric:{type:"BuildGradientPrimitive",uniforms:{color:this.style.color||new e.Color(.2,1,0,.6)},source:` uniform vec4 color; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; material.diffuse = color.rgb; float alpha = pow(st.t,1.0); material.alpha = color.a * alpha; return material; } `},translucent:!0}),faceForward:!1,closed:!1})}}class vn{constructor(t,i,n){this.viewer=t,this.position=i,this.style=n||{},this.addPyramidModel(),this.addCilcle()}addPyramidModel(){let t=new e.HeadingPitchRoll(e.Math.toRadians(0),e.Math.toRadians(0),e.Math.toRadians(0)),i=e.Math.toRadians(2);this.modelEntity=this.viewer.entities.add({position:this.position,orientation:new e.CallbackProperty(n=>(t.heading+=i,e.Transforms.headingPitchRollQuaternion(this.position,t)),!1),model:{uri:this.style.modelUrl||"static/glb/pyramid.glb",scale:this.style.scale||80,color:e.Color.YELLOW.withAlpha(.8),colorBlendMode:e.ColorBlendMode.MIX}})}addCilcle(){let t=0;this.circle=this.viewer.entities.add({position:this.position,ellipse:{height:this.style.circleHeight||0,semiMinorAxis:this.style.circleRadius||300,semiMajorAxis:this.style.circleRadius||300,material:new e.ImageMaterialProperty({image:this.style.circleImage||"static/images/circle/circular_03.png",transparent:.1}),stRotation:new e.CallbackProperty(i=>(t-=.002,t),!1)}})}remove(){this.viewer.entities.remove(this.modelEntity),this.viewer.entities.remove(this.circle)}}const gn={CustomShaderEffect:cn,GradientBuilding:pn,RotatingPyramid:vn};class Et{constructor(t){this._definitionChanged=new e.Event,this._color=void 0,this._colorSubscription=void 0,this.color=t.color,this.duration=t.duration,this._time=new Date().getTime()}}Object.defineProperties(Et.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._de