@soon-gis/effect
Version:
@soon-gis/effect 是 Cesium 的特效库,包含了很多特效
1,049 lines (1,044 loc) • 755 kB
JavaScript
import { createPropertyDescriptor as j, defined as P, Property as R, Color as l, Material as u, Event as x, Cartographic as E, Matrix4 as M, Transforms as H, Cartesian3 as p, CylinderGeometry as si, MaterialAppearance as st, GeometryInstance as q, Primitive as J, CallbackProperty as g, Math as c, ClassificationType as Tt, ImageMaterialProperty as Kt, GeoJsonDataSource as Oi, Cartesian2 as I, defaultValue as U, DistanceDisplayConditionGeometryInstanceAttribute as en, EllipsoidSurfaceAppearance as Nt, PolygonGeometry as ut, PolygonHierarchy as G, ColorGeometryInstanceAttribute as Ft, ScreenSpaceEventHandler as O, ScreenSpaceEventType as m, HeadingPitchRoll as z, ColorBlendMode as Fi, Cartesian4 as yt, Quaternion as dt, Matrix3 as ht, PostProcessStage as Jt, JulianDate as N, Ellipsoid as Et, EasingFunction as sn, Rectangle as ae, ClassificationPrimitive as qt, ShowGeometryInstanceAttribute as Qe, SceneTransforms as _, Entity as Wi, CylinderGraphics as nn, DistanceDisplayCondition as K, NearFarScalar as V, VerticalOrigin as Z, LabelStyle as Ct, SampledPositionProperty as Ot, VelocityOrientationProperty as se, SceneMode as X, EllipsoidGeometry as ni, Plane as Li, ClippingPlane as fs, ClippingPlaneCollection as oi, Model as ws, HeadingPitchRange as ys, PolylineDashMaterialProperty as W, TranslationRotationScale as Ye, ParticleSystem as Ze, ConeEmitter as Es, CircleEmitter as zi, HeightReference as Ii, BillboardCollection as on, LabelCollection as rn, SingleTileImageryProvider as an, PolylineMaterialAppearance as ln, PolylineGlowMaterialProperty as Cs, PathGraphics as hn, SvgPathBindingHandler as cn, knockout as zt, getElement as dn, EllipsoidGeodesic as hi, DeveloperError as $t, EventHelper as Ps, getTimestamp as Si, Ray as Ui, IntersectionTests as pn, BoundingSphere as un, loadCubeMap as mn, CubeMap as vn, BoxGeometry as rs, VertexFormat as gn, GeometryPipeline as An, VertexArray as fn, BufferUsage as wn, RenderState as yn, BlendingState as En, ShaderSource as Cn, ShaderProgram as Pn, destroyObject as Mn, DrawCommand as bn, PerspectiveFrustum as je, FrustumGeometry as ci, FrustumOutlineGeometry as di, PerInstanceColorAppearance as pi, Camera as _e, ShadowMap as Vi, PolylineArrowMaterialProperty as Ei, ClockRange as Gi, TimeIntervalCollection as Ni, TimeInterval as Qi, Texture as Ms, PixelFormat as bs, PixelDatatype as xs, WallGeometry as xn } from "cesium";
import * as S from "@turf/turf";
import { chart as Dn } from "highcharts";
import * as Ci from "echarts";
import Ln from "markdown-it-sanitizer";
import In from "markdown-it";
import as from "hammerjs";
import Sn from "video.js";
function Tn() {
let s = document.createElement("canvas");
s.width = 512, s.height = 512;
let t = s.getContext("2d"), e = t.createRadialGradient(256, 256, 0, 256, 256, 256);
return e.addColorStop(0.1, "rgba(255, 255, 255, 1.0)"), e.addColorStop(0.2, "rgba(255, 255, 255, 0.0)"), e.addColorStop(0.3, "rgba(255, 255, 255, 0.9)"), e.addColorStop(0.5, "rgba(255, 255, 255, 0.0)"), e.addColorStop(0.9, "rgba(255, 255, 255, 0.2)"), e.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 = e, t.fill(), t.restore(), s.toDataURL("image/png").replace("image/png", "image/octet-stream");
}
function Rn() {
let s = document.createElement("canvas");
s.width = 512, s.height = 512;
let t = s.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(), s.toDataURL("image/png").replace("image/png", "image/octet-stream");
}
function le(s) {
this._definitionChanged = new x(), this._color = void 0, this._colorSubscription = void 0, this.color = s;
}
Object.defineProperties(le.prototype, {
isConstant: {
get: function() {
return !1;
}
},
definitionChanged: {
get: function() {
return this._definitionChanged;
}
},
color: j("color")
});
le.prototype.getType = function(s) {
return "ConeGlowBottomCircle";
};
le.prototype.getValue = function(s, t) {
return P(t) || (t = {}), t.color = R.getValueOrClonedDefault(this._color, s, l.WHITE, t.color), t.image = u.ConeGlowBottomCircleImage, t;
};
le.prototype.equals = function(s) {
return this === s || s instanceof le && R.equals(this._color, s._color);
};
const Hn = le;
u.ConeGlowBottomCircleType = "ConeGlowBottomCircle";
u.ConeGlowBottomCircleImage = Tn();
u.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;
}`;
u._materialCache.addMaterial(u.ConeGlowBottomCircleType, {
fabric: {
type: u.ConeGlowBottomCircleType,
uniforms: {
color: new l(1, 0, 0, 0.5),
image: u.ConeGlowBottomCircleImage,
time: 0
},
source: u.ConeGlowBottomCircleSource
},
translucent: function(s) {
return !0;
}
});
function he(s) {
this._definitionChanged = new x(), this._color = void 0, this._colorSubscription = void 0, this.color = s;
}
Object.defineProperties(he.prototype, {
isConstant: {
get: function() {
return !1;
}
},
definitionChanged: {
get: function() {
return this._definitionChanged;
}
},
color: j("color")
});
he.prototype.getType = function(s) {
return "ConeGlowBottomRotateCircle";
};
he.prototype.getValue = function(s, t) {
return P(t) || (t = {}), t.color = R.getValueOrClonedDefault(this._color, s, l.WHITE, t.color), t.image = u.ConeGlowBottomRotateCircleImage, t;
};
he.prototype.equals = function(s) {
return this === s || s instanceof he && R.equals(this._color, s._color);
};
const Bn = he;
u.ConeGlowBottomRotateCircleType = "ConeGlowBottomRotateCircle";
u.ConeGlowBottomRotateCircleImage = Rn();
u.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;
}`;
u._materialCache.addMaterial(u.ConeGlowBottomRotateCircleType, {
fabric: {
type: u.ConeGlowBottomRotateCircleType,
uniforms: {
color: new l(1, 0, 0, 0.5),
image: u.ConeGlowBottomRotateCircleImage,
time: 0
},
source: u.ConeGlowBottomRotateCircleSource
},
translucent: function(s) {
return !0;
}
});
class kn {
constructor(t, e, i) {
this.viewer = t, this.position = e, this.style = i, this.height = i.height || 300, this.bottomRadius = i.bottomRadius || 30, this.color = i.color || l.AQUA, this.circleHeight = E.fromCartesian(e).height, this.addCone(), this.addBottomCircle(), this.addBottomRotateCircle();
}
addCone() {
var t = M.multiplyByTranslation(
H.eastNorthUpToFixedFrame(this.position),
new p(0, 0, this.height * 0.5),
new M()
), e = new si({
length: this.height,
topRadius: 0,
bottomRadius: this.bottomRadius * 0.7,
vertexFormat: st.MaterialSupport.TEXTURED.vertexFormat
}), i = new q({
geometry: e,
modelMatrix: t
});
this.cylinderPrimitive = this.viewer.scene.primitives.add(new J({
geometryInstances: [i],
appearance: new st({
material: new u({
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 += 0.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 Hn(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 Bn(this.color),
stRotation: new g((e) => (t--, t < 0 && (t = 360), c.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 ce(s, t) {
this._definitionChanged = new x(), this.color = s || l.YELLOW, this.speed = t || 10;
}
Object.defineProperties(ce.prototype, {
isConstant: {
get: function() {
return !1;
}
},
definitionChanged: {
get: function() {
return this._definitionChanged;
}
},
color: j("color")
});
ce.prototype.getType = function(s) {
return "Scanline";
};
ce.prototype.getValue = function(s, t) {
return P(t) || (t = {}), t.color = R.getValueOrClonedDefault(this.color, s, l.WHITE, t.color), t.speed = this.speed, t;
};
ce.prototype.equals = function(s) {
return this === s || s instanceof ce && R.equals(this.color, s.color) && R.equals(this.speed, s.speed);
};
const On = ce;
u.ScanlineType = "Scanline";
u.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;
} `;
u._materialCache.addMaterial(u.ScanlineType, {
fabric: {
type: u.ScanlineType,
uniforms: {
color: new l(1, 0, 0, 0.5),
time: 0,
speed: 10
},
source: u.ScanlineSource
},
translucent: function(s) {
return !0;
}
});
class Fn {
constructor(t, e, i) {
this.viewer = t, this.position = e, i = i || {}, this.radius = i.radius || 200, this.color = i.color || l.YELLOW, this.speed = i.speed || 10, this.addEnt();
}
addEnt() {
this.ent = this.viewer.entities.add({
position: this.position,
ellipse: {
semiMinorAxis: this.radius,
semiMajorAxis: this.radius,
material: new On(this.color, this.speed),
classificationType: Tt.BOTH
}
});
}
remove() {
this.viewer.remove(this.ent);
}
}
class Wn {
constructor(t, e, i) {
this.viewer = t, this.position = e, this.radius = i.radius, this.textureUrl = i.textureUrl, this.height = E.fromCartesian(e).height, this.entities = [], this.addEntities();
}
addEntities() {
let t = 0, e = [{
range: this.radius,
url: this.textureUrl + "/kedu.png",
color: new l(0.4, 0.4, 0.4, 0.8)
}, {
range: this.radius * 0.92,
url: this.textureUrl + "/fangxiang.png",
st: -0.05,
color: new l(0.4, 0.4, 0.4, 0.8)
}, {
range: this.radius * 0.85,
url: this.textureUrl + "/keduzhi.png",
color: new l(1, 1, 1, 0.2)
}, {
range: this.radius,
url: this.textureUrl + "/faguang.png",
color: new l(1, 1, 1, 0.5)
}], i;
e.forEach((n) => {
i = this.viewer.entities.add({
position: this.position,
ellipse: {
height: this.height,
semiMajorAxis: n.range,
semiMinorAxis: n.range,
material: new Kt({
image: n.url,
transparent: !0,
color: n.color ? n.color : new l(1, 1, 1, 0.7)
}),
stRotation: n.st ? n.st : 0
}
}), this.entities.push(i);
}), i = this.viewer.entities.add({
position: this.position,
ellipse: {
height: this.height,
semiMajorAxis: this.radius * 0.9,
semiMinorAxis: this.radius * 0.9,
material: new Kt({
image: this.textureUrl + "/banyuan.png",
transparent: !0,
color: new l(0.4, 0.4, 0.4, 0.4)
}),
stRotation: new g(function() {
return t += 5e-3;
}, !1)
}
}), this.entities.push(i);
}
remove() {
this.entities.forEach((t) => {
this.viewer.entities.remove(t);
}), this.entities = void 0;
}
}
class zn {
constructor(t, e, i) {
this.viewer = t, this.feature = e, this.options = i || {
bufCount: 50,
bufDis: 20,
color: l.WHITE
};
let n = this.multipleRingBuffer(e, this.options.bufCount, this.options.bufDis);
this.addRegionData(n, this.options.bufCount);
}
multipleRingBuffer(t, e, i) {
let n = [t];
for (let r = 1; r <= e; r++) {
let a = S.buffer(t, r * i, { units: "meters" });
a.properties.opacity = (e - r) / e, n.push(a);
}
for (let r = n.length - 1; r > 0; r--) {
const a = n[r];
n[r] = S.difference(a, n[r - 1]), n[r].properties.opt = a.properties.opacity;
}
return n = n.slice(-(n.length - 1)), S.featureCollection([
...n
]);
}
addRegionData(t, e) {
let i = Oi.load(t), n = 0;
i.then((o) => {
this.viewer.dataSources.add(o);
let r = o.entities.values;
for (let a = 0; a < r.length; a++) {
let h = r[a];
h.polygon.outline = !1, n = (e - a) / e * 0.8, h.polygon.material = this.options.color.withAlpha(n), h.alpha = n;
}
this.dataSource = o;
}).otherwise(function(o) {
console.log(o);
});
}
changeColor(t) {
let e = this.dataSource.entities.values;
for (let i = 0; i < e.length; i++) {
let n = e[i];
n.polygon.material = t.withAlpha(n.alpha);
}
}
remove() {
this.viewer.dataSources.remove(this.dataSource);
}
}
class Un {
constructor(t, e) {
var i = new J({
geometryInstances: new q({
geometry: t
}),
appearance: this.createMaterialAppearance(e)
});
return i;
}
createMaterialAppearance(t) {
return new st({
material: new u({
fabric: {
uniforms: {
color: t,
image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQ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tttt6uxxWmwmxp5EMiWi111B7ph/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 It(s, t, e) {
let i = [];
e = e || 360;
let n = parseInt(360 / e);
for (let o = 0; o <= 360; o += n)
i.push(Ue(s[0], s[1], o, t));
return i;
}
function Ue(s, t, e, i) {
let n = i * Math.sin(e * Math.PI / 180), o = i * Math.cos(e * Math.PI / 180), r = 6356725 + (6378137 - 6356725) * (90 - t) / 90, a = r * Math.cos(t * Math.PI / 180), h = (n / a + s * Math.PI / 180) * 180 / Math.PI, d = (o / r + t * Math.PI / 180) * 180 / Math.PI;
return [h, d];
}
function Vn(s, t, e) {
let i = s.canvas, n = new Image();
return n.src = i.toDataURL("image/png"), new Promise((o, r) => {
n.onload = function() {
i = document.createElement("canvas"), i.width = e, i.height = t, i.getContext("2d").drawImage(n, 0, 0, i.width, i.height), o(i.toDataURL("image/jpeg"));
};
});
}
function Gn(s) {
return {
heading: s.camera.heading,
pitch: s.camera.pitch,
roll: s.camera.roll,
x: s.camera.position.x,
y: s.camera.position.y,
z: s.camera.position.z
};
}
function Nn(s) {
const t = E.fromCartesian(s);
return [
c.toDegrees(t.longitude),
c.toDegrees(t.latitude),
t.height
];
}
function Qn(s) {
const t = E.fromCartesian(s);
return [
c.toDegrees(t.longitude),
c.toDegrees(t.latitude)
];
}
function Yn(s, t, e, i) {
let n = Zn(s[0], s[1], t[0], t[1], e, i), o = [];
for (let r in n)
o.push(n[r][0]), o.push(n[r][1]), o.push(n[r][2]);
return p.fromDegreesArrayHeights(o);
}
function Zn(s, t, e, i, n, o) {
let r = [t, 0], a = [(i + t) / 2, n], d = jn(r, a, [i, 0], o), v = [];
for (let f in d) {
let w = (e - s) * (d[f][0] - t) / (i - t) + s;
v.push([w, d[f][0], d[f][1]]);
}
return v;
}
function jn(s, t, e, i) {
var n = [{ x: s[0], y: s[1] }, { x: t[0], y: t[1] }, { x: e[0], y: e[1] }];
return _n(n, i || 100);
}
function _n(s, t) {
for (var e = [], i = 0; i < t; i++) {
var n = Xn(s, i / t);
e.push([n.x, n.y]);
}
return e;
}
function Xn(s, t) {
for (var e = s.length, i = 0, n = 0, o = function(h, d) {
for (var v = 1, f = 1; d > 0; )
v *= h, f *= d, h--, d--;
return v / f;
}, r = 0; r < e; r++) {
var a = s[r];
i += a.x * Math.pow(1 - t, e - 1 - r) * Math.pow(t, r) * o(e - 1, r), n += a.y * Math.pow(1 - t, e - 1 - r) * Math.pow(t, r) * o(e - 1, r);
}
return { x: i, y: n };
}
function Jn(s, t, e) {
let i = ls(s), n = i[0], o = i[1], r = i[2], a = ls(t), h = a[0], d = a[1], v = a[2], f = (h - n) / e, w = (d - o) / e, y = (v - r) / e;
for (var A = [], C = 0; C < e; C++) {
var L = Kn("rgb(" + parseInt(f * C + n) + "," + parseInt(w * C + o) + "," + parseInt(y * C + r) + ")");
A.push(L);
}
return A;
}
function ls(e) {
var t = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/, e = e.toLowerCase();
if (e && t.test(e)) {
if (e.length === 4) {
for (var i = "#", n = 1; n < 4; n += 1)
i += e.slice(n, n + 1).concat(e.slice(n, n + 1));
e = i;
}
for (var o = [], n = 1; n < 7; n += 2)
o.push(parseInt("0x" + e.slice(n, n + 2)));
return o;
} else
return e;
}
function Kn(s) {
var t = s, e = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
if (/^(rgb|RGB)/.test(t)) {
for (var i = t.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(","), n = "#", o = 0; o < i.length; o++) {
var r = Number(i[o]).toString(16);
r = r < 10 ? 0 + "" + r : r, r === "0" && (r += r), n += r;
}
return n.length !== 7 && (n = t), n;
} else if (e.test(t)) {
var a = t.replace(/#/, "").split("");
if (a.length === 6)
return t;
if (a.length === 3) {
for (var h = "#", o = 0; o < a.length; o += 1)
h += a[o] + a[o];
return h;
}
} else
return t;
}
const yh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
generateCirclePoints: It,
getCirclePoint: Ue,
getSceneImage: Vn,
pickCamera: Gn,
cartesian3ToCoordinates: Nn,
cartesian3ToLonLat: Qn,
parabola: Yn,
gradientColor: Jn
}, Symbol.toStringTag, { value: "Module" }));
class de {
constructor(t) {
this._definitionChanged = new x(), this._color = void 0, this._colorSubscription = void 0, this.color = t.color, this.img = t.img;
}
}
Object.defineProperties(de.prototype, {
isConstant: {
get: function() {
return !1;
}
},
definitionChanged: {
get: function() {
return this._definitionChanged;
}
},
color: j("color")
});
de.prototype.getType = function(s) {
return "CylinderGlowGradientWall";
};
de.prototype.getValue = function(s, t) {
return P(t) || (t = {}), t.color = R.getValueOrClonedDefault(this._color, s, l.WHITE, t.color), t.image = this.img, t;
};
de.prototype.equals = function(s) {
return this === s || s instanceof de && R.equals(this._color, s._color);
};
u.CylinderGlowGradientWallType = "CylinderGlowGradientWall";
u.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;
}`;
u._materialCache.addMaterial(u.CylinderGlowGradientWallType, {
fabric: {
type: u.CylinderGlowGradientWallType,
uniforms: {
color: new l(1, 0, 0, 0.5),
image: "",
time: 0
},
source: u.CylinderGlowGradientWallSource
},
translucent: function(s) {
return !0;
}
});
class pe {
constructor(t) {
this._definitionChanged = new x(), 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(pe.prototype, {
isConstant: {
get: function() {
return !1;
}
},
definitionChanged: {
get: function() {
return this._definitionChanged;
}
},
color: j("color")
});
pe.prototype.getType = function(s) {
return "CylinderGlowFlowWall";
};
pe.prototype.getValue = function(s, t) {
return P(t) || (t = {}), t.color = R.getValueOrClonedDefault(this._color, s, l.WHITE, t.color), t.time = (new Date().getTime() - this._time) % this.duration / this.duration, t.image = this.img, t;
};
pe.prototype.equals = function(s) {
return this === s || s instanceof pe && R.equals(this._color, s._color) && this.duration == s.duration;
};
u.CylinderGlowFlowWallType = "CylinderGlowFlowWall";
u.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;
}`;
u._materialCache.addMaterial(u.CylinderGlowFlowWallType, {
fabric: {
type: u.CylinderGlowFlowWallType,
uniforms: {
color: new l(1, 0, 0, 0.5),
image: "",
time: 0
},
source: u.CylinderGlowFlowWallSource
},
translucent: function(s) {
return !0;
}
});
class te {
constructor(t) {
this._definitionChanged = new x(), this._color = void 0, this._colorSubscription = void 0, this.color = t.color, this.img = t.img;
}
}
Object.defineProperties(te.prototype, {
isConstant: {
get: function() {
return !1;
}
},
definitionChanged: {
get: function() {
return this._definitionChanged;
}
},
color: j("color")
});
te.prototype.getType = function(s) {
return "CylinderGlowCircle";
};
te.prototype.getValue = function(s, t) {
return P(t) || (t = {}), t.color = R.getValueOrClonedDefault(this._color, s, l.WHITE, t.color), t.image = this.img, t;
};
te.prototype.equals = function(s) {
return this === s || s instanceof te && R.equals(this._color, s._color);
};
u.CylinderGlowCircleType = "CylinderGlowCircle";
u.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;
}`;
u._materialCache.addMaterial(u.CylinderGlowCircleType, {
fabric: {
type: u.CylinderGlowCircleType,
uniforms: {
color: new l(1, 0, 0, 0.5),
image: "",
time: 0
},
source: u.CylinderGlowCircleSource
},
translucent: function(s) {
return !0;
}
});
class qn {
constructor(t, e, i) {
this.viewer = t, i = i || {}, this.radius = i.radius || 100, this.cylinderHeight = i.cylinderHeight || 200, this.bottomCircleHeight = E.fromCartesian(e).height, this.generatePositions(e), this.wallMaterial = new de({
color: i.fillColor || l.WHITE,
img: i.textureUrl + "/4.png"
}), this.flowWallMaterial = new pe({
color: i.fillColor || l.WHITE,
duration: i.duration || 1e3,
img: i.textureUrl + "/3.png"
}), this.innerCircleMaterial = new te({
color: i.bottomInnerCircleColor || l.WHITE,
img: i.textureUrl + "/1.png"
}), this.outerrCircleMaterial = new te({
color: i.bottomOuterCircleColor || l.WHITE,
img: i.textureUrl + "/2.png"
}), this.addWall(), this.addFlowWall(), this.addInnerCircle(e), this.addOuterCircle(e);
}
generatePositions(t) {
let e = E.fromCartesian(t);
e.height < 0 && (e.height = 0);
let i = [c.toDegrees(e.longitude), c.toDegrees(e.latitude), e.height], n = It([i[0], i[1]], this.radius), o = this.pointsToPositions(n, i[2]);
this.setPositions(o);
}
pointsToPositions(t, e) {
let i = [];
return t.map((n) => {
i.push(p.fromDegrees(n[0], n[1], e));
}), i;
}
setPositions(t) {
this.positions = t || [], this.initHeights();
}
initHeights() {
let t = [], e = [];
this.positions.forEach((i) => {
const n = E.fromCartesian(i);
t.push(n.height), e.push(n.height + this.cylinderHeight);
}), this.minimumHeights = t, this.maximumHeights = e;
}
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 e = 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 g((i) => (e++, e < 0 && (e = 360), c.toRadians(e)), !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 I();
class $n {
constructor(t, e, i) {
this.viewer = t, this.position = e, this.cssColor = i, 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 e = document.createElement("p");
t.appendChild(e), 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, e = new I();
SceneTransforms.wgs84ToWindowCoordinates(this.viewer.scene, this.position, e), this.$htmlContainer.style.bottom = t - e.y + "px";
const i = this.$htmlContainer.offsetWidth;
this.$htmlContainer.style.left = e.x - i / 2 + "px";
const n = this.viewer.camera.position;
let o = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(n).height, r = o;
o += this.viewer.scene.globe.ellipsoid.maximumRadius, Cartesian3.distance(n, this.position) > o ? this.$htmlContainer.style.display = "none" : (this.$htmlContainer.style.display = "block", r < 8e4 ? this.$htmlContainer.style.display = "block" : this.$htmlContainer.style.display = "none");
}
remove() {
this.viewer.scene.postRender.removeEventListener(this.postRenderEventHandle, this), this.$htmlContainer.remove();
}
}
class to {
constructor(t, e, i) {
this.viewer = t, this.style = i, this.position = e, this.extrudedHeight = U(i.height, 1e3), this.u_color = U(i.color, l.fromCssColorString("#00ffff")), this._show = U(i.show, !0), this._distanceDisplayCondition = U(i.distanceDisplayCondition, new en());
var n = U(i.radius, 100);
this.topRadius = n / 100, this.topRadius = this.topRadius > 1 ? 1 : this.topRadius, this.inner_controlPoints = ti(this.position, n * 0.7), this.outer_controlPoints = ti(this.position, n), this.circular_clone_topPoints = ti(this.position, this.topRadius), this.circlePoints_2 = ti(this.position, n * 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 = cs(this.outer_controlPoints, this.circular_clone_topPoints, {
height: this.extrudedHeight,
distanceDisplayCondition: this._distanceDisplayCondition
});
this.primitive1 = new J({
geometryInstances: t,
appearance: new Nt({
material: new u({
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 = cs(this.inner_controlPoints, this.circular_clone_topPoints, {
height: this.extrudedHeight,
color: this.v_color,
distanceDisplayCondition: this._distanceDisplayCondition
}), e = new Nt({
material: new u({
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 J({
geometryInstances: t,
appearance: e,
asynchronous: !1
}), this.viewer.scene.primitives.add(this.primitive2);
}
addCircle() {
var t = E.fromCartesian(this.position), e = hs(this.circlePoints_2, {
perPositionHeight: t.height >= 1,
distanceDisplayCondition: this._distanceDisplayCondition
});
this.primitive3 = new J({
geometryInstances: e,
appearance: new Nt({
material: new u({
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.fromCartesian(this.position), e = hs(this.circlePoints_2, {
perPositionHeight: t.height >= 1,
distanceDisplayCondition: this._distanceDisplayCondition
});
this.primitive4 = new J({
geometryInstances: e,
appearance: new Nt({
material: new u({
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 e = new Image();
e.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAEACAYAAADSoXR2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjExQTg0NDEyMDEzQjExRUFBNDhBRjhGMUMzOUUy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PCgC7Jhzv44Qdh9yrru8V61jPgd645gD2io+15RiC5ZA5ENNPmGmDmtrta9YAVEQE2FlrQUM/J6efU8cSAD87ojodBaccS6kgiiErGiq/qe93XT+3oGU5BJnbyKrIUs6BQZoQUEcrQ7CYagiGqeKiMgnXLXsg5uJUm/RQJKy8fGS7PMw6SgVQPrJFGZr0kCfUL/7IFjIzrLGpemBQ0kPbehL6I9vMjUh6oEVEAAIQgAAEIAABdpyj0qcK71YrqGUJANNrv+sHOcAiRpDDM1cTY1BEHk7kqyP/2Ac5vLEEQEG8aDnIoTb5ObZRWg5ywG5o1dX4ClNYxT7IISgJPsXGpLut9MCWU0S5bqkmdAa3LQEwcZDAfkZ3tthQfkwNkVeeD6kiuaUabcp6DpS9YyalrAdQ8bT1EFQVUabarND9fNuyB2gREYAABCAAAQhAAAIQoM770UgBXARCIr/koDogVlzgrWuxemBKd0m4JnBed0+5ZQ9gn3BK5LK+P4y5ewoB8DFiKO91COLFfwVuTCZV1hSoYw1APZCsFIkbN1Haaa87wwiKQe6eT27AEX6esPVVd8/kOOdAz/oz9FE0p+uGIKUeqE5C8xgSKiICEIAABCAAAQhAAAIQgAAEIAABCECA6AA+sbkREyDUUYlKD6ggZwzRkr8tewBhusisv+0in5qE/hFchoZTE0TL4p8sTbtIpyahQ4Ag5fKpSVBmfdDECvQTZjoM0U9N6KgkwH9xY7PXpPiCmq5yuaLVldHIO7jgNi5XfOEhCqNh9udHV/RnC5YAUDTftdV4/ivvwEoRVS9XXPWa1FIT5ird8jpSB+BDN3rO8AaGMnGy0I0QRYTvdk6NkOsucuhGCMAgI8Q0isaHbmAevNMhiD4P6iZhstANGiQE2PEGCRo2NcgAsQDwKnxWFdlT17/duWU1BJmuHz6A5bwbEsCScgh+qAHit3Jr1oooOPExdRBLbeJjSpuwuy30AAH+CDAAPH5ltESNYl4AAAAASUVORK5CYII=", e.onload = function() {
this.image = this.drawCanvas(e), t && t();
}.bind(this);
}
drawCanvas(t) {
var e = document.createElement("canvas");
e.width = 64, e.height = 256;
var i = e.getContext("2d");
return i.clearRect(0, 0, 64, 256), i.drawImage(t, 0, 0), i.drawImage(t, 33, 0), e;
}
drawRingCanvas() {
var t = document.createElement("canvas");
t.width = 512, t.height = 512;
var e = t.getContext("2d");
return e.fillStyle = "rgba(255,255,255,0)", e.strokeStyle = "rgba(255, 255, 255,255)", e.setLineDash([50, 50]), e.lineWidth = 30, e.beginPath(), e.arc(256, 256, 150, 0, Math.PI * 2, !0), e.stroke(), e.restore(), t;
}
cirdrawGradientCircleCanvas() {
var t = document.createElement("canvas");
t.width = 512, t.height = 512;
var e = t.getContext("2d"), i = e.createRadialGradient(256, 256, 0, 256, 256, 256);
return i.addColorStop(0.1, "rgba(255, 255, 255, 1.0)"), i.addColorStop(0.2, "rgba(255, 255, 255, 0.0)"), i.addColorStop(0.3, "rgba(255, 255, 255, 0.9)"), i.addColorStop(0.5, "rgba(255, 255, 255, 0.0)"), i.addColorStop(0.9, "rgba(255, 255, 255, 0.2)"), i.addColorStop(1, "rgba(255, 255, 255, 1.0)"), e.clearRect(0, 0, 512, 512), e.beginPath(), e.arc(256, 256, 256, 0, Math.PI * 2, !0), e.fillStyle = i, e.fill(), e.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 hs(s, t) {
var e = new ut({
polygonHierarchy: new G(s),
perPositionHeight: t.perPositionHeight
});
return new q({
geometry: e,
attributes: {
distanceDisplayCondition: t.distanceDisplayCondition
}
});
}
function cs(s, t, e) {
for (var i = e.height, n = e.color || new l(0.5, 0.8, 1, 2), o = s.slice(), r = s.length, a = 2 * r, h = [], d = 1 / (r - 1), v = [], f = [], w = 0; w < r; w++) {
f.push(eo(t[w], i)), h.push(w * d), h.push(0);
var y = w + 1, A = (w + 1) % r, C = a - y;
v.push.apply(v, [C - 1, C, w]), v.push.apply(v, [w, A, C - 1]);
}
for (var L = 0; L < f.length; L++)
o.push(f[r - L - 1]), h.push(1 - L * d), h.push(1);