@openglobus/og 0.10.6 → 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 (163) hide show
  1. package/package.json +10 -7
  2. package/src/og/Extent.js +1 -1
  3. package/src/og/LonLat.js +7 -2
  4. package/src/og/Popup.js +2 -1
  5. package/src/og/camera/PlanetCamera.js +4 -2
  6. package/src/og/entity/EntityCollection.js +1 -1
  7. package/src/og/entity/LabelHandler.js +366 -74
  8. package/src/og/entity/Polyline.js +3 -2
  9. package/src/og/layer/KML.js +7 -5
  10. package/src/og/layer/Vector.js +5 -0
  11. package/src/og/layer/index.js +2 -1
  12. package/src/og/math/Vec2.js +448 -448
  13. package/src/og/math/Vec3.js +759 -757
  14. package/src/og/math/Vec4.js +216 -215
  15. package/src/og/scene/Planet.js +14 -4
  16. package/src/og/segment/SegmentLonLat.js +7 -0
  17. package/src/og/terrain/GlobusTerrain.js +4 -0
  18. package/src/og/utils/GeoImageCreator.js +123 -121
  19. package/src/og/utils/Loader.js +81 -80
  20. package/src/og/utils/NormalMapCreator.js +320 -318
  21. package/src/og/utils/VectorTileCreator.js +251 -250
  22. package/src/og/webgl/Framebuffer.js +265 -264
  23. package/src/og/webgl/Handler.js +1022 -1022
  24. package/src/og/webgl/Multisample.js +169 -168
  25. package/src/og/webgl/ProgramController.js +113 -112
  26. package/types/Clock.d.ts +90 -0
  27. package/types/Deferred.d.ts +6 -0
  28. package/types/Events.d.ts +73 -0
  29. package/types/Extent.d.ts +162 -0
  30. package/types/Globe.d.ts +80 -0
  31. package/types/ImageCanvas.d.ts +121 -0
  32. package/types/Lock.d.ts +12 -0
  33. package/types/LonLat.d.ts +108 -0
  34. package/types/Popup.d.ts +38 -0
  35. package/types/QueueArray.d.ts +15 -0
  36. package/types/Rectangle.d.ts +74 -0
  37. package/types/Stack.d.ts +15 -0
  38. package/types/ajax.d.ts +24 -0
  39. package/types/arial.d.ts +48 -0
  40. package/types/astro/astro.d.ts +38 -0
  41. package/types/astro/earth.d.ts +6 -0
  42. package/types/astro/jd.d.ts +254 -0
  43. package/types/bv/Box.d.ts +25 -0
  44. package/types/bv/Sphere.d.ts +32 -0
  45. package/types/bv/index.d.ts +3 -0
  46. package/types/camera/Camera.d.ts +303 -0
  47. package/types/camera/Frustum.d.ts +129 -0
  48. package/types/camera/PlanetCamera.d.ts +222 -0
  49. package/types/camera/index.d.ts +3 -0
  50. package/types/cons.d.ts +40 -0
  51. package/types/control/CompassButton.d.ts +17 -0
  52. package/types/control/Control.d.ts +101 -0
  53. package/types/control/DebugInfo.d.ts +16 -0
  54. package/types/control/EarthCoordinates.d.ts +47 -0
  55. package/types/control/GeoImageDragControl.d.ts +6 -0
  56. package/types/control/KeyboardNavigation.d.ts +22 -0
  57. package/types/control/LayerSwitcher.d.ts +23 -0
  58. package/types/control/Lighting.d.ts +16 -0
  59. package/types/control/ScaleControl.d.ts +22 -0
  60. package/types/control/ShowFps.d.ts +12 -0
  61. package/types/control/SimpleNavigation.d.ts +28 -0
  62. package/types/control/Sun.d.ts +52 -0
  63. package/types/control/ToggleWireframe.d.ts +12 -0
  64. package/types/control/ZoomControl.d.ts +28 -0
  65. package/types/control/index.d.ts +15 -0
  66. package/types/ellipsoid/Ellipsoid.d.ts +142 -0
  67. package/types/ellipsoid/index.d.ts +3 -0
  68. package/types/ellipsoid/wgs84.d.ts +5 -0
  69. package/types/entity/BaseBillboard.d.ts +208 -0
  70. package/types/entity/Billboard.d.ts +94 -0
  71. package/types/entity/BillboardHandler.d.ts +74 -0
  72. package/types/entity/Entity.d.ts +330 -0
  73. package/types/entity/EntityCollection.d.ts +303 -0
  74. package/types/entity/Geometry.d.ts +72 -0
  75. package/types/entity/GeometryHandler.d.ts +76 -0
  76. package/types/entity/Label.d.ts +194 -0
  77. package/types/entity/LabelHandler.d.ts +24 -0
  78. package/types/entity/PointCloud.d.ts +174 -0
  79. package/types/entity/PointCloudHandler.d.ts +38 -0
  80. package/types/entity/Polyline.d.ts +303 -0
  81. package/types/entity/PolylineHandler.d.ts +18 -0
  82. package/types/entity/Ray.d.ts +123 -0
  83. package/types/entity/RayHandler.d.ts +67 -0
  84. package/types/entity/ShapeHandler.d.ts +22 -0
  85. package/types/entity/Strip.d.ts +118 -0
  86. package/types/entity/StripHandler.d.ts +38 -0
  87. package/types/entity/index.d.ts +8 -0
  88. package/types/index.core.d.ts +65 -0
  89. package/types/index.d.ts +45 -0
  90. package/types/index.webgl.d.ts +7 -0
  91. package/types/inherits.d.ts +4 -0
  92. package/types/input/input.d.ts +34 -0
  93. package/types/layer/BaseGeoImage.d.ts +106 -0
  94. package/types/layer/CanvasTiles.d.ts +75 -0
  95. package/types/layer/GeoImage.d.ts +65 -0
  96. package/types/layer/GeoTexture2d.d.ts +8 -0
  97. package/types/layer/GeoVideo.d.ts +80 -0
  98. package/types/layer/KML.d.ts +58 -0
  99. package/types/layer/WMS.d.ts +66 -0
  100. package/types/layer/XYZ.d.ts +126 -0
  101. package/types/layer/index.d.ts +10 -0
  102. package/types/light/LightSource.d.ts +177 -0
  103. package/types/math/Mat3.d.ts +53 -0
  104. package/types/math/Mat4.d.ts +157 -0
  105. package/types/math/Plane.d.ts +17 -0
  106. package/types/math/Vec2.d.ts +308 -0
  107. package/types/math/Vec3.d.ts +459 -0
  108. package/types/math/Vec4.d.ts +161 -0
  109. package/types/math/coder.d.ts +42 -0
  110. package/types/math/index.d.ts +11 -0
  111. package/types/math.d.ts +261 -0
  112. package/types/mercator.d.ts +92 -0
  113. package/types/proj/EPSG3857.d.ts +5 -0
  114. package/types/proj/EPSG4326.d.ts +5 -0
  115. package/types/quadTree/quadTree.d.ts +40 -0
  116. package/types/renderer/RendererEvents.d.ts +230 -0
  117. package/types/res/images.d.ts +3 -0
  118. package/types/scene/Axes.d.ts +11 -0
  119. package/types/scene/BaseNode.d.ts +60 -0
  120. package/types/scene/Planet.d.ts +572 -0
  121. package/types/scene/RenderNode.d.ts +143 -0
  122. package/types/scene/SkyBox.d.ts +10 -0
  123. package/types/scene/index.d.ts +4 -0
  124. package/types/segment/segmentHelper.d.ts +13 -0
  125. package/types/shaders/billboard.d.ts +3 -0
  126. package/types/shaders/depth.d.ts +2 -0
  127. package/types/shaders/drawnode.d.ts +7 -0
  128. package/types/shaders/label.d.ts +4 -0
  129. package/types/shaders/pointCloud.d.ts +2 -0
  130. package/types/shaders/polyline.d.ts +3 -0
  131. package/types/shaders/ray.d.ts +2 -0
  132. package/types/shaders/screenFrame.d.ts +2 -0
  133. package/types/shaders/shape.d.ts +4 -0
  134. package/types/shaders/skybox.d.ts +2 -0
  135. package/types/shaders/toneMapping.d.ts +2 -0
  136. package/types/shapes/BaseShape.d.ts +247 -0
  137. package/types/shapes/Sphere.d.ts +41 -0
  138. package/types/terrain/BilTerrain.d.ts +8 -0
  139. package/types/terrain/EmptyTerrain.d.ts +72 -0
  140. package/types/terrain/Geoid.d.ts +26 -0
  141. package/types/terrain/GlobusTerrain.d.ts +153 -0
  142. package/types/terrain/MapboxTerrain.d.ts +8 -0
  143. package/types/terrain/index.d.ts +5 -0
  144. package/types/utils/FontAtlas.d.ts +14 -0
  145. package/types/utils/GeoImageCreator.d.ts +29 -0
  146. package/types/utils/ImagesCacheManager.d.ts +10 -0
  147. package/types/utils/Loader.d.ts +25 -0
  148. package/types/utils/NormalMapCreator.d.ts +39 -0
  149. package/types/utils/PlainSegmentWorker.d.ts +10 -0
  150. package/types/utils/TerrainWorker.d.ts +9 -0
  151. package/types/utils/TextureAtlas.d.ts +111 -0
  152. package/types/utils/VectorTileCreator.d.ts +16 -0
  153. package/types/utils/colorTable.d.ts +143 -0
  154. package/types/utils/earcut.d.ts +6 -0
  155. package/types/utils/shared.d.ts +230 -0
  156. package/types/webgl/Framebuffer.d.ts +135 -0
  157. package/types/webgl/Handler.d.ts +372 -0
  158. package/types/webgl/Multisample.d.ts +89 -0
  159. package/types/webgl/Program.d.ts +155 -0
  160. package/types/webgl/ProgramController.d.ts +84 -0
  161. package/types/webgl/callbacks.d.ts +1 -0
  162. package/types/webgl/index.d.ts +6 -0
  163. package/types/webgl/types.d.ts +2 -0
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Class represents application timer that stores custom current julian datetime, and time speed multiplier.
3
+ * @class
4
+ * @param {Object} [params]: - Clock parameters:
5
+ * @param {number} [params.startDate=0.0] - Julian start date.
6
+ * @param {number} [params.endDate=0.0] - Julian end date.
7
+ * @param {number} [params.currentDate] - Julian current date. Default: current date.
8
+ * @param {number} [params.multiplier=1.0] - Time speed multiolier.
9
+ */
10
+ export class Clock {
11
+ static set _staticCounter(arg: any);
12
+ static get _staticCounter(): any;
13
+ constructor(params: any);
14
+ _id: number;
15
+ /**
16
+ * Clock name.
17
+ * @public
18
+ * @type {string}
19
+ */
20
+ public name: string;
21
+ /**
22
+ * Clock events.
23
+ * @public
24
+ * @type {Events}
25
+ */
26
+ public events: Events;
27
+ /**
28
+ * Start julian date clock loop.
29
+ * @public
30
+ * @type {number}
31
+ */
32
+ public startDate: number;
33
+ /**
34
+ * End julian date clock loop.
35
+ * @public
36
+ * @type {number}
37
+ */
38
+ public endDate: number;
39
+ /**
40
+ * Current julian datetime.
41
+ * @public
42
+ * @type {number}
43
+ */
44
+ public currentDate: number;
45
+ /**
46
+ * Timer speed multiplier.
47
+ * @public
48
+ * @type {number}
49
+ */
50
+ public multiplier: number;
51
+ /**
52
+ * Animation frame delta time.
53
+ * @public
54
+ * @readonly
55
+ * @type {number}
56
+ */
57
+ public readonly deltaTicks: number;
58
+ /**
59
+ * Timer activity.
60
+ * @public
61
+ * @type {boolean}
62
+ */
63
+ public active: boolean;
64
+ _intervalDelay: number;
65
+ _intervalStart: number;
66
+ _intervalCallback: any;
67
+ clearInterval(): void;
68
+ setInterval(delay: any, callback: any): void;
69
+ /**
70
+ * Sets current clock datetime.
71
+ * @public
72
+ * @param {Object} date - JavaScript Date object.
73
+ */
74
+ public setDate(date: any): void;
75
+ /**
76
+ * Returns current application date.
77
+ * @public
78
+ * @returns {Date} - Current date.
79
+ */
80
+ public getDate(): Date;
81
+ reset(): void;
82
+ _tick(dt: any): void;
83
+ /**
84
+ * @public
85
+ * @param {Clock} clock - Clock instance to compare.
86
+ * @returns {boolean} - Returns true if a clock is the same instance.
87
+ */
88
+ public equal(clock: Clock): boolean;
89
+ }
90
+ import { Events } from "./Events.js";
@@ -0,0 +1,6 @@
1
+ export function Deferred(): void;
2
+ export class Deferred {
3
+ resolve: any;
4
+ reject: any;
5
+ promise: Promise<any>;
6
+ }
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Base events class to handle custom events.
3
+ * @class
4
+ * @param {Array.<string>} [eventNames] - Event names that could be dispatched.
5
+ */
6
+ export class Events {
7
+ static set _staticCounter(arg: any);
8
+ static get _staticCounter(): any;
9
+ constructor(eventNames: any, sender: any);
10
+ /**
11
+ * Registered event names.
12
+ * @protected
13
+ * @type {Array.<string>}
14
+ */
15
+ protected _eventNames: Array<string>;
16
+ _sender: any;
17
+ /**
18
+ * Stop propagation flag
19
+ * @protected
20
+ * @type {boolean}
21
+ */
22
+ protected _stopPropagation: boolean;
23
+ _stampCache: {};
24
+ __id: number;
25
+ bindSender(sender: any): void;
26
+ /**
27
+ * Function that creates event object properties that would be dispatched.
28
+ * @public
29
+ * @param {Array.<string>} eventNames - Specified event names list.
30
+ */
31
+ public registerNames(eventNames: Array<string>): void;
32
+ _getStamp(name: any, id: any, ogid: any): string;
33
+ /**
34
+ * Returns true if event callback has stamped.
35
+ * @protected
36
+ * @param {Object} name - Event identifier.
37
+ * @param {Object} obj - Event callback.
38
+ * @return {boolean} -
39
+ */
40
+ protected _stamp(name: any, obj: any): boolean;
41
+ /**
42
+ * Attach listener.
43
+ * @public
44
+ * @param {string} name - Event name to listen.
45
+ * @param {eventCallback} callback - Event callback function.
46
+ * @param {Object} sender - Event callback function owner.
47
+ */
48
+ public on(name: string, callback: any, sender: any, priority?: number): void;
49
+ /**
50
+ * Stop listening event name with specified callback function.
51
+ * @public
52
+ * @param {string} name - Event name.
53
+ * @param {eventCallback} callback - Attached event callback.
54
+ */
55
+ public off(name: string, callback: any): void;
56
+ /**
57
+ * Dispatch event.
58
+ * @public
59
+ * @param {Object} event - Event instance property that created by event name.
60
+ * @param {Object} [obj] - Event object.
61
+ */
62
+ public dispatch(event: any, ...args: any[]): boolean;
63
+ /**
64
+ * Brakes events propagation.
65
+ * @public
66
+ */
67
+ public stopPropagation(): void;
68
+ /**
69
+ * Removes all events.
70
+ * @public
71
+ */
72
+ public clear(): void;
73
+ }
@@ -0,0 +1,162 @@
1
+ /**
2
+ * Represents geographical coordinates extent.
3
+ * @class
4
+ * @param {og.LonLat} [sw] - South West extent corner coordiantes.
5
+ * @param {og.LonLat} [ne] - North East extent corner coordiantes.
6
+ */
7
+ export class Extent {
8
+ /**
9
+ * Whole mercator extent.
10
+ * @const
11
+ */
12
+ static get FULL_MERC(): Extent;
13
+ /**
14
+ * Degrees extent from north mercator limit to north pole.
15
+ * @const
16
+ */
17
+ static get NORTH_POLE_DEG(): Extent;
18
+ /**
19
+ * Degrees extent from south pole to south mercator limit.
20
+ * @const
21
+ */
22
+ static get SOUTH_POLE_DEG(): Extent;
23
+ /**
24
+ * Creates extent instance from values in array.
25
+ * @static
26
+ * @param {Array.<number>} arr - South west and north east longitude and latidudes packed in array. (exactly 4 entries)
27
+ * @return {og.Extent} Extent object.
28
+ */
29
+ static createFromArray(arr: Array<number>): any;
30
+ /**
31
+ * Creates bound extent instance by coordinate array.
32
+ * @static
33
+ * @param {Array.<og.LonLat>} arr - Coordinate array.
34
+ * @return {og.Extent} Extent object.
35
+ */
36
+ static createByCoordinates(arr: Array<any>): any;
37
+ /**
38
+ * Creates bound extent instance by coordinate array.
39
+ * @static
40
+ * @param {Array.<Array<number,number>>} arr - Coordinate array.
41
+ * @return {og.Extent} Extent object.
42
+ */
43
+ static createByCoordinatesArr(arr: Array<Array<number, number>>): any;
44
+ /**
45
+ * Creates extent by meractor grid tile coordinates.
46
+ * @static
47
+ * @param {number} x -
48
+ * @param {number} y -
49
+ * @param {number} z -
50
+ * @param {number} width -
51
+ * @param {number} height -
52
+ * @returns {og.Extent} -
53
+ */
54
+ static fromTile(x: number, y: number, z: number, width: number, height: number): any;
55
+ constructor(sw: any, ne: any);
56
+ /**
57
+ * @public
58
+ */
59
+ public southWest: any;
60
+ /**
61
+ * @public
62
+ */
63
+ public northEast: any;
64
+ /**
65
+ * Sets current bounding extent object by coordinate array.
66
+ * @public
67
+ * @param {Array.<og.LonLat>} arr - Coordinate array.
68
+ * @return {og.Extent} Current extent.
69
+ */
70
+ public setByCoordinates(arr: Array<any>): any;
71
+ /**
72
+ * Determines if point inside extent.
73
+ * @public
74
+ * @param {LonLat} lonlat - Coordinate point.
75
+ * @return {boolean} Returns true if point inside extent.
76
+ */
77
+ public isInside(lonlat: LonLat): boolean;
78
+ /**
79
+ * Returns true if two extent overlap each other.
80
+ * @public
81
+ * @param {Extent} e - Another extent.
82
+ * @return {boolean} -
83
+ */
84
+ public overlaps(e: Extent): boolean;
85
+ /**
86
+ * Gets extent width.
87
+ * @public
88
+ * @return {number} Extent width.
89
+ */
90
+ public getWidth(): number;
91
+ /**
92
+ * Gets extent height.
93
+ * @public
94
+ * @return {number} Extent height.
95
+ */
96
+ public getHeight(): number;
97
+ /**
98
+ * Creates clone instance of the current extent.
99
+ * @public
100
+ * @return {og.Extent} Extent clone.
101
+ */
102
+ public clone(): any;
103
+ /**
104
+ * Gets the center coordinate of the extent.
105
+ * @public
106
+ * @return {number} Center coordinate.
107
+ */
108
+ public getCenter(): number;
109
+ /**
110
+ * @public
111
+ */
112
+ public getNorthWest(): LonLat;
113
+ /**
114
+ * @public
115
+ */
116
+ public getNorthEast(): LonLat;
117
+ getSouthWest(): LonLat;
118
+ /**
119
+ * @public
120
+ */
121
+ public getSouthEast(): LonLat;
122
+ /**
123
+ * @public
124
+ */
125
+ public getNorth(): any;
126
+ getEast(): any;
127
+ /**
128
+ * @public
129
+ */
130
+ public getWest(): any;
131
+ /**
132
+ * @public
133
+ */
134
+ public getSouth(): any;
135
+ /**
136
+ * Returns extents are equals.
137
+ * @param {og.Extent} extent - Extent.
138
+ * @returns {boolean} -
139
+ */
140
+ equals(extent: any): boolean;
141
+ /**
142
+ * Converts extent coordinates to mercator projection coordinates.
143
+ * @public
144
+ * @return {og.Extent} New instance of the current extent.
145
+ */
146
+ public forwardMercator(): any;
147
+ /**
148
+ * Converts extent coordinates from mercator projection to degrees.
149
+ * @public
150
+ * @return {og.Extent} New instance of the current extent.
151
+ */
152
+ public inverseMercator(): any;
153
+ /**
154
+ * Gets cartesian bounding bounds of the current ellipsoid.
155
+ * @public
156
+ * @param {og.Ellipsoid} ellipsoid - Ellipsoid.
157
+ * @return {Array.<number,number,number,number,number,number>} Cartesian 3d coordinate array.
158
+ */
159
+ public getCartesianBounds(ellipsoid: any): Array<number, number, number, number, number, number>;
160
+ toString(): string;
161
+ }
162
+ import { LonLat } from "./LonLat.js";
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Creates a WebGL context with globe.
3
+ * @class
4
+ *
5
+ * @example <caption>Basic initialization</caption>
6
+ * globus = new og.Globe({
7
+ * 'atmosphere': false,
8
+ * 'target': 'globus',
9
+ * 'name': 'Earth',
10
+ * 'controls': [
11
+ * new og.control.MouseNavigation({ autoActivate: true }),
12
+ * new og.control.KeyboardNavigation({ autoActivate: true }),
13
+ * new og.control.EarthCoordinates({ autoActivate: true, center: false }),
14
+ * new og.control.LayerSwitcher({ autoActivate: true }),
15
+ * new og.control.ZoomControl({ autoActivate: true }),
16
+ * new og.control.TouchNavigation({ autoActivate: true }),
17
+ * new og.control.Sun({ autoActivate: true })
18
+ * ],
19
+ * 'terrain': new og.terrain.GlobusTerrain(),
20
+ * 'layers': [
21
+ * new og.layer.XYZ("OpenStreetMap", { isBaseLayer: true, url: "http://b.tile.openstreetmap.org/{z}/{x}/{y}.png", visibility: true, attribution: 'Data @ <a href="http://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="http://www.openstreetmap.org/copyright">ODbL</a>' })
22
+ * ],
23
+ * 'autoActivate': true
24
+ * });
25
+ *
26
+ * @param {object} options - Options:
27
+ * @param {string} options.target - HTML element id where planet canvas have to be created.
28
+ * @param {og.scene.RenderNode} [options.skybox] - Render skybox. null - default.
29
+ * @param {string} [options.name] - Planet name. Default is unic identifier.
30
+ * @param {og.terrain.Terrain} [options.terrain] - Terrain provider. Default no terrain - og.terrain.EmptyTerrain.
31
+ * @param {Array.<og.control.Control>} [options.controls] - Renderer controls array.
32
+ * @param {Array.<og.Layer>} [options.layers] - Planet layers.
33
+ * @param {og.Extent} [options.viewExtent] - Viewable starting extent.
34
+ * @param {boolean} [options.autoActivate] - Globe rendering auto activation flag. True is default.
35
+ * @param {DOMElement} [options.attributionContainer] - Container for attribution list.
36
+ * @param {Number} [options.maxGridSize] = Maximal segment grid size. 128 is default
37
+ * @param {boolean} [options.useSpecularTexture] - use specular water mask
38
+ * @param {boolean} [options.useNightTexture] - show night cities
39
+ */
40
+ export class Globe {
41
+ static set _staticCounter(arg: any);
42
+ static get _staticCounter(): any;
43
+ constructor(options: any);
44
+ _canvas: HTMLCanvasElement;
45
+ /**
46
+ * Dom element where WebGL canvas creates
47
+ * @public
48
+ * @type {Element}
49
+ */
50
+ public div: Element;
51
+ /**
52
+ * Interface for the renderer context(events, input states, renderer nodes etc.)
53
+ * @public
54
+ * @type {og.Renderer}
55
+ */
56
+ public renderer: any;
57
+ /**
58
+ * Planet node name. Access with this.renderer.<name>
59
+ * @private
60
+ * @type {String}
61
+ */
62
+ private _planetName;
63
+ planet: Planet;
64
+ sun: any;
65
+ _opacityCounter: number;
66
+ _fadeHandler: any;
67
+ _stopHandler: any;
68
+ /**
69
+ * Starts screen brightness fading in effect by the duration time.
70
+ * @public
71
+ */
72
+ public fadeIn(): void;
73
+ /**
74
+ * Starts screen brightness fading out effect by the duration time.
75
+ * @public
76
+ * @param {number} duration - Fadeout duration time.
77
+ */
78
+ public fadeOut(): void;
79
+ }
80
+ import { Planet } from "./scene/Planet.js";
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Usefull class for working with JS canvas object.
3
+ * @class
4
+ * @param {number} [width] - Canvas width. Default 256.
5
+ * @param {number} [height] - Canvas height. Default 256.
6
+ */
7
+ export class ImageCanvas {
8
+ constructor(width: any, height: any);
9
+ /**
10
+ * Canvas object.
11
+ * @protected
12
+ * @type {Object}
13
+ */
14
+ protected _canvas: any;
15
+ /**
16
+ * Canvas context.
17
+ * @protected
18
+ * @type {Object}
19
+ */
20
+ protected _context: any;
21
+ /**
22
+ * Returns canvas object.
23
+ * @public
24
+ * @returns {Object}
25
+ */
26
+ public getCanvas(): any;
27
+ /**
28
+ * Returns canvas context pointer.
29
+ * @public
30
+ * @returns {Object}
31
+ */
32
+ public getContext(): any;
33
+ /**
34
+ * Fills canvas RGBA with zeroes.
35
+ * @public
36
+ */
37
+ public fillEmpty(): void;
38
+ /**
39
+ * Gets canvas pixels RGBA data.
40
+ * @public
41
+ * @returns {Array.<number>}
42
+ */
43
+ public getData(): Array<number>;
44
+ /**
45
+ * Fill the canvas by color.
46
+ * @public
47
+ * @param {string} color - CSS string color.
48
+ */
49
+ public fillColor(color: string): void;
50
+ /**
51
+ * Sets RGBA pixel data.
52
+ * @public
53
+ * @param {Array.<number>} data - Array RGBA data.
54
+ */
55
+ public setData(data: Array<number>): void;
56
+ /**
57
+ * Resize canvas.
58
+ * @public
59
+ * @param {number} width - Width.
60
+ * @param {number} height - Height.
61
+ */
62
+ public resize(width: number, height: number): void;
63
+ /**
64
+ * Draw an image on the canvas.
65
+ * @public
66
+ * @param {Image} img - Draw image.
67
+ * @param {number} [x] - Left top image corner X coordinate on the canvas.
68
+ * @param {number} [y] - Left top image corner Y coordinate on the canvas.
69
+ * @param {number} [width] - Image width slice. Image width is default.
70
+ * @param {number} [height] - Image height slice. Image height is default.
71
+ */
72
+ public drawImage(img: new (width?: number, height?: number) => HTMLImageElement, x?: number, y?: number, width?: number, height?: number): void;
73
+ /**
74
+ * Converts canvas to JS image object.
75
+ * @public
76
+ * @returns {Image}
77
+ */
78
+ public getImage(): new (width?: number, height?: number) => HTMLImageElement;
79
+ /**
80
+ * Get measured text width.
81
+ * @public
82
+ * @param {string} text - Measured text.
83
+ * @returns {number}
84
+ */
85
+ public getTextWidth(text: string): number;
86
+ /**
87
+ * Draw a text on the canvas.
88
+ * @public
89
+ * @param {string} text - Text.
90
+ * @param {number} [x] - Canvas X - coordinate. 0 - default.
91
+ * @param {number} [y] - Canvas Y - coordinate. 0 - default.
92
+ * @param {string} [font] - Font style. 'normal 14px Verdana' - is default.
93
+ * @param {string} [color] - Css font color.
94
+ */
95
+ public drawText(text: string, x?: number, y?: number, font?: string, color?: string): void;
96
+ /**
97
+ * Gets canvas width.
98
+ * @public
99
+ * @returns {number}
100
+ */
101
+ public getWidth(): number;
102
+ /**
103
+ * Gets canvas height.
104
+ * @public
105
+ * @returns {number}
106
+ */
107
+ public getHeight(): number;
108
+ /**
109
+ * Load image to canvas.
110
+ * @public
111
+ * @param {string} url - Image url.
112
+ * @pararm {imageCallback} [callback] - Image onload callback.
113
+ */
114
+ public load(url: string, callback: any): void;
115
+ /**
116
+ * Open canvas image in the new window.
117
+ * @public
118
+ */
119
+ public openImage(): void;
120
+ destroy(): void;
121
+ }
@@ -0,0 +1,12 @@
1
+ export class Lock {
2
+ _lock: number;
3
+ lock(key: any): void;
4
+ free(key: any): void;
5
+ isFree(): boolean;
6
+ isLocked(): boolean;
7
+ }
8
+ export class Key {
9
+ static set _staticCounter(arg: any);
10
+ static get _staticCounter(): any;
11
+ _id: number;
12
+ }
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Represents a geographical point with a certain latitude, longitude and height.
3
+ * @class
4
+ * @param {number} [lon] - Longitude.
5
+ * @param {number} [lat] - Latitude.
6
+ * @param {number} [height] - Height over the surface.
7
+ */
8
+ export class LonLat {
9
+ /**
10
+ * Creates coordinates array.
11
+ * @static
12
+ * @param{Array.<Array<number>>} arr - Coordinates array data. (exactly 3 entries)
13
+ * @return{Array.<og.LonLat>} the same coordinates array but each element is LonLat instance.
14
+ */
15
+ static join(arr: Array<Array<number>>): Array<any>;
16
+ /**
17
+ * Creates an object by coordinate array.
18
+ * @static
19
+ * @param {Array.<number>} arr - Coordiante array, where first is longitude, second is latitude and third is a height. (exactly 3 entries)
20
+ * @returns {og.LonLat} -
21
+ */
22
+ static createFromArray(arr: Array<number>): any;
23
+ /**
24
+ * Converts degrees to mercator coordinates.
25
+ * @static
26
+ * @param {number} lon - Degrees longitude.
27
+ * @param {number} lat - Degrees latitude.
28
+ * @param {number} [height] - Height.
29
+ * @returns {og.LonLat} -
30
+ */
31
+ static forwardMercator(lon: number, lat: number, height?: number): any;
32
+ /**
33
+ * Converts mercator to degrees coordinates.
34
+ * @static
35
+ * @param {number} x - Mercator longitude.
36
+ * @param {number} y - Mercator latitude.
37
+ * @param {number} [height] - Height.
38
+ * @returns {og.LonLat} -
39
+ */
40
+ static inverseMercator(x: number, y: number, height?: number): any;
41
+ /**
42
+ * @param {number} [lon]
43
+ * @param {number} [lat]
44
+ * @param {number} [height]
45
+ */
46
+ constructor(lon?: number, lat?: number, height?: number);
47
+ /**
48
+ * Longitude.
49
+ * @public
50
+ * @type {number}
51
+ */
52
+ public lon: number;
53
+ /**
54
+ * Latitude.
55
+ * @public
56
+ * @type {number}
57
+ */
58
+ public lat: number;
59
+ /**
60
+ * Height.
61
+ * @public
62
+ * @type {number}
63
+ */
64
+ public height: number;
65
+ isZero(): boolean;
66
+ /**
67
+ * Sets coordinates.
68
+ * @public
69
+ * @param {number} [lon] - Longitude.
70
+ * @param {number} [lat] - Latitude.
71
+ * @param {number} [height] - Height.
72
+ * @returns {og.LonLat} -
73
+ */
74
+ public set(lon?: number, lat?: number, height?: number): any;
75
+ /**
76
+ * Copy coordinates.
77
+ * @public
78
+ * @param {og.LonLat} [lonLat] - Coordinates to copy.
79
+ * @returns {og.LonLat} -
80
+ */
81
+ public copy(lonLat?: any): any;
82
+ /**
83
+ * Clone the coordiante.
84
+ * @public
85
+ * @returns {og.LonLat} -
86
+ */
87
+ public clone(): any;
88
+ /**
89
+ * Converts to mercator coordinates.
90
+ * @public
91
+ * @returns {og.LonLat} -
92
+ */
93
+ public forwardMercator(): any;
94
+ forwardMercatorEPS01(): LonLat;
95
+ /**
96
+ * Converts from mercator coordinates.
97
+ * @public
98
+ * @returns {og.LonLat} -
99
+ */
100
+ public inverseMercator(): any;
101
+ /**
102
+ * Compares coordinates.
103
+ * @public
104
+ * @param {og.LonLat} b - Coordinate to compare with.
105
+ * @returns {boolean} -
106
+ */
107
+ public equal(b: any): boolean;
108
+ }
@@ -0,0 +1,38 @@
1
+ export class Popup {
2
+ static set _staticCounter(arg: any);
3
+ static get _staticCounter(): any;
4
+ constructor(options: any);
5
+ _id: number;
6
+ events: Events;
7
+ _template: string;
8
+ el: ChildNode;
9
+ _title: any;
10
+ _content: any;
11
+ _contentEl: any;
12
+ _titleEl: any;
13
+ _planet: any;
14
+ _offset: any;
15
+ _lonLat: any;
16
+ _cartPos: Vec3;
17
+ _visibility: any;
18
+ _renderTemplate(): ChildNode;
19
+ _updatePosition(): void;
20
+ setScreen(p: any): void;
21
+ get clientWidth(): any;
22
+ get clientHeight(): any;
23
+ setOffset(x?: number, y?: number): Popup;
24
+ render(params: any): Popup;
25
+ _tipEl: any;
26
+ setVisibility(visibility: any): Popup;
27
+ getContainer(): any;
28
+ getToolbarContainer(): any;
29
+ show(): Popup;
30
+ hide(): Popup;
31
+ setCartesian3v(cart: any, height?: number): Popup;
32
+ setTitle(html: any): Popup;
33
+ setLonLat(lonLat: any): Popup;
34
+ setContent(content: any): Popup;
35
+ clear(): void;
36
+ }
37
+ import { Events } from "./Events.js";
38
+ import { Vec3 } from "./math/Vec3.js";