Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created December 20, 2011 19:26
Show Gist options
  • Save tmcw/1502853 to your computer and use it in GitHub Desktop.
Save tmcw/1502853 to your computer and use it in GitHub Desktop.
Base leaflet.js template
<html>
<head>
<script src='https://raw.github.com/mapbox/wax/master/ext/leaflet.js' type='text/javascript'></script>
<script src='https://raw.github.com/mapbox/wax/master/dist/wax.leaf.js' type='text/javascript'></script>
<link href='https://raw.github.com/mapbox/wax/master/ext/leaflet.css' rel="stylesheet" type="text/css" />
<link href='https://raw.github.com/mapbox/wax/master/theme/controls.css' rel="stylesheet" type="text/css" />
<style type='text/css'>
#map-div {
width:500px;
height:300px;
}
</style>
<body>
<div id='map-div'></div>
<script>
wax.tilejson('http://api.tiles.mapbox.com/v2/mapbox.geography-class.jsonp',
function(tilejson) {
var map = new L.Map('map-div')
.addLayer(new wax.leaf.connector(tilejson))
.setView(new L.LatLng(51.505, -0.09), 1);
wax.leaf.interaction(map, tilejson);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment