bruce-cesium 4.4.2 → 4.4.4
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 +277 -99
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +276 -98
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/internal/cesium-utils.js +12 -1
- package/dist/lib/internal/cesium-utils.js.map +1 -1
- package/dist/lib/rendering/cesium-animated-in-out.js +1 -1
- package/dist/lib/rendering/cesium-animated-property.js +60 -7
- package/dist/lib/rendering/cesium-animated-property.js.map +1 -1
- package/dist/lib/rendering/entity-render-engine.js +129 -50
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +1 -0
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/utils/cesium-entity-styler.js +49 -14
- package/dist/lib/utils/cesium-entity-styler.js.map +1 -1
- package/dist/lib/utils/entity-utils.js +14 -6
- package/dist/lib/utils/entity-utils.js.map +1 -1
- package/dist/lib/widgets/widget-cursorbar.js +18 -15
- package/dist/lib/widgets/widget-cursorbar.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/internal/cesium-utils.d.ts +1 -0
- package/dist/types/rendering/cesium-animated-property.d.ts +10 -2
- package/dist/types/rendering/entity-render-engine.d.ts +8 -0
- package/dist/types/utils/entity-utils.d.ts +2 -0
- package/package.json +2 -2
|
@@ -627,6 +627,10 @@ function getSeriesPossesForHistoricEntity(viewer, heightRef, historic) {
|
|
|
627
627
|
var series = [];
|
|
628
628
|
for (var i = 0; i < historic.length; i++) {
|
|
629
629
|
var item = historic[i];
|
|
630
|
+
var dateTime = new Date(item.dateTime);
|
|
631
|
+
if (!dateTime) {
|
|
632
|
+
continue;
|
|
633
|
+
}
|
|
630
634
|
var pos3d = entity_utils_1.EntityUtils.GetPos({
|
|
631
635
|
entity: item.data,
|
|
632
636
|
viewer: viewer,
|
|
@@ -634,8 +638,7 @@ function getSeriesPossesForHistoricEntity(viewer, heightRef, historic) {
|
|
|
634
638
|
returnHeightRef: heightRef,
|
|
635
639
|
allowRendered: false
|
|
636
640
|
});
|
|
637
|
-
|
|
638
|
-
if (!dateTime || !pos3d || isNaN(pos3d.x) || isNaN(pos3d.y) || isNaN(pos3d.z)) {
|
|
641
|
+
if (!pos3d || isNaN(pos3d.x) || isNaN(pos3d.y) || isNaN(pos3d.z)) {
|
|
639
642
|
continue;
|
|
640
643
|
}
|
|
641
644
|
series.push({
|
|
@@ -878,7 +881,7 @@ var EntityRenderEngine;
|
|
|
878
881
|
}
|
|
879
882
|
}
|
|
880
883
|
if (!(models.length > 0)) return [3 /*break*/, 2];
|
|
881
|
-
mParams = __assign(__assign({}, groupRenderParams), { rendered: cEntities, entities: models, entitiesHistoric: params.entitiesHistoric });
|
|
884
|
+
mParams = __assign(__assign({}, groupRenderParams), { rendered: cEntities, entities: models, entitiesHistoric: params.entitiesHistoric, entityHistoricDrawTrack: params.entityHistoricDrawTrack });
|
|
882
885
|
return [4 /*yield*/, Model3d.RenderGroup(mParams)];
|
|
883
886
|
case 1:
|
|
884
887
|
mEntities = _g.sent();
|
|
@@ -1014,7 +1017,7 @@ var EntityRenderEngine;
|
|
|
1014
1017
|
_g.label = 10;
|
|
1015
1018
|
case 10:
|
|
1016
1019
|
if (!(points.length > 0)) return [3 /*break*/, 12];
|
|
1017
|
-
pParams = __assign(__assign({}, groupRenderParams), { entities: points, rendered: cEntities, entitiesHistoric: params.entitiesHistoric });
|
|
1020
|
+
pParams = __assign(__assign({}, groupRenderParams), { entities: points, rendered: cEntities, entitiesHistoric: params.entitiesHistoric, entityHistoricDrawTrack: params.entityHistoricDrawTrack });
|
|
1018
1021
|
return [4 /*yield*/, Point.RenderGroup(pParams)];
|
|
1019
1022
|
case 11:
|
|
1020
1023
|
pEntities = _g.sent();
|
|
@@ -1083,7 +1086,7 @@ var EntityRenderEngine;
|
|
|
1083
1086
|
function Render(params) {
|
|
1084
1087
|
var _a, _b, _c, _d;
|
|
1085
1088
|
return __awaiter(this, void 0, void 0, function () {
|
|
1086
|
-
var entity, style, type, cEntity, siblings, prepareExistingGraphic, iconUrlRows, icon, iconUrl, metadata, api, image, e_5, iconScale, disableDepthTest, bColor, cColor,
|
|
1089
|
+
var entity, style, type, cEntity, siblings, heightRef, animatePosition, shouldShowTrack, prepareExistingGraphic, updateShouldShowTrack, iconUrlRows, icon, iconUrl, metadata, api, image, e_5, iconScale, disableDepthTest, bColor, cColor, animateColorIn_1, position, series, currentImgKey, series, pos3d, prevPos3d, radius, bFill, cFill, outline, cOutline, outlineWidth, bOutline, pos3d, extrusion, hasOutline, outlineExtrusion, outlineEntity, bColor, cColor, size, circleBillboard, disableDepthTest, animateColorIn_2, position, series, imgKey, currentImgKey, series, animatePosition_1, pos3d, prevPos3d, animatePosition_2, lStyle, bColor, cColor, material, width, trackEntity;
|
|
1087
1090
|
return __generator(this, function (_e) {
|
|
1088
1091
|
switch (_e.label) {
|
|
1089
1092
|
case 0:
|
|
@@ -1101,15 +1104,18 @@ var EntityRenderEngine;
|
|
|
1101
1104
|
}
|
|
1102
1105
|
cEntity = null;
|
|
1103
1106
|
siblings = [];
|
|
1104
|
-
|
|
1105
|
-
|
|
1107
|
+
heightRef = null;
|
|
1108
|
+
animatePosition = null;
|
|
1109
|
+
shouldShowTrack = false;
|
|
1110
|
+
prepareExistingGraphic = function (cEntity, maxSiblings) {
|
|
1111
|
+
if (maxSiblings === void 0) { maxSiblings = 0; }
|
|
1106
1112
|
// Gather entity in case previous version had sibling graphics we no longer need.
|
|
1107
1113
|
var parts = entity_utils_1.EntityUtils.GatherEntity({
|
|
1108
1114
|
entity: cEntity,
|
|
1109
1115
|
});
|
|
1110
1116
|
if (parts.length > 1) {
|
|
1111
1117
|
// We'll cull all except the allowed number of siblings.
|
|
1112
|
-
cEntity._siblingGraphics = cEntity._siblingGraphics.slice(0,
|
|
1118
|
+
cEntity._siblingGraphics = cEntity._siblingGraphics.slice(0, maxSiblings);
|
|
1113
1119
|
// We'll remove all that aren't in the allowed (direct) list.
|
|
1114
1120
|
for (var i = 0; i < parts.length - 1; i++) {
|
|
1115
1121
|
var part = parts[i];
|
|
@@ -1121,6 +1127,34 @@ var EntityRenderEngine;
|
|
|
1121
1127
|
console.warn("Point.Render: Parent entity was not null. This should not happen.");
|
|
1122
1128
|
}
|
|
1123
1129
|
}
|
|
1130
|
+
siblings = cEntity._siblingGraphics;
|
|
1131
|
+
cEntity._siblingGraphics = [];
|
|
1132
|
+
};
|
|
1133
|
+
updateShouldShowTrack = function () {
|
|
1134
|
+
var _a, _b, _c;
|
|
1135
|
+
if (!params.entityHistoricDrawTrack) {
|
|
1136
|
+
return;
|
|
1137
|
+
}
|
|
1138
|
+
if ((_a = params.entityHistoric) === null || _a === void 0 ? void 0 : _a.length) {
|
|
1139
|
+
var lStyle = (_c = (_b = params.fullStyle) === null || _b === void 0 ? void 0 : _b.polylineStyle) !== null && _c !== void 0 ? _c : {};
|
|
1140
|
+
var width = lStyle.width ? (0, js_utils_1.EnsureNumber)(bruce_models_1.Calculator.GetNumber(lStyle.width, entity, params.tags)) : 2;
|
|
1141
|
+
if (width == null) {
|
|
1142
|
+
width = 2;
|
|
1143
|
+
}
|
|
1144
|
+
width = (0, js_utils_1.EnsureNumber)(width);
|
|
1145
|
+
if (width > 0.01) {
|
|
1146
|
+
var bColor = lStyle.lineColor ? bruce_models_1.Calculator.GetColor(lStyle.lineColor, entity, params.tags) : null;
|
|
1147
|
+
var cColor = bColor ? colorToCColor(bColor) : Cesium.Color.fromCssColorString("rgba(255, 193, 7, 0.8)");
|
|
1148
|
+
if (cColor.alpha > 0) {
|
|
1149
|
+
var seriesTrackPosses = getSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
|
|
1150
|
+
seriesTrackPosses.reverse();
|
|
1151
|
+
var posses = seriesTrackPosses.map(function (x) { return x.pos3d; });
|
|
1152
|
+
posses = cullDuplicatePoints(posses);
|
|
1153
|
+
shouldShowTrack = posses.length > 1;
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
;
|
|
1124
1158
|
};
|
|
1125
1159
|
if (!(type == bruce_models_1.Style.EPointType.Icon)) return [3 /*break*/, 9];
|
|
1126
1160
|
iconUrlRows = style.iconUrl == null ? [] : style.iconUrl;
|
|
@@ -1185,9 +1219,10 @@ var EntityRenderEngine;
|
|
|
1185
1219
|
}
|
|
1186
1220
|
disableDepthTest = Boolean(style.renderOnTop);
|
|
1187
1221
|
if (iconScale > 0) {
|
|
1222
|
+
updateShouldShowTrack();
|
|
1188
1223
|
bColor = style.iconTintColor ? bruce_models_1.Calculator.GetColor(style.iconTintColor, entity, params.tags) : null;
|
|
1189
1224
|
cColor = bColor ? colorToCColor(bColor) : Cesium.Color.WHITE.clone();
|
|
1190
|
-
|
|
1225
|
+
heightRef = getHeightRef(style);
|
|
1191
1226
|
if (!params.rendered || !params.rendered.billboard) {
|
|
1192
1227
|
animateColorIn_1 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimateColor({
|
|
1193
1228
|
durationMs: 200,
|
|
@@ -1196,20 +1231,20 @@ var EntityRenderEngine;
|
|
|
1196
1231
|
viewer: params.viewer
|
|
1197
1232
|
});
|
|
1198
1233
|
position = null;
|
|
1199
|
-
series = getSeriesPossesForHistoricEntity(params.viewer,
|
|
1234
|
+
series = getSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
|
|
1200
1235
|
if (series.length > 1) {
|
|
1201
|
-
|
|
1236
|
+
animatePosition = new cesium_animated_property_1.CesiumAnimatedProperty.AnimatePositionSeries({
|
|
1202
1237
|
posses: series,
|
|
1203
1238
|
viewer: params.viewer
|
|
1204
1239
|
});
|
|
1205
|
-
position = new Cesium.CallbackProperty(function () { return
|
|
1240
|
+
position = new Cesium.CallbackProperty(function () { return animatePosition.GetValue(); }, false);
|
|
1206
1241
|
}
|
|
1207
1242
|
else {
|
|
1208
1243
|
position = new Cesium.CallbackProperty(function () { return entity_utils_1.EntityUtils.GetPos({
|
|
1209
1244
|
viewer: params.viewer,
|
|
1210
1245
|
entity: entity,
|
|
1211
|
-
recordHeightRef:
|
|
1212
|
-
returnHeightRef:
|
|
1246
|
+
recordHeightRef: heightRef,
|
|
1247
|
+
returnHeightRef: heightRef,
|
|
1213
1248
|
allowRendered: false
|
|
1214
1249
|
}); }, true);
|
|
1215
1250
|
}
|
|
@@ -1246,7 +1281,7 @@ var EntityRenderEngine;
|
|
|
1246
1281
|
});
|
|
1247
1282
|
}
|
|
1248
1283
|
else {
|
|
1249
|
-
prepareExistingGraphic(params.rendered);
|
|
1284
|
+
prepareExistingGraphic(params.rendered, shouldShowTrack ? 1 : 0);
|
|
1250
1285
|
cEntity = params.rendered;
|
|
1251
1286
|
currentImgKey = cEntity.billboard._billboardImgKey;
|
|
1252
1287
|
if (currentImgKey != iconUrl) {
|
|
@@ -1256,31 +1291,31 @@ var EntityRenderEngine;
|
|
|
1256
1291
|
cEntity.billboard.heightReference = new Cesium.ConstantProperty(getHeightRef(style));
|
|
1257
1292
|
cEntity.billboard.disableDepthTestDistance = new Cesium.ConstantProperty(disableDepthTest ? Number.POSITIVE_INFINITY : undefined);
|
|
1258
1293
|
cEntity.billboard.distanceDisplayCondition = new Cesium.ConstantProperty(getDisplayCondition(params.minDistance, params.maxDistance));
|
|
1259
|
-
series = getSeriesPossesForHistoricEntity(params.viewer,
|
|
1294
|
+
series = getSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
|
|
1260
1295
|
if (series.length > 1) {
|
|
1261
|
-
|
|
1296
|
+
animatePosition = new cesium_animated_property_1.CesiumAnimatedProperty.AnimatePositionSeries({
|
|
1262
1297
|
posses: series,
|
|
1263
1298
|
viewer: params.viewer
|
|
1264
1299
|
});
|
|
1265
|
-
cEntity.position = new Cesium.CallbackProperty(function () { return
|
|
1300
|
+
cEntity.position = new Cesium.CallbackProperty(function () { return animatePosition.GetValue(); }, false);
|
|
1266
1301
|
}
|
|
1267
1302
|
else {
|
|
1268
1303
|
pos3d = entity_utils_1.EntityUtils.GetPos({
|
|
1269
1304
|
viewer: params.viewer,
|
|
1270
1305
|
entity: entity,
|
|
1271
|
-
recordHeightRef:
|
|
1272
|
-
returnHeightRef:
|
|
1306
|
+
recordHeightRef: heightRef,
|
|
1307
|
+
returnHeightRef: heightRef,
|
|
1273
1308
|
allowRendered: false
|
|
1274
1309
|
});
|
|
1275
1310
|
prevPos3d = getValue(params.viewer, cEntity.position);
|
|
1276
1311
|
if (!prevPos3d || !Cesium.Cartesian3.equals(prevPos3d, pos3d)) {
|
|
1277
|
-
|
|
1312
|
+
animatePosition = new cesium_animated_property_1.CesiumAnimatedProperty.AnimatePosition({
|
|
1278
1313
|
durationMs: 200,
|
|
1279
1314
|
targetPos3d: pos3d,
|
|
1280
1315
|
viewer: params.viewer,
|
|
1281
1316
|
startPos3d: prevPos3d
|
|
1282
1317
|
});
|
|
1283
|
-
cEntity.position = new Cesium.CallbackProperty(function () { return
|
|
1318
|
+
cEntity.position = new Cesium.CallbackProperty(function () { return animatePosition.GetValue(); }, false);
|
|
1284
1319
|
}
|
|
1285
1320
|
}
|
|
1286
1321
|
// We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
|
|
@@ -1374,7 +1409,7 @@ var EntityRenderEngine;
|
|
|
1374
1409
|
if (!outlineExtrusion.value && extrusion.value) {
|
|
1375
1410
|
outlineExtrusion.exHeightRef = extrusion.exHeightRef;
|
|
1376
1411
|
}
|
|
1377
|
-
outlineEntity =
|
|
1412
|
+
outlineEntity = siblings === null || siblings === void 0 ? void 0 : siblings[0];
|
|
1378
1413
|
if (outlineEntity && outlineEntity.ellipse) {
|
|
1379
1414
|
outlineEntity.ellipse.semiMajorAxis = new Cesium.ConstantProperty(radius + outlineWidth);
|
|
1380
1415
|
outlineEntity.ellipse.semiMinorAxis = new Cesium.ConstantProperty(radius + outlineWidth);
|
|
@@ -1427,9 +1462,10 @@ var EntityRenderEngine;
|
|
|
1427
1462
|
if (size <= 0) {
|
|
1428
1463
|
return [2 /*return*/, null];
|
|
1429
1464
|
}
|
|
1430
|
-
|
|
1465
|
+
heightRef = getHeightRef(style);
|
|
1431
1466
|
circleBillboard = createCircleBillboard(size, cColor.toCssColorString());
|
|
1432
1467
|
disableDepthTest = Boolean(style.renderOnTop);
|
|
1468
|
+
updateShouldShowTrack();
|
|
1433
1469
|
if (!params.rendered || !params.rendered.billboard) {
|
|
1434
1470
|
animateColorIn_2 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimateColor({
|
|
1435
1471
|
durationMs: 200,
|
|
@@ -1438,20 +1474,20 @@ var EntityRenderEngine;
|
|
|
1438
1474
|
viewer: params.viewer
|
|
1439
1475
|
});
|
|
1440
1476
|
position = null;
|
|
1441
|
-
series = getSeriesPossesForHistoricEntity(params.viewer,
|
|
1477
|
+
series = getSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
|
|
1442
1478
|
if (series.length > 1) {
|
|
1443
|
-
|
|
1479
|
+
animatePosition = new cesium_animated_property_1.CesiumAnimatedProperty.AnimatePositionSeries({
|
|
1444
1480
|
posses: series,
|
|
1445
1481
|
viewer: params.viewer
|
|
1446
1482
|
});
|
|
1447
|
-
position = new Cesium.CallbackProperty(function () { return
|
|
1483
|
+
position = new Cesium.CallbackProperty(function () { return animatePosition.GetValue(); }, false);
|
|
1448
1484
|
}
|
|
1449
1485
|
else {
|
|
1450
1486
|
position = new Cesium.CallbackProperty(function () { return entity_utils_1.EntityUtils.GetPos({
|
|
1451
1487
|
viewer: params.viewer,
|
|
1452
1488
|
entity: entity,
|
|
1453
|
-
recordHeightRef:
|
|
1454
|
-
returnHeightRef:
|
|
1489
|
+
recordHeightRef: heightRef,
|
|
1490
|
+
returnHeightRef: heightRef,
|
|
1455
1491
|
allowRendered: false
|
|
1456
1492
|
}); }, true);
|
|
1457
1493
|
}
|
|
@@ -1477,7 +1513,7 @@ var EntityRenderEngine;
|
|
|
1477
1513
|
}
|
|
1478
1514
|
return color;
|
|
1479
1515
|
}, false),
|
|
1480
|
-
heightReference:
|
|
1516
|
+
heightReference: heightRef,
|
|
1481
1517
|
distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance),
|
|
1482
1518
|
disableDepthTestDistance: disableDepthTest ? Number.POSITIVE_INFINITY : undefined
|
|
1483
1519
|
},
|
|
@@ -1494,7 +1530,7 @@ var EntityRenderEngine;
|
|
|
1494
1530
|
});
|
|
1495
1531
|
}
|
|
1496
1532
|
else {
|
|
1497
|
-
prepareExistingGraphic(params.rendered);
|
|
1533
|
+
prepareExistingGraphic(params.rendered, shouldShowTrack ? 1 : 0);
|
|
1498
1534
|
cEntity = params.rendered;
|
|
1499
1535
|
imgKey = "".concat(size, "-").concat(cColor.toCssColorString());
|
|
1500
1536
|
currentImgKey = cEntity.billboard._billboardImgKey;
|
|
@@ -1503,34 +1539,34 @@ var EntityRenderEngine;
|
|
|
1503
1539
|
}
|
|
1504
1540
|
cEntity.billboard.height = new Cesium.ConstantProperty(circleBillboard.height);
|
|
1505
1541
|
cEntity.billboard.width = new Cesium.ConstantProperty(circleBillboard.width);
|
|
1506
|
-
cEntity.billboard.heightReference = new Cesium.ConstantProperty(
|
|
1542
|
+
cEntity.billboard.heightReference = new Cesium.ConstantProperty(heightRef);
|
|
1507
1543
|
cEntity.billboard.distanceDisplayCondition = new Cesium.ConstantProperty(getDisplayCondition(params.minDistance, params.maxDistance));
|
|
1508
1544
|
cEntity.billboard.disableDepthTestDistance = new Cesium.ConstantProperty(disableDepthTest ? Number.POSITIVE_INFINITY : undefined);
|
|
1509
|
-
series = getSeriesPossesForHistoricEntity(params.viewer,
|
|
1545
|
+
series = getSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
|
|
1510
1546
|
if (series.length > 1) {
|
|
1511
|
-
|
|
1547
|
+
animatePosition_1 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimatePositionSeries({
|
|
1512
1548
|
posses: series,
|
|
1513
1549
|
viewer: params.viewer
|
|
1514
1550
|
});
|
|
1515
|
-
cEntity.position = new Cesium.CallbackProperty(function () { return
|
|
1551
|
+
cEntity.position = new Cesium.CallbackProperty(function () { return animatePosition_1.GetValue(); }, false);
|
|
1516
1552
|
}
|
|
1517
1553
|
else {
|
|
1518
1554
|
pos3d = entity_utils_1.EntityUtils.GetPos({
|
|
1519
1555
|
viewer: params.viewer,
|
|
1520
1556
|
entity: entity,
|
|
1521
|
-
recordHeightRef:
|
|
1522
|
-
returnHeightRef:
|
|
1557
|
+
recordHeightRef: heightRef,
|
|
1558
|
+
returnHeightRef: heightRef,
|
|
1523
1559
|
allowRendered: false
|
|
1524
1560
|
});
|
|
1525
1561
|
prevPos3d = getValue(params.viewer, cEntity.position);
|
|
1526
1562
|
if (!prevPos3d || !Cesium.Cartesian3.equals(prevPos3d, pos3d)) {
|
|
1527
|
-
|
|
1563
|
+
animatePosition_2 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimatePosition({
|
|
1528
1564
|
durationMs: 200,
|
|
1529
1565
|
targetPos3d: pos3d,
|
|
1530
1566
|
viewer: params.viewer,
|
|
1531
1567
|
startPos3d: prevPos3d
|
|
1532
1568
|
});
|
|
1533
|
-
cEntity.position = new Cesium.CallbackProperty(function () { return
|
|
1569
|
+
cEntity.position = new Cesium.CallbackProperty(function () { return animatePosition_2.GetValue(); }, false);
|
|
1534
1570
|
}
|
|
1535
1571
|
}
|
|
1536
1572
|
// We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
|
|
@@ -1546,9 +1582,50 @@ var EntityRenderEngine;
|
|
|
1546
1582
|
}
|
|
1547
1583
|
cEntity.billboard._billboardSize = Math.ceil(circleBillboard.height / 2);
|
|
1548
1584
|
}
|
|
1549
|
-
|
|
1550
|
-
|
|
1585
|
+
// Generate a polyline 'track' for the historic data.
|
|
1586
|
+
// We do this for historic data that exists and is moving.
|
|
1587
|
+
if (shouldShowTrack && animatePosition && animatePosition instanceof cesium_animated_property_1.CesiumAnimatedProperty.AnimatePositionSeries && animatePosition.GetSeries) {
|
|
1588
|
+
lStyle = (_d = (_c = params.fullStyle) === null || _c === void 0 ? void 0 : _c.polylineStyle) !== null && _d !== void 0 ? _d : {};
|
|
1589
|
+
bColor = lStyle.lineColor ? bruce_models_1.Calculator.GetColor(lStyle.lineColor, entity, params.tags) : null;
|
|
1590
|
+
cColor = bColor ? colorToCColor(bColor) : Cesium.Color.fromCssColorString("rgba(255, 193, 7, 0.8)");
|
|
1591
|
+
material = new Cesium.PolylineDashMaterialProperty({
|
|
1592
|
+
color: cColor
|
|
1593
|
+
});
|
|
1594
|
+
width = lStyle.lineWidth ? (0, js_utils_1.EnsureNumber)(bruce_models_1.Calculator.GetNumber(lStyle.lineWidth, entity, params.tags)) : 2;
|
|
1595
|
+
if (width == null) {
|
|
1596
|
+
width = 2;
|
|
1597
|
+
}
|
|
1598
|
+
width = (0, js_utils_1.EnsureNumber)(width);
|
|
1599
|
+
trackEntity = siblings === null || siblings === void 0 ? void 0 : siblings[0];
|
|
1600
|
+
if (!trackEntity) {
|
|
1601
|
+
trackEntity = new Cesium.Entity({
|
|
1602
|
+
id: bruce_models_1.ObjectUtils.UId(10),
|
|
1603
|
+
polyline: {
|
|
1604
|
+
positions: [],
|
|
1605
|
+
width: width,
|
|
1606
|
+
material: material,
|
|
1607
|
+
clampToGround: heightRef == Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
1608
|
+
zIndex: 0,
|
|
1609
|
+
classificationType: Cesium.ClassificationType.BOTH
|
|
1610
|
+
}
|
|
1611
|
+
});
|
|
1612
|
+
}
|
|
1613
|
+
trackEntity._noEdit = true;
|
|
1614
|
+
trackEntity.polyline.positions = new Cesium.CallbackProperty(function () {
|
|
1615
|
+
return animatePosition.GetSeries();
|
|
1616
|
+
}, false);
|
|
1617
|
+
// We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
|
|
1618
|
+
// WARNING: polyline does not support animation (yet?).
|
|
1619
|
+
cesium_entity_styler_1.CesiumEntityStyler.SetDefaultColor({
|
|
1620
|
+
color: cColor,
|
|
1621
|
+
entity: trackEntity,
|
|
1622
|
+
viewer: params.viewer,
|
|
1623
|
+
override: true,
|
|
1624
|
+
requestRender: false
|
|
1625
|
+
});
|
|
1626
|
+
siblings.push(trackEntity);
|
|
1551
1627
|
}
|
|
1628
|
+
cEntity._siblingGraphics = siblings;
|
|
1552
1629
|
return [2 /*return*/, cEntity];
|
|
1553
1630
|
}
|
|
1554
1631
|
});
|
|
@@ -1602,7 +1679,9 @@ var EntityRenderEngine;
|
|
|
1602
1679
|
maxDistance: zoomItem.MaxZoom,
|
|
1603
1680
|
minDistance: zoomItem.MinZoom,
|
|
1604
1681
|
rendered: (_c = params.rendered) === null || _c === void 0 ? void 0 : _c.get(entity.Bruce.ID),
|
|
1605
|
-
entityHistoric: (_d = params.entitiesHistoric) === null || _d === void 0 ? void 0 : _d[entity.Bruce.ID]
|
|
1682
|
+
entityHistoric: (_d = params.entitiesHistoric) === null || _d === void 0 ? void 0 : _d[entity.Bruce.ID],
|
|
1683
|
+
entityHistoricDrawTrack: params.entityHistoricDrawTrack,
|
|
1684
|
+
fullStyle: style
|
|
1606
1685
|
})];
|
|
1607
1686
|
case 7:
|
|
1608
1687
|
cEntity = _f.sent();
|
|
@@ -2336,11 +2415,11 @@ var EntityRenderEngine;
|
|
|
2336
2415
|
// If we have a series of time-based positions then we'll animate as time changes.
|
|
2337
2416
|
var series = getSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
|
|
2338
2417
|
if (series.length > 1) {
|
|
2339
|
-
var
|
|
2418
|
+
var animatePosition_3 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimatePositionSeries({
|
|
2340
2419
|
posses: series,
|
|
2341
2420
|
viewer: params.viewer
|
|
2342
2421
|
});
|
|
2343
|
-
position = new Cesium.CallbackProperty(function () { return
|
|
2422
|
+
position = new Cesium.CallbackProperty(function () { return animatePosition_3.GetValue(); }, false);
|
|
2344
2423
|
}
|
|
2345
2424
|
else {
|
|
2346
2425
|
position = new Cesium.CallbackProperty(function () { return entity_utils_1.EntityUtils.GetPos({
|
|
@@ -2386,7 +2465,7 @@ var EntityRenderEngine;
|
|
|
2386
2465
|
else {
|
|
2387
2466
|
// Gather entity in case previous version had sibling graphics we no longer need.
|
|
2388
2467
|
var parts = entity_utils_1.EntityUtils.GatherEntity({
|
|
2389
|
-
entity: cEntity
|
|
2468
|
+
entity: cEntity
|
|
2390
2469
|
});
|
|
2391
2470
|
if (parts.length > 1) {
|
|
2392
2471
|
// Kill all expect last part. Last one is the primary entity.
|
|
@@ -2413,24 +2492,24 @@ var EntityRenderEngine;
|
|
|
2413
2492
|
// If we have a series of time-based positions then we'll animate as time changes.
|
|
2414
2493
|
var series = getSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
|
|
2415
2494
|
if (series.length > 1) {
|
|
2416
|
-
var
|
|
2495
|
+
var animatePosition_4 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimatePositionSeries({
|
|
2417
2496
|
posses: series,
|
|
2418
2497
|
viewer: params.viewer
|
|
2419
2498
|
});
|
|
2420
|
-
cEntity.position = new Cesium.CallbackProperty(function () { return
|
|
2499
|
+
cEntity.position = new Cesium.CallbackProperty(function () { return animatePosition_4.GetValue(); }, false);
|
|
2421
2500
|
}
|
|
2422
2501
|
else {
|
|
2423
2502
|
var prevPos3d = getValue(params.viewer, cEntity.position);
|
|
2424
2503
|
var posChanged = !prevPos3d || !Cesium.Cartesian3.equals(prevPos3d, pos3d);
|
|
2425
|
-
var
|
|
2504
|
+
var animatePosition_5 = null;
|
|
2426
2505
|
if (posChanged) {
|
|
2427
|
-
|
|
2506
|
+
animatePosition_5 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimatePosition({
|
|
2428
2507
|
durationMs: 200,
|
|
2429
2508
|
targetPos3d: pos3d,
|
|
2430
2509
|
viewer: params.viewer,
|
|
2431
2510
|
startPos3d: prevPos3d
|
|
2432
2511
|
});
|
|
2433
|
-
cEntity.position = new Cesium.CallbackProperty(function () { return
|
|
2512
|
+
cEntity.position = new Cesium.CallbackProperty(function () { return animatePosition_5.GetValue(); }, false);
|
|
2434
2513
|
}
|
|
2435
2514
|
}
|
|
2436
2515
|
// cEntity.orientation = new Cesium.ConstantProperty(orientation);
|