Skip to content

Instantly share code, notes, and snippets.

@clhenrick
Last active April 9, 2018 01:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clhenrick/54868a85037c69e54f5e43ffe07c7ee9 to your computer and use it in GitHub Desktop.
Save clhenrick/54868a85037c69e54f5e43ffe07c7ee9 to your computer and use it in GitHub Desktop.
ischool-geo-viz-00
license: mit

Template

Here you will find an HTML template for the geo-viz workshop. We'll be adding javascript code to the section between the opening and closing <script></script> tags in the index.html file. There are already some variables there to help us get started with.

Built with blockbuilder.org

<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>iSchool GeoVisualization Workshop</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src="//d3js.org/d3.v4.min.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.43.0/mapbox-gl.js'></script>
<link href='https://unpkg.com/mapbox-gl@0.43.0/dist/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<!-- this div with an id of "map" will be used to create our map -->
<div id='map'></div>
<script>
// javascript code goes here!!!
// url to our "raw" geo data
var dataURL = "https://raw.githubusercontent.com/clhenrick/geovisualization_workshop_ischool/master/data/nyc_crashes.geojson";
// url to hexbins
var hexBinURL = "https://gist.githubusercontent.com/clhenrick/5787a12a8bf3b02821839e4f9556d997/raw/f18f34a319380ba471078baec382970dbc64a9ff/processed.json";
// access token to use with MapboxGL
var accessToken = 'pk.eyJ1IjoiZW5qYWxvdCIsImEiOiIzOTJmMjBiZmI2NGQ2ZjAzODhiMzhiOGI2MTI1YTk4YSJ9.sIOXXU3TPp5dLg_L3cUxhQ';
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment