window.BMapGL=window.BMapGL||{};(function(aK,c3){var y=y||{version:"20150702",emptyFn:function(){}};(function(){y._log=[];var i=0;var fp={};y.BaseClass=function(fq){fp[(this.hashCode=(fq||y.BaseClass.guid()))]=this};y.BaseClass.guid=function(){return"mz_"+(i++).toString(36)};y.BaseClass.create=function(){var fq=new y.BaseClass();fq.decontrol();return fq};var e=y.instance=y.I=function(fq){return fp[fq]};y.BaseClass.prototype.dispose=function(){if(this.hashCode){delete fp[this.hashCode]}for(var fq in this){if(typeof this[fq]!="function"){delete this[fq]}}};y.BaseClass.prototype.getHashCode=function(){if(!this.hashCode){fp[(this.hashCode=y.BaseClass.guid())]=this}return this.hashCode};y.BaseClass.prototype.decontrol=function(){delete fp[this.hashCode]};y.BaseClass.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"};y.BaseClass.prototype._wlog=function(fr,fs){var fq=y._log;if(fq.length>100){fq.reverse().length=50;fq.reverse()}fq[fq.length]="["+fr+"]["+(this._className||"Object")+" "+this.hashCode+"] "+fs}})();Function.prototype.inherits=function(fq,fp){var e,fr,ft=this.prototype,fs=function(){};fs.prototype=fq.prototype;fr=this.prototype=new fs();if(typeof(fp)=="string"){fr._className=fp}for(e in ft){fr[e]=ft[e]}this.prototype.constructor=ft.constructor;ft=fs=null;return fr};y.BaseEvent=function(e,i){this.type=e;this.returnValue=true;this.target=i||null;this.currentTarget=this.srcElement=null;this.cancelBubble=false;this.domEvent=null};y.BaseClass.prototype.on=y.BaseClass.prototype.addEventListener=function(fp,i){if(typeof i!=="function"){return this._wlog("error","addEventListener:"+i+" is not a function")}if(!this._listeners){this._listeners={}}var e=this._listeners;if(fp.indexOf("on")!==0){fp="on"+fp}if(typeof e[fp]!=="object"){e[fp]={}}var fq=i.hashCode||y.BaseClass.guid();i.hashCode=fq;if(e[fp][fq]){this._wlog("warning","repeat key:"+fq)}e[fp][fq]=i};y.BaseClass.prototype.off=y.BaseClass.prototype.removeEventListener=function(fp,i){if(typeof i=="function"){i=i.hashCode}else{if(typeof i!="string"){return}}if(!this._listeners){this._listeners={}}if(fp.indexOf("on")!=0){fp="on"+fp}var e=this._listeners;if(!e[fp]){return}if(e[fp][i]){delete e[fp][i]}};y.BaseClass.prototype.fire=y.BaseClass.prototype.dispatchEvent=function(fq){if(!this._listeners){this._listeners={}}var fp,e=this._listeners,fr=fq.type;fq.target=fq.srcElement=fq.target||fq.srcElement||this;fq.currentTarget=this;if(typeof this[fr]=="function"){this[fr](fq)}if(typeof e[fr]=="object"){for(fp in e[fr]){if(typeof e[fr][fp]=="function"){e[fr][fp].call(this,fq)}}}return fq.returnValue};y.BaseEvent.prototype.inherit=function(fp){var i=this;this.domEvent=fp=window.event||fp;i.clientX=fp.clientX||fp.pageX;i.clientY=fp.clientY||fp.pageY;i.offsetX=fp.offsetX||fp.layerX;i.offsetY=fp.offsetY||fp.layerY;i.screenX=fp.screenX;i.screenY=fp.screenY;i.ctrlKey=fp.ctrlKey||fp.metaKey;i.shiftKey=fp.shiftKey;i.altKey=fp.altKey;return i};y.Browser=(function(){var fp=navigator.userAgent;var fr=0;var e=0;var fs=0;var i=0;var fw=0;var fu=0;var fv=0;var ft=0;var fq=0;var fx=0;if(typeof window.opera==="object"&&/Opera(\s|\/)(\d+(\.\d+)?)/.test(fp)){fs=parseFloat(RegExp.$2)}else{if(/OPR(\/(\d+)(\..?)?)/.test(fp)){fs=parseInt(RegExp.$2,10)}else{if(/Edge\/((\d+)\.\d+)/.test(fp)){fr=parseInt(RegExp.$2,10)}else{if(/MSIE (\d+(\.\d+)?)/.test(fp)){e=parseFloat(RegExp.$1)}else{if(fp.indexOf("Trident")>-1&&/rv:(\d+(\.\d+)?)/.test(fp)){e=parseInt(RegExp.$1,10)}else{if(/Firefox(\s|\/)(\d+(\.\d+)?)/.test(fp)){fw=parseFloat(RegExp.$2)}else{if(navigator.vendor==="Netscape"&&/Netscape(\s|\/)(\d+(\.\d+)?)/.test(fp)){fv=parseFloat(RegExp.$2)}else{if(fp.indexOf("Safari")>-1&&/Version\/(\d+(\.\d+)?)/.test(fp)){i=parseFloat(RegExp.$1)}}}}}}}}if(fp.indexOf("Trident")>-1&&/Trident\/(\d+(\.\d+)?)/.test(fp)){ft=parseInt(RegExp.$1,10)}else{if(!e&&!fr&&fp.indexOf("Gecko")>-1&&fp.indexOf("KHTML")===-1&&/rv\:(\d+(\.\d+)?)/.test(fp)){fq=parseFloat(RegExp.$1)}else{if(!fr&&/chrome\/(\d+(\.\d+)?)/i.test(fp)){fu=parseFloat(RegExp.$1)}else{if(!fr&&/AppleWebKit\/(\d+(\.\d+)?)/.test(fp)){fx=parseInt(RegExp.$1,10)}}}}var fy={edge:fr,ie:e,firefox:fw,netscape:fv,opera:fs,safari:i,chrome:fu,gecko:fq,trident:ft,webkit:fx};return fy})();window.FeBrowser=y.Browser;y.Dom={};y.Dom.createDom=function(i,e){if(y.isIE&&e&&e.name){i="<"+i+' name="'+y.String.escapeHTML(e.name)+'">'}var fp=document.createElement(i);if(e){y.Dom.setProperties(fp,e)}return fp};y.Dom.getOffset=function(fq){var ft=y.Dom.getOwnerDocument(fq);var fs=y.isGecko>0&&ft.getBoxObjectFor&&y.Dom.getStyle(fq,"position")=="absolute"&&(fq.style.top===""||fq.style.left==="");var fu={left:0,top:0};var i=(y.isIE&&!y.isStrict)?ft.body:ft.documentElement;if(fq==i){return fu}var fp=null;var fr;if(fq.getBoundingClientRect){fr=fq.getBoundingClientRect();fu.left=fr.left+Math.max(ft.documentElement.scrollLeft,ft.body.scrollLeft);fu.top=fr.top+Math.max(ft.documentElement.scrollTop,ft.body.scrollTop);fu.left-=ft.documentElement.clientLeft;fu.top-=ft.documentElement.clientTop;if(y.isIE&&!y.isStrict){fu.left-=2;fu.top-=2}}else{if(ft.getBoxObjectFor&&!fs){fr=ft.getBoxObjectFor(fq);var e=ft.getBoxObjectFor(i);fu.left=fr.screenX-e.screenX;fu.top=fr.screenY-e.screenY}else{fp=fq;do{fu.left+=fp.offsetLeft;fu.top+=fp.offsetTop;if(y.isWebkit>0&&y.Dom.getStyle(fp,"position")=="fixed"){fu.left+=ft.body.scrollLeft;fu.top+=ft.body.scrollTop;break}fp=fp.offsetParent}while(fp&&fp!=fq);if(y.isOpera>0||(y.isWebkit>0&&y.Dom.getStyle(fq,"position")=="absolute")){fu.top-=ft.body.offsetTop}fp=fq.offsetParent;while(fp&&fp!=ft.body){fu.left-=fp.scrollLeft;if(!y.isOpera||fp.tagName!="TR"){fu.top-=fp.scrollTop}fp=fp.offsetParent}}}return fu};y.Dom.getOwnerDocument=function(e){return e.nodeType==9?e:e.ownerDocument||e.document};y.Dom.setProperties=function(i,e){y.each(e,function(fq,fp){y.Dom._setProperty(i,fp,fq)})};y.Dom._setProperty=function(i,e,fp){if(e=="style"){i.style.cssText=fp}else{if(e=="class"){i.className=fp}else{if(e=="for"){i.htmlFor=fp}else{if(e in y.Dom._DIRECT_ATTRIBUTE_MAP){i.setAttribute(y.Dom._DIRECT_ATTRIBUTE_MAP[e],fp)}else{i[e]=fp}}}}};y.Dom._DIRECT_ATTRIBUTE_MAP={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",height:"height",width:"width",usemap:"useMap",frameborder:"frameBorder"};y.G=function(){for(var fp=[],fq=arguments.length-1;fq>-1;fq--){var fr=arguments[fq];fp[fq]=null;if(typeof fr=="object"&&fr&&fr.dom){fp[fq]=fr.dom}else{if((typeof fr=="object"&&fr&&fr.tagName)||fr==window||fr==document){fp[fq]=fr}else{if(typeof fr=="string"&&(fr=document.getElementById(fr))){fp[fq]=fr}}}}return fp.length<2?fp[0]:fp};y.ac=function(e,i){if(!(e=this.G(e))){return}i=this.trim(i);if(!new RegExp("(^| )"+i.replace(/(\W)/g,"\\$1")+"( |$)").test(e.className)){e.className=e.className.split(/\s+/).concat(i).join(" ")}};y.addClassName=y.ac;y.each=function(fs,e){if(typeof e!="function"){return fs}if(fs){if(fs.length===undefined){for(var fp in fs){e.call(fs[fp],fs[fp],fp)}}else{for(var fq=0,fr=fs.length;fq0&&!window.opera){/MSIE (\d+(\.\d+)?)/.test(navigator.userAgent);y.isIE=parseFloat(RegExp.$1)}})();y.rc=function(e,i){if(!(e=this.G(e))){return}i=this.trim(i);var fp=e.className.replace(new RegExp("(^| +)"+i.replace(/(\W)/g,"\\$1")+"( +|$)","g"),"$2");if(e.className!=fp){e.className=fp}};y.removeClassName=y.rc;y.show=function(){this.each(arguments,function(e){if(e=y.G(e)){e.style.display=""}})};y.trim=function(e){return e.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+$)/g,"")};if(typeof HTMLElement!="undefined"&&HTMLElement.prototype.__lookupGetter__&&!HTMLElement.prototype.__lookupGetter__("children")&&!window.opera){try{HTMLElement.prototype.__defineGetter__("children",function(){for(var fp=[],fq=0,fs,fr=0,e=this.childNodes.length;fr-1};y.isEmptyObject=function(fp){if(Object.prototype.toString.call(fp)==="[object Object]"){for(var e in fp){return false}return true}else{return false}};var ad=false;var g=false;var L=window.BMAPGL_URL?window.BMAPGL_URL:"http://999.999.999.999";var dk={isOffline:false,isGLApi:true,mapStyleNameIdPair:{"default":0,"grayed-out":1},mapHost:"https://map.baidu.com",apiHost:"https://api.map.baidu.com",staticHost:"//webmap0.bdimg.com",imgPath:"//webmap0.bdimg.com/image/api/",tileDomain:["https://maponline0.bdimg.com","https://maponline1.bdimg.com","https://maponline2.bdimg.com","https://maponline3.bdimg.com"],rasterTilePath:"/tile/",vectorTilePath:"/pvd/",originTilePath:["https://pcor.baidu.com"],getIconSetPath:function(e){var i="map_icons2x/";if(typeof e==="string"&&this.mapStyleNameIdPair[e]>0){i="map_icons2x_"+(this.mapStyleNameIdPair[e]-1)+"/"}return"https://maponline0.bdimg.com/sty/"+i},getImageFullUrl:function(e,i){return this.getIconSetPath(e)+i+"?udt="+dN().udt},getMapStyleFiles:function(fp){var fr=true;if(typeof fp==="string"&&fp!=="default"){fr=false}var fs=fr?"":"_"+(this.mapStyleNameIdPair[fp]-1);var i=dN();var fq="udt="+i.udt+"&v="+i.ver;var e="https://maponline0.bdimg.com/sty/";return[e+"icons_2x"+fs+".js?"+fq,e+"fs"+fs+".js?"+fq,e+"indoor_fs.js?"+fq]}};var ds=dk;aK.MapConfig=ds;aK=aK||{};var e2=aK;aK.version="3.0";aK._register=[];aK.register=function(e){this._register[this._register.length]=e};aK.guid=1;aK.getGUID=function(e){return(e||"")+aK.guid++};dk.imgResources={blankGIF:dk.staticHost+"/res/litemapapi/v1d1/images/blank.gif?20170501",markerPng:dk.staticHost+"/res/litemapapi/v1d1/images/marker.png?20170501",locPng:dk.staticHost+"/res/litemapapi/v1d1/images/loc.png?20180918",locNewPng:dk.staticHost+"/res/litemapapi/v1d1/images/loc_new.png?20190314",zoomPng:dk.staticHost+"/res/litemapapi/v1d1/images/zoombtn.png?20180918",mapLogoPng:dk.staticHost+"/res/litemapapi/v1d1/images/logo-2x.png?20190226",mapLogoNewPng:dk.staticHost+"/res/litemapapi/v1d1/images/logo-new-2x.png?20190226"};var ax="ruler.cur";if(y.Browser.ie||y.Browser.edge){y.extend(dk,{distCursor:"url("+dk.imgPath+ax+"),crosshair",defaultCursor:"url("+dk.imgPath+"openhand.cur),default",draggingCursor:"url("+dk.imgPath+"closedhand.cur),move"})}else{if(y.Browser.firefox){y.extend(dk,{distCursor:"url("+dk.imgPath+ax+"),crosshair",defaultCursor:"-moz-grab",draggingCursor:"-moz-grabbing"})}else{if(y.Browser.chrome||y.Browser.safari){y.extend(dk,{distCursor:"url("+dk.imgPath+ax+") 2 6,crosshair",defaultCursor:"url("+dk.imgPath+"openhand.cur) 8 8,default",draggingCursor:"url("+dk.imgPath+"closedhand.cur) 8 8,move"});if(y.Platform.macintosh){dk.defaultCursor="-webkit-grab";dk.draggingCursor="-webkit-grabbing"}}else{y.extend(dk,{distCursor:"url("+dk.imgPath+ax+"),crosshair",defaultCursor:"url("+dk.imgPath+"openhand.cur),default",draggingCursor:"url("+dk.imgPath+"closedhand.cur),move"})}}}dk.tvc={ditu:{normal:{version:"088",updateDate:"20200509"},satellite:{version:"009",updateDate:"20200509"},normalTraffic:{version:"081",updateDate:"20200509"},satelliteTraffic:{version:"083",updateDate:"20200509"},mapJS:{version:"104",updateDate:"20200509"},satelliteStreet:{version:"083",updateDate:"20200509"},panoClick:{version:"1033",updateDate:"20180108"},panoUdt:{version:"20180108",updateDate:"20180108"},panoSwfAPI:{version:"20150123",updateDate:"20150123"},panoSwfPlace:{version:"20141112",updateDate:"20141112"},earthVector:{version:"001",updateDate:"20200509"}}};dk.msv={mapstyle:{updateDate:"20200428",version:"001"}};function dV(i,e){this._size=i;this._cache=[];this._totalGetTimes=0;this._totalHitTimes=0;this._options={clearCallback:null,removeOldCallback:null};e=e||{};for(var fp in e){if(e.hasOwnProperty(fp)){this._options[fp]=e[fp]}}}dV.prototype.setData=function(fp,fq){var e=this._cache;var i=this._size;if(i===0){return}if(e.length>i){this._removeOld()}if(!e[fp]){e.push(fq)}e[fp]=fq;fq._key_=fp};dV.prototype.getHitRate=function(){return Math.round(this._totalHitTimes/this._totalGetTimes*1000)/1000};dV.prototype.getData=function(i){var e=this._cache[i];if(e){this._totalHitTimes++}this._totalGetTimes++;return e};dV.prototype.removeData=function(fr){if(this._options.clearCallback){this._options.clearCallback(this._cache[fr])}var fp=this._cache;var fs=fp[fr];for(var fq=0,e=fp.length;fq=0;fr--){var fq=this._cache[fr]._key_;if(!fs[fq]){fp.splice(fr,1);if(this._options.clearCallback){this._options.clearCallback(fp[fq])}delete fp[fq]}}};dV.prototype.getDataCount=function(){return this._cache.length};function X(){}y.extend(X.prototype,{centerAndZoom:function(fv,fp,fw){var ft=this;if(!fv&&!fp){return}fv=fv||this.centerPoint;fp=fp||this.zoomLevel;fp=this._getProperZoom(fp).zoom;if(this.mapType===ez){if(!this._earth){this.mapType=C;this.temp.originMapType=ez;function fu(){ft._earth=new aK.Earth(ft,{showRealSunlight:ft.config.showRealSunlight,showMilkyway:ft.config.showMilkyway,earthBackground:ft.config.earthBackground});ft._proxyEarthEvents();ft._changeEarthMapType(ez);y.extend(ft,aK.EarthView.prototype);if(!ft._navigationCtrl&&ft.config.showControls){ft._navigationCtrl=new aK.NavigationControl3D(ft)}delete ft.temp.originMapType}cL.load("earth",function(){if(aK["FeatureStyle"+ft.config.style]){fu()}else{ft.loadMapStyleFiles(function(){fu()})}})}}this.lastLevel=this.zoomLevel||fp;this.zoomLevel=fp;var fr=new aD("onload");fr.point=fv;fr.zoom=fp;this.centerPoint=this.restrictCenter(new e7(fv.lng,fv.lat));if(this.centerPoint.zoom){this.zoomLevel=this.centerPoint.zoom}this.defaultZoomLevel=this.defaultZoomLevel||this.zoomLevel;this.defaultCenter=this.defaultCenter||this.centerPoint;if(!this.loaded&&!(this.temp.originMapType===ez)){var i=this.config.defaultMaxBounds;var fs=new bW(i,"baidu",this.mapType);var fq=new bJ({mapType:this.mapType,copyright:fs,customLayer:false,baseLayer:true,tileTypeName:"web"});fq._isInnerLayer=true;this.addTileLayer(fq);if(this.mapType===bU&&this._isHybridShow===true){this._addHybirdMap()}}this.dispatchEvent(fr);this.loaded=true;fw=fw||{};fw.callback&&fw.callback()},_setPlatformPosition:function(fw,fv,fz){fz=fz||{};if(fw===0&&fv===0&&!fz.point){return}if(isNaN(fz.initMapOffsetX)){fz.initMapOffsetX=this.offsetX}if(isNaN(fz.initMapOffsetY)){fz.initMapOffsetY=this.offsetY}var fx=fw+fz.initMapOffsetX;var fu=fv+fz.initMapOffsetY;if(fz.point){var i=this.restrictCenter(fz.point);if(!i.equals(this.centerPoint)){this.centerPoint=i.clone();this.fire(new aD("oncenter_changed"))}}else{var fq=this.offsetX-fx;var e=this.offsetY-fu;var fp=this.getZoomUnits();var ft=this.centerPoint.lng;var fs=this.centerPoint.lat;var fr=new e7(ft,fs);this.centerPoint=this.restrictCenter(new e7(fr.lng+fq*fp,fr.lat-e*fp),fp);this.fire(new aD("oncenter_changed"));if(this.zoomLevel<10){fx=this.offsetX-(this.centerPoint.lng-fr.lng)/fp;fu=this.offsetY+(this.centerPoint.lat-fr.lat)/fp}}this.offsetX=fx;this.offsetY=fu;var fy=this.platform.style;fy.left=fx+"px";fy.top=fu+"px";this.maskLayer.style.left=-fx+"px";this.maskLayer.style.top=-fu+"px";if(fz.dispatchEvent!==false){this.dispatchEvent(new aD("onmoving"))}},zoomTo:function(e,ft,fx){fx=fx||{};fx.zoomCenter=ft;if(fx.noAnimation!==true){this.deepZoomTo(e,fx);return}if(typeof e!=="number"){return}var fr=bg[this.mapType];if(!fr){return}var fp=e;e=this._getProperZoom(e).zoom;if(e===this.zoomLevel){var fu=new aD("onzoomexceeded");fu.targetZoom=fp;this.dispatchEvent(fu);fx.callback&&fx.callback();return}this.lastLevel=this.zoomLevel;if(this.config.fixCenterWhenPinch){ft=this.centerPoint.clone()}if(ft){this.temp._cPoint=ft;this.temp._cPixel=this.pointToPixel(ft)}else{if(this.getInfoWindow()){var fw=this.getInfoWindow().getPoint();this.temp._cPixel=this.pointToPixel(fw);this.temp._cPoint=fw}}if(this.config.zoomCenter){ft=this.config.zoomCenter;this.temp._cPoint=ft;this.temp._cPixel=this.pointToPixel(ft)}if(ft||this.temp.infoWin&&this.temp.infoWin.isOpen()){var i=this.temp._cPoint;var fv=this.temp._cPixel;var fq=this.getZoomUnits(e);var fs=new e7(i.lng+fq*(this.width/2-fv.x),i.lat-fq*(this.height/2-fv.y));this.centerPoint=this.restrictCenter(fs,fq,e);if(this.centerPoint.zoom){e=this.centerPoint.zoom}}if(fx.fireEvent!==false){this.dispatchEvent(new aD("onzoomstart"))}if(e!==this.zoomLevel){this.zoomLevel=e;this.dispatchEvent(new aD("onzooming"));this.dispatchEvent(new aD("onzoomstartcode"))}if(fx.fireEvent!==false){this.dispatchEvent(new aD("onzoomend"))}if(fx.callback){fx.callback()}},deepZoomMedia:function(e){var i=this;if(!i.temp.isStdCtrlBusy){i.temp.isStdCtrlBusy=true;i.deepZoomTo(i.zoomLevel+e);setTimeout(function(){i.temp.isStdCtrlBusy=false},400)}},deepZoomTo:function(fu,fq){fq=fq||{};var fs=fu-this.zoomLevel;var fr=this._getProperZoom(fu);if(fr.exceeded){var e=new aD("onzoomexceeded");e.targetZoom=fu;this.dispatchEvent(e);return}var i;if(fq.zoomCenter){i=this.pointToPixel(fq.zoomCenter)}else{if(this.getInfoWindow()){i=this.pointToPixel(this.getInfoWindow().getPoint(),{zoom:this.lastLevel})}else{var i=new cS(this.width/2,this.height/2)}}this.lastLevel=this.zoomLevel;var ft=this.deepZoom||new aX(this);var fp=fs>0?1:-1;ft.zoomMap(i,fs,fp,null,fq)},flyTo:function(fv,e){if(e===this.zoomLevel){this.panTo(fv);return}var fs=this._getProperZoom(e);if(fs.exceeded){var fw=new aD("onzoomexceeded");fw.targetZoom=e;this.dispatchEvent(fw);return}var fu=e-this.zoomLevel;var fp=new cS(this.width/2,this.height/2);var i=this.pointToPixel(fv);var ft=new cK(i.x-fp.x,i.y-fp.y);this.lastLevel=this.zoomLevel;if(Math.abs(fu)>=4||Math.abs(ft.width)>this.width||Math.abs(ft.height)>this.height){this.centerAndZoom(fv,e);return}var fr=this.deepZoom||new aX(this);var fq=fu>0?1:-1;fr.zoomMap(i,fu,fq,ft)},panTo:function(i,fp){fp=fp||{};if(!i||i.equals(this.centerPoint)){fp.callback&&fp.callback();return}var fq=this.pointToPixel(i);var e=Math.round(this.width/2);var fr=Math.round(this.height/2);if(Math.abs(e-fq.x)>this.width||Math.abs(fr-fq.y)>this.height||fp.noAnimation===true){this._panTo(e-fq.x,fr-fq.y,i);fp.callback&&fp.callback()}else{this._panBy(e-fq.x,fr-fq.y,fp)}},_panTo:function(i,e,fq){var fp=this.temp;if(fp.operating===true){return}if(fp.dragAni){fp.dragAni.stop();fp.dragAni=null;this.dispatchEvent(new aD("onmoveend"))}this.dispatchEvent(new aD("onmovestart"));this._setPlatformPosition(i,e,{point:fq});this.dispatchEvent(new aD("onmoveend"))},panBy:function(i,e,fp){fp=fp||{};i=Math.round(i)||0;e=Math.round(e)||0;if(Math.abs(i)<=this.width&&Math.abs(e)<=this.height&&fp.noAnimation!==true){this._panBy(i,e,fp)}else{this._panTo(i,e);fp.callback&&fp.callback()}},_panBy:function(i,e,fr){if(this.temp.operating===true){return}fr=fr||{};this.dispatchEvent(new aD("onmovestart"));var fq=this;var fp=fq.temp;fp.pl=fq.offsetX;fp.pt=fq.offsetY;if(fp.tlPan){fp.tlPan.cancel()}if(fp.dragAni){fp.dragAni.stop();fp.dragAni=null;this.dispatchEvent(new aD("onmoveend"))}fp.tlPan=new m({fps:fr.fps||fq.config.fps,duration:fr.duration||fq.config.actionDuration,transition:fr.transition||bs.easeInOutQuad,render:function(fs){this.terminative=fq.temp.operating;if(fq.temp.operating){return}fq._setPlatformPosition(Math.ceil(i*fs),Math.ceil(e*fs),{initMapOffsetX:fp.pl,initMapOffsetY:fp.pt})},finish:function(fs){fq.dispatchEvent(new aD("onmoveend"));fq.temp.tlPan=false;if(fq.temp.stopArrow===true){fq.temp.stopArrow=false;if(fq.temp.arrow!==0){fq._arrow()}}fr.callback&&fr.callback()}})},getCenter:function(){return this.centerPoint},getZoom:function(){return this.zoomLevel},setTilt:function(){},getTilt:function(){return this._tilt},setHeading:function(){},getHeading:function(){return this._heading},restrictCenter:function(fu,fr,fv){this.isRestrict=false;fr=fr||this.getZoomUnits();fv=fv||this.zoomLevel;var fp=this.pixelToPoint(new cS(0,0),{center:fu,zoom:fv});var fs=this.pixelToPoint(new cS(0,this.height),{center:fu,zoom:fv});if(this.zoomLevel<5){if(fp.lat>bY.MAX_LAT&&fs.latbY.MAX_LAT){this.isRestrict=true;fu.lat=bY.MAX_LAT-this.height/2*fr}else{if(fs.lat=1.5?2:1,enableEarth:aC.ifEnableEarth(),defaultMaxBounds:new cy(new e7(-21364736,-10616832),new e7(23855104,15859712)),showControls:false,showRealSunlight:true,showMilkyway:true,earthBackground:null,showStreetLayer:true,minZoom:null,maxZoom:null,style:"default",enableIconClick:false,autoSafeArea:false,ak:null,webgl2:false,restrictCenter:dk.isGLApi?false:true,smaa:true,loadVectorTileData:true,enableCapture:false};for(var fp in i){if(i.hasOwnProperty(fp)){this.config[fp]=i[fp];if(fp==="fixCenterWhenResize"){this.config.enableResizeOnCenter=i[fp]}}}this._displayMapper={showText:"poi",showIndoor:"indoor",showBuilding3d:"building",showOverlay:"overlay"};this._setTextRenderType();this._displayOptions={poi:true,poiText:true,poiIcon:true,overlay:true,layer:true,building:true,indoor:true,street:true,skyColors:["rgba(226, 237, 248, 0)","rgba(186, 211, 252, 1)"],isFlat:false};if(i.displayOptions){for(var e in i.displayOptions){if(i.displayOptions.hasOwnProperty(e)){if(this._displayMapper[e]){this._displayOptions[this._displayMapper[e]]=i.displayOptions[e]}else{this._displayOptions[e]=i.displayOptions[e]}}}}if(this.config.restrictCenter===false){this._enableTiltZoom=0;this._enableHeadingZoom=0}},getMinZoom:function(){var fp;if(bg[this.mapType][this._renderType]){fp=bg[this.mapType][this._renderType].minZoom}else{fp=bg[this.mapType].minZoom}if(this.config.minZoom!==null&&this.config.minZoom>=fp){fp=this.config.minZoom}if(this.mapType==="B_EARTH_MAP"){return fp}var i=this.getSize();var e=this.worldSize(fp);while(ee){fq=true;fp=e}if(this._renderType!=="webgl"){fp=Math.round(fp)}return{zoom:fp,exceeded:fq}},getContainer:function(){return this.container},getZoomUnits:function(fp){if(this.mapType===ez){return Math.pow(2,18-this._earth.getImageZoom())}var e=bg[this.mapType];if(typeof e!=="object"){return null}var i=fp||this.zoomLevel;if(dk.isWgs84){return b7.prototype.getZoomUnits(i)}return Math.pow(2,(e.zoomLevelBase-i))},pointToPixel:function(fz,fB){if(!fz){return}fB=fB||{};if(this.mapType===ez){var fq;if(!fz._llPt){fq=cU.convertMC2LL(fz);fz._llPt=fq}fq=fz._llPt;var fv=null;var fp=null;if(typeof fB.zoom==="number"){var fy=this._earth;var fA=fy._getEarthZoomByImgZoom(fB.zoom);if(fA<=3){fv=fy._generateTmpPMatrix(fA)}fp=fy._generateTmpMVMatrix(fy.getCenter(),fA)}var fr=this._earth.fromLatLngToPixel(fq,{useRound:false,isCalcOnBack:true,matrixInfo:{modelViewMatrix:fp,projectionMatrix:fv}});return fr}if((this._heading%360===0&&this._tilt===0)||!this._webglMapCamera){var fx=this.getZoomUnits(fB.zoom);var ft=fB.center||this.centerPoint;var i=this.width/2;var fs=this.height/2;var fw=(fz.lng-ft.lng)/fx+i;var fu=(ft.lat-fz.lat)/fx+fs;if(fB.useRound!==false){fw=Math.round(fw);fu=Math.round(fu)}return new cS(fw,fu)}var e=this._webglMapCamera.fromMCToScreenPixel(fz.lng,fz.lat,fB);if(fB.useRound===false){return e}e.x=Math.round(e.x);e.y=Math.round(e.y);return e},pixelToPoint:function(e,fx){if(!e){return}fx=fx||{};if(this.mapType===ez){if(typeof fx.zoom==="number"){var fv=this._earth;var fs=null;var fp=null;var fw=fv._getEarthZoomByImgZoom(fx.zoom);if(fw<=3){fs=fv._generateTmpPMatrix(fw)}fp=fv._generateTmpMVMatrix(fv.getCenter(),fw)}var i=this._earth.fromPixelToLatLng(e,{matrixInfo:{modelViewMatrix:fp,projectionMatrix:fs}});if(i===null){return null}return cU.convertLL2MC(i)}if((this._heading%360!==0||this._tilt>0)&&this._webglMapCamera){return this._webglMapCamera.fromScreenPixelToMC(e.x,e.y,fx)}var ft=fx.center||this.centerPoint;var fu=this.getZoomUnits(fx.zoom);var fr=ft.lng+fu*(e.x-this.width/2);var fq=ft.lat-fu*(e.y-this.height/2);return new e7(fr,fq)},pointToOverlayPixel:function(e,fq){fq=fq||{};var fp=this.pointToPixel(e,{zoom:fq.zoom,center:fq.center,forLabel:true,frustumTest:true,useRound:fq.useRound});if(!fp){return}if(fq.fixPosition&&this.mapType!=="B_EARTH_MAP"){var fr=this.getSize();var i=this.worldSize(fq.zoom);if(fp.x>fr.width){while(fp.x>fr.width){fp.x-=i}}else{if(fp.x<0){while(fp.x<0){fp.x+=i}}}}if(this._renderType==="webgl"){return fp}fp.x-=this.offsetX;fp.y-=this.offsetY;return fp},overlayPixelToPoint:function(i,e){if(!i){return}var fp=i.clone();if(this._renderType!=="webgl"){fp.x+=this.offsetX;fp.y+=this.offsetY}return this.pixelToPoint(fp,e)},lnglatToMercator:function(e,fq){var i=new e7(e,fq);var fp=cU.convertLL2MC(i);return[fp.lng,fp.lat]},mercatorToLnglat:function(i,e){if(isNaN(i)||isNaN(e)){return[]}i=parseFloat(i);e=parseFloat(e);var fq=new e7(i,e);var fp=cU.convertMC2LL(fq);return[fp.lng,fp.lat]},getBounds:function(){var fD=arguments[0];if(this.mapType===ez&&this._earth){var fx=this._earth.getCustomBounds();if(!fx){return this.config.defaultMaxBounds}var fw=fx.getSouthWest();var e=fx.getNorthEast();if(fw.lng>e.lng){e.lng=180}var fU=cU.convertLL2MC(fw);var fK=cU.convertLL2MC(e);var fA=this.config.defaultMaxBounds;var fJ=Math.max(fU.lng,fA.sw.lng);var fI=Math.max(fU.lat,fA.sw.lat);var fC=Math.min(fK.lng,fA.ne.lng);var fB=Math.min(fK.lat,fA.ne.lat);var fF=new cy(new e7(fJ,fI),new e7(fC,fB));fF.pointBottomLeft=new e7(fJ,fI);fF.pointBottomRight=new e7(fC,fI);fF.pointTopLeft=new e7(fJ,fB);fF.pointTopRight=new e7(fC,fB);fF.setMinMax();fF.makeNormalizedPoint(this._earth.getHeading());return fF}fD=fD||{};var fr=fD.margins||[0,0,0,0];var fP=this.pixelToPoint({x:fr[3],y:this.height-fr[2]},fD);var fT=this.pixelToPoint({x:this.width-fr[1],y:fr[0]},fD);var fH=typeof fD.heading==="number"?fD.heading:(this._heading%360);var fp=typeof fD.tilt==="number"?fD.tilt:this._tilt;var fz=this._webglMapCamera;if((fH===0&&fp===0)||!fz){this._bounds.setSouthWest(fP);this._bounds.setNorthEast(fT);this._bounds.pointBottomLeft=fP;this._bounds.pointBottomRight=new e7(fT.lng,fP.lat);this._bounds.pointTopRight=fT;this._bounds.pointTopLeft=new e7(fP.lng,fT.lat);this._bounds.setMinMax();this._bounds.makeNormalizedPoint(fH);return this._bounds}var fG=this.pixelToPoint({x:fr[3],y:fr[0]},fD);var fq=fz.getPosition();var fV=Math.sqrt(Math.pow(fG.lng-fq[0],2)+Math.pow(fG.lat-fq[1],2));var fQ=this.getZoomUnits();var fX=fV/fQ;var fN=fz._frustumSideLen;var fv=fz._fovy;if(fX>fN||(90-fp)ft){ft=fM[fR].lng}if(fM[fR].latfy){fy=fM[fR].lat}}this._bounds.setSouthWest(new e7(fS,fY));this._bounds.setNorthEast(new e7(ft,fy));this._bounds.pointTopLeft=fG;this._bounds.pointTopRight=fT;this._bounds.pointBottomRight=fE;this._bounds.pointBottomLeft=fP;this._bounds.makeNormalizedPoint(fH);this._bounds.setMinMax();return this._bounds},isLoaded:function(){return !!this.loaded},_getBestLevel:function(i,fz){var fs=0;if(this._renderType==="webgl"&&!ea()){fs=100}var ft=fz.margins||[10,10,10,10];var fq=fz.zoomFactor||0;var fu=ft[1]+ft[3];var fr=ft[0]+ft[2];var e=this.getMinZoom();var fy=this.getMaxZoom();var fx=i.toSpan();var fw=fx.width/(this.width-fu-fs);var fv=fx.height/(this.height-fr-fs);var fp=18-c5(Math.max(fw,fv));if(fpfy){fp=fy}fp+=fq;if(this._renderType!=="webgl"){fp=Math.floor(fp)}return fp},getViewport:function(fD,fr){if(this.mapType===ez){fD=fD||[];var fs=[];for(var fE=0;fE=0;fE--){fu.extend(fD[fE])}if(fu.isEmpty()){return fA}}var fJ=fu.getCenter();if(fr.center){fJ=fr.center.clone();var fz=fu.getSouthWest();var ft=fu.getNorthEast();var fw=fJ.lng-fz.lng;var fx=ft.lng-fJ.lng;var fy=ft.lat-fJ.lat;var fv=fJ.lat-fz.lat;var fG=new e7(0,0);fG.lng=fw>fx?fJ.lng+fw:fJ.lng-fx;fG.lat=fv>fy?fJ.lat+fv:fJ.lat-fy;fu.extend(fG)}var e=this._getBestLevel(fu,fr);if(fr.margins){var fp=fr.margins;var fI=(fp[1]-fp[3])/2;var fB=(fp[0]-fp[2])/2;var fH=this.getZoomUnits(e);fJ.lng=fJ.lng+fH*fI;fJ.lat=fJ.lat+fH*fB}return{center:fJ,zoom:e}},setViewport:function(fq,fr){if(this.mapType===ez){var fv;if(fq&&fq.center){var fp=cU.convertMC2LL(fq.center);var ft=this._earth._getEarthZoomByImgZoom(fq.zoom,fp);fv={center:fp,zoom:ft}}else{fv=[];for(var fs=0;fsbY.MAX_DRAG_TILT_L2){i.setTilt(bY.MAX_DRAG_TILT_L2,{callback:function(){i._changeEarthMapType(e)}})}else{i._changeEarthMapType(e)}},_changeEarthMapType:function(fp){var fq=this;var ft=fq.tileMgr.tileLayers;if(this._mapTypeChangAni){this._mapTypeChangAni.stop()}var fs;if(this._earth){fs=this._earth.getEarthCanvas()}if(!this._earth){this.maskLayer.style.opacity=1;this.maskLayer.style.zIndex=999;this.maskLayer.style.background="#000"}this._mapTypeChangAni=new m({duration:400,render:function(e){if(!fq._earth){return}fs.style.opacity=e},finish:function(){for(var e=ft.length-1,fu=e;fu>=0;fu--){var fw=ft[fu].tilesDiv;if(fw){fw.style.visibility="hidden"}if(ft[fu]._isInnerLayer&&fq._renderType!=="webgl"){fq.removeTileLayer(ft[fu])}}fq._mapTypeChangAni=null;fq._mapTypeChanging=false;function fv(){var fA=fq.getZoom()-2;var fB=fq.getCenter();var fy=cU.convertMC2LL(fB);fq._earth=new aK.Earth(fq,{center:fy,zoom:fA,showRealSunlight:fq.config.showRealSunlight,showMilkyway:fq.config.showMilkyway,earthBackground:fq.config.earthBackground});fq._proxyEarthEvents();var fx=fq.mapType;fq.mapType=fp;var fz=new aD("onmaptypechange");fz.zoomLevel=this.zoomLevel;fz.mapType=fp;fz.exMapType=fx;fq.dispatchEvent(fz);fq._setMapTypeStatus(fp);y.extend(fq,aK.EarthView.prototype);if(!fq._navigationCtrl&&fq.config.showControls){fq._navigationCtrl=new dj(fq)}}if(!fq._earth){if(aK["FeatureStyle"+fq.config.style]){fv()}else{fq.loadMapStyleFiles(function(){fv()})}}if(parseInt(fq.maskLayer.style.opacity,10)===1){setTimeout(function(){fq.maskLayer.style.zIndex=9;fq.maskLayer.style.opacity=0},1000)}}});if(!this._earth){return}var i=this.mapType;this.mapType=fp;var fr=new aD("onmaptypechange");fr.zoomLevel=this.zoomLevel;fr.mapType=fp;fr.exMapType=i;this.dispatchEvent(fr);fq._setMapTypeStatus(fp);y.extend(fq,aK.EarthView.prototype)},getMapStyleId:function(){if(typeof this.config.style==="string"){return this.config.style}return this.config.mapStyleId||"custom"},_setMapTypeStatus:function(fp){var fu=arguments[1];if(fp===ez){var fs=this._earth.getEarthCanvas();if(fs){fs.style.display=""}var fv={noAnimation:true};this._earth.setCenter(cU.convertMC2LL(this.centerPoint),fv);this._earth.setImageZoom(this.zoomLevel,fv);this._earth.setTilt(this.getTilt(),fv);this._earth.setHeading(this.getHeading(),fv)}else{if(this.preMapType===ez&&this._earth){var ft=this._earth;var fq=ft.getMapZoom();var fr=ft._imageRawZoom||fq;var i=fr-fq;var e=ft.getCenter();if(this._renderType==="webgl"){this._tilt=ft.getTilt();if(this.zoomLevel>7){this._heading=ft.getHeading();fu&&fu(e,fq);return}if(ft.getHeading()!==0){ft.setTilt(this.getTilt());ft.setHeading(this.getHeading(),{callback:function(){fu&&fu(e,fq)}})}else{fu&&fu(e,fq)}return}if(i<0.1&&ft.getTilt()===0&&ft.getHeading()===0){fu&&fu(e,fq);return}ft.setTilt(0);ft.setHeading(0);ft.setZoom(ft.getZoom()-i,{callback:function(){fu&&fu(e,fq)}})}}},_proxyEarthEvents:function(){var fs=this;var ft=this._earth;var e=false;ft.on("tilesload",function(i){fs.fire(i)});ft.on("centerandzoom",function(i){fs.dispatchEvent(new aD("onmoveend"));fs.dispatchEvent(new aD("onzoomend"))});function fr(i){fs.fire(i)}var fp=["zoomstart","zoomend","tilesload","sunlighttime_change","sunlighttime_clear","centerandzoom","animation_start","animation_stop","movestart","moveend","moving","dragstart","dragend","dragging"];for(var fq=0;fq=19){return bY.MAX_DRAG_TILT}else{if(e<=18){if(e=this._enableTiltZoom-2){return(1-(this._enableTiltZoom-e)/2)*bY.MAX_DRAG_TILT_L2}return 0}return bY.MAX_DRAG_TILT_L2}else{return(bY.MAX_DRAG_TILT-bY.MAX_DRAG_TILT_L2)*(e-18)+bY.MAX_DRAG_TILT_L2}}},worldSize:function(i){var e=i||this.zoomLevel;return bY.WORLD_SIZE_MC/this.getZoomUnits(e)},setTrafficOn:function(){this.addTileLayer(bm)},setTrafficOff:function(){this.removeTileLayer(bm)},showOverlayContainer:function(){this.setDisplayOptions({overlay:true})},hideOverlayContainer:function(){this.setDisplayOptions({overlay:false})},addLabelsToMapTile:function(fp){for(var e=0;e"-1"){e1.load(fy)}else{aK.customStyleInfo.xhr=ew.post(e,ft,window[fx])}})}else{e1.load(fy)}}},_setTextRenderType:function(){if(this.config.textRenderType!==null){return}if(ea()){this.config.textRenderType="canvas"}else{if(typeof this.config.style==="string"){this.config.textRenderType="image"}else{this.config.textRenderType="canvas"}}if(dk.isOffline||dk.isWgs84){this.config.textRenderType="canvas"}},setCustomStyle:function(e){this._customStyle=e;this.fire(new aD("onstyle_willchange"));var i=this;this.loadMapStyleFiles(function(){i.fire(new aD("onstyle_changed"))})},capture:function(e){if(!this._webglMapScene||!this._webglMapScene._painter){return}e=e||{};var i=this._webglMapScene._painter._canvas;var fq=e.quality||0.8;var fp=i.toDataURL("image/jpeg",fq);if(e.callback){e.callback(fp)}},destroy:function(){this._destroyed=true;this.fire(new aD("ondestroy"))},setMapStyleV2:function(e){this._setTextRenderType("canvas");this.setOptions({style:e})},startViewAnimation:function(fp){var e=fp._options.delay;var i=this;setTimeout(function(){fp._start(i)},e)},cancelViewAnimation:function(e){e._cancel(this)},pauseViewAnimation:function(e){e._pause(this)},continueViewAnimation:function(e){e._continue(this)},});var cr=null;function cD(fq,i){var e="//api.map.baidu.com/custom/v2/mapstyle?ak=49tGfOjwBKkG9zG76wgcpIbce4VZdbv6&callback=Bcb&";if(fq.styleJson){e+="styles="+encodeURIComponent(cZ(fq.styleJson))}else{if(fq.style){e+="customid="+fq.style}}var fp=this;window.Bcb=function(fr){cr=fr;i&&i()};e1.load(e)}aK.setMapStyle=cD;function cZ(fp,fz){var fA={featureType:"t",elementType:"e",visibility:"v",color:"c",lightness:"l",saturation:"s",weight:"w",level:"z",hue:"h",fontsize:"f"};var fB={all:"all",geometry:"g","geometry.fill":"g.f","geometry.stroke":"g.s",labels:"l","labels.text.fill":"l.t.f","labels.text.stroke":"l.t.s","labels.text":"l.t","labels.icon":"l.i"};var fC=[];var fu=false;var fw=false;var e=false;var fv=false;for(var fq=0,fy;fy=fp[fq];fq++){var fr={};y.extend(fr,fy);var ft=fr.stylers;delete fr.stylers;y.extend(fr,ft);var fs=[];for(var fx in fA){if(fr[fx]){if(fx==="elementType"){fs.push(fA[fx]+":"+fB[fr[fx]])}else{switch(fr[fx]){case"poilabel":fr[fx]="poi";break;case"districtlabel":fr[fx]="label";break}fs.push(fA[fx]+":"+fr[fx])}}}if(fs.length>2){fC.push(fs.join("|"))}}return fC.join(",")}var b0={NORMAL:"B_NORMAL_MAP",EARTH:"B_EARTH_MAP",SATELLITE:"B_STREET_MAP"};aK.MapTypeId=b0;var C="B_NORMAL_MAP";var bU="B_SATELLITE_MAP";var cF="B_STREET_MAP";var ez="B_EARTH_MAP";window.BMAPGL_NORMAL_MAP=C;window.BMAPGL_SATELLITE_MAP=bU;window.BMAPGL_HYBRID_MAP=cF;window.BMAPGL_EARTH_MAP=ez;window.BMAP_COORD_MERCATOR=1;window.BMAP_SYS_DRAWER=0;window.BMAP_SVG_DRAWER=1;window.BMAP_VML_DRAWER=2;window.BMAP_CANVAS_DRAWER=3;var f={getStyleUrl:function(fp,fr,fq,e){if(fp&&fp.styleJson){fp=fp.styleJson}this.styleJson=fp;var i=ds.apiHost+"/custom/v2/mapstyle?ak="+fr+"&callback="+fq+"&";i+="is_all=true&is_new=1&";i+="styles="+encodeURIComponent(this.styleJson2styleStringV2(fp,e));return i},styleJson2styleStringV2:function(fq,fB){var fC={featureType:"t",elementType:"e",visibility:"v",color:"c",lightness:"l",saturation:"s",weight:"w",level:"z",hue:"h",fontsize:"f"};var fD={all:"all",geometry:"g","geometry.fill":"g.f","geometry.stroke":"g.s",labels:"l","labels.text.fill":"l.t.f","labels.text.stroke":"l.t.s","labels.text":"l.t","labels.icon":"l.i"};var fE=[];var fw=false;var fy=false;var fp=false;var fx=false;var e=false;aK.customStyleInfo.zoomFrontStyle[fB]={};var fr=false;for(var fs=0;!!fq[fs];fs++){var fA=fq[fs];if(this.isOnlyZoomStyler(fA)){continue}aK.customStyleInfo.zoomRegion=this.getZoomRegion(fA,aK.customStyleInfo.zoomRegion);if(!this.isSelectZoom(fA,fB)){continue}if((fA.featureType==="land"||fA.featureType==="all"||fA.featureType==="background")&&typeof fA.elementType==="string"&&(fA.elementType==="geometry"||fA.elementType==="geometry.fill"||fA.elementType==="all")&&fA.stylers&&!fr){if(fA.stylers["color"]){aK.customStyleInfo.zoomFrontStyle[fB]["bmapLandColor"]=fA.stylers["color"];aK.customStyleInfo.zoomFrontStyle[fB].landColor=true;aK.bmapLandColor=fA.stylers["color"];fw=true}if(fA.stylers["visibility"]&&fA.stylers["visibility"]==="off"){aK.customStyleInfo.zoomFrontStyle[fB]["bmapLandColor"]="#00000000";aK.customStyleInfo.zoomFrontStyle[fB].landColor=true;aK.bmapLandColor="#00000000";fw=true}if(fA.featureType==="land"){fr=true}}if(fA.featureType==="railway"&&typeof fA.elementType==="string"&&fA.stylers){if(fA.stylers["color"]){if(fA.elementType==="geometry"){aK.bmapRailwayFillColor=fA.stylers["color"];fy=true;aK.bmapRailwayStrokeColor=fA.stylers["color"];fp=true;aK.customStyleInfo.zoomFrontStyle[fB]["bmapRailwayFillColor"]=fA.stylers["color"];aK.customStyleInfo.zoomFrontStyle[fB]["bmapRailwayStrokeColor"]=fA.stylers["color"];aK.customStyleInfo.zoomFrontStyle[fB].railwayFillColor=true;aK.customStyleInfo.zoomFrontStyle[fB].railwayStrokeColor=true}if(fA.elementType==="geometry.fill"){aK.bmapRailwayFillColor=fA.stylers["color"];fy=true;aK.customStyleInfo.zoomFrontStyle[fB]["bmapRailwayFillColor"]=fA.stylers["color"];aK.customStyleInfo.zoomFrontStyle[fB].railwayFillColor=true}if(fA.elementType==="geometry.stroke"){aK.bmapRailwayStrokeColor=fA.stylers["color"];fp=true;aK.customStyleInfo.zoomFrontStyle[fB]["bmapRailwayStrokeColor"]=fA.stylers["color"];aK.customStyleInfo.zoomFrontStyle[fB].railwayStrokeColor=true}}if(fA.stylers["visibility"]){aK.bmapRailwayVisibility=fA.stylers["visibility"];fx=true;aK.customStyleInfo.zoomFrontStyle[fB]["bmapRailwayVisibility"]=fA.stylers["visibility"];aK.customStyleInfo.zoomFrontStyle[fB].railwayVisibility=true}}if(fA.featureType==="roadarrow"&&fA.elementType==="labels.icon"&&fA.stylers){aK.bmapRoadarrowVisibility=fA.stylers["visibility"];aK.customStyleInfo.zoomFrontStyle[fB]["bmapRoadarrowVisibility"]=fA.stylers["visibility"];aK.customStyleInfo.zoomFrontStyle[fB].roadarrowVisibility=true;e=true}var ft={};y.extend(ft,fA);var fv=ft.stylers;delete ft.stylers;y.extend(ft,fv);var fu=[];for(var fz in fC){if(ft[fz]){if(this.isEditorZoomKeys(fz)){continue}if(fz==="elementType"){fu.push(fC[fz]+":"+fD[ft[fz]])}else{switch(ft[fz]){case"poilabel":ft[fz]="poi";break;case"districtlabel":ft[fz]="label";break}fu.push(fC[fz]+":"+ft[fz])}}}if(fu.length>2){fE.push(fu.join("|"))}}if(!aK.customStyleInfo.zoomFrontStyle[fB].landColor&&aK.customStyleInfo.zoomFrontStyle[fB]["bmapLandColor"]){delete aK.customStyleInfo.zoomFrontStyle[fB]["bmapLandColor"]}if(!aK.customStyleInfo.zoomFrontStyle[fB].railwayFillColor&&aK.customStyleInfo.zoomFrontStyle[fB]["bmapRailwayFillColor"]){delete aK.customStyleInfo.zoomFrontStyle[fB]["bmapRailwayFillColor"]}if(!aK.customStyleInfo.zoomFrontStyle[fB].railwayStrokeColor&&aK.customStyleInfo.zoomFrontStyle[fB]["bmapRailwayStrokeColor"]){delete aK.customStyleInfo.zoomFrontStyle[fB]["bmapRailwayStrokeColor"]}if(!aK.customStyleInfo.zoomFrontStyle[fB].railwayVisibility&&aK.customStyleInfo.zoomFrontStyle[fB]["bmapRailwayVisibility"]){delete aK.customStyleInfo.zoomFrontStyle[fB]["bmapRailwayVisibility"]}if(!aK.customStyleInfo.zoomFrontStyle[fB].roadarrowVisibility&&aK.customStyleInfo.zoomFrontStyle[fB]["bmapRoadarrowVisibility"]){delete aK.customStyleInfo.zoomFrontStyle[fB]["bmapRoadarrowVisibility"]}return fE.join(",")},isOnlyZoomStyler:function(e){var i={};y.extend(i,e.stylers);delete i.curZoomRegionId;delete i.curZoomRegion;delete i.level;if(y.isEmptyObject(i)){return true}else{return false}},isSelectZoom:function(i,e){var fp=i.stylers["level"];if(fp===undefined){return true}else{if(fp===e+""){return true}else{return false}}},isEditorZoomKeys:function(e){var i={curZoomRegionId:true,curZoomRegion:true};if(i[e]){return true}else{return false}},getZoomRegion:function(e,i){var fq=e.stylers["level"];var fp={};y.extend(fp,i);if(fq===undefined){return fp}else{fp[parseInt(fq,10)]=true;return fp}},onStyleDataBack:function(fr,fw,fv,e,ft){if(fr.status!==0){return}if(fr.data.style.length===3){if(!aK.customStyleInfo.baseFs){aK.customStyleInfo.baseFs=fr.data.style}aK.StyleBody=fr.data.style[2]}else{aK.StyleBody=fr.data.style}var fu=aK.customStyleInfo.baseFs;if(!y.isEmptyObject(aK.customStyleInfo.zoomRegion)){this.updateZoomFeatureStyle(aK.StyleBody,fw);this.updateFrontFeatureStyle(fw);var fp=this.calcuOtherZoomRegion(aK.customStyleInfo.zoomRegion,fw);for(var fs in fp){var fq={};y.extend(fq,e);this.getOtherZoomStyles(fs,ft,fq)}}else{aK["FeatureStyle"+fv]=fu;this.updateFrontFeatureStyle(fw)}},updateZoomFeatureStyle:function(fs,fr){aK.customStyleInfo.zoomStyleBody[fr]=fs;if(!aK.customStyleInfo.zoomRegion[fr]){var fq=3;var e=21;for(var fp=fq;fp<=e;fp++){if(!aK.customStyleInfo.zoomRegion[fp]){aK.customStyleInfo.zoomStyleBody[fp]=fs}}}},getOtherZoomStyles:function(fs,ft,fr){var fq=this;var fp=fs;var e=(Math.random()*100000).toFixed(0);window["_cbk"+e]=function(fu){if(fu.data.style.length===3){fu=fu.data.style[2]}else{fu=fu.data.style}fq.updateZoomFeatureStyle(fu,fp);fq.updateFrontFeatureStyle(fp);delete window["_cbk"+e]};var i=ds.apiHost+"/custom/v2/mapstyle?ak="+ft+"&callback=_cbk"+e+"&";i+="is_all=true&is_new=1&";if(fr.styleJson){i+="styles="+encodeURIComponent(this.styleJson2styleStringV2(fr.styleJson,fp))}else{if(fr.styleId){i+="styles="+encodeURIComponent(this.styleJson2styleStringV2(fq.styleJson,fp))}}e1.load(i)},updateFrontFeatureStyle:function(fr){if(!aK.customStyleInfo.zoomRegion[fr]){var fq=3;var e=21;for(var fp=fq;fp<=e;fp++){if(!aK.customStyleInfo.zoomRegion[fp]){if(!aK.customStyleInfo.zoomFrontStyle[fp]){aK.customStyleInfo.zoomFrontStyle[fp]={}}if(!aK.customStyleInfo.zoomFrontStyle[fr]){continue}aK.customStyleInfo.zoomFrontStyle[fp]["bmapLandColor"]=aK.customStyleInfo.zoomFrontStyle[fr]["bmapLandColor"];aK.customStyleInfo.zoomFrontStyle[fp]["bmapRailwayFillColor"]=aK.customStyleInfo.zoomFrontStyle[fr]["bmapRailwayFillColor"];aK.customStyleInfo.zoomFrontStyle[fp]["bmapRailwayStrokeColor"]=aK.customStyleInfo.zoomFrontStyle[fr]["bmapRailwayStrokeColor"]}}}},calcuOtherZoomRegion:function(ft,fs){var fp={};y.extend(fp,ft);if(fp[fs]){var fr=3;var e=21;for(var fq=fr;fq<=e;fq++){if(!fp[fq]){fp[fq]=true;break}}delete fp[fs]}else{}return fp}};function a6(i,e,fq,fp){this.cx=3*i;this.bx=3*(fq-i)-this.cx;this.ax=1-this.cx-this.bx;this.cy=3*e;this.by=3*(fp-e)-this.cy;this.ay=1-this.cy-this.by;this.p1x=i;this.p1y=fp;this.p2x=fq;this.p2y=fp}a6.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e};a6.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e};a6.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx};a6.prototype.solveCurveX=function(e,fv){if(typeof fv==="undefined"){fv=0.000001}var fu;var ft;var fr;var fp;var fq;for(fr=e,fq=0;fq<8;fq++){fp=this.sampleCurveX(fr)-e;if(Math.abs(fp)ft){return ft}while(fufp){fu=fr}else{ft=fr}fr=(ft-fu)*0.5+fu}return fr};a6.prototype.solve=function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))};var bs={};function m(fp){var e={duration:1000,fps:30,delay:0,transition:bs.linear,dropLastAnimation:false};if(fp){for(var fq in fp){e[fq]=fp[fq]}}if(fp.beginTime){this._beginTime=fp.beginTime}this._callbacks=[];this._options=e;if(e.delay){var fr=this;setTimeout(function(){fr._doStart()},e.delay)}else{this._doStart()}this._pauseTime=0}m.INFINITE="INFINITE";m.prototype._doStart=function(){if(this._isPausing){var e=performance.now()||new Date().getTime();this._pauseTime+=e-this._isPausing;this._isPausing=undefined}if(window.requestAnimationFrame){var i=this;i._timer=window.requestAnimationFrame(function(fp){i._loop(fp)})}else{this._beginTime=new Date().getTime();if(this._options.duration===m.INFINITE){this._endTime=null}else{this._endTime=this._beginTime+this._options.duration}this._loop()}};m.prototype._loop=function(fq){var ft=this;fq=fq||new Date().getTime();fq=fq-this._pauseTime;if(!this._beginTime){this._beginTime=fq}if(!this._endTime&&typeof this._options.duration==="number"){this._endTime=this._beginTime+this._options.duration}if(ft._endTime!==null&&fq>=ft._endTime){if(ft._options.dropLastAnimation===false){ft._options.render(ft._options.transition(1),1,fq)}if(typeof ft._options.finish==="function"){ft._options.finish(fq)}for(var fs=0,e=ft._callbacks.length;fs=fr.percentage&&fq0){i.unselectable="on";i.selectstart=function(){return false};i.onmousedown=function(fp){fp.preventDefault();return false}}else{var e=b3(i);e.MozUserSelect="none";e.WebkitUserSelect="none";i.addEventListener("mousedown",function(fp){fp.preventDefault()},false)}}function eU(e){return e&&e.parentNode&&e.parentNode.nodeType!==11}function ct(i,e){i.insertAdjacentHTML("beforeEnd",e);return i.lastChild}function fe(fp,i){var fq=document.createElement("div");fq.innerHTML=i;var e=fq.childNodes[0];return fp.parentNode.insertBefore(e,fp)}function j(i){i=i||window.event;i.stopPropagation?i.stopPropagation():i.cancelBubble=true}function a8(i){i=i||window.event;i.preventDefault?i.preventDefault():i.returnValue=false;return false}function b1(i){j(i);return a8(i)}function dU(){var e=document.documentElement;var i=document.body;if(e&&(e.scrollTop||e.scrollLeft)){return[e.scrollTop,e.scrollLeft]}else{if(i){return[i.scrollTop,i.scrollLeft]}else{return[0,0]}}}function dI(fr){if(!fr){return}fr.onload=fr.onerror=null;var fp=fr.attributes,fq,e,fs;if(fp){e=fp.length;for(fq=0;fq>4);fw=((fv&15)<<4)|(ft>>2);fu=((ft&3)<<6)|fs;fp=fp+String.fromCharCode(fy);if(ft!==64){fp=fp+String.fromCharCode(fw)}if(fs!==64){fp=fp+String.fromCharCode(fu)}fy=fw=fu="";fx=fv=ft=fs=""}while(fq-1||e.indexOf("iPad")>-1){return true}return false}function c4(){var e=navigator.userAgent;if(e.indexOf("Android")>-1){return true}return false}function bL(){var e=navigator.userAgent;return e.indexOf("baiduboxapp")>-1}function cu(e){return e*Math.PI/180}function b4(e){return e/Math.PI*180}function cw(e,fr){var fq=Math.pow(10,fr);if(typeof e==="number"){return Math.round(e*fq)/fq}for(var fp=0;fpe){fp=e}}return fp}function d6(e,i){while(e<0){e+=i}return e%i}function cJ(i,e){return(i>=0&&e>=0)||(i<0&&e<0)}function az(i){if(i._gl){return i._gl}var e={alpha:true,antialias:false,failIfMajorPerformanceCaveat:false,preserveDrawingBuffer:false,stencil:false};var fp=i.getContext("webgl",e)||i.getContext("experimental-webgl",e);i._gl=fp;return fp}function c9(fq,fp){for(var e=0;efq||fp.lati){return false}return true}function ev(fu,ft,fs,fq){var fr=et(fs,fq,fu);var fp=et(fs,fq,ft);var i=et(fu,ft,fs);var e=et(fu,ft,fq);if(fr*fp<0&&i*e<0){return true}else{if(fr===0&&bo(fs,fq,fu)){return true}else{if(fp===0&&bo(fs,fq,ft)){return true}else{if(i===0&&bo(fu,ft,fs)){return true}else{if(e===0&&bo(fu,ft,fq)){return true}else{return false}}}}}}function fc(fp,i){var e=i.parentNode;if(e.lastChild===i){e.appendChild(fp)}else{e.insertBefore(fp,i.nextSibling)}}function fg(fw,fx){if(fx===0){return fw}var fv=0;var ft=0;if(!fw){throw"异常"}if(fw.length===0){return[]}for(var fr=1,fp=fw.length-1;frfv){ft=fr;fv=fu}}var e=[];if(fv>=fx){var fz=fw.slice(0,ft);var fy=fw.slice(ft,fw.length);var fs=fg(fz,fx);var fq=fg(fy,fx);for(var fr=0,fp=fs.length;fr=0){fq=Math.floor(fp/65536)*65536;i=fq;e=fp-fq}else{fq=Math.floor(-fp/65536)*65536;i=-fq;e=fp+fq}return[i,e]}function B(e){if(e.lng>=0&&e.lat>=0){return new e7(e.lng-10000000,e.lat-6000000)}if(e.lng>=0&&e.lat<0){return new e7(e.lng-10000000,e.lat+6000000)}if(e.lng<0&&e.lat>=0){return new e7(e.lng+10000000,e.lat-6000000)}if(e.lng<0&&e.lat<0){return new e7(e.lng+10000000,e.lat+6000000)}}var dO=null;if(window.performance&&window.performance.now){dO=function(){return performance.now()}}else{if(Date.now){dO=function(){return Date.now()}}else{dO=function(){return(new Date).getTime()}}}function a1(fq,e,i){var fp="mouseWheel";if(y.Platform.macintosh){if(!isNaN(fq)&&(fq<10||fq!==120)&&(e%1===0&&e<5)){fp="padScroll"}if(y.Browser.firefox&&(e%1===0&&e<5&&i===0)){fp="padScroll"}}if(y.Browser.safari&&fq===12){fp="mouseWheel"}return fp}function b5(fz,fu){var fy=fz[0];var fx=fz[1];var fq=false;for(var ft=0,fs=fu.length-2;ftfx)!==(fp>fx))&&(fy<(fv-fw)*(fx-fr)/(fp-fr)+fw);if(e){fq=!fq}fs=ft}return fq}function bC(fp,e,i,fq){fq=fq||0.4;if(fp>i){fp=Math.pow(fp-i+1,fq)+i-1}else{if(fpi-gu?gu:gv},e.offset=function(i,gu){return gt(i=new Date(+i),null==gu?1:Math.floor(gu)),i},e.range=function(gv,i,gu){var gw=[];if(gv=e.ceil(gv),gu=null==gu?1:Math.floor(gu),!(i>gv&&gu>0)){return gw}do{gw.push(new Date(+gv))}while(gt(gv,gu),gs(gv),i>gv);return gw},e.filter=function(i){return gk(function(gu){for(;gs(gu),!i(gu);){gu.setTime(gu-1)}},function(gu,gv){for(;--gv>=0;){for(;gt(gu,1),!i(gu);){}}})},gq&&(e.count=function(i,gu){return f4.setTime(+i),f8.setTime(+gu),gs(f4),gs(f8),Math.floor(gq(f4,f8))},e.every=function(i){return i=Math.floor(i),isFinite(i)&&i>0?i>1?e.filter(gr?function(gu){return gr(gu)%i===0}:function(gu){return e.count(0,gu)%i===0}):e:null}),e}function f9(e){return gk(function(i){i.setDate(i.getDate()-(i.getDay()+7-e)%7),i.setHours(0,0,0,0)},function(i,gq){i.setDate(i.getDate()+7*gq)},function(i,gq){return(gq-i-(gq.getTimezoneOffset()-i.getTimezoneOffset())*f3)/gh})}function f1(e){return gk(function(i){i.setUTCDate(i.getUTCDate()-(i.getUTCDay()+7-e)%7),i.setUTCHours(0,0,0,0)},function(i,gq){i.setUTCDate(i.getUTCDate()+7*gq)},function(i,gq){return(gq-i)/gh})}var f4=new Date,f8=new Date,gf=gk(function(){},function(i,gq){i.setTime(+i+gq)},function(i,gq){return gq-i});gf.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?gk(function(i){i.setTime(Math.floor(i/e)*e)},function(i,gq){i.setTime(+i+gq*e)},function(i,gq){return(gq-i)/e}):gf:null};var go=gf.range,gm=1000,f3=60000,gj=3600000,gb=86400000,gh=604800000,fv=gk(function(e){e.setTime(Math.floor(e/gm)*gm)},function(i,gq){i.setTime(+i+gq*gm)},function(i,gq){return(gq-i)/gm},function(e){return e.getUTCSeconds()}),gl=fv.range,ga=gk(function(e){e.setTime(Math.floor(e/f3)*f3)},function(i,gq){i.setTime(+i+gq*f3)},function(i,gq){return(gq-i)/f3},function(e){return e.getMinutes()}),fD=ga.range,fX=gk(function(i){var gq=i.getTimezoneOffset()*f3%gj;0>gq&&(gq+=gj),i.setTime(Math.floor((+i-gq)/gj)*gj+gq)},function(i,gq){i.setTime(+i+gq*gj)},function(i,gq){return(gq-i)/gj},function(e){return e.getHours()}),gg=fX.range,fN=gk(function(e){e.setHours(0,0,0,0)},function(i,gq){i.setDate(i.getDate()+gq)},function(i,gq){return(gq-i-(gq.getTimezoneOffset()-i.getTimezoneOffset())*f3)/gb},function(e){return e.getDate()-1}),fu=fN.range,fK=f9(0),fM=f9(1),fq=f9(2),fI=f9(3),fx=f9(4),f0=f9(5),f7=f9(6),fs=fK.range,fZ=fM.range,fB=fq.range,fW=fI.range,gc=fx.range,fY=f0.range,gn=f7.range,ge=gk(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(i,gq){i.setMonth(i.getMonth()+gq)},function(i,gq){return gq.getMonth()-i.getMonth()+12*(gq.getFullYear()-i.getFullYear())},function(e){return e.getMonth()}),gp=ge.range,fH=gk(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(i,gq){i.setFullYear(i.getFullYear()+gq)},function(i,gq){return gq.getFullYear()-i.getFullYear()},function(e){return e.getFullYear()});fH.every=function(e){return isFinite(e=Math.floor(e))&&e>0?gk(function(i){i.setFullYear(Math.floor(i.getFullYear()/e)*e),i.setMonth(0,1),i.setHours(0,0,0,0)},function(i,gq){i.setFullYear(i.getFullYear()+gq*e)}):null};var fA=fH.range,f5=gk(function(e){e.setUTCSeconds(0,0)},function(i,gq){i.setTime(+i+gq*f3)},function(i,gq){return(gq-i)/f3},function(e){return e.getUTCMinutes()}),fP=f5.range,fO=gk(function(e){e.setUTCMinutes(0,0,0)},function(i,gq){i.setTime(+i+gq*gj)},function(i,gq){return(gq-i)/gj},function(e){return e.getUTCHours()}),fL=fO.range,fJ=gk(function(e){e.setUTCHours(0,0,0,0)},function(i,gq){i.setUTCDate(i.getUTCDate()+gq)},function(i,gq){return(gq-i)/gb},function(e){return e.getUTCDate()-1}),fG=fJ.range,fF=f1(0),fE=f1(1),fC=f1(2),fz=f1(3),fy=f1(4),ft=f1(5),fr=f1(6),fp=fF.range,fV=fE.range,gi=fC.range,f6=fz.range,gd=fy.range,fU=ft.range,fT=fr.range,fS=gk(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(i,gq){i.setUTCMonth(i.getUTCMonth()+gq)},function(i,gq){return gq.getUTCMonth()-i.getUTCMonth()+12*(gq.getUTCFullYear()-i.getUTCFullYear())},function(e){return e.getUTCMonth()}),fR=fS.range,fw=gk(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(i,gq){i.setUTCFullYear(i.getUTCFullYear()+gq)},function(i,gq){return gq.getUTCFullYear()-i.getUTCFullYear()},function(e){return e.getUTCFullYear()});fw.every=function(e){return isFinite(e=Math.floor(e))&&e>0?gk(function(i){i.setUTCFullYear(Math.floor(i.getUTCFullYear()/e)*e),i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0)},function(i,gq){i.setUTCFullYear(i.getUTCFullYear()+gq*e)}):null};var fQ=fw.range;f2.timeInterval=gk,f2.timeMillisecond=gf,f2.timeMilliseconds=go,f2.utcMillisecond=gf,f2.utcMilliseconds=go,f2.timeSecond=fv,f2.timeSeconds=gl,f2.utcSecond=fv,f2.utcSeconds=gl,f2.timeMinute=ga,f2.timeMinutes=fD,f2.timeHour=fX,f2.timeHours=gg,f2.timeDay=fN,f2.timeDays=fu,f2.timeWeek=fK,f2.timeWeeks=fs,f2.timeSunday=fK,f2.timeSundays=fs,f2.timeMonday=fM,f2.timeMondays=fZ,f2.timeTuesday=fq,f2.timeTuesdays=fB,f2.timeWednesday=fI,f2.timeWednesdays=fW,f2.timeThursday=fx,f2.timeThursdays=gc,f2.timeFriday=f0,f2.timeFridays=fY,f2.timeSaturday=f7,f2.timeSaturdays=gn,f2.timeMonth=ge,f2.timeMonths=gp,f2.timeYear=fH,f2.timeYears=fA,f2.utcMinute=f5,f2.utcMinutes=fP,f2.utcHour=fO,f2.utcHours=fL,f2.utcDay=fJ,f2.utcDays=fG,f2.utcWeek=fF,f2.utcWeeks=fp,f2.utcSunday=fF,f2.utcSundays=fp,f2.utcMonday=fE,f2.utcMondays=fV,f2.utcTuesday=fC,f2.utcTuesdays=gi,f2.utcWednesday=fz,f2.utcWednesdays=f6,f2.utcThursday=fy,f2.utcThursdays=gd,f2.utcFriday=ft,f2.utcFridays=fU,f2.utcSaturday=fr,f2.utcSaturdays=fT,f2.utcMonth=fS,f2.utcMonths=fR,f2.utcYear=fw,f2.utcYears=fQ,Object.defineProperty(f2,"__esModule",{value:!0})});function em(e){this._elemType=e;this._objCollection={}}em.prototype.get=function(){var i=null;for(var e in this._objCollection){if(this._objCollection[e]&&this._objCollection[e]._free===true){this._objCollection[e]._free=false;return this._objCollection[e]}}i=J(this._elemType);e=aK.getGUID("obj_pool_");this._objCollection[e]=i;return i};em.prototype.free=function(e){if(!e){return}e._free=true;if(e.tagName.toLowerCase()==="img"){e.src="";e.crossOrigin=null;e.onload=e.onerror=null}};em.prototype.clear=function(){for(var e in this._objCollection){if(this._objCollection[e]&&this._objCollection[e].tagName.toLowerCase==="img"){this._objCollection[e].onload=this._objCollection[e].onerror=null}}this._objCollection={}};var ew={get:function(i,fr,e,fp){var fq=new XMLHttpRequest();fq.open("GET",i,true);fq.timeout=10000;fq.ontimeout=function(){fp&&fp()};fq.onreadystatechange=function(fs){if(this.readyState===4){if(this.status===200){fr&&fr(fq.responseText)}else{e&&e()}}};fq.send()},post:function(i,fs,fr,e,fp){var fq=new XMLHttpRequest();fq.open("POST",i,true);fq.setRequestHeader("Content-type","application/x-www-form-urlencoded");fq.timeout=10000;fq.ontimeout=function(){fp&&fp()};fq.onreadystatechange=function(ft){if(this.readyState===4){if(this.status===200){fr&&fr(fq.responseText,fs)}else{e&&e()}}};fq.send(fs);return fq}};var e1=(function(e){function i(fs,fp,fr){var fq=J("script",{src:fs,type:"text/javascript",charset:"utf-8"});if(fq.addEventListener){fq.addEventListener("load",function(fu){var ft=fu.target;ft.parentNode.removeChild(ft);fp&&fp()},false);fq.addEventListener("error",function(ft){fr&&fr(null)},false)}else{if(fq.attachEvent){fq.attachEvent("onreadystatechange",function(fu){var ft=window.event.srcElement;if(ft&&(ft.readyState==="loaded"||ft.readyState==="complete")){ft.parentNode.removeChild(ft)}fp&&fp()})}}e.getElementsByTagName("head")[0].appendChild(fq)}return{load:function(ft,fp,fq){if(typeof ft==="string"){i(ft,fp,fq)}else{if(ft.length>0){var fs=ft.length;for(var fr=0;fr-1){return{col:fq,row:fw,zoom:fv,useZoom:fp}}else{var ft=b7.mapZoomBaseIndex[fv];if(dk.isWgs84){ft=b7.mapZoomBaseIndex1[fv]}var fs=b7.baseScaleZoom[ft+1];if(!fs){return null}var fu=this.getFactorByZooms(fs,fv);var e=b7.baseZoomInfo[fs];return{col:Math.floor(fq/fu),row:Math.floor(fw/fu),zoom:fs,useZoom:e[e.length-1]}}return null}if(fv-1-1){return[{col:fr,row:ft,zoom:e,useZoom:fp}]}else{var fE=0;var fB=e;while(fEfA){return null}var fz=Math.pow(2,fG);var i=fr*fz;var fy=ft*fz;var fv=e+fG;var fx=[];for(var fD=0;fD<2;fD++){var fs=i+fD;for(var fC=0;fC<2;fC++){var fu=fy+fC;fx.push({col:fs,row:fu,zoom:fv,useZoom:fv})}}return fx},getFactorByZooms:function(i,fq){var fp=b7.mapZoomBaseIndex[i];var fr=b7.mapZoomBaseIndex[fq];if(dk.isWgs84){fp=b7.mapZoomBaseIndex1[i];fr=b7.mapZoomBaseIndex1[fq]}var e=b7.baseScaleZoomMercatorSize[fp];var fs=b7.baseScaleZoomMercatorSize[fr];return e/fs}};if(dk.isWgs84){b7.prototype.getZoomUnits=function(e){return 2*Math.PI*6378137/256/Math.pow(2,e)};b7.mapZoomBaseIndex=[0,0,8,7,7,6,6,5,5,4,3,3,3,2,2,1,1,0,0,0,0];b7.mapZoomBaseIndex1={16:0,14:1,13:2,10:3,9:4,7:5,5:6,3:7,2:8,};b7.baseScaleZoom=[16,14,13,10,9,7,5,3,2];b7.baseScaleZoomMercatorSize=[b7.prototype.getZoomUnits(16)*256,b7.prototype.getZoomUnits(14)*256,b7.prototype.getZoomUnits(13)*256,b7.prototype.getZoomUnits(10)*256,b7.prototype.getZoomUnits(9)*256,b7.prototype.getZoomUnits(7)*256,b7.prototype.getZoomUnits(5)*256,b7.prototype.getZoomUnits(3)*256,b7.prototype.getZoomUnits(2)*256,];b7.mapZoomBaseZoomMapping=[0,0,2,3,3,5,5,7,7,9,10,10,10,13,13,14,14,16,16,16,16];b7.mapZoomStartZoomMapping=[0,0,2,3,3,5,5,7,7,9,10,10,10,13,13,15,15,17,17,17,17];b7.mapZoomTileSize=[0,0,256,256,512,256,512,256,512,256,256,512,1024,256,512,512,1024,512,1024,2048,4096];b7.mapZoomTileSize=[0,0,256,256,512,256,512,256,512,256,256,512,1024,256,256,512,256,512,1024,2048,4096];b7.baseZoomInfo={"2":[2],"3":[3,4],"5":[5,6],"7":[7,8],"9":[9],"10":[10,11,12],"13":[13,14],"14":[15,16],"16":[17,18,19,20]}}var aC={};var S=["swiftshader","microsoft basic render driver"];var br=["intel","nvidia","amd","apple","geforce"];function cg(e){e=e.toLowerCase();if(S.indexOf(e)>=0){return true}if(e.indexOf("mobile")>=0){return true}return false}function dP(fp){fp=fp.toLowerCase();for(var e=0;e=0){return true}}return false}function cE(e){if(!e){return false}if(cg(e)){return false}if(dP(e)){return true}return false}aC.ifEnableEarth=function(i){var e=aC.ifEnableEarth;if(!i&&typeof e._enable==="boolean"){return e._enable}if(aC.ifSupportWebGL()){e._enable=true;return true}e._enable=false;return false};aC.ifEnableWebGLMap=function(i){var e=aC.ifEnableWebGLMap;if(!i&&typeof e._enable==="boolean"){return e._enable}if(aC.ifSupportWebGL()){if(ch.inMapHost){e._enable=true;return true}else{if(window.Blob||window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder){e._enable=true;return true}else{e._enable=false;return false}}}e._enable=false;return false};aC.params={};aC.ifSupportWebGL=function(){var i=aC.ifSupportWebGL;if(typeof i._supportWebGL==="boolean"){return i._supportWebGL}if(!window.WebGLRenderingContext){i._supportWebGL=false;return false}var fp=document.createElement("canvas");fp.width=300;fp.height=150;var fr=null;var fx={alpha:false,antialias:false,failIfMajorPerformanceCaveat:true,preserveDrawingBuffer:false,stencil:false};try{fr=fp.getContext("webgl",fx)||fp.getContext("experimental-webgl",fx)}catch(ft){i._supportWebGL=false}if(fr===null){i._supportWebGL=false}else{i._supportWebGL=true;var fv=fr.getExtension("WEBGL_debug_renderer_info");if(fv){var fu=fr.getParameter(fv.UNMASKED_RENDERER_WEBGL);if(cE(fu)===true){i._supportWebGL=true}var fw=fr.getParameter(fv.UNMASKED_VENDOR_WEBGL);i._renderer=fu;i._vendor=fw}if(!fv&&y.Browser.firefox){i._supportWebGL=true}if(!fv&&y.Platform.macintosh){i._supportWebGL=true}if(fr.drawingBufferWidth!==fp.width||fr.drawingBufferHeight!==fp.height){i._supportWebGL=false}if(fr.getParameter(fr.MAX_VERTEX_TEXTURE_IMAGE_UNITS)<4){i._supportWebGL=false}var fq=fr.getParameter(fr.MAX_TEXTURE_SIZE);aC.params.maxTextureSize=fq;if(fq<4096){i._supportWebGL=false}var fs=fr.getParameter(fr.MAX_TEXTURE_IMAGE_UNITS);if(fs<8){i._supportWebGL=false}if(!fr.getShaderPrecisionFormat||fr.getShaderPrecisionFormat(fr.FRAGMENT_SHADER,fr.HIGH_FLOAT).precision<23){i._supportWebGL=false}}return i._supportWebGL};aC.ifSupportCanvas2d=function(){var fr=aC.ifSupportCanvas2d;if(typeof fr.supportCanvas2d==="boolean"){return fr.supportCanvas2d}var fp=document.createElement("canvas");var i=null;try{i=fp.getContext("2d")}catch(fq){fr.supportCanvas2d=false}if(i===null){fr.supportCanvas2d=false}else{fr.supportCanvas2d=true}return fr.supportCanvas2d};aC.ifEnableCanvas2dMap=function(){var i=navigator.userAgent;var e=0;var fq=0;var fr=0;if(/macintosh/ig.test(i)){var fp=0;if(/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(i)&&!/chrome/i.test(i)){fp=parseInt((RegExp["\x241"]||RegExp["\x242"]),10)}if(fp>0){return false}return true}if(/windows nt (\d+\.\d)/ig.test(i)){fq=parseFloat(RegExp.$1);if(fq>=6.1){if(/chrome\/(\d+\.\d)/i.test(i)){e=parseFloat(RegExp.$1);if(e>=31){return true}}if(/MSIE (\d+(\.\d+)?)/.test(i)){fr=parseFloat(RegExp.$1);if(fr>=10){return true}}if(/Firefox/.test(i)){return true}if(/rv:11.0/ig.test(i)){return true}if(/edge/ig.test(i)){return true}}}return false};aC.ifSupportCSS3=function(fu,i){var ft=document.createElement("div");var fs="Webkit Moz O ms".split(" ");var e=fs.length;var fp="";var fq=ft.style;if(fu in fq){fp=fu}fu=fu.replace(/^[a-z]/,function(fv){return fv.toUpperCase()});while(e--){var fr=fs[e]+fu;if(fr in fq){fp=fr;break}}if(i){return fp}else{return fp.length>0?true:false}};aC.isModernBrowser=aC.ifSupportCanvas2d()&&aC.ifSupportCSS3("transform");function dn(i,e){this._size=i;this._curSize=0;this._cache={};this._least=null;this._most=null;this._options={clearCallback:null,removeOldCallback:null};e=e||{};for(var fp in e){this._options[fp]=e[fp]}this._getDataTimes=0;this._hitTimes=0}dn.prototype.setData=function(fq,fs){var i=this._cache;var fp=this._size;if(fp===0){return}var e=this._curSize;if(e===fp){this._removeOld()}var fr;if(!i[fq]){fr={key:fq,data:fs,older:null,newwer:null};i[fq]=fr;if(this._least===null){this._least=fr}if(this._most===null){this._most=fr}this._curSize++}else{fr=i[fq];fr.data=fs;if(this._most===fr){return}fr.older&&(fr.older.newer=fr.newer);fr.newer&&(fr.newer.older=fr.older);if(this._least===fr){this._least=fr.newer}}if(this._most&&this._most!==fr){this._most.newer=fr;fr.older=this._most;this._most=fr;fr.newer=null}};dn.prototype.getData=function(e){var i=this._cache[e];this._getDataTimes++;if(i){this._hitTimes++;var fp=i.data;if(this._most===i){return fp}i.older&&(i.older.newer=i.newer);i.newer&&(i.newer.older=i.older);if(this._least===i){this._least=i.newer}this._most.newer=i;i.older=this._most;i.newer=null;this._most=i;return fp}return null};dn.prototype.getAllData=function(){return this._cache};dn.prototype.getHitRate=function(){return this._hitTimes/this._getDataTimes};dn.prototype.removeData=function(i){var e=this._cache;var fp=e[i];if(!fp){return}if(this._options.clearCallback){this._options.clearCallback(fp.data,fp.key)}fp.older&&(fp.older.newer=fp.newer);fp.newer&&(fp.newer.older=fp.older);if(this._least===fp){this._least=fp.newer}if(this._most===fp){this._most=fp.older}delete e[i];this._curSize--};dn.prototype._removeOld=function(){var e=this._cache;var fq=Math.round(this._size*0.6);var fp=0;while(this._least&&fp')}else{var i='
';if(e&&e.config.autoSafeArea&&aP()){this._safeAreaContainer=ct(this._map.container,i);this._safeAreaContainer.style.position="absolute";this._safeAreaContainer.style.bottom="env(safe-area-inset-bottom)";this._container=ct(this._safeAreaContainer,i)}else{this._container=ct(this._map.container,i)}}if(this._visible===false){this._container.style.display="none"}return this._container},_setPosition:function(){this.setAnchor(this._opts.anchor)},setAnchor:function(fq){if(this.anchorFixed||typeof fq!=="number"||isNaN(fq)||fqBMAP_ANCHOR_BOTTOM_RIGHT){fq=this.defaultAnchor}this._opts.offset=this._opts.offset||this.defaultOffset;var fp=this._opts.anchor;this._opts.anchor=fq;if(!this._container){return}var fs=this._container;var e=this._opts.offset.width;var fr=this._opts.offset.height;fs.style.left=fs.style.top=fs.style.right=fs.style.bottom="auto";switch(fq){case BMAP_ANCHOR_TOP_LEFT:fs.style.top=fr+"px";fs.style.left=e+"px";break;case BMAP_ANCHOR_TOP_RIGHT:fs.style.top=fr+"px";fs.style.right=e+"px";break;case BMAP_ANCHOR_BOTTOM_LEFT:fs.style.bottom=fr+"px";fs.style.left=e+"px";break;case BMAP_ANCHOR_BOTTOM_RIGHT:fs.style.bottom=fr+"px";fs.style.right=e+"px";break;default:break}var i=["TL","TR","BL","BR"];y.rc(this._container,"anchor"+i[fp]);y.ac(this._container,"anchor"+i[fq])},getAnchor:function(){return this._opts.anchor},setOffset:function(e){if(!e){return}this._opts=this._opts||{};this._opts.offset=new cK(e.width,e.height);if(!this._container){return}this.setAnchor(this._opts.anchor)},getOffset:function(){return this._opts.offset},getDom:function(){return this._container},show:function(){if(this._visible===true){return}this._visible=true;if(this._container){this._container.style.display=""}this.dispatchEvent(new aD("onshow"))},hide:function(){if(this._visible===false){return}this._visible=false;if(this._container){this._container.style.display="none"}this.dispatchEvent(new aD("onhide"))},isPrintable:function(){return !!this._opts.printable},isVisible:function(){if(!this._container&&!this._map){return false}return !!this._visible},_asyncLoadCode:function(){var e=this;cL.load("control",function(){if(e._asyncDraw){e._asyncDraw()}})}});var ff={TOP_LEFT:0,TOP_RIGHT:1,BOTTOM_LEFT:2,BOTTOM_RIGHT:3};aK.ControlAnchor=ff;window.BMAP_ANCHOR_TOP_LEFT=0;window.BMAP_ANCHOR_TOP_RIGHT=1;window.BMAP_ANCHOR_BOTTOM_LEFT=2;window.BMAP_ANCHOR_BOTTOM_RIGHT=3;function cs(e){aB.call(this);e=e||{};this._opts={printable:false};y.extend(this._opts,e);this._copyrightCollection=[];this.defaultAnchor=BMAP_ANCHOR_BOTTOM_LEFT;this.defaultOffset=new cK(5,2);this.setAnchor(e.anchor);this._canShow=true;this.sateMapStyle=false;this.blockInfoWindow=false;this._asyncLoadCode()}cs.inherits(aB,"CopyrightControl");y.extend(cs.prototype,{initialize:function(e){this._map=e;return this._container},addCopyright:function(fq){var e={minZoom:0,bounds:null,content:"",mapType:""};for(var fp in fq){e[fp]=fq[fp]}if(this._map){var ft=e.minZoom;if(ft===-1||ftthis._map.getMaxZoom()){e.minZoom=this._map.getMinZoom()}if(e.mapType!==""&&!bg[e.mapType]){e.mapType=C}}var fr=this.getCopyright(fq.id);if(fr){for(var fs in e){fr[fs]=e[fs]}}else{this._copyrightCollection.push(e)}},getCopyright:function(fq){for(var fp=0,e=this._copyrightCollection.length;fp=BMAP_NAVIGATION_CONTROL_LARGE&&e<=BMAP_NAVIGATION_CONTROL_ANIM){this._opts.type=e}else{this._opts.type=BMAP_NAVIGATION_CONTROL_LARGE}},getType:function(){return this._opts.type}});function aV(i){aB.call(this);i=i||{};this._opts={printable:false};this.defaultAnchor=BMAP_ANCHOR_TOP_RIGHT;this.defaultOffset=new cK(10,10);this.setAnchor(i.anchor);this._opts=y.extend(y.extend(this._opts,{offset:this.defaultOffset,enableSwitch:true}),i);var e=this;cL.load("control",function(){e._asyncDraw()})}aV.inherits(aB,"MapTypeControl");y.extend(aV.prototype,{initialize:function(e){this._map=e;return this._container},showStreetLayer:function(e){this._map.showStreetLayer(e)}});function bA(e){aB.call(this);e=e||{};this._opts={};this._opts=y.extend(this._opts,e);this._zoomInDisabled=false;this._zoomOutDisabled=false;this._zoomInTapped=false;this._zoomOutTapped=false;this.defaultAnchor=ff.BOTTOM_RIGHT;this.defaultOffset=new cK(10,50);this.setAnchor(e.anchor);this._asyncLoadCode()}bA.inherits(aB,"ZoomControl");y.extend(bA.prototype,{initialize:function(e){this._map=e;return this._container}});function aT(e){aB.call(this);e=e||{};this._opts={autoZoom:true,autoViewport:true,onSuccess:null,onFail:null,showTips:true,enableHighAccuracy:true,timeout:5000};this._opts=y.extend(this._opts,e);this.defaultAnchor=ff.BOTTOM_LEFT;this.defaultOffset=new cK(10,50);this.watchPosition=this._opts.watchPosition||false;this.useCompass=this._opts.useCompass||false;this.locMarker=null;this.locLevel=16;this.setAnchor(this._opts.anchor);this.onLocationStart=e.onLocationStart||null;this._asyncLoadCode()}aT.inherits(aB,"LocationControl");y.extend(aT.prototype,{initialize:function(e){this._map=e;return this._container},startLocation:function(){this._startLocationCalled=true},stopLocationTrace:function(){},setOptions:function(e){e=e||{};y.extend(this._opts,e)},showLocationAt:function(e){this._userSetLocation=e}});function R(e){aB.call(this);e=e||{};this._opts={};this._opts=y.extend(this._opts,e);this.defaultAnchor=ff.BOTTOM_LEFT;this.defaultOffset=new cK(10,5);this.setAnchor(e.anchor)}R.inherits(aB,"LogoControl");y.extend(R.prototype,{initialize:function(i){this._map=i;var e=this._container=document.createElement("div");e.innerHTML='';i.getContainer().appendChild(e);return e}});function ex(e,i){this._map=e;this._indoorInfo=i;this._visible=true;this._adjustVisible=true;this._isMobile=ea();this._sizeConfig={FLOOR_BTN_HEIGHT:this._isMobile?35:26,SWITCH_ARROW_HEIGHT:this._isMobile?20:15};this._init()}ex.prototype._init=function(){this._render();this._bindDom();this._bind();this._adjustDisplayHeight();var e=new aD("onindoor_bar_show");e.uid=this._indoorInfo.uid;this._map.dispatchEvent(e)};ex.prototype._render=function(){if(!this._indoorInfo){return}var fu=this._isMobile;var e=this._div=J("div");y.ac(e,"floor-select-container");fu&&y.ac(e,"mobile");fu&&y.ac(e,"all-border-radius");var i=this._btnTop=J("button");y.ac(i,"floor-switch-top");y.ac(i,"top-border-radius");var fs=J("div");y.ac(fs,"floor-switch-top-icon");i.appendChild(fs);var fr=this._btnBottom=J("button");var fp=J("div");y.ac(fp,"floor-switch-bottom-icon");fr.appendChild(fp);y.ac(fr,"floor-switch-bottom");y.ac(fr,"bottom-border-radius");var fq=this._floorsContainer=J("div");y.ac(fq,"floors-container");fq.appendChild(this._createFloorsDom());this._div.appendChild(i);this._div.appendChild(fq);this._div.appendChild(fr);var fv=0;if(this._btnTop.style.display===""){fv=2*this._sizeConfig.SWITCH_ARROW_HEIGHT}this._div.style.height=parseInt(this._floorsContainer.style.height,10)+fv+"px";this._map.getContainer().appendChild(this._div);if(!fu){var ft=this;setTimeout(function(){ft._div.style.right="20px"},20)}};ex.prototype._createFloorsDom=function(){if(!this._indoorInfo){return}var fp=this._ol=J("ol");var fs=this._indoorInfo.currentFloor;for(var fr=this._indoorInfo.floors.length-1;fr>=0;fr--){var ft=this._indoorInfo.floors[fr].floorName;var e=J("li");var fq=J("button");y.ac(fq,"btn-select-floor");if(fr===fs){y.ac(fq,"selected")}fq.setAttribute("data-floor",fr);fq.innerHTML=ft;e.appendChild(fq);fp.appendChild(e)}return fp};ex.prototype._updateUI=function(){if(!this._ol){this._render();this._bind();this._adjustDisplayHeight();return}this._ol=null;this._ol=this._createFloorsDom();this._floorsContainer.innerHTML="";this._floorsContainer.appendChild(this._ol);this._adjustDisplayHeight()};ex.prototype._bindDom=function(){var e=this;y.on(this._floorsContainer,"click",function(fq){var fp=fq.target||fq.srcElement;if(fp.tagName.toLowerCase()==="button"){e._map.showIndoor(e._indoorInfo.uid,parseInt(fp.getAttribute("data-floor"),10));var i=new aD("onindoor_bar_click");i.uid=e._indoorInfo.uid;e._map.dispatchEvent(i)}});y.on(this._floorsContainer,"mouseover",function(fp){var i=fp.target;if(i.tagName.toLowerCase()==="button"){y.ac(i,"hover")}});y.on(this._floorsContainer,"mouseout",function(fp){var i=fp.target;if(i.tagName.toLowerCase()==="button"){y.rc(i,"hover")}});y.on(this._floorsContainer,"touchstart",function(fp){var i=fp.target;if(i.tagName.toLowerCase()==="button"){y.ac(i,"onmousedown")}});y.on(this._floorsContainer,"touchend",function(fp){var i=fp.target;if(i.tagName.toLowerCase()==="button"){y.rc(i,"onmousedown")}});y.on(this._btnTop,"mouseover",function(i){if(this._disable){return}y.ac(this,"hover")});y.on(this._btnTop,"mouseout",function(i){y.rc(this,"hover")});y.on(this._btnBottom,"mouseover",function(i){if(this._disable){return}y.ac(this,"hover")});y.on(this._btnBottom,"mouseout",function(i){y.rc(this,"hover")});y.on(this._btnTop,"touchstart",function(i){if(this.className.indexOf("disable")>-1){return}y.ac(this,"onmousedown")});y.on(this._btnTop,"touchend",function(i){y.rc(this,"onmousedown")});y.on(this._btnBottom,"touchstart",function(i){if(this.className.indexOf("disable")>-1){return}y.ac(this,"onmousedown")});y.on(this._btnBottom,"touchend",function(i){y.rc(this,"onmousedown")});y.on(this._btnTop,"click",function(i){e._setBarSliderTop(parseInt(e._ol.style.top,10)+26)});y.on(this._btnBottom,"click",function(i){e._setBarSliderTop(parseInt(e._ol.style.top,10)-26)});y.on(this._div,"mousemove",j);y.on(this._div,"wheel",b1);y.on(this._div,"mousewheel",b1);this._map.addEventListener("resize",function(){e._adjustDisplayHeight()})};ex.prototype._adjustDisplayHeight=function(){if(!this._indoorInfo){return}var fs=this._map.getSize().height;var ft=this._sizeConfig.FLOOR_BTN_HEIGHT;var fu=fs-291-100;if(this._isMobile){fu=fs-12-108-this._map.config.bottomOffset}var e=this._indoorInfo.floors.length;var fp=e*ft;var fq=e;var fw=0;var fx=this._floorsContainer.children[0];if(fp>fu){this._showArrow=true;y.rc(fx.children[0].children[0],"top-border-radius");y.rc(fx.children[e-1].children[0],"bottom-border-radius")}else{this._showArrow=false;y.ac(fx.children[0].children[0],"top-border-radius");y.ac(fx.children[e-1].children[0],"bottom-border-radius")}while(fp>fu){if(fq===0){break}fq--;fw=2*this._sizeConfig.SWITCH_ARROW_HEIGHT;fp=fq*ft+fw}this._currentDisplayHeight=fp;if(fq<3){this._setAdjustVisbile(false)}else{this._setAdjustVisbile(true)}this._floorsContainer.style.height=fq*ft+"px";var fr=this._indoorInfo.currentFloor;var i=e-fr;var fv=fr-1;this._div.style.height=parseInt(this._floorsContainer.style.height,10)+fw+"px";var fy=-(e-(fr+Math.round(fq/2)))*ft;this._setBarSliderTop(fy);if(fq=i*fp){fq=e-i*fp;y.ac(this._btnBottom,"disable");y.rc(this._btnBottom,"hover");this._btnBottom._disable=true}else{y.rc(this._btnBottom,"disable");this._btnBottom._disable=false}if(fq>=0){fq=0;y.ac(this._btnTop,"disable");y.rc(this._btnTop,"hover");this._btnTop._disable=true}else{y.rc(this._btnTop,"disable");this._btnTop._disable=false}this._ol.style.top=fq+"px"};ex.prototype._setAdjustVisbile=function(e){if(this._adjustVisible===e){return}this._adjustVisible=e;if(e&&this._visible){this._div.style.right="20px"}else{this._div.style.right="-30px"}};ex.prototype._bind=function(){var i=this._map;var e=this;i.on("indoor_status_changed",function(fu){if(e._visible===false){return}var fp=e._ol;var fs=fu.uid;if(!fs){return}var ft=fu.floor;for(var fr=0;fr=1.5?2:1;this._imgPath=ds.imgPath+"earth-navi-control-pc4"+(this._imgRatio===2?"-2x.png":".png");this._enabled=true;var e=this;this._setHeadingOptions={callback:function(){e._target.setLock(false)}};this._init()}y.extend(fh.prototype,{_init:function(){this._createDom();this._render();this._bindDom();this._bind();this._updateUI();this._checkEnable()},_checkEnable:function(){if(this._target.getZoom()>=this._target._enableHeadingZoom){this.enable()}else{this.disable()}},_createDom:function(){var i=this._div=J("div");var e=i.style;e.position="absolute";e.zIndex=5;e.top="0";e.left="0";e.width="52px";e.height="54px";e.background="url("+this._imgPath+") no-repeat";e.backgroundSize="266px auto";this._rotateCCW=this._createButton();this._rotateCCW.title="逆时针转动";e=this._rotateCCW.style;e.left="2px";e.top="5px";e.zIndex="1";e.width="15px";e.height="42px";e.backgroundPosition="-75px -5px";this._rotateCW=this._createButton();this._rotateCW.title="顺时针转动";e=this._rotateCW.style;e.right="2px";e.top="5px";e.zIndex="1";e.width="15px";e.height="42px";e.backgroundPosition="-75px -5px";e.WebkitTransform=e.transform="scaleX(-1)";this._compass=this._createButton();this._compass.title="恢复正北方向";e=this._compass.style;e.left="19px";e.top="4px";e.width="14px";e.height="44px";e.backgroundPosition="-56px -4px";e.WebkitTransform=e.transform="rotate(0deg)";this._div.appendChild(this._rotateCCW);this._div.appendChild(this._compass);this._div.appendChild(this._rotateCW);this._domRendered=true},_createButton:function(){var e=J("button");var i=e.style;i.position="absolute";i.outline="none";i.border="none";i.background="url("+this._imgPath+") no-repeat";i.backgroundSize="266px auto";i.cursor="pointer";return e},_render:function(){this._outContainer.appendChild(this._div)},enable:function(){this._enabled=true;if(this._domRendered){this._rotateCCW.style.cursor="pointer";this._rotateCCW.style.opacity=1;this._rotateCW.style.cursor="pointer";this._rotateCW.style.opacity=1;this._compass.style.cursor="pointer";this._compass.style.opacity=1}},disable:function(){this._enabled=false;if(this._domRendered){this._rotateCCW.style.cursor="";this._rotateCCW.style.opacity=0.4;this._rotateCW.style.cursor="";this._rotateCW.style.opacity=0.4;this._compass.style.cursor="";this._compass.style.opacity=0.4}},_bindDom:function(){c9(this._div,["mousedown","click","dblclick"]);var i=this._map;var e=this;this._rotateCW.addEventListener("click",function(){if(e._isOperating||e._enabled===false){return}if(e._target.getLock()){return}if(e._target.getHeading()===360){e._target.setHeading(0)}e._target.setLock(true);e._target.setHeading(e._target.getHeading()+90,e._setHeadingOptions);i.fire(new aD("onrotatecwclick"))},false);this._rotateCCW.addEventListener("click",function(){if(e._isOperating||e._enabled===false){return}if(e._target.getLock()){return}if(e._target.getHeading()===-360){e._target.setHeading(0)}e._target.setLock(true);e._target.setHeading(e._target.getHeading()-90,e._setHeadingOptions);i.fire(new aD("onrotateccwclick"))},false);this._rotateCW.addEventListener("mouseover",function(){if(e._enabled===false){return}this.style.backgroundPosition="-89px -5px"},false);this._rotateCW.addEventListener("mouseout",function(){if(e._enabled===false){return}this.style.backgroundPosition="-75px -5px"},false);this._rotateCCW.addEventListener("mouseover",function(){if(e._enabled===false){return}this.style.backgroundPosition="-89px -5px"},false);this._rotateCCW.addEventListener("mouseout",function(){if(e._enabled===false){return}this.style.backgroundPosition="-75px -5px"},false);this._compass.addEventListener("click",function(){if(e._isOperating||e._enabled===false){return}if(e._target.getLock()){return}e._target.setLock(true);var fp=false;if(e._target.getTilt()!==0){fp=true;e._target.setTilt(0,e._setHeadingOptions)}if(e._target.getHeading()%360!==0){fp=true;e._target.resetHeading(e._setHeadingOptions)}if(!fp){e._target.setLock(false)}i.fire(new aD("oncompassclick"))},false)},_bind:function(){var e=this;this._bindTarget(this._target);if(this._map._renderType==="webgl"){this._map.addEventListener("maptypechange",function(i){if(this.mapType==="B_EARTH_MAP"){e._target=e._map._earth}else{e._target=e._map}e._bindTarget(e._target);e._checkEnable()})}},_bindTarget:function(i){if(i===this._map&&this._mapBinded){return}if(i===this._map._earth&&this._earthBinded){return}var e=this;i.addEventListener("heading_changed",function(fp){e._updateUI()});i.addEventListener("animation_start",function(fp){e._isOperating=true});i.addEventListener("animation_end",function(fp){e._isOperating=false});i.on("load",function(){e._checkEnable()});i.on("zoom_changed",function(){e._checkEnable()});if(i===this._map){this._mapBinded=true}else{this._earthBinded=true}},_updateUI:function(){var e=this._target.getHeading();var i=this._compass.style;i.WebkitTransform=i.transform="rotate("+e+"deg)"},hide:function(){this._div.style.display="none"},show:function(){this._div.style.display="block"}});function cY(fp,i){this._map=fp;this._target=fp;var fq=fp.temp.originMapType||fp.mapType;if(fq==="B_EARTH_MAP"&&fp._earth){this._target=fp._earth}this._outContainer=i||fp.getContainer();this._imgRatio=aA()>=1.5?2:1;this._imgPath=ds.imgPath+"gl-navi-control-pc4"+(this._imgRatio===2?"-2x.png":".png");this._enabled=true;var e=this;this._setTiltOptions={callback:function(){e._target.setLock(false)}};this._init()}y.extend(cY.prototype,{_init:function(){this._createDom();this._render();this._bindDom();this._bind();this._checkEnable()},_checkEnable:function(){if(this._target.getZoom()>=this._target._enableTiltZoom){this.enable()}else{this.disable()}},_createDom:function(){var e=this._div=J("button");e.title="倾斜";var i=e.style;i.position="absolute";i.zIndex=5;i.outline="none";i.border="none";i.cursor="pointer";i.width="26px";i.height="26px";i.top="56px";i.right="13px";i.background="url("+this._imgPath+") no-repeat #fff";i.backgroundSize="266px auto";i.backgroundPosition="-110px 1px";i.boxShadow="1px 2px 1px rgba(0, 0, 0, 0.15)"},enable:function(){this._enabled=true;if(this._div){this._div.style.cursor="pointer"}this._updateUI()},disable:function(){this._enabled=false;if(this._div){this._div.style.cursor=""}this._updateUI()},_render:function(){this._outContainer.appendChild(this._div)},_bindDom:function(){var e=this;this._div.addEventListener("mousedown",function(fq){if(!e._enabled){return}if(e._target.getLock()){return}var i=e._target.getTilt();var fp;if(i===e._map.getCurrentMaxTilt()){fp="out"}else{if(i===0){fp="in"}else{fp=e._preTrend?e._preTrend:"in"}}e._curTrend=fp;e._clickTimer=setTimeout(function(){e._map.fire(new aD("ontiltmsdown"));e._tiltAni=new m({duration:9999999,render:function(fr){i=e._target.getTilt();if(fp==="in"&&i0){e._target.setTilt(i-1,{noAnimation:true})}}},finish:function(){e._tiltAni=null}});e._clickTimer=null},200);fq.stopPropagation()},false);this._div.addEventListener("mouseup",function(i){if(!e._enabled){return}if(e._tiltAni){e._tiltAni.stop()}e._preTrend=e._curTrend},false);this._div.addEventListener("click",function(fq){if(!e._enabled){return}if(!e._clickTimer){return}if(e._target.getLock()){return}clearTimeout(e._clickTimer);e._map.fire(new aD("ontiltclick"));var i=e._target.getTilt();e._target.setLock(true);fq.stopPropagation();var fp=e._map.getCurrentMaxTilt();if(e._curTrend==="in"){e._target.setTilt(fp,e._setTiltOptions)}else{if(e._curTrend==="out"){e._target.setTilt(0,e._setTiltOptions)}else{if(i0){i=78}if(this._mouseOver){e=52}if(this._enabled===false){fq=26;e=0;i=0}var fr="-"+(110+i+fq+e)+"px 1px";this._div&&(this._div.style.backgroundPosition=fr);if(this._enabled){if(fp>0){this._div&&(this._div.title="恢复")}else{this._div&&(this._div.title="倾斜")}}else{this._div&&(this._div.title="请放大地图后操作")}},hide:function(){this._div.style.display="none"},show:function(){this._div.style.display="block"}});function bn(i){cN.call(this);this._opts={container:null,cursor:"default"};this._opts=y.extend(this._opts,i);this._type="contextmenu";this._map=null;this._container;this._left=0;this._top=0;this._items=[];this._rItems=[];this._dividers=[];this._enable=true;this.curPixel=null;this.curPoint=null;this._isOpen=false;var e=this;cL.load("menu",function(){e._draw()})}bn.inherits(cN,"ContextMenu");y.extend(bn.prototype,{initialize:function(e){this._map=e},remove:function(){this._map=null},addItem:function(fr,e){if(!fr||fr._type!="menuitem"||fr._text==""||fr._width<=0){return}for(var fq=0,fp=this._items.length;fqthis._items.length-1){e=-1}fr._insertIndex=e;if(e===-1){this._items.push(fr);this._rItems.push(fr)}else{this._items.splice(e,0,fr);this._rItems.splice(e,0,fr)}},removeItem:function(fq){if(!fq||fq._type!="menuitem"){return}for(var fp=0,e=this._items.length;fpthis._items.length-1){e=-1}var i={_type:"divider",_dIndex:this._dividers.length,_insertIndex:e};this._dividers.push({dom:null});if(e===-1){this._items.push(i)}else{this._items.splice(e,0,i)}},removeSeparator:function(fp){if(!this._dividers[fp]){return}for(var fq=0,e=this._items.length;fqfp){this._items[fq]._dIndex--}}this._dividers.splice(fp,1)},getDom:function(){return this._container},show:function(){if(this._isOpen==true){return}this._isOpen=true},hide:function(){if(this._isOpen==false){return}this._isOpen=false},setCursor:function(e){if(!e){return}this._opts.cursor=e},getItem:function(e){return this._rItems[e]},enable:function(){this._enable=true},disable:function(){this._enable=false},showAt:function(){}});function dM(fp,fq,i){if(!fp||!fq||typeof fq!="function"){return}cN.call(this);this._opts={width:100,id:""};i=i||{};this._opts.width=(i.width*1)?i.width:100;this._opts.id=i.id?i.id:"";this._text=fp+"";this._callback=fq;this._map=null;this._type="menuitem";this._contextmenu=null;this._container=null;this._enabled=true;var e=this;cL.load("menu",function(){e._draw()})}dM.inherits(cN,"MenuItem");y.extend(dM.prototype,{initialize:function(e,i){this._map=e;this._contextmenu=i},remove:function(){this._contextmenu=null;this._map=null},setText:function(e){if(!e){return}this._text=e+""},getDom:function(){return this._container},enable:function(){this._enabled=true},disable:function(){this._enabled=false}});function cy(e,i){this.setSouthWest(e);this.setNorthEast(i)}y.extend(cy.prototype,{isEmpty:function(){return this.sw===null&&this.ne===null},equals:function(e){if(!e||e.isEmpty()||this.isEmpty()){return false}return this.sw.equals(e.sw)&&this.ne.equals(e.ne)},containsBounds:function(e){if(!e||e.isEmpty()||this.isEmpty()){return false}return(e.sw.lng>this.sw.lng&&e.ne.lngthis.sw.lat&&e.ne.latMath.max(this.sw.lng,this.ne.lng)||Math.max(fp.sw.lat,fp.ne.lat)Math.max(this.sw.lat,this.ne.lat)){return null}var fr=Math.max(this.sw.lng,fp.sw.lng);var i=Math.min(this.ne.lng,fp.ne.lng);var fq=Math.max(this.sw.lat,fp.sw.lat);var e=Math.min(this.ne.lat,fp.ne.lat);return new cy(new e7(fr,fq),new e7(i,e))},setMinMax:function(){this.minX=this.sw?this.sw.lng:null;this.minY=this.sw?this.sw.lat:null;this.maxX=this.ne?this.ne.lng:null;this.maxY=this.ne?this.ne.lat:null},containsPoint:function(e){if(!e){return}return(e.lng>=this.sw.lng&&e.lng<=this.ne.lng&&e.lat>=this.sw.lat&&e.lat<=this.ne.lat)},extend:function(e){if(!e){return}var i=e.lng;var fp=e.lat;if(!this.sw){this.sw=e.clone()}if(!this.ne){this.ne=e.clone()}if(this.sw.lng>i){this.sw.lng=i}if(this.ne.lngfp){this.sw.lat=fp}if(this.ne.lat=0&&e<90||e>=270&&e<360){if(this.normalizedTopRight.lng=this.MCBAND[fs]){ft=this.MC2LL[fs];break}}var fu=this.convertor(e,ft);return new bV(fu.lat,fu.lng)},convertLL2MC:function(e){if(!e){return new e7(0,0)}var fq=e.lat;var fs=e.lng;fs=this.getLoop(e.lng,-180,180);fq=dQ(fq,-85,85);if(dk.isWgs84){var fw={};var fx=6378137;fw.lng=fs*Math.PI/180*fx;var fu=fq*Math.PI/180;fw.lat=fx/2*Math.log((1+Math.sin(fu))/(1-Math.sin(fu)));var fy=new e7(fw.lng,fw.lat);fy.latLng=e.clone();return fy}var fr;for(var fp=0;fp=this.LLBAND[fp]){fr=this.LL2MC[fp];break}}if(!fr){for(fp=0;fpe){fp-=e-i}while(fp90){i=90}}while(e<-180){e+=360}while(e>180){e-=360}this.lat=i||0;this.lng=e||0}y.extend(bV.prototype,{equals:function(e){return(this.lat===e.lat&&this.lng===e.lng)},clone:function(){return new bV(this.lat,this.lng)},getLngSpan:function(e){var i=this.lng;var fp=Math.abs(e-i);if(fp>180){fp=360-fp}return fp},sub:function(e){return new bV(this.lat-e.lat,this.lng-e.lng)},toString:function(){return this.lat+", "+this.lng}});function c7(e,i){if(e&&!i){i=e}this._sw=this._ne=null;this._swLng=this._swLat=null;this._neLng=this._neLat=null;if(e){this._sw=new bV(e.lat,e.lng);this._ne=new bV(i.lat,i.lng);this._swLng=e.lng;this._swLat=e.lat;this._neLng=i.lng;this._neLat=i.lat}}y.extend(c7.prototype,{isEmpty:function(){return !this._sw||!this._ne},equals:function(e){if(this.isEmpty()){return false}return this.getSouthWest().equals(e.getSouthWest())&&this.getNorthEast().equals(e.getNorthEast())},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},containsBounds:function(e){if(this.isEmpty()||e.isEmpty()){return false}return(e._swLng>this._swLng&&e._neLngthis._swLat&&e._neLatMath.max(this._swLng,this._neLng)||Math.max(fp._swLat,fp._neLat)Math.max(this._swLat,this._neLat)){return false}var fr=Math.max(this._swLng,fp._swLng);var i=Math.min(this._neLng,fp._neLng);var fq=Math.max(this._swLat,fp._swLat);var e=Math.min(this._neLat,fp._neLat);this._sw=new bV(fq,fr);this._ne=new bV(e,i);this._swLng=fr;this._swLat=fq;this._neLng=i;this._neLat=e;return true},containsPoint:function(e){if(this.isEmpty()){return false}return(e.lng>=this._swLng&&e.lng<=this._neLng&&e.lat>=this._swLat&&e.lat<=this._neLat)},extend:function(e){var i=e.lng;var fp=e.lat;if(!this._sw){this._sw=new bV(0,0)}if(!this._ne){this._ne=new bV(0,0)}if(!this._swLng||this._swLng>i){this._sw.lng=this._swLng=i}if(!this._neLng||this._neLngfp){this._sw.lat=this._swLat=fp}if(!this._neLat||this._neLate.lat){this._swLat=e.lat}if(this._swLng>e.lng){this._swLng=e.lng}if(this._neLat",_maskElement:null,_cursor:"default",inUse:false,show:function(e){if(!this._map){this._map=e}this.inUse=true;if(!this._maskElement){this._createMask(e)}this._maskElement.style.display="block"},_createMask:function(i){if(!this._map){this._map=i}if(!this._map){return}var e=this._maskElement=ct(this._map.container,this._html);y.on(e,"mouseup",function(fp){if(fp.button==2){b1(fp)}});y.on(e,"contextmenu",b1);e.style.display="none"},getDrawPoint:function(fq,ft,fr){fq=window.event||fq;var i=fq.offsetX||fq.layerX||0;var fs=parseInt(fq.offsetY)||parseInt(fq.layerY)||0;var fp=fq.target||fq.srcElement;if(fp!=cR.getDom(this._map)&&ft==true){while(fp&&fp!=this._map.container){if(!(fp.clientWidth==0&&fp.clientHeight==0&&fp.offsetParent&&fp.offsetParent.nodeName.toLowerCase()=="td")){i+=fp.offsetLeft;fs+=fp.offsetTop}fp=fp.offsetParent}}if(fp!=cR.getDom(this._map)&&fp!=this._map.container){return}if(typeof i==="undefined"||typeof fs==="undefined"){return}if(isNaN(i)||isNaN(fs)){return}if(fr){i=i+fr.x;fs=fs+fr.y}return this._map.pixelToPoint(new cS(i,fs))},hide:function(){if(!this._map){return}this.inUse=false;if(this._maskElement){this._maskElement.style.display="none"}},getDom:function(e){if(!this._maskElement){this._createMask(e)}return this._maskElement},setCursor:function(e){this._cursor=e||"default";if(this._maskElement){this._maskElement.style.cursor=this._cursor}}};function aJ(){this._type="overlay"}aJ.inherits(y.BaseClass,"Overlay");aJ.getZIndex=function(i,e){i=i*1;if(!i){return 0}if(e){i=cU.convertMC2LL(new e7(0,i)).lat}return(i*-100000)<<1};y.extend(aJ.prototype,{_i:function(e){this._map=e;if(!this.domElement&&a9(this.initialize)){this.domElement=this.initialize(e);if(this.domElement){this.domElement.style.WebkitUserSelect="none"}}this.draw()},initialize:function(e){throw"initialize方法未实现"},draw:function(){throw"draw方法未实现"},remove:function(){this._map=null;if(this.domElement&&this.domElement.parentNode){this.domElement.parentNode.removeChild(this.domElement)}this.domElement=null;this.dispatchEvent(new aD("onremove"))},hide:function(){this._visible=false;y.hide(this.domElement)},show:function(){this._visible=true;y.show(this.domElement)},getMap:function(){return this._map},dispose:function(){y.BaseClass.prototype.decontrol.call(this)}});function bM(){y.BaseClass.call(this);aJ.call(this);this._visible=true;this._visibleInternal=true;this.infoWindow=null;this._dblclickTime=0}bM.inherits(aJ,"OverlayInternal");y.extend(bM.prototype,{initialize:function(e){this.map=e;y.BaseClass.call(this,this.hashCode);return null},draw:function(){},remove:function(){this.map=null;this.decontrol();aJ.prototype.remove.call(this)},hide:function(){this._visible=false},show:function(){this._visible=true},getDom:function(){return this.domElement},getContainer:function(){return this.domElement},setClassName:function(){},setConfig:function(i){if(!i){return}for(var e in i){if(i.hasOwnProperty(e)){this._config[e]=i[e]}}},getPoint:function(fp,fq){if(!fp){return this.point}else{var e=fq?fq.width:0;var fr=fq?fq.height:0;if(this.map){var i=this.map.pointToPixel(this.point);if(this._config&&this._config.offset){i.x=i.x+this._config.offset.width+e;i.y=i.y+this._config.offset.height+fr}else{i.x=i.x+e;i.y=i.y+fr}return this.map.pixelToPoint(i)}}},setZIndex:function(e){this.zIndex=e},isVisible:function(){if(!this.domElement){return false}return !!this._visible},enableMassClear:function(){this._config.enableMassClear=true},disableMassClear:function(){this._config.enableMassClear=false},showInternal:function(){this._visibleInternal=true},hideInternal:function(e){this._visibleInternal=false;this._hideInternalReason=e}});function dl(e){this.map=e;this._overlays={};this._overlayArray=[];this._customOverlays=[];e._overlays=this._overlays;e._overlayArray=this._overlayArray;e._customOverlays=this._customOverlays;this._zoomingOrMoving=false;this._init()}dl.prototype._init=function(){if(this.map._renderType!=="webgl"){this._createOverlayContainers()}else{this._createWebGLOverlayContainers()}this._bind()};dl.prototype._createOverlayContainers=function(){var e=this.map;e.temp.overlayDiv=e.overlayDiv=this._createOverlayDiv(e.platform,200);e.temp.overlayDivEx=e.overlayDivEx=this._createOverlayDiv(e.platform,50);e._panes.floatPane=this._createOverlayDiv(e.temp.overlayDiv,800);e._panes.markerMouseTarget=this._createOverlayDiv(e.temp.overlayDiv,700);e._panes.floatShadow=this._createOverlayDiv(e.temp.overlayDiv,600);e._panes.labelPane=this._createOverlayDiv(e.temp.overlayDiv,500);e._panes.markerPane=this._createOverlayDiv(e.temp.overlayDiv,400);if(e.isCanvasMap()){e._panes.mapPane=this._createOverlayDiv(e.temp.overlayDivEx,50)}else{e._panes.mapPane=this._createOverlayDiv(e.temp.overlayDiv,200)}};dl.prototype._createWebGLOverlayContainers=function(){var e=this.map;e.temp.overlayDiv=e.overlayDiv=this._createOverlayDiv(e.platform,200);e._panes.floatPane=this._createOverlayDiv(e.temp.overlayDiv,800);e._panes.markerMouseTarget=this._createOverlayDiv(e.temp.overlayDiv,700);e._panes.floatShadow=this._createOverlayDiv(e.temp.overlayDiv,600);e._panes.labelPane=this._createOverlayDiv(e.temp.overlayDiv,500);e._panes.markerPane=this._createOverlayDiv(e.temp.overlayDiv,400)};dl.prototype._createOverlayDiv=function(e,fq){var fp=J("div");var i=fp.style;i.position="absolute";i.top=i.left=i.width=i.height="0";i.zIndex=fq;e.appendChild(fp);return fp};dl.prototype._bind=function(){var fr=this.map;var fq=this;function i(ft){fq.draw(ft)}if(fr._renderType!=="webgl"){fr.addEventListener("load",i);fr.addEventListener("moveend",i);fr.addEventListener("resize",i);fr.addEventListener("zoomend",i);fr.addEventListener("zooming_inner",i)}else{fr.on("update",i)}fr.addEventListener("zoomend",function(ft){if(this.mapType==="B_EARTH_MAP"){if(this._earth.getZoom()0;ft--){if(fq._customOverlays[ft].enableMassClear!==false){this.removeOverlay(fq._customOverlays[ft]);fq._customOverlays.splice(ft,1)}}});fr.addEventListener("infowindowopen",function(fu){var ft=this.infoWindow;if(ft){y.hide(ft.popDom);y.hide(ft.shadowDom)}});function fp(){if(this.getMapType()==="B_EARTH_MAP"||this._renderType==="webgl"){if(fq._zoomingOrMoving===false){this._panes.markerMouseTarget.style.display="none";fq._zoomingOrMoving=true}}}function e(fv){if(this.getMapType()==="B_EARTH_MAP"||this._renderType==="webgl"){if(fq._zoomingOrMoving===true){this._panes.markerMouseTarget.style.display="";fq._zoomingOrMoving=false;for(var fu=0;fu1){this._config.strokeOpacity=1}if(this._config.fillOpacity<0||this._config.fillOpacity>1){this._config.fillOpacity=1}if(this._config.strokeStyle!=="solid"&&this._config.strokeStyle!=="dashed"&&this._config.strokeStyle!=="dotted"){this._config.strokeStyle="solid"}this.domElement=null;this._bounds=new cy();this.points=[];this.greatCirclePoints=[];this._parseCache=[];this._holesCache=[];this._parseCacheGL=[];this._parseCacheGLRaw=[];this._areaCacheGL=[];this._strokeStyleInfoForGL=[[]];this._fillStyleInfoForGL="";this.vertexMarkers=[];this._temp={}}t.JOININDEX={miter:0,round:1,bevel:2};t.CAPINDEX={round:0,butt:1,square:2};t.inherits(bM,"Graph");t.getGraphPoints=function(i){var e=[];if(!i||i.length===0){return e}if(typeof i==="string"){var fp=i.split(";");y.each(fp,function(fr){var fq=fr.split(",");e.push(new e7(fq[0],fq[1]))})}if(i.constructor===Array&&i.length>0){e=i}return e};t.parseTolerance={0:[0.09,0.005,0.0001,0.00001],1:[9000,500,20,1]};y.extend(t.prototype,{initialize:function(e){this.map=e;return null},draw:function(){},setPoints:function(e){this._clearCache();this.points=t.getGraphPoints(e).slice(0);this._calcBounds()},setPath:function(e){this.setPoints(e)},_calcBounds:function(){if(!this.points){return}var e=this;e._bounds=new cy();if(!this.hasMultipleParts){y.each(this.points,function(i){e._bounds.extend(i)})}else{y.each(this.points,function(i){y.each(i,function(fp){e._bounds.extend(fp)})})}},getPoints:function(){return this.points},getPath:function(){return this.points},setPointAt:function(i,e){if(!e||!this.points[i]){return}this._clearCache();this.points[i]=new e7(e.lng,e.lat);this._calcBounds()},setOptions:function(i){i=i||{};for(var e in i){if(i.hasOwnProperty(e)){this._config[e]=i[e]}}},setStrokeColor:function(e){this._config.strokeColor=e},getStrokeColor:function(){return this._config.strokeColor},setStrokeLineCap:function(e){this._config.strokeLineCap=e},getStrokeLineCap:function(){return this._config.strokeLineCap},setStrokeLineJoin:function(e){this._config.strokeLineJoin=e},getStrokeLineJoin:function(){return this._config.strokeLineJoin},setStrokeWeight:function(e){if(e>0){this._config.strokeWeight=e}},getStrokeWeight:function(){return this._config.strokeWeight},setStrokeOpacity:function(e){if(!e||e>1||e<0){return}this._config.strokeOpacity=e},getStrokeOpacity:function(){return this._config.strokeOpacity},setFillOpacity:function(e){if(e>1||e<0){return}this._config.fillOpacity=e},getFillOpacity:function(){return this._config.fillOpacity},setStrokeStyle:function(e){if(e!=="solid"&&e!=="dashed"&&e!=="dotted"){return}this._config.strokeStyle=e},getStrokeStyle:function(){return this._config.strokeStyle},setFillColor:function(e){this._config.fillColor=e||""},getFillColor:function(){return this._config.fillColor},getBounds:function(){this._bounds.setMinMax();return this._bounds},remove:function(){if(this.map){this.map.removeEventListener("onmousemove",this._graphMouseEvent)}bM.prototype.remove.call(this);this._clearCache();var e=new aD("onlineupdate");e.action="remove";e.overlay=this;this.fire(e)},enableEditing:function(){this._config.enableEditing=true},disableEditing:function(){this._config.enableEditing=false},getLength:function(){if(typeof this._length==="number"){return this._length}if(typeof this._config.totalLength==="number"){this._length=this._config.totalLength;return this._length}var fp=0;if(this.points.length<=1){this._length=0;return fp}for(var e=0;e0){fr=this.greatCirclePoints}var fs=this.getParseTolerance(e.getZoom(),e.config.coordType);if(!this.hasMultipleParts){var fv=fg(fr,fs)}else{var fv=[];for(var fp=0;fp1&&this.srcSetObject["2x"]){return this.srcSetObject["2x"]}return this.imageUrl};eT.prototype.setPrintImageUrl=function(e){if(!e){return}this.printImageUrl=e};eT.prototype.setSize=function(e){if(!e){return}this.size=new cK(e.width,e.height);this._renderData=null};eT.prototype.setOffset=function(e){if(!e){return}this.anchor=this.offset=new cK(e.width,e.height);this._renderData=null};eT.prototype.setAnchor=function(e){this.setOffset(e)};eT.prototype.setImageOffset=function(e){if(!e){return}this.imageOffset=new cK(e.width,e.height);this._renderData=null};eT.prototype.setInfoWindowOffset=function(e){if(!e){return}this.infoWindowOffset=new cK(e.width,e.height)};eT.prototype.setImageSize=function(e){if(!e){return}this.imageSize=new cK(e.width,e.height)};eT.prototype.setImageSrcset=function(fp){var e="";if(!fp){return}for(var i in fp){if(fp.hasOwnProperty(i)){this.srcSetObject[i]=fp[i];e=fp[i]+" "+i+","}}this.srcSet=e};eT.prototype.toString=function(){return"Icon"};eT.prototype.generateRenderData=function(){var i=this.offset;var e=this.size;var fq=this.imageOffset;var fp=[];fp.push(-i.width,i.height-e.height,0);fp.push(e.width-i.width,i.height-e.height,0);fp.push(e.width-i.width,i.height,0);fp.push(-i.width,i.height-e.height,0);fp.push(e.width-i.width,i.height,0);fp.push(-i.width,i.height,0);return{vertex:fp}};eT.prototype.getRenderData=function(){if(!this._renderData){this._renderData=this.generateRenderData()}return this._renderData};function Y(fp,i){y.BaseClass.call(this);this.content=fp;this.map=null;this._config={width:0,height:0,maxWidth:600,offset:new cK(0,0),title:"",maxContent:"",enableMaximize:false,enableAutoPan:true,enableCloseOnClick:true,margin:[10,10,40,10],collisions:[[10,10],[10,10],[10,10],[10,10]],ifMaxScene:false,onClosing:function(){return true}};this.setConfig(i);if(this._config.width!=0){if(this._config.width<220){this._config.width=220}if(this._config.width>730){this._config.width=730}}if(this._config.height!=0){if(this._config.height<60){this._config.height=60}if(this._config.height>650){this._config.height=650}}if(this._config.maxWidth!=0){if(this._config.maxWidth<220){this._config.maxWidth=220}if(this._config.maxWidth>730){this._config.maxWidth=730}}this.isWinMax=false;this.IMG_PATH=ds.imgPath;this.overlay=null;var e=this;cL.load("infowindow",function(){e._draw()})}Y.inherits(y.BaseClass,"InfoWindow");y.extend(Y.prototype,{setWidth:function(e){e=e*1;if(!e&&e!=0||isNaN(e)||e<0){return}if(e!=0){if(e<220){e=220}if(e>730){e=730}}this._config.width=e},setHeight:function(e){e=e*1;if(!e&&e!=0||isNaN(e)||e<0){return}if(e!=0){if(e<60){e=60}if(e>650){e=650}}this._config.height=e},setMaxWidth:function(e){e=e*1;if(!e&&e!=0||isNaN(e)||e<0){return}if(e!=0){if(e<220){e=220}if(e>730){e=730}}this._config.maxWidth=e},setTitle:function(e){this._config.title=e||""},setContent:function(e){this.content=e||""},setMaxContent:function(e){this._config.maxContent=e||""},redraw:function(){},enableAutoPan:function(){this._config.enableAutoPan=true},disableAutoPan:function(){this._config.enableAutoPan=false},enableCloseOnClick:function(){this._config.enableCloseOnClick=true},disableCloseOnClick:function(){this._config.enableCloseOnClick=false},enableMaximize:function(){this._config.enableMaximize=true},disableMaximize:function(){this._config.enableMaximize=false},show:function(){this._visible=true},hide:function(){this._visible=false},close:function(){this.hide()},dispose:function(){y.BaseClass.prototype.decontrol.call(this)},maximize:function(){this.isWinMax=true},restore:function(){this.isWinMax=false},setConfig:function(i){if(!i){return}for(var e in i){if(typeof(this._config[e])==typeof(i[e])){this._config[e]=i[e]}}},isVisible:function(){return this.isOpen()},isOpen:function(){return false},getPoint:function(){if(this.overlay&&this.overlay.getPoint){return this.overlay.getPoint()}},getOffset:function(){return this._config.offset},dispose:function(){y.BaseClass.prototype.decontrol.call(this)},toString:function(){return"InfoWindow"}});bY.prototype.openInfoWindow=function(fq,e){if(!fq||fq.toString()!="InfoWindow"||!e||e.toString()!="Point"){return}var i=this.temp;if(!i.marker){var fp=new eT(ds.imgPath+"blank.gif",{width:1,height:1});i.marker=new cc(e,{icon:fp,width:1,height:1,offset:new cK(0,0),infoWindowOffset:new cK(0,0),clickable:false});i.marker._fromMap=1}else{i.marker.setPoint(e)}this.addOverlay(i.marker);i.marker.show();i.marker.openInfoWindow(fq)};bY.prototype.closeInfoWindow=function(){var e=this.temp.infoWin||this.temp._infoWin;if(e&&e.overlay){e.overlay.closeInfoWindow()}};bM.prototype.openInfoWindow=function(e){if(this.map){this.map.closeInfoWindow();e._visible=true;this.map.temp._infoWin=e;e.overlay=this;y.BaseClass.call(e,e.hashCode)}};bM.prototype.closeInfoWindow=function(){if(this.map&&this.map.temp._infoWin){this.map.temp._infoWin._visible=false;this.map.temp._infoWin.decontrol();this.map.temp._infoWin=null}};function ak(fp,i){bM.call(this);this.content=fp;this.map=null;this.domElement=null;this._config={width:0,offset:new cK(0,0),styles:{backgroundColor:"#fff",border:"1px solid #f00",padding:"1px",whiteSpace:"nowrap",fontSize:"12px",zIndex:"80",MozUserSelect:"none"},point:null,enableMassClear:true};i=i||{};this.setConfig(i);if(this._config.width<0){this._config.width=0}this.point=this._config.point;var e=this;cL.load("marker",function(){e._draw()})}ak.inherits(bM,"Label");y.extend(ak.prototype,{setPoint:function(e){if(e&&e.toString()==="Point"&&!this.getMarker()){this.point=this._config.point=new e7(e.lng,e.lat)}},setContent:function(e){this.content=e},setOpacity:function(e){if(e>=0&&e<=1){this._config.opacity=e}},setOffset:function(e){if(!e||e.toString()!=="Size"){return}this._config.offset=new cK(e.width,e.height)},getOffset:function(){return this._config.offset},setStyle:function(e){e=e||{};this._config.styles=y.extend(this._config.styles,e)},setStyles:function(e){this.setStyle(e)},setTitle:function(e){this._config.title=e||""},getTitle:function(){return this._config.title},setMarker:function(e){if(this._marker&&this._marker!==e){this._marker._config.label=null}this._marker=e;if(e){this.point=this._config.point=e.getPoint()}else{this.point=this._config.point=null}},getMarker:function(){return this._marker||null}});window.BMAP_ANIMATION_DROP=1;window.BMAP_ANIMATION_BOUNCE=2;function cc(e,i){bM.call(this);i=i||{};this.point=e;this.latLng=cU.convertMC2LL(e);this._rotation=0;this.map=null;this._animation=null;this.domElement=null;this.iconDom=null;this.infoWindowDom=null;this.siblingElement=null;this.textureCoord=null;this.textureCoordGLMap=null;this.collisionDetectionFailed=false;this._config={offset:new cK(0,0),opacity:1,icon:null,title:"",infoWindow:null,label:null,baseZIndex:0,clickable:true,zIndexFixed:false,isTop:false,enableMassClear:true,enableDragging:false,raiseOnDrag:false,restrictDraggingArea:false,startAnimation:"",enableCollisionDetection:false,rank:0,enableDraggingMap:false};this.setConfig(i);if(!i.icon){this._config.icon=new eT(ds.imgPath+"marker_red.png",new cK(23,25),{offset:new cK(10,25),infoWindowOffset:new cK(10,0)})}this._isDragging=false;var fp=this;cL.load("marker",function(){fp._draw()})}cc.TOP_ZINDEX=aJ.getZIndex(-90)+1000000;cc.DRAG_ZINDEX=cc.TOP_ZINDEX+1000000;cc._injectMethond=function(e){y.extend(cc.prototype,e)};cc.inherits(bM,"Marker");y.extend(cc.prototype,{setIcon:function(e){if(e){this._config.icon=e;this.textureCoord=this.textureCoordGLMap=null}},getIcon:function(){return this._config.icon},setLabel:function(e){if(!e){return}this._config.label=e;e._config.enableMassClear=this._config.enableMassClear;e.setPoint(this.point)},getLabel:function(){return this._config.label},enableDragging:function(){this._config.enableDragging=true},disableDragging:function(){this._config.enableDragging=false},setPoint:function(e){if(e){this.point=this._config.point=new e7(e.lng,e.lat);this.latLng=cU.convertMC2LL(e)}},setPosition:function(e){this.setPoint(e)},getPosition:function(){return this.getPoint()},setTop:function(i,e){this._config.isTop=!!i;if(i){this._addi=e||0}},setTitle:function(e){this._config.title=e||""},getTitle:function(){return this._config.title},setOffset:function(e){if(e){this._config.offset=e}},getOffset:function(){return this._config.offset},setAnimation:function(e){this._animation=e},setRank:function(e){this._config.rank=e},getRank:function(){return this._config.rank},setRotation:function(e){while(e<0){e+=360}this._rotation=e%360},getRotation:function(){return this._rotation}});function a(fp,e){t.call(this,e);this.setPoints(fp);var i=this;cL.load("poly",function(){i._draw()})}a.inherits(t,"Polyline");function dF(e,fp){t.call(this,fp);this._normalizedBounds=new cy();this.setPoints(e);var i=this;cL.load("poly",function(){i._draw()})}dF.inherits(a,"PolylineMultipart");y.extend(dF.prototype,{setPoints:function(e){if(!e){return}this._clearCache();this.points=this._unifyArgs(e);this._calcBounds()},_unifyArgs:function(fp){var e=[];var i=[];if(fp.constructor===Array){if(fp[0].constructor===e7){i.push(fp)}else{i=fp}}else{if(typeof fp==="string"){i.push(fp)}}y.each(i,function(fq){e.push(t.getGraphPoints(fq))});return e},setPointAt:function(i,e,fp){fp=fp||0;if(!e||!this.points[fp]||!this.points[fp][i]){return}this._clearCache();this.points[fp][i]=new e7(e.lng,e.lat);this._calcBounds()},getBounds:function(e){if(!e){this._bounds.setMinMax();return this._bounds}this._normalizedBounds.setMinMax();return this._normalizedBounds},_calcBounds:function(){if(!this.points){return}var e=this;e._bounds.setNorthEast(null);e._bounds.setSouthWest(null);if(e.greatCirclePoints&&e.greatCirclePoints.length>0){y.each(e.greatCirclePoints,function(i){e._bounds.extend(i)})}else{y.each(e.points,function(i){y.each(i,function(fp){e._bounds.extend(fp)})})}e._normalizedBounds.setSouthWest(e._bounds.getSouthWest());e._normalizedBounds.setNorthEast(e._bounds.getNorthEast());if(e._normalizedBounds.sw.lng<-bY.WORLD_SIZE_MC_HALF||e._normalizedBounds.ne.lng>bY.WORLD_SIZE_MC_HALF){e._normalizedBounds.sw.lng=-bY.WORLD_SIZE_MC_HALF;e._normalizedBounds.ne.lng=bY.WORLD_SIZE_MC_HALF}}});function an(fp,e){t.call(this,e);e=e||{};if(typeof e.fillOpacity==="number"){this._config.fillOpacity=e.fillOpacity}else{this._config.fillOpacity=0.6}dQ(this._config.fillOpacity,0,1);if(e.fillColor===""){this._config.fillColor=""}else{this._config.fillColor=e.fillColor?e.fillColor:"#fff"}this._parseFillCacheWebGL=[];this.setPoints(fp,e);var i=this;cL.load("poly",function(){i._draw()})}an.inherits(t,"Polygon");y.extend(an.prototype,{setPoints:function(fs){var fq=[];if(typeof fs==="string"||fs[0] instanceof e7||this instanceof ed||fs.length===0){var e=this._processSinglePointArray(fs);this._userPoints=e.userPoints;fq=e.innerPoints;this.hasMultipleParts=false}else{this._userPoints=[];for(var fr=0;fr1&&!innerPoints[0].equals(innerPoints[innerPoints.length-1])){innerPoints.push(new e7(innerPoints[0].lng,innerPoints[0].lat))}return{userPoints:i,innerPoints:innerPoints}},setPointAt:function(i,e){if(!this._userPoints[i]){return}this._userPoints[i]=new e7(e.lng,e.lat);this.points[i]=new e7(e.lng,e.lat);if(i===0&&!this.points[0].equals(this.points[this.points.length-1])){this.points[this.points.length-1]=new e7(e.lng,e.lat)}this._calcBounds()},getPoints:function(){var e=this._userPoints;if(e.length===0){e=this.points}return e},getPath:function(){return this.getPoints()}});function ed(i,e,fp){this.point=i;this.radius=Math.abs(e);an.call(this,[],fp)}ed.parseTolerance={0:[0.01,0.0001,0.00001,0.000004],1:[1000,10,1,0.4]};ed.inherits(an,"Circle");y.extend(ed.prototype,{initialize:function(e){this.map=e;this.points=this._getPerimeterPoints(this.point,this.radius);this._calcBounds();return null},getPoint:function(){return this.point},setPoint:function(e){if(!e){return}this.point=e},setCenter:function(e){var i=arguments[1];this.setPoint(e,i)},setRadius:function(e){this.radius=Math.abs(e)},getCenter:function(){return this.point},getRadius:function(){return this.radius},_getPerimeterPoints:function(e,fx){if(!e||!fx||!this.map){return[]}var fp=this.map;var fu=e.lng;var fs=e.lat;var fD=cU.convertMC2LL(e);fu=fD.lng;fs=fD.lat;var fE=[];var fz=fx/cU.EARTHRADIUS;var fw=(Math.PI/180)*fs;var fC=(Math.PI/180)*fu;for(var fv=0;fv<360;fv+=9){var ft=(Math.PI/180)*fv;var fA=Math.asin(Math.sin(fw)*Math.cos(fz)+Math.cos(fw)*Math.sin(fz)*Math.cos(ft));var fy=Math.atan2(Math.sin(ft)*Math.sin(fz)*Math.cos(fw),Math.cos(fz)-Math.sin(fw)*Math.sin(fA));var fB=((fC-fy+Math.PI)%(2*Math.PI))-Math.PI;var fr=new bV(fA*(180/Math.PI),fB*(180/Math.PI));fE.push(cU.convertLL2MC(fr))}var fq=fE[0];fE.push(new e7(fq.lng,fq.lat));if(fq){this._radiusMercator=Math.sqrt(Math.pow(fq.lng-this.point.lng,2)+Math.pow(fq.lat-this.point.lat,2))}else{this._radiusMercator=this.radius}return fE}});var aU={};function fi(fp,i){y.BaseClass.call(this);this.content=fp;this.map=null;this._config={width:0,height:0,maxWidth:600,offset:new cK(0,0),title:"",maxContent:"",enableMaximize:false,enableAutoPan:true,enableCloseOnClick:true,margin:[10,10,40,10],collisions:[[10,10],[10,10],[10,10],[10,10]],ifMaxScene:false,onClosing:function(){return true}};this.setConfig(i);if(this._config.width<50){this._config.width=50}if(this._config.width>730){this._config.width=730}if(this._config.height!=0){if(this._config.height<50){this._config.height=50}if(this._config.height>650){this._config.height=650}}if(this._config.maxWidth!==0){if(this._config.maxWidth<50){this._config.maxWidth=50}if(this._config.maxWidth>730){this._config.maxWidth=730}}this.isWinMax=false;this.IMG_PATH=ds.imgPath;this.overlay=null;var e=this;cL.load("simpleInfowindow",function(){e._draw()})}fi.inherits(y.BaseClass,"SimpleInfoWindow");y.extend(fi.prototype,{setWidth:function(e){e=e*1;if(!e&&e!=0||isNaN(e)||e<0){return}if(e!=0){if(e<50){e=50}if(e>730){e=730}}this._config.width=e},setHeight:function(e){e=e*1;e-=10;if(!e&&e!=0||isNaN(e)||e<0){return}if(e!=0){if(e<50){e=50}if(e>650){e=650}}this._config.height=e},setMaxWidth:function(e){e=e*1;if(!e&&e!=0||isNaN(e)||e<0){return}if(e!=0){if(e<50){e=50}if(e>730){e=730}}this._config.maxWidth=e},setTitle:function(e){this._config.title=e||""},setContent:function(e){this.content=e||""},setMaxContent:function(e){this._config.maxContent=e||""},redraw:function(){},enableAutoPan:function(){this._config.enableAutoPan=true},disableAutoPan:function(){this._config.enableAutoPan=false},enableCloseOnClick:function(){this._config.enableCloseOnClick=true},disableCloseOnClick:function(){this._config.enableCloseOnClick=false},enableMaximize:function(){this._config.enableMaximize=true},disableMaximize:function(){this._config.enableMaximize=false},show:function(){this._visible=true},hide:function(){this._visible=false},close:function(){this.hide()},dispose:function(){y.BaseClass.prototype.decontrol.call(this)},maximize:function(){this.isWinMax=true},restore:function(){this.isWinMax=false},setConfig:function(i){if(!i){return}for(var e in i){if(typeof(this._config[e])==typeof(i[e])){this._config[e]=i[e]}}},isVisible:function(){return this.isOpen()},isOpen:function(){return false},getPoint:function(){if(this.overlay&&this.overlay.getPoint){return this.overlay.getPoint()}},getOffset:function(){return this._config.offset},dispose:function(){y.BaseClass.prototype.decontrol.call(this)},toString:function(){return"SimpleInfoWindow"}});bY.prototype.openSimpleInfoWindow=function(fq,e){if(!fq||fq.toString()!="SimpleInfoWindow"||!e||e.toString()!="Point"){return}var i=this.temp;if(!i.marker){var fp=new eT(ds.imgPath+"blank.gif",{width:1,height:1});i.marker=new cc(e,{icon:fp,width:1,height:1,offset:new cK(0,0),infoWindowOffset:new cK(0,0),clickable:false});i.marker._fromMap=1}else{i.marker.setPoint(e)}this.addOverlay(i.marker);i.marker.show();i.marker.openSimpleInfoWindow(fq)};bY.prototype.closeSimpleInfoWindow=function(){var e=this.temp.infoWin||this.temp._infoWin;if(e&&e.overlay){e.overlay.closeSimpleInfoWindow()}};bM.prototype.openSimpleInfoWindow=function(e){if(this.map){this.map.closeSimpleInfoWindow();e._visible=true;this.map.temp._infoWin=e;e.overlay=this;y.BaseClass.call(e,e.hashCode)}};bM.prototype.closeSimpleInfoWindow=function(){if(this.map&&this.map.temp._infoWin){this.map.temp._infoWin._visible=false;this.map.temp._infoWin.decontrol();this.map.temp._infoWin=null}};function cS(e,i){e=isNaN(e)?0:e;i=isNaN(i)?0:i;this.x=e;this.y=i}cS.prototype.equals=function(e){if(!e){return false}return e.x===this.x&&e.y===this.y};cS.prototype.clone=function(){return new cS(this.x,this.y)};cS.prototype.toString=function(){return"Pixel"};function cK(i,e){if(typeof i!=="number"){this.width=parseFloat(i)}else{this.width=i}if(typeof e!=="number"){this.height=parseFloat(e)}else{this.height=e}}cK.prototype.equals=function(e){return !!(e&&this.width===e.width&&this.height===e.height)};cK.prototype.toString=function(){return"Size"};var a0={B_NORMAL_MAP:{tileUrls:cX(ds.tileDomain,ds.rasterTilePath),vectorTileUrls:cX(ds.tileDomain,ds.vectorTilePath),tileSize:256,baseUnits:256,zoomLevelMin:3,zoomLevelMax:19,minDataZoom:3,maxDataZoom:19,minZoom:3,maxZoom:19,webgl:{minZoom:3,maxZoom:25},zoomLevelBase:18,errorUrl:ds.imgPath+"bg.png",bounds:new cy(new e7(-21364736,-11708041.66),new e7(23855104,12474104.17)),imgExtend:"png"},B_SATELLITE_MAP:{tileUrls:["https://maponline0.bdimg.com/starpic/?qt=satepc&","https://maponline1.bdimg.com/starpic/?qt=satepc&","https://maponline2.bdimg.com/starpic/?qt=satepc&","https://maponline3.bdimg.com/starpic/?qt=satepc&"],tileSize:256,baseUnits:256,zoomLevelMin:3,zoomLevelMax:19,minDataZoom:3,maxDataZoom:19,minZoom:3,maxZoom:19,zoomLevelBase:18,errorUrl:ds.imgPath+"bg.png",bounds:new cy(new e7(-21364736,-10616832),new e7(23855104,15859712)),imgExtend:"png"},B_STREET_MAP:{tileUrls:cX(ds.tileDomain,ds.rasterTilePath),tileSize:256,baseUnits:256,zoomLevelMin:3,zoomLevelMax:19,minDataZoom:3,maxDataZoom:19,minZoom:3,maxZoom:19,zoomLevelBase:18,errorUrl:ds.imgPath+"bg.png",bounds:new cy(new e7(-21364736,-10616832),new e7(23855104,15859712)),imgExtend:"png"},BMAP_CUSTOM_LAYER:{tileUrls:[""],tileSize:256,baseUnits:256,zoomLevelMin:1,zoomLevelMax:19,minDataZoom:3,maxDataZoom:19,minZoom:3,maxZoom:19,zoomLevelBase:18,errorUrl:ds.imgPath+"blank.gif",bounds:new cy(new e7(-21364736,-10616832),new e7(23855104,15859712)),imgExtend:"png"},B_EARTH_MAP:{tileUrls:[""],tileSize:256,baseUnits:256,zoomLevelMin:3,zoomLevelMax:19,minDataZoom:3,maxDataZoom:19,minZoom:3,maxZoom:19,webgl:{minZoom:3,maxZoom:21},zoomLevelBase:18,errorUrl:ds.imgPath+"blank.gif",bounds:new cy(new e7(-21364736,-10616832),new e7(23855104,15859712)),imgExtend:"png"}};var bg=a0;function a7(fv,i,fr,fp,fq){this.mgr=fv;this.position=fr;this._cbks=[];this.name=fv.getTileName(fp,fq,fv.map.config.style);this.info=fp;this._transparentPng=fq.isTransparentPng();var fw=J("img");b9(fw);fw.galleryImg=false;var fu=fw.style;fu.position="absolute";fu.width=fv.tileSize+"px";fu.height=fv.tileSize+"px";fu.left=fr[0]+"px";fu.top=fr[1]+"px";this.img=fw;this.src=i;if(O&&fr._offsetX===0){fu.opacity=0;fu.willChange="opacity"}var ft=this;this.img.onload=function(fE){if(!ft.mgr){return}var fz=ft.mgr;var fx=fz.bufferTiles;if(fz.bufferNumber>0){fx[ft.name]=ft;fx.push(ft.name)}var fB=fx.length-fz.bufferNumber;for(var fC=0;fB>0&&fC0&&this._transparentPng){this.img.src=ds.imgPath+"blank.gif"}else{this.img.src=this.src}};a7.prototype._callCbks=function(){var fp=this;for(var e=0;e8);function dz(e){this.tileLayers=[];this.map=e;this.bufferNumber=300;this.mapTiles=[];this.bufferTiles=[];this.config=bg[this.map.mapType];this.errorUrl=this.config.errorUrl;this.tileSize=this.config.tileSize;this.baseUnits=this.config.baseUnits;this.baseZoomLevel=this.config.zoomLevelBase;this.tileURLs=this.config.tileUrls;this.imgNumber=0;this.numLoading=0;this.temp={}}aK.register(function(i){if(i._renderType==="webgl"){return}var e=i.tileMgr=new dz(i);i.addEventListener("mousewheel",function(fp){e.mouseWheel(fp)});i.addEventListener("dblclick",function(fp){e.dblClick(fp)});i.addEventListener("rightdblclick",function(fp){e.dblClick(fp)});i.addEventListener("minuspress",function(fp){e.keypress(fp)});i.addEventListener("pluspress",function(fp){e.keypress(fp)});i.addEventListener("load",function(fp){if(this.mapType===ez){return}e.loadTiles()});i.addEventListener("zoomstartcode",function(fp){if(this.mapType===ez){return}e._zoom(fp)});i.addEventListener("moving",function(fp){if(this.mapType===ez){return}e.moveGridTiles()});i.addEventListener("resize",function(fp){if(this.mapType===ez){return}e.resizeMap(fp)});i.addEventListener("addtilelayer",function(fp){e.addTileLayer(fp)});i.addEventListener("removetilelayer",function(fp){e.removeTileLayer(fp)})});y.extend(dz.prototype,{addTileLayer:function(fq){var fp=this;var i=fq.target;fp.tileLayers.push(i);if(fp.map.loaded){fp.moveGridTiles()}},removeTileLayer:function(fx){var fy=this;var fv=fx.target;var ft=fv.mapType;var fs=fy.mapTiles;var fA=fy.bufferTiles;for(var fp in fA){var fq=fp.split("-")[1];if(fq==ft){delete fA[fp]}}for(var fp in fs){var fq=fp.split("-")[1];if(fq==ft){delete fs[fp]}}if(fy.zoomsDiv&&fy.zoomsDiv.parentNode){fy.zoomsDiv.parentNode.removeChild(fy.zoomsDiv);fy.zoomsDiv.innerHTML=""}var fr=fy.map;if(fr.deepZoom){var fz=fr.deepZoom.preDeepZoomDiv;if(fz&&fz.parentNode){fz.parentNode.removeChild(fz)}}for(var fw=0,fu=fy.tileLayers.length;fw=1.5?2:1;this.normalUdt=af("ditu","normal").udt;this.numLoading=0;this.useThumbData=false;if(this.baseLayer){this.useThumbData=true}if(typeof this.opts.customLayer==="boolean"){this.customLayer=this.opts.customLayer}else{this.customLayer=true}}bJ.inherits(cN,"TileLayer");y.extend(bJ.prototype,{isTransparentPng:function(){return this.transparentPng},getTilesUrl:function(fx,e){var fp=bg[this.mapType];if(typeof fp!=="object"){return null}var fq=fx.x;var fy=fx.y;if(this.mapType!==bU){var fy=cH.calcLoopParam(fy,e).col}var i="";if(this.opts.tileUrlTemplate){i=this.opts.tileUrlTemplate;i=i.replace(/\{X\}/,fy);i=i.replace(/\{Y\}/,fq);i=i.replace(/\{Z\}/,e)}else{if(this.mapType===C){var fw=this.isCanvasMap?0:1;var fs=fp.tileUrls[Math.abs(fy+fq)%fp.tileUrls.length];if(window.offLineIPAddress){fs=window.offLineIPAddress+"tile5/"}var fr=this.map.config.style;i=fs+"?qt=vtile&x="+fq+"&y="+fy+"&z="+e+(fr==="default"?"":("&styleId="+ds.mapStyleNameIdPair[fr]))+"&styles=pl&udt="+this.normalUdt+"&scaler="+this.scaler+"&showtext="+fw;i=i.replace(/-(\d+)/gi,"M$1")}if(this.mapType===bU){var ft=af("ditu","satellite");var fv=ft.ver;var fu=ft.udt;i=fp.tileUrls[Math.abs(fy+fq)%fp.tileUrls.length]+"u=x="+fq+";y="+fy+";z="+e+";v="+fv+";type=sate&fm=46&udt="+fu;i=i.replace(/-(\d+)/gi,"M$1")}}return i},initialize:function(fr){this.map=fr;if(fr._renderType==="webgl"){var fq=null;if(this.customLayer!==false){fq=this.getTilesUrl}y.extend(this,dZ);this.labelProcessor=new b8(this);this.callbackDataQueue=[];if(fq){this.getTilesUrl=fq}var e=this;fr.on("indoor_data_refresh",function(fs){if(!e.baseLayer){return}e._refreshIndoorData(fs.uid,fs.floor)});fr.on("custom_labels_ready",function(fs){if(!e.baseLayer){return}e.clearAllCollisionsCache();e._doWorkAfterLabelImageLoad(fs.virtualTile,fs.labelCanvas,null,fs.imgKey)});fr.on("glmoduleloaded",function(){if(!e.baseLayer){return}e.updateAllIconsTextureCoords()})}if(!fr.temp.layerZIndex){fr.temp.layerZIndex=0}this.zIndex=this.zIndex||0;if(this.baseLayer){this.zIndex=0}if(!fr.temp.layid){fr.temp.layid=0}if(!this.opts.mapType){this.mapType="BMAP_CUSTOM_LAYER_"+fr.temp.layid;fr.temp.layid++}else{this.mapType=this.opts.mapType}var i=bg[this.mapType];if(!i){bg[this.mapType]={tileUrls:[],tileSize:256,baseUnits:256,zoomLevelMin:1,zoomLevelMax:19,minZoom:3,maxZoom:19,minDataZoom:3,maxDataZoom:19,zoomLevelBase:18,errorUrl:ds.imgPath+"/blank.gif",bounds:new cy(new e7(-21364736,-10616832),new e7(23855104,15859712)),imgExtend:"png"}}if(fr._renderType!=="webgl"){var fp=ct(fr.platform,'
');fp.style.display="";fp.style.left=Math.ceil(-fr.offsetX+fr.width/2)+"px";fp.style.top=Math.ceil(-fr.offsetY+fr.height/2)+"px";this.tilesDiv=fp}this.isCanvasMap=fr.isCanvasMap();this.lastZoom=fr.getZoom()},remove:function(){if(this.tilesDiv&&this.tilesDiv.parentNode){this.tilesDiv.innerHTML="";this.tilesDiv.parentNode.removeChild(this.tilesDiv)}delete this.tilesDiv},getCopyright:function(){return this.copyright},getMapType:function(){return this.mapType},setZIndex:function(e){this.zIndex=e;if(this.tilesDiv){this.tilesDiv.style.zIndex=e}}});function bW(i,e,fp){this.bounds=i;this.content=e;this.mapType=fp}bW.inherits(cN,"Copyright");var en={get:function(e){if(!en.singleton){en.singleton=new U(e)}return en.singleton}};function U(i){this._map=i;this._tileMgr=i.tileMgr;this._animationDiv=null;this._preAnimationDiv=null;this._animation=null;this._baseLayerDiv=null;this._transformStyleName=aC.ifSupportCSS3("transform",true);this._transformOriginStyleName=aC.ifSupportCSS3("transformOrigin",true);this._preZoomTimes=1;this._preRenderTick=1;this._enableCanvas2dMap=!!(i.getRenderType()==="canvas");this._isIE9=!!(y.Browser.ie===9);var e=this;i.addEventListener("maptypechange",function(){e.hide()});i.addEventListener("load",function(){e.hide()})}y.extend(U.prototype,{prepareLayer:function(){var fq=this._map;var e=this._tileMgr;this._canvas2dMapMgr=fq.canvas2dMapMgr;var fp=this._baseLayerDiv=e.tilesDiv;if(!this._animationDiv){var i=this._preAnimationDiv;if(i){i.parentNode&&i.parentNode.removeChild(i);this._preAnimationDiv=null}this._preAnimationDiv=this._animationDiv=fp.cloneNode(true);fq.platform.insertBefore(this._animationDiv,fq.platform.firstChild)}this.show()},prepareAniParam:function(){var fq=this._animationDiv;if(!fq){return}var e=fq.children.length;var fp;this._zoomAniInfo=[];for(var fr=e-1;fr>-1;fr--){var fs={};fp=fq.children[fr].style;fs.top=parseInt(fp.top,10);fs.left=parseInt(fp.left,10);this._zoomAniInfo[fr]=fs}},prepareLabelLayer:function(){var fr=this._map;if(this._enableCanvas2dMap&&fr.canvas2dMapMgr){if(this.touchZoomLabelCanvas){this.touchZoomLabelCanvas.parentNode.removeChild(this.touchZoomLabelCanvas)}var i=fr.canvas2dMapMgr._labelCanvas;this.touchZoomLabelCanvas=i.cloneNode(false);var e=this.touchZoomLabelCanvas.getContext("2d");e.drawImage(i,0,0);fr.platform.insertBefore(this.touchZoomLabelCanvas,fr.platform.firstChild);var fq=parseInt(i.style.left,10);var fp=parseInt(i.style.top,10);this.touchZoomLabelCanvas.style.zIndex=9;this.touchZoomLabelCanvas.style[this._transformOriginStyleName]=(this._fixPosition.x-(fr.offsetX+fq))+"px "+(this._fixPosition.y-(fr.offsetY+fp))+"px";i.style.visibility="hidden"}},show:function(){if(this._animationDiv){this._animationDiv.style.visibility=""}},showLabel:function(){var i=this._map;if(this._enableCanvas2dMap&&i.canvas2dMapMgr){var e=i.canvas2dMapMgr._labelCanvas;if(e){e.style.visibility=""}if(this.touchZoomLabelCanvas){this.touchZoomLabelCanvas.style.zIndex=-2;this.touchZoomLabelCanvas.style.visibility="hidden"}}},hide:function(){if(this._animationDiv){this._animationDiv.style.visibility="hidden"}if(this._preAnimationDiv){this._preAnimationDiv.style.visibility="hidden"}},hideNonAnimationLayers:function(){var fq=this._map;if(fq.getRenderType()==="dom"){if(fq.overlayDiv){fq.overlayDiv.style.visibility="hidden"}if(fq.overlayDivEx){fq.overlayDivEx.style.visibility="hidden"}}var fs=fq.tileMgr.tileLayers;var fr;for(var fp=0,e=fs.length;fp-1;fz--){var fx=this._zoomAniInfo[fz];fy=fq.children[fz].style;var fr=fx.left-fu.x;var fp=fx.top-fu.y;fx.dx=fr*e-fr;fx.dy=fp*e-fp;fx.preDx=fr-fr;fx.preDy=fp-fp;fG=fx.preDx+(fx.dx-fx.preDx);fv=fx.preDy+(fx.dy-fx.preDy)+fw;fy.left=fx.left+fG+"px";fy.top=fx.top+fv+"px";fy.width=fy.height=256*e+"px"}if(this._enableCanvas2dMap){var fF=!fE._isIE9?"translate3d(0px, "+fw+"px, 0) scale("+e+")":"translate(0px, "+fw+"px) scale("+e+")";this.touchZoomLabelCanvas.style[fB]=fF}},setZoomFinish:function(){this._animationDiv=null},startAnimation:function(ft){this.prepareLayer();this.hideNonAnimationLayers();var fM=this._map;if(this.touchZoomLabelCanvas){this.touchZoomLabelCanvas.style.display="none"}ft=ft||{};var fK=ft.zoomCount||0;var fy=ft.fixPosition;var fI=ft.fixMCPosition;var fw=ft.pixOffset;this._zoomCount=fK;var fq=fM.getZoom();var fL=fq+fK;var e=fM.config.enableContinuousZoom;var fC=0.5;var fx=5;var fp=Math.pow(2,fK);var fO=this._baseLayerDiv;var fz={x:fy.x-parseInt(fO.style.left,10)-fM.offsetX,y:fy.y-parseInt(fO.style.top,10)-fM.offsetY};var fu=this._animationDiv;var fG=fu.children.length;var fQ=this._preZoomTimes;var fJ=[];var fH=this._transformStyleName;var fv=this._transformOriginStyleName;for(var fF=fG-1;fF>-1;fF--){var fD={};var fE=fu.children[fF].style;fD.top=parseInt(fE.top,10);fD.left=parseInt(fE.left,10);var fs=fD.left-fz.x;var fr=fD.top-fz.y;fD.dx=fs*fp-fs;fD.dy=fr*fp-fr;fD.preDx=fs*fQ-fs;fD.preDy=fr*fQ-fr;fJ[fF]=fD}var fN=this;var fB;var fP;var fA;this._zoomAni=new m({fps:60,duration:e?500:1,transition:function(i){i=i*fx/(2*fC);return fx*i-fC*i*i},render:function(fZ){fZ=fZ*(4*fC)/(fx*fx);fB=fQ+fZ*(fp-fQ);var fS=fq+c5(fB);var fX=null;var fW=0;var f0=0;if(ft.onAnimationBeforeLooping){var f1=ft.onAnimationBeforeLooping(fZ,fS);fX=f1.loopingCenter;fW=f1.yDiff;f0=f1.totalYDiff}for(var fT=fJ.length-1;fT>-1;fT--){var fU=fJ[fT];if(fu.children[fT]){var fY=fu.children[fT].style;fP=fU.preDx+(fU.dx-fU.preDx)*fZ-fw.width*fZ;fA=fU.preDy+(fU.dy-fU.preDy)*fZ-fw.height*fZ+fW;fY.left=fU.left+fP+"px";fY.top=fU.top+fA+"px";fY.height=fY.width=256*fB+"px"}}var fR=fw.width*fZ;var fV=fw.height*fZ;if(fM.isRestrict){fN._enableCanvas2dMap&&fN._canvas2dMapMgr.clearLabel()}else{fN._enableCanvas2dMap&&fN._canvas2dMapMgr.drawLabel(fB,fy,fq,fL,fK,fZ,fR,fV,f0,fW)}fN._preZoomTimes=fB;fN._preRenderTick=fZ;ft.onAnimationLooping&&ft.onAnimationLooping(fZ,fS,fX)},finish:function(){fN._preZoomTimes=1;fN._zoomAni=null;fN._animationDiv=null;ft.onAnimationFinish&&ft.onAnimationFinish();fN.showNonAnimationLayers()}});return this._zoomAni},stopAnimation:function(){if(this._zoomAni){this._zoomAni.stop();this._zoomAni=null}}});function c(e){this._initVars(e);this._initColorCanvas();this._bindEvent(e)}y.extend(c.prototype,{_initVars:function(e){this._map=e._map;this._canvas2dMapMgr=e;this._labelCtx=e._labelCtx;this.ratio=this._map.config.ratio;this.sizeRatio=this.ratio>1?2:1;this.RANK1=1000000;this.RANK2=2000000;this.RANK3=3000000;this.RANK4=4000000;this.RANK5=5000000},_initColorCanvas:function(){var i=256,fp=J("canvas"),e=fp.style;e.width=i+"px";e.height=i+"px";fp.width=i;fp.height=i;this._colorCvsSize=i;this._colorCvs=fp;this._colorCtx=fp.getContext("2d")},getLabelImageData:function(fD){var fC=fD.textImg;var fp=fD.textPos;var fA=this.ratio;var fy=this.sizeRatio/fA;var fr=this._colorCtx;var fv=this._colorCvsSize;fr.clearRect(0,0,fv,fv);var fx=0;var e=0;var fu=0;for(var fw=0;fwfx){fx=fp[fw].width;e=fw;fu=fp[fw].drawX}}fx/=fy;var fz=0;for(var fw=0,ft=fp.length;fwfx){fx=fB.width/fy}fz+=fB.height/fy+2*fA}var fq=fr.getImageData(0,0,fx,fz);var fs=fr.getImageData(0,0,fx,fz);return[fq,fs]},_bindEvent:function(i){var e=this,fp=i._map;fp.addEventListener("onspotmouseover",function(ft){if(!this.isCanvasMap()||!this.temp.isPermitSpotOver){return}if(ft.spots.length>0){var fs=ft.spots[0].userdata.uid;var fr=ft.spots[0].userdata.name;var fq=e.findLabelByUid(fs,fr);fq&&e._toHighLightColor(fq)}});fp.addEventListener("onspotmouseout",function(ft){if(!this.isCanvasMap()||!this.temp.isPermitSpotOver){return}if(ft.spots.length>0){var fs=ft.spots[0].userdata.uid;var fr=ft.spots[0].userdata.name;var fq=e.findLabelByUid(fs,fr);fq&&e._toDefaultColor(fq)}});fp.addEventListener("onspotclick",function(ft){if(!this.isCanvasMap()||!this.temp.isPermitSpotOver){return}if(ft.spots&&ft.spots.length>0){var fs=ft.spots[0].userdata.uid;var fr=ft.spots[0].userdata.name;var fq=e.findLabelByUid(fs,fr);fq&&e._changeBaseMapState(fq)}else{e._recoverNormalState()}});fp.on("spot_status_reset",function(){e._recoverNormalState()});fp.on("spot_highlight",function(fr){var fq=e.findLabelByUid(fr.uid);fq&&e._changeBaseMapState(fq)})},_getTextBound:function(fB){if(!fB.textPos){return null}var fz=this.ratio;var fx=this.sizeRatio/fz;var fp=fB.textPos;var fA=fB.baseDrawX;var fy=fB.baseDrawY;var fv=fA*fz+(fp[0].drawX-fA)/fx;var ft=fy*fz+(fp[0].drawY-fy)/fx;var fr=fv+fp[0].width/fx;var e=ft+fp[0].height/fx;for(var fw=0,fu=fp.length;fwfr){fr=fs+fC.width}if(fq+fC.height>e){e=fq+fC.height}}return[fv,ft,fr,e]},_toHighLightColor:function(fp){if(fp._tempRank&&fp._tempRank==this.RANK5){return}var fu=this._getTextBound(fp);if(!fu){return}var fq=Math.round(fu[0]);var i=Math.round(fu[1]);var e=this.getLabelImageData(fp);var fs=e[0];var fr=e[1];var ft=this._canvas2dMapMgr.getFilterImageData(fs,this.RANK5);fp._oldImgData=fr;this._labelCtx.putImageData(ft,fq,i)},_toDefaultColor:function(e){if(e._tempRank&&e._tempRank==this.RANK5){return}if(e._oldImgData){var i=this.sizeRatio;var fp=this._getTextBound(e);if(!fp){return}this._labelCtx.putImageData(e._oldImgData,Math.round(fp[0]),Math.round(fp[1]));e._oldImgData=null}},_changeBaseMapState:function(fq){var fp=this._canvas2dMapMgr;var i=fq.guid;var e=fq.guidExt;var fr={guid:i,name:fq.name,guidExt:e};fp._labelStrategy.setStrategyInfo(fr);fp._loadData()},_recoverNormalState:function(){var e=this._canvas2dMapMgr;e._labelStrategy.setStrategyInfo(null);e._loadData()},findLabelByUid:function(fs,fq){var fu=this._canvas2dMapMgr,e=fu._computedLabel;for(var fr=0,fp=e.length;frgu){gu=gx.drawX+gx.width}if(gx.drawY+gx.height>gt){gt=gx.drawY+gx.height}}}}}else{fy.tileX=fq;fy.tileY=fp;fF=fq+fy.minXOriginal;fD=fp+fy.minYOriginal;gu=fq+fy.maxXOriginal;gt=fp+fy.maxYOriginal}if(fF!=undefined){var gm=gj+(fF-gj)/gc;var gl=gi+(fD-gi)/gc;var fY=gj+(gu-gj)/gc;var fW=gi+(gt-gi)/gc;fy.minX=gm;fy.minY=gl;fy.maxX=fY;fy.maxY=fW;var gq=(gm+fY)/2,gp=(gl+fW)/2,f7=fE+(gq-gn/2)*fI,f5=fC+(f6/2-gp)*fI;fy.geoX=f7;fy.geoY=f5;f0.push(fy)}}}if(gB){for(var fX=0,fT=gB.length;fXgu){gu=fN+go.width}if(fB+go.height>gt){gt=fB+go.height}if(fH.length===2){var fM=fH[1];var fK=gj+fM.destX;var fA=gi+fM.destY;if(fAgu){gu=fK+fM.width}if(fA+fM.height>gt){gt=fA+fM.height}}gf._tempBounds=[fF,fD,gu,gt];var f4=fz.iconPos;var ft=f4.geoX;var fr=f4.geoY;var gj=(ft-fE)/fI+gn/2;var gi=(fC-fr)/fI+f6/2;var fF=gj+f4.destX;var fD=gi+f4.destY;var gu=fF+f4.width;var gt=fD+f4.height;fz.textPos=fz.textPos||fz._textPos;var fH=fz.textPos;var go=fH[0];var fN=gj+go.destX;var fB=gi+go.destY;if(fNgt){gt=fB+go.height}if(fH.length===2){var fM=fH[1];var fK=gj+fM.destX;var fA=gi+fM.destY;if(fKgt){gt=fA+fM.height}}fz._tempBounds=[fF,fD,gu,gt]}for(var fX=0,fT=gB.length;fXgz[2]||gv[3]gz[3])){fG++;if(f1.textPos){f1._textPos=f1.textPos;delete f1.textPos}}var gz=gA._tempBounds;if(!(gv[2]gz[2]||gv[3]gz[3])){fG++;if(gA.textPos){gA._textPos=gA.textPos;delete gA.textPos}}if(fG>=2){if(gr.textPos){gr._textPos=gr.textPos;delete gr.textPos}}}}for(var fX=0,fT=gB.length;fXgu){gu=go.drawX+go.width}if(go.drawY+go.height>gt){gt=go.drawY+go.height}if(fH.length===2){var fM=fH[1];fM.drawX=gj+fM.destX;fM.drawY=gi+fM.destY;if(fM.drawXgu){gu=fM.drawX+fM.width}if(fM.drawY+fM.height>gt){gt=fM.drawY+fM.height}}}var gm=gj+(fF-gj)/gc;var gl=gi+(fD-gi)/gc;var fY=gj+(gu-gj)/gc;var fW=gi+(gt-gi)/gc;f2.minX=gm;f2.minY=gl;f2.maxX=fY;f2.maxY=fW;var ge=(gm+fY)/2;var gd=(gl+fW)/2;var fu=fE+(ge-gn/2)*fI;var fs=fC+(f6/2-gd)*fI;f2.geoX=fu;f2.geoY=fs;f0.push(f2)}}var gg=this._strategyInfo;if(gg){var fZ=gg.guid;var f8=gg.name;var fP=gg.guidExt;for(var fX=0,fT=f0.length;fXf3.maxX-fV||gr.maxY-fVf3.maxY-fV)){gr.arrIntersectIndex.push(fU)}}}for(var fX=0,fT=f0.length;fXfv){var fp=ft.splice(0,fs);for(var fw=0,fu=fp.length;fw0){this.isDrawText=true}},_loadLabelData:function(fz,fy,fx,fp,fA,e){var fs=fz.toString();var fq=fy.toString();var fu="cbk_"+fs.replace("-","_")+"_"+fq.replace("-","__")+"_"+Math.floor(fx);var fE=c3+"."+fu;var fD=this._labelDataUrls;var fw=Math.abs(fz+fy)%fD.length;var fJ=fD[fw];if(window.offLineIPAddress){fJ=window.offLineIPAddress+"pvd/"}var i=this.labelStyleParam;var fC="?qt=vtile";var fF="";if(this._map.config.style!=="default"){fF="&styleId="+ds.mapStyleNameIdPair[this._map.config.style]}var fB="x={x}&y={y}&z={z}&udt={udt}&v={v}&styles={styles}"+fF+"&textonly=1&textimg=1&scaler={scaler}&fn="+encodeURIComponent(fE);var fG=cH.calcLoopParam(fz,fx).col;var fv=this.ratio>1?2:1;var ft=fB.replace(/{x}/,fG).replace(/{y}/,fy).replace(/{z}/,Math.floor(fx)).replace(/{styles}/,i).replace(/{udt}/,this._udt).replace(/{v}/,this._version).replace(/{scaler}/,fv);var fr=fJ+fC+"¶m="+window.encodeURIComponent(el(ft));var fI=this;var fH=fI._map;aK[fu]=function(fK){fI._vectorDrawLib.parseLabelData(fK,fz,fy,fx,fp,fA,function(fP){var fM=fH.getCenter();var fQ=fH.getZoom();var fS="viewKey_"+Math.floor(fM.lng)+"_"+Math.floor(fM.lat)+"_"+fQ;fI._labelCount--;var fT=fI._getCache(fz,fy,fx,fp).updateLabelCounter;fI._labelCount-=fT;var fN=fI._curViewLabels;if(fS===e||(fI._labelCount<0&&fQ===fx)){fN.push(fP)}if(fS===e){fI.statResponseCount++}if(fI._labelCount<=0){var fL=(new Date()).getTime();fI.updateLabel();var fO=(new Date()).getTime();var fR=new aD("oncanvasmaploaded");fR.drawTime=fO-fL;if(fI.statResponseCount===fI.statRequestCount){fR.isAllLoadedDrawing=true}fH.dispatchEvent(fR)}fI._setCacheValue(fz,fy,fx,fp,fP);delete aK[fu]})};e1.load(fr)},drawLabel:function(fp,fq,fx,i,fv,fr,e,fs,fw,ft){var fu=this;if(!fu._computedLabel){return}if(fu._computedLabel._zoom!==fx){fu.clearLabel();return}fu._map.temp.isPermitSpotOver=false;fu.clearLabel();fu._vectorDrawLib.zoomingIconAndText(this._labelCtx,fu._computedLabel,fp,fq,i,fv,fr,e,fs,fw,ft)},_addSpotData:function(){this._spotData=[];var fx=this._map.getZoom();for(var fs=0,fr=this._computedLabel.length;fsfx)){continue}var ft=[];ft[0]=(fu.minX-fu.maxX)/2;ft[1]=(fu.minY-fu.maxY)/2;ft[2]=(fu.maxX-fu.minX)/2;ft[3]=(fu.maxY-fu.minY)/2;var fq=null;if(fu.iconPos){fq=new e7(fu.iconPos.geoX,fu.iconPos.geoY)}var fp=fu.name?fu.name.replace("\\\\","
"):"";if(fu.iconPos&&fu.iconPos.iconType.indexOf("ditie")>-1&&this._map.getZoom()>14){fp=""}var fw={n:fp,pt:new e7(fu.geoX,fu.geoY),userdata:{iconPoint:fq,uid:fu.guid,name:fp,type:fu.iconPos?fu.iconPos.iconType:"",iconImg:fu.iconImg,mapPoi:true,adver_log:fu.adver_log||""},bd:ft,tag:"MAP_SPOT_INFO"};this._spotData.push(fw)}var fv=new aD("onspotsdataready");fv.spots=this._spotData;this._map._spotDataOnCanvas=this._spotData;this._map.dispatchEvent(fv)},isClickableLabel:function(e){if(e.isDel||(!e.guid&&!e.name)){return false}return true},getFilterImageData:function(fp,ft){var fu=fp.data,fs=this._labelStrategy,ft=parseInt(ft);for(var fv=0,fr=fu.length;fv0&&!fy){continue}var fC=Math.round(fL[0]/100);var fB=Math.round(fL[1]/100);var fO={lng:fI+fC,lat:fH-(fF*fv-fB)};var ft=fC/fv;var fs=fF-fB/fv;var fG=fL[7]||"";var fT=fL[5];var fJ={type:"fixed",name:fG,textImg:fE,rank:fL[4],baseX:ft,baseY:fs,iconPos:null,textPos:null,guid:fL[3]||"",tracer:fP,direction:fT,startScale:3};if((fT!==cC&&fy||!fy)&&fS!==null){fJ.iconPos=this._getIconPosition(fS,fx,ft,fs,fO);if(fJ.iconPos){fp=fJ.iconPos.width;fD=fJ.iconPos.height}}if(fp===0){fJ.direction=cC}if(fy){fJ.textPos=this._getTextDrawData(fL,ft,fs,fp,fD)}if(fJ.textPos||fJ.iconPos){fK.push(fJ)}}}},_isVisible:function(e,i){var fq;if(!this._binaryCache[e]){fq=e.toString(2);if(fq.length<8){fq=new Array(8-fq.length+1).join("0")+fq}this._binaryCache[e]=fq}fq=this._binaryCache[e];var fp=D[i].start;return fq[i-fp]==="1"},_getIconPosition:function(fu,fs,fp,i,e){var fq=this._map.config.style;var fv=aK["iconSetInfo"+fq][fu];if(!fv){if(fu.charCodeAt(0)>=48&&fu.charCodeAt(0)<=57){fv=aK["iconSetInfo"+fq]["_"+fu]}}if(!fv){return null}var fr=fv[0];var ft=fv[1];fr=fr*fs;ft=ft*fs;return{srcX:0,srcY:0,destX:fp-fr/2,destY:i-ft/2,width:fr,height:ft,geoX:e.lng,geoY:e.lat,mcPt:e,iconType:fu}},_getTextDrawData:function(fB,fA,fz,fq,fx){var fG=fB[5];if(typeof fG!=="number"){fG=0}var fv=this.ratio;var fu=fv/2;fq*=fu;fx*=fu;var fw=fB[12];var fr=fw.length;var fJ=0;var fI=0;var fF=[];var fE=0;var fH=0;for(var fD=0;fD0&&e>0){fF.push({srcX:fs,srcY:i,destX:fJ,destY:fI,width:fp,height:e})}}if(fF.length>0){return fF}return null},_getLineLabelInfo:function(fy,fq,fr,fN,f0,fF,fL,fK,fM,fE){if(fy.length!==10){return}var fP=this.ratio;var fp=this.ratio;var fW=fy[7].length;var fG=fy[1];var fY=fy[3];var f4=fy[8];var fu=fy[4];var e=2;var fs=fu.slice(0,e);for(var f1=e;f1fC){fC=f8+ft}if(f7+fw>fB){fB=f7+fw}}fH.push({angle:fA,srcX:fv,srcY:fx,destX:f8,destY:f7,width:ft,height:fw})}var fX={type:"line",textImg:fq,rank:fG,baseX:fU,baseY:fS,arrWordPos:fH,minXOriginal:fQ,minYOriginal:fO,maxXOriginal:fC,maxYOriginal:fB,text:""};fE.push(fX)}},alterColor:function(ft,e,fs){var fp=this._colorCtx,i=this._canvas2dMapMgr;fp.clearRect(0,0,ft.width,ft.height);fp.drawImage(e,ft.srcX,ft.srcY,ft.width,ft.height,0,0,ft.width,ft.height);var fr=fp.getImageData(0,0,ft.width,ft.height),fq=i.getFilterImageData(fr,fs);fp.putImageData(fq,0,0)},drawIconAndText:function(fF,fE,e){var fw=this.ratio;var fu=this.sizeRatio/fw;var fy=2/fw;var fQ=this;for(var fI=0,fG=fE.length;fI10&&fL<350){fF.save();var fO=Math.round(fR+fK.width/2);var fN=Math.round(fP+fK.height/2);fF.translate(fO,fN);fF.rotate(-fL/180*Math.PI);fF.drawImage(fC,fK.srcX,fK.srcY,fK.width,fK.height,-Math.round(fK.width/2),-Math.round(fK.height/2),fK.width/fu,fK.height/fu);fF.restore()}else{fF.drawImage(fC,fK.srcX,fK.srcY,fK.width,fK.height,fR,fP,fK.width/fu,fK.height/fu)}}}}}},isCollide:function(fs,fB,fA,e,fu,fp,fw){for(var fr=0,fq=fp.length;frfv[1]+fv[3]+fz||fA+fufv[2]+fv[4]+fy)){return true}}}return false},zoomingIconAndText:function(fQ,fK,fq,fO,fP,gh,fX,fy,f3,fW,fH){var gi=this.ratio;var fz=this.sizeRatio/gi;var gj=2/gi;var gt=gi/2;var gd=fO.x;var gc=fO.y;var fR=2*gi;if(fH!==0){gc+=fW}var fC=undefined,fv=undefined,fs=undefined,fx=undefined,fG=undefined;var f2=gh>0?true:false;if(!f2){fC=[];var f6=1-fX}for(var gp=0,gn=fK.length;gp10&&fN<350){var gf=f8+gg.width/2;var ge=f7+gg.height/2;var fr=fN/180*Math.PI;var fU=Math.cos(fr);var fD=Math.sin(fr);var f5=fU;var fE=fU;var f4=fD;var fF=-fD;var fM=gf-gf*fU-ge*fD;var e=ge+gf*fD-ge*fU;fQ.save();fQ.transform(f5,fF,f4,fE,fM,e);fQ.drawImage(ft,gg.srcX,gg.srcY,fx,fG,fv,fs,fx/fz,fG/fz);fQ.restore()}else{fQ.drawImage(ft,gg.srcX,gg.srcY,fx,fG,fv,fs,fx/fz,fG/fz)}!f2&&fC.push([gp,fv,fs,fx,fG])}}fQ.restore()}}}});function eH(e){this.initVars(e)}y.extend(eH.prototype,{initVars:function(e){this._map=e._map;this._canvas2dMapMgr=e;this.base64Prefix="data:image/png;base64,";this.bizData=null;this.objTextsPng=null;this.arrIconsPng=null;this.bizLabels=null},proecessBizData:function(fs,fw){var fu=this;this.bizData=fs;this.objTextsPng=null;this.arrIconsPng=null;var fp=fs.textsPng;var fy=fs.iconsPng;if(!fp||!fy){return}var fv=new Image();fv.onload=function(){fu.objTextsPng=this;fu.calcIconAndTextInfo(fw);this.onload=null};fv.src=this.base64Prefix+fp;var fx=fy.length;var e=[];for(var fr=0;frfu.width||i>fu.height)&&(e>fu.width||fy>fu.height)){return false}return true},_setPlatformPosition:function(fx,fw,fz){fz=fz||{};if(fx===0&&fw===0&&!fz.point){return}if(isNaN(fz.initMapOffsetX)){fz.initMapOffsetX=this.offsetX}if(isNaN(fz.initMapOffsetY)){fz.initMapOffsetY=this.offsetY}var ft=cu(this._heading);if(this._tilt>0){fw=fw/Math.cos(cu(this._tilt))}var fy=fx*Math.cos(ft)+fw*Math.sin(ft);var fv=-fx*Math.sin(ft)+fw*Math.cos(ft);fy=fy+fz.initMapOffsetX;fv=fv+fz.initMapOffsetY;if(fz.point){var i=this.restrictCenter(fz.point);if(!i.equals(this.centerPoint)){this.centerPoint=i.clone();this.fire(new aD("oncenter_changed"))}}else{var fq=this.offsetX-fy;var e=this.offsetY-fv;var fu=this.centerPoint.lng;var fs=this.centerPoint.lat;var fr=new e7(fu,fs);var fp=this.getZoomUnits();this.centerPoint=this.restrictCenter(new e7(fr.lng+fq*fp,fr.lat-e*fp),fp);this.fire(new aD("oncenter_changed"))}this.offsetX=fy;this.offsetY=fv;this.dispatchEvent(new aD("onmoving"))},restrictCenter:function(fq,fr){if(this.config.restrictCenter===false){return fq}fr=fr||this.getZoomUnits();var fp=this.pixelToPoint(new cS(0,0),{center:fq});var i=this.pixelToPoint(new cS(0,this.height),{center:fq});if(this.zoomLevel<5){if(fp.lat>bY.MAX_LAT&&i.latbY.MAX_LAT){fq.lat=bY.MAX_LAT-this.height/2*fr}else{if(i.latfr){this._tilt=fr}if(fB){if(this._heading%360!==0||this._tilt>0){var i=this._webglMapCamera.fromScreenPixelToMC(fp.x,fp.y,{center:fu,zoom:this.zoomLevel});if(i){var fy=i.sub(ft);var fq=fu.sub(fy);this.centerPoint=this.restrictCenter(fq)}}else{var fv=this.getZoomUnits();var fq=new e7(fB.lng-fv*(fp.x-this.width/2),fB.lat+fv*(fp.y-this.height/2));this.centerPoint=this.restrictCenter(fq,fv)}this.fire(new aD("oncenter_changed"))}this._checkFireZoomend();return}this._animationInfo.zoom={current:this.zoomLevel,diff:e-this.zoomLevel,target:e};var fz=this;fC.callback=function(){fz._checkFireZoomend()};var fA=this._tilt;if(this.fixPoint||fA>bY.MAX_DRAG_TILT_L2){fC.renderCallback=function(){var fG=fz.getCurrentMaxTilt();if(fz._tilt>fG){fz._tilt=fG}var fH=fz.fixPixel;if(!fz.fixPixel||!fz.fixPoint){return}var fD=fz.fixPixel;var fN=fz.fixPoint;var fK=fz.fixCenter;var fI=fz.mousePosMCPoint;if(fz._heading%360!==0||fz._tilt>0){var fE=fz._webglMapCamera.fromScreenPixelToMC(fD.x,fD.y,{center:fK,zoom:fz.zoomLevel,tilt:fz._tilt});if(fE){var fM=fE.sub(fI);var fF=fK.sub(fM);fz.centerPoint=fz.restrictCenter(fF)}}else{var fJ=fD;var fL=fz.getZoomUnits();var fF=new e7(fN.lng-fL*(fJ.x-fz.width/2),fN.lat+fL*(fJ.y-fz.height/2));fz.centerPoint=fz.restrictCenter(fF,fL)}fz.fire(new aD("oncenter_changed"))}}if(fC.fromMouseWheel===true){this._startInfiniteZoomAnimation(fC);return}this._startAnimation(fC)},_checkFireZoomend:function(){var e=this;if(e.fireZoomendTimer){clearTimeout(e.fireZoomendTimer)}e.fireZoomendTimer=setTimeout(function(){if(e.zoomEventStatus==="zooming"){e.fire(new aD("onzoomend"));e.zoomEventStatus="idle"}e.fireZoomendTimer=null},150)},deepZoomMedia:function(e){var i=this;if(!i.temp.isStdCtrlBusy){i.temp.isStdCtrlBusy=true;i.deepZoomTo(i.zoomLevel+e);setTimeout(function(){i.temp.isStdCtrlBusy=false},400)}},deepZoomTo:function(e){this.zoomTo(e)},flyTo:function(fp,fT,fE){fE=fE||{};if(this.centerPoint.equals(fp)&&this.zoomLevel===fT&&typeof fE.heading!=="number"&&typeof fE.tilt!=="number"){return}var e=this.getHeading()%360;var fw=this.getTilt();var fC=0;var fG=0;var fz=this.getBounds().containsPoint(fp);if(typeof fE.heading==="number"){fC=fE.heading}else{if(fz){fC=e}}if(typeof fE.tilt==="number"){fG=fE.tilt}else{if(fz){fG=fw}}this._heading=e;var fQ=fC-e;var fM=fG-fw;var fA=this;var fs=this.zoomLevel;var ft=1.42;var fI=this.zoomScale(fT-fs);var fV=this.getZoomUnits();var fy=this.centerPoint.div(fV);var fW=fp.div(fV);var fP=this.worldSize();var fL=ft;var fK=Math.max(this.width,this.height);var fJ=fK/fI;var fx=fW.sub(fy).mag();var i=fL*fL;function fS(fY){var fX=(fJ*fJ-fK*fK+(fY?-1:1)*i*i*fx*fx)/(2*(fY?fJ:fK)*i*fx);return Math.log(Math.sqrt(fX*fX+1)-fX)}function fq(fX){return(Math.exp(fX)-Math.exp(-fX))/2}function fu(fX){return(Math.exp(fX)+Math.exp(-fX))/2}function fD(fX){return fq(fX)/fu(fX)}var fv=fS(0);var fN=function(fX){return(fu(fv)/fu(fv+fL*fX))};var fO=function(fX){return fK*((fu(fv)*fD(fv+fL*fX)-fq(fv))/i)/fx};var fr=(fS(1)-fv)/fL;if(Math.abs(fx)<0.000001||fr===Infinity||isNaN(fr)){if(Math.abs(fK-fJ)<0.000001){if(fE.noZoomAnimation!==true){this._animationInfo.zoom={current:this.zoomLevel,diff:fT-this.zoomLevel}}this._animationInfo.center={current:this.centerPoint,diff:fp.sub(this.centerPoint)};this._animationInfo.heading={current:e,diff:fC-e};this._animationInfo.tilt={current:fw,diff:fG-fw};this.setLock(true);this._startAnimation({callback:function(fX){fA.setLock(false);if(fE.callback){fE.callback(fX)}},duration:fE.duration});return}var fU=fJ5){fR=(fr-5)/2+fR}}var fF=fE.duration||1000*fr/fR;if(isNaN(fF)){var fH={};for(var fB in fE){fH[fB]=fE[fB];fH.noAnimation=true}this.centerAndZoom(fp,fT,fH);return}this.fire(new aD("onmovestart"));this.fire(new aD("onzoomstart"));this.setLock(true);this._startAnimation({duration:fF,renderCallback:function(fX,fY){var fZ=fX*fr;var f2=fO(fZ);if(fE.noZoomAnimation!==true){var f1=fs+fA.scaleZoom(1/fN(fZ));if(f1fA.getMaxZoom()){f1=fA.getMaxZoom()}if(f1!==fA.zoomLevel){fA.zoomLevel=f1;fA.fire(new aD("onzoom_changed"))}}fA.centerPoint=fy.add(fW.sub(fy).mult(f2)).mult(fV);fA.fire(new aD("oncenter_changed"));if(typeof fC==="number"){var f0=fX/0.7;if(f0>1){f0=1}fA.setHeading(e+fQ*fX,{noAnimation:true})}if(typeof fG==="number"){fA.setTilt(fw+fM*fX,{noAnimation:true})}},callback:function(fX,fY){fA.setLock(false);if(fY&&fY.stop===true){fA.fire(new aD("onmoveend"));if(fE.noZoomAnimation!==true){fA.fire(new aD("onzoomend"))}fE.callback&&fE.callback(fX);return}if(fT!==fA.zoomLevel&&fE.noZoomAnimation!==true){fA.zoomLevel=fT;fA.fire(new aD("onzoom_changed"))}fA.fire(new aD("onmoveend"));if(fE.noZoomAnimation!==true){fA.fire(new aD("onzoomend"))}fE.callback&&fE.callback(fX)}})},zoomScale:function(e){return Math.pow(2,e)},scaleZoom:function(e){return Math.log(e)/Math.LN2},panTo:function(i,fp){fp=fp||{};if(!i||i.equals(this.centerPoint)){fp.callback&&fp.callback();return}var fq=this.pointToPixel(i);var e=Math.round(this.width/2);var fs=Math.round(this.height/2);var fr=this._ifUseAnimation(i,this.zoomLevel);if(fp.noAnimation===true||fr===false){this._stopAllAnimations();this._panTo(e-fq.x,fs-fq.y,i);fp.callback&&fp.callback();return}this.flyTo(i,this.zoomLevel,fp)},_panTo:function(i,e,fq){var fp=this.temp;if(fp.operating===true){return}if(fp.dragAni){fp.dragAni.stop(false,{readyToMove:true});fp.dragAni=null}this.dispatchEvent(new aD("onmovestart"));this._setPlatformPosition(i,e,{point:fq});this.dispatchEvent(new aD("onmoveend"))},panBy:function(i,e,fp){i=Math.round(i)||0;e=Math.round(e)||0;fp=fp||{};if(Math.abs(i)<=this.width&&Math.abs(e)<=this.height&&fp.noAnimation!==true){this._panBy(i,e,fp)}else{this._panTo(i,e,fp.point);fp.callback&&fp.callback()}},_panBy:function(i,e,fr){if(this.temp.operating===true){return}fr=fr||{};this.dispatchEvent(new aD("onmovestart"));var fq=this;var fp=fq.temp;fp.pl=fq.offsetX;fp.pt=fq.offsetY;if(fp.tlPan){fp.tlPan.cancel()}if(fp.dragAni){fp.dragAni.stop(false,{readyToMove:true});fp.dragAni=null}fp.tlPan=new m({fps:fr.fps||fq.config.fps,duration:fr.duration||fq.config.actionDuration,transition:fr.transition||bs.easeInOutQuad,render:function(fs){this.terminative=fq.temp.operating;if(fq.temp.operating){return}fq._setPlatformPosition(i*fs,e*fs,{initMapOffsetX:fp.pl,initMapOffsetY:fp.pt})},finish:function(fs){fq.dispatchEvent(new aD("onmoveend"));fq.temp.tlPan=false;if(fq.temp.stopArrow===true){fq.temp.stopArrow=false;if(fq.temp.arrow!==0){fq._arrow()}}}})},_startAnimation:function(i){var fr=this._animationInfo;var fp=this;i=i||{};if(fp._ani){fp._ani.stop(!!i.goToEnd,{stopCurrentAnimation:i.stopCurrentAnimation})}if(fp._infiniteAni){fp._infiniteAni.stop();fp._infiniteAni=null}var fs=i.duration||500;var ft=i.transition||bs.ease;var e=new aD("onanimation_start");this.fire(e);if(i.unstopable){fr=this._animationInfoUnstopable}var fq=new m({duration:fs,transition:ft,render:function(fw,fv){for(var fu in fr){if(!fr.hasOwnProperty(fu)){continue}var fy=fr[fu].current;var fx=fr[fu].diff;fp._setValueTick(fu,fy,fx,fw)}if(i.renderCallback){i.renderCallback(fw,fv)}},finish:function(fu){fp.fire(new aD("onanimation_end"));if(i.unstopable){fp._animationInfoUnstopable={};fp._unstopableAni=null}else{fp._ani=null;fp._animationInfo={}}if(i.mapNeedCbk){i.mapNeedCbk()}if(i.callback){i.callback(fu)}},onStop:function(fu){fu=fu||{};fp.fire(new aD("onanimation_end"));if(fu.stopCurrentAnimation){fp._animationInfo={}}fp._ani=null;if(i.mapNeedCbk){i.mapNeedCbk()}if(i.callback){i.callback(null,{stop:true})}}});if(i.unstopable){fp._unstopableAni=fq}else{fp._ani=fq}},_stopAllAnimations:function(e){e=e||{};if(this._ani){this._ani.stop(!!e.goToEnd,{stopCurrentAnimation:e.stopCurrentAnimation});this._ani=null}if(this._infiniteAni){this._infiniteAni.stop();this._infiniteAni=null}},_startInfiniteZoomAnimation:function(e){var i=this;if(i._ani){i._ani.stop(!!e.goToEnd,{stopCurrentAnimation:e.stopCurrentAnimation})}if(i._infiniteAni){return}this.fire(new aD("onanimation_start"));i._infiniteAni=new m({duration:10000,transition:bs.linear,render:function(){var fp=i._animationInfo.zoom;if(Math.abs(fp.current-fp.target)<0.001){i._setValue("zoom",fp.target);i._infiniteAni.stop();return}fp.current+=(fp.target-fp.current)*0.35;i._setValue("zoom",fp.current);if(e.renderCallback){e.renderCallback()}},finish:function(){i._infiniteAni=null;i._animationInfo={};i.fire(new aD("onanimation_end"));if(e.callback){e.callback()}},onStop:function(){i._infiniteAni=null;i._animationInfo={};i.fire(new aD("onanimation_end"));if(e.callback){e.callback()}}})},_setValue:function(e,fp){if(e==="zoom"){this._preZoomLevel=this.zoomLevel;var i=this._getProperZoom(fp);fp=i.zoom;if(fp!==this.zoomLevel){this.zoomLevel=fp;if(fp<5){this.restrictCenter(this.centerPoint)}this.fire(new aD("on"+e+"_changed"))}return}else{if(e==="center"){this.centerPoint=fp}}this["_"+e]=fp;this.fire(new aD("on"+e+"_changed"))},_setValueTick:function(e,fr,fq,i){if(e==="center"){var fp=new e7(fr.lng+fq.lng*i,fr.lat+fq.lat*i);this._setValue(e,fp);return}if(e==="zoom"){this._setValue(e,Math.pow(fr,1-i)*Math.pow(fr+fq,i));return}this._setValue(e,fr+fq*i)},setHeading:function(fq,i){i=i||{};if(fq===this._heading){i.callback&&i.callback();return}var fp=d6(this._heading,360);var e=d6(fq,360);if(e===fp){this._heading=fq;i.callback&&i.callback();return}if(i.noAnimation){this._setValue("heading",fq);i.callback&&i.callback();return}if(i.unstopable){this._animationInfoUnstopable.heading={current:this._heading,diff:fq-this._heading}}else{this._animationInfo.heading={current:this._heading,diff:fq-this._heading}}this._startAnimation(i)},resetHeading:function(e){var i=this._heading;while(i<0){i+=360}i=i%360;if(i>180){i-=360}this._heading=i;e=e||{};e.unstopable=true;this.setHeading(0,e)},getHeading:function(){return this._heading},setTilt:function(e,i){i=i||{};if(e===this._tilt){i.callback&&i.callback();return}if(e>bY.MAX_TILT){e=bY.MAX_TILT}if(i&&i.noAnimation){this._setValue("tilt",e);i.callback&&i.callback();return}this._animationInfo.tilt={current:this._tilt,diff:e-this._tilt};this._startAnimation(i)},getTilt:function(){return this._tilt},getCenter:function(){return this.centerPoint},getZoom:function(){return this.zoomLevel},getCameraPosition:function(fp){fp=fp||{};var e=fp.center||this.centerPoint;var fq=fp.zoom||this.zoomLevel;var ft=typeof fp.heading==="number"?fp.heading:this._heading;var i=typeof fp.tilt==="number"?fp.tilt:this._tilt;var fs=this._webglMapCamera.generateMVMatrix(e,fq,ft,i);var fr=mat4.create(Float32Array);mat4.invert(fr,fs);return this._webglMapCamera.getPosition(fr)}});function dX(i){this._jobQueue=[];this._idleOnlyJobQueue=[];var e=this;this.isIdle=true;i.on("updateframe",function(fq){var fp=12-fq.frameTime;fp=fp<1?1:fp;e.isIdle=false;if(e.idleWorkTimer){clearInterval(e.idleWorkTimer);e.idleWorkTimer=null}e.runJobs(fp)});this._idleWorkerTicker=(function(fp){return function(){if(fp.isIdle){fp.runJobs();fp.runIdleOnlyJobs()}}})(this);i.on("mapglidle",function(){e.isIdle=true;e.runJobs();e.runIdleOnlyJobs();e.idleWorkTimer=setInterval(e._idleWorkerTicker,dX.MAX_IDLE_TIME)})}dX.MAX_IDLE_TIME=50;dX.MAX_FRAME_TIME=6;dX.prototype.runJobs=function(i){if(this._jobQueue.length===0){return}var fq=dO();var e=0;i=i||dX.MAX_FRAME_TIME;while(this._jobQueue.length&&e0){fy=1/Math.sqrt(fy);fB[0]=fA[0]*fy;fB[1]=fA[1]*fy}return fB};fw.dot=function(fz,fy){return fz[0]*fy[0]+fz[1]*fy[1]};fw.cross=function(fA,fz,fy){var fB=fz[0]*fy[1]-fz[1]*fy[0];fA[0]=fA[1]=0;fA[2]=fB;return fA};fw.lerp=function(fA,fz,fy,fB){var fD=fz[0],fC=fz[1];fA[0]=fD+fB*(fy[0]-fD);fA[1]=fC+fB*(fy[1]-fC);return fA};fw.random=function(fy,fA){fA=fA||1;var fz=fr()*2*Math.PI;fy[0]=Math.cos(fz)*fA;fy[1]=Math.sin(fz)*fA;return fy};fw.transformMat2=function(fB,fA,fz){var fy=fA[0],fC=fA[1];fB[0]=fz[0]*fy+fz[2]*fC;fB[1]=fz[1]*fy+fz[3]*fC;return fB};fw.transformMat2d=function(fB,fA,fz){var fy=fA[0],fC=fA[1];fB[0]=fz[0]*fy+fz[2]*fC+fz[4];fB[1]=fz[1]*fy+fz[3]*fC+fz[5];return fB};fw.transformMat3=function(fB,fA,fz){var fy=fA[0],fC=fA[1];fB[0]=fz[0]*fy+fz[3]*fC+fz[6];fB[1]=fz[1]*fy+fz[4]*fC+fz[7];return fB};fw.transformMat4=function(fB,fA,fz){var fy=fA[0],fC=fA[1];fB[0]=fz[0]*fy+fz[4]*fC+fz[12];fB[1]=fz[1]*fy+fz[5]*fC+fz[13];return fB};fw.rotate=function(fB,fz,fy,fF){var fE=fz[0]-fy[0];var fD=fz[1]-fy[1];var fA=Math.sin(fF);var fC=Math.cos(fF);fB[0]=fE*fC-fD*fA+fy[0];fB[1]=fE*fA+fD*fC+fy[1];return fB};fw.forEach=(function(){var fy=fw.create();return function(fB,fF,fG,fE,fD,fz){var fC,fA;if(!fF){fF=2}if(!fG){fG=0}if(fE){fA=Math.min((fE*fF)+fG,fB.length)}else{fA=fB.length}for(fC=fG;fC0){fy=1/Math.sqrt(fy);fB[0]=fA[0]*fy;fB[1]=fA[1]*fy;fB[2]=fA[2]*fy}return fB};fv.dot=function(fz,fy){return fz[0]*fy[0]+fz[1]*fy[1]+fz[2]*fy[2]};fv.cross=function(fz,fE,fD){var fy=fE[0],fG=fE[1],fF=fE[2],fC=fD[0],fB=fD[1],fA=fD[2];fz[0]=fG*fA-fF*fB;fz[1]=fF*fC-fy*fA;fz[2]=fy*fB-fG*fC;return fz};fv.lerp=function(fA,fz,fy,fB){var fE=fz[0],fD=fz[1],fC=fz[2];fA[0]=fE+fB*(fy[0]-fE);fA[1]=fD+fB*(fy[1]-fD);fA[2]=fC+fB*(fy[2]-fC);return fA};fv.random=function(fy,fC){fC=fC||1;var fA=fr()*2*Math.PI;var fB=(fr()*2)-1;var fz=Math.sqrt(1-fB*fB)*fC;fy[0]=Math.cos(fA)*fz;fy[1]=Math.sin(fA)*fz;fy[2]=fB*fC;return fy};fv.transformMat4=function(fB,fA,fz){var fy=fA[0],fD=fA[1],fC=fA[2];fB[0]=fz[0]*fy+fz[4]*fD+fz[8]*fC+fz[12];fB[1]=fz[1]*fy+fz[5]*fD+fz[9]*fC+fz[13];fB[2]=fz[2]*fy+fz[6]*fD+fz[10]*fC+fz[14];return fB};fv.transformMat3=function(fB,fA,fz){var fy=fA[0],fD=fA[1],fC=fA[2];fB[0]=fy*fz[0]+fD*fz[3]+fC*fz[6];fB[1]=fy*fz[1]+fD*fz[4]+fC*fz[7];fB[2]=fy*fz[2]+fD*fz[5]+fC*fz[8];return fB};fv.transformQuat=function(fE,fK,fy){var fL=fK[0],fJ=fK[1],fI=fK[2],fG=fy[0],fF=fy[1],fD=fy[2],fH=fy[3],fB=fH*fL+fF*fI-fD*fJ,fA=fH*fJ+fD*fL-fG*fI,fz=fH*fI+fG*fJ-fF*fL,fC=-fG*fL-fF*fJ-fD*fI;fE[0]=fB*fH+fC*-fG+fA*-fD-fz*-fF;fE[1]=fA*fH+fC*-fF+fz*-fG-fB*-fD;fE[2]=fz*fH+fC*-fD+fB*-fF-fA*-fG;return fE};fv.rotateX=function(fA,fz,fy,fD){var fC=[],fB=[];fC[0]=fz[0]-fy[0];fC[1]=fz[1]-fy[1];fC[2]=fz[2]-fy[2];fB[0]=fC[0];fB[1]=fC[1]*Math.cos(fD)-fC[2]*Math.sin(fD);fB[2]=fC[1]*Math.sin(fD)+fC[2]*Math.cos(fD);fA[0]=fB[0]+fy[0];fA[1]=fB[1]+fy[1];fA[2]=fB[2]+fy[2];return fA};fv.rotateY=function(fA,fz,fy,fD){var fC=[],fB=[];fC[0]=fz[0]-fy[0];fC[1]=fz[1]-fy[1];fC[2]=fz[2]-fy[2];fB[0]=fC[2]*Math.sin(fD)+fC[0]*Math.cos(fD);fB[1]=fC[1];fB[2]=fC[2]*Math.cos(fD)-fC[0]*Math.sin(fD);fA[0]=fB[0]+fy[0];fA[1]=fB[1]+fy[1];fA[2]=fB[2]+fy[2];return fA};fv.rotateZ=function(fA,fz,fy,fD){var fC=[],fB=[];fC[0]=fz[0]-fy[0];fC[1]=fz[1]-fy[1];fC[2]=fz[2]-fy[2];fB[0]=fC[0]*Math.cos(fD)-fC[1]*Math.sin(fD);fB[1]=fC[0]*Math.sin(fD)+fC[1]*Math.cos(fD);fB[2]=fC[2];fA[0]=fB[0]+fy[0];fA[1]=fB[1]+fy[1];fA[2]=fB[2]+fy[2];return fA};fv.forEach=(function(){var fy=fv.create();return function(fB,fF,fG,fE,fD,fz){var fC,fA;if(!fF){fF=3}if(!fG){fG=0}if(fE){fA=Math.min((fE*fF)+fG,fB.length)}else{fA=fB.length}for(fC=fG;fC0){fy=1/Math.sqrt(fy);fC[0]=fB[0]*fy;fC[1]=fB[1]*fy;fC[2]=fB[2]*fy;fC[3]=fB[3]*fy}return fC};fu.dot=function(fz,fy){return fz[0]*fy[0]+fz[1]*fy[1]+fz[2]*fy[2]+fz[3]*fy[3]};fu.lerp=function(fA,fz,fy,fB){var fE=fz[0],fD=fz[1],fC=fz[2],fF=fz[3];fA[0]=fE+fB*(fy[0]-fE);fA[1]=fD+fB*(fy[1]-fD);fA[2]=fC+fB*(fy[2]-fC);fA[3]=fF+fB*(fy[3]-fF);return fA};fu.random=function(fy,fz){fz=fz||1;fy[0]=fr();fy[1]=fr();fy[2]=fr();fy[3]=fr();fu.normalize(fy,fy);fu.scale(fy,fy,fz);return fy};fu.transformMat4=function(fC,fB,fz){var fy=fB[0],fE=fB[1],fD=fB[2],fA=fB[3];fC[0]=fz[0]*fy+fz[4]*fE+fz[8]*fD+fz[12]*fA;fC[1]=fz[1]*fy+fz[5]*fE+fz[9]*fD+fz[13]*fA;fC[2]=fz[2]*fy+fz[6]*fE+fz[10]*fD+fz[14]*fA;fC[3]=fz[3]*fy+fz[7]*fE+fz[11]*fD+fz[15]*fA;return fC};fu.transformQuat=function(fE,fK,fy){var fL=fK[0],fJ=fK[1],fI=fK[2],fG=fy[0],fF=fy[1],fD=fy[2],fH=fy[3],fB=fH*fL+fF*fI-fD*fJ,fA=fH*fJ+fD*fL-fG*fI,fz=fH*fI+fG*fJ-fF*fL,fC=-fG*fL-fF*fJ-fD*fI;fE[0]=fB*fH+fC*-fG+fA*-fD-fz*-fF;fE[1]=fA*fH+fC*-fF+fz*-fG-fB*-fD;fE[2]=fz*fH+fC*-fD+fB*-fF-fA*-fG;return fE};fu.forEach=(function(){var fy=fu.create();return function(fB,fF,fG,fE,fD,fz){var fC,fA;if(!fF){fF=4}if(!fG){fG=0}if(fE){fA=Math.min((fE*fF)+fG,fB.length)}else{fA=fB.length}for(fC=fG;fC0){fp[0].sort(function(fr,fq){return fr.tileInfo.useZoom-fq.tileInfo.useZoom})}}});var dC=(function(){var fA=new Int8Array(4);var fp=new Int32Array(fA.buffer,0,1);var fv=new Float32Array(fA.buffer,0,1);function fC(fJ){fp[0]=fJ;return fv[0]}function i(fJ){fv[0]=fJ;return fp[0]}function fw(fJ){var fL=(fJ[3]<<24|fJ[2]<<16|fJ[1]<<8|fJ[0]);var fK=fC(fL&4278190079);return fK}var fr=0;var fu=1;var fy=2;var fG=0;var fD=1;var fB=2;var fs=9;function fz(fJ,fK){var fL;if(fK%2===0){fL=[-fJ[1],fJ[0]]}else{fL=[fJ[1],-fJ[0]]}return fL}function e(fJ,fK,fL){var fM=fz(fJ,fK);var fN;if(fL===fu){return fM}else{if(fK===4||fK===5){fN=[fM[0]-fJ[0],fM[1]-fJ[1]]}else{fN=[fM[0]+fJ[0],fM[1]+fJ[1]]}if(fL===fr){vec2.normalize(fN,fN)}return fN}}function fF(fK,fJ){return Math.sqrt(Math.pow(fK[0]-fJ[0],2)+Math.pow(fK[1]-fJ[1],2))}function fq(fN,fM,fL,fJ){var fK=vec2.dot(fN,fM);if(fL===fB||fL===fD){if((fJ===0||fJ===1)&&fK>0){return true}else{if((fJ===2||fJ===3)&&fK<0){return true}}}if((fJ===0||fJ===1)&&fK<0){return true}else{if((fJ===2||fJ===3)&&fK>0){return true}}return false}function fx(fK,fP,fR){var fQ=fz(fK,fP);var fM;var fO=fK;var fN=fR;var fT=[];vec2.normalize(fT,[fO[0]+fN[0],fO[1]+fN[1]]);var fS=vec2.dot(fQ,[-fT[1],fT[0]]);if(Math.abs(fS)<0.1){fS=1}var fL=1/fS;fM=[-fT[1]*fL,fT[0]*fL];var fJ=vec2.dot(fK,fM);if(fJ<0){vec2.negate(fM,fM)}return{cos2:fJ,offset:fM}}function fI(fK,fP,fR,fJ){var fQ=fz(fK,fP);var fO;var fN;var fM;if(fP===0||fP===1){fO=fR;fN=fK}else{fO=fK;fN=fR}if(!fO||!fN){return fQ}var fT=[fO[0]+fN[0],fO[1]+fN[1]];if(fT[0]===0&&fT[1]===0){vec2.normalize(fT,fN)}else{vec2.normalize(fT,fT)}var fU=fq(fT,fQ,fJ,fP);if(fU){return fQ}var fS=vec2.dot(fQ,[-fT[1],fT[0]]);if(Math.abs(fS)<0.1){fS=1}var fL=1/fS;fM=[-fT[1]*fL,fT[0]*fL];return fM}function fH(fU,fV,fO,fN,fW,fT,fM,fP,fL,fS){var fR;var fK=0;var fJ=false;fR=fT.length/fs-1;ft(fV[0],fU[0],fO[0],fW,fN,4,fP,fL,undefined,fT,fS);fR++;fK++;ft(fV[0],fU[0],fO[0],fW,fN,5,fP,fL,undefined,fT,fS);fR++;fK++;for(var fQ=0;fQ0){fQ+=fF(fU[fP],fU[fP-1]);fN.push(fQ*10)}if(fP!==fU.length-1){var fM=[fU[fP+1][0]-fU[fP][0],fU[fP+1][1]-fU[fP][1]];var fW=[];if(fM[0]===0&&fM[1]===0){fW=[0,0]}else{vec2.normalize(fW,fM)}fT[fT.length]=[fW[0],fW[1]]}}return fH(fT,fU,fN,fL,fV,fR,fJ,fw(fO),fK,fS)},toTileSolidLineVertices:function(fN,fK){var fL=new Float32Array(fN.length/fs*5);var fJ=new Int16Array(fL.buffer);var fP=0;var fM=0;for(var fO=0;fO0){this.zoomState=1}else{if(e<0){this.zoomState=-1}}this.lastZoom=i;return this.zoomState},releaseOutViewTileData:function(e){var fr=this.map._workerMgr.releasePendingData(e);for(var fq=0,fp=fr.length;fq=0.5){fK=true}else{if(fy<0.5&&e>=0.5){fK=true}else{if(fy>=0.5&&e<0.5){fK=true}}}if(fK){this.cacheDataCollideLabels(0)}this.LAST_CALC_ZOOM=fw}else{if(this.tileLabels.length>0){this.cacheDataCollideLabels(y.Browser.ie?50:30)}}},loadVectorLayerData:function(fw){this.map.temp.isPermitSpotOver=false;var fv=this;function fu(i,fx){var fz=fv.tileCache.getData(fx);if(!fz){return}if(!i||i.error){var fy=new aD("ontileloaderror");i=i||{};fy.error=i.error||"";fy.message=i.message||"";fv.map.fire(fy);fz.status="init";fz.reloadTimer=setTimeout(function(){if(fz.retry<3){fz.retry++;fz.status="loading";fv.loadVectorTileData(i.tileInfo,fu)}else{fv.tileCache.removeData(fx)}},4000);fv.map._featureMgr.clearData(fv.drawIndex);fv._checkTilesLoaded();fv.getVectorLayerDataFromCache(fv.curViewTilesInfo,fv.getZoomState());return}if(fz.reloadTimer){clearTimeout(fz.reloadTimer);fz.reloadTimer=null}fv.callbackDataQueue.push([i,fx]);if(fv.processDataTimer){return}fv.processDataTimer=setTimeout(function(){while(fv.callbackDataQueue.length>0){var fA=fv.callbackDataQueue.shift();fv.vectorTileDataCbk(fA[0],fA[1]);fv._checkTilesLoaded()}fv.map._featureMgr.clearData(fv.drawIndex);fv.getVectorLayerDataFromCache(fv.curViewTilesInfo,fv.getZoomState());fv.processDataTimer=null},200)}for(var ft=0,fr=fw.length;ft65536){fB.renderData.base.push({type:"line",data:[dC.toTileSolidLineVertices(fH,4000),new Uint16Array(fK)]});fH=[];fK=[]}for(var fA=0;fA0){fs=fr.labelProcessor.collisionTest(fs,-1)}}else{if(ft||fu){if(this._collisionTimer){if(!ft){clearTimeout(this._collisionTimer)}else{if(Date.now()-fr.lastCollisionTestTime>500){fr.lastCollisionTestTime=Date.now()}else{clearTimeout(this._collisionTimer)}}}this._collisionTimer=setTimeout(function(){fs=fr.labelProcessor.collisionTest(fr.tileLabels);if(fs){i.setLabelData(fs)}fr.updateLabels();fr.map.dispatchEvent(new aD("onrefresh"));fr._collisionTimer=null},60);return}else{fs=fr.labelProcessor.getCachedLabels(fr.tileLabels)}}if(fs){i.setLabelData(fs)}fr.updateLabels();fr.map.dispatchEvent(new aD("onrefresh"))}if(!fp){clearTimeout(fr.cacheLabelTimer);fq()}else{if(fr.cacheLabelTimer){return}fr.cacheLabelTimer=setTimeout(function e(){fq()},fp)}},dataBackCollideLabels:function(){var i=this;if((i.tileLabels&&i.tileLabels.length===0)){return}var e;i.labelProcessor.calcLabelsCollision(i.tileLabels);e=i.labelProcessor.getCachedLabels(i.tileLabels);if(e){i.map._featureMgr.setLabelData(e)}i.updateLabels();i.map.dispatchEvent(new aD("onrefresh"));if(ea()){this.labelProcessor._refreshSpotData()}},updateLabels:function(fr){var fs=this.map;var i=fs._featureMgr;var fp=i.getLabelData();if(fp.length>0){var fq=fs.getZoom();if(fp.labelZoom-fq<3){this.labelProcessor.updateLabels(fp);var e=this.labelProcessor.fixDataFormat(fp);i.setOverlayData(e[0],2);i.setOverlayData(e[1],3);i.setOverlayData(e[2],4)}else{i.clearLabelOverlayData()}fs.temp.isPermitSpotOver=false;this.labelProcessor.curSpotAdded=false}},loadRasterLayerData:function(fq,fu){if(fu){for(var fs=0,fr=fq.length;fs9&&!e.guid){return false}if(e.zoom<=9&&!e.name&&!e.guid){return false}return true}};var bi=5;var cC=4;var e5=3;var dA=2;var fj=1;var cG=0;function s(e){this._ratio=aA();this._iconCache={};this._map=e;this._drawingCanvasPool=[];this._drawingCanvasHeight=4096}y.extend(s.prototype,{_loadIcons:function(i,fu){var fs=0;var fr=this;var fp=this._map.config.style;for(var ft in i){fs++;var e=new Image();e.id=ft;e.crossOrigin="anonymous";e.onload=function(){fr._iconCache[this.id].loaded=true;fs--;if(fs===0){fu()}this.onload=null};e.onerror=function(){fr._iconCache[this.id]=null;fs--;if(fs===0){fu()}this.onerror=null};var fq=ds.getImageFullUrl(fp,ft+".png");e.src=fq;this._iconCache[ft]={loaded:false,image:e}}},_getEmptyDrawingCanvas:function(){for(var fp=0;fp0){while(fs0){fs=0;while(fs0){fs=0;while(fs0){var fK=this;this._loadIcons(fB,function(){fJ=fK._drawEachTypeOfLabels(fD,fC,fL,fv,fu,fz,fH);fL=fJ.curStyleId;fv=fJ.curX;fu=fJ.curY;fz=fJ.curLineHeight;var i=fK._generateEachLabelCanvas(e,fu,fy,fE,fp,fI);fq(i[0],i[1])});return}var fw=this._generateEachLabelCanvas(e,fu,fy,fE,fp,fI);fq(fw[0],fw[1])},drawCustomLabelsOnCanvas:function(ft,fz){if(ft.length===0){fz();return}var fp=0;var e=(ft[0].style.fontSize+(ft[0].style.haloSize||0)*2)||0;var fq=e;var fv=this._getEmptyDrawingCanvas();var fA=fv.getContext("2d");fA.clearRect(0,0,fv.width,fv.height);var fw={};var fy=-1;for(var fr=0;frthis._drawingCanvasHeight){return{curX:fq,curY:fp,curLineHeight:fr,curStyleId:fx}}}return{curX:fq,curY:fp,curLineHeight:fr,curStyleId:fx}},_drawIndoorTextLabelOnCanvas:function(fr){var e=this._getEmptyDrawingCanvas();var fy=e.getContext("2d");fy.clearRect(0,0,e.width,e.height);var fG=0;var fx=null;var fw=0;var fu;var fD={};var fC=[];for(var fs in fr){if(fs==="tileInfo"){continue}var fq=fr[fs];var fB=fq.defaultFloor;var fv=fq.floors;for(var fA=0;fA2){f3=2}var fP=[];var fE=[];var fL=0;if(fq&&!fq[f5]){fq[f5]={}}var fz=fA+f3*2;var fQ=fz;if(ft.containDescendings){fQ+=4}if(f3===0){fQ+=2}if(ft.textOnIcon){fQ=Math.max(fQ,ft.iconSize[1])}if(f5!==i||fQ>fO){i=f5;fF.font=fA+"px sans-serif";if(fQ>fO){var fM=fQ-fO;fO+=fM;fG+=fM}if(f3>0){fF.lineWidth=f3*2;fF.strokeStyle=fs}fF.fillStyle=fX}if(ft.type==="line"){var fv=fN.split("");for(var f6=0;f6512){fH=0;fG+=fQ;fO=fQ}if(fG>this._drawingCanvasHeight){return{curX:fH,curY:fG,curLineHeight:fO,styleId:f5}}var f0=fH;if(f3>0){fp+=f3;f0-=Math.round(f3/2);fF.strokeText(fZ,fH,fG)}fF.fillText(fZ,fH,fG);var fW=[fp,fQ];fI=[Math.round(fW[0]/2),Math.round(fW[1]/2)];fR=[f0,fG-fQ];fq[f5][fZ]={displaySize:fI,curWordPosition:fR,totalHeight:fL};fH+=fp+2}fP.push(fI);fE.push(fR)}fL=Math.round(fP[0][1])}else{if(fq[f5][fN]){var fB=fq[f5][fN];fP=fB.textSize;fE=fB.labelImagePosition;fL=fB.totalHeight}else{var fC=fN.split("\\");if(fC.length>1&&ft.textOnIcon){var f7=0;var f4=0;var f8=[];var fJ=8;for(var f6=0;f6f7){f7=fy}f8.push(Math.round(fy/2));f4+=fQ}var fw=f7+2*fJ;var f2=f4+2*fJ;if(fH+fw>512){fH=0;fG+=fO}fG+=f4-fQ+2*fJ;var fV=fH;var fK=fG-f2;var e=Math.round(fw/2);var fD=this._iconCache[ft.icon].image;this.drawStretchedIcon(fF,fD,[fV,fK],fJ,f7,f4);for(var f6=0;f6512){fH=0;fG+=fQ;fO=fQ}if(fG>this._drawingCanvasHeight){return{curX:fH,curY:fG,curLineHeight:fO,styleId:f5}}var fV=fH;var fK=fG-fQ;var fU=fH;var fT=fG;if(ft.containDescendings){fT-=4}if(ft.textOnIcon){var fD=this._iconCache[ft.icon].image;var fS=ft.iconSize;if(ft.styleId===519){fF.drawImage(fD,0,0,fS[0],fS[1],fV,fK,fS[0],fS[1])}else{this.draw3StretchedIcon(fF,fD,[fV,fK],fr,fy,fS[1])}fU+=fr;if(ft.iconSize[1]>fz){fT-=(ft.iconSize[1]-fz)/2-1}fw+=1}if(f3>0){fw+=f3;fV-=Math.round(f3/2);fF.strokeText(fN,fU,fT)}fF.fillText(fN,fU,fT);var fu=[fw,fQ];var fI=[Math.round(fu[0]/2),Math.round(fu[1]/2)];fP.push(fI);fE.push([fV,fK]);fL+=Math.round(fI[1]);fH+=fw}}fq[f5][fN]={textSize:fP,labelImagePosition:fE,totalHeight:fL}}}ft.textSize=fP;ft.labelImagePosition=fE;ft.totalHeight=fL;return{curX:fH,curY:fG,curLineHeight:fO,styleId:f5}},drawStretchedIcon:function(e,fp,fq,ft,fu,i){var fs=fq[0];var fr=fq[1];e.drawImage(fp,0,0,ft,ft,fs,fr,ft,ft);e.drawImage(fp,ft,0,1,ft,fs+ft,fr,fu,ft);e.drawImage(fp,fp.width-ft,0,ft,ft,fs+fu+ft,fr,ft,ft);e.drawImage(fp,0,ft,ft,1,fs,fr+ft,ft,i);e.drawImage(fp,ft,ft,1,1,fs+ft,fr+ft,fu,i);e.drawImage(fp,fp.width-ft,ft,ft,1,fs+fu+ft,fr+ft,ft,i);e.drawImage(fp,0,fp.height-ft,ft,ft,fs,fr+i+ft,ft,ft);e.drawImage(fp,ft,fp.height-ft,1,ft,fs+ft,fr+i+ft,fu,ft);e.drawImage(fp,fp.width-ft,fp.height-ft,ft,ft,fs+fu+ft,fr+i+ft,ft,ft)},draw3StretchedIcon:function(e,i,fp,fs,fu,ft){var fr=fp[0];var fq=fp[1];e.drawImage(i,0,0,fs,i.height,fr,fq,fs,i.height);e.drawImage(i,fs,0,1,i.height,fr+fs,fq,fu,i.height);e.drawImage(i,i.width-fs,0,fs,i.height,fr+fs+fu,fq,fs,i.height)},_updateFixedLabelCoords:function(fr,fG){if(fG===0){return}var fB=[];var fN=[];var fO=0;var fE=fr.totalHeight;var fW=fr.textSize.length;var fs=fr.direction;if(typeof fs!=="number"){fs=0}for(var fP=0;fPfp){fp=fA}if(fye){e=fy}}}if(fw.custom&&fw.style.iconSize&&!fw.name){var fx=fw.style.iconSize;var fz=fw.direction;switch(fz){case cC:fs=-Math.round(fx[0]/2);fq=-Math.round(fx[1]/2);fp=Math.round(fx[0]/2);e=Math.round(fx[1]/2);break;case dA:fs=-Math.round(fx[0]/2);fq=0;fp=Math.round(fx[0]/2);e=fx[1];break}}if(fw.textPos){var ft=fw.textPos["vertex"];for(var fv=0,fr=ft.length;fvfp){fp=fA}if(fye){e=fy}}}fw.bds=[fs,fq,fp,e]},_updateLineLabelCoords:function(fH,fx){if(fx===0){return}var fq=fH.wordsInfo;var fE=fH.wordCount;if(!fH.labelImagePosition){return}var fz=fH.labelImagePosition.slice(0);if(fH.reverse){fz.reverse()}var fQ=1000;var fN=1000;var fO=-1000;var fM=-1000;for(var fI=0;fIfO){fO=fG}if(fsfM){fM=fu}}fH.bds=[fQ,fN,fO,fM]}});var bK={0:"00000000",16:"00010000",32:"00100000",48:"00110000",64:"01000000",96:"01100000"};function bt(fp,fq,fr){var e=fp.bds;if(!e){return false}var i=fp.tracer;var fu;if(i){if(!bK[i]){fu=i.toString(2);if(fu.length<8){fu=new Array(8-fu.length+1).join("0")+fu}bK[i]=fu}fu=bK[i];var ft=b7.mapZoomStartZoomMapping[fq];return fu[fq-ft]==="1"}var fs=fp.displayRange;if(fr>=fs[0]&&fr<=fs[1]){return true}return false}function b8(i,e){this.map=i.map;this.layer=i;e=e||[];this.allLabels=[];this._spotData=[];this._strategyInfo=null;this.RANK1=1000000;this.RANK2=2000000;this.RANK3=3000000;this.RANK4=4000000;this.RANK5=5000000;this._ratio=aA();this._useRound=true;this._sharpenRender=false;if(this._ratio>1.5){this._useRound=false;this._sharpenRender=true}this._mapIsMoving=false;this._onMapIdleCallback=e.onMapIdleCallback;this.map.temp.isPermitSpotOver=true;this.currentSelectedLabel=null;this.map._labelProcessor=this;this.iconCache={};this.fixedLabelData=[];this.lineLabelData=[];this.highlightLabelData=[];this._iconLoadTimer=null;this._labelTextCanvas=null;if(this.map.config.textRenderType==="canvas"){this._labelTextCanvas=this.map.tileMgr.getLabelTextCanvas()}this.bind()}y.extend(b8.prototype,{bind:function(){var fp=this.map;var i=this;fp.addEventListener("mapstatusbusy_inner",function(fq){i._mapIsMoving=true;if(i._ratio>1.5){i._sharpenRender=false}else{i._useRound=false}});fp.addEventListener("mapstatusidle_inner",function(fq){if(i._ratio>1.5){i._sharpenRender=true}else{i._useRound=true}i._mapIsMoving=false});fp.addEventListener("onspotmouseover",function(fs){if(!this.temp.isPermitSpotOver){return}if(fs.spots.length>0){var fr=fs.spots[0].userdata.uid;var ft=fs.spots[0].userdata.tilePosStr;var fq=i.getLabelByUid(fr,ft);fq&&fq.formatedData&&i._toHighlightColor(fq.formatedData)}});fp.addEventListener("onspotmouseout",function(fs){if(!this.temp.isPermitSpotOver){return}if(fs.spots.length>0){var fr=fs.spots[0].userdata.uid;var ft=fs.spots[0].userdata.tilePosStr;var fq=i.getLabelByUid(fr,ft);fq&&fq.formatedData&&i._toDefaultColor(fq.formatedData)}});fp.addEventListener("spotclick",function(fs){if(fs.spots&&fs.spots.length>0){if(fs.spots[0].userdata.zoom<10){return}var fr=fs.spots[0].userdata.uid;var ft=fs.spots[0].userdata.tilePosStr;if(i.currentSelectedLabel&&(i.currentSelectedLabel.uid!==fr||i.currentSelectedLabel.tilePosStr!==ft)){i._recoverNormalState()}var fq=i.getLabelByUid(fr,ft);fq&&i._changeBaseMapState(fq)}else{i._recoverNormalState()}});fp.on("spot_status_reset",function(){i._recoverNormalState()});fp.on("spot_highlight",function(fr){var fq=i.getLabelByUid(fr.uid,fr.tilePosStr);fq&&fq.formatedData&&i._toHighlightColor(fq.formatedData)});fp.addEventListener("mousemove",function(fq){if(i.curSpotAdded){return}if(this.currentOperation!==cA.idle||i._mapIsMoving===true){return}i._refreshSpotData();this.temp.isPermitSpotOver=true;i.curSpotAdded=true});if(ea()){function e(){i._refreshSpotData()}fp.addEventListener("mapstatusidle_inner",e)}fp.on("style_loaded",function(){if(i.map.config.textRenderType==="canvas"&&!i._labelTextCanvas){i._labelTextCanvas=i.map.tileMgr.getLabelTextCanvas()}})},getLabelByUid:function(ft,fu){var e=this.map._featureMgr.getResult().tileLabels;for(var fs=0;fs=0&&fU<45)||(fU>=315&&fU<360)){fV=f2;fT=f0;fB=fD;fA=fC}else{if(fU>=45&&fU<135){fV=f0;fT=-fD;fB=fC;fA=-f2}else{if(fU>=135&&fU<225){fV=-fD;fT=-fC;fB=-f2;fA=-f0}else{if(fU>=225&&fU<315){fV=-fC;fT=f2;fB=-f0;fA=fD}}}}fs._tempBds=[fK+fV,fI+fT,fK+fB,fI+fA];fZ.push(fs)}}var fW=this._strategyInfo;if(fW){var fz=fW.guid;var fH=fW.guidExt;var fp=false;for(var f6=0,f4=fZ.length;f60){fq=6}var fy=fF.getZoom();if(fy>=8&&fy<9){fy<8.5?(fq=6):(fq=3)}if(fF._displayOptions.labelMargin){fq=fF._displayOptions.labelMargin}var e=2;if(fy<6&&fy>=5){e=-1}for(var f6=0,f4=fZ.length;f6f7[2]+fq+e||fx[3]+fq+ef7[3]+fq+e)){fS._intersectIdx.push(f5)}}}for(var f6=0,f4=fZ.length;f6=0.5?e+0.5:e;return i},clearCollisionCache:function(e){if(!e){return}e.cacheState=null;e.unnecessaryCollisionTest=null},getCachedLabels:function(e){e=e||[];var fp=this.getZoomStep();var fr=[];var ft=false;for(var fq=0;fqe){fw.isDel=true}if(fw.isDel){continue}var fC=fw.pt;var fp=fw.iconPos;if(fp&&fp.texcoord){if(!fp.rtVertex){fp.rtVertex=[];var fE=fp.vertex;var ft=ag(fC.lng);var fB=ag(fC.lat);fp.rtVertex=[ft[0],fB[0],ft[1],fB[1],0,fE[0],fE[1],0,0,fp.texcoord[0],fp.texcoord[1],ft[0],fB[0],ft[1],fB[1],0,fE[2],fE[3],0,0,fp.texcoord[2],fp.texcoord[3],ft[0],fB[0],ft[1],fB[1],0,fE[4],fE[5],0,0,fp.texcoord[4],fp.texcoord[5],ft[0],fB[0],ft[1],fB[1],0,fE[6],fE[7],0,0,fp.texcoord[6],fp.texcoord[7],ft[0],fB[0],ft[1],fB[1],0,fE[8],fE[9],0,0,fp.texcoord[8],fp.texcoord[9],ft[0],fB[0],ft[1],fB[1],0,fE[10],fE[11],0,0,fp.texcoord[10],fp.texcoord[11]]}}var fD=fw.textPos;if(fD){if(!fD.rtVertex){fD.rtVertex=[];var fE=fD.vertex;var fu=fD.rtVertex;var ft=ag(fC.lng);var fB=ag(fC.lat);var fG=ag(fq);for(var fy=0,fF=fE.length;fy45&&fV<315){if(fV>45&&fV<=135){fR=270}else{if(fV>135&&fV<=225){fR=180}else{if(fV>225&&fV<315){fR=90}}}if(fH>225&&fH<=315&&fR<=180){fD=true}else{if((fH>=0&&fH<=45||fH>=315&&fH<360)&&fR>=180){fD=true}}}}for(var fX=0,fz=fJ.length;fX=360){e-=360}while(e<0){e+=360}return e},fixDataFormat:function(fy){var fq=this.fixedLabelData;var e=this.lineLabelData;var fp=this.highlightLabelData;var fF=0;var fu=0;var fD=0;var fE;if(this.currentSelectedLabel){var ft=this.getLabelByUid(this.currentSelectedLabel.guid,this.currentSelectedLabel.tilePosStr);if(!ft||ft.isDel){fq[fF]=this.currentSelectedLabel.formatedData;fF++;fp[fD]=this.currentSelectedLabel.formatedData;fD++}}for(var fC=0;fCfq)){continue}var i=fr[e].spot||this._getSpotDataFromLabel(fr[e]);if(i){this._spotData.push(i)}}},_getSpotDataFromLabel:function(fp){var fs=this.map;if(!fp.bds){return null}var e=fp.bds.slice(0);var fq=null;if(fp.iconPos){fq=new e7(fp.pt.lng,fp.pt.lat)}var i=fp.name?fp.name.replace("\\\\","
"):"";if(fp.iconPos&&fp.iconPos.iconType.indexOf("ditie")>-1&&fs.getZoom()>14){i=""}var fr={n:i,pt:new e7(fp.pt.lng,fp.pt.lat),userdata:{iconPoint:fq,uid:fp.guid,name:i,mapPoi:true,type:fp.iconPos?fp.iconPos.iconType:"",rank:fp.rank,zoom:fp.zoom,tilePosStr:fp.tilePosStr},bd:e,tag:"MAP_SPOT_INFO"};fp.spot=fr;return fr},drawLabelsOnCanvas:function(i,e){this._labelTextCanvas.drawLabelsOnCanvas(i,e)}});function d0(e){this._map=e;this.virtualTile={custom:true,label:{fixedLabel:[],indoorLabel:[],lineLabel:[],textureHeights:[],status:"ready"},tileInfo:{col:0,row:0,zoom:0,useZoom:0,loopOffsetX:0},status:"ready"};this.virtualTile.label.tileInfo=this.virtualTile.tileInfo;this.init()}d0.prototype.init=function(){var fp=this._map;var i=this;function e(){i.updateLabels()}fp.addEventListener("add_tile_labels",e);fp.addEventListener("onremove_tile_labels",e);fp.addEventListener("onclear_labels",e)};d0.prototype.updateLabels=function(){var i=this._map.tileMgr.getLabelTextCanvas();var fp=this._map;var e=this;i.drawCustomLabelsOnCanvas(fp._customTileLabels,function(fr){var fq=e.virtualTile;if(fr){fq.label.textureHeights[0]=[fr.height]}fq.label.fixedLabel=fp._customTileLabels;var fs=new aD("oncustom_labels_ready");fs.virtualTile=fq;fs.labelCanvas=fr;fs.imgKey=aK.getGUID("custom_labels_");fp.dispatchEvent(fs)})};aK.register(function(e){e._customLabelMgr=new d0(e)});function dc(i){var fq=null;try{if(ch.inMapHost&&!dk.isGLApi){fq=new Worker(i);fq.onerror=function(e){e.preventDefault();fq=q(i)}}else{fq=q(i)}}catch(fp){fq=q(i)}return fq}function q(fs){var fv=null;try{var fp;try{fp=new Blob(['importScripts("'+fs+'");'],{type:"application/javascript"})}catch(ft){var fr=new (window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder)();fr.append('importScripts("'+fs+'");');fp=fr.getBlob("application/javascript")}var fq=window.URL||window.webkitURL;var i=fq.createObjectURL(fp);fv=new Worker(i);fv.postMessage({action:"setConfig",isWgs84:dk.isWgs84})}catch(fu){}return fv}function ee(e){this.init(e)}var aE={init:function(fp){var i=this;this.map=fp;this.arrPendingData=[];var e=navigator.hardwareConcurrency||4;if((ea()||y.Browser.ie)&&e>2){e=2}this.arrWorker=[];this.ratio=aA();this.wordSpaceRatio=this.ratio;if(this.ratio>1){this.textSizeRatio=2}else{this.textSizeRatio=1}bR.canUseWebAssembly(function(fq){var ft;if(fq){ft="https://mapopen.cdn.bcebos.com/cms/bmapgl/worker_wasm_dalezt.js"}else{ft="https://mapopen.cdn.bcebos.com/cms/bmapgl/worker_asm_r351qg.js"}if(dk.isOffline){ft=dk.host999+ft;ft=ft.replace("https://mapopen.cdn.bcebos.com/cms/bmapgl/","/baidumap/bmapgl/api/")}for(var fs=0;fs0){var fz=i.arrPendingData.shift();var fw=fz.cbk;i.loadTileData(fz.url,fz.tileInfo,fz.tileKey,fw)}var fy=new aD("onrefresh");fy.source="workermgr";fp.fire(fy)};i.arrWorker.push(fv)}if(i.arrPendingData.length>0){for(var fs=0;fs=0;fs--){var fu=ft[fs];var e=fu.tileInfo;if(fp.tileTypeName!==e.tileTypeName){continue}var fr="id_"+e.col+"_"+e.row+"_"+e.zoom;if(!fp[fr]){ft.splice(fs,1);fq.push(e)}}return fq},loadTileData:function(e,fp,fx,fw){var fq=this.getIdleWorker();if(fq){fq._cbk=fw;fq._parsingTileInfo=fp;fq._parsingTileKey=fx;var i={action:"loadTileData",config:{},url:e,tileInfo:fp,tileKey:fx};var fu=this.map.getMapStyleId();var ft=!!(fu.indexOf("custom")===0);var fs=fu;if(ft){fs="Custom"}if(!fq.isSendFS){if(!ee["stringifiedFeatureStyle"+fu]&&aK["FeatureStyle"+fu]){ee["stringifiedFeatureStyle"+fu]=JSON.stringify(aK["FeatureStyle"+fu])}if(!ee["stringifiedIconSetInfo"+fs]){ee["stringifiedIconSetInfo"+fs]=JSON.stringify(aK["iconSetInfo"+fs])}if(!ee.stringifiedIndoorStyle){ee.stringifiedIndoorStyle=JSON.stringify(aK.indoorStyle)}if(ft&&aK.customStyleInfo){if(!ee.stringifiedCustomStyleInfo){ee.stringifiedCustomStyleInfo=JSON.stringify(aK.customStyleInfo)}}if(ee["stringifiedFeatureStyle"+fu]){i.featureStyle=ee["stringifiedFeatureStyle"+fu]}i.iconSetInfo=ee["stringifiedIconSetInfo"+fs];i.indoorStyle=ee.stringifiedIndoorStyle;if(ft&&ee.stringifiedCustomStyleInfo){i.customMapStyle=ee.stringifiedCustomStyleInfo}i.iconInfo={wordSpaceRatio:this.wordSpaceRatio,textSizeRatio:this.textSizeRatio};i.mapStyleId=fu;i.mapConfig={enableIndoor:this.map.config.enableIndoor};fq.isSendFS=true}var fv=this.map._customStyle;if(fv){fq.postMessage({action:"setCustomStyle",customStyle:fv})}fq.postMessage(i)}else{var fr={url:e,tileInfo:fp,tileKey:fx,cbk:fw};this.arrPendingData.push(fr)}}};y.extend(ee.prototype,aE);function cz(i){this.tileLayers=[];this.map=i;var e=this.config=bg[this.map.mapType];this.errorUrl=e.errorUrl;this.tileSize=e.tileSize;this.baseUnits=e.baseUnits;this.baseZoomLevel=e.zoomLevelBase;this.tileURLs=e.tileUrls;this.tilesInfoCache={};this.loadDelay=10;this._labelTextCanvas=null}aK.register(function(i){if(i._renderType!=="webgl"){return}var e=i.tileMgr=new cz(i);i.addEventListener("addtilelayer",function(fq){e.addWebGLLayer(fq.target)});i.addEventListener("removetilelayer",function(fq){e.removeWebGLLayer(fq.target)});i.on("update",function fp(fq){if(!aK["FeatureStyle"+this.config.style]&&!aK.customStyleLoaded){return}e.loadLayersData({zoomChanged:fq.changedStatus.onzoom_changed?true:false})});i.on("style_changed",function(){e.loadLayersData()})});y.extend(cz.prototype,{addWebGLLayer:function(fq){this.tileLayers.push(fq);fq.initDrawData();if(this.tileLayers.length>1){for(var fp=1;fp50);if(!e){if(!this.syncLoadTimer){this.syncLoadTimer=setTimeout(function(){fq._loadLayersFromCache(fp);fq.syncLoadTimer=null},40)}}else{this._loadLayersFromCache(fp)}this.timer&&window.clearTimeout(this.timer);this.timer=window.setTimeout(function(){var fs=fq.tileLayers.length;fq.tilesInfoCache={};for(var ft=0;ft0});var fp=fu.length;this.tilesInfoCache={};for(var fq=0;fqcH._mc180X){var fA=cH.getSpaceDistanceInPixel(ft);fS=Math.ceil(fA/fr)}if(fL.sw.lng19505879.362428114||fL.sw.lat<-15949096.637571886){if(!dk.isGLApi){fL=fL.clone()}fL.ne.lat=19505879.362428114;fL.sw.lat=-15949096.637571886}var fx=[Math.floor(fL.sw.lng/fG)-fp,Math.floor(fL.sw.lat/fG)];var f2=[Math.floor(fL.ne.lng/fG)+fS,Math.floor(fL.ne.lat/fG)];if(dk.isWgs84){var fs=Math.PI*6378137;var fx=[Math.floor((fL.sw.lng+fs)/fG)-fp,Math.floor((fL.sw.lat+fs)/fG)];var f2=[Math.ceil((fL.ne.lng+fs)/fG)+fS,Math.ceil((fL.ne.lat+fs)/fG)]}fF=fx[0];fV=f2[0]+1;fM=fx[1];fZ=f2[1]+1;var fB=[];for(var fy=fF;fy=0?fy-fu:fy+fu;var fI="id_"+fH+"_"+fD+"_"+ft;if(!fB[fI]){var fz={col:fH,row:fD,zoom:ft,useZoom:fX,loopOffsetX:0,tileSize:fN,baseTileSize:fr,mercatorSize:fG};fB.push(fz);fB[fI]=true}}}if(this.map._tilt>0){for(var f1=0;f10&&fE.x0&&fE.yfQ.lng&&fR.minYfQ.lat){continue}if(!this.ifTileInMapBounds(fR,fL,fY,f3)){fB.splice(f1,1);f1--}}}fB.sort((function(i){return function(f5,f6){return((0.4*Math.abs(f5.col-i[0])+0.6*Math.abs(f5.row-i[1]))-(0.4*Math.abs(f6.col-i[0])+0.6*Math.abs(f6.row-i[1])))}})([fK,fv]));fB.zoom=ft;fB.tileTypeName=f4;return fB},getCurrentViewTilesInfo:function(i){var e=this.tilesInfoCache[i.getName()];if(!e){return this.calcTilesInfo(i)}return e},ifTileInMapBounds:function(e,fs,fp,fr){var i=fs.normalizedBottomLeft;var fD=fs.normalizedTopRight;var fv=fs.normalizedTopLeft;var ft=fs.normalizedBottomRight;var fq=false;var fC=new e7(e.minX,e.minY);var fz=new e7(e.maxX,e.maxY);var fu=new e7(fz.lng,fC.lat);var fA=new e7(fC.lng,fz.lat);var fx=[fA,fz,fu,fC];for(var fB=0,fw=fx.length;fB=e._autoEnterZoom){e._checkIndoorByMove()}});i.on("zoomend",function(){if(this.getZoom()>=e._autoEnterZoom){e._checkIndoorByMove()}else{if(e.enterMethod!=="byClick"&&e.currentUid!==null){this.showIndoor(null)}}})};ar.prototype._checkIndoorByMove=function(){var fp=this._map;var fw=fp.getSize();var fB={x:fw.width/2,y:fw.height/2};var fA=Math.max(fw.width,fw.height);var fC=[];for(var fx in this._indoorData){var e=this._indoorData[fx].center;var fq=fp.pointToPixel(new aK.Point(e[0],e[1]));var ft=eL(fB,fq);fC.push({uid:fx,distance:ft})}if(fC.length===0){return}fC.sort(function(fD,i){return fD.distance-i.distance});var fs=fC[0];var fy=fp.getCenter();var fr=false;for(var fv=0;fvfu[0]&&fy.lat>fu[1]&&fy.lng=this._autoEnterZoom){this._checkIndoorByMove()}};ar.prototype.removeData=function(fp,fr){if(!this._indoorData[fp]){return}var fq=this._indoorData[fp];for(var e=0;efH){fC=fH}var fA=fD[1][fC][0];var fE=fA[fF];if(!fE){if(fG==="point"||fG==="pointText"){fA=fD[1][fI][0];fE=fA[fF]}}return{drawId:fE,style:fB,styleUpdate:[]}}function fp(fE,fF,fI,fH){if(!fH){return{drawId:null,style:[],styleUpdate:[]}}var fG;var fC=fH.baseFs;if(fx(fH.zoomRegion)){fG=fH.StyleBody||[]}else{fG=fH.zoomStyleBody[fI]||[]}var fB=fC[2];switch(fF){case"point":fB=fB[0];fG=fG[0]||{};break;case"pointText":fB=fB[1];fG=fG[1]||{};break;case"line":fB=fB[3];fG=fG[3]||{};break;case"polygon":fB=fB[4];fG=fG[4]||{};break;case"polygon3d":fB=fB[5];fG=fG[5]||{};break}var fA=fC[1][fI-1][0];var fD=fA[fE];return{drawId:fD,style:fB,styleUpdate:fG}}function fs(fB,fA){if(!fB||fB.length===0){return null}return{sid:fA,fontRgba:i(fB[0]),haloRgba:i(fB[1]),backRgba:i(fB[2]),fontSize:fB[3],haloSize:fB[4],fontWeight:fB[5],fontStyle:fB[6],density:fB[7]}}function e(fB,fA){return{sid:fA,rank:fB[0],ucflag:fB[1],icon:fB[2],iconType:fB[3],nineGG:fB[4],density:fB[5],zoom:fB[6]}}function fu(fB,fA){return{sid:fA,borderRgba:i(fB[0]),fillRgba:i(fB[1]),borderWidth:fB[2],fillWidth:fB[3],borderCap:fB[4],fillCap:fB[5],haveBorderLine:fB[6],haveBorderTexture:fB[7],haveFillTexture:fB[8],isUseBorderRgba:fB[9],isUseFillRgba:fB[10],borderTexture:fB[11],fillTexture:fB[12],borderTextureType:fB[13],fillTextureType:fB[14],isRealWidth:fB[15],haveArrow:fB[16],needRound:fB[17],realBorderWidth:fB[18]}}function fr(fB,fA){return{sid:fA,fillRgba:i(fB[0]),borderRgba:i(fB[1]),borderWidth:fB[2],borderTexture:fB[3],borderTextureType:fB[4],waterStyle:fB[5],haloStyle:fB[6],textureStyle:fB[7],thickRgba:i(fB[8])}}function ft(fB,fA){return{sid:fA,filter:fB[0],ratio:fB[1],haveBorder:fB[2],borderWidth:fB[3],borderRgba:i(fB[4]),fillTop:i(fB[5]),fillSide:i(fB[6]),polyTexture:fB[7]}}function i(fF){var fE=fF;if(fv[fE]){return fv[fE]}fF=fF>>>0;var fD=(fF)&255;var fC=(fF>>8)&255;var fA=(fF>>16)&255;var fB=(fF>>24)&255;fv[fE]=[fD,fC,fA,fB];return fv[fE]}return{getStyleFromCache:function(fH,fC,fF,fG,fB,fE,fA){if(typeof isWgs84==="boolean"&&isWgs84){fG=fG+1}fH=fH||"default";var fD=fH+"-"+fC+"-"+fF+"-"+fG;if(fE){fD+="-indoor"}if(fB){if(!fz[fD]){fz[fD]=fw(fC,fF,fG,fB)}return fz[fD]}if(!fq[fD]){fq[fD]=fw(fC,fF,fG,fB,fA)}return fq[fD]}}})();aK.register(function(i){var e=new cq(i)});function cq(e){e.container.appendChild(this.render());this.bind(e)}cq.prototype.render=function(){var i=document.createElement("div");i.className="click-ripple-container";var e=document.createElement("div");e.className="click-ripple";i.appendChild(e);this._div=i;this._ripple=e;return i};cq.prototype.bind=function(i){var e=this;i.addEventListener("spotclick",function(fp){if(!fp.spots||fp.spots.length===0){return}e._div.style.left=fp.pixel.x+"px";e._div.style.top=fp.pixel.y+"px";y.ac(e._ripple,"ripple-playing")});y.on(e._ripple,"transitionend",function(){y.rc(e._ripple,"ripple-playing")})};function d8(e){cN.call(this);if(!e){return}this._opts={};this._map=e;this._maxLat=84.6;this._minLat=-80.6;this._maxLatMC=cU.convertLL2MC(new bV(this._maxLat,0)).lat;this._minLatMC=cU.convertLL2MC(new bV(this._minLat,0)).lat}d8.inherits(cN,"ToolbarItem");y.extend(d8.prototype,{open:function(){if(this._isOpen==true){return true}if(this._map._toolInUse){return false}this._map._toolInUse=true;this._isOpen=true;return true},close:function(){if(!this._isOpen){return}this._map._toolInUse=false;this._isOpen=false},_checkStr:function(e){if(!e){return""}return e.replace(//g,">")}});function eG(fp,i){d8.call(this,fp);i=i||{};this._opts=y.extend(y.extend(this._opts||{},{autoClear:false,tips:"测距",followText:"单击确定起点,双击结束绘制",unit:"metric",showResult:true,lineColor:"blue",lineStroke:2,opacity:1,lineStyle:"solid",cursor:ds.distCursor,styleCodes:{lnCode:0,spCode:0,slCode:0,tlCode:0},enableMassClear:true}),i);if(this._opts.showResult===false){if(typeof i.tips==="undefined"){this._opts.tips="绘制折线"}if(!i.cursor){this._opts.cursor="crosshair"}}if(this._opts.lineStroke<=0){this._opts.lineStroke=2}if(this._opts.opacity>1){this._opts.opacity=1}else{if(this._opts.opacity<0){this._opts.opacity=0}}if(this._opts.lineStyle!=="solid"&&this._opts.lineStyle!=="dashed"){this._opts.lineStyle="solid"}this._checked=false;this._drawing=null;this.followTitle=null;this._totalDis={};this._points=[];this._paths=[];this._dots=[];this._segDistance=[];this._overlays=[];this._units={metric:{name:"metric",conv:1,incon:1000,u1:"米",u2:"公里"},us:{name:"us",conv:3.2808,incon:5279.856,u1:"英尺",u2:"英里"}};if(!this._units[this._opts.unit]){this._opts.unit="metric"}this._dLineColor="#ff6319";this._dLineStroke=3;this._dOpacity=0.8;this._dLineStyle="solid";this._dCursor=ds.distCursor;if(this._opts.showResult){this._opts.followText="单击确定起点"}this._followTextM="单击确定地点,双击结束";this._sectionMarkerTip="单击可删除此点,拖拽可调整位置";this._movingTimerId=null;if(this._opts.showResult){this.text="测距"}else{this.text="绘线"}this._isOpen=false;var e=this;cL.load("tools",function(){e._draw()})}eG.inherits(d8,"PolylineTItem");y.extend(eG.prototype,{setLineColor:function(e){this._opts.lineColor=e},setLineStroke:function(e){if(Math.round(e)>0){this._opts.lineStroke=Math.round(e)}},setOpacity:function(e){if(e>=0&&e<=1){this._opts.opacity=e}},setLineStyle:function(e){if(e==="solid"||e==="dashed"){this._opts.lineStyle=e}},clear:function(){for(var fp=0,e=this._overlays.length;fpfv){fp-=fr;ft-=this._loopOffset}while(fpthis._mc180X){e-=this._mcTSpan}while(ethis._mc180X){i.lng-=this._mcTSpan;e-=this._mcTSpan;fr-=this._mcTSpan}while(i.lng=fx){var fw=fq+fz;if(this.isTileBlank(fw,e,fC)===true){continue}var fp="id_"+fw+"_"+fD+"_"+e;if(!fy[fp]){fy[fp]=true;fA.push([fw,fD,e,0])}}else{if(fq<=ft){var fw=fq-fz;if(this.isTileBlank(fw,e,fC)===true){continue}var fp="id_"+fw+"_"+fD+"_"+e;if(!fy[fp]){fy[fp]=true;fA.push([fw,fD,e,0])}}}}for(var fu=0,fs=fA.length;fu=0;fu--){var fq=fy[fu][0];if(this.isTileBlank(fq,e,fC)){fy.splice(fu,1)}}return fy},isTileBlank:function(fp,fr,e){var fs=Math.pow(2,fr-3);var i=Math.round(this._validPixels*fs);var fq=6*fs*256/e;while(fp>fq/2-1){fp-=fq}while(fp<-(fq/2)){fp+=fq}if(fp>0&&fp*e>i){return true}if(fp<0&&Math.abs((fp+1)*e)>i){return true}return false},isAddWidth:function(e,i){return ethis._mc180X},getSpaceDistanceInPixel:function(i){var e=Math.round((this._spaceDistance+this._mSpaceDistance)/Math.pow(2,18-i));return e}};var cH=new bx();var eP={parseHexToRgbaArray:function(fs){var ft=fs.replace("#","");if(ft.length===3){ft+="f"}else{if(ft.length===6){ft+="ff"}}var e=[];var fr=ft.length;var fq=fr===8?2:1;for(var fp=0;fp=0&&fr<60){ft=fu;fs=fp;e=0}else{if(fr>=60&&fr<120){ft=fp;fs=fu;e=0}else{if(fr>=120&&fr<180){ft=0;fs=fu;e=fp}else{if(fr>=180&&fr<240){ft=0;fs=fp;e=fu}else{if(fr>=240&&fr<300){ft=fp;fs=0;e=fu}else{if(fr>=300&&fr<360){ft=fu;fs=0;e=fp}}}}}}ft=(ft+i)*255;fs=(fs+i)*255;e=(e+i)*255;return[Math.round(ft),Math.round(fs),Math.round(e)]}};var bm=(function(){var e=true;var fq=256;var fs=af("ditu","normalTraffic");var fp=fs.udt;var ft="https://sp3.baidu.com/7_AZsjOpB1gCo2Kml5_Y_DAcsMJiwa/traffic/";var fr=[[2,"79,210,125,1",3,2,0,[],0,0],[2,"79,210,125,1",3,2,0,[],0,0],[2,"79,210,125,1",4,2,0,[],0,0],[2,"79,210,125,1",5,2,0,[],0,0],[2,"79,210,125,1",6,2,0,[],0,0],[2,"255,208,69,1",3,2,0,[],0,0],[2,"255,208,69,1",3,2,0,[],0,0],[2,"255,208,69,1",4,2,0,[],0,0],[2,"255,208,69,1",5,2,0,[],0,0],[2,"255,208,69,1",6,2,0,[],0,0],[2,"232,14,14,1",3,2,0,[],0,0],[2,"232,14,14,1",3,2,0,[],0,0],[2,"232,14,14,1",4,2,0,[],0,0],[2,"232,14,14,1",5,2,0,[],0,0],[2,"232,14,14,1",6,2,0,[],0,0],[2,"181,0,0,1",3,2,0,[],0,0],[2,"181,0,0,1",3,2,0,[],0,0],[2,"181,0,0,1",4,2,0,[],0,0],[2,"181,0,0,1",5,2,0,[],0,0],[2,"181,0,0,1",6,2,0,[],0,0],[2,"255,255,255,1",4,0,0,[],0,0],[2,"255,255,255,1",5.5,0,0,[],0,0],[2,"255,255,255,1",7,0,0,[],0,0],[2,"255,255,255,1",8.5,0,0,[],0,0],[2,"255,255,255,1",10,0,0,[],0,0]];var i=new bJ({transparentPng:true,dataType:2,cacheSize:256,clipTile:true});i.zIndex=2;i.getTilesUrl=function(fw,fx){if(!fw||fx<7){return null}var fv=fw.x;var fy=fw.y;var fz="vtraffic";if(dk.isOffline){fz="traffic"}var fu=ft+"?qt="+fz+"&z="+fx+"&x="+fv+"&y="+fy+"&udt="+fp;return fu};i.setColors=function(fu){for(var fx=0;fx>16,255&e>>8,255&e],this.valpha=1;else{this.valpha=1;var l=Object.keys(e);"alpha"in e&&(l.splice(l.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);var s=l.sort().join("");if(!(s in et))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=et[s];var u=Ke[this.model].labels,d=[];for(r=0;r80*r){s=d=e[0],u=p=e[1];for(var g=r;gd&&(d=f),c>p&&(p=c);// minX, minY and invSize are later used to transform coords into integers for z-order calculation m=Re(d-s,p-u),m=0===m?0:1/m}return w(n,l,r,s,u,m),l}// create a circular doubly linked list from polygon points in the specified winding order function F(e,t,r,a,o){var n,l;if(o===0=t;n-=a)l=$(n,e[n],e[n+1],l);return l&&Z(l,l.next)&&(ee(l),l=l.next),l}// eliminate colinear or duplicate points function B(e,t){if(!e)return e;t||(t=e);var r=e,a;do if(a=!1,!r.steiner&&(Z(r,r.next)||0===H(r.prev,r,r.next))){if(ee(r),r=t=r.prev,r===r.next)break;a=!0}else r=r.next;while(a||r!==t);return t}// main ear slicing loop which triangulates a polygon (given as a linked list) function w(e,t,r,a,o,i,n){if(e){!n&&i&&N(e,a,o,i);// iterate through ears, slicing them one by one for(var l=e,s,u;e.prev!==e.next;){if(s=e.prev,u=e.next,i?C(e,a,o,i):D(e)){t.push(s.i/r),t.push(e.i/r),t.push(u.i/r),ee(e),e=u.next,l=u.next;continue}// if we looped through the whole remaining polygon and can't find any more ears if(e=u,e===l){n?1===n?(e=k(e,t,r),w(e,t,r,a,o,i,2)):2==n&&O(e,t,r,a,o,i):w(B(e),t,r,a,o,i,1);break}}}// interlink polygon nodes in z-order }// check whether a polygon node forms a valid ear with adjacent nodes function D(e){var t=e.prev,r=e,a=e.next;if(0<=H(t,r,a))return!1;// reflex, can't be an ear // now make sure we don't have other points inside the potential ear for(var o=e.next.next;o!==e.prev;){if(V(t.x,t.y,r.x,r.y,a.x,a.y,o.x,o.y)&&0<=H(o.prev,o,o.next))return!1;o=o.next}return!0}function C(e,t,r,o){var i=e.prev,a=e,l=e.next;if(0<=H(i,a,l))return!1;// reflex, can't be an ear // triangle bbox; min & max are calculated like this for speed // look for points inside the triangle in both directions for(var s=i.xa.x?i.x>l.x?i.x:l.x:a.x>l.x?a.x:l.x,f=i.y>a.y?i.y>l.y?i.y:l.y:a.y>l.y?a.y:l.y,c=q(s,u,t,r,o),m=q(d,f,t,r,o),g=e.prevZ,v=e.nextZ// z-order range for the current triangle bbox; ;g&&g.z>=c&&v&&v.z<=m;){if(g!==e.prev&&g!==e.next&&V(i.x,i.y,a.x,a.y,l.x,l.y,g.x,g.y)&&0<=H(g.prev,g,g.next))return!1;if(g=g.prevZ,v!==e.prev&&v!==e.next&&V(i.x,i.y,a.x,a.y,l.x,l.y,v.x,v.y)&&0<=H(v.prev,v,v.next))return!1;v=v.nextZ}// look for remaining points in decreasing z-order for(;g&&g.z>=c;){if(g!==e.prev&&g!==e.next&&V(i.x,i.y,a.x,a.y,l.x,l.y,g.x,g.y)&&0<=H(g.prev,g,g.next))return!1;g=g.prevZ}// look for remaining points in increasing z-order for(;v&&v.z<=m;){if(v!==e.prev&&v!==e.next&&V(i.x,i.y,a.x,a.y,l.x,l.y,v.x,v.y)&&0<=H(v.prev,v,v.next))return!1;v=v.nextZ}return!0}// go through all polygon nodes and cure small local self-intersections function k(e,t,r){var o=e;do{var i=o.prev,a=o.next.next;!Z(i,a)&&G(i,o,o.next,a)&&Q(i,a)&&Q(a,i)&&(t.push(i.i/r),t.push(o.i/r),t.push(a.i/r),ee(o),ee(o.next),o=e=a),o=o.next}while(o!==e);return o}// try splitting polygon into two and triangulate them independently function O(e,t,r,o,i,n){// look for a valid diagonal that divides the polygon into two var l=e;do{for(var s=l.next.next;s!==l.prev;){if(l.i!==s.i&&X(l,s)){// split the polygon in two by the diagonal var u=J(l,s);// filter colinear points around the cuts return l=B(l,l.next),u=B(u,u.next),w(l,t,r,o,i,n),void w(u,t,r,o,i,n)}s=s.next}l=l.next}while(l!==e)}// link every hole into the outer loop, producing a single-ring polygon without holes function M(e,t,r,a){var o=[],n,l,s,u,d;for(n=0,l=t.length;n=r.next.y&&r.next.y!==r.y){var l=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(l<=a&&l>i){if(i=l,l===a){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x=r.x&&r.x>=u&&a!==r.x&&V(on.x)&&Q(r,e)&&(n=r,f=c)),r=r.next;return n}// interlink polygon nodes in z-order function N(e,t,r,a){var o=e;do null===o.z&&(o.z=q(o.x,o.y,t,r,a)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,I(o)}// Simon Tatham's linked list merge sort algorithm // http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html function I(t){var r=1,a,o,n,l,s,u,d,f;do{for(o=t,t=null,s=null,u=0;o;){for(u++,n=o,d=0,a=0;aH(e.prev,e,e.next)?0<=H(e,t,e.next)&&0<=H(e,e.prev,t):0>H(e,t,e.prev)||0>H(e,e.next,t)}// check if the middle point of a polygon diagonal is inside the polygon function K(e,t){var r=e,a=!1,o=(e.x+t.x)/2,i=(e.y+t.y)/2;do r.y>i!=r.next.y>i&&r.next.y!==r.y&&o<(r.next.x-r.x)*(i-r.y)/(r.next.y-r.y)+r.x&&(a=!a),r=r.next;while(r!==e);return a}// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two; // if one belongs to the outer ring and another to a hole, it merges it into a single ring function J(e,t){var r=new te(e.i,e.x,e.y),a=new te(t.i,t.x,t.y),o=e.next,i=t.prev;return e.next=t,t.prev=e,r.next=o,o.prev=r,a.next=r,r.prev=a,i.next=a,a.prev=i,a}// create a node and optionally link it with previous one (in a circular doubly linked list) function $(e,t,r,a){var o=new te(e,t,r);return a?(o.next=a.next,o.prev=a,a.next.prev=o,a.next=o):(o.prev=o,o.next=o),o}function ee(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function te(e,t,r){// vertex index in coordinates array // vertex coordinates // previous and next vertex nodes in a polygon ring // z-order curve value // previous and next nodes in z-order // indicates whether this is a steiner point this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}// return a percentage difference between the polygon area and its triangulation area; // used to verify correctness of triangulation function re(e,t,r,a){for(var o=0,n=t,l=r-a;nt.length?"0"+t:t}/* MIT license */var a={};// create a list of reverse color names for(var o in Se)Se.hasOwnProperty(o)&&(a[Se[o]]=o);var i=e.exports={to:{},get:{}};// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax // (hwb have alpha optional & 1 is default value) i.get=function(e){var t=e.substring(0,3).toLowerCase(),r,a;switch(t){case"hsl":r=i.get.hsl(e),a="hsl";break;case"hwb":r=i.get.hwb(e),a="hwb";break;default:r=i.get.rgb(e),a="rgb";}return r?{model:a,value:r}:null},i.get.rgb=function(e){if(!e)return null;var r=/^#([a-f0-9]{3,4})$/i,a=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,o=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,n=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,l=/(\D+)/,s=[0,0,0,1],u,d,p;if(u=e.match(a)){for(p=u[2],u=u[1],d=0;3>d;d++){// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19 var f=2*d;s[d]=parseInt(u.slice(f,f+2),16)}p&&(s[3]=Te(100*(parseInt(p,16)/255))/100)}else if(u=e.match(r)){for(u=u[1],p=u[3],d=0;3>d;d++)s[d]=parseInt(u[d]+u[d],16);p&&(s[3]=Te(100*(parseInt(p+p,16)/255))/100)}else if(u=e.match(o)){for(d=0;3>d;d++)s[d]=parseInt(u[d+1],0);u[4]&&(s[3]=parseFloat(u[4]))}else if(u=e.match(n)){for(d=0;3>d;d++)s[d]=Te(2.55*parseFloat(u[d+1]));u[4]&&(s[3]=parseFloat(u[4]))}else return(u=e.match(l))?"transparent"===u[1]?[0,0,0,0]:(s=Se[u[1]],!s)?null:(s[3]=1,s):null;for(d=0;3>d;d++)s[d]=t(s[d],0,255);return s[3]=t(s[3],0,1),s},i.get.hsl=function(e){if(!e)return null;var r=/^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,o=e.match(r);if(o){var i=parseFloat(o[4]),n=(parseFloat(o[1])+360)%360,u=t(parseFloat(o[2]),0,100),s=t(parseFloat(o[3]),0,100),l=t(isNaN(i)?1:i,0,1);return[n,u,s,l]}return null},i.get.hwb=function(e){if(!e)return null;var r=/^hwb\(\s*([+-]?\d*[\.]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,o=e.match(r);if(o){var i=parseFloat(o[4]),n=(parseFloat(o[1])%360+360)%360,l=t(parseFloat(o[2]),0,100),s=t(parseFloat(o[3]),0,100),u=t(isNaN(i)?1:i,0,1);return[n,l,s,u]}return null},i.to.hex=function(){var e=Le(arguments);return"#"+r(e[0])+r(e[1])+r(e[2])+(1>e[3]?r(Te(255*e[3])):"")},i.to.rgb=function(){var e=Le(arguments);return 4>e.length||1===e[3]?"rgb("+Te(e[0])+", "+Te(e[1])+", "+Te(e[2])+")":"rgba("+Te(e[0])+", "+Te(e[1])+", "+Te(e[2])+", "+e[3]+")"},i.to.rgb.percent=function(){var e=Le(arguments),t=Te(100*(e[0]/255)),r=Te(100*(e[1]/255)),a=Te(100*(e[2]/255));return 4>e.length||1===e[3]?"rgb("+t+"%, "+r+"%, "+a+"%)":"rgba("+t+"%, "+r+"%, "+a+"%, "+e[3]+")"},i.to.hsl=function(){var e=Le(arguments);return 4>e.length||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},i.to.hwb=function(){var e=Le(arguments),t="";return 4<=e.length&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},i.to.keyword=function(e){return a[e.slice(0,3)]}}),Be=Fe.to,we=Fe.get,De=a(function(e){/** * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance * */function t(e,t){return be(e[0]-t[0],2)+be(e[1]-t[1],2)+be(e[2]-t[2],2)}/* MIT license */ // NOTE: conversions should only return primitive values (i.e. arrays, or // values that give correct `typeof` results). // do not use box values types (i.e. Number(), String(), etc.) var r={};for(var a in Se)Se.hasOwnProperty(a)&&(r[Se[a]]=a);var o=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};// hide .channels and .labels properties for(var i in o)if(o.hasOwnProperty(i)){if(!("channels"in o[i]))throw new Error("missing channels property: "+i);if(!("labels"in o[i]))throw new Error("missing channel labels property: "+i);if(o[i].labels.length!==o[i].channels)throw new Error("channel and label counts mismatch: "+i);var n=o[i].channels,l=o[i].labels;delete o[i].channels,delete o[i].labels,Object.defineProperty(o[i],"channels",{value:n}),Object.defineProperty(o[i],"labels",{value:l})}// http://dev.w3.org/csswg/css-color/#hwb-to-rgb o.rgb.hsl=function(e){var t=e[0]/255,r=e[1]/255,a=e[2]/255,o=Ee(t,r,a),i=Re(t,r,a),n=i-o,u,d,p;return i===o?u=0:t===i?u=(r-a)/n:r===i?u=2+(a-t)/n:a===i&&(u=4+(t-r)/n),u=Ee(60*u,360),0>u&&(u+=360),p=(o+i)/2,d=i===o?0:.5>=p?n/(i+o):n/(2-i-o),[u,100*d,100*p]},o.rgb.hsv=function(e){var t=e[0]/255,r=e[1]/255,a=e[2]/255,o=Re(t,r,a),i=o-Ee(t,r,a),n=function(e){return(o-e)/6/i+1/2},l,u,d,p,f;return 0===i?p=f=0:(f=i/o,l=n(t),u=n(r),d=n(a),t===o?p=d-u:r===o?p=1/3+l-d:a===o&&(p=2/3+u-l),0>p?p+=1:1a?a*(1+r):a+r-a*r,o=2*a-n,s=[0,0,0];for(var d=0;3>d;d++)l=t+1/3*-(d-1),0>l&&l++,16*l?o+6*(n-o)*l:1>2*l?n:2>3*l?o+6*((n-o)*(2/3-l)):o,s[d]=255*u;return s},o.hsl.hsv=function(e){var t=e[0],r=e[1]/100,a=e[2]/100,o=r,i=Re(a,.01),n,u;return a*=2,r*=1>=a?a:2-a,o*=1>=i?i:2-i,u=(a+r)/2,n=0===a?2*o/(i+o):2*r/(a+r),[t,100*n,100*u]},o.hsv.rgb=function(e){var r=e[0]/60,a=e[1]/100,o=e[2]/100,i=xe(r)%6,n=r-xe(r),l=255*o*(1-a),s=255*o*(1-a*n),u=255*o*(1-a*(1-n));return o*=255,0===i?[o,u,l]:1===i?[s,o,l]:2===i?[l,o,u]:3===i?[l,s,o]:4===i?[u,l,o]:5===i?[o,l,s]:void 0},o.hsv.hsl=function(e){var t=e[0],r=e[1]/100,a=e[2]/100,o=Re(a,.01),i,n,s;return s=(2-r)*a,i=(2-r)*o,n=r*o,n/=1>=i?i:2-i,n=n||0,s/=2,[t,100*n,100*s]},o.hwb.rgb=function(e){var t=e[0]/360,a=e[1]/100,o=e[2]/100,l=a+o,s,u,d,p;1n&&(n+=360),l=he(o*o+a*a),[r,l,n]},o.lch.lab=function(e){var t=e[0],r=e[1],o=e[2],i,n,l;return l=2*(o/360)*Ae,i=r*ye(l),n=r*ve(l),[t,i,n]},o.rgb.ansi16=function(e){var t=e[0],r=e[1],a=e[2],i=1 in arguments?arguments[1]:o.rgb.hsv(e)[2];if(i=Te(i/50),0===i)return 30;var n=30+(Te(a/255)<<2|Te(r/255)<<1|Te(t/255));return 2===i&&(n+=60),n},o.hsv.ansi16=function(e){// optimization here; we already know the value and don't need to get // it converted for us. return o.rgb.ansi16(o.hsv.rgb(e),e[2])},o.rgb.ansi256=function(e){var t=e[0],r=e[1],a=e[2];// we use the extended greyscale palette here, with the exception of // black and white. normal palette only has 4 greyscale shades. if(t===r&&r===a)return 8>t?16:248>1)*a),i=255*((1&t>>2)*a);return[o,r,i]},o.ansi256.rgb=function(e){// handle greyscale if(232<=e){var t=10*(e-232)+8;return[t,t,t]}e-=16;var a=255*(xe(e/36)/5),r=255*(xe((i=e%36)/6)/5),o=255*(i%6/5),i;return[a,r,o]},o.rgb.hex=function(e){var t=((255&Te(e[0]))<<16)+((255&Te(e[1]))<<8)+(255&Te(e[2])),r=t.toString(16).toUpperCase();return"000000".substring(r.length)+r},o.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var r=t[0];3===t[0].length&&(r=r.split("").map(function(e){return e+e}).join(""));var a=parseInt(r,16);return[255&a>>16,255&a>>8,255&a]},o.rgb.hcg=function(e){var t=e[0]/255,r=e[1]/255,a=e[2]/255,o=Re(Re(t,r),a),i=Ee(Ee(t,r),a),n=o-i,l,s;return l=1>n?i/(1-n):0,s=0>=n?0:o===t?(r-a)/n%6:o===r?2+(a-t)/n:4+(t-r)/n+4,s/=6,s%=1,[360*s,100*n,100*l]},o.hsl.hcg=function(e){var t=e[1]/100,r=e[2]/100,a=1,o=0;return a=.5>r?2*t*r:2*t*(1-r),1>a&&(o=(r-.5*a)/(1-a)),[e[0],100*a,100*o]},o.hsv.hcg=function(e){var t=e[1]/100,r=e[2]/100,a=t*r,o=0;return 1>a&&(o=(r-a)/(1-a)),[e[0],100*a,100*o]},o.hcg.rgb=function(e){var t=e[0]/360,r=e[1]/100,a=e[2]/100;if(0===r)return[255*a,255*a,255*a];var o=[0,0,0],i=6*(t%1),n=i%1,l=1-n,s=0;switch(xe(i)){case 0:o[0]=1,o[1]=n,o[2]=0;break;case 1:o[0]=l,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=n;break;case 3:o[0]=0,o[1]=l,o[2]=1;break;case 4:o[0]=n,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=l;}return s=(1-r)*a,[255*(r*o[0]+s),255*(r*o[1]+s),255*(r*o[2]+s)]},o.hcg.hsv=function(e){var t=e[1]/100,r=e[2]/100,a=t+r*(1-t),o=0;return 0a?o=t/(2*a):.5<=a&&1>a&&(o=t/(2*(1-a))),[e[0],100*o,100*a]},o.hcg.hwb=function(e){var t=e[1]/100,r=e[2]/100,a=t+r*(1-t);return[e[0],100*(a-t),100*(1-a)]},o.hwb.hcg=function(e){var t=e[1]/100,r=e[2]/100,a=1-r,o=a-t,i=0;return 1>o&&(i=(a-o)/(1-o)),[e[0],100*o,100*i]},o.apple.rgb=function(e){return[255*(e[0]/65535),255*(e[1]/65535),255*(e[2]/65535)]},o.rgb.apple=function(e){return[65535*(e[0]/255),65535*(e[1]/255),65535*(e[2]/255)]},o.gray.rgb=function(e){return[255*(e[0]/100),255*(e[0]/100),255*(e[0]/100)]},o.gray.hsl=o.gray.hsv=function(e){return[0,0,e[0]]},o.gray.hwb=function(e){return[0,100,e[0]]},o.gray.cmyk=function(e){return[0,0,0,e[0]]},o.gray.lab=function(e){return[e[0],0,0]},o.gray.hex=function(e){var t=255&Te(255*(e[0]/100)),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},o.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[100*(t/255)]}}),Ce=De.rgb,ke=De.hsl,Oe=De.hsv,Me=De.hwb,ze=De.cmyk,Ue=De.xyz,Ye=De.lab,Ne=De.lch,Ie=De.hex,qe=De.keyword,je=De.ansi16,Ve=De.ansi256,Xe=De.hcg,He=De.apple,Ze=De.gray,Ge=function(e){for(var t=n(e),r={},a=Object.keys(t),o=a.length,l=0;l=a?a/12.92:be((a+.055)/1.055,2.4);return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(e){// http://www.w3.org/TR/WCAG20/#contrast-ratiodef var t=this.luminosity(),r=e.luminosity();return t>r?(t+.05)/(r+.05):(r+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return 7.1<=t?"AAA":4.5<=t?"AA":""},isDark:function(){// YIQ equation from http://24ways.org/2010/calculating-color-contrast var e=this.rgb().color,t=(299*e[0]+587*e[1]+114*e[2])/1e3;return 128>t},isLight:function(){return!this.isDark()},negate:function(){for(var e=this.rgb(),t=0;3>t;t++)e.color[t]=255-e.color[t];return e},lighten:function(e){var t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken:function(e){var t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate:function(e){var t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate:function(e){var t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten:function(e){var t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken:function(e){var t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale:function(){// http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale var e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return f.rgb(t,t,t)},fade:function(e){return this.alpha(this.valpha-this.valpha*e)},opaquer:function(e){return this.alpha(this.valpha+this.valpha*e)},rotate:function(e){var t=this.hsl(),r=t.color[0];return r=(r+e)%360,r=0>r?360+r:r,t.color[0]=r,t},mix:function(e,t){// ported from sass implementation in C // https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 if(!e||!e.rgb)throw new Error("Argument to \"mix\" was not a Color instance, but rather an instance of "+typeof e);var r=e.rgb(),o=this.rgb(),i=t===void 0?.5:t,n=2*i-1,l=r.alpha()-o.alpha(),a=((-1==n*l?n:(n+l)/(1+n*l))+1)/2,s=1-a;return f.rgb(a*r.red()+s*o.red(),a*r.green()+s*o.green(),a*r.blue()+s*o.blue(),r.alpha()*i+o.alpha()*(1-i))}},Object.keys(Ke).forEach(function(e){if(-1===$e.indexOf(e)){var t=Ke[e].channels;// conversion methods f.prototype[e]=function(){if(this.model===e)return new f(this);if(arguments.length)return new f(arguments,e);var r="number"==typeof arguments[t]?t:this.valpha;return new f(y(Ke[this.model][e].raw(this.color)).concat(r),e)},f[e]=function(r){return"number"==typeof r&&(r=h(Je.call(arguments),t)),new f(r,e)}}});var rt=f,at=a(function(e,t){/** * Convert Degree To Radian * * @param {Number} a Angle in Degrees */ /** * Tests whether or not the arguments have approximately the same value, within an absolute * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less * than or equal to 1.0, and a relative tolerance is used for larger values) * * @param {Number} a The first number to test. * @param {Number} b The second number to test. * @returns {Boolean} True if the numbers are approximately equal, false otherwise. */Object.defineProperty(t,"__esModule",{value:!0}),t.setMatrixArrayType=function(e){t.ARRAY_TYPE=a=e},t.toRadian=function(e){return e*i},t.equals=function(e,t){return _e(e-t)<=r*Re(1,_e(e),_e(t))},t.RANDOM=t.ARRAY_TYPE=t.EPSILON=void 0;/** * Common utilities * @module glMatrix */ // Configuration Constants var r=1e-6;t.EPSILON=r;var a="undefined"==typeof Float32Array?Array:Float32Array;t.ARRAY_TYPE=a;var o=Math.random;/** * Sets the type of array used when creating new vectors and matrices * * @param {Type} type Array type, such as Float32Array or Array */t.RANDOM=o;var i=Ae/180});r(at);var ot=at.setMatrixArrayType,it=at.toRadian,nt=at.equals,lt=at.RANDOM,st=at.ARRAY_TYPE,ut=at.EPSILON,dt=a(function(e,t){/** * 2x2 Matrix * @module mat2 */ /** * Creates a new identity mat2 * * @returns {mat2} a new 2x2 matrix */ /** * Creates a new mat2 initialized with values from an existing matrix * * @param {mat2} a matrix to clone * @returns {mat2} a new 2x2 matrix */ /** * Copy the values from one mat2 to another * * @param {mat2} out the receiving matrix * @param {mat2} a the source matrix * @returns {mat2} out */ /** * Set a mat2 to the identity matrix * * @param {mat2} out the receiving matrix * @returns {mat2} out */ /** * Create a new mat2 with the given values * * @param {Number} m00 Component in column 0, row 0 position (index 0) * @param {Number} m01 Component in column 0, row 1 position (index 1) * @param {Number} m10 Component in column 1, row 0 position (index 2) * @param {Number} m11 Component in column 1, row 1 position (index 3) * @returns {mat2} out A new 2x2 matrix */ /** * Set the components of a mat2 to the given values * * @param {mat2} out the receiving matrix * @param {Number} m00 Component in column 0, row 0 position (index 0) * @param {Number} m01 Component in column 0, row 1 position (index 1) * @param {Number} m10 Component in column 1, row 0 position (index 2) * @param {Number} m11 Component in column 1, row 1 position (index 3) * @returns {mat2} out */ /** * Transpose the values of a mat2 * * @param {mat2} out the receiving matrix * @param {mat2} a the source matrix * @returns {mat2} out */ /** * Inverts a mat2 * * @param {mat2} out the receiving matrix * @param {mat2} a the source matrix * @returns {mat2} out */ /** * Calculates the adjugate of a mat2 * * @param {mat2} out the receiving matrix * @param {mat2} a the source matrix * @returns {mat2} out */ /** * Calculates the determinant of a mat2 * * @param {mat2} a the source matrix * @returns {Number} determinant of a */ /** * Multiplies two mat2's * * @param {mat2} out the receiving matrix * @param {mat2} a the first operand * @param {mat2} b the second operand * @returns {mat2} out */function r(e,t,r){var a=t[0],o=t[1],i=t[2],n=t[3],l=r[0],s=r[1],u=r[2],d=r[3];return e[0]=a*l+i*s,e[1]=o*l+n*s,e[2]=a*u+i*d,e[3]=o*u+n*d,e}/** * Rotates a mat2 by the given angle * * @param {mat2} out the receiving matrix * @param {mat2} a the matrix to rotate * @param {Number} rad the angle to rotate the matrix by * @returns {mat2} out */ /** * Subtracts matrix b from matrix a * * @param {mat2} out the receiving matrix * @param {mat2} a the first operand * @param {mat2} b the second operand * @returns {mat2} out */function a(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}/** * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) * * @param {mat2} a The first matrix. * @param {mat2} b The second matrix. * @returns {Boolean} True if the matrices are equal, false otherwise. */Object.defineProperty(t,"__esModule",{value:!0}),t.create=function(){var e=new o.ARRAY_TYPE(4);return o.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},t.clone=function(e){var t=new o.ARRAY_TYPE(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},t.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},t.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},t.fromValues=function(e,t,r,a){var i=new o.ARRAY_TYPE(4);return i[0]=e,i[1]=t,i[2]=r,i[3]=a,i},t.set=function(e,t,r,a,o){return e[0]=t,e[1]=r,e[2]=a,e[3]=o,e},t.transpose=function(e,t){// If we are transposing ourselves we can skip a few steps but have to cache // some values if(e===t){var r=t[1];e[1]=t[2],e[2]=r}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e},t.invert=function(e,t){var r=t[0],a=t[1],o=t[2],i=t[3],n=r*i-o*a;// Calculate the determinant return n?(n=1/n,e[0]=i*n,e[1]=-a*n,e[2]=-o*n,e[3]=r*n,e):null},t.adjoint=function(e,t){// Caching this value is nessecary if out == a var r=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=r,e},t.determinant=function(e){return e[0]*e[3]-e[2]*e[1]},t.multiply=r,t.rotate=function(e,t,r){var a=t[0],o=t[1],i=t[2],n=t[3],l=ve(r),s=ye(r);return e[0]=a*s+i*l,e[1]=o*s+n*l,e[2]=a*-l+i*s,e[3]=o*-l+n*s,e}/** * Scales the mat2 by the dimensions in the given vec2 * * @param {mat2} out the receiving matrix * @param {mat2} a the matrix to rotate * @param {vec2} v the vec2 to scale the matrix by * @returns {mat2} out **/,t.scale=function(e,t,r){var a=t[0],o=t[1],i=t[2],n=t[3],l=r[0],s=r[1];return e[0]=a*l,e[1]=o*l,e[2]=i*s,e[3]=n*s,e}/** * Creates a matrix from a given angle * This is equivalent to (but much faster than): * * mat2.identity(dest); * mat2.rotate(dest, dest, rad); * * @param {mat2} out mat2 receiving operation result * @param {Number} rad the angle to rotate the matrix by * @returns {mat2} out */,t.fromRotation=function(e,t){var r=ve(t),a=ye(t);return e[0]=a,e[1]=r,e[2]=-r,e[3]=a,e}/** * Creates a matrix from a vector scaling * This is equivalent to (but much faster than): * * mat2.identity(dest); * mat2.scale(dest, dest, vec); * * @param {mat2} out mat2 receiving operation result * @param {vec2} v Scaling vector * @returns {mat2} out */,t.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}/** * Returns a string representation of a mat2 * * @param {mat2} a matrix to represent as a string * @returns {String} string representation of the matrix */,t.str=function(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}/** * Returns Frobenius norm of a mat2 * * @param {mat2} a the matrix to calculate Frobenius norm of * @returns {Number} Frobenius norm */,t.frob=function(e){return he(be(e[0],2)+be(e[1],2)+be(e[2],2)+be(e[3],2))}/** * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix * @param {mat2} L the lower triangular matrix * @param {mat2} D the diagonal matrix * @param {mat2} U the upper triangular matrix * @param {mat2} a the input matrix to factorize */,t.LDU=function(e,t,r,o){return e[2]=o[2]/o[0],r[0]=o[0],r[1]=o[1],r[3]=o[3]-e[2]*r[1],[e,t,r]}/** * Adds two mat2's * * @param {mat2} out the receiving matrix * @param {mat2} a the first operand * @param {mat2} b the second operand * @returns {mat2} out */,t.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},t.subtract=a,t.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}/** * Returns whether or not the matrices have approximately the same elements in the same position. * * @param {mat2} a The first matrix. * @param {mat2} b The second matrix. * @returns {Boolean} True if the matrices are equal, false otherwise. */,t.equals=function(e,t){var r=e[0],a=e[1],i=e[2],n=e[3],l=t[0],s=t[1],u=t[2],d=t[3];return _e(r-l)<=o.EPSILON*Re(1,_e(r),_e(l))&&_e(a-s)<=o.EPSILON*Re(1,_e(a),_e(s))&&_e(i-u)<=o.EPSILON*Re(1,_e(i),_e(u))&&_e(n-d)<=o.EPSILON*Re(1,_e(n),_e(d))}/** * Multiply each element of the matrix by a scalar. * * @param {mat2} out the receiving matrix * @param {mat2} a the matrix to scale * @param {Number} b amount to scale the matrix's elements by * @returns {mat2} out */,t.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}/** * Adds two mat2's after multiplying each element of the second operand by a scalar value. * * @param {mat2} out the receiving vector * @param {mat2} a the first operand * @param {mat2} b the second operand * @param {Number} scale the amount to scale b's elements by before adding * @returns {mat2} out */,t.multiplyScalarAndAdd=function(e,t,r,a){return e[0]=t[0]+r[0]*a,e[1]=t[1]+r[1]*a,e[2]=t[2]+r[2]*a,e[3]=t[3]+r[3]*a,e}/** * Alias for {@link mat2.multiply} * @function */,t.sub=t.mul=void 0;var o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var a=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};a.get||a.set?Object.defineProperty(t,r,a):t[r]=e[r]}return t.default=e,t}(at);t.mul=r;t.sub=a});r(dt);var pt=dt.create,ft=dt.clone,ct=dt.copy,mt=dt.identity,gt=dt.fromValues,vt=dt.set,yt=dt.transpose,ht=dt.invert,xt=dt.adjoint,bt=dt.determinant,_t=dt.multiply,At=dt.rotate,Rt=dt.scale,Et=dt.fromRotation,Tt=dt.fromScaling,St=dt.str,Pt=dt.frob,Lt=dt.LDU,Ft=dt.add,Bt=dt.subtract,wt=dt.exactEquals,Dt=dt.equals,Ct=dt.multiplyScalar,kt=dt.multiplyScalarAndAdd,Ot=dt.sub,Mt=dt.mul,zt=a(function(e,t){/** * 2x3 Matrix * @module mat2d * * @description * A mat2d contains six elements defined as: *
 * [a, c, tx,
 *  b, d, ty]
 * 
* This is a short form for the 3x3 matrix: *
 * [a, c, tx,
 *  b, d, ty,
 *  0, 0, 1]
 * 
* The last row is ignored so the array is shorter and operations are faster. */ /** * Creates a new identity mat2d * * @returns {mat2d} a new 2x3 matrix */ /** * Creates a new mat2d initialized with values from an existing matrix * * @param {mat2d} a matrix to clone * @returns {mat2d} a new 2x3 matrix */ /** * Copy the values from one mat2d to another * * @param {mat2d} out the receiving matrix * @param {mat2d} a the source matrix * @returns {mat2d} out */ /** * Set a mat2d to the identity matrix * * @param {mat2d} out the receiving matrix * @returns {mat2d} out */ /** * Create a new mat2d with the given values * * @param {Number} a Component A (index 0) * @param {Number} b Component B (index 1) * @param {Number} c Component C (index 2) * @param {Number} d Component D (index 3) * @param {Number} tx Component TX (index 4) * @param {Number} ty Component TY (index 5) * @returns {mat2d} A new mat2d */ /** * Set the components of a mat2d to the given values * * @param {mat2d} out the receiving matrix * @param {Number} a Component A (index 0) * @param {Number} b Component B (index 1) * @param {Number} c Component C (index 2) * @param {Number} d Component D (index 3) * @param {Number} tx Component TX (index 4) * @param {Number} ty Component TY (index 5) * @returns {mat2d} out */ /** * Inverts a mat2d * * @param {mat2d} out the receiving matrix * @param {mat2d} a the source matrix * @returns {mat2d} out */ /** * Calculates the determinant of a mat2d * * @param {mat2d} a the source matrix * @returns {Number} determinant of a */ /** * Multiplies two mat2d's * * @param {mat2d} out the receiving matrix * @param {mat2d} a the first operand * @param {mat2d} b the second operand * @returns {mat2d} out */function r(e,t,r){var a=t[0],o=t[1],i=t[2],n=t[3],l=t[4],s=t[5],u=r[0],d=r[1],p=r[2],f=r[3],c=r[4],m=r[5];return e[0]=a*u+i*d,e[1]=o*u+n*d,e[2]=a*p+i*f,e[3]=o*p+n*f,e[4]=a*c+i*m+l,e[5]=o*c+n*m+s,e}/** * Rotates a mat2d by the given angle * * @param {mat2d} out the receiving matrix * @param {mat2d} a the matrix to rotate * @param {Number} rad the angle to rotate the matrix by * @returns {mat2d} out */ /** * Subtracts matrix b from matrix a * * @param {mat2d} out the receiving matrix * @param {mat2d} a the first operand * @param {mat2d} b the second operand * @returns {mat2d} out */function a(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e}/** * Multiply each element of the matrix by a scalar. * * @param {mat2d} out the receiving matrix * @param {mat2d} a the matrix to scale * @param {Number} b amount to scale the matrix's elements by * @returns {mat2d} out */Object.defineProperty(t,"__esModule",{value:!0}),t.create=function(){var e=new o.ARRAY_TYPE(6);return o.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[4]=0,e[5]=0),e[0]=1,e[3]=1,e},t.clone=function(e){var t=new o.ARRAY_TYPE(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},t.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},t.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},t.fromValues=function(e,t,r,a,i,n){var l=new o.ARRAY_TYPE(6);return l[0]=e,l[1]=t,l[2]=r,l[3]=a,l[4]=i,l[5]=n,l},t.set=function(e,t,r,a,o,i,n){return e[0]=t,e[1]=r,e[2]=a,e[3]=o,e[4]=i,e[5]=n,e},t.invert=function(e,t){var r=t[0],a=t[1],o=t[2],i=t[3],n=t[4],l=t[5],s=r*i-a*o;return s?(s=1/s,e[0]=i*s,e[1]=-a*s,e[2]=-o*s,e[3]=r*s,e[4]=(o*l-i*n)*s,e[5]=(a*n-r*l)*s,e):null},t.determinant=function(e){return e[0]*e[3]-e[1]*e[2]},t.multiply=r,t.rotate=function(e,t,r){var a=t[0],o=t[1],i=t[2],n=t[3],l=t[4],u=t[5],d=ve(r),s=ye(r);return e[0]=a*s+i*d,e[1]=o*s+n*d,e[2]=a*-d+i*s,e[3]=o*-d+n*s,e[4]=l,e[5]=u,e}/** * Scales the mat2d by the dimensions in the given vec2 * * @param {mat2d} out the receiving matrix * @param {mat2d} a the matrix to translate * @param {vec2} v the vec2 to scale the matrix by * @returns {mat2d} out **/,t.scale=function(e,t,r){var a=t[0],o=t[1],i=t[2],n=t[3],l=t[4],s=t[5],u=r[0],d=r[1];return e[0]=a*u,e[1]=o*u,e[2]=i*d,e[3]=n*d,e[4]=l,e[5]=s,e}/** * Translates the mat2d by the dimensions in the given vec2 * * @param {mat2d} out the receiving matrix * @param {mat2d} a the matrix to translate * @param {vec2} v the vec2 to translate the matrix by * @returns {mat2d} out **/,t.translate=function(e,t,r){var a=t[0],o=t[1],i=t[2],n=t[3],l=t[4],s=t[5],u=r[0],d=r[1];return e[0]=a,e[1]=o,e[2]=i,e[3]=n,e[4]=a*u+i*d+l,e[5]=o*u+n*d+s,e}/** * Creates a matrix from a given angle * This is equivalent to (but much faster than): * * mat2d.identity(dest); * mat2d.rotate(dest, dest, rad); * * @param {mat2d} out mat2d receiving operation result * @param {Number} rad the angle to rotate the matrix by * @returns {mat2d} out */,t.fromRotation=function(e,t){var r=ve(t),a=ye(t);return e[0]=a,e[1]=r,e[2]=-r,e[3]=a,e[4]=0,e[5]=0,e}/** * Creates a matrix from a vector scaling * This is equivalent to (but much faster than): * * mat2d.identity(dest); * mat2d.scale(dest, dest, vec); * * @param {mat2d} out mat2d receiving operation result * @param {vec2} v Scaling vector * @returns {mat2d} out */,t.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}/** * Creates a matrix from a vector translation * This is equivalent to (but much faster than): * * mat2d.identity(dest); * mat2d.translate(dest, dest, vec); * * @param {mat2d} out mat2d receiving operation result * @param {vec2} v Translation vector * @returns {mat2d} out */,t.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}/** * Returns a string representation of a mat2d * * @param {mat2d} a matrix to represent as a string * @returns {String} string representation of the matrix */,t.str=function(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"}/** * Returns Frobenius norm of a mat2d * * @param {mat2d} a the matrix to calculate Frobenius norm of * @returns {Number} Frobenius norm */,t.frob=function(e){return he(be(e[0],2)+be(e[1],2)+be(e[2],2)+be(e[3],2)+be(e[4],2)+be(e[5],2)+1)}/** * Adds two mat2d's * * @param {mat2d} out the receiving matrix * @param {mat2d} a the first operand * @param {mat2d} b the second operand * @returns {mat2d} out */,t.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e},t.subtract=a,t.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e}/** * Adds two mat2d's after multiplying each element of the second operand by a scalar value. * * @param {mat2d} out the receiving vector * @param {mat2d} a the first operand * @param {mat2d} b the second operand * @param {Number} scale the amount to scale b's elements by before adding * @returns {mat2d} out */,t.multiplyScalarAndAdd=function(e,t,r,a){return e[0]=t[0]+r[0]*a,e[1]=t[1]+r[1]*a,e[2]=t[2]+r[2]*a,e[3]=t[3]+r[3]*a,e[4]=t[4]+r[4]*a,e[5]=t[5]+r[5]*a,e}/** * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) * * @param {mat2d} a The first matrix. * @param {mat2d} b The second matrix. * @returns {Boolean} True if the matrices are equal, false otherwise. */,t.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}/** * Returns whether or not the matrices have approximately the same elements in the same position. * * @param {mat2d} a The first matrix. * @param {mat2d} b The second matrix. * @returns {Boolean} True if the matrices are equal, false otherwise. */,t.equals=function(e,t){var r=e[0],a=e[1],i=e[2],n=e[3],l=e[4],s=e[5],u=t[0],d=t[1],p=t[2],f=t[3],c=t[4],m=t[5];return _e(r-u)<=o.EPSILON*Re(1,_e(r),_e(u))&&_e(a-d)<=o.EPSILON*Re(1,_e(a),_e(d))&&_e(i-p)<=o.EPSILON*Re(1,_e(i),_e(p))&&_e(n-f)<=o.EPSILON*Re(1,_e(n),_e(f))&&_e(l-c)<=o.EPSILON*Re(1,_e(l),_e(c))&&_e(s-m)<=o.EPSILON*Re(1,_e(s),_e(m))}/** * Alias for {@link mat2d.multiply} * @function */,t.sub=t.mul=void 0;var o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var a=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};a.get||a.set?Object.defineProperty(t,r,a):t[r]=e[r]}return t.default=e,t}(at);t.mul=r;t.sub=a});r(zt);var Ut=zt.create,Yt=zt.clone,Nt=zt.copy,It=zt.identity,qt=zt.fromValues,jt=zt.set,Vt=zt.invert,Xt=zt.determinant,Ht=zt.multiply,Zt=zt.rotate,Gt=zt.scale,Wt=zt.translate,Qt=zt.fromRotation,Kt=zt.fromScaling,Jt=zt.fromTranslation,$t=zt.str,er=zt.frob,tr=zt.add,rr=zt.subtract,ar=zt.multiplyScalar,or=zt.multiplyScalarAndAdd,ir=zt.exactEquals,nr=zt.equals,lr=zt.sub,sr=zt.mul,ur=a(function(e,t){/** * 3x3 Matrix * @module mat3 */ /** * Creates a new identity mat3 * * @returns {mat3} a new 3x3 matrix */ /** * Copies the upper-left 3x3 values into the given mat3. * * @param {mat3} out the receiving 3x3 matrix * @param {mat4} a the source 4x4 matrix * @returns {mat3} out */ /** * Creates a new mat3 initialized with values from an existing matrix * * @param {mat3} a matrix to clone * @returns {mat3} a new 3x3 matrix */ /** * Copy the values from one mat3 to another * * @param {mat3} out the receiving matrix * @param {mat3} a the source matrix * @returns {mat3} out */ /** * Create a new mat3 with the given values * * @param {Number} m00 Component in column 0, row 0 position (index 0) * @param {Number} m01 Component in column 0, row 1 position (index 1) * @param {Number} m02 Component in column 0, row 2 position (index 2) * @param {Number} m10 Component in column 1, row 0 position (index 3) * @param {Number} m11 Component in column 1, row 1 position (index 4) * @param {Number} m12 Component in column 1, row 2 position (index 5) * @param {Number} m20 Component in column 2, row 0 position (index 6) * @param {Number} m21 Component in column 2, row 1 position (index 7) * @param {Number} m22 Component in column 2, row 2 position (index 8) * @returns {mat3} A new mat3 */ /** * Set the components of a mat3 to the given values * * @param {mat3} out the receiving matrix * @param {Number} m00 Component in column 0, row 0 position (index 0) * @param {Number} m01 Component in column 0, row 1 position (index 1) * @param {Number} m02 Component in column 0, row 2 position (index 2) * @param {Number} m10 Component in column 1, row 0 position (index 3) * @param {Number} m11 Component in column 1, row 1 position (index 4) * @param {Number} m12 Component in column 1, row 2 position (index 5) * @param {Number} m20 Component in column 2, row 0 position (index 6) * @param {Number} m21 Component in column 2, row 1 position (index 7) * @param {Number} m22 Component in column 2, row 2 position (index 8) * @returns {mat3} out */ /** * Set a mat3 to the identity matrix * * @param {mat3} out the receiving matrix * @returns {mat3} out */ /** * Transpose the values of a mat3 * * @param {mat3} out the receiving matrix * @param {mat3} a the source matrix * @returns {mat3} out */ /** * Inverts a mat3 * * @param {mat3} out the receiving matrix * @param {mat3} a the source matrix * @returns {mat3} out */ /** * Calculates the adjugate of a mat3 * * @param {mat3} out the receiving matrix * @param {mat3} a the source matrix * @returns {mat3} out */ /** * Calculates the determinant of a mat3 * * @param {mat3} a the source matrix * @returns {Number} determinant of a */ /** * Multiplies two mat3's * * @param {mat3} out the receiving matrix * @param {mat3} a the first operand * @param {mat3} b the second operand * @returns {mat3} out */function r(e,t,r){var a=t[0],o=t[1],i=t[2],n=t[3],l=t[4],s=t[5],u=t[6],d=t[7],p=t[8],f=r[0],c=r[1],m=r[2],g=r[3],v=r[4],y=r[5],h=r[6],x=r[7],b=r[8];return e[0]=f*a+c*n+m*u,e[1]=f*o+c*l+m*d,e[2]=f*i+c*s+m*p,e[3]=g*a+v*n+y*u,e[4]=g*o+v*l+y*d,e[5]=g*i+v*s+y*p,e[6]=h*a+x*n+b*u,e[7]=h*o+x*l+b*d,e[8]=h*i+x*s+b*p,e}/** * Translate a mat3 by the given vector * * @param {mat3} out the receiving matrix * @param {mat3} a the matrix to translate * @param {vec2} v vector to translate by * @returns {mat3} out */ /** * Subtracts matrix b from matrix a * * @param {mat3} out the receiving matrix * @param {mat3} a the first operand * @param {mat3} b the second operand * @returns {mat3} out */function a(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}/** * Multiply each element of the matrix by a scalar. * * @param {mat3} out the receiving matrix * @param {mat3} a the matrix to scale * @param {Number} b amount to scale the matrix's elements by * @returns {mat3} out */Object.defineProperty(t,"__esModule",{value:!0}),t.create=function(){var e=new o.ARRAY_TYPE(9);return o.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},t.fromMat4=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},t.clone=function(e){var t=new o.ARRAY_TYPE(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},t.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},t.fromValues=function(e,t,r,a,i,n,l,s,u){var d=new o.ARRAY_TYPE(9);return d[0]=e,d[1]=t,d[2]=r,d[3]=a,d[4]=i,d[5]=n,d[6]=l,d[7]=s,d[8]=u,d},t.set=function(e,t,r,a,o,i,n,l,s,u){return e[0]=t,e[1]=r,e[2]=a,e[3]=o,e[4]=i,e[5]=n,e[6]=l,e[7]=s,e[8]=u,e},t.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},t.transpose=function(e,t){// If we are transposing ourselves we can skip a few steps but have to cache some values if(e===t){var r=t[1],a=t[2],o=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=a,e[7]=o}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},t.invert=function(e,t){var r=t[0],a=t[1],o=t[2],i=t[3],n=t[4],l=t[5],s=t[6],u=t[7],d=t[8],p=d*n-l*u,f=-d*i+l*s,c=u*i-n*s,m=r*p+a*f+o*c;return m?(m=1/m,e[0]=p*m,e[1]=(-d*a+o*u)*m,e[2]=(l*a-o*n)*m,e[3]=f*m,e[4]=(d*r-o*s)*m,e[5]=(-l*r+o*i)*m,e[6]=c*m,e[7]=(-u*r+a*s)*m,e[8]=(n*r-a*i)*m,e):null},t.adjoint=function(e,t){var r=t[0],a=t[1],o=t[2],i=t[3],n=t[4],l=t[5],s=t[6],u=t[7],d=t[8];return e[0]=n*d-l*u,e[1]=o*u-a*d,e[2]=a*l-o*n,e[3]=l*s-i*d,e[4]=r*d-o*s,e[5]=o*i-r*l,e[6]=i*u-n*s,e[7]=a*s-r*u,e[8]=r*n-a*i,e},t.determinant=function(e){var t=e[0],r=e[1],a=e[2],o=e[3],i=e[4],n=e[5],l=e[6],s=e[7],u=e[8];return t*(u*i-n*s)+r*(-u*o+n*l)+a*(s*o-i*l)},t.multiply=r,t.translate=function(e,t,r){var a=t[0],o=t[1],i=t[2],n=t[3],l=t[4],s=t[5],u=t[6],d=t[7],p=t[8],f=r[0],c=r[1];return e[0]=a,e[1]=o,e[2]=i,e[3]=n,e[4]=l,e[5]=s,e[6]=f*a+c*n+u,e[7]=f*o+c*l+d,e[8]=f*i+c*s+p,e}/** * Rotates a mat3 by the given angle * * @param {mat3} out the receiving matrix * @param {mat3} a the matrix to rotate * @param {Number} rad the angle to rotate the matrix by * @returns {mat3} out */,t.rotate=function(e,t,r){var a=t[0],o=t[1],i=t[2],n=t[3],l=t[4],u=t[5],d=t[6],p=t[7],f=t[8],m=ve(r),s=ye(r);return e[0]=s*a+m*n,e[1]=s*o+m*l,e[2]=s*i+m*u,e[3]=s*n-m*a,e[4]=s*l-m*o,e[5]=s*u-m*i,e[6]=d,e[7]=p,e[8]=f,e}/** * Scales the mat3 by the dimensions in the given vec2 * * @param {mat3} out the receiving matrix * @param {mat3} a the matrix to rotate * @param {vec2} v the vec2 to scale the matrix by * @returns {mat3} out **/,t.scale=function(e,t,r){var a=r[0],o=r[1];return e[0]=a*t[0],e[1]=a*t[1],e[2]=a*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}/** * Creates a matrix from a vector translation * This is equivalent to (but much faster than): * * mat3.identity(dest); * mat3.translate(dest, dest, vec); * * @param {mat3} out mat3 receiving operation result * @param {vec2} v Translation vector * @returns {mat3} out */,t.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}/** * Creates a matrix from a given angle * This is equivalent to (but much faster than): * * mat3.identity(dest); * mat3.rotate(dest, dest, rad); * * @param {mat3} out mat3 receiving operation result * @param {Number} rad the angle to rotate the matrix by * @returns {mat3} out */,t.fromRotation=function(e,t){var r=ve(t),a=ye(t);return e[0]=a,e[1]=r,e[2]=0,e[3]=-r,e[4]=a,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}/** * Creates a matrix from a vector scaling * This is equivalent to (but much faster than): * * mat3.identity(dest); * mat3.scale(dest, dest, vec); * * @param {mat3} out mat3 receiving operation result * @param {vec2} v Scaling vector * @returns {mat3} out */,t.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}/** * Copies the values from a mat2d into a mat3 * * @param {mat3} out the receiving matrix * @param {mat2d} a the matrix to copy * @returns {mat3} out **/,t.fromMat2d=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}/** * Calculates a 3x3 matrix from the given quaternion * * @param {mat3} out mat3 receiving operation result * @param {quat} q Quaternion to create matrix from * * @returns {mat3} out */,t.fromQuat=function(e,t){var r=t[0],a=t[1],o=t[2],i=t[3],n=r+r,l=a+a,s=o+o,u=r*n,d=a*n,p=a*l,f=o*n,c=o*l,m=o*s,g=i*n,v=i*l,y=i*s;return e[0]=1-p-m,e[3]=d-y,e[6]=f+v,e[1]=d+y,e[4]=1-u-m,e[7]=c-g,e[2]=f-v,e[5]=c+g,e[8]=1-u-p,e}/** * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix * * @param {mat3} out mat3 receiving operation result * @param {mat4} a Mat4 to derive the normal matrix from * * @returns {mat3} out */,t.normalFromMat4=function(e,t){var r=t[0],a=t[1],o=t[2],i=t[3],n=t[4],l=t[5],s=t[6],u=t[7],d=t[8],p=t[9],f=t[10],c=t[11],m=t[12],g=t[13],v=t[14],y=t[15],h=r*l-a*n,x=r*s-o*n,b=r*u-i*n,_=a*s-o*l,A=a*u-i*l,R=o*u-i*s,E=d*g-p*m,T=d*v-f*m,S=d*y-c*m,P=p*v-f*g,L=p*y-c*g,F=f*y-c*v,B=h*F-x*L+b*P+_*S-A*T+R*E;return B?(B=1/B,e[0]=(l*F-s*L+u*P)*B,e[1]=(s*S-n*F-u*T)*B,e[2]=(n*L-l*S+u*E)*B,e[3]=(o*L-a*F-i*P)*B,e[4]=(r*F-o*S+i*T)*B,e[5]=(a*S-r*L-i*E)*B,e[6]=(g*R-v*A+y*_)*B,e[7]=(v*b-m*R-y*x)*B,e[8]=(m*A-g*b+y*h)*B,e):null}/** * Generates a 2D projection matrix with the given bounds * * @param {mat3} out mat3 frustum matrix will be written into * @param {number} width Width of your gl context * @param {number} height Height of gl context * @returns {mat3} out */,t.projection=function(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}/** * Returns a string representation of a mat3 * * @param {mat3} a matrix to represent as a string * @returns {String} string representation of the matrix */,t.str=function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}/** * Returns Frobenius norm of a mat3 * * @param {mat3} a the matrix to calculate Frobenius norm of * @returns {Number} Frobenius norm */,t.frob=function(e){return he(be(e[0],2)+be(e[1],2)+be(e[2],2)+be(e[3],2)+be(e[4],2)+be(e[5],2)+be(e[6],2)+be(e[7],2)+be(e[8],2))}/** * Adds two mat3's * * @param {mat3} out the receiving matrix * @param {mat3} a the first operand * @param {mat3} b the second operand * @returns {mat3} out */,t.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e},t.subtract=a,t.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e}/** * Adds two mat3's after multiplying each element of the second operand by a scalar value. * * @param {mat3} out the receiving vector * @param {mat3} a the first operand * @param {mat3} b the second operand * @param {Number} scale the amount to scale b's elements by before adding * @returns {mat3} out */,t.multiplyScalarAndAdd=function(e,t,r,a){return e[0]=t[0]+r[0]*a,e[1]=t[1]+r[1]*a,e[2]=t[2]+r[2]*a,e[3]=t[3]+r[3]*a,e[4]=t[4]+r[4]*a,e[5]=t[5]+r[5]*a,e[6]=t[6]+r[6]*a,e[7]=t[7]+r[7]*a,e[8]=t[8]+r[8]*a,e}/** * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) * * @param {mat3} a The first matrix. * @param {mat3} b The second matrix. * @returns {Boolean} True if the matrices are equal, false otherwise. */,t.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}/** * Returns whether or not the matrices have approximately the same elements in the same position. * * @param {mat3} a The first matrix. * @param {mat3} b The second matrix. * @returns {Boolean} True if the matrices are equal, false otherwise. */,t.equals=function(e,t){var r=e[0],a=e[1],i=e[2],n=e[3],l=e[4],s=e[5],u=e[6],d=e[7],p=e[8],f=t[0],c=t[1],m=t[2],g=t[3],v=t[4],y=t[5],h=t[6],x=t[7],b=t[8];return _e(r-f)<=o.EPSILON*Re(1,_e(r),_e(f))&&_e(a-c)<=o.EPSILON*Re(1,_e(a),_e(c))&&_e(i-m)<=o.EPSILON*Re(1,_e(i),_e(m))&&_e(n-g)<=o.EPSILON*Re(1,_e(n),_e(g))&&_e(l-v)<=o.EPSILON*Re(1,_e(l),_e(v))&&_e(s-y)<=o.EPSILON*Re(1,_e(s),_e(y))&&_e(u-h)<=o.EPSILON*Re(1,_e(u),_e(h))&&_e(d-x)<=o.EPSILON*Re(1,_e(d),_e(x))&&_e(p-b)<=o.EPSILON*Re(1,_e(p),_e(b))}/** * Alias for {@link mat3.multiply} * @function */,t.sub=t.mul=void 0;var o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var a=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};a.get||a.set?Object.defineProperty(t,r,a):t[r]=e[r]}return t.default=e,t}(at);t.mul=r;t.sub=a});r(ur);var dr=ur.create,pr=ur.fromMat4,fr=ur.clone,cr=ur.copy,mr=ur.fromValues,gr=ur.set,vr=ur.identity,yr=ur.transpose,hr=ur.invert,xr=ur.adjoint,br=ur.determinant,_r=ur.multiply,Ar=ur.translate,Rr=ur.rotate,Er=ur.scale,Tr=ur.fromTranslation,Sr=ur.fromRotation,Pr=ur.fromScaling,Lr=ur.fromMat2d,Fr=ur.fromQuat,Br=ur.normalFromMat4,wr=ur.projection,Dr=ur.str,Cr=ur.frob,kr=ur.add,Or=ur.subtract,Mr=ur.multiplyScalar,zr=ur.multiplyScalarAndAdd,Ur=ur.exactEquals,Yr=ur.equals,Nr=ur.sub,Ir=ur.mul,qr=a(function(e,t){/** * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied. * @module mat4 */ /** * Creates a new identity mat4 * * @returns {mat4} a new 4x4 matrix */ /** * Creates a new mat4 initialized with values from an existing matrix * * @param {mat4} a matrix to clone * @returns {mat4} a new 4x4 matrix */ /** * Copy the values from one mat4 to another * * @param {mat4} out the receiving matrix * @param {mat4} a the source matrix * @returns {mat4} out */ /** * Create a new mat4 with the given values * * @param {Number} m00 Component in column 0, row 0 position (index 0) * @param {Number} m01 Component in column 0, row 1 position (index 1) * @param {Number} m02 Component in column 0, row 2 position (index 2) * @param {Number} m03 Component in column 0, row 3 position (index 3) * @param {Number} m10 Component in column 1, row 0 position (index 4) * @param {Number} m11 Component in column 1, row 1 position (index 5) * @param {Number} m12 Component in column 1, row 2 position (index 6) * @param {Number} m13 Component in column 1, row 3 position (index 7) * @param {Number} m20 Component in column 2, row 0 position (index 8) * @param {Number} m21 Component in column 2, row 1 position (index 9) * @param {Number} m22 Component in column 2, row 2 position (index 10) * @param {Number} m23 Component in column 2, row 3 position (index 11) * @param {Number} m30 Component in column 3, row 0 position (index 12) * @param {Number} m31 Component in column 3, row 1 position (index 13) * @param {Number} m32 Component in column 3, row 2 position (index 14) * @param {Number} m33 Component in column 3, row 3 position (index 15) * @returns {mat4} A new mat4 */ /** * Set the components of a mat4 to the given values * * @param {mat4} out the receiving matrix * @param {Number} m00 Component in column 0, row 0 position (index 0) * @param {Number} m01 Component in column 0, row 1 position (index 1) * @param {Number} m02 Component in column 0, row 2 position (index 2) * @param {Number} m03 Component in column 0, row 3 position (index 3) * @param {Number} m10 Component in column 1, row 0 position (index 4) * @param {Number} m11 Component in column 1, row 1 position (index 5) * @param {Number} m12 Component in column 1, row 2 position (index 6) * @param {Number} m13 Component in column 1, row 3 position (index 7) * @param {Number} m20 Component in column 2, row 0 position (index 8) * @param {Number} m21 Component in column 2, row 1 position (index 9) * @param {Number} m22 Component in column 2, row 2 position (index 10) * @param {Number} m23 Component in column 2, row 3 position (index 11) * @param {Number} m30 Component in column 3, row 0 position (index 12) * @param {Number} m31 Component in column 3, row 1 position (index 13) * @param {Number} m32 Component in column 3, row 2 position (index 14) * @param {Number} m33 Component in column 3, row 3 position (index 15) * @returns {mat4} out */ /** * Set a mat4 to the identity matrix * * @param {mat4} out the receiving matrix * @returns {mat4} out */function r(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}/** * Transpose the values of a mat4 * * @param {mat4} out the receiving matrix * @param {mat4} a the source matrix * @returns {mat4} out */ /** * Multiplies two mat4s * * @param {mat4} out the receiving matrix * @param {mat4} a the first operand * @param {mat4} b the second operand * @returns {mat4} out */function a(e,t,r){var a=t[0],o=t[1],i=t[2],n=t[3],l=t[4],s=t[5],u=t[6],d=t[7],p=t[8],f=t[9],c=t[10],m=t[11],g=t[12],v=t[13],y=t[14],h=t[15],x=r[0],b=r[1],_=r[2],A=r[3];return e[0]=x*a+b*l+_*p+A*g,e[1]=x*o+b*s+_*f+A*v,e[2]=x*i+b*u+_*c+A*y,e[3]=x*n+b*d+_*m+A*h,x=r[4],b=r[5],_=r[6],A=r[7],e[4]=x*a+b*l+_*p+A*g,e[5]=x*o+b*s+_*f+A*v,e[6]=x*i+b*u+_*c+A*y,e[7]=x*n+b*d+_*m+A*h,x=r[8],b=r[9],_=r[10],A=r[11],e[8]=x*a+b*l+_*p+A*g,e[9]=x*o+b*s+_*f+A*v,e[10]=x*i+b*u+_*c+A*y,e[11]=x*n+b*d+_*m+A*h,x=r[12],b=r[13],_=r[14],A=r[15],e[12]=x*a+b*l+_*p+A*g,e[13]=x*o+b*s+_*f+A*v,e[14]=x*i+b*u+_*c+A*y,e[15]=x*n+b*d+_*m+A*h,e}/** * Translate a mat4 by the given vector * * @param {mat4} out the receiving matrix * @param {mat4} a the matrix to translate * @param {vec3} v vector to translate by * @returns {mat4} out */ /** * Creates a matrix from a quaternion rotation and vector translation * This is equivalent to (but much faster than): * * mat4.identity(dest); * mat4.translate(dest, vec); * let quatMat = mat4.create(); * quat4.toMat4(quat, quatMat); * mat4.multiply(dest, quatMat); * * @param {mat4} out mat4 receiving operation result * @param {quat4} q Rotation quaternion * @param {vec3} v Translation vector * @returns {mat4} out */function o(e,t,r){// Quaternion math var a=t[0],o=t[1],i=t[2],n=t[3],l=a+a,s=o+o,u=i+i,d=a*l,p=a*s,f=a*u,c=o*s,m=o*u,g=i*u,v=n*l,y=n*s,h=n*u;return e[0]=1-(c+g),e[1]=p+h,e[2]=f-y,e[3]=0,e[4]=p-h,e[5]=1-(d+g),e[6]=m+v,e[7]=0,e[8]=f+y,e[9]=m-v,e[10]=1-(d+c),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}/** * Creates a new mat4 from a dual quat. * * @param {mat4} out Matrix * @param {quat2} a Dual Quaternion * @returns {mat4} mat4 receiving operation result */ /** * Subtracts matrix b from matrix a * * @param {mat4} out the receiving matrix * @param {mat4} a the first operand * @param {mat4} b the second operand * @returns {mat4} out */function i(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}/** * Multiply each element of the matrix by a scalar. * * @param {mat4} out the receiving matrix * @param {mat4} a the matrix to scale * @param {Number} b amount to scale the matrix's elements by * @returns {mat4} out */Object.defineProperty(t,"__esModule",{value:!0}),t.create=function(){var e=new n.ARRAY_TYPE(16);return n.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},t.clone=function(e){var t=new n.ARRAY_TYPE(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.fromValues=function(e,t,r,a,o,i,l,s,u,d,p,f,c,m,g,v){var y=new n.ARRAY_TYPE(16);return y[0]=e,y[1]=t,y[2]=r,y[3]=a,y[4]=o,y[5]=i,y[6]=l,y[7]=s,y[8]=u,y[9]=d,y[10]=p,y[11]=f,y[12]=c,y[13]=m,y[14]=g,y[15]=v,y},t.set=function(e,t,r,a,o,i,n,l,s,u,d,p,f,c,m,g,v){return e[0]=t,e[1]=r,e[2]=a,e[3]=o,e[4]=i,e[5]=n,e[6]=l,e[7]=s,e[8]=u,e[9]=d,e[10]=p,e[11]=f,e[12]=c,e[13]=m,e[14]=g,e[15]=v,e},t.identity=r,t.transpose=function(e,t){// If we are transposing ourselves we can skip a few steps but have to cache some values if(e===t){var r=t[1],a=t[2],o=t[3],i=t[6],n=t[7],l=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=a,e[9]=i,e[11]=t[14],e[12]=o,e[13]=n,e[14]=l}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}/** * Inverts a mat4 * * @param {mat4} out the receiving matrix * @param {mat4} a the source matrix * @returns {mat4} out */,t.invert=function(e,t){var r=t[0],a=t[1],o=t[2],i=t[3],n=t[4],l=t[5],s=t[6],u=t[7],d=t[8],p=t[9],f=t[10],c=t[11],m=t[12],g=t[13],v=t[14],y=t[15],h=r*l-a*n,x=r*s-o*n,b=r*u-i*n,_=a*s-o*l,A=a*u-i*l,R=o*u-i*s,E=d*g-p*m,T=d*v-f*m,S=d*y-c*m,P=p*v-f*g,L=p*y-c*g,F=f*y-c*v,B=h*F-x*L+b*P+_*S-A*T+R*E;return B?(B=1/B,e[0]=(l*F-s*L+u*P)*B,e[1]=(o*L-a*F-i*P)*B,e[2]=(g*R-v*A+y*_)*B,e[3]=(f*A-p*R-c*_)*B,e[4]=(s*S-n*F-u*T)*B,e[5]=(r*F-o*S+i*T)*B,e[6]=(v*b-m*R-y*x)*B,e[7]=(d*R-f*b+c*x)*B,e[8]=(n*L-l*S+u*E)*B,e[9]=(a*S-r*L-i*E)*B,e[10]=(m*A-g*b+y*h)*B,e[11]=(p*b-d*A-c*h)*B,e[12]=(l*T-n*P-s*E)*B,e[13]=(r*P-a*T+o*E)*B,e[14]=(g*x-m*_-v*h)*B,e[15]=(d*_-p*x+f*h)*B,e):null}/** * Calculates the adjugate of a mat4 * * @param {mat4} out the receiving matrix * @param {mat4} a the source matrix * @returns {mat4} out */,t.adjoint=function(e,t){var r=t[0],a=t[1],o=t[2],i=t[3],n=t[4],l=t[5],s=t[6],u=t[7],d=t[8],p=t[9],f=t[10],c=t[11],m=t[12],g=t[13],v=t[14],y=t[15];return e[0]=l*(f*y-c*v)-p*(s*y-u*v)+g*(s*c-u*f),e[1]=-(a*(f*y-c*v)-p*(o*y-i*v)+g*(o*c-i*f)),e[2]=a*(s*y-u*v)-l*(o*y-i*v)+g*(o*u-i*s),e[3]=-(a*(s*c-u*f)-l*(o*c-i*f)+p*(o*u-i*s)),e[4]=-(n*(f*y-c*v)-d*(s*y-u*v)+m*(s*c-u*f)),e[5]=r*(f*y-c*v)-d*(o*y-i*v)+m*(o*c-i*f),e[6]=-(r*(s*y-u*v)-n*(o*y-i*v)+m*(o*u-i*s)),e[7]=r*(s*c-u*f)-n*(o*c-i*f)+d*(o*u-i*s),e[8]=n*(p*y-c*g)-d*(l*y-u*g)+m*(l*c-u*p),e[9]=-(r*(p*y-c*g)-d*(a*y-i*g)+m*(a*c-i*p)),e[10]=r*(l*y-u*g)-n*(a*y-i*g)+m*(a*u-i*l),e[11]=-(r*(l*c-u*p)-n*(a*c-i*p)+d*(a*u-i*l)),e[12]=-(n*(p*v-f*g)-d*(l*v-s*g)+m*(l*f-s*p)),e[13]=r*(p*v-f*g)-d*(a*v-o*g)+m*(a*f-o*p),e[14]=-(r*(l*v-s*g)-n*(a*v-o*g)+m*(a*s-o*l)),e[15]=r*(l*f-s*p)-n*(a*f-o*p)+d*(a*s-o*l),e}/** * Calculates the determinant of a mat4 * * @param {mat4} a the source matrix * @returns {Number} determinant of a */,t.determinant=function(e){var t=e[0],r=e[1],a=e[2],o=e[3],i=e[4],n=e[5],l=e[6],s=e[7],u=e[8],d=e[9],p=e[10],f=e[11],c=e[12],m=e[13],g=e[14],v=e[15];// Calculate the determinant return(t*n-r*i)*(p*v-f*g)-(t*l-a*i)*(d*v-f*m)+(t*s-o*i)*(d*g-p*m)+(r*l-a*n)*(u*v-f*c)-(r*s-o*n)*(u*g-p*c)+(a*s-o*l)*(u*m-d*c)},t.multiply=a,t.translate=function(e,t,r){var a=r[0],o=r[1],i=r[2],n,l,s,u,d,p,f,c,m,g,v,y;return t===e?(e[12]=t[0]*a+t[4]*o+t[8]*i+t[12],e[13]=t[1]*a+t[5]*o+t[9]*i+t[13],e[14]=t[2]*a+t[6]*o+t[10]*i+t[14],e[15]=t[3]*a+t[7]*o+t[11]*i+t[15]):(n=t[0],l=t[1],s=t[2],u=t[3],d=t[4],p=t[5],f=t[6],c=t[7],m=t[8],g=t[9],v=t[10],y=t[11],e[0]=n,e[1]=l,e[2]=s,e[3]=u,e[4]=d,e[5]=p,e[6]=f,e[7]=c,e[8]=m,e[9]=g,e[10]=v,e[11]=y,e[12]=n*a+d*o+m*i+t[12],e[13]=l*a+p*o+g*i+t[13],e[14]=s*a+f*o+v*i+t[14],e[15]=u*a+c*o+y*i+t[15]),e}/** * Scales the mat4 by the dimensions in the given vec3 not using vectorization * * @param {mat4} out the receiving matrix * @param {mat4} a the matrix to scale * @param {vec3} v the vec3 to scale the matrix by * @returns {mat4} out **/,t.scale=function(e,t,r){var a=r[0],o=r[1],i=r[2];return e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e[3]=t[3]*a,e[4]=t[4]*o,e[5]=t[5]*o,e[6]=t[6]*o,e[7]=t[7]*o,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}/** * Rotates a mat4 by the given angle around the given axis * * @param {mat4} out the receiving matrix * @param {mat4} a the matrix to rotate * @param {Number} rad the angle to rotate the matrix by * @param {vec3} axis the axis to rotate around * @returns {mat4} out */,t.rotate=function(e,r,a,o){var i=o[0],l=o[1],u=o[2],d=he(i*i+l*l+u*u),p,f,m,g,v,h,b,_,A,R,E,T,S,P,L,F,B,w,D,C,k,O,M,U;return dt[5]&&t[0]>t[10]?(a=2*he(1+t[0]-t[5]-t[10]),e[3]=(t[6]-t[9])/a,e[0]=.25*a,e[1]=(t[1]+t[4])/a,e[2]=(t[8]+t[2])/a):t[5]>t[10]?(a=2*he(1+t[5]-t[0]-t[10]),e[3]=(t[8]-t[2])/a,e[0]=(t[1]+t[4])/a,e[1]=.25*a,e[2]=(t[6]+t[9])/a):(a=2*he(1+t[10]-t[0]-t[5]),e[3]=(t[1]-t[4])/a,e[0]=(t[8]+t[2])/a,e[1]=(t[6]+t[9])/a,e[2]=.25*a),e}/** * Creates a matrix from a quaternion rotation, vector translation and vector scale * This is equivalent to (but much faster than): * * mat4.identity(dest); * mat4.translate(dest, vec); * let quatMat = mat4.create(); * quat4.toMat4(quat, quatMat); * mat4.multiply(dest, quatMat); * mat4.scale(dest, scale) * * @param {mat4} out mat4 receiving operation result * @param {quat4} q Rotation quaternion * @param {vec3} v Translation vector * @param {vec3} s Scaling vector * @returns {mat4} out */,t.fromRotationTranslationScale=function(e,t,r,a){// Quaternion math var o=t[0],i=t[1],n=t[2],l=t[3],s=o+o,u=i+i,d=n+n,p=o*s,f=o*u,c=o*d,m=i*u,g=i*d,v=n*d,y=l*s,h=l*u,x=l*d,b=a[0],_=a[1],A=a[2];return e[0]=(1-(m+v))*b,e[1]=(f+x)*b,e[2]=(c-h)*b,e[3]=0,e[4]=(f-x)*_,e[5]=(1-(p+v))*_,e[6]=(g+y)*_,e[7]=0,e[8]=(c+h)*A,e[9]=(g-y)*A,e[10]=(1-(p+m))*A,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}/** * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin * This is equivalent to (but much faster than): * * mat4.identity(dest); * mat4.translate(dest, vec); * mat4.translate(dest, origin); * let quatMat = mat4.create(); * quat4.toMat4(quat, quatMat); * mat4.multiply(dest, quatMat); * mat4.scale(dest, scale) * mat4.translate(dest, negativeOrigin); * * @param {mat4} out mat4 receiving operation result * @param {quat4} q Rotation quaternion * @param {vec3} v Translation vector * @param {vec3} s Scaling vector * @param {vec3} o The origin vector around which to scale and rotate * @returns {mat4} out */,t.fromRotationTranslationScaleOrigin=function(e,t,r,a,i){// Quaternion math var o=t[0],n=t[1],l=t[2],s=t[3],u=o+o,d=n+n,p=l+l,f=o*u,c=o*d,m=o*p,g=n*d,v=n*p,y=l*p,h=s*u,x=s*d,b=s*p,_=a[0],A=a[1],R=a[2],E=i[0],T=i[1],S=i[2],P=(1-(g+y))*_,L=(c+b)*_,F=(m-x)*_,B=(c-b)*A,w=(1-(f+y))*A,D=(v+h)*A,C=(m+x)*R,k=(v-h)*R,O=(1-(f+g))*R;return e[0]=P,e[1]=L,e[2]=F,e[3]=0,e[4]=B,e[5]=w,e[6]=D,e[7]=0,e[8]=C,e[9]=k,e[10]=O,e[11]=0,e[12]=r[0]+E-(P*E+B*T+C*S),e[13]=r[1]+T-(L*E+w*T+k*S),e[14]=r[2]+S-(F*E+D*T+O*S),e[15]=1,e}/** * Calculates a 4x4 matrix from the given quaternion * * @param {mat4} out mat4 receiving operation result * @param {quat} q Quaternion to create matrix from * * @returns {mat4} out */,t.fromQuat=function(e,t){var r=t[0],a=t[1],o=t[2],i=t[3],n=r+r,l=a+a,s=o+o,u=r*n,d=a*n,p=a*l,f=o*n,c=o*l,m=o*s,g=i*n,v=i*l,y=i*s;return e[0]=1-p-m,e[1]=d+y,e[2]=f-v,e[3]=0,e[4]=d-y,e[5]=1-u-m,e[6]=c+g,e[7]=0,e[8]=f+v,e[9]=c-g,e[10]=1-u-p,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}/** * Generates a frustum matrix with the given bounds * * @param {mat4} out mat4 frustum matrix will be written into * @param {Number} left Left bound of the frustum * @param {Number} right Right bound of the frustum * @param {Number} bottom Bottom bound of the frustum * @param {Number} top Top bound of the frustum * @param {Number} near Near bound of the frustum * @param {Number} far Far bound of the frustum * @returns {mat4} out */,t.frustum=function(e,t,r,a,o,i,n){var l=1/(r-t),s=1/(o-a),u=1/(i-n);return e[0]=2*i*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*i*s,e[6]=0,e[7]=0,e[8]=(r+t)*l,e[9]=(o+a)*s,e[10]=(n+i)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*(n*i)*u,e[15]=0,e}/** * Generates a perspective projection matrix with the given bounds. * Passing null/undefined/no value for far will generate infinite projection matrix. * * @param {mat4} out mat4 frustum matrix will be written into * @param {number} fovy Vertical field of view in radians * @param {number} aspect Aspect ratio. typically viewport width/height * @param {number} near Near bound of the frustum * @param {number} far Far bound of the frustum, can be null or Infinity * @returns {mat4} out */,t.perspective=function(e,t,r,a,o){var i=1/ge(t/2),n;return e[0]=i/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=o&&o!==1/0?(n=1/(a-o),e[10]=(o+a)*n,e[14]=2*o*a*n):(e[10]=-1,e[14]=-2*a),e}/** * Generates a perspective projection matrix with the given field of view. * This is primarily useful for generating projection matrices to be used * with the still experiemental WebVR API. * * @param {mat4} out mat4 frustum matrix will be written into * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees * @param {number} near Near bound of the frustum * @param {number} far Far bound of the frustum * @returns {mat4} out */,t.perspectiveFromFieldOfView=function(e,t,r,a){var o=ge(t.upDegrees*Ae/180),i=ge(t.downDegrees*Ae/180),n=ge(t.leftDegrees*Ae/180),l=ge(t.rightDegrees*Ae/180),s=2/(n+l),u=2/(o+i);return e[0]=s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-(.5*((n-l)*s)),e[9]=.5*((o-i)*u),e[10]=a/(r-a),e[11]=-1,e[12]=0,e[13]=0,e[14]=a*r/(r-a),e[15]=0,e}/** * Generates a orthogonal projection matrix with the given bounds * * @param {mat4} out mat4 frustum matrix will be written into * @param {number} left Left bound of the frustum * @param {number} right Right bound of the frustum * @param {number} bottom Bottom bound of the frustum * @param {number} top Top bound of the frustum * @param {number} near Near bound of the frustum * @param {number} far Far bound of the frustum * @returns {mat4} out */,t.ortho=function(e,t,r,a,o,i,n){var l=1/(t-r),s=1/(a-o),u=1/(i-n);return e[0]=-2*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*l,e[13]=(o+a)*s,e[14]=(n+i)*u,e[15]=1,e}/** * Generates a look-at matrix with the given eye position, focal point, and up axis. * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. * * @param {mat4} out mat4 frustum matrix will be written into * @param {vec3} eye Position of the viewer * @param {vec3} center Point the viewer is looking at * @param {vec3} up vec3 pointing up * @returns {mat4} out */,t.lookAt=function(e,t,a,o){var i=t[0],l=t[1],s=t[2],u=o[0],d=o[1],p=o[2],f=a[0],c=a[1],m=a[2],g,v,y,h,x,b,_,A,R,E;return _e(i-f)i?Ae:ce(i)}/** * Set the components of a vec3 to zero * * @param {vec3} out the receiving vector * @returns {vec3} out */,t.zero=function(e){return e[0]=0,e[1]=0,e[2]=0,e}/** * Returns a string representation of a vector * * @param {vec3} a vector to represent as a string * @returns {String} string representation of the vector */,t.str=function(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}/** * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) * * @param {vec3} a The first vector. * @param {vec3} b The second vector. * @returns {Boolean} True if the vectors are equal, false otherwise. */,t.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}/** * Returns whether or not the vectors have approximately the same elements in the same position. * * @param {vec3} a The first vector. * @param {vec3} b The second vector. * @returns {Boolean} True if the vectors are equal, false otherwise. */,t.equals=function(e,t){var r=e[0],a=e[1],o=e[2],i=t[0],n=t[1],l=t[2];return _e(r-i)<=c.EPSILON*Re(1,_e(r),_e(i))&&_e(a-n)<=c.EPSILON*Re(1,_e(a),_e(n))&&_e(o-l)<=c.EPSILON*Re(1,_e(o),_e(l))}/** * Alias for {@link vec3.subtract} * @function */,t.forEach=t.sqrLen=t.len=t.sqrDist=t.dist=t.div=t.mul=t.sub=void 0;var c=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var a=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};a.get||a.set?Object.defineProperty(t,r,a):t[r]=e[r]}return t.default=e,t}(at);t.sub=i;t.mul=n;t.div=l;t.dist=s;t.sqrDist=u;t.len=a;t.sqrLen=d;var m=function(){var e=r();return function(t,r,a,o,n,s){var u,d;for(r||(r=3),a||(a=0),d=o?Ee(o*r+a,t.length):t.length,u=a;um&&(m=-m,s=-s,d=-d,p=-p,f=-f),1-m>u.EPSILON?(c=ce(m),g=ve(c),v=ve((1-o)*c)/g,y=ve(o*c)/g):(v=1-o,y=o),e[0]=v*t+y*s,e[1]=v*i+y*d,e[2]=v*n+y*p,e[3]=v*l+y*f,e}/** * Generates a random quaternion * * @param {quat} out the receiving quaternion * @returns {quat} out */ /** * Creates a quaternion from the given 3x3 rotation matrix. * * NOTE: The resultant quaternion is not normalized, so you should be sure * to renormalize the quaternion yourself where necessary. * * @param {quat} out the receiving quaternion * @param {mat3} m rotation matrix * @returns {quat} out * @function */function l(e,t){// Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes // article "Quaternion Calculus and Fast Animation". var r=t[0]+t[4]+t[8],a;if(0 1/2, may as well choose w > 1/2 // 2w // 1/(4w) a=he(r+1),e[3]=.5*a,a=.5/a,e[0]=(t[5]-t[7])*a,e[1]=(t[6]-t[2])*a,e[2]=(t[1]-t[3])*a;else{// |w| <= 1/2 var o=0;t[4]>t[0]&&(o=1),t[8]>t[3*o+o]&&(o=2);var n=(o+1)%3,l=(o+2)%3;a=he(t[3*o+o]-t[3*n+n]-t[3*l+l]+1),e[o]=.5*a,a=.5/a,e[3]=(t[3*n+l]-t[3*l+n])*a,e[n]=(t[3*n+o]+t[3*o+n])*a,e[l]=(t[3*l+o]+t[3*o+l])*a}return e}/** * Creates a quaternion from the given euler angle x, y, z. * * @param {quat} out the receiving quaternion * @param {x} Angle to rotate around X axis in degrees. * @param {y} Angle to rotate around Y axis in degrees. * @param {z} Angle to rotate around Z axis in degrees. * @returns {quat} out * @function */Object.defineProperty(t,"__esModule",{value:!0}),t.create=a,t.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},t.setAxisAngle=o,t.getAxisAngle=function(e,t){var r=2*ce(t[3]),a=ve(r/2);return a>u.EPSILON?(e[0]=t[0]/a,e[1]=t[1]/a,e[2]=t[2]/a):(e[0]=1,e[1]=0,e[2]=0),r},t.multiply=i,t.rotateX=function(e,t,r){r*=.5;var a=t[0],o=t[1],i=t[2],n=t[3],l=ve(r),s=ye(r);return e[0]=a*s+n*l,e[1]=o*s+i*l,e[2]=i*s-o*l,e[3]=n*s-a*l,e}/** * Rotates a quaternion by the given angle about the Y axis * * @param {quat} out quat receiving operation result * @param {quat} a quat to rotate * @param {number} rad angle (in radians) to rotate * @returns {quat} out */,t.rotateY=function(e,t,r){r*=.5;var a=t[0],o=t[1],i=t[2],n=t[3],l=ve(r),s=ye(r);return e[0]=a*s-i*l,e[1]=o*s+n*l,e[2]=i*s+a*l,e[3]=n*s-o*l,e}/** * Rotates a quaternion by the given angle about the Z axis * * @param {quat} out quat receiving operation result * @param {quat} a quat to rotate * @param {number} rad angle (in radians) to rotate * @returns {quat} out */,t.rotateZ=function(e,t,r){r*=.5;var a=t[0],o=t[1],i=t[2],n=t[3],l=ve(r),s=ye(r);return e[0]=a*s+o*l,e[1]=o*s-a*l,e[2]=i*s+n*l,e[3]=n*s-i*l,e}/** * Calculates the W component of a quat from the X, Y, and Z components. * Assumes that quaternion is 1 unit in length. * Any existing W component will be ignored. * * @param {quat} out the receiving quaternion * @param {quat} a quat to calculate W component of * @returns {quat} out */,t.calculateW=function(e,t){var r=t[0],a=t[1],o=t[2];return e[0]=r,e[1]=a,e[2]=o,e[3]=he(_e(1-r*r-a*a-o*o)),e},t.slerp=n,t.random=function(e){// Implementation of http://planning.cs.uiuc.edu/node198.html // TODO: Calling random 3 times is probably not the fastest solution var t=u.RANDOM(),r=u.RANDOM(),a=u.RANDOM(),o=he(1-t),i=he(t);return e[0]=o*ve(2*Ae*r),e[1]=o*ye(2*Ae*r),e[2]=i*ve(2*Ae*a),e[3]=i*ye(2*Ae*a),e}/** * Calculates the inverse of a quat * * @param {quat} out the receiving quaternion * @param {quat} a quat to calculate inverse of * @returns {quat} out */,t.invert=function(e,t){var r=t[0],a=t[1],o=t[2],i=t[3],n=r*r+a*a+o*o+i*i,l=n?1/n:0;return e[0]=-r*l,e[1]=-a*l,e[2]=-o*l,e[3]=i*l,e}/** * Calculates the conjugate of a quat * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. * * @param {quat} out the receiving quaternion * @param {quat} a quat to calculate conjugate of * @returns {quat} out */,t.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},t.fromMat3=l,t.fromEuler=function(e,t,r,a){var o=.5*Ae/180;t*=o,r*=o,a*=o;var i=ve(t),n=ye(t),l=ve(r),s=ye(r),u=ve(a),d=ye(a);return e[0]=i*s*d-n*l*u,e[1]=n*l*d+i*s*u,e[2]=n*s*u-i*l*d,e[3]=n*s*d+i*l*u,e}/** * Returns a string representation of a quatenion * * @param {quat} a vector to represent as a string * @returns {String} string representation of the vector */,t.str=function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}/** * Creates a new quat initialized with values from an existing quaternion * * @param {quat} a quaternion to clone * @returns {quat} a new quaternion * @function */,t.setAxes=t.sqlerp=t.rotationTo=t.equals=t.exactEquals=t.normalize=t.sqrLen=t.squaredLength=t.len=t.length=t.lerp=t.dot=t.scale=t.mul=t.add=t.set=t.copy=t.fromValues=t.clone=void 0;var u=r(at),d=r(ur),p=r(Ma),f=r(Do),c=f.clone;t.clone=c;var m=f.fromValues;/** * Copy the values from one quat to another * * @param {quat} out the receiving quaternion * @param {quat} a the source quaternion * @returns {quat} out * @function */t.fromValues=m;var g=f.copy;/** * Set the components of a quat to the given values * * @param {quat} out the receiving quaternion * @param {Number} x X component * @param {Number} y Y component * @param {Number} z Z component * @param {Number} w W component * @returns {quat} out * @function */t.copy=g;var v=f.set;/** * Adds two quat's * * @param {quat} out the receiving quaternion * @param {quat} a the first operand * @param {quat} b the second operand * @returns {quat} out * @function */t.set=v;var y=f.add;/** * Alias for {@link quat.multiply} * @function */t.add=y;t.mul=i;var h=f.scale;/** * Calculates the dot product of two quat's * * @param {quat} a the first operand * @param {quat} b the second operand * @returns {Number} dot product of a and b * @function */t.scale=h;var x=f.dot;/** * Performs a linear interpolation between two quat's * * @param {quat} out the receiving quaternion * @param {quat} a the first operand * @param {quat} b the second operand * @param {Number} t interpolation amount, in the range [0-1], between the two inputs * @returns {quat} out * @function */t.dot=x;var b=f.lerp;/** * Calculates the length of a quat * * @param {quat} a vector to calculate length of * @returns {Number} length of a */t.lerp=b;var _=f.length;/** * Alias for {@link quat.length} * @function */t.length=_;t.len=_;var A=f.squaredLength;/** * Alias for {@link quat.squaredLength} * @function */t.squaredLength=A;t.sqrLen=A;var R=f.normalize;/** * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) * * @param {quat} a The first quaternion. * @param {quat} b The second quaternion. * @returns {Boolean} True if the vectors are equal, false otherwise. */t.normalize=R;var E=f.exactEquals;/** * Returns whether or not the quaternions have approximately the same elements in the same position. * * @param {quat} a The first vector. * @param {quat} b The second vector. * @returns {Boolean} True if the vectors are equal, false otherwise. */t.exactEquals=E;var T=f.equals;/** * Sets a quaternion to represent the shortest rotation from one * vector to another. * * Both vectors are assumed to be unit length. * * @param {quat} out the receiving quaternion. * @param {vec3} a the initial vector * @param {vec3} b the destination vector * @returns {quat} out */t.equals=T;var S=function(){var e=p.create(),t=p.fromValues(1,0,0),r=p.fromValues(0,1,0);return function(i,n,a){var l=p.dot(n,a);return-.999999>l?(p.cross(e,t,n),1e-6>p.len(e)&&p.cross(e,r,n),p.normalize(e,e),o(i,e,Math.PI),i):.999999 * Format: [real, dual]
* Quaternion format: XYZW
* Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
* @module quat2 */ /** * Creates a new identity dual quat * * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation] */ /** * Creates a dual quat from a quaternion and a translation * * @param {quat2} dual quaternion receiving operation result * @param {quat} q quaternion * @param {vec3} t tranlation vector * @returns {quat2} dual quaternion receiving operation result * @function */function o(e,r,a){var t=.5*a[0],o=.5*a[1],i=.5*a[2],n=r[0],l=r[1],s=r[2],u=r[3];return e[0]=n,e[1]=l,e[2]=s,e[3]=u,e[4]=t*u+o*s-i*l,e[5]=o*u+i*n-t*s,e[6]=i*u+t*l-o*n,e[7]=-t*n-o*l-i*s,e}/** * Creates a dual quat from a translation * * @param {quat2} dual quaternion receiving operation result * @param {vec3} t translation vector * @returns {quat2} dual quaternion receiving operation result * @function */ /** * Copy the values from one dual quat to another * * @param {quat2} out the receiving dual quaternion * @param {quat2} a the source dual quaternion * @returns {quat2} out * @function */function i(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}/** * Set a dual quat to the identity dual quaternion * * @param {quat2} out the receiving quaternion * @returns {quat2} out */ /** * Multiplies two dual quat's * * @param {quat2} out the receiving dual quaternion * @param {quat2} a the first operand * @param {quat2} b the second operand * @returns {quat2} out */function n(e,t,r){var a=t[0],o=t[1],i=t[2],n=t[3],l=r[4],s=r[5],u=r[6],d=r[7],p=t[4],f=t[5],c=t[6],m=t[7],g=r[0],v=r[1],y=r[2],h=r[3];return e[0]=a*h+n*g+o*y-i*v,e[1]=o*h+n*v+i*g-a*y,e[2]=i*h+n*y+a*v-o*g,e[3]=n*h-a*g-o*v-i*y,e[4]=a*d+n*l+o*u-i*s+p*h+m*g+f*y-c*v,e[5]=o*d+n*s+i*l-a*u+f*h+m*v+c*g-p*y,e[6]=i*d+n*u+a*s-o*l+c*h+m*y+p*v-f*g,e[7]=n*d-a*l-o*s-i*u+m*h-p*g-f*v-c*y,e}/** * Alias for {@link quat2.multiply} * @function */Object.defineProperty(t,"__esModule",{value:!0}),t.create=function(){var e=new l.ARRAY_TYPE(8);return l.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0),e[3]=1,e}/** * Creates a new quat initialized with values from an existing quaternion * * @param {quat2} a dual quaternion to clone * @returns {quat2} new dual quaternion * @function */,t.clone=function(e){var t=new l.ARRAY_TYPE(8);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}/** * Creates a new dual quat initialized with the given values * * @param {Number} x1 X component * @param {Number} y1 Y component * @param {Number} z1 Z component * @param {Number} w1 W component * @param {Number} x2 X component * @param {Number} y2 Y component * @param {Number} z2 Z component * @param {Number} w2 W component * @returns {quat2} new dual quaternion * @function */,t.fromValues=function(e,t,r,a,o,i,n,s){var u=new l.ARRAY_TYPE(8);return u[0]=e,u[1]=t,u[2]=r,u[3]=a,u[4]=o,u[5]=i,u[6]=n,u[7]=s,u}/** * Creates a new dual quat from the given values (quat and translation) * * @param {Number} x1 X component * @param {Number} y1 Y component * @param {Number} z1 Z component * @param {Number} w1 W component * @param {Number} x2 X component (translation) * @param {Number} y2 Y component (translation) * @param {Number} z2 Z component (translation) * @returns {quat2} new dual quaternion * @function */,t.fromRotationTranslationValues=function(e,t,r,a,o,i,n){var s=new l.ARRAY_TYPE(8);s[0]=e,s[1]=t,s[2]=r,s[3]=a;var u=.5*o,d=.5*i,p=.5*n;return s[4]=u*a+d*r-p*t,s[5]=d*a+p*e-u*r,s[6]=p*a+u*t-d*e,s[7]=-u*e-d*t-p*r,s},t.fromRotationTranslation=o,t.fromTranslation=function(e,r){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=.5*r[0],e[5]=.5*r[1],e[6]=.5*r[2],e[7]=0,e}/** * Creates a dual quat from a quaternion * * @param {quat2} dual quaternion receiving operation result * @param {quat} q the quaternion * @returns {quat2} dual quaternion receiving operation result * @function */,t.fromRotation=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}/** * Creates a new dual quat from a matrix (4x4) * * @param {quat2} out the dual quaternion * @param {mat4} a the matrix * @returns {quat2} dual quat receiving operation result * @function */,t.fromMat4=function(e,r){//TODO Optimize this var a=s.create();u.getRotation(a,r);var i=new l.ARRAY_TYPE(3);return u.getTranslation(i,r),o(e,a,i),e},t.copy=i,t.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}/** * Set the components of a dual quat to the given values * * @param {quat2} out the receiving quaternion * @param {Number} x1 X component * @param {Number} y1 Y component * @param {Number} z1 Z component * @param {Number} w1 W component * @param {Number} x2 X component * @param {Number} y2 Y component * @param {Number} z2 Z component * @param {Number} w2 W component * @returns {quat2} out * @function */,t.set=function(e,t,r,a,o,i,n,l,s){return e[0]=t,e[1]=r,e[2]=a,e[3]=o,e[4]=i,e[5]=n,e[6]=l,e[7]=s,e}/** * Gets the real part of a dual quat * @param {quat} out real part * @param {quat2} a Dual Quaternion * @return {quat} real part */,t.getDual=function(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}/** * Set the real component of a dual quat to the given quaternion * * @param {quat2} out the receiving quaternion * @param {quat} q a quaternion representing the real part * @returns {quat2} out * @function */,t.setDual=function(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}/** * Gets the translation of a normalized dual quat * @param {vec3} out translation * @param {quat2} a Dual Quaternion to be decomposed * @return {vec3} translation */,t.getTranslation=function(e,t){var r=t[4],a=t[5],o=t[6],i=t[7],n=-t[0],l=-t[1],s=-t[2],u=t[3];return e[0]=2*(r*u+i*n+a*s-o*l),e[1]=2*(a*u+i*l+o*n-r*s),e[2]=2*(o*u+i*s+r*l-a*n),e}/** * Translates a dual quat by the given vector * * @param {quat2} out the receiving dual quaternion * @param {quat2} a the dual quaternion to translate * @param {vec3} v vector to translate by * @returns {quat2} out */,t.translate=function(e,t,r){var a=t[0],o=t[1],i=t[2],n=t[3],l=.5*r[0],s=.5*r[1],u=.5*r[2],d=t[4],p=t[5],f=t[6],c=t[7];return e[0]=a,e[1]=o,e[2]=i,e[3]=n,e[4]=n*l+o*u-i*s+d,e[5]=n*s+i*l-a*u+p,e[6]=n*u+a*s-o*l+f,e[7]=-a*l-o*s-i*u+c,e}/** * Rotates a dual quat around the X axis * * @param {quat2} out the receiving dual quaternion * @param {quat2} a the dual quaternion to rotate * @param {number} rad how far should the rotation be * @returns {quat2} out */,t.rotateX=function(e,t,r){var a=-t[0],o=-t[1],i=-t[2],n=t[3],l=t[4],u=t[5],d=t[6],p=t[7],f=l*n+p*a+u*i-d*o,c=u*n+p*o+d*a-l*i,m=d*n+p*i+l*o-u*a,g=p*n-l*a-u*o-d*i;return s.rotateX(e,t,r),a=e[0],o=e[1],i=e[2],n=e[3],e[4]=f*n+g*a+c*i-m*o,e[5]=c*n+g*o+m*a-f*i,e[6]=m*n+g*i+f*o-c*a,e[7]=g*n-f*a-c*o-m*i,e}/** * Rotates a dual quat around the Y axis * * @param {quat2} out the receiving dual quaternion * @param {quat2} a the dual quaternion to rotate * @param {number} rad how far should the rotation be * @returns {quat2} out */,t.rotateY=function(e,t,r){var a=-t[0],o=-t[1],i=-t[2],n=t[3],l=t[4],u=t[5],d=t[6],p=t[7],f=l*n+p*a+u*i-d*o,c=u*n+p*o+d*a-l*i,m=d*n+p*i+l*o-u*a,g=p*n-l*a-u*o-d*i;return s.rotateY(e,t,r),a=e[0],o=e[1],i=e[2],n=e[3],e[4]=f*n+g*a+c*i-m*o,e[5]=c*n+g*o+m*a-f*i,e[6]=m*n+g*i+f*o-c*a,e[7]=g*n-f*a-c*o-m*i,e}/** * Rotates a dual quat around the Z axis * * @param {quat2} out the receiving dual quaternion * @param {quat2} a the dual quaternion to rotate * @param {number} rad how far should the rotation be * @returns {quat2} out */,t.rotateZ=function(e,t,r){var a=-t[0],o=-t[1],i=-t[2],n=t[3],l=t[4],u=t[5],d=t[6],p=t[7],f=l*n+p*a+u*i-d*o,c=u*n+p*o+d*a-l*i,m=d*n+p*i+l*o-u*a,g=p*n-l*a-u*o-d*i;return s.rotateZ(e,t,r),a=e[0],o=e[1],i=e[2],n=e[3],e[4]=f*n+g*a+c*i-m*o,e[5]=c*n+g*o+m*a-f*i,e[6]=m*n+g*i+f*o-c*a,e[7]=g*n-f*a-c*o-m*i,e}/** * Rotates a dual quat by a given quaternion (a * q) * * @param {quat2} out the receiving dual quaternion * @param {quat2} a the dual quaternion to rotate * @param {quat} q quaternion to rotate by * @returns {quat2} out */,t.rotateByQuatAppend=function(e,t,r){var a=r[0],o=r[1],i=r[2],n=r[3],l=t[0],s=t[1],u=t[2],d=t[3];return e[0]=l*n+d*a+s*i-u*o,e[1]=s*n+d*o+u*a-l*i,e[2]=u*n+d*i+l*o-s*a,e[3]=d*n-l*a-s*o-u*i,l=t[4],s=t[5],u=t[6],d=t[7],e[4]=l*n+d*a+s*i-u*o,e[5]=s*n+d*o+u*a-l*i,e[6]=u*n+d*i+l*o-s*a,e[7]=d*n-l*a-s*o-u*i,e}/** * Rotates a dual quat by a given quaternion (q * a) * * @param {quat2} out the receiving dual quaternion * @param {quat} q quaternion to rotate by * @param {quat2} a the dual quaternion to rotate * @returns {quat2} out */,t.rotateByQuatPrepend=function(e,t,r){var a=t[0],o=t[1],i=t[2],n=t[3],l=r[0],s=r[1],u=r[2],d=r[3];return e[0]=a*d+n*l+o*u-i*s,e[1]=o*d+n*s+i*l-a*u,e[2]=i*d+n*u+a*s-o*l,e[3]=n*d-a*l-o*s-i*u,l=r[4],s=r[5],u=r[6],d=r[7],e[4]=a*d+n*l+o*u-i*s,e[5]=o*d+n*s+i*l-a*u,e[6]=i*d+n*u+a*s-o*l,e[7]=n*d-a*l-o*s-i*u,e}/** * Rotates a dual quat around a given axis. Does the normalisation automatically * * @param {quat2} out the receiving dual quaternion * @param {quat2} a the dual quaternion to rotate * @param {vec3} axis the axis to rotate around * @param {Number} rad how far the rotation should be * @returns {quat2} out */,t.rotateAroundAxis=function(e,t,r,a){//Special case for rad = 0 if(_e(a)f(r,a)&&(o=-o),e[0]=r[0]*i+a[0]*o,e[1]=r[1]*i+a[1]*o,e[2]=r[2]*i+a[2]*o,e[3]=r[3]*i+a[3]*o,e[4]=r[4]*i+a[4]*o,e[5]=r[5]*i+a[5]*o,e[6]=r[6]*i+a[6]*o,e[7]=r[7]*i+a[7]*o,e}/** * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper * * @param {quat2} out the receiving dual quaternion * @param {quat2} a dual quat to calculate inverse of * @returns {quat2} out */,t.invert=function(e,t){var r=m(t);return e[0]=-t[0]/r,e[1]=-t[1]/r,e[2]=-t[2]/r,e[3]=t[3]/r,e[4]=-t[4]/r,e[5]=-t[5]/r,e[6]=-t[6]/r,e[7]=t[7]/r,e}/** * Calculates the conjugate of a dual quat * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result. * * @param {quat2} out the receiving quaternion * @param {quat2} a quat to calculate conjugate of * @returns {quat2} out */,t.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}/** * Calculates the length of a dual quat * * @param {quat2} a dual quat to calculate length of * @returns {Number} length of a * @function */,t.normalize=function(e,t){var r=m(t);if(0s?Ae:ce(s)}/** * Set the components of a vec2 to zero * * @param {vec2} out the receiving vector * @returns {vec2} out */,t.zero=function(e){return e[0]=0,e[1]=0,e}/** * Returns a string representation of a vector * * @param {vec2} a vector to represent as a string * @returns {String} string representation of the vector */,t.str=function(e){return"vec2("+e[0]+", "+e[1]+")"}/** * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===) * * @param {vec2} a The first vector. * @param {vec2} b The second vector. * @returns {Boolean} True if the vectors are equal, false otherwise. */,t.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]}/** * Returns whether or not the vectors have approximately the same elements in the same position. * * @param {vec2} a The first vector. * @param {vec2} b The second vector. * @returns {Boolean} True if the vectors are equal, false otherwise. */,t.equals=function(e,t){var r=e[0],a=e[1],o=t[0],i=t[1];return _e(r-o)<=d.EPSILON*Re(1,_e(r),_e(o))&&_e(a-i)<=d.EPSILON*Re(1,_e(a),_e(i))}/** * Alias for {@link vec2.length} * @function */,t.forEach=t.sqrLen=t.sqrDist=t.dist=t.div=t.mul=t.sub=t.len=void 0;var d=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var a=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};a.get||a.set?Object.defineProperty(t,r,a):t[r]=e[r]}return t.default=e,t}(at);t.len=s;t.sub=a;t.mul=o;t.div=i;t.dist=n;t.sqrDist=l;t.sqrLen=u;var p=function(){var e=r();return function(t,r,a,o,n,s){var u,d;for(r||(r=2),a||(a=0),d=o?Ee(o*r+a,t.length):t.length,u=a;ur&&(e=r),er&&(e=r),e0.0){float iX=ceil(v_position.x/diffDistance);float iZ=ceil(v_position.z/diffDistance);float timeDistance=8.0;t+=tan(sin(iZ));color*=(1.0+mod(t,timeDistance)/timeDistance);}}color.a=alpha;}else if(style==2.0){float t=time;float diffDistance=10.0;float modZ=mod(v_position.z-t*40.0,diffDistance*2.0);color.a=1.0-pow(v_position.z/v_height,0.5);if(v_position.z/v_height<0.3){color.r+=0.2;color.g+=0.2;color.b+=0.2;}if(modZ=v_height){color=vec4(0.3,0.3,0.3,0.3);}if(dis>u_radius-rSize&&dis=v.vertex[h].length||(t.bindBuffer(t.ARRAY_BUFFER,v.vertexBuffer[h]),t.vertexAttribPointer(u.a_pos,3,t.FLOAT,!1,y,0),t.vertexAttribPointer(u.a_normal,3,t.FLOAT,!1,y,12),t.vertexAttribPointer(u.a_color,3,t.FLOAT,!1,y,24),t.vertexAttribPointer(u.a_height,1,t.FLOAT,!1,y,36),this.options.texture&&t.vertexAttribPointer(u.a_texture_coord,2,t.FLOAT,!1,y,40),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,v.indexBuffer[h]),t.drawElements(t.TRIANGLES,v.index[h].length,t.UNSIGNED_SHORT,0),t.bindBuffer(t.ARRAY_BUFFER,null),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null));this.options.blend&&!1===d&&t.disable(t.BLEND),p&&t.enable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL)}},{key:"setData",value:function(e){e&&(this.data=e,this.dataMgr.parseData(this.data)),this.update()}},{key:"setOptions",value:function(e){e.pointOffset&&(this.webglLayer.options.pointOffset=e.pointOffset),this.options=e,this.loadTexture(),this.setData(this.data)}},{key:"loadTexture",value:function(){var e=this;this.options.texture?(this.vertexLength=12,this.isUseTexture=!0,P(this.gl,this.options.texture,function(t){e.texture=t,e.webglLayer.render()})):(this.vertexLength=10,this.isUseTexture=!1,this.texture=null)}},{key:"update",value:function(){this.webglLayer.render()}},{key:"destroy",value:function(){this.setData([])}},{key:"show",value:function(){this._isShow=!0,this.update()}},{key:"hide",value:function(){this._isShow=!1,this.webglLayer.clear()}}]),t}(is);/* eslint-disable */ie.prototype.initData=function(){this.outBuilding3d={vertex:[[]],vertexBuffer:[],index:[[]],indexBuffer:[]}},ie.prototype.getData=function(){return this.outBuilding3d},ie.prototype.initWorker=function(){this.worker=new ms,this.worker.onmessage=function(){}},ie.prototype.parseData=function(e){var t=this;this.initData(),this.shapeLayer.processData&&(e=this.shapeLayer.processData(e,this.shapeLayer.options));for(var r=this.gl,a=this.shapeLayer.options,o=function(r){var o=e[r],i=e[r].geometry.coordinates[0],n=[];i.forEach(function(e){var r=t.shapeLayer.normizedPoint(e);n.push(r[0],r[1])});var l=e[r].height||0;l*=1;var s=e[r].color||a.color||[.1,.1,.1];s instanceof Array||(s=rt(s).unitArray()),t.parseBuilding3d(n,l,s,t.outBuilding3d)},n=0;n=t))// 构建侧面 for(var P=0,L=e.length;P65536&&(x+=a.vertex[a.vertex.length-1].length/3,o(b,!1),a.vertex.push([]),a.color.push([]),a.index.push([])),o(b);for(var _=0;_f.maxX+m||~~b[1]>f.maxY+m||~~b[1]=e.canvas.width||0>=e.canvas.height)){var t=this.map;this.dataMgr.worker.postMessage({intensity:this.intensity.getImageData(),ctx:e.getImageData(0,0,e.canvas.width,e.canvas.height),totalScale:this.totalScale,canvasScale:this._canvasScale,canvasWidth:e.canvas.width,pointOffset:this.webglLayer.options.pointOffset||[0,0],canvasHeight:e.canvas.height,bound:t.getBounds(),mapSize:t.getSize(),center:t.getCenter(),zoomUnit:t.getZoomUnits()}),this.webglLayer.render()}}}]),t}(is),bs=new ae("./worker.js",function(){function e(){a=null,a={vertex:[[]],vertexBuffer:[],color:[[]],colorBuffer:[],index:[[]],indexBuffer:[]}}function t(t){function o(e,t){for(var r=0;r65536&&(x+=a.vertex[a.vertex.length-1].length/3,o(b,!1),a.vertex.push([]),a.color.push([]),a.index.push([])),o(b);for(var _=0;_f.maxX+m||~~h[1]>f.maxY+m||~~h[1]=e.canvas.width||0>=e.canvas.height)){var t=this.map;this.dataMgr.worker.postMessage({intensity:this.intensity.getImageData(),ctx:e.getImageData(0,0,e.canvas.width,e.canvas.height),totalScale:this.totalScale,canvasScale:this._canvasScale,canvasWidth:e.canvas.width,pointOffset:this.webglLayer.options.pointOffset||[0,0],canvasHeight:e.canvas.height,bound:t.getBounds(),mapSize:t.getSize(),center:t.getCenter(),zoomUnit:t.getZoomUnits()}),this.webglLayer.render()}};var _s=function(e){function t(e,r){Hl(this,t);var a=Wl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return a.bufferData=[],a}return Gl(t,e),Zl(t,[{key:"setData",value:function(e){var t=this.gl;this.data=e,this.buffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.buffer);for(var r=[],a=0,o;a=this.bufferData.length)){var a=this.program;t.useProgram(a.program),t.uniformMatrix4fv(a.uniforms.u_matrix,!1,r),t.bindBuffer(t.ARRAY_BUFFER,this.buffer),t.enableVertexAttribArray(a.attributes.aPos),t.vertexAttribPointer(a.attributes.aPos,3,t.FLOAT,!1,0,0);var o=this.options.color||[1,.05,.05,.3];if(!(o instanceof Array)){o=rt(o);var i=o.alpha();o=o.unitArray(),o[3]=i}t.uniform4f(a.uniforms.uFragColor,o[0],o[1],o[2],o[3]);var n=this.options.blend;t.enable(t.BLEND),t.enable(t.DEPTH_TEST),t.blendEquation(t.FUNC_ADD),n&&"lighter"===n?t.blendFunc(t.ONE,t.ONE):t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA),t.drawArrays(t.LINES,0,this.bufferData.length/3),t.bindBuffer(t.ARRAY_BUFFER,null),t.disable(t.BLEND),t.disable(t.DEPTH_TEST)}}}]),t}(is),As={circle:1},Rs=function(e){function t(e,r){Hl(this,t);var a=Wl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return a.bufferData=[],a}return Gl(t,e),Zl(t,[{key:"setData",value:function(e){var t=this.gl;this.data=e,this.processData&&(e=this.processData(e,this.options)),this.buffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.buffer);for(var r=[],a=this.options.color||[1,.05,.05,1],o=0;o=0.0&&aColor.w<=1.0){vColor=aColor;}else{vColor=vec4(aColor.xyz,1.0);}gl_Position=u_matrix*vec4(aPos,1.0);gl_PointSize=uSize;}",fragmentShader:"precision highp float;varying vec4 vColor;uniform int uShape;void main(void){if(uShape==1){float d=distance(gl_PointCoord,vec2(0.5,0.5));if(d<0.5){gl_FragColor=vColor;}else{discard;}}else{gl_FragColor=vColor;}}"}),this.f32BufferData=new Float32Array,this.buffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.buffer)}},{key:"render",value:function(e){var t=e.gl,r=e.matrix;if(!(0>=this.bufferData.length)){var a=this.program;t.useProgram(a.program),t.uniformMatrix4fv(a.uniforms.u_matrix,!1,r),t.bindBuffer(t.ARRAY_BUFFER,this.buffer);var o=this.f32BufferData.BYTES_PER_ELEMENT;t.enableVertexAttribArray(a.attributes.aPos),t.vertexAttribPointer(a.attributes.aPos,3,t.FLOAT,!1,7*o,0),t.enableVertexAttribArray(a.attributes.aColor),t.vertexAttribPointer(a.attributes.aColor,4,t.FLOAT,!1,7*o,3*o);var i=parseFloat(this.options.size)||5;t.uniform1f(a.uniforms.uSize,i);var n=0;this.options.shape&&As[this.options.shape]&&(n=As[this.options.shape]),t.uniform1i(a.uniforms.uShape,n);var l=this.options.blend;t.enable(t.BLEND),t.blendEquation(t.FUNC_ADD),l&&"lighter"===l?t.blendFunc(t.SRC_ALPHA,t.ONE):t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA),t.drawArrays(t.POINTS,0,this.bufferData.length/7),t.bindBuffer(t.ARRAY_BUFFER,null),t.disable(t.BLEND),t.useProgram(null)}}}]),t}(is),Es=function(e){function t(e,r){return Hl(this,t),Wl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return Gl(t,e),Zl(t,[{key:"initialize",value:function(e){var t=this;this.camera=new THREE.Camera,this.scene=new THREE.Scene,this.world=new THREE.Group,this.camera.matrixAutoUpdate=!1,this.world.matrixAutoUpdate=!1,this.scene.add(this.world),this.renderer=new THREE.WebGLRenderer({alpha:!0,antialias:!0,canvas:e.canvas,context:e}),this.renderer.autoClear=!1;var r=this.map.getSize();this.renderer.setSize(r.width,r.height),this.map.onResize(function(){var e=t.map.getSize();t.renderer.setSize(e.width,e.height)})}},{key:"add",value:function(e,t){this.scene.add(e);var r=this.getPointOffset();if(t){var a=new THREE.Group;a.isGeoGroup=!0,a.object=e,a.point=t,a.add(e),a.position.x=t.lng-r[0],a.position.y=t.lat-r[1],a.position.z=e.position.z,this.world.add(a)}else this.world.add(e);this.update()}},{key:"update",value:function(){this.webglLayer.render()}},{key:"getCamera",value:function(){return this.camera}},{key:"getScene",value:function(){return this.scene}},{key:"getRenderer",value:function(){return this.renderer}},{key:"getWorld",value:function(){return this.world}},{key:"updatePoint",value:function(e,t){for(var r=this.world.children,a=0;aa&&(a=n.length);for(var l=0,s;l1.0||vTime<0.0){discard;}gl_FragColor=vec4(uFragColor,1.0*vTime);}"}),this.buffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.buffer)}},{key:"render",value:function(e){var t=e.gl,r=e.matrix,a=this.program;t.useProgram(a.program),t.uniformMatrix4fv(a.uniforms.u_matrix,!1,r),t.bindBuffer(t.ARRAY_BUFFER,this.buffer),t.enableVertexAttribArray(a.attributes.aPos),t.vertexAttribPointer(a.attributes.aPos,3,t.FLOAT,!1,0,0);var o=this.options.color||[1,.05,.05,1];o instanceof Array||(o=rt(o).unitArray()),t.uniform3f(a.uniforms.uFragColor,o[0],o[1],o[2]),t.uniform1f(a.uniforms.currentTime,this.time),t.uniform1f(a.uniforms.trailLength,this.options.trailLength||3),t.enable(t.BLEND),t.enable(t.POLYGON_OFFSET_FILL),t.enable(t.DEPTH_TEST),t.polygonOffset(2,1),"lighter"===this.options.blend?t.blendFunc(t.ONE,t.ONE):t.blendFunc(t.SRC_ALPHA,t.ONE),t.blendEquation(t.FUNC_ADD),t.drawArrays(t.LINES,0,this.bufferData.length/3),t.bindBuffer(t.ARRAY_BUFFER,null),t.disable(t.BLEND);var i=this.options.step||.1;this.time+=i,this.time>this.endTime&&(this.time=this.startTime)}}]),t}(is),Ss=function(e){function t(e,r){Hl(this,t);var a=Wl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return a.bufferData=[],a.indexData=[],a}return Gl(t,e),Zl(t,[{key:"setData",value:function(e){var t=this.gl;this.data=e,this.vertexBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);for(var r=[],a=[],o=this.options.color||[1,.05,.05,1],n=this.options.segs||18,l=this.options.size||100,s=0;s=0.0&&aColor.w<=1.0){vColor=aColor;}else{vColor=vec4(aColor.xyz,1.0);}gl_Position=u_projectionMatrix*u_modelViewMatrix*vec4(aPos.xy,0.0,1.0);}",fragmentShader:"precision highp float;varying vec4 vColor;void main(){gl_FragColor=vColor;}"}),this.f32BufferData=new Float32Array,this.vertexBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),this.indexBuffer=e.createBuffer(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indexBuffer)}},{key:"render",value:function(e){var t=e.gl,r=e.projectionMatrix,a=e.modelViewMatrix,o=this.program;t.useProgram(o.program),t.uniformMatrix4fv(o.uniforms.u_projectionMatrix,!1,r),t.uniformMatrix4fv(o.uniforms.u_modelViewMatrix,!1,a);var i=this.f32BufferData.BYTES_PER_ELEMENT;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.enableVertexAttribArray(o.attributes.aPos),t.vertexAttribPointer(o.attributes.aPos,2,t.FLOAT,!1,6*i,0),t.enableVertexAttribArray(o.attributes.aColor),t.vertexAttribPointer(o.attributes.aColor,4,t.FLOAT,!1,6*i,2*i);var n=this.options.blend;t.enable(t.BLEND),t.blendEquation(t.FUNC_ADD),n&&"lighter"===n?t.blendFunc(t.SRC_ALPHA,t.ONE):t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.drawElements(t.TRIANGLES,this.indexData.length,t.UNSIGNED_SHORT,0),t.bindBuffer(t.ARRAY_BUFFER,null),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null),t.disable(t.BLEND),t.useProgram(null)}}]),t}(is),Ps=function(e){function t(e,r){Hl(this,t);var a=Wl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return a.bufferDataArr=[],a.indexDataArr=[],a.vertexBuffer=[],a.indexBuffer=[],a.position=[],a.opacity=1,a.currentScale=1,!1!==a.options.autoUpdate&&a.webglLayer&&a.webglLayer.startAnimation(),a}return Gl(t,e),Zl(t,[{key:"initialize",value:function(e){this.gl=e,this.program=new T(this.gl,{vertexShader:"uniform mat4 u_projectionMatrix;uniform mat4 u_modelViewMatrix;uniform mat4 u_modelMatrix;uniform float u_opacity;attribute vec4 aPos;attribute vec4 aColor;varying vec4 vColor;void main(){vColor=aColor;vColor.a=u_opacity;gl_Position=u_projectionMatrix*u_modelViewMatrix*u_modelMatrix*vec4(aPos.xyz,1.0);}",fragmentShader:"precision highp float;varying vec4 vColor;void main(){gl_FragColor=vColor;}"})}},{key:"setOptions",value:function(e){this.options=e||{},this.opacity=1,this.currentScale=1,this.setData(this.data)}},{key:"setData",value:function(e){var t=this.gl;if(this.data=e,e&&e.length){for(var r=this.options.color||[1,.05,.05,1],a=this.options.segs||18,o=this.options.size||100,n=0;n=this.bufferDataArr[l].length)){var s=this.bufferDataArr[l],u=new Float32Array(s).BYTES_PER_ELEMENT;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer[l]),t.vertexAttribPointer(o.attributes.aColor,4,t.FLOAT,!1,7*u,3*u),t.vertexAttribPointer(o.attributes.aPos,3,t.FLOAT,!1,7*u,0);var d=this.position[l],p=this.map.getZoomUnits(),f=Il.create(),c=[this.currentScale,this.currentScale,this.currentScale];"px"===this.options.unit&&(c=[this.currentScale*p,this.currentScale*p,this.currentScale]),Il.identity(f),Il.translate(f,f,[d[0],d[1],0]),Il.scale(f,f,c),t.uniformMatrix4fv(o.uniforms.u_modelMatrix,!1,f),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer[l]),t.drawElements(t.TRIANGLES,this.indexDataArr[l].length,t.UNSIGNED_SHORT,0),t.bindBuffer(t.ARRAY_BUFFER,null),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}t.disable(t.BLEND),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL);var m=this.options.scale||2;this.opacity-=.01,this.currentScale+=.1*m,0>this.opacity&&(this.opacity=1,this.currentScale=1),t.useProgram(null)}}}]),t}(is),Ls=function(e){function t(e,r){Hl(this,t);var a=Wl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return a.bufferData=[],a.startTime=a.options.startTime||0,a.endTime=a.options.endTime,a.time=a.startTime,a.segs=a.options.segs||10,a}return Gl(t,e),Zl(t,[{key:"setTime",value:function(e){this.time=e}},{key:"setOptions",value:function(e){this.options=e||{},this.setData(this.data)}},{key:"setData",value:function(e){var t=this.gl;this.data=e,this.buffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.buffer);for(var r=[],a=this.options.height||100,o=0;o1.0||vTime<0.0){discard;}gl_FragColor=vec4(uFragColor,1.0*vTime);}"}),this.buffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.buffer)}},{key:"render",value:function(e){var t=e.gl,r=e.matrix,a=this.program;t.useProgram(a.program),t.uniformMatrix4fv(a.uniforms.u_matrix,!1,r),t.bindBuffer(t.ARRAY_BUFFER,this.buffer),t.enableVertexAttribArray(a.attributes.aPos),t.vertexAttribPointer(a.attributes.aPos,4,t.FLOAT,!1,0,0);var o=this.options.color||[1,.05,.05,1];o instanceof Array||(o=rt(o).unitArray()),t.uniform3f(a.uniforms.uFragColor,o[0],o[1],o[2]),t.uniform1f(a.uniforms.currentTime,this.time),t.uniform1f(a.uniforms.trailLength,this.options.trailLength||3),t.enable(t.BLEND),t.enable(t.POLYGON_OFFSET_FILL),t.enable(t.DEPTH_TEST),t.polygonOffset(2,1),t.blendFunc(t.SRC_ALPHA,t.ONE),t.blendEquation(t.FUNC_ADD),t.drawArrays(t.LINES,0,this.bufferData.length/4),t.bindBuffer(t.ARRAY_BUFFER,null),t.disable(t.BLEND);var i=this.options.step||.1;this.time+=i,this.time>1.5*this.endTime&&(this.time=this.startTime)}}]),t}(is),Fs=function(e){function t(e,r){return Hl(this,t),Wl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return Gl(t,e),Zl(t,[{key:"generateGrid",value:function(e,t){for(var r=t.gridSize||500,a=[],o={},n=e.length,l=this.getPointOffset(),s=0;sa;a++){o=5*a;for(var n=0,l;n