bruce-cesium 2.6.5 → 2.6.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 +48 -24
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +47 -23
- 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 +13 -2
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js +33 -20
- package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/render-managers/entities/entities-loaded-render-manager.d.ts +5 -1
- package/package.json +1 -1
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, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, EntityRelationType, DelayQueue, BatchedDataGetter, EntityCoords, EntityFilterGetter, EntitySource, MenuItem, EntityRelation, ENVIRONMENT, ProjectView, ProjectViewBookmark, ProjectViewTile, ProjectViewLegacyTile, ProgramKey, Camera, AbstractApi, EntityAttachment, EntityAttachmentType, EntityAttribute } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic, Cartesian2, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1,
|
|
3
|
+
import { Cartographic, Cartesian2, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1, HeightReference, DistanceDisplayCondition, NearFarScalar, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, HeadingPitchRoll, Transforms, ColorBlendMode, SceneMode, JulianDate, Primitive, Cesium3DTileFeature, HeadingPitchRange, Cesium3DTileColorBlendMode, Cesium3DTileStyle, KmlDataSource, createOsmBuildings, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidTerrainProvider, CesiumInspector, OrthographicFrustum, defined, createWorldTerrain, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, PolygonPipeline, EllipsoidGeodesic, sampleTerrainMostDetailed, Model, ColorMaterialProperty, EasingFunction, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, Ion, BoundingSphere } from 'cesium';
|
|
4
4
|
|
|
5
5
|
var TIME_LAG = 300;
|
|
6
6
|
var POSITION_CHECK_TIMER = 950;
|
|
@@ -1715,7 +1715,7 @@ function getValue(viewer, obj) {
|
|
|
1715
1715
|
}
|
|
1716
1716
|
function getName(api, entity) {
|
|
1717
1717
|
return __awaiter(this, void 0, void 0, function () {
|
|
1718
|
-
var typeId, type, name_1, e_1;
|
|
1718
|
+
var typeId, type, name_1, e_1, hideError, error, code;
|
|
1719
1719
|
return __generator(this, function (_a) {
|
|
1720
1720
|
switch (_a.label) {
|
|
1721
1721
|
case 0:
|
|
@@ -1742,7 +1742,18 @@ function getName(api, entity) {
|
|
|
1742
1742
|
return [3 /*break*/, 4];
|
|
1743
1743
|
case 3:
|
|
1744
1744
|
e_1 = _a.sent();
|
|
1745
|
-
|
|
1745
|
+
hideError = false;
|
|
1746
|
+
// TODO: we need a util for extracting code + message rather than writing all this every time.
|
|
1747
|
+
if (e_1 && typeof e_1 == "object" && e_1.ERROR) {
|
|
1748
|
+
error = e_1.ERROR;
|
|
1749
|
+
code = error && typeof error == "object" ? error.Code : "";
|
|
1750
|
+
// Avoiding logging a common error.
|
|
1751
|
+
// This happens when rendering entities that don't have records.
|
|
1752
|
+
hideError = String(code).toLowerCase() == "notfound";
|
|
1753
|
+
}
|
|
1754
|
+
if (!hideError) {
|
|
1755
|
+
console.error(e_1);
|
|
1756
|
+
}
|
|
1746
1757
|
return [3 /*break*/, 4];
|
|
1747
1758
|
case 4: return [2 /*return*/, "Unknown entity"];
|
|
1748
1759
|
}
|
|
@@ -5757,17 +5768,20 @@ var EntitiesLoadedRenderManager;
|
|
|
5757
5768
|
(function (EntitiesLoadedRenderManager) {
|
|
5758
5769
|
var Manager = /** @class */ (function () {
|
|
5759
5770
|
function Manager(params) {
|
|
5771
|
+
var _a;
|
|
5760
5772
|
this.getter = null;
|
|
5761
5773
|
this.getterSub = null;
|
|
5762
5774
|
this.disposed = false;
|
|
5763
5775
|
this.renderedEntities = {};
|
|
5764
|
-
this.updatedEntities = {};
|
|
5765
5776
|
var viewer = params.viewer, apiGetter = params.apiGetter, monitor = params.monitor, item = params.item, visualsManager = params.register;
|
|
5766
5777
|
this.viewer = viewer;
|
|
5767
5778
|
this.apiGetter = apiGetter;
|
|
5768
5779
|
this.monitor = monitor;
|
|
5769
5780
|
this.item = item;
|
|
5770
5781
|
this.visualsManager = visualsManager;
|
|
5782
|
+
if (!((_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.Entities)) {
|
|
5783
|
+
this.item.BruceEntity = __assign(__assign({}, this.item.BruceEntity), { Entities: [] });
|
|
5784
|
+
}
|
|
5771
5785
|
}
|
|
5772
5786
|
Object.defineProperty(Manager.prototype, "Disposed", {
|
|
5773
5787
|
get: function () {
|
|
@@ -5783,13 +5797,9 @@ var EntitiesLoadedRenderManager;
|
|
|
5783
5797
|
*/
|
|
5784
5798
|
Manager.prototype.AddEntities = function (params) {
|
|
5785
5799
|
var _this = this;
|
|
5786
|
-
var _a;
|
|
5787
5800
|
if (this.disposed) {
|
|
5788
5801
|
throw (new Error("This item is disposed."));
|
|
5789
5802
|
}
|
|
5790
|
-
if (!((_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.Entities)) {
|
|
5791
|
-
this.item.BruceEntity = __assign(__assign({}, this.item.BruceEntity), { Entities: [] });
|
|
5792
|
-
}
|
|
5793
5803
|
var entities = params.entities;
|
|
5794
5804
|
entities.forEach(function (x) {
|
|
5795
5805
|
var _a;
|
|
@@ -5816,13 +5826,9 @@ var EntitiesLoadedRenderManager;
|
|
|
5816
5826
|
*/
|
|
5817
5827
|
Manager.prototype.RemoveEntities = function (params) {
|
|
5818
5828
|
var _this = this;
|
|
5819
|
-
var _a;
|
|
5820
5829
|
if (this.disposed) {
|
|
5821
5830
|
throw (new Error("This item is disposed."));
|
|
5822
5831
|
}
|
|
5823
|
-
if (!((_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.Entities)) {
|
|
5824
|
-
this.item.BruceEntity = __assign(__assign({}, this.item.BruceEntity), { Entities: [] });
|
|
5825
|
-
}
|
|
5826
5832
|
var entityIds = params.entityIds;
|
|
5827
5833
|
entityIds.forEach(function (x) {
|
|
5828
5834
|
var index = _this.item.BruceEntity.Entities.findIndex(function (y) { var _a; return ((_a = y === null || y === void 0 ? void 0 : y.Bruce) === null || _a === void 0 ? void 0 : _a.ID) == x; });
|
|
@@ -5833,7 +5839,23 @@ var EntitiesLoadedRenderManager;
|
|
|
5833
5839
|
entityId: x,
|
|
5834
5840
|
menuItemId: _this.item.id
|
|
5835
5841
|
});
|
|
5842
|
+
_this.renderedEntities[x] = false;
|
|
5843
|
+
});
|
|
5844
|
+
this.recreateGetter();
|
|
5845
|
+
};
|
|
5846
|
+
/**
|
|
5847
|
+
* Clears all entities from the menu item.
|
|
5848
|
+
* Any visuals will be removed as well.
|
|
5849
|
+
*/
|
|
5850
|
+
Manager.prototype.ClearEntities = function () {
|
|
5851
|
+
if (this.disposed) {
|
|
5852
|
+
throw (new Error("This item is disposed."));
|
|
5853
|
+
}
|
|
5854
|
+
this.item.BruceEntity.Entities = [];
|
|
5855
|
+
this.visualsManager.RemoveRegos({
|
|
5856
|
+
menuItemId: this.item.id
|
|
5836
5857
|
});
|
|
5858
|
+
this.renderedEntities = {};
|
|
5837
5859
|
this.recreateGetter();
|
|
5838
5860
|
};
|
|
5839
5861
|
Manager.prototype.Init = function () {
|
|
@@ -5910,10 +5932,6 @@ var EntitiesLoadedRenderManager;
|
|
|
5910
5932
|
}
|
|
5911
5933
|
if (entities === null || entities === void 0 ? void 0 : entities.length) {
|
|
5912
5934
|
entities = [].concat(entities).filter(function (x) { var _a; return entityIds.includes((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID); });
|
|
5913
|
-
entities.forEach(function (x) {
|
|
5914
|
-
var _a;
|
|
5915
|
-
_this.updatedEntities[(_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID] = x;
|
|
5916
|
-
});
|
|
5917
5935
|
}
|
|
5918
5936
|
this.visualsManager.MarkStale({
|
|
5919
5937
|
entityIds: entityIds,
|
|
@@ -5964,7 +5982,6 @@ var EntitiesLoadedRenderManager;
|
|
|
5964
5982
|
if (!(ids.length > 0)) return [3 /*break*/, 4];
|
|
5965
5983
|
checkBatch = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
5966
5984
|
var entityIds, entities;
|
|
5967
|
-
var _this = this;
|
|
5968
5985
|
return __generator(this, function (_a) {
|
|
5969
5986
|
switch (_a.label) {
|
|
5970
5987
|
case 0:
|
|
@@ -5978,10 +5995,6 @@ var EntitiesLoadedRenderManager;
|
|
|
5978
5995
|
if (this.disposed) {
|
|
5979
5996
|
return [2 /*return*/];
|
|
5980
5997
|
}
|
|
5981
|
-
entities.forEach(function (x) {
|
|
5982
|
-
var _a;
|
|
5983
|
-
_this.updatedEntities[(_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID] = x;
|
|
5984
|
-
});
|
|
5985
5998
|
this.onGetterUpdate(entities, force);
|
|
5986
5999
|
return [2 /*return*/];
|
|
5987
6000
|
}
|
|
@@ -6008,7 +6021,8 @@ var EntitiesLoadedRenderManager;
|
|
|
6008
6021
|
var _a;
|
|
6009
6022
|
if (force === void 0) { force = false; }
|
|
6010
6023
|
return __awaiter(this, void 0, void 0, function () {
|
|
6011
|
-
var cEntities, i, entity, id, cEntity, visual, e_2;
|
|
6024
|
+
var isEntityInItem_1, cEntities, i, entity, id, cEntity, visual, e_2;
|
|
6025
|
+
var _this = this;
|
|
6012
6026
|
return __generator(this, function (_b) {
|
|
6013
6027
|
switch (_b.label) {
|
|
6014
6028
|
case 0:
|
|
@@ -6016,6 +6030,16 @@ var EntitiesLoadedRenderManager;
|
|
|
6016
6030
|
if (this.disposed || this.viewer.isDestroyed()) {
|
|
6017
6031
|
return [2 /*return*/];
|
|
6018
6032
|
}
|
|
6033
|
+
isEntityInItem_1 = function (entityId) {
|
|
6034
|
+
var _a, _b;
|
|
6035
|
+
return (_b = (_a = _this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.Entities) === null || _b === void 0 ? void 0 : _b.find(function (y) { var _a; return ((_a = y === null || y === void 0 ? void 0 : y.Bruce) === null || _a === void 0 ? void 0 : _a.ID) == entityId; });
|
|
6036
|
+
};
|
|
6037
|
+
// Filter out entities that aren't in the menu item.
|
|
6038
|
+
// This can happen if the menu item is updated while the getter is running.
|
|
6039
|
+
entities = entities.filter(function (x) {
|
|
6040
|
+
var _a;
|
|
6041
|
+
return isEntityInItem_1((_a = x === null || x === void 0 ? void 0 : x.Bruce) === null || _a === void 0 ? void 0 : _a.ID);
|
|
6042
|
+
});
|
|
6019
6043
|
return [4 /*yield*/, EntityRenderEngine.Render({
|
|
6020
6044
|
viewer: this.viewer,
|
|
6021
6045
|
apiGetter: this.apiGetter,
|
|
@@ -6032,7 +6056,7 @@ var EntitiesLoadedRenderManager;
|
|
|
6032
6056
|
id = entity.Bruce.ID;
|
|
6033
6057
|
cEntity = cEntities[id];
|
|
6034
6058
|
this.renderedEntities[id] = !!cEntity;
|
|
6035
|
-
if (cEntity) {
|
|
6059
|
+
if (cEntity && isEntityInItem_1(id)) {
|
|
6036
6060
|
visual = (_a = this.visualsManager.GetRego({
|
|
6037
6061
|
entityId: id,
|
|
6038
6062
|
menuItemId: this.item.id
|
|
@@ -15146,7 +15170,7 @@ var ViewerUtils;
|
|
|
15146
15170
|
ViewerUtils.CreateWidgets = CreateWidgets;
|
|
15147
15171
|
})(ViewerUtils || (ViewerUtils = {}));
|
|
15148
15172
|
|
|
15149
|
-
var VERSION$1 = "2.6.
|
|
15173
|
+
var VERSION$1 = "2.6.6";
|
|
15150
15174
|
|
|
15151
15175
|
export { VERSION$1 as VERSION, CesiumViewMonitor, ViewerUtils, MenuItemManager, EntityRenderEngine, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, RelationsRenderManager, SharedGetters, CesiumParabola, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, Draw3dPolygon, Draw3dPolyline };
|
|
15152
15176
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|