mirror of
https://github.com/n30nex/CartoLite-Server.git
synced 2026-10-22 12:12:27 +00:00
Account for terrain setup work and verify sampler restoration
This commit is contained in:
1 parent
21049a51a9
commit
2a32409b93
2 files changed
+12
-1
No files matched your search
@@ -20,6 +20,17 @@ describe('historical route WebGL geometry', () => {
|
||||
const sample = terrainBatchSampler({ getCenter: () => ({ lng: 0, lat: 0 }), queryTerrainElevation: () => 75 });
|
||||
expect(sample([0, 0])).toBe(75);
|
||||
});
|
||||
it('restores the native method when the calibration query fails', () => {
|
||||
const terrain = { getElevationForLngLatZoom: () => 25 };
|
||||
const original = Object.getOwnPropertyDescriptor(terrain, 'getElevationForLngLatZoom');
|
||||
let failing = true;
|
||||
const sample = terrainBatchSampler({
|
||||
terrain, getCenter: () => ({ lng: 0, lat: 0 }),
|
||||
queryTerrainElevation: () => { if (failing) { failing = false; throw new Error('not ready'); } return 25; },
|
||||
});
|
||||
expect(Object.getOwnPropertyDescriptor(terrain, 'getElevationForLngLatZoom')).toEqual(original);
|
||||
expect(sample([0, 0])).toBe(25);
|
||||
});
|
||||
it('removes redundant straight subdivisions without flattening relief or reversing a path', () => {
|
||||
expect(collapseCollinearPositions([[0, 0, 0], [0.5, 0.5, 0.5], [1, 1, 1]])).toEqual([[0, 0, 0], [1, 1, 1]]);
|
||||
expect(collapseCollinearPositions([[0, 0, 0], [0.5, 0.5, 0.6], [1, 1, 1]])).toHaveLength(3);
|
||||
|
||||
@@ -215,7 +215,7 @@ export class HistoricalRouteLayer implements CustomLayerInterface {
|
||||
if (packedOffset === GPU_CHUNK_FLOATS) { chunks.push(packed); packed = undefined; packedOffset = 0; }
|
||||
}
|
||||
};
|
||||
let sliceStarted = performance.now();
|
||||
let sliceStarted = started;
|
||||
let maximumSlice = 0;
|
||||
let workMs = 0;
|
||||
for (const route of routes) {
|
||||
|
||||
Reference in new issue
Block a user