Skip to content

Instantly share code, notes, and snippets.

Created October 28, 2016 14:32
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save maning/f65adf9898791d140160383dbd3fe0cf to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<meta charset='utf-8' />
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src=''></script>
<link href='' rel='stylesheet' />
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
<div id='map'></div>
mapboxgl.accessToken = 'pk.eyJ1IjoibWFuaW5nIiwiYSI6IlhjWGNfdTQifQ.ras0nImWG638BCDSxU8bqw';
var map = new mapboxgl.Map({
style: 'mapbox://styles/mapbox/light-v9',
center: [-122.4027,37.7927],
zoom: 16,
pitch: 45,
bearing: -17.6,
container: 'map'
// SF Lidar data of buildings and trees
map.on('load', function() {
map.addSource('sf-lidar', {
type: 'vector',
url: 'mapbox://maning.sf-lidar'
'id': 'sf-lidar',
'source': 'sf-lidar',
'source-layer': 'L2014_SF_TreeBldg1m_toInt_vectgeojson',
'filter': [">=", "DN", 1],
'type': 'fill',
'minzoom': 16,
'paint': {
'fill-color': '#aaa',
'fill-extrude-height': {
'type': 'identity',
'property': 'DN'
'fill-opacity': .4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment