Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hongfaqiu/cesium-martini

Create cesium terrain from raster tile,从栅格瓦片创建cesium地形
https://github.com/hongfaqiu/cesium-martini

cesium raster-tiles terrain

Last synced: about 6 hours ago
JSON representation

Create cesium terrain from raster tile,从栅格瓦片创建cesium地形

Awesome Lists containing this project

README

        

# Cesium-Martini

**This is a fork from [cesium-martini](https://github.com/davenquinn/cesium-martini)**, click to view details.

This module can create cesium terrain through raster tile service.

![Cesium-Martini](/img/cesium-martini.png)

## Usage

```ts
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;
```

## Installation

This package is listed on NPM as `@zjugis/cesium-martini`. It can be installed
using the command

```bash
npm install --save @zjugis/cesium-martini
```

## Demo

[online Demo](https://cesium-martini.opendde.com/)

Launch the app in the demo folder, and then visit

![Cesium-Martini](https://s1.ax1x.com/2022/08/09/v1GhtO.png)

```node
pnpm install
pnpm dev
```

## Credit