@openglobus/og 0.10.4 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/css/og.css +1 -1
  2. package/package.json +11 -9
  3. package/src/og/Extent.js +274 -273
  4. package/src/og/Globe.js +11 -3
  5. package/src/og/LonLat.js +152 -146
  6. package/src/og/Popup.js +2 -1
  7. package/src/og/camera/PlanetCamera.js +112 -38
  8. package/src/og/control/EarthNavigation.js +259 -0
  9. package/src/og/control/MouseNavigation.js +68 -40
  10. package/src/og/entity/EntityCollection.js +1 -1
  11. package/src/og/entity/LabelHandler.js +366 -74
  12. package/src/og/entity/Polyline.js +3 -2
  13. package/src/og/layer/CanvasTiles.js +32 -30
  14. package/src/og/layer/KML.js +159 -0
  15. package/src/og/layer/Vector.js +5 -0
  16. package/src/og/layer/index.js +2 -1
  17. package/src/og/math/Vec2.js +448 -448
  18. package/src/og/math/Vec3.js +759 -757
  19. package/src/og/math/Vec4.js +216 -215
  20. package/src/og/quadTree/Node.js +67 -13
  21. package/src/og/renderer/RendererEvents.js +21 -16
  22. package/src/og/scene/Planet.js +25 -10
  23. package/src/og/segment/Segment.js +3 -3
  24. package/src/og/segment/SegmentLonLat.js +7 -0
  25. package/src/og/terrain/GlobusTerrain.js +4 -0
  26. package/src/og/utils/FontAtlas.js +1 -0
  27. package/src/og/utils/GeoImageCreator.js +123 -121
  28. package/src/og/utils/Loader.js +81 -80
  29. package/src/og/utils/NormalMapCreator.js +320 -318
  30. package/src/og/utils/VectorTileCreator.js +251 -250
  31. package/src/og/webgl/Framebuffer.js +265 -264
  32. package/src/og/webgl/Handler.js +1022 -1001
  33. package/src/og/webgl/Multisample.js +169 -168
  34. package/src/og/webgl/ProgramController.js +113 -112
  35. package/types/Clock.d.ts +90 -0
  36. package/types/Deferred.d.ts +6 -0
  37. package/types/Events.d.ts +73 -0
  38. package/types/Extent.d.ts +162 -0
  39. package/types/Globe.d.ts +80 -0
  40. package/types/ImageCanvas.d.ts +121 -0
  41. package/types/Lock.d.ts +12 -0
  42. package/types/LonLat.d.ts +108 -0
  43. package/types/Popup.d.ts +38 -0
  44. package/types/QueueArray.d.ts +15 -0
  45. package/types/Rectangle.d.ts +74 -0
  46. package/types/Stack.d.ts +15 -0
  47. package/types/ajax.d.ts +24 -0
  48. package/types/arial.d.ts +48 -0
  49. package/types/astro/astro.d.ts +38 -0
  50. package/types/astro/earth.d.ts +6 -0
  51. package/types/astro/jd.d.ts +254 -0
  52. package/types/bv/Box.d.ts +25 -0
  53. package/types/bv/Sphere.d.ts +32 -0
  54. package/types/bv/index.d.ts +3 -0
  55. package/types/camera/Camera.d.ts +303 -0
  56. package/types/camera/Frustum.d.ts +129 -0
  57. package/types/camera/PlanetCamera.d.ts +222 -0
  58. package/types/camera/index.d.ts +3 -0
  59. package/types/cons.d.ts +40 -0
  60. package/types/control/CompassButton.d.ts +17 -0
  61. package/types/control/Control.d.ts +101 -0
  62. package/types/control/DebugInfo.d.ts +16 -0
  63. package/types/control/EarthCoordinates.d.ts +47 -0
  64. package/types/control/GeoImageDragControl.d.ts +6 -0
  65. package/types/control/KeyboardNavigation.d.ts +22 -0
  66. package/types/control/LayerSwitcher.d.ts +23 -0
  67. package/types/control/Lighting.d.ts +16 -0
  68. package/types/control/ScaleControl.d.ts +22 -0
  69. package/types/control/ShowFps.d.ts +12 -0
  70. package/types/control/SimpleNavigation.d.ts +28 -0
  71. package/types/control/Sun.d.ts +52 -0
  72. package/types/control/ToggleWireframe.d.ts +12 -0
  73. package/types/control/ZoomControl.d.ts +28 -0
  74. package/types/control/index.d.ts +15 -0
  75. package/types/ellipsoid/Ellipsoid.d.ts +142 -0
  76. package/types/ellipsoid/index.d.ts +3 -0
  77. package/types/ellipsoid/wgs84.d.ts +5 -0
  78. package/types/entity/BaseBillboard.d.ts +208 -0
  79. package/types/entity/Billboard.d.ts +94 -0
  80. package/types/entity/BillboardHandler.d.ts +74 -0
  81. package/types/entity/Entity.d.ts +330 -0
  82. package/types/entity/EntityCollection.d.ts +303 -0
  83. package/types/entity/Geometry.d.ts +72 -0
  84. package/types/entity/GeometryHandler.d.ts +76 -0
  85. package/types/entity/Label.d.ts +194 -0
  86. package/types/entity/LabelHandler.d.ts +24 -0
  87. package/types/entity/PointCloud.d.ts +174 -0
  88. package/types/entity/PointCloudHandler.d.ts +38 -0
  89. package/types/entity/Polyline.d.ts +303 -0
  90. package/types/entity/PolylineHandler.d.ts +18 -0
  91. package/types/entity/Ray.d.ts +123 -0
  92. package/types/entity/RayHandler.d.ts +67 -0
  93. package/types/entity/ShapeHandler.d.ts +22 -0
  94. package/types/entity/Strip.d.ts +118 -0
  95. package/types/entity/StripHandler.d.ts +38 -0
  96. package/types/entity/index.d.ts +8 -0
  97. package/types/index.core.d.ts +65 -0
  98. package/types/index.d.ts +45 -0
  99. package/types/index.webgl.d.ts +7 -0
  100. package/types/inherits.d.ts +4 -0
  101. package/types/input/input.d.ts +34 -0
  102. package/types/layer/BaseGeoImage.d.ts +106 -0
  103. package/types/layer/CanvasTiles.d.ts +75 -0
  104. package/types/layer/GeoImage.d.ts +65 -0
  105. package/types/layer/GeoTexture2d.d.ts +8 -0
  106. package/types/layer/GeoVideo.d.ts +80 -0
  107. package/types/layer/KML.d.ts +58 -0
  108. package/types/layer/WMS.d.ts +66 -0
  109. package/types/layer/XYZ.d.ts +126 -0
  110. package/types/layer/index.d.ts +10 -0
  111. package/types/light/LightSource.d.ts +177 -0
  112. package/types/math/Mat3.d.ts +53 -0
  113. package/types/math/Mat4.d.ts +157 -0
  114. package/types/math/Plane.d.ts +17 -0
  115. package/types/math/Vec2.d.ts +308 -0
  116. package/types/math/Vec3.d.ts +459 -0
  117. package/types/math/Vec4.d.ts +161 -0
  118. package/types/math/coder.d.ts +42 -0
  119. package/types/math/index.d.ts +11 -0
  120. package/types/math.d.ts +261 -0
  121. package/types/mercator.d.ts +92 -0
  122. package/types/proj/EPSG3857.d.ts +5 -0
  123. package/types/proj/EPSG4326.d.ts +5 -0
  124. package/types/quadTree/quadTree.d.ts +40 -0
  125. package/types/renderer/RendererEvents.d.ts +230 -0
  126. package/types/res/images.d.ts +3 -0
  127. package/types/scene/Axes.d.ts +11 -0
  128. package/types/scene/BaseNode.d.ts +60 -0
  129. package/types/scene/Planet.d.ts +572 -0
  130. package/types/scene/RenderNode.d.ts +143 -0
  131. package/types/scene/SkyBox.d.ts +10 -0
  132. package/types/scene/index.d.ts +4 -0
  133. package/types/segment/segmentHelper.d.ts +13 -0
  134. package/types/shaders/billboard.d.ts +3 -0
  135. package/types/shaders/depth.d.ts +2 -0
  136. package/types/shaders/drawnode.d.ts +7 -0
  137. package/types/shaders/label.d.ts +4 -0
  138. package/types/shaders/pointCloud.d.ts +2 -0
  139. package/types/shaders/polyline.d.ts +3 -0
  140. package/types/shaders/ray.d.ts +2 -0
  141. package/types/shaders/screenFrame.d.ts +2 -0
  142. package/types/shaders/shape.d.ts +4 -0
  143. package/types/shaders/skybox.d.ts +2 -0
  144. package/types/shaders/toneMapping.d.ts +2 -0
  145. package/types/shapes/BaseShape.d.ts +247 -0
  146. package/types/shapes/Sphere.d.ts +41 -0
  147. package/types/terrain/BilTerrain.d.ts +8 -0
  148. package/types/terrain/EmptyTerrain.d.ts +72 -0
  149. package/types/terrain/Geoid.d.ts +26 -0
  150. package/types/terrain/GlobusTerrain.d.ts +153 -0
  151. package/types/terrain/MapboxTerrain.d.ts +8 -0
  152. package/types/terrain/index.d.ts +5 -0
  153. package/types/utils/FontAtlas.d.ts +14 -0
  154. package/types/utils/GeoImageCreator.d.ts +29 -0
  155. package/types/utils/ImagesCacheManager.d.ts +10 -0
  156. package/types/utils/Loader.d.ts +25 -0
  157. package/types/utils/NormalMapCreator.d.ts +39 -0
  158. package/types/utils/PlainSegmentWorker.d.ts +10 -0
  159. package/types/utils/TerrainWorker.d.ts +9 -0
  160. package/types/utils/TextureAtlas.d.ts +111 -0
  161. package/types/utils/VectorTileCreator.d.ts +16 -0
  162. package/types/utils/colorTable.d.ts +143 -0
  163. package/types/utils/earcut.d.ts +6 -0
  164. package/types/utils/shared.d.ts +230 -0
  165. package/types/webgl/Framebuffer.d.ts +135 -0
  166. package/types/webgl/Handler.d.ts +372 -0
  167. package/types/webgl/Multisample.d.ts +89 -0
  168. package/types/webgl/Program.d.ts +155 -0
  169. package/types/webgl/ProgramController.d.ts +84 -0
  170. package/types/webgl/callbacks.d.ts +1 -0
  171. package/types/webgl/index.d.ts +6 -0
  172. package/types/webgl/types.d.ts +2 -0
@@ -0,0 +1,29 @@
1
+ export class GeoImageCreator {
2
+ constructor(planet: any, maxFrames: any);
3
+ _gridSize: number;
4
+ _planet: any;
5
+ _framebuffer: Framebuffer;
6
+ _texCoordsBuffer: any;
7
+ _indexBuffer: any;
8
+ MAX_FRAMES: any;
9
+ _currentFrame: number;
10
+ _queue: any[];
11
+ _animate: any[];
12
+ _initialize(): void;
13
+ /**
14
+ * Creates geoImage corners coordinates grid buffer.
15
+ * @public
16
+ * @param{Array.<og.LonLat>} c - GeoImage corners coordinates.
17
+ * @return{WebGLBuffer} Grid coordinates buffer.
18
+ */
19
+ public createGridBuffer(c: Array<any>, toMerc: any): WebGLBuffer;
20
+ frame(): void;
21
+ add(geoImage: any): void;
22
+ remove(geoImage: any): void;
23
+ _initBuffers(): void;
24
+ _framebufferMercProj: Framebuffer;
25
+ _quadTexCoordsBuffer: any;
26
+ _quadVertexBuffer: any;
27
+ _initShaders(): void;
28
+ }
29
+ import { Framebuffer } from "../webgl/Framebuffer.js";
@@ -0,0 +1,10 @@
1
+ export class ImagesCacheManager {
2
+ imagesCache: {};
3
+ _counter: number;
4
+ _pendingsQueue: QueueArray;
5
+ _imageIndexCounter: number;
6
+ load(src: any, success: any): void;
7
+ _exec(req: any): void;
8
+ _dequeueRequest(): void;
9
+ }
10
+ import { QueueArray } from "../QueueArray.js";
@@ -0,0 +1,25 @@
1
+ export class Loader {
2
+ constructor(maxRequests?: number);
3
+ MAX_REQUESTS: number;
4
+ events: Events;
5
+ _loading: number;
6
+ _queue: any[];
7
+ _promises: {
8
+ json: (r: any) => any;
9
+ blob: (r: any) => any;
10
+ arrayBuffer: (r: any) => any;
11
+ imageBitmap: (r: any) => any;
12
+ text: (r: any) => any;
13
+ };
14
+ load(params: any, callback: any): void;
15
+ fetch(params: any): Promise<{
16
+ status: string;
17
+ data: any;
18
+ } | {
19
+ status: string;
20
+ msg: any;
21
+ }>;
22
+ _exec(): Promise<void>;
23
+ abort(): void;
24
+ }
25
+ import { Events } from "../Events.js";
@@ -0,0 +1,39 @@
1
+ export class NormalMapCreator {
2
+ constructor(planet: any, options: any);
3
+ _minTabelSize: any;
4
+ _maxTableSize: any;
5
+ _planet: any;
6
+ _handler: any;
7
+ _verticesBufferArray: any[];
8
+ _indexBufferArray: any[];
9
+ _positionBuffer: any;
10
+ _framebuffer: Framebuffer;
11
+ _normalMapVerticesTexture: any;
12
+ _width: any;
13
+ _height: any;
14
+ _queue: QueueArray;
15
+ _lock: Lock;
16
+ _init(): void;
17
+ _drawNormalMapBlur(segment: any): boolean;
18
+ _drawNormalMapNoBlur(segment: any): boolean;
19
+ _drawNormalMap(segment: any): boolean;
20
+ drawSingle(segment: any): void;
21
+ frame(): void;
22
+ queue(segment: any): void;
23
+ unshift(segment: any): void;
24
+ remove(segment: any): void;
25
+ clear(): void;
26
+ /**
27
+ * Set activity off
28
+ * @public
29
+ */
30
+ public lock(key: any): void;
31
+ /**
32
+ * Set activity on
33
+ * @public
34
+ */
35
+ public free(key: any): void;
36
+ }
37
+ import { Framebuffer } from "../webgl/Framebuffer.js";
38
+ import { QueueArray } from "../QueueArray.js";
39
+ import { Lock } from "../Lock.js";
@@ -0,0 +1,10 @@
1
+ export class PlainSegmentWorker {
2
+ constructor(numWorkers?: number);
3
+ _id: number;
4
+ _segments: {};
5
+ _workerQueue: Worker[];
6
+ _pendingQueue: any[];
7
+ check(): void;
8
+ setGeoid(geoid: any): void;
9
+ make(segment: any): void;
10
+ }
@@ -0,0 +1,9 @@
1
+ export class TerrainWorker {
2
+ constructor(numWorkers?: number);
3
+ _id: number;
4
+ _segments: {};
5
+ _workerQueue: Worker[];
6
+ _pendingQueue: any[];
7
+ check(): void;
8
+ make(segment: any, elevations: any): void;
9
+ }
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Texture atlas stores images in one texture. Each image has its own
3
+ * atlas texture coordinates.
4
+ * @class
5
+ * @param {number} [width] - Texture atlas width, if it hasn't 1024 default.
6
+ * @param {number} [height] - Texture atlas height, if it hasn't 1024 default..
7
+ */
8
+ export class TextureAtlas {
9
+ constructor(width: any, height: any);
10
+ /**
11
+ * Atlas nodes where input images store. It can be access by image.__nodeIndex.
12
+ * @public
13
+ * @type {Array.<og.utils.TextureAtlasNode >}
14
+ */
15
+ public nodes: Array<any>;
16
+ /**
17
+ * Created gl texture.
18
+ * @public
19
+ */
20
+ public texture: any;
21
+ /**
22
+ * Atlas canvas.
23
+ * @public
24
+ * @type {canvas}
25
+ */
26
+ public canvas: any;
27
+ _handler: any;
28
+ _images: any[];
29
+ _btree: TextureAtlasNode;
30
+ _imagesCacheManager: ImagesCacheManager;
31
+ borderSize: number;
32
+ /**
33
+ * Returns atlas javascript image object.
34
+ * @public
35
+ * @returns {Object} -
36
+ */
37
+ public getImage(): any;
38
+ /**
39
+ * Returns canvas object.
40
+ * @public
41
+ * @returns {Object} -
42
+ */
43
+ public getCanvas(): any;
44
+ /**
45
+ * Clear atlas with black.
46
+ * @public
47
+ */
48
+ public clearCanvas(): void;
49
+ /**
50
+ * Sets openglobus gl handler that creates gl texture.
51
+ * @public
52
+ * @param {og.webgl.Handler} handler - WebGL handler.
53
+ */
54
+ public assignHandler(handler: any): void;
55
+ /**
56
+ * Returns image diagonal size.
57
+ * @param {Object} image - JavaSript image object.
58
+ * @returns {number} -
59
+ */
60
+ getDiagonal(image: any): number;
61
+ /**
62
+ * Adds image to the atlas and returns creted node with texture coordinates of the stored image.
63
+ * @public
64
+ * @param {Object} image - Input javascript image object.
65
+ * @param {boolean} [fastInsert] - If it's true atlas doesnt restore all images again
66
+ * and store image in the curent atlas sheme.
67
+ * @returns {og.utils.TextureAtlasNode} -
68
+ */
69
+ public addImage(image: any, fastInsert?: boolean): any;
70
+ _completeNode(nodes: any, node: any): void;
71
+ /**
72
+ * Main atlas making function.
73
+ * @private
74
+ * @param {boolean} [fastInsert] - If it's true atlas doesnt restore all images again
75
+ * and store image in the curent atlas sheme.
76
+ */
77
+ private _makeAtlas;
78
+ /**
79
+ * Creates atlas gl texture.
80
+ * @public
81
+ */
82
+ public createTexture(img: any): void;
83
+ /**
84
+ * Image handler callback.
85
+ * @callback Object~successCallback
86
+ * @param {Image} img - Loaded image.
87
+ */
88
+ /**
89
+ * Asynchronous function that loads and creates image to the image cache, and call success callback when it's done.
90
+ * @public
91
+ * @param {string} src - Image object src string.
92
+ * @param {Object~successCallback} success - The callback that handles the image loads done.
93
+ */
94
+ public loadImage(src: string, success: any): void;
95
+ getImageTexCoordinates(img: any): any;
96
+ }
97
+ /**
98
+ * Atlas binary tree node.
99
+ * @class
100
+ * @param {og.Rectangle} rect - Node image rectangle.
101
+ */
102
+ export class TextureAtlasNode {
103
+ constructor(rect: any, texCoords: any);
104
+ childNodes: any[];
105
+ image: any;
106
+ rect: any;
107
+ texCoords: any;
108
+ atlas: any;
109
+ insert(img: any): any;
110
+ }
111
+ import { ImagesCacheManager } from "./ImagesCacheManager.js";
@@ -0,0 +1,16 @@
1
+ export class VectorTileCreator {
2
+ constructor(planet: any, maxFrames: any, width: any, height: any);
3
+ _width: any;
4
+ _height: any;
5
+ _handler: any;
6
+ _planet: any;
7
+ _framebuffer: Framebuffer;
8
+ MAX_FRAMES: any;
9
+ _currentFrame: number;
10
+ _queue: any[];
11
+ _initialize(): void;
12
+ frame(): void;
13
+ add(material: any): void;
14
+ remove(material: any): void;
15
+ }
16
+ import { Framebuffer } from "../webgl/Framebuffer.js";
@@ -0,0 +1,143 @@
1
+ export const colorTable: {
2
+ aliceblue: string;
3
+ antiquewhite: string;
4
+ aqua: string;
5
+ aquamarine: string;
6
+ azure: string;
7
+ beige: string;
8
+ bisque: string;
9
+ black: string;
10
+ blanchedalmond: string;
11
+ blue: string;
12
+ blueviolet: string;
13
+ brown: string;
14
+ burlywood: string;
15
+ cadetblue: string;
16
+ chartreuse: string;
17
+ chocolate: string;
18
+ coral: string;
19
+ cornflowerblue: string;
20
+ cornsilk: string;
21
+ crimson: string;
22
+ cyan: string;
23
+ darkblue: string;
24
+ darkcyan: string;
25
+ darkgoldenrod: string;
26
+ darkgray: string;
27
+ darkgreen: string;
28
+ darkkhaki: string;
29
+ darkmagenta: string;
30
+ darkolivegreen: string;
31
+ darkorange: string;
32
+ darkorchid: string;
33
+ darkred: string;
34
+ darksalmon: string;
35
+ darkseagreen: string;
36
+ darkslateblue: string;
37
+ darkslategray: string;
38
+ darkturquoise: string;
39
+ darkviolet: string;
40
+ deeppink: string;
41
+ deepskyblue: string;
42
+ dimgray: string;
43
+ dodgerblue: string;
44
+ firebrick: string;
45
+ floralwhite: string;
46
+ forestgreen: string;
47
+ fuchsia: string;
48
+ gainsboro: string;
49
+ ghostwhite: string;
50
+ gold: string;
51
+ goldenrod: string;
52
+ gray: string;
53
+ green: string;
54
+ greenyellow: string;
55
+ honeydew: string;
56
+ hotpink: string;
57
+ "indianred ": string;
58
+ indigo: string;
59
+ ivory: string;
60
+ khaki: string;
61
+ lavender: string;
62
+ lavenderblush: string;
63
+ lawngreen: string;
64
+ lemonchiffon: string;
65
+ lightblue: string;
66
+ lightcoral: string;
67
+ lightcyan: string;
68
+ lightgoldenrodyellow: string;
69
+ lightgrey: string;
70
+ lightgreen: string;
71
+ lightpink: string;
72
+ lightsalmon: string;
73
+ lightseagreen: string;
74
+ lightskyblue: string;
75
+ lightslategray: string;
76
+ lightsteelblue: string;
77
+ lightyellow: string;
78
+ lime: string;
79
+ limegreen: string;
80
+ linen: string;
81
+ magenta: string;
82
+ maroon: string;
83
+ mediumaquamarine: string;
84
+ mediumblue: string;
85
+ mediumorchid: string;
86
+ mediumpurple: string;
87
+ mediumseagreen: string;
88
+ mediumslateblue: string;
89
+ mediumspringgreen: string;
90
+ mediumturquoise: string;
91
+ mediumvioletred: string;
92
+ midnightblue: string;
93
+ mintcream: string;
94
+ mistyrose: string;
95
+ moccasin: string;
96
+ navajowhite: string;
97
+ navy: string;
98
+ oldlace: string;
99
+ olive: string;
100
+ olivedrab: string;
101
+ orange: string;
102
+ orangered: string;
103
+ orchid: string;
104
+ palegoldenrod: string;
105
+ palegreen: string;
106
+ paleturquoise: string;
107
+ palevioletred: string;
108
+ papayawhip: string;
109
+ peachpuff: string;
110
+ peru: string;
111
+ pink: string;
112
+ plum: string;
113
+ powderblue: string;
114
+ purple: string;
115
+ rebeccapurple: string;
116
+ red: string;
117
+ rosybrown: string;
118
+ royalblue: string;
119
+ saddlebrown: string;
120
+ salmon: string;
121
+ sandybrown: string;
122
+ seagreen: string;
123
+ seashell: string;
124
+ sienna: string;
125
+ silver: string;
126
+ skyblue: string;
127
+ slateblue: string;
128
+ slategray: string;
129
+ snow: string;
130
+ springgreen: string;
131
+ steelblue: string;
132
+ tan: string;
133
+ teal: string;
134
+ thistle: string;
135
+ tomato: string;
136
+ turquoise: string;
137
+ violet: string;
138
+ wheat: string;
139
+ white: string;
140
+ whitesmoke: string;
141
+ yellow: string;
142
+ yellowgreen: string;
143
+ };
@@ -0,0 +1,6 @@
1
+ export function earcut(data: any, holeIndices: any, dim: any): any[];
2
+ export function flatten(data: any): {
3
+ vertices: any[];
4
+ holes: any[];
5
+ dimensions: any;
6
+ };
@@ -0,0 +1,230 @@
1
+ export function getDefault(param: any, def: any): any;
2
+ export function isEmpty(v: any): boolean;
3
+ export function stamp(obj: any): any;
4
+ export function isString(s: any): boolean;
5
+ /**
6
+ * Synchronous text file loading. Returns file text.
7
+ * @param {string} fileUrl - File name path.
8
+ * @returns {string} -
9
+ */
10
+ export function readTextFile(fileUrl: string): string;
11
+ /**
12
+ * Convert html color string to the RGBA number vector.
13
+ * @param {string} htmlColor - HTML string("#C6C6C6" or "#EF5" or "rgb(8,8,8)" or "rgba(8,8,8)") color.
14
+ * @param {number} [opacity] - Opacity for the output vector.
15
+ * @returns {og.math.Vec4} -
16
+ */
17
+ export function htmlColorToRgba(htmlColor: string, opacity?: number): any;
18
+ export function htmlColorToFloat32Array(htmlColor: any, opacity: any): Float32Array;
19
+ /**
20
+ * Convert html color string to the RGB number vector.
21
+ * @param {string} htmlColor - HTML string("#C6C6C6" or "#EF5" or "rgb(8,8,8)" or "rgba(8,8,8)") color.
22
+ * @param {number} [opacity] - Opacity for the output vector.
23
+ * @returns {og.Vec3} -
24
+ */
25
+ export function htmlColorToRgb(htmlColor: string): any;
26
+ /**
27
+ * Replace template substrings between '{' and '}' tokens.
28
+ * @param {string} template - String with templates in "{" and "}"
29
+ * @param {Object} params - Template named object with subsrtings.
30
+ * @returns {string} -
31
+ *
32
+ * @example <caption>Example from og.terrain that replaces tile indexes in url:</caption>
33
+ * var substrings = {
34
+ * "x": 12,
35
+ * "y": 15,
36
+ * "z": 8
37
+ * }
38
+ * og.utils.stringTemplate("http://earth3.openglobus.org/{z}/{y}/{x}.ddm", substrins);
39
+ * //returns http://earth3.openglobus.org/8/15/12.ddm
40
+ */
41
+ export function stringTemplate(template: string, params: any): string;
42
+ export function getHTML(template: any, params: any): string;
43
+ export function parseHTML(htmlStr: any): ChildNode[];
44
+ export function print2d(id: any, text: any, x: any, y: any): void;
45
+ export function defaultString(str: any, def: any): any;
46
+ export function createVector3(v: any, def: any): any;
47
+ export function createVector4(v: any, def: any): any;
48
+ export function createColorRGBA(c: any, def: any): any;
49
+ export function createColorRGB(c: any, def: any): any;
50
+ export function createExtent(e: any, def: any): any;
51
+ export function createLonLat(l: any, def: any): any;
52
+ export function binarySearchFast(arr: any, x: any): number;
53
+ /**
54
+ * Finds an item in a sorted array.
55
+ * @param {Array} ar The sorted array to search.
56
+ * @param {Object} el The item to find in the array.
57
+ * @param {og.utils.binarySearch~compare_fn} compare_fn comparator The function to use to compare the item to
58
+ * elements in the array.
59
+ * @returns {Number} a negative number if a is less than b; 0 if a is equal to b;a positive number of a is greater than b.
60
+ *
61
+ * @example
62
+ * // Create a comparator function to search through an array of numbers.
63
+ * function comparator(a, b) {
64
+ * return a - b;
65
+ * };
66
+ * var numbers = [0, 2, 4, 6, 8];
67
+ * var index = og.utils.binarySearch(numbers, 6, comparator); // 3
68
+ */
69
+ export function binarySearch(ar: any[], el: any, compare_fn: any): number;
70
+ /**
71
+ * Binary insertion that uses binarySearch algorithm.
72
+ * @param {Array} ar - The sorted array to insert.
73
+ * @param {Object} el - The item to insert.
74
+ * @param {og.utils.binarySearch~compare_fn} compare_fn - comparator The function to use to compare the item to
75
+ * elements in the array.
76
+ * @returns {Number} Array index position in which item inserted in.
77
+ */
78
+ export function binaryInsert(ar: any[], el: any, compare_fn: any): number;
79
+ /**
80
+ * Returns two segment lines intersection coordinate.
81
+ * @static
82
+ * @param {og.math.Vec2} start1 - First line first coordinate.
83
+ * @param {og.math.Vec2} end1 - First line second coordinate.
84
+ * @param {og.math.Vec2} start2 - Second line first coordinate.
85
+ * @param {og.math.Vec2} end2 - Second line second coordinate.
86
+ * @param {boolean} [isSegment] - Lines are segments.
87
+ * @return {og.math.Vec2} - Intersection coordinate.
88
+ */
89
+ export function getLinesIntersection2v(start1: any, end1: any, start2: any, end2: any, isSegment?: boolean): any;
90
+ /**
91
+ * Returns two segment lines intersection coordinate.
92
+ * @static
93
+ * @param {og.math.Vec2} start1 - First line first coordinate.
94
+ * @param {og.math.Vec2} end1 - First line second coordinate.
95
+ * @param {og.math.Vec2} start2 - Second line first coordinate.
96
+ * @param {og.math.Vec2} end2 - Second line second coordinate.
97
+ * @param {boolean} [isSegment] - Lines are segments.
98
+ * @return {og.math.Vec2} - Intersection coordinate.
99
+ */
100
+ export function getLinesIntersectionLonLat(start1: any, end1: any, start2: any, end2: any, isSegment?: boolean): any;
101
+ /**
102
+ * Converts XML to JSON
103
+ * @static
104
+ * @param {Object} xml - Xml object
105
+ * @return {Object} - Json converted object.
106
+ */
107
+ export function xmlToJson(xml: any): any;
108
+ export function base64toBlob(base64Data: any, contentType: any): Blob;
109
+ export function base64StringToBlog(string: any): Blob;
110
+ /**
111
+ * Callback throttling
112
+ * @param {any} func
113
+ * @param {Number} limit
114
+ * @param {Number} skip
115
+ */
116
+ export function throttle(func: any, limit: number, skip: number): (...args: any[]) => void;
117
+ /**
118
+ *
119
+ * y2-----Q12--------------Q22---
120
+ * | | | |
121
+ * | | | |
122
+ * y-------|-----P----------|----
123
+ * | | | |
124
+ * | | | |
125
+ * | | | |
126
+ * | | | |
127
+ * | | | |
128
+ * y1-----Q11----|---------Q21---
129
+ * | | |
130
+ * | | |
131
+ * x1 x x2
132
+ *
133
+ *
134
+ * @param {Number} x -
135
+ * @param {Number} y -
136
+ * @param {Number} fQ11 -
137
+ * @param {Number} fQ21 -
138
+ * @param {Number} fQ12 -
139
+ * @param {Number} fQ22 -
140
+ * @param {Number} [x1=0.0] -
141
+ * @param {Number} [x2=1.0] -
142
+ * @param {Number} [y1=0.0] -
143
+ * @param {Number} [y2=1.0] -
144
+ */
145
+ export function blerp(x: number, y: number, fQ11: number, fQ21: number, fQ12: number, fQ22: number, x1?: number, x2?: number, y1?: number, y2?: number): number;
146
+ export function blerp2(x: any, y: any, fQ11: any, fQ21: any, fQ12: any, fQ22: any): number;
147
+ export function extractElevationTiles(rgbaData: any, outCurrenElevations: any, outChildrenElevations: any): void;
148
+ /**
149
+ * Concatenates two the same type arrays
150
+ * @param {TypedArray} a
151
+ * @param {TypedArray} b
152
+ */
153
+ export function concatTypedArrays(a: any, b: any): any;
154
+ /**
155
+ * Concatenates two the same arrays
156
+ * @param {TypedArray | Array} a
157
+ * @param {TypedArray | Array} b
158
+ */
159
+ export function concatArrays(a: any | any[], b: any | any[]): any;
160
+ /**
161
+ * Convert simple array to typed
162
+ * @param arr {Array}
163
+ * @param ctor {Float32ArrayConstructor}
164
+ * @returns {TypedArray}
165
+ */
166
+ export function makeArrayTyped(arr: any[], ctor?: Float32ArrayConstructor): any;
167
+ /**
168
+ * Convert typed array to array
169
+ * @param arr {TypedArray}
170
+ * @returns {Array}
171
+ */
172
+ export function makeArray(arr: any): any[];
173
+ /**
174
+ *
175
+ * @param {TypedArray | Array} arr
176
+ * @param {Number} starting
177
+ * @param {Number} deleteCount
178
+ * @param {Array} elements
179
+ */
180
+ export function spliceArray(arr: any | any[], starting: number, deleteCount: number, elements: any[]): any;
181
+ /**
182
+ *
183
+ * @param {TypedArray} arr
184
+ * @param {Number} starting
185
+ * @param {Number} deleteCount
186
+ * @param {Array} elements
187
+ */
188
+ export function spliceTypedArray(arr: any, starting: number, deleteCount: number, elements?: any[]): any;
189
+ /**
190
+ * Returns triangle coordinate array from inside of the source triangle array.
191
+ * @static
192
+ * @param {Array.<number>} sourceArr - Source array
193
+ * @param {number} gridSize - Source array square matrix size
194
+ * @param {number} i0 - First row index source array matrix
195
+ * @param {number} j0 - First column index
196
+ * @param {number} size - Square matrix result size.
197
+ * @return{Array.<number>} Triangle coordinates array from the source array.
198
+ * @TODO: optimization
199
+ */
200
+ export function getMatrixSubArray(sourceArr: Array<number>, gridSize: number, i0: number, j0: number, size: number): Array<number>;
201
+ /**
202
+ * Returns two float32 triangle coordinate arrays from inside of the source triangle array.
203
+ * @static
204
+ * @param {Array.<number>} sourceArr - Source array
205
+ * @param {number} gridSize - Source array square matrix size
206
+ * @param {number} i0 - First row index source array matrix
207
+ * @param {number} j0 - First column index
208
+ * @param {number} size - Square matrix result size.
209
+ * @param {object} outBounds - Output bounds.
210
+ * @return{Array.<number>} Triangle coordinates array from the source array.
211
+ * @TODO: optimization
212
+ */
213
+ export function getMatrixSubArrayBoundsExt(sourceArr: Array<number>, sourceArrHigh: any, sourceArrLow: any, noDataVertices: any, gridSize: number, i0: number, j0: number, size: number, outArr: any, outArrHigh: any, outArrLow: any, outBounds: object, outNoDataVertices: any): Array<number>;
214
+ export function cloneArray(items: any): any;
215
+ /**
216
+ * Returns true if the object pointer is undefined.
217
+ * @function
218
+ * @param {Object} obj - Object pointer.
219
+ * @returns {boolean} Returns true if object is undefined.
220
+ */
221
+ export function isUndef(obj: any): boolean;
222
+ export namespace castType {
223
+ function string(v: any): any;
224
+ function date(v: any): any;
225
+ function datetime(v: any): any;
226
+ function time(v: any): any;
227
+ function integer(v: any): any;
228
+ function float(v: any): any;
229
+ function boolean(str: any): any;
230
+ }