Skip to content

Instantly share code, notes, and snippets.

@bsudekum
Created September 20, 2012 16:05
Show Gist options
  • Save bsudekum/3756801 to your computer and use it in GitHub Desktop.
Save bsudekum/3756801 to your computer and use it in GitHub Desktop.
OSM Bike Only Layer
<!DOCTYPE html>
<html>
<head>
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.5/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.5/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');
// It's simple to add non-MapBox Layers by using the
// full Modest Maps API. Stamen also has a JavaScript
// snippet you can add to add their layers quickly:
// http://maps.stamen.com/
m.addLayer(new MM.TemplatedLayer('http://{S}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/72771/256/{Z}/{X}/{Y}.png', ['a', 'b', 'c']));
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);
m.centerzoom({
lat: 37.77098612371078,
lon: -122.46288299560547
}, 14);
</script>
</body>
</html>
//Bike Tilelayer ID: 72771
@tmcw
Copy link

tmcw commented Sep 20, 2012

@bsudekum
Copy link
Author

@tmcw What is with the a,b,c reference at the end of the tileurl? Sub-domains? I thought the {S} takes care of that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment