bruce-cesium 5.8.0 → 5.8.2
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 +101 -35
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +100 -34
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/visuals-register.js +99 -33
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/visuals-register.d.ts +12 -2
- 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, ClassificationType, ArcType, CornerType, ShadowMode, ConstantProperty, ConstantPositionProperty, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, HorizontalOrigin, VerticalOrigin, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileStyle, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, KmlDataSource, Quaternion, Matrix3, Matrix4, SceneTransforms, EllipsoidTerrainProvider, CesiumInspector, OrthographicFrustum, defined, ClockRange, EasingFunction, NearFarScalar, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, IonResource, Cesium3DTileset, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, ScreenSpaceEventHandler, ScreenSpaceEventType, BoundingSphere, GeometryInstance, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
|
|
4
4
|
|
|
5
5
|
const TIME_LAG = 300;
|
|
6
6
|
const POSITION_CHECK_TIMER = 950;
|
|
@@ -10902,7 +10902,7 @@ var VisualsRegister;
|
|
|
10902
10902
|
* @param state
|
|
10903
10903
|
* @param update
|
|
10904
10904
|
*/
|
|
10905
|
-
SetState(state, update = true) {
|
|
10905
|
+
SetState(state, update = true, source) {
|
|
10906
10906
|
if (!state || isBlankState(state)) {
|
|
10907
10907
|
return;
|
|
10908
10908
|
}
|
|
@@ -10927,7 +10927,7 @@ var VisualsRegister;
|
|
|
10927
10927
|
});
|
|
10928
10928
|
}
|
|
10929
10929
|
// Trigger update event.
|
|
10930
|
-
if (this.onUpdate) {
|
|
10930
|
+
if (this.onUpdate && source !== "tree-cascade") {
|
|
10931
10931
|
const update = {
|
|
10932
10932
|
type: EVisualUpdateType.Update,
|
|
10933
10933
|
entityId: state.entityId
|
|
@@ -10944,12 +10944,15 @@ var VisualsRegister;
|
|
|
10944
10944
|
if (state.hasOwnProperty("hidden")) {
|
|
10945
10945
|
update.hidden = state.hidden;
|
|
10946
10946
|
}
|
|
10947
|
+
if (source) {
|
|
10948
|
+
update.source = source;
|
|
10949
|
+
}
|
|
10947
10950
|
this.onUpdate.Trigger(update);
|
|
10948
10951
|
}
|
|
10949
10952
|
}
|
|
10950
10953
|
return changed;
|
|
10951
10954
|
}
|
|
10952
|
-
SetStates(states) {
|
|
10955
|
+
SetStates(states, source) {
|
|
10953
10956
|
// Array of changed Entity IDs so we know what to refresh/notify at the end.
|
|
10954
10957
|
const entityIds = [];
|
|
10955
10958
|
// If we need to update all Entities.
|
|
@@ -10983,7 +10986,7 @@ var VisualsRegister;
|
|
|
10983
10986
|
}
|
|
10984
10987
|
};
|
|
10985
10988
|
const doUpdate = (state) => {
|
|
10986
|
-
const eChanged = this.SetState(state, false);
|
|
10989
|
+
const eChanged = this.SetState(state, false, source);
|
|
10987
10990
|
if (eChanged && !entityIds.includes(state.entityId)) {
|
|
10988
10991
|
updateRefreshMarkers(state);
|
|
10989
10992
|
entityIds.push(state.entityId);
|
|
@@ -11015,7 +11018,7 @@ var VisualsRegister;
|
|
|
11015
11018
|
}
|
|
11016
11019
|
}
|
|
11017
11020
|
// Trigger update event.
|
|
11018
|
-
if (this.onUpdate) {
|
|
11021
|
+
if (this.onUpdate && source !== "tree-cascade") {
|
|
11019
11022
|
const keys = Object.keys(states);
|
|
11020
11023
|
for (let i = 0; i < keys.length; i++) {
|
|
11021
11024
|
const key = keys[i];
|
|
@@ -11037,6 +11040,9 @@ var VisualsRegister;
|
|
|
11037
11040
|
if (state.hasOwnProperty("hidden")) {
|
|
11038
11041
|
update.hidden = state.hidden;
|
|
11039
11042
|
}
|
|
11043
|
+
if (source) {
|
|
11044
|
+
update.source = source;
|
|
11045
|
+
}
|
|
11040
11046
|
this.onUpdate.Trigger(update);
|
|
11041
11047
|
}
|
|
11042
11048
|
}
|
|
@@ -11280,17 +11286,23 @@ var VisualsRegister;
|
|
|
11280
11286
|
}
|
|
11281
11287
|
ForceUpdate(params) {
|
|
11282
11288
|
var _a;
|
|
11283
|
-
let { entityIds, requestRender, refreshColors } = params;
|
|
11289
|
+
let { entityIds, requestRender, refreshColors, source } = params;
|
|
11284
11290
|
for (let i = 0; i < entityIds.length; i++) {
|
|
11285
11291
|
const entityId = entityIds[i];
|
|
11286
11292
|
this.queueUpdate({
|
|
11287
11293
|
entityId: entityId,
|
|
11288
11294
|
refresh: true
|
|
11289
11295
|
});
|
|
11290
|
-
|
|
11296
|
+
const update = {
|
|
11291
11297
|
type: EVisualUpdateType.Update,
|
|
11292
11298
|
entityId
|
|
11293
|
-
}
|
|
11299
|
+
};
|
|
11300
|
+
if (source) {
|
|
11301
|
+
update.source = source;
|
|
11302
|
+
}
|
|
11303
|
+
if (source !== "tree-cascade") {
|
|
11304
|
+
(_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(update);
|
|
11305
|
+
}
|
|
11294
11306
|
}
|
|
11295
11307
|
}
|
|
11296
11308
|
/**
|
|
@@ -11392,7 +11404,7 @@ var VisualsRegister;
|
|
|
11392
11404
|
}
|
|
11393
11405
|
SetSelected(params) {
|
|
11394
11406
|
var _a;
|
|
11395
|
-
let { entityIds, selected, refreshIfSelected, requestRender, menuItemId } = params;
|
|
11407
|
+
let { entityIds, selected, refreshIfSelected, requestRender, menuItemId, source } = params;
|
|
11396
11408
|
if (refreshIfSelected == null || refreshIfSelected === undefined) {
|
|
11397
11409
|
refreshIfSelected = true;
|
|
11398
11410
|
}
|
|
@@ -11446,11 +11458,17 @@ var VisualsRegister;
|
|
|
11446
11458
|
}
|
|
11447
11459
|
}
|
|
11448
11460
|
}
|
|
11449
|
-
|
|
11461
|
+
const update = {
|
|
11450
11462
|
entityId: id,
|
|
11451
11463
|
type: EVisualUpdateType.Update,
|
|
11452
11464
|
selected: selected
|
|
11453
|
-
}
|
|
11465
|
+
};
|
|
11466
|
+
if (source) {
|
|
11467
|
+
update.source = source;
|
|
11468
|
+
}
|
|
11469
|
+
if (source !== "tree-cascade") {
|
|
11470
|
+
(_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(update);
|
|
11471
|
+
}
|
|
11454
11472
|
}
|
|
11455
11473
|
if (requestRender != false) {
|
|
11456
11474
|
this.viewer.scene.requestRender();
|
|
@@ -11488,9 +11506,15 @@ var VisualsRegister;
|
|
|
11488
11506
|
}
|
|
11489
11507
|
}
|
|
11490
11508
|
});
|
|
11491
|
-
|
|
11509
|
+
const update = {
|
|
11492
11510
|
type: EVisualUpdateType.DeselectAll
|
|
11493
|
-
}
|
|
11511
|
+
};
|
|
11512
|
+
if (params === null || params === void 0 ? void 0 : params.source) {
|
|
11513
|
+
update.source = params.source;
|
|
11514
|
+
}
|
|
11515
|
+
if ((params === null || params === void 0 ? void 0 : params.source) !== "tree-cascade") {
|
|
11516
|
+
(_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(update);
|
|
11517
|
+
}
|
|
11494
11518
|
if ((params === null || params === void 0 ? void 0 : params.requestRender) != false) {
|
|
11495
11519
|
this.viewer.scene.requestRender();
|
|
11496
11520
|
}
|
|
@@ -11621,7 +11645,7 @@ var VisualsRegister;
|
|
|
11621
11645
|
}
|
|
11622
11646
|
SetIsolated(params) {
|
|
11623
11647
|
var _a;
|
|
11624
|
-
const { entityIds, isolated: isolate, requestRender, menuItemId } = params;
|
|
11648
|
+
const { entityIds, isolated: isolate, requestRender, menuItemId, source } = params;
|
|
11625
11649
|
for (let i = 0; i < entityIds.length; i++) {
|
|
11626
11650
|
const entityId = entityIds[i];
|
|
11627
11651
|
this.setStateValues({
|
|
@@ -11630,11 +11654,17 @@ var VisualsRegister;
|
|
|
11630
11654
|
// Null means it will be deleted from the object.
|
|
11631
11655
|
isolated: isolate ? true : null
|
|
11632
11656
|
});
|
|
11633
|
-
|
|
11657
|
+
const update = {
|
|
11634
11658
|
entityId: entityId,
|
|
11635
11659
|
type: EVisualUpdateType.Update,
|
|
11636
11660
|
isolated: isolate
|
|
11637
|
-
}
|
|
11661
|
+
};
|
|
11662
|
+
if (source) {
|
|
11663
|
+
update.source = source;
|
|
11664
|
+
}
|
|
11665
|
+
if (source !== "tree-cascade") {
|
|
11666
|
+
(_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(update);
|
|
11667
|
+
}
|
|
11638
11668
|
}
|
|
11639
11669
|
this.updateAllEntities({
|
|
11640
11670
|
requestRender: false,
|
|
@@ -11685,7 +11715,7 @@ var VisualsRegister;
|
|
|
11685
11715
|
}
|
|
11686
11716
|
}
|
|
11687
11717
|
SetHidden(params) {
|
|
11688
|
-
const { entityIds, hidden, requestRender, menuItemId } = params;
|
|
11718
|
+
const { entityIds, hidden, requestRender, menuItemId, source } = params;
|
|
11689
11719
|
const stateChanges = [];
|
|
11690
11720
|
for (let i = 0; i < entityIds.length; i++) {
|
|
11691
11721
|
const entityId = entityIds[i];
|
|
@@ -11698,7 +11728,7 @@ var VisualsRegister;
|
|
|
11698
11728
|
}
|
|
11699
11729
|
stateChanges.push(state);
|
|
11700
11730
|
}
|
|
11701
|
-
this.SetStates(stateChanges);
|
|
11731
|
+
this.SetStates(stateChanges, source);
|
|
11702
11732
|
}
|
|
11703
11733
|
GetIsHidden(params) {
|
|
11704
11734
|
const { entityId: id, menuItemId } = params;
|
|
@@ -11737,14 +11767,20 @@ var VisualsRegister;
|
|
|
11737
11767
|
refresh: true
|
|
11738
11768
|
});
|
|
11739
11769
|
}
|
|
11740
|
-
|
|
11770
|
+
const update = {
|
|
11741
11771
|
type: EVisualUpdateType.Update,
|
|
11742
11772
|
hidden: false
|
|
11743
|
-
}
|
|
11773
|
+
};
|
|
11774
|
+
if (params === null || params === void 0 ? void 0 : params.source) {
|
|
11775
|
+
update.source = params.source;
|
|
11776
|
+
}
|
|
11777
|
+
if ((params === null || params === void 0 ? void 0 : params.source) !== "tree-cascade") {
|
|
11778
|
+
(_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(update);
|
|
11779
|
+
}
|
|
11744
11780
|
}
|
|
11745
11781
|
AddRego(params) {
|
|
11746
11782
|
var _a, _b;
|
|
11747
|
-
const { rego, requestRender } = params;
|
|
11783
|
+
const { rego, requestRender, source } = params;
|
|
11748
11784
|
// ND-2078
|
|
11749
11785
|
// Tilesets will often add -> remove -> add because of how tiles load in and out of the scene.
|
|
11750
11786
|
// To avoid flickering, we'll just replace rather than remove -> add.
|
|
@@ -11769,11 +11805,17 @@ var VisualsRegister;
|
|
|
11769
11805
|
entityId: entityId,
|
|
11770
11806
|
refresh: true
|
|
11771
11807
|
});
|
|
11772
|
-
|
|
11808
|
+
const update = {
|
|
11773
11809
|
rego: rego,
|
|
11774
11810
|
type: EVisualUpdateType.Add,
|
|
11775
11811
|
entityId: rego.entityId
|
|
11776
|
-
}
|
|
11812
|
+
};
|
|
11813
|
+
if (source) {
|
|
11814
|
+
update.source = source;
|
|
11815
|
+
}
|
|
11816
|
+
if (source !== "tree-cascade") {
|
|
11817
|
+
(_b = this.onUpdate) === null || _b === void 0 ? void 0 : _b.Trigger(update);
|
|
11818
|
+
}
|
|
11777
11819
|
if (requestRender != false) {
|
|
11778
11820
|
this.viewer.scene.requestRender();
|
|
11779
11821
|
}
|
|
@@ -11852,7 +11894,7 @@ var VisualsRegister;
|
|
|
11852
11894
|
*/
|
|
11853
11895
|
RemoveRegos(params) {
|
|
11854
11896
|
var _a, _b, _c;
|
|
11855
|
-
let { entityId, menuItemId, doUpdate, relation, retainTagIds, requestRender, doRemove } = params;
|
|
11897
|
+
let { entityId, menuItemId, doUpdate, relation, retainTagIds, requestRender, doRemove, source } = params;
|
|
11856
11898
|
if (doUpdate == null || doUpdate === undefined) {
|
|
11857
11899
|
doUpdate = true;
|
|
11858
11900
|
}
|
|
@@ -11885,11 +11927,17 @@ var VisualsRegister;
|
|
|
11885
11927
|
if (doesInclude) {
|
|
11886
11928
|
this.rego[entityId] = entityRegos.filter(r => r.menuItemId !== menuItemId);
|
|
11887
11929
|
}
|
|
11888
|
-
|
|
11930
|
+
const update = {
|
|
11889
11931
|
type: EVisualUpdateType.Remove,
|
|
11890
11932
|
entityId: rego.entityId,
|
|
11891
11933
|
rego: rego
|
|
11892
|
-
}
|
|
11934
|
+
};
|
|
11935
|
+
if (source) {
|
|
11936
|
+
update.source = source;
|
|
11937
|
+
}
|
|
11938
|
+
if (source !== "tree-cascade") {
|
|
11939
|
+
(_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(update);
|
|
11940
|
+
}
|
|
11893
11941
|
if (doesInclude) {
|
|
11894
11942
|
this.queueUpdate({
|
|
11895
11943
|
entityId: entityId,
|
|
@@ -11918,11 +11966,17 @@ var VisualsRegister;
|
|
|
11918
11966
|
removeEntity(this.viewer, rego.visual);
|
|
11919
11967
|
}
|
|
11920
11968
|
rego.visual = null;
|
|
11921
|
-
|
|
11969
|
+
const update = {
|
|
11922
11970
|
type: EVisualUpdateType.Remove,
|
|
11923
11971
|
entityId: rego.entityId,
|
|
11924
11972
|
rego: rego
|
|
11925
|
-
}
|
|
11973
|
+
};
|
|
11974
|
+
if (source) {
|
|
11975
|
+
update.source = source;
|
|
11976
|
+
}
|
|
11977
|
+
if (source !== "tree-cascade") {
|
|
11978
|
+
(_b = this.onUpdate) === null || _b === void 0 ? void 0 : _b.Trigger(update);
|
|
11979
|
+
}
|
|
11926
11980
|
this.rego[entityId] = entityRegos.filter(r => r.menuItemId !== menuItemId);
|
|
11927
11981
|
if (doUpdate && menuItemId) {
|
|
11928
11982
|
this.queueUpdate({
|
|
@@ -11947,11 +12001,17 @@ var VisualsRegister;
|
|
|
11947
12001
|
removeEntity(this.viewer, rego.visual);
|
|
11948
12002
|
rego.visual = null;
|
|
11949
12003
|
this.rego[entityId] = entityRegos.filter(r => r.menuItemId !== menuItemId);
|
|
11950
|
-
|
|
12004
|
+
const update = {
|
|
11951
12005
|
type: EVisualUpdateType.Remove,
|
|
11952
12006
|
entityId: rego.entityId,
|
|
11953
12007
|
rego: rego
|
|
11954
|
-
}
|
|
12008
|
+
};
|
|
12009
|
+
if (source) {
|
|
12010
|
+
update.source = source;
|
|
12011
|
+
}
|
|
12012
|
+
if (source !== "tree-cascade") {
|
|
12013
|
+
(_c = this.onUpdate) === null || _c === void 0 ? void 0 : _c.Trigger(update);
|
|
12014
|
+
}
|
|
11955
12015
|
if (doUpdate && menuItemId) {
|
|
11956
12016
|
this.queueUpdate({
|
|
11957
12017
|
entityId: entityId,
|
|
@@ -12041,18 +12101,24 @@ var VisualsRegister;
|
|
|
12041
12101
|
*/
|
|
12042
12102
|
SetOpacity(params) {
|
|
12043
12103
|
var _a;
|
|
12044
|
-
let { opacity, entityIds, menuItemId, requestRender } = params;
|
|
12104
|
+
let { opacity, entityIds, menuItemId, requestRender, source } = params;
|
|
12045
12105
|
for (const entityId of entityIds) {
|
|
12046
12106
|
this.setStateValues({
|
|
12047
12107
|
entityId: entityId,
|
|
12048
12108
|
menuItemId: menuItemId,
|
|
12049
12109
|
opacity: opacity
|
|
12050
12110
|
});
|
|
12051
|
-
|
|
12111
|
+
const update = {
|
|
12052
12112
|
type: EVisualUpdateType.Update,
|
|
12053
12113
|
entityId: entityId,
|
|
12054
12114
|
opacity: opacity
|
|
12055
|
-
}
|
|
12115
|
+
};
|
|
12116
|
+
if (source) {
|
|
12117
|
+
update.source = source;
|
|
12118
|
+
}
|
|
12119
|
+
if (source !== "tree-cascade") {
|
|
12120
|
+
(_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(update);
|
|
12121
|
+
}
|
|
12056
12122
|
this.queueUpdate({
|
|
12057
12123
|
entityId: entityId,
|
|
12058
12124
|
refresh: {
|
|
@@ -32256,7 +32322,7 @@ class WidgetViewBar extends Widget.AWidget {
|
|
|
32256
32322
|
}
|
|
32257
32323
|
}
|
|
32258
32324
|
|
|
32259
|
-
const VERSION = "5.8.
|
|
32325
|
+
const VERSION = "5.8.2";
|
|
32260
32326
|
|
|
32261
32327
|
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, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, CESIUM_TIMELINE_LIVE_KEY, CESIUM_TIMELINE_LIVE_PADDING_KEY, CESIUM_TIMELINE_INTERVAL_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 };
|
|
32262
32328
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|