@openglobus/og 0.15.3 → 0.15.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.
- package/css/og.css +24 -15
- 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 +1 -1
- package/src/og/Globe.js +4 -0
- package/src/og/Object3d.js +1 -1
- package/src/og/control/DebugInfo.js +263 -165
- package/src/og/control/RulerSwitcher.js +4 -1
- package/src/og/control/SimpleNavigation.js +123 -128
- package/src/og/control/heightRuler/HeightRuler.js +12 -0
- package/src/og/control/heightRuler/HeightRulerScene.js +224 -0
- package/src/og/control/heightRuler/HeightRulerSwitcher.js +15 -0
- package/src/og/control/index.js +2 -0
- package/src/og/control/ruler/RulerScene.js +106 -79
- package/src/og/entity/Entity.js +6 -6
- package/src/og/entity/EntityCollection.js +4 -0
- package/src/og/entity/GeoObjectHandler.js +3 -0
- package/src/og/layer/BaseGeoImage.js +152 -16
- package/src/og/layer/GeoImage.js +0 -91
- package/src/og/layer/GeoTexture2d.js +54 -143
- package/src/og/layer/GeoVideo.js +6 -107
- package/src/og/layer/Material.js +1 -1
- package/src/og/layer/Vector.js +1 -0
- package/src/og/renderer/Renderer.js +90 -94
- package/src/og/renderer/RendererEvents.js +39 -23
- package/src/og/scene/BaseNode.js +113 -113
- package/src/og/scene/Planet.js +11 -8
- package/src/og/scene/RenderNode.js +42 -9
- package/src/og/segment/Segment.js +3 -3
- package/src/og/shaders/geoObject.js +12 -10
- package/src/og/shaders/pickingMask.js +1 -1
- package/src/og/utils/GeoImageCreator.js +61 -21
- package/src/og/utils/VectorTileCreator.js +32 -49
- package/src/og/webgl/Framebuffer.js +5 -0
- package/types/control/DebugInfo.d.ts +4 -0
- package/types/control/SimpleNavigation.d.ts +1 -0
- package/types/control/heightRuler/HeightRuler.d.ts +6 -0
- package/types/control/heightRuler/HeightRulerScene.d.ts +23 -0
- package/types/control/index.d.ts +2 -1
- package/types/control/ruler/RulerScene.d.ts +8 -5
- package/types/control/selection/SelectionScene.d.ts +0 -1
- package/types/entity/EntityCollection.d.ts +1 -0
- package/types/layer/BaseGeoImage.d.ts +17 -3
- package/types/layer/GeoImage.d.ts +0 -8
- package/types/layer/GeoTexture2d.d.ts +0 -2
- package/types/layer/GeoVideo.d.ts +0 -8
- package/types/renderer/Renderer.d.ts +12 -3
- package/types/scene/Axes.d.ts +1 -1
- package/types/scene/BaseNode.d.ts +2 -2
- package/types/scene/Planet.d.ts +0 -5
- package/types/scene/RenderNode.d.ts +16 -9
- package/types/scene/SkyBox.d.ts +1 -1
- package/types/utils/VectorTileCreator.d.ts +1 -3
- package/types/webgl/Framebuffer.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openglobus/og",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.4",
|
|
4
4
|
"description": "[OpenGlobus](https://www.openglobus.org/) is a javascript library designed to display interactive 3d maps and planets with map tiles, imagery and vector data, markers and 3d objects. It uses the WebGL technology, open source and completely free.",
|
|
5
5
|
"directories": {
|
|
6
6
|
"example": "./sandbox"
|
package/src/og/Globe.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// StandWithUkraine
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* @module og/Globe
|
|
3
5
|
*/
|
|
@@ -76,6 +78,8 @@ class Globe {
|
|
|
76
78
|
* @param {*} options
|
|
77
79
|
*/
|
|
78
80
|
constructor(options) {
|
|
81
|
+
window.__globus__ = this;
|
|
82
|
+
|
|
79
83
|
// Canvas creation
|
|
80
84
|
var _canvasId = CANVAS_ID_PREFIX + Globe._staticCounter++;
|
|
81
85
|
|
package/src/og/Object3d.js
CHANGED
|
@@ -44,7 +44,7 @@ class Object3d {
|
|
|
44
44
|
this._normals = data.normals || [];
|
|
45
45
|
} else {
|
|
46
46
|
this._normals = Object3d.getNormals(this._vertices);
|
|
47
|
-
this._indices = new Array(this._vertices.length);
|
|
47
|
+
this._indices = new Array(this._vertices.length/ 3);
|
|
48
48
|
for (let i = 0, len = this._indices.length; i < len; i++) {
|
|
49
49
|
this._indices[i] = i;
|
|
50
50
|
}
|
|
@@ -1,165 +1,263 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module og/control/DebugInfo
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
"use strict";
|
|
6
|
-
|
|
7
|
-
import { Control } from "./Control.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
{
|
|
142
|
-
label: "
|
|
143
|
-
frame: () => p.
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
label: "
|
|
147
|
-
frame: () => p.
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @module og/control/DebugInfo
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
|
|
7
|
+
import { Control } from "./Control.js";
|
|
8
|
+
import { ToggleButton } from "../ui/ToggleButton.js";
|
|
9
|
+
import { Dialog } from "../ui/Dialog.js";
|
|
10
|
+
|
|
11
|
+
const ICON_LOCK_BUTTON_SVG = `<?xml version="1.0" encoding="utf-8"?>
|
|
12
|
+
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
|
13
|
+
<svg fill="#000000" width="800px" height="800px" viewBox="-7.5 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
|
14
|
+
<title>lock</title>
|
|
15
|
+
<path d="M14.625 15.156h2.094c0.281 0 0.5 0.25 0.5 0.531v11c0 0.281-0.219 0.5-0.5 0.5h-16.219c-0.281 0-0.5-0.219-0.5-0.5v-11c0-0.281 0.219-0.531 0.5-0.531h2.031v-5.125c0-2.875 1.844-5.25 4.688-5.25h2.688c2.875 0 4.719 2.375 4.719 5.25v5.125zM5.188 15.156h6.813v-4.875c0-1.594-1.313-2.938-2.938-2.938h-0.969c-1.594 0-2.906 1.344-2.906 2.938v4.875zM7.156 24h2.906l-0.719-3.156c0.5-0.25 0.844-0.781 0.844-1.375 0-0.906-0.719-1.594-1.594-1.594s-1.563 0.688-1.563 1.594c0 0.594 0.344 1.125 0.844 1.375z"></path>
|
|
16
|
+
</svg>`;
|
|
17
|
+
|
|
18
|
+
const ICON_BUTTON_SVG = `<?xml version="1.0" encoding="iso-8859-1"?>
|
|
19
|
+
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
|
20
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
21
|
+
<svg fill="#000000" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
22
|
+
\t width="800px" height="800px" viewBox="0 0 932.179 932.179"
|
|
23
|
+
\t xml:space="preserve">
|
|
24
|
+
<g>
|
|
25
|
+
\t<path d="M61.2,341.538c4.9,16.8,11.7,33,20.3,48.2l-24.5,30.9c-8,10.1-7.1,24.5,1.9,33.6l42.2,42.2c9.1,9.1,23.5,9.899,33.6,1.899
|
|
26
|
+
\t\tl30.7-24.3c15.8,9.101,32.6,16.2,50.1,21.2l4.6,39.5c1.5,12.8,12.3,22.4,25.1,22.4h59.7c12.8,0,23.6-9.601,25.1-22.4l4.4-38.1
|
|
27
|
+
\t\tc18.8-4.9,36.8-12.2,53.7-21.7l29.7,23.5c10.1,8,24.5,7.1,33.6-1.9l42.2-42.2c9.1-9.1,9.9-23.5,1.9-33.6l-23.1-29.3
|
|
28
|
+
\t\tc9.6-16.601,17.1-34.3,22.1-52.8l35.6-4.1c12.801-1.5,22.4-12.3,22.4-25.1v-59.7c0-12.8-9.6-23.6-22.4-25.1l-35.1-4.1
|
|
29
|
+
\t\tc-4.801-18.3-12-35.8-21.199-52.2l21.6-27.3c8-10.1,7.1-24.5-1.9-33.6l-42.1-42.1c-9.1-9.1-23.5-9.9-33.6-1.9l-26.5,21
|
|
30
|
+
\t\tc-17.2-10.1-35.601-17.8-54.9-23l-4-34.3c-1.5-12.8-12.3-22.4-25.1-22.4h-59.7c-12.8,0-23.6,9.6-25.1,22.4l-4,34.3
|
|
31
|
+
\t\tc-19.8,5.3-38.7,13.3-56.3,23.8l-27.5-21.8c-10.1-8-24.5-7.1-33.6,1.9l-42.2,42.2c-9.1,9.1-9.9,23.5-1.9,33.6l23,29.1
|
|
32
|
+
\t\tc-9.2,16.6-16.2,34.3-20.8,52.7l-36.8,4.2c-12.8,1.5-22.4,12.3-22.4,25.1v59.7c0,12.8,9.6,23.6,22.4,25.1L61.2,341.538z
|
|
33
|
+
\t\t M277.5,180.038c54.4,0,98.7,44.3,98.7,98.7s-44.3,98.7-98.7,98.7c-54.399,0-98.7-44.3-98.7-98.7S223.1,180.038,277.5,180.038z"/>
|
|
34
|
+
\t<path d="M867.699,356.238l-31.5-26.6c-9.699-8.2-24-7.8-33.199,0.9l-17.4,16.3c-14.699-7.1-30.299-12.1-46.4-15l-4.898-24
|
|
35
|
+
\t\tc-2.5-12.4-14-21-26.602-20l-41.1,3.5c-12.6,1.1-22.5,11.4-22.9,24.1l-0.799,24.4c-15.801,5.7-30.701,13.5-44.301,23.3
|
|
36
|
+
\t\tl-20.799-13.8c-10.602-7-24.701-5-32.9,4.7l-26.6,31.7c-8.201,9.7-7.801,24,0.898,33.2l18.201,19.399
|
|
37
|
+
\t\tc-6.301,14.2-10.801,29.101-13.4,44.4l-26,5.3c-12.4,2.5-21,14-20,26.601l3.5,41.1c1.1,12.6,11.4,22.5,24.1,22.9l28.1,0.899
|
|
38
|
+
\t\tc5.102,13.4,11.801,26.101,19.9,38l-15.699,23.7c-7,10.6-5,24.7,4.699,32.9l31.5,26.6c9.701,8.2,24,7.8,33.201-0.9l20.6-19.3
|
|
39
|
+
\t\tc13.5,6.3,27.699,11,42.299,13.8l5.701,28.2c2.5,12.4,14,21,26.6,20l41.1-3.5c12.6-1.1,22.5-11.399,22.9-24.1l0.9-27.601
|
|
40
|
+
\t\tc15-5.3,29.199-12.5,42.299-21.399l22.701,15c10.6,7,24.699,5,32.9-4.7l26.6-31.5c8.199-9.7,7.799-24-0.9-33.2l-18.301-19.399
|
|
41
|
+
\t\tc6.701-14.2,11.602-29.2,14.4-44.601l25-5.1c12.4-2.5,21-14,20-26.601l-3.5-41.1c-1.1-12.6-11.4-22.5-24.1-22.9l-25.1-0.8
|
|
42
|
+
\t\tc-5.201-14.6-12.201-28.399-20.9-41.2l13.699-20.6C879.4,378.638,877.4,364.438,867.699,356.238z M712.801,593.837
|
|
43
|
+
\t\tc-44.4,3.801-83.602-29.3-87.301-73.699c-3.801-44.4,29.301-83.601,73.699-87.301c44.4-3.8,83.602,29.301,87.301,73.7
|
|
44
|
+
\t\tC790.301,550.938,757.199,590.138,712.801,593.837z"/>
|
|
45
|
+
\t<path d="M205,704.438c-12.6,1.3-22.3,11.899-22.4,24.6l-0.3,25.3c-0.2,12.7,9.2,23.5,21.8,25.101l18.6,2.399
|
|
46
|
+
\t\tc3.1,11.301,7.5,22.101,13.2,32.301l-12,14.8c-8,9.899-7.4,24.1,1.5,33.2l17.7,18.1c8.9,9.1,23.1,10.1,33.2,2.3l14.899-11.5
|
|
47
|
+
\t\tc10.5,6.2,21.601,11.101,33.2,14.5l2,19.2c1.3,12.6,11.9,22.3,24.6,22.4l25.301,0.3c12.699,0.2,23.5-9.2,25.1-21.8l2.3-18.2
|
|
48
|
+
\t\tc12.601-3.101,24.601-7.8,36-14l14,11.3c9.9,8,24.101,7.4,33.201-1.5l18.1-17.7c9.1-8.899,10.1-23.1,2.301-33.2L496.6,818.438
|
|
49
|
+
\t\tc6.6-11,11.701-22.7,15.201-35l16.6-1.7c12.6-1.3,22.299-11.9,22.4-24.6l0.299-25.301c0.201-12.699-9.199-23.5-21.799-25.1
|
|
50
|
+
\t\tl-16.201-2.1c-3.1-12.2-7.699-24-13.699-35l10.1-12.4c8-9.9,7.4-24.1-1.5-33.2l-17.699-18.1c-8.9-9.101-23.102-10.101-33.201-2.3
|
|
51
|
+
\t\tl-12.101,9.3c-11.399-6.9-23.6-12.2-36.399-15.8l-1.601-15.7c-1.3-12.601-11.899-22.3-24.6-22.4l-25.3-0.3
|
|
52
|
+
\t\tc-12.7-0.2-23.5,9.2-25.101,21.8l-2,15.601c-13.199,3.399-25.899,8.6-37.699,15.399l-12.5-10.2c-9.9-8-24.101-7.399-33.201,1.5
|
|
53
|
+
\t\tl-18.2,17.801c-9.1,8.899-10.1,23.1-2.3,33.199l10.7,13.801c-6.2,11-11.1,22.699-14.3,35L205,704.438z M368.3,675.837
|
|
54
|
+
\t\tc36.3,0.4,65.399,30.301,65,66.601c-0.4,36.3-30.301,65.399-66.601,65c-36.3-0.4-65.399-30.3-65-66.601
|
|
55
|
+
\t\tC302.1,704.538,332,675.438,368.3,675.837z"/>
|
|
56
|
+
</g>
|
|
57
|
+
</svg>`;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Debug information
|
|
61
|
+
* @class
|
|
62
|
+
* @extends {Control}
|
|
63
|
+
* @param {Object} [options] - Control options.
|
|
64
|
+
*/
|
|
65
|
+
class DebugInfo extends Control {
|
|
66
|
+
/**
|
|
67
|
+
* @param {Object} [options] - Control options.
|
|
68
|
+
*/
|
|
69
|
+
constructor(options = {}) {
|
|
70
|
+
if (!options.name || options.name === "") {
|
|
71
|
+
options.name = "DebugInfo";
|
|
72
|
+
}
|
|
73
|
+
super(options);
|
|
74
|
+
this.el = null;
|
|
75
|
+
this._watch = options.watch || [];
|
|
76
|
+
|
|
77
|
+
this._toggleBtn = new ToggleButton({
|
|
78
|
+
classList: ["og-map-button", "og-debuginfo_button"],
|
|
79
|
+
icon: ICON_BUTTON_SVG
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
this._dialog = new Dialog({
|
|
83
|
+
title: "Debug Info",
|
|
84
|
+
visible: false,
|
|
85
|
+
useHide: true,
|
|
86
|
+
top: 120,
|
|
87
|
+
left: 60,
|
|
88
|
+
width: 480
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
this._dialog.on("visibility", (v) => {
|
|
92
|
+
this._toggleBtn.setActive(v);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
addWatches(watches) {
|
|
97
|
+
for (var i = 0; i < watches.length; i++) {
|
|
98
|
+
this.addWatch(watches[i]);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
addWatch(watch) {
|
|
103
|
+
this._watch.push(watch);
|
|
104
|
+
let watchEl = document.createElement("div");
|
|
105
|
+
watchEl.classList.add("og-watch-line");
|
|
106
|
+
watchEl.innerHTML =
|
|
107
|
+
'<div class="og-watch-label">' +
|
|
108
|
+
watch.label +
|
|
109
|
+
'</div><div class="og-watch-value"></div>';
|
|
110
|
+
watch.valEl = watchEl.querySelector(".og-watch-value");
|
|
111
|
+
this.el.appendChild(watchEl);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
oninit() {
|
|
115
|
+
|
|
116
|
+
this._toggleBtn.appendTo(this.renderer.div);
|
|
117
|
+
this._dialog.appendTo(this.renderer.div);
|
|
118
|
+
this._toggleBtn.on("change", (isActive) => {
|
|
119
|
+
this._dialog.setVisibility(isActive);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
this.el = document.createElement("div");
|
|
123
|
+
this.el.className = "og-debug-info";
|
|
124
|
+
|
|
125
|
+
let $controls = document.createElement("div");
|
|
126
|
+
$controls.classList.add("og-debuginfo_controls");
|
|
127
|
+
this.el.appendChild($controls);
|
|
128
|
+
|
|
129
|
+
var temp = this._watch;
|
|
130
|
+
this._watch = [];
|
|
131
|
+
for (var i = 0; i < temp.length; i++) {
|
|
132
|
+
this.addWatch(temp[i]);
|
|
133
|
+
}
|
|
134
|
+
this._dialog.container.appendChild(this.el);
|
|
135
|
+
this.renderer.events.on("draw", this._frame, this);
|
|
136
|
+
|
|
137
|
+
let p = this.planet;
|
|
138
|
+
|
|
139
|
+
if (p) {
|
|
140
|
+
this.addWatches([
|
|
141
|
+
{
|
|
142
|
+
label: "Nodes count",
|
|
143
|
+
frame: () => p._renderedNodes.length
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
label: "createdNodes",
|
|
147
|
+
frame: () => p._createdNodesCount
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
label: "indexesCache",
|
|
151
|
+
frame: () => p._indexesCacheToRemoveCounter
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
label: "distBeforeMemClear",
|
|
155
|
+
frame: () => Math.round(p._distBeforeMemClear)
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
label: "maxZoom/minZoom",
|
|
159
|
+
frame: () => p.maxCurrZoom + " / " + p.minCurrZoom
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
label: "viewExtent",
|
|
163
|
+
frame: () => p.getViewExtent().toString()
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
label: "height/alt (km)",
|
|
167
|
+
frame: () =>
|
|
168
|
+
`<div style="width:190px">${(p.camera._lonLat.height / 1000.0).toFixed(2) +
|
|
169
|
+
" / " +
|
|
170
|
+
(p.camera.getAltitude() / 1000.0).toFixed(2)
|
|
171
|
+
}</div>`
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
label: "cam.slope",
|
|
175
|
+
frame: () => p.camera.slope.toFixed(3)
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
label: "lodSize",
|
|
179
|
+
frame: () => Math.round(p.lodSize)
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
label: "deltaTime/FPS",
|
|
183
|
+
frame: () =>
|
|
184
|
+
`<div style="width:70px"><div style="width:20px; float: left;">${Math.round(
|
|
185
|
+
p.renderer.handler.deltaTime
|
|
186
|
+
)}</div> <div style="float: left">${Math.round(
|
|
187
|
+
1000.0 / p.renderer.handler.deltaTime
|
|
188
|
+
)}</div></div>`
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
label: "-------------------------"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
label: "_renderCompleted / renderCompletedActivated",
|
|
195
|
+
frame: () => `${p._renderCompleted} / ${p._renderCompletedActivated}`
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
label: "_terrainCompleted / terrainCompletedActivated",
|
|
199
|
+
frame: () => `${p._terrainCompleted} / ${p._terrainCompletedActivated}`
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
label: "PlainWorker",
|
|
203
|
+
frame: () => p._plainSegmentWorker._pendingQueue.length
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
label: "TileLoader",
|
|
207
|
+
frame: () => p._tileLoader._loading + " " + p._tileLoader._queue.length
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
label: "TerrainLoader",
|
|
211
|
+
frame: () => {
|
|
212
|
+
if (p.terrain && p.terrain._loader) {
|
|
213
|
+
return (
|
|
214
|
+
p.terrain._loader._loading + " " + p.terrain._loader._queue.length
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
return "";
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
label: "TerrainWorker",
|
|
222
|
+
frame: () => p._terrainWorker._pendingQueue.length
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
label: "NormalMapCreator",
|
|
226
|
+
frame: () => p._normalMapCreator._queue.length
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
label: "VectorTileCreator",
|
|
230
|
+
frame: () => p._vectorTileCreator._queue.length
|
|
231
|
+
}
|
|
232
|
+
]);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
let lockTreeBtn = new ToggleButton({
|
|
236
|
+
classList: ["og-debuginfo_controls-button"],
|
|
237
|
+
icon: ICON_LOCK_BUTTON_SVG,
|
|
238
|
+
title: "Lock/Unlock quad tree"
|
|
239
|
+
});
|
|
240
|
+
lockTreeBtn.appendTo($controls);
|
|
241
|
+
|
|
242
|
+
lockTreeBtn.on("change", (isActive) => {
|
|
243
|
+
if (isActive) {
|
|
244
|
+
p.lockQuadTree();
|
|
245
|
+
} else {
|
|
246
|
+
p.unlockQuadTree();
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
_frame() {
|
|
252
|
+
for (var i = 0; i < this._watch.length; i++) {
|
|
253
|
+
var w = this._watch[i];
|
|
254
|
+
w.valEl.innerHTML = w.frame ? w.frame() : "";
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export function debugInfo(options) {
|
|
260
|
+
return new DebugInfo(options);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export { DebugInfo };
|
|
@@ -32,7 +32,10 @@ const ICON_BUTTON_SVG = `<?xml version="1.0" encoding="iso-8859-1"?>
|
|
|
32
32
|
*/
|
|
33
33
|
class RulerSwitcher extends Control {
|
|
34
34
|
constructor(options = {}) {
|
|
35
|
-
super(
|
|
35
|
+
super({
|
|
36
|
+
name: "RulerSwitcher",
|
|
37
|
+
...options
|
|
38
|
+
});
|
|
36
39
|
|
|
37
40
|
this.ruler = new Ruler({
|
|
38
41
|
ignoreTerrain: options.ignoreTerrain
|