人员聚集告警地图显示

pull/3/head
fangjiakai 2024-02-28 10:44:18 +08:00
parent 46f099a696
commit ab5d7f4378
7 changed files with 1665 additions and 1340 deletions

View File

@ -1,31 +1,142 @@
var CustomCesium;
(() => {
"use strict";
var e = {
d: (t, i) => {
for (var r in i) e.o(i, r) && !e.o(t, r) && Object.defineProperty(t, r, {enumerable: !0, get: i[r]})
}, o: (e, t) => Object.prototype.hasOwnProperty.call(e, t), r: e => {
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {value: "Module"}), Object.defineProperty(e, "__esModule", {value: !0})
var __webpack_modules__ = {
117: (__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.d(__webpack_exports__, {Z: () => Radar});
class Radar {
constructor(e) {
this.viewer = e.viewer, this.icy = e, this.entity = null, this.entity1 = null, this.timer = null
}
}, t = {};
e.r(t), e.d(t, {
add(positions, color, coneData, canvas, coneId, billboardId) {
this.entity = this.viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(positions[0], positions[1], positions[2]),
name: "圆锥",
id: coneId,
cylinder: {
length: coneData.height,
topRadius: 0,
bottomRadius: coneData.width,
disableDepthTestDistance: 5e5,
material: new CircleRippleMaterialProperty({
color: new Cesium.Color.fromCssColorString(color),
speed: 10,
count: 3,
gradient: .5
})
}
});
let imgUrl = new Image;
imgUrl.src = canvas.toDataURL("image/jpg"), imgUrl.style.borderRadius = "20px", this.entity1 = this.viewer.entities.add({
name: "聚集铭牌",
id: billboardId,
position: Cesium.Cartesian3.fromDegrees(positions[0], positions[1], eval(positions[2] + coneData.height / 2)),
billboard: {
image: imgUrl,
show: !0,
sizeInMeters: !1,
scaleByDistance: new Cesium.NearFarScalar(0, .5, 1e7, .5),
// disableDepthTestDistance: Number.POSITIVE_INFINITY,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
disableDepthTestDistance: 5e5,
scale: 1
}
}), this.animate()
}
animate() {
let e = 0;
this.timer = setInterval((() => {
this.entity1.billboard.scale >= 1.5 ? e = 1 : this.entity1.billboard.scale <= 1 && (e = 0), 0 == e ? this.entity1.billboard.scale += .05 : this.entity1.billboard.scale -= .05
}), 50)
}
show(e) {
this.entity.show = e, this.entity1.show = e, e ? this.animate() : clearInterval(this.timer)
}
destroy() {
clearInterval(this.timer), this.icy.viewer.entities.remove(this.entity), this.entity = void 0, this.icy.viewer.entities.remove(this.entity1), this.entity1 = void 0
}
}
function CircleRippleMaterialProperty(e) {
this._definitionChanged = new Cesium.Event, this._color = void 0, this._speed = void 0, this.color = e.color, this.speed = e.speed, this.count = e.count, this.gradient = e.gradient
}
CircleRippleMaterialProperty.prototype = {
get isConstant() {
return !1
}, get definitionChanged() {
return this._definitionChanged
}, getType: function (e) {
return Cesium.Material.CircleRippleMaterialType
}, getValue: function (e, t) {
return Cesium.defined(t) || (t = {}), t.color = Cesium.Property.getValueOrDefault(this._color, e, Cesium.Color.RED, t.color), t.speed = Cesium.Property.getValueOrDefault(this._speed, e, 10, t.speed), t.count = this.count, t.gradient = this.gradient, t
}, equals: function (e) {
return this === e || e instanceof CircleRippleMaterialProperty && Cesium.Property.equals(this._color, e._color) && Cesium.Property.equals(this._speed, e._speed) && Cesium.Property.equals(this.count, e.count) && Cesium.Property.equals(this.gradient, e.gradient)
}
}, Object.defineProperties(CircleRippleMaterialProperty.prototype, {
color: Cesium.createPropertyDescriptor("color"),
speed: Cesium.createPropertyDescriptor("speed"),
count: Cesium.createPropertyDescriptor("count"),
gradient: Cesium.createPropertyDescriptor("gradient")
}), Cesium.CircleRippleMaterialProperty = CircleRippleMaterialProperty, Cesium.Material.CircleRippleMaterialProperty = "CircleRippleMaterialProperty", Cesium.Material.CircleRippleMaterialType = "CircleRippleMaterialType", Cesium.Material.CircleRippleMaterialSource = "\nuniform vec4 color;\nuniform float speed;\nuniform float count;\nuniform float gradient;\n\nczm_material czm_getMaterial(czm_materialInput materialInput) {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.2 * color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n float per = fract(czm_frameNumber * speed / 1000.0);\n if(count == 1.0){\n if(dis > per * 0.5){\n discard;\n }else {\n material.alpha = color.a * dis / per / 2.0;\n }\n } else {\n vec3 str = materialInput.str;\n if(abs(str.z) > 0.001){\n discard;\n }\n if(dis > 0.5){\n discard;\n } else {\n float perDis = 0.5 / count;\n float disNum;\n float bl = 0.0;\n for(int i = 0; i <= 999; i++){\n if(float(i) <= count){\n disNum = perDis * float(i) - dis + per / count;\n if(disNum > 0.0){\n if(disNum < perDis){\n bl = 1.0 - disNum / perDis;\n } else if(disNum - perDis < perDis){\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = pow(bl,(1.0 + 10.0 * (1.0 - gradient)));\n }\n }\n }\n }\n }\n return material;\n}\n", Cesium.Material._materialCache.addMaterial(Cesium.Material.CircleRippleMaterialType, {
fabric: {
type: Cesium.Material.CircleRippleMaterialType,
uniforms: {
color: new Cesium.Color.fromCssColorString("#ffffff00"),
speed: 3,
count: 4,
gradient: .2
},
source: Cesium.Material.CircleRippleMaterialSource
}, translucent: function (e) {
return !0
}
})
}
}, __webpack_module_cache__ = {};
function __webpack_require__(e) {
var t = __webpack_module_cache__[e];
if (void 0 !== t) return t.exports;
var i = __webpack_module_cache__[e] = {exports: {}};
return __webpack_modules__[e](i, i.exports, __webpack_require__), i.exports
}
__webpack_require__.d = (e, t) => {
for (var i in t) __webpack_require__.o(t, i) && !__webpack_require__.o(e, i) && Object.defineProperty(e, i, {
enumerable: !0,
get: t[i]
})
}, __webpack_require__.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t), __webpack_require__.r = e => {
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {value: "Module"}), Object.defineProperty(e, "__esModule", {value: !0})
};
var __webpack_exports__ = {};
(() => {
__webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
BulletinBoard: () => k,
Carmer: () => s,
EarlyWarning: () => z,
EditGltf: () => A,
Enclosure: () => O,
GroupModel: () => T,
HumanModel: () => P,
Line: () => F,
Model: () => E,
ModelDrag: () => x,
Mouse: () => o,
Radar: () => L,
Scene: () => n,
Tiles3D: () => a
Carmer: () => r,
Cone: () => z.Z,
EarlyWarning: () => A,
EditGltf: () => I,
Enclosure: () => D,
GroupModel: () => S,
HumanModel: () => E,
Line: () => O,
Model: () => M,
ModelDrag: () => b,
Mouse: () => s,
Radar: () => F,
Scene: () => i,
Tiles3D: () => n
});
class i {
class e {
constructor(e) {
this._definitionChanged = new Cesium.Event, this._color = void 0, this.color = e.color
}
@ -46,12 +157,12 @@ var CustomCesium;
return Cesium.defined(t) || (t = {}), t.color = Cesium.Property.getValueOrDefault(this._color, e, Cesium.Color.RED, t.color), t
}
equals(e) {
return this === e || e instanceof i && Cesium.Property.equals(this._color, e._color)
equals(t) {
return this === t || t instanceof e && Cesium.Property.equals(this._color, t._color)
}
}
class r {
class t {
constructor() {
}
@ -73,7 +184,7 @@ var CustomCesium;
Cesium.WebMercatorTilingScheme;
class n {
class i {
static google_mapResources = new Cesium.UrlTemplateImageryProvider({
url: "https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
credit: "谷歌影像服务"
@ -83,8 +194,8 @@ var CustomCesium;
subdomains: ["0", "1", "2", "3"],
tilingScheme: new Cesium.WebMercatorTilingScheme,
customTags: {
q: function (e, t, i, n) {
return r.tileXYToQuadKey(t, i, n)
q: function (e, i, r, n) {
return t.tileXYToQuadKey(i, r, n)
}
},
minimumLevel: 3,
@ -96,10 +207,10 @@ var CustomCesium;
maximumLevel: 18
});
constructor(e, t, i, r) {
if (this.icy = {viewer: void 0, name: t}, 1 == i) {
constructor(e, t, r, n) {
if (this.icy = {viewer: void 0, name: t}, 1 == r) {
let t = new Cesium.UrlTemplateImageryProvider({
url: r,
url: n,
fileExtension: "png",
minimumLevel: 0,
maximumLevel: 19,
@ -107,7 +218,7 @@ var CustomCesium;
});
this.init(e, t, 50)
}
2 == i && this.init(e, n.google_mapResources, 50), 3 == i && this.init(e, n.tiandi_mapResources, 50), 4 == i && this.init(e, n.gaode_mapResources, 50), 5 == i && this.init(e, void 0, 50)
2 == r && this.init(e, i.google_mapResources, 50), 3 == r && this.init(e, i.tiandi_mapResources, 50), 4 == r && this.init(e, i.gaode_mapResources, 50), 5 == r && this.init(e, void 0, 50)
}
getIcy() {
@ -138,7 +249,7 @@ var CustomCesium;
}
initMaterial() {
Cesium.WallDiffuseMaterialProperty || (Object.defineProperties(i.prototype, {color: Cesium.createPropertyDescriptor("color")}), Cesium.WallDiffuseMaterialProperty = i, Cesium.Material.WallDiffuseMaterialProperty = "WallDiffuseMaterialProperty", Cesium.Material.WallDiffuseMaterialType = "WallDiffuseMaterialType", Cesium.Material.WallDiffuseMaterialSource = "\n uniform vec4 color;\n czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n material.diffuse = color.rgb * 2.0;\n material.alpha = color.a * (1.0 - fract(st.t)) * 0.8;\n return material;\n } \n ", Cesium.Material._materialCache.addMaterial(Cesium.Material.WallDiffuseMaterialType, {
Cesium.WallDiffuseMaterialProperty || (Object.defineProperties(e.prototype, {color: Cesium.createPropertyDescriptor("color")}), Cesium.WallDiffuseMaterialProperty = e, Cesium.Material.WallDiffuseMaterialProperty = "WallDiffuseMaterialProperty", Cesium.Material.WallDiffuseMaterialType = "WallDiffuseMaterialType", Cesium.Material.WallDiffuseMaterialSource = "\n uniform vec4 color;\n czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n material.diffuse = color.rgb * 2.0;\n material.alpha = color.a * (1.0 - fract(st.t)) * 0.8;\n return material;\n } \n ", Cesium.Material._materialCache.addMaterial(Cesium.Material.WallDiffuseMaterialType, {
fabric: {
type: Cesium.Material.WallDiffuseMaterialType,
uniforms: {color: new Cesium.Color(1, 0, 0, 1)},
@ -150,7 +261,7 @@ var CustomCesium;
}
}
class s {
class r {
constructor(e) {
this.icy = e
}
@ -197,8 +308,8 @@ var CustomCesium;
getgGsture() {
console.log("当前相机姿态输出");
let e = this.icy.viewer.camera.heading, t = this.icy.viewer.camera.pitch, i = this.icy.viewer.camera.roll,
r = this.icy.viewer.camera.positionWC;
let e = this.icy.viewer.camera.heading, t = this.icy.viewer.camera.pitch,
i = this.icy.viewer.camera.roll, r = this.icy.viewer.camera.positionWC;
console.log(`destination:{x:${r.x},y:${r.y},z:${r.z}},orientation:{heading:${e},pitch:${t},roll:${i}}`)
}
@ -244,7 +355,7 @@ var CustomCesium;
}
}
class a {
class n {
constructor(e, t, i = 0) {
this.icy = e, this.tileset = e.viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url: t,
@ -275,7 +386,7 @@ var CustomCesium;
}
}
class o {
class s {
constructor(e) {
this.icy = e, this.billboard = void 0
}
@ -297,9 +408,9 @@ var CustomCesium;
altitude: Number(o.toFixed(5))
};
console.log("鼠标获取经纬高", s, a, o, l);
let h = this.icy.viewer.scene.pick(t.position);
if (console.log(h), !h) return console.log("pick为空"), this.icy.viewer.scene.globe.translucency.enabled = !0, void (this.icy.viewer.scene.globe.translucency.frontFaceAlpha = 1);
e(h.id)
let u = this.icy.viewer.scene.pick(t.position);
if (console.log(u), !u) return console.log("pick为空"), this.icy.viewer.scene.globe.translucency.enabled = !0, void (this.icy.viewer.scene.globe.translucency.frontFaceAlpha = 1);
e(u.id)
}), Cesium.ScreenSpaceEventType.LEFT_CLICK)
}
@ -327,7 +438,7 @@ var CustomCesium;
}
}
var l, h = Object.freeze({
var a, o = Object.freeze({
Linear: Object.freeze({
None: function (e) {
return e
@ -415,11 +526,11 @@ var CustomCesium;
}
}), Bounce: Object.freeze({
In: function (e) {
return 1 - h.Bounce.Out(1 - e)
return 1 - o.Bounce.Out(1 - e)
}, Out: function (e) {
return e < 1 / 2.75 ? 7.5625 * e * e : e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375
}, InOut: function (e) {
return e < .5 ? .5 * h.Bounce.In(2 * e) : .5 * h.Bounce.Out(2 * e - 1) + .5
return e < .5 ? .5 * o.Bounce.In(2 * e) : .5 * o.Bounce.Out(2 * e - 1) + .5
}
}), generatePow: function (e) {
return void 0 === e && (e = 4), e = (e = e < Number.EPSILON ? Number.EPSILON : e) > 1e4 ? 1e4 : e, {
@ -432,12 +543,12 @@ var CustomCesium;
}
}
}
}), u = "undefined" == typeof self && "undefined" != typeof process && process.hrtime ? function () {
}), l = "undefined" == typeof self && "undefined" != typeof process && process.hrtime ? function () {
var e = process.hrtime();
return 1e3 * e[0] + e[1] / 1e6
} : "undefined" != typeof self && void 0 !== self.performance && void 0 !== self.performance.now ? self.performance.now.bind(self.performance) : void 0 !== Date.now ? Date.now : function () {
return (new Date).getTime()
}, c = function () {
}, u = function () {
function e() {
this._tweens = {}, this._tweensAddedDuringUpdate = {}
}
@ -454,7 +565,7 @@ var CustomCesium;
}, e.prototype.remove = function (e) {
delete this._tweens[e.getId()], delete this._tweensAddedDuringUpdate[e.getId()]
}, e.prototype.update = function (e, t) {
void 0 === e && (e = u()), void 0 === t && (t = !1);
void 0 === e && (e = l()), void 0 === t && (t = !1);
var i = Object.keys(this._tweens);
if (0 === i.length) return !1;
for (; i.length > 0;) {
@ -467,42 +578,42 @@ var CustomCesium;
}
return !0
}, e
}(), m = {
}(), c = {
Linear: function (e, t) {
var i = e.length - 1, r = i * t, n = Math.floor(r), s = m.Utils.Linear;
var i = e.length - 1, r = i * t, n = Math.floor(r), s = c.Utils.Linear;
return t < 0 ? s(e[0], e[1], r) : t > 1 ? s(e[i], e[i - 1], i - r) : s(e[n], e[n + 1 > i ? i : n + 1], r - n)
}, Bezier: function (e, t) {
for (var i = 0, r = e.length - 1, n = Math.pow, s = m.Utils.Bernstein, a = 0; a <= r; a++) i += n(1 - t, r - a) * n(t, a) * e[a] * s(r, a);
for (var i = 0, r = e.length - 1, n = Math.pow, s = c.Utils.Bernstein, a = 0; a <= r; a++) i += n(1 - t, r - a) * n(t, a) * e[a] * s(r, a);
return i
}, CatmullRom: function (e, t) {
var i = e.length - 1, r = i * t, n = Math.floor(r), s = m.Utils.CatmullRom;
var i = e.length - 1, r = i * t, n = Math.floor(r), s = c.Utils.CatmullRom;
return e[0] === e[i] ? (t < 0 && (n = Math.floor(r = i * (1 + t))), s(e[(n - 1 + i) % i], e[n], e[(n + 1) % i], e[(n + 2) % i], r - n)) : t < 0 ? e[0] - (s(e[0], e[0], e[1], e[1], -r) - e[0]) : t > 1 ? e[i] - (s(e[i], e[i], e[i - 1], e[i - 1], r - i) - e[i]) : s(e[n ? n - 1 : 0], e[n], e[i < n + 1 ? i : n + 1], e[i < n + 2 ? i : n + 2], r - n)
}, Utils: {
Linear: function (e, t, i) {
return (t - e) * i + e
}, Bernstein: function (e, t) {
var i = m.Utils.Factorial;
var i = c.Utils.Factorial;
return i(e) / i(t) / i(e - t)
}, Factorial: (l = [1], function (e) {
}, Factorial: (a = [1], function (e) {
var t = 1;
if (l[e]) return l[e];
if (a[e]) return a[e];
for (var i = e; i > 1; i--) t *= i;
return l[e] = t, t
return a[e] = t, t
}), CatmullRom: function (e, t, i, r, n) {
var s = .5 * (i - e), a = .5 * (r - t), o = n * n;
return (2 * t - 2 * i + s + a) * (n * o) + (-3 * t + 3 * i - 2 * s - a) * o + s * n + t
}
}
}, d = function () {
}, h = function () {
function e() {
}
return e.nextId = function () {
return e._nextId++
}, e._nextId = 0, e
}(), p = new c, C = function () {
}(), m = new u, d = function () {
function e(e, t) {
void 0 === t && (t = p), this._object = e, this._group = t, this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = h.Linear.None, this._interpolationFunction = m.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._id = d.nextId(), this._isChainStopped = !1, this._goToEnd = !1
void 0 === t && (t = m), this._object = e, this._group = t, this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = o.Linear.None, this._interpolationFunction = c.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._id = h.nextId(), this._isChainStopped = !1, this._goToEnd = !1
}
return e.prototype.getId = function () {
@ -516,22 +627,22 @@ var CustomCesium;
}, e.prototype.duration = function (e) {
return void 0 === e && (e = 1e3), this._duration = e, this
}, e.prototype.start = function (e, t) {
if (void 0 === e && (e = u()), void 0 === t && (t = !1), this._isPlaying) return this;
if (void 0 === e && (e = l()), void 0 === t && (t = !1), this._isPlaying) return this;
if (this._group && this._group.add(this), this._repeat = this._initialRepeat, this._reversed) for (var i in this._reversed = !1, this._valuesStartRepeat) this._swapEndStartRepeatValues(i), this._valuesStart[i] = this._valuesStartRepeat[i];
return this._isPlaying = !0, this._isPaused = !1, this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._isChainStopped = !1, this._startTime = e, this._startTime += this._delayTime, this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat, t), this
}, e.prototype.startFromCurrentValues = function (e) {
return this.start(e, !0)
}, e.prototype._setupProperties = function (e, t, i, r, n) {
for (var s in i) {
var a = e[s], o = Array.isArray(a), l = o ? "array" : typeof a, h = !o && Array.isArray(i[s]);
var a = e[s], o = Array.isArray(a), l = o ? "array" : typeof a, u = !o && Array.isArray(i[s]);
if ("undefined" !== l && "function" !== l) {
if (h) {
var u = i[s];
if (0 === u.length) continue;
u = u.map(this._handleRelativeValue.bind(this, a)), void 0 === t[s] && (i[s] = [a].concat(u))
if (u) {
var c = i[s];
if (0 === c.length) continue;
c = c.map(this._handleRelativeValue.bind(this, a)), void 0 === t[s] && (i[s] = [a].concat(c))
}
if ("object" !== l && !o || !a || h) (void 0 === t[s] || n) && (t[s] = a), o || (t[s] *= 1), r[s] = h ? i[s].slice().reverse() : t[s] || 0; else {
for (var c in t[s] = o ? [] : {}, a) t[s][c] = a[c];
if ("object" !== l && !o || !a || u) (void 0 === t[s] || n) && (t[s] = a), o || (t[s] *= 1), r[s] = u ? i[s].slice().reverse() : t[s] || 0; else {
for (var h in t[s] = o ? [] : {}, a) t[s][h] = a[h];
r[s] = o ? [] : {}, this._setupProperties(a, t[s], i[s], r[s], n)
}
}
@ -541,14 +652,14 @@ var CustomCesium;
}, e.prototype.end = function () {
return this._goToEnd = !0, this.update(1 / 0), this
}, e.prototype.pause = function (e) {
return void 0 === e && (e = u()), this._isPaused || !this._isPlaying || (this._isPaused = !0, this._pauseStart = e, this._group && this._group.remove(this)), this
return void 0 === e && (e = l()), this._isPaused || !this._isPlaying || (this._isPaused = !0, this._pauseStart = e, this._group && this._group.remove(this)), this
}, e.prototype.resume = function (e) {
return void 0 === e && (e = u()), this._isPaused && this._isPlaying ? (this._isPaused = !1, this._startTime += e - this._pauseStart, this._pauseStart = 0, this._group && this._group.add(this), this) : this
return void 0 === e && (e = l()), this._isPaused && this._isPlaying ? (this._isPaused = !1, this._startTime += e - this._pauseStart, this._pauseStart = 0, this._group && this._group.add(this), this) : this
}, e.prototype.stopChainedTweens = function () {
for (var e = 0, t = this._chainedTweens.length; e < t; e++) this._chainedTweens[e].stop();
return this
}, e.prototype.group = function (e) {
return void 0 === e && (e = p), this._group = e, this
return void 0 === e && (e = m), this._group = e, this
}, e.prototype.delay = function (e) {
return void 0 === e && (e = 0), this._delayTime = e, this
}, e.prototype.repeat = function (e) {
@ -558,9 +669,9 @@ var CustomCesium;
}, e.prototype.yoyo = function (e) {
return void 0 === e && (e = !1), this._yoyo = e, this
}, e.prototype.easing = function (e) {
return void 0 === e && (e = h.Linear.None), this._easingFunction = e, this
return void 0 === e && (e = o.Linear.None), this._easingFunction = e, this
}, e.prototype.interpolation = function (e) {
return void 0 === e && (e = m.Linear), this._interpolationFunction = e, this
return void 0 === e && (e = c.Linear), this._interpolationFunction = e, this
}, e.prototype.chain = function () {
for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
return this._chainedTweens = e, this
@ -577,7 +688,7 @@ var CustomCesium;
}, e.prototype.onStop = function (e) {
return this._onStopCallback = e, this
}, e.prototype.update = function (e, t) {
if (void 0 === e && (e = u()), void 0 === t && (t = !0), this._isPaused) return !0;
if (void 0 === e && (e = l()), void 0 === t && (t = !0), this._isPaused) return !0;
var i, r, n = this._startTime + this._duration;
if (!this._goToEnd && !this._isPlaying) {
if (e > n) return !1;
@ -607,25 +718,25 @@ var CustomCesium;
var t = this._valuesStartRepeat[e], i = this._valuesEnd[e];
this._valuesStartRepeat[e] = "string" == typeof i ? this._valuesStartRepeat[e] + parseFloat(i) : this._valuesEnd[e], this._valuesEnd[e] = t
}, e
}(), g = d.nextId, f = p, y = f.getAll.bind(f), _ = f.removeAll.bind(f), v = f.add.bind(f), w = f.remove.bind(f),
M = f.update.bind(f);
const S = {
Easing: h,
Group: c,
Interpolation: m,
now: u,
Sequence: d,
nextId: g,
Tween: C,
}(), p = h.nextId, C = m, _ = C.getAll.bind(C), g = C.removeAll.bind(C), f = C.add.bind(C),
y = C.remove.bind(C), v = C.update.bind(C);
const w = {
Easing: o,
Group: u,
Interpolation: c,
now: l,
Sequence: h,
nextId: p,
Tween: d,
VERSION: "19.0.0",
getAll: y,
removeAll: _,
add: v,
remove: w,
update: M
getAll: _,
removeAll: g,
add: f,
remove: y,
update: v
};
class E {
class M {
static FileUrl = "../public/models/huaxing/glb/";
static nameShow(e, t) {
@ -636,22 +747,22 @@ var CustomCesium;
static {
function e() {
S.update(), requestAnimationFrame(e)
w.update(), requestAnimationFrame(e)
}
e()
}
constructor(e, {url: t, height: i, lon: r, lat: n, id: s, name: a, scale: o, angle: l}, h) {
if (this.icy = e, !t && !h) return console.error("传参有问题");
constructor(e, {url: t, height: i, lon: r, lat: n, id: s, name: a, scale: o, angle: l}, u) {
if (this.icy = e, !t && !u) return console.error("传参有问题");
o = o || 1, i = i || 0, r = r || 116.28678152222574, n = n || 40.05185885026265;
let u = Cesium.Cartesian3.fromDegrees(r, n, i), c = Cesium.Math.toRadians(l[0]),
let c = Cesium.Cartesian3.fromDegrees(r, n, i), h = Cesium.Math.toRadians(l[0]),
m = Cesium.Math.toRadians(l[1]), d = Cesium.Math.toRadians(l[2]),
p = new Cesium.HeadingPitchRoll(c, m, d), C = Cesium.Transforms.headingPitchRollQuaternion(u, p);
p = new Cesium.HeadingPitchRoll(h, m, d), C = Cesium.Transforms.headingPitchRollQuaternion(c, p);
this.entity = t ? e.viewer.entities.add({
id: s,
name: a,
position: u,
position: c,
orientation: C,
model: {uri: t, scale: o, color: new Cesium.Color(1, 1, 1, 1)},
runAnimations: !1,
@ -662,9 +773,9 @@ var CustomCesium;
}) : e.viewer.entities.add({
id: s,
name: a,
position: u,
position: c,
orientation: C,
model: h,
model: u,
runAnimations: !1,
incrementallyLoadTextures: !1,
colorBlendMode: Cesium.ColorBlendMode.MIX,
@ -680,8 +791,8 @@ var CustomCesium;
move({lon: e, lat: t, height: i, angle: r}) {
let n = Cesium.Cartesian3.fromDegrees(e, t, i), s = Cesium.Math.toRadians(r[0]),
a = Cesium.Math.toRadians(r[1]), o = Cesium.Math.toRadians(r[2]),
l = new Cesium.HeadingPitchRoll(s, a, o), h = Cesium.Transforms.headingPitchRollQuaternion(n, l);
this.entity.position = n, this.entity.orientation = h
l = new Cesium.HeadingPitchRoll(s, a, o), u = Cesium.Transforms.headingPitchRollQuaternion(n, l);
this.entity.position = n, this.entity.orientation = u
}
updateAngle(e) {
@ -691,16 +802,16 @@ var CustomCesium;
this.entity.orientation = a
}
animationMove(e, t, i, n, s) {
animationMove(e, i, r, n, s) {
if (!this.entity) throw"还没有对象呢!!";
let a = this.entity.position, o = Cesium.Cartesian3.fromDegrees(e, t, i),
l = new S.Tween({x: a._value.x, y: a._value.y, z: a._value.z});
l.to({x: o.x, y: o.y, z: o.z}, n), l.onUpdate((({x: e, y: t, z: i}) => {
let n = new Cesium.Cartesian3(e, t, i);
let a = this.entity.position, o = Cesium.Cartesian3.fromDegrees(e, i, r),
l = new w.Tween({x: a._value.x, y: a._value.y, z: a._value.z});
l.to({x: o.x, y: o.y, z: o.z}, n), l.onUpdate((({x: e, y: i, z: r}) => {
let n = new Cesium.Cartesian3(e, i, r);
if(this.entity){
this.entity.position = n;
}
let a = r.Cartesian3ToWGS84(this.icy.viewer, n);
let a = t.Cartesian3ToWGS84(this.icy.viewer, n);
s(a)
})), l.start()
}
@ -726,16 +837,16 @@ var CustomCesium;
}
}
class x {
class b {
static FileUrl = "../public/models/huaxing/glb/";
constructor(e, {url: t, height: i, lon: r, lat: n, id: s, name: a, scale: o, angle: l}, h) {
if (this.icy = e, !t && !h) return console.error("传参有问题");
constructor(e, {url: t, height: i, lon: r, lat: n, id: s, name: a, scale: o, angle: l}, u) {
if (this.icy = e, !t && !u) return console.error("传参有问题");
o = o || 1, i = i || 0, r = r || 116.28678152222574, n = n || 40.05185885026265;
let u = Cesium.Cartesian3.fromDegrees(r, n, i);
var c = Cesium.Math.toRadians(l[0]), m = Cesium.Math.toRadians(l[1]), d = Cesium.Math.toRadians(l[2]),
p = new Cesium.HeadingPitchRoll(c, m, d);
let C = Cesium.Transforms.headingPitchRollToFixedFrame(u, p, Cesium.Ellipsoid.WGS84, Cesium.Transforms.eastNorthUpToFixedFrame, new Cesium.Matrix4);
let c = Cesium.Cartesian3.fromDegrees(r, n, i);
var h = Cesium.Math.toRadians(l[0]), m = Cesium.Math.toRadians(l[1]), d = Cesium.Math.toRadians(l[2]),
p = new Cesium.HeadingPitchRoll(h, m, d);
let C = Cesium.Transforms.headingPitchRollToFixedFrame(c, p, Cesium.Ellipsoid.WGS84, Cesium.Transforms.eastNorthUpToFixedFrame, new Cesium.Matrix4);
this.entity = e.viewer.scene.primitives.add(Cesium.Model.fromGltf({
url: t,
color: Cesium.Color.WHITE,
@ -760,13 +871,13 @@ var CustomCesium;
let a = e;
var o = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Matrix4.getTranslation(a, new Cesium.Cartesian3), Cesium.Ellipsoid.WGS84, new Cesium.Matrix4),
l = Cesium.Matrix4.multiply(Cesium.Matrix4.inverse(o, new Cesium.Matrix4), a, new Cesium.Matrix4),
h = Cesium.Matrix4.getMatrix3(l, new Cesium.Matrix3), u = Cesium.Quaternion.fromRotationMatrix(h),
c = Cesium.HeadingPitchRoll.fromQuaternion(u);
u = Cesium.Matrix4.getMatrix3(l, new Cesium.Matrix3), c = Cesium.Quaternion.fromRotationMatrix(u),
h = Cesium.HeadingPitchRoll.fromQuaternion(c);
return {
lng: n,
lat: r,
alt: s,
angle: [Cesium.Math.toDegrees(c.heading), Cesium.Math.toDegrees(c.pitch), Cesium.Math.toDegrees(c.roll)]
angle: [Cesium.Math.toDegrees(h.heading), Cesium.Math.toDegrees(h.pitch), Cesium.Math.toDegrees(h.roll)]
}
}
@ -779,7 +890,7 @@ var CustomCesium;
}
}
class T {
class S {
constructor(e) {
this.name = e, this.children = []
}
@ -808,17 +919,17 @@ var CustomCesium;
}
}
class P extends E {
static PERSON_BLUE = {url: E.FileUrl + "person_000002_blue.gltf"};
static PERSON_BLUE_FAT = {url: E.FileUrl + "person_000002_blue_fat.gltf"};
static PERSON_GREEN = {url: E.FileUrl + "person_000002_green.gltf"};
static PERSON_GREEN_FAT = {url: E.FileUrl + "person_000002_green_fat.gltf"};
static PERSON_RED = {url: E.FileUrl + "person_000002_red.gltf"};
static PERSON_RED_FAT = {url: E.FileUrl + "person_000002_red_fat.gltf"};
static PERSON_WHITE = {url: E.FileUrl + "person_000002_white.gltf"};
static PERSON_WHITE_FAT = {url: E.FileUrl + "person_000002_white_fat.gltf"};
static PERSON_YELLOW = {url: E.FileUrl + "person_000002_yellow.gltf"};
static PERSON_YELLOW_FAT = {url: E.FileUrl + "person_000002_yellow_fat.gltf"};
class E extends M {
static PERSON_BLUE = {url: M.FileUrl + "person_000002_blue.gltf"};
static PERSON_BLUE_FAT = {url: M.FileUrl + "person_000002_blue_fat.gltf"};
static PERSON_GREEN = {url: M.FileUrl + "person_000002_green.gltf"};
static PERSON_GREEN_FAT = {url: M.FileUrl + "person_000002_green_fat.gltf"};
static PERSON_RED = {url: M.FileUrl + "person_000002_red.gltf"};
static PERSON_RED_FAT = {url: M.FileUrl + "person_000002_red_fat.gltf"};
static PERSON_WHITE = {url: M.FileUrl + "person_000002_white.gltf"};
static PERSON_WHITE_FAT = {url: M.FileUrl + "person_000002_white_fat.gltf"};
static PERSON_YELLOW = {url: M.FileUrl + "person_000002_yellow.gltf"};
static PERSON_YELLOW_FAT = {url: M.FileUrl + "person_000002_yellow_fat.gltf"};
constructor(e, t, {lon: i, lat: r, id: n, name: s, scale: a, angle: o, height: l}) {
super(e, {url: t.url, height: l, lon: i, lat: r, id: n, name: s, scale: a, angle: o})
@ -828,16 +939,17 @@ var CustomCesium;
}
}
const b = window.Cesium, I = 52.35987755982988, R = 3.141592653589793, D = class {
const T = window.Cesium, P = 52.35987755982988, x = 3.141592653589793, R = class {
static BD09ToGCJ02(e, t) {
let i = +e - .0065, r = +t - .006, n = Math.sqrt(i * i + r * r) - 2e-5 * Math.sin(r * I),
s = Math.atan2(r, i) - 3e-6 * Math.cos(i * I);
let i = +e - .0065, r = +t - .006, n = Math.sqrt(i * i + r * r) - 2e-5 * Math.sin(r * P),
s = Math.atan2(r, i) - 3e-6 * Math.cos(i * P);
return [n * Math.cos(s), n * Math.sin(s)]
}
static GCJ02ToBD09(e, t) {
t = +t, e = +e;
let i = Math.sqrt(e * e + t * t) + 2e-5 * Math.sin(t * I), r = Math.atan2(t, e) + 3e-6 * Math.cos(e * I);
let i = Math.sqrt(e * e + t * t) + 2e-5 * Math.sin(t * P),
r = Math.atan2(t, e) + 3e-6 * Math.cos(e * P);
return [i * Math.cos(r) + .0065, i * Math.sin(r) + .006]
}
@ -859,21 +971,21 @@ var CustomCesium;
static delta(e, t) {
let i = this.transformLng(e - 105, t - 35), r = this.transformLat(e - 105, t - 35);
const n = t / 180 * R;
const n = t / 180 * x;
let s = Math.sin(n);
s = 1 - .006693421622965943 * s * s;
const a = Math.sqrt(s);
return i = 180 * i / (6378245 / a * Math.cos(n) * R), r = 180 * r / (6335552.717000426 / (s * a) * R), [i, r]
return i = 180 * i / (6378245 / a * Math.cos(n) * x), r = 180 * r / (6335552.717000426 / (s * a) * x), [i, r]
}
static transformLng(e, t) {
let i = 300 + (e = +e) + 2 * (t = +t) + .1 * e * e + .1 * e * t + .1 * Math.sqrt(Math.abs(e));
return i += 2 * (20 * Math.sin(6 * e * R) + 20 * Math.sin(2 * e * R)) / 3, i += 2 * (20 * Math.sin(e * R) + 40 * Math.sin(e / 3 * R)) / 3, i += 2 * (150 * Math.sin(e / 12 * R) + 300 * Math.sin(e / 30 * R)) / 3, i
return i += 2 * (20 * Math.sin(6 * e * x) + 20 * Math.sin(2 * e * x)) / 3, i += 2 * (20 * Math.sin(e * x) + 40 * Math.sin(e / 3 * x)) / 3, i += 2 * (150 * Math.sin(e / 12 * x) + 300 * Math.sin(e / 30 * x)) / 3, i
}
static transformLat(e, t) {
let i = 2 * (e = +e) - 100 + 3 * (t = +t) + .2 * t * t + .1 * e * t + .2 * Math.sqrt(Math.abs(e));
return i += 2 * (20 * Math.sin(6 * e * R) + 20 * Math.sin(2 * e * R)) / 3, i += 2 * (20 * Math.sin(t * R) + 40 * Math.sin(t / 3 * R)) / 3, i += 2 * (160 * Math.sin(t / 12 * R) + 320 * Math.sin(t * R / 30)) / 3, i
return i += 2 * (20 * Math.sin(6 * e * x) + 20 * Math.sin(2 * e * x)) / 3, i += 2 * (20 * Math.sin(t * x) + 40 * Math.sin(t / 3 * x)) / 3, i += 2 * (160 * Math.sin(t / 12 * x) + 320 * Math.sin(t * x / 30)) / 3, i
}
static out_of_china(e, t) {
@ -881,14 +993,14 @@ var CustomCesium;
}
static transformWGS84ToCartesian(e, t, i) {
return t ? b.Cartesian3.fromDegrees(t.lng || t.lon, t.lat, t.alt = i || t.alt, b.Ellipsoid.WGS84) : b.Cartesian3.ZERO
return t ? T.Cartesian3.fromDegrees(t.lng || t.lon, t.lat, t.alt = i || t.alt, T.Ellipsoid.WGS84) : T.Cartesian3.ZERO
}
static transformCartesianToWGS84(e, t) {
let i = b.Ellipsoid.WGS84.cartesianToCartographic(t);
return {lng: b.Math.toDegrees(i.longitude), lat: b.Math.toDegrees(i.latitude), alt: i.height}
let i = T.Ellipsoid.WGS84.cartesianToCartographic(t);
return {lng: T.Math.toDegrees(i.longitude), lat: T.Math.toDegrees(i.latitude), alt: i.height}
}
}, A = class {
}, I = class {
constructor(e, t, i, r) {
if (!e) throw new Error("viewer is required!");
this._viewer = e, this._gltf = t, this._handler = void 0, this._defaultWidth = 15, this._currentPick = void 0, this._dStep = i, this._rStep = r, this._params = {
@ -932,7 +1044,7 @@ var CustomCesium;
returnGltfCentorDegree(e) {
let t = this.returnGltfCentor(e);
return D.transformCartesianToWGS84(this._viewer, t)
return R.transformCartesianToWGS84(this._viewer, t)
}
editRtation() {
@ -952,13 +1064,13 @@ var CustomCesium;
const o = this.createAxisSphere("model_edit_yCircle", n, s, Cesium.Color.BLUE);
this._viewer.scene.primitives.add(o);
let l = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(90)),
h = Cesium.Matrix4.fromRotationTranslation(l);
Cesium.Matrix4.multiply(o.geometryInstances.modelMatrix, h, o.geometryInstances.modelMatrix);
const u = this.createAxisSphere("model_edit_xCircle", n, s, Cesium.Color.GREEN);
this._viewer.scene.primitives.add(u);
let c = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(90)),
m = Cesium.Matrix4.fromRotationTranslation(c);
Cesium.Matrix4.multiply(u.geometryInstances.modelMatrix, m, u.geometryInstances.modelMatrix)
u = Cesium.Matrix4.fromRotationTranslation(l);
Cesium.Matrix4.multiply(o.geometryInstances.modelMatrix, u, o.geometryInstances.modelMatrix);
const c = this.createAxisSphere("model_edit_xCircle", n, s, Cesium.Color.GREEN);
this._viewer.scene.primitives.add(c);
let h = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(90)),
m = Cesium.Matrix4.fromRotationTranslation(h);
Cesium.Matrix4.multiply(c.geometryInstances.modelMatrix, m, c.geometryInstances.modelMatrix)
}
createAxisSphere(e, t, i, r) {
@ -1003,13 +1115,14 @@ var CustomCesium;
if (r && r.primitive && r.primitive._name && -1 != r.primitive._name.indexOf("model_edit")) {
t.scene.screenSpaceCameraController.enableRotate = !1, e._currentPick = r.primitive, e._currentPick.width = 25;
let n = t.scene.camera.pickEllipsoid(i.position, t.scene.globe.ellipsoid),
s = JSON.parse(JSON.stringify(e._gltf.modelMatrix)), a = 0, o = 0, l = 0, h = 0, u = 0, c = 0;
s = JSON.parse(JSON.stringify(e._gltf.modelMatrix)), a = 0, o = 0, l = 0, u = 0, c = 0,
h = 0;
if (n && Cesium.defined(n)) {
a = 0, o = 0, l = 0, h = 0, u = 0, c = 0;
const r = D.transformCartesianToWGS84(t, n);
a = 0, o = 0, l = 0, u = 0, c = 0, h = 0;
const r = R.transformCartesianToWGS84(t, n);
e._handler.setInputAction((function (n) {
let m = t.scene.camera.pickEllipsoid(n.endPosition, t.scene.globe.ellipsoid);
const d = D.transformCartesianToWGS84(t, m), p = n.endPosition.y - i.position.y,
const d = R.transformCartesianToWGS84(t, m), p = n.endPosition.y - i.position.y,
C = n.endPosition.x - i.position.x;
switch (e._currentPick._name) {
case"model_edit_xArrow":
@ -1022,15 +1135,15 @@ var CustomCesium;
l = -e._dStep * p;
break;
case"model_edit_xCircle":
h = e._rStep * p;
u = e._rStep * p;
break;
case"model_edit_yCircle":
u = e._rStep * C;
c = e._rStep * C;
break;
case"model_edit_zCircle":
c = e._rStep * C
h = e._rStep * C
}
e.updateModel(e._params, a, o, l, h, u, c, s)
e.updateModel(e._params, a, o, l, u, c, h, s)
}), Cesium.ScreenSpaceEventType.MOUSE_MOVE)
}
e._handler.setInputAction((function (i) {
@ -1078,7 +1191,7 @@ var CustomCesium;
let i = Cesium.Transforms.eastNorthUpToFixedFrame(e), r = new Cesium.Matrix4;
Cesium.Matrix4.setTranslation(Cesium.Matrix4.IDENTITY, t, r);
let n = Cesium.Matrix4.multiply(i, r, i);
return Cesium.Matrix4.getTranslation(n, e), D.transformCartesianToWGS84(this._viewer, e)
return Cesium.Matrix4.getTranslation(n, e), R.transformCartesianToWGS84(this._viewer, e)
}
removeCoordArrows() {
@ -1100,7 +1213,7 @@ var CustomCesium;
}
};
class O {
class D {
constructor(e) {
this.icy = e, this.fenceList = [], this.currentFence = [], this.currentEntity = [], this.currentState = !1, this.currentPolyline, this.currentPolygon
}
@ -1153,25 +1266,18 @@ var CustomCesium;
}
finish() {
this.currentEntity.forEach((e => this.icy.viewer.entities.remove(e))), this.currentEntity = [], this.icy.viewer.entities.remove(this.currentPolygon), this.currentPolygon = void 0, this.icy.viewer.entities.remove(this.currentPolyline), this.currentPolyline = void 0;
let e = this.currentFence.flat();
e.push(...this.currentFence[0]);
// let t = this.icy.viewer.entities.add({
// wall: {
// positions: Cesium.Cartesian3.fromDegreesArrayHeights(e),
// maximumHeights: new Array(e.length).fill(60),
// minimunHeights: new Array(e.length).fill(10),
// material: new Cesium.WallDiffuseMaterialProperty({color: new Cesium.Color(1, 1, 0, 1)})
// }
// });
this.currentFence.length = 0, this.fenceList.push(t)
this.currentEntity.forEach((e => this.icy.viewer.entities.remove(e))), this.currentEntity = [], this.icy.viewer.entities.remove(this.currentPolygon), this.currentPolygon = void 0, this.icy.viewer.entities.remove(this.currentPolyline), this.currentPolyline = void 0, this.currentFence.flat().push(...this.currentFence[0]), this.currentFence.length = 0
}
addPoint(e, t, i) {
let r;
return r = this.icy.viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(e, t, i),
point: {pixelSize: 10, color: Cesium.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY}
point: {
pixelSize: 10,
color: Cesium.Color.YELLOW,
disableDepthTestDistance: Number.POSITIVE_INFINITY
}
}), r
}
@ -1192,7 +1298,7 @@ var CustomCesium;
} catch (e) {
}
this.fenceList.map((e => {
this.icy.viewer.entities.remove(e)
console.log(e), this.icy.viewer.entities.remove(e)
})), this.fenceList = []
}
@ -1221,7 +1327,7 @@ var CustomCesium;
}
}
class F {
class O {
constructor(e, {name: t = null, width: i = 1, positions: r, color: n}) {
this.icy = e, this.positions = r, this.entity = e.viewer.entities.add({
name: t,
@ -1249,7 +1355,7 @@ var CustomCesium;
}
}
class z {
class A {
constructor(e, {id: t, positions: i, color: r = "red", height: n = 30, name: s = "四色图"}, a) {
this.icy = e, this.entity = e.viewer.entities.add({
name: s,
@ -1264,16 +1370,16 @@ var CustomCesium;
});
var o = this.entity.polygon.hierarchy.getValue(Cesium.JulianDate.now()).positions,
l = Cesium.BoundingSphere.fromPoints(o).center;
let h = (u = l, c = new Cesium.Cartesian3(u.x, u.y, u.z), m = Cesium.Cartographic.fromCartesian(c), d = Cesium.Math.toDegrees(m.latitude), {
let u = (c = l, h = new Cesium.Cartesian3(c.x, c.y, c.z), m = Cesium.Cartographic.fromCartesian(h), d = Cesium.Math.toDegrees(m.latitude), {
lng: Cesium.Math.toDegrees(m.longitude),
lat: d,
alt: m.height
});
var u, c, m, d;
if (h.alt = n, l = function (e) {
var c, h, m, d;
if (u.alt = n, l = function (e) {
var t = Cesium.Cartesian3.fromDegrees(e.lng, e.lat, e.alt);
return {x: t.x, y: t.y, z: t.z}
}(h), this.entity.position = l, a) {
}(u), this.entity.position = l, a) {
let e = new Image;
e.src = a.toDataURL("image/jpg"), this.entity.billboard = {
image: e,
@ -1294,7 +1400,7 @@ var CustomCesium;
}
}
class L {
class F {
constructor(e) {
this.viewer = e.viewer, this.lastStageList = []
}
@ -1318,18 +1424,18 @@ var CustomCesium;
const n = Cesium.Cartographic.toCartesian(e), s = new Cesium.Cartesian4(n.x, n.y, n.z, 1),
a = new Cesium.Cartographic(e.longitude, e.latitude, e.height + 500),
o = Cesium.Cartographic.toCartesian(a), l = new Cesium.Cartesian4(o.x, o.y, o.z, 1),
h = (new Date).getTime(), u = new Cesium.Cartesian4, c = new Cesium.Cartesian4,
u = (new Date).getTime(), c = new Cesium.Cartesian4, h = new Cesium.Cartesian4,
m = new Cesium.Cartesian3, d = this, p = new Cesium.PostProcessStage({
fragmentShader: d._getScanSegmentShader(),
uniforms: {
u_scanCenterEC: function () {
return Cesium.Matrix4.multiplyByVector(d.viewer.camera._viewMatrix, s, u)
return Cesium.Matrix4.multiplyByVector(d.viewer.camera._viewMatrix, s, c)
}, u_scanPlaneNormalEC: function () {
const e = Cesium.Matrix4.multiplyByVector(d.viewer.camera._viewMatrix, s, u),
t = Cesium.Matrix4.multiplyByVector(d.viewer.camera._viewMatrix, l, c);
const e = Cesium.Matrix4.multiplyByVector(d.viewer.camera._viewMatrix, s, c),
t = Cesium.Matrix4.multiplyByVector(d.viewer.camera._viewMatrix, l, h);
return m.x = t.x - e.x, m.y = t.y - e.y, m.z = t.z - e.z, Cesium.Cartesian3.normalize(m, m), m
}, u_radius: function () {
return t * (((new Date).getTime() - h) % r) / r
return t * (((new Date).getTime() - u) % r) / r
}, u_scanColor: i
}
});
@ -1345,10 +1451,12 @@ var CustomCesium;
}
}
var z = __webpack_require__(117);
class k {
static {
function e() {
S.update(), requestAnimationFrame(e)
w.update(), requestAnimationFrame(e)
}
e()
@ -1386,7 +1494,7 @@ var CustomCesium;
animationMove(e, t, i, r) {
if (!this.entity) throw"还没有对象呢!!";
let n = this.entity.position, s = Cesium.Cartesian3.fromDegrees(e, t, i),
a = new S.Tween({x: n._value.x, y: n._value.y, z: n._value.z});
a = new w.Tween({x: n._value.x, y: n._value.y, z: n._value.z});
a.to({x: s.x, y: s.y, z: s.z}, r), a.onUpdate((({x: e, y: t, z: i}) => {
let r = new Cesium.Cartesian3(e, t, i);
if(this.entity){
@ -1408,5 +1516,6 @@ var CustomCesium;
}
}
Cesium.Ion.defaultAccessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzNzFlNTg1MC0wOTA0LTQzYzYtOTBjZi05MjIzZjU2NTkzZGQiLCJpZCI6MTE4ODE3LCJpYXQiOjE2NzE1MDY2NjF9.yGR3CbS6VQp2s6Y9NHWOIKq8qKL0sWLZZBZ9eP02Ags", CustomCesium = t
Cesium.Ion.defaultAccessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzNzFlNTg1MC0wOTA0LTQzYzYtOTBjZi05MjIzZjU2NTkzZGQiLCJpZCI6MTE4ODE3LCJpYXQiOjE2NzE1MDY2NjF9.yGR3CbS6VQp2s6Y9NHWOIKq8qKL0sWLZZBZ9eP02Ags"
})(), CustomCesium = __webpack_exports__
})();

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View File

@ -0,0 +1,84 @@
<template>
<div id="bi_container">
<div id="map" class="map_bg"></div>
</div>
</template>
<script setup>
import { onBeforeUnmount, onMounted } from "vue";
import { initMap, handleViewAlarm, handleMouseClick } from "./map";
import { useUserStore } from "@/pinia/user.js";
import { getEnterpriseInfo } from "@/request/enterprise_management.js";
const props = defineProps({
alarm: {
type: Object,
required: true,
default: null,
},
userList: {
type: Array,
required: true,
default: () => [],
},
});
const userStore = useUserStore();
const CORPINFO_ID = userStore.getUserInfo.CORPINFO_ID;
onMounted(async () => {
const corp = await getEnterpriseInfo({ CORPINFO_ID });
initMap(corp.pd);
handleMouseClick();
handleViewAlarm(props.alarm, props.userList);
});
onBeforeUnmount(() => {
window.$scene = null;
window.$icy = null;
window.$carmer = null;
});
</script>
<style scoped lang="scss">
#bi_container {
width: 100%;
height: 600px;
color: #ffffff;
position: relative;
font-size: 14px;
.map_bg {
width: 100%;
height: 540px;
}
.options {
margin-top: 10px;
display: flex;
align-items: center;
padding: 10px;
.option {
margin-right: 20px;
cursor: pointer;
text-align: center;
img {
width: 46px;
height: 46px;
}
.label {
margin-top: 10px;
font-size: 12px;
}
}
.id {
background-color: #1b284a;
padding: 10px;
border-radius: 4px;
height: 37px;
}
}
}
</style>

View File

@ -138,7 +138,7 @@ export const handleMouseClick = (model_id) => {
// 隐藏逻辑
$mouse.mouseLeft((model) => {
if (model._name === "建筑") {
model_id.value = model._id;
if (model_id) model_id.value = model._id;
clickBuilding(model);
}
});
@ -333,3 +333,68 @@ const addEntity = (id, name, lon, lat, height) => {
};
entities.add(obj);
};
export const handleViewAlarm = (alarm, userList) => {
const canvas = document.createElement("canvas");
canvas.width = 100;
canvas.height = 30;
const ctx = canvas.getContext("2d");
ctx.fillStyle = "#000000";
ctx.fillRect(0, 0, 100, 50);
ctx.fillStyle = "#ff0000";
ctx.font = "normal bold 20px Arial";
ctx.fillText("聚集告警", 5, 15);
// 聚集圆锥特效
const Cone = new window.CustomCesium.Cone(window.$icy);
Cone.add(
[alarm.lon, alarm.lat, alarm.alt], // 坐标
alarm.color, // 圆锥颜色
{ width: 20, height: 40 }, // 圆锥的宽高
canvas, // 圆锥铭牌
"100201", // 圆锥实体id
"10020101" // 铭牌实体id
);
const labelPixelOffset = new window.Cesium.Cartesian2(0, -55);
userList.forEach((user) => {
const obj = {};
obj.entity = window.$icy.viewer.entities.add(
new window.Cesium.Entity({
id: "user_" + user.card,
name: user.psnName,
position: window.Cesium.Cartesian3.fromDegrees(
user.lon,
user.lat,
user.alt
),
billboard: {
image: "src/assets/images/map/peoIcon_blueImg.png",
height: 36,
width: 30,
verticalOrigin: window.Cesium.VerticalOrigin.BOTTOM,
horizontalOrigin: window.Cesium.HorizontalOrigin.CENTER,
disableDepthTestDistance: Number.POSITIVE_INFINITY,
},
label: {
text: user.psnName,
font: "13px sans-serif",
pixelOffset: labelPixelOffset,
showBackground: true,
// 地图上扎点的名字背景色
// eslint-disable-next-line new-cap
backgroundColor: new window.Cesium.Color.fromCssColorString(
"rgba(20, 58, 142, 1)"
),
backgroundPadding: new window.Cesium.Cartesian2(7, 5),
disableDepthTestDistance: Number.POSITIVE_INFINITY,
},
})
);
obj.show = (e) => {
obj.entity.show = e;
};
obj.destroy = () => {
window.$icy.viewer.entities.remove(obj.entity);
};
});
};

View File

@ -10,3 +10,5 @@ export const getAggregatedDataStatistics = (params) =>
post("/positAlarm/aggregateDataStatistics", params); // 聚集区域统计
export const getAggregationAreaStatistics = (params) =>
post("/positAlarm/aggregateDataStatisticsByGroup", params); // 聚集数据统计
export const getAlarmGatherPsnInfo = (params) =>
post("/positAlarm/getAlarmGatherPsnInfo", params); // 聚集告警内人员列表

View File

@ -0,0 +1,42 @@
<template>
<el-dialog v-model="visible" title="告警信息" :on-close="fnClose">
<alarmView
v-if="visible"
:alarm="props.alarm"
:user-list="props.userList"
/>
<template #footer>
<el-button @click="fnClose"></el-button>
</template>
</el-dialog>
</template>
<script setup>
import { useVModels } from "@vueuse/core";
import alarmView from "@/components/map_tools/alarm_view";
const props = defineProps({
visible: {
type: Boolean,
required: true,
default: false,
},
alarm: {
type: Object,
required: true,
default: null,
},
userList: {
type: Array,
required: true,
default: () => [],
},
});
const emits = defineEmits(["update:visible", "get-data"]);
const { visible } = useVModels(props, emits);
const fnClose = () => {
visible.value = false;
};
</script>
<style scoped lang="scss"></style>

View File

@ -61,6 +61,13 @@
<el-button type="primary" @click="fnSubmit"></el-button>
</template>
</el-dialog>
<alarm_dialog
v-model:visible="data.alarmDialogDialog.visible"
:alarm="data.alarmDialogDialog.alarm"
:user-list="data.alarmDialogDialog.userList"
@get-data="fnResetPagination"
/>
</template>
<script setup>
@ -69,7 +76,12 @@ import { debounce } from "throttle-debounce";
import { ElMessage } from "element-plus";
import { serialNumber } from "@/assets/js/utils.js";
import useListData from "@/assets/js/useListData.js";
import { getGatheringAlarmRecordViewList } from "@/request/aggregation_management.js";
import {
getAlarmGatherPsnInfo,
getGatheringAlarmRecordViewList,
} from "@/request/aggregation_management.js";
import alarm_dialog from "./alarmDialog.vue";
import { reactive } from "vue";
const props = defineProps({
visible: {
@ -83,6 +95,14 @@ const props = defineProps({
default: () => ({}),
},
});
const data = reactive({
alarmDialogDialog: {
alarm: null,
userList: null,
visible: false,
},
});
const emits = defineEmits(["update:visible", "update:form", "get-data"]);
const { visible } = useVModels(props, emits);
const { list, searchForm, pagination, fnGetData, fnResetPagination } =
@ -108,9 +128,12 @@ const fnGetDataTransfer = () => {
gatherId: props.form.id,
});
};
const fnViewLocation = (row) => {
console.log(row);
// positAlarm/getAlarmGatherPsnInfo
const fnViewLocation = async (row) => {
const res = await getAlarmGatherPsnInfo({ id: row.id });
data.alarmDialogDialog.alarm = row;
data.alarmDialogDialog.userList = res.data;
data.alarmDialogDialog.visible = true;
};
const fnResetPaginationTransfer = () => {
fnResetPagination({