Skip to content

Instantly share code, notes, and snippets.

View tristen's full-sized avatar

Tristen Brown tristen

View GitHub Profile
@tristen
tristen / index.html
Created November 8, 2016 19:26
Filtering in Mapbox GL JS
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.26.0/mapbox-gl.css' rel='stylesheet' />
<link href='https://www.mapbox.com/base/latest/base.css' rel='stylesheet' />
<link href='site.css' rel='stylesheet' />
</head>
<body>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tristen
tristen / index.html
Last active October 21, 2016 13:50
Slivers [v0.7.7]
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<link rel='stylesheet' href='https://unpkg.com/leaflet@0.7.7/dist/leaflet.css' />
<script src='https://unpkg.com/leaflet@0.7.7/dist/leaflet.js'></script>
<style>
.map {
position:absolute;
top:0;bottom:0;left:0;
@tristen
tristen / index.html
Last active October 21, 2016 13:50
Slivers [v1.0.1]
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<link rel='stylesheet' href='https://unpkg.com/leaflet@1.0.1/dist/leaflet.css' />
<script src='https://unpkg.com/leaflet@1.0.1/dist/leaflet.js'></script>
<style>
.map {
position:absolute;
top:0;bottom:0;left:0;
@tristen
tristen / addresses.csv
Created October 6, 2016 15:14
test data
Name Address City State Zip
John Smith 1750 N HAMPTON RD DESOTO TX 75115
John Smith 941 YORK DR DESOTO TX 75115
John Smith 1750 N HAMPTON RD DESOTO TX 75115
John Smith 1750 N HAMPTON RD DESOTO TX 75115
John Smith 3503 W WHEATLAND RD DALLAS TX 75237
@tristen
tristen / data.json
Created September 30, 2016 16:15
Pairing json data with a vector tileset [updated]
[{"country":"Canada","revenue":5332645000},{"country":"Taiwan","revenue":6060017000},{"country":"USA","revenue":6282660000},{"country":"USA","revenue":8371218000},{"country":"Canada","revenue":2973312000},{"country":"Canada","revenue":4355203000},{"country":"USA","revenue":8312087000},{"country":"Canada","revenue":4208092000},{"country":"United Kingdom","revenue":9071013000},{"country":"Belgium","revenue":2331693000},{"country":"USA","revenue":7704186000},{"country":"USA","revenue":1884702000},{"country":"USA","revenue":6410832000},{"country":"Normway","revenue":5002508000},{"country":"Canada","revenue":9885558000},{"country":"Russian","revenue":9719444000},{"country":"Japan","revenue":9590019000},{"country":"USA","revenue":4614095000},{"country":"Taiwan","revenue":2584888000},{"country":"Canada","revenue":5042647000},{"country":"Normway","revenue":48566000},{"country":"USA","revenue":8181471000},{"country":"USA","revenue":1239162000},{"country":"Canada","revenue":1343792000},{"country":"USA","revenue":192876
@tristen
tristen / data.json
Created September 16, 2016 16:20
Pairing json data with a vector tileset
[{"country":"Canada","revenue":5332645000},{"country":"Taiwan","revenue":6060017000},{"country":"USA","revenue":6282660000},{"country":"USA","revenue":8371218000},{"country":"Canada","revenue":2973312000},{"country":"Canada","revenue":4355203000},{"country":"USA","revenue":8312087000},{"country":"Canada","revenue":4208092000},{"country":"United Kingdom","revenue":9071013000},{"country":"Belgium","revenue":2331693000},{"country":"USA","revenue":7704186000},{"country":"USA","revenue":1884702000},{"country":"USA","revenue":6410832000},{"country":"Normway","revenue":5002508000},{"country":"Canada","revenue":9885558000},{"country":"Russian","revenue":9719444000},{"country":"Japan","revenue":9590019000},{"country":"USA","revenue":4614095000},{"country":"Taiwan","revenue":2584888000},{"country":"Canada","revenue":5042647000},{"country":"Normway","revenue":48566000},{"country":"USA","revenue":8181471000},{"country":"USA","revenue":1239162000},{"country":"Canada","revenue":1343792000},{"country":"USA","revenue":192876
@tristen
tristen / centerpoints.geojson
Created September 16, 2016 14:58
Pairing json data with geojson data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tristen
tristen / index.html
Created August 9, 2016 17:37
Possible race condition triggering `setData` error
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.21.0/mapbox-gl.css' rel='stylesheet' />
<link href='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-directions/v2.1.0/mapbox-gl-directions.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@tristen
tristen / index.html
Created July 26, 2016 00:36
Polygon overlay bug
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.21.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.21.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }