var ca="function"==typeof Object.defineProperties?Object.defineProperty:function(b,a,c){b!=Array.prototype&&b!=Object.prototype&&(b[a]=c.value)},da="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;function ia(b,a){if(a){var c=da;b=b.split(".");for(var f=0;f<b.length-1;f++){var h=b[f];h in c||(c[h]={});c=c[h]}b=b[b.length-1];f=c[b];a=a(f);a!=f&&null!=a&&ca(c,b,{configurable:!0,writable:!0,value:a})}}
ia("Array.prototype.findIndex",function(b){return b?b:function(a,b){a:{var c=this;c instanceof String&&(c=String(c));for(var h=c.length,g=0;g<h;g++)if(a.call(b,c[g],g,c)){a=g;break a}a=-1}return a}});function ja(){this.l={}}var ma;ma="undefined"!==typeof window?window:self;function ta(b){var a=ua;a.l[b]=a.C()}function va(b,a){var c=ua;return parseFloat((c.l[a]-c.l[b]).toFixed(2))}ja.prototype.C=ma.performance&&ma.performance.now?function(){return performance.now()}:function(){return Date.now()};
var wa,Ca,Da,Ea,Fa,Ja,B,Ka,La,Ma,Na,Oa,Pa,Qa,Ya,Za,$a,ab;ArrayBuffer.prototype.slice||(ArrayBuffer.prototype.slice=function(b,a){void 0===b&&(b=0);void 0===a&&(a=this.byteLength);b=Math.floor(b);a=Math.floor(a);0>b&&(b+=this.byteLength);0>a&&(a+=this.byteLength);b=Math.min(Math.max(0,b),this.byteLength);a=Math.min(Math.max(0,a),this.byteLength);if(0>=a-b)return new ArrayBuffer(0);var c=new ArrayBuffer(a-b),f=new Uint8Array(c);b=new Uint8Array(this,b,a-b);f.set(b);return c});
function bb(b,a){var c=b.length;a=a||2;ab||(ab=B._get_feature_points_address()>>2);Da.set(b,ab);B._parse_points(c,a);return new Float32Array(wa.slice(ab<<2,ab+c<<2))}function cb(){return B._get_block_vertex_count()}function db(){Pa||(Pa=B._get_line_vertex_start());return new Float32Array(wa.slice(Pa,B._get_line_vertex_end()))}function fb(){Oa||(Oa=B._get_line_index_start());return new Uint16Array(wa.slice(Oa,B._get_line_index_end()))}function nb(){return B._get_line_vertex_count()}
function ob(b,a,c,f,h,g,d,r,y,m,k){var t=0;f&&(t=f.length,La||(La=B._get_line_altitudes_address()>>1),Fa.set(f,La));r&&r.length&&(Na||(Na=B._get_line_turnings_address()),Ca.set(r,Na));h=h||0;m=m||0;k=k||d.length/2;Ka||(Ka=B._get_line_data_address()>>1);Fa.set(b,Ka);Ma||(Ma=B._get_line_points_address()>>2);Ea.set(d,Ma);B._append_line_data(b.length,a[0],a[1],a[2],a[3],c,t,h,g?1:0,d.length,y,m,k)}function pb(){B._reset_line()}
function qb(b){if(wa)b&&b();else{var a=rb();var c=new WebAssembly.Memory({initial:70,maximum:70});WebAssembly.instantiate(a,{env:{DYNAMICTOP_PTR:0,tempDoublePtr:0,ABORT:0,STACKTOP:0,STACK_MAX:0,gb:0,fb:0,memory:c},global:{NaN:NaN,Infinity:Infinity}}).then(function(a){wa=c.buffer;Da=new Float32Array(wa);Ea=new Int32Array(wa);Ca=new Int8Array(wa);Fa=new Int16Array(wa);Ja=new Uint16Array(wa);B=a.instance.exports;b&&b()})}}
function sb(b,a,c,f,h){var g={fixedLabel:[],lineLabel:[]};if(!b)return g;var d=[];if(a&&a.length)for(var r=0;r<a.length;r++){var y=a[r],m=y[0]/4;J[m+1]===tb&&d.push(S(J[m]+1,y[0],y[0]+y[1]))}a=S(0,c[0],c[0]+c[1])||[];f=f.height;g.fixedLabel=ub(b,d,f,h,void 0);d=[];for(c=0;c<a.length;c++){var k=b,t=a[c];r=h;y=f;m=d;var e=t[0]/4,l=S(J[e]+1,t[0],t[0]+t[1]),A=S(0,l[6][0],l[6][0]+l[6][1]);t=[];for(var z=0;z<A.length;z++)t[z]=new Uint16Array(k,A[z][0],A[z][1]/2);A=vb;var p=Math.pow(2,18-r.zoom),n=r.col*
r.baseTileSize*p,v=r.row*r.baseTileSize*p,w=new Uint16Array(k,l[4][0],l[4][1]/2),H=w.length,x=wb[e+1],u=xb.b(yb,x,"pointText",r.useZoom,zb,!1,W);e=wb[e+2];var K=Ab(k,l[0][0],l[0][1],"utf-8"),D=t.length||K.split("").length;if(0!==D){var q=new Int32Array(k,l[1][0],l[1][1]/4),C=new Int16Array(k,l[5][0],l[5][1]/2),F=[C[0]],X=Array.prototype.slice.call(q.slice(0,2)),O=2;for(z=1;O<q.length;O+=2,z++)X[O]=X[O-2]+q[O],X[O+1]=X[O-1]+q[O+1],1===C.length?F[z]=C[0]:1<C.length&&(F[z]=F[z-1]+C[z]);var L=new Uint16Array(k,
l[3][0],l[3][1]/2);k=new Uint16Array(k,l[2][0],l[2][1]/2);for(z=0;z<H;z++)if(l=w[z],Bb(l,r.useZoom)){if(r.processedLabelZooms&&r.processedLabelZooms.length&&!W){q=r.processedLabelZooms;var M=!1;for(O=0;O<q.length;O++)if(Bb(l,q[O])){M=!0;break}if(M)continue}O=L[z];q=z*D*2;q=X.slice(q,q+2*D);var Y=M=1E3,T=-1E3,V=-1E3,U=t.slice(0);O&&U.reverse();for(var aa,Z,Q,N=[],I=0;I<D;I++){var ba=k[D*z+I],R=q[2*I]/100,P=q[2*I+1]/100,G=0;0<C.length&&(G=F[z*D]/100);0===I&&(aa=R,Z=P,Q={lng:n+aa,lat:v+Z});R=(R-aa)/
p;P=(P-Z)/p;var E=U[I],fa=null,oa=null;if(E&&0<E.length){var za=E[0];fa=E[1];var ea=E[2]/A;E=E[3]/A;oa=[ea,E];var na=za/512,ka=(y-fa-E*A)/y,Ra=za=(za+ea*A)/512;fa=(y-fa)/y;fa=[na,ka,za,ka,Ra,fa,na,ka,Ra,fa,na,fa];na=R-ea/2;ka=P+E/2;E=P-E/2;ea=R+ea/2;na<M&&(M=na);ea>T&&(T=ea);E<Y&&(Y=E);ka>V&&(V=ka)}N.push({offset:[R,P],z:G,size:oa,angle:ba,texcoord:fa})}U=q[2*(D-1)]-q[0];q=q[2*(D-1)+1]-q[1];1===O&&(U=-U,q=-q);0===U?q=0<q?90:270:(I=Math.atan(q/U)/Math.PI*180,0>U&&0<q?I+=180:0>U&&0>q?I+=180:0<U&&0>
q&&(I+=360),360===I&&(I=0),q=I);m.push({type:"line",rank:e,name:K,wordCount:D,pt:Q,mcInTile:{x:aa,y:Z},reverse:O,styleId:x,styleText:u,bds:[M,Y,T,V],wordsInfo:N,labelAngle:q,tracer:l,processedInZoom:r.useZoom,key:"line_"+e+"_"+Q.lng+"_"+Q.lat})}}}g.lineLabel=d;g.textureHeight=f;g.tileInfo=h;return g}
function ub(b,a,c,f,h,g){for(var d=[],r=0;r<a.length;r++){var y=b,m=a[r],k=f,t=c,e=d,l=h,A=g;if(m&&m.length){l=l||zb;var z=k.useZoom;9===z&&(z=8);for(var p=Math.pow(2,18-k.zoom),n=k.col*k.baseTileSize*p,v=k.row*k.baseTileSize*p,w=k.col,H,x=w,u=1536*Math.pow(2,k.zoom-3)/(k.baseTileSize||256),K=u/2-1,D=-u/2;x>K;)x-=u;for(;x<D;)x+=u;H=x;var q=n;H>w?q=n-40075452:H<w&&(q=n+40075452);for(var C=0;C<m.length;C++){var F=m[C],X=F[0]/4,O=J[X],L=J[X+1],M=xb.b(yb,L,"point",z,l,A,W),Y=xb.b(yb,L,"pointText",z,l,
A,W);if(k.areaCustom)var T=xb.b(Cb,L,"point",z,l,A,Gb),V=xb.b(Cb,L,"pointText",z,l,A,Gb);var U=S(O+1,F[0],F[0]+F[1]);if(!(Y&&0!==Y.length||M&&0!==M.length||V&&0!==V.length||T&&0!==T.length))if(5===z){if(!U||!U.length)continue;for(var aa=0;aa<U.length;aa++){var Z=U[aa],Q=Z[0]/4,N=J[Q],I=S(N+1,Z[0],Z[0]+Z[1]),ba;Z[1]&&I[1][1]&&(ba=Ab(y,I[1][0],I[1][1],"utf-8"));if("\u5317\u4eac"===ba){M=xb.b(yb,L,"point",6,l,!1,W);Y=xb.b(yb,L,"pointText",6,l,!1,Gb);T=xb.b(yb,L,"point",6,l,!1,W);V=xb.b(yb,L,"pointText",
6,l,!1,Gb);break}}}else continue;if(U){var R=null,P=1,G=0,E=0;M&&M[0]&&(M=M[0],R=M.icon,P=(M.zoom||100)/100);for(aa=0;aa<U.length;aa++)if(Z=U[aa],Q=Z[0]/4,N=J[Q],I=S(N+1,Z[0],Z[0]+Z[1]),Z[1]){var fa=J[Q+1];if(Bb(fa,k.useZoom)){if(k.processedLabelZooms&&k.processedLabelZooms.length&&!W){for(var oa=k.processedLabelZooms,za=!1,ea=0;ea<oa.length;ea++)if(Bb(fa,oa[ea])){za=!0;break}if(za)continue}var na=S(0,I[2][0],I[2][0]+I[2][1]),ka=[];for(ea=0;ea<na.length;ea++)ka[ea]=new Uint16Array(y,na[ea][0],na[ea][1]);
var Ra=void 0;I[1][1]&&(Ra=Ab(y,I[1][0],I[1][1],"utf-8"));var eb=Ra||"";if(!(Y&&0<Y.length&&0===ka.length&&""===eb)){var hc=J[Q+2],ic=J[Q+3],jc=J[Q+4],kc=Math.round(hc/100),lc=Math.round(ic/100),Db={lng:n+kc,lat:v+lc},mc={lng:q+kc,lat:v+lc};k.areaCustom&&Vb(mc,self.area)&&(Y=V);var nc=void 0;I[0][1]&&(nc=Ab(y,I[0][0],I[0][1],void 0));var Eb=J[Q+5],oc=0<ka.length||""!==eb&&0<Y.length,Fb=Wb(R),qc=!(4!==Eb||!oc||!Fb),Vc=!!eb.match(/[qypjg]/g),Wc=nc||"",Xc=Db,Yc=mc,Zc=eb,$c=Vc,ad=jc,bd=L,cd=Y,dd=R,ed=
qc,fd=M.hue,gd=Eb,hd=m.V;a:{var xa=void 0,gb=fa,rc=k.useZoom;Xb[gb]||(xa=gb.toString(2),8>xa.length&&(xa=Array(8-xa.length+1).join("0")+xa),Xb[gb]=xa);xa=Xb[gb];for(var sc=Yb[rc].start,id=Yb[rc].end-sc+1,hb=0;hb<id;hb++)if("1"===xa[hb]){var tc=hb+sc;break a}tc=99}var ha={type:"fixed",guid:Wc,pt:Xc,ptFix:Yc,name:Zc,containDescendings:$c,rank:ad,iconPos:null,textPos:null,styleId:bd,styleText:cd,icon:dd,textOnIcon:ed,hue:fd,direction:gd,onDefaultFloor:hd,startZoom:tc||99,tilePosStr:hc+","+ic,tracer:fa,
processedInZoom:k.useZoom,key:"fixed_"+jc+"_"+Db.lng+"_"+Db.lat};if(null===R||qc)null!==R&&(ha.iconSize=Fb);else{var Hb=Wb(R);if(Hb){var Ib=Hb[0]/2*P,Jb=Hb[1]/2*P,ib=Math.round(-Ib/2),jb=Math.round(-Jb/2),Kb=ib+Ib,Lb=jb+Jb;var uc={vertex:[ib,jb,Kb,jb,Kb,Lb,ib,jb,Kb,Lb,ib,Lb],texcoord:null,width:Ib,height:Jb,iconType:R}}else uc=null;ha.iconPos=uc;ha.iconPos&&(G=ha.iconPos.width,E=ha.iconPos.height)}if(ka.length){var jd=ha,kb=Eb,Mb=ka,Nb=G,vc=E,lb=t,Sa=vb;"number"!==typeof kb&&(kb=0);for(var Ga=Mb.length,
wc=[],xc=[],Ha=0,Ta=0,la=0;la<Ga;la++)Ta+=Math.round(Mb[la][3]/Sa);for(la=0;la<Ga;la++){var mb=Mb[la],yc=mb[0],zc=mb[1],Ia=Math.round(mb[2]/Sa),Aa=Math.round(mb[3]/Sa);0===Nb&&(kb=4);switch(kb){case 3:var pa=Ta/2-Aa+2*(Ga-1)/2;var ya=Math.round(-Nb/2-Ia-2);var Ba=Math.round(pa-Ha-2*la);break;case 1:pa=Ta/2-Aa+2*(Ga-1)/2;ya=Math.round(Nb/2+2);Ba=Math.round(pa-Ha-2*la);break;case 2:pa=vc/2+Ta-Aa+2*Ga;ya=Math.round(-Ia/2);Ba=Math.round(pa-Ha-2*la);break;case 0:pa=-vc/2-2-Aa;ya=Math.round(-Ia/2);Ba=Math.round(pa-
Ha-2*la);break;case 4:pa=-Ta/2-2*(Ga-1)/2,ya=Math.round(-Ia/2),Ba=Math.round(pa-Ha-2*la)}Ha+=Aa;var Ac=ya+Math.round(Ia),Bc=Ba,Cc=Ac,Ob=Bc+Math.round(Aa),Pb=yc/512,Qb=(lb-zc-Aa*Sa)/lb,Dc=(yc+Ia*Sa)/512,kd=Qb,Ec=Dc,Rb=(lb-zc)/lb,ld=Pb,md=Rb;wc.push(ya,Ba,Ac,Bc,Cc,Ob,ya,Ba,Cc,Ob,ya,Ob);xc.push(Pb,Qb,Dc,kd,Ec,Rb,Pb,Qb,Ec,Rb,ld,md)}jd.textPos={vertex:wc,texcoord:xc}}if(ha.textPos||ha.iconPos){var Ua=1E3,Va=1E3,Wa=-1E3,Xa=-1E3;if(ha.iconPos)for(var Sb=ha.iconPos.vertex,qa=0,Tb=Sb.length;qa<Tb;qa+=2){var ra=
Sb[qa],sa=Sb[qa+1];ra<Ua&&(Ua=ra);ra>Wa&&(Wa=ra);sa<Va&&(Va=sa);sa>Xa&&(Xa=sa)}if(ha.textPos){var Ub=ha.textPos.vertex;qa=0;for(Tb=Ub.length;qa<Tb;qa+=2)ra=Ub[qa],sa=Ub[qa+1],ra<Ua&&(Ua=ra),ra>Wa&&(Wa=ra),sa<Va&&(Va=sa),sa>Xa&&(Xa=sa)}ha.bds=[Ua,Va,Wa,Xa]}(Fb||oc)&&e.push(ha)}}}}}}}return d}function Wb(b){if(!b||"disekong"===b)return null;var a=Zb[b]||Zb["MapRes/"+b];!a&&b&&48<=b.charCodeAt(0)&&57>=b.charCodeAt(0)&&(a=Zb["_"+b]);return a}var $b;
$b=function(b,a,c,f){var h,g;a=S(0,a[0],a[0]+a[1]);if(!a.length)return{};for(var d={},r=[],y=[],m=[],k=[],t=[],e=0;e<a.length;e++){var l=S(0,a[e][0],a[e][0]+a[e][1]),A=l[0];A=S(0,A[0],A[0]+A[1]);l=l[1];var z=S(J[l[0]>>2]+1,l[0],l[0]+l[1]);a:{var p=b;if((h=S(0,z[2][0],z[2][0]+z[2][1]))&&h[0]){for(var n=0;n<h.length;n++){var v=h[n],w=v[0]>>2;w=J[w];v=S(w+1,v[0],v[0]+v[1]);if(!v[0][1]){p=[];h=[0,0];var H=g=void 0;break a}}g=[];var x=[0,0],u=[2.003772637E7,1.102819087E7];l=[-2.003772637E7,-1.060158079E7];
H=0;n=c.mercatorSize;var K=c.col*n,D=c.row*n;for(n=0;n<h.length;n++){v=h[n];w=v[0]>>2;w=J[w];v=S(w+1,v[0],v[0]+v[1]);v=new Int32Array(p,v[0][0],v[0][1]>>2);w=[K+v[0]/100,D+v[1]/100];x[0]+=w[0];x[1]+=w[1];w[0]<u[0]&&(u[0]=w[0]);w[1]<u[1]&&(u[1]=w[1]);w[0]>l[0]&&(l[0]=w[0]);w[1]>l[1]&&(l[1]=w[1]);for(var q=2;q<v.length;q+=2)w[q]=w[q-2]+v[q]/100,w[q+1]=w[q-1]+v[q+1]/100,x[0]+=w[q],x[1]+=w[q+1],w[q]<u[0]&&(u[0]=w[q]),w[q+1]<u[1]&&(u[1]=w[q+1]),w[q]>l[0]&&(l[0]=w[q]),w[q+1]>l[1]&&(l[1]=w[q+1]);H+=v.length;
g.push(w)}x[0]/=H/2;x[1]/=H/2;p=g;h=x;g=u;H=l}else p=[],h=[0,0],H=g=void 0}u=S(0,z[3][0],z[3][0]+z[3][1]);l=[];for(x=0;x<u.length;x++)l[x]=String.fromCharCode.apply(String,new Uint8Array(b,u[x][0],u[x][1]));K=String.fromCharCode.apply(String,new Uint8Array(b,z[1][0],z[1][1]));u=void 0;z=String.fromCharCode.apply(String,new Uint8Array(b,z[0][0],z[0][1]));for(x=0;x<l.length;x++)if(l[x]===K){u=x;break}p={defaultFloor:u,currentFloor:u,currentFloorName:l[u],uid:z,floors:[],contour:p,boundsMin:g,boundsMax:H,
center:h,floorLength:l.length};for(x=0;x<l.length;x++){n=l[x];a:{h=b;g=A;H=n;for(K=0;K<g.length;K++)if(D=S(J[g[K][0]>>2]+1,g[K][0],g[K][0]+g[K][1]),String.fromCharCode.apply(String,new Uint8Array(h,D[0][0],D[0][1]))===H){K=D[1];break a}K=null}h=b;D=z;g=c;v=f;H=x===u?!0:!1;if(K)if(K=S(0,K[0],K[0]+K[1]),K.length){n={base:[],base3d:[],contour:[],floorName:n};for(var C=0;C<K.length;C++){w=K[C];q=w[0]>>2;var F=J[q+1];7===F&&(v=ac(h,w,g,n.contour,v,1,{w:!0,S:!0}))}for(C=0;C<n.contour.length;C++)n.contour[C].uid=
D;for(C=0;C<K.length;C++)w=K[C],q=w[0]>>2,F=J[q+1],7===F&&(v=ac(h,w,g,n.base,v,2,{w:!0})),15===F&&(v=ac(h,w,g,n.base3d,v,2,{w:!0,v:!0}));for(C=0;C<n.base.length;C++)n.base[C].uid=D;for(C=0;C<n.base3d.length;C++)n.base3d[C].uid=D;(v=bc(h,K,g,!0))&&0!==v.vertex.length&&(n.area3D=v,n.area3D.uid=D,n.area3D.border&&(n.indoorBorder3D=n.area3D.border,n.indoorBorder3D.uid=D,delete n.area3D.border));D=[];for(v=0;v<K.length;v++)w=K[v],q=w[0]>>2,F=J[q+1],F===tb&&(w=S(J[q]+1,w[0],w[0]+w[1]),w.V=H,D.push(w));
n.pois=ub(h,D,H?J[2]:J[3],g,cc,!0);h=n}else h={floorName:n};else h={floorName:n};p.floors[x]=h}d[z]=p;if(p.floors[u]){if(p.floors[u].base)for(x=0;x<p.floors[u].base.length;x++)r.push(p.floors[u].base[x]);if(p.floors[u].base3d)for(x=0;x<p.floors[u].base3d.length;x++)y.push(p.floors[u].base3d[x]);if(p.floors[u].contour)for(x=0;x<p.floors[u].contour.length;x++)m.push(p.floors[u].contour[x]);p.floors[u].indoorBorder3D&&k.push(p.floors[u].indoorBorder3D);p.floors[u].area3D&&t.push(p.floors[u].area3D)}d.tileInfo=
c}0===r.length&&(r=null);0===y.length&&(y=null);0===m.length&&(m=null);0===k.length&&(k=null);0===t.length&&(t=null);return{indoorDataResult:d,indoorBase:r,indoorBase3D:y,indoorBaseContour:m,indoorArea3D:t,indoorBorder3D:k}};
var xb=function(){function b(b,c,f,h,m){h=h||null;21<f&&(f=21);if(h){m=h[2];switch(c){case "point":m=m[0];break;case "pointText":m=m[1];break;case "line":m=m[3];break;case "polygon":m=m[4];break;case "polygon3d":m=m[5]}var g=f-1;"line"===c&&12===f&&(g=f);g=h[1][g][0];g=g[b];!g&&21>f&&("point"===c||"pointText"===c)&&(g=h[1][f][0],g=g[b]);f={m:g,style:m,A:[]}}else if(m&&m.baseFs){h=m.baseFs;b:{var d=m.ua;if("[object Object]"===Object.prototype.toString.call(d)){for(g in d){g=!1;break b}g=!0}else g=
!1}m=g?m.StyleBody||[]:m.zoomStyleBody[f]||[];g=h[2];switch(c){case "point":g=g[0];m=m[0]||{};break;case "pointText":g=g[1];m=m[1]||{};break;case "line":g=g[3];m=m[3]||{};break;case "polygon":g=g[4];m=m[4]||{};break;case "polygon3d":g=g[5],m=m[5]||{}}d=h[1][f-1][0];d=d[b];!d&&21>f&&("point"===c||"pointText"===c)&&(d=h[1][f][0],d=d[b]);f={m:d,style:g,A:m}}else f={m:null,style:[],A:[]};m=f;f=m.m;h=m.style;m=m.A;g=[];if(!f)return g;for(d=0;d<f.length;d++){var e=m[f[d]]||h[f[d]];if(e){switch(c){case "polygon":var l=
null,r=null;e[e.length-1]&&e[e.length-1]instanceof Array&&"openmap"===e[e.length-1][0]&&(l=e[e.length-1][1]?e[e.length-1][1]:null,r=e[e.length-1][2]?e[e.length-1][2]:null);e={g:b,f:a(e[0]),c:a(e[1]),borderWidth:e[2],F:e[3],G:e[4],ta:e[5],ba:e[6],qa:e[7],ra:a(e[8]),h:r,u:a(l)};break;case "line":l=null;e[e.length-1]&&e[e.length-1]instanceof Array&&"openmap"===e[e.length-1][0]&&(l=e[e.length-1][1]?e[e.length-1][1]:null);e={g:b,c:a(e[0]),f:a(e[1]),borderWidth:e[2],s:e[3],Z:e[4],L:e[5],ea:e[6],fa:e[7],
ga:e[8],ja:e[9],ka:e[10],F:e[11],h:e[12],G:e[13],aa:e[14],ia:e[15],ca:e[16],ma:e[17],pa:e[18],u:a(l)};break;case "pointText":e=e&&0!==e.length?{sid:b,fontRgba:a(e[0]),haloRgba:a(e[1]),backRgba:a(e[2]),fontSize:e[3],haloSize:e[4],fontWeight:e[5],fontStyle:e[6],density:e[7]}:null;break;case "point":l=null;e[e.length-1]&&e[e.length-1]instanceof Array&&"openmap"===e[e.length-1][0]&&(l=e[e.length-1][1]?e[e.length-1][1]:null);e={sid:b,rank:e[0],sa:e[1],icon:e[2],iconType:e[3],na:e[4],density:e[5],zoom:e[6],
hue:l>>>0};break;case "polygon3d":e={g:b,filter:e[0],ratio:e[1],da:e[2],borderWidth:e[3],c:a(e[4]),o:a(e[5]),j:a(e[6]),oa:e[7]}}e&&(e.$=f[d],g[g.length]=e)}}return g}function a(a){var b=a;if(h[b])return h[b];a>>>=0;h[b]=[a&255,a>>8&255,a>>16&255,a>>24&255];return h[b]}var c={},f={},h={};return{b:function(a,d,h,y,m,k,t){a=(a||"default")+"-"+d+"-"+h+"-"+y;k&&(a+="-indoor");if(m)return f[a]||(f[a]=b(d,h,y,m)),f[a];c[a]||(c[a]=b(d,h,y,m,t));return c[a]},J:function(){c={};f={}}}}();
function dc(){var b=W.bmapLandColor.replace("#","");3===b.length?b+="f":6===b.length&&(b+="ff");for(var a=[],c=b.length,f=8===c?2:1,h=0;h<c;h+=f)2===f?a.push(parseInt(b.slice(h,h+2),16)):a.push(parseInt(b.slice(h,h+1)+b.slice(h,h+1),16));return a}function ec(b,a){if(b.fill)b.fill(a);else for(var c=0;c<b.length;c++)b[c]=a}
Uint8Array.prototype.slice||(Object.defineProperty(Uint8Array.prototype,"slice",{value:Array.prototype.slice}),Object.defineProperty(Uint16Array.prototype,"slice",{value:Array.prototype.slice}),Object.defineProperty(Uint32Array.prototype,"slice",{value:Array.prototype.slice}),Object.defineProperty(Int8Array.prototype,"slice",{value:Array.prototype.slice}),Object.defineProperty(Int16Array.prototype,"slice",{value:Array.prototype.slice}),Object.defineProperty(Int32Array.prototype,"slice",{value:Array.prototype.slice}),
Object.defineProperty(Float32Array.prototype,"slice",{value:Array.prototype.slice}));var wb,J,fc;
function Ab(b,a,c,f){b=new Uint8Array(b,a,c);if(self.TextDecoder)return fc||(fc=new TextDecoder("utf-8")),fc.decode(b).replace(/\\\\/g,"\\");if("utf-8"===f)for(f="",a=0;a<b.length;a++)c=b[a],128>c?f+=String.fromCharCode(c):191<c&&224>c?(f+=String.fromCharCode((c&31)<<6|b[a+1]&63),a+=1):223<c&&240>c?(f+=String.fromCharCode((c&15)<<12|(b[a+1]&63)<<6|b[a+2]&63),a+=2):(c=((c&7)<<18|(b[a+1]&63)<<12|(b[a+2]&63)<<6|b[a+3]&63)-65536,f+=String.fromCharCode(c>>10|55296,c&1023|56320),a+=3);else{if(4096>=c)return String.fromCharCode.apply(String,
b);f="";var h=Math.ceil(c/4096);for(a=0;a<h;a++)f+=String.fromCharCode.apply(String,b.slice(4096*a,a===h-1?c:4096*(a+1)))}return f.replace(/\\\\/g,"\\")}function S(b,a,c){var f=a>>2,h=J[f+b];a=4*(h+b+1)+a;var g=[];if(a>c)return g;for(c=0;c<h;c++){var d=J[f+b+1+c],r=a+d;g[c]=[a,d];0!==r%4?a=r+4-r%4:a=r}return g}
var tb=3,gc=1E-5,pc=1,zb=null,cc=null,Zb=null,yb="",W=null,Cb="",Gb=null,ua=new ja,Fc=20,Gc=504089,Hc=65536,Ic=[245,245,245,255],Jc=1,Kc=null,Lc=null,Yb={3:{start:3,end:3,a:3},4:{start:4,end:5,a:5},5:{start:4,end:5,a:5},6:{start:6,end:7,a:7},7:{start:6,end:7,a:7},8:{start:8,end:9,a:9},9:{start:8,end:9,a:9},10:{start:10,end:10,a:10},11:{start:11,end:13,a:12},12:{start:11,end:13,a:12},13:{start:11,end:13,a:12},14:{start:14,end:15,a:15},15:{start:14,end:15,a:15},16:{start:16,end:17,a:17},17:{start:16,
end:17,a:17},18:{start:18,end:25,a:19},19:{start:18,end:25,a:19},20:{start:18,end:25,a:19},21:{start:18,end:25,a:19},22:{start:18,end:25,a:19},23:{start:18,end:25,a:19},24:{start:18,end:25,a:19},25:{start:18,end:25,a:19}},vb,Mc,Nc=!1,Oc=[],Pc=!1;
function rb(){for(var b=atob("[encoded data, 7972 characters]"),a=
b.length,c=new Uint8Array(a),f=0;f<a;f++)c[f]=b.charCodeAt(f);return c.buffer}function Qc(){Pc||(Pc=!0,qb(function(){Nc=!0;if(Oc.length)for(var b=0;b<Oc.length;b++){var a=Oc[b];Rc(a.data,a.B,a.X)}Oc=[]}))}self.onmessage=function(b){b=b.data;var a=b.action,c=b.isText,f=b.isPoi,h=b.buildingSideGradation;if(self[a])self[a](b);self.isText=c;self.isPoi=f;self.buildingSideGradation=h};var Xb={0:"00000000",16:"00010000",32:"00100000",48:"00110000",64:"01000000",96:"01100000"};
function Sc(b,a,c,f){var h=b.lng-c.lng,g=b.lat-c.lat,d=a.lng-c.lng,r=a.lat-c.lat,y=f.lng-c.lng,m=f.lat-c.lat,k=(h*m-y*g)*(d*m-y*r);h=c.lng-b.lng;g=c.lat-b.lat;d=a.lng-b.lng;r=a.lat-b.lat;y=f.lng-b.lng;m=f.lat-b.lat;return 0>k&&0>(h*r-d*g)*(y*r-d*m)?!0:!1}function Tc(b,a,c){for(var f=0;f<c.length;f++)if(f===c.length-1?Sc(b,a,c[f],c[0]):Sc(b,a,c[f],c[f+1]))return!0;return!1}
function Vb(b,a){a=a||[];for(var c=a.length,f=0,h=!1,g=0;g<c;g++)f=g===c-1?0:f+1,a[g].lat!==a[f].lat&&(b.lat>=a[g].lat&&b.lat<a[f].lat||b.lat>=a[f].lat&&b.lat<a[g].lat)&&b.lng<(a[f].lng-a[g].lng)*(b.lat-a[g].lat)/(a[f].lat-a[g].lat)+a[g].lng&&(h=!h);return h}
function Uc(b){var a=self.area,c=b.mercatorSize,f=b.col*c,h=b.row*c;b=f+c;var g=h+c;var d=-Infinity,r=-Infinity,y=Infinity,m=Infinity;for(c=0;c<a.length;c++)d<a[c].lng&&(d=a[c].lng),r<a[c].lat&&(r=a[c].lat),y>a[c].lng&&(y=a[c].lng),m>a[c].lat&&(m=a[c].lat);c=!1;if(b<=y||f>=d||g<=m||h>=r)return c;d=[{},{},{},{}];d[0].lng=f;d[0].lat=h;d[1].lng=f;d[1].lat=g;d[2].lng=b;d[2].lat=g;d[3].lng=b;d[3].lat=h;for(f=0;f<d.length;f++)if(c=f===d.length-1?Tc(d[f],d[0],a):Tc(d[f],d[f+1],a))return c;for(f=0;f<a.length;f++)if(Vb(a[f],
d))return c=!0;for(f=0;f<d.length;f++)if(Vb(d[f],a)){c=!0;break}return c}function nd(b){b=b.map(function(a){return a/100});for(var a=2;a<b.length;a+=2)for(var c=0;2>c;c++)b[a+c]=b[a+c-2]+b[a+c];return b}function Bb(b,a){if(!Xb[b]){var c=b.toString(2);8>c.length&&(c=Array(8-c.length+1).join("0")+c);Xb[b]=c}c=Xb[b];return"1"===c[(20<a?21:a)-Yb[a].start]}
function Rc(b,a,c){ta("finishLoadTile");try{ta("begin(ParseData)"),self.area&&Uc(a)&&(a.areaCustom=!0),od(b,a,c,function(a){ta("finishParseData");a.base=a.a;a.base3d=a.D;a.virtual=a.Y;a.building3d=a.H;a.building3dMesh=a.I;a.indoorData=a.T;a.indoorBase=a.O;a.indoorBaseContour=a.P;a.indoorBorder3D=a.R;a.indoorArea3D=a.N;a.label=a.label;a.tileInfo=a.B;for(var b=[],c=0;c<a.base.length;c++){var d=a.base[c];b.push(d.data[0].buffer);b.push(d.data[1].buffer)}if(a.base3d)for(c=0;c<a.base3d.length;c++)d=a.base3d[c],
"block"===d.type?(b.push(d.data.vertex.buffer),b.push(d.data.index.buffer)):(b.push(d.data[0].buffer),b.push(d.data[1].buffer));if(a.virtual)for(c=0;c<a.virtual.length;c++)d=a.virtual[c],b.push(d.data[0].buffer),b.push(d.data[1].buffer);a.building3d&&(b.push(a.building3d.vertex.buffer),b.push(a.building3d.index.buffer));if(a.indoorBase)for(c=0;c<a.indoorBase.length;c++)d=a.indoorBase[c],b.push(d.data[0].buffer),b.push(d.data[1].buffer);if(a.indoorBaseContour)for(c=0;c<a.indoorBaseContour.length;c++)d=
a.indoorBaseContour[c],b.push(d.data[0].buffer),b.push(d.data[1].buffer);if(a.indoorBorder3D&&a.indoorBorder3D&&0<a.indoorBorder3D.length)for(c=0;c<a.indoorBorder3D.length;c++)b.push(a.indoorBorder3D[c].data[0].buffer),b.push(a.indoorBorder3D[c].data[1].buffer);if(a.indoorArea3D&&0<a.indoorArea3D.length)for(c=0;c<a.indoorArea3D.length;c++)b.push(a.indoorArea3D[c].vertex.buffer),b.push(a.indoorArea3D[c].index.buffer);a.label&&(a.label.textImageBitmap&&b.push(a.label.textImageBitmap),a.label.indoorTextImageBitmap&&
b.push(a.label.indoorTextImageBitmap));a.perfStat=[va("beginLoadTile","finishLoadTile"),va("finishLoadTile","beginParseData"),va("beginParseData","finishParseData"),Mc];a.endTime=Date.now();postMessage(a,b)})}catch(f){console.log("\u89e3\u6790\u5f02\u5e38\uff1a",f),postMessage({tileInfo:a,tileKey:c,error:"parse_error",message:f.message})}}self.setWorkerConfig=function(b){for(var a in b)b.hasOwnProperty(a)&&(self[a]=b[a])};self.clearStyleCache=function(){xb.J()};
self.loadTileData=function(b){var a=b.url,c={};c.baseTileSize=b.tileInfo.baseTileSize;c.col=b.tileInfo.col;c.loopOffsetX=b.tileInfo.loopOffsetX;c.mercatorSize=b.tileInfo.mercatorSize;c.row=b.tileInfo.row;c.tileSize=b.tileInfo.tileSize;c.tileTypeName=b.tileInfo.tileTypeName;c.useZoom=b.tileInfo.useZoom;c.zoom=b.tileInfo.zoom;c.processedLabelZooms=b.tileInfo.processedLabelZooms;c.hasPoly=b.hasPoly;c.hasLine=b.hasLine;c.carport=b.carport;var f=b.tileKey;b.featureStyle&&(zb=JSON.parse(b.featureStyle),
cc=Gb=W=null);b.indoorStyle&&(cc=JSON.parse(b.indoorStyle));b.iconSetInfo&&(Zb=JSON.parse(b.iconSetInfo));b.iconInfo&&(vb=b.iconInfo.textSizeRatio);b.mapStyleId&&(yb=b.mapStyleId);b.areaStyleId&&(Cb=b.areaStyleId);b.customMapStyle&&(W=JSON.parse(b.customMapStyle),zb=null);b.areaMapStyle&&(Gb=JSON.parse(b.areaMapStyle));c.style=yb;Kc=Lc=null;Mc=0;var h=new XMLHttpRequest;h.open("GET",a,!0);b=b.tileInfo.header;if(b instanceof Array)for(var g=0;g<b.length;g++)b[g]&&b[g].hasOwnProperty("key")&&b[g].hasOwnProperty("value")&&
h.setRequestHeader(b[g].key,b[g].value);h.responseType="arraybuffer";h.timeout=1E4;h.ontimeout=function(){postMessage({tileInfo:c,tileKey:f,error:"net_timeout",message:"net status: timeout"})};h.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(Mc=Math.round(h.response.byteLength/1024),Nc?Rc(h.response,c,f):Oc[Oc.length]={data:h.response,B:c,X:f}),(400<=this.status||0===this.status)&&postMessage({tileInfo:c,tileKey:f,error:"net_error",message:"net status: "+this.status,event:{title:a,
la:JSON.stringify({responseURL:a,status:this.status})}}))};h.send();Qc();ta("beginLoadTile")};
function od(b,a,c,f){var h=[],g=[],d=[],r=0,y=a.useZoom,m=null,k=null;J=new Uint32Array(b);wb=new Int32Array(b);Jc=J[0];var t=S(J[1]+2,0,b.byteLength),e=S(0,t[0][0],t[0][0]+t[0][1]),l=!1,A=void 0===a.hasLine?!0:a.hasLine,z=void 0===a.hasPoly?!0:a.hasPoly;if(z){for(var p=0;p<e.length;p++){var n=e[p],v=n[0]>>2,w=J[v+1];if(7===w){l=!0;break}}!1===l&&(r=ac(null,null,a,h,r,0))}for(p=0;p<e.length;p++)if(n=e[p],v=n[0]>>2,w=J[v+1],l=J[v+2],7===w&&z)r=ac(b,n,a,h,r,0);else if(4===w&&A)13E3===l||83500===l?pd(b,
n,y,d,0):r=pd(b,n,y,h,r);else if(15===w&&A){var H=r;r=ac(b,n,a,g,r,1,{v:!0,K:[501776]});r=ac(b,n,a,g,r,1,{v:!0,M:[501776]})}else 16===w&&A?r=pd(b,n,y,g,r,!0):18===w&&A?W&&W.zoomFrontStyle&&W.zoomFrontStyle[y]&&"off"===W.zoomFrontStyle[y].bmapRoadarrowVisibility||(r=qd(b,n,y,g,r)):19===w&&A?r=rd(b,n,y,h,r):20===w&&A&&(r=sd(b,n,y,g,r));A&&((m=td(e,a))&&g.push({type:"block",data:m,has3D:!0,has2D:!1}),m=bc(b,e,a),p=ud(b,e,a),0<p&&(k={vertex:new Float32Array(7*p),index:new Uint16Array(p/3)},ud(b,e,a,k.vertex,
k.index)));p={W:Ab(b,t[3][0],t[3][1],void 0)||"",height:J[2]||0};var x=sb(b,e,t[2],p,a)||{};x.textImgStr=p.W||null;x.indoorLabel=[];t[4][1]&&J[3]?(x.indoorTextImgStr=Ab(b,t[4][0],t[4][1],void 0)||null,x.indoorTextureHeight=J[3]):x.indoorTextImgStr=null;if(z){var u=$b(b,t[1],a,H?H:r);if(u.indoorDataResult)for(var K in u.indoorDataResult)if("tileInfo"!==K)for(b=u.indoorDataResult[K],r=b.defaultFloor,u.indoorDataResult[K].tileKey=c,p=0;p<b.floors.length;p++)r===p&&b.floors[p].pois&&(x.indoorLabel=x.indoorLabel.concat(b.floors[p].pois));
J=wb=null}h.length&&(h=vd(h));var D={a:h,D:g.length?g:null,Y:d.length?d:null,H:m,I:k,T:u?u.indoorDataResult:null,ha:u?u.indoorBase3D:null,O:u?u.indoorBase:null,P:u?u.indoorBaseContour:null,R:u?u.indoorBorder3D:null,N:u?u.indoorArea3D:null,label:x,B:a};if((x.textImgStr||x.indoorTextImgStr)&&self.fetch&&self.createImageBitmap&&self.Promise){var q=function(){f(D)},C=0;x.textImgStr&&(C++,fetch(x.textImgStr).then(function(a){a.blob().then(function(a){createImageBitmap(a,{imageOrientation:"flipY"}).then(function(a){x.textImageBitmap=
a;x.textImgStr=null;C--;0===C&&f(D)},q)},q)},q));x.indoorTextImgStr&&(C++,fetch(x.indoorTextImgStr).then(function(a){a.blob().then(function(a){createImageBitmap(a,{imageOrientation:"flipY"}).then(function(a){x.indoorTextImageBitmap=a;x.indoorTextImgStr=null;C--;0===C&&f(D)},q)},q)},q))}else f(D)}
function vd(b){for(var a=void 0,c=-1,f=0,h=0,g=!1,d=0;d<b.length;d++)"fill"!==b[d].type||0!==b[d].up?(a=void 0,c=-1):(-1===c&&(c=b[d].texture),-1!==c&&b[d].texture!==c?c=b[d].texture:b[d].type===a?(b[f]=wd(b[f],b[d],h),b[d].U=!0,h+=b[d].i,g=!0):(f=d,a=b[d].type,h=b[d].i));return g?b.filter(function(a){return!a.U}):b}function wd(b,a,c){var f=b.data[1],h=a.data[1];b.data[0]=xd(b.data[0],a.data[0]);b.data[1]=xd(f,h,c);b.has3D=b.has3D||a.has3D;b.has2D=b.has2D||a.has2D;return b}
function xd(b,a,c){if(b.constructor===ArrayBuffer){var f=new Uint8Array(b.byteLength+a.byteLength);f.set(new Uint8Array(b),0);f.set(new Uint8Array(a),b.byteLength);return f.buffer}f=new b.constructor(b.length+a.length);f.set(b,0);if(c)for(var h=0;h<a.length;h++)a[h]+=c;f.set(a,b.length);return f}function yd(b,a,c){for(var f=0;f<a.length;f++)b[b.length]=a[f]+c}
function ac(b,a,c,f,h,g,d){var r=[];b&&(r=a?a[0]>>2:0,r=J[r],r=S(r+1,a[0],a[0]+a[1]));a=0;var y=c.baseTileSize;c=c.useZoom;var m=[],k=[],t=[],e=[];d=d||{};var l=d.w||!1,A=d.v||!1,z=d.S||!1,p=d.K||[];d=d.M||[];var n="",v="";A||0!==h||(k=Ic,W&&W.bmapLandColor&&(k=dc()),W&&W.bmapLandFillTexture&&(n=W.bmapLandFillTexture),m=[0,0,0,k[0],k[1],k[2],k[3],0,y,0,0,k[0],k[1],k[2],k[3],0,y,y,0,k[0],k[1],k[2],k[3],0,0,y,0,k[0],k[1],k[2],k[3],0],k=[0,1,2,0,2,3],t=[72],e=[20]);1===g?(h++,a=h,h+=5):2===g&&(a=h+3*
r.length+1);for(var w=[],H=[],x=!1,u=!1,K=0;K<r.length;K++){var D=r[K];v=D[0]>>2;var q=J[v],C=J[v+1];if(!(!d.length&&p.length&&0<=p.findIndex(function(a){return a===C})||!p.length&&d.length&&0>d.findIndex(function(a){return a===C}))&&(v=xb.b(yb,C,"polygon",c,l?cc:zb,l,W))&&v.length){var F=v[0];if(F.g){if(6<c&&(71013===F.g||71012===F.g||71011===F.g))continue;if(5<c&&71011===F.g)continue;if(5>c&&(71012===F.g||71013===F.g))continue}v=F.h||"";var X=F.f[0],O=F.f[1],L=F.f[2],M=F.f[3],Y=F.c[0],T=F.c[1],
V=F.c[2],U=F.c[3],aa=F.borderWidth/4,Z=2.5*aa;D=S(q+1,D[0],D[0]+D[1]);h+=3;for(q=0;q<D.length;q++){var Q=D[q],N=Q[0]>>2,I=J[N];if(Bb(J[N+1],c)||C===Gc){var ba=S(I+1,Q[0],Q[0]+Q[1]);Q=new Int32Array(b,ba[0][0],ba[0][1]>>2);if(Q.length&&!(4E3<Q.length)){var R=new Uint16Array(b,ba[2][0],ba[2][1]>>1);!0!==z&&R&&(m.length/8+Q.length/2>Hc||n!==v)&&(m=zd(m),f.push({type:"fill",data:[m,new Uint16Array(k)],i:m.byteLength/Fc,has3D:x,has2D:u,texture:n,up:d.length?1:0,verticesLength:e,styleIds:t}),m=[],k=[],
t=[],e=[],u=x=!1,n=v);I=null;var P=!1;if(A){var G=1<Jc?new Int16Array(b,ba[1][0],ba[1][1]>>1):new Uint16Array(b,ba[1][0],ba[1][1]>>1);if(1===G.length&&G[0])I=Array(Q.length>>1),0>G[0]&&(P=!0),ec(I,G[0]),x=!0;else if(1<G.length){I=[];for(var E=0;E<G.length;E++)0>G[E]&&(P=!0),I[E]=G[E]||pc;x=!0}else u=!0}E=m.length/8;G=bb(Q);N=J[N+2];z&&1===N&&(aa=Z);if(!0!==z&&(R.length&&yd(k,R,E),R)){E=0;for(N=G.length/2;E<N;E++)R=I?I[E]:0,m.push(G[2*E],G[2*E+1],R,X,O,L,M,h);t.push(C);e.push(m.length/1.6)}if(I&&!P)for(w.length/
8+G.length/2*2>Hc&&(w=zd(w),H=new Uint16Array(H),f.push({type:"fill",data:[w,H],i:w.byteLength/Fc,has3D:x,has2D:u,up:d.length?1:0}),H=[],w=[]),N=w.length/8,E=0;E<G.length;E+=2){R=I[E/2];P=R-280;0>P&&(P=0);w.push(G[E],G[E+1],R,Y,T,V,U,h,G[E],G[E+1],P,Y,T,V,U,h);P=G[E];R=G[E+1];var fa=E===G.length-2?G[1]:G[E+3],oa=!1;if(P===(E===G.length-2?G[0]:G[E+2])){if(Math.abs(P)<gc||Math.abs(P-y)<gc)oa=!0}else R===fa&&(Math.abs(R)<gc||Math.abs(R-y)<gc)&&(oa=!0);oa||(E===G.length-2?H.push(N+E,N+E+1,N,N,N+E+1,N+
1):H.push(N+E,N+E+1,N+E+2,N+E+2,N+E+1,N+E+3))}if(g&&F.borderWidth&&G.length){if(G[0]-G[G.length-2]>gc||G[1]-G[G.length-1]>gc)G[G.length]=G[0],G[G.length]=G[1],I&&(I[I.length]=I[0]);if(ba[3])for(ba=S(0,ba[3][0],ba[3][0]+ba[3][1]),G=0;G<ba.length;G++)E=ba[G],P=S(0,E[0],E[0]+E[1]),E=new Int16Array(b,P[0][0],P[0][1]>>1),nb()+E.length/2>Hc&&(f.push({type:"line",border:!0,data:[db(),fb()],has3D:x,has2D:u,up:d.length?1:0}),pb()),N=new Uint16Array(b,P[1][0],P[1][1]>>1),P=new Int8Array(b,P[2][0],P[2][1]),
ob(E,[Y,T,V,U],aa,I,a,!1,Q,P,0,N[0],N[1])}}}}}}w.length&&(w=zd(w),H=new Uint16Array(H),f.push({type:"fill",data:[w,H],i:w.byteLength/Fc,has3D:x,has2D:u,up:d.length?1:0}));m.length&&(m=zd(m),f.push({type:"fill",data:[m,new Uint16Array(k)],i:m.byteLength/Fc,has3D:x,has2D:u,texture:n,verticesLength:e,styleIds:t,up:d.length?1:0}));g&&(f.push({type:"line",border:!0,data:[db(),fb()],has3D:x,has2D:u,up:d.length?1:0}),pb());return Math.max(h,a)}
function pd(b,a,c,f,h,g){a=S(J[a[0]>>2]+1,a[0],a[0]+a[1]);for(var d=!1,r=!1,y=[],m=[],k=0;2>k;k++){0===k&&h++;for(var t=0;t<a.length;t++){var e=a[t],l=e[0]>>2,A=J[l],z=J[l+1];if((l=xb.b(yb,z,"line",c,zb,!1,W))&&l.length&&(71059!==z||self.isText)&&(0!==k||l[0].borderWidth)&&(e=S(A+1,e[0],e[0]+e[1]),0!==k||!l[0].h))if(1===k&&l[0].h){var p=l[0].h,n=l[0].u;A=p;var v=Zb[A]||Zb["MapRes/"+A];if(v){v=[v[0],v[1]];nb()&&(f[f.length]={type:"line",data:[db(),fb()],has3D:d,has2D:r,styleIds:y,verticesLength:m},
pb(),r=d=!1,m=[],y=[]);/guojietianqiaojieti/.test(p)?h+=20:h++;var w=l[0].s/4,H=g?!0:!1,x=!1;/\b(32|16|8|4)$/.test(A)&&(w*=5,v[1]*=2,x=H=!0,p=p.replace(/\b4$/,"8"));var u=!1,K=!1;for(A=0;A<e.length;A++){var D=e[A],q=D[0]>>2,C=J[q];q=J[q+1];if(Bb(q,c)&&(q=S(C+1,D[0],D[0]+D[1]),D=null,C=new Int32Array(b,q[0][0],q[0][1]>>2),C.length&&!(8E3<C.length))){if(x&&4===C.length){var F=C,X=F[2],O=F[3],L=Math.sqrt(X*X+O*O);L=800*~~(L/800)/L;F[2]=~~(X*L);F[3]=~~(O*L)}if(g){var M=1<Jc?new Int16Array(b,q[1][0],q[1][1]>>
1):new Uint16Array(b,q[1][0],q[1][1]>>1);if(1===M.length&&M[0])D=Array(C.length>>1),ec(D,M[0]),u=!0;else if(1<M.length){D=[];for(u=0;u<M.length;u++)D[u]=M[u]||pc;u=!0}else K=!0}F=new Int16Array(b,q[2][0],q[2][1]>>1);X=new Int8Array(b,q[3][0],q[3][1]);ob(F,l[0].f,w,D,h,!0,C,X,1);y.push(z);m.push(5*nb())}}nb()&&(f[f.length]={type:"line",textureSize:v,texture:p+".png",hue:n,lineWidth:l[0].s/2,data:[db(),fb()],has3D:u,has2D:K,zoomWithMap:H,styleIds:y,verticesLength:m},y=[],m=[],pb())}}else if(0===k?(z=
l[0].c,p=l[0].borderWidth):(z=l[0].f,p=l[0].s),p/=4,!(0===p||0===z[3]||100<p))for(1===k&&h++,A=0;A<e.length;A++)if(D=e[A],q=D[0]>>2,C=J[q],q=J[q+1],Bb(q,c)&&(q=S(C+1,D[0],D[0]+D[1]),C=new Int32Array(b,q[0][0],q[0][1]>>2),C.length&&!(8E3<C.length))){F=new Int16Array(b,q[2][0],q[2][1]>>1);X=new Int8Array(b,q[3][0],q[3][1]);nb()+F.length/2>Hc&&(f[f.length]={type:"line",data:[db(),fb()],has3D:d,has2D:r},r=d=!1,pb());D=null;if(g)if(1<Jc?M=new Int16Array(b,q[1][0],q[1][1]>>1):M=new Uint16Array(b,q[1][0],
q[1][1]>>1),1===M.length&&M[0])D=Array(C.length>>1),ec(D,M[0]),d=!0;else if(1<M.length){D=[];for(d=0;d<M.length;d++)D[d]=M[d]||pc;d=!0}else r=!0;ob(F,z,p,D,h,1===l[0].L,C,X,0)}}}nb()&&(f[f.length]={type:"line",data:[db(),fb()],has3D:d,has2D:r,styleIds:y,verticesLength:m},pb());return h}
function sd(b,a,c,f,h){var g=S(J[a[0]>>2]+1,a[0],a[0]+a[1]),d=[];a=[];for(var r=!1,y=!1,m=0;m<g.length;m++){var k=g[m];k=S(J[k[0]>>2]+1,k[0],k[0]+k[1])[0];var t=k[0]>>2,e=J[t];if(Bb(J[t+1],c)){var l=S(e+1,k[0],k[0]+k[1]);k=new Int32Array(b,l[0][0],l[0][1]>>2);k=bb(k);e=1<Jc?new Int16Array(b,l[3][0],l[3][1]>>1):new Uint16Array(b,l[3][0],l[3][1]>>1);t=void 0;if(1===e.length&&e[0])t=Array(k.length>>1),ec(t,e[0]),r=!0;else if(1<e.length){t=[];for(var A=0;A<e.length;A++)t[A]=e[A]||1;r=!0}else y=!0;e=new Uint32Array(b,
l[2][0],l[2][1]>>2);A=d.length/8;h+=8;var z=xb.b(yb,e[0],"polygon",c,zb,!1,W),p=xb.b(yb,e[1],"polygon",c,zb,!1,W);if(z&&z.length&&p&&p.length){var n=new Int32Array(b,l[1][0],l[1][1]>>2);e=[n[0]/100,n[1]/100];z=z[0].f;n=[n[2]/100,n[3]/100];p=p[0].f;var v=[n[0]-e[0],n[1]-e[1]],w=Math.sqrt(Math.pow(v[0],2)+Math.pow(v[1],2));yd(a,new Uint16Array(b,l[4][0],l[4][1]>>1),A);A=0;for(l=k.length/2;A<l;A++){var H=[k[2*A],k[2*A+1]];if(0===v[0]){var x=e[0];var u=H[1]}else u=-((e[0]-H[0])*v[0]+(e[1]-H[1])*v[1])/
(v[0]*v[0]+v[1]*v[1]),x=u*v[0]+e[0],u=u*v[1]+e[1];u=Math.sqrt(Math.pow(x-n[0],2)+Math.pow(u-n[1],2))/w;if(e[0]<n[0]&&x<e[0]||e[0]>n[0]&&x>e[0])u=1;else if(e[0]<n[0]&&x>n[0]||e[0]>n[0]&&x<n[0])u=0;d.push(H[0],H[1],t?t[A]:0,u*z[0]+(1-u)*p[0],u*z[1]+(1-u)*p[1],u*z[2]+(1-u)*p[2],u*z[3]+(1-u)*p[3],h)}}}}d.length&&(b=zd(d),f.push({type:"fill",data:[b,new Uint16Array(a)],i:b.byteLength/Fc,has3D:r,has2D:y}));return h}
function qd(b,a,c,f,h){var g=S(J[a[0]>>2]+1,a[0],a[0]+a[1]);if(!g.length)return h;a=[];var d=[];h++;var r=bb(new Int32Array(b,g[0][0],g[0][1]>>2)),y=new Int32Array(b,g[1][0],g[1][1]>>2);b=new Int16Array(b,g[2][0],g[2][1]>>1);var m=g=!1;1===b.length&&0===b[0]?m=!0:g=!0;b=bb(b,1);if(1===b.length){var k=b[0];b=Array(r.length>>1);ec(b,k)}for(k=0;k<y.length;k++)if(Bb(y[k],c)){var t=[r[4*k],r[4*k+1],b[2*k]],e=[r[4*k+2],r[4*k+3],b[2*k+1]],l=[(t[0]+e[0])/2,(t[1]+e[1])/2,(t[2]+e[2])/2],A=l[0]-t[0],z=l[1]-
t[1],p=[e[0]-t[0],e[1]-t[1]],n=p[0]*p[0]+p[1]*p[1];0<n&&(n=1/Math.sqrt(n),p[0]*=n,p[1]*=n);n=a.length/10;a[a.length]=l[0];a[a.length]=l[1];a[a.length]=t[2];a[a.length]=-A;a[a.length]=-z;a[a.length]=-p[1];a[a.length]=p[0];a[a.length]=.125;a[a.length]=.3125;a[a.length]=h;a[a.length]=l[0];a[a.length]=l[1];a[a.length]=t[2];a[a.length]=-A;a[a.length]=-z;a[a.length]=p[1];a[a.length]=-p[0];a[a.length]=.125;a[a.length]=.6875;a[a.length]=h;a[a.length]=l[0];a[a.length]=l[1];a[a.length]=e[2];a[a.length]=A;a[a.length]=
z;a[a.length]=-p[1];a[a.length]=p[0];a[a.length]=1;a[a.length]=.3125;a[a.length]=h;a[a.length]=l[0];a[a.length]=l[1];a[a.length]=e[2];a[a.length]=A;a[a.length]=z;a[a.length]=p[1];a[a.length]=-p[0];a[a.length]=1;a[a.length]=.6875;a[a.length]=h;d[d.length]=n;d[d.length]=n+1;d[d.length]=n+2;d[d.length]=n+2;d[d.length]=n+1;d[d.length]=n+3}d.length&&f.push({type:"arrow",data:[new Float32Array(a),new Uint16Array(d)],has3D:g,has2D:m});return h}
function rd(b,a,c,f,h){a=S(J[a[0]>>2]+1,a[0],a[0]+a[1]);h++;for(var g=0;g<a.length;g++){var d=a[g],r=d[0]>>2,y=J[r];if((r=xb.b(yb,J[r+1],"line",c,zb,!1,W))&&r.length){var m=r[0];if("undefined"!==typeof m.h){var k=m.h+".png";m=m.u;d=S(y+1,d[0],d[0]+d[1]);for(y=0;y<d.length;y++){var t=d[y],e=t[0]>>2,l=J[e];Bb(J[e+1],c)&&(e=J[e+2]/20,t=S(l+1,t[0],t[0]+t[1]),ob(new Int16Array(b,t[2][0],t[2][1]>>1),r[0].f,e,null,h,!0,new Int32Array(b,t[0][0],t[0][1]>>2),new Int8Array(b,t[3][0],t[3][1]),2))}f[f.length]=
{type:"line",texture:k,hue:m,isSingle:!0,data:[db(),fb()]};pb()}}}return h}
function bc(b,a,c,f){var h=c.useZoom;if(!a||!a.length)return null;for(var g=[],d=[],r=[],y=[],m=0;m<a.length;m++){var k=a[m],t=k[0]>>2,e=J[t];if(8===J[t+1])for(k=S(e+1,k[0],k[0]+k[1]),t=0;t<k.length;t++){var l=k[t];e=l[0]>>2;var A=J[e];e=J[e+1];var z=xb.b(yb,e,"polygon3d",h,f?cc:zb,!1,W);if(c.areaCustom&&Gb)var p=xb.b(Cb,e,"polygon3d",h,f?cc:zb,!1,Gb);if(z&&z[0]||p&&p[0])for(l=S(A+1,l[0],l[0]+l[1]),A=0;A<l.length;A++){if(z&&z[0]){var n=z[0];var v=n.o;var w=n.j;var H=0;if(n.borderWidth){var x=n.c[0];
var u=n.c[1];var K=n.c[2];var D=n.c[3];H=n.borderWidth/4}Kc||(Kc=v,Lc=w)}var q=l[A],C=q[0]>>2,F=J[C];if(Bb(J[C+1],h)){C=J[C+2];var X=Number(self.buildingSideGradation);if(!(C<n.filter)){F=S(F+1,q[0],q[0]+q[1]);q=new Int32Array(b,F[0][0],F[0][1]>>2);for(var O=new Uint16Array(b,F[1][0],F[1][1]>>1),L=nd(q),M=c.mercatorSize*c.col,Y=c.mercatorSize*c.row,T=[],V=0;V<L.length;V+=2)T.push({lng:L[V]/2+M,lat:L[V+1]/2+Y});Y=M=L=0;for(V=1;V<=T.length;V++){var U=T[V%T.length].lat,aa=T[V%T.length].lng,Z=T[V-1].lat,
Q=T[V-1].lng,N=(U*Q-aa*Z)/2;L+=N;M+=N*(U+Z)/3;Y+=N*(aa+Q)/3}L={lat:M/L,lng:Y/L};y.push(L);Vb(L,self.area)&&p&&p[0]&&(n=p[0],v=p[0].o?p[0].o:v,w=p[0].j?p[0].j:w,x=p[0].c[0],u=p[0].c[1],K=p[0].c[2],D=p[0].c[3],H=p.borderWidth/4,r.push(T));T=q;L=C;M=v[0];Y=v[1];V=v[2];U=v[3];aa=w[0];Z=w[1];Q=w[2];N=w[3];var I=T;Qa||(Qa=B._get_block_points_address()>>2);Ea.set(I,Qa);I=O;Ya||(Ya=B._get_block_triangle_indices_address()>>1);Ja.set(I,Ya);B._append_block_data(T.length,O.length,L,X,M,Y,V,U,aa,Z,Q,N);g.push(e);
d.push(7*cb());if(n.borderWidth&&q.length&&(X=Array(q.length>>1),ec(X,100*C),F[2]))for(C=S(0,F[2][0],F[2][0]+F[2][1]),F=0;F<C.length;F++)O=C[F],L=S(0,O[0],O[0]+O[1]),O=new Int16Array(b,L[0][0],L[0][1]>>1),T=new Uint16Array(b,L[1][0],L[1][1]>>1),L=new Int8Array(b,L[2][0],L[2][1]),ob(O,[x,u,K,D],H,X,2,!0,q,L,0,T[0],T[1])}}}}}b={type:"line",data:[db(),fb()]};pb();return 0<cb()?($a||($a=B._get_block_vertex_start()),a=new Float32Array(wa.slice($a,B._get_block_vertex_end())),Za||(Za=B._get_block_index_start()),
c=new Uint16Array(wa.slice(Za,B._get_block_index_end())),g={vertex:a,index:c,styleIds:g,verticesLength:d},B._reset_block(),g.border=b,g):null}function zd(b){var a=new ArrayBuffer(b.length/8*20),c=new Float32Array(a);a=new Uint8Array(a);for(var f=0,h=12,g=4,d=0;d<b.length;d+=8)c[f]=b[d],c[f+1]=b[d+1],c[f+2]=b[d+2]/100,a[h]=b[d+3],a[h+1]=b[d+4],a[h+2]=b[d+5],a[h+3]=b[d+6],c[g]=b[d+7],f+=5,h+=20,g+=5;return c}
function ud(b,a,c,f,h){if(!a||!a.length)return 0;c=c.useZoom;for(var g=0,d=0,r=0,y=0,m=0;m<a.length;m++){var k=a[m],t=k[0]>>2;if(25===J[t+1]){k=S(J[t]+1,k[0],k[0]+k[1])[0];var e=k[0]>>2;t=J[e];if((e=xb.b(yb,J[e+1],"polygon3d",c,zb,!1,W))&&e[0]){e=e[0];var l=e.j;Lc&&(l=Lc);k=S(t+1,k[0],k[0]+k[1])[0];t=S(J[k[0]>>2]+1,k[0],k[0]+k[1]);k=new Int32Array(b,t[1][0],t[1][1]>>2);g+=k.length;if(f){e=new Int32Array(b,t[2][0],t[2][1]>>2);t=k;for(var A=f,z=y,p=new DataView(A.buffer),n,v=0;v<t.length;v+=3)n=v/3*
7+z,A[n]=t[v]/100,A[n+1]=t[v+1]/100,A[n+2]=t[v+2]/100,A[n+3]=e[v],A[n+4]=e[v+1],A[n+5]=e[v+2],p.setUint8(4*n+24,l[0]),p.setUint8(4*n+25,l[1]),p.setUint8(4*n+26,l[2]),p.setUint8(4*n+27,l[3]);t=[];for(e=0;e<k.length/3;e++)t.push(e+d);h.set(t,r);y+=k.length/3*7;r+=t.length;d+=k.length/3}}}}return g}
function td(b,a){var c=[],f=[];a=a.useZoom;for(var h=0;h<b.length;h++){var g=b[h],d=g[0]>>2;if(24===J[d+1]){d=S(J[d]+1,g[0],g[0]+g[1])[0];g=d[0]>>2;var r=J[g];if((g=xb.b(yb,J[g+1],"polygon3d",a,zb,!1,W))&&g[0])for(g=g[0],g=g.j,Lc&&(g=Lc),d=S(r+1,d[0],d[0]+d[1]),r=0;r<d.length;r++){var y=d[r][0]/4,m=c,k=f,t=c.length/10,e=J[y+1]/100,l=J[y+2]/100,A=J[y+3]/100,z=J[y+4]/100,p=g[0],n=g[1],v=g[2];for(y=0;360>=y;y+=36){var w=Math.cos(y*Math.PI/180)*l+A,H=Math.sin(y*Math.PI/180)*l+z,x=w+A,u=H+z;m.push(w,H,
0,x,u,0,p,n,v,255);m.push(w,H,e,x,u,0,p,n,v,255)}for(y=0;10>y;y++)m=2*y+t,k.push(m,m+2,m+3),k.push(m,m+3,m+1)}}}if(0<c.length){b=c.length/10;a=new Float32Array(7*b);h=new DataView(a.buffer);for(d=0;d<b;d++)g=7*d,a[g]=c[10*d],a[g+1]=c[10*d+1],a[g+2]=c[10*d+2],a[g+3]=c[10*d+3],a[g+4]=c[10*d+4],a[g+5]=c[10*d+5],h.setUint8(4*g+24,c[10*d+6]),h.setUint8(4*g+25,c[10*d+7]),h.setUint8(4*g+26,c[10*d+8]),h.setUint8(4*g+27,c[10*d+9]);c={vertex:a,index:new Uint16Array(f)}}else c=null;return c};
