bruce-cesium 6.2.1 → 6.2.3
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 +404 -146
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +398 -144
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +2 -1
- package/dist/lib/bruce-cesium.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-arb-render-manager.js +144 -98
- package/dist/lib/rendering/render-managers/tilesets/tileset-arb-render-manager.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js +189 -45
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/lib/rendering/xgrids-render-engine.js +75 -0
- package/dist/lib/rendering/xgrids-render-engine.js.map +1 -0
- package/dist/types/bruce-cesium.d.ts +2 -1
- package/dist/types/rendering/render-managers/tilesets/tileset-arb-render-manager.d.ts +11 -1
- package/dist/types/rendering/visuals-register.d.ts +15 -2
- package/dist/types/rendering/xgrids-render-engine.d.ts +14 -0
- package/package.json +1 -1
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BruceEvent, Cartes, Entity as Entity$1, ProjectViewTile, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, DelayQueue, EntityLod, Bounds, ZoomControl, EntityRelationType, ENVIRONMENT, EntityHistoricData, Tileset, EntityCoords, DataLab, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, Camera, ProjectViewLegacyTile, EntityAttachment, EntityAttachmentType, EntityAttribute, AbstractApi, Session } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition,
|
|
3
|
+
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, HorizontalOrigin, VerticalOrigin, ConstantProperty, ClassificationType, ConstantPositionProperty, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileStyle, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, KmlDataSource, Quaternion, Matrix3, Matrix4, SceneTransforms, NearFarScalar, OrthographicFrustum, EasingFunction, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, IonResource, Cesium3DTileset, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
|
|
4
4
|
|
|
5
5
|
const TIME_LAG = 300;
|
|
6
6
|
const POSITION_CHECK_TIMER = 950;
|
|
@@ -11544,41 +11544,172 @@ var VisualsRegister;
|
|
|
11544
11544
|
return newStates;
|
|
11545
11545
|
}
|
|
11546
11546
|
/**
|
|
11547
|
-
*
|
|
11548
|
-
*
|
|
11547
|
+
* Calculates the difference between current states and new states.
|
|
11548
|
+
* Returns what needs to be added, removed, and updated.
|
|
11549
|
+
*/
|
|
11550
|
+
calculateStateDifference(newStates) {
|
|
11551
|
+
const toAdd = [];
|
|
11552
|
+
const toRemove = [];
|
|
11553
|
+
const toUpdate = [];
|
|
11554
|
+
const affectedEntityIds = new Set();
|
|
11555
|
+
// State map for quick lookups.
|
|
11556
|
+
const newStatesMap = new Map();
|
|
11557
|
+
for (const state of newStates) {
|
|
11558
|
+
if (!state.entityId || isBlankState(state)) {
|
|
11559
|
+
continue;
|
|
11560
|
+
}
|
|
11561
|
+
const key = `${state.entityId}::${state.menuItemId || NO_MENU_ITEM_KEY}`;
|
|
11562
|
+
newStatesMap.set(key, state);
|
|
11563
|
+
}
|
|
11564
|
+
// Track existing states.
|
|
11565
|
+
const existingKeys = new Set();
|
|
11566
|
+
// Check existing states to see if they need removal or updating.
|
|
11567
|
+
this.ForEachState((existingState) => {
|
|
11568
|
+
const key = `${existingState.entityId}::${existingState.menuItemId || NO_MENU_ITEM_KEY}`;
|
|
11569
|
+
existingKeys.add(key);
|
|
11570
|
+
const newState = newStatesMap.get(key);
|
|
11571
|
+
// State exists in current but not in new.
|
|
11572
|
+
if (!newState) {
|
|
11573
|
+
toRemove.push({ ...existingState });
|
|
11574
|
+
affectedEntityIds.add(existingState.entityId);
|
|
11575
|
+
}
|
|
11576
|
+
// State exists in both.
|
|
11577
|
+
// See if changed.
|
|
11578
|
+
else {
|
|
11579
|
+
if (this.isStateDifferent(existingState, newState)) {
|
|
11580
|
+
toUpdate.push({ ...newState });
|
|
11581
|
+
affectedEntityIds.add(existingState.entityId);
|
|
11582
|
+
}
|
|
11583
|
+
}
|
|
11584
|
+
});
|
|
11585
|
+
// Check for new states that don't exist currently.
|
|
11586
|
+
for (const [key, newState] of newStatesMap) {
|
|
11587
|
+
if (!existingKeys.has(key)) {
|
|
11588
|
+
toAdd.push({ ...newState });
|
|
11589
|
+
affectedEntityIds.add(newState.entityId);
|
|
11590
|
+
}
|
|
11591
|
+
}
|
|
11592
|
+
return { toAdd, toRemove, toUpdate, affectedEntityIds };
|
|
11593
|
+
}
|
|
11594
|
+
/**
|
|
11595
|
+
* Compares two states to determine if they're different.
|
|
11596
|
+
* Only compares meaningful properties (not entityId/menuItemId).
|
|
11597
|
+
*/
|
|
11598
|
+
isStateDifferent(state1, state2) {
|
|
11599
|
+
const keys1 = Object.keys(state1).filter(k => k !== "entityId" && k !== "menuItemId");
|
|
11600
|
+
const keys2 = Object.keys(state2).filter(k => k !== "entityId" && k !== "menuItemId");
|
|
11601
|
+
// Different number of properties.
|
|
11602
|
+
if (keys1.length !== keys2.length) {
|
|
11603
|
+
return true;
|
|
11604
|
+
}
|
|
11605
|
+
// Check if any property values differ.
|
|
11606
|
+
for (const key of keys1) {
|
|
11607
|
+
if (state1[key] !== state2[key]) {
|
|
11608
|
+
return true;
|
|
11609
|
+
}
|
|
11610
|
+
}
|
|
11611
|
+
return false;
|
|
11612
|
+
}
|
|
11613
|
+
/**
|
|
11614
|
+
* Applies a set of new states to override the existing ones using differential updates.
|
|
11615
|
+
* This is more efficient than clearing and re-applying all states.
|
|
11549
11616
|
* @param states
|
|
11550
11617
|
*/
|
|
11551
11618
|
OverrideStates(states) {
|
|
11552
|
-
//
|
|
11553
|
-
this.
|
|
11554
|
-
|
|
11555
|
-
|
|
11556
|
-
|
|
11557
|
-
|
|
11558
|
-
|
|
11559
|
-
|
|
11560
|
-
|
|
11561
|
-
|
|
11562
|
-
|
|
11563
|
-
|
|
11564
|
-
|
|
11619
|
+
// Calculate what needs to change.
|
|
11620
|
+
const diff = this.calculateStateDifference(states);
|
|
11621
|
+
// If nothing changed, exit early.
|
|
11622
|
+
if (diff.toAdd.length === 0 && diff.toRemove.length === 0 && diff.toUpdate.length === 0) {
|
|
11623
|
+
return;
|
|
11624
|
+
}
|
|
11625
|
+
// Track which visual properties need refreshing per entity.
|
|
11626
|
+
const refreshMap = new Map();
|
|
11627
|
+
const updateRefreshForEntity = (entityId, props) => {
|
|
11628
|
+
const existing = refreshMap.get(entityId) || {};
|
|
11629
|
+
refreshMap.set(entityId, {
|
|
11630
|
+
highlighted: existing.highlighted || props.highlighted || false,
|
|
11631
|
+
selected: existing.selected || props.selected || false,
|
|
11632
|
+
opacity: existing.opacity || props.opacity || false
|
|
11633
|
+
});
|
|
11634
|
+
};
|
|
11635
|
+
// Process removals.
|
|
11636
|
+
for (const state of diff.toRemove) {
|
|
11637
|
+
// Create a state with inverted/cleared values.
|
|
11638
|
+
const clearState = {
|
|
11639
|
+
entityId: state.entityId,
|
|
11640
|
+
menuItemId: state.menuItemId
|
|
11641
|
+
};
|
|
11642
|
+
// For each property that exists, set it to null to clear it.
|
|
11643
|
+
// This will cause setStateValues to delete the property.
|
|
11644
|
+
if (state.highlighted != null) {
|
|
11645
|
+
clearState.highlighted = null;
|
|
11646
|
+
updateRefreshForEntity(state.entityId, {
|
|
11647
|
+
highlighted: true
|
|
11648
|
+
});
|
|
11565
11649
|
}
|
|
11566
|
-
if (
|
|
11567
|
-
|
|
11650
|
+
if (state.selected != null) {
|
|
11651
|
+
clearState.selected = null;
|
|
11652
|
+
updateRefreshForEntity(state.entityId, {
|
|
11653
|
+
selected: true
|
|
11654
|
+
});
|
|
11568
11655
|
}
|
|
11569
|
-
if (
|
|
11570
|
-
|
|
11656
|
+
if (state.opacity != null) {
|
|
11657
|
+
clearState.opacity = null;
|
|
11658
|
+
updateRefreshForEntity(state.entityId, {
|
|
11659
|
+
opacity: true
|
|
11660
|
+
});
|
|
11571
11661
|
}
|
|
11572
|
-
if (
|
|
11573
|
-
|
|
11662
|
+
if (state.labelled != null) {
|
|
11663
|
+
clearState.labelled = null;
|
|
11664
|
+
updateRefreshForEntity(state.entityId, {});
|
|
11574
11665
|
}
|
|
11575
|
-
|
|
11576
|
-
|
|
11577
|
-
|
|
11666
|
+
if (state.hidden != null) {
|
|
11667
|
+
clearState.hidden = null;
|
|
11668
|
+
updateRefreshForEntity(state.entityId, {});
|
|
11669
|
+
}
|
|
11670
|
+
if (state.isolated != null) {
|
|
11671
|
+
clearState.isolated = null;
|
|
11672
|
+
updateRefreshForEntity(state.entityId, {});
|
|
11673
|
+
}
|
|
11674
|
+
this.setStateValues(clearState);
|
|
11675
|
+
}
|
|
11676
|
+
// Process additions and updates.
|
|
11677
|
+
const statesToSet = [...diff.toAdd, ...diff.toUpdate];
|
|
11678
|
+
for (const state of statesToSet) {
|
|
11679
|
+
// Determine what needs visual refresh based on what's changing.
|
|
11680
|
+
if (state.hasOwnProperty("highlighted")) {
|
|
11681
|
+
updateRefreshForEntity(state.entityId, {
|
|
11682
|
+
highlighted: true
|
|
11683
|
+
});
|
|
11684
|
+
}
|
|
11685
|
+
if (state.hasOwnProperty("selected")) {
|
|
11686
|
+
updateRefreshForEntity(state.entityId, {
|
|
11687
|
+
selected: true
|
|
11688
|
+
});
|
|
11689
|
+
}
|
|
11690
|
+
if (state.hasOwnProperty("opacity")) {
|
|
11691
|
+
updateRefreshForEntity(state.entityId, {
|
|
11692
|
+
opacity: true
|
|
11693
|
+
});
|
|
11694
|
+
}
|
|
11695
|
+
if (state.hasOwnProperty("labelled")) {
|
|
11696
|
+
updateRefreshForEntity(state.entityId, {});
|
|
11697
|
+
}
|
|
11698
|
+
if (state.hasOwnProperty("hidden") || state.hasOwnProperty("isolated")) {
|
|
11699
|
+
updateRefreshForEntity(state.entityId, {});
|
|
11700
|
+
}
|
|
11701
|
+
this.setStateValues(state);
|
|
11702
|
+
}
|
|
11703
|
+
// Queue updates for all affected entities.
|
|
11704
|
+
// TODO: if a massive list we should async batch this.
|
|
11705
|
+
for (const entityId of diff.affectedEntityIds) {
|
|
11706
|
+
const refresh = refreshMap.get(entityId);
|
|
11707
|
+
this.queueUpdate({
|
|
11708
|
+
entityId: entityId,
|
|
11709
|
+
refresh: refresh || true
|
|
11710
|
+
});
|
|
11578
11711
|
}
|
|
11579
|
-
this.
|
|
11580
|
-
// Reflect the rest of the changes.
|
|
11581
|
-
this.updateAllEntities();
|
|
11712
|
+
this.viewer.scene.requestRender();
|
|
11582
11713
|
}
|
|
11583
11714
|
/**
|
|
11584
11715
|
* Returns all states with the first detected Menu Item ID settings included.
|
|
@@ -12026,7 +12157,7 @@ var VisualsRegister;
|
|
|
12026
12157
|
}
|
|
12027
12158
|
SetIsolated(params) {
|
|
12028
12159
|
var _a;
|
|
12029
|
-
const { entityIds, isolated: isolate, requestRender, menuItemId, source } = params;
|
|
12160
|
+
const { entityIds, isolated: isolate, requestRender, menuItemId, source, doUpdate } = params;
|
|
12030
12161
|
for (let i = 0; i < entityIds.length; i++) {
|
|
12031
12162
|
const entityId = entityIds[i];
|
|
12032
12163
|
this.setStateValues({
|
|
@@ -12047,12 +12178,14 @@ var VisualsRegister;
|
|
|
12047
12178
|
(_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(update);
|
|
12048
12179
|
}
|
|
12049
12180
|
}
|
|
12050
|
-
|
|
12051
|
-
|
|
12052
|
-
|
|
12053
|
-
|
|
12054
|
-
|
|
12055
|
-
|
|
12181
|
+
if (doUpdate !== false) {
|
|
12182
|
+
this.updateAllEntities({
|
|
12183
|
+
requestRender: false,
|
|
12184
|
+
refresh: isolate
|
|
12185
|
+
});
|
|
12186
|
+
if (requestRender != false) {
|
|
12187
|
+
this.viewer.scene.requestRender();
|
|
12188
|
+
}
|
|
12056
12189
|
}
|
|
12057
12190
|
}
|
|
12058
12191
|
GetIsIsolated(params) {
|
|
@@ -12088,7 +12221,7 @@ var VisualsRegister;
|
|
|
12088
12221
|
}
|
|
12089
12222
|
delete state.isolated;
|
|
12090
12223
|
});
|
|
12091
|
-
if (changed) {
|
|
12224
|
+
if (changed && params.doUpdate !== false) {
|
|
12092
12225
|
this.updateAllEntities({
|
|
12093
12226
|
requestRender: params === null || params === void 0 ? void 0 : params.requestRender,
|
|
12094
12227
|
refresh: true
|
|
@@ -12142,7 +12275,7 @@ var VisualsRegister;
|
|
|
12142
12275
|
}
|
|
12143
12276
|
delete state.hidden;
|
|
12144
12277
|
});
|
|
12145
|
-
if (changed) {
|
|
12278
|
+
if (changed && params.doUpdate !== false) {
|
|
12146
12279
|
this.updateAllEntities({
|
|
12147
12280
|
requestRender: params === null || params === void 0 ? void 0 : params.requestRender,
|
|
12148
12281
|
refresh: true
|
|
@@ -12536,16 +12669,27 @@ var VisualsRegister;
|
|
|
12536
12669
|
}
|
|
12537
12670
|
}
|
|
12538
12671
|
}
|
|
12539
|
-
updateAllEntities(params) {
|
|
12540
|
-
|
|
12541
|
-
|
|
12542
|
-
|
|
12543
|
-
|
|
12544
|
-
|
|
12545
|
-
|
|
12546
|
-
});
|
|
12672
|
+
async updateAllEntities(params) {
|
|
12673
|
+
const ids = Object.keys(this.rego);
|
|
12674
|
+
const interval = setInterval(() => {
|
|
12675
|
+
const batch = ids.splice(0, 3000);
|
|
12676
|
+
if (!batch.length || (params.isCancelled && params.isCancelled())) {
|
|
12677
|
+
clearInterval(interval);
|
|
12678
|
+
return;
|
|
12547
12679
|
}
|
|
12548
|
-
|
|
12680
|
+
for (const entityId of batch) {
|
|
12681
|
+
const regos = this.rego[entityId];
|
|
12682
|
+
if (regos && regos.length) {
|
|
12683
|
+
this.queueUpdate({
|
|
12684
|
+
entityId: entityId,
|
|
12685
|
+
refresh: (params === null || params === void 0 ? void 0 : params.refresh) == null ? true : params.refresh
|
|
12686
|
+
});
|
|
12687
|
+
}
|
|
12688
|
+
}
|
|
12689
|
+
if ((params === null || params === void 0 ? void 0 : params.requestRender) !== false) {
|
|
12690
|
+
this.viewer.scene.requestRender();
|
|
12691
|
+
}
|
|
12692
|
+
}, 10);
|
|
12549
12693
|
}
|
|
12550
12694
|
/**
|
|
12551
12695
|
* Sets opacity for given set of entities.
|
|
@@ -20826,6 +20970,75 @@ var DataSourceStaticKmlManager;
|
|
|
20826
20970
|
DataSourceStaticKmlManager.Manager = Manager;
|
|
20827
20971
|
})(DataSourceStaticKmlManager || (DataSourceStaticKmlManager = {}));
|
|
20828
20972
|
|
|
20973
|
+
/**
|
|
20974
|
+
* Render engine to handle LCC / XGrids data through the XGrids library.
|
|
20975
|
+
*/
|
|
20976
|
+
var XGridsRenderEngine;
|
|
20977
|
+
(function (XGridsRenderEngine) {
|
|
20978
|
+
function Render(params) {
|
|
20979
|
+
var _a, _b, _c;
|
|
20980
|
+
const { api, viewer, tileset } = params;
|
|
20981
|
+
if (!LCCRender) {
|
|
20982
|
+
console.warn("[XGridsRenderEngine] Render() LCCRender library not available.");
|
|
20983
|
+
return null;
|
|
20984
|
+
}
|
|
20985
|
+
const settings = tileset.settings;
|
|
20986
|
+
let position = settings === null || settings === void 0 ? void 0 : settings.origin;
|
|
20987
|
+
if (settings.dontTransform) {
|
|
20988
|
+
position = null;
|
|
20989
|
+
}
|
|
20990
|
+
let m1 = undefined;
|
|
20991
|
+
// Location matrix.
|
|
20992
|
+
if ((position === null || position === void 0 ? void 0 : position.latitude) || (position === null || position === void 0 ? void 0 : position.longitude) || (position === null || position === void 0 ? void 0 : position.altitude)) {
|
|
20993
|
+
m1 = Transforms.eastNorthUpToFixedFrame(Cartesian3.fromDegrees(EnsureNumber(position.longitude, 0), EnsureNumber(position.latitude, 0), EnsureNumber(position.altitude, 0)));
|
|
20994
|
+
}
|
|
20995
|
+
else {
|
|
20996
|
+
m1 = Transforms.eastNorthUpToFixedFrame(Cartesian3.fromDegrees(0, 0, 0));
|
|
20997
|
+
}
|
|
20998
|
+
// Apply HPR + scale.
|
|
20999
|
+
if (!settings.dontRotate && !settings.dontTransform) {
|
|
21000
|
+
const translationMatrix = Matrix4.fromTranslation(new Cartesian3(0, 0, 0), new Matrix4());
|
|
21001
|
+
const hpr = HeadingPitchRoll.fromDegrees(EnsureNumber((_a = settings.rotation) === null || _a === void 0 ? void 0 : _a.z), EnsureNumber((_b = settings.rotation) === null || _b === void 0 ? void 0 : _b.x), EnsureNumber((_c = settings.rotation) === null || _c === void 0 ? void 0 : _c.y), new HeadingPitchRoll());
|
|
21002
|
+
const hprRotation = Matrix3.fromHeadingPitchRoll(hpr);
|
|
21003
|
+
const scaleMatrix = Matrix4.fromUniformScale(EnsureNumber((position === null || position === void 0 ? void 0 : position.scale) || 1, 1), new Matrix4());
|
|
21004
|
+
let combinedMatrix = Matrix4.multiply(m1, translationMatrix, new Matrix4());
|
|
21005
|
+
combinedMatrix = Matrix4.multiply(combinedMatrix, Matrix4.fromRotation(hprRotation), new Matrix4());
|
|
21006
|
+
combinedMatrix = Matrix4.multiply(combinedMatrix, scaleMatrix, new Matrix4());
|
|
21007
|
+
m1 = combinedMatrix;
|
|
21008
|
+
}
|
|
21009
|
+
const loadUrl = Tileset.GetFileUrl({
|
|
21010
|
+
file: tileset.rootFileName || "meta.lcc",
|
|
21011
|
+
tilesetId: tileset.id,
|
|
21012
|
+
viaCdn: true,
|
|
21013
|
+
legacy: true,
|
|
21014
|
+
cacheToken: tileset.generateVersion,
|
|
21015
|
+
api: api
|
|
21016
|
+
});
|
|
21017
|
+
return window.LCCRender.load({
|
|
21018
|
+
camera: viewer.camera,
|
|
21019
|
+
scene: viewer.scene,
|
|
21020
|
+
dataPath: loadUrl,
|
|
21021
|
+
renderLib: Cesium,
|
|
21022
|
+
canvas: viewer.canvas,
|
|
21023
|
+
useEnv: false,
|
|
21024
|
+
modelMatrix: m1,
|
|
21025
|
+
useIndexDB: false,
|
|
21026
|
+
appKey: null
|
|
21027
|
+
});
|
|
21028
|
+
}
|
|
21029
|
+
XGridsRenderEngine.Render = Render;
|
|
21030
|
+
function Remove(viewer, renderObject) {
|
|
21031
|
+
if (!renderObject) {
|
|
21032
|
+
return;
|
|
21033
|
+
}
|
|
21034
|
+
if (!LCCRender) {
|
|
21035
|
+
console.warn("[XGridsRenderEngine] Remove() LCCRender library not available.");
|
|
21036
|
+
return;
|
|
21037
|
+
}
|
|
21038
|
+
}
|
|
21039
|
+
XGridsRenderEngine.Remove = Remove;
|
|
21040
|
+
})(XGridsRenderEngine || (XGridsRenderEngine = {}));
|
|
21041
|
+
|
|
20829
21042
|
async function getLegacyTileset(params) {
|
|
20830
21043
|
const { apiGetter, menuItem, tileset } = params;
|
|
20831
21044
|
try {
|
|
@@ -20860,6 +21073,12 @@ async function getTileset(params) {
|
|
|
20860
21073
|
}
|
|
20861
21074
|
var TilesetArbRenderManager;
|
|
20862
21075
|
(function (TilesetArbRenderManager) {
|
|
21076
|
+
let ERenderType;
|
|
21077
|
+
(function (ERenderType) {
|
|
21078
|
+
ERenderType["CesiumTileset"] = "CesiumTileset";
|
|
21079
|
+
ERenderType["XGridsLCC"] = "XGridsLCC";
|
|
21080
|
+
ERenderType["Unknown"] = "Unknown";
|
|
21081
|
+
})(ERenderType = TilesetArbRenderManager.ERenderType || (TilesetArbRenderManager.ERenderType = {}));
|
|
20863
21082
|
class Manager {
|
|
20864
21083
|
get Disposed() {
|
|
20865
21084
|
return this.disposed;
|
|
@@ -20870,6 +21089,12 @@ var TilesetArbRenderManager;
|
|
|
20870
21089
|
get Styler() {
|
|
20871
21090
|
return this.styler;
|
|
20872
21091
|
}
|
|
21092
|
+
get RenderType() {
|
|
21093
|
+
return this.renderType;
|
|
21094
|
+
}
|
|
21095
|
+
get RenderTypeChanged() {
|
|
21096
|
+
return this.renderTypeChanged;
|
|
21097
|
+
}
|
|
20873
21098
|
constructor(params) {
|
|
20874
21099
|
this.disposed = false;
|
|
20875
21100
|
this.cTileset = null;
|
|
@@ -20893,6 +21118,11 @@ var TilesetArbRenderManager;
|
|
|
20893
21118
|
// Saves having to do a case-insensitive lookup every time.
|
|
20894
21119
|
this.featurePropCache = new Map();
|
|
20895
21120
|
this.featurePropsChecked = 0;
|
|
21121
|
+
// How we're rendering the data.
|
|
21122
|
+
this.renderType = ERenderType.Unknown;
|
|
21123
|
+
this.renderTypeChanged = new BruceEvent();
|
|
21124
|
+
// LCC object if we're using XGrids to render LCC data.
|
|
21125
|
+
this.lccObject = null;
|
|
20896
21126
|
this.viewer = params.viewer;
|
|
20897
21127
|
this.getters = params.getters;
|
|
20898
21128
|
this.visualsManager = params.register;
|
|
@@ -20938,7 +21168,7 @@ var TilesetArbRenderManager;
|
|
|
20938
21168
|
}
|
|
20939
21169
|
const tilesetId = (_c = this.item.tileset) === null || _c === void 0 ? void 0 : _c.TilesetID;
|
|
20940
21170
|
(async () => {
|
|
20941
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
21171
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
20942
21172
|
if (tilesetId) {
|
|
20943
21173
|
let canAccess = false;
|
|
20944
21174
|
try {
|
|
@@ -20977,113 +21207,137 @@ var TilesetArbRenderManager;
|
|
|
20977
21207
|
if (tileset && loadUrlOverride) {
|
|
20978
21208
|
tileset.loadUrl = loadUrlOverride;
|
|
20979
21209
|
}
|
|
20980
|
-
|
|
20981
|
-
|
|
20982
|
-
|
|
20983
|
-
|
|
20984
|
-
|
|
20985
|
-
|
|
20986
|
-
// Legacy type. We re-request using ui.tileset endpoint.
|
|
20987
|
-
const legacyTileset = tileset ? await getLegacyTileset({
|
|
20988
|
-
apiGetter: this.getters.GetBruceGetter(),
|
|
20989
|
-
menuItem: this.item,
|
|
20990
|
-
tileset
|
|
20991
|
-
}) : null;
|
|
20992
|
-
if (this.disposed) {
|
|
20993
|
-
return;
|
|
20994
|
-
}
|
|
20995
|
-
let accountId = (_c = (_b = this.item) === null || _b === void 0 ? void 0 : _b.tileset) === null || _c === void 0 ? void 0 : _c.ClientAccountID;
|
|
20996
|
-
if (!accountId) {
|
|
20997
|
-
accountId = this.getters.GetAccountId();
|
|
20998
|
-
}
|
|
20999
|
-
this.cTileset = await TilesetRenderEngine.RenderLegacy({
|
|
21000
|
-
apiGetter: this.getters.GetBruceGetter(),
|
|
21001
|
-
tileset: legacyTileset,
|
|
21002
|
-
viewer: this.viewer,
|
|
21003
|
-
ionId: (_d = this.item.IonResource) === null || _d === void 0 ? void 0 : _d.AssetID,
|
|
21004
|
-
ionAccessToken: (_e = this.item.IonResource) === null || _e === void 0 ? void 0 : _e.AccessToken,
|
|
21005
|
-
loadUrl: loadUrlOverride,
|
|
21006
|
-
accountId: accountId,
|
|
21007
|
-
viaCdn: this.item.cdnEnabled == null ? true : Boolean(this.item.cdnEnabled),
|
|
21008
|
-
noMemoryLimit: this.item.noMaximumMemory,
|
|
21009
|
-
backFaceCulling: this.item.backFaceCulling
|
|
21210
|
+
// LCC Tileset to load through XGrids libs if they're available.
|
|
21211
|
+
if (tileset.type === Tileset.EType.LegacyStatic && tileset.rootFileName && (tileset.rootFileName.toLowerCase()).endsWith(".lcc")) {
|
|
21212
|
+
this.renderType = ERenderType.XGridsLCC;
|
|
21213
|
+
this.renderTypeChanged.Trigger(this.renderType);
|
|
21214
|
+
const api = this.getters.GetBruceApi({
|
|
21215
|
+
accountId: ((_c = (_b = this.item) === null || _b === void 0 ? void 0 : _b.tileset) === null || _c === void 0 ? void 0 : _c.ClientAccountID) || this.getters.GetAccountId()
|
|
21010
21216
|
});
|
|
21011
|
-
|
|
21012
|
-
|
|
21013
|
-
this.cTileset = await TilesetRenderEngine.Render({
|
|
21014
|
-
apiGetter: this.getters.GetBruceGetter(),
|
|
21015
|
-
tileset: tileset,
|
|
21217
|
+
this.lccObject = XGridsRenderEngine.Render({
|
|
21218
|
+
api: api,
|
|
21016
21219
|
viewer: this.viewer,
|
|
21017
|
-
|
|
21018
|
-
accountId: (_g = (_f = this.item.tileset) === null || _f === void 0 ? void 0 : _f.ClientAccountID) !== null && _g !== void 0 ? _g : this.getters.GetAccountId(),
|
|
21019
|
-
viaCdn: this.item.cdnEnabled == null ? true : Boolean(this.item.cdnEnabled)
|
|
21220
|
+
tileset: tileset
|
|
21020
21221
|
});
|
|
21021
|
-
|
|
21022
|
-
|
|
21023
|
-
|
|
21024
|
-
|
|
21025
|
-
}
|
|
21026
|
-
this.viewer.scene.requestRender();
|
|
21027
|
-
TilesetRenderEngine.OnTilesetReady(this.cTileset).then(() => {
|
|
21028
|
-
if (this.disposed || this.viewer.isDestroyed()) {
|
|
21222
|
+
// Disposed while it was loading so we'll remove it now.
|
|
21223
|
+
if (this.Disposed && this.lccObject) {
|
|
21224
|
+
XGridsRenderEngine.Remove(this.viewer, this.lccObject);
|
|
21225
|
+
this.lccObject = null;
|
|
21029
21226
|
return;
|
|
21030
21227
|
}
|
|
21031
|
-
|
|
21032
|
-
|
|
21033
|
-
|
|
21034
|
-
|
|
21035
|
-
|
|
21036
|
-
|
|
21037
|
-
|
|
21038
|
-
|
|
21039
|
-
|
|
21040
|
-
|
|
21041
|
-
|
|
21042
|
-
|
|
21043
|
-
|
|
21228
|
+
}
|
|
21229
|
+
// Typical Cesium Tileset.
|
|
21230
|
+
else {
|
|
21231
|
+
this.renderType = ERenderType.CesiumTileset;
|
|
21232
|
+
this.renderTypeChanged.Trigger(this.renderType);
|
|
21233
|
+
const LEGACY_TYPES = [
|
|
21234
|
+
Tileset.EType.LegacyEntitiesSet,
|
|
21235
|
+
Tileset.EType.LegacyExternal,
|
|
21236
|
+
Tileset.EType.LegacyStatic
|
|
21237
|
+
];
|
|
21238
|
+
if (!type || LEGACY_TYPES.includes(type)) {
|
|
21239
|
+
// Legacy type. We re-request using ui.tileset endpoint.
|
|
21240
|
+
const legacyTileset = tileset ? await getLegacyTileset({
|
|
21241
|
+
apiGetter: this.getters.GetBruceGetter(),
|
|
21242
|
+
menuItem: this.item,
|
|
21243
|
+
tileset
|
|
21244
|
+
}) : null;
|
|
21245
|
+
if (this.disposed) {
|
|
21246
|
+
return;
|
|
21044
21247
|
}
|
|
21045
|
-
|
|
21046
|
-
|
|
21047
|
-
|
|
21048
|
-
}
|
|
21049
|
-
try {
|
|
21050
|
-
if (this.item.ApplyStyles ||
|
|
21051
|
-
this.item.Type == MenuItem.EType.IonTileset) {
|
|
21052
|
-
const api = this.getters.GetBruceApi();
|
|
21053
|
-
this.styler.Init({
|
|
21054
|
-
viewer: this.viewer,
|
|
21055
|
-
api: api,
|
|
21056
|
-
cTileset: this.cTileset,
|
|
21057
|
-
fallbackStyleId: this.item.styleId,
|
|
21058
|
-
styleMapping: this.item.StyleMapping,
|
|
21059
|
-
expandSources: false,
|
|
21060
|
-
menuItemId: this.item.id,
|
|
21061
|
-
register: this.visualsManager,
|
|
21062
|
-
});
|
|
21248
|
+
let accountId = (_e = (_d = this.item) === null || _d === void 0 ? void 0 : _d.tileset) === null || _e === void 0 ? void 0 : _e.ClientAccountID;
|
|
21249
|
+
if (!accountId) {
|
|
21250
|
+
accountId = this.getters.GetAccountId();
|
|
21063
21251
|
}
|
|
21064
|
-
this.
|
|
21065
|
-
|
|
21066
|
-
|
|
21067
|
-
|
|
21068
|
-
|
|
21069
|
-
|
|
21070
|
-
|
|
21071
|
-
|
|
21072
|
-
|
|
21073
|
-
|
|
21074
|
-
|
|
21075
|
-
|
|
21076
|
-
console.error(e);
|
|
21252
|
+
this.cTileset = await TilesetRenderEngine.RenderLegacy({
|
|
21253
|
+
apiGetter: this.getters.GetBruceGetter(),
|
|
21254
|
+
tileset: legacyTileset,
|
|
21255
|
+
viewer: this.viewer,
|
|
21256
|
+
ionId: (_f = this.item.IonResource) === null || _f === void 0 ? void 0 : _f.AssetID,
|
|
21257
|
+
ionAccessToken: (_g = this.item.IonResource) === null || _g === void 0 ? void 0 : _g.AccessToken,
|
|
21258
|
+
loadUrl: loadUrlOverride,
|
|
21259
|
+
accountId: accountId,
|
|
21260
|
+
viaCdn: this.item.cdnEnabled == null ? true : Boolean(this.item.cdnEnabled),
|
|
21261
|
+
noMemoryLimit: this.item.noMaximumMemory,
|
|
21262
|
+
backFaceCulling: this.item.backFaceCulling
|
|
21263
|
+
});
|
|
21077
21264
|
}
|
|
21078
|
-
|
|
21079
|
-
|
|
21080
|
-
|
|
21081
|
-
|
|
21265
|
+
else if (tileset) {
|
|
21266
|
+
this.cTileset = await TilesetRenderEngine.Render({
|
|
21267
|
+
apiGetter: this.getters.GetBruceGetter(),
|
|
21268
|
+
tileset: tileset,
|
|
21269
|
+
viewer: this.viewer,
|
|
21270
|
+
coords: null,
|
|
21271
|
+
accountId: (_j = (_h = this.item.tileset) === null || _h === void 0 ? void 0 : _h.ClientAccountID) !== null && _j !== void 0 ? _j : this.getters.GetAccountId(),
|
|
21272
|
+
viaCdn: this.item.cdnEnabled == null ? true : Boolean(this.item.cdnEnabled)
|
|
21273
|
+
});
|
|
21082
21274
|
}
|
|
21083
|
-
|
|
21084
|
-
|
|
21275
|
+
if (this.disposed) {
|
|
21276
|
+
this.doDispose();
|
|
21277
|
+
return;
|
|
21085
21278
|
}
|
|
21086
|
-
|
|
21279
|
+
this.viewer.scene.requestRender();
|
|
21280
|
+
TilesetRenderEngine.OnTilesetReady(this.cTileset).then(() => {
|
|
21281
|
+
if (this.disposed || this.viewer.isDestroyed()) {
|
|
21282
|
+
return;
|
|
21283
|
+
}
|
|
21284
|
+
// Colour mask to apply to the Tileset as a whole.
|
|
21285
|
+
// Individual Entities can override this.
|
|
21286
|
+
// This is typically used for Tilesets without Entities to allow some sort of basic styling per-bookmark.
|
|
21287
|
+
try {
|
|
21288
|
+
const colorCss = this.item.colorMask;
|
|
21289
|
+
if (colorCss) {
|
|
21290
|
+
this.cTileset.style = new Cesium3DTileStyle({
|
|
21291
|
+
color: {
|
|
21292
|
+
conditions: [
|
|
21293
|
+
["true", `color("${colorCss}")`]
|
|
21294
|
+
]
|
|
21295
|
+
}
|
|
21296
|
+
});
|
|
21297
|
+
}
|
|
21298
|
+
}
|
|
21299
|
+
catch (e) {
|
|
21300
|
+
console.error(e);
|
|
21301
|
+
}
|
|
21302
|
+
try {
|
|
21303
|
+
if (this.item.ApplyStyles ||
|
|
21304
|
+
this.item.Type == MenuItem.EType.IonTileset) {
|
|
21305
|
+
const api = this.getters.GetBruceApi();
|
|
21306
|
+
this.styler.Init({
|
|
21307
|
+
viewer: this.viewer,
|
|
21308
|
+
api: api,
|
|
21309
|
+
cTileset: this.cTileset,
|
|
21310
|
+
fallbackStyleId: this.item.styleId,
|
|
21311
|
+
styleMapping: this.item.StyleMapping,
|
|
21312
|
+
expandSources: false,
|
|
21313
|
+
menuItemId: this.item.id,
|
|
21314
|
+
register: this.visualsManager,
|
|
21315
|
+
});
|
|
21316
|
+
}
|
|
21317
|
+
this.onCTilesetLoad();
|
|
21318
|
+
this.viewer.scene.requestRender();
|
|
21319
|
+
}
|
|
21320
|
+
catch (e) {
|
|
21321
|
+
console.error(e);
|
|
21322
|
+
}
|
|
21323
|
+
});
|
|
21324
|
+
this.cTileset.tileLoad.addEventListener((tile) => {
|
|
21325
|
+
try {
|
|
21326
|
+
this.queueTile(tile, true);
|
|
21327
|
+
}
|
|
21328
|
+
catch (e) {
|
|
21329
|
+
console.error(e);
|
|
21330
|
+
}
|
|
21331
|
+
});
|
|
21332
|
+
this.cTileset.tileUnload.addEventListener((tile) => {
|
|
21333
|
+
try {
|
|
21334
|
+
this.queueTile(tile, false);
|
|
21335
|
+
}
|
|
21336
|
+
catch (e) {
|
|
21337
|
+
console.error(e);
|
|
21338
|
+
}
|
|
21339
|
+
});
|
|
21340
|
+
}
|
|
21087
21341
|
})();
|
|
21088
21342
|
}
|
|
21089
21343
|
/**
|
|
@@ -21227,6 +21481,10 @@ var TilesetArbRenderManager;
|
|
|
21227
21481
|
}
|
|
21228
21482
|
this.cTileset = null;
|
|
21229
21483
|
}
|
|
21484
|
+
if (this.lccObject) {
|
|
21485
|
+
XGridsRenderEngine.Remove(this.viewer, this.lccObject);
|
|
21486
|
+
this.lccObject = null;
|
|
21487
|
+
}
|
|
21230
21488
|
(_b = this.styler) === null || _b === void 0 ? void 0 : _b.Dispose();
|
|
21231
21489
|
this.visualsManager.RemoveRegos({
|
|
21232
21490
|
menuItemId: this.item.id
|
|
@@ -34322,7 +34580,7 @@ class WidgetViewBar extends Widget.AWidget {
|
|
|
34322
34580
|
}
|
|
34323
34581
|
}
|
|
34324
34582
|
|
|
34325
|
-
const VERSION = "6.2.
|
|
34583
|
+
const VERSION = "6.2.3";
|
|
34326
34584
|
|
|
34327
|
-
export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, isOutlineChanged, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, DataLabRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, AssemblyRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, LiveCursor, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, CESIUM_TIMELINE_LIVE_KEY, CESIUM_TIMELINE_LIVE_PADDING_KEY, CESIUM_TIMELINE_INTERVAL_KEY, CESIUM_MODEL_SPACE_KEY, DEFAULT_LIVE_PADDING_SECONDS, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Walkthrough, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar, WidgetControlViewBar, WidgetControlViewBarSearch, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks };
|
|
34585
|
+
export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, isOutlineChanged, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, DataLabRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, AssemblyRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, LiveCursor, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, XGridsRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, CESIUM_TIMELINE_LIVE_KEY, CESIUM_TIMELINE_LIVE_PADDING_KEY, CESIUM_TIMELINE_INTERVAL_KEY, CESIUM_MODEL_SPACE_KEY, DEFAULT_LIVE_PADDING_SECONDS, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Walkthrough, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar, WidgetControlViewBar, WidgetControlViewBarSearch, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks };
|
|
34328
34586
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|