bruce-cesium 3.9.3 → 3.9.5
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 +447 -214
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +446 -213
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/entity-render-engine.js +371 -198
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +1 -1
- package/dist/lib/rendering/render-managers/entities/entity-render-manager.js +1 -1
- package/dist/lib/rendering/visual-register-culler.js +61 -4
- package/dist/lib/rendering/visual-register-culler.js.map +1 -1
- package/dist/lib/utils/entity-utils.js +5 -2
- package/dist/lib/utils/entity-utils.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/utils/entity-utils.d.ts +1 -0
- package/package.json +2 -2
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BruceEvent, Cartes, Carto, Entity as Entity$1, Geometry, Tileset, MathUtils, LRUCache, ProjectViewTile, DelayQueue, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, Api, EntityRelationType, ENVIRONMENT, EntityHistoricData, EntityCoords, 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, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, DistanceDisplayCondition, NearFarScalar, Model, Entity, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics,
|
|
3
|
+
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, DistanceDisplayCondition, NearFarScalar, Model, ColorMaterialProperty, Entity, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorBlendMode, HeadingPitchRoll, Transforms, SceneMode, Primitive, Cesium3DTileFeature, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, Cesium3DTileStyle, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, ScreenSpaceEventHandler, ScreenSpaceEventType, BoundingSphere, GeometryInstance, CzmlDataSource, Quaternion, Intersect } from 'cesium';
|
|
4
4
|
|
|
5
5
|
/*! *****************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2904,7 +2904,10 @@ var EntityUtils;
|
|
|
2904
2904
|
* @returns
|
|
2905
2905
|
*/
|
|
2906
2906
|
function GetPos(params) {
|
|
2907
|
-
var viewer = params.viewer, entity = params.entity, visualRegister = params.visualRegister;
|
|
2907
|
+
var viewer = params.viewer, entity = params.entity, visualRegister = params.visualRegister, allowRendered = params.allowRendered;
|
|
2908
|
+
if (allowRendered == null) {
|
|
2909
|
+
allowRendered = true;
|
|
2910
|
+
}
|
|
2908
2911
|
function evaluateRendered() {
|
|
2909
2912
|
var rego = visualRegister ? visualRegister.GetRego({
|
|
2910
2913
|
entityId: entity.Bruce.ID,
|
|
@@ -3017,7 +3020,7 @@ var EntityUtils;
|
|
|
3017
3020
|
}
|
|
3018
3021
|
}
|
|
3019
3022
|
}
|
|
3020
|
-
var pos3d = evaluateRendered();
|
|
3023
|
+
var pos3d = allowRendered ? evaluateRendered() : null;
|
|
3021
3024
|
if (Cartes.ValidateCartes3(pos3d)) {
|
|
3022
3025
|
return pos3d;
|
|
3023
3026
|
}
|
|
@@ -4327,6 +4330,8 @@ function runCullChecker(register) {
|
|
|
4327
4330
|
checkInterval = null;
|
|
4328
4331
|
return;
|
|
4329
4332
|
}
|
|
4333
|
+
var toRemove = [];
|
|
4334
|
+
var toAdd = [];
|
|
4330
4335
|
var slice = entityIds.splice(0, CHECK_BATCH);
|
|
4331
4336
|
for (var i = 0; i < slice.length; i++) {
|
|
4332
4337
|
var entityId = slice[i];
|
|
@@ -4349,9 +4354,10 @@ function runCullChecker(register) {
|
|
|
4349
4354
|
var shouldCull = shouldCullEntity(viewer, part);
|
|
4350
4355
|
if (shouldCull) {
|
|
4351
4356
|
part[VisualRegisterCuller.VISUAL_CULL_KEY] = true;
|
|
4352
|
-
if (viewer.entities.contains(part)) {
|
|
4353
|
-
|
|
4354
|
-
}
|
|
4357
|
+
// if (viewer.entities.contains(part)) {
|
|
4358
|
+
// viewer.entities.remove(part);
|
|
4359
|
+
// }
|
|
4360
|
+
toRemove.push(part);
|
|
4355
4361
|
}
|
|
4356
4362
|
else {
|
|
4357
4363
|
delete part[VisualRegisterCuller.VISUAL_CULL_KEY];
|
|
@@ -4360,11 +4366,18 @@ function runCullChecker(register) {
|
|
|
4360
4366
|
!viewer.entities.contains(part) &&
|
|
4361
4367
|
!hiddenIds.includes(entityId) &&
|
|
4362
4368
|
(isolatedIds.length <= 0 || isolatedIds.includes(entityId))) {
|
|
4363
|
-
viewer.entities.add(part);
|
|
4369
|
+
// viewer.entities.add(part);
|
|
4370
|
+
toAdd.push(part);
|
|
4364
4371
|
}
|
|
4365
4372
|
}
|
|
4366
4373
|
}
|
|
4367
4374
|
}
|
|
4375
|
+
if (toRemove.length > 0) {
|
|
4376
|
+
removeEntities(viewer, toRemove);
|
|
4377
|
+
}
|
|
4378
|
+
if (toAdd.length > 0) {
|
|
4379
|
+
addEntities(viewer, toAdd);
|
|
4380
|
+
}
|
|
4368
4381
|
if (entityIds.length <= 0) {
|
|
4369
4382
|
clearInterval(checkInterval);
|
|
4370
4383
|
checkInterval = null;
|
|
@@ -4375,6 +4388,53 @@ function runCullChecker(register) {
|
|
|
4375
4388
|
}
|
|
4376
4389
|
}, 200);
|
|
4377
4390
|
}
|
|
4391
|
+
// The latest remove/add pending states of an Entity.
|
|
4392
|
+
var entityRemoveAddState = new Map();
|
|
4393
|
+
/**
|
|
4394
|
+
* Removes Entities from the viewer.
|
|
4395
|
+
* This performs the action next viewer update to avoid any internal Cesium issues that can cause crashes.
|
|
4396
|
+
* @param viewer
|
|
4397
|
+
* @param entities
|
|
4398
|
+
*/
|
|
4399
|
+
function removeEntities(viewer, entities) {
|
|
4400
|
+
for (var i = 0; i < entities.length; i++) {
|
|
4401
|
+
var entity = entities[i];
|
|
4402
|
+
entityRemoveAddState.set(entity.id, false);
|
|
4403
|
+
}
|
|
4404
|
+
var removal = viewer.scene.postRender.addEventListener(function () {
|
|
4405
|
+
removal();
|
|
4406
|
+
for (var i = 0; i < entities.length; i++) {
|
|
4407
|
+
var entity = entities[i];
|
|
4408
|
+
if (entityRemoveAddState.get(entity.id) != false) {
|
|
4409
|
+
continue;
|
|
4410
|
+
}
|
|
4411
|
+
entityRemoveAddState.delete(entity.id);
|
|
4412
|
+
viewer.entities.remove(entity);
|
|
4413
|
+
}
|
|
4414
|
+
});
|
|
4415
|
+
}
|
|
4416
|
+
/**
|
|
4417
|
+
* Adds Entities to the viewer.
|
|
4418
|
+
* @param viewer
|
|
4419
|
+
* @param entities
|
|
4420
|
+
*/
|
|
4421
|
+
function addEntities(viewer, entities) {
|
|
4422
|
+
for (var i = 0; i < entities.length; i++) {
|
|
4423
|
+
var entity = entities[i];
|
|
4424
|
+
entityRemoveAddState.set(entity.id, true);
|
|
4425
|
+
}
|
|
4426
|
+
var removal = viewer.scene.postRender.addEventListener(function () {
|
|
4427
|
+
removal();
|
|
4428
|
+
for (var i = 0; i < entities.length; i++) {
|
|
4429
|
+
var entity = entities[i];
|
|
4430
|
+
if (entityRemoveAddState.get(entity.id) != true) {
|
|
4431
|
+
continue;
|
|
4432
|
+
}
|
|
4433
|
+
entityRemoveAddState.delete(entity.id);
|
|
4434
|
+
viewer.entities.add(entity);
|
|
4435
|
+
}
|
|
4436
|
+
});
|
|
4437
|
+
}
|
|
4378
4438
|
var VisualRegisterCuller;
|
|
4379
4439
|
(function (VisualRegisterCuller) {
|
|
4380
4440
|
VisualRegisterCuller.VISUAL_CULL_KEY = Symbol("VISUAL_CULL_KEY");
|
|
@@ -4739,21 +4799,11 @@ function getStyle(api, entity, styleId) {
|
|
|
4739
4799
|
});
|
|
4740
4800
|
});
|
|
4741
4801
|
}
|
|
4742
|
-
|
|
4743
|
-
* Height fix means while flat terrain is active we don't clamp-to-ground and instead place at alt=0.
|
|
4744
|
-
* This is currently breaking as the curvature of the earth makes larger polygons/polylines clip.
|
|
4745
|
-
* @param terrain
|
|
4746
|
-
* @returns
|
|
4747
|
-
*/
|
|
4748
|
-
function shouldApplyFlatFix(terrain) {
|
|
4749
|
-
//return terrain instanceof Cesium.EllipsoidTerrainProvider;
|
|
4750
|
-
return false;
|
|
4751
|
-
}
|
|
4752
|
-
function getRenderGroupId(zoomItem, terrain) {
|
|
4802
|
+
function getRenderGroupId(zoomItem) {
|
|
4753
4803
|
if (!zoomItem) {
|
|
4754
4804
|
return null;
|
|
4755
4805
|
}
|
|
4756
|
-
return zoomItem.MinZoom + "-" + zoomItem.MaxZoom
|
|
4806
|
+
return zoomItem.MinZoom + "-" + zoomItem.MaxZoom;
|
|
4757
4807
|
}
|
|
4758
4808
|
// Key = url + scale.
|
|
4759
4809
|
var _fileRadiusCache = new LRUCache(1000);
|
|
@@ -5026,7 +5076,8 @@ function getSeriesPossesForHistoricEntity(viewer, heightRef, historic) {
|
|
|
5026
5076
|
entity: item.data,
|
|
5027
5077
|
viewer: viewer,
|
|
5028
5078
|
recordHeightRef: heightRef,
|
|
5029
|
-
returnHeightRef: heightRef
|
|
5079
|
+
returnHeightRef: heightRef,
|
|
5080
|
+
allowRendered: false
|
|
5030
5081
|
});
|
|
5031
5082
|
var dateTime = new Date(item.dateTime);
|
|
5032
5083
|
if (!dateTime || !pos3d || isNaN(pos3d.x) || isNaN(pos3d.y) || isNaN(pos3d.z)) {
|
|
@@ -5039,14 +5090,116 @@ function getSeriesPossesForHistoricEntity(viewer, heightRef, historic) {
|
|
|
5039
5090
|
}
|
|
5040
5091
|
return series;
|
|
5041
5092
|
}
|
|
5093
|
+
/**
|
|
5094
|
+
* Returns if the given positions are equal.
|
|
5095
|
+
* @param a
|
|
5096
|
+
* @param b
|
|
5097
|
+
*/
|
|
5098
|
+
function comparePositions(a, b) {
|
|
5099
|
+
// Same reference.
|
|
5100
|
+
if (a == b) {
|
|
5101
|
+
return true;
|
|
5102
|
+
}
|
|
5103
|
+
// Different lengths or one is null.
|
|
5104
|
+
if ((!a || !b) || (a.length != b.length)) {
|
|
5105
|
+
return false;
|
|
5106
|
+
}
|
|
5107
|
+
for (var i = 0; i < a.length; i++) {
|
|
5108
|
+
var posA = a[i];
|
|
5109
|
+
var posB = b[i];
|
|
5110
|
+
// Null detected.
|
|
5111
|
+
if (!posA || !posB) {
|
|
5112
|
+
return false;
|
|
5113
|
+
}
|
|
5114
|
+
// Position values don't match.
|
|
5115
|
+
if (!Cartes.IsEqualCartes3(posA, posB)) {
|
|
5116
|
+
return false;
|
|
5117
|
+
}
|
|
5118
|
+
}
|
|
5119
|
+
return true;
|
|
5120
|
+
}
|
|
5121
|
+
/**
|
|
5122
|
+
* Returns if the given polygon hierarchies are equal.
|
|
5123
|
+
* @param a
|
|
5124
|
+
* @param b
|
|
5125
|
+
*/
|
|
5126
|
+
function comparePolygonHierarchies(a, b) {
|
|
5127
|
+
// Same reference.
|
|
5128
|
+
if (a == b) {
|
|
5129
|
+
return true;
|
|
5130
|
+
}
|
|
5131
|
+
// Different lengths or one is null.
|
|
5132
|
+
if ((!a || !b) || (a.positions.length != b.positions.length)) {
|
|
5133
|
+
return false;
|
|
5134
|
+
}
|
|
5135
|
+
// Positions don't match.
|
|
5136
|
+
if (!comparePositions(a.positions, b.positions)) {
|
|
5137
|
+
return false;
|
|
5138
|
+
}
|
|
5139
|
+
var holes = a.holes;
|
|
5140
|
+
var bHoles = b.holes;
|
|
5141
|
+
// Number of holes don't match.
|
|
5142
|
+
if (holes.length != bHoles.length) {
|
|
5143
|
+
return false;
|
|
5144
|
+
}
|
|
5145
|
+
for (var i = 0; i < holes.length; i++) {
|
|
5146
|
+
// Hole positions don't match.
|
|
5147
|
+
if (!comparePositions(holes[i].positions, bHoles[i].positions)) {
|
|
5148
|
+
return false;
|
|
5149
|
+
}
|
|
5150
|
+
}
|
|
5151
|
+
return true;
|
|
5152
|
+
}
|
|
5153
|
+
function getColor$2(viewer, obj) {
|
|
5154
|
+
var value = null;
|
|
5155
|
+
if (obj === null || obj === void 0 ? void 0 : obj.getValue) {
|
|
5156
|
+
var date = viewer.scene.lastRenderTime;
|
|
5157
|
+
if (!date) {
|
|
5158
|
+
date = viewer.clock.currentTime;
|
|
5159
|
+
}
|
|
5160
|
+
value = obj.getValue(date);
|
|
5161
|
+
}
|
|
5162
|
+
else {
|
|
5163
|
+
value = obj;
|
|
5164
|
+
}
|
|
5165
|
+
if (value && value instanceof ColorMaterialProperty) {
|
|
5166
|
+
value = value.color;
|
|
5167
|
+
}
|
|
5168
|
+
return value;
|
|
5169
|
+
}
|
|
5170
|
+
/**
|
|
5171
|
+
* Compares two color materials.
|
|
5172
|
+
* Returns if they are equal.
|
|
5173
|
+
* @param viewer
|
|
5174
|
+
* @param a
|
|
5175
|
+
* @param b
|
|
5176
|
+
* @returns
|
|
5177
|
+
*/
|
|
5178
|
+
function compareColorMaterials(viewer, a, b) {
|
|
5179
|
+
// Same reference.
|
|
5180
|
+
if (a == b) {
|
|
5181
|
+
return true;
|
|
5182
|
+
}
|
|
5183
|
+
var colorA = getColor$2(viewer, a.color);
|
|
5184
|
+
var colorB = getColor$2(viewer, b.color);
|
|
5185
|
+
// One is null.
|
|
5186
|
+
if (!colorA || !colorB) {
|
|
5187
|
+
return false;
|
|
5188
|
+
}
|
|
5189
|
+
// Colors don't match.
|
|
5190
|
+
if (colorA.alpha != colorB.alpha || colorA.red != colorB.red || colorA.green != colorB.green || colorA.blue != colorB.blue) {
|
|
5191
|
+
return false;
|
|
5192
|
+
}
|
|
5193
|
+
return true;
|
|
5194
|
+
}
|
|
5042
5195
|
var EntityRenderEngine;
|
|
5043
5196
|
(function (EntityRenderEngine) {
|
|
5044
5197
|
function Render(params) {
|
|
5045
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
5198
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
5046
5199
|
return __awaiter(this, void 0, void 0, function () {
|
|
5047
5200
|
var groupRenderParams, i, entity, geometry, updated, cEntities, models, multiGeometry, polygons, polylines, points, i, entity, id, zoomItem, displayType, existingRego, newRenderId, oldRenderId, mParams, mEntities, i, entity, id, cEntity, _loop_1, i, pParams, pEntities, i, entity, cEntity, pParams, pEntities, i, entity, cEntity, pParams, pEntities, i, entity, cEntity;
|
|
5048
|
-
return __generator(this, function (
|
|
5049
|
-
switch (
|
|
5201
|
+
return __generator(this, function (_k) {
|
|
5202
|
+
switch (_k.label) {
|
|
5050
5203
|
case 0:
|
|
5051
5204
|
groupRenderParams = {
|
|
5052
5205
|
apiGetter: params.apiGetter,
|
|
@@ -5093,13 +5246,13 @@ var EntityRenderEngine;
|
|
|
5093
5246
|
entityId: id,
|
|
5094
5247
|
menuItemId: params.menuItemId
|
|
5095
5248
|
});
|
|
5096
|
-
newRenderId = getRenderGroupId(zoomItem
|
|
5097
|
-
oldRenderId = (
|
|
5249
|
+
newRenderId = getRenderGroupId(zoomItem);
|
|
5250
|
+
oldRenderId = (_b = existingRego === null || existingRego === void 0 ? void 0 : existingRego.visual) === null || _b === void 0 ? void 0 : _b._renderGroup;
|
|
5098
5251
|
if (!params.force &&
|
|
5099
5252
|
newRenderId == oldRenderId &&
|
|
5100
5253
|
!(existingRego === null || existingRego === void 0 ? void 0 : existingRego.stale) &&
|
|
5101
5254
|
// If historic metadata is different then it's also stale.
|
|
5102
|
-
((existingRego === null || existingRego === void 0 ? void 0 : existingRego.historicDateTime) == ((
|
|
5255
|
+
((existingRego === null || existingRego === void 0 ? void 0 : existingRego.historicDateTime) == ((_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c.historicDateTime))) {
|
|
5103
5256
|
// No sorting category needed. Already rendered the way we want.
|
|
5104
5257
|
cEntities.set(id, existingRego.visual);
|
|
5105
5258
|
}
|
|
@@ -5110,8 +5263,8 @@ var EntityRenderEngine;
|
|
|
5110
5263
|
// Flag as no longer stale as we're unlikely to recreate the rego if we're reusing the graphic.
|
|
5111
5264
|
existingRego.stale = false;
|
|
5112
5265
|
// Update metadata for the same reason.
|
|
5113
|
-
existingRego.historicDateTime = (
|
|
5114
|
-
existingRego.historicAttrKey = (
|
|
5266
|
+
existingRego.historicDateTime = (_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d.historicDateTime;
|
|
5267
|
+
existingRego.historicAttrKey = (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.historicAttrKey;
|
|
5115
5268
|
existingRego.entityTypeId = entity.Bruce["EntityType.ID"];
|
|
5116
5269
|
updated.set(id, true);
|
|
5117
5270
|
}
|
|
@@ -5119,7 +5272,7 @@ var EntityRenderEngine;
|
|
|
5119
5272
|
models.push(entity);
|
|
5120
5273
|
}
|
|
5121
5274
|
else if (displayType == ZoomControl.EDisplayType.Geometry) {
|
|
5122
|
-
if ((
|
|
5275
|
+
if ((_g = (_f = entity.geometry) === null || _f === void 0 ? void 0 : _f.MultiGeometry) === null || _g === void 0 ? void 0 : _g.length) {
|
|
5123
5276
|
multiGeometry.push(entity);
|
|
5124
5277
|
}
|
|
5125
5278
|
else {
|
|
@@ -5137,7 +5290,7 @@ var EntityRenderEngine;
|
|
|
5137
5290
|
mParams = __assign(__assign({}, groupRenderParams), { rendered: cEntities, entities: models, entitiesHistoric: params.entitiesHistoric });
|
|
5138
5291
|
return [4 /*yield*/, Model3d.RenderGroup(mParams)];
|
|
5139
5292
|
case 1:
|
|
5140
|
-
mEntities =
|
|
5293
|
+
mEntities = _k.sent();
|
|
5141
5294
|
for (i = 0; i < mParams.entities.length; i++) {
|
|
5142
5295
|
entity = mParams.entities[i];
|
|
5143
5296
|
id = entity.Bruce.ID;
|
|
@@ -5149,16 +5302,16 @@ var EntityRenderEngine;
|
|
|
5149
5302
|
multiGeometry.push(entity);
|
|
5150
5303
|
}
|
|
5151
5304
|
}
|
|
5152
|
-
|
|
5305
|
+
_k.label = 2;
|
|
5153
5306
|
case 2:
|
|
5154
5307
|
if (!(multiGeometry.length > 0)) return [3 /*break*/, 6];
|
|
5155
5308
|
_loop_1 = function (i) {
|
|
5156
5309
|
var entity, pParams, zoomItem, j, subEntity, cPoly, rendered, cLines, cPoints, rootEntity_1, firstEntity;
|
|
5157
|
-
return __generator(this, function (
|
|
5158
|
-
switch (
|
|
5310
|
+
return __generator(this, function (_l) {
|
|
5311
|
+
switch (_l.label) {
|
|
5159
5312
|
case 0:
|
|
5160
5313
|
entity = multiGeometry[i];
|
|
5161
|
-
if (!((
|
|
5314
|
+
if (!((_j = (_h = entity.geometry) === null || _h === void 0 ? void 0 : _h.MultiGeometry) === null || _j === void 0 ? void 0 : _j.length)) {
|
|
5162
5315
|
polygons.push(entity);
|
|
5163
5316
|
return [2 /*return*/, "continue"];
|
|
5164
5317
|
}
|
|
@@ -5172,7 +5325,7 @@ var EntityRenderEngine;
|
|
|
5172
5325
|
}
|
|
5173
5326
|
return [4 /*yield*/, Polygon.RenderGroup(pParams)];
|
|
5174
5327
|
case 1:
|
|
5175
|
-
cPoly =
|
|
5328
|
+
cPoly = _l.sent();
|
|
5176
5329
|
Array.from(cPoly.keys()).forEach(function (key) {
|
|
5177
5330
|
if (cPoly.get(key)) {
|
|
5178
5331
|
pParams.entities = pParams.entities.filter(function (e) { return e.Bruce.ID != key; });
|
|
@@ -5181,7 +5334,7 @@ var EntityRenderEngine;
|
|
|
5181
5334
|
rendered = Array.from(cPoly.values());
|
|
5182
5335
|
return [4 /*yield*/, Polyline.RenderGroup(pParams)];
|
|
5183
5336
|
case 2:
|
|
5184
|
-
cLines =
|
|
5337
|
+
cLines = _l.sent();
|
|
5185
5338
|
Array.from(cLines.keys()).forEach(function (key) {
|
|
5186
5339
|
if (cLines.get(key)) {
|
|
5187
5340
|
pParams.entities = pParams.entities.filter(function (e) { return e.Bruce.ID != key; });
|
|
@@ -5191,9 +5344,9 @@ var EntityRenderEngine;
|
|
|
5191
5344
|
if (!!rendered.length) return [3 /*break*/, 4];
|
|
5192
5345
|
return [4 /*yield*/, Point.RenderGroup(pParams)];
|
|
5193
5346
|
case 3:
|
|
5194
|
-
cPoints =
|
|
5347
|
+
cPoints = _l.sent();
|
|
5195
5348
|
rendered = rendered.concat(Array.from(cPoints.values()));
|
|
5196
|
-
|
|
5349
|
+
_l.label = 4;
|
|
5197
5350
|
case 4:
|
|
5198
5351
|
rendered = rendered.filter(function (x) { return x != null; });
|
|
5199
5352
|
if (rendered.length) {
|
|
@@ -5201,7 +5354,7 @@ var EntityRenderEngine;
|
|
|
5201
5354
|
id: ObjectUtils.UId(10)
|
|
5202
5355
|
});
|
|
5203
5356
|
rootEntity_1._siblingGraphics = [];
|
|
5204
|
-
rootEntity_1._renderGroup = getRenderGroupId(zoomItem
|
|
5357
|
+
rootEntity_1._renderGroup = getRenderGroupId(zoomItem);
|
|
5205
5358
|
rootEntity_1._siblingGraphics = rootEntity_1._siblingGraphics.concat(rendered);
|
|
5206
5359
|
cEntities.set(entity.Bruce.ID, rootEntity_1);
|
|
5207
5360
|
firstEntity = rendered[0];
|
|
@@ -5220,13 +5373,13 @@ var EntityRenderEngine;
|
|
|
5220
5373
|
});
|
|
5221
5374
|
};
|
|
5222
5375
|
i = 0;
|
|
5223
|
-
|
|
5376
|
+
_k.label = 3;
|
|
5224
5377
|
case 3:
|
|
5225
5378
|
if (!(i < multiGeometry.length)) return [3 /*break*/, 6];
|
|
5226
5379
|
return [5 /*yield**/, _loop_1(i)];
|
|
5227
5380
|
case 4:
|
|
5228
|
-
|
|
5229
|
-
|
|
5381
|
+
_k.sent();
|
|
5382
|
+
_k.label = 5;
|
|
5230
5383
|
case 5:
|
|
5231
5384
|
i++;
|
|
5232
5385
|
return [3 /*break*/, 3];
|
|
@@ -5235,7 +5388,7 @@ var EntityRenderEngine;
|
|
|
5235
5388
|
pParams = __assign(__assign({}, groupRenderParams), { entities: polygons, rendered: cEntities });
|
|
5236
5389
|
return [4 /*yield*/, Polygon.RenderGroup(pParams)];
|
|
5237
5390
|
case 7:
|
|
5238
|
-
pEntities =
|
|
5391
|
+
pEntities = _k.sent();
|
|
5239
5392
|
for (i = 0; i < pParams.entities.length; i++) {
|
|
5240
5393
|
entity = pParams.entities[i];
|
|
5241
5394
|
cEntity = pEntities.get(entity.Bruce.ID);
|
|
@@ -5246,13 +5399,13 @@ var EntityRenderEngine;
|
|
|
5246
5399
|
polylines.push(entity);
|
|
5247
5400
|
}
|
|
5248
5401
|
}
|
|
5249
|
-
|
|
5402
|
+
_k.label = 8;
|
|
5250
5403
|
case 8:
|
|
5251
5404
|
if (!(polylines.length > 0)) return [3 /*break*/, 10];
|
|
5252
5405
|
pParams = __assign(__assign({}, groupRenderParams), { entities: polylines, rendered: cEntities });
|
|
5253
5406
|
return [4 /*yield*/, Polyline.RenderGroup(pParams)];
|
|
5254
5407
|
case 9:
|
|
5255
|
-
pEntities =
|
|
5408
|
+
pEntities = _k.sent();
|
|
5256
5409
|
for (i = 0; i < pParams.entities.length; i++) {
|
|
5257
5410
|
entity = pParams.entities[i];
|
|
5258
5411
|
cEntity = pEntities.get(entity.Bruce.ID);
|
|
@@ -5263,13 +5416,13 @@ var EntityRenderEngine;
|
|
|
5263
5416
|
points.push(entity);
|
|
5264
5417
|
}
|
|
5265
5418
|
}
|
|
5266
|
-
|
|
5419
|
+
_k.label = 10;
|
|
5267
5420
|
case 10:
|
|
5268
5421
|
if (!(points.length > 0)) return [3 /*break*/, 12];
|
|
5269
5422
|
pParams = __assign(__assign({}, groupRenderParams), { entities: points, rendered: cEntities, entitiesHistoric: params.entitiesHistoric });
|
|
5270
5423
|
return [4 /*yield*/, Point.RenderGroup(pParams)];
|
|
5271
5424
|
case 11:
|
|
5272
|
-
pEntities =
|
|
5425
|
+
pEntities = _k.sent();
|
|
5273
5426
|
for (i = 0; i < pParams.entities.length; i++) {
|
|
5274
5427
|
entity = pParams.entities[i];
|
|
5275
5428
|
cEntity = pEntities.get(entity.Bruce.ID);
|
|
@@ -5277,7 +5430,7 @@ var EntityRenderEngine;
|
|
|
5277
5430
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
5278
5431
|
}
|
|
5279
5432
|
}
|
|
5280
|
-
|
|
5433
|
+
_k.label = 12;
|
|
5281
5434
|
case 12: return [2 /*return*/, {
|
|
5282
5435
|
entities: cEntities,
|
|
5283
5436
|
updated: updated
|
|
@@ -5461,7 +5614,8 @@ var EntityRenderEngine;
|
|
|
5461
5614
|
viewer: params.viewer,
|
|
5462
5615
|
entity: entity,
|
|
5463
5616
|
recordHeightRef: heightRef_1,
|
|
5464
|
-
returnHeightRef: heightRef_1
|
|
5617
|
+
returnHeightRef: heightRef_1,
|
|
5618
|
+
allowRendered: false
|
|
5465
5619
|
}); }, true);
|
|
5466
5620
|
}
|
|
5467
5621
|
cEntity = new Entity({
|
|
@@ -5520,7 +5674,8 @@ var EntityRenderEngine;
|
|
|
5520
5674
|
viewer: params.viewer,
|
|
5521
5675
|
entity: entity,
|
|
5522
5676
|
recordHeightRef: heightRef_1,
|
|
5523
|
-
returnHeightRef: heightRef_1
|
|
5677
|
+
returnHeightRef: heightRef_1,
|
|
5678
|
+
allowRendered: false
|
|
5524
5679
|
});
|
|
5525
5680
|
prevPos3d = getValue$1(params.viewer, cEntity.position);
|
|
5526
5681
|
if (!prevPos3d || !Cartesian3.equals(prevPos3d, pos3d)) {
|
|
@@ -5569,7 +5724,8 @@ var EntityRenderEngine;
|
|
|
5569
5724
|
viewer: params.viewer,
|
|
5570
5725
|
entity: entity,
|
|
5571
5726
|
recordHeightRef: heightRef,
|
|
5572
|
-
returnHeightRef: heightRef
|
|
5727
|
+
returnHeightRef: heightRef,
|
|
5728
|
+
allowRendered: false
|
|
5573
5729
|
});
|
|
5574
5730
|
extrusion = getCylinderExtrusion(entity, params.tags, heightRef, style.CylinderFillExtrusion);
|
|
5575
5731
|
hasOutline = outline && outlineWidth > 0;
|
|
@@ -5700,7 +5856,8 @@ var EntityRenderEngine;
|
|
|
5700
5856
|
viewer: params.viewer,
|
|
5701
5857
|
entity: entity,
|
|
5702
5858
|
recordHeightRef: heightRef_2,
|
|
5703
|
-
returnHeightRef: heightRef_2
|
|
5859
|
+
returnHeightRef: heightRef_2,
|
|
5860
|
+
allowRendered: false
|
|
5704
5861
|
}); }, true);
|
|
5705
5862
|
}
|
|
5706
5863
|
cEntity = new Entity({
|
|
@@ -5767,7 +5924,8 @@ var EntityRenderEngine;
|
|
|
5767
5924
|
viewer: params.viewer,
|
|
5768
5925
|
entity: entity,
|
|
5769
5926
|
recordHeightRef: heightRef_2,
|
|
5770
|
-
returnHeightRef: heightRef_2
|
|
5927
|
+
returnHeightRef: heightRef_2,
|
|
5928
|
+
allowRendered: false
|
|
5771
5929
|
});
|
|
5772
5930
|
prevPos3d = getValue$1(params.viewer, cEntity.position);
|
|
5773
5931
|
if (!prevPos3d || !Cartesian3.equals(prevPos3d, pos3d)) {
|
|
@@ -5803,16 +5961,16 @@ var EntityRenderEngine;
|
|
|
5803
5961
|
}
|
|
5804
5962
|
Point.Render = Render;
|
|
5805
5963
|
function RenderGroup(params) {
|
|
5806
|
-
var _a, _b, _c, _d
|
|
5964
|
+
var _a, _b, _c, _d;
|
|
5807
5965
|
return __awaiter(this, void 0, void 0, function () {
|
|
5808
|
-
var api, cEntities, i, entity, zoomItem, style,
|
|
5809
|
-
return __generator(this, function (
|
|
5810
|
-
switch (
|
|
5966
|
+
var api, cEntities, i, entity, zoomItem, style, _e, tagIds, tags, pStyle, cEntity, name_2;
|
|
5967
|
+
return __generator(this, function (_f) {
|
|
5968
|
+
switch (_f.label) {
|
|
5811
5969
|
case 0:
|
|
5812
5970
|
api = params.apiGetter.getApi();
|
|
5813
5971
|
cEntities = new Map();
|
|
5814
5972
|
i = 0;
|
|
5815
|
-
|
|
5973
|
+
_f.label = 1;
|
|
5816
5974
|
case 1:
|
|
5817
5975
|
if (!(i < params.entities.length)) return [3 /*break*/, 11];
|
|
5818
5976
|
entity = params.entities[i];
|
|
@@ -5820,13 +5978,13 @@ var EntityRenderEngine;
|
|
|
5820
5978
|
if (!(zoomItem.StyleID != -1)) return [3 /*break*/, 3];
|
|
5821
5979
|
return [4 /*yield*/, getStyle(api, entity, zoomItem.StyleID)];
|
|
5822
5980
|
case 2:
|
|
5823
|
-
|
|
5981
|
+
_e = (_a = (_f.sent())) === null || _a === void 0 ? void 0 : _a.Settings;
|
|
5824
5982
|
return [3 /*break*/, 4];
|
|
5825
5983
|
case 3:
|
|
5826
|
-
|
|
5827
|
-
|
|
5984
|
+
_e = zoomItem.Style;
|
|
5985
|
+
_f.label = 4;
|
|
5828
5986
|
case 4:
|
|
5829
|
-
style =
|
|
5987
|
+
style = _e;
|
|
5830
5988
|
tagIds = entity.Bruce["Layer.ID"];
|
|
5831
5989
|
tags = [];
|
|
5832
5990
|
if (!(tagIds && tagIds.length > 0)) return [3 /*break*/, 6];
|
|
@@ -5835,8 +5993,8 @@ var EntityRenderEngine;
|
|
|
5835
5993
|
tagIds: tagIds
|
|
5836
5994
|
})];
|
|
5837
5995
|
case 5:
|
|
5838
|
-
tags = (
|
|
5839
|
-
|
|
5996
|
+
tags = (_f.sent()).tags;
|
|
5997
|
+
_f.label = 6;
|
|
5840
5998
|
case 6:
|
|
5841
5999
|
pStyle = (_b = style === null || style === void 0 ? void 0 : style.pointStyle) !== null && _b !== void 0 ? _b : {};
|
|
5842
6000
|
return [4 /*yield*/, Render({
|
|
@@ -5852,17 +6010,17 @@ var EntityRenderEngine;
|
|
|
5852
6010
|
entityHistoric: (_d = params.entitiesHistoric) === null || _d === void 0 ? void 0 : _d[entity.Bruce.ID]
|
|
5853
6011
|
})];
|
|
5854
6012
|
case 7:
|
|
5855
|
-
cEntity =
|
|
6013
|
+
cEntity = _f.sent();
|
|
5856
6014
|
if (!cEntity) return [3 /*break*/, 9];
|
|
5857
6015
|
return [4 /*yield*/, getName(api, entity)];
|
|
5858
6016
|
case 8:
|
|
5859
|
-
name_2 =
|
|
6017
|
+
name_2 = _f.sent();
|
|
5860
6018
|
cEntity.name = name_2;
|
|
5861
|
-
cEntity._renderGroup = getRenderGroupId(zoomItem
|
|
5862
|
-
|
|
6019
|
+
cEntity._renderGroup = getRenderGroupId(zoomItem);
|
|
6020
|
+
_f.label = 9;
|
|
5863
6021
|
case 9:
|
|
5864
6022
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
5865
|
-
|
|
6023
|
+
_f.label = 10;
|
|
5866
6024
|
case 10:
|
|
5867
6025
|
i++;
|
|
5868
6026
|
return [3 /*break*/, 1];
|
|
@@ -5876,7 +6034,7 @@ var EntityRenderEngine;
|
|
|
5876
6034
|
var Polyline;
|
|
5877
6035
|
(function (Polyline) {
|
|
5878
6036
|
function Render(params) {
|
|
5879
|
-
var _a
|
|
6037
|
+
var _a;
|
|
5880
6038
|
var entity = params.entity;
|
|
5881
6039
|
var line = (_a = entity.geometry) === null || _a === void 0 ? void 0 : _a.LineString;
|
|
5882
6040
|
var points = line && typeof line == "string" ? Geometry.ParsePoints(line) : [];
|
|
@@ -5895,14 +6053,7 @@ var EntityRenderEngine;
|
|
|
5895
6053
|
}
|
|
5896
6054
|
var style = params.style;
|
|
5897
6055
|
var heightRef = getHeightRef(style);
|
|
5898
|
-
var
|
|
5899
|
-
// We gain a lot of performance when not clamping.
|
|
5900
|
-
// If there is no terrain we can safely not clamp.
|
|
5901
|
-
if (heightRef == HeightReference.CLAMP_TO_GROUND && shouldApplyFlatFix((_b = params.viewer) === null || _b === void 0 ? void 0 : _b.terrainProvider)) {
|
|
5902
|
-
heightRef = HeightReference.NONE;
|
|
5903
|
-
flattenPoints = true;
|
|
5904
|
-
}
|
|
5905
|
-
var posses = points.map(function (x) { return Cartesian3.fromDegrees(EnsureNumber(x.longitude), EnsureNumber(x.latitude), EnsureNumber(flattenPoints ? 0 : x.altitude)); });
|
|
6056
|
+
var posses = points.map(function (x) { return Cartesian3.fromDegrees(EnsureNumber(x.longitude), EnsureNumber(x.latitude), EnsureNumber(x.altitude)); });
|
|
5906
6057
|
posses = cullDuplicatePoints(posses);
|
|
5907
6058
|
// 5 points should be enough to tell most bad data.
|
|
5908
6059
|
var CHECK_POINTS = 5;
|
|
@@ -5978,7 +6129,8 @@ var EntityRenderEngine;
|
|
|
5978
6129
|
viewer: params.viewer,
|
|
5979
6130
|
entity: entity,
|
|
5980
6131
|
recordHeightRef: heightRef,
|
|
5981
|
-
returnHeightRef: heightRef
|
|
6132
|
+
returnHeightRef: heightRef,
|
|
6133
|
+
allowRendered: false
|
|
5982
6134
|
}),
|
|
5983
6135
|
show: true
|
|
5984
6136
|
});
|
|
@@ -6003,20 +6155,51 @@ var EntityRenderEngine;
|
|
|
6003
6155
|
}
|
|
6004
6156
|
cEntity = params.rendered;
|
|
6005
6157
|
if (units == "px") {
|
|
6006
|
-
cEntity.polyline.positions
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6158
|
+
var oldPosses = getValue$1(params.viewer, cEntity.polyline.positions);
|
|
6159
|
+
if (!comparePositions(posses, oldPosses)) {
|
|
6160
|
+
cEntity.polyline.positions = new ConstantProperty(posses);
|
|
6161
|
+
}
|
|
6162
|
+
var oldWidth = getValue$1(params.viewer, cEntity.polyline.width);
|
|
6163
|
+
if (oldWidth != width) {
|
|
6164
|
+
cEntity.polyline.width = new ConstantProperty(width);
|
|
6165
|
+
}
|
|
6166
|
+
var oldClassification = getValue$1(params.viewer, cEntity.polyline.classificationType);
|
|
6167
|
+
if (oldClassification != classification) {
|
|
6168
|
+
cEntity.polyline.classificationType = new ConstantProperty(classification);
|
|
6169
|
+
}
|
|
6170
|
+
var oldZIndex = getValue$1(params.viewer, cEntity.polyline.zIndex);
|
|
6171
|
+
if (oldZIndex != getZIndex(style, entity, params.tags)) {
|
|
6172
|
+
cEntity.polyline.zIndex = new ConstantProperty(getZIndex(style, entity, params.tags));
|
|
6173
|
+
}
|
|
6174
|
+
var oldClampToGround = getValue$1(params.viewer, cEntity.polyline.clampToGround);
|
|
6175
|
+
var newClampToGround = heightRef == HeightReference.CLAMP_TO_GROUND;
|
|
6176
|
+
if (oldClampToGround != newClampToGround) {
|
|
6177
|
+
cEntity.polyline.clampToGround = new ConstantProperty(newClampToGround);
|
|
6178
|
+
}
|
|
6011
6179
|
cEntity.polyline.distanceDisplayCondition = new ConstantProperty(getDisplayCondition(params.minDistance, params.maxDistance));
|
|
6012
6180
|
cEntity.corridor = undefined;
|
|
6013
6181
|
}
|
|
6014
6182
|
else {
|
|
6015
|
-
cEntity.corridor.positions
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6183
|
+
var oldPosses = getValue$1(params.viewer, cEntity.corridor.positions);
|
|
6184
|
+
if (!comparePositions(posses, oldPosses)) {
|
|
6185
|
+
cEntity.corridor.positions = new ConstantProperty(posses);
|
|
6186
|
+
}
|
|
6187
|
+
var oldWidth = getValue$1(params.viewer, cEntity.corridor.width);
|
|
6188
|
+
if (oldWidth != width) {
|
|
6189
|
+
cEntity.corridor.width = new ConstantProperty(width);
|
|
6190
|
+
}
|
|
6191
|
+
var oldClassification = getValue$1(params.viewer, cEntity.corridor.classificationType);
|
|
6192
|
+
if (oldClassification != classification) {
|
|
6193
|
+
cEntity.corridor.classificationType = new ConstantProperty(classification);
|
|
6194
|
+
}
|
|
6195
|
+
var oldHeightRef = getValue$1(params.viewer, cEntity.corridor.heightReference);
|
|
6196
|
+
if (oldHeightRef != heightRef) {
|
|
6197
|
+
cEntity.corridor.heightReference = new ConstantProperty(heightRef);
|
|
6198
|
+
}
|
|
6199
|
+
var oldZIndex = getValue$1(params.viewer, cEntity.corridor.zIndex);
|
|
6200
|
+
if (oldZIndex != getZIndex(style, entity, params.tags)) {
|
|
6201
|
+
cEntity.corridor.zIndex = new ConstantProperty(getZIndex(style, entity, params.tags));
|
|
6202
|
+
}
|
|
6020
6203
|
cEntity.corridor.distanceDisplayCondition = new ConstantProperty(getDisplayCondition(params.minDistance, params.maxDistance, width));
|
|
6021
6204
|
cEntity.polyline = undefined;
|
|
6022
6205
|
}
|
|
@@ -6029,28 +6212,33 @@ var EntityRenderEngine;
|
|
|
6029
6212
|
override: true,
|
|
6030
6213
|
requestRender: false
|
|
6031
6214
|
});
|
|
6032
|
-
|
|
6215
|
+
var oldPos = getValue$1(params.viewer, cEntity.position);
|
|
6216
|
+
var newPos = EntityUtils.GetPos({
|
|
6033
6217
|
viewer: params.viewer,
|
|
6034
6218
|
entity: entity,
|
|
6035
6219
|
recordHeightRef: heightRef,
|
|
6036
|
-
returnHeightRef: heightRef
|
|
6037
|
-
|
|
6220
|
+
returnHeightRef: heightRef,
|
|
6221
|
+
allowRendered: false
|
|
6222
|
+
});
|
|
6223
|
+
if (newPos && (!oldPos || !Cartes.IsEqualCartes3(oldPos, newPos))) {
|
|
6224
|
+
cEntity.position = new ConstantPositionProperty(newPos);
|
|
6225
|
+
}
|
|
6038
6226
|
cEntity.show = true;
|
|
6039
6227
|
}
|
|
6040
6228
|
return cEntity;
|
|
6041
6229
|
}
|
|
6042
6230
|
Polyline.Render = Render;
|
|
6043
6231
|
function RenderGroup(params) {
|
|
6044
|
-
var _a, _b, _c
|
|
6232
|
+
var _a, _b, _c;
|
|
6045
6233
|
return __awaiter(this, void 0, void 0, function () {
|
|
6046
|
-
var api, cEntities, i, entity, zoomItem, style,
|
|
6047
|
-
return __generator(this, function (
|
|
6048
|
-
switch (
|
|
6234
|
+
var api, cEntities, i, entity, zoomItem, style, _d, tagIds, tags, lStyle, cEntity, name_3;
|
|
6235
|
+
return __generator(this, function (_e) {
|
|
6236
|
+
switch (_e.label) {
|
|
6049
6237
|
case 0:
|
|
6050
6238
|
api = params.apiGetter.getApi();
|
|
6051
6239
|
cEntities = new Map();
|
|
6052
6240
|
i = 0;
|
|
6053
|
-
|
|
6241
|
+
_e.label = 1;
|
|
6054
6242
|
case 1:
|
|
6055
6243
|
if (!(i < params.entities.length)) return [3 /*break*/, 9];
|
|
6056
6244
|
entity = params.entities[i];
|
|
@@ -6058,13 +6246,13 @@ var EntityRenderEngine;
|
|
|
6058
6246
|
if (!(zoomItem.StyleID != -1)) return [3 /*break*/, 3];
|
|
6059
6247
|
return [4 /*yield*/, getStyle(api, entity, zoomItem.StyleID)];
|
|
6060
6248
|
case 2:
|
|
6061
|
-
|
|
6249
|
+
_d = (_a = (_e.sent())) === null || _a === void 0 ? void 0 : _a.Settings;
|
|
6062
6250
|
return [3 /*break*/, 4];
|
|
6063
6251
|
case 3:
|
|
6064
|
-
|
|
6065
|
-
|
|
6252
|
+
_d = zoomItem.Style;
|
|
6253
|
+
_e.label = 4;
|
|
6066
6254
|
case 4:
|
|
6067
|
-
style =
|
|
6255
|
+
style = _d;
|
|
6068
6256
|
tagIds = entity.Bruce["Layer.ID"];
|
|
6069
6257
|
tags = [];
|
|
6070
6258
|
if (!(tagIds && tagIds.length > 0)) return [3 /*break*/, 6];
|
|
@@ -6073,8 +6261,8 @@ var EntityRenderEngine;
|
|
|
6073
6261
|
tagIds: tagIds
|
|
6074
6262
|
})];
|
|
6075
6263
|
case 5:
|
|
6076
|
-
tags = (
|
|
6077
|
-
|
|
6264
|
+
tags = (_e.sent()).tags;
|
|
6265
|
+
_e.label = 6;
|
|
6078
6266
|
case 6:
|
|
6079
6267
|
lStyle = (_b = style === null || style === void 0 ? void 0 : style.polylineStyle) !== null && _b !== void 0 ? _b : {};
|
|
6080
6268
|
cEntity = Render({
|
|
@@ -6089,11 +6277,11 @@ var EntityRenderEngine;
|
|
|
6089
6277
|
if (!cEntity) return [3 /*break*/, 8];
|
|
6090
6278
|
return [4 /*yield*/, getName(api, entity)];
|
|
6091
6279
|
case 7:
|
|
6092
|
-
name_3 =
|
|
6280
|
+
name_3 = _e.sent();
|
|
6093
6281
|
cEntity.name = name_3;
|
|
6094
|
-
cEntity._renderGroup = getRenderGroupId(zoomItem
|
|
6282
|
+
cEntity._renderGroup = getRenderGroupId(zoomItem);
|
|
6095
6283
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
6096
|
-
|
|
6284
|
+
_e.label = 8;
|
|
6097
6285
|
case 8:
|
|
6098
6286
|
i++;
|
|
6099
6287
|
return [3 /*break*/, 1];
|
|
@@ -6107,7 +6295,7 @@ var EntityRenderEngine;
|
|
|
6107
6295
|
var Polygon;
|
|
6108
6296
|
(function (Polygon) {
|
|
6109
6297
|
function Render(params) {
|
|
6110
|
-
var _a, _b, _c
|
|
6298
|
+
var _a, _b, _c;
|
|
6111
6299
|
var entity = params.entity;
|
|
6112
6300
|
var pRings = (_a = entity.geometry) === null || _a === void 0 ? void 0 : _a.Polygon;
|
|
6113
6301
|
if (pRings == null || pRings.length <= 0) {
|
|
@@ -6146,15 +6334,10 @@ var EntityRenderEngine;
|
|
|
6146
6334
|
if (posses.length < 4) {
|
|
6147
6335
|
return null;
|
|
6148
6336
|
}
|
|
6149
|
-
var flattenPoints = false;
|
|
6150
|
-
if (heightRef == HeightReference.CLAMP_TO_GROUND && shouldApplyFlatFix((_b = params.viewer) === null || _b === void 0 ? void 0 : _b.terrainProvider)) {
|
|
6151
|
-
heightRef = HeightReference.NONE;
|
|
6152
|
-
flattenPoints = true;
|
|
6153
|
-
}
|
|
6154
6337
|
var holeRings = pRings.filter(function (x) { return x.Facing == Geometry.EPolygonRingType.Hole; });
|
|
6155
6338
|
var holePosses = holeRings.map(function (x) {
|
|
6156
6339
|
var points = Geometry.ParsePoints(x.LinearRing);
|
|
6157
|
-
var holePosses = points.map(function (x) { return Cartesian3.fromDegrees(EnsureNumber(x.longitude), EnsureNumber(x.latitude), EnsureNumber(
|
|
6340
|
+
var holePosses = points.map(function (x) { return Cartesian3.fromDegrees(EnsureNumber(x.longitude), EnsureNumber(x.latitude), EnsureNumber(x.altitude)); });
|
|
6158
6341
|
holePosses = cullDuplicatePoints(holePosses);
|
|
6159
6342
|
return holePosses;
|
|
6160
6343
|
}).filter(function (x) { return x.length >= 4; });
|
|
@@ -6206,7 +6389,8 @@ var EntityRenderEngine;
|
|
|
6206
6389
|
viewer: params.viewer,
|
|
6207
6390
|
entity: entity,
|
|
6208
6391
|
recordHeightRef: heightRef,
|
|
6209
|
-
returnHeightRef: heightRef
|
|
6392
|
+
returnHeightRef: heightRef,
|
|
6393
|
+
allowRendered: false
|
|
6210
6394
|
}),
|
|
6211
6395
|
show: true
|
|
6212
6396
|
});
|
|
@@ -6216,21 +6400,46 @@ var EntityRenderEngine;
|
|
|
6216
6400
|
// So this is a "good enough" way rather than perfect as it only preserves the outline.
|
|
6217
6401
|
prepareExistingGraphic(params.rendered, hasOutline ? 1 : 0);
|
|
6218
6402
|
cEntity = params.rendered;
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6403
|
+
// We'll do a number of checks to avoid updating the entity if it's not needed.
|
|
6404
|
+
var oldHierarchy = getValue$1(params.viewer, cEntity.polygon.hierarchy);
|
|
6405
|
+
var newHierarchy = new PolygonHierarchy(posses, holePosses.map(function (x) { return new PolygonHierarchy(x); }));
|
|
6406
|
+
if (!comparePolygonHierarchies(oldHierarchy, newHierarchy)) {
|
|
6407
|
+
cEntity.polygon.hierarchy = new ConstantProperty(newHierarchy);
|
|
6408
|
+
}
|
|
6409
|
+
var oldExtrusion = getValue$1(params.viewer, cEntity.polygon.extrudedHeight);
|
|
6410
|
+
if (oldExtrusion != extrusion.value) {
|
|
6411
|
+
cEntity.polygon.extrudedHeight = new ConstantProperty(extrusion.value);
|
|
6412
|
+
}
|
|
6413
|
+
var oldExHeightRef = getValue$1(params.viewer, cEntity.polygon.extrudedHeightReference);
|
|
6414
|
+
if (oldExHeightRef != extrusion.exHeightRef) {
|
|
6415
|
+
cEntity.polygon.extrudedHeightReference = new ConstantProperty(extrusion.exHeightRef);
|
|
6416
|
+
}
|
|
6417
|
+
var oldHeightRef = getValue$1(params.viewer, cEntity.polygon.heightReference);
|
|
6418
|
+
if (oldHeightRef != heightRef) {
|
|
6419
|
+
cEntity.polygon.heightReference = new ConstantProperty(heightRef);
|
|
6420
|
+
}
|
|
6421
|
+
var oldPerPosHeight = getValue$1(params.viewer, cEntity.polygon.perPositionHeight);
|
|
6422
|
+
if (oldPerPosHeight != (heightRef == HeightReference.CLAMP_TO_GROUND ? false : true)) {
|
|
6423
|
+
cEntity.polygon.perPositionHeight = new ConstantProperty(heightRef == HeightReference.CLAMP_TO_GROUND ? false : true);
|
|
6424
|
+
}
|
|
6425
|
+
var oldPosition = getValue$1(params.viewer, cEntity.position);
|
|
6426
|
+
var newPosition = EntityUtils.GetPos({
|
|
6229
6427
|
viewer: params.viewer,
|
|
6230
6428
|
entity: entity,
|
|
6231
6429
|
recordHeightRef: heightRef,
|
|
6232
|
-
returnHeightRef: heightRef
|
|
6233
|
-
|
|
6430
|
+
returnHeightRef: heightRef,
|
|
6431
|
+
allowRendered: false
|
|
6432
|
+
});
|
|
6433
|
+
if (newPosition && (!oldPosition || !Cartes.IsEqualCartes3(oldPosition, newPosition))) {
|
|
6434
|
+
cEntity.position = new ConstantPositionProperty(newPosition);
|
|
6435
|
+
}
|
|
6436
|
+
var oldZIndex = getValue$1(params.viewer, cEntity.polygon.zIndex);
|
|
6437
|
+
if (oldZIndex != zIndex) {
|
|
6438
|
+
cEntity.polygon.zIndex = new ConstantProperty(zIndex);
|
|
6439
|
+
}
|
|
6440
|
+
cEntity.polygon.distanceDisplayCondition = new ConstantProperty(getDisplayCondition(params.minDistance, params.maxDistance, width <= 0 || !cLineColor || units == "m" ? size : null, true));
|
|
6441
|
+
cEntity.polygon.shadows = new ConstantProperty(ShadowMode.ENABLED);
|
|
6442
|
+
cEntity.polygon.classificationType = new ConstantProperty(classification);
|
|
6234
6443
|
// We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
|
|
6235
6444
|
// WARNING: polygon does not support animation (yet?).
|
|
6236
6445
|
CesiumEntityStyler.SetDefaultColor({
|
|
@@ -6245,28 +6454,16 @@ var EntityRenderEngine;
|
|
|
6245
6454
|
if (hasOutline) {
|
|
6246
6455
|
var borderHeight = undefined;
|
|
6247
6456
|
if (heightRef != HeightReference.CLAMP_TO_GROUND) {
|
|
6248
|
-
if (flattenPoints) {
|
|
6249
|
-
borderHeight = 0;
|
|
6250
|
-
}
|
|
6251
6457
|
// Set height to smallest height value from points.
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
borderHeight = point.altitude;
|
|
6257
|
-
}
|
|
6458
|
+
for (var i = 0; i < points.length; i++) {
|
|
6459
|
+
var point = points[i];
|
|
6460
|
+
if (!borderHeight || point.altitude < borderHeight) {
|
|
6461
|
+
borderHeight = point.altitude;
|
|
6258
6462
|
}
|
|
6259
6463
|
}
|
|
6260
6464
|
}
|
|
6261
|
-
var borderPosses =
|
|
6262
|
-
|
|
6263
|
-
borderPosses = points.map(function (x) { return Cartesian3.fromDegrees(EnsureNumber(x.longitude), EnsureNumber(x.latitude), EnsureNumber(0)); });
|
|
6264
|
-
Cartes.CloseRing3(borderPosses);
|
|
6265
|
-
}
|
|
6266
|
-
else {
|
|
6267
|
-
borderPosses = posses.map(function (x) { return x.clone ? x.clone() : __assign({}, x); });
|
|
6268
|
-
}
|
|
6269
|
-
var cEntityBorder = (_d = (_c = params.rendered) === null || _c === void 0 ? void 0 : _c._siblingGraphics) === null || _d === void 0 ? void 0 : _d[0];
|
|
6465
|
+
var borderPosses = posses.map(function (x) { return x.clone ? x.clone() : __assign({}, x); });
|
|
6466
|
+
var cEntityBorder = (_c = (_b = params.rendered) === null || _b === void 0 ? void 0 : _b._siblingGraphics) === null || _c === void 0 ? void 0 : _c[0];
|
|
6270
6467
|
cEntity._siblingGraphics = [];
|
|
6271
6468
|
if (!cEntityBorder || ((!cEntityBorder.polyline && units == "px") ||
|
|
6272
6469
|
(!cEntityBorder.corridor && units == "m"))) {
|
|
@@ -6300,24 +6497,60 @@ var EntityRenderEngine;
|
|
|
6300
6497
|
}
|
|
6301
6498
|
else {
|
|
6302
6499
|
if (units == "px") {
|
|
6303
|
-
cEntityBorder.polyline.positions
|
|
6304
|
-
|
|
6305
|
-
|
|
6500
|
+
var oldPosses = getValue$1(params.viewer, cEntityBorder.polyline.positions);
|
|
6501
|
+
if (!comparePositions(oldPosses, borderPosses)) {
|
|
6502
|
+
cEntityBorder.polyline.positions = new ConstantProperty(borderPosses);
|
|
6503
|
+
}
|
|
6504
|
+
var oldWidth = getValue$1(params.viewer, cEntityBorder.polyline.width);
|
|
6505
|
+
if (oldWidth != width) {
|
|
6506
|
+
cEntityBorder.polyline.width = new ConstantProperty(width);
|
|
6507
|
+
}
|
|
6508
|
+
var oldClampToGround = getValue$1(params.viewer, cEntityBorder.polyline.clampToGround);
|
|
6509
|
+
var newClampToGround = heightRef == HeightReference.CLAMP_TO_GROUND;
|
|
6510
|
+
if (oldClampToGround != newClampToGround) {
|
|
6511
|
+
cEntityBorder.polyline.clampToGround = new ConstantProperty(newClampToGround);
|
|
6512
|
+
}
|
|
6513
|
+
var oldZIndex = getValue$1(params.viewer, cEntityBorder.polyline.zIndex);
|
|
6514
|
+
if (oldZIndex != zIndex) {
|
|
6515
|
+
cEntityBorder.polyline.zIndex = new ConstantProperty(zIndex);
|
|
6516
|
+
}
|
|
6517
|
+
var oldMaterial = getValue$1(params.viewer, cEntityBorder.polyline.material);
|
|
6518
|
+
var newMaterial = new ColorMaterialProperty(cLineColor);
|
|
6519
|
+
if (compareColorMaterials(params.viewer, oldMaterial, newMaterial)) {
|
|
6520
|
+
cEntityBorder.polyline.material = newMaterial;
|
|
6521
|
+
}
|
|
6306
6522
|
cEntityBorder.polyline.classificationType = new ConstantProperty(ClassificationType.TERRAIN);
|
|
6307
|
-
cEntityBorder.polyline.zIndex = new ConstantProperty(zIndex);
|
|
6308
6523
|
cEntityBorder.polyline.distanceDisplayCondition = new ConstantProperty(getDisplayCondition(params.minDistance, params.maxDistance));
|
|
6309
|
-
cEntityBorder.polyline.material = new ColorMaterialProperty(cLineColor);
|
|
6310
6524
|
cEntityBorder.corridor = undefined;
|
|
6311
6525
|
}
|
|
6312
6526
|
else {
|
|
6313
|
-
cEntityBorder.corridor.positions
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6527
|
+
var oldPosses = getValue$1(params.viewer, cEntityBorder.corridor.positions);
|
|
6528
|
+
if (!comparePositions(oldPosses, borderPosses)) {
|
|
6529
|
+
cEntityBorder.corridor.positions = new ConstantProperty(borderPosses);
|
|
6530
|
+
}
|
|
6531
|
+
var oldHeightRef = getValue$1(params.viewer, cEntityBorder.corridor.heightReference);
|
|
6532
|
+
if (oldHeightRef != heightRef) {
|
|
6533
|
+
cEntityBorder.corridor.heightReference = new ConstantProperty(heightRef);
|
|
6534
|
+
}
|
|
6535
|
+
var oldBorderHeight = getValue$1(params.viewer, cEntityBorder.corridor.height);
|
|
6536
|
+
if (oldBorderHeight != borderHeight) {
|
|
6537
|
+
cEntityBorder.corridor.height = new ConstantProperty(borderHeight);
|
|
6538
|
+
}
|
|
6539
|
+
var oldWidth = getValue$1(params.viewer, cEntityBorder.corridor.width);
|
|
6540
|
+
if (oldWidth != width) {
|
|
6541
|
+
cEntityBorder.corridor.width = new ConstantProperty(width);
|
|
6542
|
+
}
|
|
6543
|
+
var oldZIndex = getValue$1(params.viewer, cEntityBorder.corridor.zIndex);
|
|
6544
|
+
if (oldZIndex != zIndex + 1) {
|
|
6545
|
+
cEntityBorder.corridor.zIndex = new ConstantProperty(zIndex + 1);
|
|
6546
|
+
}
|
|
6547
|
+
var oldMaterial = getValue$1(params.viewer, cEntityBorder.corridor.material);
|
|
6548
|
+
var newMaterial = new ColorMaterialProperty(cLineColor);
|
|
6549
|
+
if (compareColorMaterials(params.viewer, oldMaterial, newMaterial)) {
|
|
6550
|
+
cEntityBorder.corridor.material = newMaterial;
|
|
6551
|
+
}
|
|
6317
6552
|
cEntityBorder.corridor.fill = new ConstantProperty(true);
|
|
6318
|
-
cEntityBorder.corridor.zIndex = new ConstantProperty(zIndex + 1);
|
|
6319
6553
|
cEntityBorder.corridor.distanceDisplayCondition = new ConstantProperty(getDisplayCondition(params.minDistance, params.maxDistance, width));
|
|
6320
|
-
cEntityBorder.corridor.material = new ColorMaterialProperty(cLineColor);
|
|
6321
6554
|
cEntityBorder.polyline = undefined;
|
|
6322
6555
|
}
|
|
6323
6556
|
cEntityBorder.show = true;
|
|
@@ -6365,16 +6598,16 @@ var EntityRenderEngine;
|
|
|
6365
6598
|
}
|
|
6366
6599
|
Polygon.Render = Render;
|
|
6367
6600
|
function RenderGroup(params) {
|
|
6368
|
-
var _a, _b, _c
|
|
6601
|
+
var _a, _b, _c;
|
|
6369
6602
|
return __awaiter(this, void 0, void 0, function () {
|
|
6370
|
-
var api, cEntities, i, entity, zoomItem, style,
|
|
6371
|
-
return __generator(this, function (
|
|
6372
|
-
switch (
|
|
6603
|
+
var api, cEntities, i, entity, zoomItem, style, _d, tagIds, tags, pStyle, cEntity, name_4;
|
|
6604
|
+
return __generator(this, function (_e) {
|
|
6605
|
+
switch (_e.label) {
|
|
6373
6606
|
case 0:
|
|
6374
6607
|
api = params.apiGetter.getApi();
|
|
6375
6608
|
cEntities = new Map();
|
|
6376
6609
|
i = 0;
|
|
6377
|
-
|
|
6610
|
+
_e.label = 1;
|
|
6378
6611
|
case 1:
|
|
6379
6612
|
if (!(i < params.entities.length)) return [3 /*break*/, 9];
|
|
6380
6613
|
entity = params.entities[i];
|
|
@@ -6382,13 +6615,13 @@ var EntityRenderEngine;
|
|
|
6382
6615
|
if (!(zoomItem.StyleID != -1)) return [3 /*break*/, 3];
|
|
6383
6616
|
return [4 /*yield*/, getStyle(api, entity, zoomItem.StyleID)];
|
|
6384
6617
|
case 2:
|
|
6385
|
-
|
|
6618
|
+
_d = (_a = (_e.sent())) === null || _a === void 0 ? void 0 : _a.Settings;
|
|
6386
6619
|
return [3 /*break*/, 4];
|
|
6387
6620
|
case 3:
|
|
6388
|
-
|
|
6389
|
-
|
|
6621
|
+
_d = zoomItem.Style;
|
|
6622
|
+
_e.label = 4;
|
|
6390
6623
|
case 4:
|
|
6391
|
-
style =
|
|
6624
|
+
style = _d;
|
|
6392
6625
|
tagIds = entity.Bruce["Layer.ID"];
|
|
6393
6626
|
tags = [];
|
|
6394
6627
|
if (!(tagIds && tagIds.length > 0)) return [3 /*break*/, 6];
|
|
@@ -6397,8 +6630,8 @@ var EntityRenderEngine;
|
|
|
6397
6630
|
tagIds: tagIds
|
|
6398
6631
|
})];
|
|
6399
6632
|
case 5:
|
|
6400
|
-
tags = (
|
|
6401
|
-
|
|
6633
|
+
tags = (_e.sent()).tags;
|
|
6634
|
+
_e.label = 6;
|
|
6402
6635
|
case 6:
|
|
6403
6636
|
pStyle = (_b = style === null || style === void 0 ? void 0 : style.polygonStyle) !== null && _b !== void 0 ? _b : {};
|
|
6404
6637
|
cEntity = Render({
|
|
@@ -6408,16 +6641,19 @@ var EntityRenderEngine;
|
|
|
6408
6641
|
viewer: params.viewer,
|
|
6409
6642
|
maxDistance: zoomItem.MaxZoom,
|
|
6410
6643
|
minDistance: zoomItem.MinZoom,
|
|
6644
|
+
// Temporarily disabling re-using graphics for polygons as they have some bugs, and
|
|
6645
|
+
// they don't support any animation yet.
|
|
6646
|
+
// rendered: null
|
|
6411
6647
|
rendered: (_c = params.rendered) === null || _c === void 0 ? void 0 : _c.get(entity.Bruce.ID)
|
|
6412
6648
|
});
|
|
6413
6649
|
if (!cEntity) return [3 /*break*/, 8];
|
|
6414
6650
|
return [4 /*yield*/, getName(api, entity)];
|
|
6415
6651
|
case 7:
|
|
6416
|
-
name_4 =
|
|
6652
|
+
name_4 = _e.sent();
|
|
6417
6653
|
cEntity.name = name_4;
|
|
6418
|
-
cEntity._renderGroup = getRenderGroupId(zoomItem
|
|
6654
|
+
cEntity._renderGroup = getRenderGroupId(zoomItem);
|
|
6419
6655
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
6420
|
-
|
|
6656
|
+
_e.label = 8;
|
|
6421
6657
|
case 8:
|
|
6422
6658
|
i++;
|
|
6423
6659
|
return [3 /*break*/, 1];
|
|
@@ -6456,13 +6692,9 @@ var EntityRenderEngine;
|
|
|
6456
6692
|
viewer: params.viewer,
|
|
6457
6693
|
entity: entity,
|
|
6458
6694
|
recordHeightRef: heightRef,
|
|
6459
|
-
returnHeightRef: heightRef
|
|
6695
|
+
returnHeightRef: heightRef,
|
|
6696
|
+
allowRendered: false
|
|
6460
6697
|
});
|
|
6461
|
-
if (heightRef == HeightReference.CLAMP_TO_GROUND) {
|
|
6462
|
-
var carto = Cartographic.fromCartesian(pos3d);
|
|
6463
|
-
pos3d = Cartesian3.fromRadians(EnsureNumber(carto.longitude), EnsureNumber(carto.latitude), 0);
|
|
6464
|
-
heightRef = HeightReference.RELATIVE_TO_GROUND;
|
|
6465
|
-
}
|
|
6466
6698
|
var blendMode = null;
|
|
6467
6699
|
var blendAmount = null;
|
|
6468
6700
|
var color = null;
|
|
@@ -6511,7 +6743,8 @@ var EntityRenderEngine;
|
|
|
6511
6743
|
viewer: params.viewer,
|
|
6512
6744
|
entity: entity,
|
|
6513
6745
|
recordHeightRef: heightRef,
|
|
6514
|
-
returnHeightRef: heightRef
|
|
6746
|
+
returnHeightRef: heightRef,
|
|
6747
|
+
allowRendered: false
|
|
6515
6748
|
}); }, true);
|
|
6516
6749
|
}
|
|
6517
6750
|
cEntity = new Entity({
|
|
@@ -6743,16 +6976,16 @@ var EntityRenderEngine;
|
|
|
6743
6976
|
}
|
|
6744
6977
|
Model3d.Render = Render;
|
|
6745
6978
|
function RenderGroup(params) {
|
|
6746
|
-
var _a, _b, _c, _d, _e, _f
|
|
6979
|
+
var _a, _b, _c, _d, _e, _f;
|
|
6747
6980
|
return __awaiter(this, void 0, void 0, function () {
|
|
6748
|
-
var api, cEntities, reqBody, i, entity, zoomItem, style,
|
|
6749
|
-
return __generator(this, function (
|
|
6750
|
-
switch (
|
|
6981
|
+
var api, cEntities, reqBody, i, entity, zoomItem, style, _g, tagIds, tags, mStyle, group, level, catId, lodData, _loop_2, i;
|
|
6982
|
+
return __generator(this, function (_h) {
|
|
6983
|
+
switch (_h.label) {
|
|
6751
6984
|
case 0:
|
|
6752
6985
|
api = params.apiGetter.getApi();
|
|
6753
6986
|
return [4 /*yield*/, api.Loading];
|
|
6754
6987
|
case 1:
|
|
6755
|
-
|
|
6988
|
+
_h.sent();
|
|
6756
6989
|
cEntities = new Map();
|
|
6757
6990
|
reqBody = {
|
|
6758
6991
|
"strict": false,
|
|
@@ -6760,7 +6993,7 @@ var EntityRenderEngine;
|
|
|
6760
6993
|
"Items": []
|
|
6761
6994
|
};
|
|
6762
6995
|
i = 0;
|
|
6763
|
-
|
|
6996
|
+
_h.label = 2;
|
|
6764
6997
|
case 2:
|
|
6765
6998
|
if (!(i < params.entities.length)) return [3 /*break*/, 9];
|
|
6766
6999
|
entity = params.entities[i];
|
|
@@ -6768,13 +7001,13 @@ var EntityRenderEngine;
|
|
|
6768
7001
|
if (!(zoomItem.StyleID != -1)) return [3 /*break*/, 4];
|
|
6769
7002
|
return [4 /*yield*/, getStyle(api, entity, zoomItem.StyleID)];
|
|
6770
7003
|
case 3:
|
|
6771
|
-
|
|
7004
|
+
_g = (_a = (_h.sent())) === null || _a === void 0 ? void 0 : _a.Settings;
|
|
6772
7005
|
return [3 /*break*/, 5];
|
|
6773
7006
|
case 4:
|
|
6774
|
-
|
|
6775
|
-
|
|
7007
|
+
_g = zoomItem.Style;
|
|
7008
|
+
_h.label = 5;
|
|
6776
7009
|
case 5:
|
|
6777
|
-
style =
|
|
7010
|
+
style = _g;
|
|
6778
7011
|
tagIds = entity.Bruce["Layer.ID"];
|
|
6779
7012
|
tags = [];
|
|
6780
7013
|
if (!(tagIds && tagIds.length > 0)) return [3 /*break*/, 7];
|
|
@@ -6783,8 +7016,8 @@ var EntityRenderEngine;
|
|
|
6783
7016
|
tagIds: tagIds
|
|
6784
7017
|
})];
|
|
6785
7018
|
case 6:
|
|
6786
|
-
tags = (
|
|
6787
|
-
|
|
7019
|
+
tags = (_h.sent()).tags;
|
|
7020
|
+
_h.label = 7;
|
|
6788
7021
|
case 7:
|
|
6789
7022
|
mStyle = (_b = style === null || style === void 0 ? void 0 : style.modelStyle) !== null && _b !== void 0 ? _b : {};
|
|
6790
7023
|
group = mStyle.lodGroup ? Calculator.GetString(mStyle.lodGroup, entity, tags) : null;
|
|
@@ -6805,7 +7038,7 @@ var EntityRenderEngine;
|
|
|
6805
7038
|
"group": group,
|
|
6806
7039
|
"level": level
|
|
6807
7040
|
});
|
|
6808
|
-
|
|
7041
|
+
_h.label = 8;
|
|
6809
7042
|
case 8:
|
|
6810
7043
|
i++;
|
|
6811
7044
|
return [3 /*break*/, 2];
|
|
@@ -6814,24 +7047,24 @@ var EntityRenderEngine;
|
|
|
6814
7047
|
filter: reqBody
|
|
6815
7048
|
})];
|
|
6816
7049
|
case 10:
|
|
6817
|
-
lodData = (
|
|
7050
|
+
lodData = (_h.sent()).lods;
|
|
6818
7051
|
_loop_2 = function (i) {
|
|
6819
|
-
var entity, zoomItem, style,
|
|
6820
|
-
return __generator(this, function (
|
|
6821
|
-
switch (
|
|
7052
|
+
var entity, zoomItem, style, _j, tagIds, tags, lod, mStyle, cEntity, name_5;
|
|
7053
|
+
return __generator(this, function (_k) {
|
|
7054
|
+
switch (_k.label) {
|
|
6822
7055
|
case 0:
|
|
6823
7056
|
entity = params.entities[i];
|
|
6824
7057
|
zoomItem = params.zoomItems[entity.Bruce.ID];
|
|
6825
7058
|
if (!(zoomItem.StyleID != -1)) return [3 /*break*/, 2];
|
|
6826
7059
|
return [4 /*yield*/, getStyle(api, entity, zoomItem.StyleID)];
|
|
6827
7060
|
case 1:
|
|
6828
|
-
|
|
7061
|
+
_j = (_c = (_k.sent())) === null || _c === void 0 ? void 0 : _c.Settings;
|
|
6829
7062
|
return [3 /*break*/, 3];
|
|
6830
7063
|
case 2:
|
|
6831
|
-
|
|
6832
|
-
|
|
7064
|
+
_j = zoomItem.Style;
|
|
7065
|
+
_k.label = 3;
|
|
6833
7066
|
case 3:
|
|
6834
|
-
style =
|
|
7067
|
+
style = _j;
|
|
6835
7068
|
tagIds = entity.Bruce["Layer.ID"];
|
|
6836
7069
|
tags = [];
|
|
6837
7070
|
if (!(tagIds && tagIds.length > 0)) return [3 /*break*/, 5];
|
|
@@ -6840,8 +7073,8 @@ var EntityRenderEngine;
|
|
|
6840
7073
|
tagIds: tagIds
|
|
6841
7074
|
})];
|
|
6842
7075
|
case 4:
|
|
6843
|
-
tags = (
|
|
6844
|
-
|
|
7076
|
+
tags = (_k.sent()).tags;
|
|
7077
|
+
_k.label = 5;
|
|
6845
7078
|
case 5:
|
|
6846
7079
|
lod = lodData.find(function (x) { return x.entityId == entity.Bruce.ID; });
|
|
6847
7080
|
if (!(lod === null || lod === void 0 ? void 0 : lod.clientFileId)) {
|
|
@@ -6867,23 +7100,23 @@ var EntityRenderEngine;
|
|
|
6867
7100
|
if (!cEntity) return [3 /*break*/, 7];
|
|
6868
7101
|
return [4 /*yield*/, getName(api, entity)];
|
|
6869
7102
|
case 6:
|
|
6870
|
-
name_5 =
|
|
7103
|
+
name_5 = _k.sent();
|
|
6871
7104
|
cEntity.name = name_5;
|
|
6872
|
-
cEntity._renderGroup = getRenderGroupId(zoomItem
|
|
7105
|
+
cEntity._renderGroup = getRenderGroupId(zoomItem);
|
|
6873
7106
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
6874
|
-
|
|
7107
|
+
_k.label = 7;
|
|
6875
7108
|
case 7: return [2 /*return*/];
|
|
6876
7109
|
}
|
|
6877
7110
|
});
|
|
6878
7111
|
};
|
|
6879
7112
|
i = 0;
|
|
6880
|
-
|
|
7113
|
+
_h.label = 11;
|
|
6881
7114
|
case 11:
|
|
6882
7115
|
if (!(i < params.entities.length)) return [3 /*break*/, 14];
|
|
6883
7116
|
return [5 /*yield**/, _loop_2(i)];
|
|
6884
7117
|
case 12:
|
|
6885
|
-
|
|
6886
|
-
|
|
7118
|
+
_h.sent();
|
|
7119
|
+
_h.label = 13;
|
|
6887
7120
|
case 13:
|
|
6888
7121
|
i++;
|
|
6889
7122
|
return [3 /*break*/, 11];
|
|
@@ -8110,7 +8343,7 @@ var EntityLabel;
|
|
|
8110
8343
|
EntityLabel.GetLabel = GetLabel;
|
|
8111
8344
|
})(EntityLabel || (EntityLabel = {}));
|
|
8112
8345
|
|
|
8113
|
-
function getColor$
|
|
8346
|
+
function getColor$3(viewer, obj) {
|
|
8114
8347
|
var value = null;
|
|
8115
8348
|
if (obj === null || obj === void 0 ? void 0 : obj.getValue) {
|
|
8116
8349
|
var date = viewer.scene.lastRenderTime;
|
|
@@ -8162,7 +8395,7 @@ var CesiumAnimatedInOut;
|
|
|
8162
8395
|
var thing_1;
|
|
8163
8396
|
var colorPropKey_1;
|
|
8164
8397
|
if (piece.model) {
|
|
8165
|
-
var curColor = getColor$
|
|
8398
|
+
var curColor = getColor$3(viewer, piece.model.color);
|
|
8166
8399
|
if (!curColor) {
|
|
8167
8400
|
curColor = Color.WHITE.clone();
|
|
8168
8401
|
}
|
|
@@ -8176,7 +8409,7 @@ var CesiumAnimatedInOut;
|
|
|
8176
8409
|
colorPropKey_1 = "color";
|
|
8177
8410
|
}
|
|
8178
8411
|
else if (piece.point) {
|
|
8179
|
-
var curColor = getColor$
|
|
8412
|
+
var curColor = getColor$3(viewer, piece.point.color);
|
|
8180
8413
|
if (!curColor) {
|
|
8181
8414
|
curColor = Color.WHITE.clone();
|
|
8182
8415
|
}
|
|
@@ -8190,7 +8423,7 @@ var CesiumAnimatedInOut;
|
|
|
8190
8423
|
colorPropKey_1 = "color";
|
|
8191
8424
|
}
|
|
8192
8425
|
else if (piece.billboard) {
|
|
8193
|
-
var curColor = getColor$
|
|
8426
|
+
var curColor = getColor$3(viewer, piece.billboard.color);
|
|
8194
8427
|
if (!curColor) {
|
|
8195
8428
|
curColor = Color.WHITE.clone();
|
|
8196
8429
|
}
|
|
@@ -10253,7 +10486,7 @@ var EntitiesRenderManager;
|
|
|
10253
10486
|
this.item.CameraZoomSettings = [
|
|
10254
10487
|
{
|
|
10255
10488
|
MinZoom: 0,
|
|
10256
|
-
MaxZoom:
|
|
10489
|
+
MaxZoom: 200000,
|
|
10257
10490
|
DisplayType: ZoomControl.EDisplayType.Model3D,
|
|
10258
10491
|
LODCategoryID: "glb",
|
|
10259
10492
|
LODLevel: 0,
|
|
@@ -11253,7 +11486,7 @@ var EntitiesLoadedRenderManager;
|
|
|
11253
11486
|
this.item.CameraZoomSettings = [
|
|
11254
11487
|
{
|
|
11255
11488
|
MinZoom: 0,
|
|
11256
|
-
MaxZoom:
|
|
11489
|
+
MaxZoom: 200000,
|
|
11257
11490
|
DisplayType: ZoomControl.EDisplayType.Model3D,
|
|
11258
11491
|
LODCategoryID: "glb",
|
|
11259
11492
|
LODLevel: 0,
|
|
@@ -11921,7 +12154,7 @@ var EntitiesIdsRenderManager;
|
|
|
11921
12154
|
this.item.CameraZoomSettings = [
|
|
11922
12155
|
{
|
|
11923
12156
|
MinZoom: 0,
|
|
11924
|
-
MaxZoom:
|
|
12157
|
+
MaxZoom: 200000,
|
|
11925
12158
|
DisplayType: ZoomControl.EDisplayType.Model3D,
|
|
11926
12159
|
LODCategoryID: "glb",
|
|
11927
12160
|
LODLevel: 0,
|
|
@@ -12512,7 +12745,7 @@ var EntityRenderManager;
|
|
|
12512
12745
|
this.item.CameraZoomSettings = [
|
|
12513
12746
|
{
|
|
12514
12747
|
MinZoom: 0,
|
|
12515
|
-
MaxZoom:
|
|
12748
|
+
MaxZoom: 200000,
|
|
12516
12749
|
DisplayType: ZoomControl.EDisplayType.Model3D,
|
|
12517
12750
|
LODCategoryID: "glb",
|
|
12518
12751
|
LODLevel: 0,
|
|
@@ -24158,7 +24391,7 @@ var ViewRenderEngine;
|
|
|
24158
24391
|
ViewRenderEngine.Render = Render;
|
|
24159
24392
|
})(ViewRenderEngine || (ViewRenderEngine = {}));
|
|
24160
24393
|
|
|
24161
|
-
var VERSION = "3.9.
|
|
24394
|
+
var VERSION = "3.9.5";
|
|
24162
24395
|
|
|
24163
24396
|
export { 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, CESIUM_TIMELINE_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, Draw3dPolygon, Draw3dPolyline };
|
|
24164
24397
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|