var mm = com.modestmaps; var url = 'http://api.tiles.mapbox.com/v3/tristen.map-h7dkbvxx.jsonp'; // ## Map Implementation wax.tilejson(url, function(tilejson) { // By default, MapBox hosting provides // templating markup in uploaded .mbtiles. // In wax we want to remove template object // so we can default to tilejson.formatter instead. delete tilejson.template; // Return a new, custom formatter tilejson.formatter = function(o, d) { return { teaser: function anonymous(obj) { // Open Webkit console to view // what is returned from obj console.log(arguments); var __p = [], print = function(){ __p.push.apply(__p,arguments); }; with (obj||{}) { __p.push(''); }; return __p.join(''); }, full: function anonymous(obj) { console.log('full: ' + obj); var __p = [], print = function(){ __p.push.apply(__p,arguments); }; with (obj||{}) { __p.push(''); }; return __p.join(''); }, location: function anonymous(obj) { var __p = [], print = function(){ __p.push.apply(__p,arguments); }; with (obj||{}) { __p.push(''); }; return __p.join(''); } }[o.format](d); }; var m = new mm.Map('map', new wax.mm.connector(tilejson)); wax.mm.interaction(m, tilejson); m.setCenterZoom(new mm.Location(37, -94), 4); });