bruce-cesium 3.3.8 → 3.4.0
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 +235 -42
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +234 -41
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +74 -18
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-arb-render-manager.js +7 -0
- package/dist/lib/rendering/render-managers/tilesets/tileset-arb-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js +7 -0
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js.map +1 -1
- package/dist/lib/rendering/tileset-render-engine.js +86 -22
- package/dist/lib/rendering/tileset-render-engine.js.map +1 -1
- package/dist/lib/utils/cesium-entity-styler.js +60 -0
- package/dist/lib/utils/cesium-entity-styler.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/render-managers/tilesets/tileset-arb-render-manager.d.ts +2 -0
- package/dist/types/rendering/render-managers/tilesets/tileset-cad-render-manager.d.ts +2 -0
- package/dist/types/rendering/tileset-render-engine.d.ts +10 -0
- package/dist/types/utils/cesium-entity-styler.d.ts +12 -0
- package/package.json +1 -1
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Cartes, Carto, Entity as Entity$1, Geometry, Tileset, MathUtils, LRUCache, ProjectViewTile, DelayQueue, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, EntityRelationType, ENVIRONMENT, BruceEvent, EntityCoords, Api, EntitySource, MenuItem, EntityRelation, ProgramKey, AbstractApi, ProjectViewBookmark, EntityAttachment, EntityAttachmentType, EntityAttribute, ProjectView, ProjectViewLegacyTile, Camera } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle,
|
|
3
|
+
import { Cartographic, JulianDate, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, Entity, Primitive, Cesium3DTileFeature, DistanceDisplayCondition, NearFarScalar, Model, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, SceneMode, Ion, Cesium3DTileStyle, Cesium3DTileColorBlendMode, HeadingPitchRange, GeoJsonDataSource, ColorMaterialProperty, KmlDataSource, OrthographicFrustum, EasingFunction, SceneTransforms, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidTerrainProvider, CesiumInspector, defined, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, ScreenSpaceEventHandler, ScreenSpaceEventType, BoundingSphere, GeometryInstance, Intersect, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics } from 'cesium';
|
|
4
4
|
|
|
5
5
|
/*! *****************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -742,6 +742,66 @@ var CesiumEntityStyler;
|
|
|
742
742
|
}
|
|
743
743
|
}
|
|
744
744
|
CesiumEntityStyler.UpdateColorSetting = UpdateColorSetting;
|
|
745
|
+
/**
|
|
746
|
+
* Updates the default colour of a graphic.
|
|
747
|
+
* This will not change the graphic's state to use it if the entity is selected/highlighted.
|
|
748
|
+
* @param params
|
|
749
|
+
* @returns
|
|
750
|
+
*/
|
|
751
|
+
function SetDefaultColor(params) {
|
|
752
|
+
var viewer = params.viewer, entity = params.entity, requestRender = params.requestRender;
|
|
753
|
+
if (!entity) {
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
var parts = EntityUtils.GatherEntity({
|
|
757
|
+
entity: entity
|
|
758
|
+
});
|
|
759
|
+
for (var i = 0; i < parts.length; i++) {
|
|
760
|
+
var part = parts[i];
|
|
761
|
+
if (!isAlive(viewer, part)) {
|
|
762
|
+
continue;
|
|
763
|
+
}
|
|
764
|
+
if (part instanceof Cesium3DTileFeature) {
|
|
765
|
+
var opacity = getAppliedOpacity(part);
|
|
766
|
+
storeColor(viewer, "default", params.color, part);
|
|
767
|
+
refreshColor(viewer, part, opacity);
|
|
768
|
+
}
|
|
769
|
+
else if (part instanceof Entity) {
|
|
770
|
+
if (part.billboard) {
|
|
771
|
+
storeColor(viewer, "default", params.color, part.billboard);
|
|
772
|
+
refreshColor(viewer, part.billboard, getAppliedOpacity(part.billboard));
|
|
773
|
+
}
|
|
774
|
+
if (part.model) {
|
|
775
|
+
storeColor(viewer, "default", params.color, part.model);
|
|
776
|
+
refreshColor(viewer, part.model, getAppliedOpacity(part.model));
|
|
777
|
+
}
|
|
778
|
+
if (part.polyline) {
|
|
779
|
+
storeColor(viewer, "default", params.color, part.polyline);
|
|
780
|
+
refreshColor(viewer, part.polyline, getAppliedOpacity(part.polyline));
|
|
781
|
+
}
|
|
782
|
+
if (part.polygon) {
|
|
783
|
+
storeColor(viewer, "default", params.color, part.polygon);
|
|
784
|
+
refreshColor(viewer, part.polygon, getAppliedOpacity(part.polygon));
|
|
785
|
+
}
|
|
786
|
+
if (part.corridor) {
|
|
787
|
+
storeColor(viewer, "default", params.color, part.corridor);
|
|
788
|
+
refreshColor(viewer, part.corridor, getAppliedOpacity(part.corridor));
|
|
789
|
+
}
|
|
790
|
+
if (part.point) {
|
|
791
|
+
storeColor(viewer, "default", params.color, part.point);
|
|
792
|
+
refreshColor(viewer, part.point, getAppliedOpacity(part.point));
|
|
793
|
+
}
|
|
794
|
+
if (part.ellipse) {
|
|
795
|
+
storeColor(viewer, "default", params.color, part.ellipse);
|
|
796
|
+
refreshColor(viewer, part.ellipse, getAppliedOpacity(part.ellipse));
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
if (requestRender != false) {
|
|
801
|
+
viewer.scene.requestRender();
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
CesiumEntityStyler.SetDefaultColor = SetDefaultColor;
|
|
745
805
|
/**
|
|
746
806
|
* Updates the opacity of the graphic.
|
|
747
807
|
* This will multiply against the current colour's opacity before applying.
|
|
@@ -8419,12 +8479,12 @@ var EntitiesRenderManager;
|
|
|
8419
8479
|
* @param force TODO: This should re-render entities that are already rendered.
|
|
8420
8480
|
*/
|
|
8421
8481
|
Manager.prototype.renderAsGeojson = function (entities, force) {
|
|
8422
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
8482
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
8423
8483
|
return __awaiter(this, void 0, void 0, function () {
|
|
8424
|
-
var zoomItem, style, e_4, entityType, e_5, pStyle, polygonsClamped, bFillColor, cFillColor, bLineColor, cLineColor, lineWidthPx, geojson, source, groups, register, sEntities, i, cEntity;
|
|
8484
|
+
var zoomItem, style, e_4, entityType, e_5, pStyle, lStyle, polygonsClamped, bFillColor, cFillColor, bLineColor, cLineColor, lineWidthPx, geojson, source, groups, applyStyle, register, sEntities, i, cEntity;
|
|
8425
8485
|
var _this = this;
|
|
8426
|
-
return __generator(this, function (
|
|
8427
|
-
switch (
|
|
8486
|
+
return __generator(this, function (_k) {
|
|
8487
|
+
switch (_k.label) {
|
|
8428
8488
|
case 0:
|
|
8429
8489
|
entities = entities.filter(function (entity) {
|
|
8430
8490
|
var _a;
|
|
@@ -8438,28 +8498,28 @@ var EntitiesRenderManager;
|
|
|
8438
8498
|
zoomItem = this.item.CameraZoomSettings[0];
|
|
8439
8499
|
style = null;
|
|
8440
8500
|
if (!(zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID)) return [3 /*break*/, 4];
|
|
8441
|
-
|
|
8501
|
+
_k.label = 1;
|
|
8442
8502
|
case 1:
|
|
8443
|
-
|
|
8503
|
+
_k.trys.push([1, 3, , 4]);
|
|
8444
8504
|
return [4 /*yield*/, Style.Get({
|
|
8445
8505
|
api: this.apiGetter.getApi(),
|
|
8446
8506
|
styleId: zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID
|
|
8447
8507
|
})];
|
|
8448
8508
|
case 2:
|
|
8449
|
-
style = (_a = (
|
|
8509
|
+
style = (_a = (_k.sent()).style) === null || _a === void 0 ? void 0 : _a.Settings;
|
|
8450
8510
|
return [3 /*break*/, 4];
|
|
8451
8511
|
case 3:
|
|
8452
|
-
e_4 =
|
|
8512
|
+
e_4 = _k.sent();
|
|
8453
8513
|
console.error(e_4);
|
|
8454
8514
|
return [3 /*break*/, 4];
|
|
8455
8515
|
case 4:
|
|
8456
|
-
|
|
8516
|
+
_k.trys.push([4, 8, , 9]);
|
|
8457
8517
|
return [4 /*yield*/, EntityType.Get({
|
|
8458
8518
|
entityTypeId: this.item.BruceEntity["EntityType.ID"],
|
|
8459
8519
|
api: this.apiGetter.getApi()
|
|
8460
8520
|
})];
|
|
8461
8521
|
case 5:
|
|
8462
|
-
entityType = (_b = (
|
|
8522
|
+
entityType = (_b = (_k.sent())) === null || _b === void 0 ? void 0 : _b.entityType;
|
|
8463
8523
|
if (!(!style && ((_c = this.item.BruceEntity) === null || _c === void 0 ? void 0 : _c["EntityType.ID"]))) return [3 /*break*/, 7];
|
|
8464
8524
|
if (!entityType["DisplaySetting.ID"]) return [3 /*break*/, 7];
|
|
8465
8525
|
return [4 /*yield*/, Style.Get({
|
|
@@ -8467,16 +8527,17 @@ var EntitiesRenderManager;
|
|
|
8467
8527
|
styleId: entityType["DisplaySetting.ID"]
|
|
8468
8528
|
})];
|
|
8469
8529
|
case 6:
|
|
8470
|
-
style = (_d = (
|
|
8471
|
-
|
|
8530
|
+
style = (_d = (_k.sent()).style) === null || _d === void 0 ? void 0 : _d.Settings;
|
|
8531
|
+
_k.label = 7;
|
|
8472
8532
|
case 7: return [3 /*break*/, 9];
|
|
8473
8533
|
case 8:
|
|
8474
|
-
e_5 =
|
|
8534
|
+
e_5 = _k.sent();
|
|
8475
8535
|
console.error(e_5);
|
|
8476
8536
|
return [3 /*break*/, 9];
|
|
8477
8537
|
case 9:
|
|
8478
8538
|
pStyle = (_e = style === null || style === void 0 ? void 0 : style.polygonStyle) !== null && _e !== void 0 ? _e : {};
|
|
8479
|
-
|
|
8539
|
+
lStyle = (_f = style === null || style === void 0 ? void 0 : style.polylineStyle) !== null && _f !== void 0 ? _f : {};
|
|
8540
|
+
polygonsClamped = ((_g = pStyle === null || pStyle === void 0 ? void 0 : pStyle.altitudeOption) === null || _g === void 0 ? void 0 : _g.id) == null ? true : ((_h = pStyle === null || pStyle === void 0 ? void 0 : pStyle.altitudeOption) === null || _h === void 0 ? void 0 : _h.id) == 0;
|
|
8480
8541
|
bFillColor = Calculator.GetColor(pStyle.fillColor, {}, []);
|
|
8481
8542
|
cFillColor = bFillColor ? colorToCColor$2(bFillColor) : Color.fromCssColorString("rgba(139, 195, 74, 0.8)");
|
|
8482
8543
|
bLineColor = Calculator.GetColor(pStyle.lineColor, {}, []);
|
|
@@ -8498,7 +8559,7 @@ var EntitiesRenderManager;
|
|
|
8498
8559
|
// No points.
|
|
8499
8560
|
allowedDisplayTypes: [ZoomControl.EDisplayType.Geometry]
|
|
8500
8561
|
});
|
|
8501
|
-
if (!((
|
|
8562
|
+
if (!((_j = geojson === null || geojson === void 0 ? void 0 : geojson.features) === null || _j === void 0 ? void 0 : _j.length)) {
|
|
8502
8563
|
return [2 /*return*/];
|
|
8503
8564
|
}
|
|
8504
8565
|
return [4 /*yield*/, GeoJsonDataSource.load(geojson, {
|
|
@@ -8508,7 +8569,7 @@ var EntitiesRenderManager;
|
|
|
8508
8569
|
clampToGround: lineWidthPx <= 0 && polygonsClamped
|
|
8509
8570
|
})];
|
|
8510
8571
|
case 10:
|
|
8511
|
-
source =
|
|
8572
|
+
source = _k.sent();
|
|
8512
8573
|
this.viewer.dataSources.add(source);
|
|
8513
8574
|
this.sources.push(source);
|
|
8514
8575
|
if (this.disposed) {
|
|
@@ -8516,6 +8577,62 @@ var EntitiesRenderManager;
|
|
|
8516
8577
|
return [2 /*return*/];
|
|
8517
8578
|
}
|
|
8518
8579
|
groups = [];
|
|
8580
|
+
applyStyle = function (thing, entityId, data) {
|
|
8581
|
+
if (thing.polygon) {
|
|
8582
|
+
var bFillColor_1 = Calculator.GetColor(pStyle.fillColor, data, []);
|
|
8583
|
+
var cFillColor_1 = bFillColor_1 ? colorToCColor$2(bFillColor_1) : Color.fromCssColorString("rgba(139, 195, 74, 0.8)");
|
|
8584
|
+
var bLineColor_1 = Calculator.GetColor(pStyle.lineColor, data, []);
|
|
8585
|
+
var cLineColor_1 = bLineColor_1 ? colorToCColor$2(bLineColor_1) : Color.fromCssColorString("rgba(80, 80, 80, 0.8)");
|
|
8586
|
+
var width = pStyle.lineWidth ? Calculator.GetNumber(pStyle.lineWidth, data, []) : null;
|
|
8587
|
+
if (width == null) {
|
|
8588
|
+
width = 1;
|
|
8589
|
+
}
|
|
8590
|
+
width = EnsureNumber(width);
|
|
8591
|
+
if (width < 0.01) {
|
|
8592
|
+
width = 0;
|
|
8593
|
+
}
|
|
8594
|
+
var curFillColor = getValue$3(_this.viewer, thing.polygon.material);
|
|
8595
|
+
if (curFillColor && curFillColor instanceof ColorMaterialProperty) {
|
|
8596
|
+
curFillColor = curFillColor.color;
|
|
8597
|
+
}
|
|
8598
|
+
var curLineColor = getValue$3(_this.viewer, thing.polygon.outlineColor);
|
|
8599
|
+
if (curLineColor && curLineColor instanceof ColorMaterialProperty) {
|
|
8600
|
+
curLineColor = curLineColor.color;
|
|
8601
|
+
}
|
|
8602
|
+
var curWidth = getValue$3(_this.viewer, thing.polygon.outlineWidth);
|
|
8603
|
+
if ((curFillColor instanceof Color && curFillColor.equals(cFillColor_1)) &&
|
|
8604
|
+
(curLineColor instanceof Color && curLineColor.equals(cLineColor_1)) &&
|
|
8605
|
+
curWidth == width) {
|
|
8606
|
+
return;
|
|
8607
|
+
}
|
|
8608
|
+
thing.polygon.material = cFillColor_1;
|
|
8609
|
+
thing.polygon.outlineColor = cLineColor_1;
|
|
8610
|
+
thing.polygon.outlineWidth = width;
|
|
8611
|
+
}
|
|
8612
|
+
else if (thing.polyline) {
|
|
8613
|
+
var bColor = lStyle.lineColor ? Calculator.GetColor(lStyle.lineColor, data, []) : null;
|
|
8614
|
+
var cColor = bColor ? colorToCColor$2(bColor) : Color.fromCssColorString("rgba(255, 193, 7, 0.8)");
|
|
8615
|
+
var width = lStyle.lineWidth ? Calculator.GetNumber(lStyle.lineWidth, data, []) : null;
|
|
8616
|
+
if (width == null) {
|
|
8617
|
+
width = 2;
|
|
8618
|
+
}
|
|
8619
|
+
width = EnsureNumber(width);
|
|
8620
|
+
if (width < 0.01) {
|
|
8621
|
+
width = 0;
|
|
8622
|
+
}
|
|
8623
|
+
var curColor = getValue$3(_this.viewer, thing.polyline.material);
|
|
8624
|
+
if (curColor && curColor instanceof ColorMaterialProperty) {
|
|
8625
|
+
curColor = curColor.color;
|
|
8626
|
+
}
|
|
8627
|
+
var curWidth = getValue$3(_this.viewer, thing.polyline.width);
|
|
8628
|
+
if ((curColor instanceof Color && curColor.equals(cColor)) &&
|
|
8629
|
+
curWidth == width) {
|
|
8630
|
+
return;
|
|
8631
|
+
}
|
|
8632
|
+
thing.polyline.material = cColor;
|
|
8633
|
+
thing.polyline.width = width;
|
|
8634
|
+
}
|
|
8635
|
+
};
|
|
8519
8636
|
register = function (thing) {
|
|
8520
8637
|
var _a, _b, _c, _d;
|
|
8521
8638
|
// See if the cesium entity already exists in a group.
|
|
@@ -8575,8 +8692,7 @@ var EntitiesRenderManager;
|
|
|
8575
8692
|
});
|
|
8576
8693
|
}
|
|
8577
8694
|
}
|
|
8578
|
-
|
|
8579
|
-
// applyStyle(thing, entityId, group.data);
|
|
8695
|
+
applyStyle(thing, entityId, group.data);
|
|
8580
8696
|
};
|
|
8581
8697
|
sEntities = source.entities.values;
|
|
8582
8698
|
for (i = 0; i < sEntities.length; i++) {
|
|
@@ -10008,6 +10124,7 @@ var TilesetRenderEngine;
|
|
|
10008
10124
|
this.styleMappingLoaded = false;
|
|
10009
10125
|
this.styleMappingsLoaded = {};
|
|
10010
10126
|
this.fallbackStyle = null;
|
|
10127
|
+
this.loadingCounter = 0;
|
|
10011
10128
|
this.runningQueues = 0;
|
|
10012
10129
|
this.recordLoadQueue = [];
|
|
10013
10130
|
this.recordCheckQueue = [];
|
|
@@ -10019,6 +10136,7 @@ var TilesetRenderEngine;
|
|
|
10019
10136
|
// ND-1641. BOOKMARKS - (DEMO) View does not match bookmark.
|
|
10020
10137
|
// We have some evil hard-coded style mappings that need to be fixed.
|
|
10021
10138
|
// These exist within legacy project views.
|
|
10139
|
+
// Update: This now also lets people have a style mapping without a real style record.
|
|
10022
10140
|
if ((_a = this.styleMapping) === null || _a === void 0 ? void 0 : _a.length) {
|
|
10023
10141
|
for (var i = 0; i < this.styleMapping.length; i++) {
|
|
10024
10142
|
var mapItem = this.styleMapping[i];
|
|
@@ -10037,6 +10155,42 @@ var TilesetRenderEngine;
|
|
|
10037
10155
|
enumerable: false,
|
|
10038
10156
|
configurable: true
|
|
10039
10157
|
});
|
|
10158
|
+
/**
|
|
10159
|
+
* Updates style mapping and fallback style.
|
|
10160
|
+
* This will trigger a re-style of all entities, and will stop existing style loads.
|
|
10161
|
+
* @param params
|
|
10162
|
+
*/
|
|
10163
|
+
Styler.prototype.UpdateStyleMapping = function (params) {
|
|
10164
|
+
var _a;
|
|
10165
|
+
if (params.styleMapping) {
|
|
10166
|
+
this.styleMapping = params.styleMapping;
|
|
10167
|
+
// ND-1641. BOOKMARKS - (DEMO) View does not match bookmark.
|
|
10168
|
+
// We have some evil hard-coded style mappings that need to be fixed.
|
|
10169
|
+
// These exist within legacy project views.
|
|
10170
|
+
// Update: This now also lets people have a style mapping without a real style record.
|
|
10171
|
+
if ((_a = this.styleMapping) === null || _a === void 0 ? void 0 : _a.length) {
|
|
10172
|
+
for (var i = 0; i < this.styleMapping.length; i++) {
|
|
10173
|
+
var mapItem = this.styleMapping[i];
|
|
10174
|
+
var mapStyle = mapItem.style ? mapItem.style : mapItem.Style;
|
|
10175
|
+
this.styleMapping[i].style = correctStyle(mapStyle);
|
|
10176
|
+
}
|
|
10177
|
+
}
|
|
10178
|
+
}
|
|
10179
|
+
if (isNaN(params.fallbackStyleId) && params.fallbackStyleId != null) {
|
|
10180
|
+
this.fallbackStyleId = params.fallbackStyleId;
|
|
10181
|
+
}
|
|
10182
|
+
// Empty queues.
|
|
10183
|
+
// Requeue all.
|
|
10184
|
+
this.recordLoadQueue = [];
|
|
10185
|
+
this.recordCheckQueue = [];
|
|
10186
|
+
var regos = this.register.GetRegos({
|
|
10187
|
+
menuItemId: this.menuItemId
|
|
10188
|
+
});
|
|
10189
|
+
this.styleMappingLoaded = false;
|
|
10190
|
+
this.styleMappingsLoaded = {};
|
|
10191
|
+
this.QueueEntities(regos);
|
|
10192
|
+
this.loadStyles();
|
|
10193
|
+
};
|
|
10040
10194
|
Styler.prototype.QueueEntities = function (entities, highPriority) {
|
|
10041
10195
|
if (highPriority === void 0) { highPriority = false; }
|
|
10042
10196
|
for (var i = 0; i < entities.length; i++) {
|
|
@@ -10128,10 +10282,14 @@ var TilesetRenderEngine;
|
|
|
10128
10282
|
Styler.prototype.loadStyles = function () {
|
|
10129
10283
|
var _a, _b;
|
|
10130
10284
|
return __awaiter(this, void 0, void 0, function () {
|
|
10131
|
-
var fallbackStyleId, data, e_1, styleMapping, modelTree, entityTypeIds, _loop_2, i, i, styleMap, styleId, entityType, e_2, data, e_3;
|
|
10285
|
+
var counter, fallbackStyleId, data, e_1, styleMapping, modelTree, entityTypeIds, _loop_2, this_2, i, i, styleMap, styleId, entityType, e_2, data, e_3;
|
|
10132
10286
|
return __generator(this, function (_c) {
|
|
10133
10287
|
switch (_c.label) {
|
|
10134
10288
|
case 0:
|
|
10289
|
+
counter = ++this.loadingCounter;
|
|
10290
|
+
this.styleMappingLoaded = false;
|
|
10291
|
+
this.styleMappingsLoaded = {};
|
|
10292
|
+
this.fallbackStyle = null;
|
|
10135
10293
|
fallbackStyleId = this.fallbackStyleId;
|
|
10136
10294
|
if (!(fallbackStyleId && fallbackStyleId > 0)) return [3 /*break*/, 4];
|
|
10137
10295
|
_c.label = 1;
|
|
@@ -10150,6 +10308,9 @@ var TilesetRenderEngine;
|
|
|
10150
10308
|
console.error(e_1);
|
|
10151
10309
|
return [3 /*break*/, 4];
|
|
10152
10310
|
case 4:
|
|
10311
|
+
if (this.loadingCounter != counter) {
|
|
10312
|
+
return [2 /*return*/];
|
|
10313
|
+
}
|
|
10153
10314
|
styleMapping = this.styleMapping;
|
|
10154
10315
|
if (!styleMapping) {
|
|
10155
10316
|
styleMapping = [];
|
|
@@ -10166,11 +10327,12 @@ var TilesetRenderEngine;
|
|
|
10166
10327
|
if (styleMapping.findIndex(function (x) { return x.EntityTypeID == entityTypeId; }) <= -1) {
|
|
10167
10328
|
styleMapping.push({
|
|
10168
10329
|
EntityTypeID: entityTypeId,
|
|
10169
|
-
StyleID:
|
|
10170
|
-
style:
|
|
10330
|
+
StyleID: this_2.fallbackStyle ? fallbackStyleId : 0,
|
|
10331
|
+
style: this_2.fallbackStyle
|
|
10171
10332
|
});
|
|
10172
10333
|
}
|
|
10173
10334
|
};
|
|
10335
|
+
this_2 = this;
|
|
10174
10336
|
for (i = 0; i < entityTypeIds.length; i++) {
|
|
10175
10337
|
_loop_2(i);
|
|
10176
10338
|
}
|
|
@@ -10182,12 +10344,12 @@ var TilesetRenderEngine;
|
|
|
10182
10344
|
i = 0;
|
|
10183
10345
|
_c.label = 5;
|
|
10184
10346
|
case 5:
|
|
10185
|
-
if (!(i < styleMapping.length)) return [3 /*break*/,
|
|
10347
|
+
if (!(i < styleMapping.length)) return [3 /*break*/, 16];
|
|
10186
10348
|
if (this.disposed) {
|
|
10187
|
-
return [3 /*break*/,
|
|
10349
|
+
return [3 /*break*/, 16];
|
|
10188
10350
|
}
|
|
10189
10351
|
styleMap = styleMapping[i];
|
|
10190
|
-
if (!(!styleMap.style && styleMap.StyleID != -1)) return [3 /*break*/,
|
|
10352
|
+
if (!(!styleMap.style && styleMap.StyleID != -1)) return [3 /*break*/, 14];
|
|
10191
10353
|
styleId = styleMap.StyleID;
|
|
10192
10354
|
if (!!styleId) return [3 /*break*/, 9];
|
|
10193
10355
|
_c.label = 6;
|
|
@@ -10226,22 +10388,33 @@ var TilesetRenderEngine;
|
|
|
10226
10388
|
console.error(e_3);
|
|
10227
10389
|
return [3 /*break*/, 13];
|
|
10228
10390
|
case 13:
|
|
10391
|
+
if (this.loadingCounter != counter) {
|
|
10392
|
+
return [2 /*return*/];
|
|
10393
|
+
}
|
|
10394
|
+
_c.label = 14;
|
|
10395
|
+
case 14:
|
|
10229
10396
|
this.styleMappingsLoaded[styleMap.EntityTypeID] = true;
|
|
10230
10397
|
this.processTilesetFeatureCheckQueue();
|
|
10231
10398
|
this.processQueue();
|
|
10232
|
-
_c.label =
|
|
10233
|
-
case
|
|
10399
|
+
_c.label = 15;
|
|
10400
|
+
case 15:
|
|
10234
10401
|
i++;
|
|
10235
10402
|
return [3 /*break*/, 5];
|
|
10236
|
-
case
|
|
10403
|
+
case 16:
|
|
10404
|
+
if (this.loadingCounter != counter) {
|
|
10405
|
+
return [2 /*return*/];
|
|
10406
|
+
}
|
|
10237
10407
|
this.styleMappingLoaded = true;
|
|
10238
|
-
if (!!this.disposed) return [3 /*break*/,
|
|
10408
|
+
if (!!this.disposed) return [3 /*break*/, 18];
|
|
10239
10409
|
return [4 /*yield*/, this.processTilesetFeatureCheckQueue()];
|
|
10240
|
-
case
|
|
10410
|
+
case 17:
|
|
10241
10411
|
_c.sent();
|
|
10412
|
+
if (this.loadingCounter != counter) {
|
|
10413
|
+
return [2 /*return*/];
|
|
10414
|
+
}
|
|
10242
10415
|
this.processQueue();
|
|
10243
|
-
_c.label =
|
|
10244
|
-
case
|
|
10416
|
+
_c.label = 18;
|
|
10417
|
+
case 18: return [2 /*return*/];
|
|
10245
10418
|
}
|
|
10246
10419
|
});
|
|
10247
10420
|
});
|
|
@@ -10356,18 +10529,24 @@ var TilesetRenderEngine;
|
|
|
10356
10529
|
};
|
|
10357
10530
|
Styler.prototype.styleTilesetFeatureFullData = function (entity, data) {
|
|
10358
10531
|
var _a;
|
|
10359
|
-
var
|
|
10360
|
-
if (!
|
|
10532
|
+
var visual = entity.visual;
|
|
10533
|
+
if (!visual || !(visual instanceof Cesium3DTileFeature)) {
|
|
10361
10534
|
return;
|
|
10362
10535
|
}
|
|
10363
|
-
var
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
|
|
10367
|
-
|
|
10368
|
-
visual.color = cColor;
|
|
10369
|
-
}
|
|
10536
|
+
var style = this.getTilesetFeatureStyle(entity.entityId, entity.entityTypeId);
|
|
10537
|
+
var bColor = style && ((_a = style.modelStyle) === null || _a === void 0 ? void 0 : _a.fillColor) ? Calculator.GetColor(style.modelStyle.fillColor, data, []) : null;
|
|
10538
|
+
var cColor = null;
|
|
10539
|
+
if (bColor == null) {
|
|
10540
|
+
cColor = Color.WHITE;
|
|
10370
10541
|
}
|
|
10542
|
+
else {
|
|
10543
|
+
cColor = colorToCColor$3(bColor);
|
|
10544
|
+
}
|
|
10545
|
+
CesiumEntityStyler.SetDefaultColor({
|
|
10546
|
+
color: cColor,
|
|
10547
|
+
entity: visual,
|
|
10548
|
+
viewer: this.viewer
|
|
10549
|
+
});
|
|
10371
10550
|
};
|
|
10372
10551
|
Styler.prototype.getTilesetFeatureStyle = function (entityId, entityTypeId) {
|
|
10373
10552
|
var _a, _b, _c, _d;
|
|
@@ -10521,6 +10700,13 @@ var TilesetCadRenderManager;
|
|
|
10521
10700
|
enumerable: false,
|
|
10522
10701
|
configurable: true
|
|
10523
10702
|
});
|
|
10703
|
+
Object.defineProperty(Manager.prototype, "Styler", {
|
|
10704
|
+
get: function () {
|
|
10705
|
+
return this.styler;
|
|
10706
|
+
},
|
|
10707
|
+
enumerable: false,
|
|
10708
|
+
configurable: true
|
|
10709
|
+
});
|
|
10524
10710
|
Manager.prototype.Init = function () {
|
|
10525
10711
|
var _this = this;
|
|
10526
10712
|
var _a;
|
|
@@ -12352,6 +12538,13 @@ var TilesetArbRenderManager;
|
|
|
12352
12538
|
enumerable: false,
|
|
12353
12539
|
configurable: true
|
|
12354
12540
|
});
|
|
12541
|
+
Object.defineProperty(Manager.prototype, "Styler", {
|
|
12542
|
+
get: function () {
|
|
12543
|
+
return this.styler;
|
|
12544
|
+
},
|
|
12545
|
+
enumerable: false,
|
|
12546
|
+
configurable: true
|
|
12547
|
+
});
|
|
12355
12548
|
Manager.prototype.Init = function () {
|
|
12356
12549
|
var _this = this;
|
|
12357
12550
|
var _a, _b, _c;
|
|
@@ -20354,7 +20547,7 @@ var CesiumViewMonitor;
|
|
|
20354
20547
|
CesiumViewMonitor$$1.Monitor = Monitor;
|
|
20355
20548
|
})(CesiumViewMonitor || (CesiumViewMonitor = {}));
|
|
20356
20549
|
|
|
20357
|
-
var VERSION$1 = "3.
|
|
20550
|
+
var VERSION$1 = "3.4.0";
|
|
20358
20551
|
|
|
20359
20552
|
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 };
|
|
20360
20553
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|