bruce-cesium 3.8.0 → 3.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bruce-cesium.es5.js +211 -52
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +210 -51
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/cesium-animated-property.js +92 -9
- package/dist/lib/rendering/cesium-animated-property.js.map +1 -1
- package/dist/lib/rendering/entity-render-engine.js +88 -31
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/rendering/getters/entity-filter-getter.js +22 -6
- package/dist/lib/rendering/getters/entity-filter-getter.js.map +1 -1
- package/dist/lib/utils/cesium-entity-styler.js +4 -4
- package/dist/lib/utils/cesium-entity-styler.js.map +1 -1
- package/dist/lib/utils/entity-utils.js +3 -0
- package/dist/lib/utils/entity-utils.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/cesium-animated-property.d.ts +34 -5
- package/dist/types/rendering/entity-render-engine.d.ts +1 -0
- package/dist/types/utils/entity-utils.d.ts +1 -1
- package/package.json +1 -1
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -930,6 +930,20 @@
|
|
|
930
930
|
}
|
|
931
931
|
return value;
|
|
932
932
|
}
|
|
933
|
+
function getPosition(viewer, obj) {
|
|
934
|
+
var value = null;
|
|
935
|
+
if (obj === null || obj === void 0 ? void 0 : obj.getValue) {
|
|
936
|
+
var date = viewer.scene.lastRenderTime;
|
|
937
|
+
if (!date) {
|
|
938
|
+
date = viewer.clock.currentTime;
|
|
939
|
+
}
|
|
940
|
+
value = obj.getValue(date);
|
|
941
|
+
}
|
|
942
|
+
else {
|
|
943
|
+
value = obj;
|
|
944
|
+
}
|
|
945
|
+
return value;
|
|
946
|
+
}
|
|
933
947
|
/**
|
|
934
948
|
* Returns if a given visual is alive and in the scene.
|
|
935
949
|
* @param viewer
|
|
@@ -984,7 +998,7 @@
|
|
|
984
998
|
function AnimateColor(params) {
|
|
985
999
|
var _a;
|
|
986
1000
|
this.viewer = params.viewer;
|
|
987
|
-
this.
|
|
1001
|
+
this.targetColor = params.targetColor;
|
|
988
1002
|
this.durationMs = params.durationMs;
|
|
989
1003
|
this.startColor = getColor(this.viewer, params.startColor);
|
|
990
1004
|
if ((_a = this.startColor) === null || _a === void 0 ? void 0 : _a.clone) {
|
|
@@ -1005,18 +1019,18 @@
|
|
|
1005
1019
|
var elapsedMs = now.getTime() - this.startTime.getTime();
|
|
1006
1020
|
// Animation over.
|
|
1007
1021
|
if (elapsedMs >= this.durationMs) {
|
|
1008
|
-
return this.
|
|
1022
|
+
return this.targetColor;
|
|
1009
1023
|
}
|
|
1010
1024
|
try {
|
|
1011
1025
|
var progress = elapsedMs / this.durationMs;
|
|
1012
|
-
return Cesium.Color.lerp(this.startColor, this.
|
|
1026
|
+
return Cesium.Color.lerp(this.startColor, this.targetColor, progress, new Cesium.Color());
|
|
1013
1027
|
}
|
|
1014
1028
|
catch (e) {
|
|
1015
1029
|
console.error(e);
|
|
1016
1030
|
}
|
|
1017
1031
|
// Failed to calculate color.
|
|
1018
1032
|
// We'll just return the target color.
|
|
1019
|
-
return this.
|
|
1033
|
+
return this.targetColor;
|
|
1020
1034
|
};
|
|
1021
1035
|
/**
|
|
1022
1036
|
* Returns the calculated color as a material property.
|
|
@@ -1034,7 +1048,7 @@
|
|
|
1034
1048
|
this.paused = false;
|
|
1035
1049
|
this.paused = Boolean(params.startPaused);
|
|
1036
1050
|
this.viewer = params.viewer;
|
|
1037
|
-
this.
|
|
1051
|
+
this.targetValue = params.targetValue;
|
|
1038
1052
|
this.durationMs = params.durationMs;
|
|
1039
1053
|
this.startValue = getNumber(this.viewer, params.startValue);
|
|
1040
1054
|
if (!this.startValue) {
|
|
@@ -1058,18 +1072,18 @@
|
|
|
1058
1072
|
var elapsedMs = now.getTime() - this.startTime.getTime();
|
|
1059
1073
|
// Animation over.
|
|
1060
1074
|
if (elapsedMs >= this.durationMs) {
|
|
1061
|
-
return this.
|
|
1075
|
+
return this.targetValue;
|
|
1062
1076
|
}
|
|
1063
1077
|
try {
|
|
1064
1078
|
var progress = elapsedMs / this.durationMs;
|
|
1065
|
-
return Cesium.Math.lerp(this.startValue, this.
|
|
1079
|
+
return Cesium.Math.lerp(this.startValue, this.targetValue, progress);
|
|
1066
1080
|
}
|
|
1067
1081
|
catch (e) {
|
|
1068
1082
|
console.error(e);
|
|
1069
1083
|
}
|
|
1070
1084
|
// Failed to calculate value.
|
|
1071
1085
|
// We'll just return the target value.
|
|
1072
|
-
return this.
|
|
1086
|
+
return this.targetValue;
|
|
1073
1087
|
};
|
|
1074
1088
|
return AnimateNumber;
|
|
1075
1089
|
}());
|
|
@@ -1092,7 +1106,7 @@
|
|
|
1092
1106
|
* @returns
|
|
1093
1107
|
*/
|
|
1094
1108
|
function AnimateTFeatureColor(params) {
|
|
1095
|
-
var viewer = params.viewer, feature = params.feature, color = params.
|
|
1109
|
+
var viewer = params.viewer, feature = params.feature, color = params.targetColor, startColor = params.startColor, durationMs = params.durationMs;
|
|
1096
1110
|
ClearTFeatureColorAnimation(feature);
|
|
1097
1111
|
if (!startColor) {
|
|
1098
1112
|
if (feature.color) {
|
|
@@ -1173,6 +1187,75 @@
|
|
|
1173
1187
|
}
|
|
1174
1188
|
}
|
|
1175
1189
|
CesiumAnimatedProperty.ClearTFeatureColorAnimation = ClearTFeatureColorAnimation;
|
|
1190
|
+
var AnimatePosition = /** @class */ (function () {
|
|
1191
|
+
function AnimatePosition(params) {
|
|
1192
|
+
this.viewer = params.viewer;
|
|
1193
|
+
this.targetPos3d = params.targetPos3d;
|
|
1194
|
+
this.durationMs = params.durationMs;
|
|
1195
|
+
this.startPos3d = getPosition(this.viewer, params.startPos3d);
|
|
1196
|
+
if (!this.startPos3d) {
|
|
1197
|
+
this.startPos3d = Cesium.Cartesian3.clone(this.targetPos3d);
|
|
1198
|
+
}
|
|
1199
|
+
this.startTime = new Date();
|
|
1200
|
+
}
|
|
1201
|
+
AnimatePosition.prototype.GetValue = function () {
|
|
1202
|
+
var now = new Date();
|
|
1203
|
+
var elapsedMs = now.getTime() - this.startTime.getTime();
|
|
1204
|
+
// Animation over.
|
|
1205
|
+
if (elapsedMs >= this.durationMs) {
|
|
1206
|
+
return this.targetPos3d;
|
|
1207
|
+
}
|
|
1208
|
+
try {
|
|
1209
|
+
var progress = elapsedMs / this.durationMs;
|
|
1210
|
+
return Cesium.Cartesian3.lerp(this.startPos3d, this.targetPos3d, progress, new Cesium.Cartesian3());
|
|
1211
|
+
}
|
|
1212
|
+
catch (e) {
|
|
1213
|
+
console.error(e);
|
|
1214
|
+
}
|
|
1215
|
+
// Failed to calculate value.
|
|
1216
|
+
// We'll just return the target value.
|
|
1217
|
+
return this.targetPos3d;
|
|
1218
|
+
};
|
|
1219
|
+
return AnimatePosition;
|
|
1220
|
+
}());
|
|
1221
|
+
CesiumAnimatedProperty.AnimatePosition = AnimatePosition;
|
|
1222
|
+
var AnimateHeading = /** @class */ (function () {
|
|
1223
|
+
function AnimateHeading(params) {
|
|
1224
|
+
this.viewer = params.viewer;
|
|
1225
|
+
this.targetHeadingDeg = params.targetHeading;
|
|
1226
|
+
this.durationMs = params.durationMs;
|
|
1227
|
+
this.startHeadingDeg = getNumber(this.viewer, params.startHeading);
|
|
1228
|
+
if (!this.startHeadingDeg) {
|
|
1229
|
+
this.startHeadingDeg = 0;
|
|
1230
|
+
}
|
|
1231
|
+
this.startTime = new Date();
|
|
1232
|
+
}
|
|
1233
|
+
AnimateHeading.prototype.IsDone = function () {
|
|
1234
|
+
var now = new Date();
|
|
1235
|
+
var elapsedMs = now.getTime() - this.startTime.getTime();
|
|
1236
|
+
return elapsedMs >= this.durationMs;
|
|
1237
|
+
};
|
|
1238
|
+
AnimateHeading.prototype.GetValue = function () {
|
|
1239
|
+
var now = new Date();
|
|
1240
|
+
var elapsedMs = now.getTime() - this.startTime.getTime();
|
|
1241
|
+
// Animation over.
|
|
1242
|
+
if (elapsedMs >= this.durationMs) {
|
|
1243
|
+
return this.targetHeadingDeg;
|
|
1244
|
+
}
|
|
1245
|
+
try {
|
|
1246
|
+
var progress = elapsedMs / this.durationMs;
|
|
1247
|
+
return Cesium.Math.lerp(this.startHeadingDeg, this.targetHeadingDeg, progress);
|
|
1248
|
+
}
|
|
1249
|
+
catch (e) {
|
|
1250
|
+
console.error(e);
|
|
1251
|
+
}
|
|
1252
|
+
// Failed to calculate value.
|
|
1253
|
+
// We'll just return the target value.
|
|
1254
|
+
return this.targetHeadingDeg;
|
|
1255
|
+
};
|
|
1256
|
+
return AnimateHeading;
|
|
1257
|
+
}());
|
|
1258
|
+
CesiumAnimatedProperty.AnimateHeading = AnimateHeading;
|
|
1176
1259
|
})(CesiumAnimatedProperty || (CesiumAnimatedProperty = {}));
|
|
1177
1260
|
|
|
1178
1261
|
/**
|
|
@@ -1372,7 +1455,7 @@
|
|
|
1372
1455
|
}
|
|
1373
1456
|
else {
|
|
1374
1457
|
CesiumAnimatedProperty.AnimateTFeatureColor({
|
|
1375
|
-
|
|
1458
|
+
targetColor: color.clone(),
|
|
1376
1459
|
durationMs: animateMs,
|
|
1377
1460
|
feature: graphic,
|
|
1378
1461
|
viewer: viewer,
|
|
@@ -1383,7 +1466,7 @@
|
|
|
1383
1466
|
else if (graphic instanceof Cesium.ModelGraphics) {
|
|
1384
1467
|
// graphic.color = new Cesium.ConstantProperty(color);
|
|
1385
1468
|
var animateColor_1 = new CesiumAnimatedProperty.AnimateColor({
|
|
1386
|
-
|
|
1469
|
+
targetColor: color,
|
|
1387
1470
|
durationMs: animateMs,
|
|
1388
1471
|
viewer: viewer,
|
|
1389
1472
|
startColor: graphic.color
|
|
@@ -1407,7 +1490,7 @@
|
|
|
1407
1490
|
else if (graphic instanceof Cesium.PointGraphics) {
|
|
1408
1491
|
// graphic.color = new Cesium.ConstantProperty(color);
|
|
1409
1492
|
var animateColor_2 = new CesiumAnimatedProperty.AnimateColor({
|
|
1410
|
-
|
|
1493
|
+
targetColor: color,
|
|
1411
1494
|
durationMs: animateMs,
|
|
1412
1495
|
viewer: viewer,
|
|
1413
1496
|
startColor: graphic.color
|
|
@@ -1422,7 +1505,7 @@
|
|
|
1422
1505
|
else if (graphic instanceof Cesium.BillboardGraphics) {
|
|
1423
1506
|
// graphic.color = new Cesium.ConstantProperty(color);
|
|
1424
1507
|
var animateColor_3 = new CesiumAnimatedProperty.AnimateColor({
|
|
1425
|
-
|
|
1508
|
+
targetColor: color,
|
|
1426
1509
|
durationMs: animateMs,
|
|
1427
1510
|
viewer: viewer,
|
|
1428
1511
|
startColor: graphic.color
|
|
@@ -2112,6 +2195,9 @@
|
|
|
2112
2195
|
if (!paddingAlt) {
|
|
2113
2196
|
paddingAlt = 0;
|
|
2114
2197
|
}
|
|
2198
|
+
if (!Array.isArray(samples)) {
|
|
2199
|
+
samples = [samples];
|
|
2200
|
+
}
|
|
2115
2201
|
MAX_DISTANCE_BETWEEN_SAMPLES = 5000;
|
|
2116
2202
|
MAX_TERRAIN_SAMPLES = 25;
|
|
2117
2203
|
terrainSamples = 0;
|
|
@@ -5088,7 +5174,7 @@
|
|
|
5088
5174
|
function Render(params) {
|
|
5089
5175
|
var _a, _b, _c, _d;
|
|
5090
5176
|
return __awaiter(this, void 0, void 0, function () {
|
|
5091
|
-
var entity, style, type, cEntity, siblings, prepareExistingGraphic, iconUrlRows, icon, iconUrl, metadata, api, image, e_5, iconScale, disableDepthTest, bColor, cColor_1,
|
|
5177
|
+
var entity, style, type, cEntity, siblings, prepareExistingGraphic, iconUrlRows, icon, iconUrl, metadata, api, image, e_5, iconScale, disableDepthTest, bColor, cColor_1, heightRef_1, currentImgKey, pos3d, prevPos3d, animatePosition_1, radius, bFill, cFill, outline, cOutline, outlineWidth, bOutline, heightRef, pos3d, extrusion, hasOutline, outlineExtrusion, outlineEntity, bColor, cColor, size, heightRef_2, circleBillboard, disableDepthTest, imgKey, currentImgKey, pos3d, prevPos3d, animatePosition_2;
|
|
5092
5178
|
return __generator(this, function (_e) {
|
|
5093
5179
|
switch (_e.label) {
|
|
5094
5180
|
case 0:
|
|
@@ -5189,7 +5275,7 @@
|
|
|
5189
5275
|
if (iconScale > 0) {
|
|
5190
5276
|
bColor = style.iconTintColor ? bruceModels.Calculator.GetColor(style.iconTintColor, entity, params.tags) : null;
|
|
5191
5277
|
cColor_1 = bColor ? colorToCColor(bColor) : undefined;
|
|
5192
|
-
|
|
5278
|
+
heightRef_1 = getHeightRef(style);
|
|
5193
5279
|
if (!params.rendered || !params.rendered.billboard) {
|
|
5194
5280
|
cEntity = new Cesium.Entity({
|
|
5195
5281
|
id: bruceModels.ObjectUtils.UId(10),
|
|
@@ -5205,12 +5291,12 @@
|
|
|
5205
5291
|
// Would be great once we have a setting for this.
|
|
5206
5292
|
// translucencyByDistance: getTranslucencyByDistance(params.minDistance, params.maxDistance),
|
|
5207
5293
|
},
|
|
5208
|
-
position: exports.EntityUtils.GetPos({
|
|
5294
|
+
position: new Cesium.CallbackProperty(function () { return exports.EntityUtils.GetPos({
|
|
5209
5295
|
viewer: params.viewer,
|
|
5210
5296
|
entity: entity,
|
|
5211
|
-
recordHeightRef:
|
|
5212
|
-
returnHeightRef:
|
|
5213
|
-
}),
|
|
5297
|
+
recordHeightRef: heightRef_1,
|
|
5298
|
+
returnHeightRef: heightRef_1
|
|
5299
|
+
}); }, true),
|
|
5214
5300
|
show: true
|
|
5215
5301
|
});
|
|
5216
5302
|
}
|
|
@@ -5225,12 +5311,22 @@
|
|
|
5225
5311
|
cEntity.billboard.heightReference = new Cesium.ConstantProperty(getHeightRef(style));
|
|
5226
5312
|
cEntity.billboard.disableDepthTestDistance = new Cesium.ConstantProperty(disableDepthTest ? Number.POSITIVE_INFINITY : undefined);
|
|
5227
5313
|
cEntity.billboard.distanceDisplayCondition = new Cesium.ConstantProperty(getDisplayCondition(params.minDistance, params.maxDistance));
|
|
5228
|
-
|
|
5314
|
+
pos3d = exports.EntityUtils.GetPos({
|
|
5229
5315
|
viewer: params.viewer,
|
|
5230
5316
|
entity: entity,
|
|
5231
|
-
recordHeightRef:
|
|
5232
|
-
returnHeightRef:
|
|
5233
|
-
})
|
|
5317
|
+
recordHeightRef: heightRef_1,
|
|
5318
|
+
returnHeightRef: heightRef_1
|
|
5319
|
+
});
|
|
5320
|
+
prevPos3d = getValue$1(params.viewer, cEntity.position);
|
|
5321
|
+
if (!prevPos3d || !Cesium.Cartesian3.equals(prevPos3d, pos3d)) {
|
|
5322
|
+
animatePosition_1 = new CesiumAnimatedProperty.AnimatePosition({
|
|
5323
|
+
durationMs: 200,
|
|
5324
|
+
targetPos3d: pos3d,
|
|
5325
|
+
viewer: params.viewer,
|
|
5326
|
+
startPos3d: prevPos3d
|
|
5327
|
+
});
|
|
5328
|
+
cEntity.position = new Cesium.CallbackProperty(function () { return animatePosition_1.GetValue(); }, false);
|
|
5329
|
+
}
|
|
5234
5330
|
// We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
|
|
5235
5331
|
exports.CesiumEntityStyler.SetDefaultColor({
|
|
5236
5332
|
color: cColor_1 ? cColor_1 : new Cesium.Color(),
|
|
@@ -5374,7 +5470,7 @@
|
|
|
5374
5470
|
if (size <= 0) {
|
|
5375
5471
|
return [2 /*return*/, null];
|
|
5376
5472
|
}
|
|
5377
|
-
|
|
5473
|
+
heightRef_2 = getHeightRef(style);
|
|
5378
5474
|
circleBillboard = createCircleBillboard(size, cColor.toCssColorString());
|
|
5379
5475
|
disableDepthTest = Boolean(style.renderOnTop);
|
|
5380
5476
|
if (!params.rendered || !params.rendered.billboard) {
|
|
@@ -5394,16 +5490,16 @@
|
|
|
5394
5490
|
width: circleBillboard.width,
|
|
5395
5491
|
image: circleBillboard.canvasDataUri,
|
|
5396
5492
|
color: new Cesium.CallbackProperty(function () { return undefined; }, true),
|
|
5397
|
-
heightReference:
|
|
5493
|
+
heightReference: heightRef_2,
|
|
5398
5494
|
distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance),
|
|
5399
5495
|
disableDepthTestDistance: disableDepthTest ? Number.POSITIVE_INFINITY : undefined
|
|
5400
5496
|
},
|
|
5401
|
-
position: exports.EntityUtils.GetPos({
|
|
5497
|
+
position: new Cesium.CallbackProperty(function () { return exports.EntityUtils.GetPos({
|
|
5402
5498
|
viewer: params.viewer,
|
|
5403
5499
|
entity: entity,
|
|
5404
|
-
recordHeightRef:
|
|
5405
|
-
returnHeightRef:
|
|
5406
|
-
}),
|
|
5500
|
+
recordHeightRef: heightRef_2,
|
|
5501
|
+
returnHeightRef: heightRef_2
|
|
5502
|
+
}); }, true),
|
|
5407
5503
|
show: true
|
|
5408
5504
|
});
|
|
5409
5505
|
}
|
|
@@ -5417,15 +5513,25 @@
|
|
|
5417
5513
|
}
|
|
5418
5514
|
cEntity.billboard.height = new Cesium.ConstantProperty(circleBillboard.height);
|
|
5419
5515
|
cEntity.billboard.width = new Cesium.ConstantProperty(circleBillboard.width);
|
|
5420
|
-
cEntity.billboard.heightReference = new Cesium.ConstantProperty(
|
|
5516
|
+
cEntity.billboard.heightReference = new Cesium.ConstantProperty(heightRef_2);
|
|
5421
5517
|
cEntity.billboard.distanceDisplayCondition = new Cesium.ConstantProperty(getDisplayCondition(params.minDistance, params.maxDistance));
|
|
5422
5518
|
cEntity.billboard.disableDepthTestDistance = new Cesium.ConstantProperty(disableDepthTest ? Number.POSITIVE_INFINITY : undefined);
|
|
5423
|
-
|
|
5519
|
+
pos3d = exports.EntityUtils.GetPos({
|
|
5424
5520
|
viewer: params.viewer,
|
|
5425
5521
|
entity: entity,
|
|
5426
|
-
recordHeightRef:
|
|
5427
|
-
returnHeightRef:
|
|
5428
|
-
})
|
|
5522
|
+
recordHeightRef: heightRef_2,
|
|
5523
|
+
returnHeightRef: heightRef_2
|
|
5524
|
+
});
|
|
5525
|
+
prevPos3d = getValue$1(params.viewer, cEntity.position);
|
|
5526
|
+
if (!prevPos3d || !Cesium.Cartesian3.equals(prevPos3d, pos3d)) {
|
|
5527
|
+
animatePosition_2 = new CesiumAnimatedProperty.AnimatePosition({
|
|
5528
|
+
durationMs: 200,
|
|
5529
|
+
targetPos3d: pos3d,
|
|
5530
|
+
viewer: params.viewer,
|
|
5531
|
+
startPos3d: prevPos3d
|
|
5532
|
+
});
|
|
5533
|
+
cEntity.position = new Cesium.CallbackProperty(function () { return animatePosition_2.GetValue(); }, false);
|
|
5534
|
+
}
|
|
5429
5535
|
// We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
|
|
5430
5536
|
exports.CesiumEntityStyler.SetDefaultColor({
|
|
5431
5537
|
color: cColor,
|
|
@@ -6093,20 +6199,18 @@
|
|
|
6093
6199
|
if (styleScale <= 0) {
|
|
6094
6200
|
styleScale = 1;
|
|
6095
6201
|
}
|
|
6096
|
-
var hpr = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(heading), Cesium.Math.toRadians(pitch), Cesium.Math.toRadians(roll));
|
|
6097
6202
|
var heightRef = getHeightRef(style, Cesium.HeightReference.RELATIVE_TO_GROUND);
|
|
6098
|
-
var
|
|
6203
|
+
var pos3d = exports.EntityUtils.GetPos({
|
|
6099
6204
|
viewer: params.viewer,
|
|
6100
6205
|
entity: entity,
|
|
6101
6206
|
recordHeightRef: heightRef,
|
|
6102
6207
|
returnHeightRef: heightRef
|
|
6103
6208
|
});
|
|
6104
6209
|
if (heightRef == Cesium.HeightReference.CLAMP_TO_GROUND) {
|
|
6105
|
-
var carto = Cesium.Cartographic.fromCartesian(
|
|
6106
|
-
|
|
6210
|
+
var carto = Cesium.Cartographic.fromCartesian(pos3d);
|
|
6211
|
+
pos3d = Cesium.Cartesian3.fromRadians(EnsureNumber(carto.longitude), EnsureNumber(carto.latitude), 0);
|
|
6107
6212
|
heightRef = Cesium.HeightReference.RELATIVE_TO_GROUND;
|
|
6108
6213
|
}
|
|
6109
|
-
var orientation = Cesium.Transforms.headingPitchRollQuaternion(pos, hpr);
|
|
6110
6214
|
var blendMode = null;
|
|
6111
6215
|
var blendAmount = null;
|
|
6112
6216
|
var color = null;
|
|
@@ -6147,6 +6251,8 @@
|
|
|
6147
6251
|
var animateScale = null;
|
|
6148
6252
|
var cEntity = params.rendered;
|
|
6149
6253
|
if (!cEntity || !cEntity.model) {
|
|
6254
|
+
var hpr = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(heading), Cesium.Math.toRadians(pitch), Cesium.Math.toRadians(roll));
|
|
6255
|
+
var orientation_1 = Cesium.Transforms.headingPitchRollQuaternion(pos3d, hpr);
|
|
6150
6256
|
cEntity = new Cesium.Entity({
|
|
6151
6257
|
id: bruceModels.ObjectUtils.UId(10),
|
|
6152
6258
|
model: {
|
|
@@ -6159,8 +6265,8 @@
|
|
|
6159
6265
|
color: new Cesium.CallbackProperty(function () { return color; }, true),
|
|
6160
6266
|
distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance)
|
|
6161
6267
|
},
|
|
6162
|
-
orientation: new Cesium.
|
|
6163
|
-
position:
|
|
6268
|
+
orientation: new Cesium.CallbackProperty(function () { return orientation_1; }, true),
|
|
6269
|
+
position: new Cesium.CallbackProperty(function () { return pos3d; }, true),
|
|
6164
6270
|
show: true
|
|
6165
6271
|
});
|
|
6166
6272
|
exports.CesiumEntityStyler.BakeDefaultColor({
|
|
@@ -6196,14 +6302,50 @@
|
|
|
6196
6302
|
cEntity.model.colorBlendAmount = new Cesium.ConstantProperty(blendAmount);
|
|
6197
6303
|
cEntity.model.colorBlendMode = new Cesium.ConstantProperty(blendMode);
|
|
6198
6304
|
cEntity.model.distanceDisplayCondition = new Cesium.ConstantProperty(getDisplayCondition(params.minDistance, params.maxDistance));
|
|
6199
|
-
|
|
6200
|
-
|
|
6305
|
+
var prevPos3d = getValue$1(params.viewer, cEntity.position);
|
|
6306
|
+
var posChanged = !prevPos3d || !Cesium.Cartesian3.equals(prevPos3d, pos3d);
|
|
6307
|
+
var animatePosition_3 = null;
|
|
6308
|
+
if (posChanged) {
|
|
6309
|
+
animatePosition_3 = new CesiumAnimatedProperty.AnimatePosition({
|
|
6310
|
+
durationMs: 200,
|
|
6311
|
+
targetPos3d: pos3d,
|
|
6312
|
+
viewer: params.viewer,
|
|
6313
|
+
startPos3d: prevPos3d
|
|
6314
|
+
});
|
|
6315
|
+
cEntity.position = new Cesium.CallbackProperty(function () { return animatePosition_3.GetValue(); }, false);
|
|
6316
|
+
}
|
|
6317
|
+
// cEntity.orientation = new Cesium.ConstantProperty(orientation);
|
|
6318
|
+
var prevHeading = cEntity.model._heading;
|
|
6319
|
+
if (prevHeading == null || prevHeading == heading || isNaN(prevHeading)) {
|
|
6320
|
+
var hpr = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(heading), Cesium.Math.toRadians(pitch), Cesium.Math.toRadians(roll));
|
|
6321
|
+
var orient_1 = Cesium.Transforms.headingPitchRollQuaternion(pos3d, hpr);
|
|
6322
|
+
cEntity.orientation = new Cesium.CallbackProperty(function () { return orient_1; }, true);
|
|
6323
|
+
}
|
|
6324
|
+
// Animate orientation. We'll calculate the heading based on movement.
|
|
6325
|
+
else {
|
|
6326
|
+
var animateHeading_1 = new CesiumAnimatedProperty.AnimateHeading({
|
|
6327
|
+
durationMs: 200,
|
|
6328
|
+
targetHeading: heading,
|
|
6329
|
+
viewer: params.viewer,
|
|
6330
|
+
startHeading: prevHeading
|
|
6331
|
+
});
|
|
6332
|
+
cEntity.orientation = new Cesium.CallbackProperty(function () {
|
|
6333
|
+
var calcHeading = animateHeading_1.GetValue();
|
|
6334
|
+
var hpr = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(calcHeading), Cesium.Math.toRadians(pitch), Cesium.Math.toRadians(roll));
|
|
6335
|
+
var orient = Cesium.Transforms.headingPitchRollQuaternion(pos3d, hpr);
|
|
6336
|
+
// We'll stop the costly animation if it's done.
|
|
6337
|
+
if (animateHeading_1.IsDone()) {
|
|
6338
|
+
cEntity.orientation = new Cesium.ConstantProperty(orient);
|
|
6339
|
+
}
|
|
6340
|
+
return orient;
|
|
6341
|
+
}, false);
|
|
6342
|
+
}
|
|
6201
6343
|
// Same file but different scale. We'll animate the scale.
|
|
6202
6344
|
var prevClientFileId = cEntity.model._clientFileId;
|
|
6203
6345
|
if (prevClientFileId == params.lodClientFileId) {
|
|
6204
6346
|
animateScale = new CesiumAnimatedProperty.AnimateNumber({
|
|
6205
6347
|
durationMs: 200,
|
|
6206
|
-
|
|
6348
|
+
targetValue: scale * styleScale,
|
|
6207
6349
|
viewer: params.viewer,
|
|
6208
6350
|
startValue: cEntity.model.scale,
|
|
6209
6351
|
startPaused: true
|
|
@@ -6314,6 +6456,7 @@
|
|
|
6314
6456
|
record: scale,
|
|
6315
6457
|
style: styleScale
|
|
6316
6458
|
};
|
|
6459
|
+
model._heading = heading;
|
|
6317
6460
|
return cEntity;
|
|
6318
6461
|
}
|
|
6319
6462
|
Model3d.Render = Render;
|
|
@@ -13727,15 +13870,30 @@
|
|
|
13727
13870
|
*/
|
|
13728
13871
|
Getter.prototype.viewerDateTimeSub = function () {
|
|
13729
13872
|
var _this = this;
|
|
13730
|
-
this.
|
|
13731
|
-
if (!this.historicAttrKey) {
|
|
13873
|
+
if (!this.historicAttrKey || this.viewerDateTimeChangeRemoval) {
|
|
13732
13874
|
return;
|
|
13733
13875
|
}
|
|
13876
|
+
// This is multiplied by the speed of animation to figure
|
|
13877
|
+
// out how many animation "ticks" before we allow an update.
|
|
13878
|
+
var INTERVAL_WHILE_ANIMATING = 2.5 * 1000;
|
|
13879
|
+
var lastUpdateTime = null;
|
|
13734
13880
|
var delayQueue = new bruceModels.DelayQueue(function () {
|
|
13735
|
-
|
|
13736
|
-
|
|
13737
|
-
|
|
13738
|
-
|
|
13881
|
+
try {
|
|
13882
|
+
// If the timeline is animating then we'll wait longer to update.
|
|
13883
|
+
if (_this.viewer.clock.shouldAnimate && lastUpdateTime) {
|
|
13884
|
+
if (Math.abs(new Date().getTime() - lastUpdateTime) < INTERVAL_WHILE_ANIMATING) {
|
|
13885
|
+
return;
|
|
13886
|
+
}
|
|
13887
|
+
}
|
|
13888
|
+
lastUpdateTime = new Date().getTime();
|
|
13889
|
+
var current = _this.historicAttrDateTime;
|
|
13890
|
+
_this.updateHistoricDateTime();
|
|
13891
|
+
if (current != _this.historicAttrDateTime) {
|
|
13892
|
+
_this.updateState();
|
|
13893
|
+
}
|
|
13894
|
+
}
|
|
13895
|
+
catch (e) {
|
|
13896
|
+
console.error(e);
|
|
13739
13897
|
}
|
|
13740
13898
|
}, 250);
|
|
13741
13899
|
var postUpdateRemoval = this.viewer.scene.postUpdate.addEventListener(function () {
|
|
@@ -13842,6 +14000,7 @@
|
|
|
13842
14000
|
else {
|
|
13843
14001
|
this.getterLoopId += 1;
|
|
13844
14002
|
this.viewAreaDispose();
|
|
14003
|
+
this.viewerDateTimeDispose();
|
|
13845
14004
|
}
|
|
13846
14005
|
};
|
|
13847
14006
|
Getter.prototype.postStatus = function (status) {
|
|
@@ -23439,7 +23598,7 @@
|
|
|
23439
23598
|
ViewRenderEngine.Render = Render;
|
|
23440
23599
|
})(exports.ViewRenderEngine || (exports.ViewRenderEngine = {}));
|
|
23441
23600
|
|
|
23442
|
-
var VERSION = "3.8.
|
|
23601
|
+
var VERSION = "3.8.2";
|
|
23443
23602
|
|
|
23444
23603
|
exports.VERSION = VERSION;
|
|
23445
23604
|
exports.CesiumParabola = CesiumParabola;
|