Skip to content

Instantly share code, notes, and snippets.

@cwmanning
Created June 28, 2012 16:55
Show Gist options
  • Save cwmanning/3012480 to your computer and use it in GitHub Desktop.
Save cwmanning/3012480 to your computer and use it in GitHub Desktop.
MapBox Basic Demo
<html>
<head>
<title>MapBox Fun</title>
<link rel="stylesheet" href="leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="leaflet.ie.css" />
<![endif]-->
<script src="leaflet.js"></script>
<script src="wax.leaf.min.js"></script>
</head>
<body>
<div id="map" style="width: 600px; height: 400px"></div>
<script>
var map = new L.Map('map');
var url = 'http://a.tiles.mapbox.com/v3/usatoday.map-oe2jntdj.jsonp';
map.setView(new L.LatLng(51.5, -0.09), 13);
wax.tilejson(url, function(tilejson) {
map.addLayer(new wax.leaf.connector(tilejson));
});
var marker1 = new L.Marker(new L.LatLng(51.5, -0.09)),
marker2 = new L.Marker(new L.LatLng(51.495, -0.083)),
marker3 = new L.Marker(new L.LatLng(51.49, -0.1));
marker1.bindPopup('<h1 style="font-size:50px">BOO</h1><p>Hey, he hudas nds h</p>');
marker2.bindPopup("I am a red leaf.");
marker3.bindPopup("I am an orange leaf.");
map.addLayer(marker1)
.addLayer(marker2)
.addLayer(marker3);
marker1.openPopup();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment