Skip to content

Instantly share code, notes, and snippets.

@wmandrews
Last active December 26, 2015 17:29
Show Gist options
  • Save wmandrews/7187740 to your computer and use it in GitHub Desktop.
Save wmandrews/7187740 to your computer and use it in GitHub Desktop.
MapBox JS starter code
<!DOCTYPE html>
<html>
<head>
<!-- sets up the page for responsive content / mobile friendly -->
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<!-- imports the mapbox js library so we can use its functionality -->
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.js'></script>
<!-- imports the styles (CSS) for the mapbox library -->
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.css' rel='stylesheet' />
<!--[if lte IE 8]>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.ie.css' rel='stylesheet' >
<![endif]-->
<!-- sets the map to take up the full page -->
<style>
body { margin:0; padding:0; }
/* the styles for #map can be adjusted to make the map smaller: just set a
different width and height, and remove the position, top and bottom styles */
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<!-- this is where our map will be drawn -->
<div id='map'></div>
<script type='text/javascript'>
// 'map' matches our id='map' above. the second identifier is the Map ID from the MapBox publish window
// this is also where you can add code from the mapbox js examples to modify your map
var map = L.mapbox.map('map', 'wilsonandrews.map-7n7w4oaq');
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment