bruce-cesium 3.3.8 → 3.3.9
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 +232 -40
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +231 -39
- 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 +83 -20
- 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, JulianDate, DistanceDisplayCondition, NearFarScalar, Model,
|
|
3
|
+
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, Entity, Primitive, Cesium3DTileFeature, JulianDate, DistanceDisplayCondition, NearFarScalar, Model, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, SceneMode, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, Cesium3DTileStyle, GeoJsonDataSource, ColorMaterialProperty, KmlDataSource, SceneTransforms, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, CesiumInspector, OrthographicFrustum, defined, PolygonPipeline, BoundingSphere, Matrix3, Matrix4, EasingFunction, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, Cesium3DTileset, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, 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, 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 = [];
|
|
@@ -10182,12 +10343,12 @@ var TilesetRenderEngine;
|
|
|
10182
10343
|
i = 0;
|
|
10183
10344
|
_c.label = 5;
|
|
10184
10345
|
case 5:
|
|
10185
|
-
if (!(i < styleMapping.length)) return [3 /*break*/,
|
|
10346
|
+
if (!(i < styleMapping.length)) return [3 /*break*/, 16];
|
|
10186
10347
|
if (this.disposed) {
|
|
10187
|
-
return [3 /*break*/,
|
|
10348
|
+
return [3 /*break*/, 16];
|
|
10188
10349
|
}
|
|
10189
10350
|
styleMap = styleMapping[i];
|
|
10190
|
-
if (!(!styleMap.style && styleMap.StyleID != -1)) return [3 /*break*/,
|
|
10351
|
+
if (!(!styleMap.style && styleMap.StyleID != -1)) return [3 /*break*/, 14];
|
|
10191
10352
|
styleId = styleMap.StyleID;
|
|
10192
10353
|
if (!!styleId) return [3 /*break*/, 9];
|
|
10193
10354
|
_c.label = 6;
|
|
@@ -10226,22 +10387,33 @@ var TilesetRenderEngine;
|
|
|
10226
10387
|
console.error(e_3);
|
|
10227
10388
|
return [3 /*break*/, 13];
|
|
10228
10389
|
case 13:
|
|
10390
|
+
if (this.loadingCounter != counter) {
|
|
10391
|
+
return [2 /*return*/];
|
|
10392
|
+
}
|
|
10393
|
+
_c.label = 14;
|
|
10394
|
+
case 14:
|
|
10229
10395
|
this.styleMappingsLoaded[styleMap.EntityTypeID] = true;
|
|
10230
10396
|
this.processTilesetFeatureCheckQueue();
|
|
10231
10397
|
this.processQueue();
|
|
10232
|
-
_c.label =
|
|
10233
|
-
case
|
|
10398
|
+
_c.label = 15;
|
|
10399
|
+
case 15:
|
|
10234
10400
|
i++;
|
|
10235
10401
|
return [3 /*break*/, 5];
|
|
10236
|
-
case
|
|
10402
|
+
case 16:
|
|
10403
|
+
if (this.loadingCounter != counter) {
|
|
10404
|
+
return [2 /*return*/];
|
|
10405
|
+
}
|
|
10237
10406
|
this.styleMappingLoaded = true;
|
|
10238
|
-
if (!!this.disposed) return [3 /*break*/,
|
|
10407
|
+
if (!!this.disposed) return [3 /*break*/, 18];
|
|
10239
10408
|
return [4 /*yield*/, this.processTilesetFeatureCheckQueue()];
|
|
10240
|
-
case
|
|
10409
|
+
case 17:
|
|
10241
10410
|
_c.sent();
|
|
10411
|
+
if (this.loadingCounter != counter) {
|
|
10412
|
+
return [2 /*return*/];
|
|
10413
|
+
}
|
|
10242
10414
|
this.processQueue();
|
|
10243
|
-
_c.label =
|
|
10244
|
-
case
|
|
10415
|
+
_c.label = 18;
|
|
10416
|
+
case 18: return [2 /*return*/];
|
|
10245
10417
|
}
|
|
10246
10418
|
});
|
|
10247
10419
|
});
|
|
@@ -10356,18 +10528,24 @@ var TilesetRenderEngine;
|
|
|
10356
10528
|
};
|
|
10357
10529
|
Styler.prototype.styleTilesetFeatureFullData = function (entity, data) {
|
|
10358
10530
|
var _a;
|
|
10359
|
-
var
|
|
10360
|
-
if (!
|
|
10531
|
+
var visual = entity.visual;
|
|
10532
|
+
if (!visual || !(visual instanceof Cesium3DTileFeature)) {
|
|
10361
10533
|
return;
|
|
10362
10534
|
}
|
|
10363
|
-
var
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
|
|
10367
|
-
|
|
10368
|
-
visual.color = cColor;
|
|
10369
|
-
}
|
|
10535
|
+
var style = this.getTilesetFeatureStyle(entity.entityId, entity.entityTypeId);
|
|
10536
|
+
var bColor = style && ((_a = style.modelStyle) === null || _a === void 0 ? void 0 : _a.fillColor) ? Calculator.GetColor(style.modelStyle.fillColor, data, []) : null;
|
|
10537
|
+
var cColor = null;
|
|
10538
|
+
if (bColor == null) {
|
|
10539
|
+
cColor = Color.WHITE;
|
|
10370
10540
|
}
|
|
10541
|
+
else {
|
|
10542
|
+
cColor = colorToCColor$3(bColor);
|
|
10543
|
+
}
|
|
10544
|
+
CesiumEntityStyler.SetDefaultColor({
|
|
10545
|
+
color: cColor,
|
|
10546
|
+
entity: visual,
|
|
10547
|
+
viewer: this.viewer
|
|
10548
|
+
});
|
|
10371
10549
|
};
|
|
10372
10550
|
Styler.prototype.getTilesetFeatureStyle = function (entityId, entityTypeId) {
|
|
10373
10551
|
var _a, _b, _c, _d;
|
|
@@ -10521,6 +10699,13 @@ var TilesetCadRenderManager;
|
|
|
10521
10699
|
enumerable: false,
|
|
10522
10700
|
configurable: true
|
|
10523
10701
|
});
|
|
10702
|
+
Object.defineProperty(Manager.prototype, "Styler", {
|
|
10703
|
+
get: function () {
|
|
10704
|
+
return this.styler;
|
|
10705
|
+
},
|
|
10706
|
+
enumerable: false,
|
|
10707
|
+
configurable: true
|
|
10708
|
+
});
|
|
10524
10709
|
Manager.prototype.Init = function () {
|
|
10525
10710
|
var _this = this;
|
|
10526
10711
|
var _a;
|
|
@@ -12352,6 +12537,13 @@ var TilesetArbRenderManager;
|
|
|
12352
12537
|
enumerable: false,
|
|
12353
12538
|
configurable: true
|
|
12354
12539
|
});
|
|
12540
|
+
Object.defineProperty(Manager.prototype, "Styler", {
|
|
12541
|
+
get: function () {
|
|
12542
|
+
return this.styler;
|
|
12543
|
+
},
|
|
12544
|
+
enumerable: false,
|
|
12545
|
+
configurable: true
|
|
12546
|
+
});
|
|
12355
12547
|
Manager.prototype.Init = function () {
|
|
12356
12548
|
var _this = this;
|
|
12357
12549
|
var _a, _b, _c;
|
|
@@ -20354,7 +20546,7 @@ var CesiumViewMonitor;
|
|
|
20354
20546
|
CesiumViewMonitor$$1.Monitor = Monitor;
|
|
20355
20547
|
})(CesiumViewMonitor || (CesiumViewMonitor = {}));
|
|
20356
20548
|
|
|
20357
|
-
var VERSION$1 = "3.3.
|
|
20549
|
+
var VERSION$1 = "3.3.9";
|
|
20358
20550
|
|
|
20359
20551
|
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
20552
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|