Skip to content

Commit 8d7d9a9

Browse files
committed
fix import
Signed-off-by: Tim Deubler <[email protected]>
1 parent 140b05a commit 8d7d9a9

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

debug/dbgTools.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@
112112
let optimise = false;
113113
let dbgLayer;
114114
const dbgTools = {
115+
animateLight() {
116+
animations.toggleAnimation(animateLight);
117+
},
115118
getDisplay() {
116119
return window.display || here.xyz.maps.Map.getInstances()[0];
117120
},

packages/core/src/providers/TerrainProvider/TerrainWorker.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {XYZTerra} from './XYZTerra';
2828
import {TerrainTileLoaderOptions} from './TerrainWorkerLoader';
2929
import {StyleZoomRange} from '../../styles/LayerStyle';
3030
import {GeoJSONFeature} from '../../features/GeoJSON';
31+
import webMercator from '../../projection/webMercator';
3132

3233
declare const self: Worker;
3334

@@ -54,7 +55,7 @@ export const createTerrainTile = (
5455
if (normals) {
5556
feature.properties.normals = normals;
5657
}
57-
return prepareFeature(feature, null, null, quantizeOptions);
58+
return prepareFeature(feature, z, null, null, quantizeOptions);
5859
};
5960
const createTerrainFeature = (
6061
x: number, y: number, z: number,
@@ -72,7 +73,8 @@ const createTerrainFeature = (
7273
properties: {
7374
isTerrain: true,
7475
source: {
75-
type: sourceFormat
76+
type: sourceFormat,
77+
tile: [x, y, z]
7678
},
7779
indices,
7880
vertices
@@ -137,6 +139,7 @@ function createHeightmapTerrainFeature(x: number, y: number, z: number, mesh: RT
137139
}
138140

139141
function prepareFeature(feature,
142+
zoom: number,
140143
heightMap?: Float32Array,
141144
skirtToMainVertexMap?: Map<number, number>,
142145
quantizeOptions?: QuantizeOptions
@@ -179,7 +182,7 @@ function prepareFeature(feature,
179182
const maxLat = feature.geometry.coordinates[0][4][1];
180183
const centerLat = minLat + (maxLat - minLat) / 2;
181184
const worldSize = Math.pow(2, feature.id.length) * 256;
182-
const meterPerPixel = earthCircumference(centerLat) / worldSize;
185+
const meterPerPixel = webMercator.earthCircumference(centerLat) / worldSize;
183186

184187
properties.normals ||= computeMeshNormals({
185188
vertex: properties.vertices,
@@ -277,7 +280,7 @@ class TerrainWorker extends HTTPWorker {
277280
}
278281

279282
if (feature) {
280-
prepareFeature(feature, heightMap, skirtToMainVertexMap);
283+
prepareFeature(feature, z, heightMap, skirtToMainVertexMap);
281284

282285
// properties.uv = (function createUVs(
283286
// vertices: Float64Array | Float32Array | Uint16Array | Int16Array | number[],

0 commit comments

Comments
 (0)