Skip to content

Display buildings in 3D

Use extrusions to display buildings' height in 3D.

---
title: Display buildings in 3D
description: Use extrusions to display buildings' height in 3D.
type: vector
options:
  center: [ -74.0066, 40.7135 ]
  zoom: 15.5
  pitch: 45
  bearing: -17.6
  antialias: true
style:
  extends: https://styles.trailsta.sh/maptiler-basic.json
  layers:
    - type: fill-extrusion
      minzoom: 15
      beforeLayerId: poi_label
      source-layer: building
      filter: ['!=', [get, hide_3d], true]
      fill-extrusion-color:
        - interpolate
        - [ linear ]
        - [ get, render_height ]
        - 0
        - lightgray
        - 200
        - royalblue
        - 400
        - lightblue
      fill-extrusion-height:
        - interpolate
        - [ linear ]
        - [ zoom ]
        - 15
        - 0
        - 16
        - [ get, render_height ]
      fill-extrusion-base:
        - case
        - [ '>=', [ get, zoom ], 16 ]
        - [ get, render_min_height ]
        - 0
---
https://tile.ourmap.us/data/v3.json


View Map on Ultra
Edit Query on Ultra
View MapLibre Example