bruce-cesium 3.8.2 → 3.8.3
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 +601 -186
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +599 -184
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/cesium-animated-in-out.js +166 -0
- package/dist/lib/rendering/cesium-animated-in-out.js.map +1 -0
- package/dist/lib/rendering/cesium-animated-property.js +60 -1
- package/dist/lib/rendering/cesium-animated-property.js.map +1 -1
- package/dist/lib/rendering/entity-render-engine.js +266 -122
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +43 -21
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js +8 -23
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/lib/utils/cesium-entity-styler.js +63 -17
- package/dist/lib/utils/cesium-entity-styler.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/cesium-animated-in-out.d.ts +12 -0
- package/dist/types/rendering/cesium-animated-property.d.ts +21 -0
- package/dist/types/rendering/entity-render-engine.d.ts +6 -1
- package/dist/types/utils/cesium-entity-styler.d.ts +3 -0
- package/package.json +2 -2
|
@@ -614,6 +614,27 @@ function extractMetadataFromFileUrl(url) {
|
|
|
614
614
|
envId: envId
|
|
615
615
|
};
|
|
616
616
|
}
|
|
617
|
+
function getSeriesPossesForHistoricEntity(viewer, heightRef, historic) {
|
|
618
|
+
var series = [];
|
|
619
|
+
for (var i = 0; i < historic.length; i++) {
|
|
620
|
+
var item = historic[i];
|
|
621
|
+
var pos3d = entity_utils_1.EntityUtils.GetPos({
|
|
622
|
+
entity: item.data,
|
|
623
|
+
viewer: viewer,
|
|
624
|
+
recordHeightRef: heightRef,
|
|
625
|
+
returnHeightRef: heightRef
|
|
626
|
+
});
|
|
627
|
+
var dateTime = new Date(item.dateTime);
|
|
628
|
+
if (!dateTime || !pos3d || isNaN(pos3d.x) || isNaN(pos3d.y) || isNaN(pos3d.z)) {
|
|
629
|
+
continue;
|
|
630
|
+
}
|
|
631
|
+
series.push({
|
|
632
|
+
dateTime: dateTime,
|
|
633
|
+
pos3d: pos3d
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
return series;
|
|
637
|
+
}
|
|
617
638
|
var EntityRenderEngine;
|
|
618
639
|
(function (EntityRenderEngine) {
|
|
619
640
|
function Render(params) {
|
|
@@ -709,7 +730,7 @@ var EntityRenderEngine;
|
|
|
709
730
|
}
|
|
710
731
|
}
|
|
711
732
|
if (!(models.length > 0)) return [3 /*break*/, 2];
|
|
712
|
-
mParams = __assign(__assign({}, groupRenderParams), { rendered: cEntities, entities: models });
|
|
733
|
+
mParams = __assign(__assign({}, groupRenderParams), { rendered: cEntities, entities: models, entitiesHistoric: params.entitiesHistoric });
|
|
713
734
|
return [4 /*yield*/, Model3d.RenderGroup(mParams)];
|
|
714
735
|
case 1:
|
|
715
736
|
mEntities = _m.sent();
|
|
@@ -738,6 +759,7 @@ var EntityRenderEngine;
|
|
|
738
759
|
return [2 /*return*/, "continue"];
|
|
739
760
|
}
|
|
740
761
|
pParams = __assign(__assign({}, groupRenderParams), { entities: [], rendered: cEntities });
|
|
762
|
+
pParams.entitiesHistoric = params.entitiesHistoric;
|
|
741
763
|
zoomItem = pParams.zoomItems[entity.Bruce.ID];
|
|
742
764
|
for (j = 0; j < entity.geometry.MultiGeometry.length; j++) {
|
|
743
765
|
subEntity = __assign(__assign({}, entity), { geometry: entity.geometry.MultiGeometry[j], Bruce: __assign(__assign({}, entity.Bruce), { ID: bruce_models_1.ObjectUtils.UId() }) });
|
|
@@ -840,7 +862,7 @@ var EntityRenderEngine;
|
|
|
840
862
|
_m.label = 10;
|
|
841
863
|
case 10:
|
|
842
864
|
if (!(points.length > 0)) return [3 /*break*/, 12];
|
|
843
|
-
pParams = __assign(__assign({}, groupRenderParams), { entities: points, rendered: cEntities });
|
|
865
|
+
pParams = __assign(__assign({}, groupRenderParams), { entities: points, rendered: cEntities, entitiesHistoric: params.entitiesHistoric });
|
|
844
866
|
return [4 /*yield*/, Point.RenderGroup(pParams)];
|
|
845
867
|
case 11:
|
|
846
868
|
pEntities = _m.sent();
|
|
@@ -909,11 +931,14 @@ var EntityRenderEngine;
|
|
|
909
931
|
function Render(params) {
|
|
910
932
|
var _a, _b, _c, _d;
|
|
911
933
|
return __awaiter(this, void 0, void 0, function () {
|
|
912
|
-
var entity, style, type, cEntity, siblings, prepareExistingGraphic, iconUrlRows, icon, iconUrl, metadata, api, image, e_5, iconScale, disableDepthTest, bColor,
|
|
934
|
+
var entity, style, type, cEntity, siblings, prepareExistingGraphic, iconUrlRows, icon, iconUrl, metadata, api, image, e_5, iconScale, disableDepthTest, bColor, cColor, heightRef_1, animateColorIn_1, position, series, animatePosition_1, currentImgKey, series, animatePosition_2, pos3d, prevPos3d, animatePosition_3, radius, bFill, cFill, outline, cOutline, outlineWidth, bOutline, heightRef, pos3d, extrusion, hasOutline, outlineExtrusion, outlineEntity, bColor, cColor, size, heightRef_2, circleBillboard, disableDepthTest, animateColorIn_2, position, series, animatePosition_4, imgKey, currentImgKey, series, animatePosition_5, pos3d, prevPos3d, animatePosition_6;
|
|
913
935
|
return __generator(this, function (_e) {
|
|
914
936
|
switch (_e.label) {
|
|
915
937
|
case 0:
|
|
916
938
|
entity = params.entity;
|
|
939
|
+
if (!params.entityHistoric) {
|
|
940
|
+
params.entityHistoric = [];
|
|
941
|
+
}
|
|
917
942
|
style = params.style;
|
|
918
943
|
type = style.Type;
|
|
919
944
|
if (type == null) {
|
|
@@ -1009,9 +1034,32 @@ var EntityRenderEngine;
|
|
|
1009
1034
|
disableDepthTest = Boolean(style.renderOnTop);
|
|
1010
1035
|
if (iconScale > 0) {
|
|
1011
1036
|
bColor = style.iconTintColor ? bruce_models_1.Calculator.GetColor(style.iconTintColor, entity, params.tags) : null;
|
|
1012
|
-
|
|
1037
|
+
cColor = bColor ? colorToCColor(bColor) : Cesium.Color.WHITE.clone();
|
|
1013
1038
|
heightRef_1 = getHeightRef(style);
|
|
1014
1039
|
if (!params.rendered || !params.rendered.billboard) {
|
|
1040
|
+
animateColorIn_1 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimateColor({
|
|
1041
|
+
durationMs: 200,
|
|
1042
|
+
targetColor: cColor,
|
|
1043
|
+
startColor: cColor.withAlpha(0),
|
|
1044
|
+
viewer: params.viewer
|
|
1045
|
+
});
|
|
1046
|
+
position = null;
|
|
1047
|
+
series = getSeriesPossesForHistoricEntity(params.viewer, heightRef_1, params.entityHistoric);
|
|
1048
|
+
if (series.length > 1) {
|
|
1049
|
+
animatePosition_1 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimatePositionSeries({
|
|
1050
|
+
posses: series,
|
|
1051
|
+
viewer: params.viewer
|
|
1052
|
+
});
|
|
1053
|
+
position = new Cesium.CallbackProperty(function () { return animatePosition_1.GetValue(); }, false);
|
|
1054
|
+
}
|
|
1055
|
+
else {
|
|
1056
|
+
position = new Cesium.CallbackProperty(function () { return entity_utils_1.EntityUtils.GetPos({
|
|
1057
|
+
viewer: params.viewer,
|
|
1058
|
+
entity: entity,
|
|
1059
|
+
recordHeightRef: heightRef_1,
|
|
1060
|
+
returnHeightRef: heightRef_1
|
|
1061
|
+
}); }, true);
|
|
1062
|
+
}
|
|
1015
1063
|
cEntity = new Cesium.Entity({
|
|
1016
1064
|
id: bruce_models_1.ObjectUtils.UId(10),
|
|
1017
1065
|
billboard: {
|
|
@@ -1022,18 +1070,27 @@ var EntityRenderEngine;
|
|
|
1022
1070
|
scale: iconScale,
|
|
1023
1071
|
disableDepthTestDistance: disableDepthTest ? Number.POSITIVE_INFINITY : undefined,
|
|
1024
1072
|
distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance),
|
|
1025
|
-
color: new Cesium.CallbackProperty(function () {
|
|
1073
|
+
color: new Cesium.CallbackProperty(function () {
|
|
1074
|
+
var color = animateColorIn_1.GetColor();
|
|
1075
|
+
if (animateColorIn_1.IsDone() && (cEntity === null || cEntity === void 0 ? void 0 : cEntity.billboard)) {
|
|
1076
|
+
cEntity.billboard.color = new Cesium.CallbackProperty(function () { return color; }, true);
|
|
1077
|
+
}
|
|
1078
|
+
return color;
|
|
1079
|
+
}, false),
|
|
1026
1080
|
// Would be great once we have a setting for this.
|
|
1027
1081
|
// translucencyByDistance: getTranslucencyByDistance(params.minDistance, params.maxDistance),
|
|
1028
1082
|
},
|
|
1029
|
-
position:
|
|
1030
|
-
viewer: params.viewer,
|
|
1031
|
-
entity: entity,
|
|
1032
|
-
recordHeightRef: heightRef_1,
|
|
1033
|
-
returnHeightRef: heightRef_1
|
|
1034
|
-
}); }, true),
|
|
1083
|
+
position: position,
|
|
1035
1084
|
show: true
|
|
1036
1085
|
});
|
|
1086
|
+
cesium_entity_styler_1.CesiumEntityStyler.BakeDefaultColor({
|
|
1087
|
+
entity: cEntity,
|
|
1088
|
+
colors: {
|
|
1089
|
+
"billboard": cColor
|
|
1090
|
+
},
|
|
1091
|
+
viewer: params.viewer,
|
|
1092
|
+
refresh: false
|
|
1093
|
+
});
|
|
1037
1094
|
}
|
|
1038
1095
|
else {
|
|
1039
1096
|
prepareExistingGraphic(params.rendered);
|
|
@@ -1046,25 +1103,35 @@ var EntityRenderEngine;
|
|
|
1046
1103
|
cEntity.billboard.heightReference = new Cesium.ConstantProperty(getHeightRef(style));
|
|
1047
1104
|
cEntity.billboard.disableDepthTestDistance = new Cesium.ConstantProperty(disableDepthTest ? Number.POSITIVE_INFINITY : undefined);
|
|
1048
1105
|
cEntity.billboard.distanceDisplayCondition = new Cesium.ConstantProperty(getDisplayCondition(params.minDistance, params.maxDistance));
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
targetPos3d: pos3d,
|
|
1106
|
+
series = getSeriesPossesForHistoricEntity(params.viewer, heightRef_1, params.entityHistoric);
|
|
1107
|
+
if (series.length > 1) {
|
|
1108
|
+
animatePosition_2 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimatePositionSeries({
|
|
1109
|
+
posses: series,
|
|
1110
|
+
viewer: params.viewer
|
|
1111
|
+
});
|
|
1112
|
+
cEntity.position = new Cesium.CallbackProperty(function () { return animatePosition_2.GetValue(); }, false);
|
|
1113
|
+
}
|
|
1114
|
+
else {
|
|
1115
|
+
pos3d = entity_utils_1.EntityUtils.GetPos({
|
|
1060
1116
|
viewer: params.viewer,
|
|
1061
|
-
|
|
1117
|
+
entity: entity,
|
|
1118
|
+
recordHeightRef: heightRef_1,
|
|
1119
|
+
returnHeightRef: heightRef_1
|
|
1062
1120
|
});
|
|
1063
|
-
|
|
1121
|
+
prevPos3d = getValue(params.viewer, cEntity.position);
|
|
1122
|
+
if (!prevPos3d || !Cesium.Cartesian3.equals(prevPos3d, pos3d)) {
|
|
1123
|
+
animatePosition_3 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimatePosition({
|
|
1124
|
+
durationMs: 200,
|
|
1125
|
+
targetPos3d: pos3d,
|
|
1126
|
+
viewer: params.viewer,
|
|
1127
|
+
startPos3d: prevPos3d
|
|
1128
|
+
});
|
|
1129
|
+
cEntity.position = new Cesium.CallbackProperty(function () { return animatePosition_3.GetValue(); }, false);
|
|
1130
|
+
}
|
|
1064
1131
|
}
|
|
1065
1132
|
// We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
|
|
1066
1133
|
cesium_entity_styler_1.CesiumEntityStyler.SetDefaultColor({
|
|
1067
|
-
color:
|
|
1134
|
+
color: cColor ? cColor : new Cesium.Color(),
|
|
1068
1135
|
entity: cEntity,
|
|
1069
1136
|
viewer: params.viewer,
|
|
1070
1137
|
override: true,
|
|
@@ -1209,6 +1276,29 @@ var EntityRenderEngine;
|
|
|
1209
1276
|
circleBillboard = createCircleBillboard(size, cColor.toCssColorString());
|
|
1210
1277
|
disableDepthTest = Boolean(style.renderOnTop);
|
|
1211
1278
|
if (!params.rendered || !params.rendered.billboard) {
|
|
1279
|
+
animateColorIn_2 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimateColor({
|
|
1280
|
+
durationMs: 200,
|
|
1281
|
+
targetColor: cColor,
|
|
1282
|
+
startColor: cColor.withAlpha(0),
|
|
1283
|
+
viewer: params.viewer
|
|
1284
|
+
});
|
|
1285
|
+
position = null;
|
|
1286
|
+
series = getSeriesPossesForHistoricEntity(params.viewer, heightRef_2, params.entityHistoric);
|
|
1287
|
+
if (series.length > 1) {
|
|
1288
|
+
animatePosition_4 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimatePositionSeries({
|
|
1289
|
+
posses: series,
|
|
1290
|
+
viewer: params.viewer
|
|
1291
|
+
});
|
|
1292
|
+
position = new Cesium.CallbackProperty(function () { return animatePosition_4.GetValue(); }, false);
|
|
1293
|
+
}
|
|
1294
|
+
else {
|
|
1295
|
+
position = new Cesium.CallbackProperty(function () { return entity_utils_1.EntityUtils.GetPos({
|
|
1296
|
+
viewer: params.viewer,
|
|
1297
|
+
entity: entity,
|
|
1298
|
+
recordHeightRef: heightRef_2,
|
|
1299
|
+
returnHeightRef: heightRef_2
|
|
1300
|
+
}); }, true);
|
|
1301
|
+
}
|
|
1212
1302
|
cEntity = new Cesium.Entity({
|
|
1213
1303
|
id: bruce_models_1.ObjectUtils.UId(10),
|
|
1214
1304
|
// point: {
|
|
@@ -1224,19 +1314,28 @@ var EntityRenderEngine;
|
|
|
1224
1314
|
height: circleBillboard.height,
|
|
1225
1315
|
width: circleBillboard.width,
|
|
1226
1316
|
image: circleBillboard.canvasDataUri,
|
|
1227
|
-
color: new Cesium.CallbackProperty(function () {
|
|
1317
|
+
color: new Cesium.CallbackProperty(function () {
|
|
1318
|
+
var color = animateColorIn_2.GetColor();
|
|
1319
|
+
if (animateColorIn_2.IsDone() && (cEntity === null || cEntity === void 0 ? void 0 : cEntity.billboard)) {
|
|
1320
|
+
cEntity.billboard.color = new Cesium.CallbackProperty(function () { return color; }, true);
|
|
1321
|
+
}
|
|
1322
|
+
return color;
|
|
1323
|
+
}, false),
|
|
1228
1324
|
heightReference: heightRef_2,
|
|
1229
1325
|
distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance),
|
|
1230
1326
|
disableDepthTestDistance: disableDepthTest ? Number.POSITIVE_INFINITY : undefined
|
|
1231
1327
|
},
|
|
1232
|
-
position:
|
|
1233
|
-
viewer: params.viewer,
|
|
1234
|
-
entity: entity,
|
|
1235
|
-
recordHeightRef: heightRef_2,
|
|
1236
|
-
returnHeightRef: heightRef_2
|
|
1237
|
-
}); }, true),
|
|
1328
|
+
position: position,
|
|
1238
1329
|
show: true
|
|
1239
1330
|
});
|
|
1331
|
+
cesium_entity_styler_1.CesiumEntityStyler.BakeDefaultColor({
|
|
1332
|
+
entity: cEntity,
|
|
1333
|
+
viewer: params.viewer,
|
|
1334
|
+
colors: {
|
|
1335
|
+
"billboard": cColor
|
|
1336
|
+
},
|
|
1337
|
+
refresh: false
|
|
1338
|
+
});
|
|
1240
1339
|
}
|
|
1241
1340
|
else {
|
|
1242
1341
|
prepareExistingGraphic(params.rendered);
|
|
@@ -1251,21 +1350,31 @@ var EntityRenderEngine;
|
|
|
1251
1350
|
cEntity.billboard.heightReference = new Cesium.ConstantProperty(heightRef_2);
|
|
1252
1351
|
cEntity.billboard.distanceDisplayCondition = new Cesium.ConstantProperty(getDisplayCondition(params.minDistance, params.maxDistance));
|
|
1253
1352
|
cEntity.billboard.disableDepthTestDistance = new Cesium.ConstantProperty(disableDepthTest ? Number.POSITIVE_INFINITY : undefined);
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
targetPos3d: pos3d,
|
|
1353
|
+
series = getSeriesPossesForHistoricEntity(params.viewer, heightRef_2, params.entityHistoric);
|
|
1354
|
+
if (series.length > 1) {
|
|
1355
|
+
animatePosition_5 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimatePositionSeries({
|
|
1356
|
+
posses: series,
|
|
1357
|
+
viewer: params.viewer
|
|
1358
|
+
});
|
|
1359
|
+
cEntity.position = new Cesium.CallbackProperty(function () { return animatePosition_5.GetValue(); }, false);
|
|
1360
|
+
}
|
|
1361
|
+
else {
|
|
1362
|
+
pos3d = entity_utils_1.EntityUtils.GetPos({
|
|
1265
1363
|
viewer: params.viewer,
|
|
1266
|
-
|
|
1364
|
+
entity: entity,
|
|
1365
|
+
recordHeightRef: heightRef_2,
|
|
1366
|
+
returnHeightRef: heightRef_2
|
|
1267
1367
|
});
|
|
1268
|
-
|
|
1368
|
+
prevPos3d = getValue(params.viewer, cEntity.position);
|
|
1369
|
+
if (!prevPos3d || !Cesium.Cartesian3.equals(prevPos3d, pos3d)) {
|
|
1370
|
+
animatePosition_6 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimatePosition({
|
|
1371
|
+
durationMs: 200,
|
|
1372
|
+
targetPos3d: pos3d,
|
|
1373
|
+
viewer: params.viewer,
|
|
1374
|
+
startPos3d: prevPos3d
|
|
1375
|
+
});
|
|
1376
|
+
cEntity.position = new Cesium.CallbackProperty(function () { return animatePosition_6.GetValue(); }, false);
|
|
1377
|
+
}
|
|
1269
1378
|
}
|
|
1270
1379
|
// We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
|
|
1271
1380
|
cesium_entity_styler_1.CesiumEntityStyler.SetDefaultColor({
|
|
@@ -1290,16 +1399,16 @@ var EntityRenderEngine;
|
|
|
1290
1399
|
}
|
|
1291
1400
|
Point.Render = Render;
|
|
1292
1401
|
function RenderGroup(params) {
|
|
1293
|
-
var _a, _b, _c, _d;
|
|
1402
|
+
var _a, _b, _c, _d, _e;
|
|
1294
1403
|
return __awaiter(this, void 0, void 0, function () {
|
|
1295
|
-
var api, cEntities, i, entity, zoomItem, style,
|
|
1296
|
-
return __generator(this, function (
|
|
1297
|
-
switch (
|
|
1404
|
+
var api, cEntities, i, entity, zoomItem, style, _f, tagIds, tags, pStyle, cEntity, name_2;
|
|
1405
|
+
return __generator(this, function (_g) {
|
|
1406
|
+
switch (_g.label) {
|
|
1298
1407
|
case 0:
|
|
1299
1408
|
api = params.apiGetter.getApi();
|
|
1300
1409
|
cEntities = new Map();
|
|
1301
1410
|
i = 0;
|
|
1302
|
-
|
|
1411
|
+
_g.label = 1;
|
|
1303
1412
|
case 1:
|
|
1304
1413
|
if (!(i < params.entities.length)) return [3 /*break*/, 11];
|
|
1305
1414
|
entity = params.entities[i];
|
|
@@ -1307,13 +1416,13 @@ var EntityRenderEngine;
|
|
|
1307
1416
|
if (!(zoomItem.StyleID != -1)) return [3 /*break*/, 3];
|
|
1308
1417
|
return [4 /*yield*/, getStyle(api, entity, zoomItem.StyleID)];
|
|
1309
1418
|
case 2:
|
|
1310
|
-
|
|
1419
|
+
_f = (_a = (_g.sent())) === null || _a === void 0 ? void 0 : _a.Settings;
|
|
1311
1420
|
return [3 /*break*/, 4];
|
|
1312
1421
|
case 3:
|
|
1313
|
-
|
|
1314
|
-
|
|
1422
|
+
_f = zoomItem.Style;
|
|
1423
|
+
_g.label = 4;
|
|
1315
1424
|
case 4:
|
|
1316
|
-
style =
|
|
1425
|
+
style = _f;
|
|
1317
1426
|
tagIds = entity.Bruce["Layer.ID"];
|
|
1318
1427
|
tags = [];
|
|
1319
1428
|
if (!(tagIds && tagIds.length > 0)) return [3 /*break*/, 6];
|
|
@@ -1322,8 +1431,8 @@ var EntityRenderEngine;
|
|
|
1322
1431
|
tagIds: tagIds
|
|
1323
1432
|
})];
|
|
1324
1433
|
case 5:
|
|
1325
|
-
tags = (
|
|
1326
|
-
|
|
1434
|
+
tags = (_g.sent()).tags;
|
|
1435
|
+
_g.label = 6;
|
|
1327
1436
|
case 6:
|
|
1328
1437
|
pStyle = (_b = style === null || style === void 0 ? void 0 : style.pointStyle) !== null && _b !== void 0 ? _b : {};
|
|
1329
1438
|
return [4 /*yield*/, Render({
|
|
@@ -1335,20 +1444,21 @@ var EntityRenderEngine;
|
|
|
1335
1444
|
apiGetter: params.apiGetter,
|
|
1336
1445
|
maxDistance: zoomItem.MaxZoom,
|
|
1337
1446
|
minDistance: zoomItem.MinZoom,
|
|
1338
|
-
rendered: (_c = params.rendered) === null || _c === void 0 ? void 0 : _c.get(entity.Bruce.ID)
|
|
1447
|
+
rendered: (_c = params.rendered) === null || _c === void 0 ? void 0 : _c.get(entity.Bruce.ID),
|
|
1448
|
+
entityHistoric: (_d = params.entitiesHistoric) === null || _d === void 0 ? void 0 : _d[entity.Bruce.ID]
|
|
1339
1449
|
})];
|
|
1340
1450
|
case 7:
|
|
1341
|
-
cEntity =
|
|
1451
|
+
cEntity = _g.sent();
|
|
1342
1452
|
if (!cEntity) return [3 /*break*/, 9];
|
|
1343
1453
|
return [4 /*yield*/, getName(api, entity)];
|
|
1344
1454
|
case 8:
|
|
1345
|
-
name_2 =
|
|
1455
|
+
name_2 = _g.sent();
|
|
1346
1456
|
cEntity.name = name_2;
|
|
1347
|
-
cEntity._renderGroup = getRenderGroupId(zoomItem, (
|
|
1348
|
-
|
|
1457
|
+
cEntity._renderGroup = getRenderGroupId(zoomItem, (_e = params.viewer) === null || _e === void 0 ? void 0 : _e.terrainProvider);
|
|
1458
|
+
_g.label = 9;
|
|
1349
1459
|
case 9:
|
|
1350
1460
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
1351
|
-
|
|
1461
|
+
_g.label = 10;
|
|
1352
1462
|
case 10:
|
|
1353
1463
|
i++;
|
|
1354
1464
|
return [3 /*break*/, 1];
|
|
@@ -1919,6 +2029,9 @@ var EntityRenderEngine;
|
|
|
1919
2029
|
function Render(params) {
|
|
1920
2030
|
var _this = this;
|
|
1921
2031
|
var entity = params.entity;
|
|
2032
|
+
if (!params.entityHistoric) {
|
|
2033
|
+
params.entityHistoric = [];
|
|
2034
|
+
}
|
|
1922
2035
|
var transform = entity === null || entity === void 0 ? void 0 : entity.transform;
|
|
1923
2036
|
var heading = (0, js_utils_1.EnsureNumber)(transform === null || transform === void 0 ? void 0 : transform.heading);
|
|
1924
2037
|
heading = (heading + 90) % 360;
|
|
@@ -1965,29 +2078,38 @@ var EntityRenderEngine;
|
|
|
1965
2078
|
color = colorToCColor(bColor);
|
|
1966
2079
|
}
|
|
1967
2080
|
}
|
|
1968
|
-
/*
|
|
1969
|
-
const cEntity: ICesiumEntityExt = new Cesium.Entity({
|
|
1970
|
-
id: ObjectUtils.UId(10),
|
|
1971
|
-
model: {
|
|
1972
|
-
uri: params.lodUrl,
|
|
1973
|
-
heightReference: heightRef,
|
|
1974
|
-
scale: scale * styleScale,
|
|
1975
|
-
shadows: Cesium.ShadowMode.ENABLED,
|
|
1976
|
-
colorBlendAmount: blendAmount,
|
|
1977
|
-
colorBlendMode: blendMode,
|
|
1978
|
-
color: new Cesium.CallbackProperty(() => color, true),
|
|
1979
|
-
distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance)
|
|
1980
|
-
},
|
|
1981
|
-
orientation: new Cesium.ConstantProperty(orientation),
|
|
1982
|
-
position: pos,
|
|
1983
|
-
show: true
|
|
1984
|
-
});
|
|
1985
|
-
*/
|
|
1986
2081
|
var animateScale = null;
|
|
1987
2082
|
var cEntity = params.rendered;
|
|
1988
2083
|
if (!cEntity || !cEntity.model) {
|
|
1989
2084
|
var hpr = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(heading), Cesium.Math.toRadians(pitch), Cesium.Math.toRadians(roll));
|
|
1990
2085
|
var orientation_1 = Cesium.Transforms.headingPitchRollQuaternion(pos3d, hpr);
|
|
2086
|
+
if (!color) {
|
|
2087
|
+
color = Cesium.Color.WHITE.clone();
|
|
2088
|
+
}
|
|
2089
|
+
var animateColor_1 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimateColor({
|
|
2090
|
+
durationMs: 1500,
|
|
2091
|
+
targetColor: color,
|
|
2092
|
+
startColor: color.clone().withAlpha(0.001),
|
|
2093
|
+
viewer: params.viewer
|
|
2094
|
+
});
|
|
2095
|
+
var position = null;
|
|
2096
|
+
// If we have a series of time-based positions then we'll animate as time changes.
|
|
2097
|
+
var series = getSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
|
|
2098
|
+
if (series.length > 1) {
|
|
2099
|
+
var animatePosition_7 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimatePositionSeries({
|
|
2100
|
+
posses: series,
|
|
2101
|
+
viewer: params.viewer
|
|
2102
|
+
});
|
|
2103
|
+
position = new Cesium.CallbackProperty(function () { return animatePosition_7.GetValue(); }, false);
|
|
2104
|
+
}
|
|
2105
|
+
else {
|
|
2106
|
+
position = new Cesium.CallbackProperty(function () { return entity_utils_1.EntityUtils.GetPos({
|
|
2107
|
+
viewer: params.viewer,
|
|
2108
|
+
entity: entity,
|
|
2109
|
+
recordHeightRef: heightRef,
|
|
2110
|
+
returnHeightRef: heightRef
|
|
2111
|
+
}); }, true);
|
|
2112
|
+
}
|
|
1991
2113
|
cEntity = new Cesium.Entity({
|
|
1992
2114
|
id: bruce_models_1.ObjectUtils.UId(10),
|
|
1993
2115
|
model: {
|
|
@@ -1997,17 +2119,27 @@ var EntityRenderEngine;
|
|
|
1997
2119
|
shadows: Cesium.ShadowMode.ENABLED,
|
|
1998
2120
|
colorBlendAmount: blendAmount,
|
|
1999
2121
|
colorBlendMode: blendMode,
|
|
2000
|
-
color: new Cesium.CallbackProperty(function () {
|
|
2122
|
+
color: new Cesium.CallbackProperty(function () {
|
|
2123
|
+
var color = animateColor_1.GetColor();
|
|
2124
|
+
if (animateColor_1.IsDone() && (cEntity === null || cEntity === void 0 ? void 0 : cEntity.model)) {
|
|
2125
|
+
cEntity.model.color = new Cesium.CallbackProperty(function () { return color; }, true);
|
|
2126
|
+
}
|
|
2127
|
+
return color;
|
|
2128
|
+
}, false),
|
|
2001
2129
|
distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance)
|
|
2002
2130
|
},
|
|
2003
2131
|
orientation: new Cesium.CallbackProperty(function () { return orientation_1; }, true),
|
|
2004
|
-
position:
|
|
2132
|
+
position: position,
|
|
2005
2133
|
show: true
|
|
2006
2134
|
});
|
|
2007
2135
|
cesium_entity_styler_1.CesiumEntityStyler.BakeDefaultColor({
|
|
2008
2136
|
entity: cEntity,
|
|
2009
2137
|
viewer: params.viewer,
|
|
2010
|
-
override: true
|
|
2138
|
+
override: true,
|
|
2139
|
+
colors: {
|
|
2140
|
+
"model": color
|
|
2141
|
+
},
|
|
2142
|
+
refresh: false
|
|
2011
2143
|
});
|
|
2012
2144
|
}
|
|
2013
2145
|
else {
|
|
@@ -2037,17 +2169,28 @@ var EntityRenderEngine;
|
|
|
2037
2169
|
cEntity.model.colorBlendAmount = new Cesium.ConstantProperty(blendAmount);
|
|
2038
2170
|
cEntity.model.colorBlendMode = new Cesium.ConstantProperty(blendMode);
|
|
2039
2171
|
cEntity.model.distanceDisplayCondition = new Cesium.ConstantProperty(getDisplayCondition(params.minDistance, params.maxDistance));
|
|
2040
|
-
|
|
2041
|
-
var
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
targetPos3d: pos3d,
|
|
2047
|
-
viewer: params.viewer,
|
|
2048
|
-
startPos3d: prevPos3d
|
|
2172
|
+
// If we have a series of time-based positions then we'll animate as time changes.
|
|
2173
|
+
var series = getSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
|
|
2174
|
+
if (series.length > 1) {
|
|
2175
|
+
var animatePosition_8 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimatePositionSeries({
|
|
2176
|
+
posses: series,
|
|
2177
|
+
viewer: params.viewer
|
|
2049
2178
|
});
|
|
2050
|
-
cEntity.position = new Cesium.CallbackProperty(function () { return
|
|
2179
|
+
cEntity.position = new Cesium.CallbackProperty(function () { return animatePosition_8.GetValue(); }, false);
|
|
2180
|
+
}
|
|
2181
|
+
else {
|
|
2182
|
+
var prevPos3d = getValue(params.viewer, cEntity.position);
|
|
2183
|
+
var posChanged = !prevPos3d || !Cesium.Cartesian3.equals(prevPos3d, pos3d);
|
|
2184
|
+
var animatePosition_9 = null;
|
|
2185
|
+
if (posChanged) {
|
|
2186
|
+
animatePosition_9 = new cesium_animated_property_1.CesiumAnimatedProperty.AnimatePosition({
|
|
2187
|
+
durationMs: 200,
|
|
2188
|
+
targetPos3d: pos3d,
|
|
2189
|
+
viewer: params.viewer,
|
|
2190
|
+
startPos3d: prevPos3d
|
|
2191
|
+
});
|
|
2192
|
+
cEntity.position = new Cesium.CallbackProperty(function () { return animatePosition_9.GetValue(); }, false);
|
|
2193
|
+
}
|
|
2051
2194
|
}
|
|
2052
2195
|
// cEntity.orientation = new Cesium.ConstantProperty(orientation);
|
|
2053
2196
|
var prevHeading = cEntity.model._heading;
|
|
@@ -2196,16 +2339,16 @@ var EntityRenderEngine;
|
|
|
2196
2339
|
}
|
|
2197
2340
|
Model3d.Render = Render;
|
|
2198
2341
|
function RenderGroup(params) {
|
|
2199
|
-
var _a, _b, _c, _d, _e, _f;
|
|
2342
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2200
2343
|
return __awaiter(this, void 0, void 0, function () {
|
|
2201
|
-
var api, cEntities, reqBody, i, entity, zoomItem, style,
|
|
2202
|
-
return __generator(this, function (
|
|
2203
|
-
switch (
|
|
2344
|
+
var api, cEntities, reqBody, i, entity, zoomItem, style, _h, tagIds, tags, mStyle, group, level, catId, lodData, _loop_2, i;
|
|
2345
|
+
return __generator(this, function (_j) {
|
|
2346
|
+
switch (_j.label) {
|
|
2204
2347
|
case 0:
|
|
2205
2348
|
api = params.apiGetter.getApi();
|
|
2206
2349
|
return [4 /*yield*/, api.Loading];
|
|
2207
2350
|
case 1:
|
|
2208
|
-
|
|
2351
|
+
_j.sent();
|
|
2209
2352
|
cEntities = new Map();
|
|
2210
2353
|
reqBody = {
|
|
2211
2354
|
"strict": false,
|
|
@@ -2213,7 +2356,7 @@ var EntityRenderEngine;
|
|
|
2213
2356
|
"Items": []
|
|
2214
2357
|
};
|
|
2215
2358
|
i = 0;
|
|
2216
|
-
|
|
2359
|
+
_j.label = 2;
|
|
2217
2360
|
case 2:
|
|
2218
2361
|
if (!(i < params.entities.length)) return [3 /*break*/, 9];
|
|
2219
2362
|
entity = params.entities[i];
|
|
@@ -2221,13 +2364,13 @@ var EntityRenderEngine;
|
|
|
2221
2364
|
if (!(zoomItem.StyleID != -1)) return [3 /*break*/, 4];
|
|
2222
2365
|
return [4 /*yield*/, getStyle(api, entity, zoomItem.StyleID)];
|
|
2223
2366
|
case 3:
|
|
2224
|
-
|
|
2367
|
+
_h = (_a = (_j.sent())) === null || _a === void 0 ? void 0 : _a.Settings;
|
|
2225
2368
|
return [3 /*break*/, 5];
|
|
2226
2369
|
case 4:
|
|
2227
|
-
|
|
2228
|
-
|
|
2370
|
+
_h = zoomItem.Style;
|
|
2371
|
+
_j.label = 5;
|
|
2229
2372
|
case 5:
|
|
2230
|
-
style =
|
|
2373
|
+
style = _h;
|
|
2231
2374
|
tagIds = entity.Bruce["Layer.ID"];
|
|
2232
2375
|
tags = [];
|
|
2233
2376
|
if (!(tagIds && tagIds.length > 0)) return [3 /*break*/, 7];
|
|
@@ -2236,8 +2379,8 @@ var EntityRenderEngine;
|
|
|
2236
2379
|
tagIds: tagIds
|
|
2237
2380
|
})];
|
|
2238
2381
|
case 6:
|
|
2239
|
-
tags = (
|
|
2240
|
-
|
|
2382
|
+
tags = (_j.sent()).tags;
|
|
2383
|
+
_j.label = 7;
|
|
2241
2384
|
case 7:
|
|
2242
2385
|
mStyle = (_b = style === null || style === void 0 ? void 0 : style.modelStyle) !== null && _b !== void 0 ? _b : {};
|
|
2243
2386
|
group = mStyle.lodGroup ? bruce_models_1.Calculator.GetString(mStyle.lodGroup, entity, tags) : null;
|
|
@@ -2258,7 +2401,7 @@ var EntityRenderEngine;
|
|
|
2258
2401
|
"group": group,
|
|
2259
2402
|
"level": level
|
|
2260
2403
|
});
|
|
2261
|
-
|
|
2404
|
+
_j.label = 8;
|
|
2262
2405
|
case 8:
|
|
2263
2406
|
i++;
|
|
2264
2407
|
return [3 /*break*/, 2];
|
|
@@ -2267,24 +2410,24 @@ var EntityRenderEngine;
|
|
|
2267
2410
|
filter: reqBody
|
|
2268
2411
|
})];
|
|
2269
2412
|
case 10:
|
|
2270
|
-
lodData = (
|
|
2413
|
+
lodData = (_j.sent()).lods;
|
|
2271
2414
|
_loop_2 = function (i) {
|
|
2272
|
-
var entity, zoomItem, style,
|
|
2273
|
-
return __generator(this, function (
|
|
2274
|
-
switch (
|
|
2415
|
+
var entity, zoomItem, style, _k, tagIds, tags, lod, mStyle, cEntity, name_5;
|
|
2416
|
+
return __generator(this, function (_l) {
|
|
2417
|
+
switch (_l.label) {
|
|
2275
2418
|
case 0:
|
|
2276
2419
|
entity = params.entities[i];
|
|
2277
2420
|
zoomItem = params.zoomItems[entity.Bruce.ID];
|
|
2278
2421
|
if (!(zoomItem.StyleID != -1)) return [3 /*break*/, 2];
|
|
2279
2422
|
return [4 /*yield*/, getStyle(api, entity, zoomItem.StyleID)];
|
|
2280
2423
|
case 1:
|
|
2281
|
-
|
|
2424
|
+
_k = (_c = (_l.sent())) === null || _c === void 0 ? void 0 : _c.Settings;
|
|
2282
2425
|
return [3 /*break*/, 3];
|
|
2283
2426
|
case 2:
|
|
2284
|
-
|
|
2285
|
-
|
|
2427
|
+
_k = zoomItem.Style;
|
|
2428
|
+
_l.label = 3;
|
|
2286
2429
|
case 3:
|
|
2287
|
-
style =
|
|
2430
|
+
style = _k;
|
|
2288
2431
|
tagIds = entity.Bruce["Layer.ID"];
|
|
2289
2432
|
tags = [];
|
|
2290
2433
|
if (!(tagIds && tagIds.length > 0)) return [3 /*break*/, 5];
|
|
@@ -2293,8 +2436,8 @@ var EntityRenderEngine;
|
|
|
2293
2436
|
tagIds: tagIds
|
|
2294
2437
|
})];
|
|
2295
2438
|
case 4:
|
|
2296
|
-
tags = (
|
|
2297
|
-
|
|
2439
|
+
tags = (_l.sent()).tags;
|
|
2440
|
+
_l.label = 5;
|
|
2298
2441
|
case 5:
|
|
2299
2442
|
lod = lodData.find(function (x) { return x.entityId == entity.Bruce.ID; });
|
|
2300
2443
|
if (!(lod === null || lod === void 0 ? void 0 : lod.clientFileId)) {
|
|
@@ -2304,6 +2447,7 @@ var EntityRenderEngine;
|
|
|
2304
2447
|
cEntity = Render({
|
|
2305
2448
|
rendered: (_e = params.rendered) === null || _e === void 0 ? void 0 : _e.get(entity.Bruce.ID),
|
|
2306
2449
|
entity: entity,
|
|
2450
|
+
entityHistoric: (_f = params.entitiesHistoric) === null || _f === void 0 ? void 0 : _f[entity.Bruce.ID],
|
|
2307
2451
|
style: mStyle,
|
|
2308
2452
|
tags: tags,
|
|
2309
2453
|
viewer: params.viewer,
|
|
@@ -2319,23 +2463,23 @@ var EntityRenderEngine;
|
|
|
2319
2463
|
if (!cEntity) return [3 /*break*/, 7];
|
|
2320
2464
|
return [4 /*yield*/, getName(api, entity)];
|
|
2321
2465
|
case 6:
|
|
2322
|
-
name_5 =
|
|
2466
|
+
name_5 = _l.sent();
|
|
2323
2467
|
cEntity.name = name_5;
|
|
2324
|
-
cEntity._renderGroup = getRenderGroupId(zoomItem, (
|
|
2468
|
+
cEntity._renderGroup = getRenderGroupId(zoomItem, (_g = params.viewer) === null || _g === void 0 ? void 0 : _g.terrainProvider);
|
|
2325
2469
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
2326
|
-
|
|
2470
|
+
_l.label = 7;
|
|
2327
2471
|
case 7: return [2 /*return*/];
|
|
2328
2472
|
}
|
|
2329
2473
|
});
|
|
2330
2474
|
};
|
|
2331
2475
|
i = 0;
|
|
2332
|
-
|
|
2476
|
+
_j.label = 11;
|
|
2333
2477
|
case 11:
|
|
2334
2478
|
if (!(i < params.entities.length)) return [3 /*break*/, 14];
|
|
2335
2479
|
return [5 /*yield**/, _loop_2(i)];
|
|
2336
2480
|
case 12:
|
|
2337
|
-
|
|
2338
|
-
|
|
2481
|
+
_j.sent();
|
|
2482
|
+
_j.label = 13;
|
|
2339
2483
|
case 13:
|
|
2340
2484
|
i++;
|
|
2341
2485
|
return [3 /*break*/, 11];
|