Skip to content

Instantly share code, notes, and snippets.

@gajeam
Created April 10, 2017 18:31
Show Gist options
  • Save gajeam/ce70a26a739c796dd0885cfaab3d70ed to your computer and use it in GitHub Desktop.
Save gajeam/ce70a26a739c796dd0885cfaab3d70ed to your computer and use it in GitHub Desktop.
ischool-geo-viz-template
license: mit

Template

Here you will find an empty HTML template for the workshop. We'll be adding javascript code to the section between the opening and closing <script></script> tags in the index.html file.

Let's get started!

Built with blockbuilder.org

forked from clhenrick's block: ischool-geo-viz-template

<!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.v3.min.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.35.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.35.0/mapbox-gl.css' rel='stylesheet' />
<script src="https://cdnjs.cloudflare.com/ajax/libs/Turf.js/2.0.2/turf.min.js"></script>
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<div id='map'></div>
<script>
// javascript code goes here
var dataURL = "https://raw.githubusercontent.com/clhenrick/geovisualization_workshop_ischool/master/data/nyc_crashes.geojson";
var accessToken = 'pk.eyJ1IjoiZW5qYWxvdCIsImEiOiIzOTJmMjBiZmI2NGQ2ZjAzODhiMzhiOGI2MTI1YTk4YSJ9.sIOXXU3TPp5dLg_L3cUxhQ';
mapboxgl.accessToken = accessToken;
var map = new mapboxgl.Map({
container:'map',
style: 'mapbox://styles/mapbox/dark-v9',
center: [-74.0059, 40.7127],
zoom: 10,
});
d3.json(dataURL, function(err, data){
if (err) throw error;
console.log(data);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment