var require=function(e,h){var g=require.resolve(e,h||"/"),f=require.modules[g];if(!f)throw Error("Failed to resolve module "+e+", tried "+g);return(g=require.cache[g])?g.exports:f()};require.paths=[];require.modules={};require.cache={};require.extensions=[".js",".coffee",".json"];require._core={assert:!0,events:!0,fs:!0,path:!0,vm:!0}; require.resolve=function(){return function(e,h){function g(a){a=d.normalize(a);if(require.modules[a])return a;for(var j=0;jd?[]:a.slice(c,d-c+1)}a=g.resolve(a).substr(1);c=g.resolve(c).substr(1);for(var d=b(a.split("/")),e=b(c.split("/")),f=Math.min(d.length,e.length),k=f,h=0;hthis.open_request_count&& 0this.coord.zoom&&(this.coord=this.coord.zoomTo(0));this.coord=this.pointCoordinate(c)};e.prototype.coordinatePoint=function(a){var b=this.coord.zoomBy(g.TileExp);a=a.zoomTo(b.zoom);return new f.Point(this.center.x-b.column+a.column,this.center.y-b.row+a.row)};e.prototype.pointCoordinate=function(a){var b=a.x-this.center.x; a=a.y-this.center.y;return this.coord.zoomBy(g.TileExp).right(b).down(a).zoomTo(this.coord.zoom)};e.prototype.visible_tiles=function(){for(var a=this.roundCoord(),b=this.pointCoordinate(new f.Point(0,0)),c=this.pointCoordinate(new f.Point(2*this.center.x,2*this.center.y)),b=b.zoomTo(a.zoom).container(),c=c.zoomTo(a.zoom).container(),e=[],g={},h=b.row;h<=c.row;h++)for(var p=b.column;p<=c.column;p++){var m=new f.Coordinate(h,p,a.zoom);e.push(new d.Tile(m,this));for(var n=m.zoom-1;n>=m.zoom-this.pyramid&& 0<=n;n--){var q=m.zoomTo(n).container();if(q.toString()in g)break;g[q.toString()]=!0;e.push(new d.Tile(q,this))}}return e};g.Grid=e}); require.define("/Div.js",function(e,h,g){var f=e("./Mouse");e("./Base");var d=e("./Core"),a=e("./Grid"),b=function(c,b,e,g){this.selection=d3.select(c);this.parent=c;this.setup_mouse_control();c=f.element_size(this.parent);this.grid=new a.Grid(c.x,c.y,0);this.grid.coord=new d.Coordinate(b,e,g);var h=this;d3.select(window).on("resize.map",function(){h.update_gridsize()})};b.prototype.setup_mouse_control=function(){var a=new f.Control(this);this.selection.on("dblclick.map",function(){a.onDoubleclick()}).on("mousedown.map", function(){a.onMousedown()}).on("mousewheel.map",function(){a.onMousewheel()}).on("DOMMouseScroll.map",function(){a.onMousewheel()});return a};b.prototype.update_gridsize=function(){var a=f.element_size(this.parent);this.grid.resize(a.x,a.y);this.redraw()};b.prototype.redraw=function(){var a=this.grid.visible_tiles(),a=this.selection.selectAll("div.tile").data(a,b.tile_key);a.exit().remove();a.enter().append("div").attr("class","tile").style("border-top","1px solid pink").style("border-left","1px solid pink").text(b.tile_key).attr("id", b.tile_key);this.selection.selectAll("div.tile").style("left",b.tile_left).style("top",b.tile_top).style("width",b.tile_width).style("height",b.tile_height)};b.tile_key=function(a){return a.toKey()};b.tile_left=function(a){return a.left()};b.tile_top=function(a){return a.top()};b.tile_width=function(a){return a.width()};b.tile_height=function(a){return a.height()};b.tile_xform=function(a){return a.transform()};g.Map=b}); require.define("/Map.js",function(e){var h=e("./Image"),g=e("./Div");window.makeImgMap=function(e,d,a,b,c){if(e==document.body)throw Error("Sorry, for the moment I can\u2019t figure out how to make the mousewheel work in Safari 5.0 when the parent element is the document body. Try making your parent element a DIV?");return new h.Map(e,d,a,b,c)};window.makeDivMap=function(e,d,a,b){if(e==document.body)throw Error("Sorry, for the moment I can\u2019t figure out how to make the mousewheel work in Safari 5.0 when the parent element is the document body. Try making your parent element a DIV?"); return new g.Map(e,d,a,b)}});require("/Map.js");