bruce-cesium 3.3.7 → 3.3.8
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 +286 -40
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +285 -39
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +251 -24
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/visual-register-culler.js +1 -1
- package/dist/lib/rendering/visual-register-culler.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js +32 -11
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/render-managers/entities/entities-render-manager.d.ts +17 -0
- package/dist/types/rendering/visuals-register.d.ts +4 -0
- package/package.json +2 -2
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -3049,7 +3049,7 @@
|
|
|
3049
3049
|
var rego = register.GetRego({
|
|
3050
3050
|
entityId: entityId
|
|
3051
3051
|
});
|
|
3052
|
-
if (!rego || !rego.visual || !(rego.visual instanceof Cesium.Entity) || rego.relation != null || rego.overrideShow != null) {
|
|
3052
|
+
if (!rego || !rego.visual || !(rego.visual instanceof Cesium.Entity) || rego.relation != null || rego.overrideShow != null || rego.collection) {
|
|
3053
3053
|
continue;
|
|
3054
3054
|
}
|
|
3055
3055
|
var parts = exports.EntityUtils.GatherEntity({
|
|
@@ -6173,8 +6173,14 @@
|
|
|
6173
6173
|
}
|
|
6174
6174
|
}
|
|
6175
6175
|
}
|
|
6176
|
-
|
|
6177
|
-
|
|
6176
|
+
var MAX_SHOW_DEPTH = 10;
|
|
6177
|
+
function updateCEntityShow(viewer, visual, rego, show, ignoreParent, depth) {
|
|
6178
|
+
if (depth === void 0) { depth = 0; }
|
|
6179
|
+
if (depth > MAX_SHOW_DEPTH) {
|
|
6180
|
+
console.warn("updateCEntityShow(): Max show depth reached. EntityId = " + rego.entityId);
|
|
6181
|
+
return;
|
|
6182
|
+
}
|
|
6183
|
+
if (show && !rego.relation && !rego.overrideShow && !rego.collection) {
|
|
6178
6184
|
// Culling is controlled by "visual-register-culler.ts".
|
|
6179
6185
|
// When an object is unculled then the 'updateEntityShow' function is re-called to reveal it and related objects.
|
|
6180
6186
|
// A sub-object can be culled while the siblings are not.
|
|
@@ -6182,31 +6188,42 @@
|
|
|
6182
6188
|
show = !isCulled;
|
|
6183
6189
|
}
|
|
6184
6190
|
if (visual._parentEntity && !ignoreParent) {
|
|
6185
|
-
updateCEntityShow(viewer,
|
|
6191
|
+
updateCEntityShow(viewer, visual._parentEntity, rego, show, false, depth + 1);
|
|
6186
6192
|
}
|
|
6187
6193
|
if (visual._siblingGraphics) {
|
|
6188
6194
|
for (var i = 0; i < visual._siblingGraphics.length; i++) {
|
|
6189
6195
|
var sibling = visual._siblingGraphics[i];
|
|
6190
|
-
updateCEntityShow(viewer,
|
|
6196
|
+
updateCEntityShow(viewer, sibling, rego, show, true, depth + 1);
|
|
6191
6197
|
}
|
|
6192
6198
|
}
|
|
6193
6199
|
/**
|
|
6194
6200
|
* Do NOT use ".show" as it causes crashes in Cesium polylines that are clamped to ground.
|
|
6195
6201
|
* We could target them specifically here but we may be getting overall performance gain by just removing stuff from the scene.
|
|
6196
6202
|
*/
|
|
6197
|
-
if (
|
|
6198
|
-
|
|
6203
|
+
if (rego.collection) {
|
|
6204
|
+
if (!show && rego.collection.contains(visual)) {
|
|
6205
|
+
rego.collection.remove(visual);
|
|
6206
|
+
}
|
|
6207
|
+
else if (show && !rego.collection.contains(visual)) {
|
|
6208
|
+
rego.collection.add(visual);
|
|
6209
|
+
}
|
|
6199
6210
|
}
|
|
6200
|
-
else
|
|
6201
|
-
viewer.entities.
|
|
6211
|
+
else {
|
|
6212
|
+
if (!show && viewer.entities.contains(visual)) {
|
|
6213
|
+
viewer.entities.remove(visual);
|
|
6214
|
+
}
|
|
6215
|
+
else if (show && !viewer.entities.contains(visual)) {
|
|
6216
|
+
viewer.entities.add(visual);
|
|
6217
|
+
}
|
|
6202
6218
|
}
|
|
6203
6219
|
}
|
|
6204
|
-
function updateEntityShow(viewer,
|
|
6220
|
+
function updateEntityShow(viewer, rego, show) {
|
|
6221
|
+
var visual = rego.visual;
|
|
6205
6222
|
if (visual instanceof Cesium.Entity) {
|
|
6206
6223
|
if (!(viewer === null || viewer === void 0 ? void 0 : viewer.scene) || viewer.isDestroyed()) {
|
|
6207
6224
|
return;
|
|
6208
6225
|
}
|
|
6209
|
-
updateCEntityShow(viewer,
|
|
6226
|
+
updateCEntityShow(viewer, rego.visual, rego, show, false, 0);
|
|
6210
6227
|
return;
|
|
6211
6228
|
}
|
|
6212
6229
|
if (!isAlive$1(viewer, visual)) {
|
|
@@ -6259,7 +6276,7 @@
|
|
|
6259
6276
|
if (visible == null) {
|
|
6260
6277
|
visible = getShowState(rego);
|
|
6261
6278
|
}
|
|
6262
|
-
updateEntityShow(viewer, rego
|
|
6279
|
+
updateEntityShow(viewer, rego, visible);
|
|
6263
6280
|
if (rego.best) {
|
|
6264
6281
|
var isLabelled = register.GetIsLabelled({
|
|
6265
6282
|
entityId: entityId
|
|
@@ -6376,6 +6393,10 @@
|
|
|
6376
6393
|
enumerable: false,
|
|
6377
6394
|
configurable: true
|
|
6378
6395
|
});
|
|
6396
|
+
Register.prototype.RefreshMark = function (params) {
|
|
6397
|
+
var rego = params.rego;
|
|
6398
|
+
markEntity(this, rego, rego.visual, false);
|
|
6399
|
+
};
|
|
6379
6400
|
Register.prototype.Dispose = function () {
|
|
6380
6401
|
var _a;
|
|
6381
6402
|
(_a = this.cameraCullerDispose) === null || _a === void 0 ? void 0 : _a.call(this, {
|
|
@@ -7998,6 +8019,15 @@
|
|
|
7998
8019
|
|
|
7999
8020
|
var BATCH_SIZE = 500;
|
|
8000
8021
|
var CHECK_BATCH_SIZE = 250;
|
|
8022
|
+
function getValue$3(viewer, obj) {
|
|
8023
|
+
if (obj === null || obj === void 0 ? void 0 : obj.getValue) {
|
|
8024
|
+
return obj.getValue(viewer.scene.lastRenderTime);
|
|
8025
|
+
}
|
|
8026
|
+
return obj;
|
|
8027
|
+
}
|
|
8028
|
+
function colorToCColor$2(color) {
|
|
8029
|
+
return new Cesium.Color(color.red ? color.red / 255 : 0, color.green ? color.green / 255 : 0, color.blue ? color.blue / 255 : 0, color.alpha);
|
|
8030
|
+
}
|
|
8001
8031
|
(function (EntitiesRenderManager) {
|
|
8002
8032
|
var Manager = /** @class */ (function () {
|
|
8003
8033
|
function Manager(params) {
|
|
@@ -8012,6 +8042,10 @@
|
|
|
8012
8042
|
this.viewMonitorRemoval = null;
|
|
8013
8043
|
this.renderQueue = [];
|
|
8014
8044
|
this.renderQueueInterval = null;
|
|
8045
|
+
this.sources = [];
|
|
8046
|
+
// Highly experimental flag to try improve rendering large sets of polygons and polylines.
|
|
8047
|
+
// Many things are not supported when this is enabled.
|
|
8048
|
+
this.useGeojson = false;
|
|
8015
8049
|
var viewer = params.viewer, apiGetter = params.apiGetter, monitor = params.monitor, item = params.item, visualsManager = params.register, sharedGetters = params.sharedGetters;
|
|
8016
8050
|
this.viewer = viewer;
|
|
8017
8051
|
this.sharedGetters = sharedGetters;
|
|
@@ -8019,6 +8053,7 @@
|
|
|
8019
8053
|
this.apiGetter = apiGetter;
|
|
8020
8054
|
this.item = item;
|
|
8021
8055
|
this.visualsManager = visualsManager;
|
|
8056
|
+
this.useGeojson = item.renderAsGeojson == true;
|
|
8022
8057
|
if (item.enableClustering) {
|
|
8023
8058
|
this.clustering = new PointClustering(this.visualsManager, this.item.id);
|
|
8024
8059
|
}
|
|
@@ -8168,6 +8203,12 @@
|
|
|
8168
8203
|
clearInterval(this.renderQueueInterval);
|
|
8169
8204
|
this.renderQueue = [];
|
|
8170
8205
|
(_c = this.clustering) === null || _c === void 0 ? void 0 : _c.Dispose();
|
|
8206
|
+
this.clustering = null;
|
|
8207
|
+
for (var i = 0; i < this.sources.length; i++) {
|
|
8208
|
+
var source = this.sources[i];
|
|
8209
|
+
this.viewer.dataSources.remove(source);
|
|
8210
|
+
}
|
|
8211
|
+
this.sources = [];
|
|
8171
8212
|
};
|
|
8172
8213
|
Manager.prototype.ReRender = function (params) {
|
|
8173
8214
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -8319,14 +8360,14 @@
|
|
|
8319
8360
|
}
|
|
8320
8361
|
};
|
|
8321
8362
|
Manager.prototype.renderEntities = function (entities, force) {
|
|
8322
|
-
var _a
|
|
8363
|
+
var _a;
|
|
8323
8364
|
if (force === void 0) { force = false; }
|
|
8324
8365
|
return __awaiter(this, void 0, void 0, function () {
|
|
8325
|
-
var typeId_1,
|
|
8326
|
-
return __generator(this, function (
|
|
8327
|
-
switch (
|
|
8366
|
+
var typeId_1, e_3;
|
|
8367
|
+
return __generator(this, function (_b) {
|
|
8368
|
+
switch (_b.label) {
|
|
8328
8369
|
case 0:
|
|
8329
|
-
|
|
8370
|
+
_b.trys.push([0, 5, , 6]);
|
|
8330
8371
|
if (this.disposed || this.viewer.isDestroyed()) {
|
|
8331
8372
|
return [2 /*return*/];
|
|
8332
8373
|
}
|
|
@@ -8334,17 +8375,227 @@
|
|
|
8334
8375
|
if (typeId_1) {
|
|
8335
8376
|
entities = entities.filter(function (x) { var _a; return ((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a["EntityType.ID"]) == typeId_1; });
|
|
8336
8377
|
}
|
|
8337
|
-
return [
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8378
|
+
if (!this.useGeojson) return [3 /*break*/, 2];
|
|
8379
|
+
return [4 /*yield*/, this.renderAsGeojson(entities, force)];
|
|
8380
|
+
case 1:
|
|
8381
|
+
_b.sent();
|
|
8382
|
+
return [3 /*break*/, 4];
|
|
8383
|
+
case 2: return [4 /*yield*/, this.renderAsIndividuals(entities, force)];
|
|
8384
|
+
case 3:
|
|
8385
|
+
_b.sent();
|
|
8386
|
+
_b.label = 4;
|
|
8387
|
+
case 4: return [3 /*break*/, 6];
|
|
8388
|
+
case 5:
|
|
8389
|
+
e_3 = _b.sent();
|
|
8390
|
+
console.error(e_3);
|
|
8391
|
+
return [3 /*break*/, 6];
|
|
8392
|
+
case 6: return [2 /*return*/];
|
|
8393
|
+
}
|
|
8394
|
+
});
|
|
8395
|
+
});
|
|
8396
|
+
};
|
|
8397
|
+
/**
|
|
8398
|
+
* Our optimized and more stable path.
|
|
8399
|
+
* We construct a geojson that we draw in one go.
|
|
8400
|
+
* @param entities
|
|
8401
|
+
* @param force TODO: This should re-render entities that are already rendered.
|
|
8402
|
+
*/
|
|
8403
|
+
Manager.prototype.renderAsGeojson = function (entities, force) {
|
|
8404
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
8405
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8406
|
+
var zoomItem, style, e_4, entityType, e_5, pStyle, polygonsClamped, bFillColor, cFillColor, bLineColor, cLineColor, lineWidthPx, geojson, source, groups, register, sEntities, i, cEntity;
|
|
8407
|
+
var _this = this;
|
|
8408
|
+
return __generator(this, function (_j) {
|
|
8409
|
+
switch (_j.label) {
|
|
8410
|
+
case 0:
|
|
8411
|
+
entities = entities.filter(function (entity) {
|
|
8412
|
+
var _a;
|
|
8413
|
+
return !_this.renderedEntities[(_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID];
|
|
8414
|
+
});
|
|
8415
|
+
// Mark these as rendered.
|
|
8416
|
+
entities.forEach(function (entity) {
|
|
8417
|
+
var _a;
|
|
8418
|
+
_this.renderedEntities[(_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID] = true;
|
|
8419
|
+
});
|
|
8420
|
+
zoomItem = this.item.CameraZoomSettings[0];
|
|
8421
|
+
style = null;
|
|
8422
|
+
if (!(zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID)) return [3 /*break*/, 4];
|
|
8423
|
+
_j.label = 1;
|
|
8424
|
+
case 1:
|
|
8425
|
+
_j.trys.push([1, 3, , 4]);
|
|
8426
|
+
return [4 /*yield*/, bruceModels.Style.Get({
|
|
8427
|
+
api: this.apiGetter.getApi(),
|
|
8428
|
+
styleId: zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID
|
|
8345
8429
|
})];
|
|
8430
|
+
case 2:
|
|
8431
|
+
style = (_a = (_j.sent()).style) === null || _a === void 0 ? void 0 : _a.Settings;
|
|
8432
|
+
return [3 /*break*/, 4];
|
|
8433
|
+
case 3:
|
|
8434
|
+
e_4 = _j.sent();
|
|
8435
|
+
console.error(e_4);
|
|
8436
|
+
return [3 /*break*/, 4];
|
|
8437
|
+
case 4:
|
|
8438
|
+
_j.trys.push([4, 8, , 9]);
|
|
8439
|
+
return [4 /*yield*/, bruceModels.EntityType.Get({
|
|
8440
|
+
entityTypeId: this.item.BruceEntity["EntityType.ID"],
|
|
8441
|
+
api: this.apiGetter.getApi()
|
|
8442
|
+
})];
|
|
8443
|
+
case 5:
|
|
8444
|
+
entityType = (_b = (_j.sent())) === null || _b === void 0 ? void 0 : _b.entityType;
|
|
8445
|
+
if (!(!style && ((_c = this.item.BruceEntity) === null || _c === void 0 ? void 0 : _c["EntityType.ID"]))) return [3 /*break*/, 7];
|
|
8446
|
+
if (!entityType["DisplaySetting.ID"]) return [3 /*break*/, 7];
|
|
8447
|
+
return [4 /*yield*/, bruceModels.Style.Get({
|
|
8448
|
+
api: this.apiGetter.getApi(),
|
|
8449
|
+
styleId: entityType["DisplaySetting.ID"]
|
|
8450
|
+
})];
|
|
8451
|
+
case 6:
|
|
8452
|
+
style = (_d = (_j.sent()).style) === null || _d === void 0 ? void 0 : _d.Settings;
|
|
8453
|
+
_j.label = 7;
|
|
8454
|
+
case 7: return [3 /*break*/, 9];
|
|
8455
|
+
case 8:
|
|
8456
|
+
e_5 = _j.sent();
|
|
8457
|
+
console.error(e_5);
|
|
8458
|
+
return [3 /*break*/, 9];
|
|
8459
|
+
case 9:
|
|
8460
|
+
pStyle = (_e = style === null || style === void 0 ? void 0 : style.polygonStyle) !== null && _e !== void 0 ? _e : {};
|
|
8461
|
+
polygonsClamped = ((_f = pStyle === null || pStyle === void 0 ? void 0 : pStyle.altitudeOption) === null || _f === void 0 ? void 0 : _f.id) == null ? true : ((_g = pStyle === null || pStyle === void 0 ? void 0 : pStyle.altitudeOption) === null || _g === void 0 ? void 0 : _g.id) == 0;
|
|
8462
|
+
bFillColor = bruceModels.Calculator.GetColor(pStyle.fillColor, {}, []);
|
|
8463
|
+
cFillColor = bFillColor ? colorToCColor$2(bFillColor) : Cesium.Color.fromCssColorString("rgba(139, 195, 74, 0.8)");
|
|
8464
|
+
bLineColor = bruceModels.Calculator.GetColor(pStyle.lineColor, {}, []);
|
|
8465
|
+
cLineColor = bLineColor ? colorToCColor$2(bLineColor) : Cesium.Color.fromCssColorString("rgba(80, 80, 80, 0.8)");
|
|
8466
|
+
lineWidthPx = pStyle.lineWidth ? bruceModels.Calculator.GetNumber(pStyle.lineWidth, {}, []) : null;
|
|
8467
|
+
if (lineWidthPx == null) {
|
|
8468
|
+
lineWidthPx = 1;
|
|
8469
|
+
}
|
|
8470
|
+
lineWidthPx = EnsureNumber(lineWidthPx);
|
|
8471
|
+
if (lineWidthPx < 0.01) {
|
|
8472
|
+
lineWidthPx = 0;
|
|
8473
|
+
}
|
|
8474
|
+
lineWidthPx = Math.round(lineWidthPx);
|
|
8475
|
+
geojson = bruceModels.Entity.ToGeoJson({
|
|
8476
|
+
entities: entities,
|
|
8477
|
+
includeUserData: false,
|
|
8478
|
+
excludeAltitude: polygonsClamped && lineWidthPx <= 0,
|
|
8479
|
+
altitude: lineWidthPx > 0 && polygonsClamped ? 1 : null,
|
|
8480
|
+
// No points.
|
|
8481
|
+
allowedDisplayTypes: [bruceModels.ZoomControl.EDisplayType.Geometry]
|
|
8482
|
+
});
|
|
8483
|
+
if (!((_h = geojson === null || geojson === void 0 ? void 0 : geojson.features) === null || _h === void 0 ? void 0 : _h.length)) {
|
|
8484
|
+
return [2 /*return*/];
|
|
8485
|
+
}
|
|
8486
|
+
return [4 /*yield*/, Cesium.GeoJsonDataSource.load(geojson, {
|
|
8487
|
+
stroke: cLineColor,
|
|
8488
|
+
fill: cFillColor,
|
|
8489
|
+
strokeWidth: lineWidthPx,
|
|
8490
|
+
clampToGround: lineWidthPx <= 0 && polygonsClamped
|
|
8491
|
+
})];
|
|
8492
|
+
case 10:
|
|
8493
|
+
source = _j.sent();
|
|
8494
|
+
this.viewer.dataSources.add(source);
|
|
8495
|
+
this.sources.push(source);
|
|
8496
|
+
if (this.disposed) {
|
|
8497
|
+
this.doDispose();
|
|
8498
|
+
return [2 /*return*/];
|
|
8499
|
+
}
|
|
8500
|
+
groups = [];
|
|
8501
|
+
register = function (thing) {
|
|
8502
|
+
var _a, _b, _c, _d;
|
|
8503
|
+
// See if the cesium entity already exists in a group.
|
|
8504
|
+
var group = groups.find(function (x) { var _a; return ((_a = x.visual) === null || _a === void 0 ? void 0 : _a.id) == thing.id || x.siblings.find(function (x) { return (x === null || x === void 0 ? void 0 : x.id) == thing.id; }); });
|
|
8505
|
+
if (group) {
|
|
8506
|
+
return;
|
|
8507
|
+
}
|
|
8508
|
+
var metadata = getValue$3(_this.viewer, thing === null || thing === void 0 ? void 0 : thing.properties);
|
|
8509
|
+
var entityId = (_a = metadata === null || metadata === void 0 ? void 0 : metadata.Bruce) === null || _a === void 0 ? void 0 : _a.ID;
|
|
8510
|
+
if (!entityId) {
|
|
8511
|
+
return;
|
|
8512
|
+
}
|
|
8513
|
+
// Find group for the nextspace entity ID.
|
|
8514
|
+
group = groups.find(function (x) { return x.entityId == entityId; });
|
|
8515
|
+
// No group yet. We can designate this as the primary entity and create a new group for it.
|
|
8516
|
+
if (!group) {
|
|
8517
|
+
group = {
|
|
8518
|
+
entityId: entityId,
|
|
8519
|
+
visual: thing,
|
|
8520
|
+
tagIds: (_b = metadata === null || metadata === void 0 ? void 0 : metadata.Bruce) === null || _b === void 0 ? void 0 : _b["Layer.ID"],
|
|
8521
|
+
entityTypeId: (_c = metadata === null || metadata === void 0 ? void 0 : metadata.Bruce) === null || _c === void 0 ? void 0 : _c["EntityType.ID"],
|
|
8522
|
+
siblings: [],
|
|
8523
|
+
data: entities.find(function (x) { var _a; return ((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID) == entityId; }),
|
|
8524
|
+
rego: null
|
|
8525
|
+
};
|
|
8526
|
+
groups.push(group);
|
|
8527
|
+
var rego = {
|
|
8528
|
+
entityId: entityId,
|
|
8529
|
+
menuItemId: _this.item.id,
|
|
8530
|
+
visual: thing,
|
|
8531
|
+
priority: 0,
|
|
8532
|
+
entityTypeId: group.entityTypeId,
|
|
8533
|
+
accountId: _this.apiGetter.accountId,
|
|
8534
|
+
tagIds: group.tagIds ? [].concat(group.tagIds) : [],
|
|
8535
|
+
name: (_d = bruceModels.Entity.CalculateName({
|
|
8536
|
+
entity: group.data,
|
|
8537
|
+
type: entityType,
|
|
8538
|
+
defaultToId: false
|
|
8539
|
+
})) !== null && _d !== void 0 ? _d : "Unnamed Entity",
|
|
8540
|
+
cdn: _this.item.cdnEnabled,
|
|
8541
|
+
collection: source.entities
|
|
8542
|
+
};
|
|
8543
|
+
group.rego = rego;
|
|
8544
|
+
_this.visualsManager.AddRego({
|
|
8545
|
+
rego: rego,
|
|
8546
|
+
requestRender: false
|
|
8547
|
+
});
|
|
8548
|
+
}
|
|
8549
|
+
// Found a group. We flag this as a sibling entity of the primary.
|
|
8550
|
+
else {
|
|
8551
|
+
group.siblings.push(thing);
|
|
8552
|
+
group.visual._siblingGraphics = group.siblings;
|
|
8553
|
+
thing._parentEntity = group.visual;
|
|
8554
|
+
if (group.rego) {
|
|
8555
|
+
_this.visualsManager.RefreshMark({
|
|
8556
|
+
rego: group.rego
|
|
8557
|
+
});
|
|
8558
|
+
}
|
|
8559
|
+
}
|
|
8560
|
+
// Won't do individual styles for now. More stability that way.
|
|
8561
|
+
// applyStyle(thing, entityId, group.data);
|
|
8562
|
+
};
|
|
8563
|
+
sEntities = source.entities.values;
|
|
8564
|
+
for (i = 0; i < sEntities.length; i++) {
|
|
8565
|
+
cEntity = sEntities[i];
|
|
8566
|
+
register(cEntity);
|
|
8567
|
+
}
|
|
8568
|
+
this.viewer.scene.requestRender();
|
|
8569
|
+
return [2 /*return*/];
|
|
8570
|
+
}
|
|
8571
|
+
});
|
|
8572
|
+
});
|
|
8573
|
+
};
|
|
8574
|
+
/**
|
|
8575
|
+
* Our default path.
|
|
8576
|
+
* We render each entity individually.
|
|
8577
|
+
* @param entities
|
|
8578
|
+
* @param force
|
|
8579
|
+
* @returns
|
|
8580
|
+
*/
|
|
8581
|
+
Manager.prototype.renderAsIndividuals = function (entities, force) {
|
|
8582
|
+
var _a, _b, _c;
|
|
8583
|
+
if (force === void 0) { force = false; }
|
|
8584
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8585
|
+
var cEntities, i, entity, id, cEntity, visual, wasClustered, tagIds, rego;
|
|
8586
|
+
return __generator(this, function (_d) {
|
|
8587
|
+
switch (_d.label) {
|
|
8588
|
+
case 0: return [4 /*yield*/, exports.EntityRenderEngine.Render({
|
|
8589
|
+
viewer: this.viewer,
|
|
8590
|
+
apiGetter: this.apiGetter,
|
|
8591
|
+
entities: entities,
|
|
8592
|
+
menuItemId: this.item.id,
|
|
8593
|
+
visualRegister: this.visualsManager,
|
|
8594
|
+
zoomControl: this.item.CameraZoomSettings,
|
|
8595
|
+
force: force
|
|
8596
|
+
})];
|
|
8346
8597
|
case 1:
|
|
8347
|
-
cEntities =
|
|
8598
|
+
cEntities = _d.sent();
|
|
8348
8599
|
if (this.disposed) {
|
|
8349
8600
|
this.doDispose();
|
|
8350
8601
|
return [2 /*return*/];
|
|
@@ -8355,13 +8606,13 @@
|
|
|
8355
8606
|
cEntity = cEntities[id];
|
|
8356
8607
|
this.renderedEntities[id] = !!cEntity;
|
|
8357
8608
|
if (cEntity) {
|
|
8358
|
-
visual = (
|
|
8609
|
+
visual = (_a = this.visualsManager.GetRego({
|
|
8359
8610
|
entityId: id,
|
|
8360
8611
|
menuItemId: this.item.id
|
|
8361
|
-
})) === null ||
|
|
8612
|
+
})) === null || _a === void 0 ? void 0 : _a.visual;
|
|
8362
8613
|
if (!visual || visual != cEntity) {
|
|
8363
8614
|
wasClustered = this.clustering ? this.clustering.AddEntity(id, cEntity, false) : false;
|
|
8364
|
-
tagIds = (
|
|
8615
|
+
tagIds = (_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b["Layer.ID"];
|
|
8365
8616
|
rego = {
|
|
8366
8617
|
entityId: id,
|
|
8367
8618
|
menuItemId: this.item.id,
|
|
@@ -8386,19 +8637,14 @@
|
|
|
8386
8637
|
menuItemId: this.item.id,
|
|
8387
8638
|
requestRender: false
|
|
8388
8639
|
});
|
|
8389
|
-
(
|
|
8640
|
+
(_c = this.clustering) === null || _c === void 0 ? void 0 : _c.RemoveEntity(id, false);
|
|
8390
8641
|
}
|
|
8391
8642
|
}
|
|
8392
8643
|
this.viewer.scene.requestRender();
|
|
8393
8644
|
if (this.clustering && entities.length) {
|
|
8394
8645
|
this.clustering.Update();
|
|
8395
8646
|
}
|
|
8396
|
-
return [
|
|
8397
|
-
case 2:
|
|
8398
|
-
e_3 = _e.sent();
|
|
8399
|
-
console.error(e_3);
|
|
8400
|
-
return [3 /*break*/, 3];
|
|
8401
|
-
case 3: return [2 /*return*/];
|
|
8647
|
+
return [2 /*return*/];
|
|
8402
8648
|
}
|
|
8403
8649
|
});
|
|
8404
8650
|
});
|
|
@@ -9267,7 +9513,7 @@
|
|
|
9267
9513
|
EntityRenderManager.Manager = Manager;
|
|
9268
9514
|
})(exports.EntityRenderManager || (exports.EntityRenderManager = {}));
|
|
9269
9515
|
|
|
9270
|
-
function colorToCColor$
|
|
9516
|
+
function colorToCColor$3(color) {
|
|
9271
9517
|
return new Cesium.Color(color.red ? color.red / 255 : 0, color.green ? color.green / 255 : 0, color.blue ? color.blue / 255 : 0, color.alpha);
|
|
9272
9518
|
}
|
|
9273
9519
|
/**
|
|
@@ -10082,7 +10328,7 @@
|
|
|
10082
10328
|
}
|
|
10083
10329
|
var bColor = ((_a = style.modelStyle) === null || _a === void 0 ? void 0 : _a.fillColor) ? bruceModels.Calculator.GetColor(style.modelStyle.fillColor, data, []) : null;
|
|
10084
10330
|
if (bColor != null) {
|
|
10085
|
-
var cColor = colorToCColor$
|
|
10331
|
+
var cColor = colorToCColor$3(bColor);
|
|
10086
10332
|
var visual = entity.visual;
|
|
10087
10333
|
if (visual && visual instanceof Cesium.Cesium3DTileFeature) {
|
|
10088
10334
|
visual.color = cColor;
|
|
@@ -20049,7 +20295,7 @@
|
|
|
20049
20295
|
CesiumViewMonitor.Monitor = Monitor;
|
|
20050
20296
|
})(exports.CesiumViewMonitor || (exports.CesiumViewMonitor = {}));
|
|
20051
20297
|
|
|
20052
|
-
var VERSION$1 = "3.3.
|
|
20298
|
+
var VERSION$1 = "3.3.8";
|
|
20053
20299
|
|
|
20054
20300
|
exports.VERSION = VERSION$1;
|
|
20055
20301
|
exports.CesiumParabola = CesiumParabola;
|