@openglobus/og 0.16.2 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) 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 +0 -4
  11. package/src/og/Extent.js +5 -9
  12. package/src/og/Globe.js +92 -55
  13. package/src/og/ImageCanvas.js +12 -5
  14. package/src/og/Lock.js +44 -48
  15. package/src/og/LonLat.js +0 -4
  16. package/src/og/Object3d.js +1 -1
  17. package/src/og/Stack.js +49 -53
  18. package/src/og/astro/earth.js +112 -116
  19. package/src/og/astro/jd.js +514 -518
  20. package/src/og/astro/orbit.js +119 -123
  21. package/src/og/astro/rotation.js +36 -40
  22. package/src/og/bv/Box.js +77 -81
  23. package/src/og/bv/Sphere.js +57 -61
  24. package/src/og/camera/Camera.js +20 -7
  25. package/src/og/camera/PlanetCamera.js +8 -15
  26. package/src/og/control/Atmosphere.js +0 -4
  27. package/src/og/control/Control.js +9 -8
  28. package/src/og/control/DebugInfo.js +0 -4
  29. package/src/og/control/DrawingSwitcher.js +117 -0
  30. package/src/og/control/EarthCoordinates.js +214 -214
  31. package/src/og/control/GeoImageDragControl.js +0 -4
  32. package/src/og/control/KeyboardNavigation.js +0 -4
  33. package/src/og/control/LayerAnimation.js +0 -4
  34. package/src/og/control/LayerSwitcher.js +2 -4
  35. package/src/og/control/Lighting.js +11 -15
  36. package/src/og/control/MouseNavigation.js +0 -4
  37. package/src/og/control/MouseWheelZoomControl.js +0 -4
  38. package/src/og/control/RulerSwitcher.js +0 -4
  39. package/src/og/control/ScaleControl.js +2 -6
  40. package/src/og/control/ShowFps.js +40 -44
  41. package/src/og/control/SimpleNavigation.js +10 -10
  42. package/src/og/control/SimpleSkyBackground.js +0 -4
  43. package/src/og/control/Sun.js +0 -4
  44. package/src/og/control/ToggleWireframe.js +35 -39
  45. package/src/og/control/ZoomControl.js +0 -4
  46. package/src/og/control/drawing/DrawingControl.js +51 -0
  47. package/src/og/control/drawing/LineStringDrawingScene.js +203 -0
  48. package/src/og/control/drawing/PolygonDrawingScene.js +785 -0
  49. package/src/og/control/elevationProfile/ElevationProfile.js +275 -0
  50. package/src/og/control/index.js +5 -1
  51. package/src/og/control/ruler/Ruler.js +0 -4
  52. package/src/og/control/ruler/RulerScene.js +3 -2
  53. package/src/og/control/selection/Selection.js +0 -4
  54. package/src/og/control/selection/SelectionScene.js +2 -4
  55. package/src/og/control/timeline/TimelineControl.js +4 -4
  56. package/src/og/control/timeline/TimelineModel.js +2 -2
  57. package/src/og/control/timeline/TimelineView.js +1 -0
  58. package/src/og/control/visibleExtent/Segment.js +5 -5
  59. package/src/og/control/visibleExtent/drawnode.js +0 -4
  60. package/src/og/ellipsoid/Ellipsoid.js +205 -275
  61. package/src/og/ellipsoid/wgs84.js +0 -4
  62. package/src/og/entity/BaseBillboard.js +375 -379
  63. package/src/og/entity/Billboard.js +0 -4
  64. package/src/og/entity/BillboardHandler.js +0 -4
  65. package/src/og/entity/Entity.js +22 -22
  66. package/src/og/entity/EntityCollection.js +7 -11
  67. package/src/og/entity/GeoObject.js +0 -4
  68. package/src/og/entity/GeoObjectHandler.js +0 -4
  69. package/src/og/entity/Geometry.js +5 -4
  70. package/src/og/entity/GeometryHandler.js +3 -4
  71. package/src/og/entity/Label.js +0 -4
  72. package/src/og/entity/LabelHandler.js +0 -4
  73. package/src/og/entity/PointCloud.js +0 -4
  74. package/src/og/entity/PointCloudHandler.js +122 -126
  75. package/src/og/entity/Polyline.js +4 -6
  76. package/src/og/entity/PolylineHandler.js +104 -108
  77. package/src/og/entity/Ray.js +29 -29
  78. package/src/og/entity/Strip.js +1 -1
  79. package/src/og/index.js +3 -1
  80. package/src/og/input/KeyboardHandler.js +128 -132
  81. package/src/og/input/MouseHandler.js +94 -98
  82. package/src/og/input/TouchHandler.js +59 -63
  83. package/src/og/input/input.js +44 -48
  84. package/src/og/layer/BaseGeoImage.js +5 -8
  85. package/src/og/layer/CanvasTiles.js +0 -4
  86. package/src/og/layer/GeoImage.js +0 -4
  87. package/src/og/layer/GeoTexture2d.js +0 -4
  88. package/src/og/layer/GeoVideo.js +0 -4
  89. package/src/og/layer/KML.js +2 -3
  90. package/src/og/layer/Layer.js +22 -26
  91. package/src/og/layer/Material.js +0 -4
  92. package/src/og/layer/Vector.js +23 -20
  93. package/src/og/layer/WMS.js +182 -186
  94. package/src/og/layer/XYZ.js +0 -4
  95. package/src/og/light/LightSource.js +0 -4
  96. package/src/og/math/Line2.js +28 -32
  97. package/src/og/math/Mat3.js +152 -156
  98. package/src/og/math/Ray.js +0 -4
  99. package/src/og/math/Vec2.js +0 -4
  100. package/src/og/math/Vec3.js +0 -4
  101. package/src/og/math/Vec4.js +0 -4
  102. package/src/og/math/coder.js +104 -104
  103. package/src/og/math.js +39 -7
  104. package/src/og/proj/EPSG3857.js +13 -13
  105. package/src/og/proj/Proj.js +59 -63
  106. package/src/og/quadTree/EPSG4326QuadTreeStrategy.js +1 -0
  107. package/src/og/quadTree/EarthQuadTreeStrategy.js +1 -0
  108. package/src/og/quadTree/EntityCollectionNode.js +12 -16
  109. package/src/og/quadTree/MarsQuadTreeStrategy.js +1 -0
  110. package/src/og/quadTree/QuadTreeStrategy.js +1 -0
  111. package/src/og/quadTree/Wgs84QuadTreeStrategy.js +1 -0
  112. package/src/og/renderer/Renderer.js +109 -22
  113. package/src/og/renderer/RendererEvents.js +0 -4
  114. package/src/og/scene/Axes.js +74 -78
  115. package/src/og/scene/BaseNode.js +0 -4
  116. package/src/og/scene/Planet.js +114 -112
  117. package/src/og/scene/RenderNode.js +11 -3
  118. package/src/og/scene/SkyBox.js +104 -108
  119. package/src/og/segment/Segment.js +8 -4
  120. package/src/og/segment/SegmentLonLat.js +2 -6
  121. package/src/og/segment/segmentHelper.js +229 -225
  122. package/src/og/shaders/billboard.js +0 -4
  123. package/src/og/shaders/drawnode.js +5 -9
  124. package/src/og/shaders/geoObject.js +0 -4
  125. package/src/og/shaders/label.js +0 -4
  126. package/src/og/shaders/pickingMask.js +0 -4
  127. package/src/og/shaders/pointCloud.js +0 -4
  128. package/src/og/shaders/polyline.js +0 -4
  129. package/src/og/shaders/ray.js +0 -4
  130. package/src/og/shaders/skybox.js +0 -4
  131. package/src/og/terrain/EmptyTerrain.js +0 -4
  132. package/src/og/utils/FontAtlas.js +0 -4
  133. package/src/og/utils/GeoImageCreator.js +1 -2
  134. package/src/og/utils/NormalMapCreator.js +8 -9
  135. package/src/og/utils/VectorTileCreator.js +3 -9
  136. package/src/og/utils/shared.js +20 -1
  137. package/src/og/webgl/Framebuffer.js +0 -4
  138. package/src/og/webgl/Handler.js +45 -19
  139. package/src/og/webgl/Multisample.js +0 -4
  140. package/src/og/webgl/Program.js +0 -4
  141. package/src/og/webgl/ProgramController.js +2 -2
  142. package/types/Clock.d.ts +1 -1
  143. package/types/Extent.d.ts +5 -5
  144. package/types/Globe.d.ts +15 -1
  145. package/types/ImageCanvas.d.ts +5 -0
  146. package/types/bv/Box.d.ts +1 -1
  147. package/types/bv/Sphere.d.ts +3 -3
  148. package/types/camera/Camera.d.ts +3 -2
  149. package/types/camera/PlanetCamera.d.ts +4 -4
  150. package/types/control/DrawingSwitcher.d.ts +13 -0
  151. package/types/control/EarthCoordinates.d.ts +1 -1
  152. package/types/control/Lighting.d.ts +8 -8
  153. package/types/control/drawing/DrawingControl.d.ts +14 -0
  154. package/types/control/drawing/LineStringDrawingScene.d.ts +5 -0
  155. package/types/control/drawing/PolygonDrawingScene.d.ts +99 -0
  156. package/types/control/index.d.ts +3 -1
  157. package/types/control/ruler/RulerScene.d.ts +0 -1
  158. package/types/control/selection/SelectionScene.d.ts +0 -1
  159. package/types/ellipsoid/Ellipsoid.d.ts +50 -63
  160. package/types/entity/Entity.d.ts +3 -2
  161. package/types/entity/Geometry.d.ts +5 -0
  162. package/types/entity/Polyline.d.ts +1 -1
  163. package/types/entity/Ray.d.ts +1 -0
  164. package/types/index.d.ts +1 -0
  165. package/types/layer/BaseGeoImage.d.ts +1 -1
  166. package/types/layer/CanvasTiles.d.ts +1 -1
  167. package/types/layer/Layer.d.ts +1 -1
  168. package/types/layer/Vector.d.ts +1 -0
  169. package/types/math.d.ts +7 -0
  170. package/types/renderer/Renderer.d.ts +7 -1
  171. package/types/scene/Axes.d.ts +0 -1
  172. package/types/scene/Planet.d.ts +26 -24
  173. package/types/scene/RenderNode.d.ts +2 -0
  174. package/types/scene/SkyBox.d.ts +0 -1
  175. package/types/segment/Segment.d.ts +3 -2
  176. package/types/segment/SegmentLonLat.d.ts +0 -1
  177. package/types/utils/GeoImageCreator.d.ts +1 -1
  178. package/types/utils/NormalMapCreator.d.ts +1 -1
  179. package/types/utils/VectorTileCreator.d.ts +2 -2
  180. package/types/utils/shared.d.ts +2 -0
  181. package/types/webgl/Handler.d.ts +6 -4
@@ -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;
@@ -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,14 @@ export class Ellipsoid {
176
155
  * @returns {Vec3} -
177
156
  */
178
157
  public hitRay(origin: Vec3, direction: Vec3): Vec3;
158
+ /**
159
+ * @todo this is not precise function, needs to be replaced or removed
160
+ * @param lonLat1
161
+ * @param bearing
162
+ * @param distance
163
+ * @returns {LonLat}
164
+ */
165
+ getBearingDestination(lonLat1: any, bearing?: number, distance?: number): LonLat;
179
166
  }
180
167
  import { Vec3 } from "../math/Vec3.js";
181
168
  import { LonLat } from "../LonLat.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;
@@ -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
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";
@@ -3,7 +3,6 @@ export class Axes extends RenderNode {
3
3
  size: any;
4
4
  axesBuffer: any;
5
5
  axesColorBuffer: any;
6
- init(): void;
7
6
  createAxisBuffer(gridSize: any): void;
8
7
  axisBuffer: any;
9
8
  axisColorBuffer: any;
@@ -79,14 +79,14 @@ export class Planet extends RenderNode {
79
79
  * @type {Terrain}
80
80
  */
81
81
  public _terrainPool: Terrain;
82
+ _minAltitude: any;
83
+ _maxAltitude: any;
82
84
  /**
83
85
  * Camera is this.renderer.activeCamera pointer.
84
86
  * @public
85
87
  * @type {PlanetCamera}
86
88
  */
87
89
  public camera: PlanetCamera;
88
- _minAltitude: any;
89
- _maxAltitude: any;
90
90
  maxEqualZoomAltitude: any;
91
91
  minEqualZoomAltitude: any;
92
92
  minEqualZoomCameraSlope: any;
@@ -112,6 +112,7 @@ export class Planet extends RenderNode {
112
112
  */
113
113
  public maxCurrZoom: number;
114
114
  _viewExtent: Extent;
115
+ _initialViewExtent: Extent;
115
116
  /**
116
117
  * @protected
117
118
  */
@@ -153,11 +154,6 @@ export class Planet extends RenderNode {
153
154
  * @type {idle.Lock}
154
155
  */
155
156
  public terrainLock: idle.Lock;
156
- /**
157
- * Layer's transparent colors.
158
- * @protected
159
- */
160
- protected _tcolorArr: any[];
161
157
  /**
162
158
  * Height scale factor. 1 - is normal elevation scale.
163
159
  * @protected
@@ -228,11 +224,21 @@ export class Planet extends RenderNode {
228
224
  /**
229
225
  * GeoImage creator.
230
226
  * @protected
231
- * @type{utils.GeoImageCreator}
227
+ * @type{GeoImageCreator}
232
228
  */
233
- protected _geoImageCreator: utils.GeoImageCreator;
234
- _vectorTileCreator: VectorTileCreator;
235
- _normalMapCreator: NormalMapCreator;
229
+ protected _geoImageCreator: GeoImageCreator;
230
+ /**
231
+ * VectorTileCreator creator.
232
+ * @protected
233
+ * @type{VectorTileCreator}
234
+ */
235
+ protected _vectorTileCreator: VectorTileCreator;
236
+ /**
237
+ * NormalMapCreator creator.
238
+ * @protected
239
+ * @type{NormalMapCreator}
240
+ */
241
+ protected _normalMapCreator: NormalMapCreator;
236
242
  _terrainWorker: TerrainWorker;
237
243
  _plainSegmentWorker: PlainSegmentWorker;
238
244
  _tileLoader: Loader;
@@ -352,11 +358,7 @@ export class Planet extends RenderNode {
352
358
  */
353
359
  protected _initializeShaders(): void;
354
360
  _onLayerLoadend(layer: any): void;
355
- /**
356
- * @virtual
357
- * @public
358
- */
359
- public init(): void;
361
+ initLayers(): void;
360
362
  clearIndexesCache(): void;
361
363
  _preRender(): void;
362
364
  _preLoad(): void;
@@ -401,7 +403,6 @@ export class Planet extends RenderNode {
401
403
  _checkRendercompleted(): void;
402
404
  lockQuadTree(): void;
403
405
  unlockQuadTree(): void;
404
- _firstPASS(): void;
405
406
  _renderScreenNodesPASSNoAtmos(): void;
406
407
  /**
407
408
  * @protected
@@ -476,9 +477,9 @@ export class Planet extends RenderNode {
476
477
  * @param {Boolean} [force=false] - Force framebuffer rendering.
477
478
  * @returns {LonLat} -
478
479
  */
479
- public getLonLatFromPixelTerrain(px: Vec2, force?: boolean): LonLat;
480
+ public getLonLatFromPixelTerrain(px: Vec2): LonLat;
480
481
  /**
481
- * Returns projected 2d screen coordinates by 3d cartesian coordiantes.
482
+ * Returns projected 2d screen coordinates by 3d cartesian coordinates.
482
483
  * @public
483
484
  * @param {Vec3} coords - Cartesian coordinates.
484
485
  * @returns {Vec2} -
@@ -493,15 +494,15 @@ export class Planet extends RenderNode {
493
494
  public getPixelFromLonLat(lonlat: LonLat): Vec2;
494
495
  /**
495
496
  * Returns distance from active camera to the the planet ellipsoid
496
- * coordiantes unprojected by 2d screen coordiantes, or null if screen coordinates outside the planet.
497
+ * coordinates unprojected by 2d screen coordinates, or null if screen coordinates outside the planet.
497
498
  * @public
498
499
  * @param {Vec2} px - Screen coordinates.
499
500
  * @returns {number} -
500
501
  */
501
502
  public getDistanceFromPixelEllipsoid(px: Vec2): number;
502
503
  /**
503
- * Returns distance from active camera to the the relief planet coordiantes unprojected
504
- * by 2d screen coordiantes, or null if screen coordinates outside the planet.
504
+ * Returns distance from active camera to the the relief planet coordinates unprojected
505
+ * by 2d screen coordinates, or null if screen coordinates outside the planet.
505
506
  * If screen coordinates inside the planet but relief is not exists in the
506
507
  * point than function returns distance to the planet ellipsoid.
507
508
  * @public
@@ -550,7 +551,7 @@ export class Planet extends RenderNode {
550
551
  /**
551
552
  * Fly camera to the new point.
552
553
  * @public
553
- * @param {Vec3} cartesian - Fly coordiantes.
554
+ * @param {Vec3} cartesian - Fly coordinates.
554
555
  * @param {Vec3} [look] - Camera "look at" point.
555
556
  * @param {Vec3} [up] - Camera UP vector on the end of a flying.
556
557
  * @param {Number} [ampl] - Altitude amplitude factor.
@@ -562,7 +563,7 @@ export class Planet extends RenderNode {
562
563
  /**
563
564
  * Fly camera to the new geographical position.
564
565
  * @public
565
- * @param {LonLat} lonlat - Fly geographical coordiantes.
566
+ * @param {LonLat} lonlat - Fly geographical coordinates.
566
567
  * @param {Vec3} [look] - Camera "look at" point on the end of a flying.
567
568
  * @param {Vec3} [up] - Camera UP vector on the end of a flying.
568
569
  * @param {Number} [ampl] - Altitude amplitude factor.
@@ -584,6 +585,7 @@ import { RenderNode } from "./RenderNode.js";
584
585
  import { PlanetCamera } from "../camera/PlanetCamera.js";
585
586
  import { Vec3 } from "../math/index.js";
586
587
  import { Extent } from "../Extent.js";
588
+ import { GeoImageCreator } from "../utils/GeoImageCreator.js";
587
589
  import { VectorTileCreator } from "../utils/VectorTileCreator.js";
588
590
  import { NormalMapCreator } from "../utils/NormalMapCreator.js";
589
591
  import { TerrainWorker } from "../utils/TerrainWorker.js";
@@ -52,6 +52,8 @@ export class RenderNode extends BaseNode {
52
52
  * @param {Renderer} renderer - Redner node's renderer.
53
53
  */
54
54
  public assign(renderer: Renderer): void;
55
+ initialize(): void;
56
+ init(): void;
55
57
  onremove(): void;
56
58
  remove(): void;
57
59
  /**
@@ -4,7 +4,6 @@ export class SkyBox extends RenderNode {
4
4
  params: any;
5
5
  vertexPositionBuffer: any;
6
6
  texture: any;
7
- init(): void;
8
7
  _createBuffers(): void;
9
8
  }
10
9
  import { RenderNode } from './RenderNode.js';
@@ -161,13 +161,14 @@ export class Segment {
161
161
  * @returns {Vec3} -
162
162
  */
163
163
  public getEntityTerrainPoint(entity: Entity, res: Vec3): Vec3;
164
- isEntityInside(e: any): boolean;
164
+ getInsideLonLat(obj: any): any;
165
+ isEntityInside(entity: any): boolean;
165
166
  /**
166
167
  * Returns distance from object to terrain coordinates and terrain point that calculates out in the res parameter.
167
168
  * @public
168
169
  * @param {Vec3} xyz - Cartesian object position.
169
170
  * @param {LonLat} insideSegmentPosition - Geodetic object position.
170
- * @param {Vec3} [res] - Result cartesian coordiantes on the terrain.
171
+ * @param {Vec3} [res] - Result cartesian coordinates on the terrain.
171
172
  * @param {Vec3} [normal] - Terrain point normal.
172
173
  * @returns {number} -
173
174
  */
@@ -12,7 +12,6 @@ export class SegmentLonLat extends Segment {
12
12
  _extentMerc: Extent;
13
13
  _isNorth: boolean;
14
14
  projectNative(coords: any): any;
15
- getTerrainPoint(xyz: any, insideSegmentPosition: any, res: any, normal: any): number;
16
15
  _getMaxZoom(): number;
17
16
  _assignTileXIndexes(extent: any): void;
18
17
  _assignTileYIndexes(extent: any): void;
@@ -9,7 +9,7 @@ export class GeoImageCreator {
9
9
  _currentFrame: number;
10
10
  _queue: any[];
11
11
  _animate: any[];
12
- _initialize(): void;
12
+ init(): void;
13
13
  /**
14
14
  * Creates geoImage corners coordinates grid buffer.
15
15
  * @public
@@ -13,7 +13,7 @@ export class NormalMapCreator {
13
13
  _height: any;
14
14
  _queue: QueueArray;
15
15
  _lock: Lock;
16
- _init(): void;
16
+ init(): void;
17
17
  _drawNormalMapBlur(segment: any): boolean;
18
18
  _drawNormalMapNoBlur(segment: any): boolean;
19
19
  _drawNormalMap(segment: any): boolean;
@@ -2,11 +2,11 @@ export class VectorTileCreator {
2
2
  constructor(planet: any, width?: number, height?: number);
3
3
  _width: number;
4
4
  _height: number;
5
- _handler: any;
6
5
  _planet: any;
7
6
  _framebuffer: Framebuffer;
8
7
  _queue: any[];
9
- _initialize(): void;
8
+ init(): void;
9
+ _handler: any;
10
10
  frame(): void;
11
11
  add(material: any): void;
12
12
  remove(material: any): void;
@@ -227,6 +227,8 @@ export function loadImage(url: string): Promise<new (width?: number, height?: nu
227
227
  * @returns {boolean} Returns true is the image is loaded
228
228
  */
229
229
  export function isImageLoaded(image: HTMLImageElement): boolean;
230
+ export function distanceFormat(v: any): string;
231
+ export function getUrlParam(paramName: any): number;
230
232
  export namespace castType {
231
233
  function string(v: any): any;
232
234
  function date(v: any): any;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * A WebGL handler for accessing low-level WebGL capabilities.
3
3
  * @class
4
- * @param {string} id - Canvas element id that WebGL handler assing with. If it's null
4
+ * @param {string | HTMLCanvasElement} canvasTarget - Canvas element target.
5
5
  * or undefined creates hidden canvas and handler bacomes hidden.
6
6
  * @param {Object} [params] - Handler options:
7
7
  * @param {number} [params.anisotropy] - Anisotropy filter degree. 8 is default.
@@ -24,7 +24,7 @@ export class Handler {
24
24
  * @returns {Object} -
25
25
  */
26
26
  static getContext(canvas: any, contextAttributes?: any): any;
27
- constructor(id: any, params?: {});
27
+ constructor(canvasTarget: any, params?: {});
28
28
  events: Events;
29
29
  /**
30
30
  * Application default timer.
@@ -83,11 +83,11 @@ export class Handler {
83
83
  */
84
84
  public extensions: any;
85
85
  /**
86
- * HTML Canvas object id.
86
+ * HTML Canvas target.
87
87
  * @private
88
88
  * @type {Object}
89
89
  */
90
- private _id;
90
+ private _canvasTarget;
91
91
  _lastAnimationFrameTime: number;
92
92
  _initialized: boolean;
93
93
  /**
@@ -107,6 +107,8 @@ export class Handler {
107
107
  };
108
108
  createTextureDefault: any;
109
109
  ONCANVASRESIZE: any;
110
+ isInitialized(): boolean;
111
+ _createCanvas(): void;
110
112
  /**
111
113
  * Sets animation frame function.
112
114
  * @public