bruce-cesium 1.2.8 → 1.3.0

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.
@@ -1,5 +1,5 @@
1
- import { BruceEvent, Cartes, Carto, Geometry, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, DelayQueue, Entity as Entity$1, BatchedDataGetter, EntityRelationType, ObjectUtils, Tileset, EntityCoords, EntityFilterGetter, EntitySource, EntityRelation, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewTile, ProjectViewLegacyTile, ProgramKey, Camera } from 'bruce-models';
2
- import { Cartesian2, Cartographic, Math as Math$1, Cartesian3, Entity, Primitive, Cesium3DTileFeature, Color, Cesium3DTileColorBlendMode, HeadingPitchRange, HeightReference, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, createOsmBuildings, Cesium3DTileStyle, Rectangle, KmlDataSource, OrthographicFrustum, JulianDate, createWorldTerrain, EllipsoidTerrainProvider, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, CallbackProperty, Matrix4, Cesium3DTileset, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, ColorMaterialProperty, Matrix3, EasingFunction, GeometryInstance } from 'cesium';
1
+ import { BruceEvent, Cartes, Carto, Geometry, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, DelayQueue, Entity as Entity$1, BatchedDataGetter, EntityRelationType, Tileset, EntityCoords, EntityFilterGetter, EntitySource, EntityRelation, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewTile, ProjectViewLegacyTile, ProgramKey, Camera } from 'bruce-models';
2
+ import { Cartesian3, Color, HeightReference, Cartographic, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Math as Math$1, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, Cartesian2, Cesium3DTileColorBlendMode, HeadingPitchRange, createOsmBuildings, Cesium3DTileStyle, Rectangle, KmlDataSource, CallbackProperty, OrthographicFrustum, JulianDate, EllipsoidGeodesic, EllipsoidTerrainProvider, sampleTerrainMostDetailed, PolygonPipeline, Matrix4, Cesium3DTileset, IonResource, ColorMaterialProperty, Matrix3, EasingFunction, GeometryInstance, createWorldTerrain, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider } from 'cesium';
3
3
 
4
4
  var TIME_LAG = 300;
5
5
  var POSITION_CHECK_TIMER = 950;
@@ -1032,7 +1032,7 @@ function getPolygonStyleExtrusion(pStyle, entity, tags, heightRef) {
1032
1032
  return null;
1033
1033
  }
1034
1034
  try {
1035
- var extrusion = +Calculator.GetValue(attrPath, entity, tags);
1035
+ var extrusion = +Calculator.GetNumber(attrPath, entity, tags);
1036
1036
  if (!extrusion && extrusion != 0) {
1037
1037
  return null;
1038
1038
  }
@@ -1072,6 +1072,7 @@ function getPolygonExtrusion(entity, tags, ring, posses, heightRef, pStyle) {
1072
1072
  });
1073
1073
  posses = points.map(function (x) { return Cartesian3.fromRadians(EnsureNumber(x.longitude), EnsureNumber(x.latitude), EnsureNumber(x.height)); });
1074
1074
  }
1075
+ data.value = extrusion;
1075
1076
  }
1076
1077
  // Step 2. Try get using geometry data.
1077
1078
  else {
@@ -1114,12 +1115,19 @@ function getHeightRef(style) {
1114
1115
  return heightRef;
1115
1116
  }
1116
1117
  function getZIndex(style, entity, tags) {
1117
- var zIndex = (style === null || style === void 0 ? void 0 : style.zIndex) ? +Calculator.GetValue(style === null || style === void 0 ? void 0 : style.zIndex, entity, tags) : 0;
1118
+ var zIndex = (style === null || style === void 0 ? void 0 : style.zIndex) ? +Calculator.GetNumber(style === null || style === void 0 ? void 0 : style.zIndex, entity, tags) : 0;
1118
1119
  if (zIndex == null) {
1119
1120
  zIndex = 0;
1120
1121
  }
1121
1122
  return EnsureNumber(zIndex);
1122
1123
  }
1124
+ function getValue(viewer, obj) {
1125
+ var _a;
1126
+ if ((_a = obj) === null || _a === void 0 ? void 0 : _a.getValue) {
1127
+ return obj.getValue(viewer.scene.lastRenderTime);
1128
+ }
1129
+ return obj;
1130
+ }
1123
1131
  function getStyle(api, entity, styleId) {
1124
1132
  return __awaiter(this, void 0, void 0, function () {
1125
1133
  var style, type;
@@ -1165,11 +1173,11 @@ function getRenderGroupId(zoomItem) {
1165
1173
  var EntityRenderEngine;
1166
1174
  (function (EntityRenderEngine) {
1167
1175
  function Render(params) {
1168
- var _a, _b;
1176
+ var _a, _b, _c, _d;
1169
1177
  return __awaiter(this, void 0, void 0, function () {
1170
- var groupRenderParams, i, entity, geometry, cEntities, models, polygons, polylines, points, i, entity, id, zoomItem, displayType, newRenderId, existingRego, oldRenderId, mParams, mEntities, i, entity, id, cEntity, pParams, pEntities, i, entity, cEntity, pParams, pEntities, i, entity, cEntity, pParams, pEntities, i, entity, cEntity;
1171
- return __generator(this, function (_c) {
1172
- switch (_c.label) {
1178
+ var groupRenderParams, i, entity, geometry, cEntities, models, multiGeometry, polygons, polylines, points, i, entity, id, zoomItem, displayType, newRenderId, existingRego, 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;
1179
+ return __generator(this, function (_e) {
1180
+ switch (_e.label) {
1173
1181
  case 0:
1174
1182
  groupRenderParams = {
1175
1183
  apiGetter: params.apiGetter,
@@ -1184,11 +1192,12 @@ var EntityRenderEngine;
1184
1192
  entity = params.entities[i];
1185
1193
  geometry = entity.geometry;
1186
1194
  if (((_a = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _a === void 0 ? void 0 : _a.length) == 1) {
1187
- entity.geometry = __assign(__assign({}, entity.geometry), geometry.MultiGeometry[0]);
1195
+ entity.geometry = __assign(__assign(__assign({}, entity.geometry), geometry.MultiGeometry[0]), { MultiGeometry: [] });
1188
1196
  }
1189
1197
  }
1190
1198
  cEntities = {};
1191
1199
  models = [];
1200
+ multiGeometry = [];
1192
1201
  polygons = [];
1193
1202
  polylines = [];
1194
1203
  points = [];
@@ -1224,7 +1233,12 @@ var EntityRenderEngine;
1224
1233
  models.push(entity);
1225
1234
  }
1226
1235
  else if (displayType == ZoomControl.EDisplayType.Geometry) {
1227
- polygons.push(entity);
1236
+ if ((_d = (_c = entity.geometry) === null || _c === void 0 ? void 0 : _c.MultiGeometry) === null || _d === void 0 ? void 0 : _d.length) {
1237
+ multiGeometry.push(entity);
1238
+ }
1239
+ else {
1240
+ polygons.push(entity);
1241
+ }
1228
1242
  }
1229
1243
  else {
1230
1244
  points.push(entity);
@@ -1237,7 +1251,7 @@ var EntityRenderEngine;
1237
1251
  mParams = __assign(__assign({}, groupRenderParams), { entities: models });
1238
1252
  return [4 /*yield*/, Model3d.RenderGroup(mParams)];
1239
1253
  case 1:
1240
- mEntities = _c.sent();
1254
+ mEntities = _e.sent();
1241
1255
  for (i = 0; i < mParams.entities.length; i++) {
1242
1256
  entity = mParams.entities[i];
1243
1257
  id = entity.Bruce.ID;
@@ -1246,16 +1260,84 @@ var EntityRenderEngine;
1246
1260
  cEntities[id] = cEntity;
1247
1261
  }
1248
1262
  else {
1249
- polygons.push(entity);
1263
+ multiGeometry.push(entity);
1250
1264
  }
1251
1265
  }
1252
- _c.label = 2;
1266
+ _e.label = 2;
1253
1267
  case 2:
1254
- if (!(polygons.length > 0)) return [3 /*break*/, 4];
1268
+ if (!(multiGeometry.length > 0)) return [3 /*break*/, 6];
1269
+ _loop_1 = function (i) {
1270
+ var entity, pParams, zoomItem, j, subEntity, cPoly, rendered, cLines, cPoints, rootEntity, firstEntity;
1271
+ return __generator(this, function (_a) {
1272
+ switch (_a.label) {
1273
+ case 0:
1274
+ entity = multiGeometry[i];
1275
+ pParams = __assign(__assign({}, groupRenderParams), { entities: [] });
1276
+ zoomItem = pParams.zoomItems[entity.Bruce.ID];
1277
+ for (j = 0; j < entity.geometry.MultiGeometry.length; j++) {
1278
+ subEntity = __assign(__assign({}, entity), { geometry: entity.geometry.MultiGeometry[j], Bruce: __assign(__assign({}, entity.Bruce), { ID: ObjectUtils.UId() }) });
1279
+ pParams.zoomItems[subEntity.Bruce.ID] = zoomItem;
1280
+ pParams.entities.push(subEntity);
1281
+ }
1282
+ return [4 /*yield*/, Polygon.RenderGroup(pParams)];
1283
+ case 1:
1284
+ cPoly = _a.sent();
1285
+ Object.keys(cPoly).forEach(function (key) {
1286
+ if (cPoly[key]) {
1287
+ pParams.entities = pParams.entities.filter(function (e) { return e.Bruce.ID != key; });
1288
+ }
1289
+ });
1290
+ rendered = Object.values(cPoly);
1291
+ return [4 /*yield*/, Polyline.RenderGroup(pParams)];
1292
+ case 2:
1293
+ cLines = _a.sent();
1294
+ Object.keys(cLines).forEach(function (key) {
1295
+ if (cLines[key]) {
1296
+ pParams.entities = pParams.entities.filter(function (e) { return e.Bruce.ID != key; });
1297
+ }
1298
+ });
1299
+ rendered = rendered.concat(Object.values(cLines));
1300
+ return [4 /*yield*/, Point.RenderGroup(pParams)];
1301
+ case 3:
1302
+ cPoints = _a.sent();
1303
+ rendered = rendered.concat(Object.values(cPoints));
1304
+ rendered = rendered.filter(function (x) { return x != null; });
1305
+ if (rendered.length) {
1306
+ rootEntity = new Entity({});
1307
+ params.viewer.entities.add(rootEntity);
1308
+ rootEntity._siblingGraphics = [];
1309
+ rootEntity._renderGroup = getRenderGroupId(zoomItem);
1310
+ rootEntity._siblingGraphics = rootEntity._siblingGraphics.concat(rendered);
1311
+ cEntities[entity.Bruce.ID] = rootEntity;
1312
+ firstEntity = rendered[0];
1313
+ if (firstEntity) {
1314
+ rootEntity.position = getValue(params.viewer, firstEntity.position.getValue);
1315
+ }
1316
+ }
1317
+ else {
1318
+ polygons.push(entity);
1319
+ }
1320
+ return [2 /*return*/];
1321
+ }
1322
+ });
1323
+ };
1324
+ i = 0;
1325
+ _e.label = 3;
1326
+ case 3:
1327
+ if (!(i < multiGeometry.length)) return [3 /*break*/, 6];
1328
+ return [5 /*yield**/, _loop_1(i)];
1329
+ case 4:
1330
+ _e.sent();
1331
+ _e.label = 5;
1332
+ case 5:
1333
+ i++;
1334
+ return [3 /*break*/, 3];
1335
+ case 6:
1336
+ if (!(polygons.length > 0)) return [3 /*break*/, 8];
1255
1337
  pParams = __assign(__assign({}, groupRenderParams), { entities: polygons });
1256
1338
  return [4 /*yield*/, Polygon.RenderGroup(pParams)];
1257
- case 3:
1258
- pEntities = _c.sent();
1339
+ case 7:
1340
+ pEntities = _e.sent();
1259
1341
  for (i = 0; i < pParams.entities.length; i++) {
1260
1342
  entity = pParams.entities[i];
1261
1343
  cEntity = pEntities[entity.Bruce.ID];
@@ -1266,13 +1348,13 @@ var EntityRenderEngine;
1266
1348
  polylines.push(entity);
1267
1349
  }
1268
1350
  }
1269
- _c.label = 4;
1270
- case 4:
1271
- if (!(polylines.length > 0)) return [3 /*break*/, 6];
1351
+ _e.label = 8;
1352
+ case 8:
1353
+ if (!(polylines.length > 0)) return [3 /*break*/, 10];
1272
1354
  pParams = __assign(__assign({}, groupRenderParams), { entities: polylines });
1273
1355
  return [4 /*yield*/, Polyline.RenderGroup(pParams)];
1274
- case 5:
1275
- pEntities = _c.sent();
1356
+ case 9:
1357
+ pEntities = _e.sent();
1276
1358
  for (i = 0; i < pParams.entities.length; i++) {
1277
1359
  entity = pParams.entities[i];
1278
1360
  cEntity = pEntities[entity.Bruce.ID];
@@ -1283,13 +1365,13 @@ var EntityRenderEngine;
1283
1365
  points.push(entity);
1284
1366
  }
1285
1367
  }
1286
- _c.label = 6;
1287
- case 6:
1288
- if (!(points.length > 0)) return [3 /*break*/, 8];
1368
+ _e.label = 10;
1369
+ case 10:
1370
+ if (!(points.length > 0)) return [3 /*break*/, 12];
1289
1371
  pParams = __assign(__assign({}, groupRenderParams), { entities: points });
1290
1372
  return [4 /*yield*/, Point.RenderGroup(pParams)];
1291
- case 7:
1292
- pEntities = _c.sent();
1373
+ case 11:
1374
+ pEntities = _e.sent();
1293
1375
  for (i = 0; i < pParams.entities.length; i++) {
1294
1376
  entity = pParams.entities[i];
1295
1377
  cEntity = pEntities[entity.Bruce.ID];
@@ -1297,8 +1379,8 @@ var EntityRenderEngine;
1297
1379
  cEntities[entity.Bruce.ID] = cEntity;
1298
1380
  }
1299
1381
  }
1300
- _c.label = 8;
1301
- case 8: return [2 /*return*/, cEntities];
1382
+ _e.label = 12;
1383
+ case 12: return [2 /*return*/, cEntities];
1302
1384
  }
1303
1385
  });
1304
1386
  });
@@ -1359,7 +1441,7 @@ var EntityRenderEngine;
1359
1441
  row.type = Calculator.EValueType.Input;
1360
1442
  }
1361
1443
  });
1362
- var icon = Calculator.GetValue(iconUrlRows, entity, params.tags);
1444
+ var icon = Calculator.GetString(iconUrlRows, entity, params.tags);
1363
1445
  var iconUrl = null;
1364
1446
  if (typeof icon == "string") {
1365
1447
  iconUrl = icon;
@@ -1371,7 +1453,7 @@ var EntityRenderEngine;
1371
1453
  });
1372
1454
  }
1373
1455
  if (iconUrl) {
1374
- var iconScale = EnsureNumber(Calculator.GetValue(style.iconScale, entity, params.tags));
1456
+ var iconScale = EnsureNumber(Calculator.GetNumber(style.iconScale, entity, params.tags));
1375
1457
  if (!iconScale && iconScale != 0) {
1376
1458
  iconScale = 1;
1377
1459
  }
@@ -1397,7 +1479,7 @@ var EntityRenderEngine;
1397
1479
  if (!cEntity) {
1398
1480
  var bColor = style.color ? Calculator.GetColor(style.color, entity, params.tags) : null;
1399
1481
  var cColor = bColor ? colorToCColor(bColor) : Color.RED;
1400
- var size = style.size ? Calculator.GetValue(style.size, entity, params.tags) : null;
1482
+ var size = style.size ? Calculator.GetNumber(style.size, entity, params.tags) : null;
1401
1483
  if (size == null) {
1402
1484
  size = 30;
1403
1485
  }
@@ -1513,7 +1595,7 @@ var EntityRenderEngine;
1513
1595
  var style = params.style;
1514
1596
  var bColor = style.lineColor ? Calculator.GetColor(style.lineColor, entity, params.tags) : null;
1515
1597
  var cColor = bColor ? colorToCColor(bColor) : Color.RED;
1516
- var width = style.lineWidth ? Calculator.GetValue(style.lineWidth, entity, params.tags) : null;
1598
+ var width = style.lineWidth ? Calculator.GetNumber(style.lineWidth, entity, params.tags) : null;
1517
1599
  if (width == null) {
1518
1600
  width = 4;
1519
1601
  }
@@ -1607,7 +1689,7 @@ var EntityRenderEngine;
1607
1689
  var cFillColor = bFillColor ? colorToCColor(bFillColor) : Color.RED;
1608
1690
  var bLineColor = Calculator.GetColor(style.lineColor, entity, params.tags);
1609
1691
  var cLineColor = bLineColor ? colorToCColor(bLineColor) : Color.RED;
1610
- var width = style.lineWidth ? Calculator.GetValue(style.lineWidth, entity, params.tags) : null;
1692
+ var width = style.lineWidth ? Calculator.GetNumber(style.lineWidth, entity, params.tags) : null;
1611
1693
  if (width == null) {
1612
1694
  width = 4;
1613
1695
  }
@@ -1621,6 +1703,7 @@ var EntityRenderEngine;
1621
1703
  var posses = points.map(function (x) { return Cartesian3.fromDegrees(EnsureNumber(x.longitude), EnsureNumber(x.latitude), EnsureNumber(x.altitude)); });
1622
1704
  var extrusion = getPolygonExtrusion(entity, params.tags, outerRing, posses, heightRef, style);
1623
1705
  posses = extrusion.posses;
1706
+ console.log("EXTRUSION", extrusion, style);
1624
1707
  var holeRings = pRings.filter(function (x) { return x.Facing == Geometry.EPolygonRingType.Hole; });
1625
1708
  var holePosses = holeRings.map(function (x) {
1626
1709
  var points = Geometry.ParsePoints(x.LinearRing);
@@ -1733,7 +1816,7 @@ var EntityRenderEngine;
1733
1816
  scale = 1;
1734
1817
  }
1735
1818
  var style = params.style;
1736
- var styleScale = (style === null || style === void 0 ? void 0 : style.scale) ? Calculator.GetValue(style === null || style === void 0 ? void 0 : style.scale, entity, params.tags) : null;
1819
+ var styleScale = (style === null || style === void 0 ? void 0 : style.scale) ? Calculator.GetNumber(style === null || style === void 0 ? void 0 : style.scale, entity, params.tags) : null;
1737
1820
  styleScale = EnsureNumber(styleScale ? styleScale : 1);
1738
1821
  if (styleScale <= 0) {
1739
1822
  styleScale = 1;
@@ -1793,7 +1876,7 @@ var EntityRenderEngine;
1793
1876
  function RenderGroup(params) {
1794
1877
  var _a, _b, _c, _d;
1795
1878
  return __awaiter(this, void 0, void 0, function () {
1796
- var api, cEntities, reqBody, i, entity, zoomItem, style, tagIds, tags, mStyle, group, level, catId, lodData, _loop_1, i;
1879
+ var api, cEntities, reqBody, i, entity, zoomItem, style, tagIds, tags, mStyle, group, level, catId, lodData, _loop_2, i;
1797
1880
  return __generator(this, function (_e) {
1798
1881
  switch (_e.label) {
1799
1882
  case 0:
@@ -1825,7 +1908,7 @@ var EntityRenderEngine;
1825
1908
  _e.label = 4;
1826
1909
  case 4:
1827
1910
  mStyle = (_b = (_a = style === null || style === void 0 ? void 0 : style.Settings) === null || _a === void 0 ? void 0 : _a.polygonStyle) !== null && _b !== void 0 ? _b : {};
1828
- group = mStyle.lodGroup ? Calculator.GetValue(mStyle.lodGroup, entity, tags) : null;
1911
+ group = mStyle.lodGroup ? Calculator.GetString(mStyle.lodGroup, entity, tags) : null;
1829
1912
  if (!group) {
1830
1913
  group = "DEFAULT";
1831
1914
  }
@@ -1853,7 +1936,7 @@ var EntityRenderEngine;
1853
1936
  })];
1854
1937
  case 7:
1855
1938
  lodData = (_e.sent()).lods;
1856
- _loop_1 = function (i) {
1939
+ _loop_2 = function (i) {
1857
1940
  var entity, zoomItem, style, tagIds, tags, lod, mStyle, cEntity;
1858
1941
  return __generator(this, function (_a) {
1859
1942
  switch (_a.label) {
@@ -1902,7 +1985,7 @@ var EntityRenderEngine;
1902
1985
  _e.label = 8;
1903
1986
  case 8:
1904
1987
  if (!(i < params.entities.length)) return [3 /*break*/, 11];
1905
- return [5 /*yield**/, _loop_1(i)];
1988
+ return [5 /*yield**/, _loop_2(i)];
1906
1989
  case 9:
1907
1990
  _e.sent();
1908
1991
  _e.label = 10;
@@ -2827,12 +2910,12 @@ var RelationRenderEngine;
2827
2910
  var entity = params.dataEntity;
2828
2911
  var bColor = (style === null || style === void 0 ? void 0 : style.lineColor) ? Calculator.GetColor(style === null || style === void 0 ? void 0 : style.lineColor, entity, []) : null;
2829
2912
  var cColor = bColor ? colorToCColor$1(bColor) : Color.WHITE;
2830
- var width = EnsureNumber((style === null || style === void 0 ? void 0 : style.lineWidth) ? Calculator.GetValue(style === null || style === void 0 ? void 0 : style.lineWidth, entity, []) : 4, 4);
2913
+ var width = EnsureNumber((style === null || style === void 0 ? void 0 : style.lineWidth) ? Calculator.GetNumber(style === null || style === void 0 ? void 0 : style.lineWidth, entity, []) : 4, 4);
2831
2914
  if (width < 1) {
2832
2915
  width = 1;
2833
2916
  }
2834
- var duration = EnsureNumber((style === null || style === void 0 ? void 0 : style.duration) ? Calculator.GetValue(style === null || style === void 0 ? void 0 : style.duration, entity, []) : 2, 2);
2835
- var hDistanceRatio = EnsureNumber((style === null || style === void 0 ? void 0 : style.heightDistanceRatio) ? Calculator.GetValue(style === null || style === void 0 ? void 0 : style.heightDistanceRatio, entity, []) : 0.25, 0.25);
2917
+ var duration = EnsureNumber((style === null || style === void 0 ? void 0 : style.duration) ? Calculator.GetNumber(style === null || style === void 0 ? void 0 : style.duration, entity, []) : 2, 2);
2918
+ var hDistanceRatio = EnsureNumber((style === null || style === void 0 ? void 0 : style.heightDistanceRatio) ? Calculator.GetNumber(style === null || style === void 0 ? void 0 : style.heightDistanceRatio, entity, []) : 0.25, 0.25);
2836
2919
  var fromPos = null;
2837
2920
  var toPos = null;
2838
2921
  var updatingPosses = false;
@@ -4191,11 +4274,11 @@ var TilesetRenderEngine;
4191
4274
  TilesetRenderEngine.Render = Render;
4192
4275
  function RenderLegacy(params) {
4193
4276
  return __awaiter(this, void 0, void 0, function () {
4194
- var apiGetter, viewer, tileset, ionId, loadUrl, settings, visual, etc, api, cTileset;
4277
+ var apiGetter, viewer, tileset, ionId, loadUrl, viaCdn, settings, visual, etc, api, rootFile, api, rootFile, cTileset;
4195
4278
  return __generator(this, function (_a) {
4196
4279
  switch (_a.label) {
4197
4280
  case 0:
4198
- apiGetter = params.apiGetter, viewer = params.viewer, tileset = params.tileset, ionId = params.ionId, loadUrl = params.loadUrl;
4281
+ apiGetter = params.apiGetter, viewer = params.viewer, tileset = params.tileset, ionId = params.ionId, loadUrl = params.loadUrl, viaCdn = params.viaCdn;
4199
4282
  settings = tileset === null || tileset === void 0 ? void 0 : tileset.Settings;
4200
4283
  settings = __assign({}, settings);
4201
4284
  visual = settings.visual;
@@ -4216,7 +4299,15 @@ var TilesetRenderEngine;
4216
4299
  case 3:
4217
4300
  if (!loadUrl && tileset) {
4218
4301
  api = apiGetter.getApi(apiGetter.accountId);
4219
- loadUrl = api.GetBaseUrl() + ("ui.tileset/" + tileset.ID + "/file/tileset.json");
4302
+ rootFile = tileset.RootFileName ? tileset.RootFileName : "tileset.json";
4303
+ loadUrl = api.GetBaseUrl() + ("ui.tileset/" + tileset.ID + "/file/" + rootFile);
4304
+ }
4305
+ if (viaCdn && (tileset === null || tileset === void 0 ? void 0 : tileset.ID)) {
4306
+ api = apiGetter.getApi(apiGetter.accountId);
4307
+ if (api.LegacyTilesetCdnUrl) {
4308
+ rootFile = tileset.RootFileName ? tileset.RootFileName : "tileset.json";
4309
+ loadUrl = api.LegacyTilesetCdnUrl.replace("<TILESETID>", tileset.ID).replace("<FILEPATH>", rootFile);
4310
+ }
4220
4311
  }
4221
4312
  cTileset = new Cesium3DTileset({
4222
4313
  url: loadUrl
@@ -4957,7 +5048,7 @@ var SharedGetters;
4957
5048
  var cacheKey = createFilterGetterCacheKey(params);
4958
5049
  var getter = this.data[cacheKey];
4959
5050
  if (!getter) {
4960
- getter = new EntityFilterGetter.Getter(params.api, params.monitor, params.typeId, params.batchSize, params.attrFilter);
5051
+ getter = new EntityFilterGetter.Getter(params.api, params.monitor, params.typeId, params.batchSize, params.attrFilter, true);
4961
5052
  this.data[cacheKey] = getter;
4962
5053
  }
4963
5054
  return getter;
@@ -5768,7 +5859,8 @@ var TilesetArbRenderManager;
5768
5859
  tileset: legacyTileset,
5769
5860
  viewer: this.viewer,
5770
5861
  ionId: (_d = this.item.IonResource) === null || _d === void 0 ? void 0 : _d.AssetID,
5771
- loadUrl: loadUrlOverride
5862
+ loadUrl: loadUrlOverride,
5863
+ viaCdn: true
5772
5864
  })];
5773
5865
  case 7:
5774
5866
  _h.cTileset = _j.sent();