Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add `repeat` property to po.url.

True by default. Can be set to false to disable column wrap-around.
  • Loading branch information...
commit 1754c96066ef45ca37d41de9d53d3c70cbb0a651 1 parent 1e3ea23
@mbostock mbostock authored
View
1  examples/cloudmade/pale-dawn.js
@@ -9,6 +9,7 @@ map.add(po.image()
.url(po.url("http://{S}tile.cloudmade.com"
+ "/1a1b06b230af4efdbb989ea99e9841af" // http://cloudmade.com/register
+ "/998/256/{Z}/{X}/{Y}.png")
+ .repeat(false)
.hosts(["a.", "b.", "c.", ""])));
map.add(po.compass()
View
20 polymaps.js
@@ -2,7 +2,7 @@ if (!org) var org = {};
if (!org.polymaps) org.polymaps = {};
(function(po){
- po.version = "2.3.0"; // semver.org
+ po.version = "2.3+1.0"; // not semver!
var zero = {x: 0, y: 0};
po.ns = {
@@ -182,12 +182,18 @@ po.cache = function(load, unload) {
return cache;
};
po.url = function(template) {
- var hosts = [];
+ var hosts = [],
+ repeat = true;
function format(c) {
var max = c.zoom < 0 ? 1 : 1 << c.zoom,
- column = c.column % max;
- if (column < 0) column += max;
+ column = c.column;
+ if (repeat) {
+ column = c.column % max;
+ if (column < 0) column += max;
+ } else if ((column < 0) || (column >= max)) {
+ return "about:blank";
+ }
return template.replace(/{(.)}/g, function(s, v) {
switch (v) {
case "S": return hosts[(Math.abs(c.zoom) + c.row + column) % hosts.length];
@@ -220,6 +226,12 @@ po.url = function(template) {
return format;
};
+ format.repeat = function(x) {
+ if (!arguments.length) return repeat;
+ repeat = x;
+ return format;
+ };
+
return format;
};
po.dispatch = function(that) {
View
122 polymaps.min.js
@@ -1,62 +1,62 @@
if(!org)var org={};if(!org.polymaps)org.polymaps={};
-(function(s){function fa(e){var g=e.indexOf(":");return g<0?e:{space:s.ns[e.substring(0,g)],local:e.substring(g+1)}}function S(){for(var e=0;e<S.maps.length;e++)S.maps[e].resize()}function V(e){return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function W(e){return 180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360))}function Z(e,g){if(e.row>g.row){var c=e;e=g;g=c}return{x0:e.column,y0:e.row,x1:g.column,y1:g.row,dx:g.column-e.column,dy:g.row-e.row}}function ca(e,g,c,k,i){c=Math.max(c,Math.floor(g.y0));
-k=Math.min(k,Math.ceil(g.y1));if(e.x0==g.x0&&e.y0==g.y0?e.x0+g.dy/e.dy*e.dx<g.x1:e.x1-g.dy/e.dy*e.dx<g.x0){var a=e;e=g;g=a}a=e.dx/e.dy;var f=g.dx/g.dy,m=e.dx>0,q=g.dx<0;for(c=c;c<k;c++){var t=a*Math.max(0,Math.min(e.dy,c+m-e.y0))+e.x0;i(Math.floor(f*Math.max(0,Math.min(g.dy,c+q-g.y0))+g.x0),Math.ceil(t),c)}}function da(e,g,c,k,i,a){var f=Z(e,g);g=Z(g,c);e=Z(c,e);if(f.dy>g.dy){c=f;f=g;g=c}if(f.dy>e.dy){c=f;f=e;e=c}if(g.dy>e.dy){c=g;g=e;e=c}f.dy&&ca(e,f,k,i,a);g.dy&&ca(e,g,k,i,a)}s.version="2.3.0";
-var Y={x:0,y:0};s.ns={svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink"};s.id=function(){var e=0;return function(){return++e}}();s.svg=function(e){return document.createElementNS(s.ns.svg,e)};s.transform=function(e,g,c,k,i,a){var f={},m,q,t;if(!arguments.length){e=1;g=i=c=0;k=1;a=0}f.zoomFraction=function(l){if(!arguments.length)return q;q=l;m=Math.floor(q+Math.log(Math.sqrt(e*e+g*g+c*c+k*k))/Math.log(2));t=Math.pow(2,-m);return f};f.apply=function(l){var j=Math.pow(2,-l.zoom),
-u=Math.pow(2,l.zoom-m);return{column:(e*l.column*j+c*l.row*j+i)*u,row:(g*l.column*j+k*l.row*j+a)*u,zoom:l.zoom-m}};f.unapply=function(l){var j=Math.pow(2,-l.zoom),u=Math.pow(2,l.zoom+m);return{column:(l.column*j*k-l.row*j*c-i*k+a*c)/(e*k-g*c)*u,row:(l.column*j*g-l.row*j*e-i*g+a*e)/(c*g-k*e)*u,zoom:l.zoom+m}};f.toString=function(){return"matrix("+[e*t,g*t,c*t,k*t].join(" ")+" 0 0)"};return f.zoomFraction(0)};s.cache=function(e,g){function c(j){l--;g&&g(j);delete f[j.key];if(j.next)j.next.prev=j.prev;
-else if(q=j.prev)q.next=null;if(j.prev)j.prev.next=j.next;else if(m=j.next)m.prev=null}function k(){for(var j=q;l>t;j=j.prev){if(!j)break;j.lock||c(j)}}var i={},a={},f={},m=null,q=null,t=64,l=0;i.peek=function(j){return f[[j.zoom,j.column,j.row].join("/")]};i.load=function(j,u){var y=[j.zoom,j.column,j.row].join("/"),A=f[y];if(A){if(A.prev){if(A.prev.next=A.next)A.next.prev=A.prev;else q=A.prev;A.prev=null;A.next=m;m=m.prev=A}A.lock=1;return a[y]=A}A={key:y,column:j.column,row:j.row,zoom:j.zoom,next:m,
-prev:null,lock:1};e.call(null,A,u);a[y]=f[y]=A;if(m)m.prev=A;else q=A;m=A;l++;return A};i.unload=function(j){if(!(j in a))return false;var u=a[j];u.lock=0;delete a[j];u.request&&u.request.abort(false)&&c(u);return u};i.locks=function(){return a};i.size=function(j){if(!arguments.length)return t;t=j;k();return i};i.flush=function(){k();return i};i.clear=function(){for(var j in f){var u=f[j];u.request&&u.request.abort(false);g&&g(f[j]);if(u.lock){u.lock=0;u.element.parentNode.removeChild(u.element)}}a=
-{};f={};m=q=null;l=0;return i};return i};s.url=function(e){function g(k){var i=k.zoom<0?1:1<<k.zoom,a=k.column%i;if(a<0)a+=i;return e.replace(/{(.)}/g,function(f,m){switch(m){case "S":return c[(Math.abs(k.zoom)+k.row+a)%c.length];case "Z":return k.zoom;case "X":return a;case "Y":return k.row;case "B":var q=s.map.coordinateLocation({row:k.row,column:a,zoom:k.zoom}),t=s.map.coordinateLocation({row:k.row+1,column:a+1,zoom:k.zoom}),l=Math.ceil(Math.log(k.zoom)/Math.LN2);return t.lat.toFixed(l)+","+q.lon.toFixed(l)+
-","+q.lat.toFixed(l)+","+t.lon.toFixed(l)}return m})}var c=[];g.template=function(k){if(!arguments.length)return e;e=k;return g};g.hosts=function(k){if(!arguments.length)return c;c=k;return g};return g};s.dispatch=function(e){var g={};e.on=function(c,k){for(var i=g[c]||(g[c]=[]),a=0;a<i.length;a++)if(i[a].handler==k)return e;i.push({handler:k,on:true});return e};e.off=function(c,k){var i=g[c];if(i)for(var a=0;a<i.length;a++){var f=i[a];if(f.handler==k){f.on=false;i.splice(a,1);break}}return e};return function(c){var k=
-g[c.type];if(k){k=k.slice();for(var i=0;i<k.length;i++){var a=k[i];a.on&&a.handler.call(e,c)}}}};s.queue=function(){function e(){if(!(i>=a||!k.length)){i++;k.pop()()}}function g(f){for(var m=0;m<k.length;m++)if(k[m]==f){k.splice(m,1);return true}return false}function c(f,m,q){function t(){l=new XMLHttpRequest;q&&l.overrideMimeType(q);l.open("GET",f,true);l.onreadystatechange=function(){if(l.readyState==4){i--;l.status<300&&m(l);e()}};l.send(null)}var l;k.push(t);e();return{abort:function(j){if(g(t))return true;
-if(j&&l){l.abort();return true}return false}}}var k=[],i=0,a=6;return{text:function(f,m,q){return c(f,function(t){t.responseText&&m(t.responseText)},q)},xml:function(f,m){return c(f,function(q){q.responseXML&&m(q.responseXML)},"application/xml")},json:function(f,m){return c(f,function(q){q.responseText&&m(JSON.parse(q.responseText))},"application/json")},image:function(f,m,q){function t(){l=document.createElement("img");l.onerror=function(){i--;e()};l.onload=function(){i--;q(l);e()};l.src=m;f.setAttributeNS(s.ns.xlink,
-"href",m)}var l;k.push(t);e();return{abort:function(j){if(g(t))return true;if(j&&l){l.src="about:";return true}return false}}}}}();s.map=function(){function e(){if(u)if(t<u[0])t=u[0];else if(t>u[1])t=u[1];l=t-(t=Math.round(t));j=Math.pow(2,l)}function g(){if(n){var d=45/Math.pow(2,t+l-3),r=Math.max(Math.abs(C*f.x+A*f.y),Math.abs(B*f.x+E*f.y)),o=V(K-r*d/m.y);r=V(h+r*d/m.y);q.lat=Math.max(o,Math.min(r,q.lat));o=Math.max(Math.abs(C*f.y+A*f.x),Math.abs(B*f.y+E*f.x));q.lon=Math.max(n[0].lon-o*d/m.x,Math.min(n[1].lon+
-o*d/m.x,q.lon))}}var c={},k,i,a=Y,f=Y,m={x:256,y:256},q={lat:37.76487,lon:-122.41948},t=12,l=0,j=1,u=[1,18],y=0,A=1,C=0,E=1,B=0,K=-180,h=180,n=[{lat:V(K),lon:-Infinity},{lat:V(h),lon:Infinity}];c.locationCoordinate=function(d){d=s.map.locationCoordinate(d);var r=Math.pow(2,t);d.column*=r;d.row*=r;d.zoom+=t;return d};c.coordinateLocation=s.map.coordinateLocation;c.coordinatePoint=function(d,r){var o=Math.pow(2,t-r.zoom),z=Math.pow(2,t-d.zoom),v=(r.column*o-d.column*z)*m.x*j;o=(r.row*o-d.row*z)*m.y*
-j;return{x:f.x+A*v-C*o,y:f.y+C*v+A*o}};c.pointCoordinate=function(d,r){var o=Math.pow(2,t-d.zoom),z=(r.x-f.x)/j,v=(r.y-f.y)/j;return{column:d.column*o+(E*z-B*v)/m.x,row:d.row*o+(B*z+E*v)/m.y,zoom:t}};c.locationPoint=function(d){var r=Math.pow(2,t+l-3)/45,o=(d.lon-q.lon)*r*m.x;d=(W(q.lat)-W(d.lat))*r*m.y;return{x:f.x+A*o-C*d,y:f.y+C*o+A*d}};c.pointLocation=function(d){var r=45/Math.pow(2,t+l-3),o=(d.x-f.x)*r;d=(d.y-f.y)*r;return{lon:q.lon+(E*o-B*d)/m.x,lat:V(W(q.lat)-(B*o+E*d)/m.y)}};var w=s.svg("rect");
-w.setAttribute("visibility","hidden");w.setAttribute("pointer-events","all");c.container=function(d){if(!arguments.length)return k;k=d;k.setAttribute("class","map");k.appendChild(w);return c.resize()};c.focusableParent=function(){for(var d=k;d;d=d.parentNode)if(d.tabIndex>=0)return d;return window};c.mouse=function(d){var r=(k.ownerSVGElement||k).createSVGPoint();if($<0&&(window.scrollX||window.scrollY)){var o=document.body.appendChild(s.svg("svg"));o.style.position="absolute";o.style.top=o.style.left=
-"0px";var z=o.getScreenCTM();$=!(z.f||z.e);document.body.removeChild(o)}if($){r.x=d.pageX;r.y=d.pageY}else{r.x=d.clientX;r.y=d.clientY}return r.matrixTransform(k.getScreenCTM().inverse())};c.size=function(d){if(!arguments.length)return a;i=d;return c.resize()};c.resize=function(){if(i){a=i;S.remove(c)}else{w.setAttribute("width","100%");w.setAttribute("height","100%");b=w.getBBox();a={x:b.width,y:b.height};S.add(c)}w.setAttribute("width",a.x);w.setAttribute("height",a.y);f={x:a.x/2,y:a.y/2};g();c.dispatch({type:"resize"});
-return c};c.tileSize=function(d){if(!arguments.length)return m;m=d;c.dispatch({type:"move"});return c};c.center=function(d){if(!arguments.length)return q;q=d;g();c.dispatch({type:"move"});return c};c.panBy=function(d){var r=45/Math.pow(2,t+l-3),o=d.x*r;d=d.y*r;return c.center({lon:q.lon+(B*d-E*o)/m.x,lat:V(W(q.lat)+(B*o+E*d)/m.y)})};c.centerRange=function(d){if(!arguments.length)return n;if(n=d){K=n[0].lat>-90?W(n[0].lat):-Infinity;h=n[0].lat<90?W(n[1].lat):Infinity}else{K=-Infinity;h=Infinity}g();
-c.dispatch({type:"move"});return c};c.zoom=function(d){if(!arguments.length)return t+l;t=d;e();return c.center(q)};c.zoomBy=function(d,r,o){if(arguments.length<2)return c.zoom(t+l+d);if(arguments.length<3)o=c.pointLocation(r);t=t+l+d;e();var z=c.locationPoint(o);return c.panBy({x:r.x-z.x,y:r.y-z.y})};c.zoomRange=function(d){if(!arguments.length)return u;u=d;return c.zoom(t+l)};c.extent=function(d){if(!arguments.length)return[c.pointLocation({x:0,y:a.y}),c.pointLocation({x:a.x,y:0})];var r=c.locationPoint(d[0]),
-o=c.locationPoint(d[1]),z=Math.max((o.x-r.x)/a.x,(r.y-o.y)/a.y);r=c.pointLocation({x:(r.x+o.x)/2,y:(r.y+o.y)/2});t=t+l-Math.log(z)/Math.log(2);e();return c.center(r)};c.angle=function(d){if(!arguments.length)return y;y=d;A=Math.cos(y);C=Math.sin(y);E=Math.cos(-y);B=Math.sin(-y);g();c.dispatch({type:"move"});return c};c.add=function(d){d.map(c);return c};c.remove=function(d){d.map(null);return c};c.dispatch=s.dispatch(c);return c};S.maps=[];S.add=function(e){for(var g=0;g<S.maps.length;g++)if(S.maps[g]==
-e)return;S.maps.push(e)};S.remove=function(e){for(var g=0;g<S.maps.length;g++)if(S.maps[g]==e){S.maps.splice(g,1);return}};window.addEventListener("resize",S,false);s.map.locationCoordinate=function(e){var g=1/360;return{column:(e.lon+180)*g,row:(180-W(e.lat))*g,zoom:0}};s.map.coordinateLocation=function(e){var g=45/Math.pow(2,e.zoom-3);return{lon:g*e.column-180,lat:V(180-g*e.row)}};var $=/WebKit/.test(navigator.userAgent)?-1:0;s.layer=function(e,g){function c(B){for(var K=C[0].nextSibling;A<B;A++){u.insertBefore(C[-4],
-K);u.insertBefore(C[2],K);u.insertBefore(C[1],K);for(var h=C[-4],n=-4;n<2;)C[n]=C[++n];C[n]=h}}function k(B){for(var K=C[0].nextSibling;A>B;A--){u.insertBefore(C[-1],K);u.insertBefore(C[2],C[-4]);for(var h=C[2],n=2;n>-4;)C[n]=C[--n];C[n]=h}}function i(){function B(O){var H=O.zoom,T=H<0?1:1<<H,U=O.column%T,x=O.row;if(U<0)U+=T;return{locationPoint:function(D){D=s.map.locationCoordinate(D);var G=Math.pow(2,H-D.zoom);return{x:o.x*(G*D.column-U),y:o.y*(G*D.row-x)}}}}function K(O,H,T){var U=I.zoom,x=2-
-R,D=4+R;for(O=O;O<H;O++){var G=f.load({column:O,row:T,zoom:U},B);if(!G.ready&&!(G.key in M)){G.proxyRefs={};for(var J,N,P,Q=1;Q<=x;Q++){N=true;for(var X=0,ea=1<<Q;X<=ea;X++)for(var aa=0;aa<=ea;aa++)if((P=f.peek(J={column:(O<<Q)+aa,row:(T<<Q)+X,zoom:U+Q}))&&P.ready){M[P.key]=f.load(J);P.proxyCount++;G.proxyRefs[P.key]=P}else N=false;if(N)break}if(!N)for(Q=1;Q<=D;Q++)if((P=f.peek(J={column:O>>Q,row:T>>Q,zoom:U-Q}))&&P.ready){M[P.key]=f.load(J);P.proxyCount++;G.proxyRefs[P.key]=P;break}}M[G.key]=G}}
-var h=a.map(),n=h.zoom(),w=n-(n=Math.round(n)),d=h.size(),r=h.angle(),o=h.tileSize(),z=h.locationCoordinate(h.center());if(A!=n){if(A<n)c(n);else if(A>n)k(n);else A=n;for(var v=-4;v<=2;v++){var L=C[v];L.setAttribute("class","zoom"+(v<0?"":"+")+v+" zoom"+(n+v));L.setAttribute("transform","scale("+Math.pow(2,-v)+")")}}u.setAttribute("transform","translate("+d.x/2+","+d.y/2+")"+(r?"rotate("+r/Math.PI*180+")":"")+(w?"scale("+Math.pow(2,w)+")":"")+(y?y.zoomFraction(w):""));var I=h.pointCoordinate(z,Y);
-v=h.pointCoordinate(z,{x:d.x,y:0});n=h.pointCoordinate(z,d);h=h.pointCoordinate(z,{x:0,y:d.y});if(!w&&!r&&!y){z.column=(Math.round(o.x*z.column)+(d.x&1)/2)/o.x;z.row=(Math.round(o.y*z.row)+(d.y&1)/2)/o.y}if(y){I=y.unapply(I);v=y.unapply(v);n=y.unapply(n);h=y.unapply(h);z=y.unapply(z)}var R=t?t(I.zoom)-I.zoom:0;if(R){d=Math.pow(2,R);I.column*=d;I.row*=d;v.column*=d;v.row*=d;n.column*=d;n.row*=d;h.column*=d;h.row*=d;I.zoom=v.zoom=n.zoom=h.zoom+=R}w=f.locks();var M={};for(var F in w)w[F].proxyCount=
-0;if(q&&R>-5&&R<3){r=I.zoom<0?1:1<<I.zoom;if(m){da(I,v,n,0,r,K);da(n,h,I,0,r,K)}else{d=Math.floor((I.column+n.column)/2);r=Math.max(0,Math.min(r-1,Math.floor((v.row+h.row)/2)));v=Math.min(4,I.zoom);d=d>>v<<v;r=r>>v<<v;K(d,d+1,r)}}for(F in M){v=M[F];d=Math.pow(2,v.level=v.zoom-z.zoom);v.element.setAttribute("transform","translate("+(v.x=o.x*(v.column-z.column*d))+","+(v.y=o.y*(v.row-z.row*d))+")")}for(F in w)if(!(F in M)){v=f.unload(F);v.element.parentNode.removeChild(v.element);delete v.proxyRefs}for(F in M){v=
-M[F];if(v.element.parentNode!=C[v.level]){C[v.level].appendChild(v.element);a.show&&a.show(v)}}f.flush();a.dispatch({type:"move"})}var a={},f=a.cache=s.cache(e,g).size(512),m=true,q=true,t,l,j,u=s.svg("g"),y,A,C={};u.setAttribute("class","layer");for(var E=-4;E<=-1;E++)C[E]=u.appendChild(s.svg("g"));for(E=2;E>=1;E--)C[E]=u.appendChild(s.svg("g"));C[0]=u.appendChild(s.svg("g"));a.map=function(B){if(!arguments.length)return j;if(j){if(j==B){u.parentNode.appendChild(u);return a}j.off("move",i).off("resize",
-i);u.parentNode.removeChild(u)}if(j=B){j.container().appendChild(u);a.init&&a.init(u);j.on("move",i).on("resize",i);i()}return a};a.container=function(){return u};a.levels=function(){return C};a.id=function(B){if(!arguments.length)return l;l=B;u.setAttribute("id",B);return a};a.visible=function(B){if(!arguments.length)return q;(q=B)?u.removeAttribute("visibility"):u.setAttribute("visibility","hidden");j&&i();return a};a.transform=function(B){if(!arguments.length)return y;y=B;j&&i();return a};a.zoom=
-function(B){if(!arguments.length)return t;t=typeof B=="function"||B==null?B:function(){return B};j&&i();return a};a.tile=function(B){if(!arguments.length)return m;m=B;j&&i();return a};a.reload=function(){f.clear();j&&i();return a};a.dispatch=s.dispatch(a);a.on("load",function(B){if(B.tile.proxyRefs){for(var K in B.tile.proxyRefs){var h=B.tile.proxyRefs[K];--h.proxyCount<=0&&f.unload(K)&&h.element.parentNode.removeChild(h.element)}delete B.tile.proxyRefs}});return a};s.image=function(){var e=s.layer(function(c){var k=
-c.element=s.svg("image"),i=e.map().tileSize();k.setAttribute("preserveAspectRatio","none");k.setAttribute("width",i.x);k.setAttribute("height",i.y);if(typeof g=="function"){k.setAttribute("opacity",0);c.request=s.queue.image(k,g(c),function(a){delete c.request;c.ready=true;c.img=a;k.removeAttribute("opacity");e.dispatch({type:"load",tile:c})})}else{c.ready=true;g&&k.setAttributeNS(s.ns.xlink,"href",g);e.dispatch({type:"load",tile:c})}},function(c){c.request&&c.request.abort(true)}),g;e.url=function(c){if(!arguments.length)return g;
-g=typeof c=="string"&&/{.}/.test(c)?s.url(c):c;return e.reload()};return e};s.geoJson=function(e){function g(h){var n={lat:0,lon:0};return function(w){n.lat=w[1];n.lon=w[0];var d=h(n);w.x=d.x;w.y=d.y;return d}}function c(h,n){return h&&h.type in C&&C[h.type](h,n)}function k(h,n,w){return h.type in E&&E[h.type](h,n,w)}function i(){var h=a.map().zoom(),n=a.cache.locks(),w,d,r,o,z,v,L;if(y=="fixed")for(w in n){if((d=n[w]).scale!=h){L="scale("+Math.pow(2,d.zoom-h)+")";o=-1;for(z=(r=d.features).length;++o<
-z;)k((v=r[o]).data.geometry,v.element,L);d.scale=h}}else for(w in n){o=-1;for(z=(r=(d=n[w]).features).length;++o<z;)k((v=r[o]).data.geometry,v.element,"");delete d.scale}}var a=s.layer(function(h,n){function w(r){var o=[];if(r.next)h.request=e(r.next.href,w);switch(r.type){case "FeatureCollection":for(var z=0;z<r.features.length;z++){var v=r.features[z],L=c(v.geometry,n);L&&o.push({element:d.appendChild(L),data:v})}break;case "Feature":(L=c(r.geometry,n))&&o.push({element:d.appendChild(L),data:r});
-break;default:(L=c(r,n))&&o.push({element:d.appendChild(L),data:{type:"Feature",geometry:r}});break}h.ready=true;o.push.apply(h.features,o);a.dispatch({type:"load",tile:h,features:o})}var d=h.element=s.svg("g");h.features=[];n=g(n(h).locationPoint);if(m!=null)h.request=e(typeof m=="function"?m(h):m,w);else w({type:"FeatureCollection",features:A||[]})},function(h){h.request&&h.request.abort(true)}),f=a.container(),m,q=true,t="org.polymaps."+s.id(),l="url(#"+t+")",j=f.insertBefore(s.svg("clipPath"),
-f.firstChild),u=j.appendChild(s.svg("rect")),y="auto",A;f.setAttribute("fill-rule","evenodd");j.setAttribute("id",t);if(!arguments.length)e=s.queue.json;var C={Point:function(h,n){var w=n(h.coordinates),d=s.svg("circle");d.setAttribute("r",4.5);d.setAttribute("transform","translate("+w.x+","+w.y+")");return d},MultiPoint:function(h,n){for(var w=s.svg("g"),d=h.coordinates,r,o,z=-1,v=d.length;++z<v;){o=w.appendChild(s.svg("circle"));o.setAttribute("r",4.5);o.setAttribute("transform","translate("+(r=
-n(d[z])).x+","+r.y+")")}return w},LineString:function(h,n){for(var w=s.svg("path"),d=["M"],r=h.coordinates,o,z=-1,v=r.length;++z<v;)d.push((o=n(r[z])).x,",",o.y,"L");d.pop();if(d.length){w.setAttribute("d",d.join(""));return w}},MultiLineString:function(h,n){for(var w=s.svg("path"),d=[],r=h.coordinates,o,z=-1,v,L=r.length,I;++z<L;){o=r[z];v=-1;I=o.length;for(d.push("M");++v<I;)d.push((p=n(o[v])).x,",",p.y,"L");d.pop()}if(d.length){w.setAttribute("d",d.join(""));return w}},Polygon:function(h,n){for(var w=
-s.svg("path"),d=[],r=h.coordinates,o,z=-1,v,L=r.length,I;++z<L;){o=r[z];v=-1;I=o.length-1;for(d.push("M");++v<I;)d.push((p=n(o[v])).x,",",p.y,"L");d[d.length-1]="Z"}if(d.length){w.setAttribute("d",d.join(""));return w}},MultiPolygon:function(h,n){for(var w=s.svg("path"),d=[],r=h.coordinates,o,z,v=-1,L,I,R=r.length,M,F;++v<R;){o=r[v];L=-1;for(M=o.length;++L<M;){z=o[L];I=-1;F=z.length-1;for(d.push("M");++I<F;)d.push((p=n(z[I])).x,",",p.y,"L");d[d.length-1]="Z"}}if(d.length){w.setAttribute("d",d.join(""));
-return w}},GeometryCollection:function(h,n){for(var w=s.svg("g"),d=-1,r=h.geometries,o=r.length,z;++d<o;)(z=c(r[d],n))&&w.appendChild(z);return w}},E={Point:function(h,n,w){h=h.coordinates;n.setAttribute("transform","translate("+h.x+","+h.y+")"+w)},MultiPoint:function(h,n,w){h=h.coordinates;var d=-1,r=o.length;n=n.firstChild;for(var o;++d<r;){o=h[d];n.setAttribute("transform","translate("+o.x+","+o.y+")"+w);n=n.nextSibling}}};a.url=function(h){if(!arguments.length)return m;m=typeof h=="string"&&/{.}/.test(h)?
-s.url(h):h;if(m!=null)A=null;typeof m=="string"&&a.tile(false);return a.reload()};a.features=function(h){if(!arguments.length)return A;if(A=h){m=null;a.tile(false)}return a.reload()};a.clip=function(h){if(!arguments.length)return q;q&&f.removeChild(j);if(q=h)f.insertBefore(j,f.firstChild);var n=a.cache.locks();for(var w in n)q?n[w].element.setAttribute("clip-path",l):n[w].element.removeAttribute("clip-path");return a};var B=a.tile;a.tile=function(h){arguments.length&&!h&&a.clip(h);return B.apply(a,
-arguments)};var K=a.map;a.map=function(h){if(h&&u){var n=h.tileSize();u.setAttribute("width",n.x);u.setAttribute("height",n.y)}return K.apply(a,arguments)};a.scale=function(h){if(!arguments.length)return y;(y=h)?a.on("move",i):a.off("move",i);a.map()&&i();return a};a.show=function(h){q?h.element.setAttribute("clip-path",l):h.element.removeAttribute("clip-path");a.dispatch({type:"show",tile:h,features:h.features});return a};a.reshow=function(){var h=a.cache.locks();for(var n in h)a.show(h[n]);return a};
-return a};s.dblclick=function(){function e(a){var f=k.zoom();f=a.shiftKey?Math.ceil(f)-f-1:1-f+Math.floor(f);c==="mouse"?k.zoomBy(f,k.mouse(a)):k.zoomBy(f)}var g={},c="mouse",k,i;g.zoom=function(a){if(!arguments.length)return c;c=a;return g};g.map=function(a){if(!arguments.length)return k;if(k){i.removeEventListener("dblclick",e,false);i=null}if(k=a){i=k.container();i.addEventListener("dblclick",e,false)}return g};return g};s.drag=function(){function e(f){if(!f.shiftKey){a={x:f.clientX,y:f.clientY};
-k.focusableParent().focus();f.preventDefault();document.body.style.setProperty("cursor","move",null)}}function g(f){if(a){k.panBy({x:f.clientX-a.x,y:f.clientY-a.y});a.x=f.clientX;a.y=f.clientY}}var c={},k,i,a;c.map=function(f){if(!arguments.length)return k;if(k){i.removeEventListener("mousedown",e,false);i=null}if(k=f){i=k.container();i.addEventListener("mousedown",e,false)}return c};window.addEventListener("mousemove",g,false);window.addEventListener("mouseup",function(f){if(a){g(f);a=null;document.body.style.removeProperty("cursor")}},
-false);return c};s.wheel=function(){function e(){m=null}function g(l){var j=(l.wheelDelta/120||-l.detail)*0.1,u;if(ba<0){u=Date.now();var y=u-i;if(y>9&&Math.abs(l.wheelDelta)/y>=50)ba=1;i=u}if(ba==1)j*=0.03;if(!a&&j){u=Date.now();if(u-k>200){j=j>0?+1:-1;k=u}else j=0}if(j)switch(f){case "mouse":u=q.mouse(l);m||(m=q.pointLocation(u));q.off("move",e).zoomBy(j,u,m).on("move",e);break;case "location":q.zoomBy(j,q.locationPoint(m),m);break;default:q.zoomBy(j);break}l.preventDefault();return false}var c=
-{},k=0,i=0,a=true,f="mouse",m,q,t;c.smooth=function(l){if(!arguments.length)return a;a=l;return c};c.zoom=function(l,j){if(!arguments.length)return f;f=l;m=j;if(q)f=="mouse"?q.on("move",e):q.off("move",e);return c};c.map=function(l){if(!arguments.length)return q;if(q){t.removeEventListener("mousemove",e,false);t.removeEventListener("mousewheel",g,false);t.removeEventListener("DOMMouseScroll",g,false);t=null;q.off("move",e)}if(q=l){f=="mouse"&&q.on("move",e);t=q.container();t.addEventListener("mousemove",
-e,false);t.addEventListener("mousewheel",g,false);t.addEventListener("DOMMouseScroll",g,false)}return c};return c};var ba=/WebKit\/533/.test(navigator.userAgent)?-1:0;s.arrow=function(){function e(y){if(!(y.ctrlKey||y.altKey||y.metaKey)){var A=Date.now(),C=0,E=0;switch(y.keyCode){case 37:if(!a.left){f=A;a.left=1;a.right||(C=l)}break;case 39:if(!a.right){f=A;a.right=1;a.left||(C=-l)}break;case 38:if(!a.up){f=A;a.up=1;a.down||(E=l)}break;case 40:if(!a.down){f=A;a.down=1;a.up||(E=-l)}break;default:return}if(C||
-E)j.panBy({x:C,y:E});if(!m&&a.left|a.right|a.up|a.down)m=setInterval(k,t);y.preventDefault()}}function g(y){f=Date.now();switch(y.keyCode){case 37:a.left=0;break;case 39:a.right=0;break;case 38:a.up=0;break;case 40:a.down=0;break;default:return}if(m&&!(a.left|a.right|a.up|a.down))m=clearInterval(m);y.preventDefault()}function c(y){switch(y.charCode){case 45:case 95:j.zoom(Math.ceil(j.zoom())-1);break;case 43:case 61:j.zoom(Math.floor(j.zoom())+1);break;default:return}y.preventDefault()}function k(){if(j)if(!(Date.now()<
-f+q)){var y=(a.left-a.right)*l,A=(a.up-a.down)*l;if(y||A)j.panBy({x:y,y:A})}}var i={},a={left:0,right:0,up:0,down:0},f=0,m,q=250,t=50,l=16,j,u;i.map=function(y){if(!arguments.length)return j;if(j){u.removeEventListener("keypress",c,false);u.removeEventListener("keydown",e,false);u.removeEventListener("keyup",g,false);u=null}if(j=y){u=j.focusableParent();u.addEventListener("keypress",c,false);u.addEventListener("keydown",e,false);u.addEventListener("keyup",g,false)}return i};i.speed=function(y){if(!arguments.length)return l;
-l=y;return i};return i};s.hash=function(){function e(){var f=a.center(),m=a.zoom(),q=Math.max(0,Math.ceil(Math.log(m)/Math.LN2));f="#"+m.toFixed(2)+"/"+f.lat.toFixed(q)+"/"+f.lon.toFixed(q);if(k!==f)location.replace(k=f)}function g(){if(location.hash!==k){var f=(k=location.hash).substring(1).split("/").map(Number);if(f.length<3||f.some(isNaN))e();else{var m=a.size();a.zoomBy(f[0]-a.zoom(),{x:m.x/2,y:m.y/2},{lat:Math.min(i,Math.max(-i,f[1])),lon:f[2]})}}}var c={},k,i=89.99999999,a;c.map=function(f){if(!arguments.length)return a;
-if(a){a.off("move",e);window.removeEventListener("hashchange",g,false)}if(a=f){a.on("move",e);window.addEventListener("hashchange",g,false);location.hash?g():e()}return c};return c};s.interact=function(){var e={},g=s.drag(),c=s.wheel(),k=s.dblclick(),i=s.arrow();e.map=function(a){g.map(a);c.map(a);k.map(a);i.map(a);return e};return e};s.compass=function(){function e(x){B.setAttribute("class","compass active");I||(I=setInterval(g,r));R&&H.panBy(R);w=Date.now();return l(x)}function g(){R&&Date.now()>
-w+d&&H.panBy(R)}function c(x){if(x.shiftKey){F={x0:H.mouse(x)};H.focusableParent().focus();return l(x)}}function k(x){if(F){F.x1=H.mouse(x);O.setAttribute("x",Math.min(F.x0.x,F.x1.x));O.setAttribute("y",Math.min(F.x0.y,F.x1.y));O.setAttribute("width",Math.abs(F.x0.x-F.x1.x));O.setAttribute("height",Math.abs(F.x0.y-F.x1.y));O.removeAttribute("display")}}function i(){B.setAttribute("class","compass");if(F){if(F.x1){H.extent([H.pointLocation({x:Math.min(F.x0.x,F.x1.x),y:Math.max(F.x0.y,F.x1.y)}),H.pointLocation({x:Math.max(F.x0.x,
-F.x1.x),y:Math.min(F.x0.y,F.x1.y)})]);O.setAttribute("display","none")}F=null}if(I){clearInterval(I);I=0}}function a(x){return function(){x?this.setAttribute("class","active"):this.removeAttribute("class");R=x}}function f(x){return function(D){B.setAttribute("class","compass active");var G=H.zoom();H.zoom(x<0?Math.ceil(G)-1:Math.floor(G)+1);return l(D)}}function m(x){return function(D){H.zoom(x);return l(D)}}function q(){this.setAttribute("class","active")}function t(){this.removeAttribute("class")}
-function l(x){x.stopPropagation();x.preventDefault();return false}function j(x){var D=Math.SQRT1_2*h,G=h*0.7,J=h*0.2,N=s.svg("g"),P=N.appendChild(s.svg("path")),Q=N.appendChild(s.svg("path"));P.setAttribute("class","direction");P.setAttribute("pointer-events","all");P.setAttribute("d","M0,0L"+D+","+D+"A"+h+","+h+" 0 0,1 "+-D+","+D+"Z");Q.setAttribute("class","chevron");Q.setAttribute("d","M"+J+","+(G-J)+"L0,"+G+" "+-J+","+(G-J));Q.setAttribute("pointer-events","none");N.addEventListener("mousedown",
-e,false);N.addEventListener("mouseover",a(x),false);N.addEventListener("mouseout",a(null),false);N.addEventListener("dblclick",l,false);return N}function u(x){var D=h*0.4,G=D/2,J=s.svg("g"),N=J.appendChild(s.svg("path")),P=J.appendChild(s.svg("path")),Q=J.appendChild(s.svg("path")),X=J.appendChild(s.svg("path"));N.setAttribute("class","back");N.setAttribute("d","M"+-D+",0V"+-D+"A"+D+","+D+" 0 1,1 "+D+","+-D+"V0Z");P.setAttribute("class","direction");P.setAttribute("d",N.getAttribute("d"));Q.setAttribute("class",
-"chevron");Q.setAttribute("d","M"+-G+","+-D+"H"+G+(x>0?"M0,"+(-D-G)+"V"+-G:""));X.setAttribute("class","fore");X.setAttribute("fill","none");X.setAttribute("d",N.getAttribute("d"));J.addEventListener("mousedown",f(x),false);J.addEventListener("mouseover",q,false);J.addEventListener("mouseout",t,false);J.addEventListener("dblclick",l,false);return J}function y(x){var D=h*0.2,G=h*0.4,J=s.svg("g"),N=J.appendChild(s.svg("rect")),P=J.appendChild(s.svg("path"));N.setAttribute("pointer-events","all");N.setAttribute("fill",
-"none");N.setAttribute("x",-G);N.setAttribute("y",-0.75*G);N.setAttribute("width",2*G);N.setAttribute("height",1.5*G);P.setAttribute("class","chevron");P.setAttribute("d","M"+-D+",0H"+D);J.addEventListener("mousedown",m(x),false);J.addEventListener("dblclick",l,false);return J}function A(){var x=h+6,D=x,G=H.size();switch(o){case "top-left":break;case "top-right":x=G.x-x;break;case "bottom-left":D=G.y-D;break;case "bottom-right":x=G.x-x;D=G.y-D;break}x="translate("+x+","+D+")";M&&M.setAttribute("transform",
-x);v&&v.setAttribute("transform",x);for(var J in K)J==H.zoom()?K[J].setAttribute("class","active"):K[J].removeAttribute("class")}function C(){for(;B.lastChild;)B.removeChild(B.lastChild);B.appendChild(O);if(L!="none"){M=B.appendChild(s.svg("g"));M.setAttribute("class","pan");var x=M.appendChild(s.svg("circle"));x.setAttribute("class","back");x.setAttribute("r",h);M.appendChild(j({x:0,y:-n})).setAttribute("transform","rotate(0)");M.appendChild(j({x:n,y:0})).setAttribute("transform","rotate(90)");M.appendChild(j({x:0,
-y:n})).setAttribute("transform","rotate(180)");M.appendChild(j({x:-n,y:0})).setAttribute("transform","rotate(270)");x=M.appendChild(s.svg("circle"));x.setAttribute("fill","none");x.setAttribute("class","fore");x.setAttribute("r",h)}else M=null;if(z!="none"){v=B.appendChild(s.svg("g"));v.setAttribute("class","zoom");x=-0.5;if(z=="big"){K={};var D=H.zoomRange()[0];for(x=0;D<=H.zoomRange()[1];D++,x++)(K[D]=v.appendChild(y(D))).setAttribute("transform","translate(0,"+-(x+0.75)*h*0.4+")")}D=L=="none"?
-0.4:2;v.setAttribute("transform","translate(0,"+h*(/^top-/.test(o)?D+(x+0.5)*0.4:-D)+")");v.appendChild(u(+1)).setAttribute("transform","translate(0,"+-(x+0.5)*h*0.4+")");v.appendChild(u(-1)).setAttribute("transform","scale(-1)")}else v=null;A()}var E={},B=s.svg("g"),K={},h=30,n=16,w=0,d=250,r=50,o="top-left",z="small",v,L="small",I,R,M,F,O=s.svg("rect"),H,T,U;B.setAttribute("class","compass");O.setAttribute("class","back fore");O.setAttribute("pointer-events","none");O.setAttribute("display","none");
-E.radius=function(x){if(!arguments.length)return h;h=x;H&&C();return E};E.speed=function(x){if(!arguments.length)return h;n=x;return E};E.position=function(x){if(!arguments.length)return o;o=x;H&&C();return E};E.pan=function(x){if(!arguments.length)return L;L=x;H&&C();return E};E.zoom=function(x){if(!arguments.length)return z;z=x;H&&C();return E};E.map=function(x){if(!arguments.length)return H;if(H){T.removeEventListener("mousedown",c,false);T.removeChild(B);T=null;U.removeEventListener("mousemove",
-k,false);U.removeEventListener("mouseup",i,false);U=null;H.off("move",A).off("resize",A)}if(H=x){T=H.container();T.appendChild(B);T.addEventListener("mousedown",c,false);U=T.ownerDocument.defaultView;U.addEventListener("mousemove",k,false);U.addEventListener("mouseup",i,false);H.on("move",A).on("resize",A);C()}return E};return E};s.grid=function(){function e(){var i=k.firstChild,a=c.size(),f=c.pointLocation(Y);c.pointLocation(a);var m=Math.pow(2,4-Math.round(c.zoom()));f.lat=Math.floor(f.lat/m)*m;
-f.lon=Math.ceil(f.lon/m)*m;for(var q;(q=c.locationPoint(f).x)<=a.x;f.lon+=m){i||(i=k.appendChild(s.svg("line")));i.setAttribute("x1",q);i.setAttribute("x2",q);i.setAttribute("y1",0);i.setAttribute("y2",a.y);i=i.nextSibling}for(;(q=c.locationPoint(f).y)<=a.y;f.lat-=m){i||(i=k.appendChild(s.svg("line")));i.setAttribute("y1",q);i.setAttribute("y2",q);i.setAttribute("x1",0);i.setAttribute("x2",a.x);i=i.nextSibling}for(;i;){a=i.nextSibling;k.removeChild(i);i=a}}var g={},c,k=s.svg("g");k.setAttribute("class",
-"grid");g.map=function(i){if(!arguments.length)return c;if(c){k.parentNode.removeChild(k);c.off("move",e).off("resize",e)}if(c=i){c.on("move",e).on("resize",e);c.container().appendChild(k);c.dispatch({type:"move"})}return g};return g};s.stylist=function(){function e(i){var a=i.features.length,f=g.length,m=c.length,q,t,l,j,u,y;for(u=0;u<a;++u)if(t=(q=i.features[u]).element){q=q.data;for(y=0;y<f;++y){j=(l=g[y]).value;if(typeof j==="function")j=j.call(null,q);j==null?l.name.local?t.removeAttributeNS(l.name.space,
-l.name.local):t.removeAttribute(l.name):l.name.local?t.setAttributeNS(l.name.space,l.name.local,j):t.setAttribute(l.name,j)}for(y=0;y<m;++y){j=(l=c[y]).value;if(typeof j==="function")j=j.call(null,q);j==null?t.style.removeProperty(l.name):t.style.setProperty(l.name,j,l.priority)}if(j=k){if(typeof j==="function")j=j.call(null,q);for(;t.lastChild;)t.removeChild(t.lastChild);j!=null&&t.appendChild(s.svg("title")).appendChild(document.createTextNode(j))}}}var g=[],c=[],k;e.attr=function(i,a){g.push({name:fa(i),
-value:a});return e};e.style=function(i,a,f){c.push({name:i,value:a,priority:arguments.length<3?null:f});return e};e.title=function(i){k=i;return e};return e}})(org.polymaps);
+(function(s){function fa(e){var h=e.indexOf(":");return h<0?e:{space:s.ns[e.substring(0,h)],local:e.substring(h+1)}}function S(){for(var e=0;e<S.maps.length;e++)S.maps[e].resize()}function V(e){return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function W(e){return 180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360))}function Z(e,h){if(e.row>h.row){var c=e;e=h;h=c}return{x0:e.column,y0:e.row,x1:h.column,y1:h.row,dx:h.column-e.column,dy:h.row-e.row}}function ca(e,h,c,k,g){c=Math.max(c,Math.floor(h.y0));
+k=Math.min(k,Math.ceil(h.y1));if(e.x0==h.x0&&e.y0==h.y0?e.x0+h.dy/e.dy*e.dx<h.x1:e.x1-h.dy/e.dy*e.dx<h.x0){var a=e;e=h;h=a}a=e.dx/e.dy;var f=h.dx/h.dy,m=e.dx>0,q=h.dx<0;for(c=c;c<k;c++){var t=a*Math.max(0,Math.min(e.dy,c+m-e.y0))+e.x0;g(Math.floor(f*Math.max(0,Math.min(h.dy,c+q-h.y0))+h.x0),Math.ceil(t),c)}}function da(e,h,c,k,g,a){var f=Z(e,h);h=Z(h,c);e=Z(c,e);if(f.dy>h.dy){c=f;f=h;h=c}if(f.dy>e.dy){c=f;f=e;e=c}if(h.dy>e.dy){c=h;h=e;e=c}f.dy&&ca(e,f,k,g,a);h.dy&&ca(e,h,k,g,a)}s.version="2.3+1.0";
+var Y={x:0,y:0};s.ns={svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink"};s.id=function(){var e=0;return function(){return++e}}();s.svg=function(e){return document.createElementNS(s.ns.svg,e)};s.transform=function(e,h,c,k,g,a){var f={},m,q,t;if(!arguments.length){e=1;h=g=c=0;k=1;a=0}f.zoomFraction=function(l){if(!arguments.length)return q;q=l;m=Math.floor(q+Math.log(Math.sqrt(e*e+h*h+c*c+k*k))/Math.log(2));t=Math.pow(2,-m);return f};f.apply=function(l){var i=Math.pow(2,-l.zoom),
+u=Math.pow(2,l.zoom-m);return{column:(e*l.column*i+c*l.row*i+g)*u,row:(h*l.column*i+k*l.row*i+a)*u,zoom:l.zoom-m}};f.unapply=function(l){var i=Math.pow(2,-l.zoom),u=Math.pow(2,l.zoom+m);return{column:(l.column*i*k-l.row*i*c-g*k+a*c)/(e*k-h*c)*u,row:(l.column*i*h-l.row*i*e-g*h+a*e)/(c*h-k*e)*u,zoom:l.zoom+m}};f.toString=function(){return"matrix("+[e*t,h*t,c*t,k*t].join(" ")+" 0 0)"};return f.zoomFraction(0)};s.cache=function(e,h){function c(i){l--;h&&h(i);delete f[i.key];if(i.next)i.next.prev=i.prev;
+else if(q=i.prev)q.next=null;if(i.prev)i.prev.next=i.next;else if(m=i.next)m.prev=null}function k(){for(var i=q;l>t;i=i.prev){if(!i)break;i.lock||c(i)}}var g={},a={},f={},m=null,q=null,t=64,l=0;g.peek=function(i){return f[[i.zoom,i.column,i.row].join("/")]};g.load=function(i,u){var y=[i.zoom,i.column,i.row].join("/"),A=f[y];if(A){if(A.prev){if(A.prev.next=A.next)A.next.prev=A.prev;else q=A.prev;A.prev=null;A.next=m;m=m.prev=A}A.lock=1;return a[y]=A}A={key:y,column:i.column,row:i.row,zoom:i.zoom,next:m,
+prev:null,lock:1};e.call(null,A,u);a[y]=f[y]=A;if(m)m.prev=A;else q=A;m=A;l++;return A};g.unload=function(i){if(!(i in a))return false;var u=a[i];u.lock=0;delete a[i];u.request&&u.request.abort(false)&&c(u);return u};g.locks=function(){return a};g.size=function(i){if(!arguments.length)return t;t=i;k();return g};g.flush=function(){k();return g};g.clear=function(){for(var i in f){var u=f[i];u.request&&u.request.abort(false);h&&h(f[i]);if(u.lock){u.lock=0;u.element.parentNode.removeChild(u.element)}}a=
+{};f={};m=q=null;l=0;return g};return g};s.url=function(e){function h(g){var a=g.zoom<0?1:1<<g.zoom,f=g.column;if(k){f=g.column%a;if(f<0)f+=a}else if(f<0||f>=a)return"about:blank";return e.replace(/{(.)}/g,function(m,q){switch(q){case "S":return c[(Math.abs(g.zoom)+g.row+f)%c.length];case "Z":return g.zoom;case "X":return f;case "Y":return g.row;case "B":var t=s.map.coordinateLocation({row:g.row,column:f,zoom:g.zoom}),l=s.map.coordinateLocation({row:g.row+1,column:f+1,zoom:g.zoom}),i=Math.ceil(Math.log(g.zoom)/
+Math.LN2);return l.lat.toFixed(i)+","+t.lon.toFixed(i)+","+t.lat.toFixed(i)+","+l.lon.toFixed(i)}return q})}var c=[],k=true;h.template=function(g){if(!arguments.length)return e;e=g;return h};h.hosts=function(g){if(!arguments.length)return c;c=g;return h};h.repeat=function(g){if(!arguments.length)return k;k=g;return h};return h};s.dispatch=function(e){var h={};e.on=function(c,k){for(var g=h[c]||(h[c]=[]),a=0;a<g.length;a++)if(g[a].handler==k)return e;g.push({handler:k,on:true});return e};e.off=function(c,
+k){var g=h[c];if(g)for(var a=0;a<g.length;a++){var f=g[a];if(f.handler==k){f.on=false;g.splice(a,1);break}}return e};return function(c){var k=h[c.type];if(k){k=k.slice();for(var g=0;g<k.length;g++){var a=k[g];a.on&&a.handler.call(e,c)}}}};s.queue=function(){function e(){if(!(g>=a||!k.length)){g++;k.pop()()}}function h(f){for(var m=0;m<k.length;m++)if(k[m]==f){k.splice(m,1);return true}return false}function c(f,m,q){function t(){l=new XMLHttpRequest;q&&l.overrideMimeType(q);l.open("GET",f,true);l.onreadystatechange=
+function(){if(l.readyState==4){g--;l.status<300&&m(l);e()}};l.send(null)}var l;k.push(t);e();return{abort:function(i){if(h(t))return true;if(i&&l){l.abort();return true}return false}}}var k=[],g=0,a=6;return{text:function(f,m,q){return c(f,function(t){t.responseText&&m(t.responseText)},q)},xml:function(f,m){return c(f,function(q){q.responseXML&&m(q.responseXML)},"application/xml")},json:function(f,m){return c(f,function(q){q.responseText&&m(JSON.parse(q.responseText))},"application/json")},image:function(f,
+m,q){function t(){l=document.createElement("img");l.onerror=function(){g--;e()};l.onload=function(){g--;q(l);e()};l.src=m;f.setAttributeNS(s.ns.xlink,"href",m)}var l;k.push(t);e();return{abort:function(i){if(h(t))return true;if(i&&l){l.src="about:";return true}return false}}}}}();s.map=function(){function e(){if(u)if(t<u[0])t=u[0];else if(t>u[1])t=u[1];l=t-(t=Math.round(t));i=Math.pow(2,l)}function h(){if(n){var d=45/Math.pow(2,t+l-3),r=Math.max(Math.abs(C*f.x+A*f.y),Math.abs(B*f.x+E*f.y)),o=V(K-
+r*d/m.y);r=V(j+r*d/m.y);q.lat=Math.max(o,Math.min(r,q.lat));o=Math.max(Math.abs(C*f.y+A*f.x),Math.abs(B*f.y+E*f.x));q.lon=Math.max(n[0].lon-o*d/m.x,Math.min(n[1].lon+o*d/m.x,q.lon))}}var c={},k,g,a=Y,f=Y,m={x:256,y:256},q={lat:37.76487,lon:-122.41948},t=12,l=0,i=1,u=[1,18],y=0,A=1,C=0,E=1,B=0,K=-180,j=180,n=[{lat:V(K),lon:-Infinity},{lat:V(j),lon:Infinity}];c.locationCoordinate=function(d){d=s.map.locationCoordinate(d);var r=Math.pow(2,t);d.column*=r;d.row*=r;d.zoom+=t;return d};c.coordinateLocation=
+s.map.coordinateLocation;c.coordinatePoint=function(d,r){var o=Math.pow(2,t-r.zoom),z=Math.pow(2,t-d.zoom),v=(r.column*o-d.column*z)*m.x*i;o=(r.row*o-d.row*z)*m.y*i;return{x:f.x+A*v-C*o,y:f.y+C*v+A*o}};c.pointCoordinate=function(d,r){var o=Math.pow(2,t-d.zoom),z=(r.x-f.x)/i,v=(r.y-f.y)/i;return{column:d.column*o+(E*z-B*v)/m.x,row:d.row*o+(B*z+E*v)/m.y,zoom:t}};c.locationPoint=function(d){var r=Math.pow(2,t+l-3)/45,o=(d.lon-q.lon)*r*m.x;d=(W(q.lat)-W(d.lat))*r*m.y;return{x:f.x+A*o-C*d,y:f.y+C*o+A*
+d}};c.pointLocation=function(d){var r=45/Math.pow(2,t+l-3),o=(d.x-f.x)*r;d=(d.y-f.y)*r;return{lon:q.lon+(E*o-B*d)/m.x,lat:V(W(q.lat)-(B*o+E*d)/m.y)}};var w=s.svg("rect");w.setAttribute("visibility","hidden");w.setAttribute("pointer-events","all");c.container=function(d){if(!arguments.length)return k;k=d;k.setAttribute("class","map");k.appendChild(w);return c.resize()};c.focusableParent=function(){for(var d=k;d;d=d.parentNode)if(d.tabIndex>=0)return d;return window};c.mouse=function(d){var r=(k.ownerSVGElement||
+k).createSVGPoint();if($<0&&(window.scrollX||window.scrollY)){var o=document.body.appendChild(s.svg("svg"));o.style.position="absolute";o.style.top=o.style.left="0px";var z=o.getScreenCTM();$=!(z.f||z.e);document.body.removeChild(o)}if($){r.x=d.pageX;r.y=d.pageY}else{r.x=d.clientX;r.y=d.clientY}return r.matrixTransform(k.getScreenCTM().inverse())};c.size=function(d){if(!arguments.length)return a;g=d;return c.resize()};c.resize=function(){if(g){a=g;S.remove(c)}else{w.setAttribute("width","100%");w.setAttribute("height",
+"100%");b=w.getBBox();a={x:b.width,y:b.height};S.add(c)}w.setAttribute("width",a.x);w.setAttribute("height",a.y);f={x:a.x/2,y:a.y/2};h();c.dispatch({type:"resize"});return c};c.tileSize=function(d){if(!arguments.length)return m;m=d;c.dispatch({type:"move"});return c};c.center=function(d){if(!arguments.length)return q;q=d;h();c.dispatch({type:"move"});return c};c.panBy=function(d){var r=45/Math.pow(2,t+l-3),o=d.x*r;d=d.y*r;return c.center({lon:q.lon+(B*d-E*o)/m.x,lat:V(W(q.lat)+(B*o+E*d)/m.y)})};c.centerRange=
+function(d){if(!arguments.length)return n;if(n=d){K=n[0].lat>-90?W(n[0].lat):-Infinity;j=n[0].lat<90?W(n[1].lat):Infinity}else{K=-Infinity;j=Infinity}h();c.dispatch({type:"move"});return c};c.zoom=function(d){if(!arguments.length)return t+l;t=d;e();return c.center(q)};c.zoomBy=function(d,r,o){if(arguments.length<2)return c.zoom(t+l+d);if(arguments.length<3)o=c.pointLocation(r);t=t+l+d;e();var z=c.locationPoint(o);return c.panBy({x:r.x-z.x,y:r.y-z.y})};c.zoomRange=function(d){if(!arguments.length)return u;
+u=d;return c.zoom(t+l)};c.extent=function(d){if(!arguments.length)return[c.pointLocation({x:0,y:a.y}),c.pointLocation({x:a.x,y:0})];var r=c.locationPoint(d[0]),o=c.locationPoint(d[1]),z=Math.max((o.x-r.x)/a.x,(r.y-o.y)/a.y);r=c.pointLocation({x:(r.x+o.x)/2,y:(r.y+o.y)/2});t=t+l-Math.log(z)/Math.log(2);e();return c.center(r)};c.angle=function(d){if(!arguments.length)return y;y=d;A=Math.cos(y);C=Math.sin(y);E=Math.cos(-y);B=Math.sin(-y);h();c.dispatch({type:"move"});return c};c.add=function(d){d.map(c);
+return c};c.remove=function(d){d.map(null);return c};c.dispatch=s.dispatch(c);return c};S.maps=[];S.add=function(e){for(var h=0;h<S.maps.length;h++)if(S.maps[h]==e)return;S.maps.push(e)};S.remove=function(e){for(var h=0;h<S.maps.length;h++)if(S.maps[h]==e){S.maps.splice(h,1);return}};window.addEventListener("resize",S,false);s.map.locationCoordinate=function(e){var h=1/360;return{column:(e.lon+180)*h,row:(180-W(e.lat))*h,zoom:0}};s.map.coordinateLocation=function(e){var h=45/Math.pow(2,e.zoom-3);
+return{lon:h*e.column-180,lat:V(180-h*e.row)}};var $=/WebKit/.test(navigator.userAgent)?-1:0;s.layer=function(e,h){function c(B){for(var K=C[0].nextSibling;A<B;A++){u.insertBefore(C[-4],K);u.insertBefore(C[2],K);u.insertBefore(C[1],K);for(var j=C[-4],n=-4;n<2;)C[n]=C[++n];C[n]=j}}function k(B){for(var K=C[0].nextSibling;A>B;A--){u.insertBefore(C[-1],K);u.insertBefore(C[2],C[-4]);for(var j=C[2],n=2;n>-4;)C[n]=C[--n];C[n]=j}}function g(){function B(O){var H=O.zoom,T=H<0?1:1<<H,U=O.column%T,x=O.row;
+if(U<0)U+=T;return{locationPoint:function(D){D=s.map.locationCoordinate(D);var G=Math.pow(2,H-D.zoom);return{x:o.x*(G*D.column-U),y:o.y*(G*D.row-x)}}}}function K(O,H,T){var U=I.zoom,x=2-R,D=4+R;for(O=O;O<H;O++){var G=f.load({column:O,row:T,zoom:U},B);if(!G.ready&&!(G.key in M)){G.proxyRefs={};for(var J,N,P,Q=1;Q<=x;Q++){N=true;for(var X=0,ea=1<<Q;X<=ea;X++)for(var aa=0;aa<=ea;aa++)if((P=f.peek(J={column:(O<<Q)+aa,row:(T<<Q)+X,zoom:U+Q}))&&P.ready){M[P.key]=f.load(J);P.proxyCount++;G.proxyRefs[P.key]=
+P}else N=false;if(N)break}if(!N)for(Q=1;Q<=D;Q++)if((P=f.peek(J={column:O>>Q,row:T>>Q,zoom:U-Q}))&&P.ready){M[P.key]=f.load(J);P.proxyCount++;G.proxyRefs[P.key]=P;break}}M[G.key]=G}}var j=a.map(),n=j.zoom(),w=n-(n=Math.round(n)),d=j.size(),r=j.angle(),o=j.tileSize(),z=j.locationCoordinate(j.center());if(A!=n){if(A<n)c(n);else if(A>n)k(n);else A=n;for(var v=-4;v<=2;v++){var L=C[v];L.setAttribute("class","zoom"+(v<0?"":"+")+v+" zoom"+(n+v));L.setAttribute("transform","scale("+Math.pow(2,-v)+")")}}u.setAttribute("transform",
+"translate("+d.x/2+","+d.y/2+")"+(r?"rotate("+r/Math.PI*180+")":"")+(w?"scale("+Math.pow(2,w)+")":"")+(y?y.zoomFraction(w):""));var I=j.pointCoordinate(z,Y);v=j.pointCoordinate(z,{x:d.x,y:0});n=j.pointCoordinate(z,d);j=j.pointCoordinate(z,{x:0,y:d.y});if(!w&&!r&&!y){z.column=(Math.round(o.x*z.column)+(d.x&1)/2)/o.x;z.row=(Math.round(o.y*z.row)+(d.y&1)/2)/o.y}if(y){I=y.unapply(I);v=y.unapply(v);n=y.unapply(n);j=y.unapply(j);z=y.unapply(z)}var R=t?t(I.zoom)-I.zoom:0;if(R){d=Math.pow(2,R);I.column*=
+d;I.row*=d;v.column*=d;v.row*=d;n.column*=d;n.row*=d;j.column*=d;j.row*=d;I.zoom=v.zoom=n.zoom=j.zoom+=R}w=f.locks();var M={};for(var F in w)w[F].proxyCount=0;if(q&&R>-5&&R<3){r=I.zoom<0?1:1<<I.zoom;if(m){da(I,v,n,0,r,K);da(n,j,I,0,r,K)}else{d=Math.floor((I.column+n.column)/2);r=Math.max(0,Math.min(r-1,Math.floor((v.row+j.row)/2)));v=Math.min(4,I.zoom);d=d>>v<<v;r=r>>v<<v;K(d,d+1,r)}}for(F in M){v=M[F];d=Math.pow(2,v.level=v.zoom-z.zoom);v.element.setAttribute("transform","translate("+(v.x=o.x*(v.column-
+z.column*d))+","+(v.y=o.y*(v.row-z.row*d))+")")}for(F in w)if(!(F in M)){v=f.unload(F);v.element.parentNode.removeChild(v.element);delete v.proxyRefs}for(F in M){v=M[F];if(v.element.parentNode!=C[v.level]){C[v.level].appendChild(v.element);a.show&&a.show(v)}}f.flush();a.dispatch({type:"move"})}var a={},f=a.cache=s.cache(e,h).size(512),m=true,q=true,t,l,i,u=s.svg("g"),y,A,C={};u.setAttribute("class","layer");for(var E=-4;E<=-1;E++)C[E]=u.appendChild(s.svg("g"));for(E=2;E>=1;E--)C[E]=u.appendChild(s.svg("g"));
+C[0]=u.appendChild(s.svg("g"));a.map=function(B){if(!arguments.length)return i;if(i){if(i==B){u.parentNode.appendChild(u);return a}i.off("move",g).off("resize",g);u.parentNode.removeChild(u)}if(i=B){i.container().appendChild(u);a.init&&a.init(u);i.on("move",g).on("resize",g);g()}return a};a.container=function(){return u};a.levels=function(){return C};a.id=function(B){if(!arguments.length)return l;l=B;u.setAttribute("id",B);return a};a.visible=function(B){if(!arguments.length)return q;(q=B)?u.removeAttribute("visibility"):
+u.setAttribute("visibility","hidden");i&&g();return a};a.transform=function(B){if(!arguments.length)return y;y=B;i&&g();return a};a.zoom=function(B){if(!arguments.length)return t;t=typeof B=="function"||B==null?B:function(){return B};i&&g();return a};a.tile=function(B){if(!arguments.length)return m;m=B;i&&g();return a};a.reload=function(){f.clear();i&&g();return a};a.dispatch=s.dispatch(a);a.on("load",function(B){if(B.tile.proxyRefs){for(var K in B.tile.proxyRefs){var j=B.tile.proxyRefs[K];--j.proxyCount<=
+0&&f.unload(K)&&j.element.parentNode.removeChild(j.element)}delete B.tile.proxyRefs}});return a};s.image=function(){var e=s.layer(function(c){var k=c.element=s.svg("image"),g=e.map().tileSize();k.setAttribute("preserveAspectRatio","none");k.setAttribute("width",g.x);k.setAttribute("height",g.y);if(typeof h=="function"){k.setAttribute("opacity",0);c.request=s.queue.image(k,h(c),function(a){delete c.request;c.ready=true;c.img=a;k.removeAttribute("opacity");e.dispatch({type:"load",tile:c})})}else{c.ready=
+true;h&&k.setAttributeNS(s.ns.xlink,"href",h);e.dispatch({type:"load",tile:c})}},function(c){c.request&&c.request.abort(true)}),h;e.url=function(c){if(!arguments.length)return h;h=typeof c=="string"&&/{.}/.test(c)?s.url(c):c;return e.reload()};return e};s.geoJson=function(e){function h(j){var n={lat:0,lon:0};return function(w){n.lat=w[1];n.lon=w[0];var d=j(n);w.x=d.x;w.y=d.y;return d}}function c(j,n){return j&&j.type in C&&C[j.type](j,n)}function k(j,n,w){return j.type in E&&E[j.type](j,n,w)}function g(){var j=
+a.map().zoom(),n=a.cache.locks(),w,d,r,o,z,v,L;if(y=="fixed")for(w in n){if((d=n[w]).scale!=j){L="scale("+Math.pow(2,d.zoom-j)+")";o=-1;for(z=(r=d.features).length;++o<z;)k((v=r[o]).data.geometry,v.element,L);d.scale=j}}else for(w in n){o=-1;for(z=(r=(d=n[w]).features).length;++o<z;)k((v=r[o]).data.geometry,v.element,"");delete d.scale}}var a=s.layer(function(j,n){function w(r){var o=[];if(r.next)j.request=e(r.next.href,w);switch(r.type){case "FeatureCollection":for(var z=0;z<r.features.length;z++){var v=
+r.features[z],L=c(v.geometry,n);L&&o.push({element:d.appendChild(L),data:v})}break;case "Feature":(L=c(r.geometry,n))&&o.push({element:d.appendChild(L),data:r});break;default:(L=c(r,n))&&o.push({element:d.appendChild(L),data:{type:"Feature",geometry:r}});break}j.ready=true;o.push.apply(j.features,o);a.dispatch({type:"load",tile:j,features:o})}var d=j.element=s.svg("g");j.features=[];n=h(n(j).locationPoint);if(m!=null)j.request=e(typeof m=="function"?m(j):m,w);else w({type:"FeatureCollection",features:A||
+[]})},function(j){j.request&&j.request.abort(true)}),f=a.container(),m,q=true,t="org.polymaps."+s.id(),l="url(#"+t+")",i=f.insertBefore(s.svg("clipPath"),f.firstChild),u=i.appendChild(s.svg("rect")),y="auto",A;f.setAttribute("fill-rule","evenodd");i.setAttribute("id",t);if(!arguments.length)e=s.queue.json;var C={Point:function(j,n){var w=n(j.coordinates),d=s.svg("circle");d.setAttribute("r",4.5);d.setAttribute("transform","translate("+w.x+","+w.y+")");return d},MultiPoint:function(j,n){for(var w=
+s.svg("g"),d=j.coordinates,r,o,z=-1,v=d.length;++z<v;){o=w.appendChild(s.svg("circle"));o.setAttribute("r",4.5);o.setAttribute("transform","translate("+(r=n(d[z])).x+","+r.y+")")}return w},LineString:function(j,n){for(var w=s.svg("path"),d=["M"],r=j.coordinates,o,z=-1,v=r.length;++z<v;)d.push((o=n(r[z])).x,",",o.y,"L");d.pop();if(d.length){w.setAttribute("d",d.join(""));return w}},MultiLineString:function(j,n){for(var w=s.svg("path"),d=[],r=j.coordinates,o,z=-1,v,L=r.length,I;++z<L;){o=r[z];v=-1;
+I=o.length;for(d.push("M");++v<I;)d.push((p=n(o[v])).x,",",p.y,"L");d.pop()}if(d.length){w.setAttribute("d",d.join(""));return w}},Polygon:function(j,n){for(var w=s.svg("path"),d=[],r=j.coordinates,o,z=-1,v,L=r.length,I;++z<L;){o=r[z];v=-1;I=o.length-1;for(d.push("M");++v<I;)d.push((p=n(o[v])).x,",",p.y,"L");d[d.length-1]="Z"}if(d.length){w.setAttribute("d",d.join(""));return w}},MultiPolygon:function(j,n){for(var w=s.svg("path"),d=[],r=j.coordinates,o,z,v=-1,L,I,R=r.length,M,F;++v<R;){o=r[v];L=-1;
+for(M=o.length;++L<M;){z=o[L];I=-1;F=z.length-1;for(d.push("M");++I<F;)d.push((p=n(z[I])).x,",",p.y,"L");d[d.length-1]="Z"}}if(d.length){w.setAttribute("d",d.join(""));return w}},GeometryCollection:function(j,n){for(var w=s.svg("g"),d=-1,r=j.geometries,o=r.length,z;++d<o;)(z=c(r[d],n))&&w.appendChild(z);return w}},E={Point:function(j,n,w){j=j.coordinates;n.setAttribute("transform","translate("+j.x+","+j.y+")"+w)},MultiPoint:function(j,n,w){j=j.coordinates;var d=-1,r=o.length;n=n.firstChild;for(var o;++d<
+r;){o=j[d];n.setAttribute("transform","translate("+o.x+","+o.y+")"+w);n=n.nextSibling}}};a.url=function(j){if(!arguments.length)return m;m=typeof j=="string"&&/{.}/.test(j)?s.url(j):j;if(m!=null)A=null;typeof m=="string"&&a.tile(false);return a.reload()};a.features=function(j){if(!arguments.length)return A;if(A=j){m=null;a.tile(false)}return a.reload()};a.clip=function(j){if(!arguments.length)return q;q&&f.removeChild(i);if(q=j)f.insertBefore(i,f.firstChild);var n=a.cache.locks();for(var w in n)q?
+n[w].element.setAttribute("clip-path",l):n[w].element.removeAttribute("clip-path");return a};var B=a.tile;a.tile=function(j){arguments.length&&!j&&a.clip(j);return B.apply(a,arguments)};var K=a.map;a.map=function(j){if(j&&u){var n=j.tileSize();u.setAttribute("width",n.x);u.setAttribute("height",n.y)}return K.apply(a,arguments)};a.scale=function(j){if(!arguments.length)return y;(y=j)?a.on("move",g):a.off("move",g);a.map()&&g();return a};a.show=function(j){q?j.element.setAttribute("clip-path",l):j.element.removeAttribute("clip-path");
+a.dispatch({type:"show",tile:j,features:j.features});return a};a.reshow=function(){var j=a.cache.locks();for(var n in j)a.show(j[n]);return a};return a};s.dblclick=function(){function e(a){var f=k.zoom();f=a.shiftKey?Math.ceil(f)-f-1:1-f+Math.floor(f);c==="mouse"?k.zoomBy(f,k.mouse(a)):k.zoomBy(f)}var h={},c="mouse",k,g;h.zoom=function(a){if(!arguments.length)return c;c=a;return h};h.map=function(a){if(!arguments.length)return k;if(k){g.removeEventListener("dblclick",e,false);g=null}if(k=a){g=k.container();
+g.addEventListener("dblclick",e,false)}return h};return h};s.drag=function(){function e(f){if(!f.shiftKey){a={x:f.clientX,y:f.clientY};k.focusableParent().focus();f.preventDefault();document.body.style.setProperty("cursor","move",null)}}function h(f){if(a){k.panBy({x:f.clientX-a.x,y:f.clientY-a.y});a.x=f.clientX;a.y=f.clientY}}var c={},k,g,a;c.map=function(f){if(!arguments.length)return k;if(k){g.removeEventListener("mousedown",e,false);g=null}if(k=f){g=k.container();g.addEventListener("mousedown",
+e,false)}return c};window.addEventListener("mousemove",h,false);window.addEventListener("mouseup",function(f){if(a){h(f);a=null;document.body.style.removeProperty("cursor")}},false);return c};s.wheel=function(){function e(){m=null}function h(l){var i=(l.wheelDelta/120||-l.detail)*0.1,u;if(ba<0){u=Date.now();var y=u-g;if(y>9&&Math.abs(l.wheelDelta)/y>=50)ba=1;g=u}if(ba==1)i*=0.03;if(!a&&i){u=Date.now();if(u-k>200){i=i>0?+1:-1;k=u}else i=0}if(i)switch(f){case "mouse":u=q.mouse(l);m||(m=q.pointLocation(u));
+q.off("move",e).zoomBy(i,u,m).on("move",e);break;case "location":q.zoomBy(i,q.locationPoint(m),m);break;default:q.zoomBy(i);break}l.preventDefault();return false}var c={},k=0,g=0,a=true,f="mouse",m,q,t;c.smooth=function(l){if(!arguments.length)return a;a=l;return c};c.zoom=function(l,i){if(!arguments.length)return f;f=l;m=i;if(q)f=="mouse"?q.on("move",e):q.off("move",e);return c};c.map=function(l){if(!arguments.length)return q;if(q){t.removeEventListener("mousemove",e,false);t.removeEventListener("mousewheel",
+h,false);t.removeEventListener("DOMMouseScroll",h,false);t=null;q.off("move",e)}if(q=l){f=="mouse"&&q.on("move",e);t=q.container();t.addEventListener("mousemove",e,false);t.addEventListener("mousewheel",h,false);t.addEventListener("DOMMouseScroll",h,false)}return c};return c};var ba=/WebKit\/533/.test(navigator.userAgent)?-1:0;s.arrow=function(){function e(y){if(!(y.ctrlKey||y.altKey||y.metaKey)){var A=Date.now(),C=0,E=0;switch(y.keyCode){case 37:if(!a.left){f=A;a.left=1;a.right||(C=l)}break;case 39:if(!a.right){f=
+A;a.right=1;a.left||(C=-l)}break;case 38:if(!a.up){f=A;a.up=1;a.down||(E=l)}break;case 40:if(!a.down){f=A;a.down=1;a.up||(E=-l)}break;default:return}if(C||E)i.panBy({x:C,y:E});if(!m&&a.left|a.right|a.up|a.down)m=setInterval(k,t);y.preventDefault()}}function h(y){f=Date.now();switch(y.keyCode){case 37:a.left=0;break;case 39:a.right=0;break;case 38:a.up=0;break;case 40:a.down=0;break;default:return}if(m&&!(a.left|a.right|a.up|a.down))m=clearInterval(m);y.preventDefault()}function c(y){switch(y.charCode){case 45:case 95:i.zoom(Math.ceil(i.zoom())-
+1);break;case 43:case 61:i.zoom(Math.floor(i.zoom())+1);break;default:return}y.preventDefault()}function k(){if(i)if(!(Date.now()<f+q)){var y=(a.left-a.right)*l,A=(a.up-a.down)*l;if(y||A)i.panBy({x:y,y:A})}}var g={},a={left:0,right:0,up:0,down:0},f=0,m,q=250,t=50,l=16,i,u;g.map=function(y){if(!arguments.length)return i;if(i){u.removeEventListener("keypress",c,false);u.removeEventListener("keydown",e,false);u.removeEventListener("keyup",h,false);u=null}if(i=y){u=i.focusableParent();u.addEventListener("keypress",
+c,false);u.addEventListener("keydown",e,false);u.addEventListener("keyup",h,false)}return g};g.speed=function(y){if(!arguments.length)return l;l=y;return g};return g};s.hash=function(){function e(){var f=a.center(),m=a.zoom(),q=Math.max(0,Math.ceil(Math.log(m)/Math.LN2));f="#"+m.toFixed(2)+"/"+f.lat.toFixed(q)+"/"+f.lon.toFixed(q);if(k!==f)location.replace(k=f)}function h(){if(location.hash!==k){var f=(k=location.hash).substring(1).split("/").map(Number);if(f.length<3||f.some(isNaN))e();else{var m=
+a.size();a.zoomBy(f[0]-a.zoom(),{x:m.x/2,y:m.y/2},{lat:Math.min(g,Math.max(-g,f[1])),lon:f[2]})}}}var c={},k,g=89.99999999,a;c.map=function(f){if(!arguments.length)return a;if(a){a.off("move",e);window.removeEventListener("hashchange",h,false)}if(a=f){a.on("move",e);window.addEventListener("hashchange",h,false);location.hash?h():e()}return c};return c};s.interact=function(){var e={},h=s.drag(),c=s.wheel(),k=s.dblclick(),g=s.arrow();e.map=function(a){h.map(a);c.map(a);k.map(a);g.map(a);return e};return e};
+s.compass=function(){function e(x){B.setAttribute("class","compass active");I||(I=setInterval(h,r));R&&H.panBy(R);w=Date.now();return l(x)}function h(){R&&Date.now()>w+d&&H.panBy(R)}function c(x){if(x.shiftKey){F={x0:H.mouse(x)};H.focusableParent().focus();return l(x)}}function k(x){if(F){F.x1=H.mouse(x);O.setAttribute("x",Math.min(F.x0.x,F.x1.x));O.setAttribute("y",Math.min(F.x0.y,F.x1.y));O.setAttribute("width",Math.abs(F.x0.x-F.x1.x));O.setAttribute("height",Math.abs(F.x0.y-F.x1.y));O.removeAttribute("display")}}
+function g(){B.setAttribute("class","compass");if(F){if(F.x1){H.extent([H.pointLocation({x:Math.min(F.x0.x,F.x1.x),y:Math.max(F.x0.y,F.x1.y)}),H.pointLocation({x:Math.max(F.x0.x,F.x1.x),y:Math.min(F.x0.y,F.x1.y)})]);O.setAttribute("display","none")}F=null}if(I){clearInterval(I);I=0}}function a(x){return function(){x?this.setAttribute("class","active"):this.removeAttribute("class");R=x}}function f(x){return function(D){B.setAttribute("class","compass active");var G=H.zoom();H.zoom(x<0?Math.ceil(G)-
+1:Math.floor(G)+1);return l(D)}}function m(x){return function(D){H.zoom(x);return l(D)}}function q(){this.setAttribute("class","active")}function t(){this.removeAttribute("class")}function l(x){x.stopPropagation();x.preventDefault();return false}function i(x){var D=Math.SQRT1_2*j,G=j*0.7,J=j*0.2,N=s.svg("g"),P=N.appendChild(s.svg("path")),Q=N.appendChild(s.svg("path"));P.setAttribute("class","direction");P.setAttribute("pointer-events","all");P.setAttribute("d","M0,0L"+D+","+D+"A"+j+","+j+" 0 0,1 "+
+-D+","+D+"Z");Q.setAttribute("class","chevron");Q.setAttribute("d","M"+J+","+(G-J)+"L0,"+G+" "+-J+","+(G-J));Q.setAttribute("pointer-events","none");N.addEventListener("mousedown",e,false);N.addEventListener("mouseover",a(x),false);N.addEventListener("mouseout",a(null),false);N.addEventListener("dblclick",l,false);return N}function u(x){var D=j*0.4,G=D/2,J=s.svg("g"),N=J.appendChild(s.svg("path")),P=J.appendChild(s.svg("path")),Q=J.appendChild(s.svg("path")),X=J.appendChild(s.svg("path"));N.setAttribute("class",
+"back");N.setAttribute("d","M"+-D+",0V"+-D+"A"+D+","+D+" 0 1,1 "+D+","+-D+"V0Z");P.setAttribute("class","direction");P.setAttribute("d",N.getAttribute("d"));Q.setAttribute("class","chevron");Q.setAttribute("d","M"+-G+","+-D+"H"+G+(x>0?"M0,"+(-D-G)+"V"+-G:""));X.setAttribute("class","fore");X.setAttribute("fill","none");X.setAttribute("d",N.getAttribute("d"));J.addEventListener("mousedown",f(x),false);J.addEventListener("mouseover",q,false);J.addEventListener("mouseout",t,false);J.addEventListener("dblclick",
+l,false);return J}function y(x){var D=j*0.2,G=j*0.4,J=s.svg("g"),N=J.appendChild(s.svg("rect")),P=J.appendChild(s.svg("path"));N.setAttribute("pointer-events","all");N.setAttribute("fill","none");N.setAttribute("x",-G);N.setAttribute("y",-0.75*G);N.setAttribute("width",2*G);N.setAttribute("height",1.5*G);P.setAttribute("class","chevron");P.setAttribute("d","M"+-D+",0H"+D);J.addEventListener("mousedown",m(x),false);J.addEventListener("dblclick",l,false);return J}function A(){var x=j+6,D=x,G=H.size();
+switch(o){case "top-left":break;case "top-right":x=G.x-x;break;case "bottom-left":D=G.y-D;break;case "bottom-right":x=G.x-x;D=G.y-D;break}x="translate("+x+","+D+")";M&&M.setAttribute("transform",x);v&&v.setAttribute("transform",x);for(var J in K)J==H.zoom()?K[J].setAttribute("class","active"):K[J].removeAttribute("class")}function C(){for(;B.lastChild;)B.removeChild(B.lastChild);B.appendChild(O);if(L!="none"){M=B.appendChild(s.svg("g"));M.setAttribute("class","pan");var x=M.appendChild(s.svg("circle"));
+x.setAttribute("class","back");x.setAttribute("r",j);M.appendChild(i({x:0,y:-n})).setAttribute("transform","rotate(0)");M.appendChild(i({x:n,y:0})).setAttribute("transform","rotate(90)");M.appendChild(i({x:0,y:n})).setAttribute("transform","rotate(180)");M.appendChild(i({x:-n,y:0})).setAttribute("transform","rotate(270)");x=M.appendChild(s.svg("circle"));x.setAttribute("fill","none");x.setAttribute("class","fore");x.setAttribute("r",j)}else M=null;if(z!="none"){v=B.appendChild(s.svg("g"));v.setAttribute("class",
+"zoom");x=-0.5;if(z=="big"){K={};var D=H.zoomRange()[0];for(x=0;D<=H.zoomRange()[1];D++,x++)(K[D]=v.appendChild(y(D))).setAttribute("transform","translate(0,"+-(x+0.75)*j*0.4+")")}D=L=="none"?0.4:2;v.setAttribute("transform","translate(0,"+j*(/^top-/.test(o)?D+(x+0.5)*0.4:-D)+")");v.appendChild(u(+1)).setAttribute("transform","translate(0,"+-(x+0.5)*j*0.4+")");v.appendChild(u(-1)).setAttribute("transform","scale(-1)")}else v=null;A()}var E={},B=s.svg("g"),K={},j=30,n=16,w=0,d=250,r=50,o="top-left",
+z="small",v,L="small",I,R,M,F,O=s.svg("rect"),H,T,U;B.setAttribute("class","compass");O.setAttribute("class","back fore");O.setAttribute("pointer-events","none");O.setAttribute("display","none");E.radius=function(x){if(!arguments.length)return j;j=x;H&&C();return E};E.speed=function(x){if(!arguments.length)return j;n=x;return E};E.position=function(x){if(!arguments.length)return o;o=x;H&&C();return E};E.pan=function(x){if(!arguments.length)return L;L=x;H&&C();return E};E.zoom=function(x){if(!arguments.length)return z;
+z=x;H&&C();return E};E.map=function(x){if(!arguments.length)return H;if(H){T.removeEventListener("mousedown",c,false);T.removeChild(B);T=null;U.removeEventListener("mousemove",k,false);U.removeEventListener("mouseup",g,false);U=null;H.off("move",A).off("resize",A)}if(H=x){T=H.container();T.appendChild(B);T.addEventListener("mousedown",c,false);U=T.ownerDocument.defaultView;U.addEventListener("mousemove",k,false);U.addEventListener("mouseup",g,false);H.on("move",A).on("resize",A);C()}return E};return E};
+s.grid=function(){function e(){var g=k.firstChild,a=c.size(),f=c.pointLocation(Y);c.pointLocation(a);var m=Math.pow(2,4-Math.round(c.zoom()));f.lat=Math.floor(f.lat/m)*m;f.lon=Math.ceil(f.lon/m)*m;for(var q;(q=c.locationPoint(f).x)<=a.x;f.lon+=m){g||(g=k.appendChild(s.svg("line")));g.setAttribute("x1",q);g.setAttribute("x2",q);g.setAttribute("y1",0);g.setAttribute("y2",a.y);g=g.nextSibling}for(;(q=c.locationPoint(f).y)<=a.y;f.lat-=m){g||(g=k.appendChild(s.svg("line")));g.setAttribute("y1",q);g.setAttribute("y2",
+q);g.setAttribute("x1",0);g.setAttribute("x2",a.x);g=g.nextSibling}for(;g;){a=g.nextSibling;k.removeChild(g);g=a}}var h={},c,k=s.svg("g");k.setAttribute("class","grid");h.map=function(g){if(!arguments.length)return c;if(c){k.parentNode.removeChild(k);c.off("move",e).off("resize",e)}if(c=g){c.on("move",e).on("resize",e);c.container().appendChild(k);c.dispatch({type:"move"})}return h};return h};s.stylist=function(){function e(g){var a=g.features.length,f=h.length,m=c.length,q,t,l,i,u,y;for(u=0;u<a;++u)if(t=
+(q=g.features[u]).element){q=q.data;for(y=0;y<f;++y){i=(l=h[y]).value;if(typeof i==="function")i=i.call(null,q);i==null?l.name.local?t.removeAttributeNS(l.name.space,l.name.local):t.removeAttribute(l.name):l.name.local?t.setAttributeNS(l.name.space,l.name.local,i):t.setAttribute(l.name,i)}for(y=0;y<m;++y){i=(l=c[y]).value;if(typeof i==="function")i=i.call(null,q);i==null?t.style.removeProperty(l.name):t.style.setProperty(l.name,i,l.priority)}if(i=k){if(typeof i==="function")i=i.call(null,q);for(;t.lastChild;)t.removeChild(t.lastChild);
+i!=null&&t.appendChild(s.svg("title")).appendChild(document.createTextNode(i))}}}var h=[],c=[],k;e.attr=function(g,a){h.push({name:fa(g),value:a});return e};e.style=function(g,a,f){c.push({name:g,value:a,priority:arguments.length<3?null:f});return e};e.title=function(g){k=g;return e};return e}})(org.polymaps);
View
18 src/Url.js
@@ -1,10 +1,16 @@
po.url = function(template) {
- var hosts = [];
+ var hosts = [],
+ repeat = true;
function format(c) {
var max = c.zoom < 0 ? 1 : 1 << c.zoom,
- column = c.column % max;
- if (column < 0) column += max;
+ column = c.column;
+ if (repeat) {
+ column = c.column % max;
+ if (column < 0) column += max;
+ } else if ((column < 0) || (column >= max)) {
+ return "about:blank";
+ }
return template.replace(/{(.)}/g, function(s, v) {
switch (v) {
case "S": return hosts[(Math.abs(c.zoom) + c.row + column) % hosts.length];
@@ -37,5 +43,11 @@ po.url = function(template) {
return format;
};
+ format.repeat = function(x) {
+ if (!arguments.length) return repeat;
+ repeat = x;
+ return format;
+ };
+
return format;
};
View
2  src/start.js
@@ -2,6 +2,6 @@ if (!org) var org = {};
if (!org.polymaps) org.polymaps = {};
(function(po){
- po.version = "2.3.0"; // semver.org
+ po.version = "2.3+1.0"; // not semver!
var zero = {x: 0, y: 0};
Please sign in to comment.
Something went wrong with that request. Please try again.