var require=function(b,j){var d=require.resolve(b,j||"/"),e=require.modules[d];if(!e)throw Error("Failed to resolve module "+b+", tried "+d);return(d=require.cache[d])?d.exports:e()};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(b,j){function d(a){a=g.normalize(a);if(require.modules[a])return a;for(var c=0;cf?[]:a.slice(c,f-c+1)}a=d.resolve(a).substr(1);c=d.resolve(c).substr(1);for(var f=b(a.split("/")),g=b(c.split("/")),e=Math.min(f.length,g.length),r=e,h=0;h this.open_request_count&&0this.coord.zoom&&(this.coord=this.coord.zoomTo(0));this.coord=this.pointCoordinate(b)};b.prototype.coordinatePoint=function(c){var a=this.coord.zoomBy(d.TileExp);c=c.zoomTo(a.zoom);return new e.Point(this.center.x-a.column+c.column,this.center.y-a.row+c.row)};b.prototype.pointCoordinate= function(c){var a=c.x-this.center.x;c=c.y-this.center.y;return this.coord.zoomBy(d.TileExp).right(a).down(c).zoomTo(this.coord.zoom)};b.prototype.visibleTiles=function(){for(var c=this.roundCoord(),a=this.pointCoordinate(new e.Point(0,0)),b=this.pointCoordinate(new e.Point(2*this.center.x,2*this.center.y)),a=a.zoomTo(c.zoom).container(),b=b.zoomTo(c.zoom).container(),d=[],j={},k=a.row;k<=b.row;k++)for(var n=a.column;n<=b.column;n++){var p=new e.Coordinate(k,n,c.zoom);d.push(new g.Tile(p,this));for(var l= p.zoom-1;l>=p.zoom-this.pyramid&&0<=l;l--){var m=p.zoomTo(l).container();if(m.toString()in j)break;j[m.toString()]=!0;d.push(new g.Tile(m,this))}}return d};d.Grid=b}); require.define("/Div.js",function(b,j,d){function e(a){return a.toKey()}function g(a){return a.left()}function c(a){return a.top()}function a(a){return a.width()}function f(a){return a.height()}var h=b("./Mouse");b("./Base");var q=b("./Grid");b=function(a,b,c,d){this.selection=d3.select(a);this.parent=a;h.link_control(this.selection,new h.Control(this,!1));a=h.element_size(this.parent);c=b.locationCoordinate(c).zoomTo(d);this.grid=new q.Grid(a.x,a.y,c,0);this.projection=b;var e=this;d3.select(window).on("resize.map", function(){e.update_gridsize()});this.selection.selectAll("div.tile").remove();this.redraw(!1)};b.prototype.update_gridsize=function(){var a=h.element_size(this.parent);this.grid.resize(a.x,a.y);this.redraw(!0)};b.prototype.pointLocation=function(a){"undefined"===typeof a&&(a=null);a=this.grid.pointCoordinate(a?a:this.grid.center);return this.projection.coordinateLocation(a)};b.prototype.locationPoint=function(a){a=this.projection.locationCoordinate(a);return this.grid.coordinatePoint(a)};b.prototype.onMoved= function(a){var b=this,c=this.moved_callback;this.moved_callback=function(){c&&c();a(b)}};b.prototype.redraw=function(b){var d=this.grid.visibleTiles(),d=this.selection.selectAll("div.tile").data(d,e);d.exit().remove();d.enter().append("div").attr("class","tile").style("border-top","1px solid pink").style("border-left","1px solid pink").text(e).attr("id",e);this.selection.selectAll("div.tile").style("left",g).style("top",c).style("width",a).style("height",f);b&&this.moved_callback&&this.moved_callback()}; d.Map=b}); require.define("/Geo.js",function(b,j,d){var e=b("./Core"),g=function(a,b){this.lat=a;this.lon=b};g.prototype.toString=function(){return"("+this.lat.toFixed(6)+", "+this.lon.toFixed(6)+")"};d.Location=g;var c=Math.PI;b=function(){};b.prototype.project=function(a){var b=c*a.lon/180;a=Math.log(Math.tan(c/4+c*a.lat/180/2));return new e.Point(b,a)};b.prototype.inverse=function(a){var b=a.x;a=180*(2*Math.atan(Math.exp(a.y))-c/2)/c;return new g(a,180*b/c)};b.prototype.locationCoordinate=function(a,b){"undefined"=== typeof b&&(b=0);var d=this.project(a);return(new e.Coordinate((c-d.y)/(2*c),(d.x+c)/(2*c),0)).zoomTo(b)};b.prototype.coordinateLocation=function(a){a=a.zoomTo(0);return this.inverse(new e.Point(2*a.column*c-c,c-2*a.row*c))};d.Mercator=b}); require.define("/Map.js",function(b){var j=b("./Image"),d=b("./Div"),e=b("./Geo");window.pocketsquares={makeImgMap:function(b,c,a,d,h){if(b==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 j.Map(b,c,new e.Mercator,new e.Location(a,d),h)},makeDivMap:function(b,c,a,f){if(b==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 d.Map(b,new e.Mercator,new e.Location(c,a),f)},Geo:{Mercator:e.Mercator}};void 0==window.ps&&(window.ps=window.pocketsquares)});require("/Map.js");