@openglobus/og 0.13.5 → 0.13.6
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/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 +1 -1
- package/src/og/Events.js +188 -188
- package/src/og/Globe.js +1 -0
- package/src/og/control/KeyboardNavigation.js +48 -2
- package/src/og/control/TouchNavigation.js +13 -13
- package/src/og/control/ZoomControl.js +1 -1
- package/src/og/ellipsoid/Ellipsoid.js +1 -1
- package/src/og/entity/LabelHandler.js +2 -2
- package/src/og/input/input.js +7 -1
- package/src/og/layer/KML.js +181 -12
- package/src/og/layer/Layer.js +4 -2
- package/src/og/renderer/RendererEvents.js +17 -3
- package/src/og/scene/Planet.js +45 -27
- package/src/og/terrain/EmptyTerrain.js +159 -146
- package/src/og/terrain/Geoid.js +246 -241
- package/src/og/terrain/GlobusTerrain.js +17 -18
- package/src/og/terrain/MapboxTerrain.js +292 -294
- package/src/og/utils/PlainSegmentWorker.js +38 -26
- package/types/control/KeyboardNavigation.d.ts +3 -0
- package/types/input/input.d.ts +6 -0
- package/types/layer/KML.d.ts +26 -1
- package/types/renderer/RendererEvents.d.ts +2 -0
- package/types/scene/Planet.d.ts +5 -0
- package/types/terrain/EmptyTerrain.d.ts +3 -1
- package/types/terrain/Geoid.d.ts +1 -10
- package/types/terrain/GlobusTerrain.d.ts +0 -1
- package/types/terrain/MapboxTerrain.d.ts +1 -1
|
@@ -49,30 +49,42 @@ class PlainSegmentWorker {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
setGeoid(geoid) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
52
|
+
|
|
53
|
+
let model = null;
|
|
54
|
+
|
|
55
|
+
if (geoid.model) {
|
|
56
|
+
let m = geoid.model;
|
|
57
|
+
model = {
|
|
58
|
+
scale: m.scale,
|
|
59
|
+
offset: m.offset,
|
|
60
|
+
width: m.width,
|
|
61
|
+
height: m.height,
|
|
62
|
+
rlonres: m.rlonres,
|
|
63
|
+
rlatres: m.rlatres,
|
|
64
|
+
i: m.i
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
this._workerQueue.forEach((w) => {
|
|
68
|
+
let rawfile = new Uint8Array(m.rawfile.length);
|
|
69
|
+
rawfile.set(m.rawfile);
|
|
70
|
+
|
|
71
|
+
w.postMessage(
|
|
72
|
+
{
|
|
73
|
+
model: model,
|
|
74
|
+
rawfile: rawfile
|
|
75
|
+
},
|
|
76
|
+
[rawfile.buffer]
|
|
77
|
+
);
|
|
78
|
+
});
|
|
79
|
+
} else {
|
|
80
|
+
this._workerQueue.forEach((w) => {
|
|
81
|
+
w.postMessage(
|
|
82
|
+
{
|
|
83
|
+
model: null
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
76
88
|
}
|
|
77
89
|
|
|
78
90
|
make(segment) {
|
|
@@ -116,6 +128,8 @@ class PlainSegmentWorker {
|
|
|
116
128
|
|
|
117
129
|
const _programm = `
|
|
118
130
|
'use strict';
|
|
131
|
+
|
|
132
|
+
let model = null;
|
|
119
133
|
|
|
120
134
|
let cached_ix = null;
|
|
121
135
|
let cached_iy = null;
|
|
@@ -185,8 +199,6 @@ const _programm = `
|
|
|
185
199
|
return model.offset + model.scale * h;
|
|
186
200
|
};
|
|
187
201
|
|
|
188
|
-
let model = null;
|
|
189
|
-
|
|
190
202
|
const HALF_PI = Math.PI * 0.5;
|
|
191
203
|
const POLE = 20037508.34;
|
|
192
204
|
const PI_BY_POLE = Math.PI / POLE;
|
|
@@ -13,8 +13,11 @@ export class KeyboardNavigation extends Control {
|
|
|
13
13
|
onCameraStrifeRight(event: any): void;
|
|
14
14
|
onCameraLookUp(event: any): void;
|
|
15
15
|
onCameraLookDown(event: any): void;
|
|
16
|
+
onCameraLookLeft(event: any): void;
|
|
17
|
+
onCameraLookRight(event: any): void;
|
|
16
18
|
onCameraTurnLeft(event: any): void;
|
|
17
19
|
onCameraTurnRight(event: any): void;
|
|
20
|
+
onCameraRollNorth(event: any): void;
|
|
18
21
|
onCameraRollLeft(event: any): void;
|
|
19
22
|
onCameraRollRight(event: any): void;
|
|
20
23
|
}
|
package/types/input/input.d.ts
CHANGED
|
@@ -3,11 +3,14 @@ export namespace input {
|
|
|
3
3
|
const KEY_ALT: number;
|
|
4
4
|
const KEY_SHIFT: number;
|
|
5
5
|
const KEY_SPACE: number;
|
|
6
|
+
const KEY_PGUP: number;
|
|
7
|
+
const KEY_PGDN: number;
|
|
6
8
|
const KEY_LEFT: number;
|
|
7
9
|
const KEY_UP: number;
|
|
8
10
|
const KEY_RIGHT: number;
|
|
9
11
|
const KEY_DOWN: number;
|
|
10
12
|
const KEY_PRINTSCREEN: number;
|
|
13
|
+
const KEY_EQUALS: number;
|
|
11
14
|
const KEY_A: number;
|
|
12
15
|
const KEY_C: number;
|
|
13
16
|
const KEY_D: number;
|
|
@@ -17,6 +20,7 @@ export namespace input {
|
|
|
17
20
|
const KEY_I: number;
|
|
18
21
|
const KEY_K: number;
|
|
19
22
|
const KEY_L: number;
|
|
23
|
+
const KEY_N: number;
|
|
20
24
|
const KEY_O: number;
|
|
21
25
|
const KEY_P: number;
|
|
22
26
|
const KEY_Q: number;
|
|
@@ -26,7 +30,9 @@ export namespace input {
|
|
|
26
30
|
const KEY_W: number;
|
|
27
31
|
const KEY_X: number;
|
|
28
32
|
const KEY_Z: number;
|
|
33
|
+
const KEY_PLUS: number;
|
|
29
34
|
const KEY_F1: number;
|
|
35
|
+
const KEY_MINUS: number;
|
|
30
36
|
const KEY_APOSTROPHE: number;
|
|
31
37
|
const MB_LEFT: number;
|
|
32
38
|
const MB_RIGHT: number;
|
package/types/layer/KML.d.ts
CHANGED
|
@@ -13,6 +13,31 @@ export class KML extends Vector {
|
|
|
13
13
|
* @public
|
|
14
14
|
*/
|
|
15
15
|
public _extractCoordonatesFromKml(xmlDoc: any): any[];
|
|
16
|
+
/**
|
|
17
|
+
* @private
|
|
18
|
+
*/
|
|
19
|
+
private _AGBRtoRGBA;
|
|
20
|
+
/**
|
|
21
|
+
* @private
|
|
22
|
+
returns array of longitude, latitude, altitude (altitude optional)
|
|
23
|
+
*/
|
|
24
|
+
private _parseKMLcoordinates;
|
|
25
|
+
/**
|
|
26
|
+
* @private
|
|
27
|
+
*/
|
|
28
|
+
private _kmlPlacemarkToEntity;
|
|
29
|
+
_extractStyle(placemark: any): {
|
|
30
|
+
iconHeading: number;
|
|
31
|
+
iconURL: any;
|
|
32
|
+
iconColor: string;
|
|
33
|
+
lineWidth: number;
|
|
34
|
+
lineColor: string;
|
|
35
|
+
};
|
|
36
|
+
_parseKML(xml: any, extent: any, entities?: any): any;
|
|
37
|
+
_convertKMLintoEntities(xml: any): {
|
|
38
|
+
entities: any;
|
|
39
|
+
extent: Extent;
|
|
40
|
+
};
|
|
16
41
|
/**
|
|
17
42
|
* Creates billboards or polylines from array of lonlat.
|
|
18
43
|
* @public
|
|
@@ -63,6 +88,6 @@ export class KML extends Vector {
|
|
|
63
88
|
}>;
|
|
64
89
|
}
|
|
65
90
|
import { Vector } from "./Vector.js";
|
|
91
|
+
import { Extent } from "../Extent.js";
|
|
66
92
|
import { Entity } from "../entity/Entity.js";
|
|
67
93
|
import { Billboard } from "../entity/Billboard.js";
|
|
68
|
-
import { Extent } from "../Extent.js";
|
|
@@ -134,6 +134,8 @@ export class RendererEvents extends Events {
|
|
|
134
134
|
prev_x: number;
|
|
135
135
|
/** Previous touch Y coordinate. */
|
|
136
136
|
prev_y: number;
|
|
137
|
+
/** Screen touch position world direction. */
|
|
138
|
+
direction: Vec3;
|
|
137
139
|
/** JavaScript touching system event message. */
|
|
138
140
|
sys: any;
|
|
139
141
|
/** Current touched(picking) object. */
|
package/types/scene/Planet.d.ts
CHANGED
|
@@ -369,6 +369,11 @@ export class Planet extends RenderNode {
|
|
|
369
369
|
* @public
|
|
370
370
|
*/
|
|
371
371
|
public updateVisibleLayers(): void;
|
|
372
|
+
/**
|
|
373
|
+
* Apply to render list of layer attributions
|
|
374
|
+
* @private
|
|
375
|
+
*/
|
|
376
|
+
private _applyAttribution;
|
|
372
377
|
/**
|
|
373
378
|
* Sort visible layer - preparing for rendering.
|
|
374
379
|
* @protected
|
|
@@ -45,11 +45,13 @@ export class EmptyTerrain {
|
|
|
45
45
|
*/
|
|
46
46
|
protected _planet: Planet;
|
|
47
47
|
_geoid: any;
|
|
48
|
+
_isReady: boolean;
|
|
48
49
|
isBlur(): boolean;
|
|
49
50
|
set maxNodeZoom(arg: number);
|
|
50
51
|
get maxNodeZoom(): number;
|
|
51
52
|
set geoid(arg: any);
|
|
52
53
|
get geoid(): any;
|
|
54
|
+
getGeoid(): any;
|
|
53
55
|
/**
|
|
54
56
|
* Loads or creates segment elevation data.
|
|
55
57
|
* @public
|
|
@@ -57,7 +59,7 @@ export class EmptyTerrain {
|
|
|
57
59
|
* @param {Segment} segment - Segment to create elevation data.
|
|
58
60
|
*/
|
|
59
61
|
public handleSegmentTerrain(segment: Segment): void;
|
|
60
|
-
isReady():
|
|
62
|
+
isReady(): boolean;
|
|
61
63
|
/**
|
|
62
64
|
* Abstract function
|
|
63
65
|
* @public
|
package/types/terrain/Geoid.d.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
export class Geoid {
|
|
2
|
-
static loadModel(url: any): Promise<
|
|
3
|
-
scale: number;
|
|
4
|
-
offset: number;
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
7
|
-
rlonres: number;
|
|
8
|
-
rlatres: number;
|
|
9
|
-
i: number;
|
|
10
|
-
rawfile: Uint8Array;
|
|
11
|
-
}>;
|
|
2
|
+
static loadModel(url: any): Promise<any>;
|
|
12
3
|
constructor(options?: {});
|
|
13
4
|
model: any;
|
|
14
5
|
src: any;
|
|
@@ -48,7 +48,6 @@ export class GlobusTerrain extends EmptyTerrain {
|
|
|
48
48
|
* @returns {string} - Url query string.
|
|
49
49
|
*/
|
|
50
50
|
private _urlRewriteCallback;
|
|
51
|
-
getGeoid(): any;
|
|
52
51
|
getHeightAsync(lonLat: any, callback: any, zoom: any): boolean;
|
|
53
52
|
getTileCache(lonLat: any, z: any): any;
|
|
54
53
|
_getGroundHeightMerc(merc: any, tileData: any): number;
|