bruce-cesium 1.1.0 → 1.1.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 +86 -26
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +85 -25
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/rendering/menu-item-manager.js +2 -2
- package/dist/lib/rendering/view-render-engine.js +58 -23
- package/dist/lib/rendering/view-render-engine.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js +25 -0
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/types/rendering/menu-item-manager.d.ts +2 -2
- package/dist/types/rendering/visuals-register.d.ts +8 -1
- package/package.json +2 -2
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BruceEvent, Cartes, Carto, Geometry, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, DelayQueue, Entity as Entity$1, BatchedDataGetter, EntityRelationType, ObjectUtils, Tileset, EntityCoords, EntityFilterGetter, EntitySource, EntityRelation, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewTile, ProjectViewLegacyTile, ProgramKey, Camera } from 'bruce-models';
|
|
2
|
-
import { Cartesian2, Cartographic, Math as Math$1,
|
|
2
|
+
import { Cartesian2, Cartographic, Math as Math$1, Color, HeightReference, Cartesian3, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, HeadingPitchRange, Matrix4, Cesium3DTileStyle, Cesium3DTileset, IonResource, createWorldTerrain, EllipsoidTerrainProvider, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, OrthographicFrustum, JulianDate, ColorMaterialProperty, Rectangle, Matrix3, EasingFunction, GeometryInstance, PolygonPipeline, EllipsoidGeodesic, sampleTerrainMostDetailed, CallbackProperty, createOsmBuildings, KmlDataSource } from 'cesium';
|
|
3
3
|
|
|
4
4
|
var TIME_LAG = 300;
|
|
5
5
|
var POSITION_CHECK_TIMER = 950;
|
|
@@ -3566,6 +3566,31 @@ var VisualsRegister;
|
|
|
3566
3566
|
}
|
|
3567
3567
|
return totalOpacity ? totalOpacity / totalTicks : 1;
|
|
3568
3568
|
};
|
|
3569
|
+
Register.prototype.ClearOpacity = function () {
|
|
3570
|
+
for (var entityId in this.opacity) {
|
|
3571
|
+
var regos = this.rego[entityId];
|
|
3572
|
+
if (regos && regos.length) {
|
|
3573
|
+
for (var _i = 0, regos_4 = regos; _i < regos_4.length; _i++) {
|
|
3574
|
+
var rego = regos_4[_i];
|
|
3575
|
+
if (rego === null || rego === void 0 ? void 0 : rego.visual) {
|
|
3576
|
+
EntityUtils.RevertOpacity({
|
|
3577
|
+
entity: rego.visual,
|
|
3578
|
+
viewer: this.viewer
|
|
3579
|
+
});
|
|
3580
|
+
}
|
|
3581
|
+
}
|
|
3582
|
+
}
|
|
3583
|
+
}
|
|
3584
|
+
this.opacity = {};
|
|
3585
|
+
};
|
|
3586
|
+
/**
|
|
3587
|
+
* Returns a dictionary containing entityId -> opacity values.
|
|
3588
|
+
* Opacity 1 = 100%.
|
|
3589
|
+
* @returns
|
|
3590
|
+
*/
|
|
3591
|
+
Register.prototype.GetOpacityMap = function () {
|
|
3592
|
+
return this.opacity ? JSON.parse(JSON.stringify(this.opacity)) : {};
|
|
3593
|
+
};
|
|
3569
3594
|
return Register;
|
|
3570
3595
|
}());
|
|
3571
3596
|
VisualsRegister.Register = Register;
|
|
@@ -5897,7 +5922,7 @@ var MenuItemManager;
|
|
|
5897
5922
|
configurable: true
|
|
5898
5923
|
});
|
|
5899
5924
|
/**
|
|
5900
|
-
* Renders a given menu item and all
|
|
5925
|
+
* Renders a given menu item and all its children.
|
|
5901
5926
|
* Will return the enabled item id.
|
|
5902
5927
|
* @param params
|
|
5903
5928
|
* @returns
|
|
@@ -6054,7 +6079,7 @@ var MenuItemManager;
|
|
|
6054
6079
|
});
|
|
6055
6080
|
};
|
|
6056
6081
|
/**
|
|
6057
|
-
* Disables a menu item by
|
|
6082
|
+
* Disables a menu item by its id.
|
|
6058
6083
|
* This will disable all children as well.
|
|
6059
6084
|
* @param id
|
|
6060
6085
|
* @param recursive
|
|
@@ -7608,11 +7633,11 @@ function renderLegacyNavigator(params, bookmark, view) {
|
|
|
7608
7633
|
* @param view
|
|
7609
7634
|
*/
|
|
7610
7635
|
function renderNavigator(params, bookmark, view) {
|
|
7611
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
7636
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
|
|
7612
7637
|
return __awaiter(this, void 0, void 0, function () {
|
|
7613
|
-
var viewer, scene, vSettings, bSettings, defaults, camera, newLens, curLens, transition, pos, gOcclusion, hillShades, baseColor, shadows, size, ambientOcclusion, AO, lighting, light, quality, fxaa, dateTime, clock, terrain, selectedIds,
|
|
7614
|
-
return __generator(this, function (
|
|
7615
|
-
switch (
|
|
7638
|
+
var viewer, scene, vSettings, bSettings, defaults, camera, newLens, curLens, transition, pos, gOcclusion, hillShades, baseColor, shadows, size, ambientOcclusion, AO, lighting, light, quality, fxaa, dateTime, clock, terrain, selectedIds, hiddenIds, isolatedIds, entityOpacityMap, entityId, opacity, imagery, renderedRelationEntityIds, curEnabled, newItemIds, _i, curEnabled_1, id, menuItem;
|
|
7639
|
+
return __generator(this, function (_5) {
|
|
7640
|
+
switch (_5.label) {
|
|
7616
7641
|
case 0:
|
|
7617
7642
|
viewer = params.manager.Viewer;
|
|
7618
7643
|
scene = viewer.scene;
|
|
@@ -7784,8 +7809,8 @@ function renderNavigator(params, bookmark, view) {
|
|
|
7784
7809
|
viewer: params.manager.Viewer,
|
|
7785
7810
|
})];
|
|
7786
7811
|
case 1:
|
|
7787
|
-
|
|
7788
|
-
|
|
7812
|
+
_5.sent();
|
|
7813
|
+
_5.label = 2;
|
|
7789
7814
|
case 2:
|
|
7790
7815
|
selectedIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.selectedEntityIds;
|
|
7791
7816
|
if (selectedIds == null) {
|
|
@@ -7793,16 +7818,51 @@ function renderNavigator(params, bookmark, view) {
|
|
|
7793
7818
|
}
|
|
7794
7819
|
if (selectedIds != null) {
|
|
7795
7820
|
params.manager.VisualsRegister.ClearSelected();
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7821
|
+
params.manager.VisualsRegister.SetSelected({
|
|
7822
|
+
selected: true,
|
|
7823
|
+
entityIds: selectedIds,
|
|
7824
|
+
refreshIfSelected: false
|
|
7825
|
+
});
|
|
7826
|
+
}
|
|
7827
|
+
params.manager.VisualsRegister.ClearHidden();
|
|
7828
|
+
hiddenIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.hiddenEntityIds;
|
|
7829
|
+
if (hiddenIds == null) {
|
|
7830
|
+
hiddenIds = (_z = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _z === void 0 ? void 0 : _z.hiddenEntityIds;
|
|
7831
|
+
}
|
|
7832
|
+
if (hiddenIds != null) {
|
|
7833
|
+
params.manager.VisualsRegister.SetHidden({
|
|
7834
|
+
hidden: true,
|
|
7835
|
+
entityIds: hiddenIds
|
|
7836
|
+
});
|
|
7837
|
+
}
|
|
7838
|
+
params.manager.VisualsRegister.ClearIsolated();
|
|
7839
|
+
isolatedIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.isolatedEntityIds;
|
|
7840
|
+
if (isolatedIds == null) {
|
|
7841
|
+
isolatedIds = (_0 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _0 === void 0 ? void 0 : _0.isolatedEntityIds;
|
|
7842
|
+
}
|
|
7843
|
+
if (isolatedIds != null) {
|
|
7844
|
+
params.manager.VisualsRegister.SetIsolated({
|
|
7845
|
+
isolated: true,
|
|
7846
|
+
entityIds: isolatedIds
|
|
7847
|
+
});
|
|
7848
|
+
}
|
|
7849
|
+
params.manager.VisualsRegister.ClearOpacity();
|
|
7850
|
+
entityOpacityMap = bSettings === null || bSettings === void 0 ? void 0 : bSettings.entityOpacityMap;
|
|
7851
|
+
if (entityOpacityMap == null) {
|
|
7852
|
+
entityOpacityMap = (_1 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _1 === void 0 ? void 0 : _1.entityOpacityMap;
|
|
7853
|
+
}
|
|
7854
|
+
if (entityOpacityMap != null) {
|
|
7855
|
+
for (entityId in entityOpacityMap) {
|
|
7856
|
+
opacity = EnsureNumber(entityOpacityMap[entityId], 1);
|
|
7857
|
+
if (opacity != 1) {
|
|
7858
|
+
params.manager.VisualsRegister.SetOpacity({
|
|
7859
|
+
entityIds: [entityId],
|
|
7860
|
+
opacity: opacity
|
|
7861
|
+
});
|
|
7862
|
+
}
|
|
7803
7863
|
}
|
|
7804
7864
|
}
|
|
7805
|
-
imagery = (
|
|
7865
|
+
imagery = (_2 = bSettings.imagery) !== null && _2 !== void 0 ? _2 : (_3 = defaults.settings) === null || _3 === void 0 ? void 0 : _3.imagery;
|
|
7806
7866
|
if (imagery == null) {
|
|
7807
7867
|
// TODO: Need global default.
|
|
7808
7868
|
imagery = [
|
|
@@ -7824,15 +7884,15 @@ function renderNavigator(params, bookmark, view) {
|
|
|
7824
7884
|
viewer: params.manager.Viewer,
|
|
7825
7885
|
})];
|
|
7826
7886
|
case 3:
|
|
7827
|
-
|
|
7887
|
+
_5.sent();
|
|
7828
7888
|
renderedRelationEntityIds = bSettings.renderedEntityRelations;
|
|
7829
7889
|
if (!renderedRelationEntityIds) {
|
|
7830
7890
|
renderedRelationEntityIds = [];
|
|
7831
7891
|
}
|
|
7832
7892
|
curEnabled = params.manager.GetEnabledItemIds();
|
|
7833
|
-
newItemIds = (
|
|
7893
|
+
newItemIds = (_4 = bSettings === null || bSettings === void 0 ? void 0 : bSettings.menuItemIds) !== null && _4 !== void 0 ? _4 : [];
|
|
7834
7894
|
_i = 0, curEnabled_1 = curEnabled;
|
|
7835
|
-
|
|
7895
|
+
_5.label = 4;
|
|
7836
7896
|
case 4:
|
|
7837
7897
|
if (!(_i < curEnabled_1.length)) return [3 /*break*/, 7];
|
|
7838
7898
|
id = curEnabled_1[_i];
|
|
@@ -7842,8 +7902,8 @@ function renderNavigator(params, bookmark, view) {
|
|
|
7842
7902
|
menuItemId: id
|
|
7843
7903
|
})];
|
|
7844
7904
|
case 5:
|
|
7845
|
-
|
|
7846
|
-
|
|
7905
|
+
_5.sent();
|
|
7906
|
+
_5.label = 6;
|
|
7847
7907
|
case 6:
|
|
7848
7908
|
_i++;
|
|
7849
7909
|
return [3 /*break*/, 4];
|
|
@@ -7856,8 +7916,8 @@ function renderNavigator(params, bookmark, view) {
|
|
|
7856
7916
|
bookmark: bookmark
|
|
7857
7917
|
})];
|
|
7858
7918
|
case 8:
|
|
7859
|
-
|
|
7860
|
-
|
|
7919
|
+
_5.sent();
|
|
7920
|
+
_5.label = 9;
|
|
7861
7921
|
case 9:
|
|
7862
7922
|
if (!(renderedRelationEntityIds.length > 0)) return [3 /*break*/, 11];
|
|
7863
7923
|
menuItem = {
|
|
@@ -7873,8 +7933,8 @@ function renderNavigator(params, bookmark, view) {
|
|
|
7873
7933
|
item: menuItem
|
|
7874
7934
|
})];
|
|
7875
7935
|
case 10:
|
|
7876
|
-
|
|
7877
|
-
|
|
7936
|
+
_5.sent();
|
|
7937
|
+
_5.label = 11;
|
|
7878
7938
|
case 11: return [2 /*return*/];
|
|
7879
7939
|
}
|
|
7880
7940
|
});
|