@openglobus/og 0.13.8 → 0.13.10
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.
- package/README.md +1 -1
- package/css/og.css +388 -129
- package/dist/@openglobus/og.css +1 -1
- package/dist/@openglobus/og.esm.js +2 -2
- package/dist/@openglobus/og.esm.js.map +1 -1
- package/dist/@openglobus/og.umd.js +2 -2
- package/dist/@openglobus/og.umd.js.map +1 -1
- package/package.json +20 -19
- package/src/og/Globe.js +15 -16
- package/src/og/Object3d.js +33 -0
- package/src/og/control/GeoImageDragControl.js +102 -75
- package/src/og/control/LayerAnimation.js +306 -38
- package/src/og/control/LayerSwitcher.js +506 -159
- package/src/og/control/Lighting.js +27 -27
- package/src/og/control/RulerSwitcher.js +69 -0
- package/src/og/control/UIhelpers.js +146 -0
- package/src/og/control/index.js +3 -1
- package/src/og/control/ruler/RulerScene.js +6 -2
- package/src/og/control/visibleExtent/Segment.js +2 -1
- package/src/og/ellipsoid/wgs84.js +1 -1
- package/src/og/entity/LabelHandler.js +5 -2
- package/src/og/entity/LabelWorker.js +38 -53
- package/src/og/layer/BaseGeoImage.js +347 -312
- package/src/og/layer/CanvasTiles.js +312 -290
- package/src/og/layer/GeoImage.js +222 -214
- package/src/og/layer/GeoVideo.js +291 -291
- package/src/og/layer/Layer.js +71 -30
- package/src/og/layer/Material.js +109 -109
- package/src/og/layer/Vector.js +1 -0
- package/src/og/layer/XYZ.js +20 -12
- package/src/og/light/LightSource.js +364 -363
- package/src/og/math.js +2 -2
- package/src/og/quadTree/Node.js +7 -5
- package/src/og/renderer/Renderer.js +1 -1
- package/src/og/scene/Planet.js +103 -42
- package/src/og/segment/Segment.js +34 -56
- package/src/og/segment/Slice.js +1 -1
- package/src/og/shaders/drawnode.js +1 -1
- package/src/og/terrain/GlobusTerrain.js +31 -20
- package/src/og/terrain/MapboxTerrain.js +1 -1
- package/src/og/utils/BaseWorker.js +46 -0
- package/src/og/utils/GeoImageCreator.js +164 -161
- package/src/og/utils/Loader.js +60 -33
- package/src/og/utils/NormalMapCreator.js +403 -412
- package/src/og/utils/PlainSegmentWorker.js +29 -55
- package/src/og/utils/TerrainWorker.js +572 -589
- package/src/og/utils/functionComposition.js +13 -0
- package/src/og/webgl/Handler.js +42 -41
- package/types/Object3d.d.ts +1 -0
- package/types/camera/PlanetCamera.d.ts +4 -0
- package/types/control/GeoImageDragControl.d.ts +2 -0
- package/types/control/LayerAnimation.d.ts +73 -0
- package/types/control/LayerSwitcher.d.ts +55 -11
- package/types/control/MouseNavigation.d.ts +1 -0
- package/types/control/MouseWheelZoomControl.d.ts +1 -0
- package/types/control/Sun.d.ts +1 -0
- package/types/control/TouchNavigation.d.ts +1 -0
- package/types/control/UIhelpers.d.ts +13 -0
- package/types/control/index.d.ts +2 -1
- package/types/entity/LabelHandler.d.ts +2 -0
- package/types/entity/LabelWorker.d.ts +5 -7
- package/types/layer/BaseGeoImage.d.ts +9 -1
- package/types/layer/CanvasTiles.d.ts +5 -1
- package/types/layer/GeoImage.d.ts +1 -0
- package/types/layer/GeoTexture2d.d.ts +1 -0
- package/types/layer/Layer.d.ts +5 -1
- package/types/layer/Vector.d.ts +7 -0
- package/types/layer/WMS.d.ts +1 -0
- package/types/layer/XYZ.d.ts +8 -6
- package/types/math.d.ts +1 -1
- package/types/quadTree/EntityCollectionNode.d.ts +7 -0
- package/types/quadTree/Node.d.ts +1 -2
- package/types/renderer/Renderer.d.ts +1 -1
- package/types/renderer/RendererEvents.d.ts +16 -0
- package/types/scene/Planet.d.ts +19 -4
- package/types/segment/SegmentLonLat.d.ts +2 -0
- package/types/terrain/BilTerrain.d.ts +6 -0
- package/types/terrain/GlobusTerrain.d.ts +7 -0
- package/types/terrain/MapboxTerrain.d.ts +8 -0
- package/types/utils/BaseWorker.d.ts +14 -0
- package/types/utils/Loader.d.ts +3 -1
- package/types/utils/PlainSegmentWorker.d.ts +4 -6
- package/types/utils/TerrainWorker.d.ts +4 -6
- package/types/utils/functionComposition.d.ts +5 -0
- package/types/webgl/Handler.d.ts +4 -1
package/types/layer/XYZ.d.ts
CHANGED
|
@@ -56,10 +56,6 @@ export class XYZ extends Layer {
|
|
|
56
56
|
* @type {number}
|
|
57
57
|
*/
|
|
58
58
|
public maxNativeZoom: number;
|
|
59
|
-
/**
|
|
60
|
-
* @protected
|
|
61
|
-
*/
|
|
62
|
-
protected _crossOrigin: any;
|
|
63
59
|
/**
|
|
64
60
|
* Rewrites imagery tile url query.
|
|
65
61
|
* @private
|
|
@@ -69,12 +65,18 @@ export class XYZ extends Layer {
|
|
|
69
65
|
* @returns {string} - Url query string.
|
|
70
66
|
*/
|
|
71
67
|
private _urlRewriteCallback;
|
|
72
|
-
|
|
68
|
+
_requestsPeerSubdomian: number;
|
|
69
|
+
_requestCount: number;
|
|
70
|
+
/**
|
|
71
|
+
* @warning Use XYZ.isIdle in requesAnimationFrame(after setVisibility)
|
|
72
|
+
*/
|
|
73
|
+
get isIdle(): boolean;
|
|
73
74
|
/**
|
|
74
75
|
* Abort loading tiles.
|
|
75
76
|
* @public
|
|
76
77
|
*/
|
|
77
78
|
public abortLoading(): void;
|
|
79
|
+
remove(): void;
|
|
78
80
|
/**
|
|
79
81
|
* Sets imagery tiles url source template.
|
|
80
82
|
* @public
|
|
@@ -114,7 +116,7 @@ export class XYZ extends Layer {
|
|
|
114
116
|
* @param {layer.XYZ~_urlRewriteCallback} ur - The callback that returns tile custom created url.
|
|
115
117
|
*/
|
|
116
118
|
public setUrlRewriteCallback(ur: any): void;
|
|
117
|
-
applyMaterial(material: any): any;
|
|
119
|
+
applyMaterial(material: any, forceLoading: any): any;
|
|
118
120
|
clearMaterial(material: any): void;
|
|
119
121
|
}
|
|
120
122
|
import { Layer } from "./Layer.js";
|
package/types/math.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export function isPowerOfTwo(x: number): boolean;
|
|
|
48
48
|
* @param {number} x - Input value.
|
|
49
49
|
* @returns {number} -
|
|
50
50
|
*/
|
|
51
|
-
export function nextHighestPowerOfTwo(x: number): number;
|
|
51
|
+
export function nextHighestPowerOfTwo(x: number, maxValue?: number): number;
|
|
52
52
|
/**
|
|
53
53
|
* Returns random integer number within the bounds.
|
|
54
54
|
* @function
|
|
@@ -30,5 +30,12 @@ export class EntityCollectionNode {
|
|
|
30
30
|
}
|
|
31
31
|
export class EntityCollectionNodeWGS84 extends EntityCollectionNode {
|
|
32
32
|
isNorth: boolean;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param {*} outArr
|
|
36
|
+
* @param {*} visibleNodes
|
|
37
|
+
* @param {*} renderingNode
|
|
38
|
+
*/
|
|
39
|
+
renderCollection(outArr: any, visibleNodes: any, renderingNode: any): void;
|
|
33
40
|
}
|
|
34
41
|
import { Sphere } from "../bv/Sphere.js";
|
package/types/quadTree/Node.d.ts
CHANGED
|
@@ -22,8 +22,7 @@ export class Node {
|
|
|
22
22
|
sideSizeLog2: number[];
|
|
23
23
|
ready: boolean;
|
|
24
24
|
neighbors: any[][];
|
|
25
|
-
|
|
26
|
-
equalizedNeighborGridSize: number[];
|
|
25
|
+
equalizedSideWithNodeId: any[];
|
|
27
26
|
nodes: any[];
|
|
28
27
|
segment: any;
|
|
29
28
|
_cameraInside: boolean;
|
|
@@ -170,6 +170,22 @@ export class RendererEvents extends Events {
|
|
|
170
170
|
* @public
|
|
171
171
|
*/
|
|
172
172
|
public handleEvents(): void;
|
|
173
|
+
/**
|
|
174
|
+
* Set render event callback.
|
|
175
|
+
* @public
|
|
176
|
+
* @param {string} name - Event name
|
|
177
|
+
* @param {eventCallback} callback - Callback function
|
|
178
|
+
* @param {number} [key] - Key code from og.input
|
|
179
|
+
* @param {*} sender - Callback context
|
|
180
|
+
* @param {number} [priority] - Event callback priority
|
|
181
|
+
*/
|
|
182
|
+
public on(name: string, p0: any, p1: any, p2: any, p3: any): void;
|
|
183
|
+
/**
|
|
184
|
+
* TODO: DOESNT WORK!!!
|
|
185
|
+
* @param {any} name
|
|
186
|
+
* @param {any} callback
|
|
187
|
+
*/
|
|
188
|
+
off(name: any, callback: any): void;
|
|
173
189
|
/**
|
|
174
190
|
* Check key is pressed.
|
|
175
191
|
* @public
|
package/types/scene/Planet.d.ts
CHANGED
|
@@ -31,11 +31,17 @@ export class Planet extends RenderNode {
|
|
|
31
31
|
*/
|
|
32
32
|
protected _planetRadius2: number;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
35
|
-
* @
|
|
34
|
+
* Layers array.
|
|
35
|
+
* @protected
|
|
36
36
|
* @type {Array.<Layer>}
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
protected _layers: Array<Layer>;
|
|
39
|
+
/**
|
|
40
|
+
* Flag to trigger layer update in a next frame
|
|
41
|
+
* @type {boolean}
|
|
42
|
+
* @private
|
|
43
|
+
*/
|
|
44
|
+
private _updateLayer;
|
|
39
45
|
/**
|
|
40
46
|
* Current visible imagery tile layers array.
|
|
41
47
|
* @public
|
|
@@ -67,6 +73,12 @@ export class Planet extends RenderNode {
|
|
|
67
73
|
* @type {Terrain}
|
|
68
74
|
*/
|
|
69
75
|
public terrain: Terrain;
|
|
76
|
+
/**
|
|
77
|
+
* Terrain provider Pool.
|
|
78
|
+
* @public
|
|
79
|
+
* @type {Terrain}
|
|
80
|
+
*/
|
|
81
|
+
public _terrainPool: Terrain;
|
|
70
82
|
/**
|
|
71
83
|
* Camera is this.renderer.activeCamera pointer.
|
|
72
84
|
* @public
|
|
@@ -262,6 +274,7 @@ export class Planet extends RenderNode {
|
|
|
262
274
|
_renderCompletedActivated: boolean;
|
|
263
275
|
_terrainCompleted: boolean;
|
|
264
276
|
_terrainCompletedActivated: boolean;
|
|
277
|
+
get layers(): Layer[];
|
|
265
278
|
/**
|
|
266
279
|
* Add the given control to the renderer of the planet scene.
|
|
267
280
|
* @param {control.Control} control - Control.
|
|
@@ -345,6 +358,7 @@ export class Planet extends RenderNode {
|
|
|
345
358
|
* @protected
|
|
346
359
|
*/
|
|
347
360
|
protected _initializeShaders(): void;
|
|
361
|
+
_onLayerLoadend(layer: any): void;
|
|
348
362
|
/**
|
|
349
363
|
* @virtual
|
|
350
364
|
* @public
|
|
@@ -366,11 +380,12 @@ export class Planet extends RenderNode {
|
|
|
366
380
|
* @public
|
|
367
381
|
*/
|
|
368
382
|
public updateAttributionsList(): void;
|
|
383
|
+
updateVisibleLayers(): void;
|
|
369
384
|
/**
|
|
370
385
|
* Updates visible layers.
|
|
371
386
|
* @public
|
|
372
387
|
*/
|
|
373
|
-
public
|
|
388
|
+
public _updateVisibleLayers(): void;
|
|
374
389
|
/**
|
|
375
390
|
* Apply to render list of layer attributions
|
|
376
391
|
* @private
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export class SegmentLonLat extends Segment {
|
|
11
11
|
_extentMerc: Extent;
|
|
12
|
+
projectNative(coords: any): any;
|
|
13
|
+
getTerrainPoint(xyz: any, insideSegmentPosition: any, res: any, normal: any): number;
|
|
12
14
|
acceptForRendering(camera: any): any;
|
|
13
15
|
_isNorth: boolean;
|
|
14
16
|
normalMapNormalsRaw: Float32Array;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
export class BilTerrain extends GlobusTerrain {
|
|
2
2
|
constructor(options: any);
|
|
3
|
+
minZoom: any;
|
|
4
|
+
maxZoom: any;
|
|
5
|
+
url: any;
|
|
3
6
|
_format: string;
|
|
4
7
|
_layers: any;
|
|
5
8
|
_imageSize: any;
|
|
9
|
+
plainGridSize: any;
|
|
10
|
+
_createUrl(segment: any): string;
|
|
11
|
+
_createHeights(data: any, segment: any): Float32Array;
|
|
6
12
|
}
|
|
7
13
|
import { GlobusTerrain } from "./GlobusTerrain.js";
|
|
@@ -21,12 +21,15 @@ export class GlobusTerrain extends EmptyTerrain {
|
|
|
21
21
|
* @param {*} [options]
|
|
22
22
|
*/
|
|
23
23
|
constructor(name?: string, options?: any);
|
|
24
|
+
_s: any;
|
|
24
25
|
/**
|
|
25
26
|
* Events handler.
|
|
26
27
|
* @public
|
|
27
28
|
* @type {Events}
|
|
28
29
|
*/
|
|
29
30
|
public events: Events;
|
|
31
|
+
_requestCount: number;
|
|
32
|
+
_requestsPeerSubdomian: number;
|
|
30
33
|
/**
|
|
31
34
|
* Terrain source path url template.
|
|
32
35
|
* @public
|
|
@@ -48,6 +51,8 @@ export class GlobusTerrain extends EmptyTerrain {
|
|
|
48
51
|
* @returns {string} - Url query string.
|
|
49
52
|
*/
|
|
50
53
|
private _urlRewriteCallback;
|
|
54
|
+
isBlur(segment: any): boolean;
|
|
55
|
+
getHeightAsync(lonLat: any, callback: any, zoom: any): boolean;
|
|
51
56
|
getTileCache(lonLat: any, z: any): any;
|
|
52
57
|
_getGroundHeightMerc(merc: any, tileData: any): number;
|
|
53
58
|
/**
|
|
@@ -73,6 +78,8 @@ export class GlobusTerrain extends EmptyTerrain {
|
|
|
73
78
|
* @param {boolean} forceLoading
|
|
74
79
|
*/
|
|
75
80
|
public loadTerrain(segment: Segment, forceLoading: boolean): void;
|
|
81
|
+
_getSubdomain(): any;
|
|
82
|
+
_buildURL(x: any, y: any, z: any): string;
|
|
76
83
|
/**
|
|
77
84
|
* Creates query url.
|
|
78
85
|
* @protected
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
export class MapboxTerrain extends GlobusTerrain {
|
|
2
2
|
constructor(name: any, options?: {});
|
|
3
|
+
equalizeVertices: any;
|
|
4
|
+
equalizeNormals: any;
|
|
5
|
+
minZoom: any;
|
|
6
|
+
maxZoom: any;
|
|
7
|
+
gridSizeByZoom: any;
|
|
8
|
+
url: any;
|
|
9
|
+
plainGridSize: any;
|
|
3
10
|
_imageSize: any;
|
|
4
11
|
_ctx: CanvasRenderingContext2D;
|
|
5
12
|
_createTemporalCanvas(size: any): CanvasRenderingContext2D;
|
|
13
|
+
_createHeights(data: any, tileIndex: any, tileX: any, tileY: any, tileZoom: any, extent: any): Float32Array;
|
|
6
14
|
}
|
|
7
15
|
import { GlobusTerrain } from "./GlobusTerrain.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class BaseWorker {
|
|
2
|
+
constructor(numWorkers: number, program: any);
|
|
3
|
+
_id: number;
|
|
4
|
+
_pendingQueue: any[];
|
|
5
|
+
_numWorkers: number;
|
|
6
|
+
_workerQueue: any[];
|
|
7
|
+
/**
|
|
8
|
+
* @virtual
|
|
9
|
+
*/
|
|
10
|
+
make(): void;
|
|
11
|
+
check(): void;
|
|
12
|
+
setProgram(program: any): void;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
}
|
package/types/utils/Loader.d.ts
CHANGED
|
@@ -20,10 +20,12 @@ export class Loader {
|
|
|
20
20
|
status: string;
|
|
21
21
|
msg: any;
|
|
22
22
|
}>;
|
|
23
|
+
getRequestCounter(sender: any): any;
|
|
23
24
|
isIdle(sender: any): any;
|
|
24
25
|
_checkLoadend(request: any, sender: any): void;
|
|
25
26
|
_handleResponse(q: any, response: any): void;
|
|
26
27
|
_exec(): Promise<void>;
|
|
27
|
-
abort(): void;
|
|
28
|
+
abort(sender: any): void;
|
|
29
|
+
abortAll(): void;
|
|
28
30
|
}
|
|
29
31
|
import { Events } from "../Events.js";
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
export class PlainSegmentWorker {
|
|
1
|
+
export class PlainSegmentWorker extends BaseWorker {
|
|
2
2
|
constructor(numWorkers?: number);
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_workerQueue: Worker[];
|
|
6
|
-
_pendingQueue: any[];
|
|
7
|
-
check(): void;
|
|
3
|
+
_segments: Map<any, any>;
|
|
4
|
+
_onMessage(e: any): void;
|
|
8
5
|
setGeoid(geoid: any): void;
|
|
9
6
|
make(segment: any): void;
|
|
10
7
|
}
|
|
8
|
+
import { BaseWorker } from "./BaseWorker.js";
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
export class TerrainWorker {
|
|
1
|
+
export class TerrainWorker extends BaseWorker {
|
|
2
2
|
constructor(numWorkers?: number);
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_workerQueue: Worker[];
|
|
6
|
-
_pendingQueue: any[];
|
|
7
|
-
check(): void;
|
|
3
|
+
_segments: Map<any, any>;
|
|
4
|
+
_onMessage(e: any): void;
|
|
8
5
|
make(segment: any, elevations: any): void;
|
|
9
6
|
}
|
|
7
|
+
import { BaseWorker } from "./BaseWorker.js";
|
package/types/webgl/Handler.d.ts
CHANGED
|
@@ -24,7 +24,8 @@ 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(id: any, params?: {});
|
|
28
|
+
events: Events;
|
|
28
29
|
/**
|
|
29
30
|
* Application default timer.
|
|
30
31
|
* @public
|
|
@@ -104,6 +105,7 @@ export class Handler {
|
|
|
104
105
|
ANISOTROPIC: any;
|
|
105
106
|
};
|
|
106
107
|
createTextureDefault: any;
|
|
108
|
+
ONCANVASRESIZE: any;
|
|
107
109
|
createTexture_n: (image: any, internalFormat: any) => any;
|
|
108
110
|
/**
|
|
109
111
|
* Sets animation frame function.
|
|
@@ -387,6 +389,7 @@ export class Handler {
|
|
|
387
389
|
addClocks(clockArr: any): void;
|
|
388
390
|
removeClock(clock: any): void;
|
|
389
391
|
}
|
|
392
|
+
import { Events } from "../Events.js";
|
|
390
393
|
import { Clock } from "../Clock.js";
|
|
391
394
|
import { ProgramController } from "./ProgramController.js";
|
|
392
395
|
import { Stack } from "../Stack.js";
|