@openglobus/og 0.13.3 → 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 +340 -319
- package/src/og/control/ZoomControl.js +1 -1
- package/src/og/ellipsoid/Ellipsoid.js +1 -1
- package/src/og/entity/Billboard.js +165 -165
- package/src/og/entity/BillboardHandler.js +1 -1
- package/src/og/entity/GeoObject.js +4 -0
- package/src/og/entity/GeoObjectHandler.js +22 -33
- package/src/og/entity/Geometry.js +319 -319
- package/src/og/entity/Label.js +348 -346
- package/src/og/entity/LabelHandler.js +44 -37
- 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 +1065 -1051
- package/src/og/scene/Planet.js +45 -27
- package/src/og/shaders/billboard.js +8 -0
- package/src/og/shaders/label.js +56 -13
- 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/FontAtlas.js +25 -15
- package/src/og/utils/PlainSegmentWorker.js +38 -26
- package/src/og/utils/TextureAtlas.js +291 -280
- package/types/control/KeyboardNavigation.d.ts +3 -0
- package/types/entity/GeoObject.d.ts +1 -0
- package/types/entity/Label.d.ts +1 -0
- package/types/entity/LabelHandler.d.ts +1 -1
- 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
- package/types/utils/TextureAtlas.d.ts +2 -0
package/src/og/terrain/Geoid.js
CHANGED
|
@@ -1,242 +1,247 @@
|
|
|
1
|
-
/* This file is mostly a straight translation of
|
|
2
|
-
* GeographicLib/src/Geoid.cpp from C++ to JavaScript
|
|
3
|
-
* by Kim Vandry <vandry@TZoNE.ORG>
|
|
4
|
-
*
|
|
5
|
-
* @license
|
|
6
|
-
* **
|
|
7
|
-
* * \file Geoid.cpp
|
|
8
|
-
* * \brief Implementation for GeographicLib::Geoid class
|
|
9
|
-
* *
|
|
10
|
-
* * Copyright (c) Charles Karney (2009) <charles@karney.com>
|
|
11
|
-
* * and licensed under the LGPL. For more information, see
|
|
12
|
-
* * http://geographiclib.sourceforge.net/
|
|
13
|
-
* **********************************************************************
|
|
14
|
-
*
|
|
15
|
-
* Geoid height grade not supported
|
|
16
|
-
* The files can be downloaded from here:
|
|
17
|
-
* http://geographiclib.sourceforge.net/1.18/geoid.html
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
//window.myGeoid = new Geoid();
|
|
21
|
-
|
|
22
|
-
//Geoid.loadModel("./res/egm84-30.pgm")
|
|
23
|
-
// .then(function (model) {
|
|
24
|
-
// myGeoid.setModel(model);
|
|
25
|
-
|
|
26
|
-
// globe.planet.renderer.events.on("lclick", (e) => {
|
|
27
|
-
// let c = globe.planet.getLonLatFromPixelTerrain(e);
|
|
28
|
-
// let h = myGeoid.getHeight(c.lon, c.lat);
|
|
29
|
-
// console.log(`${c.lat} ${c.lon} h=${h}`);
|
|
30
|
-
// });
|
|
31
|
-
// })
|
|
32
|
-
// .catch(function (err) {
|
|
33
|
-
// // If we get here, the model failed to load
|
|
34
|
-
// console.log(err);
|
|
35
|
-
// });
|
|
36
|
-
|
|
37
|
-
'use strict';
|
|
38
|
-
|
|
39
|
-
class Geoid {
|
|
40
|
-
constructor(options = {}) {
|
|
41
|
-
|
|
42
|
-
this.model = options.model || null;
|
|
43
|
-
this.src = options.src || null;
|
|
44
|
-
|
|
45
|
-
this._cached_ix = null;
|
|
46
|
-
this._cached_iy = null;
|
|
47
|
-
this._v00 = null;
|
|
48
|
-
this._v01 = null;
|
|
49
|
-
this._v10 = null;
|
|
50
|
-
this._v11 = null;
|
|
51
|
-
this._t = null;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
static loadModel(url) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
var
|
|
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
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
if (
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
this.
|
|
228
|
-
this.
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
h =
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
1
|
+
/* This file is mostly a straight translation of
|
|
2
|
+
* GeographicLib/src/Geoid.cpp from C++ to JavaScript
|
|
3
|
+
* by Kim Vandry <vandry@TZoNE.ORG>
|
|
4
|
+
*
|
|
5
|
+
* @license
|
|
6
|
+
* **
|
|
7
|
+
* * \file Geoid.cpp
|
|
8
|
+
* * \brief Implementation for GeographicLib::Geoid class
|
|
9
|
+
* *
|
|
10
|
+
* * Copyright (c) Charles Karney (2009) <charles@karney.com>
|
|
11
|
+
* * and licensed under the LGPL. For more information, see
|
|
12
|
+
* * http://geographiclib.sourceforge.net/
|
|
13
|
+
* **********************************************************************
|
|
14
|
+
*
|
|
15
|
+
* Geoid height grade not supported
|
|
16
|
+
* The files can be downloaded from here:
|
|
17
|
+
* http://geographiclib.sourceforge.net/1.18/geoid.html
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
//window.myGeoid = new Geoid();
|
|
21
|
+
|
|
22
|
+
//Geoid.loadModel("./res/egm84-30.pgm")
|
|
23
|
+
// .then(function (model) {
|
|
24
|
+
// myGeoid.setModel(model);
|
|
25
|
+
|
|
26
|
+
// globe.planet.renderer.events.on("lclick", (e) => {
|
|
27
|
+
// let c = globe.planet.getLonLatFromPixelTerrain(e);
|
|
28
|
+
// let h = myGeoid.getHeight(c.lon, c.lat);
|
|
29
|
+
// console.log(`${c.lat} ${c.lon} h=${h}`);
|
|
30
|
+
// });
|
|
31
|
+
// })
|
|
32
|
+
// .catch(function (err) {
|
|
33
|
+
// // If we get here, the model failed to load
|
|
34
|
+
// console.log(err);
|
|
35
|
+
// });
|
|
36
|
+
|
|
37
|
+
'use strict';
|
|
38
|
+
|
|
39
|
+
class Geoid {
|
|
40
|
+
constructor(options = {}) {
|
|
41
|
+
|
|
42
|
+
this.model = options.model || null;
|
|
43
|
+
this.src = options.src || null;
|
|
44
|
+
|
|
45
|
+
this._cached_ix = null;
|
|
46
|
+
this._cached_iy = null;
|
|
47
|
+
this._v00 = null;
|
|
48
|
+
this._v01 = null;
|
|
49
|
+
this._v10 = null;
|
|
50
|
+
this._v11 = null;
|
|
51
|
+
this._t = null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static loadModel(url) {
|
|
55
|
+
if (!url) {
|
|
56
|
+
return new Promise((resolve) => {
|
|
57
|
+
resolve(null);
|
|
58
|
+
});
|
|
59
|
+
} else
|
|
60
|
+
|
|
61
|
+
return fetch(url, {})
|
|
62
|
+
|
|
63
|
+
.then((r) => {
|
|
64
|
+
if (!r.ok) {
|
|
65
|
+
throw Error("Geoid model file: HTTP error " + r.status);
|
|
66
|
+
}
|
|
67
|
+
return r.arrayBuffer();
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
.then((r) => {
|
|
71
|
+
if (r) {
|
|
72
|
+
return new Uint8Array(r);
|
|
73
|
+
} else {
|
|
74
|
+
throw Error("Geoid model file: no data from " + url);
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
.then(function (rawfile) {
|
|
79
|
+
|
|
80
|
+
if (!((rawfile[0] === 80) && (rawfile[1] === 53) && (
|
|
81
|
+
((rawfile[2] === 13) && (rawfile[3] === 10)) ||
|
|
82
|
+
(rawfile[2] === 10)
|
|
83
|
+
))) {
|
|
84
|
+
throw new Error("Geoid model file: no PGM header");
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
var i = (rawfile[2] === 13) ? 4 : 3;
|
|
88
|
+
var offset = null;
|
|
89
|
+
var scale = null;
|
|
90
|
+
|
|
91
|
+
function getline() {
|
|
92
|
+
var start = i;
|
|
93
|
+
for (var j = i; ; j++) {
|
|
94
|
+
if (j >= rawfile.length) {
|
|
95
|
+
throw new Error("Geoid model file: missing newline in header");
|
|
96
|
+
}
|
|
97
|
+
if (rawfile[j] === 10) {
|
|
98
|
+
i = j + 1;
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if ((j > start) && (rawfile[j - 1] === 13)) j--;
|
|
103
|
+
return String.fromCharCode.apply(null, rawfile.slice(start, j));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
var m, s;
|
|
107
|
+
for (; ;) {
|
|
108
|
+
s = getline();
|
|
109
|
+
if (s[0] !== '#') break;
|
|
110
|
+
m = s.match(/^# Offset (.*)$/);
|
|
111
|
+
if (m) {
|
|
112
|
+
offset = parseInt(m[1], 10);
|
|
113
|
+
if (!isFinite(offset)) {
|
|
114
|
+
throw new Error("Geoid model file: bad offset " + m[1]);
|
|
115
|
+
}
|
|
116
|
+
} else {
|
|
117
|
+
m = s.match(/^# Scale (.*)$/);
|
|
118
|
+
if (m) {
|
|
119
|
+
scale = parseFloat(m[1]);
|
|
120
|
+
if (!isFinite(scale)) {
|
|
121
|
+
throw new Error("Geoid model file: bad scale " + m[1]);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
m = s.match(/^\s*(\d+)\s+(\d+)\s*$/);
|
|
128
|
+
|
|
129
|
+
var width = null;
|
|
130
|
+
var height = null;
|
|
131
|
+
|
|
132
|
+
if (m) {
|
|
133
|
+
width = parseInt(m[1], 10);
|
|
134
|
+
height = parseInt(m[2], 10);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (!(m && (width >= 0) && (height >= 0))) {
|
|
138
|
+
throw new Error("Geoid model file: bad PGM width&height line");
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
var levels = parseInt(getline());
|
|
142
|
+
|
|
143
|
+
if (levels != 65535) {
|
|
144
|
+
throw new Error("Geoid model file: PGM file must have 65535 gray levels");
|
|
145
|
+
}
|
|
146
|
+
if (offset === null) {
|
|
147
|
+
throw new Error("Geoid model file: PGM file does not contain offset");
|
|
148
|
+
}
|
|
149
|
+
if (scale === null) {
|
|
150
|
+
throw new Error("Geoid model file: PGM file does not contain scale");
|
|
151
|
+
}
|
|
152
|
+
if ((width < 2) || (height < 2)) {
|
|
153
|
+
throw new Error("Geoid model file: Raster size too small");
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
var payload_len = rawfile.length - i;
|
|
157
|
+
|
|
158
|
+
if (payload_len !== (width * height * 2)) {
|
|
159
|
+
throw new Error("Geoid model file: File has the wrong length");
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return {
|
|
163
|
+
scale: scale,
|
|
164
|
+
offset: offset,
|
|
165
|
+
width: width,
|
|
166
|
+
height: height,
|
|
167
|
+
rlonres: width / 360,
|
|
168
|
+
rlatres: (height - 1) / 180,
|
|
169
|
+
i: i,
|
|
170
|
+
rawfile: rawfile
|
|
171
|
+
};
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
setModel(model) {
|
|
176
|
+
this.model = model;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
_rawval(ix, iy) {
|
|
180
|
+
let model = this.model;
|
|
181
|
+
|
|
182
|
+
if (iy < 0) {
|
|
183
|
+
iy = -iy;
|
|
184
|
+
ix += model.width / 2;
|
|
185
|
+
} else if (iy >= model.height) {
|
|
186
|
+
iy = 2 * (model.height - 1) - iy;
|
|
187
|
+
ix += model.width / 2;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (ix < 0) {
|
|
191
|
+
ix += model.width;
|
|
192
|
+
} else if (ix >= model.width) {
|
|
193
|
+
ix -= model.width;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
var k = (iy * model.width + ix) * 2 + model.i;
|
|
197
|
+
|
|
198
|
+
return (model.rawfile[k] << 8) | model.rawfile[k + 1];
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
getHeightLonLat(lonlat) {
|
|
202
|
+
return this.getHeight(lonlat.lon, lonlat.lat);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
getHeight(lon, lat) {
|
|
206
|
+
|
|
207
|
+
if (!this.model) return 0;
|
|
208
|
+
|
|
209
|
+
let model = this.model;
|
|
210
|
+
|
|
211
|
+
if (lon < 0) lon += 360.0;
|
|
212
|
+
|
|
213
|
+
var fy = (90 - lat) * model.rlatres;
|
|
214
|
+
var fx = lon * model.rlonres;
|
|
215
|
+
var iy = Math.floor(fy);
|
|
216
|
+
var ix = Math.floor(fx);
|
|
217
|
+
|
|
218
|
+
fx -= ix;
|
|
219
|
+
fy -= iy;
|
|
220
|
+
|
|
221
|
+
if (iy === (model.height - 1)) {
|
|
222
|
+
iy--;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if ((this._cached_ix !== ix) || (this._cached_iy !== iy)) {
|
|
226
|
+
|
|
227
|
+
this._cached_ix = ix;
|
|
228
|
+
this._cached_iy = iy;
|
|
229
|
+
|
|
230
|
+
this._v00 = this._rawval(ix, iy);
|
|
231
|
+
this._v01 = this._rawval(ix + 1, iy);
|
|
232
|
+
this._v10 = this._rawval(ix, iy + 1);
|
|
233
|
+
this._v11 = this._rawval(ix + 1, iy + 1);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
let h = null;
|
|
237
|
+
|
|
238
|
+
var a = (1 - fx) * this._v00 + fx * this._v01;
|
|
239
|
+
var b = (1 - fx) * this._v10 + fx * this._v11;
|
|
240
|
+
|
|
241
|
+
h = (1 - fy) * a + fy * b;
|
|
242
|
+
|
|
243
|
+
return model.offset + model.scale * h;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
242
247
|
export { Geoid };
|
|
@@ -54,10 +54,8 @@ class GlobusTerrain extends EmptyTerrain {
|
|
|
54
54
|
* @param {string} [name]
|
|
55
55
|
* @param {*} [options]
|
|
56
56
|
*/
|
|
57
|
-
constructor(name, options) {
|
|
58
|
-
super();
|
|
59
|
-
|
|
60
|
-
options = options || {};
|
|
57
|
+
constructor(name, options = {}) {
|
|
58
|
+
super({ geoidSrc: "//openglobus.org/geoid/egm84-30.pgm", ...options });
|
|
61
59
|
|
|
62
60
|
/**
|
|
63
61
|
* Events handler.
|
|
@@ -116,12 +114,6 @@ class GlobusTerrain extends EmptyTerrain {
|
|
|
116
114
|
*/
|
|
117
115
|
this.plainGridSize = options.plainGridSize || 32;
|
|
118
116
|
|
|
119
|
-
this._geoid =
|
|
120
|
-
options.geoid ||
|
|
121
|
-
new Geoid({
|
|
122
|
-
src: options.geoidSrc || "//openglobus.org/geoid/egm84-30.pgm"
|
|
123
|
-
});
|
|
124
|
-
|
|
125
117
|
this._extent = createExtent(
|
|
126
118
|
options.extent,
|
|
127
119
|
new Extent(new LonLat(-180.0, -90.0), new LonLat(180.0, 90.0))
|
|
@@ -167,10 +159,6 @@ class GlobusTerrain extends EmptyTerrain {
|
|
|
167
159
|
this._fetchCache = {};
|
|
168
160
|
}
|
|
169
161
|
|
|
170
|
-
getGeoid() {
|
|
171
|
-
return this._geoid;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
162
|
isBlur(segment) {
|
|
175
163
|
if (segment.tileZoom >= 8) {
|
|
176
164
|
return true;
|
|
@@ -216,17 +204,20 @@ class GlobusTerrain extends EmptyTerrain {
|
|
|
216
204
|
}
|
|
217
205
|
|
|
218
206
|
this._fetchCache[tileIndex].then((response) => {
|
|
207
|
+
|
|
208
|
+
let extent = mercator.getTileExtent(x, y, z);
|
|
209
|
+
|
|
219
210
|
if (response.status === "ready") {
|
|
220
211
|
let cache = {
|
|
221
|
-
heights: this._createHeights(response.data),
|
|
222
|
-
extent:
|
|
212
|
+
heights: this._createHeights(response.data, tileIndex, x, y, z, extent),
|
|
213
|
+
extent: extent
|
|
223
214
|
};
|
|
224
215
|
this._elevationCache[tileIndex] = cache;
|
|
225
216
|
callback(this._getGroundHeightMerc(merc, cache));
|
|
226
217
|
} else if (response.status === "error") {
|
|
227
218
|
let cache = {
|
|
228
219
|
heights: null,
|
|
229
|
-
extent:
|
|
220
|
+
extent: extent
|
|
230
221
|
};
|
|
231
222
|
this._elevationCache[tileIndex] = cache;
|
|
232
223
|
callback(this._geoid.getHeightLonLat(lonLat));
|
|
@@ -374,12 +365,20 @@ class GlobusTerrain extends EmptyTerrain {
|
|
|
374
365
|
},
|
|
375
366
|
(response) => {
|
|
376
367
|
if (response.status === "ready") {
|
|
377
|
-
|
|
368
|
+
|
|
369
|
+
let heights = this._createHeights(response.data,
|
|
370
|
+
segment.tileIndex,
|
|
371
|
+
segment.tileX, segment.tileY, segment.tileZoom,
|
|
372
|
+
segment.getExtent()
|
|
373
|
+
);
|
|
374
|
+
|
|
378
375
|
this._elevationCache[segment.tileIndex] = {
|
|
379
376
|
heights: heights,
|
|
380
377
|
extent: segment.getExtent()
|
|
381
378
|
};
|
|
379
|
+
|
|
382
380
|
this._applyElevationsData(segment, heights);
|
|
381
|
+
|
|
383
382
|
} else if (response.status === "abort") {
|
|
384
383
|
segment.terrainIsLoading = false;
|
|
385
384
|
} else if (response.status === "error") {
|