@openglobus/og 0.15.5 → 0.16.0

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 (122) hide show
  1. package/README.md +1 -1
  2. package/css/og.css +1 -1
  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 +13 -14
  9. package/src/og/Globe.js +5 -2
  10. package/src/og/LonLat.js +18 -1
  11. package/src/og/Object3d.js +21 -2
  12. package/src/og/bv/index.js +2 -2
  13. package/src/og/camera/PlanetCamera.js +4 -10
  14. package/src/og/control/RulerSwitcher.js +2 -2
  15. package/src/og/control/ZoomControl.js +2 -2
  16. package/src/og/control/heightRuler/HeightRulerScene.js +6 -2
  17. package/src/og/control/index.js +5 -2
  18. package/src/og/control/ruler/RulerScene.js +11 -8
  19. package/src/og/control/timeline/TimelineControl.js +5 -3
  20. package/src/og/control/timeline/TimelineModel.js +4 -0
  21. package/src/og/control/timeline/TimelineView.js +10 -3
  22. package/src/og/control/visibleExtent/Segment.js +36 -42
  23. package/src/og/ellipsoid/Ellipsoid.js +23 -10
  24. package/src/og/entity/Entity.js +3 -3
  25. package/src/og/entity/EntityCollection.js +2 -2
  26. package/src/og/entity/Label.js +1 -1
  27. package/src/og/entity/Polyline.js +4 -2
  28. package/src/og/index.js +4 -7
  29. package/src/og/layer/CanvasTiles.js +70 -23
  30. package/src/og/layer/GeoImage.js +40 -18
  31. package/src/og/layer/Vector.js +14 -11
  32. package/src/og/layer/WMS.js +2 -2
  33. package/src/og/math.js +2 -1
  34. package/src/og/quadTree/EPSG4326QuadTreeStrategy.js +26 -0
  35. package/src/og/quadTree/Node.js +44 -50
  36. package/src/og/quadTree/index.js +2 -0
  37. package/src/og/renderer/Renderer.js +13 -1
  38. package/src/og/scene/Planet.js +4 -4
  39. package/src/og/scene/index.js +3 -3
  40. package/src/og/segment/Segment.js +88 -76
  41. package/src/og/terrain/EmptyTerrain.js +19 -7
  42. package/src/og/terrain/GlobusTerrain.js +23 -18
  43. package/src/og/terrain/MapboxTerrain.js +7 -8
  44. package/src/og/terrain/index.js +4 -4
  45. package/src/og/utils/objParser.js +227 -0
  46. package/src/og/utils/shared.js +9 -0
  47. package/src/og/webgl/Handler.js +1 -3
  48. package/types/Globe.d.ts +2 -0
  49. package/types/LonLat.d.ts +12 -1
  50. package/types/Object3d.d.ts +2 -0
  51. package/types/Popup.d.ts +1 -1
  52. package/types/bv/index.d.ts +2 -2
  53. package/types/camera/PlanetCamera.d.ts +0 -7
  54. package/types/camera/index.d.ts +2 -2
  55. package/types/control/GeoImageDragControl.d.ts +1 -1
  56. package/types/control/LayerAnimation.d.ts +1 -1
  57. package/types/control/Lighting.d.ts +2 -2
  58. package/types/control/heightRuler/HeightRulerScene.d.ts +1 -1
  59. package/types/control/index.d.ts +3 -2
  60. package/types/control/ruler/RulerScene.d.ts +5 -4
  61. package/types/control/selection/SelectionScene.d.ts +3 -3
  62. package/types/control/timeline/TimelineControl.d.ts +10 -0
  63. package/types/control/timeline/TimelineModel.d.ts +33 -0
  64. package/types/control/timeline/TimelineView.d.ts +57 -0
  65. package/types/control/timeline/timelineUtils.d.ts +9 -0
  66. package/types/ellipsoid/Ellipsoid.d.ts +16 -9
  67. package/types/ellipsoid/index.d.ts +2 -2
  68. package/types/entity/Entity.d.ts +3 -3
  69. package/types/entity/EntityCollection.d.ts +2 -2
  70. package/types/entity/Label.d.ts +1 -1
  71. package/types/entity/Polyline.d.ts +1 -0
  72. package/types/index.d.ts +45 -46
  73. package/types/layer/CanvasTiles.d.ts +2 -1
  74. package/types/layer/GeoImage.d.ts +7 -1
  75. package/types/layer/GeoTexture2d.d.ts +1 -1
  76. package/types/layer/Vector.d.ts +3 -3
  77. package/types/layer/index.d.ts +9 -9
  78. package/types/math/Line2.d.ts +1 -1
  79. package/types/math/Line3.d.ts +1 -1
  80. package/types/math/index.d.ts +10 -10
  81. package/types/mercator.d.ts +1 -1
  82. package/types/quadTree/EPSG4326QuadTreeStrategy.d.ts +3 -0
  83. package/types/quadTree/EntityCollectionNode.d.ts +1 -1
  84. package/types/quadTree/index.d.ts +2 -0
  85. package/types/renderer/Renderer.d.ts +2 -2
  86. package/types/scene/Axes.d.ts +1 -1
  87. package/types/scene/SkyBox.d.ts +1 -1
  88. package/types/scene/index.d.ts +3 -3
  89. package/types/segment/Segment.d.ts +9 -11
  90. package/types/shaders/atmos.d.ts +1 -1
  91. package/types/shaders/billboard.d.ts +1 -1
  92. package/types/shaders/depth.d.ts +1 -1
  93. package/types/shaders/label.d.ts +1 -1
  94. package/types/shaders/pickingMask.d.ts +1 -1
  95. package/types/shaders/pointCloud.d.ts +1 -1
  96. package/types/shaders/polyline.d.ts +1 -1
  97. package/types/shaders/ray.d.ts +1 -1
  98. package/types/shaders/screenFrame.d.ts +1 -1
  99. package/types/shaders/skybox.d.ts +1 -1
  100. package/types/shaders/toneMapping.d.ts +1 -1
  101. package/types/terrain/BilTerrain.d.ts +1 -0
  102. package/types/terrain/EmptyTerrain.d.ts +13 -2
  103. package/types/terrain/GlobusTerrain.d.ts +2 -1
  104. package/types/terrain/MapboxTerrain.d.ts +1 -3
  105. package/types/terrain/index.d.ts +4 -4
  106. package/types/ui/Button.d.ts +1 -1
  107. package/types/ui/ButtonGroup.d.ts +12 -0
  108. package/types/ui/Dialog.d.ts +2 -2
  109. package/types/ui/Slider.d.ts +1 -1
  110. package/types/ui/ToggleButton.d.ts +1 -1
  111. package/types/ui/View.d.ts +1 -1
  112. package/types/utils/GeoImageCreator.d.ts +2 -2
  113. package/types/utils/ImagesCacheManager.d.ts +1 -1
  114. package/types/utils/Loader.d.ts +1 -1
  115. package/types/utils/VectorTileCreator.d.ts +1 -1
  116. package/types/utils/objParser.d.ts +8 -0
  117. package/types/utils/shared.d.ts +6 -0
  118. package/types/webgl/Handler.d.ts +2 -2
  119. package/src/og/index.core.js +0 -116
  120. package/src/og/index.webgl.js +0 -17
  121. package/types/index.core.d.ts +0 -65
  122. package/types/index.webgl.d.ts +0 -7
@@ -13,21 +13,20 @@ const rgb2Height = (r, g, b) => {
13
13
 
14
14
  class MapboxTerrain extends GlobusTerrain {
15
15
  constructor(name, options = {}) {
16
- super(name || "mapbox", options);
17
-
18
- this.equalizeVertices =
19
- options.equalizeVertices != undefined ? options.equalizeVertices : true;
16
+ super(name || "mapbox", {
17
+ equalizeVertices: options.equalizeVertices != undefined ? options.equalizeVertices : true,
18
+ maxZoom: options.maxZoom || 17,
19
+ ...options
20
+ });
20
21
 
21
22
  this.equalizeNormals = options.equalizeNormals || false;
22
23
 
23
- this.minZoom = options.minZoom != undefined ? options.minZoom : 2;
24
-
25
- this.maxZoom = options.maxZoom != undefined ? options.maxZoom : 17;
26
-
27
24
  this.gridSizeByZoom = options.gridSizeByZoom || [
28
25
  64, 32, 16, 8, 8, 8, 8, 16, 16, 16, 16, 16, 32, 16, 32, 16, 32, 16, 32, 16, 8, 4
29
26
  ];
30
27
 
28
+ "//{s}.srtm3.openglobus.org/{z}/{y}/{x}.ddm";
29
+
31
30
  this.url =
32
31
  options.url != undefined
33
32
  ? options.url
@@ -1,6 +1,6 @@
1
- import { BilTerrain } from './BilTerrain';
2
- import { EmptyTerrain } from './EmptyTerrain';
3
- import { GlobusTerrain } from './GlobusTerrain';
4
- import { MapboxTerrain } from './MapboxTerrain';
1
+ import { BilTerrain } from './BilTerrain.js';
2
+ import { EmptyTerrain } from './EmptyTerrain.js';
3
+ import { GlobusTerrain } from './GlobusTerrain.js';
4
+ import { MapboxTerrain } from './MapboxTerrain.js';
5
5
 
6
6
  export { EmptyTerrain, GlobusTerrain, MapboxTerrain, BilTerrain };
@@ -0,0 +1,227 @@
1
+ export function objParser(text){
2
+ const objPositions = [[0, 0, 0]];
3
+ const objTexcoords = [[0, 0]];
4
+ const objNormals = [[0, 0, 0]];
5
+
6
+ // same order as `f` indices
7
+ const objVertexData = [
8
+ objPositions,
9
+ objTexcoords,
10
+ objNormals,
11
+ ];
12
+
13
+ // same order as `f` indices
14
+ let vertexData = [
15
+ [], // positions
16
+ [], // texcoords
17
+ [], // normals
18
+ ];
19
+
20
+ const materialLibs = [];
21
+ const geometries = [];
22
+ let geometry;
23
+ let groups = ['default'];
24
+ let material = 'default';
25
+ let object = 'default';
26
+
27
+ const noop = () => {};
28
+
29
+ function newGeometry() {
30
+ // If there is an existing geometry and it's
31
+ // not empty then start a new one.
32
+ if (geometry && geometry.data.vertices.length) {
33
+ geometry = undefined;
34
+ }
35
+ }
36
+
37
+ function setGeometry() {
38
+ if (!geometry) {
39
+ const vertices = [];
40
+ const textures = [];
41
+ const normals = [];
42
+ vertexData = [
43
+ vertices,
44
+ textures,
45
+ normals,
46
+ ];
47
+ geometry = {
48
+ object,
49
+ groups,
50
+ material,
51
+ data: {
52
+ vertices,
53
+ textures,
54
+ normals,
55
+ },
56
+ };
57
+ geometries.push(geometry);
58
+ }
59
+ }
60
+
61
+ function addVertex(vert) {
62
+ const ptn = vert.split('/');
63
+ ptn.forEach((objIndexStr, i) => {
64
+ if (!objIndexStr) {
65
+ return;
66
+ }
67
+ const objIndex = parseInt(objIndexStr);
68
+ const index = objIndex + (objIndex >= 0 ? 0 : objVertexData[i].length);
69
+ vertexData[i].push(...objVertexData[i][index]);
70
+ });
71
+ }
72
+
73
+ const keywords = {
74
+ v(parts) {
75
+ objPositions.push(parts.map(parseFloat));
76
+ },
77
+ vn(parts) {
78
+ objNormals.push(parts.map(parseFloat));
79
+ },
80
+ vt(parts) {
81
+ // should check for missing v and extra w?
82
+ objTexcoords.push(parts.map(parseFloat));
83
+ },
84
+ f(parts) {
85
+ setGeometry();
86
+ const numTriangles = parts.length - 2;
87
+ for (let tri = 0; tri < numTriangles; ++tri) {
88
+ addVertex(parts[0]);
89
+ addVertex(parts[tri + 1]);
90
+ addVertex(parts[tri + 2]);
91
+ }
92
+ },
93
+ s: noop, // smoothing group
94
+ mtllib(parts, unparsedArgs) {
95
+ // the spec says there can be multiple filenames here
96
+ // but many exist with spaces in a single filename
97
+ materialLibs.push(unparsedArgs);
98
+ },
99
+ usemtl(parts, unparsedArgs) {
100
+ material = unparsedArgs;
101
+ newGeometry();
102
+ },
103
+ g(parts) {
104
+ groups = parts;
105
+ newGeometry();
106
+ },
107
+ o(parts, unparsedArgs) {
108
+ object = unparsedArgs;
109
+ newGeometry();
110
+ },
111
+ };
112
+
113
+ const keywordRE = /(\w*)(?: )*(.*)/;
114
+ const lines = text.split('\n');
115
+ for (let lineNo = 0; lineNo < lines.length; ++lineNo) {
116
+ const line = lines[lineNo].trim();
117
+ if (line === '' || line.startsWith('#')) {
118
+ continue;
119
+ }
120
+ const m = keywordRE.exec(line);
121
+ if (!m) {
122
+ continue;
123
+ }
124
+ const [, keyword, unparsedArgs] = m;
125
+ const parts = line.split(/\s+/).slice(1);
126
+ const handler = keywords[keyword];
127
+ if (!handler) {
128
+ console.warn('unhandled keyword:', keyword); // eslint-disable-line no-console
129
+ continue;
130
+ }
131
+ handler(parts, unparsedArgs);
132
+ }
133
+
134
+ // remove any arrays that have no entries.
135
+ for (const geometry of geometries) {
136
+ geometry.data = Object.fromEntries(
137
+ Object.entries(geometry.data).filter(([, array]) => array.length > 0));
138
+ }
139
+
140
+ return {
141
+ geometries,
142
+ materialLibs,
143
+ };
144
+ }
145
+
146
+ export function transformLeftToRightCoordinateSystem(objData) {
147
+ const convertedGeometries = objData.geometries.map(geometry => {
148
+ const vertices = geometry.data.vertices;
149
+ const normals = geometry.data.normals;
150
+ const textures = geometry.data.textures;
151
+ rotateObject(geometry.data, 0)
152
+ const convertedVertices = [];
153
+ const convertedNormals = [];
154
+ const convertedTextures = [];
155
+
156
+ // Convert positions
157
+ for (let i = 0; i < vertices.length; i += 3) {
158
+ const x = vertices[i];
159
+ const y = vertices[i + 1];
160
+ const z = vertices[i + 2];
161
+ convertedVertices.push(x, y, z);
162
+ }
163
+
164
+ // Convert normals
165
+ for (let i = 0; i < normals.length; i += 3) {
166
+ const x = normals[i];
167
+ const y = normals[i + 1];
168
+ const z = normals[i + 2];
169
+ convertedNormals.push(x, y, -z);
170
+ }
171
+
172
+ // Convert textures
173
+ for (let i = 0; i < textures.length; i += 2) {
174
+ const s = textures[i];
175
+ const t = 1 - textures[i + 1];
176
+ convertedTextures.push(s, t);
177
+ }
178
+
179
+ return {
180
+ object: geometry.object,
181
+ groups: geometry.groups,
182
+ material: geometry.material,
183
+ data: {
184
+ vertices: convertedVertices,
185
+ normals: convertedNormals,
186
+ textures: convertedTextures
187
+ }
188
+ };
189
+ });
190
+
191
+ return {
192
+ geometries: convertedGeometries,
193
+ materialLibs: objData.materialLibs
194
+ };
195
+ }
196
+
197
+ function rotateObject(obj, angle) {
198
+ const cosA = Math.cos(angle);
199
+ const sinA = Math.sin(angle);
200
+
201
+ const vertices = obj.vertices;
202
+ const normals = obj.normals;
203
+
204
+ for (let i = 0; i < vertices.length; i += 3) {
205
+ const x = vertices[i];
206
+ const y = vertices[i + 1];
207
+ const z = vertices[i + 2];
208
+
209
+ vertices[i] = x * cosA + z * sinA;
210
+ vertices[i + 1] = y;
211
+ vertices[i + 2] = -x * sinA + z * cosA;
212
+
213
+ const nx = normals[i];
214
+ const ny = normals[i + 1];
215
+ const nz = normals[i + 2];
216
+
217
+ normals[i] = nx * cosA + nz * sinA;
218
+ normals[i + 1] = ny;
219
+ normals[i + 2] = -nx * sinA + nz * cosA;
220
+ }
221
+
222
+ return {
223
+ vertices: vertices,
224
+ normals: normals
225
+ };
226
+ }
227
+
@@ -958,4 +958,13 @@ export async function loadImage(url) {
958
958
  image.src = url;
959
959
  return image;
960
960
  });
961
+ }
962
+
963
+ /**
964
+ * Gets image is loaded
965
+ * @param {HTMLImageElement} image
966
+ * @returns {boolean} Returns true is the image is loaded
967
+ */
968
+ export function isImageLoaded(image) {
969
+ return image.complete && image.naturalHeight !== 0;
961
970
  }
@@ -291,7 +291,7 @@ class Handler {
291
291
  /**
292
292
  * Creates NEAREST filter texture.
293
293
  * @public
294
- * @param {Object} image - Image or Canvas object.
294
+ * @param {HTMLCanvasElement | Image} image - Image or Canvas object.
295
295
  * @returns {Object} - WebGL texture object.
296
296
  */
297
297
  createTexture_n_webgl1(image, internalFormat, texture) {
@@ -934,8 +934,6 @@ class Handler {
934
934
  */
935
935
  start() {
936
936
  if (!this._requestAnimationFrameId && this._initialized) {
937
- this._lastAnimationFrameTime = window.performance.now();
938
- this.defaultClock.setDate(new Date());
939
937
  this._animationFrameCallback();
940
938
  }
941
939
  }
package/types/Globe.d.ts CHANGED
@@ -43,6 +43,8 @@
43
43
  * @param {Number} [options.minEqualZoomCameraSlope=0.8] - Minimal camera slope above te globe where segments on the screen bacame the same zoom level
44
44
  * @param {Number} [options.loadingBatchSize=12] -
45
45
  * @param {Number} [options.quadTreeStrategyPrototype] - Prototype of quadTree. QuadTreeStrategy for Earth is default.
46
+ * @param {Number} [options.msaa] - MSAA antialiasing parameter: 2,4,8,16. Default is 4.
47
+ * @param {Number} [options.dpi] - Device pixel ratio. Default is current screen DPI.
46
48
  */
47
49
  export class Globe {
48
50
  static set _staticCounter(arg: any);
package/types/LonLat.d.ts CHANGED
@@ -20,6 +20,12 @@ export class LonLat {
20
20
  * @returns {LonLat} -
21
21
  */
22
22
  static createFromArray(arr: Array<number>): LonLat;
23
+ /**
24
+ * Create array from lonlat
25
+ * @param lonLat
26
+ * @returns {number[]}
27
+ */
28
+ static toArray(lonLat: any): number[];
23
29
  /**
24
30
  * Converts degrees to mercator coordinates.
25
31
  * @static
@@ -71,6 +77,11 @@ export class LonLat {
71
77
  */
72
78
  public height: number;
73
79
  isZero(): boolean;
80
+ /**
81
+ * Create array from lonlat
82
+ * @returns {number[]}
83
+ */
84
+ toArray(): number[];
74
85
  /**
75
86
  * Sets coordinates.
76
87
  * @public
@@ -88,7 +99,7 @@ export class LonLat {
88
99
  */
89
100
  public copy(lonLat?: LonLat): LonLat;
90
101
  /**
91
- * Clone the coordiante.
102
+ * Clone the coordinates.
92
103
  * @public
93
104
  * @returns {LonLat} -
94
105
  */
@@ -9,6 +9,7 @@ export class Object3d {
9
9
  static createCylinder(radiusTop?: number, radiusBottom?: number, height?: number, radialSegments?: number, heightSegments?: number, isTop?: boolean, isBottom?: boolean, offsetX?: number, offsetY?: number, offsetZ?: number): Object3d;
10
10
  static createCube(length?: number, height?: number, depth?: number, xOffset?: number, yOffset?: number, zOffset?: number): Object3d;
11
11
  static createArrow(back?: number, height?: number, front?: number): Object3d;
12
+ static loadObj(src: any): Promise<any>;
12
13
  constructor(data: any);
13
14
  _name: any;
14
15
  _vertices: any;
@@ -23,6 +24,7 @@ export class Object3d {
23
24
  color: any[] | Float32Array;
24
25
  _indices: any;
25
26
  _normals: any;
27
+ set src(arg: string);
26
28
  get src(): string;
27
29
  get name(): any;
28
30
  get vertices(): any;
package/types/Popup.d.ts CHANGED
@@ -25,5 +25,5 @@ export class Popup extends View {
25
25
  setContent(content: any): void;
26
26
  clear(): void;
27
27
  }
28
- import { View } from "./ui/View.js";
28
+ import { View } from './ui/View.js';
29
29
  import { Vec3 } from "./math/Vec3.js";
@@ -1,3 +1,3 @@
1
- import { Box } from "./Box";
2
- import { Sphere } from "./Sphere";
1
+ import { Box } from './Box.js';
2
+ import { Sphere } from './Sphere.js';
3
3
  export { Box, Sphere };
@@ -68,13 +68,6 @@ export class PlanetCamera extends Camera {
68
68
  * @type {quadTree.Node}
69
69
  */
70
70
  protected _insideSegment: quadTree.Node;
71
- /**
72
- * Coordinates that depends on what segment class we are fling over.
73
- * It can be WGS84 or Mercator coordinates. Gets in og.quadTree.Node
74
- * @protected
75
- * @type {LonLat}
76
- */
77
- protected _insideSegmentPosition: LonLat;
78
71
  slope: number;
79
72
  _keyLock: Key;
80
73
  _framesArr: any[];
@@ -1,3 +1,3 @@
1
- import { Camera } from "./Camera.js";
2
- import { PlanetCamera } from "./PlanetCamera.js";
1
+ import { Camera } from './Camera.js';
2
+ import { PlanetCamera } from './PlanetCamera.js';
3
3
  export { Camera, PlanetCamera };
@@ -10,5 +10,5 @@ export class GeoImageDragControl extends Control {
10
10
  _onMouseLeave(): void;
11
11
  _onMouseMove(ms: any): void;
12
12
  }
13
- import { Control } from "./Control.js";
13
+ import { Control } from './Control.js';
14
14
  import { ToggleButton } from "../ui/ToggleButton.js";
@@ -70,4 +70,4 @@ export class LayerAnimation extends Control {
70
70
  _setCurrentIndexAsync(index: number, forceVisibility?: boolean, stopPropagation?: boolean): void;
71
71
  }
72
72
  import { Control } from "./Control.js";
73
- import { Events } from "../Events.js";
73
+ import { Events } from '../Events.js';
@@ -36,6 +36,6 @@ export class Lighting extends Control {
36
36
  }
37
37
  import { Control } from "./Control.js";
38
38
  import { ToggleButton } from "../ui/ToggleButton.js";
39
- import { Dialog } from "../ui/Dialog.js";
40
- import { View } from "../ui/View.js";
39
+ import { Dialog } from '../ui/Dialog.js';
40
+ import { View } from '../ui/View.js';
41
41
  import { Slider } from "../ui/Slider.js";
@@ -20,4 +20,4 @@ export class HeightRulerScene extends RulerScene {
20
20
  }
21
21
  import { RulerScene } from "../ruler/RulerScene.js";
22
22
  import { Vector } from "../../layer/Vector.js";
23
- import { Entity } from "../../entity/Entity.js";
23
+ import { Entity } from '../../entity/Entity.js';
@@ -1,6 +1,6 @@
1
1
  import { Control } from "./Control.js";
2
2
  import { CompassButton } from "./CompassButton.js";
3
- import { DebugInfo } from "./DebugInfo";
3
+ import { DebugInfo } from "./DebugInfo.js";
4
4
  import { EarthNavigation } from "./EarthNavigation.js";
5
5
  import { EarthCoordinates } from "./EarthCoordinates.js";
6
6
  import { GeoImageDragControl } from "./GeoImageDragControl.js";
@@ -21,4 +21,5 @@ import { HeightRuler } from "./heightRuler/HeightRuler.js";
21
21
  import { SimpleSkyBackground } from "./SimpleSkyBackground.js";
22
22
  import { Selection } from "./selection/Selection.js";
23
23
  import { LayerAnimation } from "./LayerAnimation.js";
24
- export { Control, CompassButton, DebugInfo, EarthNavigation, EarthCoordinates, GeoImageDragControl, KeyboardNavigation, LayerSwitcher, MouseNavigation, ToggleWireframe, TouchNavigation, SimpleNavigation, ShowFps, ScaleControl, Sun, ZoomControl, MouseWheelZoomControl, Lighting, Ruler, HeightRuler, SimpleSkyBackground, Selection, LayerAnimation };
24
+ import { TimelineControl } from "./timeline/TimelineControl.js";
25
+ export { Control, CompassButton, DebugInfo, EarthNavigation, EarthCoordinates, GeoImageDragControl, KeyboardNavigation, LayerSwitcher, MouseNavigation, ToggleWireframe, TouchNavigation, SimpleNavigation, ShowFps, ScaleControl, Sun, ZoomControl, MouseWheelZoomControl, Lighting, Ruler, HeightRuler, SimpleSkyBackground, Selection, LayerAnimation, TimelineControl };
@@ -37,6 +37,7 @@ export class RulerScene extends RenderNode {
37
37
  _onCornerEnter(e: any): void;
38
38
  _onCornerLeave(e: any): void;
39
39
  _onLdblclick(): void;
40
+ setVisibility(visibility: any): void;
40
41
  _onLclick(e: any): void;
41
42
  _timeout: any;
42
43
  _drawLine(startLonLat: any, endLonLat: any, startPos: any): void;
@@ -45,7 +46,7 @@ export class RulerScene extends RenderNode {
45
46
  isCornersPositionChanged(): boolean;
46
47
  get ellipsoid(): any;
47
48
  }
48
- import { RenderNode } from "../../scene/RenderNode.js";
49
- import { Vec2 } from "../../math/Vec2.js";
50
- import { Vector } from "../../layer/Vector.js";
51
- import { Entity } from "../../entity/Entity.js";
49
+ import { RenderNode } from '../../scene/RenderNode.js';
50
+ import { Vec2 } from '../../math/Vec2.js';
51
+ import { Vector } from '../../layer/Vector.js';
52
+ import { Entity } from '../../entity/Entity.js';
@@ -28,6 +28,6 @@ export class SelectionScene extends RenderNode {
28
28
  clear(): void;
29
29
  get ellipsoid(): any;
30
30
  }
31
- import { RenderNode } from "../../scene/RenderNode.js";
32
- import { Entity } from "../../entity/Entity.js";
33
- import { Vector } from "../../layer/Vector.js";
31
+ import { RenderNode } from '../../scene/RenderNode.js';
32
+ import { Entity } from '../../entity/Entity.js';
33
+ import { Vector } from '../../layer/Vector.js';
@@ -0,0 +1,10 @@
1
+ export class TimelineControl extends Control {
2
+ constructor(options?: {});
3
+ _timelineView: TimelineView;
4
+ _toggleBtn: ToggleButton;
5
+ _dialog: Dialog;
6
+ }
7
+ import { Control } from '../Control.js';
8
+ import { TimelineView } from './TimelineView.js';
9
+ import { ToggleButton } from "../../ui/ToggleButton.js";
10
+ import { Dialog } from "../../ui/Dialog.js";
@@ -0,0 +1,33 @@
1
+ export class TimelineModel {
2
+ constructor(options?: {});
3
+ _events: Events;
4
+ _current: any;
5
+ _rangeStart: any;
6
+ _rangeEnd: any;
7
+ _range: number;
8
+ _minDate: any;
9
+ _maxDate: any;
10
+ multiplier: any;
11
+ _requestAnimationFrameId: number;
12
+ _prevNow: number;
13
+ dt: number;
14
+ on(eventName: any, callback: any, sender: any): void;
15
+ off(eventName: any, callback: any): void;
16
+ play(): void;
17
+ stop(): void;
18
+ stopped(): boolean;
19
+ _animationFrameCallback(): void;
20
+ _frame(): void;
21
+ set current(arg: any);
22
+ get current(): any;
23
+ get range(): number;
24
+ set(rangeStart: any, rangeEnd: any): void;
25
+ set rangeStart(arg: any);
26
+ get rangeStart(): any;
27
+ set rangeEnd(arg: any);
28
+ get rangeEnd(): any;
29
+ get rangeStartTime(): any;
30
+ get rangeEndTime(): any;
31
+ get currentTime(): any;
32
+ }
33
+ import { Events } from '../../Events.js';
@@ -0,0 +1,57 @@
1
+ export class TimelineView extends View {
2
+ fillStyle: any;
3
+ _frameEl: any;
4
+ _currentEl: any;
5
+ _canvasEl: HTMLCanvasElement;
6
+ _ctx: CanvasRenderingContext2D;
7
+ _isMouseOver: boolean;
8
+ _isDragging: boolean;
9
+ _isCurrentDragging: boolean;
10
+ _isCurrentMouseOver: boolean;
11
+ _minWidth: number;
12
+ _canvasScale: number;
13
+ _millisecondsInPixel: number;
14
+ _clickPosX: number;
15
+ _clickRangeStart: Date;
16
+ _clickRangeEnd: Date;
17
+ _clickCurrentDate: Date;
18
+ _clickTime: number;
19
+ _clickDelay: number;
20
+ _onResizeObserver_: any;
21
+ _resizeObserver: ResizeObserver;
22
+ _pauseBtn: ToggleButton;
23
+ _playBtn: ToggleButton;
24
+ _buttons: ButtonGroup;
25
+ _visibility: any;
26
+ _onResizeObserver(): void;
27
+ set canvasScale(arg: number);
28
+ get canvasScale(): number;
29
+ resize(): void;
30
+ render(): TimelineView;
31
+ $controls: any;
32
+ setVisibility(visibility: any): void;
33
+ reset(): void;
34
+ play(): void;
35
+ pause(): void;
36
+ playBack(): void;
37
+ _onMouseWheel(e: any): void;
38
+ _onMouseWheelFF(e: any): void;
39
+ _zoom(pointerTime: any, pointerCenterOffsetX: any, dir: any): void;
40
+ _onMouseDown(e: any): void;
41
+ _onMouseUp(e: any): void;
42
+ _onMouseEnter(): void;
43
+ _onMouseOut(): void;
44
+ _onCurrentMouseEnter(): void;
45
+ _onCurrentMouseOut(): void;
46
+ _onMouseMove(e: any): void;
47
+ get clientWidth(): number;
48
+ get clientHeight(): number;
49
+ _resize(): void;
50
+ getOffsetbyTime(milliseconds: any): number;
51
+ _clearCanvas(): void;
52
+ _drawCurrent(): void;
53
+ draw(): void;
54
+ }
55
+ import { View } from '../../ui/View.js';
56
+ import { ToggleButton } from "../../ui/ToggleButton.js";
57
+ import { ButtonGroup } from "../../ui/ButtonGroup.js";
@@ -0,0 +1,9 @@
1
+ export function addSeconds(date: any, seconds: any): Date;
2
+ export function dateToStr(date: any, showTime?: boolean, showMilliseconds?: boolean): string;
3
+ export function createCanvasHTML(): HTMLCanvasElement;
4
+ export function getNearestTimeLeft(t: any, div: any): number;
5
+ export function drawNotch(ctx: any, xOffset?: number, size?: number, thickness?: number, color?: string): void;
6
+ export function drawText(ctx: any, text: any, x: any, y: any, font: string, fillStyle: string, align: string, baseLine: string, rotDeg: any): void;
7
+ export function getScale(seconds: any): number[];
8
+ export const SCALES: number[][];
9
+ export const MONTHS: string[];
@@ -5,6 +5,13 @@
5
5
  * @param {number} polarSize - Polar ellipsoid size.
6
6
  */
7
7
  export class Ellipsoid {
8
+ /**
9
+ * Returns angle between to bearin angles
10
+ * @param {number} a - First bearing angle
11
+ * @param {number} b - Second bearing angle
12
+ * @returns {number}
13
+ */
14
+ static getAngleBetweenTwoBearings(a: number, b: number): number;
8
15
  static getRelativeBearing(a: any, b: any): number;
9
16
  /**
10
17
  * Returns the midpoint between two points on the great circle.
@@ -88,22 +95,22 @@ export class Ellipsoid {
88
95
  */
89
96
  public getPolarSize(): number;
90
97
  /**
91
- * Gets cartesian ECEF from Wgs84 geodetic coordiantes.
98
+ * Gets cartesian ECEF from Wgs84 geodetic coordinates.
92
99
  * @public
93
- * @param {LonLat} lonlat - Degrees geodetic coordiantes.
100
+ * @param {LonLat} lonlat - Degrees geodetic coordinates.
94
101
  * @returns {Vec3} -
95
102
  */
96
103
  public lonLatToCartesian(lonlat: LonLat): Vec3;
97
104
  /**
98
- * Gets cartesian ECEF from Wgs84 geodetic coordiantes.
105
+ * Gets cartesian ECEF from Wgs84 geodetic coordinates.
99
106
  * @public
100
- * @param {LonLat} lonlat - Degrees geodetic coordiantes.
107
+ * @param {LonLat} lonlat - Degrees geodetic coordinates.
101
108
  * @param {Vec3} res - Output result.
102
109
  * @returns {Vec3} -
103
110
  */
104
111
  public lonLatToCartesianRes(lonlat: LonLat, res: Vec3): Vec3;
105
112
  /**
106
- * Gets cartesian ECEF from Wgs84 geodetic coordiantes.
113
+ * Gets cartesian ECEF from Wgs84 geodetic coordinates.
107
114
  * @public
108
115
  * @param {Number} lon - Longitude.
109
116
  * @param {Number} lat - Latitude.
@@ -112,7 +119,7 @@ export class Ellipsoid {
112
119
  */
113
120
  public geodeticToCartesian(lon: number, lat: number, height?: number): Vec3;
114
121
  /**
115
- * Gets Wgs84 geodetic coordiantes from cartesian ECEF.
122
+ * Gets Wgs84 geodetic coordinates from cartesian ECEF.
116
123
  * @public
117
124
  * @param {Vec3} p - Cartesian coordinates.
118
125
  * @returns {LonLat} -
@@ -120,13 +127,13 @@ export class Ellipsoid {
120
127
  public projToSurface(p: Vec3): LonLat;
121
128
  /**
122
129
  * Converts 3d cartesian coordinates to geodetic
123
- * @param {Vec3} cart - Cartesian coordiantes
130
+ * @param {Vec3} cart - Cartesian coordinates
124
131
  * @returns {LonLat} - Geodetic coordinates
125
132
  */
126
133
  cartesianToLonLat(cart: Vec3): LonLat;
127
134
  /**
128
135
  * Converts 3d cartesian coordinates to geodetic
129
- * @param {Vec3} cart - Cartesian coordiantes
136
+ * @param {Vec3} cart - Cartesian coordinates
130
137
  * @param {LonLat} res - Link geodetic coordinates variable
131
138
  * @returns {LonLat} - Geodetic coordinates
132
139
  */
@@ -134,7 +141,7 @@ export class Ellipsoid {
134
141
  /**
135
142
  * Gets ellipsoid surface normal.
136
143
  * @public
137
- * @param {Vec3} coord - Spatial coordiantes.
144
+ * @param {Vec3} coord - Spatial coordinates.
138
145
  * @return {Vec3} -
139
146
  */
140
147
  public getSurfaceNormal3v(coord: Vec3): Vec3;