/**/_jsload2 && _jsload2('panorama', 'Nf.prototype.hD=ja(2,function(){this.Nb.style[qf]="";this.Hi=this.si=q;this.hw("h");this.hw("v");this.ae(Cf,window);this.ae(Df);this.ae(Ef,window);this.ae(Ff,window);this.ae(Gf,window);this.options.Ik||(this.ae("DOMMouseScroll"),this.ae("mousewheel"));this.options.Gi&&this.ae(Hf);this.options.fx&&clearInterval(this.kW);this.options.MN&&this.options.MN.call(this)});var Ij=1; function Jj(a,b){var c=a.width,d=a.height,e=180/Math.pow(2,b),f=1;J()&&(f=2);c=e/(1Bj&&(d*=Math.pow(2,f-Bj),f=Bj);f\\u51fa\\u53e3\'; return c},N1:function(a,b){var c=H("div"),d=c.style;d.position="absolute";d.zIndex=1201;d.right=d.top="10px";d.width="17px";d.height="16px";d.background=\'url("\'+I.pa+\'st-close.png") no-repeat 50% 50%\';J()&&(d.right=d.top="0px",d.width="42.5px",d.height="40px",d.backgroundSize="25.5px 24px");d.cursor="pointer";c.title=a;c.onclick=b;d.display="none";return c},rc:function(a,b,c){"object"===typeof b&&(c=b,b=k);a!=this.Ya&&(this.Dl=this.Ya,this.El=this._position,this.Ya=a,this.XA=p,this.Le=b||"street", c=c||{rk:q},this.aK=c.rk,"inter"===b?this.ZF(a):this.dispatchEvent(new N("onid_changed")),this.R_(c))},R_:function(a){this.Wv={id:this.Yb(),pov:a.pov}},fY:function(a,b){var c,d;if(this.Wv&&a===this.Wv.id){c={};for(var e=0;ethis.dk?a=this.dk:aQe&&(a=Qe);ai-P.no.x&&10>j-P.no.y&&z.dispatchEvent(new N("ondblclick")),P.no=p):(P.no={x:i,y:j},P.Si=setTimeout(function(){var a,b,c=z.oB;a=z.Ed;var d=0;for(b=0;a.offsetParent;)d+= a.offsetLeft,b+=a.offsetTop,a=a.offsetParent;a=i-d;b=j-b;Pa()&&(a*=2,b*=2);0===c.tM(a,b)&&z.dispatchEvent(new N("onclick"));P.no=p},400))),P.jB=q,d(a),D=y=q)}function d(a){if(a){var b=db()-P.LI;if(!(100Math.abs(n)&&10>Math.abs(s))){var c;J()?(b=a.changedTouches[0].clientX,c=a.changedTouches[0].clientY):(b=a.clientX,c=a.clientY);a=new R(i,j);c=new R(b,c);var b=[0z.dk&&(d=z.dk);da.detail;var c=new Date;if(!(220>c-aa)&&(aa=c,"path"!=(a.srcElement||a.target).tagName)){var c=na(b,a),d=a.srcElement||a.target,e=a.offsetX||a.layerX||0,f=a.offsetY||a.layerY||0;1!=d.nodeType&&(d=d.parentNode);for(;d&&d!=z.Ga();){d.ba&&(x.lang.Lc(d.ba)instanceof kb&&(overlay=x.lang.Lc(d.ba)),x.lang.Lc(d.ba)instanceof td&&(infoWindow=x.lang.Lc(d.ba)));if(!(0==d.clientWidth&&0==d.clientHeight&&d.offsetParent&&"TD"==d.offsetParent.nodeName)&&"http://www.w3.org/2000/svg"!=d.namespaceURI)e+= d.offsetLeft||0,f+=d.offsetTop||0;else if("http://www.w3.org/2000/svg"==d.namespaceURI){var g=z.lg.md&&z.lg.md.hf||p;if(-1a&&(a=1);a=Math.round(100*a)/100;z.Oc(a,{Up:o})},q),z.Ed.addEventListener("gestureend",function(){E=q;z.ga()!=G&&z.dispatchEvent(new N("onpinchtozoomend"))},q)):(x.M(z.Ed,"mousedown",function(b){a(b.clientX||b.pageX||0,b.clientY||b.pageY||0);A=b.target||b.srcElement;x.da.ma&&A.setCapture&&A.setCapture();P.rU=z.Ed.style.cursor;z.Ed.style.cursor=I.Id;x.da.ma||Gb(b)}),x.M(document,"mousemove",function(a){b((a.clientX||a.pageX||0)-i,(a.clientY||a.pageY|| 0)-j);pa(a)}),x.M(document,"mouseup",function(a){oa(a);c(a);x.da.ma&&(A&&A.releaseCapture)&&A.releaseCapture();z.Ed.style.cursor=P.rU||I.Xb}));z.addEventListener("zoom_changed_inner",function(){P.iv=Wj(P)});z.addEventListener("size_changed",function(){P.iv=Wj(P)});var aa=new Date;x.M(z.Ga(),"mousewheel",f);window.addEventListener&&z.Ga().addEventListener("DOMMouseScroll",f,q)}}; function Wj(a){if(!a.ea)return p;var b=a.P,c=Jj(b.jh(),b.ga()),d=c.GM,c=c.jL;if("cssRender"===b.Ar()&&!Pa())return 360/(a.ea.tiles.Bp(d)*c);b=a.P.ga();return 180/Math.pow(2,b)/a.P.jh().height};function Uj(a,b){x.lang.Da.call(this);this.P=a;this.Ba=b;this.Vh=[];this.Xh={};this.GB=q;this.cA()}x.lang.ua(Uj,x.lang.Da,"PanoramaOverlayMgr"); x.extend(Uj.prototype,{cA:function(){var a=this,b=this.P;b.addEventListener("add_overlay",function(c){c=c.overlay;c.ra(b);a.Vh.push(c);a.ds()});b.addEventListener("dataload",function(){a.GB=o;a.ds()});b.addEventListener("remove_overlay",function(b){for(var b=b.overlay,d=0,e=a.Vh.length;d=d[e].left&&c.left<=d[e].right||c.right>=d[e].left&&c.right<=d[e].right)return o;return q}var b={};return function(c){for(;a(c);)c.top+=-36;b[c.top]?b[c.top].push(c):b[c.top]=[c];return c}}(),d;for(d in this.Xh)for(var e in this.Xh[d]){var f=this.Xh[d][e],g=this.iU(d,f.pov.pitch,a,b),f=f.dom,g=c({top:g[1],left:g[0],right:g[0]+f.offsetWidth});f.style.left=g.left-f.offsetWidth/2+"px";f.style.top=g.top+f.offsetHeight/2+"px"}},iU:function(a, b,c,d){if(Pa())return this.jU(a,b);var e=this.P;for(svHeading=e.Fa().heading%360;0>svHeading;)svHeading=(svHeading+360)%360;var f=(a-svHeading)%360,a=e.jh(),c=360/(2*Math.pow(2,c-2)*d);180f&&(f+=360);d=Math.round(a.width/2+f/c);b=Math.round(a.height/2-(b-e.Fa().pitch)/c);return[d,b]},jU:function(a,b){var c=500*Math.cos(Tb(b)),c=Math.round(100*c)/100;"string"==typeof a&&(a=parseFloat(a));var d;d=a+this.P.ea.tiles.dirNorth;d%=360;var e=this.P.lg.Bd;d=Xj.tg(Math.cos(Tb(d))*c,500*Math.sin(Tb(b)), Math.sin(Tb(d))*c,1);var c=Xj.create(),f=e.Wh;Yj.multiply(c,e.If[0],d);Yj.multiply(c,f,c);if(0>c[3])return[-1E3,-1E3];e=this.P.ql;return[(c[0]/c[3]+1)/2*e.width,(1-c[1]/c[3])/2*e.height]},xU:function(){for(var a in this.Xh)for(var b in this.Xh[a]){var c=this.Xh[a][b].dom;c.parentNode.removeChild(c)}this.Xh={}}});x.extend(Ue.prototype,{ra:function(a){this.P=a;this.ia()||this.ta(this.P.ia());this.tA();this.aA()},Ld:v("ed"),hide:function(){this.Oa=q;this.ed&&(this.ed.style.display="none")},show:function(){this.Oa=o;this.ed&&(this.ed.style.display="block")},isVisible:v("Oa"),uP:function(){var a=this.oo();100a?a.toFixed(2):a.toFixed(0),a+="\\u516c\\u91cc"):(a=100>a?a.toFixed(2):a.toFixed(0),a+="\\u7c73");this.kr.innerHTML=a},tA:function(){var a=this.Dk(),b=H("div"),c=b.style;c.position="absolute"; c.backgroundColor="rgba(29, 29, 29, 0.8)";c.padding="7px 0";c.height="19px";c.font="16px arial";c.color="white";c.whiteSpace="nowrap";c.borderRadius="4px";c.left="-1000px";c.top="-1000px";c=H("div");c.style["float"]="left";c.style.lineHeight="19px";b.appendChild(c);var d=H("span");d.style.margin="0 14px";d.innerHTML=a;c.appendChild(d);a=H("span");a.style.color="color:rgba(255,255,255,0.3)";a.innerHTML="|";c.appendChild(a);var e=H("span");e.style.margin="0 8px";e.style.color="#60c7fa";e.style.fontSize= "12px";e.innerHTML="0\\u7c73";c.appendChild(e);this.TR===q&&(e.style.display="none",a.style.display="none");this.ed=b;this.kr=e;this.xs=d},aA:function(){var a=this;this.uR(this.ed,function(b){a.dispatchEvent(new N("onclick"),{type:"click",target:a});Gb(b)});x.M(this.ed,"mouseenter",function(){a.dispatchEvent(new N("onmouseover"),{type:"mouseover",target:a})});x.M(this.ed,"mouseleave",function(){a.dispatchEvent(new N("onmouseout"),{type:"mouseout",target:a})})},uR:function(a,b){if(J()){var c=0,d=0, e=0;a.addEventListener("touchstart",function(a){c=(new Date).getTime();d=a.touches[0].pageX;e=a.touches[0].pageY},q);a.addEventListener("touchend",function(a){200<=(new Date).getTime()-c||(5<=Math.abs(a.changedTouches[0].pageX-d)||5<=Math.abs(a.changedTouches[0].pageY-e))||b.call(this,a)},q)}else x.M(this.ed,"click",b)},Mf:function(a,b){this.ed&&("content"===a&&(this.xs.innerHTML=b),this.P.dispatchEvent(new N("onoverlay_property_changed")))},remove:function(){this.ed=this.kr=this.xs=p;this.dispatchEvent(new N("onremove"), {type:"remove",target:this})}});x.extend(Xe.prototype,{ra:function(a){this.P=a;this.tA();(a=this.vE())&&(a.panoId||a.panoIId)&&this.aA(a)},Ld:v("ed"),hide:function(){this.Oa=q;this.ed.style.display="none"},show:function(){this.Oa=o;this.ed.style.display="block"},isVisible:v("Oa"),uP:function(){var a=this.P.ia(),b=this.ia(),a=T.rp(a,b);100a?a.toFixed(2):a.toFixed(0),a+="\\u516c\\u91cc"):(a=100>a?a.toFixed(2):a.toFixed(0),a+="\\u7c73");this.kr.innerHTML=a},aA:function(a){var b=this;if(a.panoIId){var c=function(c){b.P.ZF(a.panoIId); c.stopPropagation();c.preventDefault()};J()?x.M(this.Br,"touchend",function(a){c(a)}):(this.Br.style.cursor="pointer",x.M(this.Br,"click",function(a){c(a)}))}if(a.panoId){var d=function(c){function d(){b.P.Nc(b.Fa());b.P.removeEventListener("dataload",d)}var g=a.panoId;b.P.Yb()!=g&&(b.P.rc(g),b.P.addEventListener("dataload",d));c.stopPropagation();c.preventDefault()};x.M(this.ed,"touchend",function(a){d(a)});this.ed.style.cursor="pointer";x.M(this.ed,"click",function(a){d(a)})}},tA:function(){var a= this.Ap(),b=H("div"),c=b.style;c.position="absolute";c.backgroundColor="rgba(29, 29, 29, 0.8)";c.padding="7px 0";c.height="19px";c.font="16px arial";c.color="white";c.whiteSpace="nowrap";c.borderRadius="4px";c.left="-1000px";c.top="-1000px";var d=H("img");d.src=this.sp();d.style.width="24px";d.style.height="24px";d.style.position="absolute";d.style.left="5px";d.style.top="5px";c.paddingLeft="40px";b.appendChild(d);c=H("div");c.style["float"]="left";c.style.lineHeight="19px";b.appendChild(c);var e= H("span");e.style.margin="0 14px";e.innerHTML=a;c.appendChild(e);a=H("span");a.style.color="color:rgba(255,255,255,0.3)";a.innerHTML="|";c.appendChild(a);a=H("span");a.style.margin="0 8px";a.style.color="#60c7fa";a.style.fontSize="12px";a.innerHTML="0\\u7c73";c.appendChild(a);this.ed=b;this.Br=d;this.kr=a;this.xs=e},Mf:function(a,b){switch(a){case "title":this.xs.innerHTML=b;break;case "altitude":this.P.dispatchEvent(new N("onoverlay_position_changed"));break;case "position":this.P.dispatchEvent(new N("onoverlay_position_changed"))}}, remove:function(){this.xs=this.kr=this.Br=this.ed=p;this.dispatchEvent(new N("onremove"),{type:"remove",target:this})}});x.extend(function(a){this.Vi(a)}.prototype,{Vi:function(a){this.P=a;this.Po=this.Oo=o;this.Ba();this.ca()},Ba:function(){this.C=H("div");var a=this.C.style;a.position="absolute";a.left="10px";a.top="10px";a.zIndex=1201;a=this.C;a.innerHTML=this.tr();Xa()?(this.ld=x.$(a.children[2]),this.zo=[x.$(this.ld.children[0]),x.$(this.ld.children[1]),x.$(this.ld.children[2]),x.$(this.ld.children[3])],Pb()?this.SJ=x.$(a.children[1].childNodes[0]):Ob()&&(this.cK=x.$(a.children[1].childNodes[0])),this.ce=x.$(a.children[3])): J()&&(this.ce=x.$(a.children[0]));this.Hh=x.$(this.ce.children[0]);this.cg=x.$(this.ce.children[1]);x.da.ma&&(this.ld.style.background=\'url("\'+I.pa+\'blank.gif") repeat\');6==x.da.ma&&this.IU();J()&&(this.ce.style.left=this.ce.style.top="0",this.ce.style.width="36px",this.ce.style.height="78px",this.Hh.style.width=this.cg.style.width="33px",this.Hh.style.height=this.cg.style.height="36px",this.cg.style.top="37.5px");this.P.ga()==Qe&&this.Fo("zoomIn",q);this.P.ga()==Re&&this.Fo("zoomOut",q);this.P.Ga().appendChild(a)}, tr:function(){var a=[];Xa()&&(a.push(this.GA()),a.push(this.yS()),a.push(this.AS()));a.push(this.HA());return a.join("")},yS:function(){if(Pb())return\'\'; if(Ob())return\'
\'}, GA:function(){return\'
\'},AS:function(){return\'
\'}, HA:function(){var a="background-image:url(\'"+I.pa+"st-navictrl.png\');background-repeat:no-repeat;background-position:-74px 0;";J()&&(a="background-image:url(\'"+I.pa+"st-navictrl-hd.png\');background-repeat:no-repeat;background-position:0 0;background-size:180px 78px;");return\'
\'}, ca:function(){var a=this.P,b=this;if(Xa()){x.M(this.zo[0],"click",function(){var b=a.Fa();a.dz({heading:b.heading,pitch:b.pitch+30})});x.M(this.zo[1],"click",function(){var b=a.Fa();a.dz({heading:b.heading-45,pitch:b.pitch})});x.M(this.zo[2],"click",function(){var b=a.Fa();a.dz({heading:b.heading+45,pitch:b.pitch})});x.M(this.zo[3],"click",function(){var b=a.Fa();a.dz({heading:b.heading,pitch:b.pitch-30})});for(var c=0;cb?90-b:450-b},Fo:function(a,b){var c=this.ce.children[2];if("zoomIn"==a)if(b)if(this.Oo= o,this.Hh.style.cursor="pointer",6==x.da.ma)c.style.left="-74px";else{var d=-74;J()&&(d=0);this.ce.style.backgroundPosition=d+"px 0"}else this.Oo=q,this.Hh.style.cursor="",6==x.da.ma?c.style.left="-170px":(d=-170,J()&&(d=-144),this.ce.style.backgroundPosition=d+"px 0");"zoomOut"==a&&(b?(this.Po=o,this.cg.style.cursor="pointer",6==x.da.ma?c.style.left="-74px":(d=-74,J()&&(d=0),this.ce.style.backgroundPosition=d+"px 0")):(this.Po=q,this.cg.style.cursor="",6==x.da.ma?c.style.left="-146px":(d=-146,J()&& (d=-108),this.ce.style.backgroundPosition=d+"px 0")))}});function Zj(a,b){this.dC=a;this.$e=[];this.oc={ap:p};var b=b||{},c;for(c in b)this.oc[c]=b[c]}Zj.prototype.setData=function(a,b){if(0!==this.dC){if(this.$e.length>this.dC){for(var c=Math.round(0.6*this.dC),d=0;da;a++){this.Bi[a]= [];for(b=0;8>b;b++){var c=new dk(this.P);c.lN=a;c.mN=b;c.canvas=this.Vc;this.Bi[a][b]=c}}this.P.I2=this.Vc},va:function(a,b){if(a&&b){var c=a.heading%360,d=a.pitch;this.RA({heading:c,pitch:d},b);this.Vc.ni({heading:c,pitch:d},b)}},GT:function(a,b){this.Vc.PW();this.BS(this.ea);this.Vc.JY(this.ea);this.xJ(a,b);this.PA(b,o)},Oc:function(a,b){var c=this,d=o;b==this.Vc.sa.zoom&&(d=q);this.xJ(a,b);d&&this.PA(b,o);setTimeout(function(){c.RA()},1E3)},BS:function(a){var b=this,c=a.tiles,d={ye:[]};d.ye[0]= new Image;d.ye[0].src=c.getTilesUrl(a.id,{x:0,y:0},2);d.ye[1]=new Image;d.ye[1].src=c.getTilesUrl(a.id,{x:1,y:0},2);b.GP=0;d.ye[0].onload=function(){b.Ay()};d.ye[1].onload=function(){b.Ay()};this.yK[0]=d},Ay:function(){this.GP++;2==this.GP&&(this.Vc.X_(this.yK[0].ye),this.Vc.Ay())},RA:function(a,b){if(this.ea&&this.ea.tiles)for(var c=this.ea.tiles,d=[],b=b||this.Vc.sa.zoom,d=this.Bi,e=this.Vc.gE(a),f=e.Pu,g=e.Ys,i=e.Tt,e=e.ju,e=e>i?e-i:64+e-i,j=0,l=0,m=0;mj&&(j+=64);j=Math.floor(j*Math.pow(2,b-7));l=Math.floor(n*Math.pow(2,b-7));if(jj?g-j:64+g-j,m=0,n=0,g=0;gm&&(m+=64);m=Math.floor(m*Math.pow(2,a-7));n=Math.floor(i*Math.pow(2,a-7));if(mMath.PI/2+0.1&&(b=2*Math.PI/3);return a.a/ 2/Math.tan(b/2)},Sk:function(a,b,c){var d=this.sa;d.a=c.width;d.bb=c.height;this.rg.canvas.width=c.width;this.rg.canvas.height=c.height;d.zoom=a;d.gq=b;d.Ca=this.Nx();d.dd=16*Math.pow(2,a-2);d.gu=Math.pow(2,a-1);d.nn=Math.pow(2,a-2);d.$p=Math.pow(2,7-a)},m_:function(a,b){var c=this.sa;if(0==this.sa.Ca)c.zoom=b,c.gq=a,c.Ca=this.Nx(),c.dd=16*Math.pow(2,b-2),c.gu=Math.pow(2,b-1),c.nn=Math.pow(2,b-2),c.$p=Math.pow(2,7-b),c.xq=c.Xo*Math.pow(2,-a);else if(!(a==c.gq&&b==c.zoom)){this.jm=o;var d=this.sa.Ca; c.dd=16*Math.pow(2,b-2);c.zoom=b;c.gq=a;c.gu=Math.pow(2,b-1);c.nn=Math.pow(2,b-2);c.$p=Math.pow(2,7-b);d=(this.Nx()-d)/32;this.P.Jk();this.iK(0,d);c.xq=c.Xo*Math.pow(2,-a)}},JY:function(a){this.sa.heading-=this.sa.Pf/180*Math.PI;this.sa.Pf=a.tiles.dirNorth;this.sa.heading+=a.tiles.dirNorth/180*Math.PI;this.sa.Es=a.tiles.pitch||0},iK:function(a,b){var c=this;if(5>a)this.sa.Ca+=b*Math.pow(2,a),this.jS(),setTimeout(function(){c.iK(a+1,b)},0);else if(5==a){this.jm=q;var d=this.sa.zoom;this.sa.Ca=this.Nx(); this.sa.dd=16*Math.pow(2,d-2);this.sa.gu=Math.pow(2,d-1);this.sa.nn=Math.pow(2,d-2);this.sa.$p=Math.pow(2,7-d);this.P.kz();this.refresh()}},V4:function(a,b){this.jm=o;var c=this.sa;this.tF={data:a,NV:b};this.tF.od=0;var d=Math.cos((a.dir+c.Pf)/180*Math.PI),c=-Math.sin((a.dir+c.Pf)/180*Math.PI),c=d=0;this.P.Jk();this.eS({index:1,U2:d,V2:c})},hX:function(a,b){if(!this.jm&&this.Kt)if(1i?i=0.4:0.98m&&(m=q);m=g*g/m;g=m*j-b;j=m*i-a;l=m*l-f;m=Math.pow(g,2)+Math.pow(j,2)+Math.pow(l,2);i=Math.sqrt(m);0==m?d=e=0:(m=(g*d+l*e)/i,1m&&(m=-1),m=Math.acos(m), 0>g*e*a+j*d*f-j*e*b-l*a*d&&(m=2*Math.PI-m),e=i*Math.cos(m),d=i*Math.sin(m));return{x:c.a/2+e,y:c.bb/2-d}},rL:function(a,b,c,d,e,f){var g=this.rg,i=0,j=0,l=0,m=0,n=this.sa.xq;d&&(1==d?j=n:-1==d&&(i=n));e&&(-1==e?l=n:1==e&&(m=n));d=this.sa.jn;i=this.Wn(a.pb,b,c,-d-i,l,f);if(!i)return q;l=this.Wn(a.qb,b,c,d+j,d+l,f);if(!l)return q;c=this.Wn(a.rb,b,c,j,-d-m,f);if(!c)return q;c={pb:i,qb:l,rb:c};f=c.pb;j=c.qb;m=c.rb;g.save();g.beginPath();g.moveTo(f.x,f.y);g.lineTo(j.x,j.y);g.lineTo(m.x,m.y);g.closePath(); g.clip();a=this.Hk(a,c);g.transform(a[0],a[1],a[2],a[3],a[4],a[5]);g.drawImage(this.Rk[b],0,0);g.restore()},qL:function(a,b,c,d,e,f){var g=this.rg,i=0,j=0,l=0,m=0,n=this.sa.xq;d&&(1==d?j=n:-1==d&&(i=n));e&&(-1==e?l=n:1==e&&(m=n));d=this.sa.jn;l=this.Wn(a.pb,b,c,-i,d+l,f);if(!l)return q;i=this.Wn(a.qb,b,c,-d-i,-d-m,f);if(!i)return q;c=this.Wn(a.rb,b,c,d+j,-m,f);if(!c)return q;c={pb:l,qb:i,rb:c};f=c.pb;j=c.qb;m=c.rb;g.save();g.beginPath();g.moveTo(f.x,f.y);g.lineTo(j.x,j.y);g.lineTo(m.x,m.y);g.closePath(); g.clip();a=this.Hk(a,c);g.transform(a[0],a[1],a[2],a[3],a[4],a[5]);g.drawImage(this.Rk[b],0,0);g.restore()},PW:function(){this.Kt=q;this.P.Jk()},Ay:function(){this.Kt=o;this.refresh();this.P.kz()},ni:function(a){if(this.Kt&&!this.jm){var b=this.sa;b.pitch=a.pitch/180*Math.PI-b.Es/180*Math.PI;b.heading=(a.heading+b.Pf)/180*Math.PI;b.heading>2*Math.PI?b.heading-=2*Math.PI:0>b.heading&&(b.heading+=2*Math.PI);a=b.dd;this.rg.clearRect(0,0,b.a,b.bb);var c=b.bound,d=c.Pu,e=c.Ys,f=c.Tt,c=c.ju,c=c>f?c-f:64+ c-f,g=b.$p,i=b.uq,j=Math.cos(b.pitch),l=Math.cos(b.heading),m=Math.sin(b.heading),n=b.Ca*Math.sin(b.pitch),s=b.Ca*j*m;b.Kq=-b.Ca*j*l;b.Lq=n;b.Mq=s;b.Gs=l;b.yu=m;for(j=0;js&&(s+=64);var m=Math.floor(s/g),n=Math.floor(l/g),s=s%g,u=l%g,w={pb:{x:s*a,y:u*a-i},qb:{x:s*a-i,y:u*a+a+i},rb:{x:s*a+a+i,y:u*a+a}},y={pb:{x:s*a-i,y:u*a},qb:{x:s*a+a+i,y:u*a-i},rb:{x:s*a+a,y:u*a+a+i}};if(0==s)var D=-1;else s==g-1&&(D=1);if(0==u)var C=-1;else u==g-1&&(C=1);this.CD(w,m,n,b.zoom, D,C);this.DD(y,m,n,b.zoom,D,C)}}},refresh:function(){if(this.Kt&&!this.jm){var a=this.sa,b=a.dd;this.rg.clearRect(0,0,a.a,a.bb);var c=this.gE(),d=c.Pu,e=c.Ys,f=c.Tt,c=c.ju,c=c>f?c-f:64+c-f,g=a.$p,i=Math.cos(a.pitch),j=Math.cos(a.heading),l=Math.sin(a.heading),m=a.Ca*Math.sin(a.pitch),n=a.Ca*i*l;a.Kq=-a.Ca*i*j;a.Lq=m;a.Mq=n;a.Gs=j;a.yu=l;i=a.uq;for(j=0;js&&(s+=64);var m=Math.floor(s/g),n=Math.floor(l/g),s=s%g,u=l%g,w={pb:{x:s*b,y:u*b-i},qb:{x:s*b-i,y:u* b+b+i},rb:{x:s*b+b+i,y:u*b+b}},y={pb:{x:s*b-i,y:u*b},qb:{x:s*b+b+i,y:u*b-i},rb:{x:s*b+b,y:u*b+b+i}};if(0==s)var D=-1;else s==g-1&&(D=1);if(0==u)var C=-1;else u==g-1&&(C=1);this.CD(w,m,n,a.zoom,D,C);this.DD(y,m,n,a.zoom,D,C)}}},jS:function(){var a=this.sa;this.rg.clearRect(0,0,a.a,a.bb);var b=a.uq,c=Math.cos(a.pitch),d=Math.cos(a.heading),e=Math.sin(a.heading),f=a.Ca*Math.sin(a.pitch),g=a.Ca*c*e;a.Kq=-a.Ca*c*d;a.Lq=f;a.Mq=g;a.Gs=d;a.yu=e;for(a=0;16>a;a++)for(c=0;16>c;c++){d={pb:{x:32*a,y:32*c-b},qb:{x:32* a-b,y:32*c+32+b},rb:{x:32*a+32+b,y:32*c+32}};e={pb:{x:32*a-b,y:32*c},qb:{x:32*a+32+b,y:32*c-b},rb:{x:32*a+32,y:32*c+32+b}};if(0==a)var i=-1;else 15==a&&(i=1);if(0==c)var j=-1;else 15==c&&(j=1);this.qL(d,0,2,i,j);this.rL(e,0,2,i,j);this.qL(d,1,2,i,j);this.rL(e,1,2,i,j)}},jE:function(a,b){var c=this.sa,d=a-c.a/2,e=c.bb/2-b,f=c.pitch+c.Es/180*Math.PI,g=c.heading-c.Pf/180*Math.PI,i=-c.Ca*Math.cos(f)*Math.cos(g),j=c.Ca*Math.sin(f),l=c.Ca*Math.cos(f)*Math.sin(g),m=d*Math.sin(g),d=d*Math.cos(g),n=e*Math.sin(f)* Math.cos(g),e=e*Math.cos(f),i=i+m+n,j=j+e,e=l+d+-e*Math.sin(f)*Math.sin(g),f=this.Fa(i,j,e);if(22*Math.PI?b.heading-=2*Math.PI:0>b.heading&&(b.heading+=2*Math.PI),b.pitch=a.pitch/180*Math.PI-b.Es/180*Math.PI);var c=Math.cos(b.pitch),d=Math.sin(b.pitch),e=Math.cos(b.heading),f=Math.sin(b.heading), a=-b.Ca*c*e,g=b.Ca*d,i=b.Ca*c*f,j=b.bb/2*d*e,l=b.bb/2*c,m=-b.bb/2*d*f,n=-b.bb/2*d*e,c=-b.bb/2*c,d=b.bb/2*d*f,s=-b.a/2*f,u=-b.a/2*e,f=b.a/2*f,e=b.a/2*e;if(0Math.PI/2?(A=0,y=y.pitchF.pitch? A.pitch:F.pitch,A=Math.floor(32*(Math.PI/2-y)/Math.PI),y=32):0D.pitch?D.pitch:y.pitch,y=Math.ceil(32*(Math.PI/2-y)/Math.PI)):(y=A.pitch>F.pitch?A.pitch:F.pitch,A=Math.floor(32*(Math.PI/2-y)/Math.PI),y=Math.ceil(32*(Math.PI/2-b.pitch+a)/Math.PI));Math.abs(b.pitch)>=Math.PI/2-a?(C=0,w=64):0w.heading?Math.ceil(32*(2*b.heading-w.heading)/Math.PI):Math.ceil(32*(2*b.heading+2*Math.PI- w.heading)/Math.PI)):(w=Math.ceil(32*C.heading/Math.PI),C=b.heading>C.heading?Math.floor(32*(2*b.heading-2*Math.PI-C.heading)/Math.PI):Math.floor(32*(2*b.heading-C.heading)/Math.PI));0>C&&(C+=64);64A&&(A=0);b.bound={Pu:A,Ys:y,Tt:C,ju:w};return{Pu:A,Ys:y,Tt:C,ju:w}},CD:function(a,b,c,d,e,f){if(2==this.Bi[b][c].Am){var g=this.rg,i=0,j=0,l=0,m=0,n=this.sa.xq;e&&(1==e?j=n:-1==e&&(i=n));f&&(-1==f?l=n:1==f&&(m=n));e=this.sa.jn;l=this.jg(a.pb,b,c,d,0,-i,e,l);if(!l)return q;i=this.jg(a.qb, b,c,d,-e,-i,-e,-m);if(!i)return q;d=this.jg(a.rb,b,c,d,e,j,0,-m);if(!d)return q;d={pb:l,qb:i,rb:d};j=d.pb;m=d.qb;i=d.rb;g.save();g.beginPath();g.moveTo(j.x,j.y);g.lineTo(m.x,m.y);g.lineTo(i.x,i.y);g.closePath();g.clip();a=this.Hk(a,d);g.transform(a[0],a[1],a[2],a[3],a[4],a[5]);g.drawImage(this.Bi[b][c].ye,0,0)}else{g=this.rg;m=l=j=i=0;n=0.0078125;e&&(1==e?j=n:-1==e&&(i=n));f&&(-1==f?l=n:1==f&&(m=n));e=0.0078125;l=this.jg(a.pb,b,c,d,0,-i,e,l);if(!l)return q;i=this.jg(a.qb,b,c,d,-e,-i,-e,-m);if(!i)return q; d=this.jg(a.rb,b,c,d,e,j,0,-m);if(!d)return q;d={pb:l,qb:i,rb:d};j=d.pb;m=d.qb;i=d.rb;g.save();g.beginPath();g.moveTo(j.x,j.y);g.lineTo(m.x,m.y);g.lineTo(i.x,i.y);g.closePath();g.clip();j=a.pb;m=a.qb;i=a.rb;l=this.sa.nn;e=512*b;c*=512;b>=l?(a.pb={x:(e+j.x)/l-512,y:(c+j.y)/l},a.qb={x:(e+m.x)/l-512,y:(c+m.y)/l},a.rb={x:(e+i.x)/l-512,y:(c+i.y)/l},a=this.Hk(a,d),g.transform(a[0],a[1],a[2],a[3],a[4],a[5]),g.drawImage(this.Rk[1],0,0)):(a.pb={x:(e+j.x)/l,y:(c+j.y)/l},a.qb={x:(e+m.x)/l,y:(c+m.y)/l},a.rb= {x:(e+i.x)/l,y:(c+i.y)/l},a=this.Hk(a,d),g.transform(a[0],a[1],a[2],a[3],a[4],a[5]),g.drawImage(this.Rk[0],0,0))}g.restore()},DD:function(a,b,c,d,e,f){if(2==this.Bi[b][c].Am){var g=this.rg,i=0,j=0,l=0,m=0,n=this.sa.xq;e&&(1==e?j=n:-1==e&&(i=n));f&&(-1==f?l=n:1==f&&(m=n));e=this.sa.jn;i=this.jg(a.pb,b,c,d,-e,-i,0,l);if(!i)return q;l=this.jg(a.qb,b,c,d,e,j,e,l);if(!l)return q;d=this.jg(a.rb,b,c,d,0,j,-e,-m);if(!d)return q;d={pb:i,qb:l,rb:d};j=d.pb;m=d.qb;l=d.rb;g.save();g.beginPath();g.moveTo(j.x,j.y); g.lineTo(m.x,m.y);g.lineTo(l.x,l.y);g.closePath();g.clip();a=this.Hk(a,d);g.transform(a[0],a[1],a[2],a[3],a[4],a[5]);g.drawImage(this.Bi[b][c].ye,0,0)}else{g=this.rg;m=l=j=i=0;n=0.0078125;e&&(1==e?j=n:-1==e&&(i=n));f&&(-1==f?l=n:1==f&&(m=n));e=0.0078125;i=this.jg(a.pb,b,c,d,-e,-i,0,l);if(!i)return q;l=this.jg(a.qb,b,c,d,e,j,e,l);if(!l)return q;d=this.jg(a.rb,b,c,d,0,j,-e,-m);if(!d)return q;d={pb:i,qb:l,rb:d};j=d.pb;m=d.qb;l=d.rb;g.save();g.beginPath();g.moveTo(j.x,j.y);g.lineTo(m.x,m.y);g.lineTo(l.x, l.y);g.closePath();g.clip();j=a.pb;m=a.qb;l=a.rb;i=this.sa.nn;e=512*b;c*=512;b>=i?(a.pb={x:(e+j.x)/i-512,y:(c+j.y)/i},a.qb={x:(e+m.x)/i-512,y:(c+m.y)/i},a.rb={x:(e+l.x)/i-512,y:(c+l.y)/i},a=this.Hk(a,d),g.transform(a[0],a[1],a[2],a[3],a[4],a[5]),g.drawImage(this.Rk[1],0,0)):(a.pb={x:(e+j.x)/i,y:(c+j.y)/i},a.qb={x:(e+m.x)/i,y:(c+m.y)/i},a.rb={x:(e+l.x)/i,y:(c+l.y)/i},a=this.Hk(a,d),g.transform(a[0],a[1],a[2],a[3],a[4],a[5]),g.drawImage(this.Rk[0],0,0))}g.restore()},jg:function(a,b,c,d,e,f,g,i){d=this.sa; b=2*(1/d.gu*a.x/512+b/d.gu)*Math.PI;c=(0.5-1/d.nn*a.y/512-c/d.nn)*Math.PI;a=Math.sin(Math.abs(c));0.4>a?a=0.4:0.98m)return q;j=j*j/m;a=j*a-f;c=j*c-g;l=j*l-i;m=Math.pow(a,2)+Math.pow(c,2)+Math.pow(l,2);j=Math.sqrt(m);0==m?e=b=0:(m=(a*e+l*b)/j,1m&&(m=-1),m=Math.acos(m),0>a*b*g+c*e*i-c*b*f-l*g*e&&(m=2*Math.PI-m),b=j*Math.cos(m),e= j*Math.sin(m));return{x:d.a/2+b,y:d.bb/2-e}},mY:function(a){var b=this.P.ia();if(b){var c=this.sa,d=c.heading,e=c.Ca,f=c.pitch+c.Es/180*Math.PI,d=d-c.Pf/180*Math.PI,g=6378137*-(a.lat-b.lat)/180*Math.PI,i=6378137*(a.lng-b.lng)/180*Math.PI,a=Math.sqrt(Math.pow(g,2)+Math.pow(i,2)),j=Math.cos(f),b=Math.cos(d),d=Math.sin(d),l=-e*j*b,f=e*Math.sin(f),j=e*j*d,m=l*g+-2.08*f+i*j;if(0>m)return q;var m=e*e/m,g=m*g-l,e=-2.08*m-f,m=m*i-j,n=Math.pow(g,2)+Math.pow(e,2)+Math.pow(m,2),i=Math.sqrt(n);0==n?d=b=0:(n= (g*d+m*b)/i,1n&&(n=-1),n=Math.acos(n),0>g*b*f+e*d*j-e*b*l-m*f*d&&(n=2*Math.PI-n),b=i*Math.cos(n),d=i*Math.sin(n));return{x:c.a/2+b,y:c.bb/2-d,Ca:a}}return q},Fa:function(a,b,c){var d=Math.pow(a,2),e=Math.pow(c,2);return{heading:0e&&(i-=c);j=Math.round(f/2-j%m/g);var u,w;this.LB&&(u=this.LB+this.lJ,w=Math.round(s-u%m/g),u=Math.floor(u/m));u&&0>u&&(w-=c);m=d-Math.ceil(j/c);s=d+Math.ceil((f-j-c)/c);m=0>m?0:m;var s=s>l-1?l-1:s,y=e+Math.ceil((n-i-c)/c);l=[];for(var D={},c=e-Math.ceil(i/c);c<=y;c++)for(var C=m;C<=s;C++)l.push([c,C]),D[this.$q(this.ea.id,c,C,b)]=o;for(F in this.Zg)if(!D[F]&& !this.Go[F]&&(c=this.Zg[F]))c.style.display="none";this.Xv+=l.length;l.sort(function(a){return function(b,c){return 0.4*Math.abs(b[0]-a[0])+0.6*Math.abs(b[1]-a[1])-(0.4*Math.abs(c[0]-a[0])+0.6*Math.abs(c[1]-a[1]))}}([e,d]));for(c=0;ca-d[0]?(c.style.left=a+"px",m.style.left=parseInt(c.style.left)-d[0]+"px"):0<=a-d[0]?(m.style.left=a-d[0]+"px",c.style.left=parseInt(m.style.left)-d[0]+"px"):a+d[0]a+d[0]?(m.style.left=a+d[0]+"px",c.style.left=parseInt(m.style.left)+d[0]+"px"):(c.style.left=a+"px",m.style.left=a+d[0]+"px")},eV:function(a,b,c,d,e,f,g,i,j){var l=this.ea.tiles,m=this.$g,n=l.Bp(c),s=this.Go[this.$q(this.Rl,a,b,c)];s&&(s=s.style,s.top=Math.round((b-e)*m+g)+"px",s.left=Math.round((a-(i||d))*m+(j||f))+"px",s.width=s.height=Math.ceil(m)+"px");var i=this.$q(this.ea.id,a,b,c),u=this.Zg[i];if(u)l=u.style,l.top=Math.round((b- e)*m+g)+"px",l.left=Math.round((a-d)*m+f)+"px",l.width=l.height=Math.ceil(m)+"px",l.zIndex="2",l.display="",this.zf(),u.jC.x=a,u.jC.y=b;else{u=this.YA.Px();u.setAttribute("errorCount",0);for(j=a;0>j;)j=n+j;var w=l.getTilesUrl(this.ea.id,new R((j+n)%n,b),c),y=this;u.onload=function(){y.zf();y.ci.appendChild(this);u.style.opacity="1"};u.onerror=function(){var a=this,b=a.getAttribute("errorCount");if(b<3){b++;setTimeout(function(){a.src=w},100);a.setAttribute("errorCount",b)}else y.zf()};l=u.style;l.position= "absolute";l.zIndex="2";l.border="none";l.display="";l.WebkitUserSelect="none";l.WebkitUserDrag="none";l.width=l.height=Math.ceil(m)+"px";l.top=Math.round((b-e)*m+g)+"px";l.left=Math.round((a-d)*m+f)+"px";l.opacity="0";l.hc=l.WebkitTransition="opacity 300ms ease-out";u.src=w;0(new Date).valueOf()-b.sF&&(b.zy&&b.P.k.visible)&&b.click();b.sF=0});x.M(a,"mousemove",function(a){b.v_(a.offsetX||a.layerX||0,a.offsetY||a.layerY||0);b.J_(a.offsetX|| a.layerX||0,a.offsetY||a.layerY||0)});x.da.Te?x.M(a,"mouseout",function(a){var c=a.clientX||a.pageX||0,a=a.clientY||a.pageY||0,c=c-b.dJ,a=a-b.eJ;(40>Math.abs(Math.abs(c-b.uv/2)-b.uv/2)||40>Math.abs(Math.abs(a-b.vv/2)-b.vv/2))&&b.GD.setAttribute("visibility","hidden")}):x.M(a,"mouseout",function(){b.GD.setAttribute("visibility","hidden")});b.P.addEventListener("hide_ellipse",function(){b.Xt=o});b.P.addEventListener("show_ellipse",function(){b.Xt=q})},rA:function(){var a=H("canvas"),b=this.P,c=b.Ga().clientWidth, d=b.Ga().clientHeight;this.Xa=a;a.width=c;a.height=d;var e=a.style;e.position="absolute";e.top=e.left="0";e.width=c+"px";e.height=d+"px";e.F1="rgba(0, 0, 0, 0)";b.ck.appendChild(a);return a},LR:function(){var a=this.P.Ga(),b=a.clientWidth,a=a.clientHeight;return Db(this.P.ck,[\'\',""].join(""))},ca:function(){var a= this,b=a.P;b.addEventListener("size_changed",function(b){b=b.size;a.Ce(b.width,b.height);a.Ud={}});b.addEventListener("zoom_changed_inner",function(){a.Ud={}})},Ce:function(a,b){if(Pb())this.IJ(a,b);else if(Qb()){var c=this.Xa;c.width=a;c.height=b;c.style.width=a+"px";c.style.height=b+"px"}},IJ:function(a,b){this.hf&&(this.hf.setAttribute("width",a+"px"),this.hf.setAttribute("height",b+"px"),this.hf.setAttribute("viewBox","0 0 "+a+" "+b),this.uv=a,this.vv=b)},setData:da("ea"),va:function(a,b,c,d){if(this.ea){this.Ea= a;this.Kc=b;this.$g=c;var e=(a.heading+360)%360,a=a.pitch,f=this.P,g=this.ea.tiles,i,j,l;this.Ud[this.ea.id]?(c=this.Ud[this.ea.id],i=c.UC,j=c.TC,c=c.gi):(i=f.Ga().clientWidth,j=f.Ga().clientHeight,l=g.Bp(b),b=g.dy(b),c=360/(l*c),this.Ud[this.ea.id]={UC:i,TC:j,kP:l,mP:b,iL:360/l,gi:c});f=f.ga()+1;f=0.75*j+1*(a/c)/f;fa- -30?g+Math.tan(Tb(a- -30)):g+ 6),g=-Math.sin(Tb(Math.min(a,-30)))/g,this.Gw.coordorigin=Math.round(-i/2)+","+Math.round(-f+40),this.XR(l,b,g))}}else Pb()?this.nJ(p,[]):(this.Mh.clearRect(0,0,this.Xa.width,this.Xa.height),this.ro.length=0)},nJ:function(a,b){if(a!=this.Ya){this.Ya=a;linksCount=b.length;if(linksCount>this.ag.length){for(var c=linksCount-this.ag.length,d=this.hf,e=0;eMath.abs(a-this.ro[c][0])&&30>Math.abs(b-this.ro[c][1]))return c;return-1},qU:function(a,b){if(a!=this.Ya){this.Ya=a;linksCount=b.length;if(linksCount> this.ag.length)for(var c=linksCount-this.ag.length,d=0;d\'].join("")); this.Uq.push(g);this.xH.push(g.getElementsByTagName("skew")[0]);g=Db(this.Gw,["\'].join(""));this.ag.push(g);this.yH.push(g.getElementsByTagName("skew")[0]); e=[];f=hk;for(g=0;g\',\'\'].join("")),i=this;x.M(g,"click",function(a){(a=a.srcElement.sid)&&i.P.rc(a)});this.yl.push(g);this.zI.push(g.getElementsByTagName("skew")[0])}for(d= 0;dc?360+c-b[f].dir:360-c+b[f].dir:Math.abs(e),ed&&(b=this.P.ia(),this.P.ta(new O(b.lng+180*a.iH/Math.PI/6378137,b.lat-180*a.hH/Math.PI/6378137)))}}},u_:function(a,b){this.fX=a;this.oL=b},v_:da("BZ"),J_:function(a,b){this.ZK=coord=this.P.sa.jE(a,b);var c= this.GD;if(coord&&!this.Xt&&this.P.k.visible){c.setAttribute("cx",a);c.setAttribute("cy",b);var d=Math.abs(2*coord.RF/(coord.Ca-2)-2*coord.RF/(coord.Ca+2))/2,e=2*coord.RF/coord.Ca;if(4e&&(d=e)}c.setAttribute("rx",e);c.setAttribute("ry",d);c.setAttribute("visibility","visible");this.zy=o}else this.zy=q,c.setAttribute("visibility","hidden")}else this.zy=q,c.setAttribute("visibility","hidden")},XX:function(a,b){var c=0;0a?c=180*(Math.atan(b/a)/Math.PI)+180:0==a&&(c=0heading&&(heading+=360);return heading},U:function(){this.bk=q;this.P.ck&&(this.P.ck.style.visibility="hidden")},show:function(){this.bk=o;this.P.ck&&(this.P.ck.style.visibility="visible")},JD:function(){this.mo=o},mD:function(){this.mo=q}});var jk={get:function(a,b){var c="inst_"+b;jk[c]||(jk[c]=new kk(a));return jk[c]}};function kk(a){this.ib=a;this.jv=new Uint8Array(16);this.qr=new Uint8Array(16)}x.extend(kk.prototype,{NE:function(){for(var a=0,b=this.jv.length;a0){c=1/Math.sqrt(c);a[0]=b[0]*c;a[1]=b[1]*c}return a};qk.Xs=function(a,b){return a[0]*b[0]+a[1]*b[1]};qk.sx=function(a,b,c){b=b[0]*c[1]-b[1]*c[0];a[0]=a[1]=0;a[2]=b;return a}; qk.vy=function(a,b,c,d){var e=b[0],b=b[1];a[0]=e+d*(c[0]-e);a[1]=b+d*(c[1]-b);return a};qk.random=function(a,b){var b=b||1,c=nk()*2*Math.PI;a[0]=Math.cos(c)*b;a[1]=Math.sin(c)*b;return a};qk.J5=function(a,b,c){var d=b[0],b=b[1];a[0]=c[0]*d+c[2]*b;a[1]=c[1]*d+c[3]*b;return a};qk.K5=function(a,b,c){var d=b[0],b=b[1];a[0]=c[0]*d+c[2]*b+c[4];a[1]=c[1]*d+c[3]*b+c[5];return a};qk.H0=function(a,b,c){var d=b[0],b=b[1];a[0]=c[0]*d+c[3]*b+c[6];a[1]=c[1]*d+c[4]*b+c[7];return a}; qk.oP=function(a,b,c){var d=b[0],b=b[1];a[0]=c[0]*d+c[4]*b+c[12];a[1]=c[1]*d+c[5]*b+c[13];return a};qk.forEach=function(){var a=qk.create();return function(b,c,d,e,f,g){c||(c=2);d||(d=0);for(e=e?Math.min(e*c+d,b.length):b.length;d0){c=1/Math.sqrt(c);a[0]=b[0]*c;a[1]=b[1]*c;a[2]=b[2]*c}return a};rk.Xs=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]};rk.sx=function(a,b,c){var d=b[0],e=b[1],b=b[2],f=c[0],g=c[1],c=c[2];a[0]=e*c-b*g;a[1]=b*f-d*c;a[2]=d*g-e*f;return a};rk.vy=function(a,b,c,d){var e=b[0],f=b[1],b=b[2];a[0]=e+d*(c[0]-e);a[1]=f+d*(c[1]-f);a[2]=b+d*(c[2]-b);return a}; rk.random=function(a,b){var b=b||1,c=nk()*2*Math.PI,d=nk()*2-1,e=Math.sqrt(1-d*d)*b;a[0]=Math.cos(c)*e;a[1]=Math.sin(c)*e;a[2]=d*b;return a};rk.oP=function(a,b,c){var d=b[0],e=b[1],b=b[2];a[0]=c[0]*d+c[4]*e+c[8]*b+c[12];a[1]=c[1]*d+c[5]*e+c[9]*b+c[13];a[2]=c[2]*d+c[6]*e+c[10]*b+c[14];return a};rk.H0=function(a,b,c){var d=b[0],e=b[1],b=b[2];a[0]=d*c[0]+e*c[3]+b*c[6];a[1]=d*c[1]+e*c[4]+b*c[7];a[2]=d*c[2]+e*c[5]+b*c[8];return a}; rk.J0=function(a,b,c){var d=b[0],e=b[1],f=b[2],b=c[0],g=c[1],i=c[2],c=c[3],j=c*d+g*f-i*e,l=c*e+i*d-b*f,m=c*f+b*e-g*d,d=-b*d-g*e-i*f;a[0]=j*c+d*-b+l*-i-m*-g;a[1]=l*c+d*-g+m*-b-j*-i;a[2]=m*c+d*-i+j*-g-l*-b;return a};rk.sO=function(a,b,c,d){var e=[],f=[];e[0]=b[0]-c[0];e[1]=b[1]-c[1];e[2]=b[2]-c[2];f[0]=e[0];f[1]=e[1]*Math.cos(d)-e[2]*Math.sin(d);f[2]=e[1]*Math.sin(d)+e[2]*Math.cos(d);a[0]=f[0]+c[0];a[1]=f[1]+c[1];a[2]=f[2]+c[2];return a}; rk.tO=function(a,b,c,d){var e=[],f=[];e[0]=b[0]-c[0];e[1]=b[1]-c[1];e[2]=b[2]-c[2];f[0]=e[2]*Math.sin(d)+e[0]*Math.cos(d);f[1]=e[1];f[2]=e[2]*Math.cos(d)-e[0]*Math.sin(d);a[0]=f[0]+c[0];a[1]=f[1]+c[1];a[2]=f[2]+c[2];return a};rk.uO=function(a,b,c,d){var e=[],f=[];e[0]=b[0]-c[0];e[1]=b[1]-c[1];e[2]=b[2]-c[2];f[0]=e[0]*Math.cos(d)-e[1]*Math.sin(d);f[1]=e[0]*Math.sin(d)+e[1]*Math.cos(d);f[2]=e[2];a[0]=f[0]+c[0];a[1]=f[1]+c[1];a[2]=f[2]+c[2];return a}; rk.forEach=function(){var a=rk.create();return function(b,c,d,e,f,g){c||(c=3);d||(d=0);for(e=e?Math.min(e*c+d,b.length):b.length;d0){c=1/Math.sqrt(c);a[0]=b[0]*c;a[1]=b[1]*c;a[2]=b[2]*c;a[3]=b[3]*c}return a};Xj.Xs=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};Xj.vy=function(a,b,c,d){var e=b[0],f=b[1],g=b[2],b=b[3];a[0]=e+d*(c[0]-e);a[1]=f+d*(c[1]-f);a[2]=g+d*(c[2]-g);a[3]=b+d*(c[3]-b);return a};Xj.random=function(a,b){b=b||1;a[0]=nk();a[1]=nk();a[2]=nk();a[3]=nk();Xj.normalize(a,a);Xj.scale(a,a,b);return a}; Xj.oP=function(a,b,c){var d=b[0],e=b[1],f=b[2],b=b[3];a[0]=c[0]*d+c[4]*e+c[8]*f+c[12]*b;a[1]=c[1]*d+c[5]*e+c[9]*f+c[13]*b;a[2]=c[2]*d+c[6]*e+c[10]*f+c[14]*b;a[3]=c[3]*d+c[7]*e+c[11]*f+c[15]*b;return a};Xj.J0=function(a,b,c){var d=b[0],e=b[1],f=b[2],b=c[0],g=c[1],i=c[2],c=c[3],j=c*d+g*f-i*e,l=c*e+i*d-b*f,m=c*f+b*e-g*d,d=-b*d-g*e-i*f;a[0]=j*c+d*-b+l*-i-m*-g;a[1]=l*c+d*-g+m*-b-j*-i;a[2]=m*c+d*-i+j*-g-l*-b;return a}; Xj.forEach=function(){var a=Xj.create();return function(b,c,d,e,f,g){c||(c=4);d||(d=0);for(e=e?Math.min(e*c+d,b.length):b.length;d0.999999){d[0]=0;d[1]=0;d[2]=0;d[3]=1;return d}rk.sx(a,e,f);d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=1+g;return vk.normalize(d,d)}}(); vk.m5=function(){var a=uk.create();return function(b,c,d,e){a[0]=d[0];a[3]=d[1];a[6]=d[2];a[1]=e[0];a[4]=e[1];a[7]=e[2];a[2]=-c[0];a[5]=-c[1];a[8]=-c[2];return vk.normalize(b,vk.AX(b,a))}}();vk.ji=Xj.ji;vk.tg=Xj.tg;vk.copy=Xj.copy;vk.set=Xj.set;vk.Wm=function(a){a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};vk.D_=function(a,b){var c=Math.PI,c=c*0.5,d=Math.sin(c);a[0]=d*b[0];a[1]=d*b[1];a[2]=d*b[2];a[3]=Math.cos(c)};vk.add=Xj.add; vk.multiply=function(a,b,c){var d=b[0],e=b[1],f=b[2],b=b[3],g=c[0],i=c[1],j=c[2],c=c[3];a[0]=d*c+b*g+e*j-f*i;a[1]=e*c+b*i+f*g-d*j;a[2]=f*c+b*j+d*i-e*g;a[3]=b*c-d*g-e*i-f*j;return a};vk.gn=vk.multiply;vk.scale=Xj.scale;vk.sO=function(a,b,c){var c=c*0.5,d=b[0],e=b[1],f=b[2],b=b[3],g=Math.sin(c),c=Math.cos(c);a[0]=d*c+b*g;a[1]=e*c+f*g;a[2]=f*c-e*g;a[3]=b*c-d*g;return a}; vk.tO=function(a,b,c){var c=c*0.5,d=b[0],e=b[1],f=b[2],b=b[3],g=Math.sin(c),c=Math.cos(c);a[0]=d*c-f*g;a[1]=e*c+b*g;a[2]=f*c+d*g;a[3]=b*c-e*g;return a};vk.uO=function(a,b,c){var c=c*0.5,d=b[0],e=b[1],f=b[2],b=b[3],g=Math.sin(c),c=Math.cos(c);a[0]=d*c+e*g;a[1]=e*c-d*g;a[2]=f*c+b*g;a[3]=b*c-f*g;return a};vk.H2=function(a,b){var c=b[0],d=b[1],e=b[2];a[0]=c;a[1]=d;a[2]=e;a[3]=-Math.sqrt(Math.abs(1-c*c-d*d-e*e));return a};vk.Xs=Xj.Xs;vk.vy=Xj.vy; vk.v5=function(a,b,c,d){var e=b[0],f=b[1],g=b[2],b=b[3],i=c[0],j=c[1],l=c[2],c=c[3],m,n,s;n=e*i+f*j+g*l+b*c;if(n<0){n=-n;i=-i;j=-j;l=-l;c=-c}if(1-n>1.0E-6){m=Math.acos(n);s=Math.sin(m);n=Math.sin((1-d)*m)/s;d=Math.sin(d*m)/s}else n=1-d;a[0]=n*e+d*i;a[1]=n*f+d*j;a[2]=n*g+d*l;a[3]=n*b+d*c;return a};vk.Jp=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c*c+d*d+e*e+f*f,g=g?1/g:0;a[0]=-c*g;a[1]=-d*g;a[2]=-e*g;a[3]=f*g;return a};vk.N2=function(a,b){a[0]=-b[0];a[1]=-b[1];a[2]=-b[2];a[3]=b[3];return a}; vk.length=Xj.length;vk.hF=vk.length;vk.Zk=Xj.Zk;vk.lG=vk.Zk;vk.normalize=Xj.normalize;vk.AX=function(a,b){var c=b[0]+b[4]+b[8];if(c>0){c=Math.sqrt(c+1);a[3]=0.5*c;c=0.5/c;a[0]=(b[7]-b[5])*c;a[1]=(b[2]-b[6])*c;a[2]=(b[3]-b[1])*c}else{var d=0;b[4]>b[0]&&(d=1);b[8]>b[d*3+d]&&(d=2);var e=(d+1)%3,f=(d+2)%3,c=Math.sqrt(b[d*3+d]-b[e*3+e]-b[f*3+f]+1);a[d]=0.5*c;c=0.5/c;a[3]=(b[f*3+e]-b[e*3+f])*c;a[e]=(b[e*3+d]+b[d*3+e])*c;a[f]=(b[f*3+d]+b[d*3+f])*c}return a}; vk.Dn=function(a){return"quat("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"};"undefined"!==typeof exports&&(exports.c5=vk);function wk(a,b){this.Kf=a;this.Vq=b||2;this.fB=a-this.Vq;this.vc=[];this.Ng=[];this.PE()}x.extend(wk.prototype,{PE:function(){var a,b;this.vc.push(0,-20,0);for(ih=0;360>ih;ih+=6)a=Math.cos(Tb(ih))*this.Kf,b=Math.sin(Tb(ih))*this.Kf,this.vc.push(a,-20,b)},OE:function(){for(var a=(this.vc.length-3)/3,b=1;bc;c+=6)a=Math.cos(Tb(c))*this.fB,b=Math.sin(Tb(c))*this.fB,this.vc.push(a,-20,b);for(c=0;360>c;c+=6)a=Math.cos(Tb(c))*this.Kf,b=Math.sin(Tb(c))*this.Kf,this.vc.push(a,-20,b)},OE:function(){var a=this.vc.length/3/2;for(ih=0;ihj;j++)for(var l=Math.cos(Tb(5.625*j-90))*a,l=Math.round(100*l)/100,m=Math.sin(Tb(5.625*j-90))*a,m=Math.round(100*m)/100,f=Math.floor(j/c),n=0;64>n;n++){var s=Math.cos(Tb(5.625*n))*l,u=Math.sin(Tb(5.625*n))*l,s=Math.round(100*s)/100,u=Math.round(100*u)/100;b.push(s,m,u);g=Math.floor(n/c);i=g+f*d;fd&&(a=360-a):a=0this.hK?7:b>this.gK?6:b>this.fK?5:0-this.fK?3:b>-this.gK?2:b>-this.hK?1:0;b=Math.floor(a/22.5);return[b,c,b+c*(64/(64/this.Vd))]}});function Qj(a){this.P=a;this.oe=this.ib=this.Xa=this.cj=p;var b=this;this.vs=new Zj(6,{ap:function(a){for(var d=0;d=a;a++)this.zl[a]={cols:Math.pow(2,a-1),rows:Math.pow(2,a-1)/2};this.zl[1]={cols:1,rows:1}},Ui:function(){this.rA();this.ib=this.Xa.getContext("webgl",{alpha:q});this.Iw=jk.get(this.ib,this.P.ba);this.cB();this.XU();this.IA();this.JA();this.oU();this.Iw.NE()},rA:function(){var a=this.Xa=H("canvas"),b=this.Xa.style,c=this.P.C,d=c.clientWidth,c=c.clientHeight;b.width=d+"px";b.height=c+"px";this.dj=a.width=d*this.kg;this.Zj=a.height=c*this.kg; this.P.ci.appendChild(this.Xa)},XU:function(){var a=this.ib,b=this.Xa;a.clearColor(0,0,0,1);a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);a.disable(a.DEPTH_TEST);a.enable(a.BLEND);a.depthMask(o);a.viewport(0,0,b.width,b.height)},Sk:function(){var a=this.P.C,b=a.clientWidth,a=a.clientHeight;this.Xa.style.width=b+"px";this.Xa.style.height=a+"px";this.dj=this.Xa.width=b*this.kg;this.Zj=this.Xa.height=a*this.kg;this.rr=p;b=this.Xa;this.ib.viewport(0,0,b.width,b.height)},cB:function(){var a=this.ib,b= this.oe=a.createProgram(),c=this.Gl("attribute vec3 aVertexPosition;\\nattribute vec2 aVertexTextureCoordBack;\\nattribute vec2 aVertexTextureCoord;\\nvarying mediump vec2 vTextureCoordBack;\\nvarying mediump vec2 vTextureCoord;\\nuniform mat4 uMVMatrix;\\nuniform mat4 uPMatrix;\\nvoid main(void) {\\n gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);\\n vTextureCoordBack = aVertexTextureCoordBack;\\n vTextureCoord = aVertexTextureCoord;\\n}",a.VERTEX_SHADER),d=this.Gl("precision mediump float;\\nvarying vec2 vTextureCoordBack;\\nvarying vec2 vTextureCoord;\\nuniform sampler2D uSamplerBack;\\nuniform sampler2D uSampler;\\nuniform bool uDrawThumb;\\nuniform bool uDrawBack;\\nuniform float uAlpha;\\nvoid main(void) {\\n if (uDrawThumb) {\\n gl_FragColor = texture2D(uSamplerBack, vTextureCoordBack);\\n return;\\n }\\n if (uAlpha == 1.0) {\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n return;\\n }\\n if (uDrawBack) {\\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha + texture2D(uSamplerBack, vTextureCoordBack) * (1.0 - uAlpha);\\n } else {\\n vec4 textureColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\\n gl_FragColor = vec4(textureColor.rgb, textureColor.a * uAlpha);\\n }\\n}", a.FRAGMENT_SHADER);a.attachShader(b,c);a.attachShader(b,d);a.bindAttribLocation(b,0,"aVertexPosition");a.linkProgram(b)},Gl:function(a,b){var c=this.ib,d=c.createShader(b);c.shaderSource(d,a);c.compileShader(d);return d},oU:function(){var a=new yk(this.Kf),b=a.ZY();this.ns={SO:a,vX:b,uX:a.vc}},setData:function(a){a!==p&&(this.Rl=this.ea?this.ea.id:p,this.KB=this.ea||p);(this.ea=a)&&this.vs.setData(a.id,[])},va:function(a,b){if(this.ea){this.Ea=a;this.cf=b;var c=this.Xa;this.cj||(this.cj=this.P.ga()); this.rr||(this.rr=180/Math.pow(2,this.cj),this.vV=c.width/c.height,Yj.XZ(this.Wh,Tb(this.rr),this.vV),Yj.Jp(this.Rr,this.Wh));this.eA(0);c=this.KA(0);this.Cv[0]=c[0];this.ZA[0]=c[1];this.IT();this.os()}},eA:function(a){Yj.Wm(this.If[a]);Yj.rotate(this.If[a],this.If[a],Tb(this.Ea.pitch),[-1,0,0]);var b=this.ea.tiles.dirNorth;1==a&&this.KB&&(b=this.KB.tiles.dirNorth);Yj.rotate(this.If[a],this.If[a],Tb(b+this.Ea.heading+90),[0,1,0]);Yj.Jp(this.zB[a],this.If[a])},Yj:function(a,b,c){var d=this.dj,e=this.Zj, f=Xj.create(),g=this.Rr,c=this.zB[c],a=Xj.tg(2*a/d-1,1-2*b/e,-1,1);Yj.multiply(f,g,a);Yj.multiply(f,c,f);b=this.Kf;g=200*f[0];a=200*f[1];f=200*f[2];b=Math.sqrt(-(-b*b)/(g*g+a*a+f*f));return this.ns.SO.SX([g*b,a*b,f*b])},BI:function(a,b,c,d){var e=this.Zj,b=Xj.tg(a,b,c,1),a=Xj.create();Yj.multiply(a,this.If[d],b);b=Xj.tg(a[0],a[1],a[2],a[3]);Yj.multiply(a,this.Wh,b);if(0!==a[3])return d=(1-rk.tg(a[0]/a[3],a[1]/a[3],a[2]/a[3])[1])*e/2,0=this.$A&&a<=this.CI)&&(e=0,f=this.zl[this.cf].cols-1);for(;e<=f;e++)this.oJ(e,a)}},oJ:function(a,b,c,d){var c=c||this.cf,e=this.zl[c].cols,f=this.zl[c].rows,g=this,a=g.NB(a,c);0>b&&(a=g.NB(e-1-a,c),b=0);b>f-1&&(a=g.NB(e-1-a,c),b=f-1);var i=a+b*e,j=g.vs.getData(g.ea.id);j[c]||(j[c]=[]);j[c][i]||(j[c][i]={});var l=j[c][i];l.loaded?(g.LJ(c)&&g.RJ(),d&&d()):(l.index=i,l.loaded=q,l.RZ=g.ea.id,g.HT(a,b,c,function(a){if(l.RZ== g.ea.id){l.loaded=o;var b=j[c][i];if(!b.Ws){g.WU(b,a,c);if(c>1)b.im={duration:300,startTime:Date.now(),ZC:0,fp:1};b.Ws=o}g.LJ(c)&&g.RJ();d&&d();g.os()}}))},LJ:function(a){return 1===a&&this.Rl&&this.P.aK?o:q},FO:da("RT"),NB:function(a,b){for(var c=a,d=this.zl[b||this.cf].cols;0>c;)c+=d;return c%d},zf:function(){this.kC--;0===this.kC&&this.P.dispatchEvent(new N("ontilesloaded"))},os:function(){this.pv&&(clearTimeout(this.pv),this.pv=p);var a=this;this.pv=setTimeout(function(){cancelAnimationFrame(a.gw); a.gw=p;a.pv=p},300);this.gw||this.fw()},fw:function(){var a=this;a.gw=requestAnimationFrame(function(){a.fw()});var b=this.oe;this.ib.useProgram(b);var c=this.Iw;c.jp(b.Kn);c.jp(b.FP);c.jp(b.Ru);c.pD();b=q;this.Ug?this.tU():b=this.SB(0);if(b&&!this.Ug)for(b=0;bg?0:g);d=this.vs.getData(d);if(!d)return q;for(;g<=c;g++){var i=e,j=f;"number"===typeof this.qk&&(g>=this.qk&&g<=this.em)&&(i=0,j=this.Vd-1);for(;i<=j;i++){for(var l=i;0>l;)l+=this.Vd;var l=l%this.Vd,m=this.wl(l,g)[2],n=this.wl(l,g,this.Bo)[2],s=this.wl(l,g,1)[2],u=p,w=p,y=1;d[this.cf]&&(d[this.cf][m]&&d[this.cf][m].Ws)&&(u=m);d[this.Bo]&&d[this.Bo][n]&&d[this.Bo][n].Ws?(w=n,y=this.Bo):d[1][s]&&d[1][s].Ws&&(w=s);if(u===p&&w===p)return q; m=this.ib;n=this.oe;s=this.cf;this.Ug&&1==a?(m.uniform1i(n.tL,q),u===p&&(u=w,s=1),w=p):m.uniform1i(n.tL,o);this.AT(u,s,w,y,a);this.VU(l,g,s,y);this.YB(a);this.fS()}}return o},wl:function(a,b,c){var c=c||this.cf,d=Math.pow(2,5-c),a=Math.floor(a/d),b=Math.floor(b/d),b=this.zl[c].rows-b-1;return[a,b,a+b*this.Vd/d]},WU:function(a,b,c){if(a){var d=this.ib;1===c?d.activeTexture(d.TEXTURE0):d.activeTexture(d.TEXTURE1);a.vz=d.createTexture();d.bindTexture(d.TEXTURE_2D,a.vz);d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL, o);d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,b);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR)}},AT:function(a,b,c,d,e){var f=0==e?this.ea.id:this.Rl;if(f){var g=this.vs.getData(f),f=this.ib,i=this.oe;a===p?f.uniform1i(i.uL,o):f.uniform1i(i.uL,q);var j=p;g[d]&&g[d][c]&&(f.activeTexture(f.TEXTURE0), j=g[d][c].vz,f.bindTexture(f.TEXTURE_2D,j),f.uniform1i(i.s_,0));if("number"===typeof a){f.activeTexture(f.TEXTURE1);f.bindTexture(f.TEXTURE_2D,g[b][a].vz);f.uniform1i(i.t_,1);a=g[b][a];"number"!=typeof a.fp&&(a.fp=1);if(1==e&&(!a.im||0!=a.im.fp))a.im={duration:400,startTime:this.tw,ZC:1,fp:0},a.fp=0;a.im?(e=a.im,b=(Date.now()-e.startTime)/e.duration,0==e.ZC?(e=b,1e&&(e=0,a.im=p)),f.uniform1f(i.alpha,e)):f.uniform1f(i.alpha,a.fp)}}},VU:function(a,b,c,d){var e=this.jT(a, b),f=this.ns.vX,c=this.uI(a,b,c),a=this.uI(a,b,d),b=this.ib;this.Aw||(this.Aw=b.createBuffer());b.bindBuffer(b.ARRAY_BUFFER,this.Aw);b.bufferData(b.ARRAY_BUFFER,new Float32Array(e),b.STATIC_DRAW);this.Ko||(this.Ko=b.createBuffer(),this.Ko.BG=f.length,b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.Ko),b.bufferData(b.ELEMENT_ARRAY_BUFFER,new Uint16Array(f),b.STATIC_DRAW));this.oC||(this.oC=b.createBuffer());b.bindBuffer(b.ARRAY_BUFFER,this.oC);b.bufferData(b.ARRAY_BUFFER,new Float32Array(a),b.STATIC_DRAW); c&&(this.dm||(this.dm=b.createBuffer()),b.bindBuffer(b.ARRAY_BUFFER,this.dm),b.bufferData(b.ARRAY_BUFFER,new Float32Array(c),b.STATIC_DRAW))},fS:function(){var a=this.ib,b=this.oe;a.bindBuffer(a.ARRAY_BUFFER,this.Aw);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.Ko);a.vertexAttribPointer(b.Kn,3,a.FLOAT,q,0,0);a.bindBuffer(a.ARRAY_BUFFER,this.oC);a.vertexAttribPointer(b.FP,2,a.FLOAT,q,0,0);a.bindBuffer(a.ARRAY_BUFFER,this.dm);a.vertexAttribPointer(b.Ru,2,a.FLOAT,q,0,0);a.drawElements(a.TRIANGLES,this.Ko.BG, a.UNSIGNED_SHORT,0)},jT:function(a,b){return this.ns.uX[a+b*(64/(64/this.Vd))]},uI:function(a,b,c){return this.ns.SO.FX(c||this.cf,a,b)},IA:function(){var a=this.oe,b=this.ib;a.bu=b.getUniformLocation(a,"uPMatrix");a.Zt=b.getUniformLocation(a,"uMVMatrix");a.uL=b.getUniformLocation(a,"uDrawThumb");a.tL=b.getUniformLocation(a,"uDrawBack");a.alpha=b.getUniformLocation(a,"uAlpha");a.s_=b.getUniformLocation(a,"uSamplerBack");a.t_=b.getUniformLocation(a,"uSampler")},JA:function(){var a=this.oe,b=this.ib; a.Kn=b.getAttribLocation(a,"aVertexPosition");a.FP=b.getAttribLocation(a,"aVertexTextureCoordBack");a.Ru=b.getAttribLocation(a,"aVertexTextureCoord")},YB:function(a){var b=this.oe,c=this.ib;c.uniformMatrix4fv(b.bu,q,this.Wh);c.uniformMatrix4fv(b.Zt,q,this.If[a])},$q:function(a,b,c,d){return a+"_"+b+"_"+c+"_"+d},HT:function(a,b,c,d){var e=this.$q(this.ea.id,a,b,c),f=this.WJ.getData(e);this.kC++;if(f)f.Mr&&(d(f),this.zf());else{f=this.YA.Px();f.crossOrigin="anonymous";f.Mr=q;var g=this;f.onload=function(){-1!= this.src.indexOf("pos=0_0&z=1")&&g.P.dispatchEvent(new N("onthumbnail_complete"));d(this);g.zf();this.Mr=o};f.src=this.ea.tiles.getTilesUrl(this.ea.id,new R(a,b),c);this.WJ.setData(e,f)}},KA:function(a){var b=this.dj,c=this.Zj,d,e,f,g,i,j=this.Yj(0,0,a);d=j[0];g=j[1];j=this.Yj(b/2,0,a);j[1]>g&&(g=j[1]);j=this.Yj(b,0,a);e=j[0];ee&&(j[0]-=this.Vd);j[0]e&&(e=j[0]);j=this.Yj(0,c,a);j[0]>e&&(j[0]-= this.Vd);j[0]e&&(e=j[0]);b=j[1];this.BI(0,100,0,a)?(this.em=this.fs-1,this.qk=i):this.BI(0,-100,0,a)?(this.qk=0,this.em=b):this.CI=this.$A=this.em=this.qk=p;this.em!=p&&gthis.qk&&(f=this.qk);b=this.wl(d,g);c=this.wl(e,f);a=b[0];i=c[0];b=b[1];c=c[1];this.$A=this.wl(0,this.qk)[1];this.CI=this.wl(0,this.em)[1];return[[d,e,f,g],[a,i,b,c]]},BV:function(a){this.lg.push(a)}, RJ:function(){if(!this.Ug&&(this.eA(1),this.xB[0]=Yj.ji(this.If[0]),this.xB[1]=Yj.ji(this.If[1]),this.Cv[1]=this.KA(1)[0],this.Ug=o,this.xA=160,this.yA=120,"number"==typeof this.P.PH)){var a=Math.pow(this.P.PH,0.25);this.xA*=a;this.yA*=a}},hJ:function(){this.Ug=q;this.tw=this.Rl=p;this.eA(0);var a=this.KA(0);this.Cv[0]=a[0];this.ZA[0]=a[1];this.QI();this.os()},tU:function(){this.tw||(this.tw=Date.now());this.os();this.MR=Date.now();var a=this.MR-this.tw;if(400c)a.P.dispatchEvent(new N("onrefresh")),a.P.dispatchEvent(new N("onlongjumpcancel"));else{var d=a.ea.wh+Math.sin(Tb(b))* c,b=a.ea.xh+Math.cos(Tb(b))*c;a.P.dispatchEvent(new N("onrefresh"));a.P.dispatchEvent(new N("onlongjumpend"));d=new O(d,b);a.P.ta(a.Xd.rh(d),{rk:o})}}else d=a.P.Fa(),a.sV=1Math.abs(a[0]-d[0])&&12>Math.abs(c-d[1])?o:q},kI:function(a,b){if(!this.bk)return p;var c=this.ET[1],d=this.wr([a,b],c[1]);if(!d)return p;for(var e=0,f=this.ea.links.length;ee;)e+=360;var e=this.pS(e%360),f=this.ea.links[e].zh,g=Math.sin(Tb(f)),f=Math.cos(Tb(f)),i=-g*c[0]+f*c[2];if(100i)return 0;c=(f*c[0]+g*c[2])/9;if(3.6>c)return 0;g=this.ea.links[e];f=this.fR([this.ea.wh,0,this.ea.xh],[g.x,0,g.y]);this.Ho.FO(e);if(cd&&(d=-70);b[0]=c*f+a*d;b[2]=-a*f+c*d;this.eo[0]=b[0];this.eo[2]=b[2];b=f/9;return 300this.ea.links[c].dir&&(e=Math.abs(360+a-e),ethis.KH&&(c=0.2),this.or(this.EH.vc, this.EH.mE(),this.eo,1,c,q),this.or(this.yJ.vc,this.yJ.mE(),this.eo,1,c+0.3,q));if(!(this.xI||this.bk===q)){var c=a[0],f=a[1],g=a[2],i=a[3],j=a[4],l=a[5],a=a[6];b.blendFuncSeparate(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA,b.ONE,b.ONE_MINUS_SRC_ALPHA);b.activeTexture(b.TEXTURE2);b.useProgram(d);e.NE();e.jp(d.Kn);e.jp(d.Ru);e.pD();b.uniformMatrix4fv(d.bu,q,this.Wh);b.uniformMatrix4fv(d.Zt,q,this.yB);b.uniform1i(d.r_,2);this.Yn&&(b.bindTexture(b.TEXTURE_2D,this.Yn),this.or(c,i,p,1,1,o,j));this.$n&&(b.bindTexture(b.TEXTURE_2D, this.$n),this.or(f,i,p,1,1,o,j));this.Zn&&(b.bindTexture(b.TEXTURE_2D,this.Zn),this.or(g,l,p,1,1,o,a));b.depthMask(o)}}},pU:function(){for(var a=[],b=[],c=[],d=[],e=[],f=zk.length/3,g=this.P.Fa().heading+this.SR;0>g;)g+=360;var i=this.P.Fa().pitch,g=20,j=-30,l=this.Ho.cj||this.P.ga(),g=g+20*l;0>i&&(i=Math.abs(i),g*=(90-i)/90,j-=20*i/90);for(i=0;ie))return[c*e,d*e,j*e]}},Sk:function(){this.dj=this.Xa.width;this.Zj=this.Xa.height},HS:function(a){var b=Math.ceil(Math.floor((a+360)%360/22.5)/2);8===b&&(b=0);for(var a=Ck.slice(0),c=Math.floor(b/2),b=b%2,d=0;d