Skip to content

Instantly share code, notes, and snippets.

@javisantana
Forked from wboykinm/index.html
Last active December 10, 2015 00: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 javisantana/4354809 to your computer and use it in GitHub Desktop.
Save javisantana/4354809 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<div id='map'>
</div>
<script>
var m = mapbox.map('map');
//Define CartoDB tilejson
var communes = mapbox.layer().tilejson({
version: '1.0.0',
scheme: 'xyz',
tiles: ['http://dai.cartodb.com/tiles/ag_2011_commune3/{z}/{x}/{y}.png'],
grids: ['http://dai.cartodb.com/tiles/ag_2011_commune3/{z}/{x}/{y}.grid.json']
});
//Add layers to map
m.addLayer(new MM.TemplatedLayer('http://b.tile.stamen.com/toner/{Z}/{X}/{Y}.png'));
m.addLayer(communes);
m.ui.attribution.add()
.content('Map tiles by <a href="http://stamen.com">Stamen Design</a>, under' +
' <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>.' +
' Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>.');
m.ui.zoomer.add();
m.ui.zoombox.add();
m.zoom(3);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment