@openglobus/og 0.15.1 → 0.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/README.md +10 -4
  2. package/css/og.css +44 -45
  3. package/dist/@openglobus/og.css +1 -1
  4. package/dist/@openglobus/og.esm.js +2 -2
  5. package/dist/@openglobus/og.esm.js.map +1 -1
  6. package/dist/@openglobus/og.umd.js +2 -2
  7. package/dist/@openglobus/og.umd.js.map +1 -1
  8. package/package.json +12 -12
  9. package/src/og/Clock.js +1 -1
  10. package/src/og/Events.js +1 -1
  11. package/src/og/Extent.js +1 -1
  12. package/src/og/Globe.js +3 -5
  13. package/src/og/Popup.js +38 -63
  14. package/src/og/astro/earth.js +2 -2
  15. package/src/og/astro/rotation.js +2 -2
  16. package/src/og/bv/Box.js +1 -0
  17. package/src/og/bv/index.js +1 -1
  18. package/src/og/camera/Camera.js +4 -4
  19. package/src/og/camera/PlanetCamera.js +26 -6
  20. package/src/og/camera/index.js +1 -1
  21. package/src/og/control/Atmosphere.js +3 -8
  22. package/src/og/control/CompassButton.js +4 -5
  23. package/src/og/control/EarthCoordinates.js +3 -2
  24. package/src/og/control/EarthNavigation.js +0 -1
  25. package/src/og/control/GeoImageDragControl.js +2 -2
  26. package/src/og/control/KeyboardNavigation.js +3 -2
  27. package/src/og/control/LayerAnimation.js +2 -2
  28. package/src/og/control/LayerSwitcher.js +5 -4
  29. package/src/og/control/Lighting.js +106 -35
  30. package/src/og/control/MouseNavigation.js +4 -4
  31. package/src/og/control/MouseWheelZoomControl.js +2 -2
  32. package/src/og/control/RulerSwitcher.js +4 -3
  33. package/src/og/control/ScaleControl.js +2 -2
  34. package/src/og/control/ShowFps.js +2 -1
  35. package/src/og/control/SimpleNavigation.js +2 -1
  36. package/src/og/control/SimpleSkyBackground.js +2 -2
  37. package/src/og/control/Sun.js +8 -1
  38. package/src/og/control/ToggleWireframe.js +2 -1
  39. package/src/og/control/TouchNavigation.js +4 -3
  40. package/src/og/control/ZoomControl.js +6 -5
  41. package/src/og/control/index.js +10 -10
  42. package/src/og/control/ruler/RulerScene.js +19 -11
  43. package/src/og/control/selection/Selection.js +1 -1
  44. package/src/og/control/selection/SelectionScene.js +5 -8
  45. package/src/og/control/timeline/TimelineControl.js +3 -4
  46. package/src/og/control/timeline/TimelineModel.js +2 -2
  47. package/src/og/control/timeline/TimelineView.js +10 -5
  48. package/src/og/control/visibleExtent/Segment.js +5 -5
  49. package/src/og/control/visibleExtent/VisibleExtent.js +1 -1
  50. package/src/og/ellipsoid/Ellipsoid.js +3 -3
  51. package/src/og/entity/BaseBillboard.js +2 -2
  52. package/src/og/entity/BillboardHandler.js +10 -2
  53. package/src/og/entity/Entity.js +10 -51
  54. package/src/og/entity/EntityCollection.js +3 -20
  55. package/src/og/entity/GeoObject.js +2 -4
  56. package/src/og/entity/GeoObjectHandler.js +12 -11
  57. package/src/og/entity/Geometry.js +2 -2
  58. package/src/og/entity/GeometryHandler.js +2 -2
  59. package/src/og/entity/Label.js +2 -2
  60. package/src/og/entity/LabelHandler.js +7 -5
  61. package/src/og/entity/Polyline.js +8 -7
  62. package/src/og/entity/Ray.js +1 -2
  63. package/src/og/entity/RayHandler.js +4 -0
  64. package/src/og/entity/Strip.js +8 -5
  65. package/src/og/entity/index.js +1 -1
  66. package/src/og/index.core.js +4 -4
  67. package/src/og/index.js +4 -4
  68. package/src/og/index.webgl.js +3 -3
  69. package/src/og/layer/BaseGeoImage.js +2 -2
  70. package/src/og/layer/GeoImage.js +2 -2
  71. package/src/og/layer/GeoTexture2d.js +1 -1
  72. package/src/og/layer/Layer.js +3 -3
  73. package/src/og/layer/Vector.js +7 -11
  74. package/src/og/layer/WMS.js +2 -1
  75. package/src/og/layer/XYZ.js +2 -4
  76. package/src/og/math/Line3.js +0 -1
  77. package/src/og/math/Plane.js +0 -1
  78. package/src/og/math/Ray.js +0 -1
  79. package/src/og/math/Vec2.js +62 -62
  80. package/src/og/math/Vec3.js +1 -1
  81. package/src/og/math/Vec4.js +1 -1
  82. package/src/og/math/index.js +1 -1
  83. package/src/og/proj/EPSG3857.js +1 -1
  84. package/src/og/proj/EPSG4326.js +1 -1
  85. package/src/og/quadTree/EarthQuadTreeStrategy.js +4 -4
  86. package/src/og/quadTree/MarsQuadTreeStrategy.js +4 -4
  87. package/src/og/quadTree/Node.js +1 -1
  88. package/src/og/quadTree/Wgs84QuadTreeStrategy.js +4 -4
  89. package/src/og/quadTree/index.js +2 -2
  90. package/src/og/renderer/Renderer.js +196 -77
  91. package/src/og/renderer/RendererEvents.js +35 -10
  92. package/src/og/scene/Axes.js +2 -2
  93. package/src/og/scene/Planet.js +47 -75
  94. package/src/og/scene/RenderNode.js +2 -13
  95. package/src/og/scene/SkyBox.js +1 -1
  96. package/src/og/scene/index.js +2 -2
  97. package/src/og/segment/Segment.js +5 -5
  98. package/src/og/segment/SegmentLonLatWgs84.js +2 -3
  99. package/src/og/shaders/drawnode.js +5 -1
  100. package/src/og/shaders/geoObject.js +2 -6
  101. package/src/og/shaders/pickingMask.js +31 -0
  102. package/src/og/shaders/polyline.js +212 -212
  103. package/src/og/terrain/BilTerrain.js +4 -4
  104. package/src/og/terrain/GlobusTerrain.js +7 -7
  105. package/src/og/terrain/MapboxTerrain.js +2 -2
  106. package/src/og/terrain/index.js +2 -2
  107. package/src/og/ui/Button.js +5 -4
  108. package/src/og/ui/Dialog.js +3 -6
  109. package/src/og/ui/Slider.js +29 -3
  110. package/src/og/ui/View.js +5 -5
  111. package/src/og/ui/icons.js +3 -0
  112. package/src/og/utils/FontAtlas.js +2 -2
  113. package/src/og/utils/GeoImageCreator.js +0 -1
  114. package/src/og/utils/NormalMapCreator.js +6 -5
  115. package/src/og/utils/TerrainWorker.js +1 -1
  116. package/src/og/utils/VectorTileCreator.js +4 -4
  117. package/src/og/utils/shared.js +1 -1
  118. package/src/og/webgl/Framebuffer.js +3 -1
  119. package/src/og/webgl/Handler.js +77 -62
  120. package/src/og/webgl/Multisample.js +18 -7
  121. package/src/og/webgl/Program.js +2 -2
  122. package/src/og/webgl/index.js +2 -2
  123. package/types/Popup.d.ts +8 -21
  124. package/types/camera/PlanetCamera.d.ts +1 -0
  125. package/types/control/Sun.d.ts +1 -0
  126. package/types/control/ruler/RulerScene.d.ts +4 -3
  127. package/types/entity/Entity.d.ts +2 -19
  128. package/types/entity/EntityCollection.d.ts +0 -7
  129. package/types/math/Vec2.d.ts +95 -95
  130. package/types/renderer/Renderer.d.ts +28 -16
  131. package/types/scene/Planet.d.ts +2 -7
  132. package/types/shaders/pickingMask.d.ts +2 -0
  133. package/types/ui/Slider.d.ts +3 -0
  134. package/types/ui/View.d.ts +1 -0
  135. package/types/ui/icons.d.ts +1 -0
  136. package/types/webgl/Framebuffer.d.ts +1 -0
  137. package/types/webgl/Handler.d.ts +3 -2
  138. package/src/og/entity/ShapeHandler.js +0 -99
  139. package/src/og/shaders/shape.js +0 -135
  140. package/src/og/shapes/BaseShape.js +0 -557
  141. package/src/og/shapes/Icosphere.js +0 -179
  142. package/src/og/shapes/Sphere.js +0 -100
  143. package/types/entity/ShapeHandler.d.ts +0 -22
  144. package/types/shaders/shape.d.ts +0 -4
  145. package/types/shapes/BaseShape.d.ts +0 -250
  146. package/types/shapes/Sphere.d.ts +0 -41
@@ -4,22 +4,44 @@
4
4
 
5
5
  "use strict";
6
6
 
7
- import { Control } from "./Control.js";
8
7
  import { Dialog } from '../ui/Dialog.js';
9
- import { View } from '../ui/View.js';
10
- import { ToggleButton } from "../ui/ToggleButton.js";
11
8
  import { Slider } from "../ui/Slider.js";
9
+ import { ToggleButton } from "../ui/ToggleButton.js";
10
+ import { View } from '../ui/View.js';
11
+ import { Control } from "./Control.js";
12
+
13
+ const SUN_STOP_SVG_ICON = `<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 122.88 70.41" style="enable-background:new 0 0 122.88 70.41" xml:space="preserve"><g><path d="M60.91,19.12c6.95,0,13.24,2.95,17.8,7.72c4.55,4.77,7.37,11.37,7.37,18.64c0,1.94-0.2,3.83-0.58,5.65h31.61 c2.1,0,2.62,1.16,2.62,2.59c0,1.43-0.52,2.59-2.62,2.59H7.09c-2.1,0-2.62-1.16-2.62-2.59c0-1.43,0.52-2.59,2.62-2.59h29.23 c-0.38-1.82-0.58-3.71-0.58-5.65c0-7.28,2.82-13.87,7.37-18.64C47.67,22.08,53.96,19.12,60.91,19.12L60.91,19.12L60.91,19.12z M63.4,70.41c-2.1,0-2.62-1.16-2.62-2.59s0.52-2.59,2.62-2.59h56.86c2.1,0,2.62,1.16,2.62,2.59s-0.52,2.59-2.62,2.59H63.4 L63.4,70.41z M2.62,70.41c-2.1,0-2.62-1.16-2.62-2.59s0.52-2.59,2.62-2.59h29.51c2.1,0,2.62,1.16,2.62,2.59s-0.52,2.59-2.62,2.59 H2.62L2.62,70.41z M38.39,9.46c-0.78-1.35-0.32-3.07,1.03-3.85c1.35-0.78,3.07-0.32,3.85,1.03l3.62,6.27 c0.78,1.35,0.32,3.07-1.03,3.85c-1.35,0.78-3.07,0.32-3.85-1.03L38.39,9.46L38.39,9.46L38.39,9.46z M58.67,2.83 c0-1.56,1.27-2.83,2.83-2.83c1.56,0,2.83,1.27,2.83,2.83v7.24c0,1.56-1.27,2.83-2.83,2.83c-1.56,0-2.83-1.26-2.83-2.83V2.83 L58.67,2.83L58.67,2.83z M79.56,7.23c0.77-1.35,2.49-1.81,3.84-1.04c1.35,0.77,1.81,2.49,1.04,3.84l-3.62,6.27 c-0.77,1.35-2.49,1.81-3.84,1.04c-1.35-0.77-1.81-2.49-1.04-3.84L79.56,7.23L79.56,7.23L79.56,7.23z M95.45,21.48 c1.35-0.78,3.07-0.32,3.85,1.03c0.78,1.35,0.32,3.07-1.03,3.85L92,29.98c-1.35,0.78-3.07,0.32-3.85-1.03 c-0.78-1.35-0.32-3.07,1.03-3.85L95.45,21.48L95.45,21.48L95.45,21.48z M102.08,41.76c1.56,0,2.83,1.27,2.83,2.83 c0,1.56-1.27,2.83-2.83,2.83h-7.24c-1.56,0-2.83-1.26-2.83-2.83s1.26-2.83,2.83-2.83H102.08L102.08,41.76L102.08,41.76z M19.74,46.25c-1.56,0-2.83-1.27-2.83-2.83c0-1.56,1.27-2.83,2.83-2.83h7.24c1.56,0,2.83,1.26,2.83,2.83s-1.27,2.83-2.83,2.83 H19.74L19.74,46.25L19.74,46.25z M24.14,25.35c-1.35-0.77-1.81-2.49-1.04-3.84c0.77-1.35,2.49-1.81,3.84-1.04l6.27,3.62 c1.35,0.77,1.81,2.49,1.04,3.84c-0.77,1.35-2.49,1.81-3.84,1.04L24.14,25.35L24.14,25.35L24.14,25.35z"/></g></svg>`;
14
+ const SUN_ACTIVE_SVG_ICON = `<?xml version="1.0"?>
15
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
16
+ <path style="text-indent:0;text-align:start;line-height:normal;text-transform:none;block-progression:tb;-inkscape-font-specification:Sans" d="M 16 4 C 9.3844277 4 4 9.3844277 4 16 C 4 22.615572 9.3844277 28 16 28 C 22.615572 28 28 22.615572 28 16 C 28 9.3844277 22.615572 4 16 4 z M 16 6 C 16.389823 6 16.778223 6.0506339 17.15625 6.09375 C 18.631659 7.6568432 21 10.9245 21 16 C 21 21.0755 18.631659 24.343157 17.15625 25.90625 C 16.778223 25.949366 16.389823 26 16 26 C 10.465308 26 6 21.534692 6 16 C 6 10.465308 10.465308 6 16 6 z" overflow="visible" font-family="Sans"/>
17
+ </svg>
18
+ `;
19
+ const LIGHTING_ENABLED_SVG_ICON = `<?xml version="1.0" encoding="utf-8"?>
20
+ <!-- Generated by IcoMoon.io -->
21
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
22
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" viewBox="0 0 512 512">
23
+ <g>
24
+ </g>
25
+ \t<path d="M257.894 156.948c-53.258 0-96.42 43.561-96.42 97.26 0 53.719 43.161 97.249 96.42 97.249 53.197 0 96.379-43.53 96.379-97.25 0-53.698-43.182-97.26-96.379-97.26zM257.894 309.873c-30.464 0-55.163-24.945-55.163-55.665s24.699-55.624 55.163-55.624c30.423 0 55.101 24.904 55.101 55.624s-24.688 55.665-55.101 55.665z" fill="#000000" />
26
+ \t<path d="M241.808 43.499h32.144v79.575h-32.144v-79.575z" fill="#000000" />
27
+ \t<path d="M417.209 115.897l-22.723-22.917-55.757 56.279 22.723 22.907z" fill="#000000" />
28
+ \t<path d="M389.468 238.407h78.899v32.389h-78.899v-32.389z" fill="#000000" />
29
+ \t<path d="M396.012 416.86l22.723-22.917-55.767-56.259-22.712 22.897z" fill="#000000" />
30
+ \t<path d="M242.473 388.915h32.144v79.575h-32.144v-79.575z" fill="#000000" />
31
+ \t<path d="M96.266 396.073l22.722 22.938 55.778-56.289-22.692-22.928z" fill="#000000" />
32
+ \t<path d="M43.633 240.537h78.879v32.43h-78.879v-32.43z" fill="#000000" />
33
+ \t<path d="M115.394 93.051l-22.681 22.907 55.757 56.258 22.702-22.917z" fill="#000000" />
34
+ </svg>`;
35
+ const ATMOSPHERE_SVG_ICON = `<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
36
+ <svg width="800px" height="800px" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path fill="#000000" d="M135.688 18.5c-6.798 74.842-23.842 85.39-107.907 59.656 84.85 52.022 73.57 64.954-6.843 96.938 87.743-10.27 103.29 4.89 70.75 87.594 17.805-27.56 32.5-44.498 46.282-54.47-11.813 28.26-18.345 59.274-18.345 91.813 0 84.184 43.71 157.96 109.656 200.376-41.624-43.834-67.686-102.7-67.686-167.875 0-134.923 109.45-244.405 244.375-244.405 30.92 0 60.76 5.762 88 16.25-38.584-26.87-85.517-42.625-136.064-42.625-55.257 0-106.14 18.802-146.562 50.375 4.627-18.783 17.39-38.073 41.03-60.906C190.18 90.942 153.53 95.634 135.69 18.5zm10.03 77.188c5.67.002 11.428 1.247 16.876 3.874 14.506 6.998 22.72 21.81 22 36.938-10.26 10.87-19.507 22.696-27.594 35.344-9.035 2.753-19.075 2.27-28.25-2.156-19.37-9.343-27.5-32.6-18.156-51.97 6.715-13.92 20.638-22.036 35.125-22.03z"/></svg>`;
37
+
12
38
 
13
39
  const TEMPLATE =
14
40
  `<div class="og-lighing">
15
41
 
16
42
  <div class="og-option">
17
- <div class="og-caption">Lighting enabled<input type="checkbox" id="lighting" name="light"/></div>
18
- </div>
19
-
20
- <div class="og-option">
21
- <div class="og-caption">Atmosphere enabled<input type="checkbox" id="atmosphere" name="atmosphere"/></div>
22
- </div>
43
+ <div class="og-suncontrol"></div>
44
+ </div>
23
45
 
24
46
  <div class="og-option og-atmosphere-opacity">
25
47
  </div>
@@ -121,12 +143,12 @@ class Lighting extends Control {
121
143
 
122
144
  this._atmosphereMaxOpacity = new Slider({
123
145
  label: "Max.opacity",
124
- max: 1
146
+ max: 5
125
147
  });
126
148
 
127
149
  this._atmosphereMinOpacity = new Slider({
128
150
  label: "Min.opacity",
129
- max: 1
151
+ max: 5
130
152
  });
131
153
 
132
154
  this._gamma = new Slider({
@@ -216,14 +238,11 @@ class Lighting extends Control {
216
238
  }
217
239
 
218
240
  oninit() {
241
+
219
242
  this._toggleBtn.appendTo(this.renderer.div);
220
243
  this._dialog.appendTo(this.renderer.div);
221
244
  this._panel.appendTo(this._dialog.container);
222
245
 
223
- this._toggleBtn.on("change", (isActive) => {
224
- this._dialog.setVisibility(isActive);
225
- });
226
-
227
246
  this.$atmosphereOpacity = document.querySelector(".og-atmosphere-opacity");
228
247
  this.$gamma = document.querySelector(".og-option.og-gamma");
229
248
  this.$exposure = document.querySelector(".og-option.og-exposure");
@@ -233,6 +252,78 @@ class Lighting extends Control {
233
252
  this.$specular = document.querySelector(".og-option.og-specular");
234
253
  this.$night = document.querySelector(".og-option.og-night");
235
254
 
255
+ this._toggleBtn.on("change", (isActive) => {
256
+ this._dialog.setVisibility(isActive);
257
+ });
258
+
259
+ let $suncontrol = this._dialog.select(".og-suncontrol");
260
+
261
+ let sunStopBtn = new ToggleButton({
262
+ classList: ["og-suncontrol-button"],
263
+ isActive: true,
264
+ icon: SUN_STOP_SVG_ICON,
265
+ title: "Star/stop the Sun from following the camera"
266
+ });
267
+ sunStopBtn.appendTo($suncontrol);
268
+
269
+ let sunActiveBtn = new ToggleButton({
270
+ classList: ["og-suncontrol-button"],
271
+ isActive: true,
272
+ icon: SUN_ACTIVE_SVG_ICON,
273
+ title: "Activate/deactivate the Sun current time positioning"
274
+ });
275
+ sunActiveBtn.appendTo($suncontrol);
276
+
277
+ sunStopBtn.on("change", (isActive) => {
278
+ if (isActive) {
279
+ this.planet.renderer.controls.sun.start();
280
+ } else {
281
+ this.planet.renderer.controls.sun.stop();
282
+ }
283
+ });
284
+
285
+ sunActiveBtn.on("change", (isActive) => {
286
+ if (isActive) {
287
+ this.planet.renderer.controls.sun.activate();
288
+ } else {
289
+ this.planet.renderer.controls.sun.deactivate();
290
+ }
291
+ });
292
+
293
+ let lightingEnabledBtn = new ToggleButton({
294
+ classList: ["og-suncontrol-button"],
295
+ isActive: this.planet.lightEnabled,
296
+ icon: LIGHTING_ENABLED_SVG_ICON,
297
+ title: "Enable/disable planet lighting"
298
+ });
299
+ lightingEnabledBtn.appendTo($suncontrol);
300
+
301
+ lightingEnabledBtn.on("change", (isActive) => {
302
+ this.planet.lightEnabled = isActive;
303
+ });
304
+
305
+ let atmosphereEnabledBtn = new ToggleButton({
306
+ classList: ["og-suncontrol-button"],
307
+ isActive: this.planet.atmosphereEnabled,
308
+ icon: ATMOSPHERE_SVG_ICON,
309
+ title: "Enable/disable atmosphere scattering"
310
+ });
311
+ atmosphereEnabledBtn.appendTo($suncontrol);
312
+
313
+ if (this.planet.atmosphereEnabled) {
314
+ this.$atmosphereOpacity.style.display = "block";
315
+ } else {
316
+ this.$atmosphereOpacity.style.display = "none";
317
+ }
318
+ atmosphereEnabledBtn.on("change", (isActive) => {
319
+ this.planet.atmosphereEnabled = isActive;
320
+ if (this.planet.atmosphereEnabled) {
321
+ this.$atmosphereOpacity.style.display = "block";
322
+ } else {
323
+ this.$atmosphereOpacity.style.display = "none";
324
+ }
325
+ });
326
+
236
327
  this._atmosphereMaxOpacity.appendTo(this.$atmosphereOpacity);
237
328
  this._atmosphereMinOpacity.appendTo(this.$atmosphereOpacity);
238
329
 
@@ -255,26 +346,6 @@ class Lighting extends Control {
255
346
  this._specular_b.appendTo(this.$specular);
256
347
  this._shininess.appendTo(this.$specular);
257
348
 
258
- document.getElementById("lighting").checked = this.planet.lightEnabled;
259
- document.getElementById("lighting").addEventListener("change", (e) => {
260
- this.planet.lightEnabled = e.target.checked;
261
- });
262
-
263
- if (this.planet.atmosphereEnabled) {
264
- this.$atmosphereOpacity.style.display = "block";
265
- } else {
266
- this.$atmosphereOpacity.style.display = "none";
267
- }
268
- document.getElementById("atmosphere").checked = this.planet.atmosphereEnabled;
269
- document.getElementById("atmosphere").addEventListener("change", (e) => {
270
- this.planet.atmosphereEnabled = e.target.checked;
271
- if (this.planet.atmosphereEnabled) {
272
- this.$atmosphereOpacity.style.display = "block";
273
- } else {
274
- this.$atmosphereOpacity.style.display = "none";
275
- }
276
- });
277
-
278
349
  this._atmosphereMinOpacity.value = this.planet.atmosphereMinOpacity;
279
350
  this._atmosphereMinOpacity.on("change", (val) => {
280
351
  this.planet.atmosphereMinOpacity = val;
@@ -4,16 +4,16 @@
4
4
 
5
5
  "use strict";
6
6
 
7
- import * as math from "../math.js";
8
- import { Control } from "./Control.js";
7
+ import { Sphere } from "../bv/Sphere.js";
9
8
  import { input } from "../input/input.js";
10
9
  import { Key } from "../Lock.js";
11
10
  import { LonLat } from "../LonLat.js";
11
+ import * as math from "../math.js";
12
12
  import { Mat4 } from "../math/Mat4.js";
13
13
  import { Quat } from "../math/Quat.js";
14
14
  import { Ray } from "../math/Ray.js";
15
- import { Sphere } from "../bv/Sphere.js";
16
15
  import { Vec3 } from "../math/Vec3.js";
16
+ import { Control } from "./Control.js";
17
17
 
18
18
  /**
19
19
  * Mouse planet camera dragging control.
@@ -457,4 +457,4 @@ class MouseNavigation extends Control {
457
457
  }
458
458
  }
459
459
 
460
- export { MouseNavigation };
460
+ export { MouseNavigation };
@@ -4,11 +4,11 @@
4
4
 
5
5
  "use strict";
6
6
 
7
- import { Control } from "./Control.js";
7
+ import { Sphere } from "../bv/Sphere.js";
8
8
  import { Key } from "../Lock.js";
9
9
  import { Quat } from "../math/Quat.js";
10
- import { Sphere } from "../bv/Sphere.js";
11
10
  import { Vec3 } from "../math/Vec3.js";
11
+ import { Control } from "./Control.js";
12
12
  import { MouseNavigation } from "./MouseNavigation.js";
13
13
 
14
14
  /**
@@ -4,9 +4,9 @@
4
4
 
5
5
  "use strict";
6
6
 
7
+ import { ToggleButton } from "../ui/ToggleButton.js";
7
8
  import { Control } from "./Control.js";
8
9
  import { Ruler } from "./ruler/Ruler.js";
9
- import { ToggleButton } from "../ui/ToggleButton.js";
10
10
 
11
11
  const ICON_BUTTON_SVG = `<?xml version="1.0" encoding="iso-8859-1"?>
12
12
  <!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
@@ -56,10 +56,11 @@ class RulerSwitcher extends Control {
56
56
 
57
57
  let btn = new ToggleButton({
58
58
  classList: ["og-map-button", "og-ruler_button"],
59
- icon: ICON_BUTTON_SVG,
60
- appendTo: this.renderer.div
59
+ icon: ICON_BUTTON_SVG
61
60
  });
62
61
 
62
+ btn.appendTo(this.renderer.div);
63
+
63
64
  btn.on("change", (isActive) => {
64
65
  if (isActive) {
65
66
  this.onactivate();
@@ -4,10 +4,10 @@
4
4
 
5
5
  "use strict";
6
6
 
7
- import { Control } from "./Control.js";
8
7
  import { RADIANS } from "../math.js";
9
- import { binarySearch, parseHTML } from "../utils/shared.js";
10
8
  import { Vec3 } from "../math/Vec3.js";
9
+ import { binarySearch, parseHTML } from "../utils/shared.js";
10
+ import { Control } from "./Control.js";
11
11
 
12
12
  const scale = [
13
13
  1, 2, 3, 5, 10, 20, 30, 50, 100, 200, 300, 500, 1e3, 2e3, 3e3, 5e3, 10e3, 20e3, 30e3, 50e3,
@@ -4,8 +4,8 @@
4
4
 
5
5
  "use strict";
6
6
 
7
- import { Control } from "./Control.js";
8
7
  import { print2d } from "../utils/shared.js";
8
+ import { Control } from "./Control.js";
9
9
 
10
10
  /**
11
11
  * Frame per second(FPS) display control.
@@ -41,3 +41,4 @@ export function showFps(options) {
41
41
  }
42
42
 
43
43
  export { ShowFps };
44
+
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
- import { Control } from "./Control.js";
4
3
  import { input } from "../input/input.js";
4
+ import { Control } from "./Control.js";
5
5
 
6
6
  /**
7
7
  * Simple keyboard camera navigation with W,S,A,D and shift keys to fly around the scene.
@@ -125,3 +125,4 @@ export function simpleNavigation(options) {
125
125
  }
126
126
 
127
127
  export { SimpleNavigation };
128
+
@@ -4,9 +4,9 @@
4
4
 
5
5
  "use strict";
6
6
 
7
- import { Control } from "./Control.js";
8
- import { Program } from '../webgl/Program.js';
9
7
  import { htmlColorToRgb } from "../utils/shared.js";
8
+ import { Program } from '../webgl/Program.js';
9
+ import { Control } from "./Control.js";
10
10
 
11
11
  /**
12
12
  * Frame per second(FPS) display control.
@@ -4,11 +4,11 @@
4
4
 
5
5
  "use strict";
6
6
 
7
- import { Control } from "./Control.js";
8
7
  import { getSunPosition } from "../astro/earth.js";
9
8
  import { LightSource } from "../light/LightSource.js";
10
9
  import { Quat } from "../math/Quat.js";
11
10
  import { Vec3 } from "../math/Vec3.js";
11
+ import { Control } from "./Control.js";
12
12
 
13
13
  /**
14
14
  * Real Sun geocentric position control that place the Sun on the right place by the Earth.
@@ -93,9 +93,16 @@ class Sun extends Control {
93
93
 
94
94
  stop() {
95
95
  this._stopped = true;
96
+ this.deactivate();
97
+ }
98
+
99
+ start() {
100
+ this._stopped = false;
101
+ this.activate();
96
102
  }
97
103
 
98
104
  onactivate() {
105
+ super.onactivate();
99
106
  this._stopped = false;
100
107
  }
101
108
 
@@ -4,8 +4,8 @@
4
4
 
5
5
  "use strict";
6
6
 
7
- import { Control } from "./Control.js";
8
7
  import { input } from "../input/input.js";
8
+ import { Control } from "./Control.js";
9
9
 
10
10
  /**
11
11
  * Planet GL draw mode(TRIANGLE_STRIP/LINE_STRING) changer.
@@ -36,3 +36,4 @@ class ToggleWireframe extends Control {
36
36
  }
37
37
 
38
38
  export { ToggleWireframe };
39
+
@@ -4,14 +4,14 @@
4
4
 
5
5
  "use strict";
6
6
 
7
- import * as math from "../math.js";
8
- import { Control } from "./Control.js";
7
+ import { Sphere } from "../bv/Sphere.js";
9
8
  import { Key } from "../Lock.js";
10
9
  import { LonLat } from "../LonLat.js";
10
+ import * as math from "../math.js";
11
11
  import { Quat } from "../math/Quat.js";
12
12
  import { Ray } from "../math/Ray.js";
13
- import { Sphere } from "../bv/Sphere.js";
14
13
  import { Vec3 } from "../math/Vec3.js";
14
+ import { Control } from "./Control.js";
15
15
 
16
16
  class Touch {
17
17
  constructor() {
@@ -338,3 +338,4 @@ class TouchNavigation extends Control {
338
338
  }
339
339
 
340
340
  export { TouchNavigation };
341
+
@@ -4,9 +4,9 @@
4
4
 
5
5
  "use strict";
6
6
 
7
- import { Control } from "./Control.js";
8
7
  import { Key } from "../Lock.js";
9
8
  import { Button } from "../ui/Button.js";
9
+ import { Control } from "./Control.js";
10
10
 
11
11
  const ICON_PLUS_SVG = '<?xml version="1.0"?>' +
12
12
  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">' +
@@ -37,15 +37,16 @@ class ZoomControl extends Control {
37
37
 
38
38
  let zoomInBtn = new Button({
39
39
  classList: ["og-map-button", "og-zoomin-button"],
40
- icon: ICON_PLUS_SVG,
41
- appendTo: this.renderer.div
40
+ icon: ICON_PLUS_SVG
42
41
  });
42
+ zoomInBtn.appendTo(this.renderer.div);
43
+
43
44
 
44
45
  let zoomOutBtn = new Button({
45
46
  classList: ["og-map-button", "og-zoomout-button"],
46
- icon: ICON_MINUS_SVG,
47
- appendTo: this.renderer.div
47
+ icon: ICON_MINUS_SVG
48
48
  });
49
+ zoomOutBtn.appendTo(this.renderer.div);
49
50
 
50
51
  zoomInBtn.on("mousedown", (e) => this.zoomIn());
51
52
  zoomInBtn.on("mouseup", (e) => this.stopZoom());
@@ -1,25 +1,25 @@
1
- import { Control } from "./Control.js";
2
1
  import { CompassButton } from "./CompassButton.js";
2
+ import { Control } from "./Control.js";
3
3
  import { DebugInfo } from "./DebugInfo";
4
- import { EarthNavigation } from "./EarthNavigation.js";
5
4
  import { EarthCoordinates } from "./EarthCoordinates.js";
5
+ import { EarthNavigation } from "./EarthNavigation.js";
6
6
  import { GeoImageDragControl } from "./GeoImageDragControl.js";
7
7
  import { KeyboardNavigation } from "./KeyboardNavigation.js";
8
+ import { LayerAnimation } from "./LayerAnimation.js";
8
9
  import { LayerSwitcher } from "./LayerSwitcher.js";
10
+ import { Lighting } from "./Lighting.js";
9
11
  import { MouseNavigation } from "./MouseNavigation.js";
10
- import { ToggleWireframe } from "./ToggleWireframe.js";
11
- import { TouchNavigation } from "./TouchNavigation.js";
12
- import { SimpleNavigation } from "./SimpleNavigation.js";
12
+ import { MouseWheelZoomControl } from "./MouseWheelZoomControl.js";
13
13
  import { Ruler } from "./ruler/Ruler.js";
14
+ import { ScaleControl } from "./ScaleControl.js";
14
15
  import { Selection } from "./selection/Selection.js";
15
16
  import { ShowFps } from "./ShowFps.js";
17
+ import { SimpleNavigation } from "./SimpleNavigation.js";
18
+ import { SimpleSkyBackground } from "./SimpleSkyBackground.js";
16
19
  import { Sun } from "./Sun.js";
20
+ import { ToggleWireframe } from "./ToggleWireframe.js";
21
+ import { TouchNavigation } from "./TouchNavigation.js";
17
22
  import { ZoomControl } from "./ZoomControl.js";
18
- import { MouseWheelZoomControl } from "./MouseWheelZoomControl.js";
19
- import { Lighting } from "./Lighting.js";
20
- import { LayerAnimation } from "./LayerAnimation.js";
21
- import { ScaleControl } from "./ScaleControl.js";
22
- import { SimpleSkyBackground } from "./SimpleSkyBackground.js";
23
23
 
24
24
  export {
25
25
  Control,
@@ -1,15 +1,12 @@
1
1
  'use strict';
2
2
 
3
- import * as math from '../../math.js';
4
- import { RenderNode } from '../../scene/RenderNode.js';
3
+ import { Ellipsoid } from '../../ellipsoid/Ellipsoid.js';
4
+ import { Entity } from '../../entity/Entity.js';
5
5
  import { Events } from '../../Events.js';
6
- import { LonLat } from '../../LonLat.js';
7
- import { Vec3 } from '../../math/Vec3.js';
8
- import { Vec2 } from '../../math/Vec2.js';
9
6
  import { Vector } from '../../layer/Vector.js';
10
- import { Entity } from '../../entity/Entity.js';
11
- import { Ellipsoid } from '../../ellipsoid/Ellipsoid.js';
7
+ import { Vec2 } from '../../math/Vec2.js';
12
8
  import { Object3d } from '../../Object3d.js';
9
+ import { RenderNode } from '../../scene/RenderNode.js';
13
10
 
14
11
  const OUTLINE_COUNT = 120;
15
12
 
@@ -61,8 +58,8 @@ class RulerScene extends RenderNode {
61
58
  this._trackEntity = new Entity({
62
59
  polyline: {
63
60
  path3v: [],
64
- thickness: 3.8,
65
- color: "rgb(455,455,455)",
61
+ thickness: 4.8,
62
+ color: "rgb(255,131,0)",
66
63
  isClosed: false
67
64
  }
68
65
  });
@@ -144,6 +141,9 @@ class RulerScene extends RenderNode {
144
141
  this._onLdblclick_ = this._onLdblclick.bind(this);
145
142
  this.renderer.events.on("ldblclick", this._onLdblclick_, this);
146
143
 
144
+ this._onLUp_ = this._onLUp.bind(this);
145
+ this.renderer.events.on("lup", this._onLUp_, this);
146
+
147
147
  this._onCornerEnter_ = this._onCornerEnter.bind(this);
148
148
  this._cornersLayer.events.on("mouseenter", this._onCornerEnter_, this);
149
149
 
@@ -168,8 +168,11 @@ class RulerScene extends RenderNode {
168
168
  this._pickedCorner = null;
169
169
  this._trackLayer.remove();
170
170
  this._cornersLayer.remove();
171
+
171
172
  this.renderer.events.off("lclick", this._onLclick_);
172
173
  this.renderer.events.off("mousemove", this._onMouseMove_);
174
+ this.renderer.events.off("lup", this._onLUp_);
175
+
173
176
  this._cornersLayer.events.off("mouseenter", this._onCornerEnter_);
174
177
  this._cornersLayer.events.off("mouseleave", this._onCornerLeave_);
175
178
  this._cornersLayer.events.off("ldown", this._onCornerLdown_);
@@ -179,6 +182,7 @@ class RulerScene extends RenderNode {
179
182
 
180
183
  this._onLclick_ = null;
181
184
  this._onMouseMove_ = null;
185
+ this._onLUp_ = null;
182
186
  this._onCornerLeave_ = null;
183
187
  this._onCornerEnter_ = null;
184
188
  this._onCornerLdown_ = null;
@@ -200,7 +204,7 @@ class RulerScene extends RenderNode {
200
204
  }
201
205
  }
202
206
 
203
- _onCornerLup(e) {
207
+ _onLUp() {
204
208
  if (this._pickedCorner) {
205
209
  this.renderer.controls.mouseNavigation.activate();
206
210
  this._pickedCorner = null;
@@ -208,6 +212,10 @@ class RulerScene extends RenderNode {
208
212
  }
209
213
  }
210
214
 
215
+ _onCornerLup() {
216
+ this._onLUp();
217
+ }
218
+
211
219
  _onCornerEnter(e) {
212
220
  e.renderer.handler.canvas.style.cursor = "pointer";
213
221
  }
@@ -353,4 +361,4 @@ const EVENT_NAMES = [
353
361
  "touchenter"
354
362
  ];
355
363
 
356
- export { RulerScene };
364
+ export { RulerScene };
@@ -4,9 +4,9 @@
4
4
 
5
5
  "use strict";
6
6
 
7
+ import { ToggleButton } from "../../ui/ToggleButton.js";
7
8
  import { Control } from "../Control.js";
8
9
  import { SelectionScene } from "./SelectionScene.js";
9
- import { ToggleButton } from "../../ui/ToggleButton.js";
10
10
 
11
11
  const ICON_BUTTON_SVG = `<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
12
12
  <svg width="800px" height="800px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--gis" preserveAspectRatio="xMidYMid meet"><path d="M2.1 0v1.914H0v6h3V3h5.1V0h-6zm9 0v3h6V0h-6zm9 0v3h6V0h-6zm9 0v3h6V0h-6zm9 0v3h6V0h-6zm9 0v3h6V0h-6zm9 0v3h6V0h-6zm9 0v3h1.8v1.2h3V0h-4.8zm1.8 7.2v6h3v-6h-3zM0 10.913v6h3v-6H0zM66.9 16.2v6h3v-6h-3zM0 19.914v6h3v-6H0zM66.9 25.2v6h3v-6h-3zM0 28.914v6h3v-6H0zM66.9 34.2v6h3v-6h-3zM0 37.914v6h3v-6H0zM66.9 43.2v6h3v-6h-3zM0 46.914v6h3v-6H0zM66.9 52.2v6h3v-6h-3zM0 55.914v5.191h3.809v-3H3v-2.19H0zm6.809 2.191v3h6v-3h-6zm9 0v3h6v-3h-6zm9 0v3h6v-3h-6zm9 0v3h6v-3h-6zm9 0v3h6v-3h-6zm9 0v3h6v-3h-6zm9 0v3h6v-3h-6zm9.648 1.899a2.076 2.076 0 0 0-2.19 2.324l3.137 33.676c.2 1.635 2.135 2.399 3.397 1.34l6.623-5.371l2.969 5.142c1.707 2.958 4.417 3.684 7.375 1.977c2.957-1.708 3.684-4.417 1.976-7.375l-2.959-5.125l7.848-3.008c1.548-.564 1.855-2.62.539-3.611L71.576 60.416a2.073 2.073 0 0 0-1.119-.412z" fill="#000000"></path></svg>`;
@@ -1,15 +1,12 @@
1
1
  'use strict';
2
2
 
3
- import * as math from '../../math.js';
4
- import { RenderNode } from '../../scene/RenderNode.js';
3
+ import { Ellipsoid } from '../../ellipsoid/Ellipsoid.js';
4
+ import { Entity } from '../../entity/Entity.js';
5
5
  import { Events } from '../../Events.js';
6
- import { LonLat } from '../../LonLat.js';
7
- import { Vec3 } from '../../math/Vec3.js';
8
- import { Vec2 } from '../../math/Vec2.js';
9
6
  import { Vector } from '../../layer/Vector.js';
10
- import { Entity } from '../../entity/Entity.js';
11
- import { Ellipsoid } from '../../ellipsoid/Ellipsoid.js';
7
+ import { LonLat } from '../../LonLat.js';
12
8
  import { Object3d } from '../../Object3d.js';
9
+ import { RenderNode } from '../../scene/RenderNode.js';
13
10
 
14
11
  const OUTLINE_COUNT = 120;
15
12
 
@@ -347,4 +344,4 @@ const EVENT_NAMES = [
347
344
  "touchenter"
348
345
  ];
349
346
 
350
- export { SelectionScene };
347
+ export { SelectionScene };
@@ -1,10 +1,9 @@
1
1
  'use strict';
2
2
 
3
- import { Control } from '../Control.js';
4
- import { TimelineView } from './TimelineView.js';
5
3
  import { Dialog } from "../../ui/Dialog.js";
6
4
  import { ToggleButton } from "../../ui/ToggleButton.js";
7
- import { UTCtoDate } from "../../astro/jd.js";
5
+ import { Control } from '../Control.js';
6
+ import { TimelineView } from './TimelineView.js';
8
7
 
9
8
  function addHours(date, hours) {
10
9
  const temp = new Date(date);
@@ -96,4 +95,4 @@ class TimelineControl extends Control {
96
95
  }
97
96
  }
98
97
 
99
- export { TimelineControl };
98
+ export { TimelineControl };
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- import { addSeconds } from "./timelineUtils.js";
4
3
  import { Events } from '../../Events.js';
4
+ import { addSeconds } from "./timelineUtils.js";
5
5
 
6
6
  class TimelineModel {
7
7
  constructor(options = {}) {
@@ -130,4 +130,4 @@ class TimelineModel {
130
130
  }
131
131
  }
132
132
 
133
- export { TimelineModel }
133
+ export { TimelineModel };