bruce-cesium 5.7.9 → 5.8.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.
Files changed (230) hide show
  1. package/dist/bruce-cesium.es5.js +32308 -0
  2. package/dist/bruce-cesium.es5.js.map +1 -0
  3. package/dist/bruce-cesium.umd.js +32232 -0
  4. package/dist/bruce-cesium.umd.js.map +1 -0
  5. package/dist/lib/bruce-cesium.js +76 -0
  6. package/dist/lib/bruce-cesium.js.map +1 -0
  7. package/dist/lib/internal/cesium-utils.js +109 -0
  8. package/dist/lib/internal/cesium-utils.js.map +1 -0
  9. package/dist/lib/internal/js-utils.js +22 -0
  10. package/dist/lib/internal/js-utils.js.map +1 -0
  11. package/dist/lib/internal/limited-log.js +17 -0
  12. package/dist/lib/internal/limited-log.js.map +1 -0
  13. package/dist/lib/rendering/cesium-animated-in-out.js +166 -0
  14. package/dist/lib/rendering/cesium-animated-in-out.js.map +1 -0
  15. package/dist/lib/rendering/cesium-animated-property.js +1111 -0
  16. package/dist/lib/rendering/cesium-animated-property.js.map +1 -0
  17. package/dist/lib/rendering/entity-gatherer.js +327 -0
  18. package/dist/lib/rendering/entity-gatherer.js.map +1 -0
  19. package/dist/lib/rendering/entity-render-engine-model3d.js +689 -0
  20. package/dist/lib/rendering/entity-render-engine-model3d.js.map +1 -0
  21. package/dist/lib/rendering/entity-render-engine-point.js +984 -0
  22. package/dist/lib/rendering/entity-render-engine-point.js.map +1 -0
  23. package/dist/lib/rendering/entity-render-engine-polygon.js +669 -0
  24. package/dist/lib/rendering/entity-render-engine-polygon.js.map +1 -0
  25. package/dist/lib/rendering/entity-render-engine-polyline.js +415 -0
  26. package/dist/lib/rendering/entity-render-engine-polyline.js.map +1 -0
  27. package/dist/lib/rendering/entity-render-engine.js +442 -0
  28. package/dist/lib/rendering/entity-render-engine.js.map +1 -0
  29. package/dist/lib/rendering/getters/batched-data-getter.js +91 -0
  30. package/dist/lib/rendering/getters/batched-data-getter.js.map +1 -0
  31. package/dist/lib/rendering/getters/entity-filter-getter.js +634 -0
  32. package/dist/lib/rendering/getters/entity-filter-getter.js.map +1 -0
  33. package/dist/lib/rendering/getters/entity-globe.js +172 -0
  34. package/dist/lib/rendering/getters/entity-globe.js.map +1 -0
  35. package/dist/lib/rendering/menu-item-creator.js +354 -0
  36. package/dist/lib/rendering/menu-item-creator.js.map +1 -0
  37. package/dist/lib/rendering/menu-item-manager.js +464 -0
  38. package/dist/lib/rendering/menu-item-manager.js.map +1 -0
  39. package/dist/lib/rendering/relation-render-engine.js +235 -0
  40. package/dist/lib/rendering/relation-render-engine.js.map +1 -0
  41. package/dist/lib/rendering/render-managers/common/cesium-parabola.js +368 -0
  42. package/dist/lib/rendering/render-managers/common/cesium-parabola.js.map +1 -0
  43. package/dist/lib/rendering/render-managers/common/entity-label.js +703 -0
  44. package/dist/lib/rendering/render-managers/common/entity-label.js.map +1 -0
  45. package/dist/lib/rendering/render-managers/common/point-clustering.js +826 -0
  46. package/dist/lib/rendering/render-managers/common/point-clustering.js.map +1 -0
  47. package/dist/lib/rendering/render-managers/common/shared-getters.js +187 -0
  48. package/dist/lib/rendering/render-managers/common/shared-getters.js.map +1 -0
  49. package/dist/lib/rendering/render-managers/data-source/data-source-static-csv-manager.js +668 -0
  50. package/dist/lib/rendering/render-managers/data-source/data-source-static-csv-manager.js.map +1 -0
  51. package/dist/lib/rendering/render-managers/data-source/data-source-static-kml-manager.js +92 -0
  52. package/dist/lib/rendering/render-managers/data-source/data-source-static-kml-manager.js.map +1 -0
  53. package/dist/lib/rendering/render-managers/entities/entities-datalab-render-manager.js +143 -0
  54. package/dist/lib/rendering/render-managers/entities/entities-datalab-render-manager.js.map +1 -0
  55. package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js +510 -0
  56. package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js.map +1 -0
  57. package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js +717 -0
  58. package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js.map +1 -0
  59. package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +999 -0
  60. package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -0
  61. package/dist/lib/rendering/render-managers/entities/entity-render-manager.js +186 -0
  62. package/dist/lib/rendering/render-managers/entities/entity-render-manager.js.map +1 -0
  63. package/dist/lib/rendering/render-managers/other/assembly-render-manager.js +226 -0
  64. package/dist/lib/rendering/render-managers/other/assembly-render-manager.js.map +1 -0
  65. package/dist/lib/rendering/render-managers/other/google-search-render-manager.js +430 -0
  66. package/dist/lib/rendering/render-managers/other/google-search-render-manager.js.map +1 -0
  67. package/dist/lib/rendering/render-managers/other/legacy-relations-render-manager.js +290 -0
  68. package/dist/lib/rendering/render-managers/other/legacy-relations-render-manager.js.map +1 -0
  69. package/dist/lib/rendering/render-managers/other/relations-render-manager.js +401 -0
  70. package/dist/lib/rendering/render-managers/other/relations-render-manager.js.map +1 -0
  71. package/dist/lib/rendering/render-managers/render-manager.js +276 -0
  72. package/dist/lib/rendering/render-managers/render-manager.js.map +1 -0
  73. package/dist/lib/rendering/render-managers/tilesets/tileset-arb-render-manager.js +356 -0
  74. package/dist/lib/rendering/render-managers/tilesets/tileset-arb-render-manager.js.map +1 -0
  75. package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js +861 -0
  76. package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js.map +1 -0
  77. package/dist/lib/rendering/render-managers/tilesets/tileset-entities-render-manager.js +279 -0
  78. package/dist/lib/rendering/render-managers/tilesets/tileset-entities-render-manager.js.map +1 -0
  79. package/dist/lib/rendering/render-managers/tilesets/tileset-google-photos-render-manager.js +104 -0
  80. package/dist/lib/rendering/render-managers/tilesets/tileset-google-photos-render-manager.js.map +1 -0
  81. package/dist/lib/rendering/render-managers/tilesets/tileset-i3s-render-manager.js +81 -0
  82. package/dist/lib/rendering/render-managers/tilesets/tileset-i3s-render-manager.js.map +1 -0
  83. package/dist/lib/rendering/render-managers/tilesets/tileset-osm-render-manager.js +378 -0
  84. package/dist/lib/rendering/render-managers/tilesets/tileset-osm-render-manager.js.map +1 -0
  85. package/dist/lib/rendering/render-managers/tilesets/tileset-pointcloud-render-manager.js +140 -0
  86. package/dist/lib/rendering/render-managers/tilesets/tileset-pointcloud-render-manager.js.map +1 -0
  87. package/dist/lib/rendering/tile-render-engine.js +1328 -0
  88. package/dist/lib/rendering/tile-render-engine.js.map +1 -0
  89. package/dist/lib/rendering/tileset-render-engine.js +588 -0
  90. package/dist/lib/rendering/tileset-render-engine.js.map +1 -0
  91. package/dist/lib/rendering/tileset-styler.js +590 -0
  92. package/dist/lib/rendering/tileset-styler.js.map +1 -0
  93. package/dist/lib/rendering/view-render-engine.js +1004 -0
  94. package/dist/lib/rendering/view-render-engine.js.map +1 -0
  95. package/dist/lib/rendering/visual-register-culler.js +676 -0
  96. package/dist/lib/rendering/visual-register-culler.js.map +1 -0
  97. package/dist/lib/rendering/visuals-register.js +1741 -0
  98. package/dist/lib/rendering/visuals-register.js.map +1 -0
  99. package/dist/lib/utils/cesium-entity-styler.js +914 -0
  100. package/dist/lib/utils/cesium-entity-styler.js.map +1 -0
  101. package/dist/lib/utils/drawing-utils.js +308 -0
  102. package/dist/lib/utils/drawing-utils.js.map +1 -0
  103. package/dist/lib/utils/entity-utils.js +1382 -0
  104. package/dist/lib/utils/entity-utils.js.map +1 -0
  105. package/dist/lib/utils/measure-utils.js +73 -0
  106. package/dist/lib/utils/measure-utils.js.map +1 -0
  107. package/dist/lib/utils/simplify-geometry.js +323 -0
  108. package/dist/lib/utils/simplify-geometry.js.map +1 -0
  109. package/dist/lib/utils/view-utils.js +392 -0
  110. package/dist/lib/utils/view-utils.js.map +1 -0
  111. package/dist/lib/viewer/cesium-view-monitor.js +393 -0
  112. package/dist/lib/viewer/cesium-view-monitor.js.map +1 -0
  113. package/dist/lib/viewer/viewer-event-tracker.js +70 -0
  114. package/dist/lib/viewer/viewer-event-tracker.js.map +1 -0
  115. package/dist/lib/viewer/viewer-utils.js +310 -0
  116. package/dist/lib/viewer/viewer-utils.js.map +1 -0
  117. package/dist/lib/widgets/common/draw-3d-polygon.js +458 -0
  118. package/dist/lib/widgets/common/draw-3d-polygon.js.map +1 -0
  119. package/dist/lib/widgets/common/draw-3d-polyline.js +415 -0
  120. package/dist/lib/widgets/common/draw-3d-polyline.js.map +1 -0
  121. package/dist/lib/widgets/common/measure-creator.js +468 -0
  122. package/dist/lib/widgets/common/measure-creator.js.map +1 -0
  123. package/dist/lib/widgets/common/walkthrough.js +336 -0
  124. package/dist/lib/widgets/common/walkthrough.js.map +1 -0
  125. package/dist/lib/widgets/controls-view-bar/widget-control-view-bar-fullscreen.js +36 -0
  126. package/dist/lib/widgets/controls-view-bar/widget-control-view-bar-fullscreen.js.map +1 -0
  127. package/dist/lib/widgets/controls-view-bar/widget-control-view-bar-search.js +437 -0
  128. package/dist/lib/widgets/controls-view-bar/widget-control-view-bar-search.js.map +1 -0
  129. package/dist/lib/widgets/controls-view-bar/widget-control-view-bar.js +38 -0
  130. package/dist/lib/widgets/controls-view-bar/widget-control-view-bar.js.map +1 -0
  131. package/dist/lib/widgets/tabs-left-panel/widget-left-panel-tab-bookmarks.js +219 -0
  132. package/dist/lib/widgets/tabs-left-panel/widget-left-panel-tab-bookmarks.js.map +1 -0
  133. package/dist/lib/widgets/tabs-left-panel/widget-left-panel-tab-user.js +304 -0
  134. package/dist/lib/widgets/tabs-left-panel/widget-left-panel-tab-user.js.map +1 -0
  135. package/dist/lib/widgets/tabs-left-panel/widget-left-panel-tab.js +29 -0
  136. package/dist/lib/widgets/tabs-left-panel/widget-left-panel-tab.js.map +1 -0
  137. package/dist/lib/widgets/widget-bookmarks.js +497 -0
  138. package/dist/lib/widgets/widget-bookmarks.js.map +1 -0
  139. package/dist/lib/widgets/widget-branding.js +165 -0
  140. package/dist/lib/widgets/widget-branding.js.map +1 -0
  141. package/dist/lib/widgets/widget-cursorbar.js +1179 -0
  142. package/dist/lib/widgets/widget-cursorbar.js.map +1 -0
  143. package/dist/lib/widgets/widget-embedded-info-view.js +201 -0
  144. package/dist/lib/widgets/widget-embedded-info-view.js.map +1 -0
  145. package/dist/lib/widgets/widget-info-view.js +681 -0
  146. package/dist/lib/widgets/widget-info-view.js.map +1 -0
  147. package/dist/lib/widgets/widget-left-panel.js +548 -0
  148. package/dist/lib/widgets/widget-left-panel.js.map +1 -0
  149. package/dist/lib/widgets/widget-nav-compass.js +469 -0
  150. package/dist/lib/widgets/widget-nav-compass.js.map +1 -0
  151. package/dist/lib/widgets/widget-view-bar.js +284 -0
  152. package/dist/lib/widgets/widget-view-bar.js.map +1 -0
  153. package/dist/lib/widgets/widget.js +66 -0
  154. package/dist/lib/widgets/widget.js.map +1 -0
  155. package/dist/types/bruce-cesium.d.ts +58 -0
  156. package/dist/types/internal/cesium-utils.d.ts +23 -0
  157. package/dist/types/internal/js-utils.d.ts +8 -0
  158. package/dist/types/internal/limited-log.d.ts +6 -0
  159. package/dist/types/rendering/cesium-animated-in-out.d.ts +12 -0
  160. package/dist/types/rendering/cesium-animated-property.d.ts +245 -0
  161. package/dist/types/rendering/entity-gatherer.d.ts +36 -0
  162. package/dist/types/rendering/entity-render-engine-model3d.d.ts +56 -0
  163. package/dist/types/rendering/entity-render-engine-point.d.ts +73 -0
  164. package/dist/types/rendering/entity-render-engine-polygon.d.ts +26 -0
  165. package/dist/types/rendering/entity-render-engine-polyline.d.ts +47 -0
  166. package/dist/types/rendering/entity-render-engine.d.ts +108 -0
  167. package/dist/types/rendering/getters/batched-data-getter.d.ts +28 -0
  168. package/dist/types/rendering/getters/entity-filter-getter.d.ts +104 -0
  169. package/dist/types/rendering/getters/entity-globe.d.ts +21 -0
  170. package/dist/types/rendering/menu-item-creator.d.ts +53 -0
  171. package/dist/types/rendering/menu-item-manager.d.ts +85 -0
  172. package/dist/types/rendering/relation-render-engine.d.ts +32 -0
  173. package/dist/types/rendering/render-managers/common/cesium-parabola.d.ts +39 -0
  174. package/dist/types/rendering/render-managers/common/entity-label.d.ts +82 -0
  175. package/dist/types/rendering/render-managers/common/point-clustering.d.ts +91 -0
  176. package/dist/types/rendering/render-managers/common/shared-getters.d.ts +41 -0
  177. package/dist/types/rendering/render-managers/data-source/data-source-static-csv-manager.d.ts +41 -0
  178. package/dist/types/rendering/render-managers/data-source/data-source-static-kml-manager.d.ts +25 -0
  179. package/dist/types/rendering/render-managers/entities/entities-datalab-render-manager.d.ts +31 -0
  180. package/dist/types/rendering/render-managers/entities/entities-ids-render-manager.d.ts +76 -0
  181. package/dist/types/rendering/render-managers/entities/entities-loaded-render-manager.d.ts +90 -0
  182. package/dist/types/rendering/render-managers/entities/entities-render-manager.d.ts +90 -0
  183. package/dist/types/rendering/render-managers/entities/entity-render-manager.d.ts +42 -0
  184. package/dist/types/rendering/render-managers/other/assembly-render-manager.d.ts +38 -0
  185. package/dist/types/rendering/render-managers/other/google-search-render-manager.d.ts +45 -0
  186. package/dist/types/rendering/render-managers/other/legacy-relations-render-manager.d.ts +60 -0
  187. package/dist/types/rendering/render-managers/other/relations-render-manager.d.ts +53 -0
  188. package/dist/types/rendering/render-managers/render-manager.d.ts +30 -0
  189. package/dist/types/rendering/render-managers/tilesets/tileset-arb-render-manager.d.ts +37 -0
  190. package/dist/types/rendering/render-managers/tilesets/tileset-cad-render-manager.d.ts +86 -0
  191. package/dist/types/rendering/render-managers/tilesets/tileset-entities-render-manager.d.ts +41 -0
  192. package/dist/types/rendering/render-managers/tilesets/tileset-google-photos-render-manager.d.ts +26 -0
  193. package/dist/types/rendering/render-managers/tilesets/tileset-i3s-render-manager.d.ts +25 -0
  194. package/dist/types/rendering/render-managers/tilesets/tileset-osm-render-manager.d.ts +48 -0
  195. package/dist/types/rendering/render-managers/tilesets/tileset-pointcloud-render-manager.d.ts +27 -0
  196. package/dist/types/rendering/tile-render-engine.d.ts +80 -0
  197. package/dist/types/rendering/tileset-render-engine.d.ts +99 -0
  198. package/dist/types/rendering/tileset-styler.d.ts +86 -0
  199. package/dist/types/rendering/view-render-engine.d.ts +32 -0
  200. package/dist/types/rendering/visual-register-culler.d.ts +18 -0
  201. package/dist/types/rendering/visuals-register.d.ts +361 -0
  202. package/dist/types/utils/cesium-entity-styler.d.ts +103 -0
  203. package/dist/types/utils/drawing-utils.d.ts +59 -0
  204. package/dist/types/utils/entity-utils.d.ts +133 -0
  205. package/dist/types/utils/measure-utils.d.ts +20 -0
  206. package/dist/types/utils/simplify-geometry.d.ts +19 -0
  207. package/dist/types/utils/view-utils.d.ts +101 -0
  208. package/dist/types/viewer/cesium-view-monitor.d.ts +35 -0
  209. package/dist/types/viewer/viewer-event-tracker.d.ts +47 -0
  210. package/dist/types/viewer/viewer-utils.d.ts +88 -0
  211. package/dist/types/widgets/common/draw-3d-polygon.d.ts +62 -0
  212. package/dist/types/widgets/common/draw-3d-polyline.d.ts +50 -0
  213. package/dist/types/widgets/common/measure-creator.d.ts +60 -0
  214. package/dist/types/widgets/common/walkthrough.d.ts +37 -0
  215. package/dist/types/widgets/controls-view-bar/widget-control-view-bar-fullscreen.d.ts +10 -0
  216. package/dist/types/widgets/controls-view-bar/widget-control-view-bar-search.d.ts +18 -0
  217. package/dist/types/widgets/controls-view-bar/widget-control-view-bar.d.ts +23 -0
  218. package/dist/types/widgets/tabs-left-panel/widget-left-panel-tab-bookmarks.d.ts +11 -0
  219. package/dist/types/widgets/tabs-left-panel/widget-left-panel-tab-user.d.ts +24 -0
  220. package/dist/types/widgets/tabs-left-panel/widget-left-panel-tab.d.ts +17 -0
  221. package/dist/types/widgets/widget-bookmarks.d.ts +40 -0
  222. package/dist/types/widgets/widget-branding.d.ts +15 -0
  223. package/dist/types/widgets/widget-cursorbar.d.ts +48 -0
  224. package/dist/types/widgets/widget-embedded-info-view.d.ts +13 -0
  225. package/dist/types/widgets/widget-info-view.d.ts +21 -0
  226. package/dist/types/widgets/widget-left-panel.d.ts +73 -0
  227. package/dist/types/widgets/widget-nav-compass.d.ts +27 -0
  228. package/dist/types/widgets/widget-view-bar.d.ts +37 -0
  229. package/dist/types/widgets/widget.d.ts +29 -0
  230. package/package.json +1 -1
@@ -0,0 +1,1179 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WidgetCursorBar = void 0;
4
+ const widget_1 = require("./widget");
5
+ const measure_creator_1 = require("./common/measure-creator");
6
+ const Cesium = require("cesium");
7
+ const bruce_models_1 = require("bruce-models");
8
+ const widget_left_panel_1 = require("./widget-left-panel");
9
+ const walkthrough_1 = require("./common/walkthrough");
10
+ const drawing_utils_1 = require("../utils/drawing-utils");
11
+ var ECursor;
12
+ (function (ECursor) {
13
+ ECursor["Select"] = "select";
14
+ ECursor["Pan"] = "pan";
15
+ ECursor["Measure"] = "measure";
16
+ ECursor["Walkthrough"] = "walkthrough";
17
+ })(ECursor || (ECursor = {}));
18
+ var ESecondaryCursor;
19
+ (function (ESecondaryCursor) {
20
+ ESecondaryCursor["None"] = "none";
21
+ ESecondaryCursor["Select"] = "select";
22
+ ESecondaryCursor["Pan"] = "pan";
23
+ ESecondaryCursor["MeasurePoint"] = "measure-point";
24
+ ESecondaryCursor["MeasurePolyline"] = "measure-polyline";
25
+ ESecondaryCursor["MeasurePolygon"] = "measure-polygon";
26
+ ESecondaryCursor["WalkthroughPin"] = "walkthrough-pin";
27
+ })(ESecondaryCursor || (ESecondaryCursor = {}));
28
+ const KEY_WALKTHROUGH_MODE = "WidgetCursorBar.Walkthrough.Mode";
29
+ const KEY_WALKTHROUGH_SPEED_FLY = "WidgetCursorBar.Walkthrough.SpeedFly";
30
+ const KEY_WALKTHROUGH_SPEED_WALK = "WidgetCursorBar.Walkthrough.SpeedWalk";
31
+ const KEY_WALKTHROUGH_EXPANDED = "WidgetCursorBar.Walkthrough.Expanded";
32
+ const VIEWER_WALKTHROUGH_PANEL_CSS_VAR_BOTTOM = "--viewer-walkthrough-panel-bottom";
33
+ class WidgetCursorBar extends widget_1.Widget.AWidget {
34
+ constructor(params) {
35
+ super(params);
36
+ this.STYLESHEET_ID = "nextspace-cursorbar-stylesheet";
37
+ this._selectedCursor = ECursor.Select;
38
+ this._selectedSecondaryCursor = ESecondaryCursor.None;
39
+ this.OnCursorChange = new bruce_models_1.BruceEvent();
40
+ this._generateStyles();
41
+ this._generateElement();
42
+ if (this._selectedCursor == ECursor.Select || this._selectedSecondaryCursor == ESecondaryCursor.Select) {
43
+ this._listenSelection();
44
+ }
45
+ document.documentElement.style.setProperty(VIEWER_WALKTHROUGH_PANEL_CSS_VAR_BOTTOM, "0px");
46
+ }
47
+ Dispose() {
48
+ var _a, _b, _c;
49
+ super.Dispose();
50
+ this._disposeMeasureTool();
51
+ this._disposeCesiumEvent();
52
+ this._disposeWalkthroughBar();
53
+ if ((_b = (_a = this._viewer) === null || _a === void 0 ? void 0 : _a.canvas) === null || _b === void 0 ? void 0 : _b.style.cursor) {
54
+ this._viewer.canvas.style.removeProperty("cursor");
55
+ }
56
+ if (((_c = this._viewer) === null || _c === void 0 ? void 0 : _c.scene) && !this._viewer.isDestroyed()) {
57
+ walkthrough_1.Walkthrough.Stop({
58
+ viewer: this._viewer
59
+ });
60
+ }
61
+ }
62
+ _generateStyles() {
63
+ if (document.getElementById(this.STYLESHEET_ID)) {
64
+ return;
65
+ }
66
+ // If any CSS vars are unset we will set them here to 0.
67
+ // Having them unset breaks calc functions.
68
+ const root = document.documentElement;
69
+ if (!root.style.getPropertyValue(widget_left_panel_1.VIEWER_LEFT_PANEL_CSS_VAR_LEFT)) {
70
+ root.style.setProperty(widget_left_panel_1.VIEWER_LEFT_PANEL_CSS_VAR_LEFT, "0px");
71
+ }
72
+ const style = document.createElement("style");
73
+ style.id = this.STYLESHEET_ID;
74
+ style.innerHTML = `
75
+ .NextspaceCursorBar {
76
+ position: absolute;
77
+ z-index: 1;
78
+ top: 10px;
79
+ left: calc(10px + var(${widget_left_panel_1.VIEWER_LEFT_PANEL_CSS_VAR_LEFT}));
80
+ box-sizing: border-box;
81
+ display: flex;
82
+ flex-direction: column;
83
+ overflow: hidden;
84
+ pointer-events: none;
85
+ color: black;
86
+ }
87
+
88
+ .NextspaceCursorBar * {
89
+ box-sizing: border-box;
90
+ }
91
+
92
+ .NextspaceCursorBarPrim {
93
+ pointer-events: auto;
94
+ -webkit-touch-callout: none;
95
+ -webkit-user-select: none;
96
+ user-select: none;
97
+ }
98
+
99
+ .NextspaceCursorBarPrimContent {
100
+ align-items: center;
101
+ background-color: #21272a;
102
+ border-radius: 9px;
103
+ display: flex;
104
+ pointer-events: auto;
105
+ width: -webkit-max-content;
106
+ width: max-content;
107
+ margin-bottom: 8px;
108
+ }
109
+
110
+ .NextspaceCursorBarPrimControl {
111
+ width: 48px;
112
+ }
113
+
114
+ .NextspaceCursorBarPrimControlInner {
115
+ align-items: center;
116
+ border-radius: 0;
117
+ display: flex;
118
+ height: 100%;
119
+ height: -webkit-max-content;
120
+ height: max-content;
121
+ justify-content: center;
122
+ padding: 8px;
123
+ padding-left: 8px;
124
+ }
125
+
126
+ .NextspaceCursorBarPrimControl:first-of-type .NextspaceCursorBarPrimControlInner {
127
+ border-radius: 9px 0 0 9px;
128
+ padding-left: 8px;
129
+ }
130
+
131
+ .NextspaceCursorBarPrimControl:last-of-type .NextspaceCursorBarPrimControlInner {
132
+ border-radius: 0 9px 9px 0;
133
+ padding-right: 8px;
134
+ }
135
+
136
+ .NextspaceCursorBarPrimControl:first-of-type:last-of-type .NextspaceCursorBarPrimControlInner {
137
+ border-radius: 9px;
138
+ }
139
+
140
+ .NextspaceCursorBarPrimControlInnerIcon {
141
+ align-items: center;
142
+ border-radius: 6px;
143
+ color: #fff;
144
+ cursor: pointer;
145
+ display: flex;
146
+ font-size: 18px;
147
+ height: 32px;
148
+ justify-content: center;
149
+ transition: .3s ease;
150
+ width: 32px;
151
+ }
152
+
153
+ .NextspaceCursorBarPrimControlInnerIcon:hover {
154
+ transform: scale(1.2);
155
+ }
156
+
157
+ .NextspaceCursorBarPrimControlInner[is-selected="true"] {
158
+ background: #33b1ff;
159
+ }
160
+
161
+ .NextspaceCursorBarSec {
162
+ pointer-events: auto;
163
+ -webkit-touch-callout: none;
164
+ -webkit-user-select: none;
165
+ user-select: none;
166
+ }
167
+
168
+ .NextspaceCursorBarSecContent {
169
+ align-items: center;
170
+ -webkit-backdrop-filter: blur(20px);
171
+ backdrop-filter: blur(20px);
172
+ background: rgba(33,39,42,.8);
173
+ border-radius: 9px;
174
+ box-shadow: 0 0 1px rgba(18,22,25,.36),0 18px 36px -4px rgba(18,22,25,.36);
175
+ display: flex;
176
+ pointer-events: auto;
177
+ width: -webkit-max-content;
178
+ width: max-content;
179
+ }
180
+
181
+ .NextspaceCursorBarSecControl {
182
+ align-items: center;
183
+ border-radius: 0;
184
+ display: flex;
185
+ height: 100%;
186
+ height: -webkit-max-content;
187
+ height: max-content;
188
+ justify-content: center;
189
+ padding: 8px;
190
+ padding-left: 8px;
191
+ border: 2px solid transparent;
192
+ flex-shrink: 0;
193
+ margin: 6px 0 6px 6px;
194
+ margin-right: 0px;
195
+ }
196
+
197
+ .NextspaceCursorBarSecControl[is-selected="true"] {
198
+ background-color: transparent;
199
+ border: 2px solid #33b1ff;
200
+ border-radius: 6px;
201
+ }
202
+
203
+ .NextspaceCursorBarSecControl:last-of-type {
204
+ margin-right: 6px;
205
+ }
206
+
207
+ .NextspaceCursorBarSecControl:first-of-type {
208
+ padding-left: 8px;
209
+ }
210
+
211
+ .NextspaceCursorBarSecControlIcon {
212
+ align-items: center;
213
+ border-radius: 6px;
214
+ color: #fff;
215
+ cursor: pointer;
216
+ display: flex;
217
+ font-size: 18px;
218
+ height: 32px;
219
+ justify-content: center;
220
+ transition: .3s ease;
221
+ width: 32px;
222
+ }
223
+
224
+ .NextspaceCursorBarSecControlIcon:hover {
225
+ -webkit-transform: scale(1.2);
226
+ transform: scale(1.2);
227
+ }
228
+
229
+ .NextspaceWalkthroughBar {
230
+ position: absolute;
231
+ z-index: 1;
232
+ bottom: 10px;
233
+ left: calc(45px + var(${widget_left_panel_1.VIEWER_LEFT_PANEL_CSS_VAR_LEFT}));
234
+ width: min(1100px, calc(100vw - 205px));
235
+ box-sizing: border-box;
236
+ display: flex;
237
+ flex-direction: column;
238
+ pointer-events: auto;
239
+ font-size: 12px;
240
+ font-family: Arial;
241
+ transition: 0.3s ease;
242
+ }
243
+
244
+ .NextspaceWalkthroughBar * {
245
+ box-sizing: border-box;
246
+ }
247
+
248
+ .NextspaceWalkthroughBar[expanded="false"] {
249
+ width: 395px;
250
+ }
251
+
252
+ .NextspaceWalkthroughBar[expanded="false"] .NextspaceWalkthroughBarInputs {
253
+ flex-direction: row;
254
+ margin-right: 0;
255
+ }
256
+
257
+ .NextspaceWalkthroughBar[expanded="false"] .NextspaceWalkthroughBarRow {
258
+ margin-right: 25px;
259
+ margin-bottom: 0;
260
+ }
261
+
262
+ .NextspaceWalkthroughBar[expanded="false"] .NextspaceWalkthroughBarRowTip,
263
+ .NextspaceWalkthroughBar[expanded="false"] .NextspaceWalkthroughBarTips {
264
+ display: none;
265
+ }
266
+
267
+ .NextspaceWalkthroughBarContent {
268
+ background-color: white;
269
+ border-radius: 8px;
270
+ display: flex;
271
+ flex-direction: row;
272
+ padding: 14px 18px;
273
+ box-shadow: 0px 0px 1px rgba(18, 22, 25, 0.36), 0px 18px 36px -4px rgba(18, 22, 25, 0.36);
274
+ }
275
+
276
+ .NextspaceWalkthroughBarTitle {
277
+ opacity: 0.7;
278
+ color: white;
279
+ font-size: 12px;
280
+ font-family: Arial;
281
+ font-style: normal;
282
+ letter-spacing: 0.15em;
283
+ margin-bottom: 15px;
284
+ position: absolute;
285
+ top: -15px;
286
+ left: 5px;
287
+ }
288
+
289
+ .NextspaceWalkthroughBarInputs {
290
+ display: flex;
291
+ flex-direction: column;
292
+ margin-right: 40px;
293
+ }
294
+
295
+ .NextspaceWalkthroughBarRowTip {
296
+ color: #000;
297
+ font-family: Arial;
298
+ font-size: 12px;
299
+ font-style: normal;
300
+ font-weight: 300;
301
+ letter-spacing: .01em;
302
+ background: #efefefbf;
303
+ padding: 8px;
304
+ gap: 6px;
305
+ border-radius: 5px;
306
+ }
307
+
308
+ .NextspaceWalkthroughBarRow {
309
+ align-items: center;
310
+ display: flex;
311
+ margin-bottom: 5px;
312
+ }
313
+
314
+ .NextspaceWalkthroughBarInputs .NextspaceWalkthroughBarRow {
315
+ margin-right: 20px;
316
+ }
317
+
318
+ .NextspaceWalkthroughBarRowLabel {
319
+ margin-right: 8px;
320
+ flex-shrink: 0;
321
+ }
322
+
323
+ .NextspaceWalkthroughBarRowValue {
324
+ flex-grow: 1;
325
+ max-width: 120px;
326
+ }
327
+
328
+ .NextspaceWalkthroughBarRowValue input {
329
+ width: 100%;
330
+ padding: 4px;
331
+ border: 1px solid #ccc;
332
+ border-radius: 4px;
333
+ }
334
+
335
+ .NextspaceWalkthroughBarIcon {
336
+ margin-right: 20px;
337
+ flex-shrink: 0;
338
+ }
339
+
340
+ .NextspaceWalkthroughButtonClose {
341
+ position: absolute;
342
+ top: 6px;
343
+ right: 8px;
344
+ z-index: 1;
345
+ font-size: 25px;
346
+ color: black;
347
+ cursor: pointer;
348
+ transition: 0.3s ease;
349
+ }
350
+
351
+ .NextspaceWalkthroughButtonExpand {
352
+ position: absolute;
353
+ top: 6px;
354
+ right: 40px;
355
+ z-index: 1;
356
+ font-size: 25px;
357
+ color: black;
358
+ cursor: pointer;
359
+ transition: 0.3s ease;
360
+ display: flex;
361
+ align-items: center;
362
+ justify-content: center;
363
+ height: 24px;
364
+ width: 24px;
365
+ }
366
+
367
+ .NextspaceWalkthroughButtonClose:hover,
368
+ .NextspaceWalkthroughButtonExpand:hover {
369
+ transform: scale(1.2);
370
+ }
371
+
372
+ .NextspaceWalkthroughBarTips {
373
+ flex-grow: 1;
374
+ flex-shrink: 1;
375
+ display: flex;
376
+ color: black;
377
+ font-size: 12px;
378
+ font-family: Arial;
379
+ }
380
+
381
+ .NextspaceWalkthroughBarTips >* {
382
+ margin-right: 24px;
383
+ }
384
+
385
+ .NextspaceWalkthroughBarTips >*:last-child {
386
+ margin-right: 0;
387
+ }
388
+ `;
389
+ document.head.appendChild(style);
390
+ }
391
+ _generateElement() {
392
+ const element = document.createElement("div");
393
+ element.className = "NextspaceCursorBar";
394
+ const prim = document.createElement("div");
395
+ prim.className = "NextspaceCursorBarPrim";
396
+ this._primary = prim;
397
+ const primContent = document.createElement("div");
398
+ primContent.className = "NextspaceCursorBarPrimContent";
399
+ prim.appendChild(primContent);
400
+ element.appendChild(prim);
401
+ this._primaryContent = primContent;
402
+ const sec = document.createElement("div");
403
+ sec.className = "NextspaceCursorBarSec";
404
+ this._secondary = sec;
405
+ const secContent = document.createElement("div");
406
+ secContent.className = "NextspaceCursorBarSecContent";
407
+ sec.appendChild(secContent);
408
+ element.appendChild(sec);
409
+ this._secondaryContent = secContent;
410
+ this._generateSelect();
411
+ this._generatePan();
412
+ this._generateMeasure();
413
+ this._generateWalkthrough();
414
+ this._updateControls();
415
+ this.Container.appendChild(element);
416
+ this._element = element;
417
+ }
418
+ _generateControl(title, cursor, onClick, iconHtml) {
419
+ const div = document.createElement("div");
420
+ div.className = "NextspaceCursorBarPrimControl";
421
+ const inner = document.createElement("div");
422
+ inner.setAttribute("title", title);
423
+ inner.setAttribute("control", cursor);
424
+ inner.className = "NextspaceCursorBarPrimControlInner";
425
+ inner.innerHTML = `
426
+ <div class="NextspaceCursorBarPrimControlInnerIcon">
427
+ ${iconHtml}
428
+ </div>
429
+ `;
430
+ div.appendChild(inner);
431
+ inner.addEventListener("click", () => {
432
+ var _a;
433
+ this._disposeMeasureTool();
434
+ this._disposeCesiumEvent();
435
+ this._disposeWalkthroughBar();
436
+ if (((_a = this._viewer) === null || _a === void 0 ? void 0 : _a.scene) && !this._viewer.isDestroyed()) {
437
+ walkthrough_1.Walkthrough.Stop({
438
+ viewer: this._viewer
439
+ });
440
+ }
441
+ this._disposeWalkthroughBar();
442
+ onClick();
443
+ this._updateControls();
444
+ });
445
+ this._primaryContent.appendChild(div);
446
+ }
447
+ _generateSecondaryControl(title, cursor, onClick, iconHTML) {
448
+ const div = document.createElement("div");
449
+ div.className = "NextspaceCursorBarSecControl";
450
+ div.setAttribute("title", title);
451
+ div.setAttribute("control", cursor);
452
+ div.innerHTML = `
453
+ <div class="NextspaceCursorBarSecControlIcon">
454
+ ${iconHTML}
455
+ </div>
456
+ `;
457
+ div.addEventListener("click", () => {
458
+ this._disposeMeasureTool();
459
+ this._disposeCesiumEvent();
460
+ onClick();
461
+ this._updateSecondary();
462
+ });
463
+ this._secondaryContent.appendChild(div);
464
+ }
465
+ _generateSelect() {
466
+ const svg = `
467
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
468
+ <path d="M11.0706 25L9 7L23 17.8592L15.3135 18.3375L11.0706 25Z" fill="white" stroke="white" strokeLinejoin="round"/>
469
+ </svg>
470
+ `;
471
+ this._generateControl("Select", ECursor.Select, () => {
472
+ this._selectedCursor = ECursor.Select;
473
+ this._secondary.style.display = "none";
474
+ this._listenSelection();
475
+ this.OnCursorChange.Trigger(this._selectedCursor);
476
+ }, svg);
477
+ }
478
+ _generatePan() {
479
+ const svg = `
480
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
481
+ <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"/>
482
+ </svg>
483
+ `;
484
+ this._generateControl("Pan", ECursor.Pan, () => {
485
+ this._selectedCursor = this._selectedCursor == ECursor.Pan ? ECursor.Select : ECursor.Pan;
486
+ this._secondary.style.display = "none";
487
+ if (this._selectedCursor == ECursor.Select) {
488
+ this._listenSelection();
489
+ }
490
+ this.OnCursorChange.Trigger(this._selectedCursor);
491
+ }, svg);
492
+ }
493
+ _generateMeasure() {
494
+ const svg = `
495
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
496
+ <path d="M26.5044 8.88032C26.1735 8.54947 23.4505 5.8265 23.1197 5.49564C22.4588 4.83479 21.3876 4.83479 20.7267 5.49564C20.6878 5.53457 20.4449 5.77742 20.0557 6.16666L21.6753 7.78623C22.0061 8.11708 22.0061 8.65186 21.6753 8.98271C21.5103 9.14771 21.2936 9.23064 21.077 9.23064C20.8604 9.23064 20.6438 9.14771 20.4788 8.98271L18.8592 7.36314C18.4581 7.76423 18.0063 8.21608 17.5172 8.70517L18.2906 9.47857C18.6214 9.80942 18.6214 10.3442 18.2906 10.6751C18.1256 10.8401 17.909 10.923 17.6923 10.923C17.4757 10.923 17.2591 10.8401 17.0941 10.6751L16.3207 9.90165C15.8875 10.3349 15.4381 10.7842 14.9787 11.2437L16.5982 12.8632C16.9291 13.1941 16.9291 13.7289 16.5982 14.0597C16.4332 14.2247 16.2166 14.3077 16 14.3077C15.7834 14.3077 15.5668 14.2247 15.4018 14.0597L13.7822 12.4402C13.3363 12.8861 12.8869 13.3354 12.4402 13.7822L13.2136 14.5556C13.5444 14.8864 13.5444 15.4212 13.2136 15.7521C13.0486 15.9171 12.8319 16 12.6153 16C12.3987 16 12.1821 15.9171 12.0171 15.7521L11.2437 14.9787C10.7842 15.4381 10.3349 15.8875 9.90165 16.3207L11.5212 17.9403C11.8521 18.2711 11.8521 18.8059 11.5212 19.1368C11.3562 19.3018 11.1396 19.3847 10.923 19.3847C10.7064 19.3847 10.4897 19.3018 10.3247 19.1368L8.70517 17.5172C8.21608 18.0063 7.76423 18.4581 7.36314 18.8592L8.13654 19.6326C8.46739 19.9635 8.46739 20.4982 8.13654 20.8291C7.97154 20.9941 7.75492 21.077 7.5383 21.077C7.32168 21.077 7.10506 20.9941 6.94006 20.8291L6.16666 20.0557C5.77742 20.4449 5.53457 20.6878 5.49564 20.7267C4.83479 21.3876 4.83479 22.4588 5.49564 23.1197C5.8265 23.4505 8.54947 26.1735 8.88032 26.5044C9.54118 27.1652 10.6124 27.1652 11.2733 26.5044C11.6041 26.1735 26.1735 11.6041 26.5044 11.2733C27.1652 10.6124 27.1652 9.54118 26.5044 8.88032Z" fill="white"/>
497
+ </svg>
498
+ `;
499
+ this._generateControl("Measure", ECursor.Measure, () => {
500
+ this._selectedSecondaryCursor = ESecondaryCursor.Pan;
501
+ this._selectedCursor = this._selectedCursor == ECursor.Measure ? ECursor.Select : ECursor.Measure;
502
+ if (this._selectedCursor == ECursor.Measure) {
503
+ this._generateMeasureSecondary();
504
+ this._updateSecondary();
505
+ }
506
+ else {
507
+ this._secondary.style.display = "none";
508
+ }
509
+ if (this._selectedCursor == ECursor.Select) {
510
+ this._listenSelection();
511
+ }
512
+ this.OnCursorChange.Trigger(this._selectedCursor);
513
+ }, svg);
514
+ }
515
+ _generateMeasureSecondary() {
516
+ this._secondaryContent.innerHTML = "";
517
+ this._secondary.style.display = "flex";
518
+ const panSvg = `
519
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
520
+ <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"/>
521
+ </svg>
522
+ `;
523
+ this._generateSecondaryControl("Pan", ESecondaryCursor.Pan, () => {
524
+ this._selectedSecondaryCursor = ESecondaryCursor.Pan;
525
+ this._updateSecondary();
526
+ }, panSvg);
527
+ const pointSvg = `
528
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
529
+ <path d="M6 20H18C18.55 20 19 20.45 19 21C19 21.55 18.55 22 18 22H6C5.45 22 5 21.55 5 21C5 20.45 5.45 20 6 20ZM12 7C10.9 7 10 7.9 10 9C10 10.1 10.9 11 12 11C13.1 11 14 10.1 14 9C14 7.9 13.1 7 12 7ZM12 2C15.27 2 19 4.46 19 9.15C19 12.13 16.87 15.27 12.61 18.54C12.25 18.82 11.75 18.82 11.39 18.54C7.13 15.26 5 12.13 5 9.15C5 4.46 8.73 2 12 2Z" fill="white"/>
530
+ </svg>
531
+ `;
532
+ this._generateSecondaryControl("Measure point", ESecondaryCursor.MeasurePoint, () => {
533
+ this._selectedSecondaryCursor = this._selectedSecondaryCursor == ESecondaryCursor.MeasurePoint ? ESecondaryCursor.Pan : ESecondaryCursor.MeasurePoint;
534
+ this._updateSecondary();
535
+ this._enabledMeasureTool = new measure_creator_1.MeasureCreator.Point(this._viewer, true);
536
+ this._enabledMeasureTool.Start();
537
+ }, pointSvg);
538
+ const polylineSvg = `
539
+ <svg width="24" height="20" viewBox="0 0 24 20" fill="none" xmlns="http://www.w3.org/2000/svg">
540
+ <path d="M6 4L18 8" stroke="white" stroke-width="3"/>
541
+ <path d="M4 6L5.12233 15" stroke="white" stroke-width="3"/>
542
+ <circle cx="3.5" cy="3.5" r="2.5" stroke="white" stroke-width="2"/>
543
+ <circle cx="20.1223" cy="9" r="2" stroke="white" stroke-width="2"/>
544
+ <circle cx="6" cy="17" r="2" stroke="white" stroke-width="2"/>
545
+ </svg>
546
+ `;
547
+ this._generateSecondaryControl("Measure polyline", ESecondaryCursor.MeasurePolyline, () => {
548
+ this._selectedSecondaryCursor = this._selectedSecondaryCursor == ESecondaryCursor.MeasurePolyline ? ESecondaryCursor.Pan : ESecondaryCursor.MeasurePolyline;
549
+ this._updateSecondary();
550
+ this._enabledMeasureTool = new measure_creator_1.MeasureCreator.Polyline(this._viewer, true);
551
+ this._enabledMeasureTool.Start();
552
+ }, polylineSvg);
553
+ const polygonSvg = `
554
+ <svg width="24" height="20" viewBox="0 0 24 20" fill="none" xmlns="http://www.w3.org/2000/svg">
555
+ <path d="M6.5 15.5L5 5L18 9L6.5 15.5Z" fill="white" fill-opacity="0.4"/>
556
+ <path d="M6 4L18 8" stroke="white" stroke-width="3"/>
557
+ <path d="M4 6L5.12233 15" stroke="white" stroke-width="3"/>
558
+ <path d="M18.9518 9.82404L8 16.2072" stroke="white" stroke-width="3"/>
559
+ <circle cx="3.5" cy="3.5" r="2.5" stroke="white" stroke-width="2"/>
560
+ <circle cx="20.1223" cy="9" r="2" stroke="white" stroke-width="2"/>
561
+ <circle cx="6" cy="17" r="2" stroke="white" stroke-width="2"/>
562
+ </svg>
563
+ `;
564
+ this._generateSecondaryControl("Measure polygon", ESecondaryCursor.MeasurePolygon, () => {
565
+ this._selectedSecondaryCursor = this._selectedSecondaryCursor == ESecondaryCursor.MeasurePolygon ? ESecondaryCursor.Pan : ESecondaryCursor.MeasurePolygon;
566
+ this._updateSecondary();
567
+ this._enabledMeasureTool = new measure_creator_1.MeasureCreator.Polygon(this._viewer, true);
568
+ this._enabledMeasureTool.Start();
569
+ }, polygonSvg);
570
+ }
571
+ _generateWalkthrough() {
572
+ const svg = `
573
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
574
+ <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"/>
575
+ </svg>
576
+ `;
577
+ this._generateControl("Walkthrough", ECursor.Walkthrough, () => {
578
+ var _a;
579
+ this._selectedSecondaryCursor = ESecondaryCursor.Select;
580
+ this._selectedCursor = this._selectedCursor == ECursor.Walkthrough ? ECursor.Select : ECursor.Walkthrough;
581
+ if (this._selectedCursor == ECursor.Walkthrough) {
582
+ this._generateWalkthroughSecondary();
583
+ this._updateSecondary();
584
+ if (((_a = this._viewer) === null || _a === void 0 ? void 0 : _a.scene) && !this._viewer.isDestroyed()) {
585
+ walkthrough_1.Walkthrough.Start({
586
+ viewer: this._viewer
587
+ });
588
+ let moveType = localStorage.getItem(KEY_WALKTHROUGH_MODE);
589
+ if (!moveType) {
590
+ moveType = walkthrough_1.Walkthrough.EMoveType.Walk;
591
+ }
592
+ walkthrough_1.Walkthrough.SetMoveType({
593
+ type: moveType,
594
+ viewer: this._viewer
595
+ });
596
+ let speed = localStorage.getItem(KEY_WALKTHROUGH_SPEED_FLY);
597
+ if (speed != null && !isNaN(+speed)) {
598
+ walkthrough_1.Walkthrough.SetFlyMoveRate({
599
+ rate: +speed,
600
+ viewer: this._viewer
601
+ });
602
+ }
603
+ speed = localStorage.getItem(KEY_WALKTHROUGH_SPEED_WALK);
604
+ if (speed != null && !isNaN(+speed)) {
605
+ walkthrough_1.Walkthrough.SetWalkMoveRate({
606
+ rate: +speed,
607
+ viewer: this._viewer
608
+ });
609
+ }
610
+ }
611
+ this._generateWalkthroughBar();
612
+ }
613
+ else {
614
+ this._secondary.style.display = "none";
615
+ }
616
+ if (this._selectedCursor == ECursor.Select || this._selectedSecondaryCursor == ESecondaryCursor.Select) {
617
+ this._listenSelection();
618
+ }
619
+ this.OnCursorChange.Trigger(this._selectedCursor);
620
+ }, svg);
621
+ }
622
+ _generateWalkthroughSecondary() {
623
+ this._secondaryContent.innerHTML = "";
624
+ this._secondary.style.display = "flex";
625
+ const selectSvg = `
626
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
627
+ <path d="M11.0706 25L9 7L23 17.8592L15.3135 18.3375L11.0706 25Z" fill="white" stroke="white" strokeLinejoin="round"/>
628
+ </svg>
629
+ `;
630
+ this._generateSecondaryControl("Select", ESecondaryCursor.Select, () => {
631
+ if (this._walkthroughPinEventRemoval) {
632
+ this._walkthroughPinEventRemoval();
633
+ this._walkthroughPinEventRemoval = null;
634
+ }
635
+ this._selectedSecondaryCursor = ESecondaryCursor.Select;
636
+ this._listenSelection();
637
+ }, selectSvg);
638
+ const panSvg = `
639
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
640
+ <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"/>
641
+ </svg>
642
+ `;
643
+ this._generateSecondaryControl("Pan", ESecondaryCursor.Pan, () => {
644
+ if (this._walkthroughPinEventRemoval) {
645
+ this._walkthroughPinEventRemoval();
646
+ this._walkthroughPinEventRemoval = null;
647
+ }
648
+ if (this._selectedSecondaryCursor == ESecondaryCursor.Pan) {
649
+ this._selectedSecondaryCursor = ESecondaryCursor.Select;
650
+ this._listenSelection();
651
+ }
652
+ else {
653
+ this._selectedSecondaryCursor = ESecondaryCursor.Pan;
654
+ }
655
+ this._updateSecondary();
656
+ }, panSvg);
657
+ const pinSvg = `
658
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
659
+ <path d="M6 20H18C18.55 20 19 20.45 19 21C19 21.55 18.55 22 18 22H6C5.45 22 5 21.55 5 21C5 20.45 5.45 20 6 20ZM12 7C10.9 7 10 7.9 10 9C10 10.1 10.9 11 12 11C13.1 11 14 10.1 14 9C14 7.9 13.1 7 12 7ZM12 2C15.27 2 19 4.46 19 9.15C19 12.13 16.87 15.27 12.61 18.54C12.25 18.82 11.75 18.82 11.39 18.54C7.13 15.26 5 12.13 5 9.15C5 4.46 8.73 2 12 2Z" fill="white"/>
660
+ </svg>
661
+ `;
662
+ this._generateSecondaryControl("Move to point", ESecondaryCursor.WalkthroughPin, () => {
663
+ if (this._selectedSecondaryCursor == ESecondaryCursor.WalkthroughPin) {
664
+ this._selectedSecondaryCursor = ESecondaryCursor.Select;
665
+ this._listenSelection();
666
+ }
667
+ else {
668
+ this._selectedSecondaryCursor = ESecondaryCursor.WalkthroughPin;
669
+ this._initWalkthroughPin();
670
+ }
671
+ this._updateSecondary();
672
+ }, pinSvg);
673
+ }
674
+ _initWalkthroughPin() {
675
+ if (this._walkthroughPinEventRemoval) {
676
+ this._walkthroughPinEventRemoval();
677
+ this._walkthroughPinEventRemoval = null;
678
+ }
679
+ let pointer;
680
+ let events = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
681
+ this._walkthroughPinEventRemoval = () => {
682
+ var _a;
683
+ if (events && !events.isDestroyed()) {
684
+ events.destroy();
685
+ events = null;
686
+ }
687
+ if (((_a = this._viewer) === null || _a === void 0 ? void 0 : _a.scene) && !this._viewer.scene.isDestroyed()) {
688
+ if (pointer && this._viewer.entities.contains(pointer)) {
689
+ this._viewer.entities.remove(pointer);
690
+ }
691
+ pointer = null;
692
+ this._viewer.scene.requestRender();
693
+ }
694
+ };
695
+ let dropPosition3d;
696
+ let dropOnTerrain = false;
697
+ events.setInputAction((e) => {
698
+ const pos2d = e.endPosition;
699
+ // First try find a position on a 'thing'.
700
+ // This lets us put our pin underground if there is something there.
701
+ let pos3d = drawing_utils_1.DrawingUtils.GetAccuratePosition(this._viewer, pos2d, true, pointer ? [pointer] : null);
702
+ dropOnTerrain = false;
703
+ // Fallback to position including terrain as an option.
704
+ if (!bruce_models_1.Cartes.ValidateCartes3(pos3d)) {
705
+ pos3d = drawing_utils_1.DrawingUtils.GetAccuratePosition(this._viewer, pos2d, false, pointer ? [pointer] : null);
706
+ dropOnTerrain = true;
707
+ }
708
+ if (bruce_models_1.Cartes.ValidateCartes3(pos3d)) {
709
+ dropPosition3d = pos3d;
710
+ if (!pointer) {
711
+ // Preview is mucking up the raycast even when we ignore it, or make it not have a fill colour.
712
+ // So hiding until we find a workaround (likely a circle that isn't filled as custom geometry rather than a material).
713
+ // pointer = this._viewer.entities.add({
714
+ // position: new Cesium.CallbackProperty(() => dropPosition3d, false) as any,
715
+ // point: {
716
+ // pixelSize: 10,
717
+ // // color: Cesium.Color.fromCssColorString("#33B1FF"),
718
+ // color: Cesium.Color.TRANSPARENT,
719
+ // outlineColor: Cesium.Color.WHITE,
720
+ // outlineWidth: 2,
721
+ // heightReference: Cesium.HeightReference.NONE,
722
+ // show: true
723
+ // }
724
+ // });
725
+ }
726
+ }
727
+ }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
728
+ let processing = false;
729
+ events.setInputAction(async (e) => {
730
+ if (processing) {
731
+ return;
732
+ }
733
+ processing = true;
734
+ try {
735
+ if (!bruce_models_1.Cartes.ValidateCartes3(dropPosition3d) && e.position) {
736
+ // First try find a position on a 'thing'.
737
+ // This lets us put our pin underground if there is something there.
738
+ let pos3d = drawing_utils_1.DrawingUtils.GetAccuratePosition(this._viewer, e.position, true);
739
+ dropOnTerrain = false;
740
+ // Fallback to position including terrain as an option.
741
+ if (!bruce_models_1.Cartes.ValidateCartes3(pos3d)) {
742
+ pos3d = drawing_utils_1.DrawingUtils.GetAccuratePosition(this._viewer, e.position, false);
743
+ dropOnTerrain = true;
744
+ }
745
+ dropPosition3d = pos3d;
746
+ }
747
+ let pos3d = dropPosition3d === null || dropPosition3d === void 0 ? void 0 : dropPosition3d.clone();
748
+ if (bruce_models_1.Cartes.ValidateCartes3(pos3d)) {
749
+ const carto = Cesium.Cartographic.fromCartesian(pos3d);
750
+ // If we can raycast to something then we won't adjust above terrain.
751
+ // Eg: we clicked on an Entity so if it's underground, that's likely intended.
752
+ if (dropOnTerrain) {
753
+ const terrainCarto = carto.clone();
754
+ terrainCarto.height = 0;
755
+ if (this._viewer.scene.terrainProvider instanceof Cesium.EllipsoidTerrainProvider) {
756
+ // Flat terrain. Ignored.
757
+ }
758
+ else {
759
+ const sample = await Cesium.sampleTerrainMostDetailed(this._viewer.scene.terrainProvider, [terrainCarto]);
760
+ const terrainHeight = (sample === null || sample === void 0 ? void 0 : sample.length) ? sample[0].height : null;
761
+ if (terrainHeight != null) {
762
+ if (carto.height < terrainHeight) {
763
+ carto.height = terrainHeight;
764
+ }
765
+ }
766
+ }
767
+ }
768
+ // Add average human height.
769
+ carto.height += 1.7;
770
+ pos3d = Cesium.Cartesian3.fromRadians(carto.longitude, carto.latitude, carto.height);
771
+ this._viewer.camera.flyTo({
772
+ destination: pos3d,
773
+ duration: 2,
774
+ orientation: {
775
+ heading: this._viewer.camera.heading,
776
+ pitch: Cesium.Math.toRadians(0),
777
+ roll: Cesium.Math.toRadians(0)
778
+ }
779
+ });
780
+ // Disable this picking cursor.
781
+ this._selectedSecondaryCursor = ESecondaryCursor.Select;
782
+ this._listenSelection();
783
+ this._updateSecondary();
784
+ if (this._walkthroughPinEventRemoval) {
785
+ this._walkthroughPinEventRemoval();
786
+ this._walkthroughPinEventRemoval = null;
787
+ }
788
+ }
789
+ }
790
+ catch (e) {
791
+ console.error(e);
792
+ }
793
+ processing = false;
794
+ }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
795
+ }
796
+ /**
797
+ * Generates the Walkthrough controls bar at the bottom of the screen.
798
+ * This bar will be collapsable to show minimal information.
799
+ * A TODO is to break this class into pieces similar the ViewBar.
800
+ */
801
+ _generateWalkthroughBar() {
802
+ this._disposeWalkthroughBar();
803
+ const element = document.createElement("div");
804
+ element.className = "NextspaceWalkthroughBar";
805
+ this.Container.appendChild(element);
806
+ const content = document.createElement("div");
807
+ content.className = "NextspaceWalkthroughBarContent";
808
+ element.appendChild(content);
809
+ const inputs = document.createElement("div");
810
+ inputs.className = "NextspaceWalkthroughBarInputs";
811
+ inputs.style.marginRight = "40px";
812
+ const title = document.createElement("div");
813
+ title.className = "NextspaceWalkthroughBarTitle";
814
+ title.innerText = "Walkthrough";
815
+ inputs.appendChild(title);
816
+ // Expanded by default to show how to use Walkthrough.
817
+ let expanded = localStorage.getItem(KEY_WALKTHROUGH_EXPANDED) != "false";
818
+ // Close button.
819
+ {
820
+ const svg = `
821
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
822
+ <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"/>
823
+ </svg>
824
+ `;
825
+ const close = document.createElement("div");
826
+ close.className = "NextspaceWalkthroughButtonClose";
827
+ close.innerHTML = svg;
828
+ close.onclick = () => {
829
+ var _a;
830
+ // Toggles off the Walkthrough mode (enables first primary cursor).
831
+ // TODO: We need a more elegant way to handle this.
832
+ this._secondary.style.display = "none";
833
+ this._selectedCursor = ECursor.Select;
834
+ this._selectedSecondaryCursor = ESecondaryCursor.None;
835
+ this._updateControls();
836
+ this._updateSecondary();
837
+ this._disposeWalkthroughBar();
838
+ this._listenSelection();
839
+ if (((_a = this._viewer) === null || _a === void 0 ? void 0 : _a.scene) && !this._viewer.isDestroyed()) {
840
+ walkthrough_1.Walkthrough.Stop({
841
+ viewer: this._viewer
842
+ });
843
+ }
844
+ this.OnCursorChange.Trigger(this._selectedCursor);
845
+ };
846
+ content.appendChild(close);
847
+ }
848
+ // Toggle expand button.
849
+ {
850
+ const svgExpand = `
851
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
852
+ <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"/>
853
+ </svg>
854
+ `;
855
+ const svgMinimize = `
856
+ <svg width="16" height="2" viewBox="0 0 16 2" fill="none" xmlns="http://www.w3.org/2000/svg">
857
+ <path d="M15 1L1 0.999999" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
858
+ </svg>
859
+ `;
860
+ const heightCollapsed = "70px";
861
+ const heightExpanded = "150px";
862
+ const expand = document.createElement("div");
863
+ expand.className = "NextspaceWalkthroughButtonExpand";
864
+ expand.innerHTML = expanded ? svgMinimize : svgExpand;
865
+ expand.onclick = () => {
866
+ expanded = !expanded;
867
+ expand.innerHTML = expanded ? svgMinimize : svgExpand;
868
+ element.setAttribute("expanded", expanded ? "true" : "false");
869
+ localStorage.setItem(KEY_WALKTHROUGH_EXPANDED, expanded ? "true" : "false");
870
+ document.documentElement.style.setProperty(VIEWER_WALKTHROUGH_PANEL_CSS_VAR_BOTTOM, expanded ? heightExpanded : heightCollapsed);
871
+ };
872
+ content.appendChild(expand);
873
+ element.setAttribute("expanded", expanded ? "true" : "false");
874
+ document.documentElement.style.setProperty(VIEWER_WALKTHROUGH_PANEL_CSS_VAR_BOTTOM, expanded ? heightExpanded : heightCollapsed);
875
+ }
876
+ content.appendChild(inputs);
877
+ const tips = document.createElement("div");
878
+ tips.className = "NextspaceWalkthroughBarTips";
879
+ {
880
+ const wasd = document.createElement("div");
881
+ wasd.setAttribute("style", `
882
+ display: flex;
883
+ flex-direction: column;
884
+ justify-content: flex-end;
885
+ `);
886
+ const wasdSvg = `
887
+ <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>
888
+ `;
889
+ wasd.innerHTML = wasdSvg;
890
+ wasd.innerHTML += `
891
+ <div style="margin-top: 5px;">
892
+ Click W,A,S,D on your keyboard to move your camera.
893
+ </div>
894
+ `;
895
+ tips.appendChild(wasd);
896
+ const arrows = document.createElement("div");
897
+ arrows.setAttribute("style", `
898
+ display: flex;
899
+ flex-direction: column;
900
+ justify-content: flex-end;
901
+ `);
902
+ const arrowsSvg = `
903
+ <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>
904
+ `;
905
+ arrows.innerHTML = arrowsSvg;
906
+ arrows.innerHTML += `
907
+ <div style="margin-top: 5px;">
908
+ Click the arrow keys to pan.
909
+ </div>
910
+ `;
911
+ tips.appendChild(arrows);
912
+ const upDown = document.createElement("div");
913
+ upDown.setAttribute("style", `
914
+ display: flex;
915
+ flex-direction: column;
916
+ justify-content: flex-end;
917
+ `);
918
+ const upDownSvg = `
919
+ <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>
920
+ `;
921
+ upDown.innerHTML = upDownSvg;
922
+ upDown.innerHTML += `
923
+ <div style="margin-top: 5px;">
924
+ Click Q and E to move up and down.
925
+ </div>
926
+ `;
927
+ tips.appendChild(upDown);
928
+ }
929
+ content.appendChild(tips);
930
+ // Reference to our speed slider so we can adjust it when the move type changes.
931
+ let moveRateInput = null;
932
+ // Fly toggle row.
933
+ {
934
+ const row = document.createElement("div");
935
+ row.className = "NextspaceWalkthroughBarRow";
936
+ inputs.appendChild(row);
937
+ const label = document.createElement("div");
938
+ label.className = "NextspaceWalkthroughBarRowLabel";
939
+ label.innerText = "Fly";
940
+ row.appendChild(label);
941
+ const toggle = document.createElement("input");
942
+ toggle.className = "NextspaceWalkthroughBarRowToggle";
943
+ toggle.type = "checkbox";
944
+ row.appendChild(toggle);
945
+ toggle.checked = walkthrough_1.Walkthrough.GetMoveType({
946
+ viewer: this._viewer
947
+ }) == walkthrough_1.Walkthrough.EMoveType.Fly;
948
+ toggle.addEventListener("change", () => {
949
+ const newType = toggle.checked ? walkthrough_1.Walkthrough.EMoveType.Fly : walkthrough_1.Walkthrough.EMoveType.Walk;
950
+ walkthrough_1.Walkthrough.SetMoveType({
951
+ viewer: this._viewer,
952
+ type: newType
953
+ });
954
+ // Update the speed slider to match the new move type.
955
+ if (moveRateInput) {
956
+ if (newType == walkthrough_1.Walkthrough.EMoveType.Fly) {
957
+ const rate = walkthrough_1.Walkthrough.GetFlyMoveRate({
958
+ viewer: this._viewer
959
+ });
960
+ moveRateInput.value = (rate * 50).toFixed(2);
961
+ }
962
+ else {
963
+ const rate = walkthrough_1.Walkthrough.GetWalkMoveRate({
964
+ viewer: this._viewer
965
+ });
966
+ moveRateInput.value = (rate * 500).toFixed(2);
967
+ }
968
+ }
969
+ localStorage.setItem(KEY_WALKTHROUGH_MODE, newType);
970
+ });
971
+ // Tip for the row.
972
+ // Will be hidden while collapsed through css.
973
+ {
974
+ const tip = document.createElement("div");
975
+ tip.style.marginBottom = "10px";
976
+ tip.className = "NextspaceWalkthroughBarRowTip";
977
+ tip.innerText = "Flying means the camera will not maintain its height.";
978
+ inputs.appendChild(tip);
979
+ }
980
+ }
981
+ // Speed slider row.
982
+ {
983
+ const row = document.createElement("div");
984
+ row.className = "NextspaceWalkthroughBarRow";
985
+ inputs.appendChild(row);
986
+ const label = document.createElement("div");
987
+ label.className = "NextspaceWalkthroughBarRowLabel";
988
+ label.innerText = "Speed";
989
+ row.appendChild(label);
990
+ const slider = document.createElement("input");
991
+ moveRateInput = slider;
992
+ slider.className = "NextspaceWalkthroughBarRowSlider";
993
+ slider.type = "range";
994
+ slider.min = "0.01";
995
+ slider.max = "100";
996
+ slider.step = "0.01";
997
+ slider.value = "50";
998
+ slider.addEventListener("input", () => {
999
+ // Walk is between 0.01 and 0.5
1000
+ // Fly is between 0.01 and 10
1001
+ // We want to convert this slider's range into the respective values and apply based on active move type.
1002
+ const type = walkthrough_1.Walkthrough.GetMoveType({
1003
+ viewer: this._viewer
1004
+ });
1005
+ if (type == walkthrough_1.Walkthrough.EMoveType.Fly) {
1006
+ const value = parseFloat(slider.value);
1007
+ const speed = value / 50;
1008
+ walkthrough_1.Walkthrough.SetFlyMoveRate({
1009
+ viewer: this._viewer,
1010
+ rate: speed
1011
+ });
1012
+ localStorage.setItem(KEY_WALKTHROUGH_SPEED_FLY, speed.toString());
1013
+ }
1014
+ else {
1015
+ const value = parseFloat(slider.value);
1016
+ const speed = value / 500;
1017
+ walkthrough_1.Walkthrough.SetWalkMoveRate({
1018
+ viewer: this._viewer,
1019
+ rate: speed
1020
+ });
1021
+ localStorage.setItem(KEY_WALKTHROUGH_SPEED_WALK, speed.toString());
1022
+ }
1023
+ });
1024
+ // Set the initial value based on the move type.
1025
+ const type = walkthrough_1.Walkthrough.GetMoveType({
1026
+ viewer: this._viewer
1027
+ });
1028
+ if (type == walkthrough_1.Walkthrough.EMoveType.Fly) {
1029
+ const rate = walkthrough_1.Walkthrough.GetFlyMoveRate({
1030
+ viewer: this._viewer
1031
+ });
1032
+ slider.value = (rate * 50).toFixed(2);
1033
+ }
1034
+ else {
1035
+ const rate = walkthrough_1.Walkthrough.GetWalkMoveRate({
1036
+ viewer: this._viewer
1037
+ });
1038
+ slider.value = (rate * 500).toFixed(2);
1039
+ }
1040
+ row.appendChild(slider);
1041
+ }
1042
+ this._walkthroughBar = element;
1043
+ }
1044
+ _disposeWalkthroughBar() {
1045
+ var _a;
1046
+ if (this._walkthroughPinEventRemoval) {
1047
+ this._walkthroughPinEventRemoval();
1048
+ this._walkthroughPinEventRemoval = null;
1049
+ }
1050
+ if ((_a = this._walkthroughBar) === null || _a === void 0 ? void 0 : _a.parentElement) {
1051
+ this._walkthroughBar.parentElement.removeChild(this._walkthroughBar);
1052
+ this._walkthroughBar = null;
1053
+ }
1054
+ document.documentElement.style.setProperty(VIEWER_WALKTHROUGH_PANEL_CSS_VAR_BOTTOM, "0px");
1055
+ }
1056
+ _updateControls() {
1057
+ const controls = this._primaryContent.querySelectorAll(".NextspaceCursorBarPrimControlInner");
1058
+ controls.forEach((control) => {
1059
+ control.setAttribute("is-selected", "false");
1060
+ });
1061
+ const selected = this._primaryContent.querySelector(`.NextspaceCursorBarPrimControlInner[control="${this._selectedCursor}"]`);
1062
+ if (selected) {
1063
+ selected.setAttribute("is-selected", "true");
1064
+ }
1065
+ }
1066
+ _updateSecondary() {
1067
+ const secondary = this._secondary.querySelectorAll(".NextspaceCursorBarSecControl");
1068
+ secondary.forEach((control) => {
1069
+ control.setAttribute("is-selected", "false");
1070
+ });
1071
+ const selected = this._secondary.querySelector(`.NextspaceCursorBarSecControl[control="${this._selectedSecondaryCursor}"]`);
1072
+ if (selected) {
1073
+ selected.setAttribute("is-selected", "true");
1074
+ }
1075
+ }
1076
+ _disposeMeasureTool() {
1077
+ if (this._enabledMeasureTool) {
1078
+ this._enabledMeasureTool.Stop();
1079
+ this._enabledMeasureTool = null;
1080
+ }
1081
+ }
1082
+ _disposeCesiumEvent() {
1083
+ if (this._cesiumEventRemoval) {
1084
+ this._cesiumEventRemoval();
1085
+ }
1086
+ this._cesiumEventRemoval = null;
1087
+ }
1088
+ _listenSelection() {
1089
+ this._disposeCesiumEvent();
1090
+ const events = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
1091
+ let lastHoverPos = null;
1092
+ //let lastHoveredEntityId: string = null;
1093
+ //let unhighlightTimeout: any = null;
1094
+ const process2dCursor = (pos2d, isHover) => {
1095
+ try {
1096
+ const { regos } = this._manager.VisualsRegister.GetRegosFromCursor({
1097
+ cursor: pos2d
1098
+ });
1099
+ const first = regos.length ? regos[0] : null;
1100
+ const firstId = first === null || first === void 0 ? void 0 : first.entityId;
1101
+ if (isHover) {
1102
+ if (regos.length) {
1103
+ this._viewer.canvas.style.cursor = "pointer";
1104
+ }
1105
+ else if (this._viewer.canvas.style.cursor) {
1106
+ this._viewer.canvas.style.removeProperty("cursor");
1107
+ }
1108
+ /*
1109
+ clearTimeout(unhighlightTimeout);
1110
+ if (lastHoveredEntityId && lastHoveredEntityId != firstId) {
1111
+ this._manager.VisualsRegister.SetHighlighted({
1112
+ entityIds: [lastHoveredEntityId],
1113
+ highlighted: false
1114
+ });
1115
+ }
1116
+ if (firstId) {
1117
+ unhighlightTimeout = setTimeout(() => {
1118
+ if (lastHoveredEntityId == firstId) {
1119
+ this._manager.VisualsRegister.SetHighlighted({
1120
+ entityIds: [firstId],
1121
+ highlighted: false
1122
+ });
1123
+ lastHoveredEntityId = null;
1124
+ }
1125
+ }, 5000);
1126
+ if (lastHoveredEntityId != firstId) {
1127
+ this._manager.VisualsRegister.SetHighlighted({
1128
+ entityIds: [firstId],
1129
+ highlighted: true
1130
+ });
1131
+ }
1132
+ }
1133
+
1134
+ lastHoveredEntityId = firstId;
1135
+ */
1136
+ }
1137
+ else {
1138
+ this._manager.VisualsRegister.ClearSelected();
1139
+ if (first) {
1140
+ this._manager.VisualsRegister.SetSelected({
1141
+ entityIds: [firstId],
1142
+ selected: true
1143
+ });
1144
+ }
1145
+ }
1146
+ }
1147
+ catch (e) {
1148
+ console.error(e);
1149
+ }
1150
+ };
1151
+ const hoverDelayQueue = new bruce_models_1.DelayQueue(() => {
1152
+ process2dCursor(lastHoverPos, true);
1153
+ }, 80);
1154
+ events.setInputAction((e) => {
1155
+ var _a;
1156
+ if (!((_a = e === null || e === void 0 ? void 0 : e.position) === null || _a === void 0 ? void 0 : _a.x)) {
1157
+ return;
1158
+ }
1159
+ process2dCursor(e.position, false);
1160
+ }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
1161
+ events.setInputAction((e) => {
1162
+ var _a;
1163
+ if (!((_a = e === null || e === void 0 ? void 0 : e.endPosition) === null || _a === void 0 ? void 0 : _a.x)) {
1164
+ return;
1165
+ }
1166
+ lastHoverPos = e.endPosition;
1167
+ hoverDelayQueue.Call();
1168
+ }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
1169
+ this._cesiumEventRemoval = () => {
1170
+ hoverDelayQueue.Dispose();
1171
+ if (!events || events.isDestroyed()) {
1172
+ return;
1173
+ }
1174
+ events.destroy();
1175
+ };
1176
+ }
1177
+ }
1178
+ exports.WidgetCursorBar = WidgetCursorBar;
1179
+ //# sourceMappingURL=widget-cursorbar.js.map