var BMapLib=window.BMapLib=BMapLib||{};(function(){var b,a=b=a||{version:"1.5.0"};a.guid="$BAIDU$";(function(){window[a.guid]=window[a.guid]||{};a.dom=a.dom||{};a.dom.g=function(e){if("string"==typeof e||e instanceof String){return document.getElementById(e)}else{if(e&&e.nodeName&&(e.nodeType==1||e.nodeType==9)){return e}}return null};a.g=a.G=a.dom.g;a.lang=a.lang||{};a.lang.isString=function(e){return"[object String]"==Object.prototype.toString.call(e)};a.isString=a.lang.isString;a.dom._g=function(e){if(a.lang.isString(e)){return document.getElementById(e)}return e};a._g=a.dom._g;a.dom.getDocument=function(e){e=a.dom.g(e);return e.nodeType==9?e:e.ownerDocument||e.document};a.browser=a.browser||{};a.browser.ie=a.ie=/msie (\d+\.\d+)/i.test(navigator.userAgent)?(document.documentMode||+RegExp["\x241"]):undefined;a.dom.getComputedStyle=function(f,e){f=a.dom._g(f);var h=a.dom.getDocument(f),g;if(h.defaultView&&h.defaultView.getComputedStyle){g=h.defaultView.getComputedStyle(f,null);if(g){return g[e]||g.getPropertyValue(e)}}return""};a.dom._styleFixer=a.dom._styleFixer||{};a.dom._styleFilter=a.dom._styleFilter||[];a.dom._styleFilter.filter=function(f,j,k){for(var e=0,h=a.dom._styleFilter,g;g=h[e];e++){if(g=g[k]){j=g(f,j)}}return j};a.string=a.string||{};a.string.toCamelCase=function(e){if(e.indexOf("-")<0&&e.indexOf("_")<0){return e}return e.replace(/[-_][^-_]/g,function(f){return f.charAt(1).toUpperCase()})};a.dom.getStyle=function(g,f){var i=a.dom;g=i.g(g);f=a.string.toCamelCase(f);var h=g.style[f]||(g.currentStyle?g.currentStyle[f]:"")||i.getComputedStyle(g,f);if(!h){var e=i._styleFixer[f];if(e){h=e.get?e.get(g):a.dom.getStyle(g,e)}}if(e=i._styleFilter){h=e.filter(f,h,"get")}return h};a.getStyle=a.dom.getStyle;a.dom._NAME_ATTRS=(function(){var e={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",usemap:"useMap",frameborder:"frameBorder"};if(a.browser.ie<8){e["for"]="htmlFor";e["class"]="className"}else{e.htmlFor="for";e.className="class"}return e})();a.dom.setAttr=function(f,e,g){f=a.dom.g(f);if("style"==e){f.style.cssText=g}else{e=a.dom._NAME_ATTRS[e]||e;f.setAttribute(e,g)}return f};a.setAttr=a.dom.setAttr;a.dom.setAttrs=function(g,e){g=a.dom.g(g);for(var f in e){a.dom.setAttr(g,f,e[f])}return g};a.setAttrs=a.dom.setAttrs;a.dom.create=function(g,e){var h=document.createElement(g),f=e||{};return a.dom.setAttrs(h,f)};a.object=a.object||{};a.extend=a.object.extend=function(g,e){for(var f in e){if(e.hasOwnProperty(f)){g[f]=e[f]}}return g}})();var c=BMapLib.LuShu=function(g,f,e){if(!f||f.length<1){return}this._map=g;this._path=f;this.i=0;this._setTimeoutQuene=[];this._projection=this._map.getMapType().getProjection();this._opts={icon:null,speed:4000,defaultContent:""};this._setOptions(e);this._rotation=0;if(!this._opts.icon instanceof BMap.Icon){this._opts.icon=defaultIcon}};c.prototype._setOptions=function(e){if(!e){return}for(var f in e){if(e.hasOwnProperty(f)){this._opts[f]=e[f]}}};c.prototype.start=function(){var f=this,e=f._path.length;if(f.i&&f.i=g){clearInterval(i._intervalFlag);if(i.i>i._path.length){return}i._moveNext(++i.i)}else{h++;var o=m(l.x,k.x,h,g),r=m(l.y,k.y,h,g),q=i._projection.pointToLngLat(new BMap.Pixel(o,r));if(h==1){var p=null;if(i.i-1>=0){p=i._path[i.i-1]}if(i._opts.enableRotation==true){i.setRotation(p,n,j)}if(i._opts.autoView){if(!i._map.getBounds().containsPoint(q)){i._map.setCenter(q)}}}i._marker.setPosition(q);i._setInfoWin(q)}},e)},setRotation:function(l,f,m){var j=this;var e=0;f=j._map.pointToPixel(f);m=j._map.pointToPixel(m);if(m.x!=f.x){var k=(m.y-f.y)/(m.x-f.x),g=Math.atan(k);e=g*360/(2*Math.PI);if(m.x0){i=-1}else{i=1}j._marker.setRotation(-i*90)}return},linePixellength:function(f,e){return Math.sqrt(Math.abs(f.x-e.x)*Math.abs(f.x-e.x)+Math.abs(f.y-e.y)*Math.abs(f.y-e.y))},pointToPoint:function(f,e){return Math.abs(f.x-e.x)*Math.abs(f.x-e.x)+Math.abs(f.y-e.y)*Math.abs(f.y-e.y)},_moveNext:function(e){var f=this;if(e