bruce-cesium 5.0.0 → 5.0.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.
@@ -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, ClassificationType, ArcType, CornerType, ShadowMode, ConstantProperty, ConstantPositionProperty, HorizontalOrigin, VerticalOrigin, ColorBlendMode, HeadingPitchRoll, Transforms, Model, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, SceneMode, GeoJsonDataSource, Primitive, Cesium3DTileFeature, 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, ScreenSpaceEventHandler, ScreenSpaceEventType, Quaternion, CzmlDataSource, Intersect, Fullscreen } 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';
4
4
 
5
5
  const TIME_LAG = 300;
6
6
  const POSITION_CHECK_TIMER = 950;
@@ -1372,8 +1372,8 @@ var CesiumAnimatedProperty;
1372
1372
  Boundaries: item.boundaries
1373
1373
  }
1374
1374
  };
1375
- const dateTime = new Date(item.dateTime);
1376
- if (!dateTime) {
1375
+ const dateTime = item.dateTime ? new Date(item.dateTime) : null;
1376
+ if (!dateTime || !dateTime.getTime()) {
1377
1377
  continue;
1378
1378
  }
1379
1379
  const pos3d = EntityUtils.GetPos({
@@ -25932,15 +25932,343 @@ 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";
@@ -25954,18 +26282,23 @@ class WidgetCursorBar extends Widget.AWidget {
25954
26282
  this._selectedSecondaryCursor = ESecondaryCursor.None;
25955
26283
  this._generateStyles();
25956
26284
  this._generateElement();
25957
- if (this._selectedCursor == ECursor.Select) {
26285
+ if (this._selectedCursor == ECursor.Select || this._selectedSecondaryCursor == ESecondaryCursor.Select) {
25958
26286
  this._listenSelection();
25959
26287
  }
25960
26288
  }
25961
26289
  Dispose() {
25962
- var _a, _b;
26290
+ var _a, _b, _c;
25963
26291
  super.Dispose();
25964
26292
  this._disposeMeasureTool();
25965
26293
  this._disposeCesiumEvent();
25966
26294
  if ((_b = (_a = this._viewer) === null || _a === void 0 ? void 0 : _a.canvas) === null || _b === void 0 ? void 0 : _b.style.cursor) {
25967
26295
  this._viewer.canvas.style.removeProperty("cursor");
25968
26296
  }
26297
+ if (((_c = this._viewer) === null || _c === void 0 ? void 0 : _c.scene) && !this._viewer.isDestroyed()) {
26298
+ Walkthrough.Stop({
26299
+ viewer: this._viewer
26300
+ });
26301
+ }
25969
26302
  }
25970
26303
  _generateStyles() {
25971
26304
  if (document.getElementById(this.STYLESHEET_ID)) {
@@ -26157,6 +26490,7 @@ class WidgetCursorBar extends Widget.AWidget {
26157
26490
  this._generateSelect();
26158
26491
  this._generatePan();
26159
26492
  this._generateMeasure();
26493
+ this._generateWalkthrough();
26160
26494
  this._updateControls();
26161
26495
  this.Container.appendChild(element);
26162
26496
  this._element = element;
@@ -26175,8 +26509,14 @@ class WidgetCursorBar extends Widget.AWidget {
26175
26509
  `;
26176
26510
  div.appendChild(inner);
26177
26511
  inner.addEventListener("click", () => {
26512
+ var _a;
26178
26513
  this._disposeMeasureTool();
26179
26514
  this._disposeCesiumEvent();
26515
+ if (((_a = this._viewer) === null || _a === void 0 ? void 0 : _a.scene) && !this._viewer.isDestroyed()) {
26516
+ Walkthrough.Stop({
26517
+ viewer: this._viewer
26518
+ });
26519
+ }
26180
26520
  onClick();
26181
26521
  this._updateControls();
26182
26522
  });
@@ -26303,6 +26643,61 @@ class WidgetCursorBar extends Widget.AWidget {
26303
26643
  this._enabledMeasureTool.Start();
26304
26644
  }, polygonSvg);
26305
26645
  }
26646
+ _generateWalkthrough() {
26647
+ const svg = `
26648
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
26649
+ <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"/>
26650
+ </svg>
26651
+ `;
26652
+ this._generateControl("Walkthrough", ECursor.Walkthrough, () => {
26653
+ var _a;
26654
+ this._selectedSecondaryCursor = ESecondaryCursor.Select;
26655
+ this._selectedCursor = this._selectedCursor == ECursor.Walkthrough ? ECursor.Select : ECursor.Walkthrough;
26656
+ if (this._selectedCursor == ECursor.Walkthrough) {
26657
+ this._generateWalkthroughSecondary();
26658
+ this._updateSecondary();
26659
+ if (((_a = this._viewer) === null || _a === void 0 ? void 0 : _a.scene) && !this._viewer.isDestroyed()) {
26660
+ Walkthrough.Start({
26661
+ viewer: this._viewer
26662
+ });
26663
+ }
26664
+ }
26665
+ else {
26666
+ this._secondary.style.display = "none";
26667
+ }
26668
+ if (this._selectedCursor == ECursor.Select || this._selectedSecondaryCursor == ESecondaryCursor.Select) {
26669
+ this._listenSelection();
26670
+ }
26671
+ }, svg);
26672
+ }
26673
+ _generateWalkthroughSecondary() {
26674
+ this._secondaryContent.innerHTML = "";
26675
+ this._secondary.style.display = "flex";
26676
+ const selectSvg = `
26677
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
26678
+ <path d="M11.0706 25L9 7L23 17.8592L15.3135 18.3375L11.0706 25Z" fill="white" stroke="white" strokeLinejoin="round"/>
26679
+ </svg>
26680
+ `;
26681
+ this._generateSecondaryControl("Select", ESecondaryCursor.Select, () => {
26682
+ this._selectedSecondaryCursor = ESecondaryCursor.Select;
26683
+ this._listenSelection();
26684
+ }, selectSvg);
26685
+ const panSvg = `
26686
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
26687
+ <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"/>
26688
+ </svg>
26689
+ `;
26690
+ this._generateSecondaryControl("Pan", ESecondaryCursor.Pan, () => {
26691
+ if (this._selectedSecondaryCursor == ESecondaryCursor.Pan) {
26692
+ this._selectedSecondaryCursor = ESecondaryCursor.Select;
26693
+ this._listenSelection();
26694
+ }
26695
+ else {
26696
+ this._selectedSecondaryCursor = ESecondaryCursor.Pan;
26697
+ }
26698
+ this._updateSecondary();
26699
+ }, panSvg);
26700
+ }
26306
26701
  _updateControls() {
26307
26702
  const controls = this._primaryContent.querySelectorAll(".NextspaceCursorBarPrimControlInner");
26308
26703
  controls.forEach((control) => {
@@ -28370,7 +28765,7 @@ class WidgetViewBar extends Widget.AWidget {
28370
28765
  }
28371
28766
  }
28372
28767
 
28373
- const VERSION = "5.0.0";
28768
+ const VERSION = "5.0.2";
28374
28769
 
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 };
28770
+ 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
28771
  //# sourceMappingURL=bruce-cesium.es5.js.map