bruce-cesium 6.5.1 → 6.5.2
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 +56 -24
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +54 -22
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/entity-gatherer.js +53 -21
- package/dist/lib/rendering/entity-gatherer.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/entity-gatherer.d.ts +1 -0
- package/package.json +2 -2
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Cartes, Entity as Entity$1, Calculator, EntityRelationType, EntityType, Style, ENVIRONMENT, ProjectViewTile, DelayQueue, LRUCache, BruceEvent, ObjectUtils, Geometry, EntityHistoricData, EntityLod, ZoomControl, EntityTag, Tileset, Api, EntityCoords, DataLab, EntitySource, ClientFile, MenuItem, EntityRelation, ProgramKey, Bounds, Carto, ProjectView, ProjectViewBookmark,
|
|
1
|
+
import { Cartes, Entity as Entity$1, Calculator, EntityRelationType, EntityType, Style, ENVIRONMENT, ProjectViewTile, DelayQueue, LRUCache, BruceEvent, ObjectUtils, Geometry, EntityHistoricData, EntityLod, ZoomControl, EntityTag, Tileset, Api, EntityCoords, DataLab, EntitySource, ClientFile, MenuItem, EntityRelation, ProgramKey, Bounds, Carto, ProjectView, ProjectViewBookmark, ProjectViewLegacyTile, Camera, AbstractApi, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils, Session } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature,
|
|
3
|
+
import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, Math as Math$1, Cartesian3, JulianDate, Quaternion, Transforms, HeadingPitchRoll, Matrix4, DistanceDisplayCondition, HeightReference, ColorBlendMode, ShadowMode, ClassificationType, Model, HorizontalOrigin, VerticalOrigin, ConstantPositionProperty, PolygonHierarchy, PolylineGraphics, ArcType, CornerType, Cartesian2, SceneTransforms, NearFarScalar, Matrix3, Rectangle, KmlDataSource, GeoJsonDataSource, SceneMode, Cesium3DTileStyle, HeadingPitchRange, Cesium3DTileColorBlendMode, Ion, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, IonResource, Cesium3DTileset, OrthographicFrustum, EasingFunction, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, BoundingSphere, GeometryInstance, PolygonPipeline, CesiumInspector, ClockRange, ScreenSpaceEventHandler, ScreenSpaceEventType, Intersect, CzmlDataSource, Fullscreen } from 'cesium';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Ensures a number is returned from a given value.
|
|
@@ -10940,6 +10940,14 @@ class EntityGatherer {
|
|
|
10940
10940
|
this.viewer = viewer;
|
|
10941
10941
|
this.emitEntities = emitEntities;
|
|
10942
10942
|
}
|
|
10943
|
+
createFallbackEntity(entityId) {
|
|
10944
|
+
return {
|
|
10945
|
+
id: entityId,
|
|
10946
|
+
Bruce: {
|
|
10947
|
+
ID: entityId
|
|
10948
|
+
}
|
|
10949
|
+
};
|
|
10950
|
+
}
|
|
10943
10951
|
SetEntityDataOverride(eId, entity) {
|
|
10944
10952
|
if (this.disposed) {
|
|
10945
10953
|
return;
|
|
@@ -11084,26 +11092,44 @@ class EntityGatherer {
|
|
|
11084
11092
|
this.runningTick = true;
|
|
11085
11093
|
let rerun = false;
|
|
11086
11094
|
try {
|
|
11087
|
-
const handleResponse = async (entities) => {
|
|
11088
|
-
var _a, _b;
|
|
11089
|
-
|
|
11090
|
-
|
|
11095
|
+
const handleResponse = async (requestedBatch, entities) => {
|
|
11096
|
+
var _a, _b, _c, _d;
|
|
11097
|
+
const resolvedEntities = [];
|
|
11098
|
+
const foundById = new Map();
|
|
11099
|
+
for (const entity of entities || []) {
|
|
11100
|
+
const entityId = ((_a = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID) || (entity === null || entity === void 0 ? void 0 : entity.id);
|
|
11101
|
+
if (entityId) {
|
|
11102
|
+
foundById.set(entityId, entity);
|
|
11103
|
+
}
|
|
11104
|
+
}
|
|
11105
|
+
for (const entityId of requestedBatch || []) {
|
|
11106
|
+
const override = this.entityDataOverrides.get(entityId);
|
|
11107
|
+
if (override) {
|
|
11108
|
+
resolvedEntities.push(override);
|
|
11109
|
+
continue;
|
|
11110
|
+
}
|
|
11111
|
+
const found = foundById.get(entityId);
|
|
11112
|
+
if (found) {
|
|
11113
|
+
resolvedEntities.push(found);
|
|
11114
|
+
continue;
|
|
11115
|
+
}
|
|
11116
|
+
resolvedEntities.push(this.createFallbackEntity(entityId));
|
|
11091
11117
|
}
|
|
11092
|
-
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
|
|
11096
|
-
const eId = entity.Bruce.ID;
|
|
11097
|
-
if (this.entityDataOverrides.has(eId)) {
|
|
11098
|
-
entities[i] = this.entityDataOverrides.get(eId);
|
|
11099
|
-
}
|
|
11118
|
+
for (const entity of entities || []) {
|
|
11119
|
+
const entityId = ((_b = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _b === void 0 ? void 0 : _b.ID) || (entity === null || entity === void 0 ? void 0 : entity.id);
|
|
11120
|
+
if (!entityId || foundById.get(entityId) !== entity || (requestedBatch === null || requestedBatch === void 0 ? void 0 : requestedBatch.includes(entityId))) {
|
|
11121
|
+
continue;
|
|
11100
11122
|
}
|
|
11123
|
+
resolvedEntities.push(entity);
|
|
11124
|
+
}
|
|
11125
|
+
if (!resolvedEntities.length) {
|
|
11126
|
+
return;
|
|
11101
11127
|
}
|
|
11102
11128
|
// Gather all Tag IDs from found Entities.
|
|
11103
11129
|
let tagIds = new Set();
|
|
11104
|
-
for (let i = 0; i <
|
|
11105
|
-
const entity =
|
|
11106
|
-
if ((
|
|
11130
|
+
for (let i = 0; i < resolvedEntities.length; i++) {
|
|
11131
|
+
const entity = resolvedEntities[i];
|
|
11132
|
+
if ((_d = (_c = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _c === void 0 ? void 0 : _c["Layer.ID"]) === null || _d === void 0 ? void 0 : _d.length) {
|
|
11107
11133
|
const eTagIds = entity.Bruce["Layer.ID"];
|
|
11108
11134
|
for (let j = 0; j < eTagIds.length; j++) {
|
|
11109
11135
|
const tagId = eTagIds[j];
|
|
@@ -11132,8 +11158,10 @@ class EntityGatherer {
|
|
|
11132
11158
|
if (this.historic) {
|
|
11133
11159
|
// We can emit Entities if the last resolved time (per Entity) isn't newer than rTime.
|
|
11134
11160
|
// We compare using the changeDir to determine if we should emit or not.
|
|
11135
|
-
toEmit =
|
|
11136
|
-
|
|
11161
|
+
toEmit = resolvedEntities.filter((e) => {
|
|
11162
|
+
var _a;
|
|
11163
|
+
const entityId = ((_a = e === null || e === void 0 ? void 0 : e.Bruce) === null || _a === void 0 ? void 0 : _a.ID) || (e === null || e === void 0 ? void 0 : e.id);
|
|
11164
|
+
const lastFoundDateTime = this.lastFoundDateTimes.get(entityId);
|
|
11137
11165
|
if (lastFoundDateTime) {
|
|
11138
11166
|
if (changeDir === 1) {
|
|
11139
11167
|
return lastFoundDateTime <= rTime;
|
|
@@ -11146,12 +11174,16 @@ class EntityGatherer {
|
|
|
11146
11174
|
});
|
|
11147
11175
|
// Update the last found date times for the filtered Entities.
|
|
11148
11176
|
toEmit.forEach((e) => {
|
|
11149
|
-
|
|
11177
|
+
var _a;
|
|
11178
|
+
const entityId = ((_a = e === null || e === void 0 ? void 0 : e.Bruce) === null || _a === void 0 ? void 0 : _a.ID) || (e === null || e === void 0 ? void 0 : e.id);
|
|
11179
|
+
if (entityId) {
|
|
11180
|
+
this.lastFoundDateTimes.set(entityId, rTime);
|
|
11181
|
+
}
|
|
11150
11182
|
});
|
|
11151
11183
|
}
|
|
11152
11184
|
else {
|
|
11153
11185
|
// If we're not historic, we can just emit everything.
|
|
11154
|
-
toEmit =
|
|
11186
|
+
toEmit = resolvedEntities;
|
|
11155
11187
|
}
|
|
11156
11188
|
this.emitEntities(toEmit, tags);
|
|
11157
11189
|
};
|
|
@@ -11173,7 +11205,7 @@ class EntityGatherer {
|
|
|
11173
11205
|
api: this.api,
|
|
11174
11206
|
maxSearchTimeSec: 60 * 2
|
|
11175
11207
|
});
|
|
11176
|
-
handleResponse(entities);
|
|
11208
|
+
handleResponse(batch, entities);
|
|
11177
11209
|
requestedIds.push(...batch);
|
|
11178
11210
|
done += batch.length;
|
|
11179
11211
|
if (this._onQueueProgress) {
|
|
@@ -11210,7 +11242,7 @@ class EntityGatherer {
|
|
|
11210
11242
|
api: this.api,
|
|
11211
11243
|
maxSearchTimeSec: 60 * 2
|
|
11212
11244
|
});
|
|
11213
|
-
handleResponse(entities);
|
|
11245
|
+
handleResponse(batch, entities);
|
|
11214
11246
|
requestedIds.push(...batch);
|
|
11215
11247
|
}
|
|
11216
11248
|
}
|
|
@@ -35297,7 +35329,7 @@ class WidgetViewBar extends Widget.AWidget {
|
|
|
35297
35329
|
}
|
|
35298
35330
|
}
|
|
35299
35331
|
|
|
35300
|
-
const VERSION = "6.5.
|
|
35332
|
+
const VERSION = "6.5.2";
|
|
35301
35333
|
/**
|
|
35302
35334
|
* Updates the environment instance used by bruce-cesium to one specified.
|
|
35303
35335
|
* This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
|