@openglobus/og 0.11.8 → 0.12.4

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/css/og.css +2 -0
  2. package/dist/@openglobus/og.css +1 -0
  3. package/dist/@openglobus/og.esm.js +21 -0
  4. package/dist/@openglobus/og.esm.js.map +1 -0
  5. package/dist/@openglobus/og.umd.js +21 -0
  6. package/dist/@openglobus/og.umd.js.map +1 -0
  7. package/package.json +11 -11
  8. package/src/og/Globe.js +18 -6
  9. package/src/og/camera/Camera.js +70 -79
  10. package/src/og/camera/PlanetCamera.js +25 -30
  11. package/src/og/control/DebugInfo.js +2 -2
  12. package/src/og/control/EarthNavigation.js +26 -17
  13. package/src/og/control/MouseNavigation.js +11 -13
  14. package/src/og/control/MouseWheelZoomControl.js +5 -5
  15. package/src/og/control/Sun.js +3 -3
  16. package/src/og/entity/Entity.js +742 -742
  17. package/src/og/entity/GeoObjectHandler.js +138 -134
  18. package/src/og/entity/LabelHandler.js +2 -1
  19. package/src/og/layer/CanvasTiles.js +8 -11
  20. package/src/og/layer/KML.js +19 -12
  21. package/src/og/layer/Layer.js +9 -2
  22. package/src/og/layer/XYZ.js +27 -28
  23. package/src/og/math/Vec3.js +18 -2
  24. package/src/og/quadTree/Node.js +48 -93
  25. package/src/og/quadTree/quadTree.js +1 -1
  26. package/src/og/renderer/Renderer.js +3 -5
  27. package/src/og/scene/Planet.js +147 -127
  28. package/src/og/segment/Segment.js +63 -136
  29. package/src/og/shaders/drawnode.js +132 -221
  30. package/src/og/shaders/geoObject.js +15 -6
  31. package/src/og/terrain/EmptyTerrain.js +3 -2
  32. package/src/og/terrain/GlobusTerrain.js +2 -0
  33. package/src/og/utils/Loader.js +1 -1
  34. package/src/og/utils/PlainSegmentWorker.js +0 -13
  35. package/src/og/webgl/Handler.js +13 -9
  36. package/types/Clock.d.ts +94 -0
  37. package/types/Deferred.d.ts +6 -0
  38. package/types/Events.d.ts +77 -0
  39. package/types/Extent.d.ts +166 -0
  40. package/types/Globe.d.ts +85 -0
  41. package/types/ImageCanvas.d.ts +123 -0
  42. package/types/Lock.d.ts +12 -0
  43. package/types/LonLat.d.ts +108 -0
  44. package/types/Popup.d.ts +42 -0
  45. package/types/QueueArray.d.ts +19 -0
  46. package/types/Rectangle.d.ts +80 -0
  47. package/types/Stack.d.ts +19 -0
  48. package/types/ajax.d.ts +24 -0
  49. package/types/arial.d.ts +48 -0
  50. package/types/astro/astro.d.ts +38 -0
  51. package/types/astro/earth.d.ts +7 -0
  52. package/types/astro/jd.d.ts +254 -0
  53. package/types/bv/Box.d.ts +30 -0
  54. package/types/bv/Sphere.d.ts +38 -0
  55. package/types/bv/index.d.ts +3 -0
  56. package/types/camera/Camera.d.ts +312 -0
  57. package/types/camera/Frustum.d.ts +133 -0
  58. package/types/camera/PlanetCamera.d.ts +219 -0
  59. package/types/camera/index.d.ts +3 -0
  60. package/types/cons.d.ts +40 -0
  61. package/types/control/CompassButton.d.ts +17 -0
  62. package/types/control/Control.d.ts +104 -0
  63. package/types/control/DebugInfo.d.ts +15 -0
  64. package/types/control/EarthCoordinates.d.ts +47 -0
  65. package/types/control/EarthNavigation.d.ts +43 -0
  66. package/types/control/GeoImageDragControl.d.ts +6 -0
  67. package/types/control/KeyboardNavigation.d.ts +21 -0
  68. package/types/control/LayerSwitcher.d.ts +21 -0
  69. package/types/control/Lighting.d.ts +16 -0
  70. package/types/control/MouseNavigation.d.ts +48 -0
  71. package/types/control/MouseWheelZoomControl.d.ts +45 -0
  72. package/types/control/ScaleControl.d.ts +22 -0
  73. package/types/control/ShowFps.d.ts +11 -0
  74. package/types/control/SimpleNavigation.d.ts +25 -0
  75. package/types/control/Sun.d.ts +50 -0
  76. package/types/control/ToggleWireframe.d.ts +12 -0
  77. package/types/control/TouchNavigation.d.ts +48 -0
  78. package/types/control/ZoomControl.d.ts +27 -0
  79. package/types/control/index.d.ts +18 -0
  80. package/types/ellipsoid/Ellipsoid.d.ts +146 -0
  81. package/types/ellipsoid/index.d.ts +3 -0
  82. package/types/ellipsoid/wgs84.d.ts +6 -0
  83. package/types/entity/BaseBillboard.d.ts +215 -0
  84. package/types/entity/Billboard.d.ts +94 -0
  85. package/types/entity/BillboardHandler.d.ts +79 -0
  86. package/types/entity/Entity.d.ts +348 -0
  87. package/types/entity/EntityCollection.d.ts +317 -0
  88. package/types/entity/GeoObject.d.ts +111 -0
  89. package/types/entity/GeoObjectHandler.d.ts +81 -0
  90. package/types/entity/Geometry.d.ts +74 -0
  91. package/types/entity/GeometryHandler.d.ts +76 -0
  92. package/types/entity/Label.d.ts +189 -0
  93. package/types/entity/LabelHandler.d.ts +31 -0
  94. package/types/entity/LabelWorker.d.ts +11 -0
  95. package/types/entity/PointCloud.d.ts +174 -0
  96. package/types/entity/PointCloudHandler.d.ts +38 -0
  97. package/types/entity/Polyline.d.ts +306 -0
  98. package/types/entity/PolylineHandler.d.ts +18 -0
  99. package/types/entity/Ray.d.ts +124 -0
  100. package/types/entity/RayHandler.d.ts +67 -0
  101. package/types/entity/ShapeHandler.d.ts +22 -0
  102. package/types/entity/Strip.d.ts +119 -0
  103. package/types/entity/StripHandler.d.ts +38 -0
  104. package/types/entity/index.d.ts +8 -0
  105. package/types/index.core.d.ts +65 -0
  106. package/types/index.d.ts +45 -0
  107. package/types/index.webgl.d.ts +7 -0
  108. package/types/input/KeyboardHandler.d.ts +10 -0
  109. package/types/input/MouseHandler.d.ts +5 -0
  110. package/types/input/TouchHandler.d.ts +5 -0
  111. package/types/input/input.d.ts +34 -0
  112. package/types/layer/BaseGeoImage.d.ts +94 -0
  113. package/types/layer/CanvasTiles.d.ts +67 -0
  114. package/types/layer/GeoImage.d.ts +52 -0
  115. package/types/layer/GeoTexture2d.d.ts +8 -0
  116. package/types/layer/GeoVideo.d.ts +55 -0
  117. package/types/layer/KML.d.ts +68 -0
  118. package/types/layer/Layer.d.ts +311 -0
  119. package/types/layer/Material.d.ts +45 -0
  120. package/types/layer/Vector.d.ts +208 -0
  121. package/types/layer/WMS.d.ts +61 -0
  122. package/types/layer/XYZ.d.ts +119 -0
  123. package/types/layer/index.d.ts +10 -0
  124. package/types/light/LightSource.d.ts +178 -0
  125. package/types/math/Line2.d.ts +11 -0
  126. package/types/math/Line3.d.ts +10 -0
  127. package/types/math/Mat3.d.ts +65 -0
  128. package/types/math/Mat4.d.ts +176 -0
  129. package/types/math/Plane.d.ts +18 -0
  130. package/types/math/Quat.d.ts +379 -0
  131. package/types/math/Ray.d.ts +82 -0
  132. package/types/math/Vec2.d.ts +309 -0
  133. package/types/math/Vec3.d.ts +467 -0
  134. package/types/math/Vec4.d.ts +162 -0
  135. package/types/math/coder.d.ts +43 -0
  136. package/types/math/index.d.ts +11 -0
  137. package/types/math.d.ts +261 -0
  138. package/types/mercator.d.ts +92 -0
  139. package/types/proj/EPSG3857.d.ts +6 -0
  140. package/types/proj/EPSG4326.d.ts +6 -0
  141. package/types/proj/Proj.d.ts +42 -0
  142. package/types/quadTree/EntityCollectionNode.d.ts +34 -0
  143. package/types/quadTree/Node.d.ts +60 -0
  144. package/types/quadTree/quadTree.d.ts +40 -0
  145. package/types/renderer/Renderer.d.ts +290 -0
  146. package/types/renderer/RendererEvents.d.ts +237 -0
  147. package/types/res/images.d.ts +3 -0
  148. package/types/scene/Axes.d.ts +11 -0
  149. package/types/scene/BaseNode.d.ts +60 -0
  150. package/types/scene/Planet.d.ts +576 -0
  151. package/types/scene/RenderNode.d.ts +142 -0
  152. package/types/scene/SkyBox.d.ts +10 -0
  153. package/types/scene/index.d.ts +4 -0
  154. package/types/segment/Segment.d.ts +275 -0
  155. package/types/segment/SegmentLonLat.d.ts +17 -0
  156. package/types/segment/Slice.d.ts +10 -0
  157. package/types/segment/segmentHelper.d.ts +13 -0
  158. package/types/shaders/billboard.d.ts +3 -0
  159. package/types/shaders/depth.d.ts +2 -0
  160. package/types/shaders/drawnode.d.ts +7 -0
  161. package/types/shaders/geoObject.d.ts +3 -0
  162. package/types/shaders/label.d.ts +4 -0
  163. package/types/shaders/pointCloud.d.ts +2 -0
  164. package/types/shaders/polyline.d.ts +3 -0
  165. package/types/shaders/ray.d.ts +2 -0
  166. package/types/shaders/screenFrame.d.ts +2 -0
  167. package/types/shaders/shape.d.ts +4 -0
  168. package/types/shaders/skybox.d.ts +2 -0
  169. package/types/shaders/toneMapping.d.ts +2 -0
  170. package/types/shapes/BaseShape.d.ts +250 -0
  171. package/types/shapes/Sphere.d.ts +41 -0
  172. package/types/terrain/BilTerrain.d.ts +7 -0
  173. package/types/terrain/EmptyTerrain.d.ts +73 -0
  174. package/types/terrain/Geoid.d.ts +26 -0
  175. package/types/terrain/GlobusTerrain.d.ts +116 -0
  176. package/types/terrain/MapboxTerrain.d.ts +7 -0
  177. package/types/terrain/index.d.ts +5 -0
  178. package/types/utils/FontAtlas.d.ts +15 -0
  179. package/types/utils/GeoImageCreator.d.ts +30 -0
  180. package/types/utils/ImagesCacheManager.d.ts +10 -0
  181. package/types/utils/Loader.d.ts +25 -0
  182. package/types/utils/NormalMapCreator.d.ts +39 -0
  183. package/types/utils/PlainSegmentWorker.d.ts +10 -0
  184. package/types/utils/TerrainWorker.d.ts +9 -0
  185. package/types/utils/TextureAtlas.d.ts +111 -0
  186. package/types/utils/VectorTileCreator.d.ts +16 -0
  187. package/types/utils/colorTable.d.ts +143 -0
  188. package/types/utils/earcut.d.ts +6 -0
  189. package/types/utils/shared.d.ts +231 -0
  190. package/types/webgl/Framebuffer.d.ts +135 -0
  191. package/types/webgl/Handler.d.ts +417 -0
  192. package/types/webgl/Multisample.d.ts +89 -0
  193. package/types/webgl/Program.d.ts +161 -0
  194. package/types/webgl/ProgramController.d.ts +89 -0
  195. package/types/webgl/callbacks.d.ts +1 -0
  196. package/types/webgl/index.d.ts +6 -0
  197. package/types/webgl/types.d.ts +2 -0
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Used to load and display a video stream by specific corners coordinates on the globe, implements og.layer.BaseGeoImage interface.
3
+ * @class
4
+ * @extends {BaseGeoImage}
5
+ */
6
+ export class GeoVideo extends BaseGeoImage {
7
+ /**
8
+ * HTML5 video element object.
9
+ * @private
10
+ * @type {Object}
11
+ */
12
+ private _video;
13
+ /**
14
+ * VIdeo source url path.
15
+ * @private
16
+ * @type {String}
17
+ */
18
+ private _src;
19
+ /**
20
+ * Sets video source url path.
21
+ * @public
22
+ * @param {String} srs - Video url path.
23
+ */
24
+ public setSrc(src: any): void;
25
+ /**
26
+ * Sets HTML5 video object.
27
+ * @public
28
+ * @param {Object} video - HTML5 video element object.
29
+ */
30
+ public setVideoElement(video: any): void;
31
+ /**
32
+ * Creates or refresh source video GL texture.
33
+ * @virtual
34
+ * @protected
35
+ */
36
+ protected _createSourceTexture(): void;
37
+ /**
38
+ * @private
39
+ */
40
+ private _onCanPlay;
41
+ /**
42
+ * @private
43
+ */
44
+ private _onError;
45
+ /**
46
+ * Loads planet segment material. In this case - GeoImage source video.
47
+ * @virtual
48
+ * @public
49
+ * @param {Material} material - GeoImage planet material.
50
+ */
51
+ public loadMaterial(material: Material): void;
52
+ _renderingProjType1(): void;
53
+ _renderingProjType0(): void;
54
+ }
55
+ import { BaseGeoImage } from "./BaseGeoImage.js";
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Layer to render KMLs files
3
+ * @class
4
+ * @extends {Vector}
5
+ */
6
+ export class KML extends Vector {
7
+ _billboard: any;
8
+ /**
9
+ * @type {string}
10
+ */
11
+ _color: string;
12
+ /**
13
+ * @private
14
+ */
15
+ private _extractCoordonatesFromKml;
16
+ /**
17
+ * Creates billboards or polylines from array of lonlat.
18
+ * @private
19
+ * @param {Array} coordonates
20
+ * @param {string} color
21
+ * @returns {Array<Entity>}
22
+ */
23
+ private _convertCoordonatesIntoEntities;
24
+ /**
25
+ * @private
26
+ * @returns {Document}
27
+ */
28
+ private _getXmlContent;
29
+ /**
30
+ * @private
31
+ */
32
+ private _expandExtents;
33
+ /**
34
+ * @public
35
+ * @param {File[]} kmls
36
+ * @param {string} [color]
37
+ * @param {Billboard} [billboard]
38
+ * @returns {Promise<{entities: Entity[], extent: Extent}>}
39
+ */
40
+ public addKmlFromFiles(kmls: File[], color?: string, billboard?: Billboard): Promise<{
41
+ entities: Entity[];
42
+ extent: Extent;
43
+ }>;
44
+ /**
45
+ * @param {string} color
46
+ * @public
47
+ */
48
+ public setColor(color: string): void;
49
+ /**
50
+ * @private
51
+ */
52
+ private _getKmlFromUrl;
53
+ /**
54
+ * @public
55
+ * @param {string} url - Url of the KML to display. './myFile.kml' or 'http://mySite/myFile.kml' for example.
56
+ * @param {string} [color]
57
+ * @param {Billboard} [billboard]
58
+ * @returns {Promise<{entities: Entity[], extent: Extent}>}
59
+ */
60
+ public addKmlFromUrl(url: string, color?: string, billboard?: Billboard): Promise<{
61
+ entities: Entity[];
62
+ extent: Extent;
63
+ }>;
64
+ }
65
+ import { Vector } from "./Vector.js";
66
+ import { Billboard } from "../entity/Billboard.js";
67
+ import { Entity } from "../entity/Entity.js";
68
+ import { Extent } from "../Extent.js";
@@ -0,0 +1,311 @@
1
+ export const FADING_FACTOR: 0.29;
2
+ /**
3
+ * @classdesc
4
+ * Base class; normally only used for creating subclasses and not instantiated in apps.
5
+ * A visual representation of raster or vector map data well known as a layer.
6
+ * @class
7
+ * @param {String} [name="noname"] - Layer name.
8
+ * @param {Object} [options] - Layer options:
9
+ * @param {number} [options.opacity=1.0] - Layer opacity.
10
+ * @param {number} [options.minZoom=0] - Minimal visibility zoom level.
11
+ * @param {number} [options.maxZoom=0] - Maximal visibility zoom level.
12
+ * @param {string} [options.attribution] - Layer attribution that displayed in the attribution area on the screen.
13
+ * @param {boolean} [options.isBaseLayer=false] - This is a base layer.
14
+ * @param {boolean} [options.visibility=true] - Layer visibility.
15
+ * @param {boolean} [options.isSRGB=false] - Layer image webgl nternal format.
16
+ * @param {Extent} [options.extent=[[-180.0, -90.0], [180.0, 90.0]]] - Visible extent.
17
+ * @param {string} [options.textureFilter="anisotropic"] - Image texture filter. Available values: "nearest", "linear", "mipmap" and "anisotropic".
18
+ *
19
+ * @fires og.Layer#visibilitychange
20
+ * @fires og.Layer#add
21
+ * @fires og.Layer#remove
22
+ * @fires og.layer.Vector#mousemove
23
+ * @fires og.layer.Vector#mouseenter
24
+ * @fires og.layer.Vector#mouseleave
25
+ * @fires og.layer.Vector#lclick
26
+ * @fires og.layer.Vector#rclick
27
+ * @fires og.layer.Vector#mclick
28
+ * @fires og.layer.Vector#ldblclick
29
+ * @fires og.layer.Vector#rdblclick
30
+ * @fires og.layer.Vector#mdblclick
31
+ * @fires og.layer.Vector#lup
32
+ * @fires og.layer.Vector#rup
33
+ * @fires og.layer.Vector#mup
34
+ * @fires og.layer.Vector#ldown
35
+ * @fires og.layer.Vector#rdown
36
+ * @fires og.layer.Vector#mdown
37
+ * @fires og.layer.Vector#lhold
38
+ * @fires og.layer.Vector#rhold
39
+ * @fires og.layer.Vector#mhold
40
+ * @fires og.layer.Vector#mousewheel
41
+ * @fires og.layer.Vector#touchmove
42
+ * @fires og.layer.Vector#touchstart
43
+ * @fires og.layer.Vector#touchend
44
+ * @fires og.layer.Vector#doubletouch
45
+ */
46
+ export class Layer {
47
+ static getTMS(x: any, y: any, z: any): {
48
+ x: any;
49
+ y: number;
50
+ z: any;
51
+ };
52
+ static getTileIndex(...arr: any[]): string;
53
+ static set __layersCounter(arg: any);
54
+ static get __layersCounter(): any;
55
+ static set __requestsCounter(arg: any);
56
+ static get __requestsCounter(): any;
57
+ /**
58
+ * Maximum loading queries at one time.
59
+ * @const
60
+ * @type {number}
61
+ */
62
+ static get MAX_REQUESTS(): number;
63
+ constructor(name: any, options?: {});
64
+ /**
65
+ * Layer user name.
66
+ * @public
67
+ * @type {string}
68
+ */
69
+ public name: string;
70
+ _labelMaxLetters: any;
71
+ displayInLayerSwitcher: any;
72
+ _hasImageryTiles: boolean;
73
+ /**
74
+ * Layer global opacity.
75
+ * @public
76
+ * @type {number}
77
+ */
78
+ public _opacity: number;
79
+ /**
80
+ * Minimal zoom level when layer is visibile.
81
+ * @public
82
+ * @type {number}
83
+ */
84
+ public minZoom: number;
85
+ /**
86
+ * Maximal zoom level when layer is visibile.
87
+ * @public
88
+ * @type {number}
89
+ */
90
+ public maxZoom: number;
91
+ /**
92
+ * Planet node.
93
+ * @protected
94
+ * @type {Planet}
95
+ */
96
+ protected _planet: Planet;
97
+ /**
98
+ * Unic identifier.
99
+ * @protected
100
+ * @type {number}
101
+ */
102
+ protected _id: number;
103
+ /**
104
+ * Layer attribution.
105
+ * @protected
106
+ * @type {string}
107
+ */
108
+ protected _attribution: string;
109
+ /**
110
+ * Layer z-index.
111
+ * @protected
112
+ * @type {number}
113
+ */
114
+ protected _zIndex: number;
115
+ /**
116
+ * Base layer type flag.
117
+ * @protected
118
+ * @type {boolean}
119
+ */
120
+ protected _isBaseLayer: boolean;
121
+ _defaultTextures: any;
122
+ /**
123
+ * Layer visibility.
124
+ * @protected
125
+ * @type {boolean}
126
+ */
127
+ protected _visibility: boolean;
128
+ _fading: any;
129
+ _fadingFactor: number;
130
+ _fadingOpacity: number;
131
+ /**
132
+ * Height over the ground.
133
+ * @protected
134
+ * @type {number}
135
+ */
136
+ protected _height: number;
137
+ /**
138
+ * Visible degrees extent.
139
+ * @protected
140
+ * @type {Extent}
141
+ */
142
+ protected _extent: Extent;
143
+ createTexture: any;
144
+ _textureFilter: any;
145
+ _isSRGB: any;
146
+ _internalFormat: any;
147
+ /**
148
+ * Visible mercator extent.
149
+ * @protected
150
+ * @type {Extent}
151
+ */
152
+ protected _extentMerc: Extent;
153
+ /**
154
+ * Layer picking color. Assign when added to the planet.
155
+ * @protected
156
+ * @type {Vec3}
157
+ */
158
+ protected _pickingColor: Vec3;
159
+ _pickingEnabled: any;
160
+ _isPreloadDone: boolean;
161
+ /**
162
+ * Events handler.
163
+ * @public
164
+ * @type {Events}
165
+ */
166
+ public events: Events;
167
+ get instanceName(): string;
168
+ get rendererEvents(): Events;
169
+ set opacity(arg: number);
170
+ get opacity(): number;
171
+ set pickingEnabled(arg: boolean);
172
+ get pickingEnabled(): boolean;
173
+ /**
174
+ * Returns true if a layer has imagery tiles.
175
+ * @public
176
+ * @virtual
177
+ * @returns {boolean} - Imagery tiles flag.
178
+ */
179
+ public hasImageryTiles(): boolean;
180
+ /**
181
+ * Gets layer identifier.
182
+ * @public
183
+ * @returns {string} - Layer object id.
184
+ */
185
+ public getID(): string;
186
+ /**
187
+ * Compares layers instances.
188
+ * @public
189
+ * @param {Layer} layer - Layer instance to compare.
190
+ * @returns {boolean} - Returns true if the layers is the same instance of the input.
191
+ */
192
+ public isEqual(layer: Layer): boolean;
193
+ /**
194
+ * Assign the planet.
195
+ * @protected
196
+ * @virtual
197
+ * @param {Planet} planet - Planet render node.
198
+ */
199
+ protected _assignPlanet(planet: Planet): void;
200
+ /**
201
+ * Assign picking color to the layer.
202
+ * @protected
203
+ * @virtual
204
+ */
205
+ protected _bindPicking(): void;
206
+ /**
207
+ * Adds layer to the planet.
208
+ * @public
209
+ * @param {Planet} planet - Adds layer to the planet.
210
+ */
211
+ public addTo(planet: Planet): Layer;
212
+ /**
213
+ * Removes from planet.
214
+ * @public
215
+ * @returns {Layer} -This layer.
216
+ */
217
+ public remove(): Layer;
218
+ /**
219
+ * Clears layer material.
220
+ * @virtual
221
+ */
222
+ clear(): void;
223
+ /**
224
+ * Returns planet instance.
225
+ * @virtual
226
+ */
227
+ get planet(): Planet;
228
+ /**
229
+ * Sets layer attribution text.
230
+ * @public
231
+ * @param {string} html - HTML code that represents layer attribution, it could be just a text.
232
+ */
233
+ public setAttribution(html: string): void;
234
+ /**
235
+ * Sets height over the ground.
236
+ * @public
237
+ * @param {number} height - Layer height.
238
+ */
239
+ public setHeight(height: number): void;
240
+ /**
241
+ * Gets layer height.
242
+ * @public
243
+ * @returns {number} -
244
+ */
245
+ public getHeight(): number;
246
+ /**
247
+ * Sets z-index.
248
+ * @public
249
+ * @param {number} zIndex - Layer z-index.
250
+ */
251
+ public setZIndex(zIndex: number): void;
252
+ /**
253
+ * Gets z-index.
254
+ * @public
255
+ * @returns {number} -
256
+ */
257
+ public getZIndex(): number;
258
+ /**
259
+ * Set zIndex to the maximal value depend on other layers on the planet.
260
+ * @public
261
+ */
262
+ public bringToFront(): void;
263
+ /**
264
+ * Returns true if the layer is a base.
265
+ * @public
266
+ * @returns {boolean} - Base layer flag.
267
+ */
268
+ public isBaseLayer(): boolean;
269
+ /**
270
+ * Sets base layer type true.
271
+ * @public
272
+ * @param {boolean} flag - Base layer flag.
273
+ */
274
+ public setBaseLayer(flag: boolean): void;
275
+ /**
276
+ * Sets layer visibility.
277
+ * @public
278
+ * @virtual
279
+ * @param {boolean} visibility - Layer visibility.
280
+ */
281
+ public setVisibility(visibility: boolean): void;
282
+ /**
283
+ * Gets layer visibility.
284
+ * @public
285
+ * @returns {boolean} - Layer visibility.
286
+ */
287
+ public getVisibility(): boolean;
288
+ /**
289
+ * Sets visible geographical extent.
290
+ * @public
291
+ * @param {Extent} extent - Layer visible geographical extent.
292
+ */
293
+ public setExtent(extent: Extent): void;
294
+ /**
295
+ * Gets layer extent.
296
+ * @public
297
+ * @return {Extent} - Layer geodetic extent.
298
+ */
299
+ public getExtent(): Extent;
300
+ /**
301
+ * Special correction of the whole globe extent.
302
+ * @protected
303
+ */
304
+ protected _correctFullExtent(): void;
305
+ _refreshFadingOpacity(): boolean;
306
+ createMaterial(segment: any): Material;
307
+ }
308
+ import { Extent } from "../Extent.js";
309
+ import { Vec3 } from "../math/Vec3.js";
310
+ import { Events } from "../Events.js";
311
+ import { Material } from "./Material.js";
@@ -0,0 +1,45 @@
1
+ export class Material {
2
+ /**
3
+ *
4
+ * @param {*} segment
5
+ * @param {*} layer
6
+ */
7
+ constructor(segment: any, layer: any);
8
+ segment: any;
9
+ layer: any;
10
+ isReady: boolean;
11
+ isLoading: boolean;
12
+ texture: any;
13
+ pickingMask: any;
14
+ textureExists: boolean;
15
+ appliedNodeId: number;
16
+ texOffset: number[];
17
+ loadingAttempts: number;
18
+ _updateTexture: any;
19
+ _updatePickingMask: any;
20
+ pickingReady: boolean;
21
+ /**
22
+ *
23
+ */
24
+ abortLoading(): void;
25
+ _createTexture(img: any): any;
26
+ /**
27
+ *
28
+ * @param {*} img
29
+ */
30
+ applyImage(img: any): void;
31
+ /**
32
+ *
33
+ * @param {*} texture
34
+ * @param {*} pickingMask
35
+ */
36
+ applyTexture(texture: any, pickingMask: any): void;
37
+ /**
38
+ *
39
+ */
40
+ textureNotExists(): void;
41
+ /**
42
+ *
43
+ */
44
+ clear(): void;
45
+ }
@@ -0,0 +1,208 @@
1
+ /**
2
+ * Vector layer represents alternative entities store. Used for geospatial data rendering like
3
+ * points, lines, polygons, geometry objects etc.
4
+ * @class
5
+ * @extends {Layer}
6
+ * @param {string} [name="noname"] - Layer name.
7
+ * @param {Object} [options] - Layer options:
8
+ * @param {number} [options.minZoom=0] - Minimal visible zoom. 0 is default
9
+ * @param {number} [options.maxZoom=50] - Maximal visible zoom. 50 is default.
10
+ * @param {string} [options.attribution] - Layer attribution.
11
+ * @param {string} [options.zIndex=0] - Layer Z-order index. 0 is default.
12
+ * @param {boolean} [options.visibility=true] - Layer visibility. True is default.
13
+ * @param {boolean} [options.isBaseLayer=false] - Layer base layer. False is default.
14
+ * @param {Array.<Entity>} [options.entities] - Entities array.
15
+ * @param {Array.<number>} [options.scaleByDistance] - Scale by distance parameters. (exactly 3 entries)
16
+ * First index - near distance to the entity, after entity becomes full scale.
17
+ * Second index - far distance to the entity, when entity becomes zero scale.
18
+ * Third index - far distance to the entity, when entity becomes invisible.
19
+ * @param {number} [options.nodeCapacity=30] - Maximum entities quantity in the tree node. Rendering optimization parameter. 30 is default.
20
+ * @param {boolean} [options.async=true] - Asynchronous vector data handling before rendering. True for optimization huge data.
21
+ * @param {boolean} [options.clampToGround = false] - Clamp vector data to the ground.
22
+ * @param {boolean} [options.relativeToGround = false] - Place vector data relative to the ground relief.
23
+ * @param {Number} [options.polygonOffsetFactor=0.0] - The scale factor for the variable depth offset. The default value is 0.
24
+ * @param {Number} [options.polygonOffsetUnits=-637000.0] - The multiplier by which an implementation-specific value is multiplied with to create a constant depth offset.
25
+ *
26
+ * @fires og.layer.Vector#entitymove
27
+ * @fires og.layer.Vector#draw
28
+ * @fires og.layer.Vector#add
29
+ * @fires og.layer.Vector#remove
30
+ * @fires og.layer.Vector#entityadd
31
+ * @fires og.layer.Vector#entityremove
32
+ * @fires og.layer.Vector#visibilitychange
33
+ */
34
+ export class Vector extends Layer {
35
+ /**
36
+ * @param {string} name
37
+ * @param {*} [options]
38
+ */
39
+ constructor(name: string, options?: any);
40
+ isVector: boolean;
41
+ /**
42
+ * First index - near distance to the entity, after that entity becomes full scale.
43
+ * Second index - far distance to the entity, when entity becomes zero scale.
44
+ * Third index - far distance to the entity, when entity becomes invisible.
45
+ * @public
46
+ * @type {Array.<number>} - (exactly 3 entries)
47
+ */
48
+ public scaleByDistance: Array<number>;
49
+ pickingScale: any;
50
+ /**
51
+ * Asynchronous data handling before rendering.
52
+ * @public
53
+ * @type {boolean}
54
+ */
55
+ public async: boolean;
56
+ /**
57
+ * Vector data clamp to ground flag.
58
+ * @public
59
+ * @type {boolean}
60
+ */
61
+ public clampToGround: boolean;
62
+ /**
63
+ * Sets vector data relative to the ground relief.
64
+ * @public
65
+ * @type {boolean}
66
+ */
67
+ public relativeToGround: boolean;
68
+ /**
69
+ * Maximum entities quantity in the tree node.
70
+ * @private
71
+ */
72
+ private _nodeCapacity;
73
+ /**
74
+ * Stored entities.
75
+ * @private
76
+ */
77
+ private _entities;
78
+ _stripEntityCollection: EntityCollection;
79
+ _polylineEntityCollection: EntityCollection;
80
+ _geometryHandler: GeometryHandler;
81
+ _entityCollectionsTree: EntityCollectionNode;
82
+ _entityCollectionsTreeNorth: EntityCollectionNodeWGS84;
83
+ _entityCollectionsTreeSouth: EntityCollectionNodeWGS84;
84
+ _renderingNodes: {};
85
+ _renderingNodesNorth: {};
86
+ _renderingNodesSouth: {};
87
+ _counter: number;
88
+ _deferredEntitiesPendingQueue: QueueArray;
89
+ _pendingsQueue: any[];
90
+ /**
91
+ * Specifies the scale factor for gl.polygonOffset function to calculate depth values, 0.0 is default.
92
+ * @public
93
+ * @type {Number}
94
+ */
95
+ public polygonOffsetFactor: number;
96
+ /**
97
+ * Specifies the scale Units for gl.polygonOffset function to calculate depth values, 0.0 is default.
98
+ * @public
99
+ * @type {Number}
100
+ */
101
+ public polygonOffsetUnits: number;
102
+ /**
103
+ * Returns stored entities.
104
+ * @public
105
+ * @returns {Array.<Entity>} -
106
+ */
107
+ public getEntities(): Array<Entity>;
108
+ /**
109
+ * Adds entity to the layer.
110
+ * @public
111
+ * @param {Entity} entity - Entity.
112
+ * @param {boolean} [rightNow] - Entity insertion option. False is deafult.
113
+ * @returns {layer.Vector} - Returns this layer.
114
+ */
115
+ public add(entity: Entity, rightNow?: boolean): layer.Vector;
116
+ /**
117
+ * Adds entity to the layer in the index position.
118
+ * @public
119
+ * @param {Entity} entity - Entity.
120
+ * @param {Number} index - Index position.
121
+ * @param {boolean} [rightNow] - Entity insertion option. False is deafult.
122
+ * @returns {layer.Vector} - Returns this layer.
123
+ */
124
+ public insert(entity: Entity, index: number, rightNow?: boolean): layer.Vector;
125
+ _proceedEntity(entity: any, rightNow: any): void;
126
+ /**
127
+ * Adds entity array to the layer.
128
+ * @public
129
+ * @param {Array.<Entity>} entities - Entities array.
130
+ * @param {boolean} [rightNow] - Entity insertion option. False is deafult.
131
+ * @returns {layer.Vector} - Returns this layer.
132
+ */
133
+ public addEntities(entities: Array<Entity>, rightNow?: boolean): layer.Vector;
134
+ /**
135
+ * Remove entity from layer.
136
+ * TODO: memory leaks.
137
+ * @public
138
+ * @param {Entity} entity - Entity to remove.
139
+ * @returns {layer.Vector} - Returns this layer.
140
+ */
141
+ public removeEntity(entity: Entity): layer.Vector;
142
+ /**
143
+ * Refresh collected entities indexes from startIndex entitytes collection array position.
144
+ * @public
145
+ * @param {number} startIndex - Entity array index.
146
+ */
147
+ public _reindexEntitiesArray(startIndex: number): void;
148
+ /**
149
+ * Removes entities from layer.
150
+ * @public
151
+ * @param {Array.<Entity>} entities - Entity array.
152
+ * @returns {layer.Vector} - Returns this layer.
153
+ */
154
+ public removeEntities(entities: Array<Entity>): layer.Vector;
155
+ /**
156
+ * Sets scale by distance parameters.
157
+ * @public
158
+ * @param {number} near - Full scale entity distance.
159
+ * @param {number} far - Zerol scale entity distance.
160
+ * @param {number} [farInvisible] - Entity visibility distance.
161
+ * @returns {layer.Vector} -
162
+ */
163
+ public setScaleByDistance(near: number, far: number, farInvisible?: number): layer.Vector;
164
+ /**
165
+ * Safety entities loop.
166
+ * @public
167
+ * @param {callback} callback - Entity callback.
168
+ */
169
+ public each(callback: any): void;
170
+ /**
171
+ * Removes current entities from layer and adds new entities.
172
+ * @public
173
+ * @param {Array.<Entity>} entities - New entity array.
174
+ * @returns {layer.Vector} - Returns layer instance.
175
+ */
176
+ public setEntities(entities: Array<Entity>): layer.Vector;
177
+ _createEntityCollectionsTree(entitiesForTree: any): void;
178
+ _bindEventsDefault(entityCollection: any): void;
179
+ _collectStripCollectionPASS(outArr: any): void;
180
+ _collectPolylineCollectionPASS(outArr: any): void;
181
+ collectVisibleCollections(outArr: any): void;
182
+ _secondPASS: any[];
183
+ _queueDeferredNode(node: any): void;
184
+ _execDeferredNode(node: any): void;
185
+ /**
186
+ * Start to load tile material.
187
+ * @public
188
+ * @virtual
189
+ * @param {Segment.Material} material - Current material.
190
+ */
191
+ public loadMaterial(material: Segment.Material): void;
192
+ /**
193
+ * Abort exact material loading.
194
+ * @public
195
+ * @param {Material} material - Segment material.
196
+ */
197
+ public abortMaterialLoading(material: Material): void;
198
+ applyMaterial(material: any): number[];
199
+ clearMaterial(material: any): void;
200
+ update(): void;
201
+ }
202
+ import { Layer } from "./Layer.js";
203
+ import { EntityCollection } from "../entity/EntityCollection.js";
204
+ import { GeometryHandler } from "../entity/GeometryHandler.js";
205
+ import { EntityCollectionNode } from "../quadTree/EntityCollectionNode.js";
206
+ import { EntityCollectionNodeWGS84 } from "../quadTree/EntityCollectionNode.js";
207
+ import { QueueArray } from "../QueueArray.js";
208
+ import { Entity } from "../entity/Entity.js";