var BMapGLLib=window.BMapGLLib=BMapGLLib||{};(function(){var T;var baidu=T=baidu||{version:"1.5.0"};baidu.guid="$BAIDU$";(function(){window[baidu.guid]=window[baidu.guid]||{};baidu.dom=baidu.dom||{};baidu.dom.g=function(id){if("string"==typeof id||id instanceof String){return document.getElementById(id)}else{if(id&&id.nodeName&&(id.nodeType==1||id.nodeType==9)){return id}}return null};baidu.g=baidu.G=baidu.dom.g;baidu.lang=baidu.lang||{};baidu.lang.isString=function(source){return"[object String]"==Object.prototype.toString.call(source)};baidu.isString=baidu.lang.isString;baidu.dom._g=function(id){if(baidu.lang.isString(id)){return document.getElementById(id)}return id};baidu._g=baidu.dom._g;baidu.dom.getDocument=function(element){element=baidu.dom.g(element);return element.nodeType==9?element:element.ownerDocument||element.document};baidu.browser=baidu.browser||{};baidu.browser.ie=baidu.ie=/msie (\d+\.\d+)/i.test(navigator.userAgent)?(document.documentMode||+RegExp["\x241"]):undefined;baidu.dom.getComputedStyle=function(element,key){element=baidu.dom._g(element);var doc=baidu.dom.getDocument(element),styles;if(doc.defaultView&&doc.defaultView.getComputedStyle){styles=doc.defaultView.getComputedStyle(element,null);if(styles){return styles[key]||styles.getPropertyValue(key)}}return""};baidu.dom._styleFixer=baidu.dom._styleFixer||{};baidu.dom._styleFilter=baidu.dom._styleFilter||[];baidu.dom._styleFilter.filter=function(key,value,method){var filters=baidu.dom._styleFilter;var filter;for(var i=0;filter=filters[i];i++){if(filter=filter[method]){value=filter(key,value)}}return value};baidu.string=baidu.string||{};baidu.string.toCamelCase=function(source){if(source.indexOf("-")<0&&source.indexOf("_")<0){return source}return source.replace(/[-_][^-_]/g,function(match){return match.charAt(1).toUpperCase()})};baidu.dom.getStyle=function(element,key){var dom=baidu.dom;element=dom.g(element);key=baidu.string.toCamelCase(key);var value=element.style[key]||(element.currentStyle?element.currentStyle[key]:"")||dom.getComputedStyle(element,key);if(!value){var fixer=dom._styleFixer[key];if(fixer){value=fixer.get?fixer.get(element):baidu.dom.getStyle(element,fixer)}}if(fixer=dom._styleFilter){value=fixer.filter(key,value,"get")}return value};baidu.getStyle=baidu.dom.getStyle;baidu.dom._NAME_ATTRS=(function(){var result={"cellpadding":"cellPadding","cellspacing":"cellSpacing","colspan":"colSpan","rowspan":"rowSpan","valign":"vAlign","usemap":"useMap","frameborder":"frameBorder"};if(baidu.browser.ie<8){result["for"]="htmlFor";result["class"]="className"}else{result["htmlFor"]="for";result["className"]="class"}return result})();baidu.dom.setAttr=function(element,key,value){element=baidu.dom.g(element);if("style"==key){element.style.cssText=value}else{key=baidu.dom._NAME_ATTRS[key]||key;element.setAttribute(key,value)}return element};baidu.setAttr=baidu.dom.setAttr;baidu.dom.setAttrs=function(element,attributes){element=baidu.dom.g(element);for(var key in attributes){baidu.dom.setAttr(element,key,attributes[key])}return element};baidu.setAttrs=baidu.dom.setAttrs;baidu.dom.create=function(tagName,opt_attributes){var el=document.createElement(tagName),attributes=opt_attributes||{};return baidu.dom.setAttrs(el,attributes)};baidu.object=baidu.object||{};baidu.extend=baidu.object.extend=function(target,source){for(var p in source){if(source.hasOwnProperty(p)){target[p]=source[p]}}return target}})();WORLD_SIZE_MC_HALF=20037726.372307256;WORLD_SIZE_MC=WORLD_SIZE_MC_HALF*2;var LuShu=BMapGLLib.LuShu=function(map,path,opts){if(!path||path.length<1){return}this._map=map;if(opts["geodesic"]){this._path=getGeodesicPath(path)}else{this._path=path}this.i=0;this._setTimeoutQuene=[];this._opts={icon:null,speed:400,defaultContent:""};if(!opts["landmarkPois"]){opts["landmarkPois"]=[]}this._setOptions(opts);this._rotation=0;if(!(this._opts.icon instanceof BMapGL.Icon)){this._opts.icon=defaultIcon}};LuShu.prototype._setOptions=function(opts){if(!opts){return}for(var p in opts){if(opts.hasOwnProperty(p)){this._opts[p]=opts[p]}}};LuShu.prototype.start=function(){var me=this,len=me._path.length;if(me.i&&me.i30037726){if(target_pos.x=count){clearInterval(me._intervalFlag);if(me.i>me._path.length){return}me._moveNext(++me.i)}else{currentCount++;var x=effect(init_pos.x,target_pos.x,currentCount,count),y=effect(init_pos.y,target_pos.y,currentCount,count),pos=BMapGL.Projection.convertMC2LL(new BMapGL.Point(x,y));if(pos.lng>180){pos.lng=pos.lng-360}if(pos.lng<-180){pos.lng=pos.lng+360}if(currentCount==1){var proPos=null;if(me.i-1>=0){proPos=me._path[me.i-1]}if(me._opts.enableRotation==true){me.setRotation(proPos,initPos,targetPos,direction)}if(me._opts.autoView){if(!me._map.getBounds().containsPoint(pos)){me._map.setCenter(pos)}}}if(me._opts.autoCenter){me._map.setCenter(pos,{noAnimation:true})}me._marker.setPosition(pos);me._setInfoWin(pos)}},timer)},setRotation:function(prePos,curPos,targetPos,direction){var me=this;var deg=0;curPos=me._map.pointToPixel(curPos);targetPos=me._map.pointToPixel(targetPos);if(targetPos.x!=curPos.x){var tan=(targetPos.y-curPos.y)/(targetPos.x-curPos.x),atan=Math.atan(tan);deg=atan*360/(2*Math.PI);if((!direction&&targetPos.x0){bias=-1}else{bias=1}me._marker.setRotation(-bias*90)}return},linePixellength:function(from,to){return Math.sqrt(Math.abs(from.x-to.x)*Math.abs(from.x-to.x)+Math.abs(from.y-to.y)*Math.abs(from.y-to.y))},pointToPoint:function(from,to){return Math.abs(from.x-to.x)*Math.abs(from.x-to.x)+Math.abs(from.y-to.y)*Math.abs(from.y-to.y)},_moveNext:function(index){var me=this;if(index