Skip to content

Prototype a 3D version of a style

Add 3D terrain and Buildings to OpenTrailStash using AWS-hosted DEM tiles and OpenMapTiles buildings

---
title: Prototype a 3D version of a style
description: Add 3D terrain and Buildings to OpenTrailStash using AWS-hosted DEM tiles and OpenMapTiles buildings
options:
  hash: m
  center: [ 11.380881, 47.312333 ]
  zoom: 16
  pitch: 73
  bearing: -47.3
  maxPitch: 85
style:
  extends: https://open.trailsta.sh/style.json
  sources:
    openmaptiles:
      type: vector
      url: https://tile.ourmap.us/data/v3.json
    terrainSource:
      type: raster-dem
      tiles:
        - 'https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png'
      encoding: terrarium
      tileSize: 256
  terrain:
    source: terrainSource
    exaggeration: 1
  layers:
    - id: poi_dot
      visibility: none
    - id: poi
      visibility: none
    - type: fill-extrusion
      beforeLayerId: poi_dot
      source: openmaptiles
      source-layer: building
      minzoom: 13
      filter: ['!=', [get, hide_3d], true]
      fill-extrusion-color: '#c0c9b2'
      fill-extrusion-height: [ get, render_height ]
      fill-extrusion-base: [ get, render_min_height ]
---


View Map on Ultra
Edit Query on Ultra