bruce-cesium 2.5.3 → 2.5.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 +317 -160
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +316 -159
- 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 +172 -123
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/rendering/menu-item-manager.js +1 -1
- package/dist/lib/rendering/menu-item-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js +17 -0
- 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 +17 -0
- 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 +63 -34
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entity-render-manager.js +17 -0
- package/dist/lib/rendering/render-managers/entities/entity-render-manager.js.map +1 -1
- package/dist/lib/viewer/viewer-utils.js +29 -0
- package/dist/lib/viewer/viewer-utils.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 +5 -1
- package/dist/types/rendering/render-managers/entities/entities-loaded-render-manager.d.ts +5 -1
- package/dist/types/rendering/render-managers/entities/entities-render-manager.d.ts +7 -1
- package/dist/types/rendering/render-managers/entities/entity-render-manager.d.ts +5 -1
- package/package.json +2 -2
package/dist/lib/bruce-cesium.js
CHANGED
|
@@ -45,5 +45,5 @@ __exportStar(require("./utils/measure-utils"), exports);
|
|
|
45
45
|
__exportStar(require("./utils/entity-utils"), exports);
|
|
46
46
|
__exportStar(require("./widgets/common/draw-3d-polygon"), exports);
|
|
47
47
|
__exportStar(require("./widgets/common/draw-3d-polyline"), exports);
|
|
48
|
-
exports.VERSION = "2.5.
|
|
48
|
+
exports.VERSION = "2.5.5";
|
|
49
49
|
//# sourceMappingURL=bruce-cesium.js.map
|
|
@@ -133,9 +133,9 @@ function getPolygonExtrusion(entity, tags, ring, posses, heightRef, pStyle) {
|
|
|
133
133
|
}
|
|
134
134
|
return data;
|
|
135
135
|
}
|
|
136
|
-
function getHeightRef(style) {
|
|
136
|
+
function getHeightRef(style, defaultStyle) {
|
|
137
137
|
var _a;
|
|
138
|
-
var heightRef = Cesium.HeightReference.CLAMP_TO_GROUND;
|
|
138
|
+
var heightRef = defaultStyle == null ? Cesium.HeightReference.CLAMP_TO_GROUND : defaultStyle;
|
|
139
139
|
var altOptionId = (_a = style === null || style === void 0 ? void 0 : style.altitudeOption) === null || _a === void 0 ? void 0 : _a.id;
|
|
140
140
|
if (altOptionId == 1) {
|
|
141
141
|
heightRef = Cesium.HeightReference.NONE;
|
|
@@ -196,38 +196,52 @@ function getName(api, entity) {
|
|
|
196
196
|
}
|
|
197
197
|
function getStyle(api, entity, styleId) {
|
|
198
198
|
return __awaiter(this, void 0, void 0, function () {
|
|
199
|
-
var style, typeId, type;
|
|
199
|
+
var style, e_2, typeId, type, e_3;
|
|
200
200
|
return __generator(this, function (_a) {
|
|
201
201
|
switch (_a.label) {
|
|
202
202
|
case 0:
|
|
203
203
|
style = null;
|
|
204
|
-
if (!styleId) return [3 /*break*/,
|
|
204
|
+
if (!styleId) return [3 /*break*/, 4];
|
|
205
|
+
_a.label = 1;
|
|
206
|
+
case 1:
|
|
207
|
+
_a.trys.push([1, 3, , 4]);
|
|
205
208
|
return [4 /*yield*/, bruce_models_1.Style.Get({
|
|
206
209
|
api: api,
|
|
207
210
|
styleId: styleId
|
|
208
211
|
})];
|
|
209
|
-
case 1:
|
|
210
|
-
style = (_a.sent()).style;
|
|
211
|
-
_a.label = 2;
|
|
212
212
|
case 2:
|
|
213
|
-
|
|
213
|
+
style = (_a.sent()).style;
|
|
214
|
+
return [3 /*break*/, 4];
|
|
215
|
+
case 3:
|
|
216
|
+
e_2 = _a.sent();
|
|
217
|
+
console.error(e_2);
|
|
218
|
+
return [3 /*break*/, 4];
|
|
219
|
+
case 4:
|
|
220
|
+
if (!!style) return [3 /*break*/, 9];
|
|
214
221
|
typeId = entity.Bruce["EntityType.ID"];
|
|
215
|
-
if (!typeId) return [3 /*break*/,
|
|
222
|
+
if (!typeId) return [3 /*break*/, 9];
|
|
216
223
|
return [4 /*yield*/, bruce_models_1.EntityType.Get({
|
|
217
224
|
api: api,
|
|
218
225
|
entityTypeId: typeId
|
|
219
226
|
})];
|
|
220
|
-
case
|
|
227
|
+
case 5:
|
|
221
228
|
type = (_a.sent()).entityType;
|
|
222
|
-
if (!type["DisplaySetting.ID"]) return [3 /*break*/,
|
|
229
|
+
if (!type["DisplaySetting.ID"]) return [3 /*break*/, 9];
|
|
230
|
+
_a.label = 6;
|
|
231
|
+
case 6:
|
|
232
|
+
_a.trys.push([6, 8, , 9]);
|
|
223
233
|
return [4 /*yield*/, bruce_models_1.Style.Get({
|
|
224
234
|
api: api,
|
|
225
235
|
styleId: type["DisplaySetting.ID"]
|
|
226
236
|
})];
|
|
227
|
-
case
|
|
237
|
+
case 7:
|
|
228
238
|
style = (_a.sent()).style;
|
|
229
|
-
|
|
230
|
-
case
|
|
239
|
+
return [3 /*break*/, 9];
|
|
240
|
+
case 8:
|
|
241
|
+
e_3 = _a.sent();
|
|
242
|
+
console.error(e_3);
|
|
243
|
+
return [3 /*break*/, 9];
|
|
244
|
+
case 9: return [2 /*return*/, style];
|
|
231
245
|
}
|
|
232
246
|
});
|
|
233
247
|
});
|
|
@@ -620,7 +634,7 @@ var EntityRenderEngine;
|
|
|
620
634
|
(function (Point) {
|
|
621
635
|
function Render(params) {
|
|
622
636
|
return __awaiter(this, void 0, void 0, function () {
|
|
623
|
-
var entity, style, type, cEntity, siblings, iconUrlRows, icon, iconUrl, res,
|
|
637
|
+
var entity, style, type, cEntity, siblings, iconUrlRows, icon, iconUrl, res, e_4, iconScale, heightRef, radius, bFill, cFill, outline, cOutline, outlineWidth, outlineHeight, bOutline, fillHeight, exHeightRef, pos, bColor, cColor, size, heightRef;
|
|
624
638
|
return __generator(this, function (_a) {
|
|
625
639
|
switch (_a.label) {
|
|
626
640
|
case 0:
|
|
@@ -673,7 +687,7 @@ var EntityRenderEngine;
|
|
|
673
687
|
_a.label = 4;
|
|
674
688
|
case 4: return [3 /*break*/, 6];
|
|
675
689
|
case 5:
|
|
676
|
-
|
|
690
|
+
e_4 = _a.sent();
|
|
677
691
|
iconUrl = null;
|
|
678
692
|
return [3 /*break*/, 6];
|
|
679
693
|
case 6:
|
|
@@ -774,10 +788,10 @@ var EntityRenderEngine;
|
|
|
774
788
|
}
|
|
775
789
|
if (!cEntity) {
|
|
776
790
|
bColor = style.color ? bruce_models_1.Calculator.GetColor(style.color, entity, params.tags) : null;
|
|
777
|
-
cColor = bColor ? colorToCColor(bColor) : Cesium.Color.
|
|
791
|
+
cColor = bColor ? colorToCColor(bColor) : Cesium.Color.fromCssColorString("rgba(33, 150, 243, 0.8)");
|
|
778
792
|
size = style.size ? bruce_models_1.Calculator.GetNumber(style.size, entity, params.tags) : null;
|
|
779
793
|
if (size == null) {
|
|
780
|
-
size =
|
|
794
|
+
size = 20;
|
|
781
795
|
}
|
|
782
796
|
size = (0, js_utils_1.EnsureNumber)(size);
|
|
783
797
|
if (size <= 0) {
|
|
@@ -812,33 +826,40 @@ var EntityRenderEngine;
|
|
|
812
826
|
function RenderGroup(params) {
|
|
813
827
|
var _a, _b, _c;
|
|
814
828
|
return __awaiter(this, void 0, void 0, function () {
|
|
815
|
-
var api, cEntities, i, entity, zoomItem, style, tagIds, tags, pStyle, cEntity, name_2;
|
|
816
|
-
return __generator(this, function (
|
|
817
|
-
switch (
|
|
829
|
+
var api, cEntities, i, entity, zoomItem, style, _d, tagIds, tags, pStyle, cEntity, name_2;
|
|
830
|
+
return __generator(this, function (_e) {
|
|
831
|
+
switch (_e.label) {
|
|
818
832
|
case 0:
|
|
819
833
|
api = params.apiGetter.getApi();
|
|
820
834
|
cEntities = {};
|
|
821
835
|
i = 0;
|
|
822
|
-
|
|
836
|
+
_e.label = 1;
|
|
823
837
|
case 1:
|
|
824
|
-
if (!(i < params.entities.length)) return [3 /*break*/,
|
|
838
|
+
if (!(i < params.entities.length)) return [3 /*break*/, 11];
|
|
825
839
|
entity = params.entities[i];
|
|
826
840
|
zoomItem = params.zoomItems[entity.Bruce.ID];
|
|
841
|
+
if (!(zoomItem.StyleID != -1)) return [3 /*break*/, 3];
|
|
827
842
|
return [4 /*yield*/, getStyle(api, entity, zoomItem.StyleID)];
|
|
828
843
|
case 2:
|
|
829
|
-
|
|
844
|
+
_d = (_a = (_e.sent())) === null || _a === void 0 ? void 0 : _a.Settings;
|
|
845
|
+
return [3 /*break*/, 4];
|
|
846
|
+
case 3:
|
|
847
|
+
_d = zoomItem.Style;
|
|
848
|
+
_e.label = 4;
|
|
849
|
+
case 4:
|
|
850
|
+
style = _d;
|
|
830
851
|
tagIds = entity.Bruce["Layer.ID"];
|
|
831
852
|
tags = [];
|
|
832
|
-
if (!(tagIds && tagIds.length > 0)) return [3 /*break*/,
|
|
853
|
+
if (!(tagIds && tagIds.length > 0)) return [3 /*break*/, 6];
|
|
833
854
|
return [4 /*yield*/, bruce_models_1.EntityTag.GetListByIds({
|
|
834
855
|
api: api,
|
|
835
856
|
tagIds: tagIds
|
|
836
857
|
})];
|
|
837
|
-
case
|
|
838
|
-
tags = (
|
|
839
|
-
|
|
840
|
-
case
|
|
841
|
-
pStyle = (_b =
|
|
858
|
+
case 5:
|
|
859
|
+
tags = (_e.sent()).tags;
|
|
860
|
+
_e.label = 6;
|
|
861
|
+
case 6:
|
|
862
|
+
pStyle = (_b = style === null || style === void 0 ? void 0 : style.pointStyle) !== null && _b !== void 0 ? _b : {};
|
|
842
863
|
return [4 /*yield*/, Render({
|
|
843
864
|
entity: entity,
|
|
844
865
|
style: pStyle,
|
|
@@ -848,22 +869,22 @@ var EntityRenderEngine;
|
|
|
848
869
|
maxDistance: zoomItem.MaxZoom,
|
|
849
870
|
minDistance: zoomItem.MinZoom
|
|
850
871
|
})];
|
|
851
|
-
case
|
|
852
|
-
cEntity =
|
|
853
|
-
if (!cEntity) return [3 /*break*/,
|
|
872
|
+
case 7:
|
|
873
|
+
cEntity = _e.sent();
|
|
874
|
+
if (!cEntity) return [3 /*break*/, 9];
|
|
854
875
|
return [4 /*yield*/, getName(api, entity)];
|
|
855
|
-
case
|
|
856
|
-
name_2 =
|
|
876
|
+
case 8:
|
|
877
|
+
name_2 = _e.sent();
|
|
857
878
|
cEntity.name = name_2;
|
|
858
879
|
cEntity._renderGroup = getRenderGroupId(zoomItem, (_c = params.viewer) === null || _c === void 0 ? void 0 : _c.terrainProvider);
|
|
859
|
-
|
|
860
|
-
case
|
|
880
|
+
_e.label = 9;
|
|
881
|
+
case 9:
|
|
861
882
|
cEntities[entity.Bruce.ID] = cEntity;
|
|
862
|
-
|
|
863
|
-
case
|
|
883
|
+
_e.label = 10;
|
|
884
|
+
case 10:
|
|
864
885
|
i++;
|
|
865
886
|
return [3 /*break*/, 1];
|
|
866
|
-
case
|
|
887
|
+
case 11: return [2 /*return*/, cEntities];
|
|
867
888
|
}
|
|
868
889
|
});
|
|
869
890
|
});
|
|
@@ -919,13 +940,13 @@ var EntityRenderEngine;
|
|
|
919
940
|
return null;
|
|
920
941
|
}
|
|
921
942
|
var bColor = style.lineColor ? bruce_models_1.Calculator.GetColor(style.lineColor, entity, params.tags) : null;
|
|
922
|
-
var cColor = bColor ? colorToCColor(bColor) : Cesium.Color.
|
|
943
|
+
var cColor = bColor ? colorToCColor(bColor) : Cesium.Color.fromCssColorString("rgba(255, 193, 7, 0.8)");
|
|
923
944
|
if (cColor.alpha <= 0) {
|
|
924
945
|
return null;
|
|
925
946
|
}
|
|
926
947
|
var width = style.lineWidth ? bruce_models_1.Calculator.GetNumber(style.lineWidth, entity, params.tags) : null;
|
|
927
948
|
if (width == null) {
|
|
928
|
-
width =
|
|
949
|
+
width = 2;
|
|
929
950
|
}
|
|
930
951
|
width = (0, js_utils_1.EnsureNumber)(width);
|
|
931
952
|
if (width < 0.01) {
|
|
@@ -976,33 +997,40 @@ var EntityRenderEngine;
|
|
|
976
997
|
function RenderGroup(params) {
|
|
977
998
|
var _a, _b, _c;
|
|
978
999
|
return __awaiter(this, void 0, void 0, function () {
|
|
979
|
-
var api, cEntities, i, entity, zoomItem, style, tagIds, tags, lStyle, cEntity, name_3;
|
|
980
|
-
return __generator(this, function (
|
|
981
|
-
switch (
|
|
1000
|
+
var api, cEntities, i, entity, zoomItem, style, _d, tagIds, tags, lStyle, cEntity, name_3;
|
|
1001
|
+
return __generator(this, function (_e) {
|
|
1002
|
+
switch (_e.label) {
|
|
982
1003
|
case 0:
|
|
983
1004
|
api = params.apiGetter.getApi();
|
|
984
1005
|
cEntities = {};
|
|
985
1006
|
i = 0;
|
|
986
|
-
|
|
1007
|
+
_e.label = 1;
|
|
987
1008
|
case 1:
|
|
988
|
-
if (!(i < params.entities.length)) return [3 /*break*/,
|
|
1009
|
+
if (!(i < params.entities.length)) return [3 /*break*/, 9];
|
|
989
1010
|
entity = params.entities[i];
|
|
990
1011
|
zoomItem = params.zoomItems[entity.Bruce.ID];
|
|
1012
|
+
if (!(zoomItem.StyleID != -1)) return [3 /*break*/, 3];
|
|
991
1013
|
return [4 /*yield*/, getStyle(api, entity, zoomItem.StyleID)];
|
|
992
1014
|
case 2:
|
|
993
|
-
|
|
1015
|
+
_d = (_a = (_e.sent())) === null || _a === void 0 ? void 0 : _a.Settings;
|
|
1016
|
+
return [3 /*break*/, 4];
|
|
1017
|
+
case 3:
|
|
1018
|
+
_d = zoomItem.Style;
|
|
1019
|
+
_e.label = 4;
|
|
1020
|
+
case 4:
|
|
1021
|
+
style = _d;
|
|
994
1022
|
tagIds = entity.Bruce["Layer.ID"];
|
|
995
1023
|
tags = [];
|
|
996
|
-
if (!(tagIds && tagIds.length > 0)) return [3 /*break*/,
|
|
1024
|
+
if (!(tagIds && tagIds.length > 0)) return [3 /*break*/, 6];
|
|
997
1025
|
return [4 /*yield*/, bruce_models_1.EntityTag.GetListByIds({
|
|
998
1026
|
api: api,
|
|
999
1027
|
tagIds: tagIds
|
|
1000
1028
|
})];
|
|
1001
|
-
case
|
|
1002
|
-
tags = (
|
|
1003
|
-
|
|
1004
|
-
case
|
|
1005
|
-
lStyle = (_b =
|
|
1029
|
+
case 5:
|
|
1030
|
+
tags = (_e.sent()).tags;
|
|
1031
|
+
_e.label = 6;
|
|
1032
|
+
case 6:
|
|
1033
|
+
lStyle = (_b = style === null || style === void 0 ? void 0 : style.polylineStyle) !== null && _b !== void 0 ? _b : {};
|
|
1006
1034
|
cEntity = Render({
|
|
1007
1035
|
entity: entity,
|
|
1008
1036
|
style: lStyle,
|
|
@@ -1011,18 +1039,18 @@ var EntityRenderEngine;
|
|
|
1011
1039
|
maxDistance: zoomItem.MaxZoom,
|
|
1012
1040
|
minDistance: zoomItem.MinZoom
|
|
1013
1041
|
});
|
|
1014
|
-
if (!cEntity) return [3 /*break*/,
|
|
1042
|
+
if (!cEntity) return [3 /*break*/, 8];
|
|
1015
1043
|
return [4 /*yield*/, getName(api, entity)];
|
|
1016
|
-
case
|
|
1017
|
-
name_3 =
|
|
1044
|
+
case 7:
|
|
1045
|
+
name_3 = _e.sent();
|
|
1018
1046
|
cEntity.name = name_3;
|
|
1019
1047
|
cEntity._renderGroup = getRenderGroupId(zoomItem, (_c = params.viewer) === null || _c === void 0 ? void 0 : _c.terrainProvider);
|
|
1020
1048
|
cEntities[entity.Bruce.ID] = cEntity;
|
|
1021
|
-
|
|
1022
|
-
case
|
|
1049
|
+
_e.label = 8;
|
|
1050
|
+
case 8:
|
|
1023
1051
|
i++;
|
|
1024
1052
|
return [3 /*break*/, 1];
|
|
1025
|
-
case
|
|
1053
|
+
case 9: return [2 /*return*/, cEntities];
|
|
1026
1054
|
}
|
|
1027
1055
|
});
|
|
1028
1056
|
});
|
|
@@ -1040,12 +1068,12 @@ var EntityRenderEngine;
|
|
|
1040
1068
|
}
|
|
1041
1069
|
var style = params.style;
|
|
1042
1070
|
var bFillColor = bruce_models_1.Calculator.GetColor(style.fillColor, entity, params.tags);
|
|
1043
|
-
var cFillColor = bFillColor ? colorToCColor(bFillColor) : Cesium.Color.
|
|
1071
|
+
var cFillColor = bFillColor ? colorToCColor(bFillColor) : Cesium.Color.fromCssColorString("rgba(139, 195, 74, 0.8)");
|
|
1044
1072
|
var bLineColor = bruce_models_1.Calculator.GetColor(style.lineColor, entity, params.tags);
|
|
1045
|
-
var cLineColor = bLineColor ? colorToCColor(bLineColor) : Cesium.Color.
|
|
1073
|
+
var cLineColor = bLineColor ? colorToCColor(bLineColor) : Cesium.Color.fromCssColorString("rgba(80, 80, 80, 0.8)");
|
|
1046
1074
|
var width = style.lineWidth ? bruce_models_1.Calculator.GetNumber(style.lineWidth, entity, params.tags) : null;
|
|
1047
1075
|
if (width == null) {
|
|
1048
|
-
width =
|
|
1076
|
+
width = 1;
|
|
1049
1077
|
}
|
|
1050
1078
|
width = (0, js_utils_1.EnsureNumber)(width);
|
|
1051
1079
|
if (width < 0.01) {
|
|
@@ -1188,33 +1216,40 @@ var EntityRenderEngine;
|
|
|
1188
1216
|
function RenderGroup(params) {
|
|
1189
1217
|
var _a, _b, _c;
|
|
1190
1218
|
return __awaiter(this, void 0, void 0, function () {
|
|
1191
|
-
var api, cEntities, i, entity, zoomItem, style, tagIds, tags, pStyle, cEntity, name_4;
|
|
1192
|
-
return __generator(this, function (
|
|
1193
|
-
switch (
|
|
1219
|
+
var api, cEntities, i, entity, zoomItem, style, _d, tagIds, tags, pStyle, cEntity, name_4;
|
|
1220
|
+
return __generator(this, function (_e) {
|
|
1221
|
+
switch (_e.label) {
|
|
1194
1222
|
case 0:
|
|
1195
1223
|
api = params.apiGetter.getApi();
|
|
1196
1224
|
cEntities = {};
|
|
1197
1225
|
i = 0;
|
|
1198
|
-
|
|
1226
|
+
_e.label = 1;
|
|
1199
1227
|
case 1:
|
|
1200
|
-
if (!(i < params.entities.length)) return [3 /*break*/,
|
|
1228
|
+
if (!(i < params.entities.length)) return [3 /*break*/, 9];
|
|
1201
1229
|
entity = params.entities[i];
|
|
1202
1230
|
zoomItem = params.zoomItems[entity.Bruce.ID];
|
|
1231
|
+
if (!(zoomItem.StyleID != -1)) return [3 /*break*/, 3];
|
|
1203
1232
|
return [4 /*yield*/, getStyle(api, entity, zoomItem.StyleID)];
|
|
1204
1233
|
case 2:
|
|
1205
|
-
|
|
1234
|
+
_d = (_a = (_e.sent())) === null || _a === void 0 ? void 0 : _a.Settings;
|
|
1235
|
+
return [3 /*break*/, 4];
|
|
1236
|
+
case 3:
|
|
1237
|
+
_d = zoomItem.Style;
|
|
1238
|
+
_e.label = 4;
|
|
1239
|
+
case 4:
|
|
1240
|
+
style = _d;
|
|
1206
1241
|
tagIds = entity.Bruce["Layer.ID"];
|
|
1207
1242
|
tags = [];
|
|
1208
|
-
if (!(tagIds && tagIds.length > 0)) return [3 /*break*/,
|
|
1243
|
+
if (!(tagIds && tagIds.length > 0)) return [3 /*break*/, 6];
|
|
1209
1244
|
return [4 /*yield*/, bruce_models_1.EntityTag.GetListByIds({
|
|
1210
1245
|
api: api,
|
|
1211
1246
|
tagIds: tagIds
|
|
1212
1247
|
})];
|
|
1213
|
-
case
|
|
1214
|
-
tags = (
|
|
1215
|
-
|
|
1216
|
-
case
|
|
1217
|
-
pStyle = (_b =
|
|
1248
|
+
case 5:
|
|
1249
|
+
tags = (_e.sent()).tags;
|
|
1250
|
+
_e.label = 6;
|
|
1251
|
+
case 6:
|
|
1252
|
+
pStyle = (_b = style === null || style === void 0 ? void 0 : style.polygonStyle) !== null && _b !== void 0 ? _b : {};
|
|
1218
1253
|
cEntity = Render({
|
|
1219
1254
|
entity: entity,
|
|
1220
1255
|
style: pStyle,
|
|
@@ -1223,18 +1258,18 @@ var EntityRenderEngine;
|
|
|
1223
1258
|
maxDistance: zoomItem.MaxZoom,
|
|
1224
1259
|
minDistance: zoomItem.MinZoom
|
|
1225
1260
|
});
|
|
1226
|
-
if (!cEntity) return [3 /*break*/,
|
|
1261
|
+
if (!cEntity) return [3 /*break*/, 8];
|
|
1227
1262
|
return [4 /*yield*/, getName(api, entity)];
|
|
1228
|
-
case
|
|
1229
|
-
name_4 =
|
|
1263
|
+
case 7:
|
|
1264
|
+
name_4 = _e.sent();
|
|
1230
1265
|
cEntity.name = name_4;
|
|
1231
1266
|
cEntity._renderGroup = getRenderGroupId(zoomItem, (_c = params.viewer) === null || _c === void 0 ? void 0 : _c.terrainProvider);
|
|
1232
1267
|
cEntities[entity.Bruce.ID] = cEntity;
|
|
1233
|
-
|
|
1234
|
-
case
|
|
1268
|
+
_e.label = 8;
|
|
1269
|
+
case 8:
|
|
1235
1270
|
i++;
|
|
1236
1271
|
return [3 /*break*/, 1];
|
|
1237
|
-
case
|
|
1272
|
+
case 9: return [2 /*return*/, cEntities];
|
|
1238
1273
|
}
|
|
1239
1274
|
});
|
|
1240
1275
|
});
|
|
@@ -1261,7 +1296,7 @@ var EntityRenderEngine;
|
|
|
1261
1296
|
styleScale = 1;
|
|
1262
1297
|
}
|
|
1263
1298
|
var hpr = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(heading), Cesium.Math.toRadians(pitch), Cesium.Math.toRadians(roll));
|
|
1264
|
-
var heightRef = getHeightRef(style);
|
|
1299
|
+
var heightRef = getHeightRef(style, Cesium.HeightReference.RELATIVE_TO_GROUND);
|
|
1265
1300
|
var pos = entity_utils_1.EntityUtils.GetPos({
|
|
1266
1301
|
viewer: params.viewer,
|
|
1267
1302
|
entity: entity,
|
|
@@ -1320,9 +1355,9 @@ var EntityRenderEngine;
|
|
|
1320
1355
|
function RenderGroup(params) {
|
|
1321
1356
|
var _a, _b, _c, _d, _e;
|
|
1322
1357
|
return __awaiter(this, void 0, void 0, function () {
|
|
1323
|
-
var api, cEntities, reqBody, i, entity, zoomItem, style, tagIds, tags, mStyle, group, level, catId, lodData, _loop_2, i;
|
|
1324
|
-
return __generator(this, function (
|
|
1325
|
-
switch (
|
|
1358
|
+
var api, cEntities, reqBody, i, entity, zoomItem, style, _f, tagIds, tags, mStyle, group, level, catId, lodData, _loop_2, i;
|
|
1359
|
+
return __generator(this, function (_g) {
|
|
1360
|
+
switch (_g.label) {
|
|
1326
1361
|
case 0:
|
|
1327
1362
|
api = params.apiGetter.getApi();
|
|
1328
1363
|
cEntities = {};
|
|
@@ -1332,26 +1367,33 @@ var EntityRenderEngine;
|
|
|
1332
1367
|
"Items": []
|
|
1333
1368
|
};
|
|
1334
1369
|
i = 0;
|
|
1335
|
-
|
|
1370
|
+
_g.label = 1;
|
|
1336
1371
|
case 1:
|
|
1337
|
-
if (!(i < params.entities.length)) return [3 /*break*/,
|
|
1372
|
+
if (!(i < params.entities.length)) return [3 /*break*/, 8];
|
|
1338
1373
|
entity = params.entities[i];
|
|
1339
1374
|
zoomItem = params.zoomItems[entity.Bruce.ID];
|
|
1375
|
+
if (!(zoomItem.StyleID != -1)) return [3 /*break*/, 3];
|
|
1340
1376
|
return [4 /*yield*/, getStyle(api, entity, zoomItem.StyleID)];
|
|
1341
1377
|
case 2:
|
|
1342
|
-
|
|
1378
|
+
_f = (_a = (_g.sent())) === null || _a === void 0 ? void 0 : _a.Settings;
|
|
1379
|
+
return [3 /*break*/, 4];
|
|
1380
|
+
case 3:
|
|
1381
|
+
_f = zoomItem.Style;
|
|
1382
|
+
_g.label = 4;
|
|
1383
|
+
case 4:
|
|
1384
|
+
style = _f;
|
|
1343
1385
|
tagIds = entity.Bruce["Layer.ID"];
|
|
1344
1386
|
tags = [];
|
|
1345
|
-
if (!(tagIds && tagIds.length > 0)) return [3 /*break*/,
|
|
1387
|
+
if (!(tagIds && tagIds.length > 0)) return [3 /*break*/, 6];
|
|
1346
1388
|
return [4 /*yield*/, bruce_models_1.EntityTag.GetListByIds({
|
|
1347
1389
|
api: api,
|
|
1348
1390
|
tagIds: tagIds
|
|
1349
1391
|
})];
|
|
1350
|
-
case
|
|
1351
|
-
tags = (
|
|
1352
|
-
|
|
1353
|
-
case
|
|
1354
|
-
mStyle = (_b =
|
|
1392
|
+
case 5:
|
|
1393
|
+
tags = (_g.sent()).tags;
|
|
1394
|
+
_g.label = 6;
|
|
1395
|
+
case 6:
|
|
1396
|
+
mStyle = (_b = style === null || style === void 0 ? void 0 : style.modelStyle) !== null && _b !== void 0 ? _b : {};
|
|
1355
1397
|
group = mStyle.lodGroup ? bruce_models_1.Calculator.GetString(mStyle.lodGroup, entity, tags) : null;
|
|
1356
1398
|
if (!group) {
|
|
1357
1399
|
group = "DEFAULT";
|
|
@@ -1370,42 +1412,49 @@ var EntityRenderEngine;
|
|
|
1370
1412
|
"group": group,
|
|
1371
1413
|
"level": level
|
|
1372
1414
|
});
|
|
1373
|
-
|
|
1374
|
-
case
|
|
1415
|
+
_g.label = 7;
|
|
1416
|
+
case 7:
|
|
1375
1417
|
i++;
|
|
1376
1418
|
return [3 /*break*/, 1];
|
|
1377
|
-
case
|
|
1419
|
+
case 8: return [4 /*yield*/, bruce_models_1.EntityLod.GetLods({
|
|
1378
1420
|
api: api,
|
|
1379
1421
|
filter: reqBody
|
|
1380
1422
|
})];
|
|
1381
|
-
case
|
|
1382
|
-
lodData = (
|
|
1423
|
+
case 9:
|
|
1424
|
+
lodData = (_g.sent()).lods;
|
|
1383
1425
|
_loop_2 = function (i) {
|
|
1384
|
-
var entity, zoomItem, style, tagIds, tags, lod, mStyle, cEntity, name_5;
|
|
1385
|
-
return __generator(this, function (
|
|
1386
|
-
switch (
|
|
1426
|
+
var entity, zoomItem, style, _h, tagIds, tags, lod, mStyle, cEntity, name_5;
|
|
1427
|
+
return __generator(this, function (_j) {
|
|
1428
|
+
switch (_j.label) {
|
|
1387
1429
|
case 0:
|
|
1388
1430
|
entity = params.entities[i];
|
|
1389
1431
|
zoomItem = params.zoomItems[entity.Bruce.ID];
|
|
1432
|
+
if (!(zoomItem.StyleID != -1)) return [3 /*break*/, 2];
|
|
1390
1433
|
return [4 /*yield*/, getStyle(api, entity, zoomItem.StyleID)];
|
|
1391
1434
|
case 1:
|
|
1392
|
-
|
|
1435
|
+
_h = (_c = (_j.sent())) === null || _c === void 0 ? void 0 : _c.Settings;
|
|
1436
|
+
return [3 /*break*/, 3];
|
|
1437
|
+
case 2:
|
|
1438
|
+
_h = zoomItem.Style;
|
|
1439
|
+
_j.label = 3;
|
|
1440
|
+
case 3:
|
|
1441
|
+
style = _h;
|
|
1393
1442
|
tagIds = entity.Bruce["Layer.ID"];
|
|
1394
1443
|
tags = [];
|
|
1395
|
-
if (!(tagIds && tagIds.length > 0)) return [3 /*break*/,
|
|
1444
|
+
if (!(tagIds && tagIds.length > 0)) return [3 /*break*/, 5];
|
|
1396
1445
|
return [4 /*yield*/, bruce_models_1.EntityTag.GetListByIds({
|
|
1397
1446
|
api: api,
|
|
1398
1447
|
tagIds: tagIds
|
|
1399
1448
|
})];
|
|
1400
|
-
case
|
|
1401
|
-
tags = (
|
|
1402
|
-
|
|
1403
|
-
case
|
|
1449
|
+
case 4:
|
|
1450
|
+
tags = (_j.sent()).tags;
|
|
1451
|
+
_j.label = 5;
|
|
1452
|
+
case 5:
|
|
1404
1453
|
lod = lodData.find(function (x) { return x.entityId == entity.Bruce.ID; });
|
|
1405
1454
|
if (!(lod === null || lod === void 0 ? void 0 : lod.clientFileId)) {
|
|
1406
1455
|
return [2 /*return*/, "continue"];
|
|
1407
1456
|
}
|
|
1408
|
-
mStyle = (_d =
|
|
1457
|
+
mStyle = (_d = style === null || style === void 0 ? void 0 : style.modelStyle) !== null && _d !== void 0 ? _d : {};
|
|
1409
1458
|
cEntity = Render({
|
|
1410
1459
|
entity: entity,
|
|
1411
1460
|
style: mStyle,
|
|
@@ -1419,30 +1468,30 @@ var EntityRenderEngine;
|
|
|
1419
1468
|
maxDistance: zoomItem.MaxZoom,
|
|
1420
1469
|
minDistance: zoomItem.MinZoom
|
|
1421
1470
|
});
|
|
1422
|
-
if (!cEntity) return [3 /*break*/,
|
|
1471
|
+
if (!cEntity) return [3 /*break*/, 7];
|
|
1423
1472
|
return [4 /*yield*/, getName(api, entity)];
|
|
1424
|
-
case
|
|
1425
|
-
name_5 =
|
|
1473
|
+
case 6:
|
|
1474
|
+
name_5 = _j.sent();
|
|
1426
1475
|
cEntity.name = name_5;
|
|
1427
1476
|
cEntity._renderGroup = getRenderGroupId(zoomItem, (_e = params.viewer) === null || _e === void 0 ? void 0 : _e.terrainProvider);
|
|
1428
1477
|
cEntities[entity.Bruce.ID] = cEntity;
|
|
1429
|
-
|
|
1430
|
-
case
|
|
1478
|
+
_j.label = 7;
|
|
1479
|
+
case 7: return [2 /*return*/];
|
|
1431
1480
|
}
|
|
1432
1481
|
});
|
|
1433
1482
|
};
|
|
1434
1483
|
i = 0;
|
|
1435
|
-
|
|
1436
|
-
case 8:
|
|
1437
|
-
if (!(i < params.entities.length)) return [3 /*break*/, 11];
|
|
1438
|
-
return [5 /*yield**/, _loop_2(i)];
|
|
1439
|
-
case 9:
|
|
1440
|
-
_f.sent();
|
|
1441
|
-
_f.label = 10;
|
|
1484
|
+
_g.label = 10;
|
|
1442
1485
|
case 10:
|
|
1486
|
+
if (!(i < params.entities.length)) return [3 /*break*/, 13];
|
|
1487
|
+
return [5 /*yield**/, _loop_2(i)];
|
|
1488
|
+
case 11:
|
|
1489
|
+
_g.sent();
|
|
1490
|
+
_g.label = 12;
|
|
1491
|
+
case 12:
|
|
1443
1492
|
i++;
|
|
1444
|
-
return [3 /*break*/,
|
|
1445
|
-
case
|
|
1493
|
+
return [3 /*break*/, 10];
|
|
1494
|
+
case 13: return [2 /*return*/, cEntities];
|
|
1446
1495
|
}
|
|
1447
1496
|
});
|
|
1448
1497
|
});
|