bruce-cesium 2.9.2 → 2.9.4
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 +282 -65
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +281 -64
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/render-managers/other/relations-render-manager.js +220 -50
- package/dist/lib/rendering/render-managers/other/relations-render-manager.js.map +1 -1
- package/dist/lib/rendering/tileset-render-engine.js +12 -0
- package/dist/lib/rendering/tileset-render-engine.js.map +1 -1
- package/dist/lib/rendering/view-render-engine.js +47 -16
- package/dist/lib/rendering/view-render-engine.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/render-managers/other/relations-render-manager.d.ts +6 -0
- package/package.json +1 -1
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, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, EntityRelationType, DelayQueue, BatchedDataGetter, EntityCoords, EntityFilterGetter, EntitySource, MenuItem, EntityRelation, ENVIRONMENT, ProjectView, ProjectViewBookmark, ProjectViewTile, ProjectViewLegacyTile, ProgramKey, Camera, AbstractApi, EntityAttachment, EntityAttachmentType, EntityAttribute } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic, Cartesian2, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1, JulianDate, SceneMode, HeightReference, DistanceDisplayCondition, NearFarScalar,
|
|
3
|
+
import { Cartographic, Cartesian2, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1, JulianDate, SceneMode, Entity, Primitive, Cesium3DTileFeature, HeightReference, DistanceDisplayCondition, NearFarScalar, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Cesium3DTileColorBlendMode, HeadingPitchRange, createOsmBuildings, Cesium3DTileStyle, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, EllipsoidTerrainProvider, CesiumInspector, defined, Cesium3DTileset, Matrix4, Matrix3, IonResource, Ion, createWorldTerrain, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, EllipsoidGeodesic, sampleTerrainMostDetailed, Model, PolygonPipeline, ColorMaterialProperty, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, BoundingSphere } from 'cesium';
|
|
4
4
|
|
|
5
5
|
var TIME_LAG = 300;
|
|
6
6
|
var POSITION_CHECK_TIMER = 950;
|
|
@@ -7468,6 +7468,18 @@ var TilesetRenderEngine;
|
|
|
7468
7468
|
}
|
|
7469
7469
|
if (!pos3d) {
|
|
7470
7470
|
pos3d = getCurPos3d();
|
|
7471
|
+
if (pos3d === null || pos3d === void 0 ? void 0 : pos3d.x) {
|
|
7472
|
+
var carto = Cartographic.fromCartesian(pos3d);
|
|
7473
|
+
if (!isNaN(carto === null || carto === void 0 ? void 0 : carto.latitude)) {
|
|
7474
|
+
// We reapply back to the tileset so we can reference this location later.
|
|
7475
|
+
// For example we can reference within editing tools in navigator.
|
|
7476
|
+
position.location = {
|
|
7477
|
+
altitude: carto.height,
|
|
7478
|
+
latitude: Math$1.toDegrees(carto.latitude),
|
|
7479
|
+
longitude: Math$1.toDegrees(carto.longitude)
|
|
7480
|
+
};
|
|
7481
|
+
}
|
|
7482
|
+
}
|
|
7471
7483
|
}
|
|
7472
7484
|
var offset = getOffset(pos3d, transform.x, transform.y, transform.z);
|
|
7473
7485
|
if (Cartes.ValidateCartes3(offset)) {
|
|
@@ -9871,6 +9883,41 @@ var RelationsRenderManager;
|
|
|
9871
9883
|
relations: this.item.relations
|
|
9872
9884
|
});
|
|
9873
9885
|
};
|
|
9886
|
+
/**
|
|
9887
|
+
* Constructs the rendered state of the menu item from the visuals register.
|
|
9888
|
+
* This will let us see the difference between what the menu item should render vs has rendered.
|
|
9889
|
+
*/
|
|
9890
|
+
Manager.prototype.getRenderedState = function () {
|
|
9891
|
+
var items = [];
|
|
9892
|
+
var regos = this.register.GetRegos({
|
|
9893
|
+
menuItemId: this.item.id
|
|
9894
|
+
});
|
|
9895
|
+
var _loop_1 = function (i) {
|
|
9896
|
+
var rego = regos[i];
|
|
9897
|
+
if (!(rego === null || rego === void 0 ? void 0 : rego.relation)) {
|
|
9898
|
+
return "continue";
|
|
9899
|
+
}
|
|
9900
|
+
var relationTypeId = rego.relation["Relation.Type.ID"];
|
|
9901
|
+
if (!relationTypeId) {
|
|
9902
|
+
return "continue";
|
|
9903
|
+
}
|
|
9904
|
+
var group = items.find(function (x) { return x.relationTypeId == relationTypeId; });
|
|
9905
|
+
var entityId = rego.relation["Principal.Entity.ID"];
|
|
9906
|
+
if (!group) {
|
|
9907
|
+
items.push({
|
|
9908
|
+
relationTypeId: relationTypeId,
|
|
9909
|
+
entityIds: [entityId]
|
|
9910
|
+
});
|
|
9911
|
+
}
|
|
9912
|
+
else if (!group.entityIds.includes(entityId)) {
|
|
9913
|
+
group.entityIds.push(entityId);
|
|
9914
|
+
}
|
|
9915
|
+
};
|
|
9916
|
+
for (var i = 0; i < regos.length; i++) {
|
|
9917
|
+
_loop_1(i);
|
|
9918
|
+
}
|
|
9919
|
+
return items;
|
|
9920
|
+
};
|
|
9874
9921
|
Manager.prototype.Dispose = function () {
|
|
9875
9922
|
if (this.disposed) {
|
|
9876
9923
|
return;
|
|
@@ -9885,22 +9932,162 @@ var RelationsRenderManager;
|
|
|
9885
9932
|
* @param params
|
|
9886
9933
|
*/
|
|
9887
9934
|
Manager.prototype.ReRender = function (params) {
|
|
9935
|
+
var _a;
|
|
9888
9936
|
return __awaiter(this, void 0, void 0, function () {
|
|
9889
|
-
var entityIds, force;
|
|
9890
|
-
return __generator(this, function (
|
|
9891
|
-
|
|
9892
|
-
|
|
9937
|
+
var entityIds, force, toReRender, toReRenderDataIds, regos, groups, _loop_2, i;
|
|
9938
|
+
return __generator(this, function (_b) {
|
|
9939
|
+
switch (_b.label) {
|
|
9940
|
+
case 0:
|
|
9941
|
+
entityIds = params.entityIds, force = params.force;
|
|
9942
|
+
toReRenderDataIds = [];
|
|
9943
|
+
if (entityIds == null) {
|
|
9944
|
+
toReRender = this.item.relations;
|
|
9945
|
+
}
|
|
9946
|
+
else {
|
|
9947
|
+
toReRender = [];
|
|
9948
|
+
regos = this.register.GetRegos({
|
|
9949
|
+
menuItemId: this.item.id
|
|
9950
|
+
});
|
|
9951
|
+
groups = this.item.relations;
|
|
9952
|
+
_loop_2 = function (i) {
|
|
9953
|
+
var group = groups[i];
|
|
9954
|
+
var toRenderEntityIds = [];
|
|
9955
|
+
if ((_a = group.entityIds) === null || _a === void 0 ? void 0 : _a.length) {
|
|
9956
|
+
for (var i_1 = 0; i_1 < group.entityIds.length; i_1++) {
|
|
9957
|
+
var groupEntityId = group.entityIds[i_1];
|
|
9958
|
+
// Primary ID matches a re-render entity ID.
|
|
9959
|
+
if (entityIds.includes(groupEntityId)) {
|
|
9960
|
+
toRenderEntityIds.push(groupEntityId);
|
|
9961
|
+
}
|
|
9962
|
+
}
|
|
9963
|
+
}
|
|
9964
|
+
var groupRegos = regos.filter(function (x) { var _a; return ((_a = x.relation) === null || _a === void 0 ? void 0 : _a["Relation.Type.ID"]) == group.relationTypeId; });
|
|
9965
|
+
if (groupRegos.length) {
|
|
9966
|
+
for (var i_2 = 0; i_2 < groupRegos.length; i_2++) {
|
|
9967
|
+
var rego = groupRegos[i_2];
|
|
9968
|
+
var dataEntityId = rego.entityId;
|
|
9969
|
+
// Data ID matches a re-render entity ID.
|
|
9970
|
+
if (dataEntityId && entityIds.includes(dataEntityId) && rego.relation) {
|
|
9971
|
+
// toRenderEntityIds.push(rego.relation["Principal.Entity.ID"]);
|
|
9972
|
+
toReRenderDataIds.push(dataEntityId);
|
|
9973
|
+
}
|
|
9974
|
+
}
|
|
9975
|
+
}
|
|
9976
|
+
if (toRenderEntityIds.length) {
|
|
9977
|
+
toReRender.push({
|
|
9978
|
+
relationTypeId: group.relationTypeId,
|
|
9979
|
+
entityIds: toRenderEntityIds
|
|
9980
|
+
});
|
|
9981
|
+
}
|
|
9982
|
+
};
|
|
9983
|
+
for (i = 0; i < groups.length; i++) {
|
|
9984
|
+
_loop_2(i);
|
|
9985
|
+
}
|
|
9986
|
+
}
|
|
9987
|
+
if (!toReRenderDataIds.length) return [3 /*break*/, 2];
|
|
9988
|
+
return [4 /*yield*/, this.queueRenderDataIds({
|
|
9989
|
+
dataEntityIds: toReRenderDataIds
|
|
9990
|
+
})];
|
|
9991
|
+
case 1:
|
|
9992
|
+
_b.sent();
|
|
9993
|
+
_b.label = 2;
|
|
9994
|
+
case 2:
|
|
9995
|
+
if (!toReRender.length) return [3 /*break*/, 4];
|
|
9996
|
+
return [4 /*yield*/, this.queueRenderRelations({
|
|
9997
|
+
relations: toReRender,
|
|
9998
|
+
force: true
|
|
9999
|
+
})];
|
|
10000
|
+
case 3:
|
|
10001
|
+
_b.sent();
|
|
10002
|
+
_b.label = 4;
|
|
10003
|
+
case 4: return [2 /*return*/];
|
|
10004
|
+
}
|
|
9893
10005
|
});
|
|
9894
10006
|
});
|
|
9895
10007
|
};
|
|
9896
|
-
Manager.prototype.
|
|
10008
|
+
Manager.prototype.queueRenderDataIds = function (params) {
|
|
9897
10009
|
return __awaiter(this, void 0, void 0, function () {
|
|
9898
|
-
var
|
|
10010
|
+
var dataEntityIds, i, data, e_1;
|
|
9899
10011
|
return __generator(this, function (_a) {
|
|
9900
10012
|
switch (_a.label) {
|
|
9901
10013
|
case 0:
|
|
9902
|
-
|
|
9903
|
-
|
|
10014
|
+
dataEntityIds = params.dataEntityIds;
|
|
10015
|
+
i = 0;
|
|
10016
|
+
_a.label = 1;
|
|
10017
|
+
case 1:
|
|
10018
|
+
if (!(i < dataEntityIds.length)) return [3 /*break*/, 6];
|
|
10019
|
+
_a.label = 2;
|
|
10020
|
+
case 2:
|
|
10021
|
+
_a.trys.push([2, 4, , 5]);
|
|
10022
|
+
return [4 /*yield*/, EntityRelation.GetByDataEntityId({
|
|
10023
|
+
entityId: dataEntityIds[i],
|
|
10024
|
+
api: this.apiGetter.getApi()
|
|
10025
|
+
})];
|
|
10026
|
+
case 3:
|
|
10027
|
+
data = _a.sent();
|
|
10028
|
+
if (data.relation) {
|
|
10029
|
+
if (this.shouldRenderRelation(data.relation)) {
|
|
10030
|
+
this.onGetterUpdate([data.relation]);
|
|
10031
|
+
}
|
|
10032
|
+
}
|
|
10033
|
+
return [3 /*break*/, 5];
|
|
10034
|
+
case 4:
|
|
10035
|
+
e_1 = _a.sent();
|
|
10036
|
+
console.error(e_1);
|
|
10037
|
+
return [3 /*break*/, 5];
|
|
10038
|
+
case 5:
|
|
10039
|
+
i++;
|
|
10040
|
+
return [3 /*break*/, 1];
|
|
10041
|
+
case 6: return [2 /*return*/];
|
|
10042
|
+
}
|
|
10043
|
+
});
|
|
10044
|
+
});
|
|
10045
|
+
};
|
|
10046
|
+
Manager.prototype.queueRenderRelations = function (params) {
|
|
10047
|
+
var _a;
|
|
10048
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
10049
|
+
var relations, force, renderedState, toRender, _loop_3, i, allIds_1, _i, relations_1, relation, entityIds, i, entityId, data, toRender, j, relation, rego, e_2;
|
|
10050
|
+
return __generator(this, function (_b) {
|
|
10051
|
+
switch (_b.label) {
|
|
10052
|
+
case 0:
|
|
10053
|
+
_b.trys.push([0, 5, , 6]);
|
|
10054
|
+
relations = params.relations, force = params.force;
|
|
10055
|
+
if (force != true) {
|
|
10056
|
+
renderedState = this.getRenderedState();
|
|
10057
|
+
toRender = [];
|
|
10058
|
+
_loop_3 = function (i) {
|
|
10059
|
+
var typeId = relations[i].relationTypeId;
|
|
10060
|
+
var group = renderedState.find(function (x) { return x.relationTypeId == typeId; });
|
|
10061
|
+
if (!group || !((_a = group.entityIds) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
10062
|
+
toRender.push(relations[i]);
|
|
10063
|
+
return "continue";
|
|
10064
|
+
}
|
|
10065
|
+
var entityIds = relations[i].entityIds;
|
|
10066
|
+
if (!(entityIds === null || entityIds === void 0 ? void 0 : entityIds.length)) {
|
|
10067
|
+
return "continue";
|
|
10068
|
+
}
|
|
10069
|
+
var toRenderEntityIds = [];
|
|
10070
|
+
for (var j = 0; j < entityIds.length; j++) {
|
|
10071
|
+
var entityId = entityIds[j];
|
|
10072
|
+
if (!group.entityIds.includes(entityId) && !toRenderEntityIds.includes(entityId)) {
|
|
10073
|
+
toRenderEntityIds.push(entityId);
|
|
10074
|
+
}
|
|
10075
|
+
}
|
|
10076
|
+
if (toRenderEntityIds.length) {
|
|
10077
|
+
toRender.push({
|
|
10078
|
+
relationTypeId: typeId,
|
|
10079
|
+
entityIds: toRenderEntityIds
|
|
10080
|
+
});
|
|
10081
|
+
}
|
|
10082
|
+
};
|
|
10083
|
+
for (i = 0; i < relations.length; i++) {
|
|
10084
|
+
_loop_3(i);
|
|
10085
|
+
}
|
|
10086
|
+
if (!toRender.length) {
|
|
10087
|
+
return [2 /*return*/];
|
|
10088
|
+
}
|
|
10089
|
+
relations = toRender;
|
|
10090
|
+
}
|
|
9904
10091
|
allIds_1 = [];
|
|
9905
10092
|
for (_i = 0, relations_1 = relations; _i < relations_1.length; _i++) {
|
|
9906
10093
|
relation = relations_1[_i];
|
|
@@ -9910,9 +10097,8 @@ var RelationsRenderManager;
|
|
|
9910
10097
|
allIds_1 = allIds_1.filter(function (id, index) {
|
|
9911
10098
|
return allIds_1.indexOf(id) === index;
|
|
9912
10099
|
});
|
|
9913
|
-
toRender = [];
|
|
9914
10100
|
i = 0;
|
|
9915
|
-
|
|
10101
|
+
_b.label = 1;
|
|
9916
10102
|
case 1:
|
|
9917
10103
|
if (!(i < allIds_1.length)) return [3 /*break*/, 4];
|
|
9918
10104
|
entityId = allIds_1[i];
|
|
@@ -9925,50 +10111,37 @@ var RelationsRenderManager;
|
|
|
9925
10111
|
api: this.apiGetter.getApi()
|
|
9926
10112
|
})];
|
|
9927
10113
|
case 2:
|
|
9928
|
-
data =
|
|
9929
|
-
|
|
10114
|
+
data = _b.sent();
|
|
10115
|
+
if (this.disposed || this.viewer.isDestroyed()) {
|
|
10116
|
+
return [2 /*return*/];
|
|
10117
|
+
}
|
|
10118
|
+
toRender = [];
|
|
9930
10119
|
for (j = 0; j < data.relations.length; j++) {
|
|
9931
10120
|
relation = data.relations[j];
|
|
9932
10121
|
if (this.shouldRenderRelation(relation)) {
|
|
10122
|
+
if (force != true) {
|
|
10123
|
+
rego = this.register.GetRego({
|
|
10124
|
+
relation: relation,
|
|
10125
|
+
menuItemId: this.item.id
|
|
10126
|
+
});
|
|
10127
|
+
if (rego === null || rego === void 0 ? void 0 : rego.visual) {
|
|
10128
|
+
continue;
|
|
10129
|
+
}
|
|
10130
|
+
}
|
|
9933
10131
|
toRender.push(relation);
|
|
9934
10132
|
}
|
|
9935
10133
|
}
|
|
9936
|
-
_a.label = 3;
|
|
9937
|
-
case 3:
|
|
9938
|
-
i++;
|
|
9939
|
-
return [3 /*break*/, 1];
|
|
9940
|
-
case 4:
|
|
9941
|
-
console.log("all render", toRender);
|
|
9942
|
-
// Relations are not being returned??
|
|
9943
|
-
// const data = await Entity.GetListByIds({
|
|
9944
|
-
// entityIds: allIds,
|
|
9945
|
-
// expandRelations: true,
|
|
9946
|
-
// api: this.apiGetter.getApi()
|
|
9947
|
-
// });
|
|
9948
|
-
// for (let i = 0; i < data.entities.length; i++) {
|
|
9949
|
-
// const entity = data.entities[i];
|
|
9950
|
-
// if (entity?.Bruce?.relations?.length) {
|
|
9951
|
-
// const eRelations = entity.Bruce.relations;
|
|
9952
|
-
// for (let j = 0; j < eRelations.length; j++) {
|
|
9953
|
-
// const eRelation = eRelations[j];
|
|
9954
|
-
// const relation: EntityRelation.IRelation = {
|
|
9955
|
-
// "Principal.Entity.ID": entity.Bruce.ID,
|
|
9956
|
-
// "Related.Entity.ID": eRelation["Other.Entity.ID"],
|
|
9957
|
-
// "Relation.Type.ID": eRelation["Relation.Type.ID"]
|
|
9958
|
-
// };
|
|
9959
|
-
// if (this.shouldRenderRelation(relation)) {
|
|
9960
|
-
// toRender.push(relation);
|
|
9961
|
-
// }
|
|
9962
|
-
// }
|
|
9963
|
-
// }
|
|
9964
|
-
// }
|
|
9965
10134
|
if (toRender.length) {
|
|
9966
10135
|
this.onGetterUpdate(toRender);
|
|
9967
10136
|
}
|
|
9968
|
-
|
|
10137
|
+
_b.label = 3;
|
|
10138
|
+
case 3:
|
|
10139
|
+
i++;
|
|
10140
|
+
return [3 /*break*/, 1];
|
|
10141
|
+
case 4: return [3 /*break*/, 6];
|
|
9969
10142
|
case 5:
|
|
9970
|
-
|
|
9971
|
-
console.error(
|
|
10143
|
+
e_2 = _b.sent();
|
|
10144
|
+
console.error(e_2);
|
|
9972
10145
|
return [3 /*break*/, 6];
|
|
9973
10146
|
case 6: return [2 /*return*/];
|
|
9974
10147
|
}
|
|
@@ -9996,7 +10169,7 @@ var RelationsRenderManager;
|
|
|
9996
10169
|
Manager.prototype.onGetterUpdate = function (relations) {
|
|
9997
10170
|
var _a, _b;
|
|
9998
10171
|
return __awaiter(this, void 0, void 0, function () {
|
|
9999
|
-
var killCEntity, cEntities, key, i, relation, key, cEntity, visual,
|
|
10172
|
+
var killCEntity, cEntities, key, i, relation, rego, key, cEntity, visual, e_3;
|
|
10000
10173
|
var _this = this;
|
|
10001
10174
|
return __generator(this, function (_c) {
|
|
10002
10175
|
switch (_c.label) {
|
|
@@ -10031,6 +10204,19 @@ var RelationsRenderManager;
|
|
|
10031
10204
|
}
|
|
10032
10205
|
for (i = 0; i < relations.length; i++) {
|
|
10033
10206
|
relation = relations[i];
|
|
10207
|
+
rego = this.register.GetRego({
|
|
10208
|
+
menuItemId: this.item.id,
|
|
10209
|
+
relation: relation
|
|
10210
|
+
});
|
|
10211
|
+
if (rego) {
|
|
10212
|
+
this.register.RemoveRegos({
|
|
10213
|
+
entityId: rego.entityId,
|
|
10214
|
+
menuItemId: this.item.id,
|
|
10215
|
+
relation: relation,
|
|
10216
|
+
requestRender: false,
|
|
10217
|
+
doUpdate: true
|
|
10218
|
+
});
|
|
10219
|
+
}
|
|
10034
10220
|
key = RelationRenderEngine.GetRenderGroupId(relation);
|
|
10035
10221
|
cEntity = cEntities[key];
|
|
10036
10222
|
if (cEntity && this.shouldRenderRelation(relation)) {
|
|
@@ -10065,8 +10251,8 @@ var RelationsRenderManager;
|
|
|
10065
10251
|
this.viewer.scene.requestRender();
|
|
10066
10252
|
return [3 /*break*/, 3];
|
|
10067
10253
|
case 2:
|
|
10068
|
-
|
|
10069
|
-
console.error(
|
|
10254
|
+
e_3 = _c.sent();
|
|
10255
|
+
console.error(e_3);
|
|
10070
10256
|
return [3 /*break*/, 3];
|
|
10071
10257
|
case 3: return [2 /*return*/];
|
|
10072
10258
|
}
|
|
@@ -13244,7 +13430,7 @@ function renderLegacyNavigator(iteration, params, bookmark, view) {
|
|
|
13244
13430
|
function renderNavigator(iteration, params, bookmark, view) {
|
|
13245
13431
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
|
|
13246
13432
|
return __awaiter(this, void 0, void 0, function () {
|
|
13247
|
-
var viewer, scene, vSettings, bSettings, defaults, camera, newLens, shouldBe2d, curIs2d, transition, pos, terrain, hillShades, baseColor, globeHidden, terrainWireframe, globeAlpha, shadows, size, ambientOcclusion, AO, lighting, light, quality, fxaa, dateTime, clock, selectedIds, hiddenIds, isolatedIds, labelledIds, curLabelledIds, toUnLabel, entityOpacityMap, entityId, opacity, imagery, legacyRelationIds, relations, curEnabled, newItemIds, _i, curEnabled_1, id, menuItem, gOcclusion;
|
|
13433
|
+
var viewer, scene, vSettings, bSettings, defaults, camera, newLens, shouldBe2d, curIs2d, transition, pos, terrain, hillShades, baseColor, globeHidden, terrainWireframe, globeAlpha, shadows, size, ambientOcclusion, AO, lighting, light, quality, fxaa, dateTime, clock, selectedIds, hiddenIds, isolatedIds, labelledIds, curLabelledIds, toUnLabel, entityOpacityMap, entityId, opacity, imagery, legacyRelationIds, relations, curEnabled, newItemIds, _i, curEnabled_1, id, shouldRemove, rendered, menuItem, menuItem, gOcclusion;
|
|
13248
13434
|
return __generator(this, function (_7) {
|
|
13249
13435
|
switch (_7.label) {
|
|
13250
13436
|
case 0:
|
|
@@ -13542,8 +13728,26 @@ function renderNavigator(iteration, params, bookmark, view) {
|
|
|
13542
13728
|
newItemIds = (_5 = bSettings === null || bSettings === void 0 ? void 0 : bSettings.menuItemIds) !== null && _5 !== void 0 ? _5 : [];
|
|
13543
13729
|
for (_i = 0, curEnabled_1 = curEnabled; _i < curEnabled_1.length; _i++) {
|
|
13544
13730
|
id = curEnabled_1[_i];
|
|
13545
|
-
|
|
13546
|
-
|
|
13731
|
+
shouldRemove = void 0;
|
|
13732
|
+
if (id == RELATION_MENU_ITEM_ID) {
|
|
13733
|
+
rendered = params.manager.GetEnabledItem(id);
|
|
13734
|
+
shouldRemove = false;
|
|
13735
|
+
if (!legacyRelationIds.length && !relations.length) {
|
|
13736
|
+
shouldRemove = true;
|
|
13737
|
+
}
|
|
13738
|
+
// If we're about to render legacy relationships but a non-legacy item is currently enabled then we remove it.
|
|
13739
|
+
else if (legacyRelationIds.length && (rendered === null || rendered === void 0 ? void 0 : rendered.type) != MenuItem.EType.Relations) {
|
|
13740
|
+
shouldRemove = true;
|
|
13741
|
+
}
|
|
13742
|
+
// If we're about to render non-legacy relationships but a legacy item is currently enabled then we remove it.
|
|
13743
|
+
else if (relations.length && (rendered === null || rendered === void 0 ? void 0 : rendered.type) != MenuItem.EType.Relationships) {
|
|
13744
|
+
shouldRemove = true;
|
|
13745
|
+
}
|
|
13746
|
+
}
|
|
13747
|
+
else {
|
|
13748
|
+
shouldRemove = newItemIds.indexOf(id) === -1;
|
|
13749
|
+
}
|
|
13750
|
+
if (shouldRemove) {
|
|
13547
13751
|
params.manager.RemoveItemById({
|
|
13548
13752
|
menuItemId: id
|
|
13549
13753
|
});
|
|
@@ -13564,19 +13768,32 @@ function renderNavigator(iteration, params, bookmark, view) {
|
|
|
13564
13768
|
_7.label = 4;
|
|
13565
13769
|
case 4:
|
|
13566
13770
|
if (legacyRelationIds.length || relations.length) {
|
|
13567
|
-
|
|
13568
|
-
|
|
13569
|
-
|
|
13570
|
-
|
|
13571
|
-
|
|
13572
|
-
|
|
13573
|
-
|
|
13574
|
-
|
|
13575
|
-
|
|
13576
|
-
|
|
13577
|
-
|
|
13578
|
-
|
|
13579
|
-
|
|
13771
|
+
if (relations.length) {
|
|
13772
|
+
menuItem = {
|
|
13773
|
+
id: RELATION_MENU_ITEM_ID,
|
|
13774
|
+
Caption: "Entity relations",
|
|
13775
|
+
relations: relations,
|
|
13776
|
+
Type: MenuItem.EType.Relationships
|
|
13777
|
+
};
|
|
13778
|
+
params.manager.RenderItem({
|
|
13779
|
+
getters: params.getters,
|
|
13780
|
+
item: menuItem
|
|
13781
|
+
});
|
|
13782
|
+
}
|
|
13783
|
+
else if (legacyRelationIds.length) {
|
|
13784
|
+
menuItem = {
|
|
13785
|
+
id: RELATION_MENU_ITEM_ID,
|
|
13786
|
+
Caption: "Entity relations",
|
|
13787
|
+
BruceEntity: {
|
|
13788
|
+
EntityIds: legacyRelationIds
|
|
13789
|
+
},
|
|
13790
|
+
Type: MenuItem.EType.Relations
|
|
13791
|
+
};
|
|
13792
|
+
params.manager.RenderItem({
|
|
13793
|
+
getters: params.getters,
|
|
13794
|
+
item: menuItem
|
|
13795
|
+
});
|
|
13796
|
+
}
|
|
13580
13797
|
if (!assertIteration$1(params.viewer, iteration)) {
|
|
13581
13798
|
return [2 /*return*/];
|
|
13582
13799
|
}
|
|
@@ -16494,7 +16711,7 @@ var ViewerUtils;
|
|
|
16494
16711
|
ViewerUtils.CreateWidgets = CreateWidgets;
|
|
16495
16712
|
})(ViewerUtils || (ViewerUtils = {}));
|
|
16496
16713
|
|
|
16497
|
-
var VERSION$1 = "2.9.
|
|
16714
|
+
var VERSION$1 = "2.9.4";
|
|
16498
16715
|
|
|
16499
16716
|
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 };
|
|
16500
16717
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|