This is a fork from cesium-martini, click to view details.
This module can create cesium terrain through raster tile service.
import { Viewer, Resource } from "cesium";
import { MartiniTerrainProvider } from "@zjugis/cesium-martini";
const cesiumViewer = new Viewer("cesiumContainer");
const terrainLayer = new MartiniTerrainProvider({
url: new Resource({
url: 'https://api.mapbox.com/v4/mapbox.terrain-rgb/{z}/{x}/{y}@2x.webp',
queryParameters: {
access_token: 'pk.eyJ1Ijoic3ZjLW9rdGEtbWFwYm94LXN0YWZmLWFjY2VzcyIsImEiOiJjbG5sMnFlZ28wb2d5MnFtb2xnMG90OW96In0.IE8Vqs0NTzCY0WqPzV9kcw'
},
}),
requestVertexNormals: true,
});
cesiumViewer.scene.terrainProvider = terrainLayer;
This package is listed on NPM as @zjugis/cesium-martini
. It can be installed
using the command
npm install --save @zjugis/cesium-martini
Launch the app in the demo folder, and then visit http://localhost:5173/
pnpm install
pnpm dev