Created
January 19, 2012 20:03
-
-
Save MateoV/1642227 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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