bruce-cesium 6.4.2 → 6.4.3

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.
Files changed (31) hide show
  1. package/dist/bruce-cesium.es5.js +191 -56
  2. package/dist/bruce-cesium.es5.js.map +1 -1
  3. package/dist/bruce-cesium.umd.js +189 -54
  4. package/dist/bruce-cesium.umd.js.map +1 -1
  5. package/dist/lib/bruce-cesium.js +1 -1
  6. package/dist/lib/rendering/entity-gatherer.js +4 -2
  7. package/dist/lib/rendering/entity-gatherer.js.map +1 -1
  8. package/dist/lib/rendering/entity-render-engine-model3d.js +44 -13
  9. package/dist/lib/rendering/entity-render-engine-model3d.js.map +1 -1
  10. package/dist/lib/rendering/entity-render-engine-point.js +33 -5
  11. package/dist/lib/rendering/entity-render-engine-point.js.map +1 -1
  12. package/dist/lib/rendering/entity-render-engine-polygon.js +33 -5
  13. package/dist/lib/rendering/entity-render-engine-polygon.js.map +1 -1
  14. package/dist/lib/rendering/entity-render-engine-polyline.js +33 -5
  15. package/dist/lib/rendering/entity-render-engine-polyline.js.map +1 -1
  16. package/dist/lib/rendering/relation-render-engine.js +2 -1
  17. package/dist/lib/rendering/relation-render-engine.js.map +1 -1
  18. package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js +1 -0
  19. package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js.map +1 -1
  20. package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js +3 -1
  21. package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js.map +1 -1
  22. package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +25 -19
  23. package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
  24. package/dist/lib/rendering/render-managers/other/assembly-render-manager.js +4 -1
  25. package/dist/lib/rendering/render-managers/other/assembly-render-manager.js.map +1 -1
  26. package/dist/lib/utils/entity-utils.js +2 -0
  27. package/dist/lib/utils/entity-utils.js.map +1 -1
  28. package/dist/lib/utils/simplify-geometry.js +4 -1
  29. package/dist/lib/utils/simplify-geometry.js.map +1 -1
  30. package/dist/types/bruce-cesium.d.ts +1 -1
  31. package/package.json +2 -2
@@ -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, ProjectViewLegacyTile, Camera, AbstractApi, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils, Session } from 'bruce-models';
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, Carto, ProjectView, ProjectViewBookmark, Bounds, Camera, ProjectViewLegacyTile, 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, DistanceDisplayCondition, HeightReference, ColorBlendMode, HeadingPitchRoll, Math as Math$1, Transforms, ShadowMode, Cartesian3, ClassificationType, Model, PolygonHierarchy, ConstantPositionProperty, PolylineGraphics, ArcType, CornerType, HorizontalOrigin, VerticalOrigin, JulianDate, Quaternion, Matrix4, Cartesian2, SceneTransforms, NearFarScalar, Matrix3, Rectangle, KmlDataSource, GeoJsonDataSource, SceneMode, Cesium3DTileStyle, HeadingPitchRange, Ion, Cesium3DTileColorBlendMode, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, IonResource, OrthographicFrustum, EasingFunction, Cesium3DTileset, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, PolygonPipeline, BoundingSphere, GeometryInstance, CesiumInspector, ClockRange, ScreenSpaceEventHandler, ScreenSpaceEventType, Intersect, CzmlDataSource, Fullscreen } from 'cesium';
3
+ import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, DistanceDisplayCondition, Math as Math$1, Cartesian3, JulianDate, Quaternion, Transforms, HeadingPitchRoll, Matrix4, HeightReference, ColorBlendMode, ShadowMode, ClassificationType, Model, HorizontalOrigin, VerticalOrigin, ConstantPositionProperty, ArcType, CornerType, PolygonHierarchy, PolylineGraphics, Cartesian2, SceneTransforms, NearFarScalar, Matrix3, Rectangle, KmlDataSource, GeoJsonDataSource, SceneMode, Cesium3DTileStyle, HeadingPitchRange, Ion, Cesium3DTileset, IonResource, OrthographicFrustum, EasingFunction, Cesium3DTileColorBlendMode, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, PolygonPipeline, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, BoundingSphere, GeometryInstance, CesiumInspector, ClockRange, ScreenSpaceEventHandler, ScreenSpaceEventType, Intersect, CzmlDataSource, Fullscreen } from 'cesium';
4
4
 
5
5
  /**
6
6
  * Ensures a number is returned from a given value.
@@ -3019,7 +3019,8 @@ var RelationRenderEngine;
3019
3019
  let entities = (await Entity$1.GetListByIds({
3020
3020
  entityIds: neededEntityIdsIds,
3021
3021
  api: apiGetter.getApi(),
3022
- migrated: true
3022
+ migrated: true,
3023
+ maxSearchTimeSec: 60 * 2
3023
3024
  })).entities;
3024
3025
  // Create a map for quick reference.
3025
3026
  const entitiesMap = {};
@@ -7833,6 +7834,9 @@ class PointClustering {
7833
7834
  }
7834
7835
  }
7835
7836
 
7837
+ function isTurfAvailable() {
7838
+ return window && window.turf != null;
7839
+ }
7836
7840
  /**
7837
7841
  * Util for simplifying geometry on the fly.
7838
7842
  */
@@ -7880,7 +7884,7 @@ var SimplifyGeometry;
7880
7884
  */
7881
7885
  function Simplify(entityId, geometry, tolerance) {
7882
7886
  var _a;
7883
- if (!geometry || !turf || !turf.simplify) {
7887
+ if (!geometry || !isTurfAvailable() || !turf.simplify) {
7884
7888
  return geometry;
7885
7889
  }
7886
7890
  // Convert to geojson so that we can interact with turf.
@@ -8234,7 +8238,7 @@ var EntitiesRenderManager;
8234
8238
  this.item = params.item;
8235
8239
  }
8236
8240
  (async () => {
8237
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
8241
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
8238
8242
  if (this.disposed) {
8239
8243
  return;
8240
8244
  }
@@ -8281,8 +8285,6 @@ var EntitiesRenderManager;
8281
8285
  this.unsetGetter();
8282
8286
  (_g = this.viewMonitorRemoval) === null || _g === void 0 ? void 0 : _g.call(this);
8283
8287
  this.viewMonitorRemoval = null;
8284
- (_h = this.entityCheckQueue) === null || _h === void 0 ? void 0 : _h.Dispose();
8285
- this.entityCheckQueue = null;
8286
8288
  clearInterval(this.renderQueueInterval);
8287
8289
  this.renderQueueInterval = null;
8288
8290
  this.renderQueue = [];
@@ -8293,30 +8295,23 @@ var EntitiesRenderManager;
8293
8295
  menuItemId: this.item.id,
8294
8296
  retainTagIds: tagsToRender
8295
8297
  });
8296
- (_j = this.clustering) === null || _j === void 0 ? void 0 : _j.Dispose();
8298
+ (_h = this.clustering) === null || _h === void 0 ? void 0 : _h.Dispose();
8297
8299
  }
8298
8300
  else {
8299
8301
  this.visualsManager.RemoveRegos({
8300
8302
  menuItemId: this.item.id
8301
8303
  });
8302
- (_k = this.clustering) === null || _k === void 0 ? void 0 : _k.Dispose();
8304
+ (_j = this.clustering) === null || _j === void 0 ? void 0 : _j.Dispose();
8303
8305
  return;
8304
8306
  }
8305
8307
  if (this.item.enableClustering) {
8306
- this.clustering = new PointClustering(this.visualsManager, this.item.id, (_l = this.item) === null || _l === void 0 ? void 0 : _l.clustering);
8308
+ this.clustering = new PointClustering(this.visualsManager, this.item.id, (_k = this.item) === null || _k === void 0 ? void 0 : _k.clustering);
8307
8309
  }
8308
8310
  this.setGetter();
8309
8311
  this.viewMonitorRemoval = this.monitor.Updated().Subscribe(() => {
8310
- this.entityCheckQueue.Call();
8312
+ var _a;
8313
+ (_a = this.entityCheckQueue) === null || _a === void 0 ? void 0 : _a.Call();
8311
8314
  });
8312
- this.entityCheckQueue = new DelayQueue(() => {
8313
- // Don't bother checking for zoom control changes if we only have 1 item.
8314
- // We'll let Cesium handle hide/show at max zoom range.
8315
- const shouldCheck = this.zoomControl && this.zoomControl.length > 1;
8316
- if (shouldCheck) {
8317
- this.doEntityCheck(Object.keys(this.renderedEntities));
8318
- }
8319
- }, 3000);
8320
8315
  }
8321
8316
  catch (e) {
8322
8317
  console.error(e);
@@ -8368,7 +8363,7 @@ var EntitiesRenderManager;
8368
8363
  }
8369
8364
  }
8370
8365
  setGetter() {
8371
- var _a, _b, _c;
8366
+ var _a, _b, _c, _d;
8372
8367
  this.unsetGetter();
8373
8368
  const isTagItem = Boolean(this.item.BruceEntity.ExpandLayers);
8374
8369
  let tagsToRender = isTagItem ? this.item.BruceEntity.SelectedExpandLayers : null;
@@ -8419,13 +8414,22 @@ var EntitiesRenderManager;
8419
8414
  this.distributeForRender(data.entities);
8420
8415
  }
8421
8416
  });
8417
+ // Cesium itself handles single-visibility ranges very well.
8418
+ // That means we only occasionally check if there is 1 display item for the purpose of cleaning up the registry.
8419
+ const displayItems = this.zoomControl ? (_d = this.zoomControl) === null || _d === void 0 ? void 0 : _d.filter(x => x.DisplayType != ZoomControl.EDisplayType.Hidden) : [];
8420
+ const shouldCheck = displayItems.length > 1;
8421
+ this.entityCheckQueue = new DelayQueue(() => {
8422
+ this.doEntityCheck(Object.keys(this.renderedEntities));
8423
+ }, shouldCheck ? 3000 : 30000);
8422
8424
  }
8423
8425
  unsetGetter() {
8424
- var _a, _b;
8426
+ var _a, _b, _c;
8425
8427
  (_a = this.getter) === null || _a === void 0 ? void 0 : _a.ExcludeMenuItem(this.item.id);
8426
8428
  this.getter = null;
8427
8429
  (_b = this.getterSub) === null || _b === void 0 ? void 0 : _b.call(this);
8428
8430
  this.getterSub = null;
8431
+ (_c = this.entityCheckQueue) === null || _c === void 0 ? void 0 : _c.Dispose();
8432
+ this.entityCheckQueue = null;
8429
8433
  }
8430
8434
  Dispose() {
8431
8435
  if (this.disposed) {
@@ -8481,7 +8485,10 @@ var EntitiesRenderManager;
8481
8485
  historicKey: (_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.historicAttrKey,
8482
8486
  historicPoint: this.viewer.clock.currentTime.toString(),
8483
8487
  schemaId: (_b = this.item.BruceEntity) === null || _b === void 0 ? void 0 : _b.schemaId,
8484
- migrated: true
8488
+ expandSources: true,
8489
+ scenario: this.scenario,
8490
+ migrated: true,
8491
+ maxSearchTimeSec: 60 * 2
8485
8492
  });
8486
8493
  this.renderEntities(data.entities, true);
8487
8494
  }
@@ -8556,7 +8563,10 @@ var EntitiesRenderManager;
8556
8563
  historicKey: (_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.historicAttrKey,
8557
8564
  historicPoint: this.viewer.clock.currentTime.toString(),
8558
8565
  schemaId: (_b = this.item.BruceEntity) === null || _b === void 0 ? void 0 : _b.schemaId,
8559
- migrated: true
8566
+ scenario: this.scenario,
8567
+ expandSources: true,
8568
+ migrated: true,
8569
+ maxSearchTimeSec: 60 * 2
8560
8570
  });
8561
8571
  if (this.disposed) {
8562
8572
  return;
@@ -9448,7 +9458,9 @@ var EntitiesLoadedRenderManager;
9448
9458
  const { entities } = await Entity$1.GetListByIds({
9449
9459
  api,
9450
9460
  entityIds,
9451
- migrated: true
9461
+ expandSources: true,
9462
+ migrated: true,
9463
+ maxSearchTimeSec: 60 * 2
9452
9464
  });
9453
9465
  if (this.disposed) {
9454
9466
  return;
@@ -10068,6 +10080,7 @@ var EntitiesIdsRenderManager;
10068
10080
  entityIds,
10069
10081
  historicPoint: newDateTime,
10070
10082
  historicKey: this.item.BruceEntity.historicAttrKey,
10083
+ expandSources: true,
10071
10084
  migrated: true,
10072
10085
  // If we're taking 5+ minutes to make a query, it's a dud.
10073
10086
  // This is a timeout imposed on our DB and not external sources.
@@ -10868,7 +10881,8 @@ class EntityGatherer {
10868
10881
  entityIds: batch,
10869
10882
  historicPoint: this.historic ? rTime : null,
10870
10883
  expandSources: this.expandSources,
10871
- api: this.api
10884
+ api: this.api,
10885
+ maxSearchTimeSec: 60 * 2
10872
10886
  });
10873
10887
  handleResponse(entities);
10874
10888
  requestedIds.push(...batch);
@@ -10904,7 +10918,8 @@ class EntityGatherer {
10904
10918
  entityIds: batch,
10905
10919
  historicPoint: this.historic ? rTime : null,
10906
10920
  expandSources: this.expandSources,
10907
- api: this.api
10921
+ api: this.api,
10922
+ maxSearchTimeSec: 60 * 2
10908
10923
  });
10909
10924
  handleResponse(entities);
10910
10925
  requestedIds.push(...batch);
@@ -18558,7 +18573,10 @@ var AssemblyRenderManager;
18558
18573
  entityIds: batch,
18559
18574
  api: this.getters.GetBruceApi(),
18560
18575
  expandLODs: true,
18561
- expandLocation: true
18576
+ expandLocation: true,
18577
+ expandSources: true,
18578
+ migrated: true,
18579
+ maxSearchTimeSec: 60 * 2
18562
18580
  });
18563
18581
  if (this.disposed) {
18564
18582
  return;
@@ -29148,7 +29166,9 @@ var EntityUtils;
29148
29166
  entityIds: toSearchIds,
29149
29167
  historicPoint: latestDate,
29150
29168
  expandLocation: true,
29169
+ expandSources: true,
29151
29170
  migrated: true,
29171
+ maxSearchTimeSec: 60 * 2,
29152
29172
  api
29153
29173
  });
29154
29174
  const entitiesMap = new Map();
@@ -30905,17 +30925,45 @@ var EntityRenderEnginePoint;
30905
30925
  var _a, _b, _c, _d, _e;
30906
30926
  const api = params.apiGetter.getApi();
30907
30927
  const cEntities = new Map();
30928
+ // Gathering tags in case styling needs it.
30929
+ // TODO: analyze styles before requesting tags.
30930
+ const tagMap = new Map();
30931
+ {
30932
+ // Gather all tags from the Entities to minimize number of requests.
30933
+ let tagIds = [];
30934
+ for (let i = 0; i < params.entities.length; i++) {
30935
+ const entity = params.entities[i];
30936
+ const entityTagIds = entity.Bruce["Layer.ID"];
30937
+ if (entityTagIds && entityTagIds.length > 0) {
30938
+ tagIds = tagIds.concat(entityTagIds);
30939
+ }
30940
+ }
30941
+ // De-dupe the tag IDs.
30942
+ tagIds = Array.from(new Set(tagIds));
30943
+ // Request if at least one then create a quick lookup map for tags.
30944
+ const tags = tagIds.length > 0 ? (await EntityTag.GetListByIds({
30945
+ api,
30946
+ tagIds
30947
+ })).tags : [];
30948
+ for (let i = 0; i < tags.length; i++) {
30949
+ const tag = tags[i];
30950
+ tagMap.set(tag.ID, tag);
30951
+ }
30952
+ }
30908
30953
  for (let i = 0; i < params.entities.length; i++) {
30909
30954
  const entity = params.entities[i];
30910
30955
  const zoomItem = params.zoomItems[entity.Bruce.ID];
30911
30956
  const style = zoomItem.StyleID != -1 ? (_a = (await getStyle$1(api, entity, zoomItem.StyleID))) === null || _a === void 0 ? void 0 : _a.Settings : zoomItem.Style;
30957
+ // Pass through tags that may be needed for styling.
30912
30958
  const tagIds = entity.Bruce["Layer.ID"];
30913
- let tags = [];
30959
+ const tags = [];
30914
30960
  if (tagIds && tagIds.length > 0) {
30915
- tags = (await EntityTag.GetListByIds({
30916
- api,
30917
- tagIds
30918
- })).tags;
30961
+ for (let j = 0; j < tagIds.length; j++) {
30962
+ const tag = tagMap.get(tagIds[j]);
30963
+ if (tag) {
30964
+ tags.push(tag);
30965
+ }
30966
+ }
30919
30967
  }
30920
30968
  const pStyle = (_b = style === null || style === void 0 ? void 0 : style.pointStyle) !== null && _b !== void 0 ? _b : {};
30921
30969
  let rego = null;
@@ -31726,17 +31774,45 @@ var EntityRenderEngineModel3d;
31726
31774
  "externalSources": false,
31727
31775
  "Items": []
31728
31776
  };
31777
+ // Gathering tags in case styling needs it.
31778
+ // TODO: analyze styles before requesting tags.
31779
+ const tagMap = new Map();
31780
+ {
31781
+ // Gather all tags from the Entities to minimize number of requests.
31782
+ let tagIds = [];
31783
+ for (let i = 0; i < params.entities.length; i++) {
31784
+ const entity = params.entities[i];
31785
+ const entityTagIds = entity.Bruce["Layer.ID"];
31786
+ if (entityTagIds && entityTagIds.length > 0) {
31787
+ tagIds = tagIds.concat(entityTagIds);
31788
+ }
31789
+ }
31790
+ // De-dupe the tag IDs.
31791
+ tagIds = Array.from(new Set(tagIds));
31792
+ // Request if at least one then create a quick lookup map for tags.
31793
+ const tags = tagIds.length > 0 ? (await EntityTag.GetListByIds({
31794
+ api,
31795
+ tagIds
31796
+ })).tags : [];
31797
+ for (let i = 0; i < tags.length; i++) {
31798
+ const tag = tags[i];
31799
+ tagMap.set(tag.ID, tag);
31800
+ }
31801
+ }
31729
31802
  for (let i = 0; i < params.entities.length; i++) {
31730
31803
  const entity = params.entities[i];
31731
31804
  const zoomItem = params.zoomItems[entity.Bruce.ID];
31732
31805
  const style = zoomItem.StyleID != -1 ? (_a = (await getStyle$2(api, entity, zoomItem.StyleID))) === null || _a === void 0 ? void 0 : _a.Settings : zoomItem.Style;
31806
+ // Pass through tags that may be needed for styling.
31733
31807
  const tagIds = entity.Bruce["Layer.ID"];
31734
- let tags = [];
31808
+ const tags = [];
31735
31809
  if (tagIds && tagIds.length > 0) {
31736
- tags = (await EntityTag.GetListByIds({
31737
- api,
31738
- tagIds
31739
- })).tags;
31810
+ for (let j = 0; j < tagIds.length; j++) {
31811
+ const tag = tagMap.get(tagIds[j]);
31812
+ if (tag) {
31813
+ tags.push(tag);
31814
+ }
31815
+ }
31740
31816
  }
31741
31817
  const mStyle = (_b = style === null || style === void 0 ? void 0 : style.modelStyle) !== null && _b !== void 0 ? _b : {};
31742
31818
  let group = mStyle.lodGroup ? Calculator.GetString(mStyle.lodGroup, entity, tags) : null;
@@ -31766,18 +31842,21 @@ var EntityRenderEngineModel3d;
31766
31842
  const entity = params.entities[i];
31767
31843
  const zoomItem = params.zoomItems[entity.Bruce.ID];
31768
31844
  const style = zoomItem.StyleID != -1 ? (_c = (await getStyle$2(api, entity, zoomItem.StyleID))) === null || _c === void 0 ? void 0 : _c.Settings : zoomItem.Style;
31769
- const tagIds = entity.Bruce["Layer.ID"];
31770
- let tags = [];
31771
- if (tagIds && tagIds.length > 0) {
31772
- tags = (await EntityTag.GetListByIds({
31773
- api,
31774
- tagIds
31775
- })).tags;
31776
- }
31777
31845
  const lod = lodData.find(x => x.entityId == entity.Bruce.ID);
31778
31846
  if (!(lod === null || lod === void 0 ? void 0 : lod.clientFileId)) {
31779
31847
  continue;
31780
31848
  }
31849
+ // Pass through tags that may be needed for styling.
31850
+ const tagIds = entity.Bruce["Layer.ID"];
31851
+ const tags = [];
31852
+ if (tagIds && tagIds.length > 0) {
31853
+ for (let j = 0; j < tagIds.length; j++) {
31854
+ const tag = tagMap.get(tagIds[j]);
31855
+ if (tag) {
31856
+ tags.push(tag);
31857
+ }
31858
+ }
31859
+ }
31781
31860
  let rego = null;
31782
31861
  // Only used for historic tracks right now.
31783
31862
  // So won't bother getting it if we don't have historic data.
@@ -32208,17 +32287,45 @@ var EntityRenderEnginePolyline;
32208
32287
  var _a, _b, _c;
32209
32288
  const api = params.apiGetter.getApi();
32210
32289
  const cEntities = new Map();
32290
+ // Gathering tags in case styling needs it.
32291
+ // TODO: analyze styles before requesting tags.
32292
+ const tagMap = new Map();
32293
+ {
32294
+ // Gather all tags from the Entities to minimize number of requests.
32295
+ let tagIds = [];
32296
+ for (let i = 0; i < params.entities.length; i++) {
32297
+ const entity = params.entities[i];
32298
+ const entityTagIds = entity.Bruce["Layer.ID"];
32299
+ if (entityTagIds && entityTagIds.length > 0) {
32300
+ tagIds = tagIds.concat(entityTagIds);
32301
+ }
32302
+ }
32303
+ // De-dupe the tag IDs.
32304
+ tagIds = Array.from(new Set(tagIds));
32305
+ // Request if at least one then create a quick lookup map for tags.
32306
+ const tags = tagIds.length > 0 ? (await EntityTag.GetListByIds({
32307
+ api,
32308
+ tagIds
32309
+ })).tags : [];
32310
+ for (let i = 0; i < tags.length; i++) {
32311
+ const tag = tags[i];
32312
+ tagMap.set(tag.ID, tag);
32313
+ }
32314
+ }
32211
32315
  for (let i = 0; i < params.entities.length; i++) {
32212
32316
  const entity = params.entities[i];
32213
32317
  const zoomItem = params.zoomItems[entity.Bruce.ID];
32214
32318
  const style = zoomItem.StyleID != -1 ? (_a = (await getStyle$3(api, entity, zoomItem.StyleID))) === null || _a === void 0 ? void 0 : _a.Settings : zoomItem.Style;
32319
+ // Pass through tags that may be needed for styling.
32215
32320
  const tagIds = entity.Bruce["Layer.ID"];
32216
- let tags = [];
32321
+ const tags = [];
32217
32322
  if (tagIds && tagIds.length > 0) {
32218
- tags = (await EntityTag.GetListByIds({
32219
- api,
32220
- tagIds
32221
- })).tags;
32323
+ for (let j = 0; j < tagIds.length; j++) {
32324
+ const tag = tagMap.get(tagIds[j]);
32325
+ if (tag) {
32326
+ tags.push(tag);
32327
+ }
32328
+ }
32222
32329
  }
32223
32330
  const lStyle = (_b = style === null || style === void 0 ? void 0 : style.polylineStyle) !== null && _b !== void 0 ? _b : {};
32224
32331
  const cEntity = Render({
@@ -32674,17 +32781,45 @@ var EntityRenderEnginePolygon;
32674
32781
  var _a, _b, _c;
32675
32782
  const api = params.apiGetter.getApi();
32676
32783
  const cEntities = new Map();
32784
+ // Gathering tags in case styling needs it.
32785
+ // TODO: analyze styles before requesting tags.
32786
+ const tagMap = new Map();
32787
+ {
32788
+ // Gather all tags from the Entities to minimize number of requests.
32789
+ let tagIds = [];
32790
+ for (let i = 0; i < params.entities.length; i++) {
32791
+ const entity = params.entities[i];
32792
+ const entityTagIds = entity.Bruce["Layer.ID"];
32793
+ if (entityTagIds && entityTagIds.length > 0) {
32794
+ tagIds = tagIds.concat(entityTagIds);
32795
+ }
32796
+ }
32797
+ // De-dupe the tag IDs.
32798
+ tagIds = Array.from(new Set(tagIds));
32799
+ // Request if at least one then create a quick lookup map for tags.
32800
+ const tags = tagIds.length > 0 ? (await EntityTag.GetListByIds({
32801
+ api,
32802
+ tagIds
32803
+ })).tags : [];
32804
+ for (let i = 0; i < tags.length; i++) {
32805
+ const tag = tags[i];
32806
+ tagMap.set(tag.ID, tag);
32807
+ }
32808
+ }
32677
32809
  for (let i = 0; i < params.entities.length; i++) {
32678
32810
  const entity = params.entities[i];
32679
32811
  const zoomItem = params.zoomItems[entity.Bruce.ID];
32680
32812
  const style = zoomItem.StyleID != -1 ? (_a = (await getStyle$4(api, entity, zoomItem.StyleID))) === null || _a === void 0 ? void 0 : _a.Settings : zoomItem.Style;
32813
+ // Pass through tags that may be needed for styling.
32681
32814
  const tagIds = entity.Bruce["Layer.ID"];
32682
- let tags = [];
32815
+ const tags = [];
32683
32816
  if (tagIds && tagIds.length > 0) {
32684
- tags = (await EntityTag.GetListByIds({
32685
- api,
32686
- tagIds
32687
- })).tags;
32817
+ for (let j = 0; j < tagIds.length; j++) {
32818
+ const tag = tagMap.get(tagIds[j]);
32819
+ if (tag) {
32820
+ tags.push(tag);
32821
+ }
32822
+ }
32688
32823
  }
32689
32824
  const pStyle = (_b = style === null || style === void 0 ? void 0 : style.polygonStyle) !== null && _b !== void 0 ? _b : {};
32690
32825
  const cEntity = Render({
@@ -34815,7 +34950,7 @@ class WidgetViewBar extends Widget.AWidget {
34815
34950
  }
34816
34951
  }
34817
34952
 
34818
- const VERSION = "6.4.2";
34953
+ const VERSION = "6.4.3";
34819
34954
  /**
34820
34955
  * Updates the environment instance used by bruce-cesium to one specified.
34821
34956
  * This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.