bruce-cesium 3.4.0 → 3.4.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 +1052 -239
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +1051 -238
- 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-ids-render-manager.js +387 -21
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js +391 -21
- package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +128 -47
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/render-managers/entities/entities-ids-render-manager.d.ts +18 -0
- package/dist/types/rendering/render-managers/entities/entities-loaded-render-manager.d.ts +18 -0
- package/package.json +2 -2
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Cartes, Carto, Entity as Entity$1, Geometry, Tileset, MathUtils, LRUCache, ProjectViewTile, DelayQueue, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, EntityRelationType, ENVIRONMENT, BruceEvent, EntityCoords, Api, EntitySource, MenuItem, EntityRelation, ProgramKey, AbstractApi, ProjectViewBookmark, EntityAttachment, EntityAttachmentType, EntityAttribute, ProjectView, ProjectViewLegacyTile, Camera } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic,
|
|
3
|
+
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, DistanceDisplayCondition, NearFarScalar, Model, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, ColorMaterialProperty, HeadingPitchRange, Cesium3DTileColorBlendMode, Ion, Cesium3DTileStyle, KmlDataSource, SceneTransforms, Cesium3DTileset, Matrix4, Matrix3, IonResource, OrthographicFrustum, EasingFunction, EllipsoidTerrainProvider, CesiumInspector, defined, PolygonPipeline, EllipsoidGeodesic, sampleTerrainMostDetailed, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, ScreenSpaceEventHandler, ScreenSpaceEventType, BoundingSphere, GeometryInstance, Intersect, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics } from 'cesium';
|
|
4
4
|
|
|
5
5
|
/*! *****************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8164,6 +8164,10 @@ var EntitiesRenderManager;
|
|
|
8164
8164
|
}
|
|
8165
8165
|
];
|
|
8166
8166
|
}
|
|
8167
|
+
if (this.renderAsGeojson && this.item.CameraZoomSettings.length > 1) {
|
|
8168
|
+
console.warn("Geojson rendering does not support multiple zoom controls. Only the first one will be used.");
|
|
8169
|
+
this.item.CameraZoomSettings = [this.item.CameraZoomSettings[0]];
|
|
8170
|
+
}
|
|
8167
8171
|
var isTagItem = Boolean(this.item.BruceEntity.ExpandLayers);
|
|
8168
8172
|
var tagsToRender = isTagItem ? this.item.BruceEntity.SelectedExpandLayers : null;
|
|
8169
8173
|
if (!tagsToRender) {
|
|
@@ -8347,6 +8351,10 @@ var EntitiesRenderManager;
|
|
|
8347
8351
|
}
|
|
8348
8352
|
if (CameraZoomSettings === null || CameraZoomSettings === void 0 ? void 0 : CameraZoomSettings.length) {
|
|
8349
8353
|
this.item.CameraZoomSettings = CameraZoomSettings;
|
|
8354
|
+
if (this.renderAsGeojson && this.item.CameraZoomSettings.length > 1) {
|
|
8355
|
+
console.warn("Geojson rendering does not support multiple zoom controls. Only the first one will be used.");
|
|
8356
|
+
this.item.CameraZoomSettings = [this.item.CameraZoomSettings[0]];
|
|
8357
|
+
}
|
|
8350
8358
|
this.setGetter();
|
|
8351
8359
|
}
|
|
8352
8360
|
if (queueRerender != false) {
|
|
@@ -8441,11 +8449,11 @@ var EntitiesRenderManager;
|
|
|
8441
8449
|
var _a;
|
|
8442
8450
|
if (force === void 0) { force = false; }
|
|
8443
8451
|
return __awaiter(this, void 0, void 0, function () {
|
|
8444
|
-
var typeId_1, e_3;
|
|
8452
|
+
var typeId_1, zoomItem, e_3;
|
|
8445
8453
|
return __generator(this, function (_b) {
|
|
8446
8454
|
switch (_b.label) {
|
|
8447
8455
|
case 0:
|
|
8448
|
-
_b.trys.push([0,
|
|
8456
|
+
_b.trys.push([0, 8, , 9]);
|
|
8449
8457
|
if (this.disposed || this.viewer.isDestroyed()) {
|
|
8450
8458
|
return [2 /*return*/];
|
|
8451
8459
|
}
|
|
@@ -8453,21 +8461,30 @@ var EntitiesRenderManager;
|
|
|
8453
8461
|
if (typeId_1) {
|
|
8454
8462
|
entities = entities.filter(function (x) { var _a; return ((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a["EntityType.ID"]) == typeId_1; });
|
|
8455
8463
|
}
|
|
8456
|
-
if (!this.useGeojson) return [3 /*break*/,
|
|
8457
|
-
|
|
8464
|
+
if (!this.useGeojson) return [3 /*break*/, 5];
|
|
8465
|
+
zoomItem = this.item.CameraZoomSettings[0];
|
|
8466
|
+
if (!(zoomItem.DisplayType == ZoomControl.EDisplayType.Point)) return [3 /*break*/, 2];
|
|
8467
|
+
// We'll just render these as individuals since we don't support point geojson.
|
|
8468
|
+
return [4 /*yield*/, this.renderAsIndividuals(entities, force)];
|
|
8458
8469
|
case 1:
|
|
8470
|
+
// We'll just render these as individuals since we don't support point geojson.
|
|
8459
8471
|
_b.sent();
|
|
8460
8472
|
return [3 /*break*/, 4];
|
|
8461
|
-
case 2: return [4 /*yield*/, this.
|
|
8473
|
+
case 2: return [4 /*yield*/, this.renderAsGeojson(entities, force)];
|
|
8462
8474
|
case 3:
|
|
8463
8475
|
_b.sent();
|
|
8464
8476
|
_b.label = 4;
|
|
8465
|
-
case 4: return [3 /*break*/,
|
|
8466
|
-
case 5:
|
|
8477
|
+
case 4: return [3 /*break*/, 7];
|
|
8478
|
+
case 5: return [4 /*yield*/, this.renderAsIndividuals(entities, force)];
|
|
8479
|
+
case 6:
|
|
8480
|
+
_b.sent();
|
|
8481
|
+
_b.label = 7;
|
|
8482
|
+
case 7: return [3 /*break*/, 9];
|
|
8483
|
+
case 8:
|
|
8467
8484
|
e_3 = _b.sent();
|
|
8468
8485
|
console.error(e_3);
|
|
8469
|
-
return [3 /*break*/,
|
|
8470
|
-
case
|
|
8486
|
+
return [3 /*break*/, 9];
|
|
8487
|
+
case 9: return [2 /*return*/];
|
|
8471
8488
|
}
|
|
8472
8489
|
});
|
|
8473
8490
|
});
|
|
@@ -8479,12 +8496,12 @@ var EntitiesRenderManager;
|
|
|
8479
8496
|
* @param force TODO: This should re-render entities that are already rendered.
|
|
8480
8497
|
*/
|
|
8481
8498
|
Manager.prototype.renderAsGeojson = function (entities, force) {
|
|
8482
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
8499
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
8483
8500
|
return __awaiter(this, void 0, void 0, function () {
|
|
8484
|
-
var zoomItem, style, e_4, entityType, e_5, pStyle, lStyle, polygonsClamped, bFillColor, cFillColor, bLineColor, cLineColor, lineWidthPx, geojson, source, groups, applyStyle, register, sEntities, i, cEntity;
|
|
8501
|
+
var zoomItem, lods, withLods_1, individuals, style, e_4, entityTypeId, entityType, e_5, pStyle, lStyle, polygonsClamped, bFillColor, cFillColor, bLineColor, cLineColor, lineWidthPx, geojson, notRendered, source, groups, applyStyle, register, sEntities, i, cEntity;
|
|
8485
8502
|
var _this = this;
|
|
8486
|
-
return __generator(this, function (
|
|
8487
|
-
switch (
|
|
8503
|
+
return __generator(this, function (_o) {
|
|
8504
|
+
switch (_o.label) {
|
|
8488
8505
|
case 0:
|
|
8489
8506
|
entities = entities.filter(function (entity) {
|
|
8490
8507
|
var _a;
|
|
@@ -8496,48 +8513,96 @@ var EntitiesRenderManager;
|
|
|
8496
8513
|
_this.renderedEntities[(_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID] = true;
|
|
8497
8514
|
});
|
|
8498
8515
|
zoomItem = this.item.CameraZoomSettings[0];
|
|
8499
|
-
|
|
8500
|
-
|
|
8501
|
-
|
|
8516
|
+
if (!(zoomItem.DisplayType == ZoomControl.EDisplayType.Model3D && entities.length)) return [3 /*break*/, 2];
|
|
8517
|
+
return [4 /*yield*/, EntityLod.GetLods({
|
|
8518
|
+
api: this.apiGetter.getApi(),
|
|
8519
|
+
filter: {
|
|
8520
|
+
externalSources: false,
|
|
8521
|
+
Items: entities.map(function (x) {
|
|
8522
|
+
var _a, _b;
|
|
8523
|
+
return {
|
|
8524
|
+
entityId: (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID,
|
|
8525
|
+
categoryId: (_b = zoomItem.LODCategoryID) !== null && _b !== void 0 ? _b : "GLB",
|
|
8526
|
+
group: "DEFAULT",
|
|
8527
|
+
level: Number(zoomItem.LODLevel)
|
|
8528
|
+
};
|
|
8529
|
+
}),
|
|
8530
|
+
strict: false
|
|
8531
|
+
}
|
|
8532
|
+
})];
|
|
8502
8533
|
case 1:
|
|
8503
|
-
|
|
8534
|
+
lods = (_o.sent()).lods;
|
|
8535
|
+
if (this.disposed) {
|
|
8536
|
+
this.doDispose();
|
|
8537
|
+
return [2 /*return*/];
|
|
8538
|
+
}
|
|
8539
|
+
withLods_1 = lods.filter(function (x) { return x.entityId && !!x.clientFileId; }).map(function (x) { return x.entityId; });
|
|
8540
|
+
individuals = entities.filter(function (entity) {
|
|
8541
|
+
var _a;
|
|
8542
|
+
return withLods_1.includes((_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID);
|
|
8543
|
+
});
|
|
8544
|
+
if (individuals.length) {
|
|
8545
|
+
this.renderAsIndividuals(individuals, force);
|
|
8546
|
+
}
|
|
8547
|
+
// Now we proceed with what is left.
|
|
8548
|
+
entities = entities.filter(function (entity) {
|
|
8549
|
+
var _a;
|
|
8550
|
+
return !withLods_1.includes((_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID);
|
|
8551
|
+
});
|
|
8552
|
+
_o.label = 2;
|
|
8553
|
+
case 2:
|
|
8554
|
+
if (!entities.length) {
|
|
8555
|
+
return [2 /*return*/];
|
|
8556
|
+
}
|
|
8557
|
+
style = null;
|
|
8558
|
+
if (!((zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID) && (zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID) > -1)) return [3 /*break*/, 6];
|
|
8559
|
+
_o.label = 3;
|
|
8560
|
+
case 3:
|
|
8561
|
+
_o.trys.push([3, 5, , 6]);
|
|
8504
8562
|
return [4 /*yield*/, Style.Get({
|
|
8505
8563
|
api: this.apiGetter.getApi(),
|
|
8506
8564
|
styleId: zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID
|
|
8507
8565
|
})];
|
|
8508
|
-
case 2:
|
|
8509
|
-
style = (_a = (_k.sent()).style) === null || _a === void 0 ? void 0 : _a.Settings;
|
|
8510
|
-
return [3 /*break*/, 4];
|
|
8511
|
-
case 3:
|
|
8512
|
-
e_4 = _k.sent();
|
|
8513
|
-
console.error(e_4);
|
|
8514
|
-
return [3 /*break*/, 4];
|
|
8515
8566
|
case 4:
|
|
8516
|
-
|
|
8567
|
+
style = (_a = (_o.sent()).style) === null || _a === void 0 ? void 0 : _a.Settings;
|
|
8568
|
+
return [3 /*break*/, 6];
|
|
8569
|
+
case 5:
|
|
8570
|
+
e_4 = _o.sent();
|
|
8571
|
+
console.error(e_4);
|
|
8572
|
+
return [3 /*break*/, 6];
|
|
8573
|
+
case 6:
|
|
8574
|
+
entityTypeId = (_b = this.item.BruceEntity) === null || _b === void 0 ? void 0 : _b["EntityType.ID"];
|
|
8575
|
+
if (!entityTypeId) {
|
|
8576
|
+
entityTypeId = (_d = (_c = entities.find(function (x) { var _a; return !!((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a["EntityType.ID"]); })) === null || _c === void 0 ? void 0 : _c.Bruce) === null || _d === void 0 ? void 0 : _d["EntityType.ID"];
|
|
8577
|
+
}
|
|
8578
|
+
if (!entityTypeId) return [3 /*break*/, 12];
|
|
8579
|
+
_o.label = 7;
|
|
8580
|
+
case 7:
|
|
8581
|
+
_o.trys.push([7, 11, , 12]);
|
|
8517
8582
|
return [4 /*yield*/, EntityType.Get({
|
|
8518
|
-
entityTypeId:
|
|
8583
|
+
entityTypeId: entityTypeId,
|
|
8519
8584
|
api: this.apiGetter.getApi()
|
|
8520
8585
|
})];
|
|
8521
|
-
case
|
|
8522
|
-
entityType = (
|
|
8523
|
-
if (!(!style &&
|
|
8524
|
-
if (!entityType["DisplaySetting.ID"]) return [3 /*break*/,
|
|
8586
|
+
case 8:
|
|
8587
|
+
entityType = (_e = (_o.sent())) === null || _e === void 0 ? void 0 : _e.entityType;
|
|
8588
|
+
if (!(!style && entityType)) return [3 /*break*/, 10];
|
|
8589
|
+
if (!(entityType["DisplaySetting.ID"] && entityType["DisplaySetting.ID"] > 0)) return [3 /*break*/, 10];
|
|
8525
8590
|
return [4 /*yield*/, Style.Get({
|
|
8526
8591
|
api: this.apiGetter.getApi(),
|
|
8527
8592
|
styleId: entityType["DisplaySetting.ID"]
|
|
8528
8593
|
})];
|
|
8529
|
-
case 6:
|
|
8530
|
-
style = (_d = (_k.sent()).style) === null || _d === void 0 ? void 0 : _d.Settings;
|
|
8531
|
-
_k.label = 7;
|
|
8532
|
-
case 7: return [3 /*break*/, 9];
|
|
8533
|
-
case 8:
|
|
8534
|
-
e_5 = _k.sent();
|
|
8535
|
-
console.error(e_5);
|
|
8536
|
-
return [3 /*break*/, 9];
|
|
8537
8594
|
case 9:
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
|
|
8595
|
+
style = (_f = (_o.sent()).style) === null || _f === void 0 ? void 0 : _f.Settings;
|
|
8596
|
+
_o.label = 10;
|
|
8597
|
+
case 10: return [3 /*break*/, 12];
|
|
8598
|
+
case 11:
|
|
8599
|
+
e_5 = _o.sent();
|
|
8600
|
+
console.error(e_5);
|
|
8601
|
+
return [3 /*break*/, 12];
|
|
8602
|
+
case 12:
|
|
8603
|
+
pStyle = (_g = style === null || style === void 0 ? void 0 : style.polygonStyle) !== null && _g !== void 0 ? _g : {};
|
|
8604
|
+
lStyle = (_h = style === null || style === void 0 ? void 0 : style.polylineStyle) !== null && _h !== void 0 ? _h : {};
|
|
8605
|
+
polygonsClamped = ((_j = pStyle === null || pStyle === void 0 ? void 0 : pStyle.altitudeOption) === null || _j === void 0 ? void 0 : _j.id) == null ? true : ((_k = pStyle === null || pStyle === void 0 ? void 0 : pStyle.altitudeOption) === null || _k === void 0 ? void 0 : _k.id) == 0;
|
|
8541
8606
|
bFillColor = Calculator.GetColor(pStyle.fillColor, {}, []);
|
|
8542
8607
|
cFillColor = bFillColor ? colorToCColor$2(bFillColor) : Color.fromCssColorString("rgba(139, 195, 74, 0.8)");
|
|
8543
8608
|
bLineColor = Calculator.GetColor(pStyle.lineColor, {}, []);
|
|
@@ -8559,7 +8624,16 @@ var EntitiesRenderManager;
|
|
|
8559
8624
|
// No points.
|
|
8560
8625
|
allowedDisplayTypes: [ZoomControl.EDisplayType.Geometry]
|
|
8561
8626
|
});
|
|
8562
|
-
|
|
8627
|
+
notRendered = !((_l = geojson === null || geojson === void 0 ? void 0 : geojson.features) === null || _l === void 0 ? void 0 : _l.length) ? entities : entities.filter(function (entity) {
|
|
8628
|
+
return !geojson.features.some(function (feature) {
|
|
8629
|
+
var _a, _b, _c;
|
|
8630
|
+
return ((_b = (_a = feature.properties) === null || _a === void 0 ? void 0 : _a.Bruce) === null || _b === void 0 ? void 0 : _b.ID) == ((_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c.ID);
|
|
8631
|
+
});
|
|
8632
|
+
});
|
|
8633
|
+
if (notRendered.length) {
|
|
8634
|
+
this.renderAsIndividuals(notRendered, force);
|
|
8635
|
+
}
|
|
8636
|
+
if (!((_m = geojson === null || geojson === void 0 ? void 0 : geojson.features) === null || _m === void 0 ? void 0 : _m.length)) {
|
|
8563
8637
|
return [2 /*return*/];
|
|
8564
8638
|
}
|
|
8565
8639
|
return [4 /*yield*/, GeoJsonDataSource.load(geojson, {
|
|
@@ -8568,8 +8642,8 @@ var EntitiesRenderManager;
|
|
|
8568
8642
|
strokeWidth: lineWidthPx,
|
|
8569
8643
|
clampToGround: lineWidthPx <= 0 && polygonsClamped
|
|
8570
8644
|
})];
|
|
8571
|
-
case
|
|
8572
|
-
source =
|
|
8645
|
+
case 13:
|
|
8646
|
+
source = _o.sent();
|
|
8573
8647
|
this.viewer.dataSources.add(source);
|
|
8574
8648
|
this.sources.push(source);
|
|
8575
8649
|
if (this.disposed) {
|
|
@@ -8645,6 +8719,7 @@ var EntitiesRenderManager;
|
|
|
8645
8719
|
if (!entityId) {
|
|
8646
8720
|
return;
|
|
8647
8721
|
}
|
|
8722
|
+
var needsUpdate = false;
|
|
8648
8723
|
// Find group for the nextspace entity ID.
|
|
8649
8724
|
group = groups.find(function (x) { return x.entityId == entityId; });
|
|
8650
8725
|
// No group yet. We can designate this as the primary entity and create a new group for it.
|
|
@@ -8667,11 +8742,11 @@ var EntitiesRenderManager;
|
|
|
8667
8742
|
entityTypeId: group.entityTypeId,
|
|
8668
8743
|
accountId: _this.apiGetter.accountId,
|
|
8669
8744
|
tagIds: group.tagIds ? [].concat(group.tagIds) : [],
|
|
8670
|
-
name: (_d = Entity$1.CalculateName({
|
|
8745
|
+
name: entityType ? (_d = Entity$1.CalculateName({
|
|
8671
8746
|
entity: group.data,
|
|
8672
8747
|
type: entityType,
|
|
8673
8748
|
defaultToId: false
|
|
8674
|
-
})) !== null && _d !== void 0 ? _d : "Unnamed Entity",
|
|
8749
|
+
})) !== null && _d !== void 0 ? _d : "Unnamed Entity" : "Unnamed Entity",
|
|
8675
8750
|
cdn: _this.item.cdnEnabled,
|
|
8676
8751
|
collection: source.entities
|
|
8677
8752
|
};
|
|
@@ -8690,9 +8765,15 @@ var EntitiesRenderManager;
|
|
|
8690
8765
|
_this.visualsManager.RefreshMark({
|
|
8691
8766
|
rego: group.rego
|
|
8692
8767
|
});
|
|
8768
|
+
needsUpdate = true;
|
|
8693
8769
|
}
|
|
8694
8770
|
}
|
|
8695
8771
|
applyStyle(thing, entityId, group.data);
|
|
8772
|
+
if (needsUpdate) {
|
|
8773
|
+
_this.visualsManager.ForceUpdate({
|
|
8774
|
+
entityIds: [entityId],
|
|
8775
|
+
});
|
|
8776
|
+
}
|
|
8696
8777
|
};
|
|
8697
8778
|
sEntities = source.entities.values;
|
|
8698
8779
|
for (i = 0; i < sEntities.length; i++) {
|
|
@@ -8878,6 +8959,15 @@ var BatchedDataGetter;
|
|
|
8878
8959
|
|
|
8879
8960
|
var BATCH_SIZE$1 = 500;
|
|
8880
8961
|
var CHECK_BATCH_SIZE$1 = 250;
|
|
8962
|
+
function getValue$4(viewer, obj) {
|
|
8963
|
+
if (obj === null || obj === void 0 ? void 0 : obj.getValue) {
|
|
8964
|
+
return obj.getValue(viewer.scene.lastRenderTime);
|
|
8965
|
+
}
|
|
8966
|
+
return obj;
|
|
8967
|
+
}
|
|
8968
|
+
function colorToCColor$3(color) {
|
|
8969
|
+
return new Color(color.red ? color.red / 255 : 0, color.green ? color.green / 255 : 0, color.blue ? color.blue / 255 : 0, color.alpha);
|
|
8970
|
+
}
|
|
8881
8971
|
/**
|
|
8882
8972
|
* Render manager for a group of pre-loaded entities.
|
|
8883
8973
|
* The entities may or may not have records.
|
|
@@ -8892,12 +8982,17 @@ var EntitiesLoadedRenderManager;
|
|
|
8892
8982
|
this.getterSub = null;
|
|
8893
8983
|
this.disposed = false;
|
|
8894
8984
|
this.renderedEntities = {};
|
|
8985
|
+
this.sources = [];
|
|
8986
|
+
// Highly experimental flag to try improve rendering large sets of polygons and polylines.
|
|
8987
|
+
// Many things are not supported when this is enabled.
|
|
8988
|
+
this.useGeojson = false;
|
|
8895
8989
|
var viewer = params.viewer, apiGetter = params.apiGetter, monitor = params.monitor, item = params.item, visualsManager = params.register;
|
|
8896
8990
|
this.viewer = viewer;
|
|
8897
8991
|
this.apiGetter = apiGetter;
|
|
8898
8992
|
this.monitor = monitor;
|
|
8899
8993
|
this.item = item;
|
|
8900
8994
|
this.visualsManager = visualsManager;
|
|
8995
|
+
this.useGeojson = item.renderAsGeojson == true;
|
|
8901
8996
|
if (!((_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.Entities)) {
|
|
8902
8997
|
this.item.BruceEntity = __assign(__assign({}, this.item.BruceEntity), { Entities: [] });
|
|
8903
8998
|
}
|
|
@@ -8994,6 +9089,10 @@ var EntitiesLoadedRenderManager;
|
|
|
8994
9089
|
}
|
|
8995
9090
|
];
|
|
8996
9091
|
}
|
|
9092
|
+
if (this.renderAsGeojson && this.item.CameraZoomSettings.length > 1) {
|
|
9093
|
+
console.warn("Geojson rendering does not support multiple zoom controls. Only the first one will be used.");
|
|
9094
|
+
this.item.CameraZoomSettings = [this.item.CameraZoomSettings[0]];
|
|
9095
|
+
}
|
|
8997
9096
|
this.recreateGetter();
|
|
8998
9097
|
};
|
|
8999
9098
|
/**
|
|
@@ -9019,16 +9118,24 @@ var EntitiesLoadedRenderManager;
|
|
|
9019
9118
|
this.getter.Start();
|
|
9020
9119
|
};
|
|
9021
9120
|
Manager.prototype.Dispose = function () {
|
|
9022
|
-
var _a;
|
|
9023
9121
|
if (this.disposed) {
|
|
9024
9122
|
return;
|
|
9025
9123
|
}
|
|
9124
|
+
this.doDispose();
|
|
9125
|
+
};
|
|
9126
|
+
Manager.prototype.doDispose = function () {
|
|
9127
|
+
var _a;
|
|
9026
9128
|
(_a = this.getterSub) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
9027
9129
|
this.getterSub = null;
|
|
9028
9130
|
this.disposed = true;
|
|
9029
9131
|
this.visualsManager.RemoveRegos({
|
|
9030
9132
|
menuItemId: this.item.id
|
|
9031
9133
|
});
|
|
9134
|
+
for (var i = 0; i < this.sources.length; i++) {
|
|
9135
|
+
var source = this.sources[i];
|
|
9136
|
+
this.viewer.dataSources.remove(source);
|
|
9137
|
+
}
|
|
9138
|
+
this.sources = [];
|
|
9032
9139
|
};
|
|
9033
9140
|
Manager.prototype.ReRender = function (params) {
|
|
9034
9141
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -9073,6 +9180,10 @@ var EntitiesLoadedRenderManager;
|
|
|
9073
9180
|
}
|
|
9074
9181
|
if (CameraZoomSettings === null || CameraZoomSettings === void 0 ? void 0 : CameraZoomSettings.length) {
|
|
9075
9182
|
this.item.CameraZoomSettings = CameraZoomSettings;
|
|
9183
|
+
if (this.renderAsGeojson && this.item.CameraZoomSettings.length > 1) {
|
|
9184
|
+
console.warn("Geojson rendering does not support multiple zoom controls. Only the first one will be used.");
|
|
9185
|
+
this.item.CameraZoomSettings = [this.item.CameraZoomSettings[0]];
|
|
9186
|
+
}
|
|
9076
9187
|
}
|
|
9077
9188
|
if (queueRerender != false) {
|
|
9078
9189
|
var entityIds = Object.keys(this.renderedEntities);
|
|
@@ -9137,15 +9248,14 @@ var EntitiesLoadedRenderManager;
|
|
|
9137
9248
|
});
|
|
9138
9249
|
};
|
|
9139
9250
|
Manager.prototype.onGetterUpdate = function (entities, force) {
|
|
9140
|
-
var _a;
|
|
9141
9251
|
if (force === void 0) { force = false; }
|
|
9142
9252
|
return __awaiter(this, void 0, void 0, function () {
|
|
9143
|
-
var isEntityInItem_1,
|
|
9253
|
+
var isEntityInItem_1, zoomItem, e_2;
|
|
9144
9254
|
var _this = this;
|
|
9145
|
-
return __generator(this, function (
|
|
9146
|
-
switch (
|
|
9255
|
+
return __generator(this, function (_a) {
|
|
9256
|
+
switch (_a.label) {
|
|
9147
9257
|
case 0:
|
|
9148
|
-
|
|
9258
|
+
_a.trys.push([0, 8, , 9]);
|
|
9149
9259
|
if (this.disposed || this.viewer.isDestroyed()) {
|
|
9150
9260
|
return [2 /*return*/];
|
|
9151
9261
|
}
|
|
@@ -9159,157 +9269,523 @@ var EntitiesLoadedRenderManager;
|
|
|
9159
9269
|
var _a;
|
|
9160
9270
|
return isEntityInItem_1((_a = x === null || x === void 0 ? void 0 : x.Bruce) === null || _a === void 0 ? void 0 : _a.ID);
|
|
9161
9271
|
});
|
|
9162
|
-
return [
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
visualRegister: this.visualsManager,
|
|
9168
|
-
zoomControl: this.item.CameraZoomSettings,
|
|
9169
|
-
force: force
|
|
9170
|
-
})];
|
|
9272
|
+
if (!this.useGeojson) return [3 /*break*/, 5];
|
|
9273
|
+
zoomItem = this.item.CameraZoomSettings[0];
|
|
9274
|
+
if (!(zoomItem.DisplayType == ZoomControl.EDisplayType.Point)) return [3 /*break*/, 2];
|
|
9275
|
+
// We'll just render these as individuals since we don't support point geojson.
|
|
9276
|
+
return [4 /*yield*/, this.renderAsIndividuals(entities, force)];
|
|
9171
9277
|
case 1:
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
|
|
9175
|
-
|
|
9176
|
-
|
|
9177
|
-
|
|
9178
|
-
|
|
9179
|
-
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
menuItemId: this.item.id
|
|
9188
|
-
})) === null || _a === void 0 ? void 0 : _a.visual;
|
|
9189
|
-
if (!visual || visual != cEntity) {
|
|
9190
|
-
this.visualsManager.AddRego({
|
|
9191
|
-
rego: {
|
|
9192
|
-
entityId: id,
|
|
9193
|
-
menuItemId: this.item.id,
|
|
9194
|
-
visual: cEntity,
|
|
9195
|
-
priority: 0,
|
|
9196
|
-
entityTypeId: entity.Bruce["EntityType.ID"],
|
|
9197
|
-
accountId: this.apiGetter.accountId,
|
|
9198
|
-
name: cEntity.name
|
|
9199
|
-
},
|
|
9200
|
-
requestRender: false
|
|
9201
|
-
});
|
|
9202
|
-
}
|
|
9203
|
-
}
|
|
9204
|
-
else {
|
|
9205
|
-
this.visualsManager.RemoveRegos({
|
|
9206
|
-
entityId: id,
|
|
9207
|
-
menuItemId: this.item.id,
|
|
9208
|
-
requestRender: false
|
|
9209
|
-
});
|
|
9210
|
-
}
|
|
9211
|
-
}
|
|
9212
|
-
this.viewer.scene.requestRender();
|
|
9213
|
-
return [3 /*break*/, 3];
|
|
9214
|
-
case 2:
|
|
9215
|
-
e_2 = _b.sent();
|
|
9278
|
+
// We'll just render these as individuals since we don't support point geojson.
|
|
9279
|
+
_a.sent();
|
|
9280
|
+
return [3 /*break*/, 4];
|
|
9281
|
+
case 2: return [4 /*yield*/, this.renderAsGeojson(entities, force)];
|
|
9282
|
+
case 3:
|
|
9283
|
+
_a.sent();
|
|
9284
|
+
_a.label = 4;
|
|
9285
|
+
case 4: return [3 /*break*/, 7];
|
|
9286
|
+
case 5: return [4 /*yield*/, this.renderAsIndividuals(entities, force)];
|
|
9287
|
+
case 6:
|
|
9288
|
+
_a.sent();
|
|
9289
|
+
_a.label = 7;
|
|
9290
|
+
case 7: return [3 /*break*/, 9];
|
|
9291
|
+
case 8:
|
|
9292
|
+
e_2 = _a.sent();
|
|
9216
9293
|
console.error(e_2);
|
|
9217
|
-
return [3 /*break*/,
|
|
9218
|
-
case
|
|
9294
|
+
return [3 /*break*/, 9];
|
|
9295
|
+
case 9: return [2 /*return*/];
|
|
9219
9296
|
}
|
|
9220
9297
|
});
|
|
9221
9298
|
});
|
|
9222
9299
|
};
|
|
9223
|
-
|
|
9224
|
-
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
|
|
9231
|
-
* This will render them in batches to avoid overloading the viewer.
|
|
9232
|
-
*/
|
|
9233
|
-
var EntitiesIdsRenderManager;
|
|
9234
|
-
(function (EntitiesIdsRenderManager) {
|
|
9235
|
-
var Manager = /** @class */ (function () {
|
|
9236
|
-
function Manager(params) {
|
|
9237
|
-
var _a;
|
|
9238
|
-
this.getter = null;
|
|
9239
|
-
this.getterSub = null;
|
|
9240
|
-
this.disposed = false;
|
|
9241
|
-
this.renderedEntities = {};
|
|
9242
|
-
var viewer = params.viewer, apiGetter = params.apiGetter, monitor = params.monitor, item = params.item, visualsManager = params.register;
|
|
9243
|
-
this.viewer = viewer;
|
|
9244
|
-
this.apiGetter = apiGetter;
|
|
9245
|
-
this.monitor = monitor;
|
|
9246
|
-
this.item = item;
|
|
9247
|
-
this.visualsManager = visualsManager;
|
|
9248
|
-
if (this.item.enableClustering) {
|
|
9249
|
-
this.clustering = new PointClustering(visualsManager, this.item.id, (_a = this.item) === null || _a === void 0 ? void 0 : _a.clustering);
|
|
9250
|
-
}
|
|
9251
|
-
}
|
|
9252
|
-
Object.defineProperty(Manager.prototype, "Disposed", {
|
|
9253
|
-
get: function () {
|
|
9254
|
-
return this.disposed;
|
|
9255
|
-
},
|
|
9256
|
-
enumerable: false,
|
|
9257
|
-
configurable: true
|
|
9258
|
-
});
|
|
9259
|
-
Manager.prototype.Init = function () {
|
|
9260
|
-
var _this = this;
|
|
9261
|
-
var _a;
|
|
9262
|
-
if (this.disposed) {
|
|
9263
|
-
throw (new Error("This item is disposed."));
|
|
9264
|
-
}
|
|
9265
|
-
if (!((_a = this.item.CameraZoomSettings) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
9266
|
-
this.item.CameraZoomSettings = [
|
|
9267
|
-
{
|
|
9268
|
-
MinZoom: 0,
|
|
9269
|
-
MaxZoom: 100000,
|
|
9270
|
-
DisplayType: ZoomControl.EDisplayType.Model3D,
|
|
9271
|
-
LODCategoryID: "glb",
|
|
9272
|
-
LODLevel: 0,
|
|
9273
|
-
StyleID: 0
|
|
9274
|
-
}
|
|
9275
|
-
];
|
|
9276
|
-
}
|
|
9277
|
-
this.getter = new BatchedDataGetter.Getter(this.item.BruceEntity.EntityIds, this.monitor, BATCH_SIZE$2);
|
|
9278
|
-
this.getterSub = this.getter.OnUpdate.Subscribe(function (ids) {
|
|
9279
|
-
_this.onGetterUpdate(ids);
|
|
9280
|
-
});
|
|
9281
|
-
this.getter.Start();
|
|
9282
|
-
};
|
|
9283
|
-
Manager.prototype.Dispose = function () {
|
|
9284
|
-
var _a, _b;
|
|
9285
|
-
if (this.disposed) {
|
|
9286
|
-
return;
|
|
9287
|
-
}
|
|
9288
|
-
(_a = this.getterSub) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
9289
|
-
this.getterSub = null;
|
|
9290
|
-
this.disposed = true;
|
|
9291
|
-
this.visualsManager.RemoveRegos({
|
|
9292
|
-
menuItemId: this.item.id
|
|
9293
|
-
});
|
|
9294
|
-
(_b = this.clustering) === null || _b === void 0 ? void 0 : _b.Dispose();
|
|
9295
|
-
};
|
|
9296
|
-
Manager.prototype.ReRender = function (params) {
|
|
9300
|
+
/**
|
|
9301
|
+
* Our optimized and more stable path.
|
|
9302
|
+
* We construct a geojson that we draw in one go.
|
|
9303
|
+
* @param entities
|
|
9304
|
+
* @param force TODO: This should re-render entities that are already rendered.
|
|
9305
|
+
*/
|
|
9306
|
+
Manager.prototype.renderAsGeojson = function (entities, force) {
|
|
9307
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
9297
9308
|
return __awaiter(this, void 0, void 0, function () {
|
|
9298
|
-
var
|
|
9309
|
+
var zoomItem, lods, withLods_1, individuals, style, e_3, entityTypeId, entityType, e_4, pStyle, lStyle, polygonsClamped, bFillColor, cFillColor, bLineColor, cLineColor, lineWidthPx, geojson, notRendered, source, groups, applyStyle, register, sEntities, i, cEntity;
|
|
9299
9310
|
var _this = this;
|
|
9300
|
-
return __generator(this, function (
|
|
9301
|
-
|
|
9302
|
-
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
|
|
9309
|
-
|
|
9310
|
-
|
|
9311
|
-
|
|
9312
|
-
|
|
9311
|
+
return __generator(this, function (_o) {
|
|
9312
|
+
switch (_o.label) {
|
|
9313
|
+
case 0:
|
|
9314
|
+
entities = entities.filter(function (entity) {
|
|
9315
|
+
var _a;
|
|
9316
|
+
return !_this.renderedEntities[(_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID];
|
|
9317
|
+
});
|
|
9318
|
+
// Mark these as rendered.
|
|
9319
|
+
entities.forEach(function (entity) {
|
|
9320
|
+
var _a;
|
|
9321
|
+
_this.renderedEntities[(_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID] = true;
|
|
9322
|
+
});
|
|
9323
|
+
zoomItem = this.item.CameraZoomSettings[0];
|
|
9324
|
+
if (!(zoomItem.DisplayType == ZoomControl.EDisplayType.Model3D && entities.length)) return [3 /*break*/, 2];
|
|
9325
|
+
return [4 /*yield*/, EntityLod.GetLods({
|
|
9326
|
+
api: this.apiGetter.getApi(),
|
|
9327
|
+
filter: {
|
|
9328
|
+
externalSources: false,
|
|
9329
|
+
Items: entities.map(function (x) {
|
|
9330
|
+
var _a, _b;
|
|
9331
|
+
return {
|
|
9332
|
+
entityId: (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID,
|
|
9333
|
+
categoryId: (_b = zoomItem.LODCategoryID) !== null && _b !== void 0 ? _b : "GLB",
|
|
9334
|
+
group: "DEFAULT",
|
|
9335
|
+
level: Number(zoomItem.LODLevel)
|
|
9336
|
+
};
|
|
9337
|
+
}),
|
|
9338
|
+
strict: false
|
|
9339
|
+
}
|
|
9340
|
+
})];
|
|
9341
|
+
case 1:
|
|
9342
|
+
lods = (_o.sent()).lods;
|
|
9343
|
+
if (this.disposed) {
|
|
9344
|
+
this.doDispose();
|
|
9345
|
+
return [2 /*return*/];
|
|
9346
|
+
}
|
|
9347
|
+
withLods_1 = lods.filter(function (x) { return x.entityId && !!x.clientFileId; }).map(function (x) { return x.entityId; });
|
|
9348
|
+
individuals = entities.filter(function (entity) {
|
|
9349
|
+
var _a;
|
|
9350
|
+
return withLods_1.includes((_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID);
|
|
9351
|
+
});
|
|
9352
|
+
if (individuals.length) {
|
|
9353
|
+
this.renderAsIndividuals(individuals, force);
|
|
9354
|
+
}
|
|
9355
|
+
// Now we proceed with what is left.
|
|
9356
|
+
entities = entities.filter(function (entity) {
|
|
9357
|
+
var _a;
|
|
9358
|
+
return !withLods_1.includes((_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID);
|
|
9359
|
+
});
|
|
9360
|
+
_o.label = 2;
|
|
9361
|
+
case 2:
|
|
9362
|
+
if (!entities.length) {
|
|
9363
|
+
return [2 /*return*/];
|
|
9364
|
+
}
|
|
9365
|
+
style = null;
|
|
9366
|
+
if (!((zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID) && (zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID) > -1)) return [3 /*break*/, 6];
|
|
9367
|
+
_o.label = 3;
|
|
9368
|
+
case 3:
|
|
9369
|
+
_o.trys.push([3, 5, , 6]);
|
|
9370
|
+
return [4 /*yield*/, Style.Get({
|
|
9371
|
+
api: this.apiGetter.getApi(),
|
|
9372
|
+
styleId: zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID
|
|
9373
|
+
})];
|
|
9374
|
+
case 4:
|
|
9375
|
+
style = (_a = (_o.sent()).style) === null || _a === void 0 ? void 0 : _a.Settings;
|
|
9376
|
+
return [3 /*break*/, 6];
|
|
9377
|
+
case 5:
|
|
9378
|
+
e_3 = _o.sent();
|
|
9379
|
+
console.error(e_3);
|
|
9380
|
+
return [3 /*break*/, 6];
|
|
9381
|
+
case 6:
|
|
9382
|
+
entityTypeId = (_b = this.item.BruceEntity) === null || _b === void 0 ? void 0 : _b["EntityType.ID"];
|
|
9383
|
+
if (!entityTypeId) {
|
|
9384
|
+
entityTypeId = (_d = (_c = entities.find(function (x) { var _a; return !!((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a["EntityType.ID"]); })) === null || _c === void 0 ? void 0 : _c.Bruce) === null || _d === void 0 ? void 0 : _d["EntityType.ID"];
|
|
9385
|
+
}
|
|
9386
|
+
if (!entityTypeId) return [3 /*break*/, 12];
|
|
9387
|
+
_o.label = 7;
|
|
9388
|
+
case 7:
|
|
9389
|
+
_o.trys.push([7, 11, , 12]);
|
|
9390
|
+
return [4 /*yield*/, EntityType.Get({
|
|
9391
|
+
entityTypeId: entityTypeId,
|
|
9392
|
+
api: this.apiGetter.getApi()
|
|
9393
|
+
})];
|
|
9394
|
+
case 8:
|
|
9395
|
+
entityType = (_e = (_o.sent())) === null || _e === void 0 ? void 0 : _e.entityType;
|
|
9396
|
+
if (!(!style && entityType)) return [3 /*break*/, 10];
|
|
9397
|
+
if (!(entityType["DisplaySetting.ID"] && entityType["DisplaySetting.ID"] > 0)) return [3 /*break*/, 10];
|
|
9398
|
+
return [4 /*yield*/, Style.Get({
|
|
9399
|
+
api: this.apiGetter.getApi(),
|
|
9400
|
+
styleId: entityType["DisplaySetting.ID"]
|
|
9401
|
+
})];
|
|
9402
|
+
case 9:
|
|
9403
|
+
style = (_f = (_o.sent()).style) === null || _f === void 0 ? void 0 : _f.Settings;
|
|
9404
|
+
_o.label = 10;
|
|
9405
|
+
case 10: return [3 /*break*/, 12];
|
|
9406
|
+
case 11:
|
|
9407
|
+
e_4 = _o.sent();
|
|
9408
|
+
console.error(e_4);
|
|
9409
|
+
return [3 /*break*/, 12];
|
|
9410
|
+
case 12:
|
|
9411
|
+
pStyle = (_g = style === null || style === void 0 ? void 0 : style.polygonStyle) !== null && _g !== void 0 ? _g : {};
|
|
9412
|
+
lStyle = (_h = style === null || style === void 0 ? void 0 : style.polylineStyle) !== null && _h !== void 0 ? _h : {};
|
|
9413
|
+
polygonsClamped = ((_j = pStyle === null || pStyle === void 0 ? void 0 : pStyle.altitudeOption) === null || _j === void 0 ? void 0 : _j.id) == null ? true : ((_k = pStyle === null || pStyle === void 0 ? void 0 : pStyle.altitudeOption) === null || _k === void 0 ? void 0 : _k.id) == 0;
|
|
9414
|
+
bFillColor = Calculator.GetColor(pStyle.fillColor, {}, []);
|
|
9415
|
+
cFillColor = bFillColor ? colorToCColor$3(bFillColor) : Color.fromCssColorString("rgba(139, 195, 74, 0.8)");
|
|
9416
|
+
bLineColor = Calculator.GetColor(pStyle.lineColor, {}, []);
|
|
9417
|
+
cLineColor = bLineColor ? colorToCColor$3(bLineColor) : Color.fromCssColorString("rgba(80, 80, 80, 0.8)");
|
|
9418
|
+
lineWidthPx = pStyle.lineWidth ? Calculator.GetNumber(pStyle.lineWidth, {}, []) : null;
|
|
9419
|
+
if (lineWidthPx == null) {
|
|
9420
|
+
lineWidthPx = 1;
|
|
9421
|
+
}
|
|
9422
|
+
lineWidthPx = EnsureNumber(lineWidthPx);
|
|
9423
|
+
if (lineWidthPx < 0.01) {
|
|
9424
|
+
lineWidthPx = 0;
|
|
9425
|
+
}
|
|
9426
|
+
lineWidthPx = Math.round(lineWidthPx);
|
|
9427
|
+
geojson = Entity$1.ToGeoJson({
|
|
9428
|
+
entities: entities,
|
|
9429
|
+
includeUserData: false,
|
|
9430
|
+
excludeAltitude: polygonsClamped && lineWidthPx <= 0,
|
|
9431
|
+
altitude: lineWidthPx > 0 && polygonsClamped ? 1 : null,
|
|
9432
|
+
// No points.
|
|
9433
|
+
allowedDisplayTypes: [ZoomControl.EDisplayType.Geometry]
|
|
9434
|
+
});
|
|
9435
|
+
notRendered = !((_l = geojson === null || geojson === void 0 ? void 0 : geojson.features) === null || _l === void 0 ? void 0 : _l.length) ? entities : entities.filter(function (entity) {
|
|
9436
|
+
return !geojson.features.some(function (feature) {
|
|
9437
|
+
var _a, _b, _c;
|
|
9438
|
+
return ((_b = (_a = feature.properties) === null || _a === void 0 ? void 0 : _a.Bruce) === null || _b === void 0 ? void 0 : _b.ID) == ((_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c.ID);
|
|
9439
|
+
});
|
|
9440
|
+
});
|
|
9441
|
+
if (notRendered.length) {
|
|
9442
|
+
this.renderAsIndividuals(notRendered, force);
|
|
9443
|
+
}
|
|
9444
|
+
if (!((_m = geojson === null || geojson === void 0 ? void 0 : geojson.features) === null || _m === void 0 ? void 0 : _m.length)) {
|
|
9445
|
+
return [2 /*return*/];
|
|
9446
|
+
}
|
|
9447
|
+
return [4 /*yield*/, GeoJsonDataSource.load(geojson, {
|
|
9448
|
+
stroke: cLineColor,
|
|
9449
|
+
fill: cFillColor,
|
|
9450
|
+
strokeWidth: lineWidthPx,
|
|
9451
|
+
clampToGround: lineWidthPx <= 0 && polygonsClamped
|
|
9452
|
+
})];
|
|
9453
|
+
case 13:
|
|
9454
|
+
source = _o.sent();
|
|
9455
|
+
this.viewer.dataSources.add(source);
|
|
9456
|
+
this.sources.push(source);
|
|
9457
|
+
if (this.disposed) {
|
|
9458
|
+
this.doDispose();
|
|
9459
|
+
return [2 /*return*/];
|
|
9460
|
+
}
|
|
9461
|
+
groups = [];
|
|
9462
|
+
applyStyle = function (thing, entityId, data) {
|
|
9463
|
+
if (thing.polygon) {
|
|
9464
|
+
var bFillColor_1 = Calculator.GetColor(pStyle.fillColor, data, []);
|
|
9465
|
+
var cFillColor_1 = bFillColor_1 ? colorToCColor$3(bFillColor_1) : Color.fromCssColorString("rgba(139, 195, 74, 0.8)");
|
|
9466
|
+
var bLineColor_1 = Calculator.GetColor(pStyle.lineColor, data, []);
|
|
9467
|
+
var cLineColor_1 = bLineColor_1 ? colorToCColor$3(bLineColor_1) : Color.fromCssColorString("rgba(80, 80, 80, 0.8)");
|
|
9468
|
+
var width = pStyle.lineWidth ? Calculator.GetNumber(pStyle.lineWidth, data, []) : null;
|
|
9469
|
+
if (width == null) {
|
|
9470
|
+
width = 1;
|
|
9471
|
+
}
|
|
9472
|
+
width = EnsureNumber(width);
|
|
9473
|
+
if (width < 0.01) {
|
|
9474
|
+
width = 0;
|
|
9475
|
+
}
|
|
9476
|
+
var curFillColor = getValue$4(_this.viewer, thing.polygon.material);
|
|
9477
|
+
if (curFillColor && curFillColor instanceof ColorMaterialProperty) {
|
|
9478
|
+
curFillColor = curFillColor.color;
|
|
9479
|
+
}
|
|
9480
|
+
var curLineColor = getValue$4(_this.viewer, thing.polygon.outlineColor);
|
|
9481
|
+
if (curLineColor && curLineColor instanceof ColorMaterialProperty) {
|
|
9482
|
+
curLineColor = curLineColor.color;
|
|
9483
|
+
}
|
|
9484
|
+
var curWidth = getValue$4(_this.viewer, thing.polygon.outlineWidth);
|
|
9485
|
+
if ((curFillColor instanceof Color && curFillColor.equals(cFillColor_1)) &&
|
|
9486
|
+
(curLineColor instanceof Color && curLineColor.equals(cLineColor_1)) &&
|
|
9487
|
+
curWidth == width) {
|
|
9488
|
+
return;
|
|
9489
|
+
}
|
|
9490
|
+
thing.polygon.material = cFillColor_1;
|
|
9491
|
+
thing.polygon.outlineColor = cLineColor_1;
|
|
9492
|
+
thing.polygon.outlineWidth = width;
|
|
9493
|
+
}
|
|
9494
|
+
else if (thing.polyline) {
|
|
9495
|
+
var bColor = lStyle.lineColor ? Calculator.GetColor(lStyle.lineColor, data, []) : null;
|
|
9496
|
+
var cColor = bColor ? colorToCColor$3(bColor) : Color.fromCssColorString("rgba(255, 193, 7, 0.8)");
|
|
9497
|
+
var width = lStyle.lineWidth ? Calculator.GetNumber(lStyle.lineWidth, data, []) : null;
|
|
9498
|
+
if (width == null) {
|
|
9499
|
+
width = 2;
|
|
9500
|
+
}
|
|
9501
|
+
width = EnsureNumber(width);
|
|
9502
|
+
if (width < 0.01) {
|
|
9503
|
+
width = 0;
|
|
9504
|
+
}
|
|
9505
|
+
var curColor = getValue$4(_this.viewer, thing.polyline.material);
|
|
9506
|
+
if (curColor && curColor instanceof ColorMaterialProperty) {
|
|
9507
|
+
curColor = curColor.color;
|
|
9508
|
+
}
|
|
9509
|
+
var curWidth = getValue$4(_this.viewer, thing.polyline.width);
|
|
9510
|
+
if ((curColor instanceof Color && curColor.equals(cColor)) &&
|
|
9511
|
+
curWidth == width) {
|
|
9512
|
+
return;
|
|
9513
|
+
}
|
|
9514
|
+
thing.polyline.material = cColor;
|
|
9515
|
+
thing.polyline.width = width;
|
|
9516
|
+
}
|
|
9517
|
+
};
|
|
9518
|
+
register = function (thing) {
|
|
9519
|
+
var _a, _b, _c, _d;
|
|
9520
|
+
// See if the cesium entity already exists in a group.
|
|
9521
|
+
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; }); });
|
|
9522
|
+
if (group) {
|
|
9523
|
+
return;
|
|
9524
|
+
}
|
|
9525
|
+
var metadata = getValue$4(_this.viewer, thing === null || thing === void 0 ? void 0 : thing.properties);
|
|
9526
|
+
var entityId = (_a = metadata === null || metadata === void 0 ? void 0 : metadata.Bruce) === null || _a === void 0 ? void 0 : _a.ID;
|
|
9527
|
+
if (!entityId) {
|
|
9528
|
+
return;
|
|
9529
|
+
}
|
|
9530
|
+
var needsUpdate = false;
|
|
9531
|
+
// Find group for the nextspace entity ID.
|
|
9532
|
+
group = groups.find(function (x) { return x.entityId == entityId; });
|
|
9533
|
+
// No group yet. We can designate this as the primary entity and create a new group for it.
|
|
9534
|
+
if (!group) {
|
|
9535
|
+
group = {
|
|
9536
|
+
entityId: entityId,
|
|
9537
|
+
visual: thing,
|
|
9538
|
+
tagIds: (_b = metadata === null || metadata === void 0 ? void 0 : metadata.Bruce) === null || _b === void 0 ? void 0 : _b["Layer.ID"],
|
|
9539
|
+
entityTypeId: (_c = metadata === null || metadata === void 0 ? void 0 : metadata.Bruce) === null || _c === void 0 ? void 0 : _c["EntityType.ID"],
|
|
9540
|
+
siblings: [],
|
|
9541
|
+
data: entities.find(function (x) { var _a; return ((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID) == entityId; }),
|
|
9542
|
+
rego: null
|
|
9543
|
+
};
|
|
9544
|
+
groups.push(group);
|
|
9545
|
+
var rego = {
|
|
9546
|
+
entityId: entityId,
|
|
9547
|
+
menuItemId: _this.item.id,
|
|
9548
|
+
visual: thing,
|
|
9549
|
+
priority: 0,
|
|
9550
|
+
entityTypeId: group.entityTypeId,
|
|
9551
|
+
accountId: _this.apiGetter.accountId,
|
|
9552
|
+
tagIds: group.tagIds ? [].concat(group.tagIds) : [],
|
|
9553
|
+
name: entityType ? (_d = Entity$1.CalculateName({
|
|
9554
|
+
entity: group.data,
|
|
9555
|
+
type: entityType,
|
|
9556
|
+
defaultToId: false
|
|
9557
|
+
})) !== null && _d !== void 0 ? _d : "Unnamed Entity" : "Unnamed Entity",
|
|
9558
|
+
cdn: _this.item.cdnEnabled,
|
|
9559
|
+
collection: source.entities
|
|
9560
|
+
};
|
|
9561
|
+
group.rego = rego;
|
|
9562
|
+
_this.visualsManager.AddRego({
|
|
9563
|
+
rego: rego,
|
|
9564
|
+
requestRender: false
|
|
9565
|
+
});
|
|
9566
|
+
}
|
|
9567
|
+
// Found a group. We flag this as a sibling entity of the primary.
|
|
9568
|
+
else {
|
|
9569
|
+
group.siblings.push(thing);
|
|
9570
|
+
group.visual._siblingGraphics = group.siblings;
|
|
9571
|
+
thing._parentEntity = group.visual;
|
|
9572
|
+
if (group.rego) {
|
|
9573
|
+
_this.visualsManager.RefreshMark({
|
|
9574
|
+
rego: group.rego
|
|
9575
|
+
});
|
|
9576
|
+
needsUpdate = true;
|
|
9577
|
+
}
|
|
9578
|
+
}
|
|
9579
|
+
applyStyle(thing, entityId, group.data);
|
|
9580
|
+
if (needsUpdate) {
|
|
9581
|
+
_this.visualsManager.ForceUpdate({
|
|
9582
|
+
entityIds: [entityId],
|
|
9583
|
+
});
|
|
9584
|
+
}
|
|
9585
|
+
};
|
|
9586
|
+
sEntities = source.entities.values;
|
|
9587
|
+
for (i = 0; i < sEntities.length; i++) {
|
|
9588
|
+
cEntity = sEntities[i];
|
|
9589
|
+
register(cEntity);
|
|
9590
|
+
}
|
|
9591
|
+
this.viewer.scene.requestRender();
|
|
9592
|
+
return [2 /*return*/];
|
|
9593
|
+
}
|
|
9594
|
+
});
|
|
9595
|
+
});
|
|
9596
|
+
};
|
|
9597
|
+
/**
|
|
9598
|
+
* Our default path.
|
|
9599
|
+
* We render each entity individually.
|
|
9600
|
+
* @param entities
|
|
9601
|
+
* @param force
|
|
9602
|
+
* @returns
|
|
9603
|
+
*/
|
|
9604
|
+
Manager.prototype.renderAsIndividuals = function (entities, force) {
|
|
9605
|
+
var _a;
|
|
9606
|
+
if (force === void 0) { force = false; }
|
|
9607
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
9608
|
+
var cEntities, isEntityInItem, i, entity, id, cEntity, visual;
|
|
9609
|
+
var _this = this;
|
|
9610
|
+
return __generator(this, function (_b) {
|
|
9611
|
+
switch (_b.label) {
|
|
9612
|
+
case 0: return [4 /*yield*/, EntityRenderEngine.Render({
|
|
9613
|
+
viewer: this.viewer,
|
|
9614
|
+
apiGetter: this.apiGetter,
|
|
9615
|
+
entities: entities,
|
|
9616
|
+
menuItemId: this.item.id,
|
|
9617
|
+
visualRegister: this.visualsManager,
|
|
9618
|
+
zoomControl: this.item.CameraZoomSettings,
|
|
9619
|
+
force: force
|
|
9620
|
+
})];
|
|
9621
|
+
case 1:
|
|
9622
|
+
cEntities = _b.sent();
|
|
9623
|
+
if (this.disposed) {
|
|
9624
|
+
this.visualsManager.RemoveRegos({
|
|
9625
|
+
menuItemId: this.item.id
|
|
9626
|
+
});
|
|
9627
|
+
return [2 /*return*/];
|
|
9628
|
+
}
|
|
9629
|
+
isEntityInItem = function (entityId) {
|
|
9630
|
+
var _a, _b;
|
|
9631
|
+
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; });
|
|
9632
|
+
};
|
|
9633
|
+
for (i = 0; i < entities.length; i++) {
|
|
9634
|
+
entity = entities[i];
|
|
9635
|
+
id = entity.Bruce.ID;
|
|
9636
|
+
cEntity = cEntities[id];
|
|
9637
|
+
this.renderedEntities[id] = !!cEntity;
|
|
9638
|
+
if (cEntity && isEntityInItem(id)) {
|
|
9639
|
+
visual = (_a = this.visualsManager.GetRego({
|
|
9640
|
+
entityId: id,
|
|
9641
|
+
menuItemId: this.item.id
|
|
9642
|
+
})) === null || _a === void 0 ? void 0 : _a.visual;
|
|
9643
|
+
if (!visual || visual != cEntity) {
|
|
9644
|
+
this.visualsManager.AddRego({
|
|
9645
|
+
rego: {
|
|
9646
|
+
entityId: id,
|
|
9647
|
+
menuItemId: this.item.id,
|
|
9648
|
+
visual: cEntity,
|
|
9649
|
+
priority: 0,
|
|
9650
|
+
entityTypeId: entity.Bruce["EntityType.ID"],
|
|
9651
|
+
accountId: this.apiGetter.accountId,
|
|
9652
|
+
name: cEntity.name
|
|
9653
|
+
},
|
|
9654
|
+
requestRender: false
|
|
9655
|
+
});
|
|
9656
|
+
}
|
|
9657
|
+
}
|
|
9658
|
+
else {
|
|
9659
|
+
this.visualsManager.RemoveRegos({
|
|
9660
|
+
entityId: id,
|
|
9661
|
+
menuItemId: this.item.id,
|
|
9662
|
+
requestRender: false
|
|
9663
|
+
});
|
|
9664
|
+
}
|
|
9665
|
+
}
|
|
9666
|
+
this.viewer.scene.requestRender();
|
|
9667
|
+
return [2 /*return*/];
|
|
9668
|
+
}
|
|
9669
|
+
});
|
|
9670
|
+
});
|
|
9671
|
+
};
|
|
9672
|
+
return Manager;
|
|
9673
|
+
}());
|
|
9674
|
+
EntitiesLoadedRenderManager.Manager = Manager;
|
|
9675
|
+
})(EntitiesLoadedRenderManager || (EntitiesLoadedRenderManager = {}));
|
|
9676
|
+
|
|
9677
|
+
var BATCH_SIZE$2 = 500;
|
|
9678
|
+
function getValue$5(viewer, obj) {
|
|
9679
|
+
if (obj === null || obj === void 0 ? void 0 : obj.getValue) {
|
|
9680
|
+
return obj.getValue(viewer.scene.lastRenderTime);
|
|
9681
|
+
}
|
|
9682
|
+
return obj;
|
|
9683
|
+
}
|
|
9684
|
+
function colorToCColor$4(color) {
|
|
9685
|
+
return new Color(color.red ? color.red / 255 : 0, color.green ? color.green / 255 : 0, color.blue ? color.blue / 255 : 0, color.alpha);
|
|
9686
|
+
}
|
|
9687
|
+
/**
|
|
9688
|
+
* Render manager for rendering an array of entity ids.
|
|
9689
|
+
* This will render them in batches to avoid overloading the viewer.
|
|
9690
|
+
*/
|
|
9691
|
+
var EntitiesIdsRenderManager;
|
|
9692
|
+
(function (EntitiesIdsRenderManager) {
|
|
9693
|
+
var Manager = /** @class */ (function () {
|
|
9694
|
+
function Manager(params) {
|
|
9695
|
+
var _a;
|
|
9696
|
+
this.getter = null;
|
|
9697
|
+
this.getterSub = null;
|
|
9698
|
+
this.disposed = false;
|
|
9699
|
+
this.renderedEntities = {};
|
|
9700
|
+
this.sources = [];
|
|
9701
|
+
// Highly experimental flag to try improve rendering large sets of polygons and polylines.
|
|
9702
|
+
// Many things are not supported when this is enabled.
|
|
9703
|
+
this.useGeojson = false;
|
|
9704
|
+
var viewer = params.viewer, apiGetter = params.apiGetter, monitor = params.monitor, item = params.item, visualsManager = params.register;
|
|
9705
|
+
this.viewer = viewer;
|
|
9706
|
+
this.apiGetter = apiGetter;
|
|
9707
|
+
this.monitor = monitor;
|
|
9708
|
+
this.item = item;
|
|
9709
|
+
this.visualsManager = visualsManager;
|
|
9710
|
+
this.useGeojson = item.renderAsGeojson == true;
|
|
9711
|
+
if (this.item.enableClustering) {
|
|
9712
|
+
this.clustering = new PointClustering(visualsManager, this.item.id, (_a = this.item) === null || _a === void 0 ? void 0 : _a.clustering);
|
|
9713
|
+
}
|
|
9714
|
+
}
|
|
9715
|
+
Object.defineProperty(Manager.prototype, "Disposed", {
|
|
9716
|
+
get: function () {
|
|
9717
|
+
return this.disposed;
|
|
9718
|
+
},
|
|
9719
|
+
enumerable: false,
|
|
9720
|
+
configurable: true
|
|
9721
|
+
});
|
|
9722
|
+
Manager.prototype.Init = function () {
|
|
9723
|
+
var _this = this;
|
|
9724
|
+
var _a;
|
|
9725
|
+
if (this.disposed) {
|
|
9726
|
+
throw (new Error("This item is disposed."));
|
|
9727
|
+
}
|
|
9728
|
+
if (!((_a = this.item.CameraZoomSettings) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
9729
|
+
this.item.CameraZoomSettings = [
|
|
9730
|
+
{
|
|
9731
|
+
MinZoom: 0,
|
|
9732
|
+
MaxZoom: 100000,
|
|
9733
|
+
DisplayType: ZoomControl.EDisplayType.Model3D,
|
|
9734
|
+
LODCategoryID: "glb",
|
|
9735
|
+
LODLevel: 0,
|
|
9736
|
+
StyleID: 0
|
|
9737
|
+
}
|
|
9738
|
+
];
|
|
9739
|
+
}
|
|
9740
|
+
if (this.renderAsGeojson && this.item.CameraZoomSettings.length > 1) {
|
|
9741
|
+
console.warn("Geojson rendering does not support multiple zoom controls. Only the first one will be used.");
|
|
9742
|
+
this.item.CameraZoomSettings = [this.item.CameraZoomSettings[0]];
|
|
9743
|
+
}
|
|
9744
|
+
this.getter = new BatchedDataGetter.Getter(this.item.BruceEntity.EntityIds, this.monitor, BATCH_SIZE$2);
|
|
9745
|
+
this.getterSub = this.getter.OnUpdate.Subscribe(function (ids) {
|
|
9746
|
+
_this.onGetterUpdate(ids);
|
|
9747
|
+
});
|
|
9748
|
+
this.getter.Start();
|
|
9749
|
+
};
|
|
9750
|
+
Manager.prototype.Dispose = function () {
|
|
9751
|
+
if (this.disposed) {
|
|
9752
|
+
return;
|
|
9753
|
+
}
|
|
9754
|
+
this.doDispose();
|
|
9755
|
+
};
|
|
9756
|
+
Manager.prototype.doDispose = function () {
|
|
9757
|
+
var _a, _b;
|
|
9758
|
+
(_a = this.getterSub) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
9759
|
+
this.getterSub = null;
|
|
9760
|
+
this.disposed = true;
|
|
9761
|
+
this.visualsManager.RemoveRegos({
|
|
9762
|
+
menuItemId: this.item.id
|
|
9763
|
+
});
|
|
9764
|
+
(_b = this.clustering) === null || _b === void 0 ? void 0 : _b.Dispose();
|
|
9765
|
+
this.clustering = null;
|
|
9766
|
+
for (var i = 0; i < this.sources.length; i++) {
|
|
9767
|
+
var source = this.sources[i];
|
|
9768
|
+
this.viewer.dataSources.remove(source);
|
|
9769
|
+
}
|
|
9770
|
+
this.sources = [];
|
|
9771
|
+
};
|
|
9772
|
+
Manager.prototype.ReRender = function (params) {
|
|
9773
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
9774
|
+
var entityIds, force, entities;
|
|
9775
|
+
var _this = this;
|
|
9776
|
+
return __generator(this, function (_a) {
|
|
9777
|
+
entityIds = params.entityIds, force = params.force, entities = params.entities;
|
|
9778
|
+
if (entities && !entityIds) {
|
|
9779
|
+
entityIds = entities.map(function (x) { var _a; return (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID; });
|
|
9780
|
+
}
|
|
9781
|
+
if (entityIds == null) {
|
|
9782
|
+
entityIds = Object.keys(this.renderedEntities);
|
|
9783
|
+
}
|
|
9784
|
+
else {
|
|
9785
|
+
// ensure entity ids are part of menu item.
|
|
9786
|
+
entityIds = entityIds.filter(function (x) {
|
|
9787
|
+
var _a;
|
|
9788
|
+
return (_a = _this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.EntityIds.includes(x);
|
|
9313
9789
|
});
|
|
9314
9790
|
}
|
|
9315
9791
|
this.visualsManager.MarkStale({
|
|
@@ -9333,6 +9809,10 @@ var EntitiesIdsRenderManager;
|
|
|
9333
9809
|
}
|
|
9334
9810
|
if (CameraZoomSettings === null || CameraZoomSettings === void 0 ? void 0 : CameraZoomSettings.length) {
|
|
9335
9811
|
this.item.CameraZoomSettings = CameraZoomSettings;
|
|
9812
|
+
if (this.renderAsGeojson && this.item.CameraZoomSettings.length > 1) {
|
|
9813
|
+
console.warn("Geojson rendering does not support multiple zoom controls. Only the first one will be used.");
|
|
9814
|
+
this.item.CameraZoomSettings = [this.item.CameraZoomSettings[0]];
|
|
9815
|
+
}
|
|
9336
9816
|
}
|
|
9337
9817
|
if (queueRerender != false) {
|
|
9338
9818
|
var entityIds = Object.keys(this.renderedEntities);
|
|
@@ -9353,53 +9833,391 @@ var EntitiesIdsRenderManager;
|
|
|
9353
9833
|
if (this.disposed || this.viewer.isDestroyed()) {
|
|
9354
9834
|
return [2 /*return*/];
|
|
9355
9835
|
}
|
|
9356
|
-
_a.label = 1;
|
|
9357
|
-
case 1:
|
|
9358
|
-
_a.trys.push([1, 4, , 5]);
|
|
9359
|
-
api = this.apiGetter.getApi();
|
|
9360
|
-
return [4 /*yield*/, Entity$1.GetListByIds({
|
|
9361
|
-
api: api,
|
|
9362
|
-
entityIds: entityIds
|
|
9363
|
-
})];
|
|
9836
|
+
_a.label = 1;
|
|
9837
|
+
case 1:
|
|
9838
|
+
_a.trys.push([1, 4, , 5]);
|
|
9839
|
+
api = this.apiGetter.getApi();
|
|
9840
|
+
return [4 /*yield*/, Entity$1.GetListByIds({
|
|
9841
|
+
api: api,
|
|
9842
|
+
entityIds: entityIds
|
|
9843
|
+
})];
|
|
9844
|
+
case 2:
|
|
9845
|
+
entities = (_a.sent()).entities;
|
|
9846
|
+
return [4 /*yield*/, this.renderEntities(entities, force)];
|
|
9847
|
+
case 3:
|
|
9848
|
+
_a.sent();
|
|
9849
|
+
return [3 /*break*/, 5];
|
|
9850
|
+
case 4:
|
|
9851
|
+
e_1 = _a.sent();
|
|
9852
|
+
console.error(e_1);
|
|
9853
|
+
return [3 /*break*/, 5];
|
|
9854
|
+
case 5: return [2 /*return*/];
|
|
9855
|
+
}
|
|
9856
|
+
});
|
|
9857
|
+
});
|
|
9858
|
+
};
|
|
9859
|
+
Manager.prototype.renderEntities = function (entities, force) {
|
|
9860
|
+
if (force === void 0) { force = false; }
|
|
9861
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
9862
|
+
var zoomItem, e_2;
|
|
9863
|
+
return __generator(this, function (_a) {
|
|
9864
|
+
switch (_a.label) {
|
|
9865
|
+
case 0:
|
|
9866
|
+
if (this.disposed || this.viewer.isDestroyed()) {
|
|
9867
|
+
return [2 /*return*/];
|
|
9868
|
+
}
|
|
9869
|
+
_a.label = 1;
|
|
9870
|
+
case 1:
|
|
9871
|
+
_a.trys.push([1, 9, , 10]);
|
|
9872
|
+
if (!this.useGeojson) return [3 /*break*/, 6];
|
|
9873
|
+
zoomItem = this.item.CameraZoomSettings[0];
|
|
9874
|
+
if (!(zoomItem.DisplayType == ZoomControl.EDisplayType.Point)) return [3 /*break*/, 3];
|
|
9875
|
+
// We'll just render these as individuals since we don't support point geojson.
|
|
9876
|
+
return [4 /*yield*/, this.renderAsIndividuals(entities, force)];
|
|
9877
|
+
case 2:
|
|
9878
|
+
// We'll just render these as individuals since we don't support point geojson.
|
|
9879
|
+
_a.sent();
|
|
9880
|
+
return [3 /*break*/, 5];
|
|
9881
|
+
case 3: return [4 /*yield*/, this.renderAsGeojson(entities, force)];
|
|
9882
|
+
case 4:
|
|
9883
|
+
_a.sent();
|
|
9884
|
+
_a.label = 5;
|
|
9885
|
+
case 5: return [3 /*break*/, 8];
|
|
9886
|
+
case 6: return [4 /*yield*/, this.renderAsIndividuals(entities, force)];
|
|
9887
|
+
case 7:
|
|
9888
|
+
_a.sent();
|
|
9889
|
+
_a.label = 8;
|
|
9890
|
+
case 8: return [3 /*break*/, 10];
|
|
9891
|
+
case 9:
|
|
9892
|
+
e_2 = _a.sent();
|
|
9893
|
+
console.error(e_2);
|
|
9894
|
+
return [3 /*break*/, 10];
|
|
9895
|
+
case 10: return [2 /*return*/];
|
|
9896
|
+
}
|
|
9897
|
+
});
|
|
9898
|
+
});
|
|
9899
|
+
};
|
|
9900
|
+
/**
|
|
9901
|
+
* Our optimized and more stable path.
|
|
9902
|
+
* We construct a geojson that we draw in one go.
|
|
9903
|
+
* @param entities
|
|
9904
|
+
* @param force TODO: This should re-render entities that are already rendered.
|
|
9905
|
+
*/
|
|
9906
|
+
Manager.prototype.renderAsGeojson = function (entities, force) {
|
|
9907
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
9908
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
9909
|
+
var zoomItem, lods, withLods_1, individuals, style, e_3, entityTypeId, entityType, e_4, pStyle, lStyle, polygonsClamped, bFillColor, cFillColor, bLineColor, cLineColor, lineWidthPx, geojson, notRendered, source, groups, applyStyle, register, sEntities, i, cEntity;
|
|
9910
|
+
var _this = this;
|
|
9911
|
+
return __generator(this, function (_o) {
|
|
9912
|
+
switch (_o.label) {
|
|
9913
|
+
case 0:
|
|
9914
|
+
entities = entities.filter(function (entity) {
|
|
9915
|
+
var _a;
|
|
9916
|
+
return !_this.renderedEntities[(_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID];
|
|
9917
|
+
});
|
|
9918
|
+
// Mark these as rendered.
|
|
9919
|
+
entities.forEach(function (entity) {
|
|
9920
|
+
var _a;
|
|
9921
|
+
_this.renderedEntities[(_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID] = true;
|
|
9922
|
+
});
|
|
9923
|
+
zoomItem = this.item.CameraZoomSettings[0];
|
|
9924
|
+
if (!(zoomItem.DisplayType == ZoomControl.EDisplayType.Model3D && entities.length)) return [3 /*break*/, 2];
|
|
9925
|
+
return [4 /*yield*/, EntityLod.GetLods({
|
|
9926
|
+
api: this.apiGetter.getApi(),
|
|
9927
|
+
filter: {
|
|
9928
|
+
externalSources: false,
|
|
9929
|
+
Items: entities.map(function (x) {
|
|
9930
|
+
var _a, _b;
|
|
9931
|
+
return {
|
|
9932
|
+
entityId: (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID,
|
|
9933
|
+
categoryId: (_b = zoomItem.LODCategoryID) !== null && _b !== void 0 ? _b : "GLB",
|
|
9934
|
+
group: "DEFAULT",
|
|
9935
|
+
level: Number(zoomItem.LODLevel)
|
|
9936
|
+
};
|
|
9937
|
+
}),
|
|
9938
|
+
strict: false
|
|
9939
|
+
}
|
|
9940
|
+
})];
|
|
9941
|
+
case 1:
|
|
9942
|
+
lods = (_o.sent()).lods;
|
|
9943
|
+
if (this.disposed) {
|
|
9944
|
+
this.doDispose();
|
|
9945
|
+
return [2 /*return*/];
|
|
9946
|
+
}
|
|
9947
|
+
withLods_1 = lods.filter(function (x) { return x.entityId && !!x.clientFileId; }).map(function (x) { return x.entityId; });
|
|
9948
|
+
individuals = entities.filter(function (entity) {
|
|
9949
|
+
var _a;
|
|
9950
|
+
return withLods_1.includes((_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID);
|
|
9951
|
+
});
|
|
9952
|
+
if (individuals.length) {
|
|
9953
|
+
this.renderAsIndividuals(individuals, force);
|
|
9954
|
+
}
|
|
9955
|
+
// Now we proceed with what is left.
|
|
9956
|
+
entities = entities.filter(function (entity) {
|
|
9957
|
+
var _a;
|
|
9958
|
+
return !withLods_1.includes((_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID);
|
|
9959
|
+
});
|
|
9960
|
+
_o.label = 2;
|
|
9364
9961
|
case 2:
|
|
9365
|
-
|
|
9366
|
-
|
|
9962
|
+
if (!entities.length) {
|
|
9963
|
+
return [2 /*return*/];
|
|
9964
|
+
}
|
|
9965
|
+
style = null;
|
|
9966
|
+
if (!((zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID) && (zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID) > -1)) return [3 /*break*/, 6];
|
|
9967
|
+
_o.label = 3;
|
|
9367
9968
|
case 3:
|
|
9368
|
-
|
|
9369
|
-
return [
|
|
9969
|
+
_o.trys.push([3, 5, , 6]);
|
|
9970
|
+
return [4 /*yield*/, Style.Get({
|
|
9971
|
+
api: this.apiGetter.getApi(),
|
|
9972
|
+
styleId: zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID
|
|
9973
|
+
})];
|
|
9370
9974
|
case 4:
|
|
9371
|
-
|
|
9372
|
-
|
|
9373
|
-
|
|
9374
|
-
|
|
9975
|
+
style = (_a = (_o.sent()).style) === null || _a === void 0 ? void 0 : _a.Settings;
|
|
9976
|
+
return [3 /*break*/, 6];
|
|
9977
|
+
case 5:
|
|
9978
|
+
e_3 = _o.sent();
|
|
9979
|
+
console.error(e_3);
|
|
9980
|
+
return [3 /*break*/, 6];
|
|
9981
|
+
case 6:
|
|
9982
|
+
entityTypeId = (_b = this.item.BruceEntity) === null || _b === void 0 ? void 0 : _b["EntityType.ID"];
|
|
9983
|
+
if (!entityTypeId) {
|
|
9984
|
+
entityTypeId = (_d = (_c = entities.find(function (x) { var _a; return !!((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a["EntityType.ID"]); })) === null || _c === void 0 ? void 0 : _c.Bruce) === null || _d === void 0 ? void 0 : _d["EntityType.ID"];
|
|
9985
|
+
}
|
|
9986
|
+
if (!entityTypeId) return [3 /*break*/, 12];
|
|
9987
|
+
_o.label = 7;
|
|
9988
|
+
case 7:
|
|
9989
|
+
_o.trys.push([7, 11, , 12]);
|
|
9990
|
+
return [4 /*yield*/, EntityType.Get({
|
|
9991
|
+
entityTypeId: entityTypeId,
|
|
9992
|
+
api: this.apiGetter.getApi()
|
|
9993
|
+
})];
|
|
9994
|
+
case 8:
|
|
9995
|
+
entityType = (_e = (_o.sent())) === null || _e === void 0 ? void 0 : _e.entityType;
|
|
9996
|
+
if (!(!style && entityType)) return [3 /*break*/, 10];
|
|
9997
|
+
if (!(entityType["DisplaySetting.ID"] && entityType["DisplaySetting.ID"] > 0)) return [3 /*break*/, 10];
|
|
9998
|
+
return [4 /*yield*/, Style.Get({
|
|
9999
|
+
api: this.apiGetter.getApi(),
|
|
10000
|
+
styleId: entityType["DisplaySetting.ID"]
|
|
10001
|
+
})];
|
|
10002
|
+
case 9:
|
|
10003
|
+
style = (_f = (_o.sent()).style) === null || _f === void 0 ? void 0 : _f.Settings;
|
|
10004
|
+
_o.label = 10;
|
|
10005
|
+
case 10: return [3 /*break*/, 12];
|
|
10006
|
+
case 11:
|
|
10007
|
+
e_4 = _o.sent();
|
|
10008
|
+
console.error(e_4);
|
|
10009
|
+
return [3 /*break*/, 12];
|
|
10010
|
+
case 12:
|
|
10011
|
+
pStyle = (_g = style === null || style === void 0 ? void 0 : style.polygonStyle) !== null && _g !== void 0 ? _g : {};
|
|
10012
|
+
lStyle = (_h = style === null || style === void 0 ? void 0 : style.polylineStyle) !== null && _h !== void 0 ? _h : {};
|
|
10013
|
+
polygonsClamped = ((_j = pStyle === null || pStyle === void 0 ? void 0 : pStyle.altitudeOption) === null || _j === void 0 ? void 0 : _j.id) == null ? true : ((_k = pStyle === null || pStyle === void 0 ? void 0 : pStyle.altitudeOption) === null || _k === void 0 ? void 0 : _k.id) == 0;
|
|
10014
|
+
bFillColor = Calculator.GetColor(pStyle.fillColor, {}, []);
|
|
10015
|
+
cFillColor = bFillColor ? colorToCColor$4(bFillColor) : Color.fromCssColorString("rgba(139, 195, 74, 0.8)");
|
|
10016
|
+
bLineColor = Calculator.GetColor(pStyle.lineColor, {}, []);
|
|
10017
|
+
cLineColor = bLineColor ? colorToCColor$4(bLineColor) : Color.fromCssColorString("rgba(80, 80, 80, 0.8)");
|
|
10018
|
+
lineWidthPx = pStyle.lineWidth ? Calculator.GetNumber(pStyle.lineWidth, {}, []) : null;
|
|
10019
|
+
if (lineWidthPx == null) {
|
|
10020
|
+
lineWidthPx = 1;
|
|
10021
|
+
}
|
|
10022
|
+
lineWidthPx = EnsureNumber(lineWidthPx);
|
|
10023
|
+
if (lineWidthPx < 0.01) {
|
|
10024
|
+
lineWidthPx = 0;
|
|
10025
|
+
}
|
|
10026
|
+
lineWidthPx = Math.round(lineWidthPx);
|
|
10027
|
+
geojson = Entity$1.ToGeoJson({
|
|
10028
|
+
entities: entities,
|
|
10029
|
+
includeUserData: false,
|
|
10030
|
+
excludeAltitude: polygonsClamped && lineWidthPx <= 0,
|
|
10031
|
+
altitude: lineWidthPx > 0 && polygonsClamped ? 1 : null,
|
|
10032
|
+
// No points.
|
|
10033
|
+
allowedDisplayTypes: [ZoomControl.EDisplayType.Geometry]
|
|
10034
|
+
});
|
|
10035
|
+
notRendered = !((_l = geojson === null || geojson === void 0 ? void 0 : geojson.features) === null || _l === void 0 ? void 0 : _l.length) ? entities : entities.filter(function (entity) {
|
|
10036
|
+
return !geojson.features.some(function (feature) {
|
|
10037
|
+
var _a, _b, _c;
|
|
10038
|
+
return ((_b = (_a = feature.properties) === null || _a === void 0 ? void 0 : _a.Bruce) === null || _b === void 0 ? void 0 : _b.ID) == ((_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c.ID);
|
|
10039
|
+
});
|
|
10040
|
+
});
|
|
10041
|
+
if (notRendered.length) {
|
|
10042
|
+
this.renderAsIndividuals(notRendered, force);
|
|
10043
|
+
}
|
|
10044
|
+
if (!((_m = geojson === null || geojson === void 0 ? void 0 : geojson.features) === null || _m === void 0 ? void 0 : _m.length)) {
|
|
10045
|
+
return [2 /*return*/];
|
|
10046
|
+
}
|
|
10047
|
+
return [4 /*yield*/, GeoJsonDataSource.load(geojson, {
|
|
10048
|
+
stroke: cLineColor,
|
|
10049
|
+
fill: cFillColor,
|
|
10050
|
+
strokeWidth: lineWidthPx,
|
|
10051
|
+
clampToGround: lineWidthPx <= 0 && polygonsClamped
|
|
10052
|
+
})];
|
|
10053
|
+
case 13:
|
|
10054
|
+
source = _o.sent();
|
|
10055
|
+
this.viewer.dataSources.add(source);
|
|
10056
|
+
this.sources.push(source);
|
|
10057
|
+
if (this.disposed) {
|
|
10058
|
+
this.doDispose();
|
|
10059
|
+
return [2 /*return*/];
|
|
10060
|
+
}
|
|
10061
|
+
groups = [];
|
|
10062
|
+
applyStyle = function (thing, entityId, data) {
|
|
10063
|
+
if (thing.polygon) {
|
|
10064
|
+
var bFillColor_1 = Calculator.GetColor(pStyle.fillColor, data, []);
|
|
10065
|
+
var cFillColor_1 = bFillColor_1 ? colorToCColor$4(bFillColor_1) : Color.fromCssColorString("rgba(139, 195, 74, 0.8)");
|
|
10066
|
+
var bLineColor_1 = Calculator.GetColor(pStyle.lineColor, data, []);
|
|
10067
|
+
var cLineColor_1 = bLineColor_1 ? colorToCColor$4(bLineColor_1) : Color.fromCssColorString("rgba(80, 80, 80, 0.8)");
|
|
10068
|
+
var width = pStyle.lineWidth ? Calculator.GetNumber(pStyle.lineWidth, data, []) : null;
|
|
10069
|
+
if (width == null) {
|
|
10070
|
+
width = 1;
|
|
10071
|
+
}
|
|
10072
|
+
width = EnsureNumber(width);
|
|
10073
|
+
if (width < 0.01) {
|
|
10074
|
+
width = 0;
|
|
10075
|
+
}
|
|
10076
|
+
var curFillColor = getValue$5(_this.viewer, thing.polygon.material);
|
|
10077
|
+
if (curFillColor && curFillColor instanceof ColorMaterialProperty) {
|
|
10078
|
+
curFillColor = curFillColor.color;
|
|
10079
|
+
}
|
|
10080
|
+
var curLineColor = getValue$5(_this.viewer, thing.polygon.outlineColor);
|
|
10081
|
+
if (curLineColor && curLineColor instanceof ColorMaterialProperty) {
|
|
10082
|
+
curLineColor = curLineColor.color;
|
|
10083
|
+
}
|
|
10084
|
+
var curWidth = getValue$5(_this.viewer, thing.polygon.outlineWidth);
|
|
10085
|
+
if ((curFillColor instanceof Color && curFillColor.equals(cFillColor_1)) &&
|
|
10086
|
+
(curLineColor instanceof Color && curLineColor.equals(cLineColor_1)) &&
|
|
10087
|
+
curWidth == width) {
|
|
10088
|
+
return;
|
|
10089
|
+
}
|
|
10090
|
+
thing.polygon.material = cFillColor_1;
|
|
10091
|
+
thing.polygon.outlineColor = cLineColor_1;
|
|
10092
|
+
thing.polygon.outlineWidth = width;
|
|
10093
|
+
}
|
|
10094
|
+
else if (thing.polyline) {
|
|
10095
|
+
var bColor = lStyle.lineColor ? Calculator.GetColor(lStyle.lineColor, data, []) : null;
|
|
10096
|
+
var cColor = bColor ? colorToCColor$4(bColor) : Color.fromCssColorString("rgba(255, 193, 7, 0.8)");
|
|
10097
|
+
var width = lStyle.lineWidth ? Calculator.GetNumber(lStyle.lineWidth, data, []) : null;
|
|
10098
|
+
if (width == null) {
|
|
10099
|
+
width = 2;
|
|
10100
|
+
}
|
|
10101
|
+
width = EnsureNumber(width);
|
|
10102
|
+
if (width < 0.01) {
|
|
10103
|
+
width = 0;
|
|
10104
|
+
}
|
|
10105
|
+
var curColor = getValue$5(_this.viewer, thing.polyline.material);
|
|
10106
|
+
if (curColor && curColor instanceof ColorMaterialProperty) {
|
|
10107
|
+
curColor = curColor.color;
|
|
10108
|
+
}
|
|
10109
|
+
var curWidth = getValue$5(_this.viewer, thing.polyline.width);
|
|
10110
|
+
if ((curColor instanceof Color && curColor.equals(cColor)) &&
|
|
10111
|
+
curWidth == width) {
|
|
10112
|
+
return;
|
|
10113
|
+
}
|
|
10114
|
+
thing.polyline.material = cColor;
|
|
10115
|
+
thing.polyline.width = width;
|
|
10116
|
+
}
|
|
10117
|
+
};
|
|
10118
|
+
register = function (thing) {
|
|
10119
|
+
var _a, _b, _c, _d;
|
|
10120
|
+
// See if the cesium entity already exists in a group.
|
|
10121
|
+
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; }); });
|
|
10122
|
+
if (group) {
|
|
10123
|
+
return;
|
|
10124
|
+
}
|
|
10125
|
+
var metadata = getValue$5(_this.viewer, thing === null || thing === void 0 ? void 0 : thing.properties);
|
|
10126
|
+
var entityId = (_a = metadata === null || metadata === void 0 ? void 0 : metadata.Bruce) === null || _a === void 0 ? void 0 : _a.ID;
|
|
10127
|
+
if (!entityId) {
|
|
10128
|
+
return;
|
|
10129
|
+
}
|
|
10130
|
+
var needsUpdate = false;
|
|
10131
|
+
// Find group for the nextspace entity ID.
|
|
10132
|
+
group = groups.find(function (x) { return x.entityId == entityId; });
|
|
10133
|
+
// No group yet. We can designate this as the primary entity and create a new group for it.
|
|
10134
|
+
if (!group) {
|
|
10135
|
+
group = {
|
|
10136
|
+
entityId: entityId,
|
|
10137
|
+
visual: thing,
|
|
10138
|
+
tagIds: (_b = metadata === null || metadata === void 0 ? void 0 : metadata.Bruce) === null || _b === void 0 ? void 0 : _b["Layer.ID"],
|
|
10139
|
+
entityTypeId: (_c = metadata === null || metadata === void 0 ? void 0 : metadata.Bruce) === null || _c === void 0 ? void 0 : _c["EntityType.ID"],
|
|
10140
|
+
siblings: [],
|
|
10141
|
+
data: entities.find(function (x) { var _a; return ((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID) == entityId; }),
|
|
10142
|
+
rego: null
|
|
10143
|
+
};
|
|
10144
|
+
groups.push(group);
|
|
10145
|
+
var rego = {
|
|
10146
|
+
entityId: entityId,
|
|
10147
|
+
menuItemId: _this.item.id,
|
|
10148
|
+
visual: thing,
|
|
10149
|
+
priority: 0,
|
|
10150
|
+
entityTypeId: group.entityTypeId,
|
|
10151
|
+
accountId: _this.apiGetter.accountId,
|
|
10152
|
+
tagIds: group.tagIds ? [].concat(group.tagIds) : [],
|
|
10153
|
+
name: entityType ? (_d = Entity$1.CalculateName({
|
|
10154
|
+
entity: group.data,
|
|
10155
|
+
type: entityType,
|
|
10156
|
+
defaultToId: false
|
|
10157
|
+
})) !== null && _d !== void 0 ? _d : "Unnamed Entity" : "Unnamed Entity",
|
|
10158
|
+
cdn: _this.item.cdnEnabled,
|
|
10159
|
+
collection: source.entities
|
|
10160
|
+
};
|
|
10161
|
+
group.rego = rego;
|
|
10162
|
+
_this.visualsManager.AddRego({
|
|
10163
|
+
rego: rego,
|
|
10164
|
+
requestRender: false
|
|
10165
|
+
});
|
|
10166
|
+
}
|
|
10167
|
+
// Found a group. We flag this as a sibling entity of the primary.
|
|
10168
|
+
else {
|
|
10169
|
+
group.siblings.push(thing);
|
|
10170
|
+
group.visual._siblingGraphics = group.siblings;
|
|
10171
|
+
thing._parentEntity = group.visual;
|
|
10172
|
+
if (group.rego) {
|
|
10173
|
+
_this.visualsManager.RefreshMark({
|
|
10174
|
+
rego: group.rego
|
|
10175
|
+
});
|
|
10176
|
+
needsUpdate = true;
|
|
10177
|
+
}
|
|
10178
|
+
}
|
|
10179
|
+
applyStyle(thing, entityId, group.data);
|
|
10180
|
+
if (needsUpdate) {
|
|
10181
|
+
_this.visualsManager.ForceUpdate({
|
|
10182
|
+
entityIds: [entityId],
|
|
10183
|
+
});
|
|
10184
|
+
}
|
|
10185
|
+
};
|
|
10186
|
+
sEntities = source.entities.values;
|
|
10187
|
+
for (i = 0; i < sEntities.length; i++) {
|
|
10188
|
+
cEntity = sEntities[i];
|
|
10189
|
+
register(cEntity);
|
|
10190
|
+
}
|
|
10191
|
+
this.viewer.scene.requestRender();
|
|
10192
|
+
return [2 /*return*/];
|
|
9375
10193
|
}
|
|
9376
10194
|
});
|
|
9377
10195
|
});
|
|
9378
10196
|
};
|
|
9379
|
-
|
|
10197
|
+
/**
|
|
10198
|
+
* Our default path.
|
|
10199
|
+
* We render each entity individually.
|
|
10200
|
+
* @param entities
|
|
10201
|
+
* @param force
|
|
10202
|
+
* @returns
|
|
10203
|
+
*/
|
|
10204
|
+
Manager.prototype.renderAsIndividuals = function (entities, force) {
|
|
9380
10205
|
var _a, _b;
|
|
9381
10206
|
if (force === void 0) { force = false; }
|
|
9382
10207
|
return __awaiter(this, void 0, void 0, function () {
|
|
9383
|
-
var cEntities, i, entity, id, cEntity, visual, clustered
|
|
10208
|
+
var cEntities, i, entity, id, cEntity, visual, clustered;
|
|
9384
10209
|
return __generator(this, function (_c) {
|
|
9385
10210
|
switch (_c.label) {
|
|
9386
|
-
case 0:
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9390
|
-
|
|
10211
|
+
case 0: return [4 /*yield*/, EntityRenderEngine.Render({
|
|
10212
|
+
viewer: this.viewer,
|
|
10213
|
+
apiGetter: this.apiGetter,
|
|
10214
|
+
entities: entities,
|
|
10215
|
+
menuItemId: this.item.id,
|
|
10216
|
+
visualRegister: this.visualsManager,
|
|
10217
|
+
zoomControl: this.item.CameraZoomSettings,
|
|
10218
|
+
force: force
|
|
10219
|
+
})];
|
|
9391
10220
|
case 1:
|
|
9392
|
-
_c.trys.push([1, 3, , 4]);
|
|
9393
|
-
return [4 /*yield*/, EntityRenderEngine.Render({
|
|
9394
|
-
viewer: this.viewer,
|
|
9395
|
-
apiGetter: this.apiGetter,
|
|
9396
|
-
entities: entities,
|
|
9397
|
-
menuItemId: this.item.id,
|
|
9398
|
-
visualRegister: this.visualsManager,
|
|
9399
|
-
zoomControl: this.item.CameraZoomSettings,
|
|
9400
|
-
force: force
|
|
9401
|
-
})];
|
|
9402
|
-
case 2:
|
|
9403
10221
|
cEntities = _c.sent();
|
|
9404
10222
|
for (i = 0; i < entities.length; i++) {
|
|
9405
10223
|
entity = entities[i];
|
|
@@ -9441,12 +10259,7 @@ var EntitiesIdsRenderManager;
|
|
|
9441
10259
|
if (this.clustering && entities.length) {
|
|
9442
10260
|
this.clustering.Update();
|
|
9443
10261
|
}
|
|
9444
|
-
return [
|
|
9445
|
-
case 3:
|
|
9446
|
-
e_2 = _c.sent();
|
|
9447
|
-
console.error(e_2);
|
|
9448
|
-
return [3 /*break*/, 4];
|
|
9449
|
-
case 4: return [2 /*return*/];
|
|
10262
|
+
return [2 /*return*/];
|
|
9450
10263
|
}
|
|
9451
10264
|
});
|
|
9452
10265
|
});
|
|
@@ -9662,7 +10475,7 @@ var EntityRenderManager;
|
|
|
9662
10475
|
EntityRenderManager.Manager = Manager;
|
|
9663
10476
|
})(EntityRenderManager || (EntityRenderManager = {}));
|
|
9664
10477
|
|
|
9665
|
-
function colorToCColor$
|
|
10478
|
+
function colorToCColor$5(color) {
|
|
9666
10479
|
return new Color(color.red ? color.red / 255 : 0, color.green ? color.green / 255 : 0, color.blue ? color.blue / 255 : 0, color.alpha);
|
|
9667
10480
|
}
|
|
9668
10481
|
/**
|
|
@@ -10540,7 +11353,7 @@ var TilesetRenderEngine;
|
|
|
10540
11353
|
cColor = Color.WHITE;
|
|
10541
11354
|
}
|
|
10542
11355
|
else {
|
|
10543
|
-
cColor = colorToCColor$
|
|
11356
|
+
cColor = colorToCColor$5(bColor);
|
|
10544
11357
|
}
|
|
10545
11358
|
CesiumEntityStyler.SetDefaultColor({
|
|
10546
11359
|
color: cColor,
|
|
@@ -20547,7 +21360,7 @@ var CesiumViewMonitor;
|
|
|
20547
21360
|
CesiumViewMonitor$$1.Monitor = Monitor;
|
|
20548
21361
|
})(CesiumViewMonitor || (CesiumViewMonitor = {}));
|
|
20549
21362
|
|
|
20550
|
-
var VERSION$1 = "3.4.
|
|
21363
|
+
var VERSION$1 = "3.4.2";
|
|
20551
21364
|
|
|
20552
21365
|
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, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, Draw3dPolygon, Draw3dPolyline };
|
|
20553
21366
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|