mirror of https://github.com/CesiumGS/cesium.git
28 lines
642 B
JavaScript
28 lines
642 B
JavaScript
/*eslint-env node*/
|
|
"use strict";
|
|
|
|
// NodeJS smoke screen test
|
|
|
|
const assert = require("node:assert");
|
|
const {
|
|
CesiumTerrainProvider,
|
|
Cartographic,
|
|
sampleTerrain,
|
|
} = require("cesium");
|
|
|
|
async function test() {
|
|
const provider = await CesiumTerrainProvider.fromUrl(
|
|
"https://s3.amazonaws.com/cesiumjs/smallTerrain"
|
|
);
|
|
const results = await sampleTerrain(provider, 11, [
|
|
Cartographic.fromDegrees(86.925145, 27.988257),
|
|
Cartographic.fromDegrees(87.0, 28.0),
|
|
]);
|
|
assert(results[0].height > 5000);
|
|
assert(results[0].height < 10000);
|
|
assert(results[1].height > 5000);
|
|
assert(results[1].height < 10000);
|
|
}
|
|
|
|
test();
|