bruce-cesium 5.6.9 → 5.7.1
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 +163 -33
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +162 -32
- 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 +161 -31
- package/dist/lib/rendering/view-render-engine.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/package.json +2 -2
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, OrthographicFrustum, EasingFunction, NearFarScalar, 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;
|
|
@@ -25420,6 +25420,50 @@ function newIteration$1(viewer) {
|
|
|
25420
25420
|
function assertIteration$1(viewer, iteration) {
|
|
25421
25421
|
return viewer[ITERATION_KEY$1] == iteration;
|
|
25422
25422
|
}
|
|
25423
|
+
function modelSpaceToPosition(point) {
|
|
25424
|
+
let lat = 0;
|
|
25425
|
+
let lon = 0;
|
|
25426
|
+
let alt = 0;
|
|
25427
|
+
{
|
|
25428
|
+
if (point) {
|
|
25429
|
+
if (isNaN(point.x) || point.x == null) {
|
|
25430
|
+
point.x = 0;
|
|
25431
|
+
}
|
|
25432
|
+
if (isNaN(point.y) || point.y == null) {
|
|
25433
|
+
point.y = 0;
|
|
25434
|
+
}
|
|
25435
|
+
if (isNaN(point.z) || point.z == null) {
|
|
25436
|
+
point.z = 0;
|
|
25437
|
+
}
|
|
25438
|
+
}
|
|
25439
|
+
if (point && (point.x !== 0 || point.y !== 0 || point.z !== 0)) {
|
|
25440
|
+
try {
|
|
25441
|
+
// Create a reference position at 0,0,0 - matching the origin used in PositionToModelSpace.
|
|
25442
|
+
const originPosition = Cartesian3.fromDegrees(0, 0, 0);
|
|
25443
|
+
// Get the east-north-up (ENU) reference frame at the origin.
|
|
25444
|
+
const enuTransform = Transforms.eastNorthUpToFixedFrame(originPosition);
|
|
25445
|
+
// Create the relative position.
|
|
25446
|
+
const relativePosition = new Cartesian3(point.x, point.y, point.z);
|
|
25447
|
+
// Transform the relative position to the model's lat/lon/alt.
|
|
25448
|
+
const modelPosition = new Cartesian3();
|
|
25449
|
+
Matrix4.multiplyByPoint(enuTransform, relativePosition, modelPosition);
|
|
25450
|
+
// Convert the Cartesian3 position to lat/lon/alt.
|
|
25451
|
+
const carto = Cartographic.fromCartesian(modelPosition);
|
|
25452
|
+
lat = Math$1.toDegrees(carto.latitude);
|
|
25453
|
+
lon = Math$1.toDegrees(carto.longitude);
|
|
25454
|
+
alt = carto.height;
|
|
25455
|
+
}
|
|
25456
|
+
catch (e) {
|
|
25457
|
+
console.error("Error converting model space to position:", e);
|
|
25458
|
+
}
|
|
25459
|
+
}
|
|
25460
|
+
}
|
|
25461
|
+
return {
|
|
25462
|
+
latitude: lat,
|
|
25463
|
+
longitude: lon,
|
|
25464
|
+
altitude: alt
|
|
25465
|
+
};
|
|
25466
|
+
}
|
|
25423
25467
|
/**
|
|
25424
25468
|
* Renders DATA_VERSION = 1 navigator.
|
|
25425
25469
|
* param iteration
|
|
@@ -25610,16 +25654,32 @@ async function renderNavigator(iteration, params, bookmark, view, getters) {
|
|
|
25610
25654
|
contentType = ProjectViewBookmark.EContentType.WEB_3D;
|
|
25611
25655
|
}
|
|
25612
25656
|
let camera = ((_d = bookmark === null || bookmark === void 0 ? void 0 : bookmark.Camera) !== null && _d !== void 0 ? _d : {});
|
|
25613
|
-
if (
|
|
25614
|
-
camera
|
|
25615
|
-
|
|
25616
|
-
|
|
25617
|
-
|
|
25618
|
-
|
|
25619
|
-
|
|
25620
|
-
|
|
25621
|
-
|
|
25622
|
-
|
|
25657
|
+
if (contentType == ProjectViewBookmark.EContentType.WEB_3D_MODEL_SPACE) {
|
|
25658
|
+
if (!Cartes.ValidateCartes3(camera) && !Carto.ValidateCarto(camera)) {
|
|
25659
|
+
camera = {
|
|
25660
|
+
altitude: 500,
|
|
25661
|
+
latitude: 0,
|
|
25662
|
+
longitude: 0,
|
|
25663
|
+
heading: 0,
|
|
25664
|
+
pitch: -90,
|
|
25665
|
+
roll: 0,
|
|
25666
|
+
cameraFrustum: Camera.EFrustum.Perspective,
|
|
25667
|
+
transition: 2000
|
|
25668
|
+
};
|
|
25669
|
+
}
|
|
25670
|
+
}
|
|
25671
|
+
else {
|
|
25672
|
+
if (!Carto.ValidateCarto(camera)) {
|
|
25673
|
+
camera = {
|
|
25674
|
+
...camera,
|
|
25675
|
+
altitude: (_e = defaults.camera) === null || _e === void 0 ? void 0 : _e.altitude,
|
|
25676
|
+
latitude: (_f = defaults.camera) === null || _f === void 0 ? void 0 : _f.latitude,
|
|
25677
|
+
longitude: (_g = defaults.camera) === null || _g === void 0 ? void 0 : _g.longitude,
|
|
25678
|
+
heading: (_h = defaults.camera) === null || _h === void 0 ? void 0 : _h.heading,
|
|
25679
|
+
pitch: (_j = defaults.camera) === null || _j === void 0 ? void 0 : _j.pitch,
|
|
25680
|
+
roll: (_k = defaults.camera) === null || _k === void 0 ? void 0 : _k.roll
|
|
25681
|
+
};
|
|
25682
|
+
}
|
|
25623
25683
|
}
|
|
25624
25684
|
let newLens = camera.cameraFrustum;
|
|
25625
25685
|
if (newLens == null) {
|
|
@@ -25649,8 +25709,24 @@ async function renderNavigator(iteration, params, bookmark, view, getters) {
|
|
|
25649
25709
|
// TODO: Need global default.
|
|
25650
25710
|
transition = 2000;
|
|
25651
25711
|
}
|
|
25652
|
-
|
|
25653
|
-
|
|
25712
|
+
let pos3d;
|
|
25713
|
+
if (contentType == ProjectViewBookmark.EContentType.WEB_3D_MODEL_SPACE) {
|
|
25714
|
+
if (Cartes.ValidateCartes3(camera)) {
|
|
25715
|
+
const point = modelSpaceToPosition(camera);
|
|
25716
|
+
if (point && Carto.ValidateCarto(point)) {
|
|
25717
|
+
pos3d = Cartesian3.fromDegrees(+point.longitude, +point.latitude, +point.altitude);
|
|
25718
|
+
}
|
|
25719
|
+
}
|
|
25720
|
+
else if (Carto.ValidateCarto(camera)) {
|
|
25721
|
+
pos3d = Cartesian3.fromDegrees(+camera.longitude, +camera.latitude, +camera.altitude);
|
|
25722
|
+
}
|
|
25723
|
+
}
|
|
25724
|
+
else {
|
|
25725
|
+
if (Carto.ValidateCarto(camera)) {
|
|
25726
|
+
pos3d = Cartesian3.fromDegrees(+camera.longitude, +camera.latitude, +camera.altitude);
|
|
25727
|
+
}
|
|
25728
|
+
}
|
|
25729
|
+
if (pos3d) {
|
|
25654
25730
|
if (
|
|
25655
25731
|
// Moving into model-space.
|
|
25656
25732
|
(contentType == ProjectViewBookmark.EContentType.WEB_3D_MODEL_SPACE) ||
|
|
@@ -25661,12 +25737,12 @@ async function renderNavigator(iteration, params, bookmark, view, getters) {
|
|
|
25661
25737
|
if (!cameraPos3d || (cameraPos3d.x == 0 && cameraPos3d.y == 0 && cameraPos3d.z == 0)) {
|
|
25662
25738
|
transition = 0;
|
|
25663
25739
|
}
|
|
25664
|
-
else if (Cartesian3.distance(cameraPos3d,
|
|
25740
|
+
else if (Cartesian3.distance(cameraPos3d, pos3d) > 10000) {
|
|
25665
25741
|
transition = 0;
|
|
25666
25742
|
}
|
|
25667
25743
|
}
|
|
25668
25744
|
scene.camera.flyTo({
|
|
25669
|
-
destination:
|
|
25745
|
+
destination: pos3d,
|
|
25670
25746
|
orientation: {
|
|
25671
25747
|
heading: Math$1.toRadians(+camera.heading),
|
|
25672
25748
|
pitch: Math$1.toRadians(+camera.pitch),
|
|
@@ -26147,7 +26223,7 @@ var ViewRenderEngine;
|
|
|
26147
26223
|
* @param params
|
|
26148
26224
|
*/
|
|
26149
26225
|
async function FlyTo(params) {
|
|
26150
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
26226
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
26151
26227
|
if (!params.manager && params.viewer) {
|
|
26152
26228
|
params.manager = ViewerUtils.GetManager({
|
|
26153
26229
|
viewer: params.viewer,
|
|
@@ -26181,21 +26257,45 @@ var ViewRenderEngine;
|
|
|
26181
26257
|
const scene = viewer.scene;
|
|
26182
26258
|
const vSettings = view.Settings;
|
|
26183
26259
|
const defaults = (_a = vSettings.defaults) !== null && _a !== void 0 ? _a : {};
|
|
26184
|
-
|
|
26185
|
-
|
|
26186
|
-
|
|
26187
|
-
|
|
26188
|
-
|
|
26189
|
-
|
|
26190
|
-
|
|
26191
|
-
|
|
26192
|
-
|
|
26193
|
-
|
|
26194
|
-
|
|
26260
|
+
const bSettings = ((_b = bookmark === null || bookmark === void 0 ? void 0 : bookmark.Settings) !== null && _b !== void 0 ? _b : {});
|
|
26261
|
+
let contentType = bSettings.contentType;
|
|
26262
|
+
if (!contentType && ((_c = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _c === void 0 ? void 0 : _c.contentType)) {
|
|
26263
|
+
contentType = defaults.settings.contentType;
|
|
26264
|
+
}
|
|
26265
|
+
if (contentType == null) {
|
|
26266
|
+
contentType = ProjectViewBookmark.EContentType.WEB_3D;
|
|
26267
|
+
}
|
|
26268
|
+
let camera = ((_d = bookmark === null || bookmark === void 0 ? void 0 : bookmark.Camera) !== null && _d !== void 0 ? _d : {});
|
|
26269
|
+
if (contentType == ProjectViewBookmark.EContentType.WEB_3D_MODEL_SPACE) {
|
|
26270
|
+
if (!Cartes.ValidateCartes3(camera) && !Carto.ValidateCarto(camera)) {
|
|
26271
|
+
camera = {
|
|
26272
|
+
altitude: 500,
|
|
26273
|
+
latitude: 0,
|
|
26274
|
+
longitude: 0,
|
|
26275
|
+
heading: 0,
|
|
26276
|
+
pitch: -90,
|
|
26277
|
+
roll: 0,
|
|
26278
|
+
cameraFrustum: Camera.EFrustum.Perspective,
|
|
26279
|
+
transition: 2000
|
|
26280
|
+
};
|
|
26281
|
+
}
|
|
26282
|
+
}
|
|
26283
|
+
else {
|
|
26284
|
+
if (!Carto.ValidateCarto(camera)) {
|
|
26285
|
+
camera = {
|
|
26286
|
+
...camera,
|
|
26287
|
+
altitude: (_e = defaults.camera) === null || _e === void 0 ? void 0 : _e.altitude,
|
|
26288
|
+
latitude: (_f = defaults.camera) === null || _f === void 0 ? void 0 : _f.latitude,
|
|
26289
|
+
longitude: (_g = defaults.camera) === null || _g === void 0 ? void 0 : _g.longitude,
|
|
26290
|
+
heading: (_h = defaults.camera) === null || _h === void 0 ? void 0 : _h.heading,
|
|
26291
|
+
pitch: (_j = defaults.camera) === null || _j === void 0 ? void 0 : _j.pitch,
|
|
26292
|
+
roll: (_k = defaults.camera) === null || _k === void 0 ? void 0 : _k.roll
|
|
26293
|
+
};
|
|
26294
|
+
}
|
|
26195
26295
|
}
|
|
26196
26296
|
let newLens = camera.cameraFrustum;
|
|
26197
26297
|
if (newLens == null) {
|
|
26198
|
-
newLens = (
|
|
26298
|
+
newLens = (_l = defaults.camera) === null || _l === void 0 ? void 0 : _l.cameraFrustum;
|
|
26199
26299
|
}
|
|
26200
26300
|
if (newLens == null) {
|
|
26201
26301
|
// TODO: Need global default.
|
|
@@ -26214,16 +26314,46 @@ var ViewRenderEngine;
|
|
|
26214
26314
|
}
|
|
26215
26315
|
let transition = params.skipTransition ? 0 : shouldBe2d === curIs2d ? camera.transition : 0;
|
|
26216
26316
|
if (transition == null) {
|
|
26217
|
-
transition = (
|
|
26317
|
+
transition = (_m = defaults.camera) === null || _m === void 0 ? void 0 : _m.transition;
|
|
26218
26318
|
}
|
|
26219
26319
|
if (transition == null) {
|
|
26220
26320
|
// TODO: Need global default.
|
|
26221
26321
|
transition = 2000;
|
|
26222
26322
|
}
|
|
26223
|
-
|
|
26224
|
-
|
|
26323
|
+
let pos3d;
|
|
26324
|
+
if (contentType == ProjectViewBookmark.EContentType.WEB_3D_MODEL_SPACE) {
|
|
26325
|
+
if (Cartes.ValidateCartes3(camera)) {
|
|
26326
|
+
const point = modelSpaceToPosition(camera);
|
|
26327
|
+
if (point && Carto.ValidateCarto(point)) {
|
|
26328
|
+
pos3d = Cartesian3.fromDegrees(+point.longitude, +point.latitude, +point.altitude);
|
|
26329
|
+
}
|
|
26330
|
+
}
|
|
26331
|
+
else if (Carto.ValidateCarto(camera)) {
|
|
26332
|
+
pos3d = Cartesian3.fromDegrees(+camera.longitude, +camera.latitude, +camera.altitude);
|
|
26333
|
+
}
|
|
26334
|
+
}
|
|
26335
|
+
else {
|
|
26336
|
+
if (Carto.ValidateCarto(camera)) {
|
|
26337
|
+
pos3d = Cartesian3.fromDegrees(+camera.longitude, +camera.latitude, +camera.altitude);
|
|
26338
|
+
}
|
|
26339
|
+
}
|
|
26340
|
+
if (pos3d) {
|
|
26341
|
+
if (
|
|
26342
|
+
// Moving into model-space.
|
|
26343
|
+
(contentType == ProjectViewBookmark.EContentType.WEB_3D_MODEL_SPACE) ||
|
|
26344
|
+
// Moving away from model-space.
|
|
26345
|
+
// @ts-expect-error
|
|
26346
|
+
(contentType != ProjectViewBookmark.EContentType.WEB_3D_MODEL_SPACE && viewer[MODEL_SPACE_FLAG] == true)) {
|
|
26347
|
+
const cameraPos3d = viewer.camera.position;
|
|
26348
|
+
if (!cameraPos3d || (cameraPos3d.x == 0 && cameraPos3d.y == 0 && cameraPos3d.z == 0)) {
|
|
26349
|
+
transition = 0;
|
|
26350
|
+
}
|
|
26351
|
+
else if (Cartesian3.distance(cameraPos3d, pos3d) > 10000) {
|
|
26352
|
+
transition = 0;
|
|
26353
|
+
}
|
|
26354
|
+
}
|
|
26225
26355
|
scene.camera.flyTo({
|
|
26226
|
-
destination:
|
|
26356
|
+
destination: pos3d,
|
|
26227
26357
|
orientation: {
|
|
26228
26358
|
heading: Math$1.toRadians(+camera.heading),
|
|
26229
26359
|
pitch: Math$1.toRadians(+camera.pitch),
|
|
@@ -31964,7 +32094,7 @@ class WidgetViewBar extends Widget.AWidget {
|
|
|
31964
32094
|
}
|
|
31965
32095
|
}
|
|
31966
32096
|
|
|
31967
|
-
const VERSION = "5.
|
|
32097
|
+
const VERSION = "5.7.1";
|
|
31968
32098
|
|
|
31969
32099
|
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 };
|
|
31970
32100
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|