bruce-cesium 5.3.2 → 5.3.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 +98 -15
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +96 -13
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/view-render-engine.js +94 -0
- package/dist/lib/rendering/view-render-engine.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js +1 -12
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/view-render-engine.d.ts +14 -0
- package/package.json +2 -2
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BruceEvent, Cartes, Entity as Entity$1, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, ProjectViewTile, DelayQueue, EntityLod, Bounds, ZoomControl, EntityRelationType, ENVIRONMENT, EntityHistoricData, Tileset, EntityCoords, DataLab, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark,
|
|
1
|
+
import { BruceEvent, Cartes, Entity as Entity$1, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, ProjectViewTile, DelayQueue, EntityLod, Bounds, ZoomControl, EntityRelationType, ENVIRONMENT, EntityHistoricData, Tileset, EntityCoords, DataLab, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, ProjectViewLegacyTile, Camera, 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, HorizontalOrigin, VerticalOrigin, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, GeoJsonDataSource, SceneMode, Cesium3DTileStyle, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, KmlDataSource, SceneTransforms, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, OrthographicFrustum, EasingFunction, NearFarScalar, CesiumInspector, defined, ClockRange, PolygonPipeline, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, BoundingSphere, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, Quaternion, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
|
|
4
4
|
|
|
5
5
|
const TIME_LAG = 300;
|
|
6
6
|
const POSITION_CHECK_TIMER = 950;
|
|
@@ -10700,18 +10700,7 @@ var VisualsRegister;
|
|
|
10700
10700
|
return state.isolated === true;
|
|
10701
10701
|
}
|
|
10702
10702
|
GetIsIsolatedAny() {
|
|
10703
|
-
|
|
10704
|
-
for (let i = 0; i < entityIds.length; i++) {
|
|
10705
|
-
const state = this.states[entityIds[i]];
|
|
10706
|
-
const menuItemIds = state ? Object.keys(state) : [];
|
|
10707
|
-
for (let j = 0; j < menuItemIds.length; j++) {
|
|
10708
|
-
const menuItemId = menuItemIds[j];
|
|
10709
|
-
if (state[menuItemId].isolated) {
|
|
10710
|
-
return true;
|
|
10711
|
-
}
|
|
10712
|
-
}
|
|
10713
|
-
}
|
|
10714
|
-
return false;
|
|
10703
|
+
return Object.values(this.states).some(state => state && Object.values(state).some(item => item.isolated));
|
|
10715
10704
|
}
|
|
10716
10705
|
/**
|
|
10717
10706
|
* @deprecated Use GetStates() or GetState().
|
|
@@ -24584,6 +24573,100 @@ var ViewRenderEngine;
|
|
|
24584
24573
|
}
|
|
24585
24574
|
}
|
|
24586
24575
|
ViewRenderEngine.Render = Render;
|
|
24576
|
+
/**
|
|
24577
|
+
* Moves the camera to a given view + bookmark.
|
|
24578
|
+
* @param params
|
|
24579
|
+
*/
|
|
24580
|
+
async function FlyTo(params) {
|
|
24581
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
24582
|
+
if (!params.manager && params.viewer) {
|
|
24583
|
+
params.manager = ViewerUtils.GetManager({
|
|
24584
|
+
viewer: params.viewer,
|
|
24585
|
+
createIfMissing: true
|
|
24586
|
+
});
|
|
24587
|
+
}
|
|
24588
|
+
else if (!params.viewer && params.manager) {
|
|
24589
|
+
params.viewer = params.manager.Viewer;
|
|
24590
|
+
}
|
|
24591
|
+
if (!params.getters) {
|
|
24592
|
+
params.getters = ENVIRONMENT.Api();
|
|
24593
|
+
}
|
|
24594
|
+
const api = params.getters.GetBruceApi();
|
|
24595
|
+
const view = params.view ? params.view : (await ProjectView.Get({
|
|
24596
|
+
api,
|
|
24597
|
+
viewId: params.viewId
|
|
24598
|
+
})).view;
|
|
24599
|
+
let bookmark = params.bookmark;
|
|
24600
|
+
if (!bookmark) {
|
|
24601
|
+
let bookmarkId = params.bookmarkId;
|
|
24602
|
+
if (!bookmarkId) {
|
|
24603
|
+
bookmarkId = view.DefaultUISlideID;
|
|
24604
|
+
}
|
|
24605
|
+
bookmark = bookmarkId ? (await ProjectViewBookmark.Get({
|
|
24606
|
+
api,
|
|
24607
|
+
viewId: params.viewId,
|
|
24608
|
+
bookmarkId: bookmarkId
|
|
24609
|
+
})).bookmark : null;
|
|
24610
|
+
}
|
|
24611
|
+
const viewer = params.manager.Viewer;
|
|
24612
|
+
const scene = viewer.scene;
|
|
24613
|
+
const vSettings = view.Settings;
|
|
24614
|
+
const defaults = (_a = vSettings.defaults) !== null && _a !== void 0 ? _a : {};
|
|
24615
|
+
let camera = ((_b = bookmark === null || bookmark === void 0 ? void 0 : bookmark.Camera) !== null && _b !== void 0 ? _b : {});
|
|
24616
|
+
if (!Carto.ValidateCarto(camera)) {
|
|
24617
|
+
camera = {
|
|
24618
|
+
...camera,
|
|
24619
|
+
altitude: (_c = defaults.camera) === null || _c === void 0 ? void 0 : _c.altitude,
|
|
24620
|
+
latitude: (_d = defaults.camera) === null || _d === void 0 ? void 0 : _d.latitude,
|
|
24621
|
+
longitude: (_e = defaults.camera) === null || _e === void 0 ? void 0 : _e.longitude,
|
|
24622
|
+
heading: (_f = defaults.camera) === null || _f === void 0 ? void 0 : _f.heading,
|
|
24623
|
+
pitch: (_g = defaults.camera) === null || _g === void 0 ? void 0 : _g.pitch,
|
|
24624
|
+
roll: (_h = defaults.camera) === null || _h === void 0 ? void 0 : _h.roll
|
|
24625
|
+
};
|
|
24626
|
+
}
|
|
24627
|
+
let newLens = camera.cameraFrustum;
|
|
24628
|
+
if (newLens == null) {
|
|
24629
|
+
newLens = (_j = defaults.camera) === null || _j === void 0 ? void 0 : _j.cameraFrustum;
|
|
24630
|
+
}
|
|
24631
|
+
if (newLens == null) {
|
|
24632
|
+
// TODO: Need global default.
|
|
24633
|
+
newLens = Camera.EFrustum.Perspective;
|
|
24634
|
+
}
|
|
24635
|
+
const shouldBe2d = newLens == Camera.EFrustum.Orthographic;
|
|
24636
|
+
const curIs2d = ViewUtils.Get2dStatus({
|
|
24637
|
+
viewer
|
|
24638
|
+
});
|
|
24639
|
+
if (shouldBe2d != curIs2d) {
|
|
24640
|
+
ViewUtils.Set2dStatus({
|
|
24641
|
+
status: shouldBe2d,
|
|
24642
|
+
viewer,
|
|
24643
|
+
moveCamera: false
|
|
24644
|
+
});
|
|
24645
|
+
}
|
|
24646
|
+
let transition = params.skipTransition ? 0 : shouldBe2d === curIs2d ? camera.transition : 0;
|
|
24647
|
+
if (transition == null) {
|
|
24648
|
+
transition = (_k = defaults.camera) === null || _k === void 0 ? void 0 : _k.transition;
|
|
24649
|
+
}
|
|
24650
|
+
if (transition == null) {
|
|
24651
|
+
// TODO: Need global default.
|
|
24652
|
+
transition = 2000;
|
|
24653
|
+
}
|
|
24654
|
+
if (Carto.ValidateCarto(camera)) {
|
|
24655
|
+
const pos = Cartesian3.fromDegrees(+camera.longitude, +camera.latitude, +camera.altitude);
|
|
24656
|
+
scene.camera.flyTo({
|
|
24657
|
+
destination: pos,
|
|
24658
|
+
orientation: {
|
|
24659
|
+
heading: Math$1.toRadians(+camera.heading),
|
|
24660
|
+
pitch: Math$1.toRadians(+camera.pitch),
|
|
24661
|
+
roll: Math$1.toRadians(+camera.roll)
|
|
24662
|
+
},
|
|
24663
|
+
duration: transition != 0 ? transition / 1000 : 0,
|
|
24664
|
+
// Make it ease in and out.
|
|
24665
|
+
easingFunction: EasingFunction.CUBIC_IN_OUT
|
|
24666
|
+
});
|
|
24667
|
+
}
|
|
24668
|
+
}
|
|
24669
|
+
ViewRenderEngine.FlyTo = FlyTo;
|
|
24587
24670
|
})(ViewRenderEngine || (ViewRenderEngine = {}));
|
|
24588
24671
|
|
|
24589
24672
|
const VIEWER_LEFT_PANEL_WIDGET_KEY = "_viewerLeftPanelWidget";
|
|
@@ -30007,7 +30090,7 @@ class WidgetViewBar extends Widget.AWidget {
|
|
|
30007
30090
|
}
|
|
30008
30091
|
}
|
|
30009
30092
|
|
|
30010
|
-
const VERSION = "5.3.
|
|
30093
|
+
const VERSION = "5.3.3";
|
|
30011
30094
|
|
|
30012
30095
|
export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, isHistoricMetadataChanged, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, DataLabRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, 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 };
|
|
30013
30096
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|