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
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BruceEvent, Cartes, Carto, Entity as Entity$1, Geometry, MathUtils, LRUCache, ProjectViewTile, DelayQueue, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, Api, EntityRelationType, ENVIRONMENT, EntityHistoricData, Tileset, EntityCoords, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, Camera, ProjectViewLegacyTile, EntityAttribute, EntityAttachment, EntityAttachmentType, 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, DistanceDisplayCondition, NearFarScalar, Model, ColorMaterialProperty,
|
|
3
|
+
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, Primitive, Cesium3DTileFeature, DistanceDisplayCondition, NearFarScalar, Model, ColorMaterialProperty, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, PolylineDashMaterialProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorBlendMode, HeadingPitchRoll, Transforms, SceneMode, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, Cesium3DTileStyle, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, CesiumInspector, defined, ClockRange, Cesium3DTileset, Matrix4, Matrix3, IonResource, PolygonPipeline, EllipsoidGeodesic, sampleTerrainMostDetailed, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, BoundingSphere, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Quaternion, Intersect } from 'cesium';
|
|
4
4
|
|
|
5
5
|
/*! *****************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1275,8 +1275,12 @@ var CesiumAnimatedProperty;
|
|
|
1275
1275
|
*/
|
|
1276
1276
|
var AnimatePositionSeries = /** @class */ (function () {
|
|
1277
1277
|
function AnimatePositionSeries(params) {
|
|
1278
|
-
this.
|
|
1279
|
-
this.
|
|
1278
|
+
this.lastCalcPos3d = null;
|
|
1279
|
+
this.lastCalcPosIndexLast = -1;
|
|
1280
|
+
this.lastCalcPosIndexNext = -1;
|
|
1281
|
+
this.lastCalcTime = null;
|
|
1282
|
+
this.lastCalcSeriesPos3d = [];
|
|
1283
|
+
this.lastCalcSeriesTime = null;
|
|
1280
1284
|
this.viewer = params.viewer;
|
|
1281
1285
|
this.positions = params.posses;
|
|
1282
1286
|
// Order positions by date.
|
|
@@ -1291,16 +1295,20 @@ var CesiumAnimatedProperty;
|
|
|
1291
1295
|
now = this.viewer.clock.currentTime;
|
|
1292
1296
|
}
|
|
1293
1297
|
var nowTime = JulianDate.toDate(now);
|
|
1294
|
-
if (this.
|
|
1295
|
-
return this.
|
|
1298
|
+
if (this.lastCalcTime == nowTime.getTime()) {
|
|
1299
|
+
return this.lastCalcPos3d;
|
|
1296
1300
|
}
|
|
1297
1301
|
var calculate = function () {
|
|
1298
1302
|
// See if we're before the first position.
|
|
1299
1303
|
if (nowTime.getTime() <= _this.positions[0].dateTime.getTime()) {
|
|
1304
|
+
_this.lastCalcPosIndexLast = 0;
|
|
1305
|
+
_this.lastCalcPosIndexNext = 0;
|
|
1300
1306
|
return _this.positions[0].pos3d;
|
|
1301
1307
|
}
|
|
1302
1308
|
// See if we're after the last position.
|
|
1303
1309
|
if (nowTime.getTime() >= _this.positions[_this.positions.length - 1].dateTime.getTime()) {
|
|
1310
|
+
_this.lastCalcPosIndexLast = _this.positions.length - 1;
|
|
1311
|
+
_this.lastCalcPosIndexNext = _this.positions.length - 1;
|
|
1304
1312
|
return _this.positions[_this.positions.length - 1].pos3d;
|
|
1305
1313
|
}
|
|
1306
1314
|
// Find the current position.
|
|
@@ -1315,17 +1323,62 @@ var CesiumAnimatedProperty;
|
|
|
1315
1323
|
}
|
|
1316
1324
|
}
|
|
1317
1325
|
var last = _this.positions[lastIndex];
|
|
1326
|
+
_this.lastCalcPosIndexLast = lastIndex;
|
|
1318
1327
|
// Interpolate the position.
|
|
1319
1328
|
var next = _this.positions[lastIndex + 1];
|
|
1320
1329
|
if (!next) {
|
|
1330
|
+
_this.lastCalcPosIndexNext = lastIndex;
|
|
1321
1331
|
return last.pos3d;
|
|
1322
1332
|
}
|
|
1333
|
+
_this.lastCalcPosIndexNext = lastIndex + 1;
|
|
1323
1334
|
var progress = (nowTime.getTime() - last.dateTime.getTime()) / (next.dateTime.getTime() - last.dateTime.getTime());
|
|
1324
1335
|
return Cartesian3.lerp(last.pos3d, next.pos3d, progress, new Cartesian3());
|
|
1325
1336
|
};
|
|
1326
|
-
this.
|
|
1327
|
-
this.
|
|
1328
|
-
return this.
|
|
1337
|
+
this.lastCalcTime = nowTime.getTime();
|
|
1338
|
+
this.lastCalcPos3d = calculate();
|
|
1339
|
+
return this.lastCalcPos3d;
|
|
1340
|
+
};
|
|
1341
|
+
/**
|
|
1342
|
+
* Returns a series of positions to use for rendering the path.
|
|
1343
|
+
*/
|
|
1344
|
+
AnimatePositionSeries.prototype.GetSeries = function () {
|
|
1345
|
+
// We update 30 times a second.
|
|
1346
|
+
var doUpdate = this.lastCalcSeriesTime == null;
|
|
1347
|
+
if (!doUpdate && this.lastCalcSeriesTime && (new Date().getTime() - this.lastCalcSeriesTime) > 1000 / 30) {
|
|
1348
|
+
doUpdate = true;
|
|
1349
|
+
}
|
|
1350
|
+
if (!doUpdate) {
|
|
1351
|
+
return this.lastCalcSeriesPos3d;
|
|
1352
|
+
}
|
|
1353
|
+
// Refresh cached values.
|
|
1354
|
+
this.GetValue();
|
|
1355
|
+
var now = this.viewer.scene.lastRenderTime;
|
|
1356
|
+
if (!now) {
|
|
1357
|
+
now = this.viewer.clock.currentTime;
|
|
1358
|
+
}
|
|
1359
|
+
var nowDate = JulianDate.toDate(now);
|
|
1360
|
+
// Get total duration.
|
|
1361
|
+
var totalDuration = this.positions[this.positions.length - 1].dateTime.getTime() - this.positions[0].dateTime.getTime();
|
|
1362
|
+
// Percentage of the polyline to be visible before and after each point.
|
|
1363
|
+
var visibilityPercentage = 0.05; // 5%
|
|
1364
|
+
var visibilityDuration = totalDuration * visibilityPercentage;
|
|
1365
|
+
// Gather positions that fall within the visibility duration.
|
|
1366
|
+
// No positions is valid.
|
|
1367
|
+
var newPosses = [];
|
|
1368
|
+
for (var i = 0; i < this.positions.length; i++) {
|
|
1369
|
+
var pos = this.positions[i];
|
|
1370
|
+
var add = nowDate >= new Date(pos.dateTime.getTime() - visibilityDuration / 2) && nowDate <= new Date(pos.dateTime.getTime() + visibilityDuration / 2);
|
|
1371
|
+
// Not valid time-wise but if we're currently rendering this segment then we'll show it.
|
|
1372
|
+
if (!add && this.lastCalcPosIndexLast > -1 && this.lastCalcPosIndexNext > -1) {
|
|
1373
|
+
add = i >= this.lastCalcPosIndexLast && i <= this.lastCalcPosIndexNext;
|
|
1374
|
+
}
|
|
1375
|
+
if (add) {
|
|
1376
|
+
newPosses.push(pos.pos3d);
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
this.lastCalcSeriesTime = nowDate.getTime();
|
|
1380
|
+
this.lastCalcSeriesPos3d = newPosses;
|
|
1381
|
+
return newPosses;
|
|
1329
1382
|
};
|
|
1330
1383
|
return AnimatePositionSeries;
|
|
1331
1384
|
}());
|
|
@@ -1538,7 +1591,6 @@ function refreshColor(viewer, graphic, opacity) {
|
|
|
1538
1591
|
}
|
|
1539
1592
|
}
|
|
1540
1593
|
else if (graphic instanceof ModelGraphics) {
|
|
1541
|
-
// graphic.color = new Cesium.ConstantProperty(color);
|
|
1542
1594
|
var animateColor_1 = new CesiumAnimatedProperty.AnimateColor({
|
|
1543
1595
|
targetColor: color,
|
|
1544
1596
|
durationMs: animateMs,
|
|
@@ -1553,16 +1605,38 @@ function refreshColor(viewer, graphic, opacity) {
|
|
|
1553
1605
|
}
|
|
1554
1606
|
}
|
|
1555
1607
|
else if (graphic instanceof PolygonGraphics) {
|
|
1556
|
-
|
|
1608
|
+
// See if it's changed before applying.
|
|
1609
|
+
// Applying a new material to a polygon causes a flicker we want to avoid when possible.
|
|
1610
|
+
var currentColor = calculateCurColor(viewer, graphic);
|
|
1611
|
+
if (currentColor == null || !currentColor.equals(color)) {
|
|
1612
|
+
graphic.material = new ColorMaterialProperty(color);
|
|
1613
|
+
}
|
|
1557
1614
|
}
|
|
1558
1615
|
else if (graphic instanceof PolylineGraphics) {
|
|
1559
|
-
|
|
1616
|
+
// See if it's changed before applying.
|
|
1617
|
+
// Applying a new material to a polyline causes a flicker we want to avoid when possible.
|
|
1618
|
+
var currentColor = calculateCurColor(viewer, graphic);
|
|
1619
|
+
if (currentColor == null || !currentColor.equals(color)) {
|
|
1620
|
+
// If the current material is not a simple colour one then we'll mimic it with the new colour.
|
|
1621
|
+
// Eg: retain a stripe material.
|
|
1622
|
+
var currentMaterial = graphic.material;
|
|
1623
|
+
if (currentMaterial instanceof PolylineDashMaterialProperty) {
|
|
1624
|
+
graphic.material = new PolylineDashMaterialProperty({
|
|
1625
|
+
color: color,
|
|
1626
|
+
gapColor: currentMaterial.gapColor,
|
|
1627
|
+
dashLength: currentMaterial.dashLength,
|
|
1628
|
+
dashPattern: currentMaterial.dashPattern
|
|
1629
|
+
});
|
|
1630
|
+
}
|
|
1631
|
+
else {
|
|
1632
|
+
graphic.material = new ColorMaterialProperty(color);
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1560
1635
|
}
|
|
1561
1636
|
else if (graphic instanceof CorridorGraphics) {
|
|
1562
1637
|
graphic.material = new ColorMaterialProperty(color);
|
|
1563
1638
|
}
|
|
1564
1639
|
else if (graphic instanceof PointGraphics) {
|
|
1565
|
-
// graphic.color = new Cesium.ConstantProperty(color);
|
|
1566
1640
|
var animateColor_2 = new CesiumAnimatedProperty.AnimateColor({
|
|
1567
1641
|
targetColor: color,
|
|
1568
1642
|
durationMs: animateMs,
|
|
@@ -1592,7 +1666,12 @@ function refreshColor(viewer, graphic, opacity) {
|
|
|
1592
1666
|
}
|
|
1593
1667
|
}
|
|
1594
1668
|
else if (graphic instanceof EllipseGraphics) {
|
|
1595
|
-
|
|
1669
|
+
// See if it's changed before applying.
|
|
1670
|
+
// Applying a new material to a ellipse causes a flicker we want to avoid when possible.
|
|
1671
|
+
var currentColor = calculateCurColor(viewer, graphic);
|
|
1672
|
+
if (currentColor == null || !currentColor.equals(color)) {
|
|
1673
|
+
graphic.material = new ColorMaterialProperty(color);
|
|
1674
|
+
}
|
|
1596
1675
|
}
|
|
1597
1676
|
graphic[LAST_APPLIED_OPACITY_KEY] = opacity;
|
|
1598
1677
|
}
|
|
@@ -1650,7 +1729,8 @@ var CesiumEntityStyler;
|
|
|
1650
1729
|
return;
|
|
1651
1730
|
}
|
|
1652
1731
|
var parts = EntityUtils.GatherEntity({
|
|
1653
|
-
entity: entity
|
|
1732
|
+
entity: entity,
|
|
1733
|
+
selectable: true
|
|
1654
1734
|
});
|
|
1655
1735
|
for (var i = 0; i < parts.length; i++) {
|
|
1656
1736
|
var part = parts[i];
|
|
@@ -1718,7 +1798,8 @@ var CesiumEntityStyler;
|
|
|
1718
1798
|
colorMap = new Map();
|
|
1719
1799
|
}
|
|
1720
1800
|
var parts = EntityUtils.GatherEntity({
|
|
1721
|
-
entity: entity
|
|
1801
|
+
entity: entity,
|
|
1802
|
+
selectable: true
|
|
1722
1803
|
});
|
|
1723
1804
|
for (var i = 0; i < parts.length; i++) {
|
|
1724
1805
|
var part = parts[i];
|
|
@@ -1806,7 +1887,8 @@ var CesiumEntityStyler;
|
|
|
1806
1887
|
return;
|
|
1807
1888
|
}
|
|
1808
1889
|
var parts = EntityUtils.GatherEntity({
|
|
1809
|
-
entity: entity
|
|
1890
|
+
entity: entity,
|
|
1891
|
+
selectable: true
|
|
1810
1892
|
});
|
|
1811
1893
|
for (var i = 0; i < parts.length; i++) {
|
|
1812
1894
|
var part = parts[i];
|
|
@@ -1873,7 +1955,8 @@ var CesiumEntityStyler;
|
|
|
1873
1955
|
return;
|
|
1874
1956
|
}
|
|
1875
1957
|
var parts = EntityUtils.GatherEntity({
|
|
1876
|
-
entity: entity
|
|
1958
|
+
entity: entity,
|
|
1959
|
+
selectable: true
|
|
1877
1960
|
});
|
|
1878
1961
|
for (var i = 0; i < parts.length; i++) {
|
|
1879
1962
|
var part = parts[i];
|
|
@@ -1923,7 +2006,8 @@ var CesiumEntityStyler;
|
|
|
1923
2006
|
return null;
|
|
1924
2007
|
}
|
|
1925
2008
|
var parts = EntityUtils.GatherEntity({
|
|
1926
|
-
entity: entity
|
|
2009
|
+
entity: entity,
|
|
2010
|
+
selectable: true
|
|
1927
2011
|
});
|
|
1928
2012
|
for (var i = 0; i < parts.length; i++) {
|
|
1929
2013
|
var part = parts[i];
|
|
@@ -1981,7 +2065,8 @@ var CesiumEntityStyler;
|
|
|
1981
2065
|
return;
|
|
1982
2066
|
}
|
|
1983
2067
|
var parts = EntityUtils.GatherEntity({
|
|
1984
|
-
entity: entity
|
|
2068
|
+
entity: entity,
|
|
2069
|
+
selectable: true
|
|
1985
2070
|
});
|
|
1986
2071
|
for (var i = 0; i < parts.length; i++) {
|
|
1987
2072
|
var part = parts[i];
|
|
@@ -2040,7 +2125,8 @@ var CesiumEntityStyler;
|
|
|
2040
2125
|
return;
|
|
2041
2126
|
}
|
|
2042
2127
|
var parts = EntityUtils.GatherEntity({
|
|
2043
|
-
entity: entity
|
|
2128
|
+
entity: entity,
|
|
2129
|
+
selectable: true
|
|
2044
2130
|
});
|
|
2045
2131
|
for (var i = 0; i < parts.length; i++) {
|
|
2046
2132
|
var part = parts[i];
|
|
@@ -2099,7 +2185,8 @@ var CesiumEntityStyler;
|
|
|
2099
2185
|
return;
|
|
2100
2186
|
}
|
|
2101
2187
|
var parts = EntityUtils.GatherEntity({
|
|
2102
|
-
entity: entity
|
|
2188
|
+
entity: entity,
|
|
2189
|
+
selectable: true
|
|
2103
2190
|
});
|
|
2104
2191
|
for (var i = 0; i < parts.length; i++) {
|
|
2105
2192
|
var part = parts[i];
|
|
@@ -2156,7 +2243,8 @@ var CesiumEntityStyler;
|
|
|
2156
2243
|
return;
|
|
2157
2244
|
}
|
|
2158
2245
|
var parts = EntityUtils.GatherEntity({
|
|
2159
|
-
entity: entity
|
|
2246
|
+
entity: entity,
|
|
2247
|
+
selectable: true
|
|
2160
2248
|
});
|
|
2161
2249
|
for (var i = 0; i < parts.length; i++) {
|
|
2162
2250
|
var part = parts[i];
|
|
@@ -2205,17 +2293,19 @@ var CesiumEntityStyler;
|
|
|
2205
2293
|
CesiumEntityStyler.Unhighlight = Unhighlight;
|
|
2206
2294
|
})(CesiumEntityStyler || (CesiumEntityStyler = {}));
|
|
2207
2295
|
|
|
2208
|
-
function traverseEntity(cEntity, arr, ignoreParent) {
|
|
2296
|
+
function traverseEntity(cEntity, arr, ignoreParent, onlyEditable, onlySelectable) {
|
|
2209
2297
|
if (cEntity._parentEntity && !ignoreParent) {
|
|
2210
|
-
traverseEntity(cEntity._parentEntity, arr, false);
|
|
2298
|
+
traverseEntity(cEntity._parentEntity, arr, false, onlyEditable, onlySelectable);
|
|
2211
2299
|
}
|
|
2212
2300
|
if (cEntity._siblingGraphics) {
|
|
2213
2301
|
for (var i = 0; i < cEntity._siblingGraphics.length; i++) {
|
|
2214
2302
|
var sibling = cEntity._siblingGraphics[i];
|
|
2215
|
-
traverseEntity(sibling, arr, true);
|
|
2303
|
+
traverseEntity(sibling, arr, true, onlyEditable, onlySelectable);
|
|
2216
2304
|
}
|
|
2217
2305
|
}
|
|
2218
|
-
|
|
2306
|
+
if ((!cEntity._noEdit || !onlyEditable) && (!cEntity._noSelect || !onlySelectable)) {
|
|
2307
|
+
arr.push(cEntity);
|
|
2308
|
+
}
|
|
2219
2309
|
}
|
|
2220
2310
|
function GetValue(viewer, obj) {
|
|
2221
2311
|
if (obj === null || obj === void 0 ? void 0 : obj.getValue) {
|
|
@@ -3098,11 +3188,17 @@ var EntityUtils;
|
|
|
3098
3188
|
* @param entity
|
|
3099
3189
|
*/
|
|
3100
3190
|
function GatherEntity(params) {
|
|
3101
|
-
var entity = params.entity;
|
|
3191
|
+
var entity = params.entity, editable = params.editable, selectable = params.selectable;
|
|
3192
|
+
if (editable == null) {
|
|
3193
|
+
editable = false;
|
|
3194
|
+
}
|
|
3195
|
+
if (selectable == null) {
|
|
3196
|
+
selectable = false;
|
|
3197
|
+
}
|
|
3102
3198
|
if (entity instanceof Entity) {
|
|
3103
3199
|
var cEntity = entity;
|
|
3104
3200
|
var items = [];
|
|
3105
|
-
traverseEntity(cEntity, items, false);
|
|
3201
|
+
traverseEntity(cEntity, items, false, editable, selectable);
|
|
3106
3202
|
return items;
|
|
3107
3203
|
}
|
|
3108
3204
|
return [entity];
|
|
@@ -5335,6 +5431,10 @@ function getSeriesPossesForHistoricEntity(viewer, heightRef, historic) {
|
|
|
5335
5431
|
var series = [];
|
|
5336
5432
|
for (var i = 0; i < historic.length; i++) {
|
|
5337
5433
|
var item = historic[i];
|
|
5434
|
+
var dateTime = new Date(item.dateTime);
|
|
5435
|
+
if (!dateTime) {
|
|
5436
|
+
continue;
|
|
5437
|
+
}
|
|
5338
5438
|
var pos3d = EntityUtils.GetPos({
|
|
5339
5439
|
entity: item.data,
|
|
5340
5440
|
viewer: viewer,
|
|
@@ -5342,8 +5442,7 @@ function getSeriesPossesForHistoricEntity(viewer, heightRef, historic) {
|
|
|
5342
5442
|
returnHeightRef: heightRef,
|
|
5343
5443
|
allowRendered: false
|
|
5344
5444
|
});
|
|
5345
|
-
|
|
5346
|
-
if (!dateTime || !pos3d || isNaN(pos3d.x) || isNaN(pos3d.y) || isNaN(pos3d.z)) {
|
|
5445
|
+
if (!pos3d || isNaN(pos3d.x) || isNaN(pos3d.y) || isNaN(pos3d.z)) {
|
|
5347
5446
|
continue;
|
|
5348
5447
|
}
|
|
5349
5448
|
series.push({
|
|
@@ -5586,7 +5685,7 @@ var EntityRenderEngine;
|
|
|
5586
5685
|
}
|
|
5587
5686
|
}
|
|
5588
5687
|
if (!(models.length > 0)) return [3 /*break*/, 2];
|
|
5589
|
-
mParams = __assign(__assign({}, groupRenderParams), { rendered: cEntities, entities: models, entitiesHistoric: params.entitiesHistoric });
|
|
5688
|
+
mParams = __assign(__assign({}, groupRenderParams), { rendered: cEntities, entities: models, entitiesHistoric: params.entitiesHistoric, entityHistoricDrawTrack: params.entityHistoricDrawTrack });
|
|
5590
5689
|
return [4 /*yield*/, Model3d.RenderGroup(mParams)];
|
|
5591
5690
|
case 1:
|
|
5592
5691
|
mEntities = _g.sent();
|
|
@@ -5722,7 +5821,7 @@ var EntityRenderEngine;
|
|
|
5722
5821
|
_g.label = 10;
|
|
5723
5822
|
case 10:
|
|
5724
5823
|
if (!(points.length > 0)) return [3 /*break*/, 12];
|
|
5725
|
-
pParams = __assign(__assign({}, groupRenderParams), { entities: points, rendered: cEntities, entitiesHistoric: params.entitiesHistoric });
|
|
5824
|
+
pParams = __assign(__assign({}, groupRenderParams), { entities: points, rendered: cEntities, entitiesHistoric: params.entitiesHistoric, entityHistoricDrawTrack: params.entityHistoricDrawTrack });
|
|
5726
5825
|
return [4 /*yield*/, Point.RenderGroup(pParams)];
|
|
5727
5826
|
case 11:
|
|
5728
5827
|
pEntities = _g.sent();
|
|
@@ -5791,7 +5890,7 @@ var EntityRenderEngine;
|
|
|
5791
5890
|
function Render(params) {
|
|
5792
5891
|
var _a, _b, _c, _d;
|
|
5793
5892
|
return __awaiter(this, void 0, void 0, function () {
|
|
5794
|
-
var entity, style, type, cEntity, siblings, prepareExistingGraphic, iconUrlRows, icon, iconUrl, metadata, api, image, e_5, iconScale, disableDepthTest, bColor, cColor,
|
|
5893
|
+
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;
|
|
5795
5894
|
return __generator(this, function (_e) {
|
|
5796
5895
|
switch (_e.label) {
|
|
5797
5896
|
case 0:
|
|
@@ -5809,15 +5908,18 @@ var EntityRenderEngine;
|
|
|
5809
5908
|
}
|
|
5810
5909
|
cEntity = null;
|
|
5811
5910
|
siblings = [];
|
|
5812
|
-
|
|
5813
|
-
|
|
5911
|
+
heightRef = null;
|
|
5912
|
+
animatePosition = null;
|
|
5913
|
+
shouldShowTrack = false;
|
|
5914
|
+
prepareExistingGraphic = function (cEntity, maxSiblings) {
|
|
5915
|
+
if (maxSiblings === void 0) { maxSiblings = 0; }
|
|
5814
5916
|
// Gather entity in case previous version had sibling graphics we no longer need.
|
|
5815
5917
|
var parts = EntityUtils.GatherEntity({
|
|
5816
5918
|
entity: cEntity,
|
|
5817
5919
|
});
|
|
5818
5920
|
if (parts.length > 1) {
|
|
5819
5921
|
// We'll cull all except the allowed number of siblings.
|
|
5820
|
-
cEntity._siblingGraphics = cEntity._siblingGraphics.slice(0,
|
|
5922
|
+
cEntity._siblingGraphics = cEntity._siblingGraphics.slice(0, maxSiblings);
|
|
5821
5923
|
// We'll remove all that aren't in the allowed (direct) list.
|
|
5822
5924
|
for (var i = 0; i < parts.length - 1; i++) {
|
|
5823
5925
|
var part = parts[i];
|
|
@@ -5829,6 +5931,33 @@ var EntityRenderEngine;
|
|
|
5829
5931
|
console.warn("Point.Render: Parent entity was not null. This should not happen.");
|
|
5830
5932
|
}
|
|
5831
5933
|
}
|
|
5934
|
+
siblings = cEntity._siblingGraphics;
|
|
5935
|
+
cEntity._siblingGraphics = [];
|
|
5936
|
+
};
|
|
5937
|
+
updateShouldShowTrack = function () {
|
|
5938
|
+
var _a, _b, _c;
|
|
5939
|
+
if (!params.entityHistoricDrawTrack) {
|
|
5940
|
+
return;
|
|
5941
|
+
}
|
|
5942
|
+
if ((_a = params.entityHistoric) === null || _a === void 0 ? void 0 : _a.length) {
|
|
5943
|
+
var lStyle = (_c = (_b = params.fullStyle) === null || _b === void 0 ? void 0 : _b.polylineStyle) !== null && _c !== void 0 ? _c : {};
|
|
5944
|
+
var width = lStyle.width ? EnsureNumber(Calculator.GetNumber(lStyle.width, entity, params.tags)) : 2;
|
|
5945
|
+
if (width == null) {
|
|
5946
|
+
width = 2;
|
|
5947
|
+
}
|
|
5948
|
+
width = EnsureNumber(width);
|
|
5949
|
+
if (width > 0.01) {
|
|
5950
|
+
var bColor = lStyle.lineColor ? Calculator.GetColor(lStyle.lineColor, entity, params.tags) : null;
|
|
5951
|
+
var cColor = bColor ? colorToCColor(bColor) : Color.fromCssColorString("rgba(255, 193, 7, 0.8)");
|
|
5952
|
+
if (cColor.alpha > 0) {
|
|
5953
|
+
var seriesTrackPosses = getSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
|
|
5954
|
+
seriesTrackPosses.reverse();
|
|
5955
|
+
var posses = seriesTrackPosses.map(function (x) { return x.pos3d; });
|
|
5956
|
+
posses = cullDuplicatePoints(posses);
|
|
5957
|
+
shouldShowTrack = posses.length > 1;
|
|
5958
|
+
}
|
|
5959
|
+
}
|
|
5960
|
+
}
|
|
5832
5961
|
};
|
|
5833
5962
|
if (!(type == Style.EPointType.Icon)) return [3 /*break*/, 9];
|
|
5834
5963
|
iconUrlRows = style.iconUrl == null ? [] : style.iconUrl;
|
|
@@ -5893,9 +6022,10 @@ var EntityRenderEngine;
|
|
|
5893
6022
|
}
|
|
5894
6023
|
disableDepthTest = Boolean(style.renderOnTop);
|
|
5895
6024
|
if (iconScale > 0) {
|
|
6025
|
+
updateShouldShowTrack();
|
|
5896
6026
|
bColor = style.iconTintColor ? Calculator.GetColor(style.iconTintColor, entity, params.tags) : null;
|
|
5897
6027
|
cColor = bColor ? colorToCColor(bColor) : Color.WHITE.clone();
|
|
5898
|
-
|
|
6028
|
+
heightRef = getHeightRef(style);
|
|
5899
6029
|
if (!params.rendered || !params.rendered.billboard) {
|
|
5900
6030
|
animateColorIn_1 = new CesiumAnimatedProperty.AnimateColor({
|
|
5901
6031
|
durationMs: 200,
|
|
@@ -5904,20 +6034,20 @@ var EntityRenderEngine;
|
|
|
5904
6034
|
viewer: params.viewer
|
|
5905
6035
|
});
|
|
5906
6036
|
position = null;
|
|
5907
|
-
series = getSeriesPossesForHistoricEntity(params.viewer,
|
|
6037
|
+
series = getSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
|
|
5908
6038
|
if (series.length > 1) {
|
|
5909
|
-
|
|
6039
|
+
animatePosition = new CesiumAnimatedProperty.AnimatePositionSeries({
|
|
5910
6040
|
posses: series,
|
|
5911
6041
|
viewer: params.viewer
|
|
5912
6042
|
});
|
|
5913
|
-
position = new CallbackProperty(function () { return
|
|
6043
|
+
position = new CallbackProperty(function () { return animatePosition.GetValue(); }, false);
|
|
5914
6044
|
}
|
|
5915
6045
|
else {
|
|
5916
6046
|
position = new CallbackProperty(function () { return EntityUtils.GetPos({
|
|
5917
6047
|
viewer: params.viewer,
|
|
5918
6048
|
entity: entity,
|
|
5919
|
-
recordHeightRef:
|
|
5920
|
-
returnHeightRef:
|
|
6049
|
+
recordHeightRef: heightRef,
|
|
6050
|
+
returnHeightRef: heightRef,
|
|
5921
6051
|
allowRendered: false
|
|
5922
6052
|
}); }, true);
|
|
5923
6053
|
}
|
|
@@ -5954,7 +6084,7 @@ var EntityRenderEngine;
|
|
|
5954
6084
|
});
|
|
5955
6085
|
}
|
|
5956
6086
|
else {
|
|
5957
|
-
prepareExistingGraphic(params.rendered);
|
|
6087
|
+
prepareExistingGraphic(params.rendered, shouldShowTrack ? 1 : 0);
|
|
5958
6088
|
cEntity = params.rendered;
|
|
5959
6089
|
currentImgKey = cEntity.billboard._billboardImgKey;
|
|
5960
6090
|
if (currentImgKey != iconUrl) {
|
|
@@ -5964,31 +6094,31 @@ var EntityRenderEngine;
|
|
|
5964
6094
|
cEntity.billboard.heightReference = new ConstantProperty(getHeightRef(style));
|
|
5965
6095
|
cEntity.billboard.disableDepthTestDistance = new ConstantProperty(disableDepthTest ? Number.POSITIVE_INFINITY : undefined);
|
|
5966
6096
|
cEntity.billboard.distanceDisplayCondition = new ConstantProperty(getDisplayCondition(params.minDistance, params.maxDistance));
|
|
5967
|
-
series = getSeriesPossesForHistoricEntity(params.viewer,
|
|
6097
|
+
series = getSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
|
|
5968
6098
|
if (series.length > 1) {
|
|
5969
|
-
|
|
6099
|
+
animatePosition = new CesiumAnimatedProperty.AnimatePositionSeries({
|
|
5970
6100
|
posses: series,
|
|
5971
6101
|
viewer: params.viewer
|
|
5972
6102
|
});
|
|
5973
|
-
cEntity.position = new CallbackProperty(function () { return
|
|
6103
|
+
cEntity.position = new CallbackProperty(function () { return animatePosition.GetValue(); }, false);
|
|
5974
6104
|
}
|
|
5975
6105
|
else {
|
|
5976
6106
|
pos3d = EntityUtils.GetPos({
|
|
5977
6107
|
viewer: params.viewer,
|
|
5978
6108
|
entity: entity,
|
|
5979
|
-
recordHeightRef:
|
|
5980
|
-
returnHeightRef:
|
|
6109
|
+
recordHeightRef: heightRef,
|
|
6110
|
+
returnHeightRef: heightRef,
|
|
5981
6111
|
allowRendered: false
|
|
5982
6112
|
});
|
|
5983
6113
|
prevPos3d = getValue$1(params.viewer, cEntity.position);
|
|
5984
6114
|
if (!prevPos3d || !Cartesian3.equals(prevPos3d, pos3d)) {
|
|
5985
|
-
|
|
6115
|
+
animatePosition = new CesiumAnimatedProperty.AnimatePosition({
|
|
5986
6116
|
durationMs: 200,
|
|
5987
6117
|
targetPos3d: pos3d,
|
|
5988
6118
|
viewer: params.viewer,
|
|
5989
6119
|
startPos3d: prevPos3d
|
|
5990
6120
|
});
|
|
5991
|
-
cEntity.position = new CallbackProperty(function () { return
|
|
6121
|
+
cEntity.position = new CallbackProperty(function () { return animatePosition.GetValue(); }, false);
|
|
5992
6122
|
}
|
|
5993
6123
|
}
|
|
5994
6124
|
// We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
|
|
@@ -6082,7 +6212,7 @@ var EntityRenderEngine;
|
|
|
6082
6212
|
if (!outlineExtrusion.value && extrusion.value) {
|
|
6083
6213
|
outlineExtrusion.exHeightRef = extrusion.exHeightRef;
|
|
6084
6214
|
}
|
|
6085
|
-
outlineEntity =
|
|
6215
|
+
outlineEntity = siblings === null || siblings === void 0 ? void 0 : siblings[0];
|
|
6086
6216
|
if (outlineEntity && outlineEntity.ellipse) {
|
|
6087
6217
|
outlineEntity.ellipse.semiMajorAxis = new ConstantProperty(radius + outlineWidth);
|
|
6088
6218
|
outlineEntity.ellipse.semiMinorAxis = new ConstantProperty(radius + outlineWidth);
|
|
@@ -6135,9 +6265,10 @@ var EntityRenderEngine;
|
|
|
6135
6265
|
if (size <= 0) {
|
|
6136
6266
|
return [2 /*return*/, null];
|
|
6137
6267
|
}
|
|
6138
|
-
|
|
6268
|
+
heightRef = getHeightRef(style);
|
|
6139
6269
|
circleBillboard = createCircleBillboard(size, cColor.toCssColorString());
|
|
6140
6270
|
disableDepthTest = Boolean(style.renderOnTop);
|
|
6271
|
+
updateShouldShowTrack();
|
|
6141
6272
|
if (!params.rendered || !params.rendered.billboard) {
|
|
6142
6273
|
animateColorIn_2 = new CesiumAnimatedProperty.AnimateColor({
|
|
6143
6274
|
durationMs: 200,
|
|
@@ -6146,20 +6277,20 @@ var EntityRenderEngine;
|
|
|
6146
6277
|
viewer: params.viewer
|
|
6147
6278
|
});
|
|
6148
6279
|
position = null;
|
|
6149
|
-
series = getSeriesPossesForHistoricEntity(params.viewer,
|
|
6280
|
+
series = getSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
|
|
6150
6281
|
if (series.length > 1) {
|
|
6151
|
-
|
|
6282
|
+
animatePosition = new CesiumAnimatedProperty.AnimatePositionSeries({
|
|
6152
6283
|
posses: series,
|
|
6153
6284
|
viewer: params.viewer
|
|
6154
6285
|
});
|
|
6155
|
-
position = new CallbackProperty(function () { return
|
|
6286
|
+
position = new CallbackProperty(function () { return animatePosition.GetValue(); }, false);
|
|
6156
6287
|
}
|
|
6157
6288
|
else {
|
|
6158
6289
|
position = new CallbackProperty(function () { return EntityUtils.GetPos({
|
|
6159
6290
|
viewer: params.viewer,
|
|
6160
6291
|
entity: entity,
|
|
6161
|
-
recordHeightRef:
|
|
6162
|
-
returnHeightRef:
|
|
6292
|
+
recordHeightRef: heightRef,
|
|
6293
|
+
returnHeightRef: heightRef,
|
|
6163
6294
|
allowRendered: false
|
|
6164
6295
|
}); }, true);
|
|
6165
6296
|
}
|
|
@@ -6185,7 +6316,7 @@ var EntityRenderEngine;
|
|
|
6185
6316
|
}
|
|
6186
6317
|
return color;
|
|
6187
6318
|
}, false),
|
|
6188
|
-
heightReference:
|
|
6319
|
+
heightReference: heightRef,
|
|
6189
6320
|
distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance),
|
|
6190
6321
|
disableDepthTestDistance: disableDepthTest ? Number.POSITIVE_INFINITY : undefined
|
|
6191
6322
|
},
|
|
@@ -6202,7 +6333,7 @@ var EntityRenderEngine;
|
|
|
6202
6333
|
});
|
|
6203
6334
|
}
|
|
6204
6335
|
else {
|
|
6205
|
-
prepareExistingGraphic(params.rendered);
|
|
6336
|
+
prepareExistingGraphic(params.rendered, shouldShowTrack ? 1 : 0);
|
|
6206
6337
|
cEntity = params.rendered;
|
|
6207
6338
|
imgKey = "".concat(size, "-").concat(cColor.toCssColorString());
|
|
6208
6339
|
currentImgKey = cEntity.billboard._billboardImgKey;
|
|
@@ -6211,34 +6342,34 @@ var EntityRenderEngine;
|
|
|
6211
6342
|
}
|
|
6212
6343
|
cEntity.billboard.height = new ConstantProperty(circleBillboard.height);
|
|
6213
6344
|
cEntity.billboard.width = new ConstantProperty(circleBillboard.width);
|
|
6214
|
-
cEntity.billboard.heightReference = new ConstantProperty(
|
|
6345
|
+
cEntity.billboard.heightReference = new ConstantProperty(heightRef);
|
|
6215
6346
|
cEntity.billboard.distanceDisplayCondition = new ConstantProperty(getDisplayCondition(params.minDistance, params.maxDistance));
|
|
6216
6347
|
cEntity.billboard.disableDepthTestDistance = new ConstantProperty(disableDepthTest ? Number.POSITIVE_INFINITY : undefined);
|
|
6217
|
-
series = getSeriesPossesForHistoricEntity(params.viewer,
|
|
6348
|
+
series = getSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
|
|
6218
6349
|
if (series.length > 1) {
|
|
6219
|
-
|
|
6350
|
+
animatePosition_1 = new CesiumAnimatedProperty.AnimatePositionSeries({
|
|
6220
6351
|
posses: series,
|
|
6221
6352
|
viewer: params.viewer
|
|
6222
6353
|
});
|
|
6223
|
-
cEntity.position = new CallbackProperty(function () { return
|
|
6354
|
+
cEntity.position = new CallbackProperty(function () { return animatePosition_1.GetValue(); }, false);
|
|
6224
6355
|
}
|
|
6225
6356
|
else {
|
|
6226
6357
|
pos3d = EntityUtils.GetPos({
|
|
6227
6358
|
viewer: params.viewer,
|
|
6228
6359
|
entity: entity,
|
|
6229
|
-
recordHeightRef:
|
|
6230
|
-
returnHeightRef:
|
|
6360
|
+
recordHeightRef: heightRef,
|
|
6361
|
+
returnHeightRef: heightRef,
|
|
6231
6362
|
allowRendered: false
|
|
6232
6363
|
});
|
|
6233
6364
|
prevPos3d = getValue$1(params.viewer, cEntity.position);
|
|
6234
6365
|
if (!prevPos3d || !Cartesian3.equals(prevPos3d, pos3d)) {
|
|
6235
|
-
|
|
6366
|
+
animatePosition_2 = new CesiumAnimatedProperty.AnimatePosition({
|
|
6236
6367
|
durationMs: 200,
|
|
6237
6368
|
targetPos3d: pos3d,
|
|
6238
6369
|
viewer: params.viewer,
|
|
6239
6370
|
startPos3d: prevPos3d
|
|
6240
6371
|
});
|
|
6241
|
-
cEntity.position = new CallbackProperty(function () { return
|
|
6372
|
+
cEntity.position = new CallbackProperty(function () { return animatePosition_2.GetValue(); }, false);
|
|
6242
6373
|
}
|
|
6243
6374
|
}
|
|
6244
6375
|
// We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
|
|
@@ -6254,9 +6385,50 @@ var EntityRenderEngine;
|
|
|
6254
6385
|
}
|
|
6255
6386
|
cEntity.billboard._billboardSize = Math.ceil(circleBillboard.height / 2);
|
|
6256
6387
|
}
|
|
6257
|
-
|
|
6258
|
-
|
|
6388
|
+
// Generate a polyline 'track' for the historic data.
|
|
6389
|
+
// We do this for historic data that exists and is moving.
|
|
6390
|
+
if (shouldShowTrack && animatePosition && animatePosition instanceof CesiumAnimatedProperty.AnimatePositionSeries && animatePosition.GetSeries) {
|
|
6391
|
+
lStyle = (_d = (_c = params.fullStyle) === null || _c === void 0 ? void 0 : _c.polylineStyle) !== null && _d !== void 0 ? _d : {};
|
|
6392
|
+
bColor = lStyle.lineColor ? Calculator.GetColor(lStyle.lineColor, entity, params.tags) : null;
|
|
6393
|
+
cColor = bColor ? colorToCColor(bColor) : Color.fromCssColorString("rgba(255, 193, 7, 0.8)");
|
|
6394
|
+
material = new PolylineDashMaterialProperty({
|
|
6395
|
+
color: cColor
|
|
6396
|
+
});
|
|
6397
|
+
width = lStyle.lineWidth ? EnsureNumber(Calculator.GetNumber(lStyle.lineWidth, entity, params.tags)) : 2;
|
|
6398
|
+
if (width == null) {
|
|
6399
|
+
width = 2;
|
|
6400
|
+
}
|
|
6401
|
+
width = EnsureNumber(width);
|
|
6402
|
+
trackEntity = siblings === null || siblings === void 0 ? void 0 : siblings[0];
|
|
6403
|
+
if (!trackEntity) {
|
|
6404
|
+
trackEntity = new Entity({
|
|
6405
|
+
id: ObjectUtils.UId(10),
|
|
6406
|
+
polyline: {
|
|
6407
|
+
positions: [],
|
|
6408
|
+
width: width,
|
|
6409
|
+
material: material,
|
|
6410
|
+
clampToGround: heightRef == HeightReference.CLAMP_TO_GROUND,
|
|
6411
|
+
zIndex: 0,
|
|
6412
|
+
classificationType: ClassificationType.BOTH
|
|
6413
|
+
}
|
|
6414
|
+
});
|
|
6415
|
+
}
|
|
6416
|
+
trackEntity._noEdit = true;
|
|
6417
|
+
trackEntity.polyline.positions = new CallbackProperty(function () {
|
|
6418
|
+
return animatePosition.GetSeries();
|
|
6419
|
+
}, false);
|
|
6420
|
+
// We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
|
|
6421
|
+
// WARNING: polyline does not support animation (yet?).
|
|
6422
|
+
CesiumEntityStyler.SetDefaultColor({
|
|
6423
|
+
color: cColor,
|
|
6424
|
+
entity: trackEntity,
|
|
6425
|
+
viewer: params.viewer,
|
|
6426
|
+
override: true,
|
|
6427
|
+
requestRender: false
|
|
6428
|
+
});
|
|
6429
|
+
siblings.push(trackEntity);
|
|
6259
6430
|
}
|
|
6431
|
+
cEntity._siblingGraphics = siblings;
|
|
6260
6432
|
return [2 /*return*/, cEntity];
|
|
6261
6433
|
}
|
|
6262
6434
|
});
|
|
@@ -6310,7 +6482,9 @@ var EntityRenderEngine;
|
|
|
6310
6482
|
maxDistance: zoomItem.MaxZoom,
|
|
6311
6483
|
minDistance: zoomItem.MinZoom,
|
|
6312
6484
|
rendered: (_c = params.rendered) === null || _c === void 0 ? void 0 : _c.get(entity.Bruce.ID),
|
|
6313
|
-
entityHistoric: (_d = params.entitiesHistoric) === null || _d === void 0 ? void 0 : _d[entity.Bruce.ID]
|
|
6485
|
+
entityHistoric: (_d = params.entitiesHistoric) === null || _d === void 0 ? void 0 : _d[entity.Bruce.ID],
|
|
6486
|
+
entityHistoricDrawTrack: params.entityHistoricDrawTrack,
|
|
6487
|
+
fullStyle: style
|
|
6314
6488
|
})];
|
|
6315
6489
|
case 7:
|
|
6316
6490
|
cEntity = _f.sent();
|
|
@@ -7044,11 +7218,11 @@ var EntityRenderEngine;
|
|
|
7044
7218
|
// If we have a series of time-based positions then we'll animate as time changes.
|
|
7045
7219
|
var series = getSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
|
|
7046
7220
|
if (series.length > 1) {
|
|
7047
|
-
var
|
|
7221
|
+
var animatePosition_3 = new CesiumAnimatedProperty.AnimatePositionSeries({
|
|
7048
7222
|
posses: series,
|
|
7049
7223
|
viewer: params.viewer
|
|
7050
7224
|
});
|
|
7051
|
-
position = new CallbackProperty(function () { return
|
|
7225
|
+
position = new CallbackProperty(function () { return animatePosition_3.GetValue(); }, false);
|
|
7052
7226
|
}
|
|
7053
7227
|
else {
|
|
7054
7228
|
position = new CallbackProperty(function () { return EntityUtils.GetPos({
|
|
@@ -7094,7 +7268,7 @@ var EntityRenderEngine;
|
|
|
7094
7268
|
else {
|
|
7095
7269
|
// Gather entity in case previous version had sibling graphics we no longer need.
|
|
7096
7270
|
var parts = EntityUtils.GatherEntity({
|
|
7097
|
-
entity: cEntity
|
|
7271
|
+
entity: cEntity
|
|
7098
7272
|
});
|
|
7099
7273
|
if (parts.length > 1) {
|
|
7100
7274
|
// Kill all expect last part. Last one is the primary entity.
|
|
@@ -7121,24 +7295,24 @@ var EntityRenderEngine;
|
|
|
7121
7295
|
// If we have a series of time-based positions then we'll animate as time changes.
|
|
7122
7296
|
var series = getSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
|
|
7123
7297
|
if (series.length > 1) {
|
|
7124
|
-
var
|
|
7298
|
+
var animatePosition_4 = new CesiumAnimatedProperty.AnimatePositionSeries({
|
|
7125
7299
|
posses: series,
|
|
7126
7300
|
viewer: params.viewer
|
|
7127
7301
|
});
|
|
7128
|
-
cEntity.position = new CallbackProperty(function () { return
|
|
7302
|
+
cEntity.position = new CallbackProperty(function () { return animatePosition_4.GetValue(); }, false);
|
|
7129
7303
|
}
|
|
7130
7304
|
else {
|
|
7131
7305
|
var prevPos3d = getValue$1(params.viewer, cEntity.position);
|
|
7132
7306
|
var posChanged = !prevPos3d || !Cartesian3.equals(prevPos3d, pos3d);
|
|
7133
|
-
var
|
|
7307
|
+
var animatePosition_5 = null;
|
|
7134
7308
|
if (posChanged) {
|
|
7135
|
-
|
|
7309
|
+
animatePosition_5 = new CesiumAnimatedProperty.AnimatePosition({
|
|
7136
7310
|
durationMs: 200,
|
|
7137
7311
|
targetPos3d: pos3d,
|
|
7138
7312
|
viewer: params.viewer,
|
|
7139
7313
|
startPos3d: prevPos3d
|
|
7140
7314
|
});
|
|
7141
|
-
cEntity.position = new CallbackProperty(function () { return
|
|
7315
|
+
cEntity.position = new CallbackProperty(function () { return animatePosition_5.GetValue(); }, false);
|
|
7142
7316
|
}
|
|
7143
7317
|
}
|
|
7144
7318
|
// cEntity.orientation = new Cesium.ConstantProperty(orientation);
|
|
@@ -8770,7 +8944,7 @@ var CesiumAnimatedInOut;
|
|
|
8770
8944
|
var viewer = params.viewer, entity = params.entity;
|
|
8771
8945
|
if (entity instanceof Entity) {
|
|
8772
8946
|
var pieces = EntityUtils.GatherEntity({
|
|
8773
|
-
entity: entity
|
|
8947
|
+
entity: entity
|
|
8774
8948
|
});
|
|
8775
8949
|
var leaderSet = false;
|
|
8776
8950
|
var removed_1 = false;
|
|
@@ -9957,7 +10131,7 @@ var VisualsRegister;
|
|
|
9957
10131
|
VisualsRegister.Register = Register;
|
|
9958
10132
|
})(VisualsRegister || (VisualsRegister = {}));
|
|
9959
10133
|
|
|
9960
|
-
function GetValue$
|
|
10134
|
+
function GetValue$2(viewer, obj) {
|
|
9961
10135
|
if (obj === null || obj === void 0 ? void 0 : obj.getValue) {
|
|
9962
10136
|
var date = viewer.scene.lastRenderTime;
|
|
9963
10137
|
if (!date) {
|
|
@@ -10747,12 +10921,12 @@ var PointClustering = /** @class */ (function () {
|
|
|
10747
10921
|
if (entity.polygon || entity.polyline) {
|
|
10748
10922
|
return false;
|
|
10749
10923
|
}
|
|
10750
|
-
var pos3d = GetValue$
|
|
10924
|
+
var pos3d = GetValue$2(this.viewer, entity.position);
|
|
10751
10925
|
if (!(pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) {
|
|
10752
10926
|
return false;
|
|
10753
10927
|
}
|
|
10754
10928
|
if (!this.pointColorBg && entity.point) {
|
|
10755
|
-
var pointColorBg = GetValue$
|
|
10929
|
+
var pointColorBg = GetValue$2(this.viewer, entity.point.color);
|
|
10756
10930
|
if (pointColorBg) {
|
|
10757
10931
|
var cColor = null;
|
|
10758
10932
|
if (pointColorBg instanceof Object) {
|
|
@@ -10776,7 +10950,7 @@ var PointClustering = /** @class */ (function () {
|
|
|
10776
10950
|
}
|
|
10777
10951
|
}
|
|
10778
10952
|
if (!this.iconUrl && entity.billboard) {
|
|
10779
|
-
var iconUrl = GetValue$
|
|
10953
|
+
var iconUrl = GetValue$2(this.viewer, entity.billboard.image);
|
|
10780
10954
|
if (typeof iconUrl == "string") {
|
|
10781
10955
|
this.iconUrl = iconUrl;
|
|
10782
10956
|
}
|
|
@@ -11644,6 +11818,7 @@ var EntitiesRenderManager;
|
|
|
11644
11818
|
visualRegister: this.visualsManager,
|
|
11645
11819
|
zoomControl: this.item.CameraZoomSettings,
|
|
11646
11820
|
entitiesHistoric: entitiesHistoric,
|
|
11821
|
+
entityHistoricDrawTrack: this.item.historicDrawTrack,
|
|
11647
11822
|
force: force,
|
|
11648
11823
|
optimizeGeometry: this.item.optimizeGeometry,
|
|
11649
11824
|
optimizeMinPoints: this.item.optimizeMinPoints,
|
|
@@ -24982,15 +25157,15 @@ var WidgetCursorBar = /** @class */ (function (_super) {
|
|
|
24982
25157
|
this._disposeCesiumEvent();
|
|
24983
25158
|
var events = new ScreenSpaceEventHandler(this._viewer.scene.canvas);
|
|
24984
25159
|
var lastHoverPos = null;
|
|
24985
|
-
|
|
24986
|
-
|
|
25160
|
+
//let lastHoveredEntityId: string = null;
|
|
25161
|
+
//let unhighlightTimeout: any = null;
|
|
24987
25162
|
var process2dCursor = function (pos2d, isHover) {
|
|
24988
25163
|
try {
|
|
24989
25164
|
var regos = _this._manager.VisualsRegister.GetRegosFromCursor({
|
|
24990
25165
|
cursor: pos2d
|
|
24991
25166
|
}).regos;
|
|
24992
25167
|
var first = regos.length ? regos[0] : null;
|
|
24993
|
-
var
|
|
25168
|
+
var firstId = first === null || first === void 0 ? void 0 : first.entityId;
|
|
24994
25169
|
if (isHover) {
|
|
24995
25170
|
if (regos.length) {
|
|
24996
25171
|
_this._viewer.canvas.style.cursor = "pointer";
|
|
@@ -24998,37 +25173,40 @@ var WidgetCursorBar = /** @class */ (function (_super) {
|
|
|
24998
25173
|
else if (_this._viewer.canvas.style.cursor) {
|
|
24999
25174
|
_this._viewer.canvas.style.removeProperty("cursor");
|
|
25000
25175
|
}
|
|
25176
|
+
/*
|
|
25001
25177
|
clearTimeout(unhighlightTimeout);
|
|
25002
|
-
if (lastHoveredEntityId && lastHoveredEntityId !=
|
|
25003
|
-
|
|
25178
|
+
if (lastHoveredEntityId && lastHoveredEntityId != firstId) {
|
|
25179
|
+
this._manager.VisualsRegister.SetHighlighted({
|
|
25004
25180
|
entityIds: [lastHoveredEntityId],
|
|
25005
25181
|
highlighted: false
|
|
25006
25182
|
});
|
|
25007
25183
|
}
|
|
25008
|
-
if (
|
|
25009
|
-
unhighlightTimeout = setTimeout(
|
|
25010
|
-
if (lastHoveredEntityId ==
|
|
25011
|
-
|
|
25012
|
-
entityIds: [
|
|
25184
|
+
if (firstId) {
|
|
25185
|
+
unhighlightTimeout = setTimeout(() => {
|
|
25186
|
+
if (lastHoveredEntityId == firstId) {
|
|
25187
|
+
this._manager.VisualsRegister.SetHighlighted({
|
|
25188
|
+
entityIds: [firstId],
|
|
25013
25189
|
highlighted: false
|
|
25014
25190
|
});
|
|
25015
25191
|
lastHoveredEntityId = null;
|
|
25016
25192
|
}
|
|
25017
25193
|
}, 5000);
|
|
25018
|
-
if (lastHoveredEntityId !=
|
|
25019
|
-
|
|
25020
|
-
entityIds: [
|
|
25194
|
+
if (lastHoveredEntityId != firstId) {
|
|
25195
|
+
this._manager.VisualsRegister.SetHighlighted({
|
|
25196
|
+
entityIds: [firstId],
|
|
25021
25197
|
highlighted: true
|
|
25022
25198
|
});
|
|
25023
25199
|
}
|
|
25024
25200
|
}
|
|
25025
|
-
|
|
25201
|
+
|
|
25202
|
+
lastHoveredEntityId = firstId;
|
|
25203
|
+
*/
|
|
25026
25204
|
}
|
|
25027
25205
|
else {
|
|
25028
25206
|
_this._manager.VisualsRegister.ClearSelected();
|
|
25029
25207
|
if (first) {
|
|
25030
25208
|
_this._manager.VisualsRegister.SetSelected({
|
|
25031
|
-
entityIds: [
|
|
25209
|
+
entityIds: [firstId],
|
|
25032
25210
|
selected: true
|
|
25033
25211
|
});
|
|
25034
25212
|
}
|
|
@@ -26296,7 +26474,7 @@ var ViewerUtils;
|
|
|
26296
26474
|
ViewerUtils.AssertIonToken = AssertIonToken;
|
|
26297
26475
|
})(ViewerUtils || (ViewerUtils = {}));
|
|
26298
26476
|
|
|
26299
|
-
var VERSION = "4.4.
|
|
26477
|
+
var VERSION = "4.4.4";
|
|
26300
26478
|
|
|
26301
26479
|
export { VERSION, CesiumViewMonitor, ViewerUtils, MenuItemManager, EntityRenderEngine, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, 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, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, WidgetNavCompass$$1 as WidgetNavCompass, WidgetSearchBar, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks };
|
|
26302
26480
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|