!function(){for(var r=0,f=["ms","moz","webkit","o"],t=0;t>1,f|=f>>2,f|=f>>4,f|=f>>8,f|=f>>16,++f},pointDisToSegment:function(f,t,i,s,e,r){var a={},n=e-i,o=f-i,h=r-s,c=t-s,u=f-e,l=t-r,d=n*o+h*c;if(d<=0)return a.distance=Math.sqrt(o*o+c*c),a.x=i,a.y=s,a;var p=n*n+h*h;if(p<=d)return a.distance=Math.sqrt(u*u+l*l),a.x=e,a.y=r,a;var v=d/p,M=i+n*v,H=s+h*v,G=f-M,b=t-H;return a.x=M,a.y=H,a.distance=Math.sqrt(G*G+b*b),a},pointInPolygon:function(f,t){for(var i=0,s=0;sMath.max(e.y,r.y)))(f.y-e.y)*(r.x-e.x)/(r.y-e.y)+e.x>f.x&&i++}return i%2==1},pointDisToPolygon:function(f,t){if(GHMap.G.pointInPolygon(f,t))return{distance:0};for(var i=void 0,s=0;s|/);C=t.split(D);for(var E=0;EMath.abs(a[t][t])&&(e=i);if(e!=t)for(s=0;s<4;s++)r=a[t][s],a[t][s]=a[e][s],a[e][s]=r,r=n.F[4*t+s],n.F[4*t+s]=n.F[4*e+s],n.F[4*e+s]=r;if(0==a[t][t])return;for(r=a[t][t],s=0;s<4;s++)a[t][s]/=r,n.F[4*t+s]/=r;for(i=0;i<4;i++)if(i!=t)for(r=a[i][t],s=0;s<4;s++)a[i][s]-=a[t][s]*r,n.F[4*i+s]-=n.F[4*t+s]*r}return n},$f:function(f){var t=new GHMap.nf,i=[];i[0]=f[5]*f[10]*f[15]-f[5]*f[11]*f[14]-f[9]*f[6]*f[15]+f[9]*f[7]*f[14]+f[13]*f[6]*f[11]-f[13]*f[7]*f[10],i[4]=-f[4]*f[10]*f[15]+f[4]*f[11]*f[14]+f[8]*f[6]*f[15]-f[8]*f[7]*f[14]-f[12]*f[6]*f[11]+f[12]*f[7]*f[10],i[8]=f[4]*f[9]*f[15]-f[4]*f[11]*f[13]-f[8]*f[5]*f[15]+f[8]*f[7]*f[13]+f[12]*f[5]*f[11]-f[12]*f[7]*f[9],i[12]=-f[4]*f[9]*f[14]+f[4]*f[10]*f[13]+f[8]*f[5]*f[14]-f[8]*f[6]*f[13]-f[12]*f[5]*f[10]+f[12]*f[6]*f[9],i[1]=-f[1]*f[10]*f[15]+f[1]*f[11]*f[14]+f[9]*f[2]*f[15]-f[9]*f[3]*f[14]-f[13]*f[2]*f[11]+f[13]*f[3]*f[10],i[5]=f[0]*f[10]*f[15]-f[0]*f[11]*f[14]-f[8]*f[2]*f[15]+f[8]*f[3]*f[14]+f[12]*f[2]*f[11]-f[12]*f[3]*f[10],i[9]=-f[0]*f[9]*f[15]+f[0]*f[11]*f[13]+f[8]*f[1]*f[15]-f[8]*f[3]*f[13]-f[12]*f[1]*f[11]+f[12]*f[3]*f[9],i[13]=f[0]*f[9]*f[14]-f[0]*f[10]*f[13]-f[8]*f[1]*f[14]+f[8]*f[2]*f[13]+f[12]*f[1]*f[10]-f[12]*f[2]*f[9],i[2]=f[1]*f[6]*f[15]-f[1]*f[7]*f[14]-f[5]*f[2]*f[15]+f[5]*f[3]*f[14]+f[13]*f[2]*f[7]-f[13]*f[3]*f[6],i[6]=-f[0]*f[6]*f[15]+f[0]*f[7]*f[14]+f[4]*f[2]*f[15]-f[4]*f[3]*f[14]-f[12]*f[2]*f[7]+f[12]*f[3]*f[6],i[10]=f[0]*f[5]*f[15]-f[0]*f[7]*f[13]-f[4]*f[1]*f[15]+f[4]*f[3]*f[13]+f[12]*f[1]*f[7]-f[12]*f[3]*f[5],i[14]=-f[0]*f[5]*f[14]+f[0]*f[6]*f[13]+f[4]*f[1]*f[14]-f[4]*f[2]*f[13]-f[12]*f[1]*f[6]+f[12]*f[2]*f[5],i[3]=-f[1]*f[6]*f[11]+f[1]*f[7]*f[10]+f[5]*f[2]*f[11]-f[5]*f[3]*f[10]-f[9]*f[2]*f[7]+f[9]*f[3]*f[6],i[7]=f[0]*f[6]*f[11]-f[0]*f[7]*f[10]-f[4]*f[2]*f[11]+f[4]*f[3]*f[10]+f[8]*f[2]*f[7]-f[8]*f[3]*f[6],i[11]=-f[0]*f[5]*f[11]+f[0]*f[7]*f[9]+f[4]*f[1]*f[11]-f[4]*f[3]*f[9]-f[8]*f[1]*f[7]+f[8]*f[3]*f[5],i[15]=f[0]*f[5]*f[10]-f[0]*f[6]*f[9]-f[4]*f[1]*f[10]+f[4]*f[2]*f[9]+f[8]*f[1]*f[6]-f[8]*f[2]*f[5];var s=f[0]*i[0]+f[1]*i[4]+f[2]*i[8]+f[3]*i[12];if(0===s)return!1;s=1/s;for(var e=0;e<16;e+=1)t.F[e]=i[e]*s;return t}},GHMap.Direction={HORIZONTAL:0,VERTICAL:1},GHMap.ft=function(f){this.tt(f)},GHMap.ft.prototype={tt:function(f){this.$=f,this.it=[]},st:function(f,t){var i=this.it.indexOf(f);if(0<=i){if(!t)return;this.it.splice(i,1)}t?this.it.splice(0,0,f):this.it.push(f)},et:function(){return this.$.getLanguage()==GHMap.Language.CHINESE?"_td":"_otd"},rt:function(){null==this.nt&&0!=this.it.length&&(this.ot=0,this.ht())},ht:function(){var t=this;this.nt=setTimeout(function(){var f=t.it.shift();t.ct(f),t.ot++,t.ot%20==0&&(t.$.refresh(),t.ot=0),t.nt=void 0,0>16&255,this.pt=f>>8&255,this.vt=255&f,this},getHex:function(f){return 255*this.dt<<16^255*this.pt<<8^255*this.vt<<0},setAlpha:function(f){return this.Mt=f,this},getRGB:function(){return[this.dt,this.pt,this.vt]},getArray:function(){return[this.dt/255,this.pt/255,this.vt/255,this.Mt]},getRGBArray:function(){return[this.dt/255,this.pt/255,this.vt/255]}},GHMap.I=function(f,t,i){this.F=[GHMap.A.getValue(f,0),GHMap.A.getValue(t,0),GHMap.A.getValue(i,0)]},GHMap.I.makeFromArray=function(f){return new GHMap.I(f[0],f[1],f[2])},GHMap.I.prototype={constructor:GHMap.I,dot:function(f){return this.F[0]*f.F[0]+this.F[1]*f.F[1]+this.F[2]*f.F[2]},add:function(f){return this.F[0]+=f.F[0],this.F[1]+=f.F[1],this.F[2]+=f.F[2],this},addVectors:function(f){return new GHMap.I(this.F[0]+f.F[0],this.F[1]+f.F[1],this.F[2]+f.F[2])},sub:function(f){return this.F[0]-=f.F[0],this.F[1]-=f.F[1],this.F[2]-=f.F[2],this},subVectors:function(f){return new GHMap.I(this.F[0]-f.F[0],this.F[1]-f.F[1],this.F[2]-f.F[2])},mult:function(f){return this.F[0]*=f.F[0],this.F[1]*=f.F[1],this.F[2]*=f.F[2],this},multScalar:function(f){for(var t=0;t=r.length&&(h-=r.length),n.preNode=r[o],n.nextNode=r[h],n.calConvex()}for(;3x&&C.push(T.link);var I=this.Tt++;D.links.push({fromNum:F.fromNum,toNum:F.toNum,geom:[{x:f.x,y:f.y,z:f.z||0},{x:T.x,y:T.y,z:f.z||0}],length:T.distance,linkId:I,linkType:9,fnodeId:S,oneway:2,tnodeId:D.maxNode}),this.jt(F.linkId,I),x=Math.max(x,D.maxNode),s(_,D.links)}else{var D;F=t[(a=a||n).link];(D=this.splitRoute(a,a.link,x,t)).maxNode>x&&C.push(a.link);I=this.Tt++;D.links.push({fromNum:F.fromNum,toNum:F.toNum,geom:[{x:f.x,y:f.y,z:f.z||0},{x:a.x,y:a.y,z:f.z||0}],length:a.distance,linkType:9,linkId:I,oneway:2,fnodeId:S,tnodeId:D.maxNode}),this.jt(F.linkId,I),x=Math.max(x,D.maxNode),s(_,D.links)}for(p=0;pn.dy&&(r=a,a=n,n=r),a.dy>o.dy&&(r=a,a=o,o=r),n.dy>o.dy&&(r=n,n=o,o=r),a.dy&&GHMap.Qt.Kt(o,a,s,e),n.dy&&GHMap.Qt.Kt(o,n,s,e)},Kt:function(f,t,i,s){var e=GHMap.Qt.Jt,r=Math.max(i,Math.floor(t.y0)),a=Math.min(s,Math.ceil(t.y1));if(f.x0===t.x0&&f.y0===t.y0?f.x0+t.dy/f.dy*f.dxs.y){var e=i;i=s,s=e}return{x0:i.x,y0:i.y,x1:s.x,y1:s.y,dx:s.x-i.x,dy:s.y-i.y}}},GHMap.Overlay=function(){this.qt={},this.$t=!0,this.fi=0,this.ii=GHMap.OID++,this.ri=!0,this.ni="",this.oi,this.rf,this.$,this.hi,this.ci,this.ui=!1},GHMap.Overlay.prototype={li:function(f){this.$=f},setFieldObject:function(f){this.rf=f},getFieldObject:function(){return this.rf},setExtraInfo:function(f){return this.qt=f,this},getExtraInfo:function(){return this.qt},setVisible:function(f){return this.$t=f,this},isVisible:function(){return this.$t},setZIndex:function(f){return this.fi=f,this},getZIndex:function(){return this.fi},setCanClick:function(f){return this.ri=f,this},isCanClick:function(){return this.ri},setCode:function(f){return this.ni=f,this},getCode:function(){return this.ni},getId:function(){return this.ii},setFloorName:function(f){return this.oi=f,this},setName:function(f){this.hi!=f&&(this.ui=!0),this.hi=f},getName:function(){return this.hi},setOName:function(f){this.ci=f},getOName:function(){return this.ci},getFloorName:function(){return this.oi}},GHMap.Line=function(f,t){GHMap.Overlay.call(this),this.pi=f,this.if=new GHMap._,this.vi=GHMap.A.getValueFromJson(t,"width",1),this.Mi=GHMap.A.getValueFromJson(t,"dashed",!1),this.Hi=GHMap.A.getValueFromJson(t,"height",0),this.Rt=0,this.setColor(GHMap.A.getValueFromJson(t,"color","#777777")),this.af=!0,this.Gi=!1,this.wi=!0},GHMap.Line.prototype={constructor:GHMap.Line,setPoints:function(f){return this.af=null!=this.pi&&null!=f&&(this.pi!=f||this.pi.length!=f.length),this.pi=f,this},getPoints:function(){return this.pi},addPoints:function(f){return null==this.pi&&(this.pi=[]),this.pi.push(f),this.af=!0,this},setWidth:function(f){return this.af=this.vi!=f,this.vi=f,this},getWidth:function(){return this.vi},setColor:function(f){return this.af=this.gi!=f,this.gi=f,this.if.set(f),this},getColor:function(f){return this.gi},setDashed:function(f){return this.Mi=f,this},isDashed:function(){return this.Mi},setHeight:function(f){return this.af=this.Hi!=f,this.Hi=f,this},getHeight:function(){return this.Hi},setBottomHeight:function(f){return this.af=this.Rt!=f,this.Rt=f,this},getBottomHeight:function(){return this.Rt},setGpuRender:function(f){this.Gi=f},isGpuRender:function(){return this.Gi},setFlash:function(f){this.wi=f},isFlash:function(){return this.wi}},GHMap.A.copy(GHMap.Line.prototype,GHMap.Overlay.prototype),GHMap.Line.prototype.constructor=GHMap.Line,GHMap.Polygon=function(f){GHMap.Overlay.call(this),this.pi=f,this.Ai=1,this.mi=new GHMap._,this.yf=new GHMap._,this.Tf=new GHMap._,this.Hi=0,this.Rt=0,this.yi=void 0,this.Si=void 0,this.Ff=void 0,this.Ef=[],this.xi=[],this.Bf=[],this.Ci=[],this.Nf=[],this.Lf=[],this.kf=[],this.Sf=!1,this.xf=new GHMap._,this._i=void 0,this.Ti=new GHMap._,this.Fi=12,this.Ii,this.Di,this.Ei,this.Bi,this.Li=!0,this.setTextColor(),this.setSelectedColor("#ffff00")},GHMap.Polygon.prototype={constructor:GHMap.Polygon,setLogoPath:function(f){this.Ei=f},getLogoPath:function(){return this.Ei},setLogoPoints:function(f){this.Bi=f},getLogoPoints:function(){return this.Bi},setPoints:function(f){return this.pi=f,this},getPoints:function(){return this.pi},setStrokeWidth:function(f){return this.Ai=f,this},getStrokeWidth:function(){return this.Ai},setStrokeColor:function(f){return this.yi=f,this.mi.set(f),this},getStrokeColor:function(){return this.yi},setFillColor:function(f){return this.Ni=f,this.yf.set(f),this},getFillColor:function(){return this.Ni},ki:function(f){return this.mf?this.mf.set(f):this.mf=new GHMap._(f),this},Pi:function(){var f=null!=this.mf;return this.mf=void 0,f},setBottomColor:function(f){return this.Ff=f,this.Tf.set(f),this},getBottomColor:function(){return this.Ff},setHeight:function(f){return this.Hi=f,this},getHeight:function(){return this.Hi},setAlpha:function(f){return this.yf.Mt=f,this.Tf.Mt=f,this},getAlpha:function(){return this.yf.Mt},setBottomHeight:function(f){this.Rt=f},getBottomHeight:function(){return this.Rt},setSelected:function(f){this.Sf=f},isSelected:function(){return this.Sf},setSelectedColor:function(f){return this._i=f,this.xf.set(f),this},getSeletedColor:function(){return this._i},setTextColor:function(f){null==f?this.Ti="#5D5D5D":(this.Ti!=f&&(this.ui=!0),this.Ti=f)},getTextColor:function(){return this.Ti},setTextSize:function(f){this.Fi!=f&&(this.ui=!0),this.Fi=f},getTextSize:function(){return this.Fi},setTextVisible:function(f){this.Li=f},isTextVisible:function(){return this.Li},getCenter:function(){if(this.Oi)return new GHMap.Point(this.Oi.x,this.Oi.y)},setIcon:function(f){this.Di!=f&&(this.ui=!0),this.Di=f},getIcon:function(){return this.Di},setIconSize:function(f){this.Ii!=f&&(this.ui=!0),this.Ii=f},getIconSize:function(){return this.Ii}},GHMap.A.copy(GHMap.Polygon.prototype,GHMap.Overlay.prototype),GHMap.Polygon.prototype.constructor=GHMap.Polygon,GHMap.Circle=function(f,t){this.Oi=f,this.Ri=t},GHMap.Circle.prototype={Ui:function(f){return this.Oi=f,this.Oi},getCenter:function(){return this.Oi},setRadius:function(f){return this.Ri=f,this.Ri},getRadius:function(){return this.Ri}},GHMap.A.copy(GHMap.Circle.prototype,GHMap.Polygon.prototype),GHMap.Circle.prototype.constructor=GHMap.Circle,GHMap.Label=function(f){GHMap.Overlay.call(this),this.zi=f,this.Vi=1,this.hi="",this.ci="",this.Ti=new GHMap._,this.Fi=12,this.mi=new GHMap._,this.Ai=1,this.ji=new GHMap._,this.Qi=void 0,this.Ii,this.Di,this.Hi=0,this.setTextColor("#333333"),this.setStrokeColor("#FFFFFF"),this.wt=GHMap.Direction.HORIZONTAL,this.Xi=GHMap.Marker.TextAlign.CENTER,this.Yi=!0,this.Wi=""},GHMap.Label.prototype={constructor:GHMap.Label,setPosition:function(f){this.zi=f},getPosition:function(){return this.zi},setAlpha:function(f){this.Vi=f},getAlpha:function(){return this.Vi},setName:function(f){this.hi=f},getName:function(){return this.hi},setOName:function(f){this.ci=f},getOName:function(){return this.ci},setTextColor:function(f){this.Ti=null==f?"#000000":f},getTextColor:function(){return this.Ti},setTextSize:function(f){this.Fi=f},getTextSize:function(){return this.Fi},setTextBold:function(f){this.Yi!==f&&(this.ui=!0),this.Yi=f},isTextBold:function(){return this.Yi},setTextFont:function(f){this.Wi!=f&&(this.ui=!0),this.Wi=f},getTextFont:function(){return this.Wi},setStrokeColor:function(f){this.yi=f,this.yi&&this.mi.set(this.yi)},getStrokeColor:function(){return this.yi},setStrokeWidth:function(f){this.Ai=f},getStrokeWidth:function(){return this.Ai},setBackGroundColor:function(f){this.Qi=f,this.Qi&&this.ji.set(this.Qi)},getBackGroundColor:function(){return this.Qi},setTextAlign:function(f){this.Xi!=f&&(this.ui=!0),this.Xi=f},getTextAlign:function(){return this.Xi},setHeight:function(f){this.Hi=f},getHeight:function(){return this.Hi},setDirection:function(f){this.wt=f},getDirection:function(){return this.wt},setIcon:function(f){this.Di!=f&&(this.ui=!0),this.Di=f},getIcon:function(){return this.Di},setIconSize:function(f){this.Ii!=f&&(this.ui=!0),this.Ii=f},getIconSize:function(){return this.Ii}},GHMap.A.copy(GHMap.Label.prototype,GHMap.Overlay.prototype),GHMap.Label.prototype.constructor=GHMap.Label,GHMap.Label.ShowMode={COMPATIBLE:5e3,STRICT:50001},GHMap.Marker=function(f){GHMap.Overlay.call(this),this.zi=f,this.Di,this.Ji=0,this.Vi=1,this.Zi=1,this.Ki=GHMap.Marker.IconLayout.CENTER,this.Ti=new GHMap._,this.Hi=0,this.mi=new GHMap._,this.Ai=1,this.qi=GHMap.Marker.TextLayout.CENTER,this.$i=2,this.Fi=12,this.ss=!1,this.es=!0,this.Li=!0,this.rs=!0,this.Xi=GHMap.Marker.TextAlign.CENTER,this.as=void 0,this.ns=void 0,this.os=.5,this.hs=0,this.Yi=!0,this.Wi="",this.cs=void 0,this.setTextColor(),this.wt=GHMap.Direction.HORIZONTAL,this.us=!1,this.ls=void 0},GHMap.Marker.prototype={constuctor:GHMap.Marker,setHtmlContent:function(f){this.ls!=f&&(this.ls=f,this.ls?this.ps&&(this.ps.innerHTML=f):this.ps&&(GHMap.Xf.remove(this.ps),this.ps=void 0,delete this.ps),this.$&&this.$.refresh())},getHtmlContent:function(){return this.ls},setTextBold:function(f){this.Yi!==f&&(this.ui=!0),this.Yi=f},isTextBold:function(){return this.Yi},setTextFont:function(f){this.Wi!=f&&(this.ui=!0),this.Wi=f},getTextFont:function(){return this.Wi},setTextBackgroundRadius:function(f){this.hs!=f&&(this.ui=!0),this.hs=f},getTextBackgroundRadius:function(){return this.hs},setTextAlign:function(f){this.Xi!=f&&(this.ui=!0),this.Xi=f},getTextAlign:function(){return this.Xi},setUseAnimation:function(f){this.rs=f},isUseAnimation:function(){return this.rs},setPosition:function(f){this.zi=f},getPosition:function(){return this.zi},setTextVisible:function(f){this.Li=f},isTextVisible:function(){return this.Li},panTo:function(f){if(this.zi&&this.$){var t=new GHMap.Ms.MarkerPan(this.$,this);this.$.Hs.stopOthers(t),t.setValue({x:f.x-this.zi.x,y:f.y-this.zi.y,z:f.z-this.zi.z}),this.$.Hs.addTween(t)}else this.zi=f},setIcon:function(f){this.Di?this.Di!=f&&(this.Di=f,this.us=!0):this.Di=f},getIcon:function(){return this.Di},setRotate:function(f){this.Ji=f},getRotate:function(f){return this.Ji},setAlpha:function(f){this.Vi=f},getAlpha:function(){return this.Vi},setScale:function(f,t){t?this.Zi*=f:this.Zi=f},getScale:function(){return this.Zi},setIconLayout:function(f){this.Ki=f},getIconLayout:function(){return this.Ki},setHeight:function(f){this.Hi=f},getHeight:function(){return this.Hi},setTextColor:function(f){null==f?this.Gs="#000000":(this.Gs!=f&&(this.ui=!0),this.Gs=f),this.Ti.set(this.Gs)},getTextColor:function(){return this.Gs},setTextSize:function(f){this.Fi!=f&&(this.ui=!0),this.Fi=f},getTextSize:function(){return this.Fi},setStrokeColor:function(f){this.Gs!=f&&(this.ui=!0),this.yi=f,this.yi&&this.mi.set(this.yi)},getStrokeColor:function(){return this.yi},setStrokeWidth:function(f){this.Ai!=f&&(this.ui=!0),this.Ai=f},getStrokeWidth:function(){return this.Ai},setTextLayout:function(f){this.qi=f},getTextLayout:function(){return this.qi},setSpacing:function(f){this.$i=f},getSpacing:function(f){return this.$i},isAvoid:function(){return this.ss},setAvoid:function(f){this.ss=f},setSprite:function(f){this.es=f},isSprite:function(){return this.es},setDirection:function(f){this.wt=f},getDirection:function(){return this.wt},setTextBackgroundColor:function(f){this.as!=f&&(this.ui=!0),this.as=f},getTextBackgroundColor:function(){return this.as},setTextBackgroundBorderColor:function(f){this.ns!=f&&(this.ui=!0),this.ns=f},getTextBackgroundBorderColor:function(f){return this.ns},setTextBackgroundBorderWidth:function(f){this.os!=f&&(this.ui=!0),this.os=f},getTextBackgroundBorderWidth:function(){return this.os},setOffset:function(f){this.cs=f},getOffset:function(){return this.cs}},GHMap.A.copy(GHMap.Marker.prototype,GHMap.Overlay.prototype),GHMap.Marker.prototype.constructor=GHMap.Marker,GHMap.Marker.IconLayout={CENTER:1e3,BOTTOM_CENTER:1001},GHMap.Marker.TextLayout={TOP:2e3,BOTTOM:2001,RIGHT:2002,LEFT:2003,CENTER:2004},GHMap.Marker.TextAlign={LEFT:3e3,CENTER:3001,RIGHT:3002,TOP:3003,BOTTOM:3004},GHMap.InfoWindow=function(f){this.$=f.map,this.bs=f.mapContainer,this.ws=!1,this.init()},GHMap.InfoWindow.prototype={init:function(){this.gs=GHMap.Xf.createElement({class:"gh-infowindow-container"}),this.As=GHMap.Xf.createElement({class:"gh-infowindow"}),this.ms=GHMap.Xf.createElement({class:"gh-infowindow-content"}),this.ys=GHMap.Xf.createElement({class:"gh-infowindow-triangle-down-border"}),this.Ss=GHMap.Xf.createElement({class:"gh-infowindow-triangle-down"}),this.gs.style.display="none",GHMap.Xf.append(this.gs,this.As),GHMap.Xf.append(this.ys,this.Ss),GHMap.Xf.append(this.As,this.ms),GHMap.Xf.append(this.As,this.ys),GHMap.Xf.append(this.bs,this.gs)},open:function(f){var t=GHMap.A.getValueFromJson(f,"width",200),i=GHMap.A.getValueFromJson(f,"content","");this.xs=GHMap.A.getValueFromJson(f,"point",void 0),this.cs=GHMap.A.getValueFromJson(f,"offset",0),this.Cs=GHMap.A.getValueFromJson(f,"floor",this.$.getCurrentFloorName()),this.ms.style.width=t+"px",this.ms.innerHTML=i,this.gs.style.display="block",this.ws=!1,this.render()},hide:function(){this.gs.style.display="none",this.ws=!0},isOpen:function(){return!this.ws},render:function(){if(this.xs&&!this.ws)if(this.Cs==this.$.getCurrentFloorName()){this.gs.style.display="block";var f=new GHMap.Point(this.xs.x,this.xs.y,this.xs.z*this.$.q.s),t=this.$.gp2px(f);this.$.isUseDevicePixelRatio()&&(t.x/=window.devicePixelRatioMap,t.y/=window.devicePixelRatioMap),this.gs.style.left=t.x-this.ms.clientWidth/2+"px",this.gs.style.top=t.y-this.ms.clientHeight+this.cs+"px"}else this.gs.style.display="none"}},GHMap._s=function(f){GHMap.Overlay.call(this),this.rf=f.f,this.Rt=GHMap.A.getValueFromJson(f.f,"BOTH",0)},GHMap._s.prototype={constuctor:GHMap._s,getBottomHeight:function(){return this.Rt}},GHMap.A.copy(GHMap._s.prototype,GHMap.Overlay.prototype),GHMap._s.prototype.constructor=GHMap._s,GHMap.Ts=function(f){this.objLayer=f,this.idCache={};var a=this;f.$.Is.Fs(GHMap.ThreadSrc,function(f){var t,i,s,e,r;a.worker=new Worker((t=f,i=window.URL||window.webkitURL,s=new Blob([t]),i.createObjectURL(s))),(r=(e=a).worker).onmessage=function(f){var t=f.data;if(t){var i=e.getObj3D(t.oid);for(var s in delete t.oid,t)t[s].m=i.queryMaterialByName(s);i.Ds=t,i.Es=!1}e.objLayer.$.refresh()},r.onerror=function(f){e.objLayer.it.forEach(function(f){f.Es=!1})}})},GHMap.Ts.prototype={getObj3D:function(f){return this.idCache[f]},addObj3D:function(f){this.idCache[f.id]=f},queryMaterialByName:function(f,t){return f.queryMaterialByName(t)}},GHMap.Bs=function(f,t){this.$=f,this.Ls=t},GHMap.Bs.prototype={Ns:function(f,t,i,s,e){var r=f+"_"+t,a=this.Ls[r].res,n=256*(this.$.q.s*a);this.ks=i*n-this.$.q.lx,this.Ps=s*n-this.$.q.ly,this.Os=this.ks+n,this.Rs=this.Ps+n,this.Us=e.texture}},GHMap.Polyline=function(f,t){GHMap.Line.call(this,f,t),this.zs=500,this.rs=!1,this.Vs=0,this.js=1e4,this.Qs=1},GHMap.Polyline.prototype={constructor:GHMap.Polyline,setUseAnimation:function(f){this.rs=f},isUseAnimation:function(){return this.rs},setAnimationTime:function(f){this.zs=f},getAnimationTime:function(){return this.zs},setIcon:function(f){this.Di!=f&&(this.us=!0),this.Di=f},getIcon:function(){return this.Di},setFlyHeight:function(f){this.Vs=f},setFlyTime:function(f){this.js=f},setShiness:function(f){this.Qs=f},getShiness:function(){return this.Qs},getFlyHeight:function(){return this.Vs},getFlyTime:function(){return this.js}},GHMap.A.copy(GHMap.Polyline.prototype,GHMap.Line.prototype),GHMap.Polyline.prototype.constructor=GHMap.Polyline,GHMap.Xs=function(f){this.it=[],this.pi=[],this.ii=++GHMap.Ys,this.tt(f)},GHMap.Ys=0,GHMap.Xs.prototype={tt:function(f){for(var t=0;t|/g," ")).toLowerCase().indexOf(t.toLowerCase())},GHMap.Te.prototype.jr=function(f,t,i,s){for(var e=!1,r=0;rs.distance&&(e=1):i.crossWall&&!s.crossWall?e=1:!i.crossWall&&s.crossWall&&(e=-1),e}),G},GHMap.Te.prototype.Vt=function(f,t){for(var i=!1,s=0;sj&&(O=-(U=W.width/2)),F.Ua.left=-W.width/2,F.Ua.right=-F.Ua.left,F.Ua.bottom=R,R+=W.height,F.Ua.top=R;break;case GHMap.Marker.TextLayout.BOTTOM:z-=P,W.width>j&&(O=-(U=W.width/2)),F.Ua.left=-W.width/2,F.Ua.right=-F.Ua.left,F.Ua.top=z,z-=W.height,F.Ua.bottom=z;break;case GHMap.Marker.TextLayout.RIGHT:U+=P,W.height>Q&&(z=-(R=W.height/2)),F.Ua.top=W.height/2,F.Ua.bottom=-F.Ua.top,F.Ua.left=U,U+=W.width,F.Ua.right=U;break;case GHMap.Marker.TextLayout.LEFT:O-=P,W.height>Q&&(z=-(R=W.height/2)),F.Ua.top=W.height/2,F.Ua.bottom=-F.Ua.top,F.Ua.right=O,O-=W.width,F.Ua.left=O;break;case GHMap.Marker.TextLayout.CENTER:F.Ua.top=W.height/2,F.Ua.bottom=-F.Ua.top,F.Ua.right=W.width/2,F.Ua.left=-F.Ua.right,U=-(O=Math.min(F.Ua.left,-j/2)),z=-(R=Math.max(F.Ua.top,Q/2))}}var J=!0,Z=null==F.za?0:F.za;Z*=this.$.uf.vi/2;var K=null==F.Va?0:F.Va;if(K*=this.$.uf.Hi/2,t&&(F.Oa&&(O=F.Oa.left,U=F.Oa.right,R=F.Oa.top,z=F.Oa.bottom),Y&&!1!==F.Ca)){Y.style.display="";var q=Y.clientWidth,$=Y.clientHeight,ff=q/1,tf=$/1,sf=Q,ef=E.y-z,rf=E.x+1*O,af=E.x+1*U;if(ef-=K,this.$.isUseDevicePixelRatio()){var nf=window.devicePixelRatioMap;ef/=nf,rf/=nf,af/=nf,sf/=nf,ff*=1,tf*=1}var of=ef,hf=(rf+af)/2-q/2;switch(0==O&&O==U&&O==R&&U==R&&(U=-(O=-ff/2),z=-(R=tf/2)),F.getTextLayout()){case GHMap.Marker.TextLayout.TOP:R+=P,z+=P,jo.distance&&(s=o):s=o)}}return void 0!==s?new GHMap.Point(s.x,s.y):s},GHMap.qa.prototype.updateUpDown=function(){this.sn.clear();var f=50;this.$.isUseDevicePixelRatio()&&(f*=window.devicePixelRatioMap);for(var t=f/this.$.uf.vi,i=0;iu.min&&e<=u.max&&(h=u.color)}a=GHMap.A.getContextColor(h),s.fillStyle=a.color,s.globalAlpha=a.alpha,s.beginPath(),s.arc(n,n,n,0,2*Math.PI,!0),s.closePath(),s.fill(),s.font=fontStr,a=GHMap.A.getContextColor(this.Ti),s.fillStyle=a.color,s.globalAlpha=a.alpha;var l=this.ch;if(0=this.$.getMinZoomLevel();s--){var r;e=f+"_"+s;if(r=this.Ls[e]){t={zoom:s,pxScale:r.res,rect:this.Ls[e].rect};break}}return t},render:function(f){if(!this.Nh)if(this.Ls){var t=this.$.getCurrentFloorLayer(),i=t.Rt,s=t.hi,e=this.kh(s);if(e){var r=e.zoom,a=e.pxScale,n=this.$.uf.getExtent(),o=256*a*this.$.q.s,h=n.ut.x+this.$.q.lx,c=n.ut.y+this.$.q.ly,u=n.lt.x+this.$.q.lx,l=n.lt.y+this.$.q.ly,d=Math.floor(h/o),p=Math.floor(c/o),v=Math.ceil(u/o),M=Math.ceil(l/o),H=GHMap.A.copy({},f);H.indice=[0,1,2,0,2,3],H.coord=[0,0,1,0,1,1,0,1],H.bottomHeight=i+1.5*GHMap.A.getLayerDisHeight(this.$);var G=this.$.Rf;G.blendFunc(G.ONE,G.ONE_MINUS_SRC_ALPHA);var b=e.rect;d=Math.max(b[0],d),p=Math.max(b[1],p),v=Math.min(b[2],v),M=Math.min(b[3],M);for(var w=d;w=this.Oh){var n=this.zh.indexOf(f);-1= 0.68 && color.r <= 0.69 && color.g >= 0.82 && color.g <= 0.83 && color.b >= 0.99 && color.b <= 1.0; ","\ta = a || ( color.r >= 0.64 && color.r <= 0.65 && color.g >= 0.8 && color.g <= 0.81 && color.b >= 0.99 && color.b <= 1.0 ) ; ","\treturn a ; ","}","void main(void){","\tvec3 difColor = vec3(0.0);\t","\tvec3 specColor = vec3(0.0);\t","\tif(uUseLight == 1.0){\t","\t\tfor(int i = 0; i < MAX_LIGHT_COUNT; i++){\t","\t\t\tif(i > uDirLightCount) break;","\t\t\tvec3 lightDirection = uDirLightDirection[i];\t","\t\t\tbool keep = uDirLightKeep[i];\t\t\t","\t\t\tvec4 dir = vec4(lightDirection, 0.0);\t","\t\t\tif(keep) dir = invMatrix * dir;\t","\t\t\tvec3 invLight = normalize(dir.xyz);","\t\t\tvec3 invEye = normalize(uEyeDirection);","\t\t\tvec3 halfLE = normalize(invLight + invEye);\t","\t\t\tfloat dv = max( dot(vNormal, invLight) , 0.0); ","\t\t\tfloat diffuse = uDifMin + (uDifMax - uDifMin ) * dv; ","\t\t\tfloat specular = pow(clamp(dot(vNormal, halfLE), 0.0, 1.0), 0.5); ","\t\t\tdifColor += uDirLightColor[i] * diffuse;\t","\t\t\tspecColor += specular ;\t","\t\t}\t","\t}\t"," bool isWater = false; ","\tif(uType == 1.0){","\t\tif(vColor.a == 0.0) discard;","\t\tgl_FragColor = vColor;","\t}else if(uType == 3.0){ ","\t\tif(uSamplerColor.a == 0.0) discard;","\t\tgl_FragColor = uSamplerColor;\t","\t}else if(uType == 4.0){ ","\t\tvec4 tcolor = texture2D(uSampler, vTextureCoord);\t\t","\t\tgl_FragColor.rgb = \ttcolor.rgb * tcolor.a + uSamplerColor.rgb * ( 1.0 - tcolor.a ) ;\t","\t\tgl_FragColor.a = uSamplerColor.a; ","\t\tif(gl_FragColor.a == 0.0) discard;"," } else {\t\t\t\t","\t\tgl_FragColor = texture2D(uSampler, vTextureCoord); ","\t\tif(gl_FragColor.a == 0.0) discard;","\t\tif( u_type_reflect == 1 ) { ","\t\t\tisWater = checkWater( gl_FragColor ); ","\t\t\tif( isWater ) { ","\t\t\t\tvec2 _uv = gl_FragCoord.xy / vec2( uScreenWidth , uScreenHeight ); ","\t\t\t\tvec4 color4 = texture2D(u_sampler_reflect, _uv); ","\t\t\t\tif(color4.a > 0.0 ) gl_FragColor.rgb = mix( gl_FragColor.rgb, color4.rgb, 0.5); ","\t\t\t} ","\t\t}","\t}","\tif(uUseLight == 1.0){","\t\tgl_FragColor = gl_FragColor * vec4(difColor,1.0) + vec4(specColor,0.0) * vec4(0.2,0.2,0.2,0.0);","\t}","\tif(uNightMode == 1 && !isWater ) { ","\t\tgl_FragColor.rgb = blueGrayColor( gl_FragColor.rgb ) ; ","\t}","\tgl_FragColor *= uAlpha * globalAlpha; ","\tif( v_shiness != 0.0 )gl_FragColor.rgb *= v_shiness ; ","\tif(useDepthExt == 1) {","\t\t#ifdef USE_DEPTH_EXT","\t\t\tfloat fz = gl_FragCoord.z / gl_FragCoord.w; ","\t\t\tgl_FragDepthEXT = (fz - uNear ) / (uFar - uNear) ; ","\t\t#endif","\t}","}"],this.gc={},this.init(this.Gc,this.wc)},GHMap.Mc.prototype={constructor:GHMap.Mc,init:function(f,t){var i=this.Hc;i.createProgram(f.join("\n"),GHMap.Q.jf(this.$)+t.join("\n")),i.isValid()&&(i.useProgram(),GHMap.Q.setUniformLoc(this.gc,i,["mvpMatrix","heightScale","bottomHeight","uType","uSampler","uScreenWidth","uScreenHeight","useScreenPoint","uSamplerColor","uUseLight","invMatrix","uEyeDirection","uDirLightCount","uDirLightColor","uDirLightKeep","uDirLightDirection","uMixFactor","uNightMode","uAlpha","uDifMin","uDifMax","renderRoute","globalAlpha","uvOffsetY","uFar","uNear","useDepthExt","mapScale","u_sampler_reflect","u_type_reflect"]),GHMap.Q.setAttribLoc(this.gc,i,["aVertexColor","aVertexPosition","aTextureCoord","aNormal","aMixColor","a_shiness"]))},useLight:function(f){var t=this.Rf;if(f.useLight){if(f.dir){var i=f.dir;t.uniform1i(this.gc.uDirLightCount,i.count),t.uniform3fv(this.gc.uDirLightColor,i.color),t.uniform1iv(this.gc.uDirLightKeep,i.keep),t.uniform3fv(this.gc.uDirLightDirection,i.dir),t.uniform3fv(this.gc.uEyeDirection,f.eyeDirData),t.uniformMatrix4fv(this.gc.invMatrix,!1,f.invData)}t.uniform1f(this.gc.uUseLight,1)}else t.uniform1f(this.gc.uUseLight,0);return f.useLight},render:function(f){this.Hc.useProgram();var t=this.Rf;f.closeCurface&&t.disable(t.CULL_FACE),t.uniformMatrix4fv(this.gc.mvpMatrix,t.FALSE,f.mvpData);var i=this.$.Qe;f.Ac&&i 0.5) color.a = 0.0 ; ","\t}","\tgl_FragColor = color * globalAlpha;","\t#ifdef USE_DEPTH_EXT","\t\tfloat fz = gl_FragCoord.z / gl_FragCoord.w; ","\t\tgl_FragDepthEXT = (fz - uNear ) / (uFar - uNear) ; ","\t#endif","}"],this.gc={},this.init(this.Gc,this.wc)},GHMap._c.prototype={constructor:GHMap._c,init:function(f,t){var i=this.Hc;i.createProgram(f.join("\n"),GHMap.Q.jf(this.$)+t.join("\n")),i.isValid()&&(i.useProgram(),GHMap.Q.setUniformLoc(this.gc,i,["mvpMatrix","heightScale","screenWidth","screenHeight","bottomHeight","globalAlpha","uFar","uNear","mapScale"]),GHMap.Q.setAttribLoc(this.gc,i,["aVertexColor","aVertexPosition","aStartVertexPosition","aDashs"]))},render:function(f){this.Hc.useProgram();var t,i,s=this.Rf;s.uniformMatrix4fv(this.gc.mvpMatrix,s.FALSE,f.mvpData),s.uniform1f(this.gc.screenWidth,f.screenWidth),s.uniform1f(this.gc.screenHeight,f.screenHeight),s.uniform1f(this.gc.mapScale,.001*this.$.q.s),s.uniform1f(this.gc.heightScale,this.$.Qe),s.uniform1f(this.gc.bottomHeight,void 0===f.bottomHeight?0:f.bottomHeight+f.bottomOffset),s.uniform1f(this.gc.globalAlpha,void 0===f.globalAlpha?1:f.globalAlpha),s.uniform1f(this.gc.uFar,this.$.uf.Sc),s.uniform1f(this.gc.uNear,this.$.uf.xc);var e=GHMap.Q.bufferData(s,f.vertex),r=GHMap.Q.bufferData(s,f.color),a=GHMap.Q.bufferIndiceData(s,f.indice);s.enableVertexAttribArray(this.gc.aVertexPosition),s.enableVertexAttribArray(this.gc.aVertexColor),s.bindBuffer(s.ARRAY_BUFFER,e),s.vertexAttribPointer(this.gc.aVertexPosition,4,s.FLOAT,s.FALSE,0,0),s.bindBuffer(s.ARRAY_BUFFER,r),s.vertexAttribPointer(this.gc.aVertexColor,4,s.FLOAT,s.FALSE,0,0),f.startVertex&&(s.enableVertexAttribArray(this.gc.aStartVertexPosition),t=GHMap.Q.bufferData(s,f.startVertex),s.bindBuffer(s.ARRAY_BUFFER,t),s.vertexAttribPointer(this.gc.aStartVertexPosition,3,s.FLOAT,s.FALSE,0,0)),f.dashs&&(s.enableVertexAttribArray(this.gc.aDashs),i=GHMap.Q.bufferData(s,f.dashs),s.bindBuffer(s.ARRAY_BUFFER,i),s.vertexAttribPointer(this.gc.aDashs,2,s.FLOAT,s.FALSE,0,0)),s.lineWidth(1),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,a),s.drawElements(s.LINES,f.indice.length,s.UNSIGNED_SHORT,0),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,null),s.bindBuffer(s.ARRAY_BUFFER,null),s.disableVertexAttribArray(this.gc.aVertexPosition),s.disableVertexAttribArray(this.gc.aVertexColor),s.disableVertexAttribArray(this.gc.aStartVertexPosition),s.disableVertexAttribArray(this.gc.aDashs),GHMap.Q.releaseBuffer(s,e),GHMap.Q.releaseBuffer(s,r),t&&GHMap.Q.releaseBuffer(s,t),i&&GHMap.Q.releaseBuffer(s,i),GHMap.Q.releaseBuffer(s,a)},release:function(){this.Hc.release()}},GHMap.Tc=function(f){this.$=f,this.Rf=f.getGLContext(),this.Fc=this.Rf.getExtension("ANGLE_instanced_arrays"),this.Fc||console.log("浏览器不支持 ANGLE_instanced_arrays 扩展"),this.Hc=new GHMap.Program(this.Rf),this.Ic=new GHMap.Program(this.Rf),this.Dc=new GHMap.Program(this.Rf),this.Ec=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;\t","#else\t","precision mediump float","#endif\t\n"],this.Gc=["attribute vec2 aVertexPosition;","attribute highp vec2 aTextureCoord;","varying highp vec2 vTextureCoord;","void main(void) {","\tvec4 pTran = vec4(aVertexPosition.x,aVertexPosition.y,0.0,1.0);","\tgl_Position\t= pTran;","\tvTextureCoord = aTextureCoord; ","}"],this.wc=["varying highp vec2 vTextureCoord;\t","uniform sampler2D uSampler; ","uniform sampler2D uSampler2;","uniform float uFar\t; ","uniform float uNear; ","void main(void){","\thighp vec4 color = texture2D(uSampler2, vTextureCoord);","\thighp float alpha = color.a;\t","\tif(alpha == 0.0) discard;","\tgl_FragColor = texture2D(uSampler,vec2(alpha,0.5));\t","\talpha /= 0.7;","\tif(alpha > 0.7)\talpha = 0.7;","\tgl_FragColor.a = alpha ; ","\t#ifdef USE_DEPTH_EXT","\t\tfloat fz = gl_FragCoord.z / gl_FragCoord.w; ","\t\tgl_FragDepthEXT = (fz - uNear ) / (uFar - uNear) ; ","\t#endif","}"],this.Bc=["attribute vec3 aVertexPosition;","attribute vec2 aCenterPosition;","attribute float aValue;","uniform mat4 mvpMatrix;","uniform float height; ","varying highp float vAlpha;\t","varying highp float vValue;\t","void main(void){","\tvec4 pTan = vec4(aVertexPosition.x + aCenterPosition.x,aVertexPosition.y + aCenterPosition.y,height,1.0);","\tgl_Position = mvpMatrix * pTan;","\tvAlpha = aVertexPosition.z;\t","\tvValue = aValue;\t","}"],this.Lc=["uniform highp float uMinValue;","uniform highp float uMaxValue;","uniform float uFar\t; ","uniform float uNear; ","varying highp float vAlpha;\t","varying highp float vValue;\t","vec2 packDepth16( in float depth ) {\t","\tfloat depthVal = depth * (256.0*256.0 - 1.0) / (256.0*256.0);\t","\tvec3 encode = fract( depthVal * vec3(1.0, 256.0, 256.0*256.0) );\t","\treturn encode.xy - encode.yz / 256.0 + 1.0/512.0;\t"," }\t","void main(void){","\thighp vec4 color = vec4(1.0,0.0,0.0,1.0);","\thighp float alpha = (vValue - uMinValue) / (uMaxValue -uMinValue );","\tcolor.a = vAlpha * smoothstep(0.0 , 1.0, alpha); ","\tgl_FragColor = color;","\t#ifdef USE_DEPTH_EXT","\t\tfloat fz = gl_FragCoord.z / gl_FragCoord.w; ","\t\tgl_FragDepthEXT = (fz - uNear ) / (uFar - uNear) ; ","\t#endif","}"],this.Nc=["attribute vec3 aVertexPosition;","attribute highp vec2 aTextureCoord;","uniform sampler2D uFrameSampler; ","uniform mat4 mvpMatrix;","uniform float uWidth; ","uniform float uHeight; ","varying highp vec2 vTextureCoord;","void main(void){","\tvec4 pTan = vec4(aVertexPosition , 1.0);","\tgl_Position = mvpMatrix * pTan;","\tvTextureCoord = aTextureCoord;\t","}"],this.kc=["varying highp vec2 vTextureCoord;\t","uniform sampler2D uSampler; ","uniform sampler2D uSampler2;","uniform float uWidth; ","uniform float uHeight; ","uniform float uFar\t; ","uniform float uNear; ","void main(void){","\thighp vec4 color = texture2D(uSampler2, vTextureCoord);","\thighp float alpha = color.a;\t","\tif(alpha == 0.0) discard;","\tfloat weight[5];","\tweight[0] = 0.227027; ","\tweight[1] = 0.1945946; ","\tweight[2] = 0.1216216; ","\tweight[3] = 0.054054; ","\tweight[4] = 0.016216; ","\tvec2 coord = vec2( alpha, 0.5); ","\tvec2 tex_offset = vec2( 20.0 / uWidth , 0.0); ","\tvec3 result = texture2D(uSampler, coord).rgb * weight[0];\t","\tresult += texture2D(uSampler, coord + vec2(tex_offset.x * 1.0, 0.0)).rgb * weight[1];","\tresult += texture2D(uSampler, coord - vec2(tex_offset.x * 1.0, 0.0)).rgb * weight[1];","\tresult += texture2D(uSampler, coord + vec2(tex_offset.x * 2.0, 0.0)).rgb * weight[2];","\tresult += texture2D(uSampler, coord - vec2(tex_offset.x * 2.0, 0.0)).rgb * weight[2];","\tresult += texture2D(uSampler, coord + vec2(tex_offset.x * 3.0, 0.0)).rgb * weight[3];","\tresult += texture2D(uSampler, coord - vec2(tex_offset.x * 3.0, 0.0)).rgb * weight[3];","\tresult += texture2D(uSampler, coord + vec2(tex_offset.x * 4.0, 0.0)).rgb * weight[4];","\tresult += texture2D(uSampler, coord - vec2(tex_offset.x * 4.0, 0.0)).rgb * weight[4];","\talpha *= 1.65;","\tif(alpha > 0.9)\talpha = 0.9;","\tgl_FragColor = vec4( result , alpha ); ","\t#ifdef USE_DEPTH_EXT","\t\tfloat fz = gl_FragCoord.z / gl_FragCoord.w; ","\t\tgl_FragDepthEXT = (fz - uNear ) / (uFar - uNear) ; ","\t#endif","}"],this.gc={},this.Pc={},this.Oc={},this.init()},GHMap.Tc.prototype={init:function(){var f=this.Ec.join("\n");this.Hc.createProgram(f+this.Gc.join("\n"),f+GHMap.Q.jf(this.$)+this.wc.join("\n")),this.Hc.isValid()&&(this.Hc.useProgram(),GHMap.Q.setUniformLoc(this.gc,this.Hc,["uSampler","uSampler2","uFar","uNear"]),GHMap.Q.setAttribLoc(this.gc,this.Hc,["aVertexPosition","aTextureCoord"])),this.Ic.createProgram(f+this.Bc.join("\n"),f+GHMap.Q.jf(this.$)+this.Lc.join("\n")),this.Ic.isValid()&&(this.Ic.useProgram(),GHMap.Q.setUniformLoc(this.Pc,this.Ic,["mvpMatrix","uMinValue","uMaxValue","height","uFar","uNear"]),GHMap.Q.setAttribLoc(this.Pc,this.Ic,["aVertexPosition","aCenterPosition","aValue"])),this.Dc.createProgram(f+this.Nc.join("\n"),f+GHMap.Q.jf(this.$)+this.kc.join("\n")),this.Dc.isValid()&&(this.Dc.useProgram(),GHMap.Q.setUniformLoc(this.Oc,this.Dc,["mvpMatrix","uSampler","uSampler2","uWidth","uHeight","uFar","uNear"]),GHMap.Q.setAttribLoc(this.Oc,this.Dc,["aVertexPosition","aTextureCoord"]))},renderHeight:function(f){var t=this.Rc;if(this.pixelsToTexture(),this.Dc.isValid()){this.Dc.useProgram();var i=this.Rf;i.blendFunc(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA),i.uniform1f(this.Oc.uWidth,f.screenWidth),i.uniform1f(this.Oc.uHeight,f.screenHeight),i.uniformMatrix4fv(this.Oc.mvpMatrix,!1,f.mvpData),i.uniform1f(this.Oc.uFar,this.$.uf.Sc),i.uniform1f(this.Oc.uNear,this.$.uf.xc);var s=GHMap.Q.bufferData(i,f.vertex),e=GHMap.Q.bufferData(i,f.coord);i.enableVertexAttribArray(this.Oc.aVertexPosition),i.bindBuffer(i.ARRAY_BUFFER,s),i.vertexAttribPointer(this.Oc.aVertexPosition,3,i.FLOAT,i.FALSE,0,0),i.enableVertexAttribArray(this.Oc.aTextureCoord),i.bindBuffer(i.ARRAY_BUFFER,e),i.vertexAttribPointer(this.Oc.aTextureCoord,2,i.FLOAT,i.FALSE,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,f.texture),i.uniform1i(this.Oc.uSampler,0),i.activeTexture(i.TEXTURE1),i.bindTexture(i.TEXTURE_2D,t.texture),i.uniform1i(this.Oc.uSampler2,1);var r=GHMap.Q.bufferIndiceData(i,f.indice);i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,r),i.drawElements(i.TRIANGLES,6*f.count/4,i.UNSIGNED_SHORT,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,null),i.bindBuffer(i.ARRAY_BUFFER,null),i.disableVertexAttribArray(this.Oc.aVertexPosition),i.disableVertexAttribArray(this.Oc.aVertexColor)}},deleteFbo:function(){if(this.Rc){var f=this.Rc,t=this.Rf;t.deleteTexture(f.texture),t.deleteRenderbuffer(f.depthBuffer),t.deleteFramebuffer(f),this.Rc=null}},Uc:function(){var f=this.$.uf,t=f.vi,i=f.Hi;this.zc||(this.zc=document.createElement("canvas"),this.Vc=this.zc.getContext("2d"));var s=this.zc,e=this.Vc;s.width=t,s.height=i;for(var r=e.createImageData(t,i),a=this.jc.length,n=3;n uDirLightCount) break;","\t\t\tvec3 lightDirection = uDirLightDirection[i];\t","\t\t\tbool keep = uDirLightKeep[i];\t\t\t","\t\t\tvec4 dir = vec4(lightDirection, 0.0);\t","\t\t\tif(keep) dir = invMatrix * dir;\t","\t\t\tvec3 invLight = normalize(dir.xyz);","\t\t\tvec3 invEye = normalize(uEyeDirection);","\t\t\tvec3 halfLE = normalize(invLight + invEye);\t","\t\t\tfloat dv = max( dot(vNormal, invLight) , 0.0); ","\t\t\tfloat diffuse = uDifMin + (uDifMax - uDifMin ) * dv; ","\t\t\tfloat specular = pow(clamp(dot(vNormal, halfLE), 0.0, 1.0), 0.5); ","\t\t\tdifColor += uDirLightColor[i] * diffuse;\t","\t\t\tspecColor += specular ;\t","\t\t}\t","\t}\t","\tgl_FragColor = vColor;","\tif(uUseLight == 1.0){","\t\tgl_FragColor = gl_FragColor * vec4(difColor,1.0) + vec4(specColor,0.0) * vec4(0.2,0.2,0.2,0.0);","\t}","\tgl_FragColor *= uAlpha * globalAlpha; ","\tif(useDepthExt == 1) {","\t\t#ifdef USE_DEPTH_EXT","\t\t\tfloat fz = gl_FragCoord.z / gl_FragCoord.w; ","\t\t\tgl_FragDepthEXT = (fz - uNear ) / (uFar - uNear) ; ","\t\t#endif","\t}","}"],this.gc={},this.init(this.Gc,this.wc)},GHMap.Yc.prototype={constructor:GHMap.Yc,init:function(f,t){var i=this.Hc;i.createProgram(f.join("\n"),GHMap.Q.jf(this.$)+t.join("\n")),i.isValid()&&(i.useProgram(),GHMap.Q.setUniformLoc(this.gc,i,["mvpMatrix","heightScale","bottomHeight","uUseLight","invMatrix","uEyeDirection","uDirLightCount","uDirLightColor","uDirLightKeep","uDirLightDirection","uFar","uNear","uAlpha","uDifMin","uDifMax","globalAlpha","useDepthExt","mapScale"]),GHMap.Q.setAttribLoc(this.gc,i,["aVertexColor","aVertexPosition","aNormal","aV1","aV2","aV3","aV4"]))},useLight:function(f){var t=this.Rf;if(f.useLight){if(f.dir){var i=f.dir;t.uniform1i(this.gc.uDirLightCount,i.count),t.uniform3fv(this.gc.uDirLightColor,i.color),t.uniform1iv(this.gc.uDirLightKeep,i.keep),t.uniform3fv(this.gc.uDirLightDirection,i.dir),t.uniform3fv(this.gc.uEyeDirection,f.eyeDirData),t.uniformMatrix4fv(this.gc.invMatrix,!1,f.invData)}t.uniform1f(this.gc.uUseLight,1)}else t.uniform1f(this.gc.uUseLight,0);return f.useLight},render:function(f){if(this.Fc){this.Hc.useProgram();var s=this.Rf,e=this.Fc;f.closeCurface&&s.disable(s.CULL_FACE),s.uniformMatrix4fv(this.gc.mvpMatrix,s.FALSE,f.mvpData),s.uniform1f(this.gc.heightScale,this.$.Qe),s.uniform1f(this.gc.bottomHeight,void 0===f.bottomHeight?0:f.bottomHeight+f.bottomOffset),s.uniform1f(this.gc.mapScale,0),s.uniform1f(this.gc.uFar,this.$.uf.Sc),s.uniform1f(this.gc.uNear,this.$.uf.xc),s.uniform1f(this.gc.uAlpha,void 0===f.alpha?1:f.alpha),s.uniform1f(this.gc.globalAlpha,void 0===f.globalAlpha?1:f.globalAlpha),s.uniform1f(this.gc.uDifMin,void 0===f.diffuseMin?.4:f.diffuseMin),s.uniform1f(this.gc.uDifMax,void 0===f.diffuseMax?1:f.diffuseMax),s.uniform1i(this.gc.useDepthExt,0==f.useDepthExt?0:1);var t=GHMap.Q.bufferData(s,f.vertex);s.enableVertexAttribArray(this.gc.aVertexPosition),s.bindBuffer(s.ARRAY_BUFFER,t),s.vertexAttribPointer(this.gc.aVertexPosition,4,s.FLOAT,s.FALSE,0,0);var i=GHMap.Q.bufferData(s,f.color);s.bindBuffer(s.ARRAY_BUFFER,i),s.enableVertexAttribArray(this.gc.aVertexColor),s.vertexAttribPointer(this.gc.aVertexColor,4,s.FLOAT,s.FALSE,0,0);var r=GHMap.Q.bufferData(s,f.normal);s.enableVertexAttribArray(this.gc.aNormal),s.bindBuffer(s.ARRAY_BUFFER,r),s.vertexAttribPointer(this.gc.aNormal,3,s.FLOAT,s.FALSE,0,0);var a=GHMap.Q.bufferData(s,f.matrix);s.bindBuffer(s.ARRAY_BUFFER,a);var n=["aV1","aV2","aV3","aV4"],o=this;n.forEach(function(f,t){var i=o.gc[f];s.enableVertexAttribArray(i),s.vertexAttribPointer(i,4,s.FLOAT,s.FALSE,64,16*t),e.vertexAttribDivisorANGLE(i,1)});var h=GHMap.Q.bufferIndiceData(s,f.indice);s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,h),this.useLight(f),e.drawElementsInstancedANGLE(s.TRIANGLES,f.indice.length,s.UNSIGNED_SHORT,0,f.matrix.length/16),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,null),s.bindBuffer(s.ARRAY_BUFFER,null),GHMap.Q.releaseBuffer(s,t),GHMap.Q.releaseBuffer(s,i),GHMap.Q.releaseBuffer(s,h),GHMap.Q.releaseBuffer(s,r),GHMap.Q.releaseBuffer(s,a),s.disableVertexAttribArray(this.gc.aVertexPosition),s.disableVertexAttribArray(this.gc.aVertexColor),s.disableVertexAttribArray(this.gc.aNormal),n.forEach(function(f){var t=o.gc[f];s.disableVertexAttribArray(t),e.vertexAttribDivisorANGLE(t,0)}),f.closeCurface&&s.enable(s.CULL_FACE)}},release:function(){this.Hc.release()}},GHMap.Wc=function(f){this.$=f,this.Rf=f.getGLContext(),this.Fc=this.Rf.getExtension("ANGLE_instanced_arrays"),this.Hc=new GHMap.Program(this.Rf),this.Gc=["uniform mat4 mvpMatrix;","uniform float heightScale;","uniform float bottomHeight;","uniform float mapScale;","attribute vec4 aVertexColor;","attribute vec4 aVertexPosition;","attribute highp vec4 aV1;","attribute highp vec4 aV2;","attribute highp vec4 aV3;","attribute highp vec4 aV4;","varying highp vec4 vColor;","void main(void) {","\tvec4 pTan = vec4(aVertexPosition.xyz,1.0);","\tfloat height = aVertexPosition.w;\t","\tpTan.z = pTan.z * mapScale + bottomHeight + (pTan.z + height) * heightScale; ","\tmat4 modalMatrix = mat4(aV1, aV2, aV3, aV4); ","\tpTan = modalMatrix * pTan; ","\tvec4 position = mvpMatrix * pTan;\t","\tvColor = aVertexColor;","\tgl_Position = position; ","}"],this.wc=["precision mediump float;","varying highp vec4 vColor;\t"," uniform float globalAlpha;","uniform float uFar\t; ","uniform float uNear; ","void main(void){","\tif(vColor.a == 0.0) discard;","\tgl_FragColor = vColor * globalAlpha;","\t#ifdef USE_DEPTH_EXT","\t\tfloat fz = gl_FragCoord.z / gl_FragCoord.w; ","\t\tgl_FragDepthEXT = (fz - uNear ) / (uFar - uNear) ; ","\t#endif","}"],this.gc={},this.init(this.Gc,this.wc)},GHMap.Wc.prototype={constructor:GHMap.Wc,init:function(f,t){var i=this.Hc;i.createProgram(f.join("\n"),GHMap.Q.jf(this.$)+t.join("\n")),i.isValid()&&(i.useProgram(),GHMap.Q.setUniformLoc(this.gc,i,["mvpMatrix","heightScale","bottomHeight","globalAlpha","uFar","uNear","mapScale"]),GHMap.Q.setAttribLoc(this.gc,i,["aVertexColor","aVertexPosition","aV1","aV2","aV3","aV4"]))},render:function(f){if(this.Fc){this.Hc.useProgram();var s=this.Rf,e=this.Fc;s.uniformMatrix4fv(this.gc.mvpMatrix,s.FALSE,f.mvpData),s.uniform1f(this.gc.mapScale,0),s.uniform1f(this.gc.heightScale,this.$.Qe),s.uniform1f(this.gc.bottomHeight,void 0===f.bottomHeight?0:f.bottomHeight+f.bottomOffset),s.uniform1f(this.gc.globalAlpha,void 0===f.globalAlpha?1:f.globalAlpha),s.uniform1f(this.gc.uFar,this.$.uf.Sc),s.uniform1f(this.gc.uNear,this.$.uf.xc);var t=GHMap.Q.bufferData(s,f.vertex),i=GHMap.Q.bufferData(s,f.color),r=GHMap.Q.bufferIndiceData(s,f.indice);s.enableVertexAttribArray(this.gc.aVertexPosition),s.enableVertexAttribArray(this.gc.aVertexColor),s.bindBuffer(s.ARRAY_BUFFER,t),s.vertexAttribPointer(this.gc.aVertexPosition,4,s.FLOAT,s.FALSE,0,0),s.bindBuffer(s.ARRAY_BUFFER,i),s.vertexAttribPointer(this.gc.aVertexColor,4,s.FLOAT,s.FALSE,0,0);var a=GHMap.Q.bufferData(s,f.matrix);s.bindBuffer(s.ARRAY_BUFFER,a);var n=["aV1","aV2","aV3","aV4"],o=this;n.forEach(function(f,t){var i=o.gc[f];s.enableVertexAttribArray(i),s.vertexAttribPointer(i,4,s.FLOAT,s.FALSE,64,16*t),e.vertexAttribDivisorANGLE(i,1)}),s.lineWidth(1),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,r),e.drawElementsInstancedANGLE(s.LINES,f.indice.length,s.UNSIGNED_SHORT,0,f.matrix.length/16),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,null),s.bindBuffer(s.ARRAY_BUFFER,null),s.disableVertexAttribArray(this.gc.aVertexPosition),s.disableVertexAttribArray(this.gc.aVertexColor),GHMap.Q.releaseBuffer(s,a),GHMap.Q.releaseBuffer(s,t),GHMap.Q.releaseBuffer(s,i),GHMap.Q.releaseBuffer(s,r),n.forEach(function(f){var t=o.gc[f];s.disableVertexAttribArray(t),e.vertexAttribDivisorANGLE(t,0)})}},release:function(){this.Hc.release()}},GHMap.BaseRender=function(f){this.$=f,this.Rf=f.getGLContext(),this.Hc=new GHMap.Program(this.Rf),this.Jc=this.Rf.getExtension("EXT_frag_depth"),this.gc={}},GHMap.BaseRender.prototype={tt:function(f,t,i,s){var e=this.Hc;e.createProgram(f.join("\n"),this.jf()+t.join("\n")),e.isValid()&&(e.useProgram(),this.setUniformLoc(this.gc,i),this.setAttribLoc(this.gc,s))},setUniformLoc:function(t,f){var i=this.Hc;f.forEach(function(f){t[f]=i.getUniformLocation(f)})},setAttribLoc:function(t,f){var i=this.Hc;f.forEach(function(f){t[f]=i.getAttribLocation(f)})},setDepthUniform:function(f,t){f.uniform1i(this.gc.useDepthExt,0==t.useDepthExt?0:1),f.uniform1f(this.gc.uFar,t.zfar),f.uniform1f(this.gc.uNear,t.znear)},jf:function(){if(this.Jc){return["#extension GL_EXT_frag_depth : enable","#ifndef USE_DEPTH_EXT","#define USE_DEPTH_EXT 1","#endif"].join("\n")+"\n"}return""},Zc:function(f,t,i){if(void 0!==i){var s=this.gc[f];if(s){var e=this.Rf;"mat4"===t?e.uniformMatrix4fv(s,e.FALSE,i):"vec4"===t?e.uniform4fv(s,i):"vec3"===t?e.uniform3fv(s,i):"vec2"===t?e.uniform2fv(s,i):"float"===t?e.uniform1f(s,i):"int"===t&&e.uniform1i(s,i)}}},Kc:function(f,t,i,s){var e=this.Rf;if(f){var r=e.TEXTURE0+t;e.activeTexture(r),e.bindTexture(e.TEXTURE_2D,f),e.uniform1i(this.gc[i],t),s.push(r)}},bindData:function(f){var t=this.Rf,i=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,i),t.bufferData(t.ARRAY_BUFFER,f,t.STREAM_DRAW),i},bindIndiceData:function(f){var t=this.Rf,i=t.createBuffer();return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i),t.bufferData(t.ELEMENT_ARRAY_BUFFER,f,t.STREAM_DRAW),i}},GHMap.GpuPolylineRender=function(f){GHMap.BaseRender.call(this,f);this.tt(["uniform mat4 mvp_matrix;","uniform float u_bottom_height ;","uniform float u_px_scale ;","attribute vec3 a_pos;","attribute vec3 a_normal; ","attribute vec4 a_color;","attribute vec4 a_uv; ","attribute vec2 a_info; ","attribute float a_shiness; ","varying vec2 v_uv; ","varying float v_shiness; ","varying vec4 v_color; ","void main(void){","\tfloat width = a_info.x * u_px_scale; ","\tvec3 pos = vec3( a_pos.xy + a_normal.xy * width , a_pos.z + u_bottom_height); ","\tgl_Position = mvp_matrix * vec4( pos, 1.0); ","\tv_uv = vec2( a_uv.x + a_uv.z , a_uv.y * a_info.y + a_uv.w ); ","\tv_shiness = a_shiness; ","\tv_color = a_color; ","}"],["precision mediump float;","uniform sampler2D u_sampler;\t","uniform int u_type;","uniform float uFar\t; ","uniform float uNear; ","varying vec2 v_uv; ","varying float v_shiness; ","varying vec4 v_color; ","void main(void){","\tif( u_type == 1 ) { ","\t\tgl_FragColor = texture2D(u_sampler, v_uv ) ; ","\t} else { ","\t\tgl_FragColor = v_color; ","\t}","\tif(gl_FragColor.a == 0.0 ) discard; ","\tgl_FragColor.rgb *= v_shiness ; ","\t#ifdef USE_DEPTH_EXT","\t\tfloat fz = gl_FragCoord.z / gl_FragCoord.w; ","\t\tgl_FragDepthEXT = (fz - uNear ) / (uFar - uNear) ; ","\t#endif","}"],["mvp_matrix","u_bottom_height","u_px_scale","u_sampler","u_type","uFar","uNear"],["a_pos","a_normal","a_uv","a_info","a_shiness","a_color"])},GHMap.GpuPolylineRender.prototype={enableAttrBuffer:function(f,t,i){var s=this.Rf,e=this.gc[t],r=this.bindData(f);return s.enableVertexAttribArray(e),s.bindBuffer(s.ARRAY_BUFFER,r),s.vertexAttribPointer(e,i,s.FLOAT,s.FALSE,0,0),{buffer:r,dataloc:e}},enableIndiceBuffer:function(f){var t=this.Rf,i=this.bindIndiceData(f);return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i),{buffer:i}},render:function(f,t){this.Hc.useProgram();var i=this.Rf;i.disable(i.CULL_FACE),this.Zc("mvp_matrix","mat4",f.mvpData),this.Zc("u_bottom_height","float",f.bottomHeight+f.bottomOffset),this.Zc("u_px_scale","float",f.pxScale),this.setDepthUniform(i,f);var s=[],e=[],r=0;s.push(this.enableAttrBuffer(t.pos,"a_pos",3)),s.push(this.enableAttrBuffer(t.normal,"a_normal",3)),s.push(this.enableAttrBuffer(t.shiness,"a_shiness",1)),s.push(this.enableAttrBuffer(t.info,"a_info",2)),s.push(this.enableAttrBuffer(t.color,"a_color",4)),t.texture?(this.Zc("u_type","int",1),this.Kc(t.texture,r++,"u_sampler",e),s.push(this.enableAttrBuffer(t.uv,"a_uv",4))):this.Zc("u_type","int",0),s.push(this.enableIndiceBuffer(t.indice)),i.drawElements(i.TRIANGLES,t.indice.length,"int"==t.glType?i.UNSIGNED_INT:i.UNSIGNED_SHORT,0),e.forEach(function(f){i.activeTexture(f),i.bindTexture(i.TEXTURE_2D,null)}),s.forEach(function(f){i.deleteBuffer(f.buffer),void 0!==f.dataloc&&i.disableVertexAttribArray(f.dataloc)})}},GHMap.A.copy(GHMap.GpuPolylineRender.prototype,GHMap.BaseRender.prototype,!1);var GHAnimation={BaseInterpolator:function(){}};GHAnimation.BaseInterpolator.prototype={getInterpolation:function(f){return 0}},GHAnimation.AccelerateInterpolator=function(f){GHAnimation.BaseInterpolator.call(this),this.mFactor=void 0===f?1:f,this.mDoubleFactor=2*this.mFactor},GHMap.A.copy(GHAnimation.AccelerateInterpolator.prototype,GHAnimation.BaseInterpolator),GHAnimation.AccelerateInterpolator.prototype.getInterpolation=function(f){return 1===this.mFactor?f*f:Math.pow(f,this.mDoubleFactor)},GHAnimation.DecelerateInterpolator=function(f){GHAnimation.BaseInterpolator.call(this),this.mFactor=void 0===f?1:f},GHMap.A.copy(GHAnimation.DecelerateInterpolator.prototype,GHAnimation.BaseInterpolator),GHAnimation.DecelerateInterpolator.prototype.getInterpolation=function(f){return 1==this.mFactor?1-(1-f)*(1-f):1-Math.pow(1-f,2*this.mFactor)},GHAnimation.LinearInterpolator=function(){GHAnimation.BaseInterpolator.call(this)},GHMap.A.copy(GHAnimation.LinearInterpolator.prototype,GHAnimation.BaseInterpolator),GHAnimation.LinearInterpolator.prototype.getInterpolation=function(f){return f},GHAnimation.AccelerateDecelerateInterpolator=function(){GHAnimation.BaseInterpolator.call(this)},GHMap.A.copy(GHAnimation.AccelerateDecelerateInterpolator.prototype,GHAnimation.BaseInterpolator),GHAnimation.AccelerateDecelerateInterpolator.prototype.getInterpolation=function(f){return Math.cos((f+1)*Math.PI)/2+.5},GHAnimation.BounceInterpolator=function(){GHAnimation.BaseInterpolator.call(this)},GHMap.A.copy(GHAnimation.BounceInterpolator.prototype,GHAnimation.BaseInterpolator),GHAnimation.BounceInterpolator.prototype.getInterpolation=function(f){return(f*=1.1226)<.3535?this.bounce(f):f<.7408?this.bounce(f-.54719)+.7:f<.9644?this.bounce(f-.8526)+.9:this.bounce(f-1.0435)+.95},GHAnimation.BounceInterpolator.prototype.bounce=function(f){return f*f*8},GHAnimation.CycleInterpolator=function(f){GHAnimation.BaseInterpolator.call(this),this.mCycles=void 0===f?1:f},GHAnimation.CycleInterpolator.prototype.getInterpolation=function(f){return Math.sin(2*this.mCycles*Math.PI*f)},GHAnimation.Interpolator={LINEAR:new GHAnimation.LinearInterpolator,ACCELERATE:new GHAnimation.AccelerateInterpolator,DECELERATE:new GHAnimation.DecelerateInterpolator,ACCELERATE_DECELERATE:new GHAnimation.AccelerateDecelerateInterpolator,BOUNCE:new GHAnimation.BounceInterpolator,CYCLE:new GHAnimation.CycleInterpolator(.5)},GHAnimation.Tween=function(f){this.mStartTime,this.mEndTime,this.mTime=350,this.mInterpolater=GHAnimation.Interpolator.DECELERATE,this.mStartValue,this.mEndValue,this.mInterpolaterValue,this.mIsRuning=!1,this.mComputeValueListener,this.mTweenEndListener,this.mTweenId=f},GHAnimation.Tween.prototype={setStartValue:function(f){return this.mStartValue=f,void 0!==this.mStartValue&&void 0!==this.mEndValue&&this.computeInterpolaterValue(),this},setEndValue:function(f){return this.mEndValue=f,void 0!==this.mStartValue&&void 0!==this.mEndValue&&this.computeInterpolaterValue(),this},setInterpolaterValue:function(f){return this.mInterpolaterValue=f,this},computeInterpolaterValue:function(){this.mInterpolaterValue=this.mEndValue.subVectors(this.mStartValue)},setTime:function(f){this.mTime=f},setOnComputeValueListener:function(f){this.mComputeValueListener=f},setOnTweenEndListener:function(f){this.mTweenEndListener=f},start:function(){return this.mStartTime=Date.now(),this.mEndTime=this.mStartTime+this.mTime,this.mIsRuning=!0,this},run:function(f){if(this.mIsRuning){var t=(f-this.mStartTime)/this.mTime;1<=t&&(this.stop(),t=1),1<(t=this.mInterpolater.getInterpolation(t))&&(t=1);var i=this.computeValue(t);this.onPostvalue(i),this.mComputeValueListener&&this.mComputeValueListener(i)}},onPostvalue:function(f){},computeValue:function(f){var t=this.mInterpolaterValue.clone().multScalar(f);return t.add(this.mStartValue),t},stop:function(){this.mIsRuning=!1,this.mTweenEndListener&&this.mTweenEndListener(this.mTweenId),this.mTweenEndListener=void 0},isRuning:function(){return this.mIsRuning},getId:function(){return this.mTweenId}},GHAnimation.Manager=function(f){this.mTweens=[],this.mTimerId,this.mTimeInterval=16,this.mListeners=[],this.mMap=f},GHAnimation.Manager.prototype={findTweenById:function(f){for(var t=void 0,i=0;ithis.Iu&&(r=this.Iu):r=this.hu&&(u=u*h/this.hu),this.Oi.setX(n),this.Oi.setY(o),this.Oi.setZ(this.$.getCurrentFloorLayer().Rt);var l=u+this.Oi.getZ()+this.$.q.s;if(this.au.setValue(n,o,l),this.nu.copy(new GHMap.I(0,1,0)),0==i&&0==s&&e==this.$.q.w&&r==this.$.q.h&&(this._u=u,this.xu(),this.Tu()),this.setPitch(0,this.Oi,!0),this.$.Ru=GHMap.MapMode.MAP_2D,this.$.An&&this.$.An.setMapModeImage(),this.makeMvp(),this.bu(),t){var d=GHMap.A.getValue(t.left,0)*window.devicePixelRatioMap,p=GHMap.A.getValue(t.right,0)*window.devicePixelRatioMap,v=GHMap.A.getValue(t.top,0)*window.devicePixelRatioMap,M=GHMap.A.getValue(t.bottom,0)*window.devicePixelRatioMap;if(0!=d||0!=p||0!=v||0!=M){var H=this.vi-(d+p),G=this.Hi-(v+M),b=Math.max(this.vi/H,this.Hi/G);i-=d*=h=this.vu*b,e+=p*=h,s-=v*=h,r+=M*=h;var w=new GHMap.Box(new GHMap.Point(i,s),new GHMap.Point(e,r));this.zoomToBox(w)}}},GHMap.Lu.prototype.setZoom=function(f){if(void 0!==f){fthis.$.getMaxZoomLevel()&&(f=this.$.getMaxZoomLevel());var t=Math.pow(2,f-1);t=this.Fu/t;var i=this.au.subVectors(this.Oi);i.normalize().multNum(t).add(this.Oi),this.au.copy(i),this.makeMvp(),this.bu()}},GHMap.Lu.prototype.getZoom=function(){var f=this.au.subVectors(this.Oi).length();return f=this.Fu/f,GHMap.G.toFixed(Math.log2(f)+1)},GHMap.Lu.prototype.scale=function(f,t){if(1!=f){var i=t||this.Oi,s=this.au.subVectors(i),e=s.length()*f;1this.Iu&&(e=this.Iu):ethis.hu?this.updateByWidth(r/2):this.updateByHeight(a/2),this.au.setValue(n,o,this.au.getZ()),this.nu.copy(new GHMap.I(0,1,0)),0==t&&0==i&&s==_map.Xu&&e==_map.Yu&&(this._u=this.Vu,this.xu(),this.Tu()),this.setPitch(this.cu,this.center,!0),this.makeMvp(),this.bu()},GHMap.Uu.prototype.getZoom=function(){var f=this.Iu/this.Vu;return GHMap.G.toFixed(Math.log(f)/Math.log(2)+1)},GHMap.Uu.prototype.setZoom=function(f){if(f){fthis.$.getMaxZoomLevel()&&(f=this.$.getMaxZoomLevel());var t=Math.pow(2,f-1);t=this.Iu/t,this.updateByWidth(t),this.makeMvp(),this.bu()}},GHMap.Uu.prototype.scale=function(f,t){1==f&&reutrn;var i=this.Vu*f;1this.Iu&&(i=this.Iu):i80*i){s=r=f[0],e=a=f[1];for(var p=i;pr.x?e.x>a.x?e.x:a.x:r.x>a.x?r.x:a.x,c=e.y>r.y?e.y>a.y?e.y:a.y:r.y>a.y?r.y:a.y,u=zOrder(n,o,t,i,s),l=zOrder(h,c,t,i,s),d=f.prevZ,p=f.nextZ;d&&d.z>=u&&p&&p.z<=l;){if(d!==f.prev&&d!==f.next&&pointInTriangle(e.x,e.y,r.x,r.y,a.x,a.y,d.x,d.y)&&0<=area(d.prev,d,d.next))return!1;if(d=d.prevZ,p!==f.prev&&p!==f.next&&pointInTriangle(e.x,e.y,r.x,r.y,a.x,a.y,p.x,p.y)&&0<=area(p.prev,p,p.next))return!1;p=p.nextZ}for(;d&&d.z>=u;){if(d!==f.prev&&d!==f.next&&pointInTriangle(e.x,e.y,r.x,r.y,a.x,a.y,d.x,d.y)&&0<=area(d.prev,d,d.next))return!1;d=d.prevZ}for(;p&&p.z<=l;){if(p!==f.prev&&p!==f.next&&pointInTriangle(e.x,e.y,r.x,r.y,a.x,a.y,p.x,p.y)&&0<=area(p.prev,p,p.next))return!1;p=p.nextZ}return!0}function cureLocalIntersections(f,t,i){var s=f;do{var e=s.prev,r=s.next.next;!equals(e,r)&&intersects(e,s,s.next,r)&&locallyInside(e,r)&&locallyInside(r,e)&&(t.push(e.i/i),t.push(s.i/i),t.push(r.i/i),removeNode(s),removeNode(s.next),s=f=r),s=s.next}while(s!==f);return filterPoints(s)}function splitEarcut(f,t,i,s,e,r){var a=f;do{for(var n=a.next.next;n!==a.prev;){if(a.i!==n.i&&isValidDiagonal(a,n)){var o=splitPolygon(a,n);return a=filterPoints(a,a.next),o=filterPoints(o,o.next),earcutLinked(a,t,i,s,e,r),void earcutLinked(o,t,i,s,e,r)}n=n.next}a=a.next}while(a!==f)}function eliminateHoles(f,t,i,s){var e,r,a,n=[];for(e=0,r=t.length;e=s.next.y&&s.next.y!==s.y){var n=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(n<=e&&a=s.x&&s.x>=c&&e!==s.x&&pointInTriangle(ri.x||s.x===i.x&§orContainsSector(i,s)))&&(i=s,l=o)),(s=s.next)!==h;);return i}function sectorContainsSector(f,t){return area(f.prev,f,t.prev)<0&&area(t.next,f,f.next)<0}function indexCurve(f,t,i,s){for(var e=f;null===e.z&&(e.z=zOrder(e.x,e.y,t,i,s)),e.prevZ=e.prev,e.nextZ=e.next,(e=e.next)!==f;);e.prevZ.nextZ=null,e.prevZ=null,sortLinked(e)}function sortLinked(f){var t,i,s,e,r,a,n,o,h=1;do{for(i=f,r=f=null,a=0;i;){for(a++,s=i,t=n=0;t=Math.min(f.x,i.x)&&t.y<=Math.max(f.y,i.y)&&t.y>=Math.min(f.y,i.y)}function sign(f){return 0r!=i.next.y>r&&i.next.y!==i.y&&e<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(s=!s),(i=i.next)!==f;);return s}function splitPolygon(f,t){var i=new Node(f.i,f.x,f.y),s=new Node(t.i,t.x,t.y),e=f.next,r=t.prev;return(f.next=t).prev=f,(i.next=e).prev=i,(s.next=i).prev=s,(r.next=s).prev=r,s}function insertNode(f,t,i,s){var e=new Node(f,t,i);return s?(e.next=s.next,(e.prev=s).next.prev=e,s.next=e):(e.prev=e).next=e,e}function removeNode(f){f.next.prev=f.prev,f.prev.next=f.next,f.prevZ&&(f.prevZ.nextZ=f.nextZ),f.nextZ&&(f.nextZ.prevZ=f.prevZ)}function Node(f,t,i){this.i=f,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function signedArea(f,t,i,s){for(var e=0,r=t,a=i-s;r=f&&i.sh<=t},draw:function(){var f=!0,t=!0,i=this.Hl.scrollTop,s=this.Hl.scrollTop+this.Hl.clientHeight;if(this.wl||this.Al)if(this.wl==this.Al){var e=this.getHeightByFloorName(this.wl);t=f=this.show(i,s,e);var r=e.sh+this.Hl.offsetTop-this.Hl.scrollTop;this.Gl.style.top=r+"px",f&&(this.Gl.style.display=""),this.bl.style.top=r+this.Gl.clientHeight+"px"}else{if(this.wl){e=this.getHeightByFloorName(this.wl);f=this.show(i,s,e);var a=(e.eh-e.sh)/4;r=e.sh+this.Hl.offsetTop-this.Hl.scrollTop+a;this.Gl.style.top=r+"px"}if(this.Al){e=this.getHeightByFloorName(this.Al);t=this.show(i,s,e);a=(e.eh-e.sh)/4,r=e.sh+this.Hl.offsetTop-this.Hl.scrollTop+a;this.bl.style.top=r+"px"}}this.wl&&f?this.Gl.style.display="":this.Gl.style.display="none",this.Al&&t?this.bl.style.display="":this.bl.style.display="none"}},GHMap.Zu.CommonTextView=function(f,t,i){this.lh=f,this.St=t,this.ml=i,this.yl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAYCAYAAACMcW/9AAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAGaSURBVHgBzZa9TgJBFIXPHVw6yb6B0EiLoaEcrIgFiU8gFhI7Q2enpR2tiYU8gpXRyrWzIWKJDfsIqyWaXWdQEYT9m51J9msg2XuTL3d251yCJnirUybLuiZCDSAbAW78j2nPuRu40ABBA1KSFa3nmeAynj+d7uiQZcjIt2TxYY2kxJbPZA0ykmmif5Iox5S6YrLNLJNVFuW8Y7NSURx3rOQvrv8uXgNn4EEBpaOXkoVSokkuUpY9shcKKImyTasfQH7d6ZA9shcKFJCS3Xa3D6JjqEJUq1Tr9mQ8vE/TlkpUSJ6Jn1NkpyFkIWQfkzYkFv2RPIc+eBrZRKK8fXRCoAvoh1e262+T1+FTXGGsKG93DxjoEqYgtLaqddcdD1+iyyLge50a27DCUkcnnv8ZNJ3bq1FYQahoRH6bInIvWHuPxuS3KSL3gpWJpshvU6zdC5ZEFfLbFCt7wfzoFfPbFCt7wVxUNb9N8X8vmN2jmfPbFAt7ARmIRv0E6BWEsYO8Q2gw8S6MkHOEo8cCFhyKPy5yirg/R8Jx/wunm5UaBpf16wAAAABJRU5ErkJggg==",this.Sl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAYCAYAAACMcW/9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAITgAACE4AUWWMWAAAAGdSURBVFhHzZffbcIwEId9lgjljadKaVMJNoARGKETtExAmaDtBGUDOkI3YISyQZAwBPUpb1VbyVcnXCkof+3YEt8DcFEcfTpjfgcwS4Rh1Gu1YQ4MBoxhlzF44yCnvu+v6JZGWBFNJL02f98LHgOxkh3akOX0bsxeEhZZyQTsSoRFFEU9umBMo47+S7IqkRUHHDXprLFoGIZdr91R210p+cfq++tz2O/3Y6q1MNr6VNLr1OnkMar7nUWylmotjERb3sVM7YU63doM0rUGaIuuxXYGAHdUapOsXYudtqyW6HoTPXHOJ1QawzmbJM+isha1D1MqCfBIpRUk4vPNtV9LuJao2O4e1I0vVFoFpZwGwVXlV6FSVIjoHjjMqXQCShwHgf9KZS6lokJ8DIBjQerYBGKUMAqCyyVdyFAoWpzfriifC3JPfXl+u6J8Lsh0VCO/XZE7F5yIGuS3KzJzwWHrDfPbFZm54CDaIL9dcTIXpKJN89sVx3MBuIhG2yTpBZvtDqk+Y9RvrHopTIPzAWOO8mesPln5S+uIJUp++wtt364cpMOg+QAAAABJRU5ErkJggg==",this.lh.getContext&&(this.dh=this.lh.getContext("2d"))},GHMap.Zu.CommonTextView.TYPE={UP:1,DOWN:2},GHMap.Zu.CommonTextView.prototype={draw:function(){1==this.ml?this.draw1():this.draw2()},draw2:function(){0!=this.lh.ac?this.lh.src=this.yl:this.lh.src=this.Sl},draw1:function(){this.lh.width=this.lh.clientWidth*window.devicePixelRatio,this.lh.height=this.lh.clientHeight*window.devicePixelRatio;var f=this.lh.width/2,t=this.lh.height/2,i=10*window.devicePixelRatio,s=i,e=i/2,r=this.dh;switch(r.fillStyle="white",r.clearRect(0,0,this.lh.width,this.lh.height),r.lineWidth=1*window.devicePixelRatio,0!=this.lh.ac?r.strokeStyle="black":r.strokeStyle="#cccccc",r.beginPath(),this.St){case GHMap.Zu.CommonTextView.TYPE.UP:r.moveTo(f,t-e/2),r.lineTo(f-s/2,t+e/2),r.lineTo(f+s/2,t+e/2);break;case GHMap.Zu.CommonTextView.TYPE.DOWN:r.moveTo(f,t+e/2),r.lineTo(f-s/2,t-e/2),r.lineTo(f+s/2,t-e/2)}r.closePath(),r.stroke()}},GHMap.xl=function(f,t){this.$=f,this.bs=t,this.gs,this.init()},GHMap.xl.prototype={init:function(){this.gs=GHMap.Xf.createElement({class:"gh-zoom-container",style:"display:none;z-index: 10;"});var f=GHMap.Xf.createElement({class:"gh-zoom-button"}),t=GHMap.Xf.createElement({tagName:"img",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAB3klEQVR4Xu1bPUsDQRCdIb9BEEWw312CtY0W2gmCIIpVGu1s/RcWlqJg4UchKFiaQut0YSdpLSSF4F+4jFwjkuwlgtzE5N6Vt2Rn5mXe7cy8O6aKX1zx+AkAIAMmgEC9Xl/MsuyMiFaZOVPVFhEdi8i7tTsToYD3/pmINgaCbYrI5swD4JzbY+a7VKD9fr/R7XavLEEwz4AQwq2q7hcE+SAiOzMNgPf+hYjWCoJ8FZF1AGCIgDkFkAGgAJ4BeAjiFMAxiDoAhRAqwTQCKIXRC6AZQjeIdtiwG7Yfi6MdRjs8Je1wCOFwxPDyrzQtLIX/unHq98x8EWO8Sa4N3vTeLxHRZWJuX4Zvlns2a7Vao91u934aHZoJeu8fiWjb0jNDW0Nj9yEAQgg9VV0wdMrS1IeIzI/MgMoD4L1/IqIty7/Fypaq3nc6nd2RGZAvOufemHnZyjEjO58iMjdoq1AYcc6dMvNKSc5ZH4OtGOPJr47BkgL+3halMErhKSmFy6ICKAAKgAIQRyGOQhyFOApxFOIoxNEkAlCHoQ5DHYY6DHW4rFYcI7EEAnhb3DLdclshhANVvS4QMY9ijOeWPplnQB5cpT+aygGo/Gdzlik+ztZEKDDOKct1AGCJ9n+09QXVFUBQrw3htAAAAABJRU5ErkJggg=="});GHMap.Xf.append(f,t);var i,s,e=GHMap.Xf.createElement({class:"gh-zoom-button"}),r=GHMap.Xf.createElement({tagName:"img",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAABJklEQVR4Xu2WwUkDURRFTwoQFxK0DSFYgWRhF1aWLgQRC5Bs7CJBggsrkIEIw/AhvKX3ndkOD+aed+7/s6L5s2qeHwFoQHMCVqC5AB6CVsAKNCdgBZoL4C1gBaxAcwJWoLkA3gJWwAo0J2AFmgvgLWAFrMCYwBp4Bu6BW+Drn4Kavv0IfAK7UY5RBTbACzBBSHpOwBOwn4caAXgFtknJZ1neltmWAK6An9Dwf7Gu5xkFMNj2pMljqAXvy2yjM+DhfAjehEH4Ph+CH5cOwen9Xeg1eFgu1T/BMM3LcTSgjCxsQAPCFlqOowFlZGEDGhC20HIcDSgjCxvQgLCFluNoQBlZ2IAGhC20HEcDysjCBjQgbKHlOBpQRhY2oAFhCy3H0YAysrCBX/54GEEjKWXnAAAAAElFTkSuQmCC"});GHMap.Xf.append(e,r),GHMap.Xf.append(this.gs,f),GHMap.Xf.append(this.gs,e),GHMap.Xf.append(this.bs,this.gs),i=this,s=e,f.onclick=function(){i.$.zoomIn()},s.onclick=function(){i.$.zoomOut()}},show:function(){this.$.Cl&&(this.gs.style.display="")},hide:function(){this.gs.style.display="none"}},GHMap.NaviMode={NORMAL:1,ROAD:2},GHMap.NaviDirection={STRAIGHT:1,RIGHT_FRONT:2,RIGHT:3,LEFT_FRONT:4,LEFT:5,TURN:6,UPSTAIRS:7,DOWNSTAIRS:8,DESTINATION:9},GHMap.NaviResultCode={NO_START_INFO:1,NO_END_INFO:2,AUTO_ROUTING_START:3,AUTO_ROUTING_COMPLETE:4,AUTO_ROUTING_ERROR:5,ROUTING_START:6,ROUTING_COMPLETE:7,ROUTING_ERROR:8,NAVI_START:9,NAVI_END:10,NAVI_STOP:11,NAVI_RESUME:12,NAVI_TRACKING:13},GHMap.NaviLinkType={STRAIGHT_LADDER:2,HAND_LADDER:3,WALKING_LADDER:1,GOODS_LADDER:4},GHMap._l=function(f,t){this.map=f,this.autoRoute,this.naviMode,this.threshold,this.maxOffCount,this.startInfo,this.endInfo,this.routeResult,this.bookResult,this.routeItems,this.locOffsetCount=0,this.runing=!1,this.Tl=new Array,this.Fl=5,this.Il,this.Dl=2,this.lineAngle,this.removeLastLineCount,this.setOption(),this.frontAngle=45,this.El="./",this.Bl={},this.Ll=[],this.Nl=!1,this.kl,this.Pl,this.Ol,this.Rl,this.Ul=!0,this.zl=!0,this.Vl=new GHMap._l.TTSObject(this),this.jl=3,this.Ql={2:"直梯",1:"步行梯",3:"扶梯",4:"货梯"},this.Xl={2:GHMap.NaviLinkType.STRAIGHT_LADDER,1:GHMap.NaviLinkType.WALKING_LADDER,3:GHMap.NaviLinkType.HAND_LADDER,4:GHMap.NaviLinkType.GOODS_LADDER},this.en=new GHMap.da(f),this.Yl()},GHMap._l.prototype={Wl:function(f,t){this.map.xh(new GHMap.Ch("navigation",{code:f,data:t},this.map))},Yl:function(){var i,f;f={},(i=this).Pl&&(f.appKey=i.Pl),i.Ol&&(f.appsecret=i.Ol),i.map.Is.Yl(i.map.Jl,f,function(f){f&&200==f.retcode&&(i.Rl=f.body.token)}),i.map.ba.load(i.map.Ha+"route_nav.png",function(f,t){f&&(i.pn=f)},{})},setAppKeyAndSecret:function(f,t){this.Pl=f,this.Ol=t,this.Yl()},setMockSpeed:function(f){this.jl=f,this.kl&&this.kl.setSpeed(f)},getMockSpeed:function(){return this.jl},setUsePassLine:function(f){this.zl=f},isUsePassLine:function(){return this.zl},setFrontAngle:function(f){this.frontAngle=f},setUseTts:function(f){this.Ul=f},isUseTts:function(){return this.Ul},getFrontAngle:function(){return this.frontAngle},setEndThreshold:function(f){this.Fl=f},getEndThreshold:function(){return this.Fl},setBackThrehold:function(f){this.Dl=f},getBackThrehold:function(){return this.Dl},setRouteResult:function(f,t){this.routeResult=f,this.bookResult=this.Zl(f,1==t?0:1)},setOption:function(f){f=f||{},this.autoRoute=GHMap.A.getValueFromJson(f,"autoRoute",!0),this.naviMode=GHMap.A.getValueFromJson(f,"naviMode",GHMap.NaviMode.ROAD),this.threshold=GHMap.A.getValueFromJson(f,"threshold",5),this.maxOffCount=GHMap.A.getValueFromJson(f,"maxOffCount",5),this.lineAngle=GHMap.A.getValueFromJson(f,"lineAngle",10),this.removeLastLineCount=GHMap.A.getValueFromJson(f,"removeLastLineCount",0)},setLineAngle:function(f){this.lineAngle=f},getLineAngle:function(){return this.lineAngle},setRemoveLastLineCount:function(f){this.removeLastLineCount=f},getRemoveLastLineCount:function(){return this.removeLastLineCount},setAutoRoad:function(f){this.autoRoute=f},getAutoRoad:function(){return this.autoRoute},setNaviMode:function(f){this.naviMode=f},getNaviMode:function(){return this.naviMode},setThreshold:function(f){this.threshold=f},getThreshold:function(){return this.threshold},setMaxOffCount:function(f){this.maxOffCount=f},getMaxOffCount:function(){return this.maxOffCount},setStartInfo:function(f){this.startInfo=f},setEndInfo:function(f){this.endInfo=f},getStartInfo:function(){return this.startInfo},getEndInfo:function(){return this.endInfo},start:function(){this.Kl(!1)},startMock:function(){this.kl||(this.kl=new GHMap._l.MockNaviRunable(this)),this.Kl(!0)},clearRouteResult:function(){this.routeResult=void 0},Kl:function(f){this.runing||(this.startInfo?this.endInfo?(this.Wl(GHMap.NaviResultCode.NAVI_START),this.runing=!0,this.Nl=f,this.routeResult?(this.Wl(GHMap.NaviResultCode.ROUTING_COMPLETE,this.bookResult),this.Nl&&this.kl&&this.kl.start(this.routeItems)):this.startRoute()):this.Wl(GHMap.NaviResultCode.NO_END_INFO):this.Wl(GHMap.NaviResultCode.NO_START_INFO))},ql:function(f,t,i,s){8h.end.floorNum){h.direction=14,o=!0,(l=this.ad(h.start))&&(h.linkType=l.type)}else{var l;o=!0,h.direction=13,(l=this.ad(h.start))&&(h.linkType=l.type)}n=r}return t},ad:function(f){for(var t=void 0,i=this.map.getSearch().searchInFloorByLayer(f.floorName,"POI_INFO"),s=0;sh.distance&&(t=h):t=h}if(t&&t.distance<=this.threshold)this.locOffsetCount=0;else if(!0===this.autoRoute)return this.locOffsetCount++,void(this.locOffsetCount==this.maxOffCount&&(this.locOffsetCount=0,this.Tl.length=0,this.startInfo.x=f.x,this.startInfo.y=f.y,this.startInfo.floorName=f.floorName,this.startRoute(!0)));if(t){for(n=e;nthis.Fl&&(g="剩余"+p+"米",h.desc=g+"到达目的地",h.desc+="附近")}else h.length>this.Fl&&(h.desc="Destination is "+p+" meters in front of you");h.nextDirection=GHMap.NaviDirection.DESTINATION}else if(H){if(H.direction<=8)this.$l()?h.desc="沿"+this.Ee(u.direction)+"方向直行"+p+"米后"+this.Ee(H.direction):h.desc="Head "+this.Ee(u.direction)+" Go straight for "+p+" meters then "+this.Ee(H.direction);else if(void 0!==H)if(M=GHMap._l.SPEAK_TYPE.ROUND,3=n.distance)&&(r=n)}}if(r){this.en.clear();for(a=0;a=o.distance)&&(i=o)}return i}},render:function(f,t){if(this.map.getRouteLayer().isVisible()){var i=this.en.getObjectSize();if(0!=i){for(var s=this.map.getCurrentFloorLayer().getNum(),e=0;e=t&&(i=s)}return i},IM:function(f,t,i,s){var e=function(f,t,i){for(i=0<=i?i:i+f.length;0<=i;i--){var s=f[i];if(s.Qv(t))return s}return null}(f,s,i?i-1:0),r=function(f,t,i){for(;it)break}return i},_M:function(f){if(-1n.duration)(a=n.interpolate(n.duration))&&(o.isReset&&(o.localMatrix.identity(),o.isReset=!1),o.localMatrix.multMatrix(a.matrix));else(a=n.interpolate(t-this.startTime))&&(s=!0,o.isReset&&(o.localMatrix.identity(),o.isReset=!1),o.localMatrix.multMatrix(a.matrix))}}this.jointTree.forEach(function(f){!function t(f){f.invBindMatrix||(f.invBindMatrix=new GHMap.nf),f.globalMatrix=f.parent?f.parent.globalMatrix.mult(f.localMatrix):f.localMatrix,f.skinMatrix=i.matrix.mult(f.globalMatrix.mult(f.invBindMatrix)),f.children.forEach(function(f){t(f)})}(f)}),s||this.stop()}},setupBindPose:function(){var f=new GHMap.nf,t=new GHMap.nf,i=new GHMap.nf;f.scale(new GHMap.I(this.scale,this.scale,this.scale)),t.rotate(this.rotate,this.up),i.translate(this.location);var s=i.mult(t.mult(f.mult(this.upMatrix)));if(0=this.PH&&(this.OH=!0)}if(this.kH){var r=this.UH.x-t,a=this.UH.y-i;!(0==r&&0==a)&&this.QH.move&&this.QH.move(GHMap.A.copy({},this.UH),{x:t,y:i},f),this.UH.x=t,this.UH.y=i}}else if(this.WH){s=Math.abs(t-this.zH.x),e=Math.abs(i-this.zH.y);Math.sqrt(s*s+e*e)>=this.PH&&this.QH.rightMove&&(this.QH.rightMove(GHMap.A.copy({},this.zH),{x:t,y:i},f),this.zH.x=t,this.zH.y=i)}else this.QH.mousemove({x:t,y:i})}},mousewheel:function(f){this.stop(f),this.QH.mousewheel&&this.QH.mousewheel(f)},touchstart:function(f){if(this.stop(f),1==f.touches.length){this.kH=!0;var t=f.touches[0];this.kH=!0,this.RH||(this.RH={}),this.RH.x=this.getX(t),this.RH.y=this.getY(t),this.UH||(this.UH={}),GHMap.A.copy(this.UH,this.RH),this.QH.movestart&&this.QH.movestart(GHMap.A.copy({},this.RH)),this.VH++,1==this.VH?(this.JH&&clearTimeout(this.JH),this.ZH&&clearTimeout(this.ZH),this.OH=!1,function(f){f.JH=setTimeout(function(){f.timerTask()},GHMap.NH.DBCLICK_INTERVAL),this.ZH=setTimeout(function(){f.longpressTask()},GHMap.NH.LONG_PRESS_TIME)}(this)):this.OH=!0}else this.RH=void 0,this.UH=void 0,this.kH=!1,this.VH=0},touchmove:function(f){var t,i;if(this.stop(f),1==f.touches.length){this.kH=!0,t=f.touches[0];var s=this.getX(t),e=this.getY(t);if(this.RH&&this.UH){var r=this.UH.x-s,a=this.UH.y-e;0==r&&0==a||(this.QH.move&&this.QH.move(GHMap.A.copy({},this.UH),{x:s,y:e}),this.UH.x=s,this.UH.y=e)}else this.RH={x:s,y:e},this.UH={x:s,y:e};this.XH&&(this.KH=!1,this.qH=!1,this.QH.touch2&&this.QH.touch2(2),this.XH=void 0)}else if(2==f.touches.length){this.kH=!1,t=f.touches[0],i=f.touches[1];var n={x1:this.getX(t),y1:this.getY(t),x2:this.getX(i),y2:this.getY(i)};if(null!=this.XH){var o=Date.now();if(n.time=o,n.cx=n.x1+.5*this.XH.x2,n.cy=n.y1+.5*this.XH.y2,this.XH.cx){var h=this.$H(this.XH,n);h.flag&&(this.QH.touch2&&0!=h.state&&this.QH.touch2(1,GHMap.A.copy({},this.XH),GHMap.A.copy({},n),h.state),this.XH=GHMap.A.copy({},n))}else this.XH=GHMap.A.copy({},n)}else this.XH=n,this.XH.time=Date.now(),this.QH.touch2&&this.QH.touch2(0),this.KH=!1,this.qH=!1}else this.XH&&(this.KH=!1,this.qH=!1,this.QH.touch2&&this.QH.touch2(2),this.XH=void 0),this.RH=void 0,this.UH=void 0,this.kH=!1},$H:function(f,t){var i=f.x2-f.x1,s=f.y2-f.y1,e=Math.sqrt(i*i+s*s),r=t.x2-t.x1,a=t.y2-t.y1,n=e/Math.sqrt(r*r+a*a),o=Math.abs(Math.log(n)),h=Math.abs(f.cx-t.cx),c=Math.abs(f.cy-t.cy),u=!1;.22*window.devicePixelRatio||c>2*window.devicePixelRatio)&&o<.02)&&(l.state=1));var d=0;if(!u){var p=GHMap.G.getRotate(f.x1,f.y1,f.x2,f.y2),v=GHMap.G.getRotate(t.x1,t.y1,t.x2,t.y2);d=Math.abs(p-v),!this.qH&&42*window.devicePixelRatio||c>2*window.devicePixelRatio)&&d<1)&&(l.flag=!0,l.state+=2)}return l},touchend:function(f){this.stop(f),this.kH&&this.QH.moveend&&this.QH.moveend({x:this.UH.x,y:this.UH.y}),this.kH=!1,this.XH&&(this.QH.touch2&&this.QH.touch2(2),this.XH=void 0)},getX:function(f){if(f.offsetX)return this.jH?f.offsetX*window.devicePixelRatioMap:f.offsetX;var t=f.pageX-this.cs.x;return this.jH?t*window.devicePixelRatioMap:t},getY:function(f){if(f.offsetY)return this.jH?f.offsetY*window.devicePixelRatioMap:f.offsetY;var t=0;if(f.target&&null!=f.target.scrollTop){var i=f.target;for(t=i.scrollTop;i=i.offsetParent;)t+=i.scrollTop}var s=f.pageY+t-this.cs.y;return this.jH?s*window.devicePixelRatioMap:s},x:function(f){for(var t=f,i=f.offsetLeft;t=t.offsetParent;)i+=t.offsetLeft;return i},y:function(f){for(var t=f,i=f.offsetTop;t=t.offsetParent;)i+=t.offsetTop;return i},click:function(f){this.QH.click&&this.QH.click(f)},longpress:function(f){this.QH.longpress&&this.QH.longpress(f)},dbclick:function(f){this.QH.dbclick&&this.QH.dbclick(f)},on:function(f,t){window.attachEvent?this.ps.attachEvent(f,t):this.ps.addEventListener(f,t,!1)},stop:function(f){return f&&f.preventDefault?f.preventDefault():window.event.returnValue=!1,!1}},GHMap.fG=function(f,t){this.$=f,this.ps=t,this.Oi={x:f.lh.width/2,y:f.lh.height/2},this.tG=new GHMap.NH(t,{target:this,movestart:this.movestart,move:this.move,moveend:this.moveend,touch2:this.touch2,mousewheel:this.mousewheel,click:this.click,dbclick:this.dbclick,mousemove:this.mousemove,longpress:this.longpress,iG:this.iG,contextmenu:this.sG,eG:this.eG,rightMove:this.rightMove})},GHMap.fG.prototype={constructor:GHMap.fG,movestart:function(f){var t=this.target.$,i=t.px2gp(f,!0);t.rG(0,{point:i,pixel:f})},mousemove:function(f){this.target.$.aG(f)},move:function(f,t,i){function s(f,t,i){return(i.x-f.x)*(t.y-f.y)-(i.y-f.y)*(t.x-f.x)<0}var e=this.target.$,r=e.px2gp(t,!0);i&&i.ctrlKey?s(this.target.Oi,f,t)?e.setRotate(e.getRotate()-2):e.setRotate(e.getRotate()+2):i&&i.shiftKey?s(this.target.Oi,f,t)?e.setPitch(e.getPitch()-2):e.setPitch(e.getPitch()+2):(e.nG({x:t.x-f.x,y:t.y-f.y}),e.rG(1,{point:r,pixel:t}))},rightMove:function(f,t){var i,s,e,r=this.target.$;r.getMapMode()==GHMap.MapMode.MAP_3D&&(t.y>f.y?r.setPitch(r.getPitch()-5):r.setPitch(r.getPitch()+5)),i=this.target.Oi,s=f,((e=t).x-i.x)*(s.y-i.y)-(e.y-i.y)*(s.x-i.x)<0?r.setRotate(r.getRotate()-5):r.setRotate(r.getRotate()+5)},moveend:function(f){var t=this.target.$,i=t.px2gp(f,!0);t.rG(2,{point:i,pixel:f})},iG:function(){for(var f=0,t=this.oG.length,i=0;i=e.getMinZoomLevel()&&e.uf.scale(n/c)),2==s||3==s){var p=GHMap.G.getRotate(i.x1,i.y1,i.x2,i.y2);e.uf.setNorth(GHMap.G.angleToRadians(360-e.getRotate()+p-l))}e.uG&&e.uG.Th(),e.refresh()}}else this.oG=[]},lG:function(f){var t=f.deltaMode===WheelEvent.DOM_DELTA_LINE?40*f.deltaY:f.deltaY,i=Date.now(),s=i-(this.ev||0);return this.av=t,this.ev=i,t&&Math.abs(t)<4?this.pa="trackpad":this.pa=400this.q.t)return this.Ow(!0),void setTimeout(function(){alert("数据已过期")});this.uf.updateMatrix(),this.q.w=r.i.rx-r.i.lx,this.q.h=r.i.ry-r.i.ly,this.q.r=Math.sqrt(this.q.w*this.q.w+this.q.h*this.q.h),this.Mr=r.c,this.fg={x:this.q.w/2,y:this.q.h/2};var a=this.q.w/2-this.q.w/8,n=this.q.h/2-this.q.h/8,h=.1*this.q.s;this.q.Ce=new GHMap.Box(new GHMap.Point(this.q.cx-a,this.q.cy-n,0),new GHMap.Point(this.q.cx+a,this.q.cy+n,h));var c=this.Mr.c;if(c){var u={};c.forEach(function(f){var t=f.c.split("_");u[t[0]]=f.n}),this.Mr.cls=u}this.tg=this.Mr.t;var l=this.q.ti;if(this.tg&&0this.re&&(R=this.re),this.uf.setZoom(R),this.xn.forEach(function(f){f.updateLayerHeight()}),i=null,this.Oi&&this.setCenter(this.Oi),this.rg=this.getCenter(),this.tw=!0,this.Rb.tt(),this.xh(new GHMap.Ch("dataloadend",void 0,this))}else this.xh(new GHMap.Ch("dataloaderror",void 0,this));function U(f){var s=[];return f&&f.forEach(function(f){var t=f.g;t[0].z=0,t[1].z=0;var i={fnodeId:f.si,tnodeId:f.ei,fromNum:f.sf,toNum:f.ef,geom:t,linkType:f.t,length:f.l,oneway:f.o,linkId:f.i,weight:1};f.ed&&(f.ed.WEIGHT&&(i.weight=parseFloat(f.ed.WEIGHT)),f.ed.START_HEIGHT&&(t[0].z=parseFloat(f.ed.START_HEIGHT*o.q.s)),f.ed.END_HEIGHT&&(t[1].z=parseFloat(f.ed.END_HEIGHT*o.q.s))),s.push(i)}),s}function z(f,t,i,s,e,r,a){var n=new GHMap.Label(new GHMap.Point(t,i,r));return n.setHeight(e),n.setName(s.NAME),n.setOName(s.ONAME),n.setTextBold(f.sb),n.setTextFont(f.ib),a&&(n.setTextColor(a.fc),n.setTextSize(a.bw)),n}function V(f,t,i){var s=new GHMap.Marker(new GHMap.Point(f.x,f.y));s.setAvoid(!0);var e=0;if(void 0!==t.HEIGHT&&(e=t.HEIGHT),s.setHeight(e*o.q.s),s.Of=!0,10==t.TYPE)switch(s.setName(t.NAME),s.setOName(t.ONAME),t.CODE){case"100016":s.setDirection(GHMap.Direction.HORIZONTAL),s.setTextSize(16);break;case"100017":s.setDirection(GHMap.Direction.HORIZONTAL),s.setTextSize(12);break;case"100018":s.setDirection(GHMap.Direction.HORIZONTAL),s.setTextSize(14);break;case"100019":s.setDirection(GHMap.Direction.VERTICAL),s.setTextSize(16);break;case"100020":s.setDirection(GHMap.Direction.VERTICAL),s.setTextSize(12);break;case"100021":s.setDirection(GHMap.Direction.VERTICAL),s.setTextSize(14)}else s.setIcon(parseInt(t.POID));return i&&(s.setTextColor(i.fc),s.setAlpha(i.o/1e3),3this.VG;){var f=this.QG.shift();this.Lt(f).Dr()}},getCurrentFloorName:function(){return this.oi},getCurrentFloorNum:function(){return this.Lt(this.oi).getNum()},getCurrentFloorLayer:function(){return this.Lt(this.oi)},Tn:function(){return this.Lt("F1")},getCurrentFloorHeight:function(){return this.getCurrentFloorLayer().Rt},getFloorNames:function(){var t=[];return this.xn.forEach(function(f){t.push(f.hi)}),t},setMapMode:function(f){this.Ru!=f&&(f==GHMap.MapMode.MAP_2D?this.dg({pitch:this.getPitch(),scale:this.Qe},{pitch:0,scale:0}):f==GHMap.MapMode.MAP_3D&&this.dg({pitch:this.getPitch(),scale:this.Qe},{pitch:this.SG,scale:1}),this.Ru=f,this.An&&this.An.setMapModeImage())},dg:function(f,t){var i=new GHMap.Ms.Switch(this);this.Hs.stopOthers(i),i.setStartValue(f),i.setEndValue(t),this.Hs.addTween(i)},getMapMode:function(){return this.Ru},getBuildingInfo:function(){var f=this.q;return{minx:f.lx/f.s,miny:f.ly/f.s,maxx:f.rx/f.s,maxy:f.ry/f.s,name:f.n,code:f.m,codeExt:f.ec,scale:f.s}},getProjectInfo:function(){return this.getBuildingInfo()},setNightMode:function(f){this.yb=f,this.refresh()},isNightMode:function(){return this.yb},setLanguage:function(f){this.IG!=f&&(this.IG=f,this.pg())},pg:function(){for(var f=0;fthis.re&&(f=this.re);var s=this.getZoomLevel();if(f!=s)if(t){var e=s=this.re||(this.ew?this.uf.Eu(.9,GHMap.Ms.TYPE.ZOOM_IN):this.uf.Eu(.5,GHMap.Ms.TYPE.ZOOM_IN))},zoomOut:function(){this.getZoomLevel()<=this.ee||(this.ew?this.uf.Eu(1/.9,GHMap.Ms.TYPE.ZOOM_OUT):this.uf.Eu(2,GHMap.Ms.TYPE.ZOOM_OUT))},zoomToExtent:function(){this.uf.zoomToBox(new GHMap.Box(new GHMap.Point(0,0),new GHMap.Point(this.q.w,this.q.h)))},zoomToBox:function(f,t,i,s){var e=f.ut,r=f.lt;e=this._mect2gp(e),r=this._mect2gp(r);var a=this.uf;if(i){var n={eye:a.au.clone(),up:a.nu.clone(),center:a.Oi.clone(),scale:this.Qe,pitch:a.cu};a.backup(),a.zoomToBox(new GHMap.Box(e,r),t),this.resetRotate();var o={eye:a.au.clone(),up:a.nu.clone(),center:a.Oi.clone(),scale:0,pitch:0};a.reset();var h=new GHMap.Ms.ZoomPan(this);this.Hs.stopOthers(h),h.setStartValue(n),h.setEndValue(o),s&&h.setTime(s),this.Hs.addTween(h),this.Ru=GHMap.MapMode.MAP_2D,this.An&&this.An.setMapModeImage()}else a.zoomToBox(new GHMap.Box(e,r),t),this.resetRotate(),this.refresh()},zoomToOverlay:function(f){var t=this.Rb.getOverlayBox(f);t&&this.zoomToBox(t)},setRotate:function(f,t,i){var s=this.getRotate();f!=s&&(t?this.Mg(f-s,i):(this.cG(0),this.uf.setNorth(GHMap.G.angleToRadians(360-f)),this.cG(2),this.refresh()))},getLabelShowMode:function(){return this.Pf},Mg:function(f,t){f%=360,180f.endTime)return!1;var i=f.velocity.multNums(t-f.currentTime);return f.position.add(i),!0},velocity:function(f,t,i){var s,e;s=f.position.getX()<0?-GHMap.G.randomBetween(f.position.getX(),0):-GHMap.G.randomBetween(0,f.position.getX()),e=f.position.getY()<0?-GHMap.G.randomBetween(f.position.getY(),0):-GHMap.G.randomBetween(0,f.position.getY());var r=GHMap.G.randomBetween(t*this.scale,i*this.scale);f.velocity=new GHMap.I(s,e,r).multNum(.001)}},GHMap.ParticleEffect.Fountain=function(f){this.kg=new GHMap.I(0,0,-9.81),this.Pg=f.fountainRadius||5},GHMap.ParticleEffect.Fountain.prototype={init:function(){this.kg.multNum(this.scale)},update:function(f,t){if(f.position.getZ()<0)return!1;var i=(t-f.currentTime)/1e3;if(i<0)return!0;var s=this.kg.multNums(i),e=f.velocity.multNums(i);return f.position.add(e),f.velocity.add(s),!0},computeMaxTime:function(f,t){var i=1e3*t*2/9.81;return this.Og=i},velocity:function(f,t,i){var s=this.Pg*this.scale*1e3/this.Og,e=GHMap.G.randomBetween(0,2*Math.PI),r=s*Math.cos(e),a=s*Math.sin(e),n=GHMap.G.randomBetween(t*this.scale,i*this.scale);f.velocity=new GHMap.I(r,a,n),f.vz=n}},GHMap.ParticleEffect.Snow=function(f){this.nc=f},GHMap.ParticleEffect.Snow.prototype={init:function(){this.Rg=-this.nc.emitterHeight/(this.nc.duration/1e3)},update:function(f,t){if(f.position.getZ()<0||1=this.Kg&&this.getOrCreateParticle()},getOrCreateParticle:function(){this.rA=Date.now();for(var f=0;fthis.re&&(i=this.re),i},mA:function(f,t,i,s,e,r){var a=this.Ce,n=r.q,o=n.s,h=s*this.cA*o,c={};return c.minx=f*h+a.minx*o-n.lx+this.cs.x*o,c.maxy=a.maxx*o-t*h-n.ly+this.cs.y*o,c.maxx=c.minx+h,c.miny=c.maxy-h,c.texture=e,c.zoom=parseInt(i),c.center={x:(c.maxx+c.minx)/2,y:(c.maxy+c.miny)/2},c},yA:function(f,t,i){return 0===i?"root":f+"_"+t+"_"+i},SA:function(f,t,i,s){if(0==i)return this.Ih.root;f>>=1,t>>=1;var e=this.yA(f,t,i-1),r=this.Ih[e];return r||(this.request(f,t,i-1,this.lA[i-1],s),r=this.SA(f,t,i-1,s)),r},getTileUrl:function(f,t,i){return this.fe+"/"+i+"/"+t+"/"+f},request:function(f,t,i,s,e){var r=this.yA(f,t,i),a=this.Ih[r];if(a)return a;var n=this.getTileUrl(f,t,i);this.requestImage(e,{url:n,x:f,y:t,zoom:i,key:r,res:s})},releaseTileMap:function(){for(var f in this.Ih){this.Ih[f].texture.release()}this.Ih={}},xA:function(f,t){for(var i=0;i");var r=s.type;"guideBoards"==r?-1>10),56320+(1023&r)))}return t}},GHMap.zy=function(f,t){this.init(f)},GHMap.zy.prototype={init:function(f){this.Ce=f.box,this.Vy=f.region,this.jy=f.sphere,this.Mm=f.extensions,this.Hm=f.extras,this.Qy()},Qy:function(){if(this.ia=void 0,this.Ce){var f=this.Ce[3],t=this.Ce[7],i=this.Ce[11];this.ia={minx:this.Ce[0]-f,maxx:this.Ce[0]+f,miny:this.Ce[1]-t,maxy:this.Ce[1]+t,minz:this.Ce[2]-i,maxz:this.Ce[2]+i}}else if(this.Vy){var s=GHMap.G.lonLatToMercator(this.Vy[0],this.Vy[1]),e=GHMap.G.lonLatToMercator(this.Vy[2],this.Vy[3]);this.ia={minx:s.x,maxx:e.x,miny:s.y,maxy:e.y,minz:this.Vy[4],maxz:this.Vy[5]}}else if(this.jy){var r=this.jy[3];this.ia={minx:this.jy[0]-r,maxx:this.jy[0]+r,miny:this.jy[1]-r,maxy:this.jy[1]+r,minz:this.jy[2]-r,maxz:this.jy[2]+r,radius:r}}this.ia?(this.ia.xAxisLength=this.ia.maxx-this.ia.minx,this.ia.yAxisLength=this.ia.maxy-this.ia.miny,this.ia.zAxisLength=this.ia.maxz-this.ia.minz,void 0===this.ia.radius&&(this.ia.radius=Math.sqrt(this.ia.xAxisLength*this.ia.xAxisLength+this.ia.yAxisLength*this.ia.yAxisLength+this.ia.zAxisLength*this.ia.zAxisLength)/2)):console.error("TDTileBounding rect 未解析, 请联系技术人员")},transform:function(f){if(this.Ce||this.jy){var t=this.center;t=new GHMap.I(t.x,t.y,t.z).multMat4(f);var i=this.xAxisLength,s=this.yAxisLength,e=this.zAxisLength,r=this.rect;r.minx=t.getX()-i/2,r.maxx=t.getX()+i/2,r.miny=t.getY()-s/2,r.maxy=t.getY()+s/2,r.minz=t.getZ()-e/2,r.maxz=t.getZ()+e/2}}},GHMap.A.defineProperties(GHMap.zy.prototype,{rect:{get:function(){return this.ia}},center:{get:function(){var f=this.rect;return{x:(f.minx+f.maxx)/2,y:(f.miny+f.maxy)/2,z:(f.minz+f.maxz)/2,radius:f.radius}}},centerZ:{get:function(){var f=this.rect;return{x:(f.minx+f.maxx)/2,y:(f.miny+f.maxy)/2,z:f.minz,radius:f.radius}}},xAxisLength:{get:function(){return this.ia.xAxisLength}},yAxisLength:{get:function(){return this.ia.yAxisLength}},zAxisLength:{get:function(){return this.ia.zAxisLength}}}),GHMap.Xy=function(f,t){this.Yy=f,this.fe=t,this.Wy=void 0,this.Jy=void 0,this.Zy=new GHMap.nf,this.Ky=void 0,this.qy=!1,this.$y=!1},GHMap.Xy.prototype={request:function(){var t=this,f=this.fe,i=GHMap.fS.getInstance(this.map.Is);this.qy?i.addToFirst(f):this.$y||(this.qy=!0,this.$y=!0,i.addObject({url:f,success:function(f){t.QA(f),t.qy=!1},error:function(){t.qy=!1,console.error("TDTileContent : ",f)}}))},release:function(){this.tS&&(this.Jy=void 0,this.Ky=void 0,this.tS.release(),this.$y=!1,this.tS=void 0)},QA:function(f){this.iS=f.byteLength/1024,this.Yy.sS=Date.now(),this.Yy.getMemoryManager().addTile(this.Yy);var t=new Uint8Array(f);GHMap.Ny.getMagic(t);this.eS(f)},eS:function(f){var t=new Uint8Array(f),i=new DataView(f),s=Uint32Array.BYTES_PER_ELEMENT,e=0+s,r=i.getUint32(e,!0);if(1!==r)throw new RuntimeError("Only Batched 3D Model version 1 is supported. Version "+r+" is not.");e+=s;var a=i.getUint32(e,!0);e+=s;var n=i.getUint32(e,!0);e+=s;var o=i.getUint32(e,!0);e+=s;var h=i.getUint32(e,!0);e+=s;var c=i.getUint32(e,!0);e+=s;var u=0;570425344<=h?(e-=2*s,u=n,h=o,o=n=c=0,console.error("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/Batched3DModel.")):570425344<=c&&(e-=s,u=h,h=n,c=o,o=n=0,console.error("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/Batched3DModel."));var l,d=GHMap.A.getValue;if(0===n)l={BATCH_LENGTH:d(u,0)};else{var p=GHMap.Ny.getStringFromTypedArray(t,e,n);l=JSON.parse(p),e+=n}var v=new Uint8Array(f,e,o);e+=o;var M,H,G=new GHMap.rS(l,v);if(u=G.getGlobalProperty("BATCH_LENGTH"),G.featuresLength=u,0this.PS},releaseOne:function(){if(this.isOverflow()){var f=this.Yt.shift(),t=f.fl.iS;f.release(),this.RS-=t,this.isOverflow()&&this.releaseOne()}}},GHMap.fS=function(f){this.Is=f,this.it=[],this.zS={},this.Oh=15,this.VS=0},GHMap.fS.getInstance=function(f){return GHMap.fS.US||(GHMap.fS.US=new GHMap.fS(f)),GHMap.fS.US},GHMap.fS.prototype={addObject:function(f){this.zS[f.url]=f,this.it.push(f),this.needLoad()},addToFirst:function(f){var t=this.zS[f];if(t){var i=this.it.indexOf(t);-1this.Oh)this.XS.push({src:i,callback:f,data:s,scale:e,isWall:t,generic:r});else{i=i&&i.replace(/\\/g,"/");var n=this.Map[i];if(n&&n.texture&&this.map.Rf.isTexture(n.texture))return f(n,s),void l();var o=this.CallBack[i];if(o||(o=new Array,this.CallBack[i]=o),o.push({callback:f,data:s}),!(-1f.length&&console.error("GHMap._TgaLoader: No data."),i+=v.id_length;var s=!1,e=!1,u=!1;switch(v.image_type){case 9:e=s=!0;break;case 1:e=!0;break;case 10:s=!0;break;case 2:break;case 11:u=s=!0;break;case 3:u=!0}var r=document.createElement("canvas");r.width=v.width,r.height=v.height;var a=r.getContext("2d"),n=a.createImageData(v.width,v.height),o=function(f,t,i,s,e){var r,a,n,o;if(a=i.pixel_size>>3,n=i.width*i.height*a,t&&(o=e.subarray(s,s+=i.colormap_length*(i.colormap_size>>3))),f){var h,c,u;r=new Uint8Array(n);for(var l=0,d=new Uint8Array(a);l>4){default:case 2:h=t,a=r=0,o=n=1,c=i;break;case 0:r=0,h=t,a=i-(n=1),c=o=-1;break;case 3:r=t-1,h=n=-1,a=0,o=1,c=i;break;case 1:r=t-1,a=i-1,c=o=h=n=-1}if(u)switch(v.pixel_size){case 8:!function(f,t,i,s,e,r,a,n){var o,h,c,u=0,l=v.width;for(c=t;c!==s;c+=i)for(h=e;h!==a;h+=r,u++)o=n[u],f[4*(h+l*c)+0]=o,f[4*(h+l*c)+1]=o,f[4*(h+l*c)+2]=o,f[4*(h+l*c)+3]=255}(f,a,o,c,r,n,h,s);break;case 16:!function(f,t,i,s,e,r,a,n){var o,h,c=0,u=v.width;for(h=t;h!==s;h+=i)for(o=e;o!==a;o+=r,c+=2)f[4*(o+u*h)+0]=n[c+0],f[4*(o+u*h)+1]=n[c+0],f[4*(o+u*h)+2]=n[c+0],f[4*(o+u*h)+3]=n[c+1]}(f,a,o,c,r,n,h,s);break;default:console.error("GHMap._TgaLoader: Format not supported.")}else switch(v.pixel_size){case 8:!function(f,t,i,s,e,r,a,n,o){var h,c,u,l=o,d=0,p=v.width;for(u=t;u!==s;u+=i)for(c=e;c!==a;c+=r,d++)h=n[d],f[4*(c+p*u)+3]=255,f[4*(c+p*u)+2]=l[3*h+0],f[4*(c+p*u)+1]=l[3*h+1],f[4*(c+p*u)+0]=l[3*h+2]}(f,a,o,c,r,n,h,s,e);break;case 16:!function(f,t,i,s,e,r,a,n){var o,h,c,u=0,l=v.width;for(c=t;c!==s;c+=i)for(h=e;h!==a;h+=r,u+=2)o=n[u+0]+(n[u+1]<<8),f[4*(h+l*c)+0]=(31744&o)>>7,f[4*(h+l*c)+1]=(992&o)>>2,f[4*(h+l*c)+2]=(31&o)>>3,f[4*(h+l*c)+3]=32768&o?0:255}(f,a,o,c,r,n,h,s);break;case 24:!function(f,t,i,s,e,r,a,n){var o,h,c=0,u=v.width;for(h=t;h!==s;h+=i)for(o=e;o!==a;o+=r,c+=3)f[4*(o+u*h)+3]=255,f[4*(o+u*h)+2]=n[c+0],f[4*(o+u*h)+1]=n[c+1],f[4*(o+u*h)+0]=n[c+2]}(f,a,o,c,r,n,h,s);break;case 32:!function(f,t,i,s,e,r,a,n){var o,h,c=0,u=v.width;for(h=t;h!==s;h+=i)for(o=e;o!==a;o+=r,c+=4)f[4*(o+u*h)+2]=n[c+0],f[4*(o+u*h)+1]=n[c+1],f[4*(o+u*h)+0]=n[c+2],f[4*(o+u*h)+3]=n[c+3]}(f,a,o,c,r,n,h,s);break;default:console.error("GHMap._TgaLoader: Format not supported.")}}(n.data,v.width,v.height,o.pixel_data,o.palettes);return a.putImageData(n,0,0),r}},GHMap.g958=function(f,t){this.api=f,this.key=t,this.load_script=function(f,t){var i=document.getElementsByTagName("head")[0],s=document.createElement("script");s.type="text/javascript",s.src=f,s.onload=s.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(s.onload=s.onreadystatechange=null,i&&s.parentNode&&i.removeChild(s))},s.onerror=function(){t()},i.insertBefore(s,i.firstChild)},this.http_get=function(f,t,i,s){var e="gh_"+Math.round(1e4*Math.random());i.key=this.key;var r={action:f,sid:t,uname:"",lg:"1",body:i},a=JSON.stringify(r),n=this.api+"?jsoncallback=GHMap.g958."+e+"¶ms="+encodeURIComponent(a);this.load_script(n,s),GHMap.g958[e]=function(f){delete GHMap.g958[e],s&&s(f)}},this.http_post=function(f,t,i,s,e){var r=new XMLHttpRequest;r.overrideMimeType("text/plain"),r.open("POST",f,!0),e&&(r.responseType=e),r.addEventListener("load",function(f){var t=f.target.response;200===this.status||0===this.status?i&&i(t):s&&s(f),r=null},!1),r.addEventListener("error",function(f){s&&s(f)},!1),r.send(t)},this.http_load=function(f,i,s,t){var e=new XMLHttpRequest;e.overrideMimeType("text/plain"),e.open("GET",f,!0),t&&"arraybuffer"==(e.responseType=t)&&e.overrideMimeType("application/octet-stream"),e.addEventListener("load",function(f){var t=f.target.response;200===this.status||0===this.status?i&&i(t):s&&s(f),e=null},!1),e.addEventListener("error",function(f){s&&s(f)},!1),e.send(null)},this.Fs=function(f,t,i){this.http_load(f,t,i)},this.Jw=function(f,t,i){this.http_get("getMapDataPath",f,t,i)},this.Yl=function(f,t,i){this.http_get("getAppToken",f,t,i)},this.Bn=function(f,t,i){var s="https://restapi.amap.com/v3/direction/"+("p"==f.type?"walking":"driving")+"?key=4c4547068147b62a6652fe773312cc94";for(var e in delete f.type,f)s+="&"+e+"="+f[e];this.http_load(s,t,i)}},GHMap.FileLoaderManager=function(f){this.$=f,this.JS=[],this.ZS=[],this.KS=[],this.zS={},this.qS={},this.Oh=10,this.Is=f.Is},GHMap.FileLoaderManager.prototype={qo:function(f){var t=f.url,i=this.qS[t];if(i&&f.callback)f.callback(f.data,i);else{var s=this.zS[t];s||(s=[],this.zS[t]=s),s.push(f),-1|/g," ")).toLowerCase().indexOf(t.toLowerCase())},kC:function(f){var t=f.$x(),i=f.fC();if(t){var s,e=this.TC[t];if(e||(e={},this.TC[t]=e),i)e[s="video"]||(e[s]=[]),e[s].push(f);else e[s="obj"]||(e[s]=[]),e[s].push(f);this.PC(f,i,e)}else i&&f.playVideo()},PC:function(f,t,i){if(t){var s=f.Sx.rf.CODE,e=!1,r=this.DC[s];this.EC&&null==r?e=!0:1==r&&(e=!0),(f.$t=e)&&this.OC([f])}else i&&i.playing&&(f.$t=!1)},LC:function(f){var t,i=f.Zx();if(i.num&&((t=this.RC(i.num))||(t={num:i.num,floors:[]},this.SC.push(t)),i.floor)){var s=this.UC(t.floors,i.floor);s||(s={name:i.floor,num:this.zC(i.floor),objects:[]},t.floors.push(s),t.floors.sort(function(f,t){return f.num-t.num})),s.objects.push(f)}},UC:function(f,t){for(var i=0;i= directionLightCount) break; ","\t\tDirectionLight light = directionLights[ i ]; "," vec3 light_vec = normalize( -light.dir ); "," ambient += light.ambient; "," diffuse += calc_diffuse( light_vec, normal, light.diffuse ); "," specular += calc_specular( light_vec, normal , normalize( mat3( normal_matrix ) * v_view_vec ) , light.specular, light.shininess ) ; "," }\t","} ","\tvec4 result; ","\tif(use_light == 1 && ( directionLightCount > 0 || spotLightCount > 0 ) ) {","\t\tresult = vec4(ambient,1.0) * ambientFactor + vec4(diffuse,1.0) * diffuseFactor + vec4( specular ,1.0 ) * specularFactor + vec4(material.emissive, 0.0);","\t\tresult.a = diffuseFactor.a ; ","\t} else {","\t\tresult = diffuseFactor2 + vec4(material.emissive, 0.0) ; ","\t}","#env_start","\tif(envMapUse == 1) {","\t\tvec3 viewDir = -v_view_vec; ","\t\tvec3 reflectDir = normalize( reflect(viewDir, v_normal ) ); ","\t\tconst float mPerturbationAmt = 0.05; ","\t\treflectDir.x = reflectDir.x + mPerturbationAmt * reflectDir.x * normal.x; ","\t\treflectDir.y = reflectDir.y + mPerturbationAmt * reflectDir.y * normal.z; ","\t\treflectDir.z = reflectDir.z + mPerturbationAmt * reflectDir.z * normal.y; ","\t\tvec4 envColor = textureCube(envMap, vec3( reflectDir.x, reflectDir.z, reflectDir.y )) ; ","\t\tresult.rgb = mix(result.rgb, envColor.rgb, 0.9); ","\t}","#env_end","\tif(result.a == 0.0) discard; ","\tif( use_material == 0 ) { ","\t\tresult = vec4( u_color, 1.0 ); ","\t} else if( use_material == 2 ) {","\t\tresult = diffuseFactor2 ; ","\t}","\tif (reflectionMapUse == 1 ) {","\t\tvec2 _uv2 = vec2( gl_FragCoord.x / uWidth, gl_FragCoord.y / uHeight ) ; ","\t\tconst float mPerturbationAmt = 0.02; ","\t\t_uv2.x = _uv2.x + mPerturbationAmt * _uv2.x * normal.x; ","\t\t_uv2.y = _uv2.y + mPerturbationAmt * _uv2.y * normal.y; ","\t\tvec4 color4 = texture2D(reflectionMap, _uv2); ","\t\tif(color4.a > 0.0 ) result.rgb = mix( result.rgb, color4.rgb, 0.3); ","\t}","\tif( heatMapUse == 1 ) {","\t\tvec3 shadowCoord = ( v_position_0.xyz / v_position_0.w ) * 0.5 + 0.5; ","\t\tvec4 value4 = texture2D( heatMap, shadowCoord.xy ); ","\t\tif( value4.a > 0.3 ) { ","\t\t\tvec4 color4 = texture2D( heatColorMap, vec2( value4.a, 0.5 ) ); ","\t\t\tresult.rgb = mix( result.rgb, color4.rgb , 0.6); ","\t\t}","\t} "," if( useFog == 1) result.rgb = mix( result.rgb, fogColor, fogFactor ); ","\tvec4 color = result * ( u_alpha * opacity ); "," \tif(\tuse_material == 3 )\t{","\t\tcolor.rgb = mix( color.rgb, u_color, u_color_factor ) ;","\t}"," \tgl_FragColor = color; ","\tif(useDepthExt == 1) {","\t\t#ifdef USE_DEPTH_EXT","\t\t\tfloat fz = gl_FragCoord.z / gl_FragCoord.w; ","\t\t\tgl_FragDepthEXT = (fz - uNear ) / (uFar - uNear) ; ","\t\t#endif","\t}","}"],this.gc={},this.init(this.Gc,this.wc),this.KC={ambient:"vec3",diffuse:"vec3",specular:"vec3",dir:"vec3",shininess:"float",keep:"int"}},GHMap.pC.prototype={qC:function(f){for(var t=[],i=void 0,s=0;sGHMap.nC.Oh?GHMap.nC.Rh.push(f):(GHMap.nC.Vh(f),GHMap.nC.ga++)},Vh:function(s){s.map.Is.Fs(s.url,function(f){var t=s.map.Or(f),i=JSON.parse(t);s.success(i),GHMap.nC.ga--,GHMap.nC.jh()},function(f){GHMap.nC.ga--,GHMap.nC.jh()})},jh:function(){if(0Math.abs(f.getZ())?s.setValue(-f.getY(),f.getX(),0):s.setValue(0,-f.getZ(),f.getY())):s=f.cross(t),{x:s.getX(),y:s.getY(),z:s.getZ(),w:i}},getShadowMatrix:function(f){var t=f.uf,i=new GHMap.nf,s=f.fg,e=new GHMap.I(s.x+100,s.y,3e3),r=new GHMap.I(0,1,0);i.lookAt(e,new GHMap.I(s.x,s.y,0),r);var a=new GHMap.nf;return a.perspective(t.Gu,t.hu,1e3,2e4),a.mult(i)}}),GHMap.yC=function(f){this.y_=f.startDistance,this.S_=f.endDistance,this.if=new GHMap._("#FFFFFF"),f.color&&this.setColor(f.color)},GHMap.yC.prototype={setStartDistance:function(f){this.y_=f},setEndDistance:function(f){this.S_=f},setColor:function(f){this.if.set(f)},getData:function(f){return{distance:new Float32Array([this.y_*f,this.S_*f]),color:new Float32Array(this.if.getRGBArray())}}},GHMap.HC=function(f){this.$=f,this.Rf=f.getGLContext(),this.Hc=new GHMap.Program(this.Rf),this.Gc=["uniform mat4 mvp_matrix;\t\t","attribute vec3 position;\t\t","varying vec4 v_position; ","void main(void) {","\tvec4 pTan = vec4( position , 1.0 ); ","\tgl_Position = mvp_matrix * pTan; ","\tv_position = gl_Position; ","}"],this.wc=["precision mediump float;","varying vec4 v_position; ","vec4 packDepth( float depth ) {","\tvec4 bitSh = vec4(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0); ","\tvec4 bitMsk = vec4(0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0); ","\tvec4 enc = fract(depth * bitSh); ","\tenc -= enc.xxyz * bitMsk; ","\treturn enc; ","}","void main(void) {","\tvec4 result = packDepth( gl_FragCoord.z ); ","\tgl_FragColor = result;","}"],this.gc={},this.init(this.Gc,this.wc)},GHMap.HC.prototype={init:function(f,t){var i=this.Hc;if(i.createProgram(f.join("\n"),t.join("\n")),i.isValid()){i.useProgram();GHMap.Q.setUniformLoc(this.gc,i,["mvp_matrix"]),GHMap.Q.setAttribLoc(this.gc,i,["position"])}},Zc:function(f,t,i){if(void 0!==i){var s=this.gc[f],e=this.Rf;"mat4"===t?e.uniformMatrix4fv(s,e.FALSE,i):"vec4"===t?e.uniform4fv(s,i):"vec3"===t?e.uniform3fv(s,i):"vec2"===t?e.uniform2fv(s,i):"float"===t?e.uniform1f(s,i):"int"===t&&e.uniform1i(s,i)}},render:function(f,t){this.Hc.useProgram();var i=t.data,s=this.Rf;this.Zc("mvp_matrix","mat4",f.mvpData);for(var e=[],r=0;r=f.aT[0]&&t>=e,t>>=e):e<0&&(f<<=-e,t<<=-e),{x:f,y:t,zoom:s}},TT:function(f,t,i){for(var s=-1,e=0;e=this.wT)return this.TT(),void this.gT.push({x:f,y:t,zoom:i});var n=this.Lh(f,t,i,s);this.IT({url:n,x:f,y:t,zoom:i,p:1==s?1:0,key:r})},DT:function(){if(this.$.UG&&!this.AT){this.AT=!0;var f=this.$.UG+"index.dat",e=this;this.$.Is.http_load(f,function(f){for(var t in e.TA=JSON.parse(f),e.TA){var i=e.TA[t],s={};i.userStyles&&i.userStyles.forEach(function(f){if((s[f.Name]=f).fillColor){var t=new GHMap._(f.fillColor);f.GT=t.getArray()}}),i.HT=s}e.$.refresh()},function(){e.AT=!1})}},Lh:function(f,t,i,s){var e=this.$.UG+i+"/"+f+"_"+t;return s&&(e+="_p"),e+=".mvt"},xA:function(f,t){for(var i=0;i>w,A=H>>w,m=this.NA(g,A,b);if(!m)break;u.push(m),(m=this.NA(g,A,b,!0))&&u.push(m)}u.forEach(function(f){l.indexOf(f)<0&&l.push(f)})}var y=t.Rf;y.disable(y.DEPTH_TEST);var S=GHMap.A.copy({},f);void 0===S.bottomHeight&&(S.bottomHeight=0);var x=this.NT(l);this.kT(S,x),S.bottomHeight+=GHMap.A.getLayerDisHeight(this.$);var C=this.PT(l);this.OT(S,C),y.enable(y.DEPTH_TEST),this.RT=l}else this.DT()},kT:function(t,f){var i=this.ke;f.forEach(function(f){f.render(t,i)})},OT:function(t,f){var i=this.la;f.forEach(function(f){f.render(t,i)})},NT:function(f){var t=[];return f.forEach(function(f){f.dT().forEach(function(f){t.push(f)})}),t.sort(function(f,t){var i=f.lT-t.lT;return 0==i&&(i=f.Yy.nc.zoom-t.Yy.nc.zoom),i}),t},PT:function(f){var t=[];return f.forEach(function(f){f.pT().forEach(function(f){t.push(f)})}),t.sort(function(f,t){var i=f.lT-t.lT;return 0==i&&(i=f.Yy.nc.zoom-t.Yy.nc.zoom),i}),t},renderPoi:function(t){if(this.RT){var i=this.$,f=i.Rf;f.disable(f.DEPTH_TEST),this.RT.forEach(function(f){f.renderPoi(t,i)}),f.enable(f.DEPTH_TEST)}},renderMarkers:function(f){},LT:function(f){this.UT().postMessage(f,[f.data])},td:function(f){var t=this.Ih[f.code.key];t&&t.nT(f)},UT:function(){if(!this.Cr){var i=this;this.Cr=new Worker(GHMap.zT),this.Cr.onmessage=function(f){var t=f.data;i.td(t)}}return this.Cr}},GHMap.zT=function(){if(!document.currentScript)return"tileload.js";var f=document.currentScript.src,t=f.lastIndexOf("/");return f.substr(0,t+1)+"tileload.js"}(),GHMap.uT=function(f,t,i,s){GHMap.te.call(this,f,t),this.TA=i,this.sT=s,this.wM=new GHMap.Hr(f,t+"_M",!1,!0)},GHMap.A.copy(GHMap.uT.prototype,GHMap.te.prototype),GHMap.uT.prototype.constructor=GHMap.uT,GHMap.uT.prototype.addObject=function(f){var t="Name";this.TA&&(t=this.TA.fieldName);var i=f.properties[t];if(i){var s=this.$.q.s,e=f.coord,r=this.$._mect2gp({x:e[0],y:e[1]}),a=f.geometry.coordinates[0],n=r.x+a.x*s,o=r.y+a.y*s,h=new GHMap.Marker(new GHMap.Point(n,o));if(10<=i.length){var c=parseInt(i.length/2);i=i.substring(0,c)+"
"+i.substring(c)}h.setName(i),null!=f.properties._ANGLE_&&h.setRotate(parseFloat(f.properties._ANGLE_)),h.setTextLayout(GHMap.Marker.TextLayout.CENTER),h.setSpacing(0),h.setAvoid(!0);var u=this.VT();if(u){if(3 0.5 ? 1.0 : v_alpha;","\t\tif(g_alpha != 1.0 ) color.a *= mix( 0.0, 1.0, g_alpha* 2.0 ); ","\t}","\tbool render = false; ","\tif( uAlphaTest == 1 && color.a >= 0.5 ) render = true; ","\telse if ( uAlphaTest == 0 && color.a < 0.5 ) render = true; ","\tif(!render) discard; ","\tcolor.rgb = hdr( color.rgb,exposure ); ","\tgl_FragColor = color ; ","\tif(gl_FragColor.a == 0.0) discard; ","\tif(useDepthExt == 1) {","\t\t#ifdef USE_DEPTH_EXT","\t\t\tfloat fz = gl_FragCoord.z / gl_FragCoord.w; ","\t\t\tgl_FragDepthEXT = (fz - uNear ) / (uFar - uNear) ; ","\t\t#endif","\t}","}"],this.gc={},this.tt(this.Gc,this.wc)},GHMap.EffectRender.prototype={tt:function(f,t){var i=this.Hc;if(i.createProgram(f.join("\n"),this.jf()+t.join("\n")),i.isValid()){i.useProgram();this.setUniformLoc(this.gc,["mvp_matrix","height_scale","mapScale","bottom_height","uvOffset","isShine","diffuseMap","uFar","uNear","useDepthExt","aoMap","uScreenWidth","uScreenHeight","uAlphaTest","diffuseColor","exposure"]),this.setAttribLoc(this.gc,["position","uv","uvAlpha"])}},setUniformLoc:function(t,f){var i=this.Hc;f.forEach(function(f){t[f]=i.getUniformLocation(f)})},setAttribLoc:function(t,f){var i=this.Hc;f.forEach(function(f){t[f]=i.getAttribLocation(f)})},jf:function(){if(this.Jc){return["#extension GL_EXT_frag_depth : enable","#ifndef USE_DEPTH_EXT","#define USE_DEPTH_EXT 1","#endif"].join("\n")+"\n"}return""},Zc:function(f,t,i){if(void 0!==i){var s=this.gc[f];if(s){var e=this.Rf;"mat4"===t?e.uniformMatrix4fv(s,e.FALSE,i):"vec4"===t?e.uniform4fv(s,i):"vec3"===t?e.uniform3fv(s,i):"vec2"===t?e.uniform2fv(s,i):"float"===t?e.uniform1f(s,i):"int"===t&&e.uniform1i(s,i)}}},Kc:function(f,t,i,s,e){if(t){var r=f.TEXTURE0+i;f.activeTexture(r),f.bindTexture(f.TEXTURE_2D,t),f.uniform1i(this.gc[s],i),e.push(r)}},bindData:function(f){var t=this.Rf,i=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,i),t.bufferData(t.ARRAY_BUFFER,f,t.STREAM_DRAW),i},bindIndiceData:function(f){var t=this.Rf,i=t.createBuffer();return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i),t.bufferData(t.ELEMENT_ARRAY_BUFFER,f,t.STREAM_DRAW),i},render:function(f,t){this.Hc.useProgram();var i=this.Rf;this.Zc("mvp_matrix","mat4",f.mvpData),this.Zc("height_scale","float",1),this.Zc("useDepthExt","int",0==f.useDepthExt?0:1),this.Zc("uFar","float",f.zfar),this.Zc("uNear","float",f.znear),this.Zc("uScreenWidth","float",f.screenWidth),this.Zc("uScreenHeight","float",f.screenHeight),this.Zc("uvOffset","vec2",t.uvOffset),this.Zc("uAlphaTest","int",t.alphaTest?1:0),this.Zc("bottom_height","float",t.floorBottomHeight),this.Zc("diffuseColor","vec3",t.diffuseColor),this.Zc("exposure","float",t.exposure);var s=[];this.Kc(i,t.tex,0,"diffuseMap",s),this.Kc(i,t.aoTex,1,"aoMap",s);var e=[],r=[],a=this.bindData(t.pos),n=this.gc.position;i.enableVertexAttribArray(n),i.bindBuffer(i.ARRAY_BUFFER,a),i.vertexAttribPointer(n,4,i.FLOAT,i.FALSE,0,0),e.push(a),r.push(n),a=this.bindData(t.uvs),n=this.gc.uv,i.enableVertexAttribArray(n),i.bindBuffer(i.ARRAY_BUFFER,a),i.vertexAttribPointer(n,2,i.FLOAT,i.FALSE,0,0),e.push(a),r.push(n),a=this.bindData(t.uvAlpha),n=this.gc.uvAlpha,i.enableVertexAttribArray(n),i.bindBuffer(i.ARRAY_BUFFER,a),i.vertexAttribPointer(n,1,i.FLOAT,i.FALSE,0,0),e.push(a),r.push(n),a=this.bindIndiceData(t.indices),e.push(a),i.drawElements(i.TRIANGLES,t.indices.length,i.UNSIGNED_SHORT,0),s.forEach(function(f){i.activeTexture(f),i.bindTexture(i.TEXTURE_2D,null)}),e.forEach(function(f){i.deleteBuffer(f)}),r.forEach(function(f){i.disableVertexAttribArray(f)}),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,null),i.bindBuffer(i.ARRAY_BUFFER,null)}},GHMap.EffectWall=function(f){f=f||{},GHMap.BaseEffectObject.call(this,f),this.isWall=!0,this.pi=f.points||[],this.GH=f.image,this.OF=void 0===f.imageMeterWidth?1:f.imageMeterWidth,this.RF=void 0===f.imageMeterWidth?1:f.imageMeterHeight,this.UF=void 0===f.isShine||f.isShine,this.AF=void 0===f.scrollXTime?0:f.scrollXTime,this.yF=void 0===f.scrollYTime?0:f.scrollYTime,this.mF=void 0!==f.scrollXClock&&f.scrollXClock,this.SF=void 0===f.scrollYUp||f.scrollYUp,this.zF=void 0===f.exposure?1:f.exposure},GHMap.EffectWall.prototype={getPoints:function(){return this.pi},getImage:function(){return this.GH},isShine:function(){return this.UF},getImageMeterWidth:function(){return this.OF},getImageMeterHeight:function(){return this.RF}},defineProperties(GHMap.EffectWall.prototype,GHMap.BaseEffectObject.prototype),GHMap.SweepEffect=function(f){GHMap.Overlay.call(this),this.tt(f)},GHMap.SweepEffect.prototype={tt:function(f){this.nt=f.time||5e3,this.oF=f.endPosition,this.zi=f.position,this.hF=new GHMap.Point(this.zi.x,this.zi.y,this.zi.z),this.if=new GHMap._(f.color||"#FFFF00"),this.cF=void 0===f.mixFactor?1:f.mixFactor,this.GH=f.image,this.$T=void 0===f.delayTime?0:f.delayTime},initStartTime:function(){this.wa=Date.now()+this.$T},setColor:function(f){this.if.set(f)},setAlpha:function(f){this.if.setAlpha(f)},getImage:function(){return this.GH},rF:function(){var f=Date.now();return f 0.7 ) percent = mix( 0.0, 1.0, ( u_percent - 0.7 ) / 0.3 ) ; ","\t\tgl_FragColor.a = alpha * ( 1.0 - percent ); ","\t} else {","\t\tfloat dis = abs( v_as.x ); ","\t\tif( dis > 0.4 ) ","\t\t\tgl_FragColor.a *= mix( 1.0, 0.3, ( dis - 0.4 ) / 0.6 );","\t} ","\tif( gl_FragColor.a == 0.0 ) discard; ","}"],this.$=f,this.Rf=f.getGLContext(),this.Hc=new GHMap.Program(this.Rf),this.gc={},this.init(this.Gc,this.wc)},GHMap.SweepEffectRender.prototype={init:function(f,t){var i=this.Hc;i.createProgram(f.join("\n"),t.join("\n")),i.isValid()&&(i.useProgram(),GHMap.Q.setUniformLoc(this.gc,i,["mvp_matrix","u_color","u_pos","u_angle","u_size","u_bottom_height","u_mix_factor","u_type","u_sampler","u_percent"]),GHMap.Q.setAttribLoc(this.gc,i,["a_vs"]))},Zc:function(f,t,i){if(void 0!==i){var s=this.gc[f],e=this.Rf;"mat4"===t?e.uniformMatrix4fv(s,e.FALSE,i):"vec4"===t?e.uniform4fv(s,i):"vec3"===t?e.uniform3fv(s,i):"vec2"===t?e.uniform2fv(s,i):"float"===t?e.uniform1f(s,i):"int"===t&&e.uniform1i(s,i)}},render:function(f,t){this.Hc.useProgram();var i=this.Rf;this.Zc("mvp_matrix","mat4",f.mvpData),this.Zc("u_color","vec4",new Float32Array(t.color)),this.Zc("u_pos","vec3",t.pos),this.Zc("u_angle","float",t.angle),this.Zc("u_size","vec2",t.size),this.Zc("u_bottom_height","float",t.bottomHeight),this.Zc("u_mix_factor","float",t.mixFactor),this.Zc("u_percent","float",t.percent);var s=GHMap.Q.bufferData(i,t.vs);i.enableVertexAttribArray(this.gc.a_vs),i.bindBuffer(i.ARRAY_BUFFER,s),i.vertexAttribPointer(this.gc.a_vs,2,i.FLOAT,i.FALSE,0,0);var e=GHMap.Q.bufferIndiceData(i,t.indice);i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e);var r=[];t.texture?(this.Zc("u_type","int",1),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture),i.uniform1i(this.gc.u_sampler,0),r.push(i.TEXTURE0)):this.Zc("u_type","int",0),i.drawElements(i.TRIANGLES,t.indice.length,i.UNSIGNED_SHORT,0),r.forEach(function(f){i.activeTexture(f),i.bindTexture(i.TEXTURE_2D,null)}),i.disableVertexAttribArray(this.gc.a_vs),GHMap.Q.releaseBuffer(i,s),GHMap.Q.releaseBuffer(i,e)},release:function(){this.Hc.release()}},GHMap.SweepEffectLayer=function(f,t){GHMap.te.call(this,f,t)},GHMap.A.copy(GHMap.SweepEffectLayer.prototype,GHMap.te.prototype),GHMap.SweepEffectLayer.prototype.constructor=GHMap.SweepEffectLayer,GHMap.SweepEffectLayer.prototype.render=function(f){var t=this.$.Rf;t.disable(t.DEPTH_TEST);for(var i=this.$.getCurrentFloorLayer().Rt||0,s=0;s 0.4 ) ","\t\tgl_FragColor.a *= mix( 1.0, 0.1, ( v_alpha - 0.4 ) / 0.6 );","}"],this.$=f,this.Rf=f.getGLContext(),this.Hc=new GHMap.Program(this.Rf),this.gc={},this.init(this.Gc,this.wc)},GHMap.CircleSweepEffectRender.prototype={init:function(f,t){var i=this.Hc;i.createProgram(f.join("\n"),t.join("\n")),i.isValid()&&(i.useProgram(),GHMap.Q.setUniformLoc(this.gc,i,["mvp_matrix","u_color","u_pos","u_radius","u_bottom_height"]),GHMap.Q.setAttribLoc(this.gc,i,["a_vs"]))},Zc:function(f,t,i){if(void 0!==i){var s=this.gc[f],e=this.Rf;"mat4"===t?e.uniformMatrix4fv(s,e.FALSE,i):"vec4"===t?e.uniform4fv(s,i):"vec3"===t?e.uniform3fv(s,i):"vec2"===t?e.uniform2fv(s,i):"float"===t?e.uniform1f(s,i):"int"===t&&e.uniform1i(s,i)}},render:function(f,t){this.Hc.useProgram();var i=this.Rf;this.Zc("mvp_matrix","mat4",f.mvpData),this.Zc("u_color","vec4",new Float32Array(t.color)),this.Zc("u_pos","vec3",t.pos),this.Zc("u_radius","float",t.radius),this.Zc("u_bottom_height","float",t.bottomHeight);var s=GHMap.Q.bufferData(i,t.vs);i.enableVertexAttribArray(this.gc.a_vs),i.bindBuffer(i.ARRAY_BUFFER,s),i.vertexAttribPointer(this.gc.a_vs,3,i.FLOAT,i.FALSE,0,0);var e=GHMap.Q.bufferIndiceData(i,t.indice);i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e),i.drawElements(i.TRIANGLES,t.indice.length,i.UNSIGNED_SHORT,0),i.disableVertexAttribArray(this.gc.a_vs),GHMap.Q.releaseBuffer(i,s),GHMap.Q.releaseBuffer(i,e)},release:function(){this.Hc.release()}},GHMap.VectorLayer=function(f){GHMap.te.call(this,f,"VECTOR_LAYER"),this.cA=256,this.Ih={},this.vA=[],this.wT=15,this.gT=[],this.AT=!1,this.yb=!1,this.mT={},this.Fe="add",this.yb=!1,this.WF=1,this.Bw=new GHMap.SweepEffectLayer(f,"Effect_Layer"),this.I_=new GHMap.__({width:this.$.uf.vi*this.WF,height:this.$.uf.Hi*this.WF,gl:this.$.Rf}),this.ke=new GHMap.GvtPolygonRender(f),this.JF=new GHMap.GvtMaskLayer(f,"MASK"),this.init()},GHMap.VectorLayer.prototype={init:function(){this.lA={};for(var f=2*Math.PI*6378137,t=1;t<=30;t++){var i=1<>=e,t>>=e):e<0&&(f<<=-e,t<<=-e),{x:f,y:t,zoom:s}},TT:function(f,t,i){for(var s=-1,e=0;e=this.wT)return this.TT(),this.gT.push({x:f,y:t,zoom:i}),{code:300};var a=this.getTileUrl(f,t,i);return this.IT({url:a,x:f,y:t,zoom:i,key:e})?{code:400}:{code:300}},getTileUrl:function(f,t,i){return""},xA:function(f,t){for(var i=0;i>b,g=M>>b,A=this.NA(w,g,G);if(200==A.code){c.push(A.tile);break}}c.forEach(function(f){u.indexOf(f)<0&&u.push(f)})}return u},renderPoi:function(f){},NT:function(f){var t=[];return f.forEach(function(f){f.dT().forEach(function(f){t.push(f)})}),t},addSweepEffectObject:function(f){this.Bw.addObject(f)},KF:function(f){var t=this.Bw.needRender();return t&&(this.I_.setOptions({width:this.$.uf.vi*this.WF,height:this.$.uf.Hi*this.WF,gl:this.$.Rf}),this.I_.enable(),this.Bw.render(f),this.I_.disable(),this.$.refresh()),t},qF:function(f){var t=this.JF.needRender();if(t){var i={width:this.$.uf.vi*this.WF,height:this.$.uf.Hi*this.WF,gl:this.$.Rf};this.$F?this.$F.setOptions(i):this.$F=new GHMap.__(i);var s=f.night;f.night=!1,this.$F.enable(),this.JF.render(f,this.ke),this.$F.disable(),f.night=s,this.$.refresh()}return t},addMask:function(f){this.JF.addObject(f)},clearMask:function(){this.JF.clear()},doRender:function(f){},render:function(f){this.needRender()&&this.doRender(f)}},GHMap.GvtLayer=function(f){GHMap.VectorLayer.call(this,f,"GVT_LAYER"),this.ee=1,this.re=30,this.Od=[],this.GC=[],this.Ve=!0},GHMap.GvtLayer.prototype={onCreatTile:function(f,t){return new GHMap.GVectorTile(f,{x:t.x,y:t.y,zoom:t.zoom,map:this.$,style:this.TA})},setStyle:function(f){if(this.TA=f)for(var t in f){var i=f[t].styles,s=1;for(var e in i){var r=i[e];r.id=s++,r.sideColor=new GHMap._(r.sideColor),r.topColor=new GHMap._(r.topColor)}}},needRender:function(){var f=this.$,t=f.q.s,i=this.CT(f.uf.getPxScale()*window.devicePixelRatioMap/t);return i>=this.ee&&i<=this.re},getTileUrl:function(f,t,i){return this.$.zG+i+"/"+f+"_"+t+".gvt"},setMinZoomLevel:function(f){this.ee=f},setMaxZoomLevel:function(f){this.re=f},getMinZoomLevel:function(){return this.ee},getMaxZoomLevel:function(){return this.re},addLight:function(f){this.Od.push(f),f instanceof GHMap.MaxDirectionLight&&this.GC.push(f)},setUseLight:function(f){this.Ve=f},isUseLight:function(){return this.Ve},doRender:function(f){var t=this.$.Rf,i=this.KF(f),s=GHMap.A.copy({},f);void 0===s.bottomHeight&&(s.bottomHeight=0),s.night=this.isNightMode(),t.disable(t.DEPTH_TEST);var e=this.qF(s);t.enable(t.DEPTH_TEST),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA),s.bottomHeight+=GHMap.A.getLayerDisHeight(this.$),s.scanTexture=i?this.I_.getTexture():void 0,s.maskTexture=e?this.$F.getTexture():void 0,s.sweepSizeScale=this.WF;var r=this.ZF(),a=this.NT(r),n=[];this.GC.forEach(function(f){n.push(f.getData())});var o={dirLights:n,useLight:this.Ve};this.kT(s,a,o),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA),t.enable(t.CULL_FACE)},kT:function(t,f,i){var s=2*GHMap.A.getLayerDisHeight(this.$),e=this.ke;f.forEach(function(f){t.bottomHeight+=s,f.render(t,e,i)})}},GHMap.A.copy(GHMap.GvtLayer.prototype,GHMap.VectorLayer.prototype,!1),GHMap.GVectorTile=function(f,t){this.fI=t.x,this.tI=t.y,this.JG=t.zoom,this.$=t.map,this.TA=t.style,this.$e=[],this.init(f)},GHMap.GVectorTile.prototype={init:function(f){for(var t=this.Xd(f),i=t.header,s=t.layers,e=0;e>3&7];if(!(64&n)||!o||e>o;0 0.0 ) { ","\t\tgl_FragColor.rgb = mix( gl_FragColor.rgb , s_color.rgb, s_color.a ); ","\t\tgl_FragColor.a = 1.0; "," \t}\t"," }\t","vec3 ambient = vec3(0.0); ","vec3 diffuse = vec3(0.0); ","vec3 specular = vec3(0.0); ","if( use_light == 1 ) { ","\tfor( int i = 0; i < MAX_LIGHT_COUNT; i ++) { ","\t\tif( i >= directionLightCount) break; ","\t\tDirectionLight light = directionLights[ i ]; "," vec3 light_vec = normalize( -light.dir ); "," ambient += light.ambient; "," diffuse += calc_diffuse( light_vec, v_normal, light.diffuse ); ","\t} ","\tgl_FragColor.rgb = ambient * gl_FragColor.rgb + diffuse * gl_FragColor.rgb; ","} "," gl_FragColor.rgb *= u_exposure;","\tif(useDepthExt == 1) {","\t\t#ifdef USE_DEPTH_EXT","\t\t\tfloat fz = gl_FragCoord.z / gl_FragCoord.w; ","\t\t\tgl_FragDepthEXT = (fz - uNear ) / (uFar - uNear) ; ","\t\t#endif","\t}","}"],this.KC={ambient:"vec3",diffuse:"vec3",specular:"vec3",dir:"vec3",shininess:"float",keep:"int"},this.gc={},this.init(this.Gc,this.wc)},GHMap.GvtPolygonRender.prototype={init:function(f,t){var i=this.Hc;if(i.createProgram(f.join("\n"),GHMap.Q.jf(this.$)+t.join("\n")),i.isValid()){i.useProgram();var s=["mvpMatrix","bottomHeight","eye_pos","uFar","uNear","useDepthExt","uNight","uType","uSampler","u_scan_sampler","u_scan_type","u_size","u_mask_sampler","u_mask_type","u_mask_type_1","u_color","uType2","uSampler2","u_color_factor","u_exposure","directionLightCount","use_light","normal_matrix"];this.f_(s),GHMap.Q.setUniformLoc(this.gc,i,s),GHMap.Q.setAttribLoc(this.gc,i,["a_pos","a_height","a_uv","a_normal"])}},f_:function(i){for(var f=["ambient","diffuse","specular","shininess","dir","keep"],s=0;s