Skip to content

Instantly share code, notes, and snippets.

View tristen's full-sized avatar

Tristen Brown tristen

View GitHub Profile
This file has been truncated, but you can view the full file.
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).mapboxgl=t()}(this,function(){"use strict";var e,t,i;function r(r,n){if(e)if(t){var o="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk); self.onerror = null;",s={};e(s),i=n(s),"undefined"!=typeof window&&window&&window.URL&&window.URL.createObjectURL&&(i.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else t=n;else e=n}return r(0,function(e){var t="2.7.0-dev",i=r;function r(e,t,i,r){this.cx=3*e,this.bx=3*(i-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(r-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=i,this.p2
@tristen
tristen / index.html
Created April 28, 2016 18:48
Full height sidebar with scrollable content
<!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://www.mapbox.com/base/latest/base.css' rel='stylesheet' />
<link href='site.css' rel='stylesheet' />
</head>
<body>
@tristen
tristen / commands.sh
Last active March 9, 2021 20:07
topojson merge
ogr2ogr \
-f GeoJSON \
subunits.json \
nameofshapefile.shp
ogr2ogr \
-f GeoJSON \
boundaries.json \
nameofshapefile.shp
@tristen
tristen / map.js
Last active August 23, 2020 13:07
class Map extends React.Component {
componentDidMount() {
this.map = new mapboxgl.Map({
container: this.mapContainer,
style: 'mapbox://styles/mapbox/streets-v9'
});
}
componentWillUnmount() {
this.map.remove();
@tristen
tristen / index.html
Created May 23, 2016 18:16
Mapbox GL JS map with custom DOM marker
<!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.18.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.18.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@tristen
tristen / index.html
Created April 15, 2016 20:45
Animate a marker along a route
<!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.17.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.17.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@tristen
tristen / README.md
Last active October 30, 2019 07:13
Cab Spotting
@tristen
tristen / app.js
Last active September 6, 2019 09:31
Basic Controls
var map;
var initMap = function() {
var template = 'http://{S}tile.openstreetmap.org/{Z}/{X}/{Y}.png';
var subdomains = ['', 'a.', 'b.', 'c.'];
var provider = new MM.TemplatedLayer(template, subdomains);
map = new MM.Map('map', provider, null, [
new MM.MouseWheelHandler(null, true)
]);
@tristen
tristen / app.js
Last active September 4, 2019 12:33
Zoom Slider
var zoomSlider = document.getElementById('zoom');
var zoomValue = document.getElementById('zoomvalue');
var map, targetZoom;
var initMap = function() {
var template = 'http://{S}tile.openstreetmap.org/{Z}/{X}/{Y}.png';
var subdomains = ['', 'a.', 'b.', 'c.'];
var provider = new MM.TemplatedLayer(template, subdomains);
map = new MM.Map('map', provider, null);
@tristen
tristen / README.md
Last active June 29, 2019 04:45
Overlay Popup

##Overlay popup

The key file in this example is follower-canvas which applies the styling and draws the popup using canvas on the map. There is additional fallback support for IE < 9 by using Vector Markup Language, or vml.

Contributors