bruce-cesium 5.0.1 → 5.0.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.
@@ -1,6 +1,6 @@
1
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, 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, HorizontalOrigin, VerticalOrigin, ConstantProperty, ClassificationType, ConstantPositionProperty, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, Quaternion, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
3
+ import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, ClassificationType, ArcType, CornerType, ShadowMode, ConstantProperty, ConstantPositionProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, SceneMode, GeoJsonDataSource, Primitive, Cesium3DTileFeature, HorizontalOrigin, VerticalOrigin, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, Cesium3DTileset, PolygonPipeline, Matrix4, Matrix3, IonResource, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, BoundingSphere, GeometryInstance, Quaternion, ScreenSpaceEventHandler, ScreenSpaceEventType, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
4
4
 
5
5
  const TIME_LAG = 300;
6
6
  const POSITION_CHECK_TIMER = 950;
@@ -25932,20 +25932,352 @@ var MeasureCreator;
25932
25932
  MeasureCreator.Polygon = Polygon;
25933
25933
  })(MeasureCreator || (MeasureCreator = {}));
25934
25934
 
25935
+ var EAction;
25936
+ (function (EAction) {
25937
+ EAction["Forward"] = "f";
25938
+ EAction["Backward"] = "b";
25939
+ EAction["Left"] = "l";
25940
+ EAction["Right"] = "r";
25941
+ EAction["Up"] = "u";
25942
+ EAction["Down"] = "d";
25943
+ EAction["LookUp"] = "lu";
25944
+ EAction["LookDown"] = "ld";
25945
+ EAction["LookLeft"] = "ll";
25946
+ EAction["LookRight"] = "lr";
25947
+ EAction["Looking"] = "looking";
25948
+ })(EAction || (EAction = {}));
25949
+ const DEFAULT_WALK_MOVE_RATE = 0.2;
25950
+ const DEFAULT_FLY_MOVE_RATE = 0.2;
25951
+ const DEFAULT_MOVE_TYPE = null;
25952
+ const VIEWER_WALKTHROUGH_DATA_KEY = "_cesiumWalkthroughData";
25953
+ /**
25954
+ * Returns heading of camera towards where movement is happening.
25955
+ * @returns
25956
+ */
25957
+ function getMovementHeading(viewer) {
25958
+ var _a;
25959
+ const actions = (_a = viewer[VIEWER_WALKTHROUGH_DATA_KEY]) === null || _a === void 0 ? void 0 : _a.actions;
25960
+ if (!actions) {
25961
+ return 0;
25962
+ }
25963
+ let heading = Math$1.toDegrees(viewer.camera.heading);
25964
+ let count = 0;
25965
+ let totalHeading = 0;
25966
+ let left = actions.get(EAction.Left);
25967
+ if (left) {
25968
+ totalHeading += heading + 270;
25969
+ count += 1;
25970
+ }
25971
+ if (actions.get(EAction.Right)) {
25972
+ totalHeading += heading + 90;
25973
+ count += 1;
25974
+ }
25975
+ let forward = actions.get(EAction.Forward);
25976
+ if (forward) {
25977
+ totalHeading += heading;
25978
+ count += 1;
25979
+ }
25980
+ if (actions.get(EAction.Backward)) {
25981
+ totalHeading += heading + 180;
25982
+ count += 1;
25983
+ }
25984
+ if (left && forward) {
25985
+ totalHeading = heading - 45;
25986
+ }
25987
+ else {
25988
+ totalHeading /= count;
25989
+ }
25990
+ return totalHeading;
25991
+ }
25992
+ /**
25993
+ * Updates camera position and orientation based on current actions.
25994
+ */
25995
+ function doMovementTick(viewer) {
25996
+ const data = viewer[VIEWER_WALKTHROUGH_DATA_KEY];
25997
+ if (!data) {
25998
+ return;
25999
+ }
26000
+ const canvas = viewer.canvas;
26001
+ const camera = viewer.camera;
26002
+ const moveRate = data.moveType == Walkthrough.EMoveType.Walk ? data.walkMoveRate : data.flyMoveRate;
26003
+ if (data.actions.get(EAction.Looking)) {
26004
+ let width = canvas.clientWidth;
26005
+ let height = canvas.clientHeight;
26006
+ // Coordinate (0.0, 0.0) will be where the mouse was clicked.
26007
+ let x = (data.mousePosCurrent.x - data.mousePosStart.x) / width;
26008
+ let y = -(data.mousePosCurrent.y - data.mousePosStart.y) / height;
26009
+ let lookFactor = 0.1;
26010
+ camera.lookRight(x * lookFactor);
26011
+ camera.lookUp(y * lookFactor);
26012
+ }
26013
+ let lookStep = 0.03;
26014
+ if (data.actions.get(EAction.LookLeft)) {
26015
+ camera.lookLeft(lookStep);
26016
+ }
26017
+ if (data.actions.get(EAction.LookRight)) {
26018
+ camera.lookRight(lookStep);
26019
+ }
26020
+ if (data.actions.get(EAction.LookUp)) {
26021
+ camera.lookUp(lookStep);
26022
+ }
26023
+ if (data.actions.get(EAction.LookDown)) {
26024
+ camera.lookDown(lookStep);
26025
+ }
26026
+ if (data.actions.get(EAction.Up)) {
26027
+ camera.moveUp(moveRate / 2);
26028
+ }
26029
+ if (data.actions.get(EAction.Down)) {
26030
+ camera.moveDown(moveRate / 2);
26031
+ }
26032
+ if (camera.roll > 0) {
26033
+ camera.twistLeft(camera.roll);
26034
+ }
26035
+ else if (camera.roll < 0) {
26036
+ camera.twistRight(camera.roll * -1);
26037
+ }
26038
+ // If movement type is fly use cesium movement methods
26039
+ if (data.moveType == Walkthrough.EMoveType.Fly) {
26040
+ if (data.actions.get(EAction.Forward)) {
26041
+ camera.moveForward(moveRate);
26042
+ }
26043
+ if (data.actions.get(EAction.Backward)) {
26044
+ camera.moveBackward(moveRate);
26045
+ }
26046
+ if (data.actions.get(EAction.Left)) {
26047
+ camera.moveLeft(moveRate);
26048
+ }
26049
+ if (data.actions.get(EAction.Right)) {
26050
+ camera.moveRight(moveRate);
26051
+ }
26052
+ }
26053
+ // If movement type is walk, calculate new position without affecting altitude
26054
+ else {
26055
+ if (data.actions.get(EAction.Left) ||
26056
+ data.actions.get(EAction.Right) ||
26057
+ data.actions.get(EAction.Forward) ||
26058
+ data.actions.get(EAction.Backward)) {
26059
+ const heading = getMovementHeading(viewer);
26060
+ const pos = viewer.camera.positionCartographic;
26061
+ const newPos = _offsetPoint$1({
26062
+ altitude: pos.height,
26063
+ latitude: Math$1.toDegrees(pos.latitude),
26064
+ longitude: Math$1.toDegrees(pos.longitude)
26065
+ }, moveRate, heading);
26066
+ camera.position = Cartesian3.fromDegrees(newPos.longitude, newPos.latitude, newPos.altitude);
26067
+ }
26068
+ }
26069
+ viewer.scene.requestRender();
26070
+ }
26071
+ /**
26072
+ * Moves a given point by a given distance towards a heading.
26073
+ * @param point in degrees.
26074
+ * @param distance in meters.
26075
+ * @param heading in degrees.
26076
+ * @returns
26077
+ */
26078
+ function _offsetPoint$1(point, distance, heading) {
26079
+ // Radius of earth.
26080
+ const radius = 6371e3;
26081
+ const δ = distance / radius;
26082
+ const θ = Math$1.toRadians(heading);
26083
+ const φ1 = Math$1.toRadians(point.latitude);
26084
+ const λ1 = Math$1.toRadians(point.longitude);
26085
+ const sinφ2 = Math.sin(φ1) * Math.cos(δ) + Math.cos(φ1) * Math.sin(δ) * Math.cos(θ);
26086
+ const φ2 = Math.asin(sinφ2);
26087
+ const y = Math.sin(θ) * Math.sin(δ) * Math.cos(φ1);
26088
+ const x = Math.cos(δ) - Math.sin(φ1) * sinφ2;
26089
+ const λ2 = λ1 + Math.atan2(y, x);
26090
+ return {
26091
+ altitude: point.altitude,
26092
+ latitude: Math$1.toDegrees(φ2),
26093
+ longitude: Math$1.toDegrees(λ2)
26094
+ };
26095
+ }
26096
+ /**
26097
+ * Checks given keyboard key against keybinds and sets action accordingly.
26098
+ * @param key
26099
+ * @param keyDown
26100
+ */
26101
+ function checkKeybind(viewer, key, keyDown) {
26102
+ const data = viewer[VIEWER_WALKTHROUGH_DATA_KEY];
26103
+ if (!data) {
26104
+ return;
26105
+ }
26106
+ key = key.toLowerCase();
26107
+ if (key == "w") {
26108
+ data.actions.set(EAction.Forward, keyDown);
26109
+ }
26110
+ else if (key == "s") {
26111
+ data.actions.set(EAction.Backward, keyDown);
26112
+ }
26113
+ else if (key == "a") {
26114
+ data.actions.set(EAction.Left, keyDown);
26115
+ }
26116
+ else if (key == "d") {
26117
+ data.actions.set(EAction.Right, keyDown);
26118
+ }
26119
+ else if (key == "q") {
26120
+ data.actions.set(EAction.Up, keyDown);
26121
+ }
26122
+ else if (key == "e") {
26123
+ data.actions.set(EAction.Down, keyDown);
26124
+ }
26125
+ else if (key == "arrowup") {
26126
+ data.actions.set(EAction.LookUp, keyDown);
26127
+ }
26128
+ else if (key == "arrowdown") {
26129
+ data.actions.set(EAction.LookDown, keyDown);
26130
+ }
26131
+ else if (key == "arrowleft") {
26132
+ data.actions.set(EAction.LookLeft, keyDown);
26133
+ }
26134
+ else if (key == "arrowright") {
26135
+ data.actions.set(EAction.LookRight, keyDown);
26136
+ }
26137
+ }
26138
+ var Walkthrough;
26139
+ (function (Walkthrough) {
26140
+ let EMoveType;
26141
+ (function (EMoveType) {
26142
+ EMoveType["Walk"] = "WALK";
26143
+ EMoveType["Fly"] = "FLY";
26144
+ })(EMoveType = Walkthrough.EMoveType || (Walkthrough.EMoveType = {}));
26145
+ function Start(params) {
26146
+ Stop(params);
26147
+ const viewer = params.viewer;
26148
+ const data = viewer[VIEWER_WALKTHROUGH_DATA_KEY] = {
26149
+ walkMoveRate: DEFAULT_WALK_MOVE_RATE,
26150
+ flyMoveRate: DEFAULT_FLY_MOVE_RATE,
26151
+ moveType: DEFAULT_MOVE_TYPE,
26152
+ actions: new Map(),
26153
+ ...viewer[VIEWER_WALKTHROUGH_DATA_KEY]
26154
+ };
26155
+ data.handlerScreenSpace = new ScreenSpaceEventHandler(viewer.canvas);
26156
+ ViewUtils.SetLockedCameraStatus({
26157
+ viewer: viewer,
26158
+ status: true
26159
+ });
26160
+ let lastCheck;
26161
+ let currentTime = new Date();
26162
+ data.tickRemoval = viewer.clock.onTick.addEventListener(async () => {
26163
+ lastCheck = new Date();
26164
+ if (lastCheck.getTime() - currentTime.getTime() > (1000 / 60)) {
26165
+ doMovementTick(viewer);
26166
+ currentTime = new Date();
26167
+ }
26168
+ });
26169
+ document.addEventListener("keydown", data.handlerKeyDown = (e) => {
26170
+ checkKeybind(viewer, e.key, true);
26171
+ }, false);
26172
+ document.addEventListener("keyup", data.handlerKeyUp = (e) => {
26173
+ checkKeybind(viewer, e.key, false);
26174
+ }, false);
26175
+ data.handlerScreenSpace.setInputAction((e) => {
26176
+ data.actions.set(EAction.Looking, true);
26177
+ data.mousePosCurrent = data.mousePosStart = Cartesian2.clone(e.position);
26178
+ }, ScreenSpaceEventType.LEFT_DOWN);
26179
+ data.handlerScreenSpace.setInputAction(((e) => {
26180
+ data.mousePosCurrent = e.endPosition;
26181
+ }), ScreenSpaceEventType.MOUSE_MOVE);
26182
+ data.handlerScreenSpace.setInputAction(() => {
26183
+ data.actions.set(EAction.Looking, false);
26184
+ }, ScreenSpaceEventType.LEFT_UP);
26185
+ }
26186
+ Walkthrough.Start = Start;
26187
+ function Stop(params) {
26188
+ var _a, _b;
26189
+ const viewer = params.viewer;
26190
+ const data = viewer[VIEWER_WALKTHROUGH_DATA_KEY];
26191
+ ViewUtils.SetLockedCameraStatus({
26192
+ viewer: viewer,
26193
+ status: false
26194
+ });
26195
+ if (data) {
26196
+ (_a = data.screenSpaceHandler) === null || _a === void 0 ? void 0 : _a.destroy();
26197
+ data.screenSpaceHandler = null;
26198
+ (_b = data.tickRemoval) === null || _b === void 0 ? void 0 : _b.call(data);
26199
+ data.tickRemoval = null;
26200
+ if (data.keyDownHandler) {
26201
+ document.removeEventListener("keydown", data.keyDownHandler);
26202
+ data.keyDownHandler = null;
26203
+ }
26204
+ if (data.keyUpHandler) {
26205
+ document.removeEventListener("keyup", data.keyUpHandler);
26206
+ data.keyUpHandler = null;
26207
+ }
26208
+ }
26209
+ }
26210
+ Walkthrough.Stop = Stop;
26211
+ function IsRunning(params) {
26212
+ const viewer = params.viewer;
26213
+ const data = viewer[VIEWER_WALKTHROUGH_DATA_KEY];
26214
+ return (data === null || data === void 0 ? void 0 : data.handlerScreenSpace) != null;
26215
+ }
26216
+ Walkthrough.IsRunning = IsRunning;
26217
+ function SetWalkMoveRate(params) {
26218
+ var _a;
26219
+ const data = (_a = params.viewer) === null || _a === void 0 ? void 0 : _a[VIEWER_WALKTHROUGH_DATA_KEY];
26220
+ if (data) {
26221
+ data.walkMoveRate = params.rate;
26222
+ }
26223
+ }
26224
+ Walkthrough.SetWalkMoveRate = SetWalkMoveRate;
26225
+ function SetMoveType(params) {
26226
+ var _a;
26227
+ const data = (_a = params.viewer) === null || _a === void 0 ? void 0 : _a[VIEWER_WALKTHROUGH_DATA_KEY];
26228
+ if (data) {
26229
+ data.moveType = params.type;
26230
+ }
26231
+ }
26232
+ Walkthrough.SetMoveType = SetMoveType;
26233
+ function GetWalkMoveRate(params) {
26234
+ var _a;
26235
+ const data = (_a = params.viewer) === null || _a === void 0 ? void 0 : _a[VIEWER_WALKTHROUGH_DATA_KEY];
26236
+ return data === null || data === void 0 ? void 0 : data.walkMoveRate;
26237
+ }
26238
+ Walkthrough.GetWalkMoveRate = GetWalkMoveRate;
26239
+ function GetFlyMoveRate(params) {
26240
+ var _a;
26241
+ const data = (_a = params.viewer) === null || _a === void 0 ? void 0 : _a[VIEWER_WALKTHROUGH_DATA_KEY];
26242
+ return data === null || data === void 0 ? void 0 : data.flyMoveRate;
26243
+ }
26244
+ Walkthrough.GetFlyMoveRate = GetFlyMoveRate;
26245
+ function SetFlyMoveRate(params) {
26246
+ var _a;
26247
+ const data = (_a = params.viewer) === null || _a === void 0 ? void 0 : _a[VIEWER_WALKTHROUGH_DATA_KEY];
26248
+ if (data) {
26249
+ data.flyMoveRate = params.rate;
26250
+ }
26251
+ }
26252
+ Walkthrough.SetFlyMoveRate = SetFlyMoveRate;
26253
+ function GetMoveType(params) {
26254
+ var _a;
26255
+ const data = (_a = params.viewer) === null || _a === void 0 ? void 0 : _a[VIEWER_WALKTHROUGH_DATA_KEY];
26256
+ return data === null || data === void 0 ? void 0 : data.moveType;
26257
+ }
26258
+ Walkthrough.GetMoveType = GetMoveType;
26259
+ })(Walkthrough || (Walkthrough = {}));
26260
+
25935
26261
  var ECursor;
25936
26262
  (function (ECursor) {
25937
26263
  ECursor["Select"] = "select";
25938
26264
  ECursor["Pan"] = "pan";
25939
26265
  ECursor["Measure"] = "measure";
26266
+ ECursor["Walkthrough"] = "walkthrough";
25940
26267
  })(ECursor || (ECursor = {}));
25941
26268
  var ESecondaryCursor;
25942
26269
  (function (ESecondaryCursor) {
25943
26270
  ESecondaryCursor["None"] = "none";
26271
+ ESecondaryCursor["Select"] = "select";
25944
26272
  ESecondaryCursor["Pan"] = "pan";
25945
26273
  ESecondaryCursor["MeasurePoint"] = "measure-point";
25946
26274
  ESecondaryCursor["MeasurePolyline"] = "measure-polyline";
25947
26275
  ESecondaryCursor["MeasurePolygon"] = "measure-polygon";
25948
26276
  })(ESecondaryCursor || (ESecondaryCursor = {}));
26277
+ const KEY_WALKTHROUGH_MODE = "WidgetCursorBar.Walkthrough.Mode";
26278
+ const KEY_WALKTHROUGH_SPEED_FLY = "WidgetCursorBar.Walkthrough.SpeedFly";
26279
+ const KEY_WALKTHROUGH_SPEED_WALK = "WidgetCursorBar.Walkthrough.SpeedWalk";
26280
+ const KEY_WALKTHROUGH_EXPANDED = "WidgetCursorBar.Walkthrough.Expanded";
25949
26281
  class WidgetCursorBar extends Widget.AWidget {
25950
26282
  constructor(params) {
25951
26283
  super(params);
@@ -25954,18 +26286,24 @@ class WidgetCursorBar extends Widget.AWidget {
25954
26286
  this._selectedSecondaryCursor = ESecondaryCursor.None;
25955
26287
  this._generateStyles();
25956
26288
  this._generateElement();
25957
- if (this._selectedCursor == ECursor.Select) {
26289
+ if (this._selectedCursor == ECursor.Select || this._selectedSecondaryCursor == ESecondaryCursor.Select) {
25958
26290
  this._listenSelection();
25959
26291
  }
25960
26292
  }
25961
26293
  Dispose() {
25962
- var _a, _b;
26294
+ var _a, _b, _c;
25963
26295
  super.Dispose();
25964
26296
  this._disposeMeasureTool();
25965
26297
  this._disposeCesiumEvent();
26298
+ this._disposeWalkthroughBar();
25966
26299
  if ((_b = (_a = this._viewer) === null || _a === void 0 ? void 0 : _a.canvas) === null || _b === void 0 ? void 0 : _b.style.cursor) {
25967
26300
  this._viewer.canvas.style.removeProperty("cursor");
25968
26301
  }
26302
+ if (((_c = this._viewer) === null || _c === void 0 ? void 0 : _c.scene) && !this._viewer.isDestroyed()) {
26303
+ Walkthrough.Stop({
26304
+ viewer: this._viewer
26305
+ });
26306
+ }
25969
26307
  }
25970
26308
  _generateStyles() {
25971
26309
  if (document.getElementById(this.STYLESHEET_ID)) {
@@ -26132,6 +26470,165 @@ class WidgetCursorBar extends Widget.AWidget {
26132
26470
  -webkit-transform: scale(1.2);
26133
26471
  transform: scale(1.2);
26134
26472
  }
26473
+
26474
+ .NextspaceWalkthroughBar {
26475
+ position: absolute;
26476
+ z-index: 1;
26477
+ bottom: 10px;
26478
+ left: calc(45px + var(${VIEWER_LEFT_PANEL_CSS_VAR_LEFT}));
26479
+ width: min(1100px, calc(100vw - 205px));
26480
+ box-sizing: border-box;
26481
+ display: flex;
26482
+ flex-direction: column;
26483
+ pointer-events: auto;
26484
+ font-size: 12px;
26485
+ font-family: Arial;
26486
+ transition: 0.3s ease;
26487
+ }
26488
+
26489
+ .NextspaceWalkthroughBar * {
26490
+ box-sizing: border-box;
26491
+ }
26492
+
26493
+ .NextspaceWalkthroughBar[expanded="false"] {
26494
+ width: 395px;
26495
+ }
26496
+
26497
+ .NextspaceWalkthroughBar[expanded="false"] .NextspaceWalkthroughBarInputs {
26498
+ flex-direction: row;
26499
+ margin-right: 0;
26500
+ }
26501
+
26502
+ .NextspaceWalkthroughBar[expanded="false"] .NextspaceWalkthroughBarRow {
26503
+ margin-right: 25px;
26504
+ margin-bottom: 0;
26505
+ }
26506
+
26507
+ .NextspaceWalkthroughBar[expanded="false"] .NextspaceWalkthroughBarRowTip,
26508
+ .NextspaceWalkthroughBar[expanded="false"] .NextspaceWalkthroughBarTips {
26509
+ display: none;
26510
+ }
26511
+
26512
+ .NextspaceWalkthroughBarContent {
26513
+ background-color: white;
26514
+ border-radius: 8px;
26515
+ display: flex;
26516
+ flex-direction: row;
26517
+ padding: 14px 18px;
26518
+ }
26519
+
26520
+ .NextspaceWalkthroughBarTitle {
26521
+ opacity: 0.7;
26522
+ color: white;
26523
+ font-size: 12px;
26524
+ font-family: Arial;
26525
+ font-style: normal;
26526
+ letter-spacing: 0.15em;
26527
+ margin-bottom: 15px;
26528
+ position: absolute;
26529
+ top: -15px;
26530
+ left: 5px;
26531
+ }
26532
+
26533
+ .NextspaceWalkthroughBarInputs {
26534
+ display: flex;
26535
+ flex-direction: column;
26536
+ margin-right: 40px;
26537
+ }
26538
+
26539
+ .NextspaceWalkthroughBarRowTip {
26540
+ color: #000;
26541
+ font-family: Arial;
26542
+ font-size: 12px;
26543
+ font-style: normal;
26544
+ font-weight: 300;
26545
+ letter-spacing: .01em;
26546
+ background: #efefefbf;
26547
+ padding: 8px;
26548
+ gap: 6px;
26549
+ border-radius: 5px;
26550
+ }
26551
+
26552
+ .NextspaceWalkthroughBarRow {
26553
+ align-items: center;
26554
+ display: flex;
26555
+ margin-bottom: 5px;
26556
+ }
26557
+
26558
+ .NextspaceWalkthroughBarInputs .NextspaceWalkthroughBarRow {
26559
+ margin-right: 20px;
26560
+ }
26561
+
26562
+ .NextspaceWalkthroughBarRowLabel {
26563
+ margin-right: 8px;
26564
+ flex-shrink: 0;
26565
+ }
26566
+
26567
+ .NextspaceWalkthroughBarRowValue {
26568
+ flex-grow: 1;
26569
+ max-width: 120px;
26570
+ }
26571
+
26572
+ .NextspaceWalkthroughBarRowValue input {
26573
+ width: 100%;
26574
+ padding: 4px;
26575
+ border: 1px solid #ccc;
26576
+ border-radius: 4px;
26577
+ }
26578
+
26579
+ .NextspaceWalkthroughBarIcon {
26580
+ margin-right: 20px;
26581
+ flex-shrink: 0;
26582
+ }
26583
+
26584
+ .NextspaceWalkthroughButtonClose {
26585
+ position: absolute;
26586
+ top: 6px;
26587
+ right: 8px;
26588
+ z-index: 1;
26589
+ font-size: 25px;
26590
+ color: black;
26591
+ cursor: pointer;
26592
+ transition: 0.3s ease;
26593
+ }
26594
+
26595
+ .NextspaceWalkthroughButtonExpand {
26596
+ position: absolute;
26597
+ top: 6px;
26598
+ right: 40px;
26599
+ z-index: 1;
26600
+ font-size: 25px;
26601
+ color: black;
26602
+ cursor: pointer;
26603
+ transition: 0.3s ease;
26604
+ display: flex;
26605
+ align-items: center;
26606
+ justify-content: center;
26607
+ height: 24px;
26608
+ width: 24px;
26609
+ }
26610
+
26611
+ .NextspaceWalkthroughButtonClose:hover,
26612
+ .NextspaceWalkthroughButtonExpand:hover {
26613
+ transform: scale(1.2);
26614
+ }
26615
+
26616
+ .NextspaceWalkthroughBarTips {
26617
+ flex-grow: 1;
26618
+ flex-shrink: 1;
26619
+ display: flex;
26620
+ color: black;
26621
+ font-size: 12px;
26622
+ font-family: Arial;
26623
+ }
26624
+
26625
+ .NextspaceWalkthroughBarTips >* {
26626
+ margin-right: 24px;
26627
+ }
26628
+
26629
+ .NextspaceWalkthroughBarTips >*:last-child {
26630
+ margin-right: 0;
26631
+ }
26135
26632
  `;
26136
26633
  document.head.appendChild(style);
26137
26634
  }
@@ -26157,6 +26654,7 @@ class WidgetCursorBar extends Widget.AWidget {
26157
26654
  this._generateSelect();
26158
26655
  this._generatePan();
26159
26656
  this._generateMeasure();
26657
+ this._generateWalkthrough();
26160
26658
  this._updateControls();
26161
26659
  this.Container.appendChild(element);
26162
26660
  this._element = element;
@@ -26175,8 +26673,16 @@ class WidgetCursorBar extends Widget.AWidget {
26175
26673
  `;
26176
26674
  div.appendChild(inner);
26177
26675
  inner.addEventListener("click", () => {
26676
+ var _a;
26178
26677
  this._disposeMeasureTool();
26179
26678
  this._disposeCesiumEvent();
26679
+ this._disposeWalkthroughBar();
26680
+ if (((_a = this._viewer) === null || _a === void 0 ? void 0 : _a.scene) && !this._viewer.isDestroyed()) {
26681
+ Walkthrough.Stop({
26682
+ viewer: this._viewer
26683
+ });
26684
+ }
26685
+ this._disposeWalkthroughBar();
26180
26686
  onClick();
26181
26687
  this._updateControls();
26182
26688
  });
@@ -26303,6 +26809,334 @@ class WidgetCursorBar extends Widget.AWidget {
26303
26809
  this._enabledMeasureTool.Start();
26304
26810
  }, polygonSvg);
26305
26811
  }
26812
+ _generateWalkthrough() {
26813
+ const svg = `
26814
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
26815
+ <path d="M17.5033 4C16.8406 4 16.205 4.26339 15.7364 4.73223C15.2678 5.20107 15.0045 5.83696 15.0045 6.5C15.0045 7.16304 15.2678 7.79893 15.7364 8.26777C16.205 8.73661 16.8406 9 17.5033 9C18.166 9 18.8015 8.73661 19.2701 8.26777C19.7388 7.79893 20.002 7.16304 20.002 6.5C20.002 5.83696 19.7388 5.20107 19.2701 4.73223C18.8015 4.26339 18.166 4 17.5033 4ZM15.5023 10C15.1066 10 14.7378 10.1015 14.4052 10.2656C14.3549 10.2813 14.306 10.3009 14.2588 10.3242L10.3448 12.1992C10.1322 12.3003 9.96216 12.4733 9.86453 12.6875L8.09784 16.5859C8.0405 16.7059 8.00764 16.836 8.00118 16.9688C7.99472 17.1016 8.01479 17.2344 8.06021 17.3593C8.10563 17.4843 8.1755 17.5989 8.26572 17.6965C8.35594 17.7941 8.46471 17.8727 8.58567 17.9278C8.70662 17.9828 8.83733 18.0132 8.97016 18.0171C9.10299 18.0211 9.23526 17.9984 9.35924 17.9506C9.48323 17.9028 9.59644 17.8307 9.69225 17.7386C9.78806 17.6464 9.86454 17.5361 9.91724 17.4141L11.3638 14.2246L12.658 13.8359C12.3918 15.2411 12.0603 16.9816 12.0587 16.9902C12.0583 16.9923 12.0572 16.994 12.0568 16.9961C12.0568 16.9961 12.0568 17 12.0568 17C12.024 17.1615 12.006 17.3288 12.006 17.5C12.006 18.271 12.3631 18.9514 12.9118 19.4102L12.9196 19.4336L16.8103 22.5L17.923 26.6953L18.0225 27.1953C18.0677 27.4221 18.19 27.6263 18.3687 27.773C18.5474 27.9197 18.7714 27.9999 19.0025 28C19.2676 28 19.5218 27.8946 19.7093 27.7071C19.8967 27.5196 20.002 27.2652 20.002 27C20.0019 26.9344 19.9954 26.869 19.9825 26.8047V26.8008C19.9812 26.7969 19.9799 26.793 19.9786 26.7891L18.983 21.8047C18.9562 21.6693 18.9017 21.541 18.8229 21.4277L16.9528 18.0039C16.9546 17.9951 16.953 17.9854 16.9547 17.9766L17.9366 13.0625L17.9347 13.0605C17.9762 12.8798 18.003 12.6933 18.003 12.5C18.003 11.1207 16.8837 10.0011 15.5023 10ZM19.3871 13.7422L18.9186 16.0078L19.3344 16.3809C19.4093 16.4489 19.4962 16.5059 19.5882 16.5469L22.5866 17.9102V17.9082C22.7165 17.9681 22.8576 17.9994 23.0005 18C23.2656 18 23.5198 17.8946 23.7073 17.7071C23.8947 17.5196 24 17.2652 24 17C23.9996 16.8084 23.9442 16.6209 23.8404 16.4599C23.7366 16.2989 23.5887 16.1711 23.4144 16.0918V16.0898L20.5545 14.7891L19.3871 13.7422ZM11.9631 20.7246L11.4497 22.4219L9.22228 26.3613L9.1481 26.4863L9.15005 26.4883C9.13825 26.5087 9.12718 26.5296 9.11686 26.5508L9.10905 26.5625C9.0425 26.6987 9.00778 26.8484 9.00754 27C9.00754 27.2652 9.11285 27.5196 9.30029 27.7071C9.48773 27.8946 9.74195 28 10.007 28C10.1647 27.9999 10.3201 27.9626 10.4606 27.891C10.601 27.8193 10.7225 27.7155 10.8152 27.5879H10.8172L10.8328 27.5645C10.8334 27.5632 10.8341 27.5618 10.8347 27.5605L14.1592 22.5117L11.9631 20.7246Z" fill="white"/>
26816
+ </svg>
26817
+ `;
26818
+ this._generateControl("Walkthrough", ECursor.Walkthrough, () => {
26819
+ var _a;
26820
+ this._selectedSecondaryCursor = ESecondaryCursor.Select;
26821
+ this._selectedCursor = this._selectedCursor == ECursor.Walkthrough ? ECursor.Select : ECursor.Walkthrough;
26822
+ if (this._selectedCursor == ECursor.Walkthrough) {
26823
+ this._generateWalkthroughSecondary();
26824
+ this._updateSecondary();
26825
+ if (((_a = this._viewer) === null || _a === void 0 ? void 0 : _a.scene) && !this._viewer.isDestroyed()) {
26826
+ Walkthrough.Start({
26827
+ viewer: this._viewer
26828
+ });
26829
+ let moveType = localStorage.getItem(KEY_WALKTHROUGH_MODE);
26830
+ if (!moveType) {
26831
+ moveType = Walkthrough.EMoveType.Walk;
26832
+ }
26833
+ Walkthrough.SetMoveType({
26834
+ type: moveType,
26835
+ viewer: this._viewer
26836
+ });
26837
+ let speed = localStorage.getItem(KEY_WALKTHROUGH_SPEED_FLY);
26838
+ if (speed != null && !isNaN(+speed)) {
26839
+ Walkthrough.SetFlyMoveRate({
26840
+ rate: +speed,
26841
+ viewer: this._viewer
26842
+ });
26843
+ }
26844
+ speed = localStorage.getItem(KEY_WALKTHROUGH_SPEED_WALK);
26845
+ if (speed != null && !isNaN(+speed)) {
26846
+ Walkthrough.SetWalkMoveRate({
26847
+ rate: +speed,
26848
+ viewer: this._viewer
26849
+ });
26850
+ }
26851
+ }
26852
+ this._generateWalkthroughBar();
26853
+ }
26854
+ else {
26855
+ this._secondary.style.display = "none";
26856
+ }
26857
+ if (this._selectedCursor == ECursor.Select || this._selectedSecondaryCursor == ESecondaryCursor.Select) {
26858
+ this._listenSelection();
26859
+ }
26860
+ }, svg);
26861
+ }
26862
+ _generateWalkthroughSecondary() {
26863
+ this._secondaryContent.innerHTML = "";
26864
+ this._secondary.style.display = "flex";
26865
+ const selectSvg = `
26866
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
26867
+ <path d="M11.0706 25L9 7L23 17.8592L15.3135 18.3375L11.0706 25Z" fill="white" stroke="white" strokeLinejoin="round"/>
26868
+ </svg>
26869
+ `;
26870
+ this._generateSecondaryControl("Select", ESecondaryCursor.Select, () => {
26871
+ this._selectedSecondaryCursor = ESecondaryCursor.Select;
26872
+ this._listenSelection();
26873
+ }, selectSvg);
26874
+ const panSvg = `
26875
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
26876
+ <path d="M15.5652 6C14.9172 6 14.3913 6.51692 14.3913 7.15385V14.4615H13.6087V8.69231C13.6087 8.05538 13.0828 7.53846 12.4348 7.53846C11.7868 7.53846 11.2609 8.05538 11.2609 8.69231V14.4615V16.7692V19.6734C11.2609 19.6734 9.0069 18.2402 7.87211 17.7548C7.55594 17.6194 7.22575 17.5385 6.89079 17.5385C5.1401 17.5385 5 19.0769 5 19.0769L8.13043 21.3846L10.6357 24.3398C11.5279 25.3922 12.85 26 14.243 26H19.8696C21.5983 26 23 24.6223 23 22.9231V14.4615V11C23 10.3631 22.4741 9.84615 21.8261 9.84615C21.1781 9.84615 20.6522 10.3631 20.6522 11V14.4615H19.8696V8.69231C19.8696 8.05538 19.3437 7.53846 18.6957 7.53846C18.0477 7.53846 17.5217 8.05538 17.5217 8.69231V14.4615H16.7391V7.15385C16.7391 6.51692 16.2132 6 15.5652 6Z" fill="white"/>
26877
+ </svg>
26878
+ `;
26879
+ this._generateSecondaryControl("Pan", ESecondaryCursor.Pan, () => {
26880
+ if (this._selectedSecondaryCursor == ESecondaryCursor.Pan) {
26881
+ this._selectedSecondaryCursor = ESecondaryCursor.Select;
26882
+ this._listenSelection();
26883
+ }
26884
+ else {
26885
+ this._selectedSecondaryCursor = ESecondaryCursor.Pan;
26886
+ }
26887
+ this._updateSecondary();
26888
+ }, panSvg);
26889
+ }
26890
+ /**
26891
+ * Generates the Walkthrough controls bar at the bottom of the screen.
26892
+ * This bar will be collapsable to show minimal information.
26893
+ * A TODO is to break this class into pieces similar the ViewBar.
26894
+ */
26895
+ _generateWalkthroughBar() {
26896
+ this._disposeWalkthroughBar();
26897
+ const element = document.createElement("div");
26898
+ element.className = "NextspaceWalkthroughBar";
26899
+ this.Container.appendChild(element);
26900
+ const content = document.createElement("div");
26901
+ content.className = "NextspaceWalkthroughBarContent";
26902
+ element.appendChild(content);
26903
+ const inputs = document.createElement("div");
26904
+ inputs.className = "NextspaceWalkthroughBarInputs";
26905
+ inputs.style.marginRight = "40px";
26906
+ const title = document.createElement("div");
26907
+ title.className = "NextspaceWalkthroughBarTitle";
26908
+ title.innerText = "Walkthrough";
26909
+ inputs.appendChild(title);
26910
+ // Expanded by default to show how to use Walkthrough.
26911
+ let expanded = localStorage.getItem(KEY_WALKTHROUGH_EXPANDED) != "false";
26912
+ // Close button.
26913
+ {
26914
+ const svg = `
26915
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
26916
+ <path d="M18.3002 5.70973C17.9102 5.31973 17.2802 5.31973 16.8902 5.70973L12.0002 10.5897L7.11022 5.69973C6.72022 5.30973 6.09021 5.30973 5.70021 5.69973C5.31021 6.08973 5.31021 6.71973 5.70021 7.10973L10.5902 11.9997L5.70021 16.8897C5.31021 17.2797 5.31021 17.9097 5.70021 18.2997C6.09021 18.6897 6.72022 18.6897 7.11022 18.2997L12.0002 13.4097L16.8902 18.2997C17.2802 18.6897 17.9102 18.6897 18.3002 18.2997C18.6902 17.9097 18.6902 17.2797 18.3002 16.8897L13.4102 11.9997L18.3002 7.10973C18.6802 6.72973 18.6802 6.08973 18.3002 5.70973Z" fill="black"/>
26917
+ </svg>
26918
+ `;
26919
+ const close = document.createElement("div");
26920
+ close.className = "NextspaceWalkthroughButtonClose";
26921
+ close.innerHTML = svg;
26922
+ close.onclick = () => {
26923
+ var _a;
26924
+ // Toggles off the Walkthrough mode (enables first primary cursor).
26925
+ // TODO: We need a more elegant way to handle this.
26926
+ this._secondary.style.display = "none";
26927
+ this._selectedCursor = ECursor.Select;
26928
+ this._selectedSecondaryCursor = ESecondaryCursor.None;
26929
+ this._updateControls();
26930
+ this._updateSecondary();
26931
+ this._disposeWalkthroughBar();
26932
+ this._listenSelection();
26933
+ if (((_a = this._viewer) === null || _a === void 0 ? void 0 : _a.scene) && !this._viewer.isDestroyed()) {
26934
+ Walkthrough.Stop({
26935
+ viewer: this._viewer
26936
+ });
26937
+ }
26938
+ };
26939
+ content.appendChild(close);
26940
+ }
26941
+ // Toggle expand button.
26942
+ {
26943
+ const svgExpand = `
26944
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
26945
+ <path d="M6 14C5.45 14 5 14.45 5 15V18C5 18.55 5.45 19 6 19H9C9.55 19 10 18.55 10 18C10 17.45 9.55 17 9 17H7V15C7 14.45 6.55 14 6 14ZM6 10C6.55 10 7 9.55 7 9V7H9C9.55 7 10 6.55 10 6C10 5.45 9.55 5 9 5H6C5.45 5 5 5.45 5 6V9C5 9.55 5.45 10 6 10ZM17 17H15C14.45 17 14 17.45 14 18C14 18.55 14.45 19 15 19H18C18.55 19 19 18.55 19 18V15C19 14.45 18.55 14 18 14C17.45 14 17 14.45 17 15V17ZM14 6C14 6.55 14.45 7 15 7H17V9C17 9.55 17.45 10 18 10C18.55 10 19 9.55 19 9V6C19 5.45 18.55 5 18 5H15C14.45 5 14 5.45 14 6Z" fill="black"/>
26946
+ </svg>
26947
+ `;
26948
+ const svgMinimize = `
26949
+ <svg width="16" height="2" viewBox="0 0 16 2" fill="none" xmlns="http://www.w3.org/2000/svg">
26950
+ <path d="M15 1L1 0.999999" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
26951
+ </svg>
26952
+ `;
26953
+ const expand = document.createElement("div");
26954
+ expand.className = "NextspaceWalkthroughButtonExpand";
26955
+ expand.innerHTML = expanded ? svgMinimize : svgExpand;
26956
+ expand.onclick = () => {
26957
+ expanded = !expanded;
26958
+ expand.innerHTML = expanded ? svgMinimize : svgExpand;
26959
+ element.setAttribute("expanded", expanded ? "true" : "false");
26960
+ localStorage.setItem(KEY_WALKTHROUGH_EXPANDED, expanded ? "true" : "false");
26961
+ };
26962
+ content.appendChild(expand);
26963
+ element.setAttribute("expanded", expanded ? "true" : "false");
26964
+ }
26965
+ content.appendChild(inputs);
26966
+ const tips = document.createElement("div");
26967
+ tips.className = "NextspaceWalkthroughBarTips";
26968
+ {
26969
+ const wasd = document.createElement("div");
26970
+ wasd.setAttribute("style", `
26971
+ display: flex;
26972
+ flex-direction: column;
26973
+ justify-content: flex-end;
26974
+ `);
26975
+ const wasdSvg = `
26976
+ <svg width="132" height="87" viewBox="0 0 188 124" fill="none" xmlns="http://www.w3.org/2000/svg"><rect y="64" width="60" height="60" rx="6" fill="#ebebeb"></rect><rect x="128" y="64" width="60" height="60" rx="6" fill="#ebebeb"></rect><rect x="64" width="60" height="60" rx="6" fill="#ebebeb"></rect><rect x="64" y="64" width="60" height="60" rx="6" fill="#ebebeb"></rect><path d="M88.2841 39L83.5114 21.5455H85.6591L89.3068 35.7614H89.4773L93.1932 21.5455H95.5795L99.2955 35.7614H99.4659L103.114 21.5455H105.261L100.489 39H98.3068L94.4545 25.0909H94.3182L90.4659 39H88.2841Z" fill="#525252"></path><path d="M24.8295 103H22.6136L29.0227 85.5455H31.2045L37.6136 103H35.3977L30.1818 88.3068H30.0455L24.8295 103ZM25.6477 96.1818H34.5795V98.0568H25.6477V96.1818Z" fill="#525252"></path><path d="M97.6591 89.9091C97.5568 89.0455 97.142 88.375 96.4148 87.8977C95.6875 87.4205 94.7955 87.1818 93.7386 87.1818C92.9659 87.1818 92.2898 87.3068 91.7102 87.5568C91.1364 87.8068 90.6875 88.1506 90.3636 88.5881C90.0455 89.0256 89.8864 89.5227 89.8864 90.0795C89.8864 90.5455 89.9972 90.946 90.2188 91.2812C90.446 91.6108 90.7358 91.8864 91.0881 92.108C91.4403 92.3239 91.8097 92.5028 92.196 92.6449C92.5824 92.7812 92.9375 92.892 93.2614 92.9773L95.0341 93.4545C95.4886 93.5739 95.9943 93.7386 96.5511 93.9489C97.1136 94.1591 97.6506 94.446 98.1619 94.8097C98.679 95.1676 99.1051 95.6278 99.4403 96.1903C99.7756 96.7528 99.9432 97.4432 99.9432 98.2614C99.9432 99.2045 99.696 100.057 99.2017 100.818C98.7131 101.58 97.9972 102.185 97.054 102.634C96.1165 103.082 94.9773 103.307 93.6364 103.307C92.3864 103.307 91.304 103.105 90.3892 102.702C89.4801 102.298 88.7642 101.736 88.2415 101.014C87.7244 100.293 87.4318 99.4545 87.3636 98.5H89.5455C89.6023 99.1591 89.8239 99.7045 90.2102 100.136C90.6023 100.562 91.0966 100.881 91.6932 101.091C92.2955 101.295 92.9432 101.398 93.6364 101.398C94.4432 101.398 95.1676 101.267 95.8097 101.006C96.4517 100.739 96.9602 100.369 97.3352 99.8977C97.7102 99.4205 97.8977 98.8636 97.8977 98.2273C97.8977 97.6477 97.7358 97.1761 97.4119 96.8125C97.0881 96.4489 96.6619 96.1534 96.1335 95.9261C95.6051 95.6989 95.0341 95.5 94.4205 95.3295L92.2727 94.7159C90.9091 94.3239 89.8295 93.7642 89.0341 93.0369C88.2386 92.3097 87.8409 91.358 87.8409 90.1818C87.8409 89.2045 88.1051 88.3523 88.6335 87.625C89.1676 86.892 89.8835 86.3239 90.7812 85.9205C91.6847 85.5114 92.6932 85.3068 93.8068 85.3068C94.9318 85.3068 95.9318 85.5085 96.8068 85.9119C97.6818 86.3097 98.375 86.8551 98.8864 87.5483C99.4034 88.2415 99.6761 89.0284 99.7045 89.9091H97.6591Z" fill="#525252"></path><path d="M157.5 103H152.114V85.5455H157.739C159.432 85.5455 160.881 85.8949 162.085 86.5938C163.29 87.2869 164.213 88.2841 164.855 89.5852C165.497 90.8807 165.818 92.4318 165.818 94.2386C165.818 96.0568 165.494 97.6222 164.847 98.9347C164.199 100.241 163.256 101.247 162.017 101.952C160.778 102.651 159.273 103 157.5 103ZM154.227 101.125H157.364C158.807 101.125 160.003 100.847 160.952 100.29C161.901 99.733 162.608 98.9403 163.074 97.9119C163.54 96.8835 163.773 95.6591 163.773 94.2386C163.773 92.8295 163.543 91.6165 163.082 90.5994C162.622 89.5767 161.935 88.7926 161.02 88.2472C160.105 87.696 158.966 87.4205 157.602 87.4205H154.227V101.125Z" fill="#525252"></path></svg>
26977
+ `;
26978
+ wasd.innerHTML = wasdSvg;
26979
+ wasd.innerHTML += `
26980
+ <div style="margin-top: 5px;">
26981
+ Click W,A,S,D on your keyboard to move your camera.
26982
+ </div>
26983
+ `;
26984
+ tips.appendChild(wasd);
26985
+ const arrows = document.createElement("div");
26986
+ arrows.setAttribute("style", `
26987
+ display: flex;
26988
+ flex-direction: column;
26989
+ justify-content: flex-end;
26990
+ `);
26991
+ const arrowsSvg = `
26992
+ <svg width="132" height="87" viewBox="0 0 188 124" fill="none" xmlns="http://www.w3.org/2000/svg"><rect y="64" width="60" height="60" rx="6" fill="#ebebeb"></rect><rect x="128" y="64" width="60" height="60" rx="6" fill="#ebebeb"></rect><rect x="64" width="60" height="60" rx="6" fill="#ebebeb"></rect><rect x="64" y="64" width="60" height="60" rx="6" fill="#ebebeb"></rect><path d="M95.2503 38.75V24.7875L101.35 30.8875C101.838 31.375 102.638 31.375 103.125 30.8875C103.613 30.4 103.613 29.6125 103.125 29.125L94.8878 20.8875C94.4003 20.4 93.6128 20.4 93.1253 20.8875L84.8753 29.1125C84.3878 29.6 84.3878 30.3875 84.8753 30.875C85.3628 31.3625 86.1503 31.3625 86.6378 30.875L92.7503 24.7875V38.75C92.7503 39.4375 93.3128 40 94.0003 40C94.6878 40 95.2503 39.4375 95.2503 38.75Z" fill="#525252"></path><path d="M38.75 92.7497H24.7875L30.8875 86.6497C31.375 86.1622 31.375 85.3622 30.8875 84.8747C30.4 84.3872 29.6125 84.3872 29.125 84.8747L20.8875 93.1122C20.4 93.5997 20.4 94.3872 20.8875 94.8747L29.1125 103.125C29.6 103.612 30.3875 103.612 30.875 103.125C31.3625 102.637 31.3625 101.85 30.875 101.362L24.7875 95.2497H38.75C39.4375 95.2497 40 94.6872 40 93.9997C40 93.3122 39.4375 92.7497 38.75 92.7497Z" fill="#525252"></path><path d="M150.25 95.2503H164.213L158.113 101.35C157.625 101.838 157.625 102.638 158.113 103.125C158.6 103.613 159.388 103.613 159.875 103.125L168.113 94.8878C168.6 94.4003 168.6 93.6128 168.113 93.1253L159.888 84.8753C159.4 84.3878 158.613 84.3878 158.125 84.8753C157.638 85.3628 157.638 86.1503 158.125 86.6378L164.213 92.7503H150.25C149.563 92.7503 149 93.3128 149 94.0003C149 94.6878 149.563 95.2503 150.25 95.2503Z" fill="#525252"></path><path d="M92.7497 85.25V99.2125L86.6497 93.1125C86.1622 92.625 85.3622 92.625 84.8747 93.1125C84.3872 93.6 84.3872 94.3875 84.8747 94.875L93.1122 103.113C93.5997 103.6 94.3872 103.6 94.8747 103.113L103.125 94.8875C103.612 94.4 103.612 93.6125 103.125 93.125C102.637 92.6375 101.85 92.6375 101.362 93.125L95.2497 99.2125V85.25C95.2497 84.5625 94.6872 84 93.9997 84C93.3122 84 92.7497 84.5625 92.7497 85.25Z" fill="#525252"></path></svg>
26993
+ `;
26994
+ arrows.innerHTML = arrowsSvg;
26995
+ arrows.innerHTML += `
26996
+ <div style="margin-top: 5px;">
26997
+ Click the arrow keys to pan.
26998
+ </div>
26999
+ `;
27000
+ tips.appendChild(arrows);
27001
+ const upDown = document.createElement("div");
27002
+ upDown.setAttribute("style", `
27003
+ display: flex;
27004
+ flex-direction: column;
27005
+ justify-content: flex-end;
27006
+ `);
27007
+ const upDownSvg = `
27008
+ <svg width="87" height="42" viewBox="0 0 124 60" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="64" width="60" height="60" rx="6" fill="#ebebeb"></rect><rect width="60" height="60" rx="6" fill="#ebebeb"></rect><path d="M29.4545 33.5455H31.7727L33.7159 36.1023L34.2273 36.7841L37.125 40.6364H34.8068L32.8977 38.0795L32.4205 37.4318L29.4545 33.5455ZM37.8409 30.2727C37.8409 32.1136 37.5085 33.7045 36.8438 35.0455C36.179 36.3864 35.267 37.4205 34.108 38.1477C32.9489 38.875 31.625 39.2386 30.1364 39.2386C28.6477 39.2386 27.3239 38.875 26.1648 38.1477C25.0057 37.4205 24.0938 36.3864 23.429 35.0455C22.7642 33.7045 22.4318 32.1136 22.4318 30.2727C22.4318 28.4318 22.7642 26.8409 23.429 25.5C24.0938 24.1591 25.0057 23.125 26.1648 22.3977C27.3239 21.6705 28.6477 21.3068 30.1364 21.3068C31.625 21.3068 32.9489 21.6705 34.108 22.3977C35.267 23.125 36.179 24.1591 36.8438 25.5C37.5085 26.8409 37.8409 28.4318 37.8409 30.2727ZM35.7955 30.2727C35.7955 28.7614 35.5426 27.4858 35.0369 26.446C34.5369 25.4062 33.858 24.6193 33 24.0852C32.1477 23.5511 31.1932 23.2841 30.1364 23.2841C29.0795 23.2841 28.1222 23.5511 27.2642 24.0852C26.4119 24.6193 25.733 25.4062 25.2273 26.446C24.7273 27.4858 24.4773 28.7614 24.4773 30.2727C24.4773 31.7841 24.7273 33.0597 25.2273 34.0994C25.733 35.1392 26.4119 35.9261 27.2642 36.4602C28.1222 36.9943 29.0795 37.2614 30.1364 37.2614C31.1932 37.2614 32.1477 36.9943 33 36.4602C33.858 35.9261 34.5369 35.1392 35.0369 34.0994C35.5426 33.0597 35.7955 31.7841 35.7955 30.2727Z" fill="#525252"></path><path d="M88.1136 39V21.5455H98.6477V23.4205H90.2273V29.3182H98.1023V31.1932H90.2273V37.125H98.7841V39H88.1136Z" fill="#525252"></path></svg>
27009
+ `;
27010
+ upDown.innerHTML = upDownSvg;
27011
+ upDown.innerHTML += `
27012
+ <div style="margin-top: 5px;">
27013
+ Click Q and E to move up and down.
27014
+ </div>
27015
+ `;
27016
+ tips.appendChild(upDown);
27017
+ }
27018
+ content.appendChild(tips);
27019
+ // Reference to our speed slider so we can adjust it when the move type changes.
27020
+ let moveRateInput = null;
27021
+ // Fly toggle row.
27022
+ {
27023
+ const row = document.createElement("div");
27024
+ row.className = "NextspaceWalkthroughBarRow";
27025
+ inputs.appendChild(row);
27026
+ const label = document.createElement("div");
27027
+ label.className = "NextspaceWalkthroughBarRowLabel";
27028
+ label.innerText = "Fly";
27029
+ row.appendChild(label);
27030
+ const toggle = document.createElement("input");
27031
+ toggle.className = "NextspaceWalkthroughBarRowToggle";
27032
+ toggle.type = "checkbox";
27033
+ row.appendChild(toggle);
27034
+ toggle.checked = Walkthrough.GetMoveType({
27035
+ viewer: this._viewer
27036
+ }) == Walkthrough.EMoveType.Fly;
27037
+ toggle.addEventListener("change", () => {
27038
+ const newType = toggle.checked ? Walkthrough.EMoveType.Fly : Walkthrough.EMoveType.Walk;
27039
+ Walkthrough.SetMoveType({
27040
+ viewer: this._viewer,
27041
+ type: newType
27042
+ });
27043
+ // Update the speed slider to match the new move type.
27044
+ if (moveRateInput) {
27045
+ if (newType == Walkthrough.EMoveType.Fly) {
27046
+ const rate = Walkthrough.GetFlyMoveRate({
27047
+ viewer: this._viewer
27048
+ });
27049
+ moveRateInput.value = (rate * 50).toFixed(2);
27050
+ }
27051
+ else {
27052
+ const rate = Walkthrough.GetWalkMoveRate({
27053
+ viewer: this._viewer
27054
+ });
27055
+ moveRateInput.value = (rate * 500).toFixed(2);
27056
+ }
27057
+ }
27058
+ localStorage.setItem(KEY_WALKTHROUGH_MODE, newType);
27059
+ });
27060
+ // Tip for the row.
27061
+ // Will be hidden while collapsed through css.
27062
+ {
27063
+ const tip = document.createElement("div");
27064
+ tip.style.marginBottom = "10px";
27065
+ tip.className = "NextspaceWalkthroughBarRowTip";
27066
+ tip.innerText = "Flying means the camera will not maintain its height.";
27067
+ inputs.appendChild(tip);
27068
+ }
27069
+ }
27070
+ // Speed slider row.
27071
+ {
27072
+ const row = document.createElement("div");
27073
+ row.className = "NextspaceWalkthroughBarRow";
27074
+ inputs.appendChild(row);
27075
+ const label = document.createElement("div");
27076
+ label.className = "NextspaceWalkthroughBarRowLabel";
27077
+ label.innerText = "Speed";
27078
+ row.appendChild(label);
27079
+ const slider = document.createElement("input");
27080
+ moveRateInput = slider;
27081
+ slider.className = "NextspaceWalkthroughBarRowSlider";
27082
+ slider.type = "range";
27083
+ slider.min = "0.01";
27084
+ slider.max = "100";
27085
+ slider.step = "0.01";
27086
+ slider.value = "50";
27087
+ slider.addEventListener("input", () => {
27088
+ // Walk is between 0.01 and 0.5
27089
+ // Fly is between 0.01 and 10
27090
+ // We want to convert this slider's range into the respective values and apply based on active move type.
27091
+ const type = Walkthrough.GetMoveType({
27092
+ viewer: this._viewer
27093
+ });
27094
+ if (type == Walkthrough.EMoveType.Fly) {
27095
+ const value = parseFloat(slider.value);
27096
+ const speed = value / 50;
27097
+ Walkthrough.SetFlyMoveRate({
27098
+ viewer: this._viewer,
27099
+ rate: speed
27100
+ });
27101
+ localStorage.setItem(KEY_WALKTHROUGH_SPEED_FLY, speed.toString());
27102
+ }
27103
+ else {
27104
+ const value = parseFloat(slider.value);
27105
+ const speed = value / 500;
27106
+ Walkthrough.SetWalkMoveRate({
27107
+ viewer: this._viewer,
27108
+ rate: speed
27109
+ });
27110
+ localStorage.setItem(KEY_WALKTHROUGH_SPEED_WALK, speed.toString());
27111
+ }
27112
+ });
27113
+ // Set the initial value based on the move type.
27114
+ const type = Walkthrough.GetMoveType({
27115
+ viewer: this._viewer
27116
+ });
27117
+ if (type == Walkthrough.EMoveType.Fly) {
27118
+ const rate = Walkthrough.GetFlyMoveRate({
27119
+ viewer: this._viewer
27120
+ });
27121
+ slider.value = (rate * 50).toFixed(2);
27122
+ }
27123
+ else {
27124
+ const rate = Walkthrough.GetWalkMoveRate({
27125
+ viewer: this._viewer
27126
+ });
27127
+ slider.value = (rate * 500).toFixed(2);
27128
+ }
27129
+ row.appendChild(slider);
27130
+ }
27131
+ this._walkthroughBar = element;
27132
+ }
27133
+ _disposeWalkthroughBar() {
27134
+ var _a;
27135
+ if ((_a = this._walkthroughBar) === null || _a === void 0 ? void 0 : _a.parentElement) {
27136
+ this._walkthroughBar.parentElement.removeChild(this._walkthroughBar);
27137
+ this._walkthroughBar = null;
27138
+ }
27139
+ }
26306
27140
  _updateControls() {
26307
27141
  const controls = this._primaryContent.querySelectorAll(".NextspaceCursorBarPrimControlInner");
26308
27142
  controls.forEach((control) => {
@@ -28370,7 +29204,7 @@ class WidgetViewBar extends Widget.AWidget {
28370
29204
  }
28371
29205
  }
28372
29206
 
28373
- const VERSION = "5.0.1";
29207
+ const VERSION = "5.0.3";
28374
29208
 
28375
- export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, 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, 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 };
29209
+ export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, 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 };
28376
29210
  //# sourceMappingURL=bruce-cesium.es5.js.map