bruce-cesium 3.7.4 → 3.7.6
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 +166 -70
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +165 -69
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/entity-render-engine.js +39 -26
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/rendering/getters/entity-filter-getter.js +69 -2
- package/dist/lib/rendering/getters/entity-filter-getter.js.map +1 -1
- package/dist/lib/rendering/render-managers/common/shared-getters.js +2 -1
- package/dist/lib/rendering/render-managers/common/shared-getters.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +37 -20
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/lib/utils/cesium-entity-styler.js +18 -19
- package/dist/lib/utils/cesium-entity-styler.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/getters/entity-filter-getter.d.ts +15 -1
- package/dist/types/rendering/render-managers/common/shared-getters.d.ts +1 -0
- package/dist/types/rendering/visuals-register.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, Tileset, MathUtils, LRUCache, ProjectViewTile, DelayQueue, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, Api, EntityRelationType, ENVIRONMENT, EntityCoords, EntitySource, MenuItem, EntityRelation, ProgramKey, AbstractApi, ProjectViewBookmark, EntityAttachment, EntityAttachmentType, EntityAttribute, ProjectView, ProjectViewLegacyTile, Camera } 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, Entity, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, Cesium3DTileStyle, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction,
|
|
3
|
+
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, DistanceDisplayCondition, NearFarScalar, Model, Entity, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, Cesium3DTileStyle, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Quaternion, Intersect } from 'cesium';
|
|
4
4
|
|
|
5
5
|
/*! *****************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1280,12 +1280,11 @@ function calculateCurColor(viewer, graphic) {
|
|
|
1280
1280
|
/**
|
|
1281
1281
|
* Stores a copy of the color against a key within the graphic.
|
|
1282
1282
|
* This lets us refer to it later if we need to change to it.
|
|
1283
|
-
* @param viewer
|
|
1284
1283
|
* @param key
|
|
1285
1284
|
* @param color
|
|
1286
1285
|
* @param graphic
|
|
1287
1286
|
*/
|
|
1288
|
-
function storeColor(
|
|
1287
|
+
function storeColor(key, color, graphic) {
|
|
1289
1288
|
graphic[getStoreKey(key)] = (color === null || color === void 0 ? void 0 : color.clone) ? color.clone() : color;
|
|
1290
1289
|
}
|
|
1291
1290
|
/**
|
|
@@ -1305,7 +1304,7 @@ function getColor$1(viewer, key, graphic) {
|
|
|
1305
1304
|
// We'll only store the default color.
|
|
1306
1305
|
// Rest can be retrieved every time to get the latest setting value.
|
|
1307
1306
|
if (color) {
|
|
1308
|
-
storeColor(
|
|
1307
|
+
storeColor(key, color, graphic);
|
|
1309
1308
|
}
|
|
1310
1309
|
}
|
|
1311
1310
|
else if (key == "select") {
|
|
@@ -1557,36 +1556,36 @@ var CesiumEntityStyler;
|
|
|
1557
1556
|
}
|
|
1558
1557
|
if (part instanceof Cesium3DTileFeature) {
|
|
1559
1558
|
var opacity = getAppliedOpacity(part);
|
|
1560
|
-
storeColor(
|
|
1559
|
+
storeColor("default", calculateCurColor(viewer, part), part);
|
|
1561
1560
|
refreshColor(viewer, part, opacity);
|
|
1562
1561
|
}
|
|
1563
1562
|
else if (part instanceof Entity) {
|
|
1564
1563
|
if (part.billboard) {
|
|
1565
|
-
storeColor(
|
|
1564
|
+
storeColor("default", calculateCurColor(viewer, part.billboard), part.billboard);
|
|
1566
1565
|
refreshColor(viewer, part.billboard, getAppliedOpacity(part.billboard));
|
|
1567
1566
|
}
|
|
1568
1567
|
if (part.model) {
|
|
1569
|
-
storeColor(
|
|
1568
|
+
storeColor("default", calculateCurColor(viewer, part.model), part.model);
|
|
1570
1569
|
refreshColor(viewer, part.model, getAppliedOpacity(part.model));
|
|
1571
1570
|
}
|
|
1572
1571
|
if (part.polyline) {
|
|
1573
|
-
storeColor(
|
|
1572
|
+
storeColor("default", calculateCurColor(viewer, part.polyline), part.polyline);
|
|
1574
1573
|
refreshColor(viewer, part.polyline, getAppliedOpacity(part.polyline));
|
|
1575
1574
|
}
|
|
1576
1575
|
if (part.polygon) {
|
|
1577
|
-
storeColor(
|
|
1576
|
+
storeColor("default", calculateCurColor(viewer, part.polygon), part.polygon);
|
|
1578
1577
|
refreshColor(viewer, part.polygon, getAppliedOpacity(part.polygon));
|
|
1579
1578
|
}
|
|
1580
1579
|
if (part.corridor) {
|
|
1581
|
-
storeColor(
|
|
1580
|
+
storeColor("default", calculateCurColor(viewer, part.corridor), part.corridor);
|
|
1582
1581
|
refreshColor(viewer, part.corridor, getAppliedOpacity(part.corridor));
|
|
1583
1582
|
}
|
|
1584
1583
|
if (part.point) {
|
|
1585
|
-
storeColor(
|
|
1584
|
+
storeColor("default", calculateCurColor(viewer, part.point), part.point);
|
|
1586
1585
|
refreshColor(viewer, part.point, getAppliedOpacity(part.point));
|
|
1587
1586
|
}
|
|
1588
1587
|
if (part.ellipse) {
|
|
1589
|
-
storeColor(
|
|
1588
|
+
storeColor("default", calculateCurColor(viewer, part.ellipse), part.ellipse);
|
|
1590
1589
|
refreshColor(viewer, part.ellipse, getAppliedOpacity(part.ellipse));
|
|
1591
1590
|
}
|
|
1592
1591
|
}
|
|
@@ -1621,36 +1620,36 @@ var CesiumEntityStyler;
|
|
|
1621
1620
|
}
|
|
1622
1621
|
if (part instanceof Cesium3DTileFeature) {
|
|
1623
1622
|
var opacity = getAppliedOpacity(part);
|
|
1624
|
-
storeColor(
|
|
1623
|
+
storeColor("default", params.color, part);
|
|
1625
1624
|
refreshColor(viewer, part, opacity);
|
|
1626
1625
|
}
|
|
1627
1626
|
else if (part instanceof Entity) {
|
|
1628
1627
|
if (part.billboard) {
|
|
1629
|
-
storeColor(
|
|
1628
|
+
storeColor("default", params.color, part.billboard);
|
|
1630
1629
|
refreshColor(viewer, part.billboard, getAppliedOpacity(part.billboard));
|
|
1631
1630
|
}
|
|
1632
1631
|
if (part.model) {
|
|
1633
|
-
storeColor(
|
|
1632
|
+
storeColor("default", params.color, part.model);
|
|
1634
1633
|
refreshColor(viewer, part.model, getAppliedOpacity(part.model));
|
|
1635
1634
|
}
|
|
1636
1635
|
if (part.polyline) {
|
|
1637
|
-
storeColor(
|
|
1636
|
+
storeColor("default", params.color, part.polyline);
|
|
1638
1637
|
refreshColor(viewer, part.polyline, getAppliedOpacity(part.polyline));
|
|
1639
1638
|
}
|
|
1640
1639
|
if (part.polygon) {
|
|
1641
|
-
storeColor(
|
|
1640
|
+
storeColor("default", params.color, part.polygon);
|
|
1642
1641
|
refreshColor(viewer, part.polygon, getAppliedOpacity(part.polygon));
|
|
1643
1642
|
}
|
|
1644
1643
|
if (part.corridor) {
|
|
1645
|
-
storeColor(
|
|
1644
|
+
storeColor("default", params.color, part.corridor);
|
|
1646
1645
|
refreshColor(viewer, part.corridor, getAppliedOpacity(part.corridor));
|
|
1647
1646
|
}
|
|
1648
1647
|
if (part.point) {
|
|
1649
|
-
storeColor(
|
|
1648
|
+
storeColor("default", params.color, part.point);
|
|
1650
1649
|
refreshColor(viewer, part.point, getAppliedOpacity(part.point));
|
|
1651
1650
|
}
|
|
1652
1651
|
if (part.ellipse) {
|
|
1653
|
-
storeColor(
|
|
1652
|
+
storeColor("default", params.color, part.ellipse);
|
|
1654
1653
|
refreshColor(viewer, part.ellipse, getAppliedOpacity(part.ellipse));
|
|
1655
1654
|
}
|
|
1656
1655
|
}
|
|
@@ -4807,11 +4806,11 @@ function extractMetadataFromFileUrl(url) {
|
|
|
4807
4806
|
var EntityRenderEngine;
|
|
4808
4807
|
(function (EntityRenderEngine) {
|
|
4809
4808
|
function Render(params) {
|
|
4810
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4809
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
4811
4810
|
return __awaiter(this, void 0, void 0, function () {
|
|
4812
4811
|
var groupRenderParams, i, entity, geometry, cEntities, models, multiGeometry, polygons, polylines, points, i, entity, id, zoomItem, displayType, existingRego, newRenderId, oldRenderId, mParams, mEntities, i, entity, id, cEntity, _loop_1, i, pParams, pEntities, i, entity, cEntity, pParams, pEntities, i, entity, cEntity, pParams, pEntities, i, entity, cEntity;
|
|
4813
|
-
return __generator(this, function (
|
|
4814
|
-
switch (
|
|
4812
|
+
return __generator(this, function (_m) {
|
|
4813
|
+
switch (_m.label) {
|
|
4815
4814
|
case 0:
|
|
4816
4815
|
groupRenderParams = {
|
|
4817
4816
|
apiGetter: params.apiGetter,
|
|
@@ -4859,7 +4858,11 @@ var EntityRenderEngine;
|
|
|
4859
4858
|
});
|
|
4860
4859
|
newRenderId = getRenderGroupId(zoomItem, (_b = params.viewer) === null || _b === void 0 ? void 0 : _b.terrainProvider);
|
|
4861
4860
|
oldRenderId = (_c = existingRego === null || existingRego === void 0 ? void 0 : existingRego.visual) === null || _c === void 0 ? void 0 : _c._renderGroup;
|
|
4862
|
-
if (!params.force &&
|
|
4861
|
+
if (!params.force &&
|
|
4862
|
+
newRenderId == oldRenderId &&
|
|
4863
|
+
!(existingRego === null || existingRego === void 0 ? void 0 : existingRego.stale) &&
|
|
4864
|
+
// If historic metadata is different then it's also stale.
|
|
4865
|
+
((existingRego === null || existingRego === void 0 ? void 0 : existingRego.historicDateTime) == ((_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d.historicDateTime))) {
|
|
4863
4866
|
// No sorting category needed. Already rendered the way we want.
|
|
4864
4867
|
cEntities[id] = existingRego.visual;
|
|
4865
4868
|
}
|
|
@@ -4869,12 +4872,16 @@ var EntityRenderEngine;
|
|
|
4869
4872
|
cEntities[id] = existingRego.visual;
|
|
4870
4873
|
// Flag as no longer stale as we're unlikely to recreate the rego if we're reusing the graphic.
|
|
4871
4874
|
existingRego.stale = false;
|
|
4875
|
+
// Update metadata for the same reason.
|
|
4876
|
+
existingRego.historicDateTime = (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.historicDateTime;
|
|
4877
|
+
existingRego.historicAttrKey = (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.historicAttrKey;
|
|
4878
|
+
existingRego.entityTypeId = entity.Bruce["EntityType.ID"];
|
|
4872
4879
|
}
|
|
4873
4880
|
if (displayType == ZoomControl.EDisplayType.Model3D) {
|
|
4874
4881
|
models.push(entity);
|
|
4875
4882
|
}
|
|
4876
4883
|
else if (displayType == ZoomControl.EDisplayType.Geometry) {
|
|
4877
|
-
if ((
|
|
4884
|
+
if ((_h = (_g = entity.geometry) === null || _g === void 0 ? void 0 : _g.MultiGeometry) === null || _h === void 0 ? void 0 : _h.length) {
|
|
4878
4885
|
multiGeometry.push(entity);
|
|
4879
4886
|
}
|
|
4880
4887
|
else {
|
|
@@ -4892,7 +4899,7 @@ var EntityRenderEngine;
|
|
|
4892
4899
|
mParams = __assign(__assign({}, groupRenderParams), { rendered: cEntities, entities: models });
|
|
4893
4900
|
return [4 /*yield*/, Model3d.RenderGroup(mParams)];
|
|
4894
4901
|
case 1:
|
|
4895
|
-
mEntities =
|
|
4902
|
+
mEntities = _m.sent();
|
|
4896
4903
|
for (i = 0; i < mParams.entities.length; i++) {
|
|
4897
4904
|
entity = mParams.entities[i];
|
|
4898
4905
|
id = entity.Bruce.ID;
|
|
@@ -4904,16 +4911,16 @@ var EntityRenderEngine;
|
|
|
4904
4911
|
multiGeometry.push(entity);
|
|
4905
4912
|
}
|
|
4906
4913
|
}
|
|
4907
|
-
|
|
4914
|
+
_m.label = 2;
|
|
4908
4915
|
case 2:
|
|
4909
4916
|
if (!(multiGeometry.length > 0)) return [3 /*break*/, 6];
|
|
4910
4917
|
_loop_1 = function (i) {
|
|
4911
4918
|
var entity, pParams, zoomItem, j, subEntity, cPoly, rendered, cLines, cPoints, rootEntity_1, firstEntity;
|
|
4912
|
-
return __generator(this, function (
|
|
4913
|
-
switch (
|
|
4919
|
+
return __generator(this, function (_o) {
|
|
4920
|
+
switch (_o.label) {
|
|
4914
4921
|
case 0:
|
|
4915
4922
|
entity = multiGeometry[i];
|
|
4916
|
-
if (!((
|
|
4923
|
+
if (!((_k = (_j = entity.geometry) === null || _j === void 0 ? void 0 : _j.MultiGeometry) === null || _k === void 0 ? void 0 : _k.length)) {
|
|
4917
4924
|
polygons.push(entity);
|
|
4918
4925
|
return [2 /*return*/, "continue"];
|
|
4919
4926
|
}
|
|
@@ -4926,7 +4933,7 @@ var EntityRenderEngine;
|
|
|
4926
4933
|
}
|
|
4927
4934
|
return [4 /*yield*/, Polygon.RenderGroup(pParams)];
|
|
4928
4935
|
case 1:
|
|
4929
|
-
cPoly =
|
|
4936
|
+
cPoly = _o.sent();
|
|
4930
4937
|
Object.keys(cPoly).forEach(function (key) {
|
|
4931
4938
|
if (cPoly[key]) {
|
|
4932
4939
|
pParams.entities = pParams.entities.filter(function (e) { return e.Bruce.ID != key; });
|
|
@@ -4935,7 +4942,7 @@ var EntityRenderEngine;
|
|
|
4935
4942
|
rendered = Object.values(cPoly);
|
|
4936
4943
|
return [4 /*yield*/, Polyline.RenderGroup(pParams)];
|
|
4937
4944
|
case 2:
|
|
4938
|
-
cLines =
|
|
4945
|
+
cLines = _o.sent();
|
|
4939
4946
|
Object.keys(cLines).forEach(function (key) {
|
|
4940
4947
|
if (cLines[key]) {
|
|
4941
4948
|
pParams.entities = pParams.entities.filter(function (e) { return e.Bruce.ID != key; });
|
|
@@ -4945,9 +4952,9 @@ var EntityRenderEngine;
|
|
|
4945
4952
|
if (!!rendered.length) return [3 /*break*/, 4];
|
|
4946
4953
|
return [4 /*yield*/, Point.RenderGroup(pParams)];
|
|
4947
4954
|
case 3:
|
|
4948
|
-
cPoints =
|
|
4955
|
+
cPoints = _o.sent();
|
|
4949
4956
|
rendered = rendered.concat(Object.values(cPoints));
|
|
4950
|
-
|
|
4957
|
+
_o.label = 4;
|
|
4951
4958
|
case 4:
|
|
4952
4959
|
rendered = rendered.filter(function (x) { return x != null; });
|
|
4953
4960
|
if (rendered.length) {
|
|
@@ -4955,7 +4962,7 @@ var EntityRenderEngine;
|
|
|
4955
4962
|
id: ObjectUtils.UId(10)
|
|
4956
4963
|
});
|
|
4957
4964
|
rootEntity_1._siblingGraphics = [];
|
|
4958
|
-
rootEntity_1._renderGroup = getRenderGroupId(zoomItem, (
|
|
4965
|
+
rootEntity_1._renderGroup = getRenderGroupId(zoomItem, (_l = params.viewer) === null || _l === void 0 ? void 0 : _l.terrainProvider);
|
|
4959
4966
|
rootEntity_1._siblingGraphics = rootEntity_1._siblingGraphics.concat(rendered);
|
|
4960
4967
|
cEntities[entity.Bruce.ID] = rootEntity_1;
|
|
4961
4968
|
firstEntity = rendered[0];
|
|
@@ -4974,13 +4981,13 @@ var EntityRenderEngine;
|
|
|
4974
4981
|
});
|
|
4975
4982
|
};
|
|
4976
4983
|
i = 0;
|
|
4977
|
-
|
|
4984
|
+
_m.label = 3;
|
|
4978
4985
|
case 3:
|
|
4979
4986
|
if (!(i < multiGeometry.length)) return [3 /*break*/, 6];
|
|
4980
4987
|
return [5 /*yield**/, _loop_1(i)];
|
|
4981
4988
|
case 4:
|
|
4982
|
-
|
|
4983
|
-
|
|
4989
|
+
_m.sent();
|
|
4990
|
+
_m.label = 5;
|
|
4984
4991
|
case 5:
|
|
4985
4992
|
i++;
|
|
4986
4993
|
return [3 /*break*/, 3];
|
|
@@ -4989,7 +4996,7 @@ var EntityRenderEngine;
|
|
|
4989
4996
|
pParams = __assign(__assign({}, groupRenderParams), { entities: polygons, rendered: cEntities });
|
|
4990
4997
|
return [4 /*yield*/, Polygon.RenderGroup(pParams)];
|
|
4991
4998
|
case 7:
|
|
4992
|
-
pEntities =
|
|
4999
|
+
pEntities = _m.sent();
|
|
4993
5000
|
for (i = 0; i < pParams.entities.length; i++) {
|
|
4994
5001
|
entity = pParams.entities[i];
|
|
4995
5002
|
cEntity = pEntities[entity.Bruce.ID];
|
|
@@ -5000,13 +5007,13 @@ var EntityRenderEngine;
|
|
|
5000
5007
|
polylines.push(entity);
|
|
5001
5008
|
}
|
|
5002
5009
|
}
|
|
5003
|
-
|
|
5010
|
+
_m.label = 8;
|
|
5004
5011
|
case 8:
|
|
5005
5012
|
if (!(polylines.length > 0)) return [3 /*break*/, 10];
|
|
5006
5013
|
pParams = __assign(__assign({}, groupRenderParams), { entities: polylines, rendered: cEntities });
|
|
5007
5014
|
return [4 /*yield*/, Polyline.RenderGroup(pParams)];
|
|
5008
5015
|
case 9:
|
|
5009
|
-
pEntities =
|
|
5016
|
+
pEntities = _m.sent();
|
|
5010
5017
|
for (i = 0; i < pParams.entities.length; i++) {
|
|
5011
5018
|
entity = pParams.entities[i];
|
|
5012
5019
|
cEntity = pEntities[entity.Bruce.ID];
|
|
@@ -5017,13 +5024,13 @@ var EntityRenderEngine;
|
|
|
5017
5024
|
points.push(entity);
|
|
5018
5025
|
}
|
|
5019
5026
|
}
|
|
5020
|
-
|
|
5027
|
+
_m.label = 10;
|
|
5021
5028
|
case 10:
|
|
5022
5029
|
if (!(points.length > 0)) return [3 /*break*/, 12];
|
|
5023
5030
|
pParams = __assign(__assign({}, groupRenderParams), { entities: points, rendered: cEntities });
|
|
5024
5031
|
return [4 /*yield*/, Point.RenderGroup(pParams)];
|
|
5025
5032
|
case 11:
|
|
5026
|
-
pEntities =
|
|
5033
|
+
pEntities = _m.sent();
|
|
5027
5034
|
for (i = 0; i < pParams.entities.length; i++) {
|
|
5028
5035
|
entity = pParams.entities[i];
|
|
5029
5036
|
cEntity = pEntities[entity.Bruce.ID];
|
|
@@ -5031,7 +5038,7 @@ var EntityRenderEngine;
|
|
|
5031
5038
|
cEntities[entity.Bruce.ID] = cEntity;
|
|
5032
5039
|
}
|
|
5033
5040
|
}
|
|
5034
|
-
|
|
5041
|
+
_m.label = 12;
|
|
5035
5042
|
case 12: return [2 /*return*/, cEntities];
|
|
5036
5043
|
}
|
|
5037
5044
|
});
|
|
@@ -5231,7 +5238,7 @@ var EntityRenderEngine;
|
|
|
5231
5238
|
}));
|
|
5232
5239
|
// We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
|
|
5233
5240
|
CesiumEntityStyler.SetDefaultColor({
|
|
5234
|
-
color: cColor_1,
|
|
5241
|
+
color: cColor_1 ? cColor_1 : new Color(),
|
|
5235
5242
|
entity: cEntity,
|
|
5236
5243
|
viewer: params.viewer,
|
|
5237
5244
|
override: true,
|
|
@@ -6161,6 +6168,11 @@ var EntityRenderEngine;
|
|
|
6161
6168
|
position: pos,
|
|
6162
6169
|
show: true
|
|
6163
6170
|
});
|
|
6171
|
+
CesiumEntityStyler.BakeDefaultColor({
|
|
6172
|
+
entity: cEntity,
|
|
6173
|
+
viewer: params.viewer,
|
|
6174
|
+
override: true
|
|
6175
|
+
});
|
|
6164
6176
|
}
|
|
6165
6177
|
else {
|
|
6166
6178
|
// Gather entity in case previous version had sibling graphics we no longer need.
|
|
@@ -6209,7 +6221,7 @@ var EntityRenderEngine;
|
|
|
6209
6221
|
// We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
|
|
6210
6222
|
// cEntity.model.color = new Cesium.CallbackProperty(() => color, true);
|
|
6211
6223
|
CesiumEntityStyler.SetDefaultColor({
|
|
6212
|
-
color: color,
|
|
6224
|
+
color: color ? color : new Color(),
|
|
6213
6225
|
entity: cEntity,
|
|
6214
6226
|
viewer: params.viewer,
|
|
6215
6227
|
override: true,
|
|
@@ -9754,7 +9766,8 @@ var EntitiesRenderManager;
|
|
|
9754
9766
|
// So for multiple tags we'll manually sort on UI end...
|
|
9755
9767
|
tagIds: (tagsToRender === null || tagsToRender === void 0 ? void 0 : tagsToRender.length) ? tagsToRender : [],
|
|
9756
9768
|
debugShowBounds: Boolean(window === null || window === void 0 ? void 0 : window.ENTITIES_RENDER_MANAGER_SHOW_BOUNDS),
|
|
9757
|
-
cdn: this.item.cdnEnabled
|
|
9769
|
+
cdn: this.item.cdnEnabled,
|
|
9770
|
+
historicAttrKey: this.item.BruceEntity.historicAttrKey
|
|
9758
9771
|
});
|
|
9759
9772
|
var minMax = RenderManager.GetZoomMinMax({
|
|
9760
9773
|
zoomControl: this.item.CameraZoomSettings
|
|
@@ -10316,23 +10329,37 @@ var EntitiesRenderManager;
|
|
|
10316
10329
|
* @returns
|
|
10317
10330
|
*/
|
|
10318
10331
|
Manager.prototype.renderAsIndividuals = function (entities, force) {
|
|
10319
|
-
var _a, _b, _c;
|
|
10332
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
10320
10333
|
if (force === void 0) { force = false; }
|
|
10321
10334
|
return __awaiter(this, void 0, void 0, function () {
|
|
10322
|
-
var cEntities, i, entity, id, cEntity, visual, wasClustered, tagIds, rego;
|
|
10323
|
-
return __generator(this, function (
|
|
10324
|
-
switch (
|
|
10325
|
-
case 0:
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10335
|
+
var toRemove, i, entity, cEntities, i, entity, id, cEntity, visual, wasClustered, tagIds, rego;
|
|
10336
|
+
return __generator(this, function (_h) {
|
|
10337
|
+
switch (_h.label) {
|
|
10338
|
+
case 0:
|
|
10339
|
+
if ((_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.historicAttrKey) {
|
|
10340
|
+
toRemove = entities.filter(function (x) { var _a; return !((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.historicAttrKey); });
|
|
10341
|
+
for (i = 0; i < toRemove.length; i++) {
|
|
10342
|
+
entity = toRemove[i];
|
|
10343
|
+
this.visualsManager.RemoveRegos({
|
|
10344
|
+
entityId: entity.Bruce.ID,
|
|
10345
|
+
menuItemId: this.item.id,
|
|
10346
|
+
requestRender: false
|
|
10347
|
+
});
|
|
10348
|
+
(_b = this.clustering) === null || _b === void 0 ? void 0 : _b.RemoveEntity(entity.Bruce.ID, false);
|
|
10349
|
+
}
|
|
10350
|
+
entities = entities.filter(function (x) { var _a; return !!((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.historicAttrKey); });
|
|
10351
|
+
}
|
|
10352
|
+
return [4 /*yield*/, EntityRenderEngine.Render({
|
|
10353
|
+
viewer: this.viewer,
|
|
10354
|
+
apiGetter: this.apiGetter,
|
|
10355
|
+
entities: entities,
|
|
10356
|
+
menuItemId: this.item.id,
|
|
10357
|
+
visualRegister: this.visualsManager,
|
|
10358
|
+
zoomControl: this.item.CameraZoomSettings,
|
|
10359
|
+
force: force
|
|
10360
|
+
})];
|
|
10334
10361
|
case 1:
|
|
10335
|
-
cEntities =
|
|
10362
|
+
cEntities = _h.sent();
|
|
10336
10363
|
if (this.disposed) {
|
|
10337
10364
|
this.doDispose();
|
|
10338
10365
|
return [2 /*return*/];
|
|
@@ -10343,13 +10370,13 @@ var EntitiesRenderManager;
|
|
|
10343
10370
|
cEntity = cEntities[id];
|
|
10344
10371
|
this.renderedEntities[id] = !!cEntity;
|
|
10345
10372
|
if (cEntity) {
|
|
10346
|
-
visual = (
|
|
10373
|
+
visual = (_c = this.visualsManager.GetRego({
|
|
10347
10374
|
entityId: id,
|
|
10348
10375
|
menuItemId: this.item.id
|
|
10349
|
-
})) === null ||
|
|
10376
|
+
})) === null || _c === void 0 ? void 0 : _c.visual;
|
|
10350
10377
|
if (!visual || visual != cEntity) {
|
|
10351
10378
|
wasClustered = this.clustering ? this.clustering.AddEntity(id, cEntity, false) : false;
|
|
10352
|
-
tagIds = (
|
|
10379
|
+
tagIds = (_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d["Layer.ID"];
|
|
10353
10380
|
rego = {
|
|
10354
10381
|
entityId: id,
|
|
10355
10382
|
menuItemId: this.item.id,
|
|
@@ -10360,7 +10387,9 @@ var EntitiesRenderManager;
|
|
|
10360
10387
|
tagIds: tagIds ? [].concat(tagIds) : [],
|
|
10361
10388
|
overrideShow: wasClustered ? false : null,
|
|
10362
10389
|
name: cEntity.name,
|
|
10363
|
-
cdn: this.item.cdnEnabled
|
|
10390
|
+
cdn: this.item.cdnEnabled,
|
|
10391
|
+
historicDateTime: (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.historicDateTime,
|
|
10392
|
+
historicAttrKey: (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.historicAttrKey
|
|
10364
10393
|
};
|
|
10365
10394
|
this.visualsManager.AddRego({
|
|
10366
10395
|
rego: rego,
|
|
@@ -10374,7 +10403,7 @@ var EntitiesRenderManager;
|
|
|
10374
10403
|
menuItemId: this.item.id,
|
|
10375
10404
|
requestRender: false
|
|
10376
10405
|
});
|
|
10377
|
-
(
|
|
10406
|
+
(_g = this.clustering) === null || _g === void 0 ? void 0 : _g.RemoveEntity(id, false);
|
|
10378
10407
|
}
|
|
10379
10408
|
}
|
|
10380
10409
|
this.viewer.scene.requestRender();
|
|
@@ -13596,12 +13625,13 @@ var EntityFilterGetter;
|
|
|
13596
13625
|
EStatus["Loading"] = "LOADING";
|
|
13597
13626
|
})(EStatus = EntityFilterGetter.EStatus || (EntityFilterGetter.EStatus = {}));
|
|
13598
13627
|
var Getter = /** @class */ (function () {
|
|
13599
|
-
function Getter(api, viewPort, typeId, batchSize, attrFilter, viaCdn) {
|
|
13628
|
+
function Getter(api, viewer, viewPort, typeId, batchSize, attrFilter, historicAttrKey, viaCdn) {
|
|
13600
13629
|
this.onUpdate = null;
|
|
13601
13630
|
this.LastStateUpdates = {};
|
|
13602
13631
|
this.onStateUpdate = null;
|
|
13603
13632
|
this.onScanUpdate = null;
|
|
13604
13633
|
this.viewPortChangeRemoval = null;
|
|
13634
|
+
this.viewerDateTimeChangeRemoval = null;
|
|
13605
13635
|
this.cells = null;
|
|
13606
13636
|
this.registeredItems = {};
|
|
13607
13637
|
this.getterLoopId = 0;
|
|
@@ -13612,10 +13642,12 @@ var EntityFilterGetter;
|
|
|
13612
13642
|
this.viewCenter = null;
|
|
13613
13643
|
this.api = api;
|
|
13614
13644
|
this.typeId = typeId;
|
|
13645
|
+
this.historicAttrKey = historicAttrKey;
|
|
13615
13646
|
this.viaCdn = Boolean(viaCdn);
|
|
13616
13647
|
this.batchSize = isNaN(batchSize) ? 300 : batchSize;
|
|
13617
13648
|
this.viewPort = viewPort;
|
|
13618
13649
|
this.attrFilter = attrFilter;
|
|
13650
|
+
this.viewer = viewer;
|
|
13619
13651
|
this.updateBounds();
|
|
13620
13652
|
}
|
|
13621
13653
|
Object.defineProperty(Getter.prototype, "OnUpdate", {
|
|
@@ -13654,7 +13686,14 @@ var EntityFilterGetter;
|
|
|
13654
13686
|
* @returns
|
|
13655
13687
|
*/
|
|
13656
13688
|
Getter.prototype.getIntegrityId = function () {
|
|
13657
|
-
|
|
13689
|
+
var integrity = this.tagIds == null ? "" : this.tagIds.join();
|
|
13690
|
+
if (this.historicAttrKey) {
|
|
13691
|
+
integrity += this.historicAttrKey;
|
|
13692
|
+
if (this.historicAttrDateTime) {
|
|
13693
|
+
integrity += this.historicAttrDateTime;
|
|
13694
|
+
}
|
|
13695
|
+
}
|
|
13696
|
+
return integrity;
|
|
13658
13697
|
};
|
|
13659
13698
|
Getter.prototype.viewAreaSub = function () {
|
|
13660
13699
|
var _this = this;
|
|
@@ -13667,6 +13706,57 @@ var EntityFilterGetter;
|
|
|
13667
13706
|
Getter.prototype.viewAreaDispose = function () {
|
|
13668
13707
|
var _a;
|
|
13669
13708
|
(_a = this.viewPortChangeRemoval) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
13709
|
+
this.viewPortChangeRemoval = null;
|
|
13710
|
+
};
|
|
13711
|
+
/**
|
|
13712
|
+
* Monitors the Cesium viewer and updates the historic data filter values.
|
|
13713
|
+
* If there is no historic attr set, this will do nothing.
|
|
13714
|
+
*/
|
|
13715
|
+
Getter.prototype.viewerDateTimeSub = function () {
|
|
13716
|
+
var _this = this;
|
|
13717
|
+
this.viewerDateTimeDispose();
|
|
13718
|
+
if (!this.historicAttrKey) {
|
|
13719
|
+
return;
|
|
13720
|
+
}
|
|
13721
|
+
var delayQueue = new DelayQueue(function () {
|
|
13722
|
+
var current = _this.getIntegrityId();
|
|
13723
|
+
_this.updateHistoricDateTime();
|
|
13724
|
+
if (current != _this.getIntegrityId()) {
|
|
13725
|
+
_this.updateState();
|
|
13726
|
+
}
|
|
13727
|
+
}, 250);
|
|
13728
|
+
var postUpdateRemoval = this.viewer.scene.postUpdate.addEventListener(function () {
|
|
13729
|
+
if (delayQueue) {
|
|
13730
|
+
delayQueue.Call();
|
|
13731
|
+
}
|
|
13732
|
+
});
|
|
13733
|
+
this.viewerDateTimeChangeRemoval = function () {
|
|
13734
|
+
delayQueue === null || delayQueue === void 0 ? void 0 : delayQueue.Dispose();
|
|
13735
|
+
postUpdateRemoval === null || postUpdateRemoval === void 0 ? void 0 : postUpdateRemoval();
|
|
13736
|
+
delayQueue = null;
|
|
13737
|
+
postUpdateRemoval = null;
|
|
13738
|
+
};
|
|
13739
|
+
};
|
|
13740
|
+
Getter.prototype.updateHistoricDateTime = function () {
|
|
13741
|
+
var newDateTime = JulianDate.toDate(this.viewer.clock.currentTime);
|
|
13742
|
+
// Has previous value. Let's compare.
|
|
13743
|
+
if (this.historicAttrDateTime) {
|
|
13744
|
+
var oldDateTime = new Date(this.historicAttrDateTime);
|
|
13745
|
+
// Change must be at least 0.1 seconds.
|
|
13746
|
+
// TODO: This is just a random value I picked. We may need to make a setting or refine this.
|
|
13747
|
+
if (Math.abs(newDateTime.getTime() - oldDateTime.getTime()) < 100) {
|
|
13748
|
+
return;
|
|
13749
|
+
}
|
|
13750
|
+
}
|
|
13751
|
+
this.historicAttrDateTime = newDateTime.toISOString();
|
|
13752
|
+
// Set min/max to be the value increased/decreased by 1 minute.
|
|
13753
|
+
this.historicAttrDateTimeMin = new Date(newDateTime.getTime() - 60000).toISOString();
|
|
13754
|
+
this.historicAttrDateTimeMax = new Date(newDateTime.getTime() + 60000).toISOString();
|
|
13755
|
+
};
|
|
13756
|
+
Getter.prototype.viewerDateTimeDispose = function () {
|
|
13757
|
+
var _a;
|
|
13758
|
+
(_a = this.viewerDateTimeChangeRemoval) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
13759
|
+
this.viewerDateTimeChangeRemoval = null;
|
|
13670
13760
|
};
|
|
13671
13761
|
Getter.prototype.GetMenuItems = function () {
|
|
13672
13762
|
return Object.keys(this.registeredItems);
|
|
@@ -13726,8 +13816,10 @@ var EntityFilterGetter;
|
|
|
13726
13816
|
this.minHeight = minHeight;
|
|
13727
13817
|
this.maxHeight = maxHeight;
|
|
13728
13818
|
this.updateBounds();
|
|
13819
|
+
this.updateHistoricDateTime();
|
|
13729
13820
|
this.startGetterLoop();
|
|
13730
13821
|
this.viewAreaSub();
|
|
13822
|
+
this.viewerDateTimeSub();
|
|
13731
13823
|
}
|
|
13732
13824
|
else {
|
|
13733
13825
|
this.getterLoopId += 1;
|
|
@@ -13823,6 +13915,9 @@ var EntityFilterGetter;
|
|
|
13823
13915
|
_j.trys.push([8, 10, , 11]);
|
|
13824
13916
|
return [4 /*yield*/, Entity$1.GetList({
|
|
13825
13917
|
api: this.api,
|
|
13918
|
+
historicKey: this.historicAttrKey,
|
|
13919
|
+
historicFrom: this.historicAttrKey ? this.historicAttrDateTimeMin : null,
|
|
13920
|
+
historicTo: this.historicAttrKey ? this.historicAttrDateTimeMax : null,
|
|
13826
13921
|
filter: {
|
|
13827
13922
|
pageSize: PAGE_SIZE,
|
|
13828
13923
|
pageIndex: curCell.FetchPageIndex,
|
|
@@ -13920,6 +14015,7 @@ function createFilterGetterCacheKey(params) {
|
|
|
13920
14015
|
cacheKey += params.batchSize;
|
|
13921
14016
|
cacheKey += String(params.cdn);
|
|
13922
14017
|
cacheKey += JSON.stringify(params.tagIds ? params.tagIds : []);
|
|
14018
|
+
cacheKey += params.historicAttrKey ? params.historicAttrKey : "";
|
|
13923
14019
|
// This could potentially crash, but if it crashes here then it would crash during API request anyways.
|
|
13924
14020
|
cacheKey += JSON.stringify(params.attrFilter ? params.attrFilter : {});
|
|
13925
14021
|
return cacheKey;
|
|
@@ -13935,7 +14031,7 @@ var SharedGetters;
|
|
|
13935
14031
|
var cacheKey = createFilterGetterCacheKey(params);
|
|
13936
14032
|
var getter = this.data[cacheKey];
|
|
13937
14033
|
if (!getter) {
|
|
13938
|
-
getter = new EntityFilterGetter.Getter(params.api, params.monitor, params.typeId, params.batchSize, params.attrFilter, params.cdn);
|
|
14034
|
+
getter = new EntityFilterGetter.Getter(params.api, params.viewer, params.monitor, params.typeId, params.batchSize, params.attrFilter, params.historicAttrKey, params.cdn);
|
|
13939
14035
|
this.data[cacheKey] = getter;
|
|
13940
14036
|
/**
|
|
13941
14037
|
* Debug option.
|
|
@@ -23345,7 +23441,7 @@ var ViewRenderEngine;
|
|
|
23345
23441
|
ViewRenderEngine.Render = Render;
|
|
23346
23442
|
})(ViewRenderEngine || (ViewRenderEngine = {}));
|
|
23347
23443
|
|
|
23348
|
-
var VERSION = "3.7.
|
|
23444
|
+
var VERSION = "3.7.6";
|
|
23349
23445
|
|
|
23350
23446
|
export { VERSION, CesiumViewMonitor, ViewerUtils, MenuItemManager, EntityRenderEngine, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, Draw3dPolygon, Draw3dPolyline };
|
|
23351
23447
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|