Skip to content

Instantly share code, notes, and snippets.

@MateoV
Created January 19, 2012 20:03
Show Gist options
  • Save MateoV/1642227 to your computer and use it in GitHub Desktop.
Save MateoV/1642227 to your computer and use it in GitHub Desktop.
<script type='text/javascript'>
// Your map's TileJSON url. Define your map layers here.
var url = 'http://api.tiles.mapbox.com/v3/mapbox.blue-marble-topo-jul,mapbox.world-borders-light,mapbox.tornadoes-2010.jsonp';
// Shortening of 'com.modestmaps'
var mm = com.modestmaps;
wax.tilejson(url, function(tilejson) {
// Set up a new map in a div with id 'mymap'
var m = new mm.Map('mymap',
// Add a new map layer with Wax's connector
new wax.mm.connector(tilejson));
// Add zoom controls
wax.mm.zoomer(m, tilejson).appendTo(m.parent);
// Add interactivity (tooltips)
var interaction = wax.mm.interaction(m, tilejson);
// Set the initial center and zoom level
m.setCenterZoom(new mm.Location(39, -98), 5);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment