@openglobus/og 0.13.8 → 0.13.10

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 (85) hide show
  1. package/README.md +1 -1
  2. package/css/og.css +388 -129
  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 +20 -19
  9. package/src/og/Globe.js +15 -16
  10. package/src/og/Object3d.js +33 -0
  11. package/src/og/control/GeoImageDragControl.js +102 -75
  12. package/src/og/control/LayerAnimation.js +306 -38
  13. package/src/og/control/LayerSwitcher.js +506 -159
  14. package/src/og/control/Lighting.js +27 -27
  15. package/src/og/control/RulerSwitcher.js +69 -0
  16. package/src/og/control/UIhelpers.js +146 -0
  17. package/src/og/control/index.js +3 -1
  18. package/src/og/control/ruler/RulerScene.js +6 -2
  19. package/src/og/control/visibleExtent/Segment.js +2 -1
  20. package/src/og/ellipsoid/wgs84.js +1 -1
  21. package/src/og/entity/LabelHandler.js +5 -2
  22. package/src/og/entity/LabelWorker.js +38 -53
  23. package/src/og/layer/BaseGeoImage.js +347 -312
  24. package/src/og/layer/CanvasTiles.js +312 -290
  25. package/src/og/layer/GeoImage.js +222 -214
  26. package/src/og/layer/GeoVideo.js +291 -291
  27. package/src/og/layer/Layer.js +71 -30
  28. package/src/og/layer/Material.js +109 -109
  29. package/src/og/layer/Vector.js +1 -0
  30. package/src/og/layer/XYZ.js +20 -12
  31. package/src/og/light/LightSource.js +364 -363
  32. package/src/og/math.js +2 -2
  33. package/src/og/quadTree/Node.js +7 -5
  34. package/src/og/renderer/Renderer.js +1 -1
  35. package/src/og/scene/Planet.js +103 -42
  36. package/src/og/segment/Segment.js +34 -56
  37. package/src/og/segment/Slice.js +1 -1
  38. package/src/og/shaders/drawnode.js +1 -1
  39. package/src/og/terrain/GlobusTerrain.js +31 -20
  40. package/src/og/terrain/MapboxTerrain.js +1 -1
  41. package/src/og/utils/BaseWorker.js +46 -0
  42. package/src/og/utils/GeoImageCreator.js +164 -161
  43. package/src/og/utils/Loader.js +60 -33
  44. package/src/og/utils/NormalMapCreator.js +403 -412
  45. package/src/og/utils/PlainSegmentWorker.js +29 -55
  46. package/src/og/utils/TerrainWorker.js +572 -589
  47. package/src/og/utils/functionComposition.js +13 -0
  48. package/src/og/webgl/Handler.js +42 -41
  49. package/types/Object3d.d.ts +1 -0
  50. package/types/camera/PlanetCamera.d.ts +4 -0
  51. package/types/control/GeoImageDragControl.d.ts +2 -0
  52. package/types/control/LayerAnimation.d.ts +73 -0
  53. package/types/control/LayerSwitcher.d.ts +55 -11
  54. package/types/control/MouseNavigation.d.ts +1 -0
  55. package/types/control/MouseWheelZoomControl.d.ts +1 -0
  56. package/types/control/Sun.d.ts +1 -0
  57. package/types/control/TouchNavigation.d.ts +1 -0
  58. package/types/control/UIhelpers.d.ts +13 -0
  59. package/types/control/index.d.ts +2 -1
  60. package/types/entity/LabelHandler.d.ts +2 -0
  61. package/types/entity/LabelWorker.d.ts +5 -7
  62. package/types/layer/BaseGeoImage.d.ts +9 -1
  63. package/types/layer/CanvasTiles.d.ts +5 -1
  64. package/types/layer/GeoImage.d.ts +1 -0
  65. package/types/layer/GeoTexture2d.d.ts +1 -0
  66. package/types/layer/Layer.d.ts +5 -1
  67. package/types/layer/Vector.d.ts +7 -0
  68. package/types/layer/WMS.d.ts +1 -0
  69. package/types/layer/XYZ.d.ts +8 -6
  70. package/types/math.d.ts +1 -1
  71. package/types/quadTree/EntityCollectionNode.d.ts +7 -0
  72. package/types/quadTree/Node.d.ts +1 -2
  73. package/types/renderer/Renderer.d.ts +1 -1
  74. package/types/renderer/RendererEvents.d.ts +16 -0
  75. package/types/scene/Planet.d.ts +19 -4
  76. package/types/segment/SegmentLonLat.d.ts +2 -0
  77. package/types/terrain/BilTerrain.d.ts +6 -0
  78. package/types/terrain/GlobusTerrain.d.ts +7 -0
  79. package/types/terrain/MapboxTerrain.d.ts +8 -0
  80. package/types/utils/BaseWorker.d.ts +14 -0
  81. package/types/utils/Loader.d.ts +3 -1
  82. package/types/utils/PlainSegmentWorker.d.ts +4 -6
  83. package/types/utils/TerrainWorker.d.ts +4 -6
  84. package/types/utils/functionComposition.d.ts +5 -0
  85. package/types/webgl/Handler.d.ts +4 -1
@@ -0,0 +1,13 @@
1
+ 'use strict'
2
+
3
+ // Used to compose other functions,
4
+ // in a specific order to return to desired output.
5
+
6
+ const compose = x => ({
7
+ run: f => compose(f(x)), // runs the function
8
+ runForEach: f => compose(x.map(el => f(el))), // runs the function for an array
9
+ end: () => x, // result
10
+ })
11
+
12
+ export {compose}
13
+
@@ -11,6 +11,7 @@ import { isEmpty } from "../utils/shared.js";
11
11
  import { ProgramController } from "./ProgramController.js";
12
12
  import { Stack } from "../Stack.js";
13
13
  import { Vec2 } from "../math/Vec2.js";
14
+ import { Events } from "../Events.js";
14
15
 
15
16
  const vendorPrefixes = ["", "WEBKIT_", "MOZ_"];
16
17
 
@@ -31,9 +32,9 @@ const MAX_LEVELS = 2;
31
32
  * @param {Array.<string>} [params.extensions] - Additional WebGL extension list. Available by default: EXT_texture_filter_anisotropic.
32
33
  */
33
34
  class Handler {
34
- constructor(id, params) {
35
- params = params || {};
35
+ constructor(id, params = {}) {
36
36
 
37
+ this.events = new Events(["visibilitychange", "resize"]);
37
38
  /**
38
39
  * Application default timer.
39
40
  * @public
@@ -137,6 +138,8 @@ class Handler {
137
138
 
138
139
  this.createTextureDefault = null;
139
140
 
141
+ this.ONCANVASRESIZE = null;
142
+
140
143
  if (params.autoActivate || isEmpty(params.autoActivate)) {
141
144
  this.initialize();
142
145
  }
@@ -174,7 +177,6 @@ class Handler {
174
177
  for (let i = 0; i < CONTEXT_TYPE.length; i++) {
175
178
  ctx = canvas.getContext(CONTEXT_TYPE[i], contextAttributes);
176
179
  if (ctx) {
177
- console.log(CONTEXT_TYPE[i]);
178
180
  ctx.type = CONTEXT_TYPE[i];
179
181
  break;
180
182
  }
@@ -223,25 +225,14 @@ class Handler {
223
225
  let gl = this.gl;
224
226
  let texture = gl.createTexture();
225
227
  gl.bindTexture(gl.TEXTURE_2D, texture);
226
- gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
227
-
228
- gl.texImage2D(
229
- gl.TEXTURE_2D,
230
- level,
231
- gl[internalFormat.toUpperCase()],
232
- width,
233
- height,
234
- 0,
235
- gl[format.toUpperCase()],
236
- gl[type.toUpperCase()],
237
- null
228
+ //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
229
+ gl.texImage2D(gl.TEXTURE_2D, level, gl[internalFormat.toUpperCase()], width, height, 0,
230
+ gl[format.toUpperCase()], gl[type.toUpperCase()], null
238
231
  );
239
-
240
232
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl[filter.toUpperCase()]);
241
233
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl[filter.toUpperCase()]);
242
234
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
243
235
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
244
-
245
236
  gl.bindTexture(gl.TEXTURE_2D, null);
246
237
  return texture;
247
238
  }
@@ -257,7 +248,7 @@ class Handler {
257
248
  let gl = this.gl;
258
249
  let texture = gl.createTexture();
259
250
  gl.bindTexture(gl.TEXTURE_2D, texture);
260
- gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
251
+ //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
261
252
  gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat || gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
262
253
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
263
254
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
@@ -278,7 +269,7 @@ class Handler {
278
269
  let gl = this.gl;
279
270
  let texture = gl.createTexture();
280
271
  gl.bindTexture(gl.TEXTURE_2D, texture);
281
- gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
272
+ //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
282
273
  gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat || gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
283
274
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
284
275
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
@@ -298,7 +289,7 @@ class Handler {
298
289
  var gl = this.gl;
299
290
  var texture = gl.createTexture();
300
291
  gl.bindTexture(gl.TEXTURE_2D, texture);
301
- gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
292
+ //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
302
293
  gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat || gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
303
294
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
304
295
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
@@ -339,10 +330,8 @@ class Handler {
339
330
  let gl = this.gl;
340
331
  let texture = gl.createTexture();
341
332
  gl.bindTexture(gl.TEXTURE_2D, texture);
342
- gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
343
-
333
+ //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
344
334
  gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat || gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
345
-
346
335
  gl.generateMipmap(gl.TEXTURE_2D);
347
336
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);
348
337
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
@@ -361,10 +350,8 @@ class Handler {
361
350
  let gl = this.gl;
362
351
  let texture = gl.createTexture();
363
352
  gl.bindTexture(gl.TEXTURE_2D, texture);
364
- gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
365
-
353
+ //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
366
354
  gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat || gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
367
-
368
355
  gl.generateMipmap(gl.TEXTURE_2D);
369
356
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);
370
357
  gl.texParameterf(gl.TEXTURE_2D, this.extensions.EXT_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT, this._params.anisotropy);
@@ -384,11 +371,10 @@ class Handler {
384
371
  var gl = this.gl;
385
372
  var texture = gl.createTexture();
386
373
  gl.bindTexture(gl.TEXTURE_2D, texture);
387
- gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
388
-
374
+ //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
375
+ //gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
389
376
  gl.texStorage2D(gl.TEXTURE_2D, 1, internalFormat || gl.RGBA8, image.width, image.height);
390
377
  gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, image.width, image.height, gl.RGBA, gl.UNSIGNED_BYTE, image);
391
-
392
378
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
393
379
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
394
380
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
@@ -407,10 +393,10 @@ class Handler {
407
393
  let gl = this.gl;
408
394
  let texture = gl.createTexture();
409
395
  gl.bindTexture(gl.TEXTURE_2D, texture);
410
-
396
+ //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
397
+ //gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
411
398
  gl.texStorage2D(gl.TEXTURE_2D, 1, internalFormat || gl.RGBA8, image.width, image.height);
412
399
  gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, image.width, image.height, gl.RGBA, gl.UNSIGNED_BYTE, image);
413
-
414
400
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
415
401
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
416
402
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
@@ -429,11 +415,10 @@ class Handler {
429
415
  let gl = this.gl;
430
416
  let texture = gl.createTexture();
431
417
  gl.bindTexture(gl.TEXTURE_2D, texture);
432
- gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
433
-
418
+ //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
419
+ //gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
434
420
  gl.texStorage2D(gl.TEXTURE_2D, MAX_LEVELS, internalFormat || gl.RGBA8, image.width, image.height);
435
421
  gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, image.width, image.height, gl.RGBA, gl.UNSIGNED_BYTE, image);
436
-
437
422
  gl.generateMipmap(gl.TEXTURE_2D);
438
423
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);
439
424
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
@@ -452,11 +437,10 @@ class Handler {
452
437
  let gl = this.gl;
453
438
  let texture = gl.createTexture();
454
439
  gl.bindTexture(gl.TEXTURE_2D, texture);
455
- gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
456
-
440
+ //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
441
+ //gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
457
442
  gl.texStorage2D(gl.TEXTURE_2D, MAX_LEVELS, internalFormat || gl.RGBA8, image.width, image.height);
458
443
  gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, image.width, image.height, gl.RGBA, gl.UNSIGNED_BYTE, image);
459
-
460
444
  gl.generateMipmap(gl.TEXTURE_2D);
461
445
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);
462
446
  gl.texParameterf(gl.TEXTURE_2D, this.extensions.EXT_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT, this._params.anisotropy);
@@ -503,7 +487,7 @@ class Handler {
503
487
  for (let i = 0; i < faces.length; i++) {
504
488
  let face = faces[i][1];
505
489
  gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture);
506
- gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
490
+ //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
507
491
  gl.texImage2D(face, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, emptyImage);
508
492
  }
509
493
 
@@ -514,7 +498,7 @@ class Handler {
514
498
  image.onload = (function (texture, face, image) {
515
499
  return function () {
516
500
  gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture);
517
- gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
501
+ //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
518
502
  gl.texImage2D(face, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
519
503
  };
520
504
  })(texture, face, image);
@@ -677,6 +661,17 @@ class Handler {
677
661
  /** Initilalize shaders and rendering parameters*/
678
662
  this._initPrograms();
679
663
  this._setDefaults();
664
+
665
+ document.addEventListener("visibilitychange", () => {
666
+ if (document.visibilityState === 'visible') {
667
+ this.start();
668
+ this.ONCANVASRESIZE && this.ONCANVASRESIZE();
669
+ this.events.dispatch(this.events.visibilitychange, true);
670
+ } else {
671
+ this.events.dispatch(this.events.visibilitychange, false);
672
+ this.stop();
673
+ }
674
+ });
680
675
  }
681
676
 
682
677
  /**
@@ -812,7 +807,8 @@ class Handler {
812
807
  this._oneByHeight = 1.0 / this.canvas.height;
813
808
 
814
809
  this.gl && this.gl.viewport(0, 0, w, h);
815
- this.onCanvasResize && this.onCanvasResize(this.canvas);
810
+ this.ONCANVASRESIZE && this.ONCANVASRESIZE(this.canvas);
811
+ this.events.dispatch(this.events.resize, this);
816
812
  }
817
813
 
818
814
  get pixelRatio() {
@@ -882,7 +878,12 @@ class Handler {
882
878
  let canvas = this.canvas;
883
879
 
884
880
  if (Math.floor(canvas.clientWidth * this._params.pixelRatio) !== canvas.width || Math.floor(canvas.clientHeight * this._params.pixelRatio) !== canvas.height) {
885
- this.setSize(canvas.clientWidth, canvas.clientHeight);
881
+ if (canvas.clientWidth === 0 || canvas.clientHeight === 0) {
882
+ this.stop();
883
+ } else if (!document.hidden) {
884
+ this.start();
885
+ this.setSize(canvas.clientWidth, canvas.clientHeight);
886
+ }
886
887
  }
887
888
 
888
889
  /** Draw frame */
@@ -7,6 +7,7 @@ export class Object3d {
7
7
  static createDisc(radius: number, height: number, radialSegments: number, isTop: boolean, startIndex: number, offsetX: number, offsetY: any, offsetZ?: number): Object3d;
8
8
  static createCylinder(radiusTop?: number, radiusBottom?: number, height?: number, radialSegments?: number, heightSegments?: number, isTop?: boolean, isBottom?: boolean, offsetX?: number, offsetY?: number, offsetZ?: number): Object3d;
9
9
  static createCube(length?: number, height?: number, depth?: number, xOffset?: number, yOffset?: number, zOffset?: number): Object3d;
10
+ static createArrow(back?: number, height?: number, front?: number): Object3d;
10
11
  constructor(data: any);
11
12
  _name: any;
12
13
  _vertices: any;
@@ -203,6 +203,10 @@ export class PlanetCamera extends Camera {
203
203
  * @param {number} angle - Rotation angle.
204
204
  */
205
205
  public rotateDown(angle: number): void;
206
+ rotateVertical(angle: any, center: any, minSlope?: number): void;
207
+ _u: any;
208
+ _r: any;
209
+ _b: any;
206
210
  /**
207
211
  * Prepare camera to the frame. Used in render node frame function.
208
212
  * @public
@@ -1,6 +1,8 @@
1
1
  export class GeoImageDragControl extends Control {
2
+ constructor(options?: {});
2
3
  _cornerIndex: number;
3
4
  _catchCorner: boolean;
5
+ createDraggerButton(): void;
4
6
  _bindLayer(layer: any): void;
5
7
  }
6
8
  import { Control } from "./Control.js";
@@ -0,0 +1,73 @@
1
+ export function layerAnimation(options: any): any;
2
+ /**
3
+ *
4
+ * @class
5
+ * @extends {Control}
6
+ * @param {Object} [options] - Control options.
7
+ */
8
+ export class LayerAnimation extends Control {
9
+ constructor(options?: {});
10
+ events: Events;
11
+ _layersArr: any[];
12
+ _currentIndex: number;
13
+ _playInterval: any;
14
+ _playIntervalHandler: number;
15
+ _playIndex: number;
16
+ _frameSize: any;
17
+ repeat: any;
18
+ skipTimeout: any;
19
+ _timeoutStart: number;
20
+ _onViewchange(): void;
21
+ _getFramesNum(): number;
22
+ _setFrame(frameIndex: any): void;
23
+ _getFrameIndex(layerIndex: any): number;
24
+ _appendFrameToPlanet(frameIndex: any): void;
25
+ _removeFrameFromPlanet(frameIndex: any): void;
26
+ _onLayerLoadend_: any;
27
+ _onViewchange_: any;
28
+ _onVisibityChange_: any;
29
+ _onVisibityChange(isVisible: any): void;
30
+ clear(): void;
31
+ _currVisibleIndex: number;
32
+ _initLayers(): void;
33
+ setLayers(layers: any): void;
34
+ appendLayer(layer: any): void;
35
+ /**
36
+ * warning: Use XYZ.isIdle in requesAnimationFrame(after setVisibility)
37
+ * @returns {boolean} Returns truw if current layer is idle
38
+ */
39
+ get isIdle(): boolean;
40
+ set playInterval(arg: any);
41
+ get playInterval(): any;
42
+ get isPlaying(): boolean;
43
+ get layers(): any[];
44
+ _checkEnd(): void;
45
+ play(): void;
46
+ stop(): void;
47
+ pause(): void;
48
+ _clearInterval(): void;
49
+ /**
50
+ * Waiting for the current index layer loadend and make it non transparent,
51
+ * and make prev layer transparent, also check previous frame index to cleanup.
52
+ * @param {Layer} layer
53
+ * @private
54
+ */
55
+ private _onLayerLoadend;
56
+ /**
57
+ * Function sets layer index visible.
58
+ * @param {number} index
59
+ * @param {boolean} [stopPropagation]
60
+ */
61
+ setCurrentIndex(index: number, stopPropagation?: boolean): void;
62
+ /**
63
+ * Function sets layer index visible. If the layer is idle (all visible tiles loaded), sets opacity to one,
64
+ * otherwise to ZERO it means that when all visible tiles will be loaded the opacity becomes ONE. So, previous
65
+ * layer remains non transparent (opacity = 1) till current layer is loading.
66
+ * @param {number} index
67
+ * @param {boolean} [forceVisibility]
68
+ * @param {boolean} [stopPropagation]
69
+ */
70
+ _setCurrentIndexAsync(index: number, forceVisibility?: boolean, stopPropagation?: boolean): void;
71
+ }
72
+ import { Control } from "./Control.js";
73
+ import { Events } from "../Events.js";
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Simple(OpenLayers like)layer switcher, includes base layers, overlays, geo images etc. groups.
2
+ * Advanced :) layer switcher, includes base layers, overlays, geo images etc. groups.
3
+ * Double click for zoom, drag-and-drop to change zIndex
3
4
  * @class
4
5
  * @extends {Control}
5
6
  * @param {Object} [options] - Control options.
@@ -7,15 +8,58 @@
7
8
  export class LayerSwitcher extends Control {
8
9
  static set numSwitches(arg: any);
9
10
  static get numSwitches(): any;
10
- dialog: HTMLDivElement;
11
- baseLayersDiv: HTMLDivElement;
12
- overlaysDiv: HTMLDivElement;
13
- onLayerAdded(layer: any): void;
14
- onLayerRemoved(layer: any): void;
15
- addSwitcher(type: any, obj: any, container: any, id?: string): void;
16
- createBaseLayersContainer(): void;
17
- createOverlaysContainer(): void;
18
- createDialog(): void;
19
- createSwitcher(): void;
11
+ constructor(options?: {});
12
+ switcherDependent: any;
13
+ expandedSections: any;
14
+ switcherInMenu: any;
15
+ docListener: any;
16
+ setupSwitcher(): void;
17
+ planetDataBasic(): {
18
+ collectTerrains: (planet: any) => any[];
19
+ collectLayers: (planet: any) => any;
20
+ pickBaseLayers: (layers: any) => any;
21
+ pickOverlays: (layers: any) => any;
22
+ classifyObject: (object: any) => "Terrain Providers" | "Overlays" | "BaseLayers";
23
+ sortByZIndex: (layers: any) => any;
24
+ serializeZIndices: (layers: any) => any;
25
+ normalizeOverlay: (overlay: any) => any;
26
+ };
27
+ planetDataReturn(planet: any): {
28
+ terrains: any[];
29
+ baseLayers: any;
30
+ overlays: any;
31
+ };
32
+ dialogSectionStructure(name: any, input: any, data: any): {
33
+ name: any;
34
+ input: any;
35
+ data: any;
36
+ };
37
+ recordsStructure(terrains: any, baseLayers: any, overlays: any): {
38
+ data: {
39
+ name: any;
40
+ input: any;
41
+ data: any;
42
+ }[];
43
+ };
44
+ getRecords(planet: any): {
45
+ data: {
46
+ name: any;
47
+ input: any;
48
+ data: any;
49
+ }[];
50
+ };
51
+ addNewLayer(layer: any): void;
52
+ removeLayer(layer: any): void;
53
+ getUserPrefs(): {
54
+ switcherDependency: any;
55
+ sectionsOpening: any;
56
+ btnInMenu: any;
57
+ };
58
+ buildBasicDOM(): {
59
+ $mainContainer: any;
60
+ whereClickHandler: (e: any) => void;
61
+ };
62
+ buildRecords(myData: any, $mainContainer: any, depth: any, createLastDropZone: any): void;
63
+ removeRecords(): void;
20
64
  }
21
65
  import { Control } from "./Control.js";
@@ -6,6 +6,7 @@
6
6
  */
7
7
  export class MouseNavigation extends Control {
8
8
  static getMovePointsFromPixelTerrain(cam: any, planet: any, stepsCount: any, delta: any, point: any, forward: any, dir: any): {}[];
9
+ _name: string;
9
10
  grabbedPoint: Vec3;
10
11
  _eye0: Vec3;
11
12
  pointOnEarth: Vec3;
@@ -6,6 +6,7 @@ export function mouseWheelZoomControl(options: any): MouseWheelZoomControl;
6
6
  * @params {Object} [options] - Control options.
7
7
  */
8
8
  export class MouseWheelZoomControl extends Control {
9
+ _name: string;
9
10
  grabbedPoint: Vec3;
10
11
  _eye0: Vec3;
11
12
  pointOnEarth: Vec3;
@@ -6,6 +6,7 @@ export function sun(options: any): Sun;
6
6
  * @param {Object} [options] - Control options.
7
7
  */
8
8
  export class Sun extends Control {
9
+ _name: string;
9
10
  /**
10
11
  * Earth planet node.
11
12
  * @public
@@ -5,6 +5,7 @@
5
5
  * @param {Object} [options] - Control options.
6
6
  */
7
7
  export class TouchNavigation extends Control {
8
+ _name: string;
8
9
  grabbedPoint: Vec3;
9
10
  inertia: number;
10
11
  grabbedSpheroid: Sphere;
@@ -0,0 +1,13 @@
1
+ export function elementFactory(type: any, attributes: any, ...children: any[]): any;
2
+ export function appendChildren(parent: any, childrenArray: any): void;
3
+ export function toggleText(elementText: any, textArray: any): any;
4
+ export function enableElmovement(el: any, planet: any): {
5
+ behaviour: (e: any) => void;
6
+ mouseMove: (e: any) => void;
7
+ };
8
+ export function getAllnodes(CSSclass: any): NodeListOf<any>;
9
+ export function nodesToArray(nodeList: any): any[];
10
+ export function setAllCSSclass(CSSclass: any, nodeArray: any): any;
11
+ export function allMenuBtnOFF(): void;
12
+ export function allDialogsHide(): void;
13
+ export function btnClickHandler(btn_id: any, dialog_id: any, dialog_selector: any, btn_icon_id: any): void;
@@ -16,4 +16,5 @@ import { ZoomControl } from "./ZoomControl.js";
16
16
  import { MouseWheelZoomControl } from "./MouseWheelZoomControl.js";
17
17
  import { Lighting } from "./Lighting.js";
18
18
  import { Ruler } from "./ruler/Ruler.js";
19
- export { Control, CompassButton, DebugInfo, EarthNavigation, EarthCoordinates, GeoImageDragControl, KeyboardNavigation, LayerSwitcher, MouseNavigation, ToggleWireframe, TouchNavigation, SimpleNavigation, ShowFps, Sun, ZoomControl, MouseWheelZoomControl, Lighting, Ruler };
19
+ import { LayerAnimation } from "./LayerAnimation.js";
20
+ export { Control, CompassButton, DebugInfo, EarthNavigation, EarthCoordinates, GeoImageDragControl, KeyboardNavigation, LayerSwitcher, MouseNavigation, ToggleWireframe, TouchNavigation, SimpleNavigation, ShowFps, Sun, ZoomControl, MouseWheelZoomControl, Lighting, Ruler, LayerAnimation };
@@ -18,6 +18,7 @@ export class LabelHandler extends BillboardHandler {
18
18
  assignFontAtlas(label: any): void;
19
19
  workerCallback(data: any, label: any): void;
20
20
  setText(index: any, text: any, fontIndex: any, align: any, isRTL?: boolean): void;
21
+ setSizeArr(index: any, size: any): void;
21
22
  setOutlineColorArr(index: any, rgba: any): void;
22
23
  setOutlineArr(index: any, outline: any): void;
23
24
  setFontIndexArr(index: any, fontIndex: any): void;
@@ -25,5 +26,6 @@ export class LabelHandler extends BillboardHandler {
25
26
  createOutlineBuffer(): void;
26
27
  createOutlineColorBuffer(): void;
27
28
  setMaxLetters(c: any): void;
29
+ refreshTexCoordsArr(): any;
28
30
  }
29
31
  import { BillboardHandler } from "./BillboardHandler.js";
@@ -1,11 +1,9 @@
1
1
  export const LOCK_UPDATE: -2;
2
2
  export const LOCK_FREE: -1;
3
- export class LabelWorker {
3
+ export class LabelWorker extends BaseWorker {
4
4
  constructor(numWorkers?: number);
5
- _id: number;
6
- _source: {};
7
- _freeWorkerQueue: Worker[];
8
- _pendingQueue: any[];
9
- check(): void;
10
- make(handler: any, label: any): void;
5
+ _source: Map<any, any>;
6
+ _onMessage(e: any): void;
7
+ make(...args: any[]): void;
11
8
  }
9
+ import { BaseWorker } from "../utils/BaseWorker.js";
@@ -22,7 +22,15 @@ export class BaseGeoImage extends Layer {
22
22
  _isRendering: boolean;
23
23
  _extentWgs84: Extent;
24
24
  _cornersWgs84: number[] | LonLat[];
25
+ _isFullExtent: any;
26
+ /**
27
+ * rendering function pointer
28
+ */
25
29
  rendering: any;
30
+ get isIdle(): boolean;
31
+ addTo(planet: any): BaseGeoImage;
32
+ _onLoadend_: any;
33
+ _onLoadend(): void;
26
34
  /**
27
35
  * Gets corners coordinates.
28
36
  * @public
@@ -72,7 +80,7 @@ export class BaseGeoImage extends Layer {
72
80
  /**
73
81
  * @virtual
74
82
  * @protected
75
- * @param {Material} material - GeoImage material.
83
+ * @param {Material} material - GeoImage segment material.
76
84
  * @returns {Array<number> } -
77
85
  */
78
86
  protected applyMaterial(material: Material): Array<number>;
@@ -16,7 +16,7 @@
16
16
  * @fires og.layer.CanvasTiles#loadend
17
17
  */
18
18
  export class CanvasTiles extends Layer {
19
- constructor(name: any, options: any);
19
+ minNativeZoom: any;
20
20
  /**
21
21
  * Current creating tiles couter.
22
22
  * @protected
@@ -35,6 +35,10 @@ export class CanvasTiles extends Layer {
35
35
  * @public
36
36
  */
37
37
  public drawTile: layer.CanvasTiles;
38
+ addTo(planet: any): CanvasTiles;
39
+ _onLoadend_: any;
40
+ _onLoadend(): void;
41
+ get isIdle(): boolean;
38
42
  /**
39
43
  * Abort loading tiles.
40
44
  * @public
@@ -16,6 +16,7 @@ export class GeoImage extends BaseGeoImage {
16
16
  * @type {String}
17
17
  */
18
18
  private _src;
19
+ abortLoading(): void;
19
20
  /**
20
21
  * Sets image source url path.
21
22
  * @public
@@ -2,6 +2,7 @@ export class GeoTexture2d extends BaseGeoImage {
2
2
  loadMaterial(material: any): void;
3
3
  bindTexture(texture: any): void;
4
4
  setSize(width: any, height: any): void;
5
+ abortMaterialLoading(material: any): void;
5
6
  _renderingProjType1(): void;
6
7
  _renderingProjType0(): void;
7
8
  }
@@ -1,4 +1,3 @@
1
- export const FADING_FACTOR: 0.29;
2
1
  /**
3
2
  * @classdesc
4
3
  * Base class; normally only used for creating subclasses and not instantiated in apps.
@@ -12,6 +11,7 @@ export const FADING_FACTOR: 0.29;
12
11
  * @param {string} [options.attribution] - Layer attribution that displayed in the attribution area on the screen.
13
12
  * @param {boolean} [options.isBaseLayer=false] - This is a base layer.
14
13
  * @param {boolean} [options.visibility=true] - Layer visibility.
14
+ * @param {boolean} [options.displayInLayerSwitcher=true] - Presence of layer in dialog window of LayerSwitcher control.
15
15
  * @param {boolean} [options.isSRGB=false] - Layer image webgl nternal format.
16
16
  * @param {Extent} [options.extent=[[-180.0, -90.0], [180.0, 90.0]]] - Visible extent.
17
17
  * @param {string} [options.textureFilter="anisotropic"] - Image texture filter. Available values: "nearest", "linear", "mipmap" and "anisotropic".
@@ -59,6 +59,7 @@ export class Layer {
59
59
  * @type {string}
60
60
  */
61
61
  public name: string;
62
+ properties: any;
62
63
  _labelMaxLetters: any;
63
64
  displayInLayerSwitcher: any;
64
65
  _hasImageryTiles: boolean;
@@ -190,6 +191,7 @@ export class Layer {
190
191
  * @param {Planet} planet - Planet render node.
191
192
  */
192
193
  protected _assignPlanet(planet: Planet): void;
194
+ get isIdle(): any;
193
195
  /**
194
196
  * Assign picking color to the layer.
195
197
  * @protected
@@ -298,8 +300,10 @@ export class Layer {
298
300
  * @protected
299
301
  */
300
302
  protected _correctFullExtent(): void;
303
+ get screenOpacity(): number;
301
304
  _refreshFadingOpacity(): boolean;
302
305
  createMaterial(segment: any): Material;
306
+ redraw(): void;
303
307
  }
304
308
  import { Extent } from "../Extent.js";
305
309
  import { Vec3 } from "../math/Vec3.js";
@@ -93,6 +93,13 @@ export class Vector extends Layer {
93
93
  * @type {Number}
94
94
  */
95
95
  public polygonOffsetUnits: number;
96
+ /**
97
+ * Adds layer to the planet.
98
+ * @public
99
+ * @param {Planet} planet - Planet scene object.
100
+ * @returns {layer.Vector} -
101
+ */
102
+ public addTo(planet: Planet): layer.Vector;
96
103
  /**
97
104
  * Returns stored entities.
98
105
  * @public
@@ -55,6 +55,7 @@ export class WMS extends XYZ {
55
55
  */
56
56
  public imageHeight: number;
57
57
  _getBbox: typeof WMS.get_bbox_v1_1_1;
58
+ _createUrl(segment: any): string;
58
59
  setVersion(version: any): void;
59
60
  _version: any;
60
61
  }