<commit_before>(function(ca){function S(b,a){var c=b.x-a.x,d=b.y-a.y;return c*c+d*d}function va(b){var a=b.length;if(16>a)return!1;var c,d=Infinity,f=-Infinity,e=Infinity,g=-Infinity;for(c=0;c<a-1;c+=2)d=Math.min(d,b[c]),f=Math.max(f,b[c]),e=Math.min(e,b[c+1]),g=Math.max(g,b[c+1]);c=f-d;g-=e;f=c/g;if(0.85>f||1.15<f)return!1;d={x:d+c/2,y:e+g/2};c=(c+g)/4;e=c*c;for(c=0;c<a-1;c+=2)if(g=S({x:b[c],y:b[c+1]},d),0.8>g/e||1.2<g/e)return!1;return!0}function ja(b,a){var c={};b/=T;a/=T;var d=wa,f;f=0>=a?90:1<=a?-90:(2*xa(ya(E*
(1-2*a)))-J)/E*180;c[d]=f;c[za]=360*(1===b?1:(b%1+1)%1)-180;return c}function da(b,a){var c=U(1,K(0,0.5-Aa(ka(Ba+J*b/180))/E/2));return{x:(a/360+0.5)*T<<0,y:c*T<<0}}function V(b){for(var a=B+p,c=v+n,d=0,f=b.length-3;d<f;d+=2)if(b[d]>p&&b[d]<a&&b[d+1]>n&&b[d+1]<c)return!0;return!1}function Ca(){$||($=setInterval(function(){for(var b=F.items,a=!1,c=0,d=b.length;c<d;c++)1>b[c].scale&&(b[c].scale+=0.1,1<b[c].scale&&(b[c].scale=1),a=!0);A.render();a||(clearInterval($),$=null)},33))}function ea(b){M=W+
b.x;N=v+b.y;A.render(!0)}function la(b){B=b.width;v=b.height;W=B/2<<0;fa=v/2<<0;M=W;N=v;A.setSize(B,v);ga=q-50}function ma(b){x=b;T=Da<<x;b=ja(p+W,n+fa);var a=da(b.latitude,0);na=da(b.latitude,1).x-a.x;C=oa(0.95,x-G);ha=""+H.alpha(C);aa=""+ba.alpha(C);X=""+O.alpha(C)}var u=Math,ya=u.exp,Aa=u.log,Ea=u.sin,Fa=u.cos,ka=u.tan,xa=u.atan,P=u.atan2,U=u.min,K=u.max,pa=u.sqrt,qa=u.ceil,oa=u.pow,ra=ra||Array,sa=sa||Array,u=/iP(ad|hone|od)/g.test(navigator.userAgent),t=!!~navigator.userAgent.indexOf("Trident"),
Ga=!ca.requestAnimationFrame||u||t?function(b){b()}:ca.requestAnimationFrame,I=function(b){function a(a,b,c){0>c&&(c+=1);1<c&&(c-=1);return c<1/6?a+6*(b-a)*c:0.5>c?b:c<2/3?a+(b-a)*(2/3-c)*6:a}var c={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",grey:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",orange:"#ffa500",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"},d=function(a,b,
c,d){this.H=a;this.S=b;this.L=c;this.A=d};d.parse=function(a){var b=0,d=0,h=0,k=1,m;a=(""+a).toLowerCase();a=c[a]||a;if(m=a.match(/^#(\w{2})(\w{2})(\w{2})$/))b=parseInt(m[1],16),d=parseInt(m[2],16),h=parseInt(m[3],16);else if(m=a.match(/rgba?\((\d+)\D+(\d+)\D+(\d+)(\D+([\d.]+))?\)/))b=parseInt(m[1],10),d=parseInt(m[2],10),h=parseInt(m[3],10),k=m[4]?parseFloat(m[5]):1;else return;return this.fromRGBA(b,d,h,k)};d.fromRGBA=function(a,b,c,h){"object"===typeof a?(b=a.g/255,c=a.b/255,h=a.a,a=a.r/255):(a/=
255,b/=255,c/=255);var k=Math.max(a,b,c),m=Math.min(a,b,c),l,y=(k+m)/2,s=k-m;if(s){m=0.5<y?s/(2-k-m):s/(k+m);switch(k){case a:l=(b-c)/s+(b<c?6:0);break;case b:l=(c-a)/s+2;break;case c:l=(a-b)/s+4}l*=60}else l=m=0;return new d(l,m,y,h)};d.prototype={toRGBA:function(){var b=Math.min(360,Math.max(0,this.H)),c=Math.min(1,Math.max(0,this.S)),d=Math.min(1,Math.max(0,this.L)),h=Math.min(1,Math.max(0,this.A)),k;if(0===c)b=k=c=d;else{var m=0.5>d?d*(1+c):d+c-d*c,d=2*d-m,b=b/360,c=a(d,m,b+1/3);k=a(d,m,b);b=
a(d,m,b-1/3)}return{r:Math.round(255*c),g:Math.round(255*k),b:Math.round(255*b),a:h}},toString:function(){var a=this.toRGBA();return 1===a.a?"#"+(16777216+(a.r<<16)+(a.g<<8)+a.b).toString(16).slice(1,7):"rgba("+[a.r,a.g,a.b,a.a.toFixed(2)].join()+")"},hue:function(a){return new d(this.H*a,this.S,this.L,this.A)},saturation:function(a){return new d(this.H,this.S*a,this.L,this.A)},lightness:function(a){return new d(this.H,this.S,this.L*a,this.A)},alpha:function(a){return new d(this.H,this.S,this.L,this.A*
a)}};return d}(this),Ha=function(){var b=Math,a=b.PI,c=b.sin,d=b.cos,f=b.tan,e=b.asin,g=b.atan2,h=a/180,k=23.4397*h;return function(b,l,y){y=h*-y;l*=h;b=b.valueOf()/864E5-0.5+2440588-2451545;var s=h*(357.5291+0.98560028*b),D;D=h*(1.9148*c(s)+0.02*c(2*s)+3E-4*c(3*s));D=s+D+102.9372*h+a;s=e(c(0)*d(k)+d(0)*c(k)*c(D));D=g(c(D)*d(k)-f(0)*c(k),d(D));b=h*(280.16+360.9856235*b)-y-D;y=e(c(l)*c(s)+d(l)*d(s)*d(b));l=g(c(b),d(b)*c(l)-f(s)*d(l));return{altitude:y,azimuth:l-a/2}}}(),Ja=function(){function b(a){a=
a.toLowerCase();return"#"===a[0]?a:d[f[a]||a]||null}function a(a,b){var c,d,f,s,D=0,p,n;p=0;for(n=a.length-3;p<n;p+=2)c=a[p],d=a[p+1],f=a[p+2],s=a[p+3],D+=c*s-f*d;if((0<D/2?e:g)===b)return a;c=[];for(d=a.length-2;0<=d;d-=2)c.push(a[d],a[d+1]);return c}function c(b){var d,f,l=[],y;switch(b.type){case "GeometryCollection":l=[];d=0;for(f=b.geometries.length;d<f;d++)(y=c(b.geometries[d]))&&l.push.apply(l,y);return l;case "MultiPolygon":l=[];d=0;for(f=b.coordinates.length;d<f;d++)(y=c({type:"Polygon",
coordinates:b.coordinates[d]}))&&l.push.apply(l,y);return l;case "Polygon":b=b.coordinates;break;default:return[]}var s,p=[],n=[];s=b[0];d=0;for(f=s.length;d<f;d++)p.push(s[d][1],s[d][0]);p=a(p,e);d=0;for(f=b.length-1;d<f;d++){s=b[d+1];n[d]=[];l=0;for(y=s.length;l<y;l++)n[d].push(s[l][1],s[l][0]);n[d]=a(n[d],g)}return[{outer:p,inner:n.length?n:null}]}var d={brick:"#cc7755",bronze:"#ffeecc",canvas:"#fff8f0",concrete:"#999999",copper:"#a0e0d0",glass:"#e8f8f8",gold:"#ffcc00",plants:"#009933",metal:"#aaaaaa",
panel:"#fff8f0",plaster:"#999999",roof_tiles:"#f08060",silver:"#cccccc",slate:"#666666",stone:"#996666",tar_paper:"#333333",wood:"#deb887"},f={asphalt:"tar_paper",bitumen:"tar_paper",block:"stone",bricks:"brick",glas:"glass",glassfront:"glass",grass:"plants",masonry:"stone",granite:"stone",panels:"panel",paving_stones:"stone",plastered:"plaster",rooftiles:"roof_tiles",roofingfelt:"tar_paper",sandstone:"stone",sheet:"canvas",sheets:"canvas",shingle:"tar_paper",shingles:"tar_paper",slates:"slate",steel:"metal",
tar:"tar_paper",tent:"canvas",thatch:"plants",tile:"roof_tiles",tiles:"roof_tiles"},e="CW",g="CCW";return{read:function(a){if(!a||"FeatureCollection"!==a.type)return[];a=a.features;var d,f,e,g,p=[],n,q,t,r;d=0;for(f=a.length;d<f;d++)if(n=a[d],"Feature"===n.type&&!1!==ta(n)){e=n.properties;g={};e=e||{};g.height=e.height||(e.levels?3*e.levels:Ia);g.minHeight=e.minHeight||(e.minLevel?3*e.minLevel:0);if(q=e.material?b(e.material):e.wallColor||e.color)g.wallColor=q;if(q=e.roofMaterial?b(e.roofMaterial):
e.roofColor)g.roofColor=q;switch(e.shape){case "cylinder":case "cone":case "dome":case "sphere":g.shape=e.shape;g.isRotational=!0;break;case "pyramid":g.shape=e.shape}switch(e.roofShape){case "cone":case "dome":g.roofShape=e.roofShape;g.isRotational=!0;break;case "pyramid":g.roofShape=e.roofShape}g.roofShape&&e.roofHeight?(g.roofHeight=e.roofHeight,g.height=K(0,g.height-g.roofHeight)):g.roofHeight=0;t=g;q=c(n.geometry);e=0;for(g=q.length;e<g;e++){r=t;var w={},u=void 0;for(u in r)r.hasOwnProperty(u)&&
(w[u]=r[u]);r=w;r.footprint=q[e].outer;if(r.isRotational){for(var w=r,u=r.footprint,x=180,z=-180,v=0,A=u.length;v<A;v+=2)x=U(x,u[v+1]),z=K(z,u[v+1]);w.radius=(z-x)/2}q[e].inner&&(r.holes=q[e].inner);if(n.id||n.properties.id)r.id=n.id||n.properties.id;n.properties.relationId&&(r.relationId=n.properties.relationId);p.push(r)}}return p}}}(),E=Math.PI,J=E/2,Ba=E/4,Da=256,x,T,G=15,wa="latitude",za="longitude",B=0,v=0,W=0,fa=0,p=0,n=0,H=I.parse("rgba(200, 190, 180)"),ba=H.lightness(0.8),O=H.lightness(1.2),
ha=""+H,aa=""+ba,X=""+O,na=0,C=1,ga,Ia=5,M,N,q=450,Q,Ka=function(){function b(b,g){if(a[b])g&&g(a[b]);else{var h=new XMLHttpRequest;h.onreadystatechange=function(){if(4===h.readyState&&h.status&&!(200>h.status||299<h.status)&&g&&h.responseText){var k=h.responseText;a[b]=k;c.push({url:b,size:k.length});d+=k.length;for(g(k);d>f;)k=c.shift(),d-=k.size,delete a[k.url]}};h.open("GET",b);h.send(null);return h}}var a={},c=[],d=0,f=5242880;return{loadJSON:function(a,c){return b(a,function(a){var b;try{b=
JSON.parse(a)}catch(d){}c(b)})}}}(),F={loadedItems:{},items:[],getPixelFootprint:function(b){for(var a=new ra(b.length),c,d=0,f=b.length-1;d<f;d+=2)c=da(b[d],b[d+1]),a[d]=c.x,a[d+1]=c.y;b=a;a=b.length/2;c=new sa(a);var d=0,f=a-1,e,g,h,k,m=[],l=[],n=[];for(c[d]=c[f]=1;f;){g=0;for(e=d+1;e<f;e++){h=b[2*e];var p=b[2*e+1],q=b[2*d],r=b[2*d+1],u=b[2*f],w=b[2*f+1],t=u-q,v=w-r,x=void 0;if(0!==t||0!==v)x=((h-q)*t+(p-r)*v)/(t*t+v*v),1<x?(q=u,r=w):0<x&&(q+=t*x,r+=v*x);t=h-q;v=p-r;h=t*t+v*v;h>g&&(k=e,g=h)}2<g&&
(c[k]=1,m.push(d),l.push(k),m.push(k),l.push(f));d=m.pop();f=l.pop()}for(e=0;e<a;e++)c[e]&&n.push(b[2*e],b[2*e+1]);a=n;if(!(8>a.length))return a},resetItems:function(){this.items=[];this.loadedItems={};Y.reset()},addRenderItems:function(b,a){for(var c,d,f,e=Ja.read(b),g=0,h=e.length;g<h;g++)c=e[g],f=c.id||[c.footprint[0],c.footprint[1],c.height,c.minHeight].join(),!this.loadedItems[f]&&(d=this.scale(c))&&(d.scale=a?0:1,this.items.push(d),this.loadedItems[f]=1);Ca()},scale:function(b){var a={},c=6/
oa(2,x-G);b.id&&(a.id=b.id);a.height=U(b.height/c,ga);a.minHeight=isNaN(b.minHeight)?0:b.minHeight/c;if(!(a.minHeight>ga)&&(a.footprint=this.getPixelFootprint(b.footprint),a.footprint)){for(var d=a.footprint,f=Infinity,e=-Infinity,g=Infinity,h=-Infinity,k=0,m=d.length-3;k<m;k+=2)f=U(f,d[k]),e=K(e,d[k]),g=U(g,d[k+1]),h=K(h,d[k+1]);a.center={x:f+(e-f)/2<<0,y:g+(h-g)/2<<0};b.radius&&(a.radius=b.radius*na);b.shape&&(a.shape=b.shape);b.roofShape&&(a.roofShape=b.roofShape);"cone"!==a.roofShape&&"dome"!==
a.roofShape||a.shape||!va(a.footprint)||(a.shape="cylinder");if(b.holes){a.holes=[];for(var l,d=0,f=b.holes.length;d<f;d++)(l=this.getPixelFootprint(b.holes[d]))&&a.holes.push(l)}var n;b.wallColor&&(n=I.parse(b.wallColor))&&(n=n.alpha(C),a.altColor=""+n.lightness(0.8),a.wallColor=""+n);b.roofColor&&(n=I.parse(b.roofColor))&&(a.roofColor=""+n.alpha(C));b.relationId&&(a.relationId=b.relationId);a.hitColor=Y.idToColor(b.relationId||b.id);a.roofHeight=isNaN(b.roofHeight)?0:b.roofHeight/c;if(!(a.height+
a.roofHeight<=a.minHeight))return a}},set:function(b){this.isStatic=!0;this.resetItems();this._staticData=b;this.addRenderItems(this._staticData,!0)},load:function(b,a){this.src=b||"http://{s}.data.osmbuildings.org/0.2/{k}/tile/{z}/{x}/{y}.json".replace("{k}",a||"anonymous");this.update()},update:function(){function b(a){g.addRenderItems(a)}this.resetItems();if(!(x<G))if(this.isStatic&&this._staticData)this.addRenderItems(this._staticData);else if(this.src){var a=16<x?256<<x-16:256>>16-x,c=p/a<<0,
d=n/a<<0,f=qa((p+B)/a),a=qa((n+v)/a),e,g=this;for(e=d;e<=a;e++)for(d=c;d<=f;d++)this.loadTile(d,e,16,b)}},loadTile:function(b,a,c,d){b=this.src.replace("{s}","abcd"[(b+a)%4]).replace("{x}",b).replace("{y}",a).replace("{z}",c);return Ka.loadJSON(b,d)}},Z={draw:function(b,a,c,d,f,e,g,h){var k,m=this._extrude(b,a,d,f,e,g),l=[];if(c)for(a=0,k=c.length;a<k;a++)l[a]=this._extrude(b,c[a],d,f,e,g);b.fillStyle=h;b.beginPath();this._ring(b,m);if(c)for(a=0,k=l.length;a<k;a++)this._ring(b,l[a]);b.closePath();
b.stroke();b.fill()},_extrude:function(b,a,c,d,f,e){c=q/(q-c);for(var g=q/(q-d),h={x:0,y:0},k={x:0,y:0},m,l,y=[],s=0,t=a.length-3;s<t;s+=2)h.x=a[s]-p,h.y=a[s+1]-n,k.x=a[s+2]-p,k.y=a[s+3]-n,m=r.project(h,c),l=r.project(k,c),d&&(h=r.project(h,g),k=r.project(k,g)),(k.x-h.x)*(m.y-h.y)>(m.x-h.x)*(k.y-h.y)&&(b.fillStyle=h.x<k.x&&h.y<k.y||h.x>k.x&&h.y>k.y?e:f,b.beginPath(),this._ring(b,[k.x,k.y,h.x,h.y,m.x,m.y,l.x,l.y]),b.closePath(),b.fill()),y[s]=m.x,y[s+1]=m.y;return y},_ring:function(b,a){b.moveTo(a[0],
a[1]);for(var c=2,d=a.length-1;c<d;c+=2)b.lineTo(a[c],a[c+1])},simplified:function(b,a,c){b.beginPath();this._ringAbs(b,a);if(c){a=0;for(var d=c.length;a<d;a++)this._ringAbs(b,c[a])}b.closePath();b.stroke();b.fill()},_ringAbs:function(b,a){b.moveTo(a[0]-p,a[1]-n);for(var c=2,d=a.length-1;c<d;c+=2)b.lineTo(a[c]-p,a[c+1]-n)},shadow:function(b,a,c,d,f){for(var e=null,g={x:0,y:0},h={x:0,y:0},k,m,l=0,q=a.length-3;l<q;l+=2)g.x=a[l]-p,g.y=a[l+1]-n,h.x=a[l+2]-p,h.y=a[l+3]-n,k=z.project(g,d),m=z.project(h,
d),f&&(g=z.project(g,f),h=z.project(h,f)),(h.x-g.x)*(k.y-g.y)>(k.x-g.x)*(h.y-g.y)?(1===e&&b.lineTo(g.x,g.y),e=0,l||b.moveTo(g.x,g.y),b.lineTo(h.x,h.y)):(0===e&&b.lineTo(k.x,k.y),e=1,l||b.moveTo(k.x,k.y),b.lineTo(m.x,m.y));if(c)for(l=0,q=c.length;l<q;l++)this._ringAbs(b,c[l])},shadowMask:function(b,a,c){this._ringAbs(b,a);if(c){a=0;for(var d=c.length;a<d;a++)this._ringAbs(b,c[a])}},hitArea:function(b,a,c,d,f,e){c=null;var g={x:0,y:0},h={x:0,y:0};d=q/(q-d);var k=q/(q-f),m;b.fillStyle=e;b.beginPath();
for(var l=0,t=a.length-3;l<t;l+=2)g.x=a[l]-p,g.y=a[l+1]-n,h.x=a[l+2]-p,h.y=a[l+3]-n,e=r.project(g,d),m=r.project(h,d),f&&(g=r.project(g,k),h=r.project(h,k)),(h.x-g.x)*(e.y-g.y)>(e.x-g.x)*(h.y-g.y)?(1===c&&b.lineTo(g.x,g.y),c=0,l||b.moveTo(g.x,g.y),b.lineTo(h.x,h.y)):(0===c&&b.lineTo(e.x,e.y),c=1,l||b.moveTo(e.x,e.y),b.lineTo(m.x,m.y));b.closePath();b.fill()}},w={draw:function(b,a,c,d,f,e,g,h,k){a={x:a.x-p,y:a.y-n};var m=q/(q-f),l=q/(q-e);f=r.project(a,m);d*=m;e&&(a=r.project(a,l),c*=l);(m=this._tangents(a,
c,f,d))?(e=P(m[0].y1-a.y,m[0].x1-a.x),m=P(m[1].y1-a.y,m[1].x1-a.x)):(e=1.5*E,m=1.5*E);b.fillStyle=g;b.beginPath();b.arc(f.x,f.y,d,J,e,!0);b.arc(a.x,a.y,c,e,J);b.closePath();b.fill();b.fillStyle=h;b.beginPath();b.arc(f.x,f.y,d,m,J,!0);b.arc(a.x,a.y,c,J,m);b.closePath();b.fill();b.fillStyle=k;this._circle(b,f,d)},simplified:function(b,a,c){this._circle(b,{x:a.x-p,y:a.y-n},c)},shadow:function(b,a,c,d,f,e){a={x:a.x-p,y:a.y-n};f=z.project(a,f);var g;e&&(a=z.project(a,e));var h=this._tangents(a,c,f,d);
h?(e=P(h[0].y1-a.y,h[0].x1-a.x),g=P(h[1].y1-a.y,h[1].x1-a.x),b.moveTo(h[1].x2,h[1].y2),b.arc(f.x,f.y,d,g,e),b.arc(a.x,a.y,c,e,g)):(b.moveTo(a.x+c,a.y),b.arc(a.x,a.y,c,0,2*E))},shadowMask:function(b,a,c){var d=a.x-p;a=a.y-n;b.moveTo(d+c,a);b.arc(d,a,c,0,2*E)},hitArea:function(b,a,c,d,f,e,g){a={x:a.x-p,y:a.y-n};var h=q/(q-f),k=q/(q-e);f=r.project(a,h);d*=h;e&&(a=r.project(a,k),c*=k);e=this._tangents(a,c,f,d);b.fillStyle=g;b.beginPath();e?(g=P(e[0].y1-a.y,e[0].x1-a.x),h=P(e[1].y1-a.y,e[1].x1-a.x),b.moveTo(e[1].x2,
e[1].y2),b.arc(f.x,f.y,d,h,g),b.arc(a.x,a.y,c,g,h)):(b.moveTo(a.x+c,a.y),b.arc(a.x,a.y,c,0,2*E));b.closePath();b.fill()},_circle:function(b,a,c){b.beginPath();b.arc(a.x,a.y,c,0,2*E);b.stroke();b.fill()},_tangents:function(b,a,c,d){var f=b.x-c.x,e=b.y-c.y,g=a-d,h=f*f+e*e;if(!(h<=g*g)){var h=pa(h),f=-f/h,e=-e/h,g=g/h,h=[],k,m,l;k=pa(K(0,1-g*g));for(var n=1;-1<=n;n-=2)m=f*g-n*k*e,l=e*g+n*k*f,h.push({x1:b.x+a*m<<0,y1:b.y+a*l<<0,x2:c.x+d*m<<0,y2:c.y+d*l<<0});return h}}},R={draw:function(b,a,c,d,f,e,g){var h=
q/(q-f);c=r.project({x:c.x-p,y:c.y-n},q/(q-d));d={x:0,y:0};for(var k={x:0,y:0},m=0,l=a.length-3;m<l;m+=2)d.x=a[m]-p,d.y=a[m+1]-n,k.x=a[m+2]-p,k.y=a[m+3]-n,f&&(d=r.project(d,h),k=r.project(k,h)),(k.x-d.x)*(c.y-d.y)>(c.x-d.x)*(k.y-d.y)&&(b.fillStyle=d.x<k.x&&d.y<k.y||d.x>k.x&&d.y>k.y?g:e,b.beginPath(),this._triangle(b,d,k,c),b.closePath(),b.fill())},_triangle:function(b,a,c,d){b.moveTo(a.x,a.y);b.lineTo(c.x,c.y);b.lineTo(d.x,d.y)},_ring:function(b,a){b.moveTo(a[0]-p,a[1]-n);for(var c=2,d=a.length-1;c<
d;c+=2)b.lineTo(a[c]-p,a[c+1]-n)},shadow:function(b,a,c,d,f){var e={x:0,y:0},g={x:0,y:0};c=z.project({x:c.x-p,y:c.y-n},d);d=0;for(var h=a.length-3;d<h;d+=2)e.x=a[d]-p,e.y=a[d+1]-n,g.x=a[d+2]-p,g.y=a[d+3]-n,f&&(e=z.project(e,f),g=z.project(g,f)),(g.x-e.x)*(c.y-e.y)>(c.x-e.x)*(g.y-e.y)&&this._triangle(b,e,g,c)},shadowMask:function(b,a){this._ring(b,a)},hitArea:function(b,a,c,d,f,e){var g=q/(q-f);c=r.project({x:c.x-p,y:c.y-n},q/(q-d));d={x:0,y:0};var h={x:0,y:0};b.fillStyle=e;b.beginPath();e=0;for(var k=
a.length-3;e<k;e+=2)d.x=a[e]-p,d.y=a[e+1]-n,h.x=a[e+2]-p,h.y=a[e+3]-n,f&&(d=r.project(d,g),h=r.project(h,g)),(h.x-d.x)*(c.y-d.y)>(c.x-d.x)*(h.y-d.y)&&this._triangle(b,d,h,c);b.closePath();b.fill()}},r={project:function(b,a){return{x:(b.x-M)*a+M<<0,y:(b.y-N)*a+N<<0}},render:function(){var b=this.context;b.clearRect(0,0,B,v);if(!(x<G||Q)){var a,c,d,f={x:M+p,y:N+n},e,g,h,k,m=F.items;m.sort(function(a,b){return a.minHeight-b.minHeight||S(b.center,f)-S(a.center,f)||b.height-a.height});for(var l=0,q=m.length;l<
q;l++)if(a=m[l],!ia.isSimple(a)&&(e=a.footprint,V(e))){c=1>a.scale?a.height*a.scale:a.height;d=0;a.minHeight&&(d=1>a.scale?a.minHeight*a.scale:a.minHeight);g=a.wallColor||ha;h=a.altColor||aa;k=a.roofColor||X;b.strokeStyle=h;switch(a.shape){case "cylinder":w.draw(b,a.center,a.radius,a.radius,c,d,g,h,k);break;case "cone":w.draw(b,a.center,a.radius,0,c,d,g,h);break;case "dome":w.draw(b,a.center,a.radius,a.radius/2,c,d,g,h);break;case "sphere":w.draw(b,a.center,a.radius,a.radius,c,d,g,h,k);break;case "pyramid":R.draw(b,
e,a.center,c,d,g,h);break;default:Z.draw(b,e,a.holes,c,d,g,h,k)}switch(a.roofShape){case "cone":w.draw(b,a.center,a.radius,0,c+a.roofHeight,c,k,""+I.parse(k).lightness(0.9));break;case "dome":w.draw(b,a.center,a.radius,a.radius/2,c+a.roofHeight,c,k,""+I.parse(k).lightness(0.9));break;case "pyramid":R.draw(b,e,a.center,c+a.roofHeight,c,k,I.parse(k).lightness(0.9))}}}}},ia={maxZoom:G+2,maxHeight:5,isSimple:function(b){return x<=this.maxZoom&&b.height+b.roofHeight<this.maxHeight},render:function(){var b=
this.context;b.clearRect(0,0,B,v);if(!(x<G||Q||x>this.maxZoom))for(var a,c,d=F.items,f=0,e=d.length;f<e;f++)if(a=d[f],!(a.height>=this.maxHeight)&&(c=a.footprint,V(c)))switch(b.strokeStyle=a.altColor||aa,b.fillStyle=a.roofColor||X,a.shape){case "cylinder":case "cone":case "dome":case "sphere":w.simplified(b,a.center,a.radius);break;default:Z.simplified(b,c,a.holes)}}},z={enabled:!0,color:"#666666",blurColor:"#000000",blurSize:15,date:new Date,direction:{x:0,y:0},project:function(b,a){return{x:b.x+
this.direction.x*a,y:b.y+this.direction.y*a}},render:function(){var b=this.context,a,c,d;b.clearRect(0,0,B,v);if(!(!this.enabled||x<G||Q||(a=ja(W+p,fa+n),a=Ha(this.date,a.latitude,a.longitude),0>=a.altitude))){c=1/ka(a.altitude);d=5>c?0.75:1/c*5;this.direction.x=Fa(a.azimuth)*c;this.direction.y=Ea(a.azimuth)*c;var f,e,g,h;a=F.items;b.canvas.style.opacity=d/(2*C);b.shadowColor=this.blurColor;b.shadowBlur=C/2*this.blurSize;b.fillStyle=this.color;b.beginPath();d=0;for(c=a.length;d<c;d++)if(f=a[d],h=
f.footprint,V(h)){e=1>f.scale?f.height*f.scale:f.height;g=0;f.minHeight&&(g=1>f.scale?f.minHeight*f.scale:f.minHeight);switch(f.shape){case "cylinder":w.shadow(b,f.center,f.radius,f.radius,e,g);break;case "cone":w.shadow(b,f.center,f.radius,0,e,g);break;case "dome":w.shadow(b,f.center,f.radius,f.radius/2,e,g);break;case "sphere":w.shadow(b,f.center,f.radius,f.radius,e,g);break;case "pyramid":R.shadow(b,h,f.center,e,g);break;default:Z.shadow(b,h,f.holes,e,g)}switch(f.roofShape){case "cone":w.shadow(b,
f.center,f.radius,0,e+f.roofHeight,e);break;case "dome":w.shadow(b,f.center,f.radius,f.radius/2,e+f.roofHeight,e);break;case "pyramid":R.shadow(b,h,f.center,e+f.roofHeight,e)}}b.closePath();b.fill();b.shadowBlur=null;b.globalCompositeOperation="destination-out";b.beginPath();d=0;for(c=a.length;d<c;d++)if(f=a[d],h=f.footprint,V(h)&&!f.minHeight)switch(f.shape){case "cylinder":case "cone":case "dome":w.shadowMask(b,f.center,f.radius);break;default:Z.shadowMask(b,h,f.holes)}b.fillStyle="#00ff00";b.fill();
b.globalCompositeOperation="source-over"}}},Y={_idMapping:[null],reset:function(){this._idMapping=[null]},render:function(){if(!this._timer){var b=this;this._timer=setTimeout(function(){b._timer=null;b._render()},500)}},_render:function(){var b=this.context;b.clearRect(0,0,B,v);if(!(x<G||Q)){var a,c,d,f={x:M+p,y:N+n},e,g,h=F.items;h.sort(function(a,b){return a.minHeight-b.minHeight||S(b.center,f)-S(a.center,f)||b.height-a.height});for(var k=0,m=h.length;k<m;k++)if(a=h[k],g=a.hitColor)if(e=a.footprint,
V(e)){c=a.height;d=0;a.minHeight&&(d=a.minHeight);switch(a.shape){case "cylinder":w.hitArea(b,a.center,a.radius,a.radius,c,d,g);break;case "cone":w.hitArea(b,a.center,a.radius,0,c,d,g);break;case "dome":w.hitArea(b,a.center,a.radius,a.radius/2,c,d,g);break;case "sphere":w.hitArea(b,a.center,a.radius,a.radius,c,d,g);break;case "pyramid":R.hitArea(b,e,a.center,c,d,g);break;default:Z.hitArea(b,e,a.holes,c,d,g)}switch(a.roofShape){case "cone":w.hitArea(b,a.center,a.radius,0,c+a.roofHeight,c,g);break;
case "dome":w.hitArea(b,a.center,a.radius,a.radius/2,c+a.roofHeight,c,g);break;case "pyramid":R.hitArea(b,e,a.center,c+a.roofHeight,c,g)}}B&&v&&(this._imageData=this.context.getImageData(0,0,B,v).data)}},getIdFromXY:function(b,a){var c=this._imageData;if(c){var d=4*((a|0)*B+(b|0));return this._idMapping[c[d]|c[d+1]<<8|c[d+2]<<16]}},idToColor:function(b){var a=this._idMapping.indexOf(b);-1===a&&(this._idMapping.push(b),a=this._idMapping.length-1);return"rgb("+[a&255,a>>8&255,a>>16&255].join()+")"}},
$,A={container:document.createElement("DIV"),items:[],init:function(){this.container.style.pointerEvents="none";this.container.style.position="absolute";this.container.style.left=0;this.container.style.top=0;z.context=this.createContext(this.container);ia.context=this.createContext(this.container);r.context=this.createContext(this.container);Y.context=this.createContext()},render:function(b){Ga(function(){b||(z.render(),ia.render(),Y.render());r.render()})},createContext:function(b){var a=document.createElement("CANVAS");
a.style.transform="translate3d(0, 0, 0)";a.style.imageRendering="optimizeSpeed";a.style.position="absolute";a.style.left=0;a.style.top=0;var c=a.getContext("2d");c.lineCap="round";c.lineJoin="round";c.lineWidth=1;c.imageSmoothingEnabled=!1;this.items.push(a);b&&b.appendChild(a);return c},appendTo:function(b){b.appendChild(this.container)},remove:function(){this.container.parentNode.removeChild(this.container)},setSize:function(b,a){for(var c=0,d=this.items.length;c<d;c++)this.items[c].width=b,this.items[c].height=
a},setPosition:function(b,a){this.container.style.left=b+"px";this.container.style.top=a+"px"}};A.init();u=function(b){this.offset={x:0,y:0};b&&b.addLayer(this)};t=u.prototype=L.Layer?new L.Layer:{};t.addTo=function(b){b.addLayer(this);return this};t.onAdd=function(b){this.map=b;A.appendTo(b._panes.overlayPane);var a=this.getOffset(),c=b.getPixelOrigin();la({width:b._size.x,height:b._size.y});var d=c.y-a.y;p=c.x-a.x;n=d;ma(b._zoom);A.setPosition(-a.x,-a.y);b.on({move:this.onMove,moveend:this.onMoveEnd,
zoomstart:this.onZoomStart,zoomend:this.onZoomEnd,resize:this.onResize,viewreset:this.onViewReset,click:this.onClick},this);if(b.options.zoomAnimation)b.on("zoomanim",this.onZoom,this);b.attributionControl&&b.attributionControl.addAttribution('&copy; <a href="http://osmbuildings.org">OSM Buildings</a>');F.update()};t.onRemove=function(){var b=this.map;b.attributionControl&&b.attributionControl.removeAttribution('&copy; <a href="http://osmbuildings.org">OSM Buildings</a>');b.off({move:this.onMove,
moveend:this.onMoveEnd,zoomstart:this.onZoomStart,zoomend:this.onZoomEnd,resize:this.onResize,viewreset:this.onViewReset,click:this.onClick},this);b.options.zoomAnimation&&b.off("zoomanim",this.onZoom,this);A.remove()};t.onMove=function(b){b=this.getOffset();ea({x:this.offset.x-b.x,y:this.offset.y-b.y})};t.onMoveEnd=function(b){if(this.noMoveEnd)this.noMoveEnd=!1;else{var a=this.map;b=this.getOffset();var c=a.getPixelOrigin();this.offset=b;A.setPosition(-b.x,-b.y);ea({x:0,y:0});la({width:a._size.x,
height:a._size.y});a=c.y-b.y;p=c.x-b.x;n=a;A.render();F.update()}};t.onZoomStart=function(b){Q=!0;A.render()};t.onZoom=function(b){};t.onZoomEnd=function(b){b=this.map;var a=this.getOffset(),c=b.getPixelOrigin(),d=c.y-a.y;p=c.x-a.x;n=d;b=b._zoom;Q=!1;ma(b);F.update();A.render();this.noMoveEnd=!0};t.onResize=function(){};t.onViewReset=function(){var b=this.getOffset();this.offset=b;A.setPosition(-b.x,-b.y);ea({x:0,y:0})};t.onClick=function(b){var a=Y.getIdFromXY(b.containerPoint.x,b.containerPoint.y);
a&&ua({feature:a,lat:b.latlng.lat,lon:b.latlng.lng})};t.getOffset=function(){return L.DomUtil.getPosition(this.map._mapPane)};t.style=function(b){b=b||{};var a;if(a=b.color||b.wallColor)H=I.parse(a),ha=""+H.alpha(C),ba=H.lightness(0.8),aa=""+ba.alpha(C),O=H.lightness(1.2),X=""+O.alpha(C);b.roofColor&&(O=I.parse(b.roofColor),X=""+O.alpha(C));void 0!==b.shadows&&(z.enabled=!!b.shadows);A.render();return this};t.date=function(b){z.date=b;z.render();return this};t.load=function(b){F.load(b);return this};
t.set=function(b){F.set(b);return this};var ta=function(){};t.each=function(b){ta=function(a){return b(a)};return this};var ua=function(){};t.click=function(b){ua=function(a){return b(a)};return this};u.VERSION="0.2.2b";u.ATTRIBUTION='&copy; <a href="http://osmbuildings.org">OSM Buildings</a>';ca.OSMBuildings=u})(this);<commit_msg>:arrow_up: Update OSMBuildings-Leaflet.js<commit_after>(function(ba){function Q(a,b){var c=a.x-b.x,d=a.y-b.y;return c*c+d*d}function ua(a){var b=a.length;if(16>b)return!1;var c,d=Infinity,e=-Infinity,g=Infinity,f=-Infinity;for(c=0;c<b-1;c+=2)d=Math.min(d,a[c]),e=Math.max(e,a[c]),g=Math.min(g,a[c+1]),f=Math.max(f,a[c+1]);c=e-d;f-=g;e=c/f;if(.85>e||1.15<e)return!1;d={x:d+c/2,y:g+f/2};c=(c+f)/4;g=c*c;for(c=0;c<b-1;c+=2)if(f=Q({x:a[c],y:a[c+1]},d),.8>f/g||1.2<f/g)return!1;return!0}function ia(a,b){var c={};a/=R;b/=R;var d;d=0>=b?90:1<=b?-90:(2*va(wa(D*(1-
2*b)))-H)/D*180;c.latitude=d;c.longitude=360*(1===a?1:(a%1+1)%1)-180;return c}function ca(a,b){var c=S(1,I(0,.5-xa(ja(ya+H*a/180))/D/2));return{x:(b/360+.5)*R<<0,y:c*R<<0}}function T(a){for(var b=B+n,c=z+p,d=0,e=a.length-3;d<e;d+=2)if(a[d]>n&&a[d]<b&&a[d+1]>p&&a[d+1]<c)return!0;return!1}function za(){Y||(Y=setInterval(function(){for(var a=E.items,b=!1,c=0,d=a.length;c<d;c++)1>a[c].scale&&(a[c].scale+=.1,1<a[c].scale&&(a[c].scale=1),b=!0);A.render();b||(clearInterval(Y),Y=null)},33))}function da(a){J=
U+a.x;K=z+a.y;A.render(!0)}function ka(a){B=a.width;z=a.height;U=B/2<<0;ea=z/2<<0;J=U;K=z;A.setSize(B,z);fa=400}function la(a){x=a;R=256<<x;a=ia(n+U,p+ea);var b=ca(a.latitude,0);ma=ca(a.latitude,1).x-b.x;C=na(.95,x-15);ga=""+G.alpha(C);Z=""+aa.alpha(C);V=""+M.alpha(C)}var u=Math,wa=u.exp,xa=u.log,Aa=u.sin,Ba=u.cos,ja=u.tan,va=u.atan,N=u.atan2,S=u.min,I=u.max,oa=u.sqrt,pa=u.ceil,na=u.pow,qa=qa||Array,ra=ra||Array,u=/iP(ad|hone|od)/g.test(navigator.userAgent),w=!!~navigator.userAgent.indexOf("Trident"),
Ca=!ba.requestAnimationFrame||u||w?function(a){a()}:ba.requestAnimationFrame,F=function(){function a(b,a,c){0>c&&(c+=1);1<c&&--c;return c<1/6?b+6*(a-b)*c:.5>c?a:c<2/3?b+(a-b)*(2/3-c)*6:b}function b(b,a){if(void 0!==b)return Math.min(a,Math.max(0,b||0))}var c={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",
cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",
darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",
lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",
mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",
peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",
turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},d=function(a,c,d,k){this.r=b(a,1);this.g=b(c,1);this.b=b(d,1);this.a=b(k,1)||1};d.parse=function(b){if("string"===typeof b){b=b.toLowerCase();b=c[b]||b;var a;if(a=b.match(/^#?(\w{2})(\w{2})(\w{2})$/))return new d(parseInt(a[1],16)/255,parseInt(a[2],16)/255,parseInt(a[3],16)/255);if(a=b.match(/rgba?\((\d+)\D+(\d+)\D+(\d+)(\D+([\d.]+))?\)/))return new d(parseFloat(a[1])/
255,parseFloat(a[2])/255,parseFloat(a[3])/255,a[4]?parseFloat(a[5]):1)}return new d};d.fromHSL=function(b,c,f,k){if(0===c)return new d(f,f,f,k);c=.5>f?f*(1+c):f+c-f*c;f=2*f-c;b/=360;return new d(a(f,c,b+1/3),a(f,c,b),a(f,c,b-1/3),k)};d.prototype={toHSL:function(){if(void 0!==this.r&&void 0!==this.g&&void 0!==this.b){var b=Math.max(this.r,this.g,this.b),a=Math.min(this.r,this.g,this.b),c,d=(b+a)/2,h=b-a;if(h){a=.5<d?h/(2-b-a):h/(b+a);switch(b){case this.r:c=(this.g-this.b)/h+(this.g<this.b?6:0);break;
case this.g:c=(this.b-this.r)/h+2;break;case this.b:c=(this.r-this.g)/h+4}c*=60}else c=a=0;return{h:c,s:a,l:d,a:this.a}}},toString:function(){if(void 0!==this.r&&void 0!==this.g&&void 0!==this.b)return 1===this.a?"#"+(16777216+(Math.round(255*this.r)<<16)+(Math.round(255*this.g)<<8)+Math.round(255*this.b)).toString(16).slice(1,7):"rgba("+[Math.round(255*this.r),Math.round(255*this.g),Math.round(255*this.b),this.a.toFixed(2)].join()+")"},toArray:function(){if(void 0!==this.r&&void 0!==this.g&&void 0!==
this.b)return[this.r,this.g,this.b]},hue:function(b){var a=this.toHSL();return d.fromHSL(a.h+b,a.s,a.l)},saturation:function(b){var a=this.toHSL();return d.fromHSL(a.h,a.s*b,a.l)},lightness:function(b){var a=this.toHSL();return d.fromHSL(a.h,a.s,a.l*b)},red:function(a){return new d(this.r*a,this.g,this.b,this.a)},green:function(a){return new d(this.r,this.g*a,this.b,this.a)},blue:function(a){return new d(this.r,this.g,this.b*a,this.a)},alpha:function(a){return new d(this.r,this.g,this.b,this.a*a)},
copy:function(){return new d(this.r,this.g,this.b,this.a)}};return d}();"object"===typeof module&&(module.exports=F);var Da=function(){var a=Math,b=a.PI,c=a.sin,d=a.cos,e=a.tan,g=a.asin,f=a.atan2,k=b/180,h=23.4397*k;return function(a,m,q){q=k*-q;m*=k;a=a.valueOf()/864E5-.5+2440588-2451545;var r=k*(357.5291+.98560028*a),n;n=k*(1.9148*c(r)+.02*c(2*r)+3E-4*c(3*r));n=r+n+102.9372*k+b;r=g(c(0)*d(h)+d(0)*c(h)*c(n));n=f(c(n)*d(h)-e(0)*c(h),d(n));a=k*(280.16+360.9856235*a)-q-n;q=g(c(m)*c(r)+d(m)*d(r)*d(a));
m=f(c(a),d(a)*c(m)-e(r)*d(m));return{altitude:q,azimuth:m-b/2}}}(),Fa=function(){function a(a){a=a.toLowerCase();return"#"===a[0]?a:d[e[a]||a]||null}function b(a,b){var c,d,e,m,q=0,r,n;r=0;for(n=a.length-3;r<n;r+=2)c=a[r],d=a[r+1],e=a[r+2],m=a[r+3],q+=c*m-e*d;if((0<q/2?"CW":"CCW")===b)return a;c=[];for(d=a.length-2;0<=d;d-=2)c.push(a[d],a[d+1]);return c}function c(a){var d,e,h=[],l;switch(a.type){case "GeometryCollection":h=[];d=0;for(e=a.geometries.length;d<e;d++)(l=c(a.geometries[d]))&&h.push.apply(h,
l);return h;case "MultiPolygon":h=[];d=0;for(e=a.coordinates.length;d<e;d++)(l=c({type:"Polygon",coordinates:a.coordinates[d]}))&&h.push.apply(h,l);return h;case "Polygon":a=a.coordinates;break;default:return[]}var m,q=[],r=[];m=a[0];d=0;for(e=m.length;d<e;d++)q.push(m[d][1],m[d][0]);q=b(q,"CW");d=0;for(e=a.length-1;d<e;d++){m=a[d+1];r[d]=[];h=0;for(l=m.length;h<l;h++)r[d].push(m[h][1],m[h][0]);r[d]=b(r[d],"CCW")}return[{outer:q,inner:r.length?r:null}]}var d={brick:"#cc7755",bronze:"#ffeecc",canvas:"#fff8f0",
concrete:"#999999",copper:"#a0e0d0",glass:"#e8f8f8",gold:"#ffcc00",plants:"#009933",metal:"#aaaaaa",panel:"#fff8f0",plaster:"#999999",roof_tiles:"#f08060",silver:"#cccccc",slate:"#666666",stone:"#996666",tar_paper:"#333333",wood:"#deb887"},e={asphalt:"tar_paper",bitumen:"tar_paper",block:"stone",bricks:"brick",glas:"glass",glassfront:"glass",grass:"plants",masonry:"stone",granite:"stone",panels:"panel",paving_stones:"stone",plastered:"plaster",rooftiles:"roof_tiles",roofingfelt:"tar_paper",sandstone:"stone",
sheet:"canvas",sheets:"canvas",shingle:"tar_paper",shingles:"tar_paper",slates:"slate",steel:"metal",tar:"tar_paper",tent:"canvas",thatch:"plants",tile:"roof_tiles",tiles:"roof_tiles"};return{read:function(b){if(!b||"FeatureCollection"!==b.type)return[];b=b.features;var d,e,h,l,m=[],q,r,n,p;d=0;for(e=b.length;d<e;d++)if(q=b[d],"Feature"===q.type&&!1!==sa(q)){h=q.properties;l={};h=h||{};l.height=h.height||(h.levels?3*h.levels:Ea);l.minHeight=h.minHeight||(h.minLevel?3*h.minLevel:0);if(r=h.material?
a(h.material):h.wallColor||h.color)l.wallColor=r;if(r=h.roofMaterial?a(h.roofMaterial):h.roofColor)l.roofColor=r;switch(h.shape){case "cylinder":case "cone":case "dome":case "sphere":l.shape=h.shape;l.isRotational=!0;break;case "pyramid":l.shape=h.shape}switch(h.roofShape){case "cone":case "dome":l.roofShape=h.roofShape;l.isRotational=!0;break;case "pyramid":l.roofShape=h.roofShape}l.roofShape&&h.roofHeight?(l.roofHeight=h.roofHeight,l.height=I(0,l.height-l.roofHeight)):l.roofHeight=0;n=l;r=c(q.geometry);
h=0;for(l=r.length;h<l;h++){p=n;var w={},v=void 0;for(v in p)p.hasOwnProperty(v)&&(w[v]=p[v]);p=w;p.footprint=r[h].outer;if(p.isRotational){for(var w=p,v=p.footprint,t=180,u=-180,x=0,y=v.length;x<y;x+=2)t=S(t,v[x+1]),u=I(u,v[x+1]);w.radius=(u-t)/2}r[h].inner&&(p.holes=r[h].inner);if(q.id||q.properties.id)p.id=q.id||q.properties.id;q.properties.relationId&&(p.relationId=q.properties.relationId);m.push(p)}}return m}}}(),D=Math.PI,H=D/2,ya=D/4,x,R,B=0,z=0,U=0,ea=0,n=0,p=0,G=F.parse("rgba(200, 190, 180)"),
aa=G.lightness(.8),M=G.lightness(1.2),ga=""+G,Z=""+aa,V=""+M,ma=0,C=1,fa,Ea=5,J,K,O,Ga=function(){function a(a,g){if(b[a])g&&g(b[a]);else{var f=new XMLHttpRequest;f.onreadystatechange=function(){if(4===f.readyState&&!(!f.status||200>f.status||299<f.status)&&g&&f.responseText){var k=f.responseText;b[a]=k;c.push({url:a,size:k.length});d+=k.length;for(g(k);5242880<d;)k=c.shift(),d-=k.size,delete b[k.url]}};f.open("GET",a);f.send(null);return f}}var b={},c=[],d=0;return{loadJSON:function(b,c){return a(b,
function(a){var b;try{b=JSON.parse(a)}catch(d){}c(b)})}}}(),E={loadedItems:{},items:[],getPixelFootprint:function(a){for(var b=new qa(a.length),c,d=0,e=a.length-1;d<e;d+=2)c=ca(a[d],a[d+1]),b[d]=c.x,b[d+1]=c.y;a=b;b=a.length/2;c=new ra(b);var d=0,e=b-1,g,f,k,h,l=[],m=[],q=[];for(c[d]=c[e]=1;e;){f=0;for(g=d+1;g<e;g++){k=a[2*g];var r=a[2*g+1],n=a[2*d],p=a[2*d+1],v=a[2*e],w=a[2*e+1],t=v-n,u=w-p,x=void 0;if(0!==t||0!==u)x=((k-n)*t+(r-p)*u)/(t*t+u*u),1<x?(n=v,p=w):0<x&&(n+=t*x,p+=u*x);t=k-n;u=r-p;k=t*
t+u*u;k>f&&(h=g,f=k)}2<f&&(c[h]=1,l.push(d),m.push(h),l.push(h),m.push(e));d=l.pop();e=m.pop()}for(g=0;g<b;g++)c[g]&&q.push(a[2*g],a[2*g+1]);b=q;if(!(8>b.length))return b},resetItems:function(){this.items=[];this.loadedItems={};W.reset()},addRenderItems:function(a,b){for(var c,d,e,g=Fa.read(a),f=0,k=g.length;f<k;f++)c=g[f],e=c.id||[c.footprint[0],c.footprint[1],c.height,c.minHeight].join(),!this.loadedItems[e]&&(d=this.scale(c))&&(d.scale=b?0:1,this.items.push(d),this.loadedItems[e]=1);za()},scale:function(a){var b=
{},c=6/na(2,x-15);a.id&&(b.id=a.id);b.height=S(a.height/c,fa);b.minHeight=isNaN(a.minHeight)?0:a.minHeight/c;if(!(b.minHeight>fa)&&(b.footprint=this.getPixelFootprint(a.footprint),b.footprint)){for(var d=b.footprint,e=Infinity,g=-Infinity,f=Infinity,k=-Infinity,h=0,l=d.length-3;h<l;h+=2)e=S(e,d[h]),g=I(g,d[h]),f=S(f,d[h+1]),k=I(k,d[h+1]);b.center={x:e+(g-e)/2<<0,y:f+(k-f)/2<<0};a.radius&&(b.radius=a.radius*ma);a.shape&&(b.shape=a.shape);a.roofShape&&(b.roofShape=a.roofShape);"cone"!==b.roofShape&&
"dome"!==b.roofShape||b.shape||!ua(b.footprint)||(b.shape="cylinder");if(a.holes){b.holes=[];for(var m,d=0,e=a.holes.length;d<e;d++)(m=this.getPixelFootprint(a.holes[d]))&&b.holes.push(m)}var q;a.wallColor&&(q=F.parse(a.wallColor))&&(q=q.alpha(C),b.altColor=""+q.lightness(.8),b.wallColor=""+q);a.roofColor&&(q=F.parse(a.roofColor))&&(b.roofColor=""+q.alpha(C));a.relationId&&(b.relationId=a.relationId);b.hitColor=W.idToColor(a.relationId||a.id);b.roofHeight=isNaN(a.roofHeight)?0:a.roofHeight/c;if(!(b.height+
b.roofHeight<=b.minHeight))return b}},set:function(a){this.isStatic=!0;this.resetItems();this._staticData=a;this.addRenderItems(this._staticData,!0)},load:function(a,b){this.src=a||"https://{s}.data.osmbuildings.org/0.2/{k}/tile/{z}/{x}/{y}.json".replace("{k}",b||"anonymous");this.update()},update:function(){function a(a){f.addRenderItems(a)}this.resetItems();if(!(15>x))if(this.isStatic&&this._staticData)this.addRenderItems(this._staticData);else if(this.src){var b=16<x?256<<x-16:256>>16-x,c=n/b<<
0,d=p/b<<0,e=pa((n+B)/b),b=pa((p+z)/b),g,f=this;for(g=d;g<=b;g++)for(d=c;d<=e;d++)this.loadTile(d,g,16,a)}},loadTile:function(a,b,c,d){a=this.src.replace("{s}","abcd"[(a+b)%4]).replace("{x}",a).replace("{y}",b).replace("{z}",c);return Ga.loadJSON(a,d)}},X={draw:function(a,b,c,d,e,g,f,k){var h,l=this._extrude(a,b,d,e,g,f),m=[];if(c)for(b=0,h=c.length;b<h;b++)m[b]=this._extrude(a,c[b],d,e,g,f);a.fillStyle=k;a.beginPath();this._ring(a,l);if(c)for(b=0,h=m.length;b<h;b++)this._ring(a,m[b]);a.closePath();
a.stroke();a.fill()},_extrude:function(a,b,c,d,e,g){c=450/(450-c);for(var f=450/(450-d),k={x:0,y:0},h={x:0,y:0},l,m,q=[],r=0,t=b.length-3;r<t;r+=2)k.x=b[r]-n,k.y=b[r+1]-p,h.x=b[r+2]-n,h.y=b[r+3]-p,l=v.project(k,c),m=v.project(h,c),d&&(k=v.project(k,f),h=v.project(h,f)),(h.x-k.x)*(l.y-k.y)>(l.x-k.x)*(h.y-k.y)&&(a.fillStyle=k.x<h.x&&k.y<h.y||k.x>h.x&&k.y>h.y?g:e,a.beginPath(),this._ring(a,[h.x,h.y,k.x,k.y,l.x,l.y,m.x,m.y]),a.closePath(),a.fill()),q[r]=l.x,q[r+1]=l.y;return q},_ring:function(a,b){a.moveTo(b[0],
b[1]);for(var c=2,d=b.length-1;c<d;c+=2)a.lineTo(b[c],b[c+1])},simplified:function(a,b,c){a.beginPath();this._ringAbs(a,b);if(c){b=0;for(var d=c.length;b<d;b++)this._ringAbs(a,c[b])}a.closePath();a.stroke();a.fill()},_ringAbs:function(a,b){a.moveTo(b[0]-n,b[1]-p);for(var c=2,d=b.length-1;c<d;c+=2)a.lineTo(b[c]-n,b[c+1]-p)},shadow:function(a,b,c,d,e){for(var g=null,f={x:0,y:0},k={x:0,y:0},h,l,m=0,q=b.length-3;m<q;m+=2)f.x=b[m]-n,f.y=b[m+1]-p,k.x=b[m+2]-n,k.y=b[m+3]-p,h=y.project(f,d),l=y.project(k,
d),e&&(f=y.project(f,e),k=y.project(k,e)),(k.x-f.x)*(h.y-f.y)>(h.x-f.x)*(k.y-f.y)?(1===g&&a.lineTo(f.x,f.y),g=0,m||a.moveTo(f.x,f.y),a.lineTo(k.x,k.y)):(0===g&&a.lineTo(h.x,h.y),g=1,m||a.moveTo(h.x,h.y),a.lineTo(l.x,l.y));if(c)for(m=0,q=c.length;m<q;m++)this._ringAbs(a,c[m])},shadowMask:function(a,b,c){this._ringAbs(a,b);if(c){b=0;for(var d=c.length;b<d;b++)this._ringAbs(a,c[b])}},hitArea:function(a,b,c,d,e,g){c=null;var f={x:0,y:0},k={x:0,y:0};d=450/(450-d);var h=450/(450-e),l;a.fillStyle=g;a.beginPath();
for(var m=0,q=b.length-3;m<q;m+=2)f.x=b[m]-n,f.y=b[m+1]-p,k.x=b[m+2]-n,k.y=b[m+3]-p,g=v.project(f,d),l=v.project(k,d),e&&(f=v.project(f,h),k=v.project(k,h)),(k.x-f.x)*(g.y-f.y)>(g.x-f.x)*(k.y-f.y)?(1===c&&a.lineTo(f.x,f.y),c=0,m||a.moveTo(f.x,f.y),a.lineTo(k.x,k.y)):(0===c&&a.lineTo(g.x,g.y),c=1,m||a.moveTo(g.x,g.y),a.lineTo(l.x,l.y));a.closePath();a.fill()}},t={draw:function(a,b,c,d,e,g,f,k,h){b={x:b.x-n,y:b.y-p};var l=450/(450-e),m=450/(450-g);e=v.project(b,l);d*=l;g&&(b=v.project(b,m),c*=m);(l=
this._tangents(b,c,e,d))?(g=N(l[0].y1-b.y,l[0].x1-b.x),l=N(l[1].y1-b.y,l[1].x1-b.x)):(g=1.5*D,l=1.5*D);a.fillStyle=f;a.beginPath();a.arc(e.x,e.y,d,H,g,!0);a.arc(b.x,b.y,c,g,H);a.closePath();a.fill();a.fillStyle=k;a.beginPath();a.arc(e.x,e.y,d,l,H,!0);a.arc(b.x,b.y,c,H,l);a.closePath();a.fill();a.fillStyle=h;this._circle(a,e,d)},simplified:function(a,b,c){this._circle(a,{x:b.x-n,y:b.y-p},c)},shadow:function(a,b,c,d,e,g){b={x:b.x-n,y:b.y-p};e=y.project(b,e);var f;g&&(b=y.project(b,g));var k=this._tangents(b,
c,e,d);k?(g=N(k[0].y1-b.y,k[0].x1-b.x),f=N(k[1].y1-b.y,k[1].x1-b.x),a.moveTo(k[1].x2,k[1].y2),a.arc(e.x,e.y,d,f,g),a.arc(b.x,b.y,c,g,f)):(a.moveTo(b.x+c,b.y),a.arc(b.x,b.y,c,0,2*D))},shadowMask:function(a,b,c){var d=b.x-n;b=b.y-p;a.moveTo(d+c,b);a.arc(d,b,c,0,2*D)},hitArea:function(a,b,c,d,e,g,f){b={x:b.x-n,y:b.y-p};var k=450/(450-e),h=450/(450-g);e=v.project(b,k);d*=k;g&&(b=v.project(b,h),c*=h);g=this._tangents(b,c,e,d);a.fillStyle=f;a.beginPath();g?(f=N(g[0].y1-b.y,g[0].x1-b.x),k=N(g[1].y1-b.y,
g[1].x1-b.x),a.moveTo(g[1].x2,g[1].y2),a.arc(e.x,e.y,d,k,f),a.arc(b.x,b.y,c,f,k)):(a.moveTo(b.x+c,b.y),a.arc(b.x,b.y,c,0,2*D));a.closePath();a.fill()},_circle:function(a,b,c){a.beginPath();a.arc(b.x,b.y,c,0,2*D);a.stroke();a.fill()},_tangents:function(a,b,c,d){var e=a.x-c.x,g=a.y-c.y,f=b-d,k=e*e+g*g;if(!(k<=f*f)){var k=oa(k),e=-e/k,g=-g/k,f=f/k,k=[],h,l,m;h=oa(I(0,1-f*f));for(var q=1;-1<=q;q-=2)l=e*f-q*h*g,m=g*f+q*h*e,k.push({x1:a.x+b*l<<0,y1:a.y+b*m<<0,x2:c.x+d*l<<0,y2:c.y+d*m<<0});return k}}},P=
{draw:function(a,b,c,d,e,g,f){var k=450/(450-e);c=v.project({x:c.x-n,y:c.y-p},450/(450-d));d={x:0,y:0};for(var h={x:0,y:0},l=0,m=b.length-3;l<m;l+=2)d.x=b[l]-n,d.y=b[l+1]-p,h.x=b[l+2]-n,h.y=b[l+3]-p,e&&(d=v.project(d,k),h=v.project(h,k)),(h.x-d.x)*(c.y-d.y)>(c.x-d.x)*(h.y-d.y)&&(a.fillStyle=d.x<h.x&&d.y<h.y||d.x>h.x&&d.y>h.y?f:g,a.beginPath(),this._triangle(a,d,h,c),a.closePath(),a.fill())},_triangle:function(a,b,c,d){a.moveTo(b.x,b.y);a.lineTo(c.x,c.y);a.lineTo(d.x,d.y)},_ring:function(a,b){a.moveTo(b[0]-
n,b[1]-p);for(var c=2,d=b.length-1;c<d;c+=2)a.lineTo(b[c]-n,b[c+1]-p)},shadow:function(a,b,c,d,e){var g={x:0,y:0},f={x:0,y:0};c=y.project({x:c.x-n,y:c.y-p},d);d=0;for(var k=b.length-3;d<k;d+=2)g.x=b[d]-n,g.y=b[d+1]-p,f.x=b[d+2]-n,f.y=b[d+3]-p,e&&(g=y.project(g,e),f=y.project(f,e)),(f.x-g.x)*(c.y-g.y)>(c.x-g.x)*(f.y-g.y)&&this._triangle(a,g,f,c)},shadowMask:function(a,b){this._ring(a,b)},hitArea:function(a,b,c,d,e,g){var f=450/(450-e);c=v.project({x:c.x-n,y:c.y-p},450/(450-d));d={x:0,y:0};var k={x:0,
y:0};a.fillStyle=g;a.beginPath();g=0;for(var h=b.length-3;g<h;g+=2)d.x=b[g]-n,d.y=b[g+1]-p,k.x=b[g+2]-n,k.y=b[g+3]-p,e&&(d=v.project(d,f),k=v.project(k,f)),(k.x-d.x)*(c.y-d.y)>(c.x-d.x)*(k.y-d.y)&&this._triangle(a,d,k,c);a.closePath();a.fill()}},v={project:function(a,b){return{x:(a.x-J)*b+J<<0,y:(a.y-K)*b+K<<0}},render:function(){var a=this.context;a.clearRect(0,0,B,z);if(!(15>x||O)){var b,c,d,e={x:J+n,y:K+p},g,f,k,h,l=E.items;l.sort(function(a,b){return a.minHeight-b.minHeight||Q(b.center,e)-Q(a.center,
e)||b.height-a.height});for(var m=0,q=l.length;m<q;m++)if(b=l[m],!ha.isSimple(b)&&(g=b.footprint,T(g))){c=1>b.scale?b.height*b.scale:b.height;d=0;b.minHeight&&(d=1>b.scale?b.minHeight*b.scale:b.minHeight);f=b.wallColor||ga;k=b.altColor||Z;h=b.roofColor||V;a.strokeStyle=k;switch(b.shape){case "cylinder":t.draw(a,b.center,b.radius,b.radius,c,d,f,k,h);break;case "cone":t.draw(a,b.center,b.radius,0,c,d,f,k);break;case "dome":t.draw(a,b.center,b.radius,b.radius/2,c,d,f,k);break;case "sphere":t.draw(a,
b.center,b.radius,b.radius,c,d,f,k,h);break;case "pyramid":P.draw(a,g,b.center,c,d,f,k);break;default:X.draw(a,g,b.holes,c,d,f,k,h)}switch(b.roofShape){case "cone":t.draw(a,b.center,b.radius,0,c+b.roofHeight,c,h,""+F.parse(h).lightness(.9));break;case "dome":t.draw(a,b.center,b.radius,b.radius/2,c+b.roofHeight,c,h,""+F.parse(h).lightness(.9));break;case "pyramid":P.draw(a,g,b.center,c+b.roofHeight,c,h,F.parse(h).lightness(.9))}}}}},ha={maxZoom:17,maxHeight:5,isSimple:function(a){return x<=this.maxZoom&&
a.height+a.roofHeight<this.maxHeight},render:function(){var a=this.context;a.clearRect(0,0,B,z);if(!(15>x||O||x>this.maxZoom))for(var b,c,d=E.items,e=0,g=d.length;e<g;e++)if(b=d[e],!(b.height>=this.maxHeight)&&(c=b.footprint,T(c)))switch(a.strokeStyle=b.altColor||Z,a.fillStyle=b.roofColor||V,b.shape){case "cylinder":case "cone":case "dome":case "sphere":t.simplified(a,b.center,b.radius);break;default:X.simplified(a,c,b.holes)}}},y={enabled:!0,color:"#666666",blurColor:"#000000",blurSize:15,date:new Date,
direction:{x:0,y:0},project:function(a,b){return{x:a.x+this.direction.x*b,y:a.y+this.direction.y*b}},render:function(){var a=this.context,b,c,d;a.clearRect(0,0,B,z);if(!(!this.enabled||15>x||O||(b=ia(U+n,ea+p),b=Da(this.date,b.latitude,b.longitude),0>=b.altitude))){c=1/ja(b.altitude);d=5>c?.75:1/c*5;this.direction.x=Ba(b.azimuth)*c;this.direction.y=Aa(b.azimuth)*c;var e,g,f,k;b=E.items;a.canvas.style.opacity=d/(2*C);a.shadowColor=this.blurColor;a.shadowBlur=C/2*this.blurSize;a.fillStyle=this.color;
a.beginPath();d=0;for(c=b.length;d<c;d++)if(e=b[d],k=e.footprint,T(k)){g=1>e.scale?e.height*e.scale:e.height;f=0;e.minHeight&&(f=1>e.scale?e.minHeight*e.scale:e.minHeight);switch(e.shape){case "cylinder":t.shadow(a,e.center,e.radius,e.radius,g,f);break;case "cone":t.shadow(a,e.center,e.radius,0,g,f);break;case "dome":t.shadow(a,e.center,e.radius,e.radius/2,g,f);break;case "sphere":t.shadow(a,e.center,e.radius,e.radius,g,f);break;case "pyramid":P.shadow(a,k,e.center,g,f);break;default:X.shadow(a,k,
e.holes,g,f)}switch(e.roofShape){case "cone":t.shadow(a,e.center,e.radius,0,g+e.roofHeight,g);break;case "dome":t.shadow(a,e.center,e.radius,e.radius/2,g+e.roofHeight,g);break;case "pyramid":P.shadow(a,k,e.center,g+e.roofHeight,g)}}a.closePath();a.fill();a.shadowBlur=null;a.globalCompositeOperation="destination-out";a.beginPath();d=0;for(c=b.length;d<c;d++)if(e=b[d],k=e.footprint,T(k)&&!e.minHeight)switch(e.shape){case "cylinder":case "cone":case "dome":t.shadowMask(a,e.center,e.radius);break;default:X.shadowMask(a,
k,e.holes)}a.fillStyle="#00ff00";a.fill();a.globalCompositeOperation="source-over"}}},W={_idMapping:[null],reset:function(){this._idMapping=[null]},render:function(){if(!this._timer){var a=this;this._timer=setTimeout(function(){a._timer=null;a._render()},500)}},_render:function(){var a=this.context;a.clearRect(0,0,B,z);if(!(15>x||O)){var b,c,d,e={x:J+n,y:K+p},g,f,k=E.items;k.sort(function(a,b){return a.minHeight-b.minHeight||Q(b.center,e)-Q(a.center,e)||b.height-a.height});for(var h=0,l=k.length;h<
l;h++)if(b=k[h],f=b.hitColor)if(g=b.footprint,T(g)){c=b.height;d=0;b.minHeight&&(d=b.minHeight);switch(b.shape){case "cylinder":t.hitArea(a,b.center,b.radius,b.radius,c,d,f);break;case "cone":t.hitArea(a,b.center,b.radius,0,c,d,f);break;case "dome":t.hitArea(a,b.center,b.radius,b.radius/2,c,d,f);break;case "sphere":t.hitArea(a,b.center,b.radius,b.radius,c,d,f);break;case "pyramid":P.hitArea(a,g,b.center,c,d,f);break;default:X.hitArea(a,g,b.holes,c,d,f)}switch(b.roofShape){case "cone":t.hitArea(a,
b.center,b.radius,0,c+b.roofHeight,c,f);break;case "dome":t.hitArea(a,b.center,b.radius,b.radius/2,c+b.roofHeight,c,f);break;case "pyramid":P.hitArea(a,g,b.center,c+b.roofHeight,c,f)}}B&&z&&(this._imageData=this.context.getImageData(0,0,B,z).data)}},getIdFromXY:function(a,b){var c=this._imageData;if(c){var d=4*((b|0)*B+(a|0));return this._idMapping[c[d]|c[d+1]<<8|c[d+2]<<16]}},idToColor:function(a){var b=this._idMapping.indexOf(a);-1===b&&(this._idMapping.push(a),b=this._idMapping.length-1);return"rgb("+
[b&255,b>>8&255,b>>16&255].join()+")"}},Y,A={container:document.createElement("DIV"),items:[],init:function(){this.container.style.pointerEvents="none";this.container.style.position="absolute";this.container.style.left=0;this.container.style.top=0;y.context=this.createContext(this.container);ha.context=this.createContext(this.container);v.context=this.createContext(this.container);W.context=this.createContext()},render:function(a){Ca(function(){a||(y.render(),ha.render(),W.render());v.render()})},
createContext:function(a){var b=document.createElement("CANVAS");b.style.transform="translate3d(0, 0, 0)";b.style.imageRendering="optimizeSpeed";b.style.position="absolute";b.style.left=0;b.style.top=0;var c=b.getContext("2d");c.lineCap="round";c.lineJoin="round";c.lineWidth=1;c.imageSmoothingEnabled=!1;this.items.push(b);a&&a.appendChild(b);return c},appendTo:function(a){a.appendChild(this.container)},remove:function(){this.container.parentNode.removeChild(this.container)},setSize:function(a,b){for(var c=
0,d=this.items.length;c<d;c++)this.items[c].width=a,this.items[c].height=b},setPosition:function(a,b){this.container.style.left=a+"px";this.container.style.top=b+"px"}};A.init();u=function(a){this.offset={x:0,y:0};a&&a.addLayer(this)};w=u.prototype=L.Layer?new L.Layer:{};w.addTo=function(a){a.addLayer(this);return this};w.onAdd=function(a){this.map=a;A.appendTo(a._panes.overlayPane);var b=this.getOffset(),c=a.getPixelOrigin();ka({width:a._size.x,height:a._size.y});var d=c.y-b.y;n=c.x-b.x;p=d;la(a._zoom);
A.setPosition(-b.x,-b.y);a.on({move:this.onMove,moveend:this.onMoveEnd,zoomstart:this.onZoomStart,zoomend:this.onZoomEnd,resize:this.onResize,viewreset:this.onViewReset,click:this.onClick},this);if(a.options.zoomAnimation)a.on("zoomanim",this.onZoom,this);a.attributionControl&&a.attributionControl.addAttribution('&copy; <a href="https://osmbuildings.org">OSM Buildings</a>');E.update()};w.onRemove=function(){var a=this.map;a.attributionControl&&a.attributionControl.removeAttribution('&copy; <a href="https://osmbuildings.org">OSM Buildings</a>');
a.off({move:this.onMove,moveend:this.onMoveEnd,zoomstart:this.onZoomStart,zoomend:this.onZoomEnd,resize:this.onResize,viewreset:this.onViewReset,click:this.onClick},this);a.options.zoomAnimation&&a.off("zoomanim",this.onZoom,this);A.remove()};w.onMove=function(a){a=this.getOffset();da({x:this.offset.x-a.x,y:this.offset.y-a.y})};w.onMoveEnd=function(a){if(this.noMoveEnd)this.noMoveEnd=!1;else{var b=this.map;a=this.getOffset();var c=b.getPixelOrigin();this.offset=a;A.setPosition(-a.x,-a.y);da({x:0,
y:0});ka({width:b._size.x,height:b._size.y});b=c.y-a.y;n=c.x-a.x;p=b;A.render();E.update()}};w.onZoomStart=function(a){O=!0;A.render()};w.onZoom=function(a){};w.onZoomEnd=function(a){a=this.map;var b=this.getOffset(),c=a.getPixelOrigin(),d=c.y-b.y;n=c.x-b.x;p=d;a=a._zoom;O=!1;la(a);E.update();A.render();this.noMoveEnd=!0};w.onResize=function(){};w.onViewReset=function(){var a=this.getOffset();this.offset=a;A.setPosition(-a.x,-a.y);da({x:0,y:0})};w.onClick=function(a){var b=W.getIdFromXY(a.containerPoint.x,
a.containerPoint.y);b&&ta({feature:b,lat:a.latlng.lat,lon:a.latlng.lng})};w.getOffset=function(){return L.DomUtil.getPosition(this.map._mapPane)};w.style=function(a){a=a||{};var b;if(b=a.color||a.wallColor)G=F.parse(b),ga=""+G.alpha(C),aa=G.lightness(.8),Z=""+aa.alpha(C),M=G.lightness(1.2),V=""+M.alpha(C);a.roofColor&&(M=F.parse(a.roofColor),V=""+M.alpha(C));void 0!==a.shadows&&(y.enabled=!!a.shadows);A.render();return this};w.date=function(a){y.date=a;y.render();return this};w.load=function(a){E.load(a);
return this};w.set=function(a){E.set(a);return this};var sa=function(){};w.each=function(a){sa=function(b){return a(b)};return this};var ta=function(){};w.click=function(a){ta=function(b){return a(b)};return this};u.VERSION="0.2.2b";u.ATTRIBUTION='&copy; <a href="https://osmbuildings.org">OSM Buildings</a>';ba.OSMBuildings=u})(this);
{'fraction_non_alphanumeric': 0.32804253337472833, 'fraction_numerical': 0.04325131946600435, 'mean_word_length': 13.150741350906095, 'pattern_counts': {'":': 85, '<': 237, '<?xml version=': 0, '>': 97, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4090599', 'n_tokens_mistral': 28388, 'n_tokens_neox': 27400, 'n_words': 577}