@openglobus/og 0.16.3 → 0.17.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 (197) hide show
  1. package/README.md +1 -1
  2. package/css/og.css +24 -2
  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 +1 -1
  9. package/src/og/Clock.js +1 -5
  10. package/src/og/Events.js +2 -6
  11. package/src/og/Extent.js +5 -9
  12. package/src/og/Globe.js +93 -56
  13. package/src/og/ImageCanvas.js +13 -6
  14. package/src/og/Lock.js +44 -48
  15. package/src/og/LonLat.js +1 -5
  16. package/src/og/Object3d.js +2 -2
  17. package/src/og/QueueArray.js +1 -1
  18. package/src/og/Stack.js +49 -53
  19. package/src/og/astro/earth.js +112 -116
  20. package/src/og/astro/jd.js +514 -518
  21. package/src/og/astro/orbit.js +119 -123
  22. package/src/og/astro/rotation.js +36 -40
  23. package/src/og/bv/Box.js +77 -81
  24. package/src/og/bv/Sphere.js +57 -61
  25. package/src/og/camera/Camera.js +20 -7
  26. package/src/og/camera/Frustum.js +4 -4
  27. package/src/og/camera/PlanetCamera.js +15 -22
  28. package/src/og/cons.js +1 -1
  29. package/src/og/control/Atmosphere.js +0 -4
  30. package/src/og/control/Control.js +9 -8
  31. package/src/og/control/DebugInfo.js +3 -7
  32. package/src/og/control/DrawingSwitcher.js +117 -0
  33. package/src/og/control/EarthCoordinates.js +214 -214
  34. package/src/og/control/EarthNavigation.js +6 -13
  35. package/src/og/control/GeoImageDragControl.js +0 -4
  36. package/src/og/control/KeyboardNavigation.js +0 -4
  37. package/src/og/control/LayerAnimation.js +0 -4
  38. package/src/og/control/LayerSwitcher.js +2 -4
  39. package/src/og/control/Lighting.js +12 -16
  40. package/src/og/control/MouseNavigation.js +1 -5
  41. package/src/og/control/MouseWheelZoomControl.js +0 -4
  42. package/src/og/control/RulerSwitcher.js +0 -4
  43. package/src/og/control/ScaleControl.js +2 -6
  44. package/src/og/control/ShowFps.js +40 -44
  45. package/src/og/control/SimpleNavigation.js +10 -10
  46. package/src/og/control/SimpleSkyBackground.js +0 -4
  47. package/src/og/control/Sun.js +0 -4
  48. package/src/og/control/ToggleWireframe.js +35 -39
  49. package/src/og/control/ZoomControl.js +0 -4
  50. package/src/og/control/drawing/DrawingControl.js +51 -0
  51. package/src/og/control/drawing/LineStringDrawingScene.js +203 -0
  52. package/src/og/control/drawing/PolygonDrawingScene.js +785 -0
  53. package/src/og/control/elevationProfile/ElevationProfile.js +275 -0
  54. package/src/og/control/index.js +5 -1
  55. package/src/og/control/ruler/Ruler.js +0 -4
  56. package/src/og/control/ruler/RulerScene.js +3 -2
  57. package/src/og/control/selection/Selection.js +0 -4
  58. package/src/og/control/selection/SelectionScene.js +2 -4
  59. package/src/og/control/timeline/TimelineControl.js +4 -4
  60. package/src/og/control/timeline/TimelineModel.js +2 -2
  61. package/src/og/control/timeline/TimelineView.js +1 -0
  62. package/src/og/control/visibleExtent/Segment.js +7 -7
  63. package/src/og/control/visibleExtent/drawnode.js +0 -4
  64. package/src/og/ellipsoid/Ellipsoid.js +236 -325
  65. package/src/og/ellipsoid/wgs84.js +0 -4
  66. package/src/og/entity/BaseBillboard.js +375 -379
  67. package/src/og/entity/Billboard.js +0 -4
  68. package/src/og/entity/BillboardHandler.js +3 -7
  69. package/src/og/entity/Entity.js +22 -22
  70. package/src/og/entity/EntityCollection.js +14 -18
  71. package/src/og/entity/GeoObject.js +6 -8
  72. package/src/og/entity/GeoObjectHandler.js +30 -24
  73. package/src/og/entity/Geometry.js +5 -4
  74. package/src/og/entity/GeometryHandler.js +18 -19
  75. package/src/og/entity/Label.js +0 -4
  76. package/src/og/entity/LabelHandler.js +10 -14
  77. package/src/og/entity/LabelWorker.js +1 -1
  78. package/src/og/entity/PointCloud.js +2 -6
  79. package/src/og/entity/PointCloudHandler.js +122 -126
  80. package/src/og/entity/Polyline.js +15 -17
  81. package/src/og/entity/PolylineHandler.js +104 -108
  82. package/src/og/entity/Ray.js +29 -29
  83. package/src/og/entity/RayHandler.js +2 -2
  84. package/src/og/entity/Strip.js +1 -1
  85. package/src/og/entity/StripHandler.js +2 -2
  86. package/src/og/index.js +3 -1
  87. package/src/og/input/KeyboardHandler.js +128 -132
  88. package/src/og/input/MouseHandler.js +94 -98
  89. package/src/og/input/TouchHandler.js +59 -63
  90. package/src/og/input/input.js +44 -48
  91. package/src/og/layer/BaseGeoImage.js +6 -9
  92. package/src/og/layer/CanvasTiles.js +1 -5
  93. package/src/og/layer/GeoImage.js +0 -4
  94. package/src/og/layer/GeoTexture2d.js +0 -4
  95. package/src/og/layer/GeoVideo.js +0 -4
  96. package/src/og/layer/KML.js +1 -0
  97. package/src/og/layer/Layer.js +22 -26
  98. package/src/og/layer/Material.js +0 -4
  99. package/src/og/layer/Vector.js +25 -22
  100. package/src/og/layer/WMS.js +182 -186
  101. package/src/og/layer/XYZ.js +0 -4
  102. package/src/og/light/LightSource.js +0 -4
  103. package/src/og/math/Line2.js +28 -32
  104. package/src/og/math/Mat3.js +152 -156
  105. package/src/og/math/Ray.js +0 -4
  106. package/src/og/math/Vec2.js +0 -4
  107. package/src/og/math/Vec3.js +5 -4
  108. package/src/og/math/Vec4.js +0 -4
  109. package/src/og/math/coder.js +104 -104
  110. package/src/og/math.js +42 -10
  111. package/src/og/mercator.js +1 -1
  112. package/src/og/proj/EPSG3857.js +13 -13
  113. package/src/og/proj/Proj.js +59 -63
  114. package/src/og/quadTree/EPSG4326QuadTreeStrategy.js +1 -0
  115. package/src/og/quadTree/EarthQuadTreeStrategy.js +1 -0
  116. package/src/og/quadTree/EntityCollectionNode.js +12 -16
  117. package/src/og/quadTree/MarsQuadTreeStrategy.js +1 -0
  118. package/src/og/quadTree/Node.js +15 -14
  119. package/src/og/quadTree/QuadTreeStrategy.js +1 -0
  120. package/src/og/quadTree/Wgs84QuadTreeStrategy.js +1 -0
  121. package/src/og/renderer/Renderer.js +114 -27
  122. package/src/og/renderer/RendererEvents.js +0 -4
  123. package/src/og/scene/Axes.js +74 -78
  124. package/src/og/scene/BaseNode.js +1 -5
  125. package/src/og/scene/Planet.js +127 -130
  126. package/src/og/scene/RenderNode.js +20 -12
  127. package/src/og/scene/SkyBox.js +104 -108
  128. package/src/og/segment/Segment.js +10 -6
  129. package/src/og/segment/SegmentLonLat.js +3 -7
  130. package/src/og/segment/segmentHelper.js +229 -225
  131. package/src/og/shaders/atmos.js +1 -1
  132. package/src/og/shaders/billboard.js +0 -4
  133. package/src/og/shaders/drawnode.js +5 -9
  134. package/src/og/shaders/geoObject.js +0 -4
  135. package/src/og/shaders/label.js +0 -4
  136. package/src/og/shaders/pickingMask.js +0 -4
  137. package/src/og/shaders/pointCloud.js +0 -4
  138. package/src/og/shaders/polyline.js +0 -4
  139. package/src/og/shaders/ray.js +0 -4
  140. package/src/og/shaders/skybox.js +0 -4
  141. package/src/og/terrain/EmptyTerrain.js +0 -4
  142. package/src/og/utils/FontAtlas.js +0 -4
  143. package/src/og/utils/GeoImageCreator.js +2 -3
  144. package/src/og/utils/NormalMapCreator.js +11 -12
  145. package/src/og/utils/PlainSegmentWorker.js +9 -9
  146. package/src/og/utils/TerrainWorker.js +2 -2
  147. package/src/og/utils/TextureAtlas.js +1 -1
  148. package/src/og/utils/VectorTileCreator.js +3 -9
  149. package/src/og/utils/earcut.js +8 -8
  150. package/src/og/utils/shared.js +30 -11
  151. package/src/og/webgl/Framebuffer.js +2 -6
  152. package/src/og/webgl/Handler.js +46 -20
  153. package/src/og/webgl/Multisample.js +2 -6
  154. package/src/og/webgl/Program.js +4 -8
  155. package/src/og/webgl/ProgramController.js +2 -2
  156. package/types/Clock.d.ts +1 -1
  157. package/types/Extent.d.ts +5 -5
  158. package/types/Globe.d.ts +15 -1
  159. package/types/ImageCanvas.d.ts +5 -0
  160. package/types/bv/Box.d.ts +1 -1
  161. package/types/bv/Sphere.d.ts +3 -3
  162. package/types/camera/Camera.d.ts +3 -2
  163. package/types/camera/PlanetCamera.d.ts +4 -4
  164. package/types/control/DrawingSwitcher.d.ts +13 -0
  165. package/types/control/EarthCoordinates.d.ts +1 -1
  166. package/types/control/Lighting.d.ts +8 -8
  167. package/types/control/drawing/DrawingControl.d.ts +14 -0
  168. package/types/control/drawing/LineStringDrawingScene.d.ts +5 -0
  169. package/types/control/drawing/PolygonDrawingScene.d.ts +99 -0
  170. package/types/control/index.d.ts +3 -1
  171. package/types/control/ruler/RulerScene.d.ts +0 -1
  172. package/types/control/selection/SelectionScene.d.ts +0 -1
  173. package/types/ellipsoid/Ellipsoid.d.ts +53 -64
  174. package/types/entity/Entity.d.ts +3 -2
  175. package/types/entity/GeoObject.d.ts +1 -2
  176. package/types/entity/Geometry.d.ts +5 -0
  177. package/types/entity/Polyline.d.ts +1 -1
  178. package/types/entity/Ray.d.ts +1 -0
  179. package/types/index.d.ts +1 -0
  180. package/types/layer/BaseGeoImage.d.ts +1 -1
  181. package/types/layer/CanvasTiles.d.ts +1 -1
  182. package/types/layer/Layer.d.ts +1 -1
  183. package/types/layer/Vector.d.ts +1 -0
  184. package/types/math/Vec3.d.ts +2 -0
  185. package/types/math.d.ts +7 -0
  186. package/types/renderer/Renderer.d.ts +7 -1
  187. package/types/scene/Axes.d.ts +0 -1
  188. package/types/scene/Planet.d.ts +27 -26
  189. package/types/scene/RenderNode.d.ts +2 -0
  190. package/types/scene/SkyBox.d.ts +0 -1
  191. package/types/segment/Segment.d.ts +3 -2
  192. package/types/segment/SegmentLonLat.d.ts +0 -1
  193. package/types/utils/GeoImageCreator.d.ts +1 -1
  194. package/types/utils/NormalMapCreator.d.ts +1 -1
  195. package/types/utils/VectorTileCreator.d.ts +2 -2
  196. package/types/utils/shared.d.ts +2 -0
  197. package/types/webgl/Handler.d.ts +6 -4
@@ -37,6 +37,11 @@ export class ImageCanvas {
37
37
  * @public
38
38
  */
39
39
  public fillEmpty(): void;
40
+ /**
41
+ * Fills canvas RGBA with color.
42
+ * @public
43
+ */
44
+ public fill(color: any): void;
40
45
  /**
41
46
  * Gets canvas pixels RGBA data.
42
47
  * @public
package/types/bv/Box.d.ts CHANGED
@@ -21,7 +21,7 @@ export class Box {
21
21
  */
22
22
  setFromBoundsArr(bounds: Array<number>): void;
23
23
  /**
24
- * Sets bounding box coordiantes by ellipsoid geodetic extend.
24
+ * Sets bounding box coordinates by ellipsoid geodetic extend.
25
25
  * @param {Ellipsoid} ellipsoid - Ellipsoid.
26
26
  * @param {Extent} extent - Geodetic extent.
27
27
  */
@@ -2,7 +2,7 @@
2
2
  * Bounding sphere class.
3
3
  * @class
4
4
  * @param {Number} [radius] - Bounding sphere radius.
5
- * @param {Vec3} [center] - Bounding sphere coordiantes.
5
+ * @param {Vec3} [center] - Bounding sphere coordinates.
6
6
  */
7
7
  export class Sphere {
8
8
  /**
@@ -18,7 +18,7 @@ export class Sphere {
18
18
  */
19
19
  public radius: number;
20
20
  /**
21
- * Sphere coordiantes.
21
+ * Sphere coordinates.
22
22
  * @public
23
23
  * @type {Vec3}
24
24
  */
@@ -29,7 +29,7 @@ export class Sphere {
29
29
  */
30
30
  setFromBounds(bounds: Array<number>): void;
31
31
  /**
32
- * Sets bounding sphere coordiantes by ellipsoid geodetic extend.
32
+ * Sets bounding sphere coordinates by ellipsoid geodetic extend.
33
33
  * @param {Ellipsoid} ellipsoid - Ellipsoid.
34
34
  * @param {Extent} extent - Geodetic extent.
35
35
  */
@@ -105,6 +105,7 @@ export class Camera {
105
105
  currentFrustumIndex: number;
106
106
  isFirstPass: boolean;
107
107
  checkMoveEnd(): void;
108
+ bindRenderer(renderer: any): void;
108
109
  /**
109
110
  * Camera initialization.
110
111
  * @public
@@ -225,9 +226,9 @@ export class Camera {
225
226
  */
226
227
  public unproject(x: number, y: number): Vec3;
227
228
  /**
228
- * Gets projected 3d point to the 2d screen coordiantes
229
+ * Gets projected 3d point to the 2d screen coordinates
229
230
  * @public
230
- * @param {Vec3} v - Cartesian 3d coordiantes
231
+ * @param {Vec3} v - Cartesian 3d coordinates
231
232
  * @returns {Vec2} - Screen point coordinates
232
233
  */
233
234
  public project(v: Vec3): Vec2;
@@ -7,9 +7,9 @@
7
7
  * @param {Object} [options.name] - Camera name.
8
8
  * @param {number} [options.viewAngle] - Camera angle of view.
9
9
  * @param {number} [options.near] - Camera near plane distance. Default is 1.0
10
- * @param {number} [options.far] - Camera far plane distance. Deafult is og.math.MAX
11
- * @param {number} [options.minAltitude] - Minimal altitude for the camera. Deafult is 5
12
- * @param {number} [options.maxAltitude] - Maximal altitude for the camera. Deafult is 20000000
10
+ * @param {number} [options.far] - Camera far plane distance. Default is og.math.MAX
11
+ * @param {number} [options.minAltitude] - Minimal altitude for the camera. Default is 5
12
+ * @param {number} [options.maxAltitude] - Maximal altitude for the camera. Default is 20000000
13
13
  * @param {Vec3} [options.eye] - Camera eye position. Default (0,0,0)
14
14
  * @param {Vec3} [options.look] - Camera look position. Default (0,0,0)
15
15
  * @param {Vec3} [options.up] - Camera eye position. Default (0,1,0)
@@ -152,7 +152,7 @@ export class PlanetCamera extends Camera {
152
152
  public flyCartesian(cartesian: Vec3, look?: Vec3, up?: Vec3, ampl?: number, completeCallback?: cameraCallback, startCallback?: cameraCallback, frameCallback?: () => void): void;
153
153
  _frameCallback: () => void;
154
154
  /**
155
- * Flies to the geo coordiantes.
155
+ * Flies to the geo coordinates.
156
156
  * @public
157
157
  * @param {LonLat} lonlat - Finish coordinates.
158
158
  * @param {Vec3} [look] - Camera LOOK in the end of flying. Default - (0,0,0)
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Activate drawing control
3
+ * @class
4
+ * @extends {Control}
5
+ * @param {Object} [options] - Control options.
6
+ */
7
+ export class DrawingSwitcher extends Control {
8
+ constructor(options?: {});
9
+ drawingControl: DrawingControl;
10
+ _createMenu(): void;
11
+ }
12
+ import { Control } from "./Control.js";
13
+ import { DrawingControl } from "./drawing/DrawingControl.js";
@@ -3,7 +3,7 @@
3
3
  * @class
4
4
  * @extends {og.control.Control}
5
5
  * @param {Object} [options] - Options:
6
- * @param {Boolean} [options.center] - Earth coordiantes by screen center otherwise mouse pointer. False is default.
6
+ * @param {Boolean} [options.center] - Earth coordinates by screen center otherwise mouse pointer. False is default.
7
7
  * @param {Boolean} [options.type] - Coordinates shown: 0 - is decimal degrees, 1 - degrees, 2 - mercator geodetic coordinates.
8
8
  */
9
9
  export class EarthCoordinates {
@@ -21,14 +21,14 @@ export class Lighting extends Control {
21
21
  _specular_b: Slider;
22
22
  _shininess: Slider;
23
23
  bindLayer(layer: any): void;
24
- $atmosphereOpacity: Element;
25
- $gamma: Element;
26
- $exposure: Element;
27
- $opacity: Element;
28
- $diffuse: Element;
29
- $ambient: Element;
30
- $specular: Element;
31
- $night: Element;
24
+ $atmosphereOpacity: any;
25
+ $gamma: any;
26
+ $exposure: any;
27
+ $opacity: any;
28
+ $diffuse: any;
29
+ $ambient: any;
30
+ $specular: any;
31
+ $night: any;
32
32
  _update(): void;
33
33
  _fetchLayers(): void;
34
34
  _onLayerAdd(e: any): void;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Activate drawing
3
+ * @class
4
+ * @extends {Control}
5
+ * @param {Object} [options] - Control options.
6
+ */
7
+ export class DrawingControl extends Control {
8
+ constructor(options?: {});
9
+ _drawingScene: LineStringDrawingScene;
10
+ activatePolygonDrawing(): void;
11
+ activateLineStringDrawing(): void;
12
+ }
13
+ import { Control } from "../Control.js";
14
+ import { LineStringDrawingScene } from "./LineStringDrawingScene.js";
@@ -0,0 +1,5 @@
1
+ export class LineStringDrawingScene extends PolygonDrawingScene {
2
+ constructor(props: any);
3
+ _moveCorner(indexCurrent: any, indexPrev: any, indexCenter: any): void;
4
+ }
5
+ import { PolygonDrawingScene } from "./PolygonDrawingScene.js";
@@ -0,0 +1,99 @@
1
+ export const NUM_SEGMENTS: 200;
2
+ export const OUTLINE_ALT: 0.3;
3
+ export const COORDINATES_COLOR: "rgb(350, 350, 0)";
4
+ export const CENTER_COLOR: "rgb(0, 350, 50)";
5
+ export const OUTLINE_COLOR: "rgb(0, 350, 50)";
6
+ export const OUTLINE_THICKNESS: 3.5;
7
+ export namespace CORNER_OPTIONS {
8
+ export const scale: number;
9
+ export const instanced: boolean;
10
+ export const tag: string;
11
+ export { COORDINATES_COLOR as color };
12
+ export { POINTER_OBJ3D as object3d };
13
+ }
14
+ export namespace CENTER_OPTIONS {
15
+ const scale_1: number;
16
+ export { scale_1 as scale };
17
+ const instanced_1: boolean;
18
+ export { instanced_1 as instanced };
19
+ const tag_1: string;
20
+ export { tag_1 as tag };
21
+ export { CENTER_COLOR as color };
22
+ export { POINTER_OBJ3D as object3d };
23
+ }
24
+ export namespace OUTLINE_OPTIONS {
25
+ export { OUTLINE_THICKNESS as thickness };
26
+ export { OUTLINE_COLOR as color };
27
+ }
28
+ declare const POINTER_OBJ3D: Object3d;
29
+ export class PolygonDrawingScene extends RenderNode {
30
+ constructor(options?: {});
31
+ _planet: any;
32
+ _initCoordinates: any;
33
+ _pickedCorner: any;
34
+ _pickedCenter: any;
35
+ _startPos: any;
36
+ _startClick: Vec2;
37
+ _geometryLayer: Vector;
38
+ _cornerLayer: Vector;
39
+ _centerLayer: Vector;
40
+ _outlineLayer: Vector;
41
+ _ghostCorner: Entity;
42
+ _ghostOutlineLayer: Vector;
43
+ _showGhostPointer: boolean;
44
+ _isStartPoint: boolean;
45
+ _insertCornerIndex: number;
46
+ get geometryType(): string;
47
+ getCoordinates(): any;
48
+ bindPlanet(planet: any): void;
49
+ _onChange_: any;
50
+ _onChange(e: any): void;
51
+ clear(): void;
52
+ setCoordinates(coords: any): void;
53
+ stopNewPoint(): void;
54
+ _onMouseDblClick_: any;
55
+ startNewPoint(): void;
56
+ showGhostPointer(): void;
57
+ hideGhostPointer(): void;
58
+ setGhostPointerPosition(groundPos: any): void;
59
+ _onCornerMouseEnter(e: any): void;
60
+ _onCornerMouseLeave(e: any): void;
61
+ _onCenterMouseEnter(e: any): void;
62
+ _onCenterMouseLeave(e: any): void;
63
+ _onLup(e: any): void;
64
+ _getLdown(e: any): any;
65
+ _onCornerLdown(e: any): void;
66
+ _onCenterLdown(e: any): void;
67
+ _onMouseMove(e: any): void;
68
+ _onCornerLdblclick(e: any): void;
69
+ _cornerDblClick: boolean;
70
+ _onMouseDblClick(e: any): void;
71
+ _initEvents(): void;
72
+ _onCornerLdblclick_: any;
73
+ _onCornerLdown_: any;
74
+ _onCenterLdown_: any;
75
+ _onLup_: any;
76
+ _onMouseMove_: any;
77
+ _onCornerMouseEnter_: any;
78
+ _onCornerMouseLeave_: any;
79
+ _onCenterMouseEnter_: any;
80
+ _onCenterMouseLeave_: any;
81
+ _clearEvents(): void;
82
+ _drawCorners(): void;
83
+ _drawCenters(): void;
84
+ _drawGhostCorner(): void;
85
+ _checkTerrainCollision(entity: any): void;
86
+ _moveCenterPoint(): void;
87
+ _addNew(cart: any): void;
88
+ _appendCart(cart: any): void;
89
+ _clearGhostPointer(): void;
90
+ _moveCornerPoint(e: any): void;
91
+ _updateGhostOutlinePointer(groundPos: any): void;
92
+ _initGhostLayerPointer(): void;
93
+ }
94
+ import { Object3d } from '../../Object3d.js';
95
+ import { RenderNode } from '../../scene/RenderNode.js';
96
+ import { Vec2 } from '../../math/Vec2.js';
97
+ import { Vector } from '../../layer/Vector.js';
98
+ import { Entity } from '../../entity/Entity.js';
99
+ export {};
@@ -22,4 +22,6 @@ import { SimpleSkyBackground } from "./SimpleSkyBackground.js";
22
22
  import { Selection } from "./selection/Selection.js";
23
23
  import { LayerAnimation } from "./LayerAnimation.js";
24
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 };
25
+ import { DrawingSwitcher } from "./DrawingSwitcher.js";
26
+ import { DrawingControl } from "./drawing/DrawingControl.js";
27
+ 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, DrawingSwitcher, DrawingControl };
@@ -17,7 +17,6 @@ export class RulerScene extends RenderNode {
17
17
  bindPlanet(planet: any): void;
18
18
  _createCorners(): void;
19
19
  _cornerEntity: Entity[];
20
- init(): void;
21
20
  _propsLabel: Entity;
22
21
  _trackEntity: Entity;
23
22
  _activate(): void;
@@ -13,7 +13,6 @@ export class SelectionScene extends RenderNode {
13
13
  _cornersLayer: Vector;
14
14
  set ignoreTerrain(arg: any);
15
15
  bindPlanet(planet: any): void;
16
- init(): void;
17
16
  _activate(): void;
18
17
  _onMouseMove_: any;
19
18
  _onMouseLdown_: any;
@@ -6,20 +6,12 @@
6
6
  */
7
7
  export class Ellipsoid {
8
8
  /**
9
- * Returns angle between to bearin angles
10
- * @param {number} a - First bearing angle
11
- * @param {number} b - Second bearing angle
9
+ * REMOVE ASAP after
10
+ * @param lonLat1
11
+ * @param lonLat2
12
12
  * @returns {number}
13
13
  */
14
- static getAngleBetweenTwoBearings(a: number, b: number): number;
15
- static getRelativeBearing(a: any, b: any): number;
16
- /**
17
- * Returns the midpoint between two points on the great circle.
18
- * @param {LonLat} lonLat1 - Longitude/latitude of first point.
19
- * @param {LonLat} lonLat2 - Longitude/latitude of second point.
20
- * @return {LonLat} Midpoint between points.
21
- */
22
- static getMiddlePointOnGreatCircle(lonLat1: LonLat, lonLat2: LonLat): LonLat;
14
+ static getBearing(lonLat1: any, lonLat2: any): number;
23
15
  /**
24
16
  * Returns the point at given fraction between two points on the great circle.
25
17
  * @param {LonLat} lonLat1 - Longitude/Latitude of source point.
@@ -29,31 +21,6 @@ export class Ellipsoid {
29
21
  */
30
22
  static getIntermediatePointOnGreatCircle(lonLat1: LonLat, lonLat2: LonLat, fraction: number): LonLat;
31
23
  static getRhumbBearing(lonLat1: any, lonLat2: any): number;
32
- static getBearing(lonLat1: any, lonLat2: any): number;
33
- /**
34
- * Returns the (initial) bearing from source to destination point on the great circle.
35
- * @param {LonLat} lonLat1 - Longitude/latitude of source point.
36
- * @param {LonLat} lonLat2 - Longitude/latitude of destination point.
37
- * @return {number} Initial bearing in degrees from north.
38
- */
39
- static getInitialBearing(lonLat1: LonLat, lonLat2: LonLat): number;
40
- /**
41
- * Returns the point of intersection of two paths defined by point and bearing.
42
- * @param {LonLat} p1 - First point.
43
- * @param {number} brng1 - Initial bearing from first point.
44
- * @param {LonLat} p2 - Second point.
45
- * @param {number} brng2 - Initial bearing from second point.
46
- * @return {LonLat|null} Destination point (null if no unique intersection defined).
47
- */
48
- static intersection(p1: LonLat, brng1: number, p2: LonLat, brng2: number): LonLat | null;
49
- /**
50
- * Returns final bearing arriving at destination destination point from lonLat1 point; the final bearing
51
- * will differ from the initial bearing by varying degrees according to distance and latitude.
52
- * @param {LonLat} lonLat1 - Longitude/latitude of source point.
53
- * @param {LonLat} lonLat2 - Longitude/latitude of destination point.
54
- * @return {number} Final bearing in degrees from north.
55
- */
56
- static getFinalBearing(lonLat1: LonLat, lonLat2: LonLat): number;
57
24
  /**
58
25
  * @param {number} equatorialSize - Equatorial ellipsoid size.
59
26
  * @param {number} polarSize - Polar ellipsoid size.
@@ -76,12 +43,20 @@ export class Ellipsoid {
76
43
  _invRadii2: Vec3;
77
44
  /**
78
45
  * Returns the distance travelling from ‘this’ point to destination point along a rhumb line.
79
- *
80
46
  * @param {LonLat} start coordinates.
81
47
  * @param {LonLat} end coordinates
82
48
  * @returns {number} Distance in m between this point and destination point (same units as radius).
83
49
  */
84
50
  rhumbDistanceTo(startLonLat: any, endLonLat: any): number;
51
+ /**
52
+ * Returns the point at given fraction between two points on the great circle.
53
+ * @param {LonLat} lonLat1 - Longitude/Latitude of source point.
54
+ * @param {LonLat} lonLat2 - Longitude/Latitude of destination point.
55
+ * @param {number} fraction - Fraction between the two points (0 = source point, 1 = destination point).
56
+ * @returns {LonLat} Intermediate point between points.
57
+ */
58
+ getIntermediatePointOnGreatCircle(lonLat1: LonLat, lonLat2: LonLat, fraction: number): LonLat;
59
+ getFlattening(): number;
85
60
  /**
86
61
  * Gets ellipsoid equatorial size.
87
62
  * @public
@@ -95,17 +70,17 @@ export class Ellipsoid {
95
70
  */
96
71
  public getPolarSize(): number;
97
72
  /**
98
- * Gets cartesian ECEF from Wgs84 geodetic coordinates.
73
+ * Calculate cartesian coordinates by its ECEF geodetic coordinates.
99
74
  * @public
100
- * @param {LonLat} lonlat - Degrees geodetic coordinates.
75
+ * @param {LonLat} lonlat - Geodetic coordinates.
101
76
  * @returns {Vec3} -
102
77
  */
103
78
  public lonLatToCartesian(lonlat: LonLat): Vec3;
104
79
  /**
105
- * Gets cartesian ECEF from Wgs84 geodetic coordinates.
80
+ * Calculate cartesian coordinates by its ECEF geodetic coordinates.
106
81
  * @public
107
- * @param {LonLat} lonlat - Degrees geodetic coordinates.
108
- * @param {Vec3} res - Output result.
82
+ * @param {LonLat} lonlat - Geodetic coordinates.
83
+ * @param {Vec3} res - Output variable reference.
109
84
  * @returns {Vec3} -
110
85
  */
111
86
  public lonLatToCartesianRes(lonlat: LonLat, res: Vec3): Vec3;
@@ -117,7 +92,7 @@ export class Ellipsoid {
117
92
  * @param {Number} height - Height.
118
93
  * @returns {Vec3} -
119
94
  */
120
- public geodeticToCartesian(lon: number, lat: number, height?: number): Vec3;
95
+ public geodeticToCartesian(lon: number, lat: number, height: number, res: any): Vec3;
121
96
  /**
122
97
  * Gets Wgs84 geodetic coordinates from cartesian ECEF.
123
98
  * @public
@@ -145,30 +120,34 @@ export class Ellipsoid {
145
120
  * @return {Vec3} -
146
121
  */
147
122
  public getSurfaceNormal3v(coord: Vec3): Vec3;
123
+ getGreatCircleDistance(lonLat1: any, lonLat2: any): number;
148
124
  /**
149
- *
150
- * @param {LonLat} lonLat1
151
- * @param {number} [bearing]
152
- * @param {number} [distance]
153
- * @return {LonLat} -
154
- */
155
- getBearingDestination(lonLat1: LonLat, bearing?: number, distance?: number): LonLat;
156
- /**
157
- * Returns the distance from one point to another(using haversine formula) on the great circle.
158
- * @param {LonLat} lonLat1 - Longitude/latitude of source point.
159
- * @param {LonLat} lonLat2 - Longitude/latitude of destination point.
160
- * @return {number} Distance between points.
161
- */
162
- getGreatCircleDistance(lonLat1: LonLat, lonLat2: LonLat): number;
163
- /**
164
- * Calculates the destination point given start point lat / lon, bearing(deg) and distance (m).
165
- *
166
- * Taken from http://movable-type.co.uk/scripts/latlong-vincenty-direct.html and optimized / cleaned up by Mathias Bynens <http://mathiasbynens.be/>
125
+ * Calculates the destination point given start point lat / lon, azimuth(deg) and distance (m).
126
+ * Source: http://movable-type.co.uk/scripts/latlong-vincenty-direct.html and optimized / cleaned up by Mathias Bynens <http://mathiasbynens.be/>
167
127
  * Based on the Vincenty direct formula by T. Vincenty, “Direct and Inverse Solutions of Geodesics on the Ellipsoid with application of nested equations”, Survey Review, vol XXII no 176, 1975 <http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf>
128
+ * @param {LonLat} lonLat - Origin coordinates
129
+ * @param {number} azimuth - View azimuth in degrees
130
+ * @param {number} dist - Distance to the destination point coordinates in meters
131
+ * @returns {LonLat} - Destination point coordinates
132
+ */
133
+ getGreatCircleDestination(lonLat: LonLat, azimuth: number, dist: number): LonLat;
134
+ inverse(lonLat1: any, lonLat2: any): {
135
+ distance: number;
136
+ initialAzimuth: number;
137
+ finalAzimuth: number;
138
+ };
139
+ /**
140
+ * Calculates the destination point given start point lat / lon, azimuth(deg) and distance (m).
141
+ * Source: http://movable-type.co.uk/scripts/latlong-vincenty-direct.html and optimized / cleaned up by Mathias Bynens <http://mathiasbynens.be/>
142
+ * Based on the Vincenty direct formula by T. Vincenty, “Direct and Inverse Solutions of Geodesics on the Ellipsoid with application of nested equations”, Survey Review, vol XXII no 176, 1975 <http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf>
143
+ * @param {LonLat} lonLat - Origin coordinates
144
+ * @param {number} azimuth - View azimuth in degrees
145
+ * @param {number} dist - Distance to the destination point coordinates in meters
146
+ * @returns {LonLat} - Destination point coordinates
168
147
  */
169
- getGreatCircleDestination(lonLat: any, brng: any, dist: any): LonLat;
148
+ direct(lonLat: LonLat, azimuth: number, dist: number): LonLat;
170
149
  /**
171
- * Returns ray vector hit ellipsoid coordinates.
150
+ * Returns cartesian coordinates of the intersection of a ray and an ellipsoid.
172
151
  * If the ray doesn't hit ellipsoid returns null.
173
152
  * @public
174
153
  * @param {Vec3} origin - Ray origin point.
@@ -176,6 +155,16 @@ export class Ellipsoid {
176
155
  * @returns {Vec3} -
177
156
  */
178
157
  public hitRay(origin: Vec3, direction: Vec3): Vec3;
158
+ getNorthFrameRotation(cartesian: any): Quat;
159
+ /**
160
+ * @todo this is not precise function, needs to be replaced or removed
161
+ * @param lonLat1
162
+ * @param bearing
163
+ * @param distance
164
+ * @returns {LonLat}
165
+ */
166
+ getBearingDestination(lonLat1: any, bearing?: number, distance?: number): LonLat;
179
167
  }
180
168
  import { Vec3 } from "../math/Vec3.js";
181
169
  import { LonLat } from "../LonLat.js";
170
+ import { Quat } from "../math/Quat.js";
@@ -56,13 +56,13 @@ export class Entity {
56
56
  * @protected
57
57
  * @type {LonLat}
58
58
  */
59
- protected _lonlat: LonLat;
59
+ protected _lonLat: LonLat;
60
60
  /**
61
61
  * World Mercator entity coordinates.
62
62
  * @protected
63
63
  * @type {LonLat}
64
64
  */
65
- protected _lonlatMerc: LonLat;
65
+ protected _lonLatMerc: LonLat;
66
66
  /**
67
67
  * Entity visible terrain altitude.
68
68
  * @protected
@@ -163,6 +163,7 @@ export class Entity {
163
163
  * @type {Strip}
164
164
  */
165
165
  public strip: Strip;
166
+ get layerIndex(): number;
166
167
  get instanceName(): string;
167
168
  _createOptionFeature(featureName: any, options: any): any;
168
169
  getCollectionIndex(): number;
@@ -112,7 +112,6 @@ export class GeoObject {
112
112
  */
113
113
  public setPickingColor3v(color: og.Vec3): void;
114
114
  updateDirection(): void;
115
- _qNorthFrame: Quat;
115
+ _qNorthFrame: any;
116
116
  }
117
117
  import { Vec3 } from "../math/index.js";
118
- import { Quat } from "../math/index.js";
@@ -44,6 +44,11 @@ export class Geometry {
44
44
  _style: any;
45
45
  _visibility: any;
46
46
  _pickingReady: boolean;
47
+ /**
48
+ * @todo ASAP need test for this method
49
+ * @param geoJson
50
+ * @returns {Geometry}
51
+ */
47
52
  setGeometry(geoJson: any): Geometry;
48
53
  setFillColor(r: any, g: any, b: any, a: any): Geometry;
49
54
  setFillColor4v(rgba: any): Geometry;
@@ -103,7 +103,7 @@ export class Polyline {
103
103
  private _path3v;
104
104
  _pathLengths: any[];
105
105
  /**
106
- * Polyline geodetic degrees coordiantes.
106
+ * Polyline geodetic degrees coordinates.
107
107
  * @private
108
108
  * @type {Array.<LonLat>}
109
109
  */
@@ -58,6 +58,7 @@ export class Ray {
58
58
  * @param {number} z - Z coordinate.
59
59
  */
60
60
  public setStartPosition(x: number, y: number, z: number): void;
61
+ getLength(): any;
61
62
  /**
62
63
  * Sets ray start position.
63
64
  * @public
package/types/index.d.ts CHANGED
@@ -20,6 +20,7 @@ import { Planet } from './scene/Planet.js';
20
20
  import { PlanetCamera } from './camera/index.js';
21
21
  import { Globe } from './Globe.js';
22
22
  import { LightSource } from './light/LightSource.js';
23
+ export const Polyline: typeof entity.Polyline;
23
24
  export const EntityCollection: typeof entity.EntityCollection;
24
25
  export const Handler: typeof webgl.Handler;
25
26
  import { Renderer } from './renderer/Renderer.js';
@@ -33,7 +33,7 @@ export class BaseGeoImage extends Layer {
33
33
  */
34
34
  rendering: (() => void) | (() => void);
35
35
  get isIdle(): boolean;
36
- addTo(planet: any): BaseGeoImage;
36
+ addTo(planet: any): void;
37
37
  _onLoadend_: any;
38
38
  _onLoadend(): void;
39
39
  /**
@@ -37,7 +37,7 @@ export class CanvasTiles extends Layer {
37
37
  * @public
38
38
  */
39
39
  public drawTile: layer.CanvasTiles;
40
- addTo(planet: any): CanvasTiles;
40
+ addTo(planet: any): void;
41
41
  _onLoadend_: any;
42
42
  _onLoadend(): void;
43
43
  get isIdle(): boolean;
@@ -212,7 +212,7 @@ export class Layer {
212
212
  * @public
213
213
  * @param {Planet} planet - Adds layer to the planet.
214
214
  */
215
- public addTo(planet: Planet): Layer;
215
+ public addTo(planet: Planet): void;
216
216
  /**
217
217
  * Removes from planet.
218
218
  * @public
@@ -100,6 +100,7 @@ export class Vector extends Layer {
100
100
  * @returns {layer.Vector} -
101
101
  */
102
102
  public addTo(planet: Planet): layer.Vector;
103
+ remove(): void;
103
104
  /**
104
105
  * Returns stored entities.
105
106
  * @public
@@ -35,6 +35,8 @@ export class Vec3 {
35
35
  static get UNIT_Y(): Vec3;
36
36
  /** @const */
37
37
  static get UNIT_Z(): Vec3;
38
+ /** @const */
39
+ static get NORTH(): Vec3;
38
40
  /**
39
41
  * Separate 63 bit Vec3 to two Vec3 32 bit float values.
40
42
  * @function
package/types/math.d.ts CHANGED
@@ -198,6 +198,13 @@ export function solve_iteration_fixed(f: equationCallback, x0: number, maxIter:
198
198
  * @returns {number} -
199
199
  */
200
200
  export function solve_iteration(f: equationCallback, x0: number, err: number, maxIter?: number): number;
201
+ /**
202
+ * Returns angle between two azimuths
203
+ * @param {number} a - First azimuth angle
204
+ * @param {number} b - Second azimuth angle
205
+ * @returns {number}
206
+ */
207
+ export function getAngleBetweenAzimuths(a: number, b: number): number;
201
208
  /** @const */
202
209
  export const TWO_PI: number;
203
210
  /** @const */
@@ -117,6 +117,8 @@ export class Renderer {
117
117
  _fnScreenFrame: (() => void) | (() => void);
118
118
  labelWorker: LabelWorker;
119
119
  __useDistanceFramebuffer__: boolean;
120
+ enableBlendOneSrcAlpha(): void;
121
+ enableBlendDefault(): void;
120
122
  /**
121
123
  * Sets renderer events activity.
122
124
  * @param {Boolean} activity - Events activity.
@@ -186,6 +188,7 @@ export class Renderer {
186
188
  * @param {control.Control} control - Control.
187
189
  */
188
190
  removeControl(control: control.Control): void;
191
+ isInitialized(): boolean;
189
192
  /**
190
193
  * Renderer initialization.
191
194
  * @public
@@ -208,6 +211,7 @@ export class Renderer {
208
211
  screenFramePositionBuffer: any;
209
212
  outputTexture: any;
210
213
  _pickingMaskCoordinatesBuffer: any;
214
+ _initializeControls(): void;
211
215
  resize(): void;
212
216
  setCurrentScreen(screenName: any): void;
213
217
  _resizeStart(): void;
@@ -219,6 +223,7 @@ export class Renderer {
219
223
  * @param {RenderNode} renderNode - Render node.
220
224
  */
221
225
  public addNode(renderNode: RenderNode): void;
226
+ _initializeRenderNodes(): void;
222
227
  /**
223
228
  * Adds render node to the renderer before specific node.
224
229
  * @public
@@ -273,10 +278,11 @@ export class Renderer {
273
278
  readPickingColor(x: any, y: any, outColor: any): void;
274
279
  readDistanceColor(x: any, y: any, outColor: any): void;
275
280
  /**
276
- * Function starts rendering.
281
+ * Function starts renderer
277
282
  * @public
278
283
  */
279
284
  public start(): void;
285
+ destroy(): void;
280
286
  }
281
287
  import { Camera } from "../camera/Camera.js";
282
288
  import { RendererEvents } from "./RendererEvents.js";