bruce-cesium 5.3.6 → 5.3.8
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 +370 -4
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +367 -1
- 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 +219 -0
- package/dist/lib/rendering/cesium-animated-property.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js +143 -0
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js.map +1 -1
- package/dist/lib/rendering/tileset-render-engine.js +5 -0
- package/dist/lib/rendering/tileset-render-engine.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/cesium-animated-property.d.ts +56 -0
- package/dist/types/rendering/render-managers/tilesets/tileset-cad-render-manager.d.ts +20 -0
- package/package.json +2 -2
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BruceEvent, Cartes, Entity as Entity$1, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, ProjectViewTile, DelayQueue, EntityLod, Bounds, ZoomControl, EntityRelationType, ENVIRONMENT, EntityHistoricData, Tileset, EntityCoords, DataLab, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, Camera, ProjectViewLegacyTile, EntityAttachment, EntityAttachmentType, EntityAttribute, AbstractApi, Session } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, ClassificationType, ArcType, CornerType, ShadowMode, ConstantProperty, ConstantPositionProperty, HorizontalOrigin, VerticalOrigin,
|
|
3
|
+
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, ClassificationType, ArcType, CornerType, ShadowMode, ConstantProperty, ConstantPositionProperty, HorizontalOrigin, VerticalOrigin, ColorBlendMode, HeadingPitchRoll, Transforms, Model, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, SceneMode, GeoJsonDataSource, Primitive, Cesium3DTileFeature, Cesium3DTileStyle, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, BoundingSphere, GeometryInstance, Quaternion, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
|
|
4
4
|
|
|
5
5
|
const TIME_LAG = 300;
|
|
6
6
|
const POSITION_CHECK_TIMER = 950;
|
|
@@ -1406,6 +1406,225 @@ var CesiumAnimatedProperty;
|
|
|
1406
1406
|
return series;
|
|
1407
1407
|
}
|
|
1408
1408
|
CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity = GetSeriesPossesForHistoricEntity;
|
|
1409
|
+
/**
|
|
1410
|
+
* Animates a tileset position and heading from a series of positions over time.
|
|
1411
|
+
* Unlike other animation functions that directly modify the tileset,
|
|
1412
|
+
* this provides a callback with calculated values for the caller to apply.
|
|
1413
|
+
*
|
|
1414
|
+
* Example:
|
|
1415
|
+
* ```
|
|
1416
|
+
* const dispose = CesiumAnimatedProperty.AnimateTPositionSeries({
|
|
1417
|
+
* viewer: viewer,
|
|
1418
|
+
* posses: positionSeries,
|
|
1419
|
+
* onUpdate: (position, heading) => {}
|
|
1420
|
+
* });
|
|
1421
|
+
*
|
|
1422
|
+
* // To dispose:
|
|
1423
|
+
* dispose();
|
|
1424
|
+
* ```
|
|
1425
|
+
* @param params Animation parameters
|
|
1426
|
+
* @returns Function to stop the animation
|
|
1427
|
+
*/
|
|
1428
|
+
class AnimateTPositionSeries {
|
|
1429
|
+
constructor(params) {
|
|
1430
|
+
// Cache for calculated values.
|
|
1431
|
+
this.lastCalcTime = null;
|
|
1432
|
+
this.lastCalcPos3d = null;
|
|
1433
|
+
this.lastCalcHeading = null;
|
|
1434
|
+
this.removal = null;
|
|
1435
|
+
this.viewer = params.viewer;
|
|
1436
|
+
this.onUpdate = params.onUpdate;
|
|
1437
|
+
this.onDone = params.onDone;
|
|
1438
|
+
// No positions to animate.
|
|
1439
|
+
if (!params.posses || params.posses.length === 0) {
|
|
1440
|
+
return;
|
|
1441
|
+
}
|
|
1442
|
+
// Order positions by date.
|
|
1443
|
+
const orderedPosses = [...params.posses].sort((a, b) => {
|
|
1444
|
+
return a.dateTime.getTime() - b.dateTime.getTime();
|
|
1445
|
+
});
|
|
1446
|
+
// Process headings - if all are null or 0, assume all are null.
|
|
1447
|
+
this.positions = this.processHeadings([...orderedPosses]);
|
|
1448
|
+
// Set up the animation loop.
|
|
1449
|
+
this.removal = this.viewer.scene.postUpdate.addEventListener(() => this.update());
|
|
1450
|
+
this.update();
|
|
1451
|
+
}
|
|
1452
|
+
/**
|
|
1453
|
+
* Stop the animation and call the onDone callback if provided.
|
|
1454
|
+
*/
|
|
1455
|
+
stop() {
|
|
1456
|
+
if (this.removal) {
|
|
1457
|
+
this.removal();
|
|
1458
|
+
this.removal = null;
|
|
1459
|
+
if (this.onDone) {
|
|
1460
|
+
this.onDone();
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
/**
|
|
1465
|
+
* Update function called on each frame.
|
|
1466
|
+
*/
|
|
1467
|
+
update() {
|
|
1468
|
+
let now = this.viewer.scene.lastRenderTime;
|
|
1469
|
+
if (!now) {
|
|
1470
|
+
now = this.viewer.clock.currentTime;
|
|
1471
|
+
}
|
|
1472
|
+
const nowTime = JulianDate.toDate(now);
|
|
1473
|
+
const nowTimeMs = nowTime.getTime();
|
|
1474
|
+
// Skip calculation if time hasn't changed.
|
|
1475
|
+
if (this.lastCalcTime === nowTimeMs) {
|
|
1476
|
+
return;
|
|
1477
|
+
}
|
|
1478
|
+
// Calculate position.
|
|
1479
|
+
const position = this.calculatePosition(nowTimeMs);
|
|
1480
|
+
// Update cache values.
|
|
1481
|
+
this.lastCalcTime = nowTimeMs;
|
|
1482
|
+
this.lastCalcPos3d = position.pos3d;
|
|
1483
|
+
// Calculate heading.
|
|
1484
|
+
this.lastCalcHeading = this.calculateHeading(nowTimeMs, position.indexLast, position.indexNext);
|
|
1485
|
+
// Provide the calculated values to the caller.
|
|
1486
|
+
this.onUpdate(this.lastCalcPos3d, this.lastCalcHeading);
|
|
1487
|
+
}
|
|
1488
|
+
/**
|
|
1489
|
+
* Pre-process headings in the series.
|
|
1490
|
+
* If all are null or 0, then assume all are null.
|
|
1491
|
+
*/
|
|
1492
|
+
processHeadings(posses) {
|
|
1493
|
+
let hasHeading = false;
|
|
1494
|
+
for (let i = 0; i < posses.length; i++) {
|
|
1495
|
+
let pos = posses[i];
|
|
1496
|
+
if (pos.heading !== null && pos.heading !== 0) {
|
|
1497
|
+
hasHeading = true;
|
|
1498
|
+
break;
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
if (!hasHeading) {
|
|
1502
|
+
for (let i = 0; i < posses.length; i++) {
|
|
1503
|
+
posses[i].heading = null;
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
return posses;
|
|
1507
|
+
}
|
|
1508
|
+
/**
|
|
1509
|
+
* Calculate the position at the given time
|
|
1510
|
+
*/
|
|
1511
|
+
calculatePosition(currentTimeMs) {
|
|
1512
|
+
const posses = this.positions;
|
|
1513
|
+
// See if we're before the first position
|
|
1514
|
+
if (currentTimeMs <= posses[0].dateTime.getTime()) {
|
|
1515
|
+
return {
|
|
1516
|
+
pos3d: posses[0].pos3d,
|
|
1517
|
+
indexLast: 0,
|
|
1518
|
+
indexNext: 0
|
|
1519
|
+
};
|
|
1520
|
+
}
|
|
1521
|
+
// See if we're after the last position
|
|
1522
|
+
if (currentTimeMs >= posses[posses.length - 1].dateTime.getTime()) {
|
|
1523
|
+
const lastIndex = posses.length - 1;
|
|
1524
|
+
return {
|
|
1525
|
+
pos3d: posses[lastIndex].pos3d,
|
|
1526
|
+
indexLast: lastIndex,
|
|
1527
|
+
indexNext: lastIndex
|
|
1528
|
+
};
|
|
1529
|
+
}
|
|
1530
|
+
// Find the current position
|
|
1531
|
+
let lastIndex = 0;
|
|
1532
|
+
for (let i = 1; i < posses.length; i++) {
|
|
1533
|
+
let pos = posses[i];
|
|
1534
|
+
if (currentTimeMs >= pos.dateTime.getTime()) {
|
|
1535
|
+
lastIndex = i;
|
|
1536
|
+
}
|
|
1537
|
+
else {
|
|
1538
|
+
break;
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
const last = posses[lastIndex];
|
|
1542
|
+
const next = posses[lastIndex + 1];
|
|
1543
|
+
// If no next position, use the last one
|
|
1544
|
+
if (!next) {
|
|
1545
|
+
return {
|
|
1546
|
+
pos3d: last.pos3d,
|
|
1547
|
+
indexLast: lastIndex,
|
|
1548
|
+
indexNext: lastIndex
|
|
1549
|
+
};
|
|
1550
|
+
}
|
|
1551
|
+
// Interpolate the position
|
|
1552
|
+
const progress = (currentTimeMs - last.dateTime.getTime()) /
|
|
1553
|
+
(next.dateTime.getTime() - last.dateTime.getTime());
|
|
1554
|
+
const interpolatedPos = Cartesian3.lerp(last.pos3d, next.pos3d, progress, new Cartesian3());
|
|
1555
|
+
return {
|
|
1556
|
+
pos3d: interpolatedPos,
|
|
1557
|
+
indexLast: lastIndex,
|
|
1558
|
+
indexNext: lastIndex + 1
|
|
1559
|
+
};
|
|
1560
|
+
}
|
|
1561
|
+
/**
|
|
1562
|
+
* Calculate the heading at the given time.
|
|
1563
|
+
*/
|
|
1564
|
+
calculateHeading(currentTimeMs, lastIndex, nextIndex) {
|
|
1565
|
+
const posses = this.positions;
|
|
1566
|
+
// Ensure valid indices.
|
|
1567
|
+
if (lastIndex < 0 || nextIndex < 0 ||
|
|
1568
|
+
lastIndex >= posses.length || nextIndex >= posses.length) {
|
|
1569
|
+
return null;
|
|
1570
|
+
}
|
|
1571
|
+
const lastPos = posses[lastIndex];
|
|
1572
|
+
const nextPos = posses[nextIndex];
|
|
1573
|
+
// If the heading is present and not null, interpolate or use it directly.
|
|
1574
|
+
if (lastPos.heading !== null && nextPos.heading !== null) {
|
|
1575
|
+
// If they're the same position or same time, just return the heading.
|
|
1576
|
+
if (lastIndex === nextIndex ||
|
|
1577
|
+
lastPos.dateTime.getTime() === nextPos.dateTime.getTime()) {
|
|
1578
|
+
return lastPos.heading;
|
|
1579
|
+
}
|
|
1580
|
+
let deltaHeading = nextPos.heading - lastPos.heading;
|
|
1581
|
+
// Handle wraparound between 359 and 0 degrees.
|
|
1582
|
+
if (deltaHeading > 180) {
|
|
1583
|
+
deltaHeading -= 360;
|
|
1584
|
+
}
|
|
1585
|
+
else if (deltaHeading < -180) {
|
|
1586
|
+
deltaHeading += 360;
|
|
1587
|
+
}
|
|
1588
|
+
const factor = (currentTimeMs - lastPos.dateTime.getTime()) /
|
|
1589
|
+
(nextPos.dateTime.getTime() - lastPos.dateTime.getTime());
|
|
1590
|
+
let interpolatedHeading = lastPos.heading + factor * deltaHeading;
|
|
1591
|
+
interpolatedHeading = (interpolatedHeading + 360) % 360;
|
|
1592
|
+
return interpolatedHeading;
|
|
1593
|
+
}
|
|
1594
|
+
// If no valid heading is available, calculate based on movement direction.
|
|
1595
|
+
else {
|
|
1596
|
+
const previousPos = lastPos.pos3d;
|
|
1597
|
+
const currentPos = nextPos.pos3d;
|
|
1598
|
+
if (!previousPos || isNaN(previousPos.x) ||
|
|
1599
|
+
!currentPos || isNaN(currentPos.x)) {
|
|
1600
|
+
return null;
|
|
1601
|
+
}
|
|
1602
|
+
// Flatten to avoid orientation changes due to height differences.
|
|
1603
|
+
const adjustedPointPrev = Cartographic.fromCartesian(previousPos);
|
|
1604
|
+
const adjustedPos3dPrev = Cartesian3.fromRadians(adjustedPointPrev.longitude, adjustedPointPrev.latitude, 0);
|
|
1605
|
+
const adjustedPointNext = Cartographic.fromCartesian(currentPos);
|
|
1606
|
+
const adjustedPos3dNext = Cartesian3.fromRadians(adjustedPointNext.longitude, adjustedPointNext.latitude, 0);
|
|
1607
|
+
// Check if the positions are too close.
|
|
1608
|
+
if (Cartesian3.distance(adjustedPos3dPrev, adjustedPos3dNext) < 0.05) {
|
|
1609
|
+
return null;
|
|
1610
|
+
}
|
|
1611
|
+
const direction = Cartesian3.subtract(adjustedPos3dNext, adjustedPos3dPrev, new Cartesian3());
|
|
1612
|
+
// No movement.
|
|
1613
|
+
if (direction.x === 0 && direction.y === 0 && direction.z === 0) {
|
|
1614
|
+
return null;
|
|
1615
|
+
}
|
|
1616
|
+
// Calculate heading from the direction vector.
|
|
1617
|
+
Cartesian3.normalize(direction, direction);
|
|
1618
|
+
// Convert the direction to a heading angle.
|
|
1619
|
+
const east = Cartesian3.UNIT_X;
|
|
1620
|
+
const north = Cartesian3.UNIT_Y;
|
|
1621
|
+
const heading = Math.atan2(Cartesian3.dot(direction, east), Cartesian3.dot(direction, north));
|
|
1622
|
+
// Convert to degrees.
|
|
1623
|
+
return (Math$1.toDegrees(heading) + 360) % 360;
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
CesiumAnimatedProperty.AnimateTPositionSeries = AnimateTPositionSeries;
|
|
1409
1628
|
})(CesiumAnimatedProperty || (CesiumAnimatedProperty = {}));
|
|
1410
1629
|
|
|
1411
1630
|
/**
|
|
@@ -16772,6 +16991,11 @@ var TilesetRenderEngine;
|
|
|
16772
16991
|
}
|
|
16773
16992
|
getTilesetFeatureNeedsFullData(entityId, entityTypeId) {
|
|
16774
16993
|
var _a;
|
|
16994
|
+
if (this.historic) {
|
|
16995
|
+
// Unfortunately when we are working with historic we have to request the entity.
|
|
16996
|
+
// This is because we need to know if a record exists at the point in time.
|
|
16997
|
+
return true;
|
|
16998
|
+
}
|
|
16775
16999
|
const style = this.getTilesetFeatureStyle(entityId, entityTypeId);
|
|
16776
17000
|
if (!style) {
|
|
16777
17001
|
return false;
|
|
@@ -16874,7 +17098,7 @@ var TilesetRenderEngine;
|
|
|
16874
17098
|
* CAD tilesets are referred to as "MODEL" tilesets in some other areas of Bruce code.
|
|
16875
17099
|
*/
|
|
16876
17100
|
var TilesetCadRenderManager;
|
|
16877
|
-
(function (TilesetCadRenderManager) {
|
|
17101
|
+
(function (TilesetCadRenderManager$$1) {
|
|
16878
17102
|
class Manager {
|
|
16879
17103
|
get Disposed() {
|
|
16880
17104
|
return this.disposed;
|
|
@@ -16901,6 +17125,12 @@ var TilesetCadRenderManager;
|
|
|
16901
17125
|
// We retain this information as a quick look-up on what has been registered.
|
|
16902
17126
|
// This lets us properly assign siblings to the same rego when hierarchy items are marked as collapsed.
|
|
16903
17127
|
this.loadedCesiumEntities = {};
|
|
17128
|
+
// Callback to dispose the link between scene time and the root's historic position.
|
|
17129
|
+
this.viewerDateTimeChangeRemoval = null;
|
|
17130
|
+
// Series of points to help interpolate movement when the timeline changes.
|
|
17131
|
+
this.historicPosses = [];
|
|
17132
|
+
this.historicPossesLoading = false;
|
|
17133
|
+
this.historicPossesLoadingProm = null;
|
|
16904
17134
|
const { viewer, register: visualsManager, getters, item } = params;
|
|
16905
17135
|
this.viewer = viewer;
|
|
16906
17136
|
this.getters = getters;
|
|
@@ -17042,6 +17272,8 @@ var TilesetCadRenderManager;
|
|
|
17042
17272
|
historic: (_c = this.item.BruceEntity) === null || _c === void 0 ? void 0 : _c.historic,
|
|
17043
17273
|
});
|
|
17044
17274
|
this.viewer.scene.requestRender();
|
|
17275
|
+
// Monitor scene time changes and update the root Entity.
|
|
17276
|
+
this.viewerDateTimeSub(tileset);
|
|
17045
17277
|
}
|
|
17046
17278
|
catch (e) {
|
|
17047
17279
|
console.error(e);
|
|
@@ -17331,6 +17563,7 @@ var TilesetCadRenderManager;
|
|
|
17331
17563
|
menuItemId: this.item.id,
|
|
17332
17564
|
doRemove: false
|
|
17333
17565
|
});
|
|
17566
|
+
this.viewerDateTimeDispose();
|
|
17334
17567
|
}
|
|
17335
17568
|
async ReRender(params) {
|
|
17336
17569
|
let { entityIds, force, entities } = params;
|
|
@@ -17350,8 +17583,141 @@ var TilesetCadRenderManager;
|
|
|
17350
17583
|
this.styler.SetEntityCache(entityIds, entities);
|
|
17351
17584
|
this.styler.QueueEntities(regos, true);
|
|
17352
17585
|
}
|
|
17586
|
+
/**
|
|
17587
|
+
* Monitors the Cesium Viewer and updates the root Entity based on the scene time changing.
|
|
17588
|
+
* If the root Entity is historic, this can allow for movement of the assembly as a whole.
|
|
17589
|
+
* @parma tileset
|
|
17590
|
+
*/
|
|
17591
|
+
viewerDateTimeSub(tileset) {
|
|
17592
|
+
var _a, _b;
|
|
17593
|
+
if (!((_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.historic) || this.viewerDateTimeChangeRemoval) {
|
|
17594
|
+
return;
|
|
17595
|
+
}
|
|
17596
|
+
let accountId = (_b = this.item.tileset) === null || _b === void 0 ? void 0 : _b.ClientAccountID;
|
|
17597
|
+
if (!accountId) {
|
|
17598
|
+
accountId = this.getters.GetAccountId();
|
|
17599
|
+
}
|
|
17600
|
+
const api = this.getters.GetBruceApi({
|
|
17601
|
+
accountId: accountId
|
|
17602
|
+
});
|
|
17603
|
+
// Returns a series of positions to use for position interpolation based on time.
|
|
17604
|
+
// If the timeline range is different to the previous query, we'll re-request the data.
|
|
17605
|
+
const getSeriesPosses = async () => {
|
|
17606
|
+
const minDateTime = this.viewer.clock.startTime.toString();
|
|
17607
|
+
const maxDateTime = this.viewer.clock.stopTime.toString();
|
|
17608
|
+
if (this.historicPossesMinDateTime == minDateTime &&
|
|
17609
|
+
this.historicPossesMaxDateTime == maxDateTime) {
|
|
17610
|
+
if (this.historicPossesLoading) {
|
|
17611
|
+
if (!await this.historicPossesLoadingProm) {
|
|
17612
|
+
return false;
|
|
17613
|
+
}
|
|
17614
|
+
}
|
|
17615
|
+
return this.historicPosses;
|
|
17616
|
+
}
|
|
17617
|
+
this.historicPossesMinDateTime = minDateTime;
|
|
17618
|
+
this.historicPossesMaxDateTime = maxDateTime;
|
|
17619
|
+
this.historicPossesLoading = true;
|
|
17620
|
+
this.historicPossesLoadingProm = new Promise(async (res) => {
|
|
17621
|
+
// We'll add/remove 1 second to ensure we cover all records.
|
|
17622
|
+
const startTmp = JulianDate.toDate(this.viewer.clock.startTime);
|
|
17623
|
+
const stopTmp = JulianDate.toDate(this.viewer.clock.stopTime);
|
|
17624
|
+
const startStr = new Date(startTmp.getTime() - 1000).toISOString();
|
|
17625
|
+
const stopStr = new Date(stopTmp.getTime() + 1000).toISOString();
|
|
17626
|
+
const historicData = await EntityHistoricData.GetList({
|
|
17627
|
+
attrKey: null,
|
|
17628
|
+
dateTimeFrom: startStr,
|
|
17629
|
+
dateTimeTo: stopStr,
|
|
17630
|
+
entityIds: [this.rootId],
|
|
17631
|
+
api: api
|
|
17632
|
+
});
|
|
17633
|
+
const posses = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(this.viewer, HeightReference.NONE, historicData.recordsByIds[this.rootId]);
|
|
17634
|
+
if (this.historicPossesMinDateTime == minDateTime &&
|
|
17635
|
+
this.historicPossesMaxDateTime == maxDateTime) {
|
|
17636
|
+
this.historicPosses = posses;
|
|
17637
|
+
this.historicPossesMinDateTime = minDateTime;
|
|
17638
|
+
this.historicPossesMaxDateTime = maxDateTime;
|
|
17639
|
+
this.historicPossesLoading = false;
|
|
17640
|
+
res(posses);
|
|
17641
|
+
}
|
|
17642
|
+
res(false);
|
|
17643
|
+
});
|
|
17644
|
+
return await this.historicPossesLoadingProm;
|
|
17645
|
+
};
|
|
17646
|
+
getSeriesPosses().then((posses) => {
|
|
17647
|
+
if (this.disposed || posses === false) {
|
|
17648
|
+
return;
|
|
17649
|
+
}
|
|
17650
|
+
let animation = new CesiumAnimatedProperty.AnimateTPositionSeries({
|
|
17651
|
+
viewer: this.viewer,
|
|
17652
|
+
posses: posses,
|
|
17653
|
+
onUpdate: (pos3d, heading) => {
|
|
17654
|
+
if (this.disposed) {
|
|
17655
|
+
return;
|
|
17656
|
+
}
|
|
17657
|
+
const location = Cartographic.fromCartesian(pos3d);
|
|
17658
|
+
const lat = Math$1.toDegrees(location.latitude);
|
|
17659
|
+
const lon = Math$1.toDegrees(location.longitude);
|
|
17660
|
+
const alt = location.height;
|
|
17661
|
+
const cTileset = this.cTileset;
|
|
17662
|
+
const prevCoords = cTileset._bruceCoords;
|
|
17663
|
+
const coords = {
|
|
17664
|
+
"Entity.ID": null,
|
|
17665
|
+
...prevCoords,
|
|
17666
|
+
transform: {
|
|
17667
|
+
...prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.transform,
|
|
17668
|
+
heading: heading
|
|
17669
|
+
},
|
|
17670
|
+
ucs: {
|
|
17671
|
+
name: null,
|
|
17672
|
+
transform: null,
|
|
17673
|
+
...prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.ucs,
|
|
17674
|
+
"Entity.ID": this.rootId,
|
|
17675
|
+
location: {
|
|
17676
|
+
altitude: alt,
|
|
17677
|
+
latitude: lat,
|
|
17678
|
+
longitude: lon
|
|
17679
|
+
}
|
|
17680
|
+
}
|
|
17681
|
+
};
|
|
17682
|
+
this.applyCoords(tileset, coords);
|
|
17683
|
+
}
|
|
17684
|
+
});
|
|
17685
|
+
this.viewerDateTimeChangeRemoval = () => {
|
|
17686
|
+
if (animation) {
|
|
17687
|
+
animation.stop();
|
|
17688
|
+
animation = null;
|
|
17689
|
+
}
|
|
17690
|
+
};
|
|
17691
|
+
});
|
|
17692
|
+
}
|
|
17693
|
+
viewerDateTimeDispose() {
|
|
17694
|
+
var _a;
|
|
17695
|
+
(_a = this.viewerDateTimeChangeRemoval) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
17696
|
+
this.viewerDateTimeChangeRemoval = null;
|
|
17697
|
+
}
|
|
17698
|
+
/**
|
|
17699
|
+
* Updates the Tileset with latest coordinates.
|
|
17700
|
+
* This is used to refresh with new values, not to render the first time!
|
|
17701
|
+
* @param tileset
|
|
17702
|
+
* @param coords
|
|
17703
|
+
*/
|
|
17704
|
+
applyCoords(tileset, coords) {
|
|
17705
|
+
if (this.disposed || !this.cTileset || this.cTileset.isDestroyed()) {
|
|
17706
|
+
return;
|
|
17707
|
+
}
|
|
17708
|
+
const settings = tileset.settings;
|
|
17709
|
+
TilesetRenderEngine.ApplyPosition({
|
|
17710
|
+
cTileset: this.Tileset,
|
|
17711
|
+
position: {
|
|
17712
|
+
ucs: coords === null || coords === void 0 ? void 0 : coords.ucs,
|
|
17713
|
+
location: (coords === null || coords === void 0 ? void 0 : coords.location) == null ? settings.location : coords.location,
|
|
17714
|
+
transform: (coords === null || coords === void 0 ? void 0 : coords.transform) == null ? settings.transform : coords.transform
|
|
17715
|
+
}
|
|
17716
|
+
});
|
|
17717
|
+
this.viewer.scene.requestRender();
|
|
17718
|
+
}
|
|
17353
17719
|
}
|
|
17354
|
-
TilesetCadRenderManager.Manager = Manager;
|
|
17720
|
+
TilesetCadRenderManager$$1.Manager = Manager;
|
|
17355
17721
|
})(TilesetCadRenderManager || (TilesetCadRenderManager = {}));
|
|
17356
17722
|
|
|
17357
17723
|
var DataLabRenderManager;
|
|
@@ -30105,7 +30471,7 @@ class WidgetViewBar extends Widget.AWidget {
|
|
|
30105
30471
|
}
|
|
30106
30472
|
}
|
|
30107
30473
|
|
|
30108
|
-
const VERSION = "5.3.
|
|
30474
|
+
const VERSION = "5.3.8";
|
|
30109
30475
|
|
|
30110
30476
|
export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, isHistoricMetadataChanged, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, DataLabRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Walkthrough, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar, WidgetControlViewBar, WidgetControlViewBarSearch, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks };
|
|
30111
30477
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|