This is a standalone version of the TerrainExtension with a TerrainLayer with a GeoJSON layer on deck.gl website.
The example is showing a GeoJSONLayer with Tour de France cycling routes over a TerrainLayer.
Copy the content of this folder to your project.
To load the terrain tiles, you need a Mapbox access token. You can either set an environment variable:
export MapboxAccessToken=<mapbox_access_token>
Or set MAPBOX_TOKEN
directly in app.jsx
.
# install dependencies
npm install
# or
yarn
# bundle and serve the app with vite
npm start
Mapbox's terrain API encodes elevation data in raster tiles.
To use other data sources, check out the documentation of TerrainLayer.
Data source for routes was prepared and processed using Tour de France GPX data freely available to download from https://www.cyclingstage.com/tour-de-france-2023-gpx/.