window.TILE_VERSION={"ditu":{"normal":{"version":"088","updateDate":"20220208"},"satellite":{"version":"009","updateDate":"20220208"},"normalTraffic":{"version":"081","updateDate":"20220208"},"satelliteTraffic":{"version":"083","updateDate":"20220208"},"mapJS":{"version":"104","updateDate":"20220208"},"satelliteStreet":{"version":"083","updateDate":"20220208"},"earthVector":{"version":"001","updateDate":"20220208"}},"webapp":{"high_normal":{"version":"001","updateDate":"20220208"},"lower_normal":{"version":"002","updateDate":"20220208"}},"api_for_mobile":{"vector":{"version":"002","updateDate":"20220208"},"vectorIcon":{"version":"002","updateDate":"20220208"}}};window.BMAP_AUTHENTIC_KEY="";(function(){var k=k||{version:"20080809",emptyFn:function(){}};(function(){k._log=[];var ar=0;var at={};k.BaseClass=function(au){at[(this.hashCode=(au||k.BaseClass.guid()))]=this};k.BaseClass.guid=function(){return"mz_"+(ar++).toString(36)};k.BaseClass.create=function(){var au=new k.BaseClass();au.decontrol();return au};var e=k.instance=k.I=function(au){return at[au]};k.BaseClass.prototype.dispose=function(){if(this.hashCode){delete at[this.hashCode]}for(var au in this){if(typeof this[au]!="function"){delete this[au]}}};k.BaseClass.prototype.getHashCode=function(){if(!this.hashCode){at[(this.hashCode=k.BaseClass.guid())]=this}return this.hashCode};k.BaseClass.prototype.decontrol=function(){delete at[this.hashCode]};k.BaseClass.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"};k.BaseClass.prototype._wlog=function(av,aw){var au=k._log;if(au.length>100){au.reverse().length=50;au.reverse()}au[au.length]="["+av+"]["+(this._className||"Object")+" "+this.hashCode+"] "+aw}})();Function.prototype.inherits=function(at,ar){var e,au,aw=this.prototype,av=function(){};av.prototype=at.prototype;au=this.prototype=new av();if(typeof(ar)=="string"){au._className=ar}for(e in aw){au[e]=aw[e]}this.prototype.constructor=aw.constructor;aw=av=null;return au};k.BaseEvent=function(e,ar){this.type=e;this.returnValue=true;this.target=ar||null;this.currentTarget=this.srcElement=null;this.cancelBubble=false;this.domEvent=null};k.BaseClass.prototype.addEventListener=function(au,at,ar){if(typeof at!="function"){return this._wlog("error","addEventListener:"+at+" is not a function")}if(!this._listeners){this._listeners={}}var e=this._listeners,av;if(typeof ar=="string"&&ar){if(/[^\w\-]/.test(ar)){this._wlog("warning","nonstandard key:"+ar)}else{at.hashCode=ar;av=ar}}if(au.indexOf("on")!=0){au="on"+au}if(typeof e[au]!="object"){e[au]={}}av=av||k.BaseClass.guid();at.hashCode=av;if(e[au][av]){this._wlog("warning","repeat key:"+av)}e[au][av]=at};k.BaseClass.prototype.removeEventListener=function(at,ar){if(typeof ar=="function"){ar=ar.hashCode}else{if(typeof ar!="string"){return}}if(!this._listeners){this._listeners={}}if(at.indexOf("on")!=0){at="on"+at}var e=this._listeners;if(!e[at]){return}if(e[at][ar]){delete e[at][ar]}};k.BaseClass.prototype.dispatchEvent=function(at){if(!this._listeners){this._listeners={}}var ar,e=this._listeners,au=at.type;at.target=at.srcElement=at.target||at.srcElement||this;at.currentTarget=this;if(typeof this[au]=="function"){this[au](at)}if(typeof e[au]=="object"){for(ar in e[au]){if(typeof e[au][ar]=="function"){e[au][ar].call(this,at)}}}return at.returnValue};k.BaseEvent.prototype.inherit=function(at){var ar=this;this.domEvent=at=window.event||at;ar.clientX=at.clientX||at.pageX;ar.clientY=at.clientY||at.pageY;ar.offsetX=at.offsetX||at.layerX;ar.offsetY=at.offsetY||at.layerY;ar.screenX=at.screenX;ar.screenY=at.screenY;ar.ctrlKey=at.ctrlKey||at.metaKey;ar.shiftKey=at.shiftKey;ar.altKey=at.altKey;return ar};k.Browser=(function(){var at=navigator.userAgent;var ax=0,e=0,aw=0,av=0;var au=0,ay=0,ar=0;if(typeof(window.opera)=="object"&&/Opera(\s|\/)(\d+(\.\d+)?)/.test(at)){e=parseFloat(RegExp.$2)}else{if(/MSIE (\d+(\.\d+)?)/.test(at)){ax=parseFloat(RegExp.$1)}else{if(/Firefox(\s|\/)(\d+(\.\d+)?)/.test(at)){av=parseFloat(RegExp.$2)}else{if(navigator.vendor=="Netscape"&&/Netscape(\s|\/)(\d+(\.\d+)?)/.test(at)){ar=parseFloat(RegExp.$2)}else{if(at.indexOf("Safari")>-1&&/Version\/(\d+(\.\d+)?)/.test(at)){aw=parseFloat(RegExp.$1)}}}}}if(at.indexOf("Gecko")>-1&&at.indexOf("KHTML")==-1&&/rv\:(\d+(\.\d+)?)/.test(at)){ay=parseFloat(RegExp.$1)}return{ie:ax,firefox:av,gecko:ay,netscape:ar,opera:e,safari:aw}})();window.FeBrowser=k.Browser;k.Dom={};k.Dom.createDom=function(ar,e){if(k.isIE&&e&&e.name){ar="<"+ar+' name="'+k.String.escapeHTML(e.name)+'">'}var at=document.createElement(ar);if(e){k.Dom.setProperties(at,e)}return at};k.Dom.getOffset=function(au){var ax=k.Dom.getOwnerDocument(au);var aw=k.isGecko>0&&ax.getBoxObjectFor&&k.Dom.getStyle(au,"position")=="absolute"&&(au.style.top===""||au.style.left==="");var ay={left:0,top:0};var ar=(k.isIE&&!k.isStrict)?ax.body:ax.documentElement;if(au==ar){return ay}var at=null;var av;if(au.getBoundingClientRect){av=au.getBoundingClientRect();ay.left=av.left+Math.max(ax.documentElement.scrollLeft,ax.body.scrollLeft);ay.top=av.top+Math.max(ax.documentElement.scrollTop,ax.body.scrollTop);ay.left-=ax.documentElement.clientLeft;ay.top-=ax.documentElement.clientTop;if(k.isIE&&!k.isStrict){ay.left-=2;ay.top-=2}}else{if(ax.getBoxObjectFor&&!aw){av=ax.getBoxObjectFor(au);var e=ax.getBoxObjectFor(ar);ay.left=av.screenX-e.screenX;ay.top=av.screenY-e.screenY}else{at=au;do{ay.left+=at.offsetLeft;ay.top+=at.offsetTop;if(k.isWebkit>0&&k.Dom.getStyle(at,"position")=="fixed"){ay.left+=ax.body.scrollLeft;ay.top+=ax.body.scrollTop;break}at=at.offsetParent}while(at&&at!=au);if(k.isOpera>0||(k.isWebkit>0&&k.Dom.getStyle(au,"position")=="absolute")){ay.top-=ax.body.offsetTop}at=au.offsetParent;while(at&&at!=ax.body){ay.left-=at.scrollLeft;if(!k.isOpera||at.tagName!="TR"){ay.top-=at.scrollTop}at=at.offsetParent}}}return ay};k.Dom.getOwnerDocument=function(e){return e.nodeType==9?e:e.ownerDocument||e.document};k.Dom.setProperties=function(ar,e){k.each(e,function(au,at){k.Dom._setProperty(ar,at,au)})};k.Dom._setProperty=function(ar,e,at){if(e=="style"){ar.style.cssText=at}else{if(e=="class"){ar.className=at}else{if(e=="for"){ar.htmlFor=at}else{if(e in k.Dom._DIRECT_ATTRIBUTE_MAP){ar.setAttribute(k.Dom._DIRECT_ATTRIBUTE_MAP[e],at)}else{ar[e]=at}}}}};k.Dom._DIRECT_ATTRIBUTE_MAP={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",height:"height",width:"width",usemap:"useMap",frameborder:"frameBorder"};k.G=function(){for(var ar=[],at=arguments.length-1;at>-1;at--){var au=arguments[at];ar[at]=null;if(typeof au=="object"&&au&&au.dom){ar[at]=au.dom}else{if((typeof au=="object"&&au&&au.tagName)||au==window||au==document){ar[at]=au}else{if(typeof au=="string"&&(au=document.getElementById(au))){ar[at]=au}}}}return ar.length<2?ar[0]:ar};if(typeof(HTMLElement)!="undefined"&&!window.opera){HTMLElement.prototype.__defineGetter__("currentStyle",function(){return this.ownerDocument.defaultView.getComputedStyle(this,null)})}k.ac=function(e,ar){if(!(e=this.G(e))){return}ar=this.trim(ar);if(!new RegExp("(^| )"+ar.replace(/(\W)/g,"\\$1")+"( |$)").test(e.className)){e.className=e.className.split(/\s+/).concat(ar).join(" ")}};k.addClassName=k.ac;k.each=function(av,e){if(typeof e!="function"){return av}if(av){if(av.length===undefined){for(var ar in av){e.call(av[ar],av[ar],ar)}}else{for(var at=0,au=av.length;at<au;at++){e.call(av[at],av[at],at)}}}return av};k.extend=function(aw,au){if(aw&&au&&typeof(au)=="object"){for(var av in au){aw[av]=au[av]}var at=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"];for(var e=0,ar;e<at.length;e++){ar=at[e];if(Object.prototype.hasOwnProperty.call(au,ar)){aw[ar]=au[ar]}}}return aw};k.hide=function(){k.each(arguments,function(e){if(e=k.G(e)){e.style.display="none"}})};k.inherit=function(ax,at,ar){var aw=ax.prototype;var av=function(){};av.prototype=at.prototype;var au=ax.prototype=new av();if(typeof ar=="string"){au._className=ar}for(var e in aw){au[e]=aw[e]}ax.prototype.constructor=aw.constructor;aw=null;return au};k.isIE=0;(function(){if(navigator.userAgent.indexOf("MSIE")>0&&!window.opera){/MSIE (\d+(\.\d+)?)/.test(navigator.userAgent);k.isIE=parseFloat(RegExp.$1)}})();k.rc=function(e,ar){if(!(e=this.G(e))){return}ar=this.trim(ar);var at=e.className.replace(new RegExp("(^| +)"+ar.replace(/(\W)/g,"\\$1")+"( +|$)","g"),"$2");if(e.className!=at){e.className=at}};k.removeClassName=k.rc;k.show=function(){this.each(arguments,function(e){if(e=k.G(e)){e.style.display=""}})};k.trim=function(e){return e.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+$)/g,"")};var q=k.BaseClass;q.prototype.toString=function(){return this._className||""};var ak=k.BaseEvent;k.on=function(at,ar,e){if(!(at=k.G(at))){return at}ar=ar.replace(/^on/,"").toLowerCase();if(at.addEventListener){at.addEventListener(ar,e,false)}else{if(at.attachEvent){at.attachEvent("on"+ar,e)}}return at};k.un=function(at,ar,e){if(!(at=k.G(at))){return at}ar=ar.replace(/^on/,"").toLowerCase();if(at.removeEventListener){at.removeEventListener(ar,e,false)}else{if(at.detachEvent){at.detachEvent("on"+ar,e)}}return at};k.hc=function(au,at){if(!au||!au.className||typeof au.className!="string"){return false}var ar=-1;try{ar=au.className==at||au.className.search(new RegExp("(\\s|^)"+at+"(\\s|$)"))}catch(av){return false}return ar>-1};if(typeof(HTMLElement)!="undefined"&&!window.opera){try{HTMLElement.prototype.__defineGetter__("children",function(){for(var ar=[],at=0,av,au=0,e=this.childNodes.length;au<e;au++){av=this.childNodes[au];if(av.nodeType==1){ar[at++]=av;if(av.name){if(!ar[av.name]){ar[av.name]=[]}ar[av.name][ar[av.name].length]=av}if(av.id){ar[av.id]=av}}}return ar})}catch(am){}}if(typeof(HTMLElement)!="undefined"&&!window.opera&&HTMLElement.prototype&&!HTMLElement.prototype.insertAdjacentHTML){HTMLElement.prototype.insertAdjacentHTML=function(ar,at){var au=this.ownerDocument.createRange();au.setStartBefore(this);au=au.createContextualFragment(at);ar=ar.toLowerCase();switch(ar){case"beforebegin":this.parentNode.insertBefore(au,this);break;case"afterbegin":this.insertBefore(au,this.firstChild);break;case"beforeend":this.appendChild(au);break;case"afterend":if(!this.nextSibling){this.parentNode.appendChild(au)}else{this.parentNode.insertBefore(au,this.nextSibling)}break}}}var aj={imgPath:"http://api.map.baidu.com/images/"};k.extend(aj,{distCursor:"url("+aj.imgPath+"ruler.cur),crosshair",defaultCursor:"url("+aj.imgPath+"openhand.cur),default",draggingCursor:"url("+aj.imgPath+"closedhand.cur),move"});var z=z||{version:"20090107",emptyFn:function(){},_register:new Array(),register:function(e){this._register[this._register.length]=e}};BMapLanguage={Unit:{m:"\u7c73",km:"\u516c\u91cc",mile:"\u82f1\u91cc"}};function x(at,au){at=k.G(at);if(!at){return}q.call(this);this.container=at;this._setStyle(at);at.unselectable="on";at.innerHTML="";at.appendChild(this.render());this.width=0;this.height=0;this.offsetX=0;this.offsetY=0;this.platform=at.childNodes[0];this.maskLayer=this.platform.childNodes[0];this._bind();this.centerPoint=null;this.zoomLevel=0;this.lastLevel=0;this.defaultZoomLevel=null;this.defaultCenter=null;this.currentOperation=0;this.config={clickInterval:200,movingInterval:0,enableDragging:true,enableKeyboard:false,enableClickPan:false,enableDblclickZoom:true,enableWheelZoom:false,enableMouseDown:true,dblclickZoomStep:1,zoomStep:1,fps:30,zoomerSizeMin:60,zoomerSizeMax:120,zoomerDuration:300,actionDuration:450,defaultCursor:aj.defaultCursor,draggingCursor:aj.draggingCursor,isOverviewMap:false,centerPoint:{},zoomLevel:10,zoomLevelMin:1,zoomLevelMax:18,enableMapArea:true,coordType:BMAP_COORD_LNGLAT,mapType:BMAP_TYPE_NORMAL,restrictBounds:false};this.setConfig(au);this.mapType=this.config.mapType;this.temp={undoList:[],operating:false,arrow:0,undoPoint:0,undoLength:30,lastDomMoveTime:0,lastMovingTime:0,canKeyboard:false,I:function(av){return k.I(av)},curSpots:[],spotsGuid:1};window.InstanceCore=this.temp.I;this.platform.style.cursor=this.config.defaultCursor;if(k.Browser.ie){try{document.execCommand("BackgroundImageCache",false,true)}catch(ar){}}for(var e=0;e<z._register.length;e++){z._register[e](this)}}x.inherits(q,"Map");k.extend(x.prototype,{render:function(){var e=document.createElement("font");e.id="platform";var au=e.style;au.overflow="visible";au.position="absolute";au.zIndex="0";au.top=au.left="0px";var ar=document.createElement("font");ar.id="mask";ar.className="BMap_mask";var at=ar.style;at.position="absolute";at.top=at.left="0px";at.zIndex="9";at.overflow="hidden";e.appendChild(ar);return e},_setStyle:function(e){e.style.overflow="hidden";if(e.currentStyle.position!="absolute"){e.style.position="relative"}e.style.backgroundImage="url("+aj.imgPath+"bg.png)";e.style.color="#000";e.style.textAlign="left"},_bind:function(){var at=this;var ar=this.platform;function au(aw,ay){var ax=aw.srcElement||aw.target;var av=aw.offsetX||aw.layerX||0;var az=aw.offsetY||aw.layerY||0;if(ax.nodeType!=1){ax=ax.parentNode}while(ax&&ax!=at.container){if(!(ax.clientWidth==0&&ax.clientHeight==0&&ax.offsetParent&&ax.offsetParent.nodeName=="TD")&&ax.namespaceURI!="http://www.w3.org/2000/svg"){av+=ax.offsetLeft||0;az+=ax.offsetTop||0}else{if(ax.namespaceURI=="http://www.w3.org/2000/svg"){if(navigator.userAgent.indexOf("Safari")>-1&&ax.tagName!="svg"){ax=at.palette}if(at.palette){av+=parseFloat(at.palette.style.left)+at.offsetX;az+=parseFloat(at.palette.style.top)+at.offsetY}}}ax=ax.offsetParent}ay.offsetX=av;ay.offsetY=az;ay.pixel=new s(av,az);ay.point=at.pixelToPoint(ay.pixel);return ay}this.container.onselectstart=function(){return false};this.container.oncontextmenu=function(){return false};k.on(at.platform,"contextmenu",function(av){if(at.currentOperation==0){at.dispatchEvent(au(av,new ak("onrightclick").inherit(av)))}});k.on(at.platform,"mousemove",function(av){if(at.currentOperation==0){at.dispatchEvent(au(av,new ak("onmousemove").inherit(av)))}});k.on(at.platform,"mousedown",function(ay){if(!at.config.enableMouseDown){return}var ay=window.event||ay;at.temp.operating=true;var ax=ay.srcElement||ay.target;at._bind.upValid=true;if(at._bind.dTimer){clearTimeout(at._bind.dTimer);delete at._bind.dTimer}at._bind.dTimer=setTimeout(function(){at._bind.upValid=false},500);var av=ax;while(av){if(av==at.container){break}if(k.hc(av,"BMap_Marker")){return}av=av.parentNode}if(ax.nodeType!=1){ax=ax.parentNode}if(k.Browser.ie&&at.maskLayer.setCapture){at.maskLayer.setCapture()}else{if(window.captureEvents){window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP)}}at.temp.tpx=ay.clientX||ay.pageX;at.temp.tpy=ay.clientY||ay.pageY;at.dispatchEvent(au(ay,new ak("onmousedown").inherit(ay)));if(at.config.enableDragging&&!(at.currentOperation&g.drag)&&ay.button!=2){var aw=at.temp;aw.mx=(ay.clientX||ay.pageX);aw.my=(ay.clientY||ay.pageY);aw.pl=at.offsetX;aw.pt=at.offsetY;at.currentOperation|=g.drag;if(at.temp.curSpots.length==0){at.platform.style.cursor=at.config.draggingCursor}else{at.platform.style.cursor="pointer"}}});k.on(document,"mousemove",function(ay){var ay=window.event||ay;if(at.temp.tpx||at.temp.tpy){at.temp.mox=ay.clientX||ay.pageX-at.temp.tpx;at.temp.moy=ay.clientY||ay.pageY-at.temp.tpy}var az=new Date().getTime();if(az-at.temp.lastDomMoveTime<18){return false}at.temp.lastDomMoveTime=az;if(at.currentOperation&g.drag&&at.config.enableDragging){if(at.platform.style.cursor!=at.config.draggingCursor){at.platform.style.cursor=at.config.draggingCursor}var ax;if(!at.temp._moved){ax=au(ay,new ak("ondragstart").inherit(ay))}else{ax=au(ay,new ak("ondragging").inherit(ay))}at.dispatchEvent(ax);var aw=at.temp;var av=ay.clientX||ay.pageX||0;var aA=ay.clientY||ay.pageY||0;if(aw.mx==0&&aw.my==0&&at.temp.keyboardDrag){aw.mx=av;aw.my=aA;aw.pl=at.offsetX;aw.pt=at.offsetY}if(av-aw.mx!=0||aA-aw.my!=0){at.temp._moved=true;at._setPlatformPosition(aw.pl+av-aw.mx,aw.pt+aA-aw.my)}}});k.on(document,"mouseup",function(av){if(k.Browser.ie&&at.maskLayer.releaseCapture){at.maskLayer.releaseCapture()}else{if(window.releaseEvents){window.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP)}}if(at.temp.preEnableClickPan){at.enableClickPan(true)}if(at.currentOperation&g.drag&&at.config.enableDragging){var av=window.event||av;at.currentOperation^=g.drag;if(at.temp.curSpots.length==0){at.platform.style.cursor=at.config.defaultCursor}else{at.platform.style.cursor="pointer"}if(at.temp._moved){at.dispatchEvent(au(av,new ak("ondragend").inherit(av)))}else{if(at._bind.upValid==true){at.closeInfoWindow()}}at.temp._moved=false}at.temp.operating=false});function e(aw){if(at.config.enableWheelZoom){at.currentOperation|=g.mousewheel;var aw=window.event||aw;at.lastLevel=at.zoomLevel;var av=new ak("onmousewheel");av.trend=aw.wheelDelta>=0||aw.detail<0;if(av.trend==true&&at.zoomLevel==N[at.mapType].zoomLevelMax||av.trend==false&&at.zoomLevel==N[at.mapType].zoomLevelMin){at.currentOperation^=g.mousewheel;U(aw);return}au(aw,av.inherit(aw));at.dispatchEvent(av);at.currentOperation^=g.mousewheel;aw.returnValue=false;U(aw)}}k.on(at.container,"mousewheel",e);if(window.addEventListener){at.container.addEventListener("DOMMouseScroll",e,false)}k.on(at.platform,"click",function(ax){var aw=new ak("onclick");au(ax,aw.inherit(ax));if(!at.currentOperation){if(at.temp.mox>0||at.temp.moy>0){if(at.config.enableDragging){if(at.config.enableClickPan==true){at.enableClickPan(true)}}else{at.temp.preEnableClickPan=at.config.enableClickPan;at.enableClickPan(false)}}else{if(at.config.enableClickPan){at.enableClickPan(true)}}if(at._bind.clicker){clearTimeout(at._bind.clicker)}var av=false;if(!at.temp.mox&&!at.temp.moy){av=true}if(at.temp.curSpots.length>0&&av==true){var ax=new ak("onspotclick");ax.spots=at.temp.curSpots.slice(0);at.dispatchEvent(ax)}at._bind.clicker=setTimeout(function(){at._bind.clicker=false;if(av){at.dispatchEvent(aw)}},at.config.clickInterval);at.temp.tpx=null;at.temp.tpy=null;at.temp.mox=0;at.temp.moy=0}});k.on(at.platform,"dblclick",function(aw){if(!at.currentOperation){if(at._bind.clicker){clearTimeout(at._bind.clicker);at._bind.clicker=false}at.currentOperation|=g.dblclick;var av=new ak("ondblclick").inherit(aw);at.dispatchEvent(au(aw,av));at.currentOperation^=g.dblclick}});at._watchSize=function(){var aw=at.getSize();if(at.width!=aw.width||at.height!=aw.height){var aA=(aw.width-at.width)/2;var aC=(aw.height-at.height)/2;var ax=at.getZoomUnits();var az=at.centerPoint;if(az){at.centerPoint=new D(az.lng+aA*ax,az.lat-aC*ax)}at.maskLayer.style.width=(at.width=aw.width)+"px";at.maskLayer.style.height=(at.height=aw.height)+"px";var ay=new ak("onresize");ay.size=aw;at.dispatchEvent(ay);var av=parseInt(at.platform.style.left)||0;var aB=parseInt(at.platform.style.top)||0;if(at.currentOperation!="undefined"&&at.currentOperation!=0&&(at.offsetX!=av||at.offsetY!=aB)){at._setPlatformPosition(av,aB)}}};at._watchSize();setInterval(at._watchSize,80);if(typeof HTMLElement!="undefined"&&!window.opera){HTMLElement.prototype.contains=function(av){if(av==this){return true}while(av=av.parentNode){if(av==this){return true}}return false}}if(!k.Browser.ie&&typeof Event!="undefined"&&!window.opera){Event.prototype.__defineSetter__("returnValue",function(av){if(!av){this.preventDefault()}return av});Event.prototype.__defineSetter__("cancelBubble",function(av){if(av){this.stopPropagation()}return av})}k.on(document,"mousedown",function(aw){var aw=window.event||aw;var av=aw.srcElement||aw.target;if(at.temp.canKeyboard){at.temp.canKeyboard=at.container.contains(av)}else{at.temp.canKeyboard=at.platform.contains(av)}});k.on(document,"keydown",function(av){if(at.temp.stopArrow==true){at.temp.stopArrow=false}if(at.config.enableKeyboard&&at.temp.canKeyboard){var av=window.event||av;switch(av.keyCode||av.which){case 43:case 189:case 109:at.temp.operating=true;at.zoomOut();break;case 43:case 61:case 187:case 107:at.temp.operating=true;at.zoomIn();break;case 33:at.temp.operating=false;at.temp.stopArrow=true;at.panBy(0,Math.round(at.height*0.8));av.cancelBubble=true;av.returnValue=false;break;case 34:at.temp.operating=false;at.temp.stopArrow=true;at.panBy(0,-Math.round(at.height*0.8));av.cancelBubble=true;av.returnValue=false;break;case 35:at.temp.operating=false;at.temp.stopArrow=true;at.panBy(-Math.round(at.width*0.8),0);av.cancelBubble=true;av.returnValue=false;break;case 36:at.temp.operating=false;at.temp.stopArrow=true;at.panBy(Math.round(at.width*0.8),0);av.cancelBubble=true;av.returnValue=false;break;case 37:at.temp.operating=true;at.temp.arrow|=1;at._arrow();av.cancelBubble=true;av.returnValue=false;break;case 38:at.temp.operating=true;at.temp.arrow|=2;at._arrow();av.cancelBubble=true;av.returnValue=false;break;case 39:at.temp.operating=true;at.temp.arrow|=4;at._arrow();av.cancelBubble=true;av.returnValue=false;break;case 40:at.temp.operating=true;at.temp.arrow|=8;at._arrow();av.cancelBubble=true;av.returnValue=false;break}}});k.on(document,"keyup",function(av){if(at.config.enableKeyboard){var av=window.event||av;switch(av.keyCode||av.which){case 37:at.temp.arrow=at.temp.arrow&~1;if(at.temp.arrow!=0){at._arrow()}break;case 38:at.temp.arrow=at.temp.arrow&~2;if(at.temp.arrow!=0){at._arrow()}break;case 39:at.temp.arrow=at.temp.arrow&~4;if(at.temp.arrow!=0){at._arrow()}break;case 40:at.temp.arrow=at.temp.arrow&~8;if(at.temp.arrow!=0){at._arrow()}break}}at.temp.operating=false})},_setPlatformPosition:function(aC,aA,au){if(isNaN(aC)||isNaN(aA)){return}var av=this.offsetX-aC;var at=this.offsetY-aA;var aw=this.getZoomUnits();var aB=this.centerPoint.lng;var az=this.centerPoint.lat;var ay=new D(aB,az);this.centerPoint=new D(ay.lng+av*aw,ay.lat-at*aw);if(au){this.centerPoint=au}if(this.zoomLevel<=4||this.config.restrictBounds){var ar=N[this.mapType].bounds;if(this.centerPoint.lng-this.width/2*aw<=ar.minX&&av<0||this.centerPoint.lng+this.width/2*aw>ar.maxX&&av>=0){aC=this.offsetX}if(this.centerPoint.lat-this.height/2*aw<=ar.minY&&at>=0||this.centerPoint.lat+this.height/2*aw>ar.maxY&&at<0){aA=this.offsetY}this.centerPoint=new D(ay.lng+(this.offsetX-aC)*aw,ay.lat-(this.offsetY-aA)*aw);var ax=new ak("onreachbounds");this.dispatchEvent(ax)}this.offsetX=aC;this.offsetY=aA;this.platform.style.left=aC+"px";this.platform.style.top=aA+"px";this.maskLayer.style.left=-aC+"px";this.maskLayer.style.top=-aA+"px";this.dispatchEvent(new ak("onmoving"))},setViewSize:function(e){Y(this.maskLayer,e);this.width=e[0];this.height=e[1]},zoomTo:function(ay,ar){if(typeof ay!="number"){return}var ax=N[this.mapType];if(typeof ax!="object"){return}var aw=this.config.zoomLevelMin;if(aw){if(ay<aw){ay=aw}}var at=this.config.zoomLevelMax;if(at){if(ay>at){ay=at}}if(ay<ax.zoomLevelMin){ay=ax.zoomLevelMin}if(ay>ax.zoomLevelMax){ay=ax.zoomLevelMax}if(this.zoomLevel==ay){return}this.lastLevel=this.zoomLevel;if(ar){this.temp._cPoint=ar;this.temp._cPixel=this.pointToPixel(ar)}else{if(!ar&&this.temp.infoWin&&this.temp.infoWin.isOpen()){this.temp._cPixel=this.pointToPixel(this.temp.infoWin.overlay.getPoint());ar=this.temp.infoWin.overlay.getPoint();this.temp._cPoint=this.config.coordType==BMAP_COORD_LNGLAT?an.convertLL2MC(ar):ar}}this.dispatchEvent(new ak("onzoomstart"));this.zoomLevel=ay;if(ar||this.temp.infoWin&&this.temp.infoWin.isOpen()){var au=this.temp._cPoint;var e=this.temp._cPixel;var av=this.getZoomUnits(ay);this.centerPoint=new D(au.lng+av*(this.width/2-e.x),au.lat-av*(this.height/2-e.y))}},zoomIn:function(e){this.zoomTo(this.zoomLevel+this.config.zoomStep,e)},zoomOut:function(e){this.zoomTo(this.zoomLevel-this.config.zoomStep,e)},panTo:function(ar,au,av){if(!ar||ar.toString()!="Point"){return}var at=this.pointToPixel(ar);ar=this.config.coordType==BMAP_COORD_LNGLAT?an.convertLL2MC(ar):ar;var e=Math.round(this.width/2);var aw=Math.round(this.height/2);if(Math.abs(e-at.x)>this.width||Math.abs(aw-at.y)>this.height||au==true){this._panTo(e-at.x,aw-at.y,ar)}else{this._panBy(e-at.x,aw-at.y,{duration:av})}},_panTo:function(ar,e,at){if(this.temp.operating==true){return}this.dispatchEvent(new ak("onmovestart"));this._setPlatformPosition(this.offsetX+ar,this.offsetY+e,at);this.dispatchEvent(new ak("onmoveend"))},panBy:function(ar,e){ar=Math.round(ar)||0;e=Math.round(e)||0;if(Math.abs(ar)<=this.width&&Math.abs(e)<=this.height){this._panBy(ar,e,{fps:arguments[2]})}else{this._panTo(ar,e)}},_panBy:function(ar,e,av){if(this.temp.operating==true){return}av=av||{};this.dispatchEvent(new ak("onmovestart"));var au=this,at=au.temp;at.pl=au.offsetX;at.pt=au.offsetY;if(this.temp.tlPan){this.temp.tlPan.cancel()}this.temp.tlPan=new A({fps:av.fps||au.config.fps,duration:av.duration||au.config.actionDuration,transition:av.transition||p.easeInOutQuad,render:function(aw){this.terminative=au.temp.operating;if(au.temp.operating){return}au._setPlatformPosition(at.pl+Math.ceil(ar*aw),at.pt+Math.ceil(e*aw))},finish:function(aw){au.dispatchEvent(new ak("onmoveend"));au.temp.tlPan=false;if(au.temp.stopArrow==true){au.temp.stopArrow=false;if(au.temp.arrow!=0){au._arrow()}}}})},_arrow:function(){if(this._arrow.occurrent&&this._arrow._lastArrow==this.temp.arrow&&this.temp.stopArrow==true){return}var e=this;var at=e.temp.arrow;e._arrow._lastArrow=at;e._arrow.interval=30;e._arrow.duration=999;e._arrow.dx=e._arrow.dy=0;if(at&1){e._arrow.dx=1}if(at&2){e._arrow.dy=1}if(at&4){e._arrow.dx=-1}if(at&8){e._arrow.dy=-1}if(at&1&&at&4){e._arrow.dx=0}if(at&2&&at&8){e._arrow.dy=0}if(!e._arrow.occurrent){e._arrow.occurrent=true;e._arrow.time=new Date().getTime();e._arrow.beginTime=e._arrow.time;e.dispatchEvent(new ak("onmovestart"));var ar=new A({fps:e._arrow.interval,duration:e._arrow.duration,transition:p.linear,render:function(aA){var av=e._arrow;var ay=e.temp.arrow;if(e._arrow._lastArrow!=ay){e._arrow._lastArrow=ay;if(ay&1){av.dx=1}if(ay&2){av.dy=1}if(ay&4){av.dx=-1}if(ay&8){av.dy=-1}if(ay&1&&ay&4){av.dx=0}if(ay&2&&ay&8){av.dy=0}}if(e.temp.stopArrow==true){av.dx=0;av.dy=0}var az=new Date().getTime();var ax=Math.pow((az-av.beginTime)/av.duration,2);if(!e.temp.arrow){av.occurrent=false;ar.terminative=true;e._arrow.time=new Date().getTime();setTimeout(function(){e.dispatchEvent(new ak("onmoveend"))},40)}var aB=(az-av.time);var aw=av.dx*aB*ax>=0?Math.ceil(av.dx*aB*ax):Math.floor(av.dx*aB*ax);var au=av.dy*aB*ax>=0?Math.ceil(av.dy*aB*ax):Math.floor(av.dy*aB*ax);if(aw!=0&&au!=0){aw=Math.round(aw*0.7);au=Math.round(au*0.7)}av.time=az;e._setPlatformPosition(e.offsetX+aw,e.offsetY+au)},finish:function(){e._arrow.time=new Date().getTime();setTimeout(function(){e._arrowPan()},e._arrow.interval)}})}},_arrowPan:function(){var au=this;var ar=au._arrow;if(au.temp.stopArrow){ar.dx=0;ar.dy=0}if(!au.temp.arrow){ar.occurrent=false;au.dispatchEvent(new ak("onmoveend"));return}var av=new Date().getTime();var aw=(av-ar.time);var at=Math.ceil(ar.dx*aw);var e=Math.ceil(ar.dy*aw);ar.time=av;au._setPlatformPosition(au.offsetX+at,au.offsetY+e);setTimeout(function(){au._arrowPan()},ar.interval)},addControl:function(e){if(e&&e._type=="control"&&typeof e._i=="function"){e._i(this);this.dispatchEvent(new ak("onaddcontrol",e))}},removeControl:function(e){if(e&&e._type=="control"&&typeof e.remove=="function"){this.dispatchEvent(new ak("onremovecontrol",e));e.remove()}},addContextMenu:function(e){if(e&&e._type=="contextmenu"&&typeof e.initialize=="function"){e.initialize(this);this.dispatchEvent(new ak("onaddcontextmenu",e))}},removeContextMenu:function(e){if(e&&e._type=="contextmenu"&&typeof e.remove=="function"){this.dispatchEvent(new ak("onremovecontextmenu",e));e.remove()}},addOverlay:function(e){if(e&&e._type=="overlay"&&typeof e.initialize=="function"){this.dispatchEvent(new ak("onaddoverlay",e));e.initialize(this)}},removeOverlay:function(e){if(e&&e._type=="overlay"&&typeof e.remove=="function"){this.dispatchEvent(new ak("onremoveoverlay",e));e.remove()}},clearOverlays:function(){this.dispatchEvent(new ak("onclearoverlays"))},addTileLayer:function(e){if(e&&e._type=="tilelayer"&&typeof e.initialize=="function"){e.initialize(this);this.dispatchEvent(new ak("onaddtilelayer",e))}},removeTileLayer:function(e){if(e&&e._type=="tilelayer"&&typeof e.remove=="function"){e.remove();this.dispatchEvent(new ak("onremovetilelayer",e))}},getTileLayer:function(e){if(this.tileMgr){return this.tileMgr.getTileLayer(e)}return},getTileId:function(e,aw){var au=N[this.mapType];if(typeof au!="object"){return null}var ar=au.baseUnits*Math.pow(2,(au.zoomLevelMax-aw));var av=parseInt(e.lng/ar);var at=parseInt(e.lat/ar);return{row:av,column:at,level:aw}},setCenter:function(e){if(!(e instanceof D)){return}this.panTo(e,true)},centerAndZoom:function(aB,at,aA){if(!aB&&this.config.centerPoint){aB=this.config.centerPoint}if(!at&&this.config.zoomLevel){at=this.config.zoomLevel}var au=this.config.zoomLevelMin;if(au&&at<au){at=au}var ax=this.config.zoomLevelMax;if(ax&&at>ax){at=ax}if(typeof at!="number"){return}var aw=N[this.mapType];if(typeof aw!="object"){return}if(at<aw.zoomLevelMin){at=aw.zoomLevelMin}if(at>aw.zoomLevelMax){at=aw.zoomLevelMax}this.lastLevel=this.zoomLevel||at;this.zoomLevel=at;var az=new ak("onload");az.point=aB;az.zoom=at;if(!aA&&this.config.coordType==BMAP_COORD_LNGLAT){aB=this.config.coordType==BMAP_COORD_LNGLAT?an.convertLL2MC(aB):aB}this.centerPoint=aB;this.defaultZoomLevel=this.defaultZoomLevel||this.zoomLevel;this.defaultCenter=this.defaultCenter||this.centerPoint;if(!this.loaded){var ar=new m(-21364736,-10616832,23855104,15859712);var ay=new ac("baidu",ar,"\u767e\u5ea6\u5730\u56fe");var av=new v({mapType:this.mapType,copyright:ay});av.baseLayer=true;this.addTileLayer(av)}az.pixel=this.pointToPixel(this.centerPoint,this.zoomLevel,true);this.dispatchEvent(az)},reset:function(){var ar=this;var at=ar.defaultZoomLevel;var e=ar.defaultCenter;ar.centerAndZoom(e,at,true)},openInfoWindow:function(au,e){if(!au||au.toString()!="InfoWindow"||e.toString()!="Point"){return}if(!this.temp.marker){var ar=new n(aj.imgPath+"blank.gif",{width:1,height:1});this.temp.marker=new K(e,{icon:ar,width:1,height:1,offset:new f(0,0),infoWindowOffset:new f(0,0)})}else{this.temp.marker.setPoint(e)}this.addOverlay(this.temp.marker);this.temp.marker.openInfoWindow(au);this.temp._infoWindowOpened=true;var at=this;au.addEventListener("onclose",function(){at.temp._infoWindowOpened=false})},closeInfoWindow:function(){if(this.temp.infoWin&&this.temp.infoWin.overlay){this.temp.infoWin.overlay.closeInfoWindow()}},resizeMapDiv:function(){var at=this.getSize();if(this.width&&at.width==this.width&&at.height==this.height){return}this.setViewSize(at);var ar=new ak("onresize");ar.size=at;this.dispatchEvent(ar)},enableDragging:function(e){this.config.enableDragging=true},disableDragging:function(){this.config.enableDragging=false},enableScrollWheelZoom:function(e){this.config.enableWheelZoom=true},disableScrollWheelZoom:function(e){this.config.enableWheelZoom=false},enableClickPan:function(e){this.config.enableClickPan=!!e},enableDoubleClickZoom:function(e){this.config.enableDblclickZoom=true},disableDoubleClickZoom:function(e){this.config.enableDblclickZoom=false},enableKeyboard:function(e){this.config.enableKeyboard=true},disableKeyboard:function(e){this.config.enableKeyboard=false},enableMapArea:function(e){this.config.enableMapArea=!!e},getSize:function(){var e=new f(this.container.clientWidth,this.container.clientHeight);return e},getCenter:function(){var e=this.centerPoint;e=this.config.coordType==BMAP_COORD_LNGLAT?an.convertMC2LL(e):e;return e},getZoom:function(){return this.zoomLevel},getContainer:function(){return this.container},getZoomUnits:function(at){var e=N[this.mapType];if(typeof e!="object"){return null}var ar=at||this.zoomLevel;return Math.pow(2,(e.zoomLevelMax-ar))*e.baseUnits/e.tileSize},pointToPixel:function(ar,aw,au){if(!ar){return}if(!au){ar=this.config.coordType==BMAP_COORD_LNGLAT?an.convertLL2MC(ar):ar}var at=this.getZoomUnits(aw);var e=Math.round((ar.lng-this.centerPoint.lng)/at+this.width/2);var av=Math.round((this.centerPoint.lat-ar.lat)/at+this.height/2);return new s(e,av)},pixelToPoint:function(av,ax,at){if(!av){return}var ar=this.getZoomUnits(ax);var au=this.centerPoint.lng+ar*(av.x-this.width/2);var aw=this.centerPoint.lat-ar*(av.y-this.height/2);var e=new D(au,aw);if(!at&&this.config.coordType==BMAP_COORD_LNGLAT){e=this.config.coordType==BMAP_COORD_LNGLAT?an.convertMC2LL(e):e}return e},lnglatToMercator:function(ar,au){if(isNaN(ar)||isNaN(au)){return[]}ar=parseFloat(ar);au=parseFloat(au);var e=new D(ar,au);var at=an.convertLL2MC(e);return[at.lng,at.lat]},mercatorToLnglat:function(at,ar){if(isNaN(at)||isNaN(ar)){return[]}at=parseFloat(at);ar=parseFloat(ar);var au=new D(at,ar);var e=an.convertMC2LL(au);return[e.lng,e.lat]},pt2px:function(e,at){var ar=this.pointToPixel(e,at);return new s(ar.x+this.offsetX,ar.y+this.offsetY)},px2pt:function(e,at){var ar=new s(e.x-this.offsetX,e.y-this.offsetY);return this.pixelToPoint(ar,at,true)},getEventPoint:function(at,au){if(typeof at.offsetY=="number"){var ar=new s(at.offsetX,at.offsetY);return this.pixelToPoint(ar,au,true)}else{return null}},getBounds:function(){var ar=this.pixelToPoint({x:0,y:this.height},null,true);var e=this.pixelToPoint({x:this.width,y:0},null,true);if(this.config.coordType==BMAP_COORD_LNGLAT){ar=an.convertMC2LL(ar);e=an.convertMC2LL(e)}return new m(ar.lng,ar.lat,e.lng,e.lat)},setConfig:function(e){if(!e){return}for(var ar in e){if(typeof(e[ar])!="undefined"&&typeof(this.config[ar])==typeof(e[ar])){this.config[ar]=e[ar]}}},getPointsBounds:function(ar){var at=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MIN_VALUE,Number.MIN_VALUE);for(var e=ar.length-1;e>=0;e--){at.extend(ar[e])}if(at.minX==Number.MAX_VALUE&&at.minY==Number.MAX_VALUE&&at.maxX==Number.MIN_VALUE&&at.maxY==Number.MIN_VALUE){return null}return at},getBestMap:function(aE,ax,au,e,ay){if(aE.length==0){return}var aC=[];if(this.config.coordType==BMAP_COORD_LNGLAT){for(var aw=0,av=aE.length;aw<av;aw++){var at=an.convertLL2MC(aE[aw]);aC.push(at)}}else{aC=aE}var aD=this.getBounds();var aA=this.getPointsBounds(aC);if(!aA){return}var aB=this;var az=aA.getCenterPoint();if(this.config.coordType==BMAP_COORD_LNGLAT){az=an.convertMC2LL(az)}var ar=this.getBestLevel(aA,ax,ay);if(au){if(!aD.containsBounds(aA)){if(ar==this.zoomLevel){setTimeout(function(){aB.panTo(az,false,210)},200)}else{this.centerAndZoom(az,ar)}}}else{if(!e){if(ar==this.zoomLevel){setTimeout(function(){aB.panTo(az,false,210)},200)}else{this.centerAndZoom(az,ar)}}}return{center:az,level:ar}},getBestLevel:function(ar,au,av){var aw=N[this.mapType];au=au||10;av=av||false;var ax=typeof(au);var ay=eh=au;if(ax=="object"){ay=au[0];eh=au[1]}if(typeof aw!="object"){return}var e=aw.zoomLevelMin;var aA=aw.zoomLevelMax;for(var at=aA;at>=e;at--){var az=this.getZoomUnits(at);if((ar.getMaxX()-ar.getMinX())/az<this.width-ay*2&&(ar.getMaxY()-ar.getMinY())/az<this.height-eh*2){break}}if(at==-1){at++}if(at==aw.zoomLevelMax&&!av){at--}return at},addHotspot:function(e){if(!e){return}if(!this.arrHotspot){this.arrHotspot=[]}this.arrHotspot[this.arrHotspot.length]=e},clearHotspot:function(){delete this.arrHotspot},addSpots:function(ar){if(!ar||ar.length==0){return}this.spotsPool=this.spotsPool||{};var e="sp"+(this.temp.spotsGuid++);this.spotsPool[e]=ar.slice(0);return e},getSpots:function(e){return this.spotsPool[e]||[]},removeSpots:function(e){if(!e||!this.spotsPool[e]){return}delete this.spotsPool[e]},clearSpots:function(){delete this.spotsPool},clearHotspot:function(){delete this.arrHotspot},setMapBounds:function(ar){var e=this.centerPoint;if(ar.containsPoint(e)){return}if(e.lng>ar.getMaxX()){e.lng=ar.getMaxX()}if(e.lat>ar.getMaxY()){e.lat=ar.getMaxY()}if(e.lng<ar.getMinX()){e.lng=ar.getMinX()}if(e.lat<ar.getMinY()){e.lat=ar.getMinY()}this.centerPoint=e},setBounds:function(e){N[this.mapType].bounds=new m(e.minX,e.minY,e.maxX,e.maxY)},getCoordType:function(){return this.config.coordType}});window.BMAP_API_VERSION="1.0";window.BMAP_TYPE_NORMAL="B_NORMAL_MAP";window.BMAP_TYPE_SATELLITE="B_SATELLITE_MAP";window.BMAP_TYPE_PHYSICAL="B_PHYSICAL_MAP";window.BMAP_COORD_LNGLAT=0;window.BMAP_COORD_MERCATOR=1;var N={B_NORMAL_MAP:{tileUrls:["http://online0.map.bdimg.com/tile/","http://online1.map.bdimg.com/tile/","http://online2.map.bdimg.com/tile/","http://online3.map.bdimg.com/tile/","http://online4.map.bdimg.com/tile/"],tileSize:256,baseUnits:256,zoomLevelMin:1,zoomLevelMax:18,errorUrl:aj.imgPath+"bg.png",bounds:new m(-21364736,-10616832,23855104,15859712),imgExtend:"png"},B_SATELLITE_MAP:{tileUrls:[""],tileSize:256,baseUnits:256,zoomLevelMin:1,zoomLevelMax:18,errorUrl:aj.imgPath+"bg.png",bounds:new m(-21364736,-10616832,23855104,15859712),imgExtend:"png"},B_PHYSICAL_MAP:{tileUrls:[""],tileSize:256,baseUnits:256,zoomLevelMin:1,zoomLevelMax:18,errorUrl:aj.imgPath+"bg.png",bounds:new m(-21364736,-10616832,23855104,15859712),imgExtend:"png"},BMAP_CUSTOM_LAYER:{tileUrls:[""],tileSize:256,baseUnits:256,zoomLevelMin:1,zoomLevelMax:18,errorUrl:aj.imgPath+"blank.gif",bounds:new m(-21364736,-10616832,23855104,15859712),imgExtend:"png"}};function A(au){var e={duration:1000,fps:30,delay:0,transition:p.linear};if(au){for(var ar in au){e[ar]=au[ar]}}this._opts=e;if(e.delay){var at=this;setTimeout(function(){at._beginTime=new Date().getTime();at._endTime=at._beginTime+at._opts.duration;at._launch()},e.delay)}else{this._beginTime=new Date().getTime();this._endTime=this._beginTime+this._opts.duration;this._launch()}}A.prototype._launch=function(){var ar=this;var e=new Date().getTime();if(e>=ar._endTime){if(typeof ar._opts.render=="function"){ar._opts.render(ar._opts.transition(1))}if(typeof ar._opts.finish=="function"){ar._opts.finish()}return}ar.schedule=ar._opts.transition((e-ar._beginTime)/ar._opts.duration);if(typeof ar._opts.render=="function"){ar._opts.render(ar.schedule)}if(!ar.terminative){ar._timer=setTimeout(function(){ar._launch()},1000/ar._opts.fps)}};A.prototype.stop=function(e){this.terminative=true;if(this._timer){clearTimeout(this._timer)}if(e){this._endTime=this._beginTime;this._launch()}};A.prototype.cancel=function(){if(this._timer){clearTimeout(this._timer)}this._endTime=this._beginTime;this.schedule=0};var p={linear:function(e){return e},reverse:function(e){return 1-e},easeInQuad:function(e){return e*e},easeInCubic:function(e){return Math.pow(e,3)},easeOutQuad:function(e){return -(e*(e-2))},easeOutCubic:function(e){return Math.pow((e-1),3)+1},easeInOutQuad:function(e){if(e<0.5){return e*e*2}else{return -2*(e-2)*e-1}return},easeInOutCubic:function(e){if(e<0.5){return Math.pow(e,3)*4}else{return Math.pow(e-1,3)*4+1}},easeInOutSine:function(e){return(1-Math.cos(Math.PI*e))/2}};function E(e){q.call(this);this._map=null;this._container;this._type="control";this.blockInfoWindow=true;this._opts={printable:false};this._visible=true}E.inherits(q,"Control");k.extend(E.prototype,{initialize:function(e){this._map=e;if(this._container){e.container.appendChild(this._container);return this._container}return},_i:function(ar){if(!this._container&&this.initialize&&typeof this.initialize=="function"){this._container=this.initialize(ar)}var at=this._container;if(at){var e=at.style;e.position="absolute";e.zIndex=this._cZIndex||"10";e.MozUserSelect="none";at._hashCode=this.hashCode;if(!this._opts.printable){k.ac(at,"BMap_noprint")}}this._setPosition()},remove:function(){this._map=null;if(!this._container){return}this._container.parentNode&&this._container.parentNode.removeChild(this._container);this._container=null},_render:function(){this._container=V(this._map.container,"<div unselectable='on'></div>");if(this._visible==false){this._container.style.display="none"}return this._container},_setPosition:function(){this.setAnchor(this._opts.anchor)},setAnchor:function(au){if(this.anchorFixed||typeof au!="number"||isNaN(au)||au<BMAP_ANCHOR_TOP_LEFT||au>BMAP_ANCHOR_BOTTOM_RIGHT){au=this.defaultAnchor}this._opts.offset=this._opts.offset||this.defaultOffset;var at=this._opts.anchor;this._opts.anchor=au;if(!this._container){return}var aw=this._container;var e=this._opts.offset.width;var av=this._opts.offset.height;aw.style.left=aw.style.top=aw.style.right=aw.style.bottom="auto";switch(au){case BMAP_ANCHOR_TOP_LEFT:aw.style.top=av+"px";aw.style.left=e+"px";break;case BMAP_ANCHOR_TOP_RIGHT:aw.style.top=av+"px";aw.style.right=e+"px";break;case BMAP_ANCHOR_BOTTOM_LEFT:aw.style.bottom=av+"px";aw.style.left=e+"px";break;case BMAP_ANCHOR_BOTTOM_RIGHT:aw.style.bottom=av+"px";aw.style.right=e+"px";break;default:break}var ar=["TL","TR","BL","BR"];k.rc(this._container,"anchor"+ar[at]);k.ac(this._container,"anchor"+ar[au])},getAnchor:function(){return this._opts.anchor},setOffset:function(e){if(!e||e&&e.toString()!="Size"){return}this._opts.offset=new f(e.width,e.height);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=""}},hide:function(){if(this._visible==false){return}this._visible=false;if(this._container){this._container.style.display="none"}},isPrintable:function(){return !!this._opts.printable},isVisible:function(){if(!this._container){return false}return !!this._visible}});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 u(e){E.call(this);e=e||{};k.extend(this._opts,e);this._copyrightCollection=[];this.defaultAnchor=BMAP_ANCHOR_BOTTOM_LEFT;this.defaultOffset=new f(5,2);this.setAnchor(e.anchor);this._canShow=true;this.blockInfoWindow=false}u.inherits(E,"CopyrightControl");k.extend(u.prototype,{initialize:function(ar){E.prototype.initialize.call(this,ar);this._render();this._updateState();var e=this;ar.addEventListener("load",function(at){e._updateState()});ar.addEventListener("moveend",function(at){e._updateState()});ar.addEventListener("dragend",function(at){e._updateState()});ar.addEventListener("zoomend",function(at){e._updateState()});return this._container},_render:function(){E.prototype._render.call(this);k.ac(this._container,"BMap_cpyCtrl");this._container.style.cursor="default";this._container.style.whiteSpace="nowrap";this._container.style.MozUserSelect="none";E.prototype._setPosition.call(this)},_updateState:function(){if(!this._map||!this._container||this._copyrightCollection.length==0){return}for(var av=0,at=this._copyrightCollection.length;av<at;av++){var ar;var e=this._map.getZoom();if(this._copyrightCollection[av].mapType!=""&&this._map.mapType!=this._copyrightCollection[av].mapType){ar=false}else{if(e<this._copyrightCollection[av].minZoom){ar=false}else{var az=this._map.pixelToPoint({x:0,y:0});var ay=this._map.pixelToPoint({x:this._map.width,y:this._map.height});var ax=new m(az.lng,az.lat,ay.lng,ay.lat);if(this._copyrightCollection[av].bounds&&ax.intersects(this._copyrightCollection[av].bounds)==null){ar=false}else{ar=true}}}if(ar){if(this._container){var aA=false;for(var au=0,aw=this._container.children.length;au<aw;au++){if(this._container.children[au].getAttribute("_cid")==this._copyrightCollection[av].id){aA=true;this._container.children[au].style.display="inline";if(this._container.children[au].innerHTML!=this._copyrightCollection[av].content){this._container.children[au].innerHTML=this._copyrightCollection[av].content}break}}if(!aA){this._generateHTML(this._copyrightCollection[av])}}}else{if(this._container){for(var au=0;au<this._container.children.length;au++){if(this._container.children[au].getAttribute("_cid")==this._copyrightCollection[av].id&&this._container.children[au].style.display!="none"){this._container.children[au].style.display="none";return}}}}}},addCopyright:function(at){if(!at||typeof at.id!="number"||isNaN(at.id)){return}var e={minZoom:0,bounds:null,content:"",mapType:""};for(var ar in at){e[ar]=at[ar]}if(this._map){var aw=e.minZoom;if(aw==-1||aw<N[this._map.mapType].zoomLevelMin||aw>N[this._map.mapType].zoomLevelMax){e.minZoom=N[this._map.mapType].zoomLevelMin}if(e.mapType!=""&&!N[e.mapType]){e.mapType=BMAP_TYPE_NORMAL}}var au=this.getCopyright(at.id);if(au){for(var av in e){au[av]=e[av]}}else{this._copyrightCollection.push(e)}this._updateState()},getCopyright:function(at){for(var ar=0,e=this._copyrightCollection.length;ar<e;ar++){if(this._copyrightCollection[ar].id==at){return this._copyrightCollection[ar]}}},getCopyrightCollection:function(){return this._copyrightCollection},removeCopyright:function(av){var at;for(var ar=0,e=this._copyrightCollection.length;ar<e;ar++){if(this._copyrightCollection[ar].id==av){at=this._copyrightCollection.splice(ar,1);ar--;e=this._copyrightCollection.length}}var au=this.getDom(av);if(au&&au.parentNode){au.parentNode.removeChild(au);au=null}this._updateState();return at},_generateHTML:function(e){if(!this._container){return}this._container.innerHTML+="<span style='color:#000;background:none;line-height:15px;font:11px arial,simsun' _cid='"+e.id+"'>"+e.content+"</span>"},getDom:function(au){var at=E.prototype.getDom.call(this);if(typeof au=="undefined"){return at}else{if(at){for(var ar=0,e=at.children.length;ar<e;ar++){if(at.children[ar].getAttribute("_cid")==au){return at.children[ar]}}}}}});function ao(e){E.call(this);e=e||{};this._opts=k.extend(k.extend(this._opts,{size:new f(150,150),padding:8,isOpen:false,zoomInterval:4}),e);this.defaultAnchor=BMAP_ANCHOR_BOTTOM_RIGHT;this.defaultOffset=new f(0,0);this.setAnchor(e.anchor);this.setSize(this._opts.size);this._omCanvas;this._omMapContainer;this._omView;this._omViewMv;this._omBtn;this._borderWidth=1;this._btnWidth=15;this._btnHeight=15;this._quad=4;this._overviewMap=null;this._minZoomLevel=-1;this._maxZoomLevel=-1;this._curOMZoomLevel=-1;this._wRatio=1;this._hRatio=1;this._temp={};this._currentOp="";this._overviewInitialized=false}ao.inherits(E,"OverviewMapControl");k.extend(ao.prototype,{initialize:function(e){E.prototype.initialize.call(this,e);this._render();this._bind();this._initOverviewMap();k.on(this._container,"click",function(ar){al(ar)});k.on(this._container,"dblclick",function(ar){al(ar)});k.on(this._container,"mousewheel",function(ar){al(ar)});if(window.addEventListener){this._container.addEventListener("DOMMouseScroll",function(ar){al(ar)},true)}return this._container},_getCurOMZoomLevel:function(){if(!this._map){return}var e=this._map.zoomLevel;var ar=e-this._opts.zoomInterval;if(ar<this._minZoomLevel){return this._minZoomLevel}else{if(ar>this._maxZoomLevel){return this._maxZoomLevel}else{return ar}}return -1},_render:function(){E.prototype._render.call(this);var e=k.Browser.ie!=false?" BMap_ie"+k.Browser.ie:"";var ar=this._container;ar.innerHTML=this._generateHTML();k.ac(ar,"BMap_omCtrl"+e);this._omCanvas=ar.children[0].children[0];this._omMapContainer=this._omCanvas.children[0];this._omViewMv=this._omCanvas.children[1];this._omViewMvInn=this._omViewMv.children[0];this._omBtn=ar.children[1];this.setSize(this._opts.size);this._omViewMv.style.cursor=aj.defaultCursor},_generateHTML:function(){var e=['<div class="BMap_omOutFrame"><div class="BMap_omInnFrame">','<div class="BMap_omMapContainer"></div>','<div class="BMap_omViewMv"><div class="BMap_omViewInnFrame"><div></div></div></div>','</div></div><div class="BMap_omBtn"></div>'];return e.join("")},_bind:function(){var e=this;k.on(this._omBtn,"click",function(){e.changeView()});if(k.Browser.ie){k.on(this._omBtn,"dblclick",function(){e.changeView()})}k.on(this._omViewMv,"mousedown",function(ar){if(e._omViewMv&&typeof e._omViewMv._drag!="undefined"&&e._omViewMv._drag=="true"){return}e._omViewMv._drag="true";var ar=window.event||ar;if(e._omViewMv.setCapture){e._omViewMv.setCapture()}e._bind.iniX=parseInt(e._omViewMv.currentStyle.left);e._bind.iniY=parseInt(e._omViewMv.currentStyle.top);e._bind.mx=ar.pageX||ar.clientX;e._bind.my=ar.pageY||ar.clientY;e._bind.i=0;e._bind.j=0;e._setViewMvCursor(aj.draggingCursor);al(ar);return U(ar)});k.on(document,"mousemove",function(ay){if(e._omViewMv&&e._omViewMv._drag=="true"){var ay=window.event||ay;var ar=ay.pageX||ay.clientX;var az=ay.pageY||ay.clientY;e._bind.curX=e._bind.iniX+ar-e._bind.mx;e._bind.curY=e._bind.iniY+az-e._bind.my;var ax=3;e._bind._moveX=0;e._bind._moveY=0;if(e._bind.curX<=0){e._bind._moveX=ax}if(e._bind.curY<=0){e._bind._moveY=ax}if(e._bind.curX+e._omViewMv.offsetWidth>=e._overviewMap.width){e._bind._moveX=-ax}if(e._bind.curY+e._omViewMv.offsetHeight>=e._overviewMap.height){e._bind._moveY=-ax}e._omViewMv.style.left=e._bind.curX+"px";e._omViewMv.style.top=e._bind.curY+"px";if((e._bind._moveX!=0||e._bind._moveY!=0)&&!e._bind.intervalId){e._bind._mapMoving=true;var aw=e._overviewMap.offsetX;var au=e._overviewMap.offsetY;var av=aw+e._bind._moveX;var at=au+e._bind._moveY;e._overviewMap._setPlatformPosition(av,at);e._bind.intervalId=setInterval(function(){var aB=e._bind._moveX!=0?(e._bind._moveX>0?e._bind.i+=ax:e._bind.i-=ax):e._bind.i;var aA=e._bind._moveY!=0?(e._bind._moveY>0?e._bind.j+=ax:e._bind.j-=ax):e._bind.j;e._overviewMap._setPlatformPosition(av+aB,at+aA)},30)}if(e._bind._moveX==0&&e._bind._moveY==0){clearInterval(e._bind.intervalId);delete e._bind.intervalId;e._bind.i=0;e._bind.j=0}al(ay);return U(ay)}});k.on(document,"mouseup",function(aw){if(e._omViewMv&&e._omViewMv._drag=="true"){e._omViewMv._drag="";e._setViewMvCursor(aj.defaultCursor);if(e._omViewMv.releaseCapture){e._omViewMv.releaseCapture()}if(e._bind.initX==e._bind.curX&&e._bind.initY==e._bind.curY){al(aw);return U(aw)}e._currentOp="dragView";e._overviewMap.config.enableMouseDown=false;e._map.temp.operating=true;if(typeof e._bind.curX=="undefined"||typeof e._bind.curY=="undefined"){return}var av=e._bind.curX+parseInt(e._omViewMv.style.width)/2+1;var au=e._bind.curY+parseInt(e._omViewMv.style.height)/2+1;delete e._bind.curX;delete e._bind.curY;var at=e._overviewMap.pixelToPoint({x:av,y:au},e._overviewMap.zoomLevel);var ar=N[e._map.mapType].bounds;if(at.lng<ar[0]||at.lng>ar[2]||at.lat<ar[1]||at.lat>ar[3]){at=e._overviewMap.getCenter()}e._map.temp.operating=false;if(e._bind._mapMoving==true){clearInterval(e._bind.intervalId);delete e._bind.intervalId;e._bind._mapMoving=false}e._map.temp.operating=true;setTimeout(function(){e._map.temp.operating=false;e._map.panTo(at)},50);al(aw);return U(aw)}})},_initOverviewMap:function(){if(this._overviewInitialized==true){return}var at=this;var au=at._map;au.addEventListener("resize",function(){if(at._overviewMap!=null){at._overviewMap.setCenter(au.getCenter())}if(at._omView!=null){at._omView.setPoint(au.getCenter());at._setRatio()}at.setAnchor(at._opts.anchor)});if(this._opts.isOpen==false){return}if(!this._binded){au.addEventListener("load",function(){at._onMainZoomEnd()});au.addEventListener("moving",function(){at._moveView()});au.addEventListener("moveend",function(av){at._onMainMoveEnd(av)});au.addEventListener("dragend",function(av){at._onMainMoveEnd(av)});au.addEventListener("zoomend",function(av){at._onMainZoomEnd(av)});this._binded=true}var e=au.getCenter();this._minZoomLevel=N[au.mapType].zoomLevelMin;this._maxZoomLevel=N[au.mapType].zoomLevelMax;this._curOMZoomLevel=this._getCurOMZoomLevel();this._overviewMap=new x(this._omMapContainer,{coordType:au.config.coordType,isOverviewMap:true});this._overviewMap.enableClickPan(false);this._overviewMap.enableScrollWheelZoom(false);this._overviewMap.enableDoubleClickZoom(false);this._overviewMap.enableKeyboard(false);this._overviewMap.enableMapArea(false);this._overviewMap.centerAndZoom(e,this._curOMZoomLevel);this._omView=new H({point:au.getCenter(),lineStroke:1,lineColor:"#6688cc"});this._overviewMap.addOverlay(this._omView);this._omView.getDom().innerHTML='<div class="BMap_omViewInnFrame"><div class="BMap_omViewMask"></div></div>';this._omViewInn=this._omView.getDom().children[0];var ar=this._omView.getDom().style;ar.borderLeftColor="#84b0df";ar.borderTopColor="#adcff4";ar.borderRightColor="#274b8b";ar.borderBottomColor="#274b8b";this._setRatio();this._overviewMap.addEventListener("dragend",function(){at._currentOp="dragMap";au.panTo(at._overviewMap.getCenter())});this._overviewMap.addEventListener("moveend",function(){at._onViewMapMoveEnd()});this._overviewMap.addEventListener("mousedown",function(av){at._temp._downX=av.offsetX;at._temp._downY=av.offsetY});this._overviewMap.addEventListener("resize",function(av){if(at._map&&at._overviewMap){at._overviewMap.setCenter(at._map.getCenter())}at._setRatio()});this._overviewInitialized=true},_setViewMvCursor:function(e){this._omViewMv.style.cursor=e},setAnchor:function(av){E.prototype.setAnchor.call(this,av);if(!this._map){return}if(k.Browser.ie){var ay=this._map.width;var au=this._map.height;var ar=this._opts.size.width;var aw=this._opts.size.height;var at=this._opts.offset.width;var e=this._opts.offset.height;if(this._opts.isOpen==false){ar=this._btnWidth;aw=this._btnHeight}var ax=this._container;switch(av){case BMAP_ANCHOR_TOP_RIGHT:ax.style.right="auto";ax.style.left=ay-ar-at+"px";break;case BMAP_ANCHOR_BOTTOM_LEFT:ax.style.bottom="auto";ax.style.top=au-aw-e+"px";break;case BMAP_ANCHOR_BOTTOM_RIGHT:ax.style.bottom="auto";ax.style.right="auto";ax.style.top=au-aw-e+"px";ax.style.left=ay-ar-at+"px";break;default:break}}this._setQuad();this._redraw()},changeView:function(){this.changeView._running=true;this._opts.isOpen=!this._opts.isOpen;if(!this._container){this.changeView._running=false;return}var aw=this._container;var e=this._opts.size.width;var at=this._opts.size.height;var av=this._btnWidth;var ar=this._btnHeight;var au=this;if(!this._opts.isOpen){this.changeView._preBtnTop=this._omBtn.style.top;this.changeView._preBtnLeft=this._omBtn.style.left;new A({fps:30,duration:120,transition:p.easeInCubic,render:function(ax){aw.style.width=(e-Math.ceil((e-av)*ax))+"px";aw.style.height=(at-Math.ceil((at-ar)*ax))+"px";if(k.Browser.ie){au._omBtn.style.top=(au._quad==3||au._quad==4)?parseInt(aw.style.height)-ar+"px":"0";au._omBtn.style.left=(au._quad==1||au._quad==4)?parseInt(aw.style.width)-av+"px":"0";if(au._opts.anchor>=0&&au._opts.anchor<=BMAP_ANCHOR_BOTTOM_RIGHT){if(au._quad==3||au._quad==4){aw.style.top=au._map.height-parseInt(aw.style.height)-au._opts.offset.height+"px"}if(au._quad==1||au._quad==4){aw.style.left=au._map.width-parseInt(aw.style.width)-au._opts.offset.width+"px"}}}au.dispatchEvent(new ak("onviewchanging"))},finish:function(){if(k.Browser.ie){au._omBtn.style.left="0";au._omBtn.style.top="0";if(au._opts.anchor>=0&&au._opts.anchor<=BMAP_ANCHOR_BOTTOM_RIGHT){if(au._quad==3||au._quad==4){aw.style.top=au._map.height-au._btnHeight-au._opts.offset.height+"px"}if(au._quad==1||au._quad==4){aw.style.left=au._map.width-au._btnWidth-au._opts.offset.width+"px"}}}au._redraw();k.ac(au._omBtn,"BMap_omBtnClosed");var ax=new ak("onviewchanged");ax.isOpen=au._opts.isOpen;au.dispatchEvent(ax);au.changeView._running=false}})}else{if(this._overviewInitialized==false){this._initOverviewMap()}new A({fps:40,duration:120,transition:p.easeOutCubic,render:function(ax){aw.style.width=(Math.ceil(e*ax))+"px";aw.style.height=(Math.ceil(at*ax))+"px";if(k.Browser.ie){au._omBtn.style.top=(au._quad==3||au._quad==4)?parseInt(aw.style.height)-ar+"px":"0";au._omBtn.style.left=(au._quad==1||au._quad==4)?parseInt(aw.style.width)-av+"px":"0";if(au._opts.anchor>=0&&au._opts.anchor<=BMAP_ANCHOR_BOTTOM_RIGHT){if(au._quad==3||au._quad==4){aw.style.top=au._map.height-parseInt(aw.style.height)-au._opts.offset.height+"px"}if(au._quad==1||au._quad==4){aw.style.left=au._map.width-parseInt(aw.style.width)-au._opts.offset.width+"px"}}}au.dispatchEvent(new ak("onviewchanging"))},finish:function(){if(au._opts.anchor>=0&&au._opts.anchor<=BMAP_ANCHOR_BOTTOM_RIGHT){if(k.Browser.ie){if(au._quad==3||au._quad==4){aw.style.top=au._map.height-at-au._opts.offset.height+"px"}if(au._quad==1||au._quad==4){aw.style.left=au._map.width-e-au._opts.offset.width+"px"}}}au._redraw();au._setBtnPosition();k.rc(au._omBtn,"BMap_omBtnClosed");var ax=new ak("onviewchanged");ax.isOpen=au._opts.isOpen;au.dispatchEvent(ax);au.changeView._running=false}})}},_setRatio:function(){if(!this._map){return}var ax=this._map.zoomLevel;var az=this._map.pixelToPoint({x:0,y:0},ax);var au=this._map.pixelToPoint({x:this._map.width,y:this._map.height},ax);var ar=this._overviewMap.pixelToPoint({x:0,y:0},this._curOMZoomLevel);var at=this._overviewMap.pixelToPoint({x:this._overviewMap.width,y:this._overviewMap.height},this._curOMZoomLevel);this._wRatio=(au.lng-az.lng)/(at.lng-ar.lng);this._hRatio=(au.lat-az.lat)/(at.lat-ar.lat);if(this._wRatio>=1||this._hRatio>=1){this._omViewMv.style.display="none";this._omView.hide()}else{var av=parseInt(this._overviewMap.width);var e=parseInt(this._overviewMap.height);var ay=Math.round(av*this._wRatio);var aw=Math.round(e*this._hRatio);this._omView.show();this._omView.setDimension(ay,aw);this._omViewMv.style.display=""}this._setOMViewMvPos()},_setOMViewMvPos:function(){if(!this._omView||!this._omView.getDom()){return}if(this._wRatio>=1||this._hRatio>=1){this._omViewMv.style.display="none";return}var ar=this._omView.getDom().style;this._omViewMv.style.display="";this._omViewMv.style.width=ar.width;this._omViewMv.style.height=ar.height;var e=parseInt(ar.width)-2;var at=parseInt(ar.height)-2;e=e<0?0:e;at=at<0?0:at;this._omViewMvInn.style.width=e+"px";this._omViewMvInn.style.height=at+"px";this._omViewInn.style.width=this._omViewMvInn.style.width;this._omViewInn.style.height=this._omViewMvInn.style.height;this._omViewMv.style.left=parseInt(ar.left)+this._overviewMap.offsetX+"px";this._omViewMv.style.top=parseInt(ar.top)+this._overviewMap.offsetY+"px"},setSize:function(at){if(!at||at.toString()!="Size"){at=new f(150,150)}var ar=at.width;var au=at.height;ar=ar>0?ar:150;au=au>0?au:150;this._opts.size=at;if(!this._container){return}if(this.changeView._running==true){var e=arguments;var av=this;setTimeout(function(){e.callee.call(av,at)},120);return}Y(this._container,[ar,au]);var av=this;setTimeout(function(){if(av._overviewMap&&av._map){av._overviewMap.setCenter(av._map.getCenter())}},100);this.setAnchor(this._opts.anchor);this.dispatchEvent(new ak("resize"))},getSize:function(){if(this._container){return new f(parseInt(this._container.style.width),parseInt(this._container.style.height))}else{return this._opts.size}},setOffset:function(e){if(!e||e.toString()!="Size"){return}E.prototype.setOffset.call(this,e);if(e.width!=0||e.height!=0){k.ac(this._container,"withOffset")}else{k.rc(this._container,"withOffset")}},_redraw:function(){if(!this._omCanvas){return}var at=this._opts.size.width;var aw=this._opts.size.height;var ay=this._opts.padding;var e=this._borderWidth;var au=0;var ax=0;var ar=0;var av=0;this._omCanvas.style.left=this._omCanvas.style.top=this._omCanvas.style.right=this._omCanvas.style.bottom="auto";this._omBtn.style.left=this._omBtn.style.top=this._omBtn.style.right=this._omBtn.style.bottom="auto";if(this._opts.offset.width==0&&this._opts.offset.height==0){switch(this._opts.anchor){case BMAP_ANCHOR_TOP_LEFT:this._omCanvas.style.left="0px";this._omCanvas.style.top="0px";break;case BMAP_ANCHOR_TOP_RIGHT:this._omCanvas.style.left=ay+"px";this._omCanvas.style.top="0px";break;case BMAP_ANCHOR_BOTTOM_LEFT:this._omCanvas.style.top=ay+"px";this._omCanvas.style.left="0px";break;case BMAP_ANCHOR_BOTTOM_RIGHT:this._omCanvas.style.top=ay+"px";this._omCanvas.style.left=ay+"px";break;default:break}au=at-e;ax=aw-e;ar=au-ay-2*e;av=ax-ay-2*e;if(k.Browser.ie&&document.compatMode=="BackCompat"){au=au+1;ax=ax+1;ar=ar+2;av=av+2}}else{this._omCanvas.style.left=this._omCanvas.style.top=this._omCanvas.style.right=this._omCanvas.style.bottom=ay+"px";au=at-2*e;ax=aw-2*e;ar=au-2*ay-2*e;av=ax-2*ay-2*e;if(this._opts.offset.width!=0||this._opts.offset.height!=0){k.ac(this._container,"withOffset")}if(k.Browser.ie&&document.compatMode=="BackCompat"){au=au+2;ax=ax+2;ar=ar+2;av=av+2}}if(au>0&&ax>0){Y(this._container.children[0],[au,ax])}if(ar>0&&av>0){Y(this._omCanvas,[ar,av])}this._setBtnPosition();k.rc(this._omBtn,"BMap_omBtnClosed");if(!this._opts.isOpen){this._container.style.width=this._btnWidth+"px";this._container.style.height=this._btnHeight+"px";if(k.Browser.ie){this.changeView._preBtnTop=this._omBtn.style.top;this.changeView._preBtnLeft=this._omBtn.style.left;this._omBtn.style.left="0";this._omBtn.style.top="0"}k.ac(this._omBtn,"BMap_omBtnClosed")}},_setQuad:function(){var ar=this._container;if(!ar){return}var e=this._quad;switch(this._opts.anchor){case BMAP_ANCHOR_TOP_LEFT:this._quad=2;break;case BMAP_ANCHOR_TOP_RIGHT:this._quad=1;break;case BMAP_ANCHOR_BOTTOM_LEFT:this._quad=3;break;case BMAP_ANCHOR_BOTTOM_RIGHT:this._quad=4;break;default:break}k.rc(ar,"quad"+e);k.ac(ar,"quad"+this._quad)},_setBtnPosition:function(){if(!k.Browser.ie){switch(this._quad){case 2:this._omBtn.style.top="0";this._omBtn.style.left="0";break;case 1:this._omBtn.style.top="0";this._omBtn.style.right="0";break;case 4:this._omBtn.style.bottom="0";this._omBtn.style.right="0";break;case 3:this._omBtn.style.bottom="0";this._omBtn.style.left="0";break;default:break}}else{var au=this._btnWidth;var ar=this._btnHeight;var e=this._opts.size.width;var at=this._opts.size.height;this._omBtn.style.left="auto";this._omBtn.style.top="auto";this._omBtn.style.right="auto";this._omBtn.style.bottom="auto";switch(this._quad){case 2:this._omBtn.style.left="0px";this._omBtn.style.top="0px";break;case 1:this._omBtn.style.left=e-au+"px";this._omBtn.style.top="0px";break;case 4:this._omBtn.style.top=at-ar+"px";this._omBtn.style.left=e-au+"px";break;case 3:this._omBtn.style.left="0px";this._omBtn.style.top=at-ar+"px";break;default:break}}},_moveView:function(){if(this._omView){this._omView.setPoint(this._map.getCenter())}},_onMainMoveEnd:function(ar){switch(this._currentOp){case"dragMap":this._setOMViewMvPos();this._currentOp="";break;case"dragView":this._omViewMv.style.display="none";this._overviewMap.panTo(this._map.getCenter(),false,90);this._currentOp="";break;default:if(this._overviewMap){this._overviewMap.panTo(this._map.getCenter(),false,90)}break}},_onMainZoomEnd:function(){if(!this._overviewMap){return}var e=this;e._curOMZoomLevel=e._getCurOMZoomLevel();setTimeout(function(){e._overviewMap.centerAndZoom(e._map.getCenter(),e._curOMZoomLevel);e._omView.setPoint(e._map.getCenter());e._setRatio()},100)},_onViewMapMoveEnd:function(){this._setOMViewMvPos();this._overviewMap.config.enableMouseDown=true},remove:function(){E.prototype.remove.call(this);this._omCanvas=null;this._omMapContainer=null;this._omView=null;this._omViewInn=null;this._omViewMv=null;this._omViewMvInn=null;this._omBtn=null;this._overviewInitialized=false;this._overviewMap=null},isOpen:function(){if(!this._container){return false}return this._opts.isOpen}});function F(e){E.call(this);e=e||{};this._opts=k.extend(k.extend(this._opts,{color:"black",unit:"metric"}),e);this.defaultAnchor=BMAP_ANCHOR_BOTTOM_LEFT;this.defaultOffset=new f(81,18);this.setAnchor(e.anchor);this._units={metric:{name:"metric",conv:1,incon:1000,u1:"\u7c73",u2:"\u516c\u91cc"},us:{name:"us",conv:3.2808,incon:5280,u1:"\u82f1\u5c3a",u2:"\u82f1\u91cc"}};if(!this._units[this._opts.unit]){this._opts.unit="metric"}this._scaleText=null;this._numberArray={}}window.BMAP_UNIT_METRIC="metric";window.BMAP_UNIT_IMPERIAL="us";F.inherits(E,"ScaleControl");k.extend(F.prototype,{initialize:function(ar){E.prototype.initialize.call(this,ar);this._render();this._numberArray={us:[5280*5000,5280*2500,5280*2000,5280*1000,5280*500,5280*200,5280*100,5280*50,5280*25,5280*20,5280*10,5280*5,5280*2,5280,2000,1000,500,200,100,50,20,10,5],metric:[10000000,5000000,2000000,1000000,500000,200000,100000,50000,25000,20000,10000,5000,2000,1000,500,200,100,50,20,10,5,2,1]};this._updateScale();var e=this;ar.addEventListener("zoomend",function(at){e._updateScale()});ar.addEventListener("load",function(at){e._updateScale()});ar.addEventListener("moveend",function(at){e._updateScale()});ar.addEventListener("dragend",function(at){e._updateScale()});return this._container},_render:function(){E.prototype._render.call(this);k.ac(this._container,"BMap_scaleCtrl");this._container.innerHTML=this._generateHTML();this._scaleText=this._container.children[0];E.prototype._setPosition.call(this)},_generateHTML:function(){var e='<div class="BMap_scaleTxt" unselectable="on"></div><div class="BMap_scaleBar BMap_scaleHBar"><img src="'+aj.imgPath+'mapctrls11.png" /></div><div class="BMap_scaleBar BMap_scaleLBar"><img src="'+aj.imgPath+'mapctrls11.png" /></div><div class="BMap_scaleBar BMap_scaleRBar"><img src="'+aj.imgPath+'mapctrls11.png" /></div>';return e},setColor:function(e){this._opts.color=e+"";if(!this._container){return}this._container.children[0].style.backgroundColor="transparent";this._container.children[0].style.color=e;for(var at=1,ar=this._container.children.length;at<ar;at++){this._container.children[at].style.backgroundColor=e}},getColor:function(){return this._opts.color},setUnit:function(e){this._opts.unit=this._units[e]&&this._units[e].name||this._opts.unit;if(!this._map){return}this._updateScale()},getUnit:function(){return this._opts.unit},_setScaleText:function(ar,e){if(typeof ar!="number"||typeof e!="string"){return}this._scaleText.innerHTML=ar+"&nbsp;"+e},_updateScale:function(){if(!this._map||!this._container){return}var aw=this._map.config.coordType;var ar=aw==BMAP_COORD_LNGLAT?10:500000;var av=new D(this._map.getCenter().lng,this._map.getCenter().lat+ar);var ax=Math.abs(this._map.pointToPixel(this._map.getCenter()).y-this._map.pointToPixel(av).y);var aB;if(aw==BMAP_COORD_LNGLAT){aB=an.getDistanceByLL(this._map.getCenter(),av)/ax}else{if(aw==BMAP_COORD_MERCATOR){aB=an.getDistanceByMC(this._map.getCenter(),av)/ax}}if(aB==0||isNaN(aB)){return}var az=this._convertUnit(aB,this._opts.unit);var e=0;var at=this._units[this._opts.unit].incon;var ay=this._map.getZoom();var au=this._numberArray[this._opts.unit][this._map.getZoom()-1];e=au/az;var aA=au>=at?this._units[this._opts.unit].u2:this._units[this._opts.unit].u1;if(au>=at){au=Math.round(au/at)}this._setScaleText(au,aA);if(Math.round(e)%2!=0&&k.Browser.ie==6){e=e+1}this._container.style.width=Math.round(e)+"px"},_convertUnit:function(e,ar){ar=ar||"metric";if(this._units[ar]){return e*this._units[ar].conv}return e}});window.BMAP_NAVIGATION_CONTROL_LARGE=0;window.BMAP_NAVIGATION_CONTROL_SMALL=1;window.BMAP_NAVIGATION_CONTROL_PAN=2;window.BMAP_NAVIGATION_CONTROL_ZOOM=3;function Z(e){E.call(this);e=e||{};k.extend(this._opts,e);this.controlHeight=[{width:52,height:226,zoomHeight:167,zoomWidth:37,sliderHeight:133,sliderCHeight:124},{width:37,height:97,zoomHeight:38,zoomWidth:37,sliderHeight:0,sliderCHeight:0},{width:37,height:57,zoomHeight:0,zoomWidth:0,sliderHeight:0,sliderCHeight:0},{width:18,height:38,zoomHeight:38,zoomWidth:18,sliderHeight:0,sliderCHeight:0}];this.defaultAnchor=BMAP_ANCHOR_TOP_LEFT;this.defaultOffset=new f(10,10);this.setAnchor(e.anchor);this.setType(e.type);this._maxTotalZoomLv=18;this._minZoomLevel=-1;this._maxZoomLevel=-1;this._totalZoomLv=-1;this._sliderInterval=7;this._minBarY=1;this._maxBarY=-1;this._curBarY=-1;this._zoomDom=null;this._zoomBtnDom=null;this._sliderDom=null;this._sliderBaseDom=null;this._cZIndex="1100"}Z.inherits(E,"NavigationControl");k.extend(Z.prototype,{initialize:function(ar){E.prototype.initialize.call(this,ar);this._setParam();this._render();this._bind();this._setSliderZoomLv(ar.getZoom());var e=this;ar.addEventListener("zoomend",function(at){if(!e._map){return}e._setSliderZoomLv(e._map.getZoom());if(e._msover){return}if(e._isShowLevelHint){e._hideTimerId=setTimeout(function(){e._hideLevelHint()},1000)}});ar.addEventListener("mousewheel",function(){if(!e._map){return}if(e._map.config.enableWheelZoom&&e._isShowLevelHint){if(e._hideTimerId){clearTimeout(e._hideTimerId);e._hideTimerId=null}e._showLevelHint()}});ar.addEventListener("load",function(at){if(!e._map){return}e._setSliderZoomLv(e._map.getZoom())});return this._container},_setParam:function(){var e=this._map.mapType;this._minZoomLevel=this._map.config.zoomLevelMin;this._maxZoomLevel=this._map.config.zoomLevelMax;if(this._minZoomLevel!=N[e].zoomLevelMin||this._maxZoomLevel!=N[e].zoomLevelMax){this._isShowLevelHint=false}else{this._isShowLevelHint=true}this._totalZoomLv=this._maxZoomLevel-this._minZoomLevel+1;this._maxBarY=this._minBarY+(this._totalZoomLv-1)*this._sliderInterval},_render:function(){E.prototype._render.call(this);var at=k.Browser.ie==6?" BMap_ie6":"";var ar=" BMap_stdMpType"+this._opts.type;var au=this._container;k.ac(au,"BMap_stdMpCtrl");k.ac(au,at);k.ac(au,ar);au.innerHTML=this._generateHtml(this._opts.type);this._setSliderBarCursor(k.Browser.opera?"pointer":aj.defaultCursor);this._zoomDom=k.G(au.children[1]);var e=this._zoomDom;this._zoomBtnDom=k.G(e.children[0]);this._sliderDom=k.G(e.children[1]);this._sliderBaseDom=k.G(e.children[1].children[0]);this._sliderBotDom=k.G(e.children[1].children[1]);this.setType(this._opts.type)},_setSliderHeight:function(){var az=this._opts.type;var ax=this.controlHeight[az].width;var e=this.controlHeight[az].height;var au=this.controlHeight[az].zoomHeight;var ay=this.controlHeight[az].zoomWidth;var ar=this.controlHeight[az].sliderHeight;var av=this.controlHeight[az].sliderCHeight;var at=(this._maxTotalZoomLv-this._totalZoomLv)*this._sliderInterval;if(this._opts.type==BMAP_NAVIGATION_CONTROL_LARGE){e=e-at>=0?e-at:0;au=au-at>=0?au-at:0;ar=ar-at>=0?ar-at:0;av=av-at>=0?av-at:0;sliderBotDomTop=124-at>=0?124-at:0;this._sliderBotDom.style.top=sliderBotDomTop+"px"}this._container.style.width=ax+"px";this._container.style.height=e+"px";this._zoomDom.style.height=au+"px";this._zoomDom.style.width=ax+"px";this._zoomBtnDom.style.height=au+"px";this._zoomBtnDom.style.width=ay+"px";this._sliderDom.style.height=ar+"px";this._sliderBaseDom.style.height=av+"px";var aw=this._zoomBtnDom.children;if(this._opts.type==BMAP_NAVIGATION_CONTROL_ZOOM){aw[0].style.left=aw[1].style.left="0"}else{aw[0].style.left=aw[1].style.left=""}},_generateHtml:function(){var e=[];e.push(this._generatePanHtml());e.push(this._generateZoomContainerHtml());return e.join("")},_generatePanHtml:function(){var e='<div class="BMap_stdMpPan"><div class="BMap_button BMap_panN" title="\u5411\u4e0a\u5e73\u79fb"></div><div class="BMap_button BMap_panW" title="\u5411\u5de6\u5e73\u79fb"></div><div class="BMap_button BMap_panE" title="\u5411\u53f3\u5e73\u79fb"></div><div class="BMap_button BMap_panS" title="\u5411\u4e0b\u5e73\u79fb"></div><div class="BMap_stdMpPanBg BMap_smcbg"></div></div>';return e},_generateZoomContainerHtml:function(){var e='<div class="BMap_stdMpZoom">'+this._generateZoomHtml()+this._generateSliderHtml()+this._generateZoomBalloonHtml()+"</div>";return e},_generateZoomHtml:function(){var e='<div><div class="BMap_button BMap_stdMpZoomIn" title="\u653e\u5927\u4e00\u7ea7"><div class="BMap_smcbg"></div></div><div class="BMap_button BMap_stdMpZoomOut" title="\u7f29\u5c0f\u4e00\u7ea7"><div class="BMap_smcbg"></div></div></div>';return e},_generateSliderHtml:function(){var e='<div class="BMap_stdMpSlider"><div class="BMap_stdMpSliderBgTop"><div class="BMap_smcbg"></div></div><div class="BMap_stdMpSliderBgBot"><div class="BMap_smcbg"></div></div><div class="BMap_stdMpSliderMask" title="\u653e\u7f6e\u5230\u6b64\u7ea7\u522b"></div><div class="BMap_stdMpSliderBar" title="\u62d6\u52a8\u7f29\u653e"><div class="BMap_smcbg"></div></div></div>';return e},_generateZoomBalloonHtml:function(){var e='<div class="BMap_zlHolder"><div class="BMap_zlSt"><div class="BMap_smcbg"></div></div><div class="BMap_zlCity"><div class="BMap_smcbg"></div></div><div class="BMap_zlProv"><div class="BMap_smcbg"></div></div><div class="BMap_zlCountry"><div class="BMap_smcbg"></div></div></div>';return e},setType:function(e){if(typeof e=="number"&&e>=BMAP_NAVIGATION_CONTROL_LARGE&&e<=BMAP_NAVIGATION_CONTROL_ZOOM){this._opts.type=e}else{this._opts.type=BMAP_NAVIGATION_CONTROL_LARGE}if(!this._map||!this._container){return}var ar=this._container;ar.className=ar.className.replace(/BMap_stdMpType\d/,"BMap_stdMpType"+this._opts.type);this._setSliderHeight();if(e!=BMAP_NAVIGATION_CONTROL_LARGE){k.rc(ar.children[1].children[2],"hvr")}this.setAnchor(this._opts.anchor)},getType:function(){return this._opts.type},_bind:function(){var ay=this;var ax=ay._container;k.on(this._zoomDom,"mouseover",function(){if(!ay._isShowLevelHint){return}ay._msover=true;if(ay._hideTimerId){clearTimeout(ay._hideTimerId);ay._hideTimerId=null}ay._showLevelHint()});k.on(this._zoomDom,"mouseout",function(){if(!ay._isShowLevelHint){return}if(ay._hideTimerId){clearTimeout(ay._hideTimerId)}ay._msover=false;ay._hideTimerId=setTimeout(function(){ay._hideLevelHint();ay._hideTimerId=null},1000)});k.on(ax.children[0],"mouseover",function(){ay._hideLevelHint(true)});k.on(ax.children[0].children[0],"click",function(){ay._panBy(0,Math.round(ay._map.height/3))});k.on(ax.children[0].children[1],"click",function(){ay._panBy(Math.round(ay._map.width/3),0)});k.on(ax.children[0].children[2],"click",function(){ay._panBy(-Math.round(ay._map.width/3),0)});k.on(ax.children[0].children[3],"click",function(){ay._panBy(0,-Math.round(ay._map.height/3))});var av=ax.children[1].children[0].children;k.on(av[0],"click",function(){ay._zoomIn()});k.on(av[1],"click",function(){ay._zoomOut()});for(var at=1;at<6;at++){k.on(ax.children[0].children[at],"mouseup",function(aA){if((ay._map.currentOperation&g.stdMapCtrlDrag)==0&&(ay._map.currentOperation&g.drag)==0){al(aA)}});k.on(ax.children[0].children[at],"contextmenu",function(aA){U(aA)});k.on(ax.children[0].children[at],"click",function(aA){U(aA)})}k.on(av[0],"mouseup",function(aA){if((ay._map.currentOperation&g.stdMapCtrlDrag)==0&&(ay._map.currentOperation&g.drag)==0){al(aA)}});k.on(av[1],"mouseup",function(aA){if((ay._map.currentOperation&g.stdMapCtrlDrag)==0&&(ay._map.currentOperation&g.drag)==0){al(aA)}});k.on(av[0],"contextmenu",function(aA){U(aA)});k.on(av[1],"contextmenu",function(aA){U(aA)});var az=ax.children[1].children[1].children[2];k.on(az,"mouseup",function(aA){if((ay._map.currentOperation&g.stdMapCtrlDrag)==0&&(ay._map.currentOperation&g.drag)==0){al(aA)}});k.on(av[0],"click",function(aA){al(aA)});k.on(av[1],"click",function(aA){al(aA)});k.on(az,"click",function(aA){al(aA)});var aw=ax.children[1].children[1].children[3];k.on(aw,"mouseup",function(aA){if(aA.button==2){al(aA)}});k.on(aw,"contextmenu",function(aA){U(aA)});k.on(this._zoomDom.children[2].children[0],"click",function(aA){ay._map.zoomTo(18)});k.on(this._zoomDom.children[2].children[1],"click",function(aA){ay._map.zoomTo(12)});k.on(this._zoomDom.children[2].children[2],"click",function(aA){ay._map.zoomTo(8)});k.on(this._zoomDom.children[2].children[3],"click",function(aA){ay._map.zoomTo(4)});k.on(az,"mousedown",function(aB){aB=window.event||aB;var aA=0;if(typeof aB.layerY!="undefined"){aA=aB.layerY}else{if(typeof aB.offsetY!="undefined"){aA=aB.offsetY}}var aC=0;aC=(ay._maxZoomLevel+1)-Math.round(ay._totalZoomLv*parseFloat(aA/(ay._totalZoomLv*ay._sliderInterval)));ay._map.zoomTo(aC)});k.on(aw,"mouseover",function(){k.ac(aw,"h")});k.on(aw,"mouseout",function(){if((ay._map.currentOperation&g.stdMapCtrlDrag)==0){k.rc(aw,"h")}});var au=function(aA){var aA=window.event||aA;if(aA.button==2){return}if((k.Browser.ie&&aA.button!=1)){return}if(aw.setCapture){aw.setCapture()}ay._map.currentOperation|=g.stdMapCtrlDrag;ay._bind.my=aA.pageY||aA.clientY||0;if(!k.Browser.opera){ay._setSliderBarCursor(aj.draggingCursor)}k.on(document,"mousemove",e);k.on(document,"mouseup",ar);al(aA);return U(aA)};var e=function(aB){if((ay._map.currentOperation&g.stdMapCtrlDrag)!=0){var aB=window.event||aB;var aC=aB.pageY||aB.clientY;var aA=ay._curBarY+aC-ay._bind.my;if(aA<ay._minBarY){aw.style.top=ay._minBarY+"px"}else{if(aA>ay._maxBarY){aw.style.top=ay._maxBarY+"px"}else{aw.style.top=aA+"px"}}}};var ar=function(aB){if((ay._map.currentOperation&g.stdMapCtrlDrag)!=0){var aA=k.G(aw);ay._curBarY=parseInt(aA.style.top);k.rc(aw,"h");ay._map.currentOperation&=~g.stdMapCtrlDrag;if(ax&&aw&&aw.releaseCapture){aw.releaseCapture()}if(!k.Browser.opera){ay._setSliderBarCursor(aj.defaultCursor)}var aC=(ay._maxZoomLevel+1)-Math.round(parseFloat(ay._curBarY-ay._minBarY)/parseFloat(ay._maxBarY-ay._minBarY)*(ay._totalZoomLv-1)+1);ay._map.zoomTo(aC);k.un(document,"mousemove",e);k.un(document,"mouseup",ar)}};k.on(aw,"mousedown",au)},_setSliderBarCursor:function(e){this._container.children[1].children[1].children[3].style.cursor=e},_panBy:function(ar,e){this._map.panBy(ar,e)},_zoomIn:function(){this._map.zoomIn()},_zoomOut:function(){this._map.zoomOut()},_setSliderZoomLv:function(ar){if(!this._container||this.getType()!=BMAP_NAVIGATION_CONTROL_LARGE){return}var e=(this._maxZoomLevel-ar)*this._sliderInterval+this._minBarY;this._curBarY=e>this._maxBarY?this._maxBarY:e<this._minBarY?this._minBarY:e;this._container.children[1].children[1].children[3].style.top=this._curBarY+"px"},_hideLevelHint:function(e){if(this._opts.type==0){k.rc(this._container.children[1].children[2],"hvr")}if(e&&this._hideTimerId){clearTimeout(this._hideTimerId);this._hideTimerId=null}},_showLevelHint:function(){if(this._opts.type==0){k.ac(this._container.children[1].children[2],"hvr")}}});function M(e){q.call(this);this._opts={container:null,cursor:"default"};this._opts=k.extend(this._opts,e);this._type="contextmenu";this._map=null;this._container;this._shadow;this._left=0;this._top=0;this._items=[];this._rItems=[];this._dividers=[];this.curPixel=null;this.curPoint=null;this._isOpen=false}M.inherits(q,"ContextMenu");k.extend(M.prototype,{initialize:function(au){if(this._container){return false}this._map=au;this._render();var at=this;this._container.style.cursor=au.config.defaultCursor;this._shadow.style.cursor=this._container.style.cursor;k.on(document,"mousedown",function(aw){if(!at._container){return}at.hide()});k.on(this._container,"click",function(aw){at.hide();al(aw)});var av=this._opts.container;if(!av){av=this._map.container}k.on(av,"contextmenu",function(ax){if(!at._container){return}ax=window.event||ax;var aw=ax.target||ax.srcElement;while(aw&&!k.hc(aw,"pop")){aw=aw.parentNode}if(aw&&k.hc(aw,"pop")){at.hide();return}at._showMenu(ax,av);return U(ax)});for(var ar=0,e=this._items.length;ar<e;ar++){if(this._items[ar]._type=="menuitem"){this._items[ar].initialize(au,this)}if(this._items[ar]._type=="divider"){this._dividers[this._items[ar]._dIndex].dom=V(this._container,"<div class='BMap_cmDivider'></div>")}}this._updateShadowSize()},remove:function(){if(this._container){this._container.parentNode.removeChild(this._container);this._container=null}if(this._shadow){this._shadow.parentNode.removeChild(this._shadow);this._shadow=null}this._map=null},_render:function(){this._container=V(this._map.container,"<div unselectable='on'></div>");this._container.className="BMap_contextMenu";this._container.style.font="12px arial, simsun";this._shadow=V(this._map.container,"<div class='BMap_cmShadow'></div>");return this._container},addItem:function(at){if(!at||at._type!="menuitem"||at._text==""||at._width<=0){return}for(var ar=0,e=this._items.length;ar<e;ar++){if(this._items[ar]===at){return}}this._items.push(at);this._rItems.push(at);at.initialize(this._map,this);k.ac(at.getDom(),"BMap_cmLstItem");if(this._items.length>1){this._items[this._items.length-2]._type=="menuitem"&&k.rc(this._items[this._items.length-2].getDom(),"BMap_cmLstItem")}else{this._items[0]._type=="menuitem"&&k.ac(this._items[0].getDom(),"BMap_cmFstItem")}this._updateShadowSize()},removeItem:function(at){if(!at||at._type!="menuitem"){return}for(var ar=0,e=this._items.length;ar<e;ar++){if(this._items[ar]===at){this._items[ar].remove();this._items.splice(ar,1);e--}}for(var ar=0,e=this._rItems.length;ar<e;ar++){if(this._rItems[ar]===at){this._rItems[ar].remove();this._rItems.splice(ar,1);e--}}if(!this._container){return}if(this._items.length>0){this._items[this._items.length-1]._type=="menuitem"&&k.ac(this._items[this._items.length-1].getDom(),"BMap_cmLstItem")}this._updateShadowSize()},addSeparator:function(){this._items.push({_type:"divider",_dIndex:this._dividers.length});this._dividers.push({dom:null});if(!this._container){return}var e="<div class='BMap_cmDivider'></div>";this._dividers[this._dividers.length-1].dom=V(this._container,e);this._updateShadowSize()},removeSeparator:function(ar){if(!this._dividers[ar]){return}if(this._dividers[ar].dom&&this._dividers[ar].dom.parentNode){this._dividers[ar].dom.parentNode.removeChild(this._dividers[ar].dom)}for(var at=0,e=this._items.length;at<e;at++){if(this._items[at]&&this._items[at]._type=="divider"&&this._items[at]._dIndex==ar){this._items.splice(at,1);e--}if(this._items[at]&&this._items[at]._type=="divider"&&this._items[at]._dIndex>ar){this._items[at]._dIndex--}}this._dividers.splice(ar,1);this._updateShadowSize()},getDom:function(){return this._container},setPosition:function(e,ar){this._left=e;this._top=ar;this._container.style.left=e+"px";this._container.style.top=ar+"px";this._shadow.style.left=e+1+"px";this._shadow.style.top=ar+2+"px"},show:function(){if(this._isOpen==true){return}if(this._rItems.length==0){return}this._isOpen=true;if(this._container){this._container.style.visibility="visible"}if(this._shadow){this._shadow.style.visibility="visible"}var e=new ak("onopen");e.point=this.curPoint;e.pixel=this.curPixel;this.dispatchEvent(e)},hide:function(){if(this._isOpen==false){return}this._isOpen=false;if(this._container){this._container.style.visibility="hidden"}if(this._shadow){this._shadow.style.visibility="hidden"}var e=new ak("onclose");e.point=this.curPoint;e.pixel=this.curPixel;this.dispatchEvent(e)},setCursor:function(e){if(!e){return}this._opts.cursor=e;if(this._container){this._container.style.cursor=this._opts.cursor}if(this._shadow){this._shadow.style.cursor=this._opts.cursor}},_updateShadowSize:function(){if(this._container&&this._shadow){this._shadow.style.width=this._container.offsetWidth+"px";this._shadow.style.height=this._container.offsetHeight+"px"}},getItem:function(e){return this._rItems[e]},_showMenu:function(av,ax){if(this._rItems.length==0){return}var ay=this;var aA=av.layerX||av.offsetX;var az=av.layerY||av.offsetY;var aC=av.target||av.srcElement;var aw=aC;if(ax==ay._map.container&&aw!==ay._map.maskLayer&&aw.nodeName.toLowerCase()!="svg"){while(aw&&!k.hc(aw,"shadow")){aw=aw.parentNode}if(!k.hc(aw,"shadow")||aw.getAttribute("type")!="infowindow_shadow"){ay.hide();return}}while(aC&&aC!=ay._map.container){if(!(aC.clientWidth==0&&aC.clientHeight==0&&aC.offsetParent&&aC.offsetParent.nodeName.toLowerCase()=="td")){if(aC.nodeName.toLowerCase()=="svg"){aA+=parseInt(aC.getAttribute("viewBox").split(" ")[0])||0;az+=parseInt(aC.getAttribute("viewBox").split(" ")[1])||0}else{aA+=aC.offsetLeft;az+=aC.offsetTop}}aC=aC.offsetParent||aC.parentNode}ay.curPixel=new s(aA,az);ay.curPoint=ay._map.pixelToPoint(ay.curPixel);if(ay.curPoint.lng<N[ay._map.mapType].bounds[0]||ay.curPoint.lng>N[ay._map.mapType].bounds[2]||ay.curPoint.lat<N[ay._map.mapType].bounds[1]||ay.curPoint.lat>N[ay._map.mapType].bounds[3]){return}var au=ay.getDom().offsetHeight;var aB=ay.getDom().offsetWidth;var at=aA;var ar=az;if(aA+aB>this._map.width){at=aA-aB}if(az+au>this._map.height){ar=az-au}ay.setPosition(at,ar);ay.show()}});function L(ar,at,e){if(!ar||!at||typeof at!="function"){return}q.call(this);this._opts={width:100,id:""};e=e||{};this._opts.width=(e.width*1)?e.width:100;this._opts.id=e.id?e.id:"";this._text=ar+"";this._callback=at;this._map=null;this._type="menuitem";this._contextmenu=null;this._container=null;this._enabled=true}L.inherits(q,"MenuItem");k.extend(L.prototype,{initialize:function(e,ar){if(this._container){return false}this._map=e;this._contextmenu=ar;if(ar.getDom()){this._render();this._bind()}return true},remove:function(){var e=this;if(this._container){this._container.parentNode.removeChild(this._container);this._container=null}this._contextmenu=null;this._map=null},_render:function(){var e="<div"+(this._opts.id?" id='"+this._opts.id+"'":"")+" unselectable='on'><span>"+this._text+"</span></div>";this._container=V(this._contextmenu.getDom(),e);var ar=this._container.style;ar.padding="2px 6px";ar.margin="0 2px";ar.fontSize="12px";ar.MozUserSelect="none";ar.lineHeight="17px";ar.width=this._opts.width+"px";if(this._enabled){ar.color="#000";ar.cursor="pointer"}else{ar.color="#aaa";ar.cursor=this._map.config.defaultCursor}return this._container},_bind:function(){var e=this;k.on(this._container,"click",function(ar){if(!e._enabled){al(ar);return}if(e._callback&&e._callback.call){e._callback.call(e,e._contextmenu.curPoint,e._contextmenu.curPixel)}});k.on(this._container,"mousedown",function(ar){al(ar)});k.on(this._container,"mouseover",function(){if(!e._enabled){return}e._container.style.color="#6688cc"});k.on(this._container,"mouseout",function(){if(!e._enabled){return}e._container.style.color="#000"})},setText:function(e){if(!e){return}this._text=e+"";if(this._container){this._container.innerHTML="<span>"+this._text+"</span>"}},getDom:function(){return this._container},enable:function(){this._enabled=true;if(this._container){this._container.style.color="#000";this._container.style.cursor="pointer"}},disable:function(){this._enabled=false;if(this._container){this._container.style.color="#aaa";this._container.style.cursor=this._map.config.defaultCursor}}});function m(e,au,at,ar){this.minX=e;this.minY=au;this.maxX=at;this.maxY=ar}k.extend(m.prototype,{isEmpty:function(){var e="number";return(typeof(this.minX)!=e||typeof(this.minY)!=e||typeof(this.maxX)!=e||typeof(this.maxY)!=e)},equals:function(e){if(!e||e.toString()!="Bounds"){return}return(this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY)},getMaxX:function(){return this.maxX},getMaxY:function(){return this.maxY},getMinX:function(){return this.minX},getMinY:function(){return this.minY},containsBounds:function(e){if(!e||e.toString()!="Bounds"){return}return(e.minX>this.minX&&e.maxX<this.maxX&&e.minY>this.minY&&e.maxY<this.maxY)},getCenterPoint:function(){var e=(this.minX+this.maxX)/2;var ar=(this.minY+this.maxY)/2;return new D(e,ar)},getCenter:function(){return this.getCenterPoint()},intersects:function(at){if(!at||at.toString()!="Bounds"){return}if(Math.max(at.minX,at.maxX)<Math.min(this.minX,this.maxX)||Math.min(at.minX,at.maxX)>Math.max(this.minX,this.maxX)||Math.max(at.minY,at.maxY)<Math.min(this.minY,this.maxY)||Math.min(at.minY,at.maxY)>Math.max(this.minY,this.maxY)){return null}var av=Math.max(this.minX,at.minX);var ar=Math.min(this.maxX,at.maxX);var au=Math.max(this.minY,at.minY);var e=Math.min(this.maxY,at.maxY);return new m(av,au,ar,e)},containsPoint:function(e){if(!e||e.toString()!="Point"){return}return(e.lng>=this.minX&&e.lng<=this.maxX&&e.lat>=this.minY&&e.lat<=this.maxY)},extend:function(e){if(!e||e.toString()!="Point"){return}var at=e.lng,ar=e.lat;if(this.minX>at){this.minX=at}if(this.maxX<at){this.maxX=at}if(this.minY>ar){this.minY=ar}if(this.maxY<ar){this.maxY=ar}},getIntersectLine:function(e){if(!e||e.toString()!="Line"){return}var ar=e.sPoint;var au=e.ePoint;var at=[];if(ar.lat==au.lat){if(ar.lng==au.lng){return null}if(ar.lat>this.minY&&ar.lat<this.maxY){}var e=new Line(at.lng,at.lat);return e}},getMin:function(){return new D(this.minX,this.minY)},getMax:function(){return new D(this.maxX,this.maxY)},toString:function(){return"Bounds"}});function D(e,ar){if(isNaN(e)){e=0}else{if(typeof e=="string"){e=parseFloat(e)}}if(isNaN(ar)){ar=0}else{if(typeof ar=="string"){ar=parseFloat(ar)}}this.lng=e;this.lat=ar}D.inherits(q,"Point");D.prototype.equals=function(e){if(!e||e.toString()!="Point"){return}return(this.lat==e.lat&&this.lng==e.lng)};var g={undo:1,redo:2,zoom:4,drag:8,move:16,mousewheel:32,toolbarOperation:64,stdMapCtrlDrag:128,dblclick:256};var j={_map:null,_html:"<div class='BMap_opMask' unselectable='on'></div>",_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(e){if(!this._map){this._map=e}if(!this._map){return}this._maskElement=V(this._map.container,this._html);k.on(this._maskElement,"mouseup",function(ar){if(ar.button==2){al(ar);return U(ar)}});k.on(this._maskElement,"click",function(ar){});this._maskElement.style.display="none"},getDrawPoint:function(au,ax,av){au=window.event||au;var ar=au.layerX||au.offsetX||0;var aw=au.layerY||au.offsetY||0;var at=au.target||au.srcElement;if(at!=j.getDom(this._map)&&ax==true){while(at&&at!=this._map.container){if(!(at.clientWidth==0&&at.clientHeight==0&&at.offsetParent&&at.offsetParent.nodeName.toLowerCase()=="td")){ar+=at.offsetLeft;aw+=at.offsetTop}at=at.offsetParent}}if(at!=j.getDom(this._map)&&at!=this._map.container){return}if(typeof ar==="undefined"||typeof aw==="undefined"){return}if(isNaN(ar)||isNaN(aw)){return}if(av){ar=ar+av.x;aw=aw+av.y}return this._map.pixelToPoint(new s(ar,aw))},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 ag(){k.BaseClass.call(this);this._visible=true;this._type="overlay";this.infoWindow=null}ag.inherits(k.BaseClass,"Overlay");z.register(function(at){var ar='<div style="position:absolute;top:0;left:0;width:0;height:0;z-index:200"></div>';at.temp.overlayDiv=at.overlayDiv=V(at.platform,ar);var e='<div style="position:absolute;top:0;left:0;width:0;height:0" type="system"></div>';at.temp.areaDiv=V(at.temp.overlayDiv,e);at.temp.areaDiv.style.zIndex=700;at.temp.labelDiv=V(at.temp.overlayDiv,e);at.temp.labelDiv.style.zIndex=500;at.markerDiv=at.temp.markerDiv=V(at.temp.overlayDiv,e);at.temp.markerDiv.style.zIndex=400});ag.getZIndex=function(ar,e){ar=ar*1;if(!ar){return 0}if(e&&e==BMAP_COORD_MERCATOR){ar=an.convertMC2LL(new z.Point(0,ar)).lat}return(ar*-100000)<<5};k.extend(ag.prototype,{remove:function(){if(this.domElement&&this.domElement.parentNode&&this.domElement.parentNode.tagName){if(this.infoWindow&&this.infoWindow.overlay&&this.infoWindow.overlay==this){this.closeInfoWindow()}this.domElement.parentNode.removeChild(this.domElement);this.domElement=null;this.dispatchEvent(new ak("onremove"))}},_addOverlayDom:function(){var at=this.map;if(!this.domElement){switch(this.toString()){case"Marker":this.domElement=V(at.temp.areaDiv,this.render());this.siblingElement=V(at.temp.markerDiv,this.siblingRender());this.siblingElement.hashCode=this.getHashCode();break;case"Label":this.domElement=V(at.temp.labelDiv,this.render());break;default:this.domElement=V(at.temp.overlayDiv,this.render());break}var e=this;if(this.domElement){k.on(this.domElement,"mousemove",function(au){if(e.isDraging){return true}return al(au)})}this.domElement.hashCode=this.getHashCode();if(this._visible==false){this.domElement.style.display="none";if(this.siblingElement){this.siblingElement.style.display="none"}}function ar(ax,aw){var av=ax.srcElement||ax.target;var au=ax.clientX||ax.pageX;var az=ax.clientY||ax.pageY;if(ax&&aw&&au&&az&&av){var ay=k.Dom.getOffset(at.container);aw.pixel=new s(au-ay.left,az-ay.top);aw.point=at.pixelToPoint(aw.pixel);return aw}else{return aw}}var e=this;k.on(this.domElement,"mouseover",function(au){if(!e._dragstarted){e.dispatchEvent(ar(au,new ak("onmouseover").inherit(au)))}});k.on(this.domElement,"mouseout",function(au){if(!e._dragstarted){e.dispatchEvent(ar(au,new ak("onmouseout").inherit(au)))}});k.on(this.domElement,"click",function(av){var au=av.srcElement||av.target;while(au){if(au==e.domElement){if(e.toString()!="Marker"||e.toString()=="Marker"&&(!e._lastPt||e._lastPt&&e.getPoint().equals(e._lastPt))){e.dispatchEvent(ar(av,new ak("onclick").inherit(av)))}break}else{if(e.map.infoWindow&&au==e.map.infoWindow.popDom){break}}au=au.parentNode}av.cancelBubble=true});k.on(this.domElement,"mousedown",function(au){if(e.toString()=="Marker"){e._lastPt=e.getPoint()}e.dispatchEvent(ar(au,new ak("onmousedown").inherit(au)))});k.on(this.domElement,"mouseup",function(au){e.dispatchEvent(ar(au,new ak("onmouseup").inherit(au)))});k.on(this.domElement,"dblclick",function(au){e.dispatchEvent(ar(au,new ak("ondblclick").inherit(au)));au.cancelBubble=true;au.returnValue=false})}else{if(this.toString()=="Marker"){at.temp.areaDiv.appendChild(this.domElement);at.temp.markerDiv.appendChild(this.siblingElement)}else{if(this.toString()=="Label"){at.temp.labelDiv.appendChild(this.domElement)}else{at.overlayDiv.appendChild(this.domElement)}}}this.setPoint(this.point)},hide:function(){if(this._visible==false){return}this._visible=false;if(this.infoWindow&&this.infoWindow.overlay&&this.infoWindow.overlay==this){this.closeInfoWindow()}k.hide(this.domElement)},show:function(){if(this._visible==true){return}this._visible=true;k.show(this.domElement)},dispose:function(){k.BaseClass.prototype.dispose.call(this)},openInfoWindow:function(aw,av){if(!aw||!this.domElement||this.domElement.style.display=="none"||aw.toString()!="InfoWindow"){return}if(this.map.temp.infoWin===aw&&this.map.temp.infoWin.isOpen()&&this.map.temp.infoWin.overlay===this){return}if(this.map.temp.infoWin&&this.map.temp.infoWin.isOpen()){this.map.closeInfoWindow()}this.infoWindow=aw;var e=false;if(this.map.temp.infoWin==null||this.map.temp.infoWin!=aw){e=true;aw.initialize(this)}aw.overlay=this;var ar=this.map.infoWindow;var at=this.map.temp;at.infoWin=aw;if(!at.pop){at.pop=V(this.map.temp.overlayDiv,"<span style='position: absolute;z-index:800' type='system'></span>")}if(!at.shadow){at.shadow=V(this.map.temp.overlayDiv,"<span style='position: absolute;z-index:600' type='system'></span>")}aw.setPosition();at.shadow.appendChild(ar.shadowDom);at.pop.appendChild(ar.popDom);aw.reset(null);aw.reset(true);if(!e){aw.reset(true)}if(!(av&&av.notMove)){setTimeout(function(){aw.setPanTo()},200)}var au=this;this.dispatchEvent(new ak("oninfowindowopen"))},closeInfoWindow:function(){if(!this.map||!this.map.infoWindow){return}var ar=this;if(this.infoWindow!=null&&this.infoWindow.hashCode==this.map.infoWindow.hashCode){try{ar.infoWindow.hide()}catch(e){}this.dispatchEvent(new ak("oninfowindowclose"))}this.infoWindow=null},setStyle:function(e){if(this.domElement){if(this.siblingElement){this.siblingElement.style.cssText=this.siblingElement.style.cssText+";"+e}else{this.domElement.style.cssText=this.domElement.style.cssText+";"+e}}},getDom:function(){return this.domElement},setConfig:function(ar){if(ar==null){return}for(var e in ar){if(typeof(this._config[e])==typeof(ar[e])){this._config[e]=ar[e]}}},overlayPoints:function(at){if(at.length==0){return{pixels:[],points:[]}}if(typeof(at)=="string"){return this._overlayPoints(at)}else{if(typeof(at[0])=="string"){var ar=[];for(var e=0;e<at.length;e++){var au=this._overlayPoints(at[e]);ar.push(au)}return ar}else{return this._overlayPoints(at)}}},_overlayPoints:function(av){var au=[];var at=[];var e=typeof(av)=="string"?av.split(";"):av;for(var ar=0;ar<e.length;ar++){if(typeof(e[ar])=="string"){var aw=e[ar].split(",");var ax=new D(parseFloat(aw[0]),parseFloat(aw[1]));at.push(ax);au.push(this.getOverLayPosition(ax))}else{au.push(this.getOverLayPosition(e[ar]))}}if(typeof(av)!="string"){at=av}return{pixels:au,points:at}},getOverLayPosition:function(ar){var au=this.map;var at=au.pointToPixel(ar);var e=at.x-au.offsetX;var av=at.y-au.offsetY;return new s(e,av)},overlayPixel:function(e){var ar=this.map;if(e.toString()=="Point"){return ar.pt2px(e,ar.zoomLevel)}else{return ar.px2pt(e,ar.zoomLevel)}},setPoint:function(e){if(e&&e.toString()=="Point"){this.point=this._config.point=e;if(this.domElement&&this.domElement.style){var at=(this._config&&this._config.offset)?this._config.offset:new f(0,0);var ar=this.getOverLayPosition(e);this.domElement.style.left=(ar.x+at.width)+"px";this.domElement.style.top=(ar.y+at.height)+"px"}}},getPoint:function(at,au){if(!at){return this.point}else{var e=au?au.width:0;var av=au?au.height:0;if(this.map){var ar=this.map.pointToPixel(this.point);if(this._config&&this._config.offset){ar.x=ar.x+this._config.offset.width+e;ar.y=ar.y+this._config.offset.height+av}else{ar.x=ar.x+e;ar.y=ar.y+av}return this.map.pixelToPoint(ar)}}},isVisible:function(){if(!this.domElement){return false}return !!this._visible}});function d(){this.map=null;this.lengthMax=200;this.cacheBox=null}z.register(function(ar){var e=new d();e.map=ar;ar.overlayCache=e;e.cacheBox=document.createElement("div");ar.addEventListener("load",function(at){e.district();e.zoom(at)});ar.addEventListener("moveend",function(at){e.district();e.zoom(at)});ar.addEventListener("dragend",function(at){e.district();e.zoom(at)});ar.addEventListener("zoomend",function(at){e.district();e.zoom(at)});ar.addEventListener("onclearoverlays",function(az){var ay=ar.overlayDiv.childNodes;for(var au=0;au<ay.length;au++){var ax=ay[au];if(ax.getAttribute("type")!="system"){if(ax.getAttribute("hashCode")){k.I(ax.getAttribute("hashCode")).remove()}else{}au--}else{var aA=ax.childNodes;for(var at=0;at<aA.length;at++){var aw,av;if(!k.Browser.ie){aw=aA[at].getAttribute("type")}else{av=true}if(aw!="system"&&!av||av==true){if(aA[at].hashCode!=null){k.I(aA[at].hashCode).remove()}else{try{aA[at].parentNode.removeChild(aA[at]);if(aA[at]){aA[at]=null}}catch(az){}}at--}}}}ar.infoWindow=ar.temp.infoWin=ar.temp.pop=ar.temp.shadow=null;ay=null});ar.addEventListener("oninfowindowopen",function(au){var at=this.map.infoWindow;k.hide(at.popDom);k.hide(at.shadowDom)})});d.prototype.zoom=function(aD){var aE=this.map.temp.overlayDiv.childNodes;var az=this.map.temp.markerDiv.childNodes;var aC=this.map.temp.labelDiv.childNodes;for(var aB=0;aB<aE.length;aB++){if(aE[aB].tagName=="svg"){continue}var aA=k.I(aE[aB].hashCode);if(aA&&aA.point){if(aA.point.toString()=="Point"){aA.setPoint(aA.point)}}}this.revisePoint(az);this.revisePoint(aC);if(this.map.temp.infoWin){this.map.temp.infoWin.setPosition()}if(this.map.palette){var av=this.map.palette;var at=av.childNodes;if((av.tagName!="svg"&&(aD.type=="ondragend"||aD.type=="onmoveend"))){var ar=this.map.temp.drawView;if(ar==null){return}var au=this.map.pointToPixel(ar.point);var ax=ar.margin;if(Math.abs(au.x-this.map.width/2)<ax&&Math.abs(au.y-this.map.height/2)<ax){return}}for(var aB=0;aB<at.length;aB++){if(at[aB].tagName=="shape"||at[aB].tagName=="path"){var aw=k.I(at[aB].hashCode);if(aw&&aw.points){if(at[aB].tagName=="shape"){at[aB].setAttribute("path","m0 0")}aw.setPolylinePoint(at[aB],aw.points)}}}if(aw&&av.tagName=="svg"){var ay=k.I(aw.hashCode);aw.setPalette()}}};d.prototype.revisePoint=function(at){for(var ar=0;ar<at.length;ar++){var e=k.I(at[ar].hashCode);if(e&&e.point){if(e.point.toString()=="Point"){e.setPoint(e.point)}}}};d.prototype.district=function(){var at=this.map;var ay=at.overlayDiv.childNodes;var aA=at.markerDiv.childNodes;var au=this.cacheBox.childNodes;var aB=at.pixelToPoint(new s(-at.width/2,at.height*3/2));var az=at.pixelToPoint(new s(at.width*3/2,-at.height/2));var ar=new m(aB.lng,aB.lat,az.lng,az.lat);for(var ax=0;ax<au.length;ax++){var e=au[ax];if(!e.hashCode){continue}var aw=k.I(e.hashCode);if(!aw.point){continue}if(ar.containsPoint(aw.point)){at.addOverlay(aw)}}if(ay.length<4000){return}if(aA.length<4000){return}for(var ax=0;ax<ay.length;ax++){var e=ay[ax];if(!e.hashCode){continue}var aw=k.I(e.hashCode);if(!aw.point){continue}if(!ar.containsPoint(aw.point)){this.cacheBox.appendChild(e)}}for(var ax=0;ax<aA.length;ax++){var aC=aA[ax];if(!aC.hashCode){continue}var av=k.I(aC.hashCode);if(!av.point){continue}if(!ar.containsPoint(av.point)){this.cacheBox.appendChild(aC);this.cacheBox.appendChild(av.siblingElement)}}};d.prototype.addCache=function(e){this.cacheBox.appendChild(e);if(this.cacheBox.childNodes.length>this.lengthMax){this.remove(this.cacheBox.firstChild)}};d.prototype.addMap=function(e){this.map.addOverlay(e)};d.prototype.remove=function(e){e.domElement.parentNode.removeChild(e.domElement)};d.prototype.clear=function(){this.cacheBox.innerHTML=""};function v(e){this.opts=e||{};this.copyright=this.opts.copyright||{};this.transparentPng=this.opts.transparentPng||false;this.baseLayer=this.opts.baseLayer||false;this.offset=[0,0];this._type="tilelayer"}v.inherits(q,"TileLayer");k.extend(v.prototype,{isTransparentPng:function(){return this.transparentPng},getTilesUrl:function(ay,ar){var at=N[this.mapType];if(typeof at!="object"){return null}var ax=at.baseUnits*Math.pow(2,(at.zoomLevelMax-ar));var az=parseInt(ay.lng/ax)-this.offset[0];var au=parseInt(ay.lat/ax-this.offset[1]);var aw=Math.floor(az/200);var av=Math.floor(au/200);var e="";if(this.opts.tileUrlTemplate){e=this.opts.tileUrlTemplate;e=e.replace(/\{X\}/,az);e=e.replace(/\{Y\}/,au);e=e.replace(/\{Z\}/,ar)}else{e=at.tileUrls[Math.abs(az+au)%at.tileUrls.length]+"?qt=tile&x="+az+"&y="+au+"&z="+ar+"&styles=pl&udt=20140928";e=e.replace(/-(\d+)/gi,"M$1")}return e},initialize:function(at){if(!at.temp.layerZIndex){at.temp.layerZIndex=0}this.zIndex=this.zIndex||-1;if(this.baseLayer){this.zIndex=-1}if(!at.temp.layid){at.temp.layid=0}if(!this.opts.mapType){this.mapType="BMAP_CUSTOM_LAYER_"+at.temp.layid;at.temp.layid++}else{this.mapType=this.opts.mapType}var e=N[this.mapType];if(!e){N[this.mapType]={tileUrls:[],tileSize:256,baseUnits:256,zoomLevelMin:1,zoomLevelMax:18,errorUrl:aj.imgPath+"/blank.gif",bounds:new m(-21364736,-10616832,23855104,15859712),imgExtend:"png"}}var ar=V(at.platform,'<div style="position:absolute;z-index:'+this.zIndex+'"></div>');ar.style.display="";ar.style.left=Math.ceil(-at.offsetX+at.width/2)+"px";ar.style.top=Math.ceil(-at.offsetY+at.height/2)+"px";this.tilesDiv=ar;this.map=at},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 ac(ar,e,at){this.bounds=ar;this.content=e;this.mapType=at}ac.inherits(q,"Copyright");function af(e){ag.call(this);this._config={strokeColor:"#3a6bdb",strokeWeight:5,strokeOpacity:0.65,fillColor:"#fff",fillOpacity:0.65,strokeStyle:"solid",startArrow:"none",endArrow:"none"};this.drawMargin=350;this.setConfig(e);if(this._config.strokeWeight<=0){this._config.strokeWeight=1}if(this._config.strokeOpacity<0){this._config.strokeOpacity=0}else{if(this._config.strokeOpacity>1){this._config.strokeOpacity=1}}if(this._config.fillOpacity<0){this._config.fillOpacity=0}else{if(this._config.fillOpacity>1){this._config.fillOpacity=1}}if(this._config.strokeStyle!="solid"&&this._config.strokeStyle!="dashed"){this._config.strokeStyle="solid"}this.domElement=null;this.isSvg=!!window.SVGAngle;this.isVml=!window.SVGAngle;this.svgs="http://www.w3.org/2000/svg";this.svgType={strokeweight:"stroke-width",strokecolor:"stroke",stroked:"stroke",fillcolor:"fill",filled:"fill"}}af.inherits(ag,"Draw");k.extend(af.prototype,{_addOverlayDom:function(){if(this.map.palette){this.setPalette()}},createPalette:function(){if(this.map.palette){this.setPalette();return}var at=this.map.overlayDiv;var e;if(this.isSvg){e=document.createElementNS(this.svgs,"svg");this.setTypeNS(e,"font-size","24px");this.setTypeNS(e,"version","1.1");e.style.position="absolute";e.style.zIndex="200";e.setAttribute("type","system");at.appendChild(e);k.on(e,"mousedown",function(au){U(au)})}else{if(this.isVml){var ar='<font style="overflow:visible;z-index:200" type="system"></font>';e=V(at,ar)}}this.map.palette=e;this.setPalette()},setPalette:function(){if(!this.isSvg){return}var aw=this.map;var ar=aw.palette;var at=aw.width*3;var e=aw.height*3;var av=-aw.offsetX-aw.width;var au=-aw.offsetY-aw.height;this.setTypeNS(ar,"x",at+"px");this.setTypeNS(ar,"y",e+"px");ar.style.top=au+"px";ar.style.left=av+"px";ar.style.width=at+"px";ar.style.height=e+"px";this.setTypeNS(ar,"viewBox",av+" "+au+" "+at+" "+e)},polyline:function(at,aw){var au=this;var ar=this.map.palette;if(this.getDom()==null){if(this.isSvg){var e=document.createElementNS(this.svgs,"path");this.setTypeNS(e,"stroke-linejoin","round");this.setTypeNS(e,"stroke-linecap","round");this.setTypeNS(e,"fill-rule","evenodd");ar.appendChild(e)}else{if(this.isVml){var ax=['<v:shape style="behavior:url(#default#VML);z-index:1;width:1px;height:1px;position:absolute;left:0;top:0;"','coordsize="1,1" coordorigin="0,0" filled="t" fillcolor="white">','<v:stroke style="behavior:url(#default#VML);" endcap="round" oned="true" />','<v:fill style="behavior:url(#default#VML);"/>',"</v:shape>"].join("");var e=V(ar,ax)}}}else{var e=this.getDom()}this.setPolylinePoint(e,at,aw);if(this._config.startArrow!="none"){this.startArrow(this._config.startArrow,e)}if(this._config.endArrow!="none"){this.endArrow(this._config.endArrow,e)}function av(aD,aB){var aA=aD.srcElement||aD.target;var az=B();var ay=aD.pageX?aD.pageX:(aD.clientX+az[1]);var aF=aD.pageY?aD.pageY:(aD.clientY+az[0]);if(aD&&aB&&ay&&aF&&aA){var aC=k.I(aA.hashCode).map;var aE=k.Dom.getOffset(aC.container);aB.pixel=new s(ay-aE.left,aF-aE.top);aB.point=aC.pixelToPoint(aB.pixel);return aB}else{return aB}}k.on(e,"mouseover",function(ay){au.dispatchEvent(au.dispatchEvent(av(ay,new ak("onmouseover").inherit(ay))))});k.on(e,"mousemove",function(ay){au.dispatchEvent(au.dispatchEvent(av(ay,new ak("onmousemove").inherit(ay))))});k.on(e,"mouseout",function(ay){au.dispatchEvent(au.dispatchEvent(av(ay,new ak("onmouseout").inherit(ay))))});k.on(e,"click",function(ay){au.dispatchEvent(au.dispatchEvent(av(ay,new ak("onclick").inherit(ay))))});k.on(e,"mousedown",function(ay){au.dispatchEvent(au.dispatchEvent(av(ay,new ak("onmousedown").inherit(ay))))});k.on(e,"mouseup",function(ay){au.dispatchEvent(au.dispatchEvent(av(ay,new ak("onmouseup").inherit(ay))))});k.on(e,"dblclick",function(ay){au.dispatchEvent(au.dispatchEvent(av(ay,new ak("ondblclick").inherit(ay))))});k.on(this,"remove",function(ay){this.remove();au.dispatchEvent(new ak("remove").inherit(ay))});return e},setPolylinePoint:function(av,au){var au=this.overlayPoints(au);this.points=au.points;if(this.points&&this.points.length==0){return}if(this.toString()=="Polygon"||this.toString()=="Oval"){var aw=au.points[0];var e=au.points[au.points.length-1];if(aw.lng!=e.lng||aw.lat!=e.lat){au.points.push(au.points[0]);au.pixels.push(au.pixels[0])}}if(au[0]==null){var at=this._setPolylinePoint(av,au)}else{var ax=[];for(var ar=0;ar<au.length;ar++){ax.push(this._setPolylinePoint(av,au[ar]))}at=ax.join(" ")}if(this.isSvg){if(this.toString()=="Polygon"){}this.setTypeNS(av,"d",at)}else{if(this.toString()=="Polygon"){at+="E"}this.setTypeNS(av,"path",at)}if(this.isVml){this.map.temp.drawView={point:this.map.centerPoint,margin:this.drawMargin}}},_setPolylinePoint:function(au,ay){var az=ay.points;var ax=ay.pixels;if(az.length==0){return}if((az[az.length-1].lat!=az[0].lat||az[az.length-1].lng!=az[0].lng)&&!this.isSvg&&this.toString()=="Polygon"){az[az.length]=az[0];ax[ax.length]=ax[0]}if(!au){return}var ar=[];for(var aw=0;aw<ax.length;aw++){if(ax[aw+1]!=null){if(ax[aw].x==ax[aw+1].x&&ax[aw].y==ax[aw+1].y){continue}var at=this.getIntersectLine(ax[aw],ax[aw+1]);if(at.length==0){if(ar.length!=0&&ar[ar.length-1]!="M"){ar.push("M")}}for(var av=0;av<at.length;av++){if(at[av]==null){continue}if(ar.length==0){ar.push("M"+at[av].x+","+at[av].y)}if(ar[ar.length-1]=="M"){ar.push(at[av].x+","+at[av].y)}else{if(ar[ar.length-1]!="L"+at[av].x+","+at[av].y){ar.push("L"+at[av].x+","+at[av].y)}}}}}if(ar[ar.length-1]=="M"){ar[ar.length-1]=null;delete ar[ar.length-1]}var e=ar.join().replace(/,/g," ");return e},setPoints:function(e){if(this.isVml&&this.getDom()){this.getDom().path="m-9999999,-9999999 e"}this.setPolylinePoint(this.getDom(),e)},setPath:function(e,at){if(!this.points||!this.points[at]){return}this.points[at]=e;var ar=this.domElement;this.setPolylinePoint(ar,this.points)},oval:function(){},arrow:function(ar){if(this.isSvg){var e=document.createElementNS(this.svgs,"marker");this.setTypeNS(e,"id",ar);this.setTypeNS(e,"viewBox","0 0 10 10");this.setTypeNS(e,"refX","8");if(navigator.userAgent.indexOf("Safari")>0){this.setTypeNS(e,"refY","8")}else{this.setTypeNS(e,"refY","5")}this.setTypeNS(e,"markerUnits","strokeWidth");this.setTypeNS(e,"markerWidth","4");this.setTypeNS(e,"markerHeight","9");this.setTypeNS(e,"orient","auto");switch(ar){case"oval":break;case"classic":var at=document.createElementNS(this.svgs,"path");this.setTypeNS(at,"fill",this._config.strokeColor);at.setAttributeNS(null,"d","M 0 0 L10 5 L0 10 L3 5 z")}e.appendChild(at);this.map.palette.appendChild(e);return at}},setTypeNS:function(at,ar,au){if(!at){return}if(this.isSvg){var e=this.svgType;if(e[ar]){ar=e[ar];if(au==false){au="none"}}at.setAttributeNS(null,ar,au)}else{if(this.isVml){at[ar]=au}}},getTypeNS:function(at,ar){if(this.isSvg){var e=this.svgType;if(e[ar]){ar=e[ar]}return at.getAttributeNS(null,ar)}else{if(this.isVml){return at.getAttribute(ar)}}},getDrawPoint:function(at){at=window.event||at;var ar=(at.pageX||at.clientX);var av=(at.pageY||at.clientY);var au=k.Dom.getOffset(this.map.container);ar=ar-au.left;av=av-au.top;return{x:ar,y:av}},startArrow:function(ar,e,au){e=e||this.getDom();if(!e){return}ar=ar.toLowerCase();if(this.isSvg&&au==true){if(this.map.palette.getElementsByTagName("marker").length==0){this.arrowElement=this.arrow(ar);e._arrow=this.map.palette.getElementsByTagName("marker")[0]}this.setTypeNS(e,"marker-start","url(#"+ar+")")}else{if(this.isVml){if(e.childNodes.length==0){var at=V(e,"<v:Stroke StartArrow="+ar+"/>")}else{var at=e.childNodes[0];at.setAttribute("StartArrow",ar)}}}},_startArrowF:function(ar,e){this.startArrow(ar,e,true)},endArrow:function(ar,e,au){e=e||this.getDom();if(!e){return}ar=ar.toLowerCase();if(this.isSvg&&au==true){if(this.map.palette.getElementsByTagName("marker").length==0){this.arrowElement=this.arrow(ar);e._arrow=this.map.palette.getElementsByTagName("marker")[0]}this.setTypeNS(e,"marker-end","url(#"+ar+")")}else{if(this.isVml){if(e.childNodes.length==0){var at=V(e,"<v:Stroke endarrow="+ar+"/>")}else{var at=e.childNodes[0];at.setAttribute("endarrow",ar)}}}},_endArrowF:function(ar,e){this.endArrow(ar,e,true)},setStrokeColor:function(e){if(this._config){this._config.strokeColor=e}if(this.domElement){this.setTypeNS(this.domElement,"strokecolor",e)}if(this.arrowElement){this.setTypeNS(this.arrowElement,"fill",e)}},getStrokeColor:function(){return this._config.strokeColor},setStrokeWeight:function(e){if(e>0){this._config.strokeWeight=e;this.setTypeNS(this.domElement,"strokeweight",this._config.strokeWeight+"px")}},getStrokeWeight:function(){return this._config.strokeWeight},setStrokeOpacity:function(e){if(e>1||e<0){return}this._config.strokeOpacity=e;if(!this.map){return}if(this.isSvg){this.setTypeNS(this.getDom(),"stroke-opacity",e)}else{if(this.getDom()&&this.getDom().childNodes){this.setTypeNS(this.getDom().childNodes[0],"opacity",e)}}},getStrokeOpacity:function(){return this._config.strokeOpacity},setFillOpacity:function(e){if(e>1||e<0){return}this._config.fillOpacity=e;if(!this.map){return}if(this.isSvg){this.setTypeNS(this.getDom(),"fill-opacity",e)}else{if(this.getDom()&&this.getDom().childNodes){this.setTypeNS(this.getDom().childNodes[1],"opacity",e)}}},getFillOpacity:function(){return this._config.fillOpacity},setStrokeStyle:function(ar){if(ar!="solid"&&ar!="dashed"){return}if(!ar){ar=this._config.strokeStyle}else{this._config.strokeStyle=ar}if(!this.map){return}var e=this.getDom();if(this.isSvg){ar=ar=="solid"?0:this.getStrokeWeight()*2;this.setTypeNS(e,"stroke-dasharray",ar)}else{if(this.isVml){ar=ar=="solid"?"solid":"4 2 1 2";if(e&&e.childNodes&&e.childNodes[0]){e.childNodes[0]["dashstyle"]=ar}}}},getStrokeStyle:function(){return this._config.strokeStyle},setFillColor:function(e){if(e){this._config.fillColor=e;if(this.domElement){if(this.domElement.getElementsByTagName("fill").length==0&&this.isVml){this.domElement.innerHTML+="<v:fill />"}this.setTypeNS(this.domElement,"filled",true);this.setTypeNS(this.domElement,"fillcolor",e)}}else{this._config.fillColor="";this.setTypeNS(this.domElement,"filled",false)}},getFillColor:function(){if(this.toString()!="Rect"&&this.toString()!="Polygon"&&this.toString()!="Oval"){return}return this._config.fillColor},getIntersectLine:function(aH,aF){if(!aF){return[aH]}if(this.toString()=="Rect"||this.toString()=="Polygon"||this.toString()=="Oval"){return[aH,aF]}var aw=[{x:(-this.map.offsetX-this.drawMargin),y:(-this.map.offsetY+this.map.height+this.drawMargin)},{x:(-this.map.offsetX+this.map.width+this.drawMargin),y:(-this.map.offsetY-this.drawMargin)}];var aA=[{x:(aH.x>aF.x?aF.x:aH.x),y:(aH.y>aF.y?aH.y:aF.y)},{x:(aH.x>aF.x?aH.x:aF.x),y:(aH.y>aF.y?aF.y:aH.y)}];var au=[];var av=function(aK,aI){try{if(parseInt(aK.x)>=(aI[0]["x"]-2)&&parseInt(aK.x)<=(aI[1]["x"]+2)&&parseInt(aK.y)>=(aI[1]["y"]-2)&&parseInt(aK.y)<=(aI[0]["y"]+2)){return true}else{return false}}catch(aJ){return true}};var aG=function(aJ){if(aF.y==aH.y){return}else{var aI=parseInt(((aF.x-aH.x)*(aJ-aH.y))/(aF.y-aH.y)+aH.x);if(av({x:aI,y:aJ},aw)){return{x:aI,y:aJ}}}};var aE=function(aI){if(aF.x==aH.x){return}else{var aJ=parseInt(((aF.y-aH.y)*(aI-aH.x))/(aF.x-aH.x)+aH.y);if(av({x:aI,y:aJ},aw)){return{x:aI,y:aJ}}}};var ay=av(aH,aw);var aD=av(aF,aw);if(ay&&aD){au.push(aH);au.push(aF)}else{if(ay||aD){var at=[];if(ay){at.push(aH)}if(aH.x==aF.x){var ar={x:aH.x,y:aw[0].y};var e={x:aH.x,y:aw[1].y};if(av(ar,aA)){au.push(ar)}if(av(e,aA)){au.push(e)}}else{if((aH.y==aF.y)){var ar={x:aw[0].x,y:aH.y};var ar={x:aw[0].x,y:aH.y};if(av(ar,aA)){au.push(ar)}if(av(e,aA)){au.push(e)}}else{for(var ax=0;ax<2;ax++){var az=aw[ax];var aC=aE(az.x);if(aC!=null&&av(aC,aA)){at.push(aC)}var aB=aG(az.y);if(aB!=null&&av(aB,aA)){at.push(aB)}}}}if(aD){at.push(aF)}if(at.length==2){if(((aH.x-aF.x)>0)==((at[0].x-at[1].x)>0)&&((aH.y-aF.y)>0)==((at[0].y-at[1].y)>0)){au.push(at[0]);au.push(at[1])}else{au.push(at[1]);au.push(at[0])}}}else{var at=[];for(var ax=0;ax<2;ax++){var az=aw[ax];var aC=aE(az.x);if(aC!=null&&av(aC,aw)&&av(aC,aA)){at.push(aC)}var aB=aG(az.y);if(aB!=null&&av(aB,aw)&&av(aB,aA)){at.push(aB)}}if(at.length==2){if(((aH.x-aF.x)>0)==((at[0].x-at[1].x)>0)){au.push(at[0]);au.push(at[1])}else{au.push(at[1]);au.push(at[0])}}}}return au}});if(document.namespaces&&!document.namespaces.olv){document.namespaces.add("olv","urn:schemas-microsoft-com:vml")}function H(e){ag.call(this);this.map=null;this.domElement=null;this._config={width:0,height:0,offset:new f(0,0),opacity:1,background:"transparent",lineStroke:1,lineColor:"#000",lineStyle:"solid",point:null};this.setConfig(e);this.point=this._config.point}H.inherits(ag,"Division");k.extend(H.prototype,{render:function(){var e=this._config;var at=this.content;var ar=['<div class="BMap_Division" style="position:absolute;'];ar.push("width:"+e.width+"px;display:block;");ar.push("overflow:hidden;");if(e.borderColor!="none"){ar.push("border:"+e.lineStroke+"px "+e.lineStyle+" "+e.lineColor+";")}ar.push("opacity:"+e.opacity+"; filter:(opacity="+e.opacity*100+")");ar.push("background:"+e.background+";");ar.push('z-index:60;">');ar.push(at);ar.push("</div>");return ar.join("")},initialize:function(e){this.map=e;this._addOverlayDom();if(this.domElement){k.on(this.domElement,"mousedown",function(ar){al(ar)})}},getPoint:function(){return this._config.point},_getPixel:function(e){return this.map.pointToPixel(this.getPoint())},setPoint:function(e){this._config.offset=new f(-Math.round(this._config.width/2)-Math.round(this._config.lineStroke),-Math.round(this._config.height/2)-Math.round(this._config.lineStroke));ag.prototype.setPoint.call(this,e)},setDimension:function(e,ar){this._config.width=Math.round(e);this._config.height=Math.round(ar);if(this.domElement){this.domElement.style.width=this._config.width+"px";this.domElement.style.height=this._config.height+"px";this.setPoint(this._config.point)}}});function n(ar,at,av){if(!ar||!at){return}this.imageUrl=ar;this.size=at;var au=new f(Math.floor(at.width/2),Math.floor(at.height/2));var aw={offset:au,imageOffset:new f(0,0)};av=av||{};for(var e in av){if(typeof(aw[e])==typeof(av[e])){aw[e]=av[e]}}this.offset=aw.offset;this.imageOffset=aw.imageOffset;this.infoWindowOffset=av.infoWindowOffset||this.offset}k.inherit(n,k.BaseClass,"Icon");n.prototype.setImageUrl=function(e){if(!e||typeof e!="string"){return}this.imageUrl=e};n.prototype.getHTML=function(){if(k.Browser.ie==6&&this.imageUrl.toLowerCase().indexOf(".png")>0){return["<div",' style="width: 1px; height: 1px;',"; left:"+parseInt(this.imageOffset.width)+"px","; top:"+parseInt(this.imageOffset.height)+"px","; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image,src='"+this.imageUrl+"')",'; position:absolute;"></div>'].join("")}else{return['<img src="',this.imageUrl,'" style="left:'+parseInt(this.imageOffset.width)+"px","; top:"+parseInt(this.imageOffset.height)+"px",'; position:absolute;" />'].join("")}};n.prototype.setSize=function(e){if(!e||e.toString()!="Size"){return}this.size=new f(e.width,e.height)};n.prototype.setOffset=function(e){if(!e||e.toString()!="Size"){return}this.offset=new f(e.width,e.height)};n.prototype.setImageOffset=function(e){if(!e||e.toString()!="Size"){return}this.imageOffset=new f(e.width,e.height)};n.prototype.setInfoWindowOffset=function(e){if(!e||e.toString()!="Size"){return}this.infoWindowOffset=new f(e.width,e.height)};n.prototype.toString=function(){return"Icon"};function Q(ar,e){k.BaseClass.call(this);this.content=ar;this.map=null;this._config={width:0,height:0,maxWidth:600,offset:new f(0,0),title:"",maxContent:"",enableMaximize:false,margin:[10,10,40,10],collisions:[[10,10],[10,10],[10,10],[10,10]],ifMaxScene:false};this.setConfig(e);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=aj.imgPath;this.overlay=null}Q.inherits(k.BaseClass,"InfoWindow");k.extend(Q.prototype,{initialize:function(at){if(!at.map){return}this.overlay=at;this.map=at.map;if(this.map.infoWindow){var ar=this.map.infoWindow;k.hide(ar.popDom);k.hide(ar.shadowDom)}this.render();this._bind();if(this._config.enableMaximize){this.enableMaximize()}else{this.disableMaximize()}this.setTitle();this.setContent();if(this._config.ifMaxScene){this.setMaxScene(true)}this.reset(true);if(this.map.infoWindow.marker){var e=this.map.infoWindow.marker;this.map.infoWindow.marker=null}if(at.toString()=="Marker"){this.map.infoWindow.marker=at}if(!this._binded){var au=this;this.map.addEventListener("dragstart",function(){au._setOverflow()});this.map.addEventListener("movestart",function(){au._setOverflow()});this.map.addEventListener("dragend",function(){au._resetOverflow()});this.map.addEventListener("moveend",function(){au._resetOverflow()});this._binded=true}},render:function(){var av=this.map;var ar=this;if(!av.infoWindow){av.infoWindow={};var e=['<div class="shadow" style="position: absolute;display:none" type="infowindow_shadow">'];e.push('<div><img onmousedown="return false" style=" left: -323px; top: 0px;" src="'+this.IMG_PATH+'iws3.png"/></div>');e.push('<div><img onmousedown="return false" style=" left: -393px; top: 0px;" src="'+this.IMG_PATH+'iws3.png"/></div>');e.push('<div><img onmousedown="return false" style=" left: -1033px; top: 0px;" src="'+this.IMG_PATH+'iws3.png"/></div>');e.push('<div><img onmousedown="return false" style="top: -30px;" src="'+this.IMG_PATH+'iws3.png"/></div>');e.push('<div><img onmousedown="return false" style=" left: -360px; top: -30px;" src="'+this.IMG_PATH+'iws3.png"/></div>');e.push('<div><img onmousedown="return false" style="top: -30px;" src="'+this.IMG_PATH+'iws3.png"/></div>');e.push('<div><img onmousedown="return false" style=" left: -14px; top: -310px;" src="'+this.IMG_PATH+'iws3.png"/></div>');e.push('<div><img onmousedown="return false" style="left: -345px; top: -310px;" src="'+this.IMG_PATH+'iws3.png"/></div>');e.push('<div><img onmousedown="return false" style=" left: -440px; top: -310px;" src="'+this.IMG_PATH+'iws3.png"/></div>');e.push('<div><img onmousedown="return false" style=" left: -345px; top: -310px;" src="'+this.IMG_PATH+'iws3.png"/></div>');e.push('<div><img onmousedown="return false" style=" left: -754px; top: -310px;" src="'+this.IMG_PATH+'iws3.png"/></div>');e.push("</div>");e.push('<div class="pop" style="position: absolute;display:none;cursor:default">');e.push('<div><img style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 690px; height: 786px;" src="'+this.IMG_PATH+'iw3.png"/></div>');e.push('<div class="top"><img src="'+this.IMG_PATH+'iw3.png" style="position: absolute; left: -65px; top: -60px;"/></div>');e.push('<div><img style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -665px; top: 0px; width: 690px; height: 786px; " src="'+this.IMG_PATH+'iw3.png"/></div>');e.push('<div class="center"><img src="'+this.IMG_PATH+'iw3.png" style="position: absolute; left: -65px; top: -60px;"/></div>');e.push('<div><img style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: -665px; width: 690px; height: 786px; " src="'+this.IMG_PATH+'iw3.png"/></div>');e.push('<div class="bottom"><img src="'+this.IMG_PATH+'iw3.png" style="position: absolute; left: -65px; top: -146px;"/></div>');e.push('<div><img style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -665px; top: -665px; width: 690px; height: 786px; " src="'+this.IMG_PATH+'iw3.png"/></div>');e.push('<div><img onmousedown="return false" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -155px; top: -691px; width: 690px; height: 786px;" src="'+this.IMG_PATH+'iw3.png"/></div>');e.push('<div style="overflow-y: hidde;overflow-x:hidde; width:auto;height:auto;position:absolute;left: 16px; top: 16px;z-index: 10;"></div>');e.push("</div>");av.infoWindow.popDom=V(av.platform,e.join(""));av.infoWindow.shadowDom=av.infoWindow.popDom.previousSibling;av.infoWindow.popDiv=av.infoWindow.popDom.getElementsByTagName("div");av.infoWindow.shadoDiv=av.infoWindow.shadowDom.getElementsByTagName("div");av.infoWindow.contentMain=av.infoWindow.popDiv[8];av.infoWindow.titleDiv=V(av.infoWindow.popDiv[8],'<div class="BMap_bubble_title" style="display:block;overflow:hidden;height:24px;line-height:24px"></div>');av.infoWindow.contentDiv=V(av.infoWindow.popDiv[8],'<div class="BMap_bubble_content" style="display:block"></div>');av.infoWindow.maxContentDiv=V(av.infoWindow.popDiv[8],'<div class="BMap_bubble_max_content" style="display:none;position:relative"></div>');var at='<img style="position: absolute;top:12px; width: 12px; height: 12px; -moz-user-select: none; cursor: pointer; z-index: 10000;" src="'+this.IMG_PATH+'iw_close.gif"/>';av.infoWindow.closeButton=V(av.infoWindow.popDom,at);var au='<img style="position: absolute;top:12px; width: 12px; height: 12px; -moz-user-select: none; cursor: pointer; z-index: 10000;display:none" src="'+this.IMG_PATH+'iw_plus.gif"/>';av.infoWindow.maxButton=V(av.infoWindow.popDom,au);this._mendIE6(av.infoWindow)}av.infoWindow.hashCode=this.hashCode},_bind:function(){var ar=this.map;var e=this;ar.infoWindow.closeButton.onclick=function(at){var at=at||window.event;e.hide();e.dispatchEvent(new ak("onclickclose"));at.cancelBubble=true;at.returnValue=false};k.on(ar.infoWindow.closeButton,"mouseout",function(at){at.cancelBubble=true;at.returnValue=false});k.on(ar.infoWindow.popDiv,"click",function(at){if(!at){return}at.cancelBubble=true;at.returnValue=false});k.on(ar.infoWindow.popDom,"mousedown",function(at){if(!at){return}at.cancelBubble=true});k.on(ar.infoWindow.popDom,"mouseout",function(at){at.cancelBubble=true;at.returnValue=false});k.on(ar.infoWindow.popDom,"mousemove",function(at){at.cancelBubble=true;at.returnValue=false});k.on(ar.infoWindow.popDom,"mouseover",function(at){if(!at){return}at.cancelBubble=true;at.returnValue=false});k.on(ar.infoWindow.popDom,"click",function(at){if(!at){return}at.cancelBubble=true});k.on(ar.infoWindow.popDom,"dblclick",function(at){if(!at){return}at.cancelBubble=true;at.returnValue=false});k.on(ar.infoWindow.popDom,"mousewheel",function(at){if(!at){return}at.cancelBubble=true;at.returnValue=false});k.on(ar.infoWindow.popDom,"keydown",function(at){if(!at){return}at.cancelBubble=true});k.on(ar.infoWindow.popDom,"selectstart",function(at){at.cancelBubble=true});if(window.addEventListener){ar.infoWindow.popDom.addEventListener("DOMMouseScroll",function(at){if(!at){return}at.cancelBubble=true;at.returnValue=false},false)}ar.infoWindow.maxButton.onclick=function(au){var at=e.map.infoWindow.maxButton;if(at.src.indexOf("iw_plus")>0||at.src.indexOf("blank.gif")>0){e.isWinMax=true;at.src=e.IMG_PATH+"iw_minus.gif";e.setMaxContent();e.map.infoWindow.maxContentDiv.style.display="block"}else{e.isWinMax=false;at.src=e.IMG_PATH+"iw_plus.gif";e.setContent();e.map.infoWindow.maxContentDiv.style.display="none"}e.reset(false);e.reset(true);setTimeout(function(){e.setPanTo()},200);au=au||window.event;if(!au){return}au.cancelBubble=true;au.returnValue=false}},_mendIE6:function(au){if(k.isIE>6||k.isIE==0){return}var at=au.popDom.getElementsByTagName("IMG");for(var ar=0;ar<at.length;ar++){at[ar].style.cssText+=";FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+at[ar].src+",sizingMethod=crop)";at[ar].src=this.IMG_PATH+"blank.gif"}var e=au.shadowDom.getElementsByTagName("IMG");for(var ar=0;ar<e.length;ar++){e[ar].style.cssText+=";FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+e[ar].src+",sizingMethod=crop)";e[ar].src=this.IMG_PATH+"blank.gif"}},_setWinSize:function(aB,aA,aO){var aL=this._config;aB=aB||aL.width;aA=aA||aL.height;if(aA<0){aA=0}var av=aL.offset.width;var az=aL.offset.height;var aK=[25,-1,25,-1,25,-1,25,97];var au=[25,-1,25,-1,25,-1,25,50];aK[1]=aB-aK[0]-aK[2];if(k.isIE&&document.compatMode!="CSS1Compat"){aK[3]=aB}else{aK[3]=aB-2}aK[5]=aB-aK[4]-aK[6];au[1]=au[0];au[3]=aA-au[0]-au[4];if(k.isIE&&document.compatMode!="CSS1Compat"){au[5]=au[4]}else{au[5]=au[4]-1}var aM=[0,aK[0],aB-aK[2],0,0,aK[4],aB-aK[6],Math.ceil((aB-aK[7])/2)];var aG=[0,0,0,aK[0],aA-aK[4],aA-aK[4],aA-aK[4],aA-aK[4]];var ar=av-(aB-aK[7])/2-32;var aH=az-aA-24;var aN=Math.floor((aA+au[7])/2.03)+30;var ax=[70,-1,70,-1,-1,-1,50,-1,140,-1,70];var aF=[30,30,30,25,25,25,60,60,60,60,60];ax[7]=(aB+80-(ax[6]+ax[8]+ax[10])-50)/2;ax[9]=ax[7]+50;var aJ=ax[6]+ax[7]+ax[8]+ax[9]+ax[10];ax[1]=aJ-ax[0]-ax[2]-29;ax[5]=ax[3]=aN-aF[0]-aF[6]+70;aF[3]=aF[4]=aF[5]=aN-aF[0]-aF[6];ax[4]=(ax[0]+ax[1]+ax[2]+aF[3]+29)-ax[5]-ax[3];var e=[aN-60-1,aN-60-1+ax[0],aN-60-1+ax[0]+ax[1],29,29+ax[3],29+ax[3]+ax[4],0,ax[6],ax[6]+ax[7],ax[6]+ax[7]+ax[8],ax[6]+ax[7]+ax[8]+ax[9],];var aE=[0,0,0,aF[0],aF[0],aF[0],aF[0]+aF[3],aF[0]+aF[3],aF[0]+aF[3],aF[0]+aF[3],aF[0]+aF[3]];allShadowLeft=av-ax[6]-ax[7]-70;allShadowTop=az-aN+30;var aw=323-aN+90;shadowRightImageLeft=740+aw;var at="";var aI=function(aP){return"overflow: hidden; z-index: 1; position: absolute;              left:"+aM[aP]+"px;              top:"+aG[aP]+"px;              width:"+aK[aP]+"px;              height:"+au[aP]+"px"};var aC=function(aP){return"overflow: hidden; z-index: 1; position: absolute;              left:"+e[aP]+"px;              top:"+aE[aP]+"px;              width:"+ax[aP]+"px;              height:"+aF[aP]+"px;"};var ay=this.map.infoWindow;ay.popDom.style.top=aH+"px";ay.popDom.style.left=ar+"px";ay.shadowDom.style.top=allShadowTop+"px";ay.shadowDom.style.left=allShadowLeft+"px";for(var aD=0;aD<8;aD++){ay.popDiv[aD].style.cssText=aI(aD)}for(var aD=0;aD<ay.shadoDiv.length;aD++){ay.shadoDiv[aD].style.cssText=aC(aD)}ay.shadoDiv[3].firstChild.style.left="-"+aw+"px";ay.shadoDiv[5].firstChild.style.left="-"+shadowRightImageLeft+"px";if(aO!==null){this.show()}},setWidth:function(e){if(typeof(e)!="number"){return}if(e<0){return}this._config.width=e;if(e!=0){if(e<220){this._config.width=220}if(e>730){this._config.width=730}}if(this.map&&this.map.infoWindow&&this.map.infoWindow.hashCode==this.hashCode&&this.isOpen()){this.reset(true);var ar=this;setTimeout(function(){ar.setPanTo(),200})}},setHeight:function(e){if(typeof(e)!="number"){return}if(e<0){return}if(e!=0){if(e<60){e=60}if(e>650){e=650}}this._config.height=e;var at=this.map;if(this.map&&this.map.infoWindow&&this.map.infoWindow.hashCode==this.hashCode&&this.isOpen()){if(this._config.width!=0){at.infoWindow.contentDiv.style.width=this._config.width+"px"}this.reset(true);var ar=this;setTimeout(function(){ar.setPanTo(),200})}},setMaxWidth:function(e){if(!typeof(e)!="number"){return}if(e<0){return}this._config.maxWidth=e},setTitle:function(ar){var e=this.map;ar=ar||this._config.title;ar=ar.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+$)/g,"");this._config.title=ar;if(!e||!e.infoWindow||e.infoWindow.hashCode!=this.hashCode){return}if(ar==""){k.hide(this.map.infoWindow.titleDiv);return}e.infoWindow.titleDiv.innerHTML=ar;k.show(this.map.infoWindow.titleDiv)},setContent:function(ar){var e=ar;ar=ar||this.content;var at=this.map;this.content=ar;if(!at||!at.infoWindow||at.infoWindow.hashCode!=this.hashCode){return}if(this.isWinMax){return}at.infoWindow.contentDiv.innerHTML=ar;if(this._config.width!=0){at.infoWindow.contentDiv.style.width=this._config.width+"px"}at.infoWindow.maxContentDiv.style.display="none";if(navigator.userAgent.indexOf("Safari")>0){at.infoWindow.contentDiv.style.display="block"}else{at.infoWindow.contentDiv.style.display="inline"}},setMaxContent:function(e){if(!e){e=this._config.maxContent}else{this._config.maxContent=e}var ar=this.map;if(!ar||!ar.infoWindow||ar.infoWindow.hashCode!=this.hashCode){return}ar.infoWindow.maxContentDiv.innerHTML=e;if(!this.isWinMax){return}ar.infoWindow.contentDiv.style.display="none";if(navigator.userAgent.indexOf("Safari")>0){ar.infoWindow.maxContentDiv.style.display="block"}else{ar.infoWindow.maxContentDiv.style.display="inline"}},reset:function(e){return this.redraw(e)},redraw:function(ar){if(!this.map||!this.map.infoWindow||this.map.infoWindow.hashCode!=this.hashCode){return}var at=this;timeout=100;var e=at.map.infoWindow;var au=0;if(e.titleDiv.style.display!="none"){au=24}if(this.isWinMax){w=at._config.maxWidth;setTimeout(function(){var av=au+e.maxContentDiv.scrollHeight;av=av>at.map.height?at.map.height-60:av;if(at._config.width==0){e.contentMain.style.overflowX="hidden"}else{e.contentMain.style.overflowX="auto"}if(at._config.height==0){e.contentMain.style.overflowY="hidden"}else{e.contentMain.style.overflowY="auto"}w=w<220?220:w;w=w>600?600:w;av=av<55?55:av;av=av>440?440:av;at._setWinSize(w+32,av+32,ar);e.contentMain.style.width=w+"px";e.contentMain.style.height=av+"px";e.closeButton.style.left=w+7+"px";e.maxButton.style.left=(w-20)+7+"px";if(ar!=false){at.dispatchEvent(new ak("onresize"))}},timeout)}else{e.contentDiv.style.width=e.contentMain.style.width="auto";e.contentDiv.style.height=e.contentMain.style.height="auto";if(e.contentDiv.style.display!="block"){e.contentDiv.style.display="block"}e.contentDiv.style.whiteSpace="nowrap";setTimeout(function(){var av=e.contentMain.scrollWidth||0;av=at._config.width==0?av:at._config.width;av=av<220?220:av;av=av>600?600:av;e.contentMain.style.width=av+"px";h=e.contentMain.scrollHeight||0;h=at._config.height==0?h:at._config.height;if(at._config.width==0){e.contentMain.style.overflowX="hidden"}else{e.contentMain.style.overflowX="auto"}e.contentDiv.style.whiteSpace="";if(at._config.height==0){e.contentMain.style.overflowY="hidden"}else{e.contentMain.style.overflowY="auto"}h=h<55?55:h;h=h>440?440:h;at._setWinSize(av+32,h+32,ar);e.contentMain.style.height=h+"px";e.closeButton.style.left=av+7+"px";e.maxButton.style.left=(av-20)+7+"px";if(ar!=false){at.dispatchEvent(new ak("onresize"))}},timeout)}},setPosition:function(){var ar=this.map.temp;var at=this.overlay;if(ar.pop&&at&&at.getDom()){var e=parseInt(at.getDom().style.left)+at.getIcon().infoWindowOffset.width;var au=parseInt(at.getDom().style.top)+at.getIcon().infoWindowOffset.height;ar.pop.style.left=ar.shadow.style.left=e+"px";ar.pop.style.top=ar.shadow.style.top=au+"px"}},setPanTo:function(){if(!this.overlay||!this.overlay.point){return}var aH=this.map;var au=aH.infoWindow.popDiv;var aI=aH.infoWindow.popDom;var av=parseInt(au[3].style.width)+2;var aE=parseInt(au[1].style.height)+parseInt(au[3].style.height)+parseInt(au[7].style.height);var aC=parseInt(aI.style.left);var ax=parseInt(aI.style.top);var ar=aH.pointToPixel(this.getPoint());ar.x=ar.x-this.overlay.getIcon().offset.width+this.overlay.getIcon().infoWindowOffset.width;ar.y=ar.y-this.overlay.getIcon().offset.height+this.overlay.getIcon().infoWindowOffset.height;var az=new s(ar.x+aC,ar.y+ax);var ay=new s(ar.x+av+aC,ar.y+aE+ax);if(this._config.height!=0&&document.all){if(!aH.temp.infoKey){aH.temp.infoKey=-1}var aF=-aH.temp.infoKey;aH.temp.infoKey=-aH.temp.infoKey}var aF=0;var aD=0;var e=10;var at=this._config.margin[0];var aw=this._config.margin[1];var aG=this._config.margin[2];var aA=this._config.margin[3];if(az.x<aA){aF=-az.x+aA}if(az.y<at){aD=-az.y+at}if(ay.x>aH.width-aw){aF=aH.width-ay.x-aw}if(ay.y>aH.height-aG){aD=aH.height-ay.y-aG}this._loadCollisions();var aB=this._config.collisions;if(az.x<aB[0][0]&&az.y<aB[0][1]){if(Math.abs(-az.x+aB[0][0])<Math.abs(-az.y+aB[0][1])){aF=-az.x+aB[0][0]}else{if(aH.height-aB[0][1]-aB[3][1]<aE){aF=-az.x+aB[0][0]}else{aD=-az.y+aB[0][1]}}if(aH.width-aB[0][0]-aB[1][0]<av&&az.y<aB[1][1]){aD=-az.y+aB[1][1]}}if(ay.x>aH.width-aB[1][0]&&az.y<aB[1][1]){if(Math.abs(-ay.x+aH.width-aB[1][0])<Math.abs(-az.y+aB[1][1])&&aH.width-aB[0][0]-aB[1][0]>=av){aF=-ay.x+aH.width-aB[1][0]}else{aD=-az.y+aB[1][1];if(aH.width-aB[0][0]-aB[1][0]<av&&aH.width-aB[0][0]<av){aF=-az.x+aB[0][0]}}}if(az.x<aB[3][0]&&ay.y>aH.height-aB[3][1]){if(Math.abs(-az.x+aB[3][0])<Math.abs(-ay.y+aH.height-aB[3][1])&&(Math.abs(-az.x+aB[3][0])<Math.abs(aD)&&aD!=0||aD==0)&&aH.width-aB[3][0]>=av){aF=-az.x+aB[3][0]}else{aD=-ay.y+aH.height-aB[3][1]}if(aH.height-aB[0][1]-aB[3][1]<aE&&az.x<aB[0][0]){aF=-az.x+aB[0][0]}}if(ay.x>aH.width-aB[2][0]&&ay.y>aH.height-aB[2][1]){if(Math.abs(-ay.x+aH.width-aB[2][0])<Math.abs(-ay.y+aH.height-aB[2][1])&&(Math.abs(-ay.x+aH.width-aB[2][0])<Math.abs(aD)&&aD!=0||aD==0)&&aH.width-aB[0][0]-aB[1][0]>=av){aF=-ay.x+aH.width-aB[2][0]}else{if(aH.height-aB[1][1]-aB[2][1]>=aE){aD=-ay.y+aH.height-aB[2][1]}else{aD=-az.y+aB[1][1]}if(aH.width-aB[0][0]-aB[2][0]<av){aF=-az.x+aB[0][0]}}}if(aF!=0||aD!=0){aH.panBy(aF,aD)}},_loadCollisions:function(){if(!this.map){return}var ar=this.map;this._config.collisions=[[10,10],[10,10],[10,10],[10,10]];var aB=this.map.container;for(var az=0,at=aB.children.length;az<at;az++){var aw;var aC;if(aB.children[az]._hashCode&&k.I(aB.children[az]._hashCode)&&k.I(aB.children[az]._hashCode) instanceof E&&k.I(aB.children[az]._hashCode).blockInfoWindow==true){aw=aB.children[az]}else{if(typeof aB.children[az]._anchor!="undefined"&&aB.children[az]._offset){aw=aB.children[az]}else{continue}}var aD=aw.offsetWidth;var aA=aw.offsetHeight;var e=ar.temp.I(aw._hashCode);var av,ay;if(!e){if(typeof aw._anchor!="undefined"&&aw._offset&&aw.currentStyle.display!="none"&&aw.currentStyle.visibility!="hidden"){av=aw._offset;ay=aw._anchor}else{continue}}else{if(e.isVisible()==false){continue}av=e.getOffset();ay=e.getAnchor()}switch(ay){case BMAP_ANCHOR_TOP_LEFT:aC=0;break;case BMAP_ANCHOR_TOP_RIGHT:aC=1;break;case BMAP_ANCHOR_BOTTOM_LEFT:aC=3;break;case BMAP_ANCHOR_BOTTOM_RIGHT:aC=2;break;default:break}var ax=aD+av.width+10;var au=aA+av.height+10;var aE=this._config.collisions[aC];this._config.collisions[aC]=[ax>aE[0]?ax:aE[0],au>aE[1]?au:aE[1]]}},enableMaximize:function(){this._config.enableMaximize=true;if(this.map&&this.map.infoWindow&&this.map.infoWindow.hashCode==this.hashCode){this.map.infoWindow.maxButton.style.display="block"}},disableMaximize:function(){this._config.enableMaximize=false;if(this.map&&this.map.infoWindow&&this.map.infoWindow.hashCode==this.hashCode){this.map.infoWindow.maxButton.style.display="none"}},show:function(){if(!this.map||!this.map.infoWindow||this.map.infoWindow.hashCode!=this.hashCode){return}var ar=this.map.infoWindow;if(ar.popDom.style.display!="none"){return}k.show(ar.popDom);k.show(ar.shadowDom);var e=new ak("onopen");e.point=this.getPoint();this.dispatchEvent(e)},hide:function(){if(!this.map||!this.map.infoWindow||this.map.infoWindow.hashCode!=this.hashCode){return}var ar=this.map.infoWindow;if(ar.popDom.style.display=="none"){return}k.hide(ar.popDom);k.hide(ar.shadowDom);if(this.isWinMax){this.isWinMax=false;ar.maxContentDiv.style.display="none";this.map.infoWindow.maxButton.src=this.IMG_PATH+"iw_plus.gif"}var e=new ak("onclose");e.point=this.getPoint();this.dispatchEvent(e)},close:function(){this.hide()},dispose:function(){k.BaseClass.prototype.dispose.call(this)},getObject:function(){return this.domElement},setConfig:function(ar){if(ar==null){return}for(var e in ar){if(typeof(this._config[e])==typeof(ar[e])){this._config[e]=ar[e]}}},_revert:function(){if(!this.map||!this.map.infoWindow||this.map.infoWindow.hashCode!=this.hashCode){return}this.isWinMax=false;this.map.infoWindow.titleDiv.innerHTML="";this.map.infoWindow.contentDiv.innerHTML="";this.map.infoWindow.maxContentDiv.innerHTML="";this.map.infoWindow.maxButton.src=this.IMG_PATH+"iw_plus.gif"},_setOverflow:function(){var e=this.map;if(!e||!e.infoWindow||e.infoWindow.hashCode!=this.hashCode){return}e.infoWindow._overflowX=e.infoWindow.contentMain.style.overflowX;e.infoWindow._overflowY=e.infoWindow.contentMain.style.overflowY;e.infoWindow.contentMain.style.overflowX="hidden";e.infoWindow.contentMain.style.overflowY="hidden"},_resetOverflow:function(){var e=this;var ar=this.map;if(!ar||!ar.infoWindow||ar.infoWindow.hashCode!=this.hashCode||!ar.infoWindow._overflowX||!ar.infoWindow._overflowY){return}ar.infoWindow.contentMain.style.overflowX=ar.infoWindow._overflowX;ar.infoWindow.contentMain.style.overflowY=ar.infoWindow._overflowY;delete ar.infoWindow._overflowX;delete ar.infoWindow._overflowY},isVisible:function(){return this.isOpen()},isOpen:function(){if(!this.map){return false}var e=this.map.temp.infoWin;if(this.map.infoWindow&&this.map.infoWindow.hashCode!=this.hashCode){return false}if(e&&e.overlay==this.overlay&&this.map.infoWindow&&this.map.infoWindow.popDom.style.display=="none"){return false}else{return true}},getPoint:function(){if(this.overlay&&this.overlay.getPoint&&this.overlay.getPoint()){return this.overlay.getPoint()}},getOffset:function(){return this._config.offset},setMaxScene:function(e){var ar=this;if(!ar.map||!ar.map.infoWindow||ar.map.infoWindow.hashCode!=this.hashCode){return}ar.map.infoWindow.maxButton.style.display="block";var at=ar.map.infoWindow.maxButton;if(!!e==!!this.isWinMax){return}if(e){ar.isWinMax=true;at.src=ar.IMG_PATH+"iw_minus.gif";ar.setMaxContent();ar.map.infoWindow.maxContentDiv.style.display="block"}else{ar.isWinMax=false;at.src=ar.IMG_PATH+"iw_plus.gif";ar.setContent();ar.map.infoWindow.maxContentDiv.style.display="none"}this.reset(false)},toString:function(){return"InfoWindow"}});function R(ar,e){ag.call(this);this.content=ar;this.map=null;this.domElement=null;this._config={width:0,offset:new f(0,0),styles:{backgroundColor:"#fff",border:"1px solid #f00",padding:"1px",whiteSpace:"nowrap",font:"12px arial,simsun",zIndex:"80",MozUserSelect:"none"},point:null};e=e||{};this.setConfig(e);if(this._config.width<0){this._config.width=0}this.point=e.point}R.inherits(ag,"Label");k.extend(R.prototype,{render:function(){var e=this._config;var at=this.content;var ar=['<label class="BMapLabel" unselectable="on" '];if(e.title){ar.push('title="'+e.title+'" ')}ar.push('style="position:absolute;');if(e.width==0||e.width=="auto"){ar.push("display:inline;")}else{ar.push("width:"+e.width+"px;display:block;");ar.push("overflow:hidden;")}ar.push('">');ar.push(at);ar.push("</label>");return ar.join("")},initialize:function(e){this.map=e;this._addOverlayDom();this.setStyle(this._config.styles);if(!k.Browser.ie){this.domElement.style.cursor="inherit"}},_getPixel:function(e){return this.map.pointToPixel(this.getPoint())},setContent:function(e){this.content=e;if(this.domElement){this.domElement.innerHTML=e}},setOpacity:function(e){if(e>=0&&e<=1){this._config.opacity=e}if(this.domElement){ad(this.domElement,e)}},setOffset:function(e){if(!e||e.toString()!="Size"){return}this._config.offset=new f(e.width,e.height);this.setPoint(this.getPoint())},getOffset:function(){return this._config.offset},setStyle:function(ar){ar=ar||{};this._config.styles=k.extend(this._config.styles,ar);if(this.domElement){for(var au in ar){try{this.domElement.style[au]=ar[au]}catch(at){alert(at.message)}}}},setStyles:function(e){return this.setStyle(e)},setTitle:function(e){this._config.title=e||"";if(this.domElement){this.domElement.title=this._config.title}},getTitle:function(){return this._config.title}});function K(e,ar){ag.call(this);ar=ar||{};this.point=e;this.map=null;this.domElement=null;this.iconDom=null;this.infoWindowDom=null;this.siblingElement=null;this.iconClassName="none";this.isDraging=false;this._config={offset:new f(0,0),opacity:1,icon:null,infoWindow:null,label:null,baseZIndex:2500000,clickable:true,zIndexFixed:false,isTop:false};this.setConfig(ar);if(!ar.icon){this._config.icon=new z.Icon(aj.imgPath+"marker_red.png",new f(23,25),{offset:new f(10,25),infoWindowOffset:new f(10,0)})}}K.inherits(ag,"Marker");k.extend(K.prototype,{initialize:function(e){this.map=e;this._addOverlayDom();this.setIcon(this._config.icon);this.setLabel(this._config.label);this.enableDragging(this.isDraging)},render:function(){var e=['<span class="BMap_Marker BMap_noprint" unselectable="on" '];e.push(this._config.title?'title="'+this._config.title+'"':'"');e.push(' style="position:absolute;padding:0;margin:0;border:0;width:0;height:0;-moz-user-select:none;');e.push(this._config.clickable?"cursor:pointer;":"");e.push("background:url("+aj.imgPath+"blank.gif);");e.push("width:"+this._config.icon.size.width+"px;");e.push("height:"+this._config.icon.size.height+"px;");e.push('">');e.push("</span>");return e.join("")},siblingRender:function(){var e=['<span class="BMap_Marker" unselectable="on" '];e.push('style="position:absolute;padding:0;margin:0;border:0;width:0;height:0;-moz-user-select:none">');e.push("</span>");return e.join("")},remove:function(){if(this.domElement&&this.domElement.parentNode){this.domElement.parentNode.removeChild(this.domElement)}if(this.siblingElement&&this.siblingElement.parentNode){this.siblingElement.parentNode.removeChild(this.siblingElement)}if(this.infoWindow&&this.infoWindow.overlay&&this.infoWindow.overlay===this){this.closeInfoWindow();this.infoWindow=null}this.domElement=null;this.siblingElement=null;this.iconDom=null;if(this._config.label){this._config.label.domElement=null;this._config.label=null}this.dispatchEvent(new ak("onremove"))},hide:function(){ag.prototype.hide.call(this);if(this.infoWindow&&this.infoWindow.overlay&&this.infoWindow.overlay==this){this.closeInfoWindow()}k.hide(this.domElement);k.hide(this.siblingElement)},show:function(){ag.prototype.show.call(this);if(this.domElement){this.domElement.style.display=""}k.show(this.siblingElement)},setIcon:function(at){if(!at||at.toString()!="Icon"){return}this._config.icon=at;if(!this.map||!this.domElement||!this.siblingElement){return}var av=this.map;try{if(this.iconDom){this.siblingElement.removeChild(this.iconDom);this.iconDom=null}this.domElement.style.width=at.size.width+"px";this.domElement.style.height=at.size.height+"px"}catch(au){}if(this._config.icon){var ar=['<div style="position:absolute;padding:0;margin:0;border:0;overflow:hidden;'];ar.push("width:"+at.size.width+"px;");ar.push("height:"+at.size.height+"px;");ar.push("left:"+(-at.offset.width)+"px;");ar.push("top:"+(-at.offset.height)+'px;"');if(this.iconClassName!="none"){ar.push(' class="'+this.iconClassName+'"')}ar.push("> ");ar.push(at.getHTML());ar.push(" </div>");this.iconDom=V(this.siblingElement,ar.join(""));this.iconDom.galleryImg=false}this.setPoint(this.getPoint())},setIconClassName:function(e){if(this.iconDom){this.iconDom.className=e}},getIcon:function(){return this._config.icon},setLabel:function(e){if(!e||e.toString()!="Label"){return}this._config.label=e;var ar=this;if(!this._config.label._binded){this._config.label._binded=true;this._config.label.addEventListener("remove",function(){ar._config.label=null})}if(!this.map){return}this.map.addOverlay(e);if(e.getDom()){this.siblingElement.appendChild(e.getDom())}else{e.domElement=V(this.domElement,e.render());e.domElement.hashCode=e.getHashCode()}e.domElement.style.left=(e._config.offset.width)+"px";e.domElement.style.top=(e._config.offset.height)+"px"},getLabel:function(){return this._config.label},enableDragging:function(av){this.isDraging=!!av;if(!this.domElement){return}var az=this;var aw=0;var au=0;var at=0;var ar=false;var aA={x:0,y:0};function ay(aE,aD){var aC=aE.srcElement||aE.target;var aB=aE.clientX||aE.pageX;var aG=aE.clientY||aE.pageY;if(aE&&aD&&aB&&aG&&aC){var aF=k.Dom.getOffset(map.container);aD.pixel=new s(aB-aF.left,aG-aF.top);aD.point=map.pixelToPoint(aD.pixel);return aD}else{return aD}}this.dragStart=function(aC){ar=true;var aB=az.map.pointToPixel(az.point);aw=aC.clientX-aB.x;au=aC.clientY-aB.y;at=new Date().getTime();k.on(document,"mousemove",az.dragIng);k.on(document,"mouseup",az.dragEnd);if(az.domElement&&az.domElement.setCapture){az.domElement.setCapture()}};this.dragEnd=function(aB){if(az.domElement&&az.domElement.releaseCapture){az.domElement.releaseCapture()}ar=false;k.un(document,"mousemove",az.dragIng);k.un(document,"mouseup",az.dragEnd);aw=au=0;if((new Date()).getTime()-at>=100&&(aA.x>2||aA.y>2)){az._dragstarted=false;az.dispatchEvent(ay(aB,new ak("ondragend").inherit(aB)))}};this.dragIng=function(aD){if(ar==false){return}if(!az._dragstarted){az.dispatchEvent(ay(aD,new ak("ondragstart").inherit(aD)));az._dragstarted=true}var aC=new s((aD.clientX-aw),(aD.clientY-au));aA=aC;if((aC.x>15&&aC.x<map.width-15)&&(aC.y>30&&aC.y<map.height-15)){var aB=az.map.pixelToPoint(aC);az.setPoint(aB)}az.dispatchEvent(ay(aD,new ak("ondragging").inherit(aD)))};if(av==true){k.on(this.domElement,"mousedown",this.dragStart)}else{try{k.un(this.domElement,"mousedown",this.dragStart)}catch(ax){}}},setTop:function(ar,e){if(ar){this._config.isTop=true}else{this._config.isTop=false}if(this.map&&this.getPoint()){this.setZIndex(ag.getZIndex(this.getPoint().lat,this.map.getCoordType()),e)}},setPoint:function(e){ag.prototype.setPoint.call(this,e);if(this.siblingElement){this.siblingElement.style.left=this.domElement.style.left;this.siblingElement.style.top=this.domElement.style.top}if(this.domElement){this.domElement.style.left=parseInt(this.domElement.style.left)-this._config.icon.offset.width+"px";this.domElement.style.top=parseInt(this.domElement.style.top)-this._config.icon.offset.height+"px"}if(this.infoWindow!=null&&this.infoWindow.isOpen()){this.infoWindow.setPosition()}if(this.map){this.setZIndex(ag.getZIndex(this.getPoint().lat,this.map.getCoordType()))}},setZIndex:function(e,at){var ar=this;ar.zIndex=ar._config.baseZIndex+(ar._config.isTop?at||1000000:0);if(ar._config.zIndexFixed==false){ar.zIndex=e+ar.zIndex}if(ar.domElement&&ar.domElement.style){ar.domElement.style.zIndex=ar.zIndex}if(ar.siblingElement&&ar.siblingElement.style){ar.siblingElement.style.zIndex=ar.zIndex}},setTitle:function(e){this._config.title=e;if(this.getDom()){this.getDom().title=e}},getTitle:function(){return this._config.title||""},setOffset:function(e){if(!e||e.toString()!="Size"){return}this._config.offset=e;this.setPoint(this.getPoint())},getOffset:function(){return this._config.offset}});function y(e,ar){af.call(this,ar);this.points=e.slice(0);this.pixels=null;this.map=null;this.domElement=null}y.inherits(af,"Polygon");k.extend(y.prototype,{render:function(){return""},initialize:function(e){this.map=e;this.createPalette();this.domElement=this.polyline(this.points,true);this.domElement.hashCode=this.getHashCode();if(this._visible==false){this.domElement.style.display="none"}this.setStrokeColor(this._config.strokeColor);this.setStrokeWeight(this._config.strokeWeight);this.setStrokeStyle(this._config.strokeStyle);this.setFillColor(this._config.fillColor);this.setStrokeOpacity(this._config.strokeOpacity);this.setFillOpacity(this._config.fillOpacity)},getPoints:function(){return this.points}});function C(e,ar){af.call(this,ar);this.points=e.slice(0);this.pixels=null;this.map=null;this.domElement=null}C.inherits(af,"Polyline");k.extend(C.prototype,{render:function(){return""},initialize:function(e){this.map=e;this.createPalette();this.domElement=this.polyline(this.points);this.domElement.hashCode=this.getHashCode();if(this._visible==false){this.domElement.style.display="none"}this.setTypeNS(this.domElement,"filled",false);this.setStrokeColor(this._config.strokeColor);this.setStrokeWeight(this._config.strokeWeight);this.setStrokeStyle(this._config.strokeStyle);this.setStrokeOpacity(this._config.strokeOpacity)},getPoints:function(){return this.points}});function ap(ar,e,at){this.point=ar;this.radius=e;this.map=null;this.domElement=null;this.points=[];this.pointUnit=50;af.call(this,at)}ap.inherits(af,"Oval");k.extend(ap.prototype,{render:function(){var e=[""];return e.join("")},afterZoom:function(){},initialize:function(ar){this.map=ar;this.setPoints(this.point,this.radius);this.createPalette();this.domElement=this.polyline(this.points,true);this.domElement.hashCode=this.getHashCode();if(this._visible==false){this.domElement.style.display="none"}this.setStrokeColor(this._config.strokeColor);this.setStrokeWeight(this._config.strokeWeight);this.setStrokeStyle(this._config.strokeStyle);this.setFillColor(this._config.fillColor);this.setStrokeOpacity(this._config.strokeOpacity);this.setFillOpacity(this._config.fillOpacity);var e=this},getPoint:function(){return this.point},setPoint:function(e){this.point=e;this.setPoints(this.point,this.radius)},getRadius:function(){return this.radius},setRadius:function(e){this.radius=e;this.setPoints(this.point,this.radius)},setPoints:function(az,au){if(!az||!au){return}var ar=this.map;var aA=az.lng;var ay=az.lat;if(ar.config.coordType==BMAP_COORD_LNGLAT){var ax=ar.lnglatToMercator(aA,ay);aA=ax[0];ay=ax[1]}var aB=[];for(var at=0;at<this.pointUnit;at++){var e=((360/this.pointUnit)*at*Math.PI)/180;var aw=aA+au*Math.cos(e);var av=ay-au*Math.sin(e);if(ar.config.coordType==BMAP_COORD_LNGLAT){var ax=ar.mercatorToLnglat(aw,av);aB.push(new z.Point(ax[0],ax[1]))}else{aB.push(new z.Point(aw,av))}}this.points=aB;if(this.domElement){this.setPolylinePoint(this.domElement,this.points)}},getPoints:function(){return this.points}});function J(ar,e,at){this.setPoints(ar,e);this.pixels=null;this.map=null;this.domElement=null;af.call(this,at)}J.inherits(af,"Rect");k.extend(J.prototype,{render:function(){var e=[""];return e.join("")},afterZoom:function(){},initialize:function(e){this.map=e;this.createPalette();this.domElement=this.polyline(this.points,true);this.domElement.hashCode=this.getHashCode();this.setStrokeColor(this._config.strokeColor);this.setStrokeWeight(this._config.strokeWeight);this.setStrokeStyle(this._config.strokeStyle);this.setFillColor(this._config.fillColor);this.setStrokeOpacity(this._config.strokeOpacity);this.setFillOpacity(this._config.fillOpacity)},getPoint:function(){},setPoint:function(){},setPoints:function(at,e){if(!at||!e||at.toString()!="Point"||e.toString()!="Point"){return}var ax=at;var av=e;var aw=new D(ax.lng,av.lat);var au=new D(av.lng,ax.lat);var ar=at;this.points=[ax,aw,av,au,ar];if(this.domElement){this.setPolylinePoint(this.domElement,this.points)}},getPoints:function(){return[this.points[0],this.points[2]]}});function s(e,ar){e=isNaN(e)?0:parseFloat(e);ar=isNaN(ar)?0:parseFloat(ar);this.x=e;this.y=ar}s.inherits(q,"Pixel");function an(){}k.extend(an,{EARTHRADIUS:6370996.81,MCBAND:[12890594.86,8362377.87,5591021,3481989.83,1678043.12,0],LLBAND:[75,60,45,30,15,0],MC2LL:[[1.410526172116255e-8,0.00000898305509648872,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-0.03801003308653,17337981.2],[-7.435856389565537e-9,0.000008983055097726239,-0.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,10260144.86],[-3.030883460898826e-8,0.00000898305509983578,0.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,0.32710905363475,6856817.37],[-1.981981304930552e-8,0.000008983055099779535,0.03278182852591,40.31678527705744,0.65659298677277,-4.44255534477492,0.85341911805263,0.12923347998204,-0.04625736007561,4482777.06],[3.09191371068437e-9,0.000008983055096812155,0.00006995724062,23.10934304144901,-0.00023663490511,-0.6321817810242,-0.00663494467273,0.03430082397953,-0.00466043876332,2555164.4],[2.890871144776878e-9,0.000008983055095805407,-3.068298e-8,7.47137025468032,-0.00000353937994,-0.02145144861037,-0.00001234426596,0.00010322952773,-0.00000323890364,826088.5]],LL2MC:[[-0.0015702102444,111320.7020616939,1704480524535203,-10338987376042340,26112667856603880,-35149669176653700,26595700718403920,-10725012454188240,1800819912950474,82.5],[0.0008277824516172526,111320.7020463578,647795574.6671607,-4082003173.641316,10774905663.51142,-15171875531.51559,12053065338.62167,-5124939663.577472,913311935.9512032,67.5],[0.00337398766765,111320.7020202162,4481351.045890365,-23393751.19931662,79682215.47186455,-115964993.2797253,97236711.15602145,-43661946.33752821,8477230.501135234,52.5],[0.00220636496208,111320.7020209128,51751.86112841131,3796837.749470245,992013.7397791013,-1221952.21711287,1340652.697009075,-620943.6990984312,144416.9293806241,37.5],[-0.0003441963504368392,111320.7020576856,278.2353980772752,2485758.690035394,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-0.0003218135878613132,111320.7020701615,0.00369383431289,823725.6402795718,0.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,0.37238884252424,7.45]],getDistanceByMC:function(aw,au){if(typeof(aw)=="undefined"||typeof(au)=="undefined"){return 0}var ar,av,e,at;aw=this.convertMC2LL(aw);if(typeof(aw)=="undefined"){return 0}ar=this.toRadians(aw.lng);av=this.toRadians(aw.lat);au=this.convertMC2LL(au);if(typeof(au)=="undefined"){return 0}e=this.toRadians(au.lng);at=this.toRadians(au.lat);return this.getDistance(ar,e,av,at)},getDistanceByLL:function(aw,au){if(typeof(aw)=="undefined"||typeof(au)=="undefined"){return 0}aw.lng=this.getLoop(aw.lng,-180,180);aw.lat=this.getRange(aw.lat,-74,74);au.lng=this.getLoop(au.lng,-180,180);au.lat=this.getRange(au.lat,-74,74);var ar,e,av,at;ar=this.toRadians(aw.lng);av=this.toRadians(aw.lat);e=this.toRadians(au.lng);at=this.toRadians(au.lat);return this.getDistance(ar,e,av,at)},convertMC2LL:function(ar){var at,av;at=new D(Math.abs(ar.lng),Math.abs(ar.lat));for(var au=0;au<this.MCBAND.length;au++){if(at.lat>=this.MCBAND[au]){av=this.MC2LL[au];break}}var e=this.convertor(ar,av);var ar=new D(e.lng.toFixed(6),e.lat.toFixed(6));return ar},convertLL2MC:function(e){var ar,au;e.lng=this.getLoop(e.lng,-180,180);e.lat=this.getRange(e.lat,-74,74);ar=new D(e.lng,e.lat);for(var at=0;at<this.LLBAND.length;at++){if(ar.lat>=this.LLBAND[at]){au=this.LL2MC[at];break}}if(!au){for(var at=this.LLBAND.length-1;at>=0;at--){if(ar.lat<=-this.LLBAND[at]){au=this.LL2MC[at];break}}}var av=this.convertor(e,au);var e=new D(av.lng.toFixed(2),av.lat.toFixed(2));return e},convertor:function(at,au){if(!at||!au){return}var e=au[0]+au[1]*Math.abs(at.lng);var ar=Math.abs(at.lat)/au[9];var av=au[2]+au[3]*ar+au[4]*ar*ar+au[5]*ar*ar*ar+au[6]*ar*ar*ar*ar+au[7]*ar*ar*ar*ar*ar+au[8]*ar*ar*ar*ar*ar*ar;e*=(at.lng<0?-1:1);av*=(at.lat<0?-1:1);return new D(e,av)},getDistance:function(ar,e,au,at){return this.EARTHRADIUS*Math.acos((Math.sin(au)*Math.sin(at)+Math.cos(au)*Math.cos(at)*Math.cos(e-ar)))},toRadians:function(e){return Math.PI*e/180},toDegrees:function(e){return(180*e)/Math.PI},getRange:function(at,ar,e){if(ar!=null){at=Math.max(at,ar)}if(e!=null){at=Math.min(at,e)}return at},getLoop:function(at,ar,e){while(at>e){at-=e-ar}while(at<ar){at+=e-ar}return at}});function f(ar,e){this.width=parseFloat(ar)||0;this.height=parseFloat(e)||0}f.prototype.equals=function(e){return !!(e&&this.width==e.width&&this.height==e.height)};f.prototype.toString=function(){return"Size"};function c(aw,ax,ar,e,at){k.BaseClass.call(this);this.tilelayer=at;this.position=ar;this.mgr=aw;this.name=aw.getTileName(e,at);this.info=e;var av=document.createElement("img");Y(av,[aw.tileSize,aw.tileSize]);T(av);aa(av).position="absolute";av.galleryImg=false;ai(av,ar);this.img=av;this.src=ax;var au=this;this.img.onload=function(aD){if(!au.mgr){return}var aA=au.mgr;var aE=aA.bufferTiles;if(aA.bufferNumber>0){aE[au.name]=au;aE.push(au.name)}var aH=aE.length-aA.bufferNumber;for(var aB=0;aH>0&&aB<aE.length;aB++){var ay=aE[aB];if(!aA.mapTiles[ay]){if(aE[ay]){aE[ay].mgr=null;var aC=aE[ay].img;if(aC.parentNode){O(aC);aC.parentNode.removeChild(aC)}aC=null;aE[ay].img=null;delete aE[ay]}aE.splice(aB,1);aB--;aH--}}au.loaded=true;if(!G(au.img)){if(at.tilesDiv){at.tilesDiv.appendChild(au.img);if(FeBrowser.ie<=6&&FeBrowser.ie>0&&at.isTransparentPng()==true){var aG=au.src.toUpperCase();if(aG.indexOf(".PNG")>0){var az=au.img.style.width;var aI=au.img.style.height;var aF='position:absolute;FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+au.src+'",sizingMethod=scale);';au.img.style.cssText=aF;au.img.style.width=az;au.img.style.height=aI;ai(au.img,au.position)}}}}};this.img.onerror=function(aA){if(!au.mgr){return}var ay=au.mgr;au.error=true;var az=N[at.mapType];if(az.errorUrl){au.img.src=az.errorUrl}if(!G(au.img)){if(at.tilesDiv){at.tilesDiv.appendChild(au.img)}}};if(FeBrowser.ie<=6&&FeBrowser.ie>0&&at.isTransparentPng()==true){av.src=aj.imgPath+"blank.gif"}else{av.src=ax}}function S(e){this.tileLayers=[];this.cacheDiv=null;this.map=e;this.bufferNumber=500;this.mapTiles=[];this.bufferTiles=[];this.slideMaxZoom=4;this.config=N[this.map.mapType];this.errorUrl=this.config.errorUrl;this.tileSize=this.config.tileSize;this.baseUnits=this.config.baseUnits;this.minZoomLevel=this.config.zoomLevelMin;this.maxZoomLevel=this.config.zoomLevelMax;this.tileURLs=this.config.tileUrls;this.temp={}}z.register(function(ar){var e=ar.tileMgr=new S(ar);ar.addEventListener("dragstart",function(at){e.dragStart(at)});ar.addEventListener("dragend",function(at){e.dragEnd(at)});ar.addEventListener("click",function(at){e.click(at)});ar.addEventListener("mousewheel",function(at){e.mouseWheel(at)});ar.addEventListener("dblclick",function(at){e.dblClick(at)});ar.addEventListener("load",function(at){e.loadTiles()});ar.addEventListener("zoomstart",function(at){e._zoom(at)});ar.addEventListener("moving",function(at){e.mend(at)});ar.addEventListener("resize",function(at){e.resizeMap(at)});ar.addEventListener("addtilelayer",function(at){e.addTileLayer(at)});ar.addEventListener("removetilelayer",function(at){e.removeTileLayer(at)})});k.extend(S.prototype,{addTileLayer:function(au){var at=this;var ar=au.target;at.tileLayers.push(ar);at.moveGridTiles(true)},removeTileLayer:function(az){var aA=this;var ax=az.target;var av=ax.mapType;var au=aA.mapTiles;var aB=aA.bufferTiles;for(var ar in aB){var at=ar.split("-")[1];if(at==av){delete aB[ar]}}for(var ar in au){var at=ar.split("-")[1];if(at==av){delete au[ar]}}if(aA.zoomsDiv&&aA.zoomsDiv.parentNode){aA.zoomsDiv.parentNode.removeChild(aA.zoomsDiv);aA.zoomsDiv.innerHTML=""}for(var ay=0,aw=aA.tileLayers.length;ay<aw;ay++){if(ax==aA.tileLayers[ay]){aA.tileLayers.splice(ay,1);delete ax}}aA.moveGridTiles(true)},getTileLayer:function(au){var at=this;for(var ar=0,e=at.tileLayers.length;ar<e;ar++){tilelayer=at.tileLayers[ar];if(tilelayer.mapType==au){return tilelayer}}return},mend:function(ar){this.moveGridTiles(true)},_zoom:function(at){var ar=this;if((ar.map.currentOperation&g.mousewheel)!=0||(ar.map.currentOperation&g.dblclick)!=0){return}if(!at.forWheel){if(ar.zoomsDiv&&ar.zoomsDiv.style.display!="none"){ar.zoomsDiv.style.display="none"}}setTimeout(function(){ar.moveGridTiles(true);ar.map.dispatchEvent(new ak("onzoomend"))},10)},resizeMap:function(at){this.loaded=false;var ar=this.map;this.moveGridTiles(true)},zoom:function(aA,aG,aF){aG=aG||0;aF=aF||0;var at=this.map;var av=aA?new s(aA.offsetX,aA.offsetY):new s(at.width/2,at.height/2);var aC=this;if(at.overlayDiv){at.overlayDiv.style.visibility="hidden"}if(at.markerDiv){at.markerDiv.style.visibility="hidden"}for(var ay=0,ax=aC.tileLayers.length;ay<ax;ay++){tilelayer=aC.tileLayers[ay];if(!tilelayer.baseLayer){tilelayer.tilesDiv.style.visibility="hidden"}}if(!this.zoomsDiv){this.zoomsDiv=this.tilesDiv.cloneNode(true)}else{if(this.zoomsDiv&&this.zoomsDiv.parentNode&&!this._zTimeLine){this.zoomsDiv.parentNode.removeChild(this.zoomsDiv);this.zoomsDiv=null;this.zoomsDiv=this.tilesDiv.cloneNode(true)}}this.zoomsDiv.style.display="block";at.platform.insertBefore(this.zoomsDiv,at.platform.firstChild);var ar={x:av.x-parseInt(this.tilesDiv.style.left)-at.offsetX,y:av.y-parseInt(this.tilesDiv.style.top)-at.offsetY};var aw=[];var aD=at.zoomLevel-at.lastLevel;if(!aC._diff){aC._diff=aD}else{if(at.zoomLevel-at.lastLevel>0){aC._diff++}else{aC._diff--}}if(this._zTimeLine&&this._zTimeLine.schedule==0){this._zTimeLine.stop();this._zTimeLine=null;aD=aC._diff}var aB=Math.pow(2,aD);var az=this.zoomsDiv.childNodes.length;for(var ay=az-1;ay>-1;ay--){var au={};var aE=this.zoomsDiv.childNodes[ay].style;au.top=parseInt(aE.top)||0;au.left=parseInt(aE.left)||0;au.width=parseInt(aE.width);au.height=parseInt(aE.height);au.dw=au.width*aB-au.width;au.dh=au.height*aB-au.height;au.dx=(au.left-ar.x)*aB-(au.left-ar.x);au.dy=(au.top-ar.y)*aB-(au.top-ar.y);aw[ay]=au}this.zoomsDiv._ol=parseInt(this.zoomsDiv.style.left);this.zoomsDiv._ot=parseInt(this.zoomsDiv.style.top);if(this._zTimeLine!=null){this._zTimeLine.stop();this._zTimeLine=null}this._zTimeLine=new A({fps:20,duration:at.config.zoomerDuration,transition:p.easeInQuad,render:function(aI){if(aI<0.1){return}for(var aH=aw.length-1;aH>-1;aH--){var aJ=aw[aH];if(aC.zoomsDiv&&aC.zoomsDiv.childNodes[aH]){var e=aC.zoomsDiv.childNodes[aH].style;e.top=Math.round(aJ.top+aJ.dy*aI)+"px";e.left=Math.round(aJ.left+aJ.dx*aI)+"px";e.width=Math.ceil(aJ.width+aJ.dw*aI)+"px";e.height=Math.ceil(aJ.height+aJ.dh*aI)+"px"}}if(aG||aF){aC.zoomsDiv.style.left=aC.zoomsDiv._ol-(aG*aI)+"px";aC.zoomsDiv.style.top=aC.zoomsDiv._ot-(aF*aI)+"px"}},finish:function(){aC.moveGridTiles(true);aC._zTimeLine=null;if(at.overlayDiv){at.overlayDiv.style.visibility=""}if(at.markerDiv){at.markerDiv.style.visibility=""}for(var aH=0,e=aC.tileLayers.length;aH<e;aH++){tilelayer=aC.tileLayers[aH];if(!tilelayer.baseLayer){tilelayer.tilesDiv.style.visibility=""}}aC.tilesDiv.style.visibility="";delete aC._diff;at.dispatchEvent(new ak("onzoomend"));return}});this.tilesDiv.style.visibility="hidden"},showTile:function(aw,av,aB,ay){this.centerPos=av;var ax=N[ay.mapType];var at=this.getTileName(aw,ay);var au=(aw[0]*ax.tileSize)+av[0];var ar=(-1-aw[1])*ax.tileSize+av[1];var az=[au,ar];var aA=this.mapTiles[at];if(aA){if(aB){ai(aA.img,az)}return}aA=this.bufferTiles[at];if(aA){ay.tilesDiv.insertBefore(aA.img,ay.tilesDiv.lastChild);this.mapTiles[at]=aA;ai(aA.img,az);return}else{var aD=ax.baseUnits*Math.pow(2,(ax.zoomLevelMax-aw[2]));var aC=new D(aw[0]*aD,aw[1]*aD);var e=ay.getTilesUrl(aC,aw[2]);aA=new c(this,e,az,aw,ay);this.mapTiles[at]=aA}},getTileName:function(e,ar){var at=ar.mapType;return"TILE-"+at+"-"+e[0]+"-"+e[1]+"-"+e[2]},hideTile:function(at){var ar=false;var e=at.img;if(G(e)){if(at.loaded){ar=true}if(e.parentNode){O(e);e.parentNode.removeChild(e)}}delete this.mapTiles[at.name];if(!ar){if(e.parentNode){O(e);e.parentNode.removeChild(e)}e=null;at.img=null;at.mgr=null;at=null}},loadTiles:function(){var ar=this;if(k.Browser.ie){try{document.execCommand("BackgroundImageCache",false,true)}catch(at){}}if(this.zoomsDiv&&this.zoomsDiv.style.display!="none"){this.zoomsDiv.style.display="none"}ar.moveGridTiles(true);ar.map.loaded=true},getCell:function(av,au){var e=this.baseUnits*Math.pow(2,(this.maxZoomLevel-au));var at=parseInt(av.lng/e);var ar=parseInt(av.lat/e);return[at,ar,e*(at+0.5),e*(ar+0.5)]},moveGridTiles:function(aI){var aE=this.tileLayers.length;for(var aG=0;aG<aE;aG++){var av=this.tileLayers[aG];if(av.baseLayer||aE==1){this.tilesDiv=av.tilesDiv}var aO=N[av.mapType];var aS=this.map;var aF=aS.zoomLevel;var aJ=aS.centerPoint;this.mapCenterPoint=aJ;var az=aS.getZoomUnits(aS.zoomLevel);var aB=aO.baseUnits*Math.pow(2,(aO.zoomLevelMax-aF));var aA=parseInt(aJ.lng/aB);if(aJ.lng<0){aA-=1}var aw=parseInt(aJ.lat/aB);if(aJ.lat<0){aw-=1}var aD=aO.tileSize;var au=[aA,aw,(aJ.lng-aA*aB)/aB*aD,(aJ.lat-aw*aB)/aB*aD];var aN=au[0]-Math.ceil((aS.width/2-au[2])/aD);var at=au[1]-Math.ceil((aS.height/2-au[3])/aD);var aK=au[0]+Math.ceil((aS.width/2+au[2])/aD)-1;var aC=au[1]+Math.ceil((aS.height/2+au[3])/aD)-1;if(aI){this.areaCenter=new D(aJ.lng,aJ.lat)}var ar=this.mapTiles;var ay=-Math.round(this.areaCenter.lng/az);var ax=Math.round(this.areaCenter.lat/az);var aQ=[ay,ax];for(var aR in ar){var aT=ar[aR];var aP=aT.info;if(!aP){continue}if(aP[2]==aS.zoomLevel&&(aN>aP[0]||aK<aP[0]||at>aP[1]||aC<aP[1])){this.hideTile(aT)}else{if(aP[2]!=aS.zoomLevel){this.hideTile(aT)}else{if(aP[2]==aS.lastLevel){this.showTile(aP,[aQ[0]*Math.pow(2,aS.zoomLevel-aS.lastLevel),aQ[1]*Math.pow(2,aS.zoomLevel-aS.lastLevel)],aI,av)}}}}av.tilesDiv.style.left=Math.ceil(-aS.offsetX+aS.width/2)+"px";av.tilesDiv.style.top=Math.ceil(-aS.offsetY+aS.height/2)+"px";var e=[];for(var aM=aN;aM<=aK;aM++){for(var aL=at;aL<=aC;aL++){e.push([aM,aL])}}e.sort((function(aU){return function(aV,aW){return(Math.abs(aV[0]-aU[0]+aV[1]-aU[1])-Math.abs(aW[0]-aU[0]+aW[1]-aU[1]))}})([au[0],au[1]]));for(var aM=0,aH=e.length;aM<aH;aM++){this.showTile([e[aM][0],e[aM][1],aS.zoomLevel],aQ,aI,av)}}return},dragStart:function(ar){this.temp.pps={x:this.map.offsetX,y:this.map.offsetY}},dragEnd:function(ar){this.temp.ppe={x:this.map.offsetX,y:this.map.offsetY}},click:function(at){if(!this.map.config.enableClickPan){return}var ar=this.temp;if(this.map.currentOperation==0&&!ar.ppe&&!ar.pps||(ar.ppe&&ar.pps&&(ar.ppe.x-ar.pps.x==0&&ar.ppe.y-ar.pps.y==0))){this.map.panBy(this.map.width/2-at.offsetX,this.map.height/2-at.offsetY)}ar.pps=null;ar.ppe=null},mouseWheel:function(ax){if(!this.map.config.enableWheelZoom){return}var ay=this.map;var az=new ak("onzoomstart");az.forWheel=true;ay.dispatchEvent(az);var av=N[ay.mapType];ay.zoomLevel=ay.zoomLevel+(ax.trend==true?1:-1);var at=ay.config.zoomLevelMin;if(at){if(ay.zoomLevel<at){ay.zoomLevel=at;return}}var aw=ay.config.zoomLevelMax;if(aw){if(ay.zoomLevel>aw){ay.zoomLevel=aw;return}}if(ay.zoomLevel>av.zoomLevelMax){ay.zoomLevel=av.zoomLevelMax;return}if(ay.zoomLevel<av.zoomLevelMin){ay.zoomLevel=av.zoomLevelMin;return}if(ax){var aA=new s(ax.offsetX,ax.offsetY);var ar=ay.pixelToPoint(aA,ay.lastLevel,true);var au=ay.getZoomUnits(ay.zoomLevel);ay.centerPoint=new D(ar.lng+au*(ay.width/2-aA.x),ar.lat-au*(ay.height/2-aA.y));this.zoom(ax)}else{var ay=this;setTimeout(function(){ay.moveGridTiles(true)},10)}},dblClick:function(ax){var ay=this.map;if(!ay.config.enableDblclickZoom){return}var aB=new s(ax.offsetX,ax.offsetY);var at=ay.pixelToPoint(aB,null,true);var az=N[ay.mapType].zoomLevelMax;if(ay.zoomLevel>az){ay.zoomLevel=az}var aw=ay.config.zoomLevelMax;if(aw){if(ay.zoomLevel>aw){ay.zoomLevel=aw;az=aw}}if(ay.zoomLevel<az){ay.dispatchEvent(new ak("onzoomstart"));ay.lastLevel=ay.zoomLevel;ay.zoomLevel++;var au=ay.config.zoomLevelMin;if(au){if(ay.zoomLevel<au){ay.zoomLevel=au;return}}var av=ay.getZoomUnits(ay.zoomLevel);ay.centerPoint=new D(at.lng,at.lat);var ar=(ay.getZoomUnits(ay.zoomLevel-1))/av*0.5;var aD=aB.x-Math.round(ay.width/2)*ar;var aA=aB.y-Math.round(ay.height/2)*ar;this.zoom(ax,aD,aA)}else{var aC=ay.pixelToPoint(aB,null);ay.panTo(aC)}}});function a(e){q.call(this);if(!e){return}this._opts={};this._map=e}a.inherits(q,"ToolbarItem");k.extend(a.prototype,{initialize:function(){},_bind:function(){var ar=this;ar.setCursor(ar._opts.cursor);k.on(ar._map.container,"mousemove",function(av){if(!ar._isOpen){return}if(!ar.followTitle){return}av=window.event||av;var at=av.target||av.srcElement;if(at!=j.getDom(ar._map)){ar.followTitle.hide();return}if(!ar._mapMoving){ar.followTitle.show()}var au=j.getDrawPoint(av,true);ar.followTitle.setPoint(au)});if(this._opts.followText){var e=this.followTitle=new R(this._opts.followText,{offset:new f(14,16)});this.followTitle.setStyles({color:"#333",borderColor:"#ff0103"});this._map.addOverlay(e);e.hide()}},_checkStr:function(e){if(!e){return""}return e.replace(/</g,"&lt;").replace(/>/g,"&gt;")}});function aq(ar,e){a.call(this,ar);this._opts=k.extend(k.extend(this._opts,{icon:null,iconFollow:false,followText:"",cursor:"pointer"}),e);this._isOpen=false;this._opts.followText=this._checkStr(this._opts.followText);this.followTitle=this._opts.followText;this.followMarker=null;this._overlays=[]}aq.inherits(a,"PushpinTool");k.extend(aq.prototype,{open:function(){if(this._isOpen==true){return true}if(this._map._toolInUse){return false}this._map._toolInUse=true;this._isOpen=true;if(!this.binded){this._bind();this.binded=true}if(this.followMarker==null){this.followMarker=new K(this._map.getCenter(),{icon:this._opts.icon})}this._map.addOverlay(this.followMarker);this.followMarker.hide();j.show(this._map);this.setCursor(this._opts.cursor)},close:function(){if(!this._isOpen){return}this._map._toolInUse=false;this._isOpen=false;if(this.followMarker){this.followMarker.remove();this.followMarker=null}if(this.followTitle){this.followTitle.hide()}j.hide()},_bind:function(){a.prototype._bind.call(this);var e=this;k.on(j.getDom(e._map),"click",function(aw){if(!e._isOpen){return}aw=window.event||aw;var ar=aw.layerX||aw.offsetX;var ax=aw.layerY||aw.offsetY;var av=j.getDrawPoint(aw);var at=new K(av,{icon:e._opts.icon});e._map.addOverlay(at);e._overlays.push(at);var au=new ak("onmarkend");au.marker=at;e.dispatchEvent(au);e.close()})},setIcon:function(e){if(!e||e&&e.toString()!="Icon"){return}this._opts.icon=e},getIcon:function(){return this._opts.icon},setCursor:function(e){this._opts.cursor=e;j.setCursor(this._opts.cursor)},getCursor:function(){return this._opts.cursor},clear:function(){for(var ar=0,e=this._overlays.length;ar<e;ar++){if(this._overlays[ar].remove){this._overlays[ar].remove();this._overlays[ar].dispose()}}this._overlays.length=0},toString:function(){return"PushPinTool"}});function t(ar,e){a.call(this,ar);e=e||{};this._opts=k.extend(k.extend(this._opts||{},{autoClear:false,tips:"\u6d4b\u8ddd",followText:"\u5355\u51fb\u786e\u5b9a\u8d77\u70b9\uff0c\u53cc\u51fb\u7ed3\u675f\u7ed8\u5236",unit:"metric",showResult:true,lineColor:"blue",lineStroke:2,opacity:1,lineStyle:"solid",cursor:aj.imgPath+"ruler.cur",styleCodes:{lnCode:0,spCode:0,slCode:0,tlCode:0}}),e);if(this._opts.showResult==false){if(typeof e.tips=="undefined"){this._opts.tips="\u7ed8\u5236\u6298\u7ebf"}if(!e.cursor){this._opts.cursor="crosshair"}}if(this._opts.lineStroke<=0){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:"\u7c73",u2:"\u516c\u91cc"},us:{name:"us",conv:3.2808,incon:5279.856,u1:"\u82f1\u5c3a",u2:"\u82f1\u91cc"}};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=aj.imgPath+"ruler.cur";if(this._opts.showResult){this._opts.followText="\u5355\u51fb\u786e\u5b9a\u8d77\u70b9"}this._followTextM="\u5355\u51fb\u786e\u5b9a\u5730\u70b9\uff0c\u53cc\u51fb\u7ed3\u675f";this._movingTimerId=null;if(this._opts.showResult){this.text="\u6d4b\u8ddd"}else{this.text="\u7ed8\u7ebf"}this._isOpen=false}t.inherits(a,"PolylineTItem");k.extend(t.prototype,{initialize:function(ar,e){if(a.prototype.initialize.call(this,ar,e)==false){return}},open:function(){if(this._isOpen==true){return true}if(this._map._toolInUse){return false}this._map._toolInUse=true;this._isOpen=true;if(this._mapMoving){delete this._mapMoving}var au=this;if(!this._binded){this._binded=true;this._bind();this._map.addEventListener("moving",function(){au._hideCurrent()})}var at=function(aC){var ax=au._map;if(ax.currentOperation&g.toolbarOperation==0||!au._isOpen){return}aC=window.event||aC;var az=j.getDrawPoint(aC,true);if(!au._isPointValid(az)){return}au._bind.initX=aC.pageX||aC.clientX||0;au._bind.initY=aC.pageY||aC.clientY||0;if(au._points.length>0){var aF=ax.pointToPixel(au._points[au._points.length-1]);var ay=ax.pointToPixel(az);var aB=Math.sqrt(Math.pow(aF.x-ay.x,2)+Math.pow(aF.y-ay.y,2));if(aB<5){return}}au._bind.x=aC.layerX||aC.offsetX||0;au._bind.y=aC.layerY||aC.offsetY||0;au._points.push(az);if(au._opts.showResult){au._addSecPoint(az)}if(au._opts.showResult&&au._paths.length==0){au._formatTitle(1,au._followTextM,au.getTotalDistance())}if(au._paths.length>0){au._paths[au._paths.length-1].show();if(au._opts.showResult){au._paths[au._paths.length-1].setStrokeOpacity(au._dOpacity)}}var aI=new C([az,az]);au._map.addOverlay(aI);aI._stCode=au._opts.styleCodes.lnCode;au._paths.push(aI);au._overlays.push(aI);if(au._opts.showResult){aI.setStrokeWeight(au._dLineStroke);aI.setStrokeColor(au._dLineColor);aI.setStrokeOpacity(au._dOpacity/2);aI.setStrokeStyle(au._dLineStyle)}else{aI.setStrokeStroke(au._opts.lineStroke);aI.setStrokeColor(au._opts.lineColor);aI.setStrokeOpacity(au._opts.opacity);aI.setStrokeStyle(au._opts.lineStyle)}if(au._mapMoving){aI.hide()}if(au._points.length>1){var aA=au._paths[au._points.length-2];aA.setPath(az,1)}if(au._opts.showResult){var aD="";if(au._points.length>1){var aG=au._setSegDistance(au._points[au._points.length-2],au._points[au._points.length-1]);var aE=au.getTotalDistance();aD=au._formatDisStr(aE)}else{aD="\u8d77\u70b9"}var aH=new R(aD,{offset:new z.Size(10,-5)});aH.setStyles({color:"#333",borderColor:"#ff0103"});aH._stCode=au._opts.styleCodes.slCode;au._map.addOverlay(aH);au._formatSegLabel(aH,aD);au._overlays.push(aH);az.disLabel=aH;aH.setPoint(az)}};var ar=function(aO){if(!au._isOpen){return}if(au._paths.length>0){aO=window.event||aO;var aE=aO.pageX||aO.clientX||0;var aD=aO.pageY||aO.clientY||0;if(typeof au._bind.initX=="undefined"){au._bind.x=aO.layerX||aO.offsetX||0;au._bind.y=aO.layerY||aO.offsetY||0;au._bind.initX=aE;au._bind.initY=aD}var aG=au._bind.x+aE-au._bind.initX;var aF=au._bind.y+aD-au._bind.initY;var aM=au._paths[au._paths.length-1];var aK=au._map.pixelToPoint(new s(aG,aF));aM.setPath(aK,1);if(!au._mapMoving){aM.show()}var aI=0;var aH=0;if(aG<10){aI=8}else{if(aG>au._map.width-10){aI=-8}}if(aF<10){aH=8}else{if(aF>au._map.height-10){aH=-8}}if(aI!=0||aH!=0){if(!ar._movingTimerId){var az=au._map.offsetX;var ay=au._map.offsetY;var aB=az+aI;var aA=ay+aH;au._mapMoving=true;au._map._setPlatformPosition(aB,aA);au._bind.i=0;au._bind.j=0;ar._movingTimerId=setInterval(function(){var aQ=aI!=0?au._bind.i+=aI:0;var aP=aH!=0?au._bind.j+=aH:0;au._map._setPlatformPosition(aB+aQ,aA+aP)},30);au._movingTimerId=ar._movingTimerId;aM.hide();au.followTitle&&au.followTitle.hide()}}else{if(ar._movingTimerId){clearInterval(ar._movingTimerId);delete ar._movingTimerId;delete au._movingTimerId;var aJ=au._paths[au._paths.length-1];var ax=au._map.pixelToPoint(new s(aG,aF));if(!aJ){return}aJ.setPath(ax,1);aJ.show();if(au.followTitle){au.followTitle.setPoint(ax);au.followTitle.show()}au._bind.i=0;au._bind.j=0;delete au._mapMoving}}if(au._opts.showResult&&au.followTitle){var aC=au.getTotalDistance();var aN=au._getDistance(au._points[au._points.length-1],aK);au._updateInstDis(au.followTitle.getDom(),aC+aN)}}else{if(au.followTitle){au.followTitle.show();aO=window.event||aO;var aL=aO.target||aO.srcElement;if(aL!=j.getDom()){au.followTitle.hide()}}}};var e=function(aE){if(!au._isOpen){return}k.un(j.getDom(au._map),"click",at);k.un(document,"mousemove",ar);k.un(j.getDom(au._map),"dblclick",e);if(au._opts.showResult&&au._points.length>0){var aD=au._points[au._points.length-1];aD.disLabel.remove();delete aD.disLabel}var ay=0;if(au._paths.length>0){var aC=au._paths[au._paths.length-1];var aB=au._map.pointToPixel(au._points[au._points.length-1]);var az=au._map.pointToPixel(au._points[au._points.length-2]);if(aB&&az){var ax=Math.round(Math.sqrt((aB.x-az.x)*(aB.x-az.x)+(aB.y-az.y)*(aB.y-az.y)));if(ax<5){aC.remove();au._paths.length=au._paths.length-1}if(au._opts.showResult&&au._paths.length>0){ay=au.getTotalDistance();au._processLastOp()}}}else{if(au._opts.showResult==true&&au._paths.length<1){au._clearThis()}}var aA=new ak("ondrawend");aA.points=au._points.slice(0);aA.overlays=au._paths.slice(0);if(au._opts.showResult){aA.distance=ay.toFixed(0)}au.dispatchEvent(aA);setTimeout(function(){if(au._isOpen==true){au.close()}},50)};var aw=function(ax){ax=window.event||ax;if(ax.keyCode==27){au._clearThis();au.dispatchEvent(new ak("ondrawended"));setTimeout(function(){if(au._isOpen==true){au.close()}},50)}};var av=function(ax){ax=window.event||ax;if(k.Browser.ie&&ax.button!=1||ax.button==2){if(au._isOpen==true){au.dispatchEvent(new ak("ondrawend"));au.close()}}};au._initArrays();if(this._opts.showResult){this._formatTitle()}j.show(this._map);this.setCursor(this._opts.cursor);k.on(j.getDom(this._map),"click",at);k.on(document,"mousemove",ar);k.on(j.getDom(this._map),"dblclick",e);k.on(document,"keydown",aw);k.on(j.getDom(this._map),"mouseup",av);this.bindFunc=[{elem:j.getDom(this._map),type:"click",func:at},{elem:j.getDom(this._map),type:"dblclick",func:e},{elem:document,type:"mousemove",func:ar},{elem:document,type:"keydown",func:aw},{elem:j.getDom(this._map),type:"mouseup",func:av}];return true},close:function(){if(this._isOpen==false){return}this._isOpen=false;this._map._toolInUse=false;if(this._mapMoving){delete this._mapMoving}var at=this;if(at._points.length<2){at._clearThis()}else{at._paths[at._paths.length-1].remove();at._paths[at._paths.length-1]=null;at._paths.length=at._paths.length-1;var au=at._points[at._points.length-1];if(au.disLabel){au.disLabel.remove()}at._processLastOp()}j.hide();for(var ar=0,e=this.bindFunc.length;ar<e;ar++){k.un(this.bindFunc[ar].elem,this.bindFunc[ar].type,this.bindFunc[ar].func)}if(at._movingTimerId){clearInterval(at._movingTimerId);at._movingTimerId=null}if(this.followTitle){this.followTitle.hide()}},_bind:function(){a.prototype._bind.call(this);var e=this;k.on(j.getDom(e._map),"mousedown",function(ar){if(e._map.config.enableKeyboard==true){e._map.temp.canKeyboard=true;al(ar)}})},_clearThis:function(){for(var ar=0,e=this._points.length;ar<e;ar++){if(this._points[ar].disLabel){this._points[ar].disLabel.remove()}}for(var ar=0,e=this._paths.length;ar<e;ar++){this._paths[ar].remove()}for(var ar=0,e=this._dots.length;ar<e;ar++){this._dots[ar].remove()}this._initArrays()},_initArrays:function(){this._points.length=0;this._paths.length=0;this._segDistance.length=0;this._dots.length=0},_updatePoi:function(ar,at){var e=this._points[this._points.length-1];this._drawing.setPolylinePoint(ar,[e,at])},_setSegDistance:function(at,ar){if(!at||!ar){return}var e=this._getDistance(at,ar);this._segDistance.push(e);return e},getTotalDistance:function(){var at=0;for(var ar=0,e=this._segDistance.length;ar<e;ar++){at+=this._segDistance[ar]}return at},_convertUnit:function(e,ar){ar=ar||"metric";if(this._units[ar]){return e*this._units[ar].conv}return e},_addSecPoint:function(at){var ar=new n(aj.imgPath+"mapctrls11.png",new z.Size(11,11),{imageOffset:new z.Size(-26,-313)});var e=new K(at,{icon:ar,clickable:false,baseZIndex:3500000,zIndexFixed:true});e._stCode=this._opts.styleCodes.spCode;this._map.addOverlay(e);this._dots.push(e)},_formatDisStr:function(au){var ar=this._opts.unit;var at=this._units[ar].u1;var e=this._convertUnit(au,ar);if(e>this._units[ar].incon){e=e/this._units[ar].incon;at=this._units[ar].u2;e=e.toFixed(1)}else{e=e.toFixed(0)}return e+at},setLineColor:function(e){if(e&&typeof e=="string"){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 ar=0,e=this._overlays.length;ar<e;ar++){if(this._overlays[ar]&&this._overlays[ar].remove){this._overlays[ar].remove()}}this._overlays.length=0;for(var ar=0,e=this._dots.length;ar<e;ar++){if(this._dots[ar]&&this._dots[ar].parentNode){this._dots[ar].parentNode.removeChild(this._dots[ar])}}this._dots.length=0},setCursor:function(e){if(this._opts.showResult==true){j.setCursor("url("+this._dCursor+"), crosshair")}else{j.setCursor(this._opts.cursor)}},getCursor:function(){if(this._opts.showResult==true){return this._dCursor}var e=this._opts.cursor.match(/^url\((.+)\)(,.*)?/);if(e!=null){return e[1]}else{return this._opts.cursor}},showResult:function(e){this._opts.showResult=!!e},_formatSegLabel:function(e,at){var ar=e.getDom();ar.style.border="none";ar.style.padding="0";ar.innerHTML="<span class='BMap_diso'><span class='BMap_disi'>"+at+"</span></span>"},_processLastOp:function(){var av=this;delete av._bind.x;delete av._bind.y;delete av._bind.initX;delete av._bind.initY;if(av._paths.length>av._points.length-1){var at=av._paths.length-1;av._paths[at].remove();av._paths[at]=null;av._paths.length=at}if(!av._opts.showResult){return}var e=av._totalDis[av._points[0].getHashCode()]={};e.points=av._points.slice(0);e.paths=av._paths.slice(0);e.dots=av._dots.slice(0);e.segDis=av._segDistance.slice(0);var aw=av._map.pointToPixel(e.points[e.points.length-1]);var au=av._map.pointToPixel(e.points[e.points.length-2]);var ax=[0,0];var ar=[0,0];if(aw.y-au.y>=0){ar=[-5,11]}else{ar=[-5,-35]}if(aw.x-au.x>=0){ax=[14,0]}else{ax=[-14,0]}var aA=e.points[e.points.length-1];aA.disLabel=new R("",{offset:new z.Size(-15,-40)});aA.disLabel.setStyles({color:"#333",borderColor:"#ff0103"});aA.disLabel._stCode=av._opts.styleCodes.tlCode;av._map.addOverlay(aA.disLabel);aA.disLabel.setOffset(new z.Size(ar[0],ar[1]));aA.disLabel.setPoint(aA);av._formatTitle(2,"","",aA.disLabel);var az=new n(aj.imgPath+"mapctrls.gif",new z.Size(12,12),{imageOffset:new z.Size(0,-14)});e.closeBtn=new K(e.points[e.points.length-1],{icon:az,offset:new z.Size(ax[0],ax[1]),baseZIndex:3600000});av._map.addOverlay(e.closeBtn);e.closeBtn.getDom().title="\u6e05\u9664\u672c\u6b21\u6d4b\u8ddd";e.closeBtn.addEventListener("click",function(aE){var aC=e.points[0].getHashCode();for(var aD=0,aB=e.points.length;aD<aB;aD++){e.points[aD].disLabel.remove();e.points[aD].disLabel=null}for(var aD=0,aB=e.paths.length;aD<aB;aD++){e.paths[aD].remove();e.paths[aD]=null}for(var aD=0,aB=e.dots.length;aD<aB;aD++){e.dots[aD].remove();e.dots[aD]=null}e.closeBtn.remove();e.closeBtn=null;delete av._totalDis[aC];al(aE)});var ay=e.dots[e.dots.length-1];if(ay&&ay._bind!=true){ay._bind=true;ay.getDom().style.cursor="pointer";ay.addEventListener("click",function(aF){av.open();av._points=e.points.slice(0);av._paths=e.paths.slice(0);av._dots=e.dots.slice(0);av._segDistance=e.segDis.slice(0,e.points.length-1);var aG=av._points[av._points.length-1];var aE=new C([aG,aG]);aE._stCode=av._opts.styleCodes.lnCode;av._map.addOverlay(aE);av._paths.push(aE);av._overlays.push(aE);aE.setStrokeWeight(av._dLineStroke);aE.setStrokeColor(av._dLineColor);aE.setStrokeOpacity(av._dOpacity/2);aE.setStrokeStyle(av._dLineStyle);var aH=av._map.pointToPixel(av._points[av._points.length-1]);av._formatTitle(1,av._followTextM,av.getTotalDistance());e.closeBtn.remove();e.points[e.points.length-1].disLabel.remove();var aC=av.getTotalDistance();var aD=av._formatDisStr(aC);var aB=new R(aD,{offset:new z.Size(10,-5)});aB.setStyles({color:"#333",borderColor:"#ff0103"});aB._stCode=av._opts.styleCodes.slCode;av._map.addOverlay(aB);av._formatSegLabel(aB,aD);av._overlays.push(aB);e.points[e.points.length-1].disLabel=aB;aB.setPoint(aG);ay.removeEventListener("click",arguments.callee);ay._bind=false;ay.getDom().style.cursor=av._map.config.defaultCursor})}av._initArrays()},_formatTitle:function(au,aA,e,aw){var av=aw||this.followTitle;if(!av){return}var at=av.getDom();if(!at){return}k.ac(at,"BMap_disLabel");var aC=at.style;var aB=av.content;aC.zIndex="85";aC.padding="3px 5px";var ay=[];if(au==1){av.setOffset(0,25);var az=this._opts.unit;var ax=this._units[az].u1;var ar=this._convertUnit(e,az);if(ar>this._units[az].incon){ar=ar/this._units[az].incon;ax=this._units[az].u2;ar=ar.toFixed(1)}else{ar=ar.toFixed(0)}ay.push("<span>\u603b\u957f\uff1a<span class='BMap_disBoxDis'>"+ar+"</span>"+ax+"</span><br />");ay.push("<span style='color:#7a7a7a'>"+aA+"</span>")}else{if(au==2){var az=this._opts.unit;var ax=this._units[az].u1;var ar=this._convertUnit(this.getTotalDistance(),az);if(ar>this._units[az].incon){ar=ar/this._units[az].incon;ax=this._units[az].u2;ar=ar.toFixed(1)}else{ar=ar.toFixed(0)}ay.push("\u603b\u957f\uff1a<span class='BMap_disBoxDis'>"+ar+"</span>"+ax);av.content="\u603b\u957f\uff1a"+ar+ax}else{av.setOffset(0,25);ay.push(aB)}}at.innerHTML=ay.join("")},_updateInstDis:function(at,e){var ar=this._opts.unit;var au=this._units[ar].u1;if(e>this._units[ar].incon){e=e/this._units[ar].incon;au=this._units[ar].u2;e=e.toFixed(1)}else{e=e.toFixed(0)}at.children[0].innerHTML="\u603b\u957f\uff1a<span class='BMap_disBoxDis'>"+e+"</span>"+au},_hideCurrent:function(){if(!this._isOpen){return}if(this._paths.length>0){var e=this._paths[this._paths.length-1];e.hide()}this.followTitle&&this.followTitle.hide()},_isPointValid:function(e){if(!e){return false}if(e.lng<N[this._map.mapType].bounds[0]||e.lng>N[this._map.mapType].bounds[2]||e.lat<N[this._map.mapType].bounds[1]||e.lat>N[this._map.mapType].bounds[3]){return false}return true},_getDistance:function(at,ar){var e=0;if(this._map.config.coordType==BMAP_COORD_LNGLAT){e=an.getDistanceByLL(at,ar)}else{e=an.getDistanceByMC(at,ar)}return e},toString:function(){return"DistanceTool"}});window.BMAP_ZOOM_IN=0;window.BMAP_ZOOM_OUT=1;function l(ar,e){a.call(this,ar);this._opts=k.extend(k.extend(this._opts,{zoomType:BMAP_ZOOM_IN,followText:"",strokeWeight:2,strokeColor:"#111",style:"solid",fillColor:"#ccc",opacity:0.4,cursor:"crosshair",autoClose:false}),e);this._opts.strokeWeight=this._opts.strokeWeight<=0?1:this._opts.strokeWeight;this._opts.opacity=this._opts.opacity<0?0:this._opts.opacity>1?1:this._opts.opacity;if(this._opts.zoomType<BMAP_ZOOM_IN||this._opts.zoomType>BMAP_ZOOM_OUT){this._opts.zoomType=BMAP_ZOOM_IN}this._isOpen=false;this._fDiv=null;this.followTitle=null}l.inherits(a,"DragAndZoomTool");k.extend(l.prototype,{open:function(){if(this._isOpen==true){return true}if(this._map._toolInUse){return false}this._map._toolInUse=true;this._isOpen=true;if(!this.binded){this._bind();this.binded=true}var at=this;var au=this._map;var ar=function(aw){aw=window.event||aw;if(aw.button!=0&&!k.Browser.ie||k.Browser.ie&&aw.button!=1){return}if(z.OperationMask.getDom(au).setCapture){z.OperationMask.getDom(au).setCapture()}if(!at._isOpen){return}at._bind.isZooming=true;k.on(document,"mousemove",e);k.on(document,"mouseup",av);at._bind.mx=aw.layerX||aw.offsetX||0;at._bind.my=aw.layerY||aw.offsetY||0;at._bind.ix=aw.pageX||aw.clientX||0;at._bind.iy=aw.pageY||aw.clientY||0;j.getDom(au).insertAdjacentHTML("beforeBegin",at._generateHTML());at._fDiv=j.getDom(au).previousSibling;at._fDiv.style.width="0";at._fDiv.style.height="0";at._fDiv.style.left=at._bind.mx+"px";at._fDiv.style.top=at._bind.my+"px";al(aw);return U(aw)};var e=function(aC){if(at._isOpen==true&&at._bind.isZooming==true){var aC=window.event||aC;var ay=aC.pageX||aC.clientX||0;var aw=aC.pageY||aC.clientY||0;var aA=at._bind.dx=ay-at._bind.ix;var ax=at._bind.dy=aw-at._bind.iy;var az=Math.abs(aA)-at._opts.strokeWeight;var aB=Math.abs(ax)-at._opts.strokeWeight;at._fDiv.style.width=(az<0?0:az)+"px";at._fDiv.style.height=(aB<0?0:aB)+"px";if(aA>=0){at._fDiv.style.right="auto";at._fDiv.style.left=at._bind.mx+"px";if(at._bind.mx+aA>=au.width-2*at._opts.strokeWeight){at._fDiv.style.width=au.width-at._bind.mx-2*at._opts.strokeWeight+"px";at.followTitle&&at.followTitle.hide()}}else{at._fDiv.style.left="auto";at._fDiv.style.right=au.width-at._bind.mx+"px";if(at._bind.mx+aA<=2*at._opts.strokeWeight){at._fDiv.style.width=at._bind.mx-2*at._opts.strokeWeight+"px";at.followTitle&&at.followTitle.hide()}}if(ax>=0){at._fDiv.style.bottom="auto";at._fDiv.style.top=at._bind.my+"px";if(at._bind.my+ax>=au.height-2*at._opts.strokeWeight){at._fDiv.style.height=au.height-at._bind.my-2*at._opts.strokeWeight+"px";at.followTitle&&at.followTitle.hide()}}else{at._fDiv.style.top="auto";at._fDiv.style.bottom=au.height-at._bind.my+"px";if(at._bind.my+ax<=2*at._opts.strokeWeight){at._fDiv.style.height=at._bind.my-2*at._opts.strokeWeight+"px";at.followTitle&&at.followTitle.hide()}}al(aC);return U(aC)}};var av=function(aD){if(at._isOpen==true){k.un(document,"mousemove",e);k.un(document,"mouseup",av);if(z.OperationMask.getDom(au).releaseCapture){z.OperationMask.getDom(au).releaseCapture()}var az=parseInt(at._fDiv.style.left)+parseInt(at._fDiv.style.width)/2;var ay=parseInt(at._fDiv.style.top)+parseInt(at._fDiv.style.height)/2;if(isNaN(az)){az=at._map.width-parseInt(at._fDiv.style.right)-parseInt(at._fDiv.style.width)/2}if(isNaN(ay)){ay=at._map.height-parseInt(at._fDiv.style.bottom)-parseInt(at._fDiv.style.height)/2}var aE=Math.min(au.width/Math.abs(at._bind.dx),au.height/Math.abs(at._bind.dy));aE=Math.floor(aE);var aB=new s(az-parseInt(at._fDiv.style.width)/2,ay-parseInt(at._fDiv.style.height)/2);var aA=new s(az+parseInt(at._fDiv.style.width)/2,ay+parseInt(at._fDiv.style.height)/2);var aH=at._map.pixelToPoint(aB);var aG=at._map.pixelToPoint(aA);var aC=new m(aH.lng,aG.lat,aG.lng,aH.lat);delete at._bind.dx;delete at._bind.dy;delete at._bind.ix;delete at._bind.iy;if(!isNaN(aE)){var aI=at._map.getZoomUnits(at._map.getZoom());if(at._opts.zoomType==BMAP_ZOOM_IN){targetZoomLv=Math.round(au.getZoom()+(Math.log(aE)/Math.log(2)));if(targetZoomLv<au.getZoom()){targetZoomLv=au.getZoom()}}else{targetZoomLv=Math.round(au.getZoom()+(Math.log(1/aE)/Math.log(2)));if(targetZoomLv>au.getZoom()){targetZoomLv=au.getZoom()}}}else{targetZoomLv=at._map.getZoom()+(at._opts.zoomType==BMAP_ZOOM_IN?1:-1)}var ax=at._map.pixelToPoint({x:az,y:ay},at._map.getZoom());at._map.centerAndZoom(ax,targetZoomLv);var aJ=j.getDrawPoint(aD);if(at.followTitle){at.followTitle.setPoint(aJ);at.followTitle.show()}at._bind.isZooming=false;at._fDiv.parentNode.removeChild(at._fDiv);at._fDiv=null}var aw=new ak("ondrawend");aw.bounds=aC;at.dispatchEvent(aw);var aF=new J(new D(aC.minX,aC.minY),new D(aC.maxX,aC.maxY));aF.setStrokeWeight(2);aF.setStrokeColor("#111");aF.setStrokeOpacity(0.3);aF.setFillColor("");au.addOverlay(aF);new A({duration:240,fps:20,delay:1000,render:function(aL){var aK=0.3*(1-aL);aF.setStrokeOpacity(aK)},finish:function(){aF.remove();aF.dispose();aF=null}});if(at._opts.autoClose){setTimeout(function(){if(at._isOpen==true){at.close()}},70)}al(aD);return U(aD)};j.show(this._map);this.setCursor(this._opts.cursor);if(!this._bind[this.hashCode]){k.on(j.getDom(this._map),"mousedown",ar);this._bind[this.hashCode]=true}return true},close:function(){if(!this._isOpen){return}this._map._toolInUse=false;this._isOpen=false;if(this.followTitle){this.followTitle.hide()}j.hide()},_generateHTML:function(){return["<div style='position:absolute;z-index:300;border:",this._opts.strokeWeight,"px ",this._opts.style," ",this._opts.strokeColor,"; opacity:",this._opts.opacity,"; background: ",this._opts.fillColor,"; filter:alpha(opacity=",Math.round(this._opts.opacity*100),"); width:0; height:0; font-size:0'></div>"].join("")},setStrokeColor:function(e){if(typeof e=="string"){this._opts.strokeColor=e;this._updateStyle()}},setLineStroke:function(e){if(typeof e=="number"&&Math.round(e)>0){this._opts.strokeWeight=Math.round(e);this._updateStyle()}},setLineStyle:function(e){if(e=="solid"||e=="dashed"){this._opts.style=e;this._updateStyle()}},setOpacity:function(e){if(typeof e=="number"&&e>=0&&e<=1){this._opts.opacity=e;this._updateStyle()}},setLineStyle:function(e){if(e=="solid"||e=="dashed"){this._opts.style=e;this._updateStyle()}},setFillColor:function(e){this._opts.fillColor=e;this._updateStyle()},_updateStyle:function(){if(this._fDiv!=null){this._fDiv.style.border=[this._opts.strokeWeight,"px ",this._opts.style," ",this._opts.color].join("");this._fDiv.style.opacity=this._opts.opacity;this._fDiv.style.filter="alpha(opacity="+Math.round(opacity*100)+")"}},setCursor:function(e){this._opts.cursor=e;j.setCursor(this._opts.cursor)},getCursor:function(){return this._opts.cursor},toString:function(){return"DragAndZoomTool"}});function i(){}function ab(ar,e,au){var at=document.createElement("div");if(ar>0){aa(at).position=(ar==2)?"relative":"absolute"}if(e){ai(at,e)}if(au){b(at,au)}return at}function aa(e){return e.style}function b(e,ar){aa(e).zIndex=ar}function ai(ar,e){aa(ar).left=ae(e[0]);aa(ar).top=ae(e[1])}function ad(at,ar){var e=aa(at);e.opacity=ar;e.MozOpacity=ar;e.KhtmlOpacity=ar;e.filter="alpha(opacity="+(ar*100)+")";e=null}function ae(at){if(typeof at=="number"){return at+"px"}else{if(typeof at=="string"){var ar=/"\\s","g"/;var au=/"^\\d+(px|%)+$","i"/;var e=at.replace(ar,"");if(au.exec(e)){return e}var av=new RegExp("^\\d+$");if(av.exec(e)){return e+"px"}return"0px"}}}function T(e){if(k.Browser.ie>0){e.unselectable="on";e.selectstart=function(){return false}}else{aa(e).MozUserSelect="none"}}function Y(ar,e){aa(ar).width=ae(e[0]);aa(ar).height=ae(e[1])}function W(at){var ar=[at.offsetWidth,at.offsetHeight];if(at==document.body&&!document.all){ar[1]=at.clientHeight}if(!ar[0]){ar[0]=at.clientWidth}if(!ar[0]){ar[0]=parseInt(aa(at).width)}if(!ar[1]){ar[1]=at.clientHeight}if(!ar[1]){ar[1]=parseInt(aa(at).height)}if(!ar[0]||!ar[1]){var e=at.parentElement;while(e){if(!ar[0]&&e.offsetWidth){ar[0]=e.offsetWidth}if(!ar[1]&&e.offsetHeight){ar[1]=e.offsetHeight}if(ar[0]&&ar[1]){break}e=e.parentElement}}return ar}function G(e){return e.parentNode&&e.parentNode.nodeType!=11}function V(ar,e){ar.insertAdjacentHTML("beforeEnd",e);return ar.lastChild}function I(e,ar){if(e.lng<ar.minX||e.lng>ar.maxX||e.lat<ar.minY||e.lat>ar.maxY){return false}else{return true}}function al(ar){var ar=window.event||ar;ar.stopPropagation?ar.stopPropagation():ar.cancelBubble=true}function U(ar){var ar=window.event||ar;ar.preventDefault?ar.preventDefault():ar.returnValue=false;return false}function P(aw,au){aw=aw||window.event;var ar=aw.clientX||aw.pageX;var ay=aw.clientY||aw.pageY;var at=aw.target||aw.srcElement;if(aw&&au&&ar&&ay&&at&&k.I(at.hashCode)){var av=k.I(at.hashCode).map;var ax=k.Dom.getOffset(av.container);au.pixel=new s(ar-ax.left,ay-ax.top);au.point=av.pixelToPoint(au.pixel);return au}else{return au}}function o(au){au=au||window.event;if(au&&au.clientX&&au.clientY&&au.target&&k.I(au.target.hashCode)){var at=k.I(au.target.hashCode).map;var av=k.Dom.getOffset(at.container);var ar=au.clientX||au.x;var aw=au.clientY||au.y;au.pixel=new s(ar-av.left,aw-av.top);au.point=at.pixelToPoint(au.pixel);return au}else{return au}}function X(at,e){if(document.createEvent){var ar=document.createEvent("MouseEvents");ar.initEvent(e,true,false);at.dispatchEvent(ar)}else{if(document.createEventObject){at.fireEvent("on"+e)}}}function B(){var e=document.documentElement,ar=document.body;if(e&&(e.scrollTop||e.scrollLeft)){return[e.scrollTop,e.scrollLeft]}else{if(ar){return[ar.scrollTop,ar.scrollLeft]}else{return[0,0]}}}function O(au){var ar=au.attributes,at,e,av;if(ar){e=ar.length;for(at=0;at<e;at+=1){av=ar[at].name;if(typeof au[av]==="function"){au[av]=null}}}ar=au.childNodes;if(ar){e=ar.length;for(at=0;at<e;at+=1){O(au.childNodes[at])}}}function ah(e){this._container=null;this._map=e}z.register(function(ar){if(ar.config&&ar.config.isOverviewMap){return}var e=new ah(ar);ar.container.insertAdjacentHTML("beforeEnd",e.render());e._container=ar.container.lastChild;ar.addEventListener("onmousewheel",function(at){e.action(at,ar)})});ah.prototype.render=function(){var e=['<div id=zoomer style="position:absolute; z-index:0; top:0px; left:0px;overflow:hidden; visibility: hidden;cursor:'+aj.defaultCursor+'">'];e.push('<div class="BMap_zoomer" style="top:0;left:0;"></div>');e.push('<div class="BMap_zoomer" style="top:0;right:0;"></div>');e.push('<div class="BMap_zoomer" style="bottom:0;left:0;"></div>');e.push('<div class="BMap_zoomer" style="bottom:0;right:0;"></div>');e.push("</div>");return e.join("")};ah.prototype.action=function(aB){if(ah._timeline){return}var az=this._container;if(!az){return}var at=aB.currentTarget;var aI=aB.trend;if(aB.oldZoomLevel==at.zoomLevel||at.lastLevel==N[at.mapType].zoomLevelMin&&!aI||at.lastLevel==N[at.mapType].zoomLevelMax&&aI){return}var av=at.config.zoomerSizeMin||60;var aH=at.config.zoomerSizeMax||120;var aC=at.width/at.height;var aA=aC>=1;var ax=Math.ceil((aI?av:aH)/2);var ay=Math.max(15,(aA?ax/aC:ax*aC));az.style[(aA?"width":"height")]=ax*2+"px";az.style[(aA?"height":"width")]=ay*2+"px";az.style.visibility="visible";var aE=az.children;if(aI){aE[0].style.backgroundPosition="0 0";aE[1].style.backgroundPosition="-7px 0";aE[2].style.backgroundPosition="0 -7px";aE[3].style.backgroundPosition="-7px -7px"}else{aE[0].style.backgroundPosition="-7px -7px";aE[1].style.backgroundPosition="0 -7px";aE[2].style.backgroundPosition="-7px 0";aE[3].style.backgroundPosition="0 0"}aE=null;var aG=aB.offsetX-(aA?ax:ay);var aF=aB.offsetY-(aA?ay:ax);if(isNaN(aG)||isNaN(aF)){return}az.style.left=aG+"px";az.style.top=aF+"px";var au=Math.ceil((aI?aH:av)/2);var aw=Math.max(15,(aA?au/aC:au*aC));au=au-ax;aw=Math.ceil(aw-ay);var aD=this;var ar=aD._container.style;if(ah._timeline){ah._timeline.end()}ah._timeline=new A({fps:20,duration:aD._map.config.zoomerDuration,transition:p.easeInQuad,delay:100,render:function(aJ){if(aJ<0.1){return}var aK=Math.ceil(au*aJ);var e=Math.ceil(aw*aJ);ar[aA?"width":"height"]=(ax+aK)*2+"px";ar[aA?"height":"width"]=(ay+e)*2+"px";ar[aA?"left":"top"]=((aA?aG:aF)-aK)+"px";ar[aA?"top":"left"]=((aA?aF:aG)-e)+"px"},finish:function(){ah._timeline=false;setTimeout(function(){az.style.visibility="hidden"},300)}})};window.BMap=z;z.Map=x;z.MapType=N;z.Point=D;z.Pixel=s;z.Size=f;z.Bounds=m;z.TileLayer=v;z.Copyright=ac;z.Project=an;z.Overlay=ag;z.Draw=af;z.Label=R;z.Marker=K;z.Icon=n;z.Polyline=C;z.Polygon=y;z.Rect=J;z.InfoWindow=Q;z.Oval=ap;z.Control=E;z.NavigationControl=Z;z.OverviewMapControl=ao;z.CopyrightControl=u;z.ScaleControl=F;z.PushpinTool=aq;z.DistanceTool=t;z.DragAndZoomTool=l;z.ContextMenu=M;z.MenuItem=L;z.OperationMask=j;z.Util=i;z.register(function(e){if(e.config&&e.config.isOverviewMap){return}e.addEventListener("load",function(){if(e.temp.copyadded){return}e.temp.copyadded=true;var at=new u({offset:new f(81,2),printable:true});at.addCopyright({content:"&copy; 2015 Baidu",id:1});e.addControl(at);var ar=new r();ar._opts.printable=true;e.addControl(ar)})});function r(e){this.defaultAnchor=BMAP_ANCHOR_BOTTOM_LEFT;this.defaultOffset=new f(1,0);this.IMG_URL=aj.imgPath+"copyright_logo.png"}r.prototype=new E();r.prototype.initialize=function(at){this._map=at;var au=document.createElement("div");au.style.height="32px";var e=this._link=document.createElement("a");e.title="\u5230\u767e\u5ea6\u5730\u56fe\u9996\u9875";e.target="_blank";e.href="http://map.baidu.com/?sr=1";e.style.outline="none";if(k.Browser.ie==6){e.innerHTML="<div style='cursor:pointer;width:77px;height:32px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+this.IMG_URL+")'></div>"}else{e.innerHTML="<img style='border:none;width:77px;height:32px' src='"+this.IMG_URL+"' />"}var ar=this;au.appendChild(e);at.getContainer().appendChild(au);return au};z.register(function(ar){if(ar.config&&ar.config.isOverviewMap){return}ar.addEventListener("mousemove",function(aD){if(ar.temp.spottimer){clearTimeout(ar.temp.spottimer);ar.temp.spottimer=null}if(ar.spotsPool&&!(ar.currentOperation&g.drag)){var at=ar.temp.curSpots.slice(0);ar.temp.curSpots=[];for(var au in ar.spotsPool){var aC=ar.spotsPool[au];for(var aA=0,ax=aC.length;aA<ax;aA++){var aE=aC[aA];if(aE.lr&&(ar.getZoom()<aE.lr[0]||ar.getZoom()>aE.lr[1])){continue}var av=ar.pointToPixel(aE.pt);if(av.x<ar.width&&av.y<ar.height){if((aD.offsetX-av.x<aE.bd[2]&&aD.offsetX-av.x>aE.bd[0])&&(av.y-aD.offsetY<aE.bd[3]&&av.y-aD.offsetY>aE.bd[1])){ar.platform.style.cursor="pointer";ar.temp.curSpots.push(aE)}}}}var aF=ar.temp.curSpots.slice(0);for(var aA=0,ax=at.length;aA<ax;aA++){for(var az=0,ay=0,aw=ar.temp.curSpots.length;az<aw;az++,ay++){if(at[aA]===ar.temp.curSpots[az]){at.splice(aA,1);aA--;aF.splice(ay,1);ay--}}}if(at.length>0){var aB=new ak("onspotmouseout");aB.spots=at.slice(0);ar.dispatchEvent(aB)}if(ar.temp.curSpots.length==0){if(ar.platform.style.cursor!=ar.config.defaultCursor){ar.platform.style.cursor=ar.config.defaultCursor}}else{if(aF.length>0){var aB=new ak("onspotmouseover");aB.spots=aF.slice(0);ar.dispatchEvent(aB)}}}});function e(){ar.temp.curSpots=[];ar.platform.style.cursor=ar.config.defaultCursor}ar.addEventListener("load",e);ar.addEventListener("moveend",e);ar.addEventListener("zoomend",e)});window._addStat=function(f,e){if(!f){return}e=e||{};var d="";for(var b in e){d=d+"&"+b+"="+encodeURIComponent(e[b])}var g=function(h){if(!h){return}_addStat._sending=true;setTimeout(function(){_addStat._img.src="http://api.map.baidu.com/images/blank.gif?"+h.src},50)};var a=function(){var h=_addStat._reqQueue.shift();if(h){g(h)}};var c=(Math.random()*100000000).toFixed(0);if(_addStat._sending){_addStat._reqQueue.push({src:"t="+c+"&code="+f+d})}else{g({src:"t="+c+"&code="+f+d})}if(!_addStat._binded){k.on(_addStat._img,"load",function(){_addStat._sending=false;a()});k.on(_addStat._img,"error",function(){_addStat._sending=false;a()});_addStat._binded=true}};window._addStat._reqQueue=[];window._addStat._img=new Image();var STAT_JS_EXECUTE=5000;_addStat(STAT_JS_EXECUTE,{v:"1.0"});})();
console.log(123);(function(){var baidu=baidu||{version:"1-1-0"};baidu.event=baidu.event||{};baidu.event._unload=function(){var c=baidu.event._listeners,a=c.length,b=!!window.removeEventListener,e,d;while(a--){e=c[a];d=e[0];if(d.removeEventListener){d.removeEventListener(e[1],e[3],false)}else{if(d.detachEvent){d.detachEvent("on"+e[1],e[3])}}}if(b){window.removeEventListener("unload",baidu.event._unload,false)}else{window.detachEvent("onunload",baidu.event._unload)}};if(window.attachEvent){window.attachEvent("onunload",baidu.event._unload)}else{window.addEventListener("unload",baidu.event._unload,false)}baidu.event._listeners=baidu.event._listeners||[];baidu.event.un=function(c,d,f){if("string"==typeof c){c=baidu.dom.g(c)}d=d.replace(/^on/i,"");var b=baidu.event._listeners,a=b.length,g=!f,e;while(a--){e=b[a];if(e[1]===d&&e[0]===c&&(g||e[2]===f)){if(c.detachEvent){c.detachEvent("on"+d,e[3])}else{if(c.removeEventListener){c.removeEventListener(d,e[3],false)}}b.splice(a,1)}}return c};baidu.un=baidu.event.un;baidu.array=baidu.array||{};baidu.string=baidu.string||{};baidu.string.trim=function(a){return String(a).replace(new RegExp("(^[\\s\\t\\xa0\\u3000]+)|([\\u3000\\xa0\\s\\t]+\x24)","g"),"")};baidu.trim=baidu.string.trim;baidu.object=baidu.object||{};baidu.object.extend=function(c,a){for(var b in a){if(a.hasOwnProperty(b)){c[b]=a[b]}}};baidu.extend=baidu.object.extend;baidu.event.on=function(b,d,e){d=d.replace(/^on/i,"");if("string"==typeof b){b=baidu.dom.g(b)}var c=function(f){e.call(b,f)},a=baidu.event._listeners;a[a.length]=[b,d,e,c];if(b.attachEvent){b.attachEvent("on"+d,c)}else{if(b.addEventListener){b.addEventListener(d,c,false)}}return b};baidu.on=baidu.event.on;baidu.lang=baidu.lang||{};baidu.lang._instances=baidu.lang._instances||{};baidu.lang.instance=function(a){return baidu.lang._instances[a]||null};baidu.lang.inherits=function(g,e,d){var c,f,a=g.prototype,b=new Function();b.prototype=e.prototype;f=g.prototype=new b();for(c in a){f[c]=a[c]}g.prototype.constructor=g;g.superClass=e.prototype;if("string"==typeof d){f._className=d}};baidu.inherits=baidu.lang.inherits;baidu.dom=baidu.dom||{};baidu.dom.g=function(a){if("string"==typeof a||a instanceof String){return document.getElementById(a)}else{if(a&&a.nodeName&&(a.nodeType==1||a.nodeType==9)){return a}}return null};baidu.g=baidu.G=baidu.dom.g;baidu.lang._insCounter=baidu.lang._insCounter||1;baidu.lang.Class=function(a){this.guid=a||baidu.lang.Class.guid();baidu.lang._instances[this.guid]=this};baidu.lang.Class.guid=function(){return"TANGRAM__"+(baidu.lang._insCounter++).toString(36)};baidu.lang.Class.create=function(b){var d=new baidu.lang.Class();for(var a in b){d[a]=b[a]}return d};baidu.lang.Class.prototype.dispose=function(){if(this.guid){delete baidu.lang._instances[this.guid]}for(var a in this){if(typeof this[a]!="function"){delete this[a]}}};baidu.lang.Class.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"};var CITY_TYPE_PROV=1;var CITY_TYPE_CITY=2;var CITY_TYPE_DIST=3;var RED_ICON_SIZE=new BMap.Size(23,25);var RED_ICON_OFFSET=new BMap.Size(9,25);var RED_ICON_INFOWND_OFFSET=new BMap.Size(9,0);function addSearchPoi(map,point,index,title,coordType){var pt=getPoiPoint(point,map.config.coordType,coordType);if(!pt){return}if(index<0||index>9){return}var ico=new BMap.Icon(API_URL+"img/markers.png",RED_ICON_SIZE,{offset:RED_ICON_OFFSET,imageOffset:new BMap.Size(0,-25*index),infoWindowOffset:RED_ICON_INFOWND_OFFSET});var mkr=new BMap.Marker(pt,{icon:ico});map.addOverlay(mkr);if(title){mkr.setTitle(title)}return mkr}function addCenterPoi(map,point,title,coordType){var pt=getPoiPoint(point,map.config.coordType,coordType);if(!pt){return}var ico=new BMap.Icon(API_URL+"img/markers.png",RED_ICON_SIZE,{offset:RED_ICON_OFFSET,imageOffset:new BMap.Size(0,-250),infoWindowOffset:RED_ICON_INFOWND_OFFSET});var mkr=new BMap.Marker(pt,{icon:ico});map.addOverlay(mkr);if(title){mkr.setTitle(title)}return mkr}function addSearchInBoundsPoi(map,point,title,coordType){var pt=getPoiPoint(point,map.config.coordType,coordType);if(!pt){return}var ico=new BMap.Icon(API_URL+"img/markers.png",RED_ICON_SIZE,{offset:RED_ICON_OFFSET,imageOffset:new BMap.Size(0,-300),infoWindowOffset:RED_ICON_INFOWND_OFFSET});var mkr=new BMap.Marker(pt,{icon:ico});map.addOverlay(mkr);if(title){mkr.setTitle(title)}return mkr}function getPoiPoint(point,mapCoordType,searchCoordType){var pts=[];var pt=null;if(point.toString()=="Point"){pt=point}else{if(typeof point=="string"){pts=baidu.trim(point).split(",");if(pts.length<2){return}pts[0]=parseFloat(baidu.trim(pts[0]));pts[1]=parseFloat(baidu.trim(pts[1]))}else{pts=point.slice(0);if(pts.length<2){return}}pt=new BMap.Point(pts[0],pts[1])}pt=convertCoord(pt,searchCoordType,mapCoordType);return pt}window.BMAP_POI_TYPE_NORMAL=0;window.BMAP_POI_TYPE_BUSSTOP=1;window.BMAP_POI_TYPE_BUSLINE=2;window.BMAP_POI_TYPE_SUBSTOP=3;window.BMAP_POI_TYPE_SUBLINE=4;function createSearchInfoWnd(contents,opts){var title=contents.title;var addr=contents.addr;var tel=contents.tel;var uid=contents.uid||"";var url=contents.url;var poiType=contents.poiType||BMAP_POI_TYPE_NORMAL;opts=opts||{};if(!title){return null}var ntitle=title;if(poiType==BMAP_POI_TYPE_BUSSTOP){ntitle=ntitle+"-\u516c\u4ea4\u8f66\u7ad9"}else{if(poiType==BMAP_POI_TYPE_SUBSTOP){ntitle=ntitle+"-\u5730\u94c1\u7ad9"}}if(ntitle.replace(/[\u0100-\uffff]/g,"##").length>27){ntitle=ntitle.substring(0,13)+"&#8230"}var thtml="<p style='width:210px;font-family:arial,simsun,sans-serif;line-height:16px;margin:0;font-size:14px;color:#cc5522;font-weight:bold;white-space:nowrap;overflow:hidden' title='"+title+"'>"+ntitle+"</p>";var htmls=[];htmls.push("<div style='font:12px arial,sans-serif' >");if(addr){var addrTitle="\u5730\u5740\uff1a";if(poiType==BMAP_POI_TYPE_BUSSTOP||poiType==BMAP_POI_TYPE_SUBSTOP){addrTitle="\u8f66\u6b21\uff1a"}htmls.push('<table cellspacing="0" style="table-layout:fixed;width:100%;font:12px arial,simsun,sans-serif" >');htmls.push('<tr><td style="vertical-align:top;width:38px;white-space:nowrap;word-break:keep-all">'+addrTitle+"&nbsp;</td><td>");htmls.push(addr+"&nbsp;</td></tr>");if(tel){htmls.push("<tr><td>\u7535\u8bdd\uff1a</td><td>"+tel+"</td></tr>")}htmls.push("</table>")}else{if(tel){htmls.push('<table cellspacing="0" style="table-layout:fixed;width:100%;font:12px arial,simsun,sans-serif">');htmls.push('<tr><td style="vertical-align:top;width:36px;white-space:nowrap;word-break:keep-all">\u7535\u8bdd\uff1a</td><td>'+tel+"</td></tr></table>")}}htmls.push("</div>");var iw=new BMap.InfoWindow(htmls.join(""),{title:thtml,height:0,width:230,margin:[10,10,20,10]});return iw}var DEST_START=0;var DEST_END=1;function addDestPoi(map,point,title,type,coordType){var pt=getPoiPoint(point,map.config.coordType,coordType);if(!pt){return}var ico=new BMap.Icon(API_URL+"img/dest_markers.png",new BMap.Size(42,34),{offset:new BMap.Size(14,32),imageOffset:new BMap.Size(0,-34*type),infoWindowOffset:new BMap.Size(14,0)});var mkr=new BMap.Marker(pt,{icon:ico,baseZIndex:3500000});map.addOverlay(mkr);if(title){mkr.setTitle(title)}return mkr}var ROUTE_TYPE_DEFAULT=0;var ROUTE_TYPE_TRANSIT=1;function addLine(map,points,coordType){return addRoute(map,points,ROUTE_TYPE_TRANSIT,coordType)}function addRoute(map,points,type,coordType){var config=[{stroke:6,color:"#0030ff",opacity:0.45},{stroke:6,color:"#0030ff",opacity:0.45},{stroke:4,color:"#30a208",opacity:0.55},{stroke:5,color:"#0030ff",opacity:0.45}];if(typeof type=="undefined"){type=0}if(!config[type]){return}var realPoints=[];var conf=config[type];if(map.config.coordType!=coordType){for(var i=0,l=points.length;i<l;i++){realPoints.push(convertCoord(points[i],coordType,map.config.coordType))}}else{realPoints=points}var p=new BMap.Polyline(realPoints,{strokeWeight:conf.stroke,strokeColor:conf.color,strokeOpacity:conf.opacity});map.addOverlay(p);p._routeType=type;if(type==ROUTE_TYPE_TRANSIT){var p2=new BMap.Polyline(realPoints,{strokeWeight:conf.stroke-2,strokeColor:"#fff",strokeOpacity:0.3});p._p=p2;map.addOverlay(p2)}return p}var TRANS_INFO_WND_TRANSIT=0;var TRANS_INFO_WND_DRIVING=1;var TRANS_INFO_WND_WALKING=2;function createTransInfoWnd(contents){var content=contents.content;var curIndex=contents.curIndex;var total=contents.total;var nextTransCbk=contents.nextTransCbk;var obj=contents.obj;var type=contents.type||TRANS_INFO_WND_TRANSIT;var htmls=["<div style='font:12px arial,simsun,sans-serif'>"];if(content){htmls.push("<div style='margin:0 1em 24px 0'>"+content+"</div>")}htmls.push('<table width="99%" cols="2" style="background:#eaf2ff;font:12px arial,simsun,sans-serif"><tbody><tr>');htmls.push('<td nowrap="nowrap" width="50%" align="left">');if(curIndex==0){htmls.push('<span unselectable="on" style="color:#9c9d99;-moz-user-select:none" >\u4e0a\u4e00\u6b65</span>')}else{htmls.push('<a id="trans_prev" style="color:#7777cc;-moz-user-select:none" href="javascript:void(0)">\u4e0a\u4e00\u6b65</a>')}htmls.push("</td>");htmls.push('<td nowrap="nowrap" width="50%" align="right">');if(curIndex==total+1){htmls.push('<span unselectable="on" style="color:#9c9d99;-moz-user-select:none" >\u4e0b\u4e00\u6b65</span>')}else{htmls.push('<a style="color:#7777cc" id="trans_next" href="javascript:void(0)">\u4e0b\u4e00\u6b65</a>')}htmls.push("</td></tr></tbody></table>");var iw=new BMap.InfoWindow(htmls.join(""),{title:"",height:0,width:220,margin:[10,10,20,10]});iw.addEventListener("open",function(){if(baidu.G("trans_prev")){baidu.on(baidu.G("trans_prev"),"click",function(){if(nextTransCbk&&typeof nextTransCbk=="function"){nextTransCbk(curIndex-1,obj)}})}if(baidu.G("trans_next")){baidu.on(baidu.G("trans_next"),"click",function(){if(nextTransCbk&&typeof nextTransCbk=="function"){nextTransCbk(curIndex+1,obj)}})}});return iw}function addTransPoi(map,point,type,title,coordType){var pt=getPoiPoint(point,map.config.coordType,coordType);if(!pt){return}type=type||BMAP_LINE_TYPE_BUS;var offsetY=-55;if(type==BMAP_LINE_TYPE_SUBWAY){offsetY=-76}var ico=new BMap.Icon(API_URL+"img/trans_icons.png",new BMap.Size(21,21),{imageOffset:new BMap.Size(0,offsetY),infoWindowOffset:new BMap.Size(10,0)});var mkr=new BMap.Marker(pt,{icon:ico});map.addOverlay(mkr);if(title){mkr.setTitle(title)}return mkr}var DataMgr={RawDispatcher:{},REQ_BASE_URL:"http://api.map.baidu.com/",request:function(cbk,params,userData){var timeStamp=(Math.random()*100000).toFixed(0);DataMgr.RawDispatcher["_cbk"+timeStamp]=function(json){userData=userData||{};cbk&&cbk(json,userData);delete DataMgr.RawDispatcher["_cbk"+timeStamp]};var reqParam=jsonToQuery(params,encodeURIComponent);var me=this;var key=window._key||"";var script=create("script",{src:me.REQ_BASE_URL+"?"+reqParam+"&key="+key+"&ie=utf-8&oue=1&res=api&callback=BMap.DataMgr.RawDispatcher._cbk"+timeStamp});if(script.addEventListener){script.addEventListener("load",function(){script.parentNode.removeChild(script)},false)}else{if(script.attachEvent){script.attachEvent("onreadystatechange",function(e){var t=window.event.srcElement;if(t&&t.readyState=="loaded"){script.parentNode.removeChild(script)}})}}setTimeout(function(){document.getElementsByTagName("head")[0].appendChild(script)},1)}};mg("DataMgr",DataMgr);function BaseSearch(loc,opts){baidu.lang.Class.call(this);this._loc={};this.setLocation(loc);this._opts={coordType:BMAP_COORD_LNGLAT,renderOptions:{panel:null,map:null,autoViewport:true},onSearchComplete:function(){},onMarkersSet:function(){},onInfoHtmlSet:function(){},onResultsHtmlSet:function(){}};baidu.extend(this._opts,opts);this._opts.renderOptions.autoViewport=!!this._opts.renderOptions.autoViewport;this._opts.renderOptions.panel=baidu.G(this._opts.renderOptions.panel);this._setCoordType(this._opts.coordType)}baidu.inherits(BaseSearch,baidu.lang.Class);BaseSearch.CBK_SEARCH_COMPLETE=1;BaseSearch.CBK_MARKERS_SET=2;BaseSearch.CBK_INFO_HTML_SET=3;BaseSearch.CBK_POLYLINES_SET=4;BaseSearch.CBK_RESULTS_HTML_SET=5;BaseSearch._getPoiUrl=function(uid,ccode){return MAP_URL+"?s="+encodeURIComponent("inf&uid="+uid+"&c="+ccode)+"&i=0&sr=1"};BaseSearch._getLocType=function(loc){if(!loc){return LOC_TYPE_UNKNOWN}if(typeof loc=="string"){return LOC_TYPE_STRING}else{if(loc.constructor==BMap.Point){return LOC_TYPE_POINT}else{if(loc.constructor==BMap.Map){return LOC_TYPE_MAP}}}return LOC_TYPE_UNKNOWN};baidu.extend(BaseSearch.prototype,{getCoordType:function(){return this._opts.coordType},getResults:function(){return this._results},enableAutoViewport:function(){this._opts.renderOptions.autoViewport=true},disableAutoViewport:function(){this._opts.renderOptions.autoViewport=false},setLocation:function(loc){if(!loc){return}this._loc.src=loc},_getIdByLoc:function(loc,cbk){var locType=BaseSearch._getLocType(loc.src);if(locType==LOC_TYPE_UNKNOWN){return}var me=this;if(locType==LOC_TYPE_STRING){if(loc.curLocType==locType&&loc.curSrc==loc.src&&loc.curId){cbk&&cbk(loc.curId);return}loc.curLocType=locType;loc.curSrc=loc.src;DataMgr.request(function(json){if(json&&json.result&&json.result.type==RETURN_TYPE_CURRENT_CITY){me._loc.curId=json.content.code;cbk&&cbk(me._loc.curId)}},{qt:QUERY_TYPE_CURRENT_CITY,wd:loc.src})}else{var pt;var level=18;if(locType==LOC_TYPE_MAP){pt=loc.src.getCenter();level=loc.src.getZoom()}else{pt=loc.src}if(locType==loc.curLocType&&loc.curSrc.equals(pt)&&loc.curId){cbk&&cbk(loc.curId);return}if(locType==LOC_TYPE_MAP&&loc.src.config.coordType==BMAP_COORD_LNGLAT){pt=BMap.Project.convertLL2MC(pt)}if(locType==LOC_TYPE_POINT&&this._opts.coordType==BMAP_COORD_LNGLAT){pt=BMap.Project.convertLL2MC(pt)}loc.curLocType=locType;loc.curSrc=new BMap.Point(pt.lng,pt.lat);DataMgr.request(function(json){if(json&&json.result&&json.result.type==RETURN_TYPE_CENTER){me._loc.curId=json.content.uid;cbk&&cbk(me._loc.curId)}},{qt:QUERY_TYPE_CENTER,b:pt.lng+","+pt.lat+";"+pt.lng+","+pt.lat,l:level})}},setSearchCompleteCallback:function(cbk){this._opts.onSearchComplete=cbk||function(){}},setMarkersSetCallback:function(cbk){this._opts.onMarkersSet=cbk||function(){}},setInfoHtmlSetCallback:function(cbk){this._opts.onInfoHtmlSet=cbk||function(){}},setResultsHtmlSetCallback:function(cbk){this._opts.onResultsHtmlSet=cbk||function(){}},getStatus:function(){return this._status},_setStatus:function(code){if(typeof code=="number"){this._status=code}else{delete this._status}},_setCoordType:function(type){if(type===BMAP_COORD_LNGLAT||type===BMAP_COORD_MERCATOR){this._opts.coordType=type}else{this._opts.coordType=BMAP_COORD_LNGLAT}},toString:function(){return"BaseSearch"},_triggerCbk:function(cbkCode,d0,d1){var cbk;switch(cbkCode){case BaseSearch.CBK_SEARCH_COMPLETE:cbk=this._opts.onSearchComplete;break;case BaseSearch.CBK_MARKERS_SET:cbk=this._opts.onMarkersSet;break;case BaseSearch.CBK_POLYLINES_SET:cbk=this._opts.onPolylinesSet;break;case BaseSearch.CBK_INFO_HTML_SET:cbk=this._opts.onInfoHtmlSet;break;case BaseSearch.CBK_RESULTS_HTML_SET:cbk=this._opts.onResultsHtmlSet;break;default:break}cbk&&cbk(d0,d1)}});var LocalSearch=function(loc,opts){BaseSearch.call(this,loc,opts);opts=opts||{};opts.renderOptions=opts.renderOptions||{};this.setPageCapacity(opts.pageCapacity);if(typeof opts.renderOptions.selectFirstResult!="undefined"&&!opts.renderOptions.selectFirstResult){this.disableFirstResultSelection()}else{this.enableFirstResultSelection()}this._overlays=[];this._curIndex=-1};baidu.inherits(LocalSearch,BaseSearch);LocalSearch.DEFAULT_PAGE_CAPACITY=10;LocalSearch.MIN_PAGE_CAPACITY=1;LocalSearch.MAX_PAGE_CAPACITY=50;LocalSearch.DEFAULT_RADIUS=2000;LocalSearch.MAX_RADIUS=5000;LocalSearch.isReqDataMap=function(qt,type){if(!qt||typeof type=="undefined"){return false}if(qt==QUERY_TYPE_POI_SEARCH&&type!=RETURN_TYPE_POI_SEARCH&&type!=RETURN_TYPE_CITY_LIST&&type!=RETURN_TYPE_CURRENT_CITY&&type!=RETURN_TYPE_SPECIAL_REGION&&type!=RETURN_TYPE_NODATA_REGION){return false}if(qt==QUERY_TYPE_SEARCH_NEARBY&&type!=RETURN_TYPE_SEARCH_NEARBY){return false}if(qt==QUERY_TYPE_SEARCH_INBOUNDS&&type!=RETURN_TYPE_SEARCH_INBOUNDS){return false}return true};baidu.extend(LocalSearch.prototype,{search:function(keyword){if(!keyword){this.clearResults();this._setStatus(BMAP_STATUS_INVALID_REQUEST);this._triggerCbk(BaseSearch.CBK_SEARCH_COMPLETE);return}var opts=arguments[1]||{};var me=this;this._getIdByLoc(this._loc,function(id){id=id||1;var _opts={qt:QUERY_TYPE_POI_SEARCH,c:id,wd:keyword,rn:me.getPageCapacity(QUERY_TYPE_POI_SEARCH)};baidu.extend(_opts,opts.params);var ud={params:_opts,userKw:opts.userKw||keyword};baidu.extend(ud,opts);DataMgr.request(function(json,userData){me._rawDataCbk(json,userData)},_opts,ud)})},searchInBounds:function(keyword,bounds){if(!keyword||!bounds){this.clearResults();this._setStatus(BMAP_STATUS_INVALID_REQUEST);this._triggerCbk(BaseSearch.CBK_SEARCH_COMPLETE);return}var me=this;var opts=arguments[2]||{};this._getIdByLoc(this._loc,function(id){id=id||1;var pt1=new BMap.Point(bounds.minX,bounds.minY);var pt2=new BMap.Point(bounds.maxX,bounds.maxY);if(me._opts.coordType==BMAP_COORD_LNGLAT){pt1=BMap.Project.convertLL2MC(pt1);pt2=BMap.Project.convertLL2MC(pt2)}var bdstr="("+pt1.lng+","+pt1.lat+";"+pt2.lng+","+pt2.lat+")";var _opts={qt:QUERY_TYPE_SEARCH_INBOUNDS,c:id,wd:keyword,ar:bdstr,rn:me._opts.pageCapacity,l:18};baidu.extend(_opts,opts.params);DataMgr.request(function(json,userData){me._rawDataCbk(json,userData)},_opts,{params:_opts,bounds:bounds,userKw:opts.userKw||keyword})})},searchNearby:function(keyword,center,radius){if(!keyword||!center||typeof center=="object"&&!center.uid){this.clearResults();this._setStatus(BMAP_STATUS_INVALID_REQUEST);this._triggerCbk(BaseSearch.CBK_SEARCH_COMPLETE);return}radius=radius||LocalSearch.DEFAULT_RADIUS;radius=radius<1?1:(radius>LocalSearch.MAX_RADIUS?LocalSearch.MAX_RADIUS:radius);var me=this;var opts=arguments[3]||{};this._getIdByLoc(this._loc,function(id){id=id||1;var _opts={qt:QUERY_TYPE_SEARCH_NEARBY,c:id,wd:keyword,rn:me.getPageCapacity(QUERY_TYPE_SEARCH_NEARBY),uid:center.uid,r:radius};if(typeof center=="string"){_opts.qt=QUERY_TYPE_POI_SEARCH;_opts.wd=center+" "+keyword;delete _opts.r;delete _opts.uid}baidu.extend(_opts,opts.params);DataMgr.request(function(json,userData){me._rawDataCbk(json,userData)},_opts,{params:_opts,center:center,radius:radius,userKw:opts.userKw||keyword})})},_rawDataCbk:function(json,userData){var me=this;this.clearResults();me._json=json;this._ud=userData;var r=json.result;var qt=userData.params.qt;if(r.error!=0||!LocalSearch.isReqDataMap(qt,r.type)){var cc=json.current_city;this._results=new LocalResult({keyword:userData.userKw,city:cc.name,ccode:cc.code,pc:me.getPageCapacity(userData.params.qt),center:userData.center,radius:userData.radius,bounds:userData.bounds});this._results._qt=userData.params.qt;this._setStatus(BMAP_STATUS_UNKNOWN_LOCATION);this._triggerCbk(BaseSearch.CBK_SEARCH_COMPLETE,this._results);this._renderList();return}me._processRaw(userData);me._renderMap();me._renderList();if(this._opts.renderOptions.selectFirstResult&&this._results&&this._results.getNumPois()>0){var me=this;setTimeout(function(){me._select(0)},240)}},_processRaw:function(userData){var r=this._json.result;var c=this._json.content;var cc=this._json.current_city;var type=r.type;var me=this;var pageNum=r.page_num||0;var total=0;var count=0;var results=[];var points=[];var cityList=[];var count,total;if(type!=RETURN_TYPE_CITY_LIST&&type!=RETURN_TYPE_SPECIAL_REGION){count=r.count-(pageNum==0?(r.spec_dispnum||0):0);total=r.total;var start=pageNum==0?(r.spec_dispnum||0):0;if(type!=RETURN_TYPE_CURRENT_CITY){for(var i=start;i<r.count;i++){if(c&&c[i]){var cur=c[i];var addr=this._formatAddr(cur.addr,cur.poiType);var poi={title:cur.name,uid:cur.uid,point:parseGeo(cur.geo,true,me._opts.coordType).point,url:BaseSearch._getPoiUrl(cur.uid,cc.code),address:addr,city:cc.name,phoneNumber:cur.tel,postcode:cur.zip,type:cur.poiType||BMAP_POI_TYPE_NORMAL};results.push(poi);points.push(poi.point)}}}else{count=total=1;var poi={title:c.cname,uid:c.uid,point:parseGeo(c.geo,true,me._opts.coordType).point,address:c.cname,url:MAP_URL+"?s="+encodeURIComponent("s&wd="+r.wd)};results.push(poi);points.push(poi.point)}}else{if(type==RETURN_TYPE_SPECIAL_REGION){count=total=1;var poi={title:r.wd,point:parseGeoStr(c[0],me._opts.coordType),url:MAP_URL+"?s="+encodeURIComponent("s&wd="+r.wd)};results.push(poi);points.push(poi.point)}if(type==RETURN_TYPE_CITY_LIST){count=total=0;for(var i=0;i<c.length;i++){cityList.push({city:c[i].name,_code:c[i].code,numResults:c[i].num})}if(this._json.more_city){var mc=this._json.more_city;for(var i=0,l=mc.length;i<l;i++){for(var j=0,ll=mc[i].city.length;j<ll;j++){var c=mc[i].city[j];cityList.push({city:c.name,_code:c.code,numResults:c.num})}}}}}this._results=new LocalResult({keyword:userData.userKw,count:count,total:total,pageIdx:r.page_num,city:cc.name,ccode:cc.code,pois:results,cityList:cityList,pc:me.getPageCapacity(userData.params.qt),center:userData.center,radius:userData.radius,bounds:userData.bounds});this._results._qt=userData.params.qt;if(total==0&&type!=RETURN_TYPE_CITY_LIST){this._setStatus(BMAP_STATUS_UNKNOWN_LOCATION)}else{if(type!=RETURN_TYPE_CITY_LIST){this._setStatus(BMAP_STATUS_SUCCESS)}else{this._setStatus(BMAP_STATUS_CITY_LIST)}}this._triggerCbk(BaseSearch.CBK_SEARCH_COMPLETE,this._results)},_formatAddr:function(addr,poiType){poiType=poiType||BMAP_POI_TYPE_NORMAL;if(poiType==BMAP_POI_TYPE_BUSSTOP||poiType==BMAP_POI_TYPE_SUBSTOP){return unique(addr.split(";")).join("; ")}return addr},_renderMap:function(){if(this._opts.renderOptions.map&&this._results&&this._results.getCurrentNumPois()>0){var me=this,map=this._opts.renderOptions.map,points=[];for(var i=0;i<this._results.getCurrentNumPois();i++){var cur=this._results.getPoi(i);points.push(cur.point);var mkr=this._addPoi(cur.point,i,cur.title);if(!mkr){continue}cur.marker=mkr;(function(){var index=i;mkr.addEventListener("click",function(){me._select(index)})})();this._overlays.push(mkr)}var center=this._results.center;if(center&&typeof center!="string"){var ctr=this._centerMkr=addCenterPoi(map,center.point,center.title,this._opts.coordType);ctr.addEventListener("click",function(){me._select(-1);me._curIndex="c";var iw=createSearchInfoWnd({title:center.title,addr:center.address,tel:center.phoneNumber,url:center.url,poiType:center.type});ctr.openInfoWindow(iw);me._triggerCbk(BaseSearch.CBK_INFO_HTML_SET,center,map.infoWindow.contentDiv.childNodes[0])})}var type=this._json.result&&this._json.result.type;var viewData={};switch(type){case RETURN_TYPE_POI_SEARCH:case RETURN_TYPE_SEARCH_NEARBY:case RETURN_TYPE_SEARCH_INBOUNDS:viewData.points=points;break;case RETURN_TYPE_CURRENT_CITY:viewData.center=this._results.getPoi(0).point;viewData.level=this._json.content.level;break;case RETURN_TYPE_NODATA_REGION:viewData.center=this._results.getPoi(0).point;viewData.level=13;break;case RETURN_TYPE_SPECIAL_REGION:viewData.center=this._results.getPoi(0).point;viewData.level=parseInt(this._json.content[1]);break;default:break}this._getBestViewport(viewData);this._triggerCbk(BaseSearch.CBK_MARKERS_SET,this._results._pois)}},_addPoi:function(pt,i,title){if(this._results.getCurrentNumPois()<=LocalSearch.DEFAULT_PAGE_CAPACITY){return addSearchPoi(this._opts.renderOptions.map,pt,i,title,this._opts.coordType)}else{return addSearchInBoundsPoi(this._opts.renderOptions.map,pt,title,this._opts.coordType)}},_select:function(index){var preIndex=this._curIndex;var map=this._opts.renderOptions.map;var panel=this._opts.renderOptions.panel;if(map&&index>-1&&this._overlays[index]){var mkr=this._overlays[index];map.closeInfoWindow();var cur=this._results.getPoi(index);var iw=createSearchInfoWnd({title:cur.title,addr:cur.address,tel:cur.phoneNumber,url:cur.url,poiType:cur.type});var me=this;iw.addEventListener("close",function(){if(panel){if(typeof me._curIndex=="number"&&me._curIndex!=-1&&panel.getElementsByTagName("li")[me._curIndex]){panel.getElementsByTagName("li")[me._curIndex].style.backgroundColor=""}}me._curIndex=-1});mkr.openInfoWindow(iw);this._triggerCbk(BaseSearch.CBK_INFO_HTML_SET,cur,map.infoWindow.contentDiv.childNodes[0])}if(panel){if(typeof preIndex=="number"&&preIndex!=-1&&panel.getElementsByTagName("li")[preIndex]){panel.getElementsByTagName("li")[preIndex].style.backgroundColor=""}if(typeof index=="number"&&index!=-1&&panel.getElementsByTagName("li")[index]){panel.getElementsByTagName("li")[index].style.backgroundColor="#f0f0f0"}}this._curIndex=index},_clearOverlays:function(){for(var i=0,l=this._overlays.length;i<l;i++){this._overlays[i].remove();this._overlays[i]=null}this._overlays.length=0;if(this._centerMkr){this._centerMkr.remove();this._centerMkr=null}},_renderList:function(){if(this._opts.renderOptions.panel&&this._opts.renderOptions.panel.appendChild&&this._results){var container=create("div",{style:"font-family:arial,sans-serif;border:1px solid #999;font-size:12px"});var status=this.getStatus();var resultsContainer=create("div",{style:"background:#fff"});var resultsList=create("ol",{style:"list-style:none;padding:0;margin:0"});if(status==BMAP_STATUS_SUCCESS){for(var i=0,l=this._results.getCurrentNumPois();i<l;i++){var item=this._createItem(i);resultsList.appendChild(item)}}if(status==BMAP_STATUS_CITY_LIST){for(var i=0,l=Math.min(6,this._results.getCityList().length);i<l;i++){var item=this._createCityItem(i);resultsList.appendChild(item)}}if(status==BMAP_STATUS_UNKNOWN_LOCATION){var item=create("li",{style:"margin:2px 0;padding:0 5px 0 3px;overflow:hidden;line-height:17px"});item.innerHTML="\u62b1\u6b49\uff0c\u672a\u627e\u5230\u76f8\u5173\u5730\u70b9\u3002";resultsList.appendChild(item)}resultsContainer.appendChild(resultsList);container.appendChild(resultsContainer);var me=this;var resultsControl=create("div",{style:"white-space:nowrap;text-align:right;background:#e5ecf9;margin-top:5px;padding:2px"});var moreUrl=create("a",{style:"color:#7777cc",href:this._results.moreResultsUrl,target:"_blank",title:"\u5230\u767e\u5ea6\u5730\u56fe\u67e5\u770b\u66f4\u591a\u7ed3\u679c"});moreUrl.innerHTML="\u66f4\u591a\u7ed3\u679c&#187;";var paging=create("div",{style:"float:left;margin-right:5px"});if(this._results.getNumPages()>1){var pg=new Page(paging,function(page){me.gotoPage(page-1)},{pageCount:me._results.getNumPages(),page:me._results.getPageIndex()+1,update:false})}resultsControl.appendChild(paging);resultsControl.appendChild(moreUrl);container.appendChild(resultsControl);this._opts.renderOptions.panel.appendChild(container);this._triggerCbk(BaseSearch.CBK_RESULTS_HTML_SET,container)}},_createItem:function(index){var r=this._results;if(!r||!r.getPoi(index)){return}var cur=r.getPoi(index);var kw=this._results.keyword;var item=create("li",{style:"margin:2px 0;padding:0 5px 0 3px;cursor:pointer;overflow:hidden;line-height:17px"});if(this._curIndex>-1&&index==this._curIndex){item.style.backgroundColor="#f0f0f0"}var offsetY=index==0?index+2+"px":"-"+(index*20-2)+"px";if(this._results.getCurrentNumPois()>LocalSearch.DEFAULT_PAGE_CAPACITY){offsetY="-218px"}var htmls=["<span style='background:url("+API_URL+"bmap/red_labels.gif) 0 "+offsetY+" no-repeat;padding-left:10px;margin-right:3px'>&nbsp;</span>"];var regex=new RegExp(kw,"ig");var title=cur.title.replace(regex,"<b>$&</b>");if(cur.type==BMAP_POI_TYPE_BUSSTOP){title+="-\u516c\u4ea4\u8f66\u7ad9"}else{if(cur.type==BMAP_POI_TYPE_SUBSTOP){title+="-\u5730\u94c1\u7ad9"}}htmls.push("<span style='color:#00c;text-decoration:underline'>"+title+"</span>");if(cur.address){htmls.push("<span style='color:#666;'> - "+cur.address.replace(regex,"<b>$&</b>")+"</span>")}item.innerHTML=htmls.join("");var me=this;item.onclick=function(){me._select(index)};return item},_createCityItem:function(index){var item=create("li",{style:"margin:2px 0;padding:0 5px 0 3px;cursor:pointer;overflow:hidden;line-height:17px"});item._index=index;var clist=this._results.getCityList();item.innerHTML="<span style='color:#00c;text-decoration:underline'>"+clist[index].city+"</span> <span style='color:#666'>(\u5171"+clist[index].numResults+"\u6761\u7ed3\u679c)</span>";var me=this;item.onclick=function(){me.setLocation(me._results.getCityList()[index].city);me.search(me._results.keyword)};return item},clearResults:function(){delete this._json;delete this._status;delete this._results;delete this._ud;this._curIndex=-1;this._setStatus();this._clearOverlays();if(this._opts.renderOptions.panel){this._opts.renderOptions.panel.innerHTML=""}},gotoPage:function(pageNum){if(this._ud){if(typeof pageNum=="number"&&!isNaN(pageNum)&&pageNum>=0&&pageNum<=this._results.getNumPages()-1){this._ud.params.pn=pageNum;var qt=this._ud.params.qt;switch(qt){case QUERY_TYPE_POI_SEARCH:this.search(this._ud.params.wd,this._ud);break;case QUERY_TYPE_SEARCH_INBOUNDS:this.searchInBounds(this._ud.params.wd,this._ud.bounds,this._ud);break;case QUERY_TYPE_SEARCH_NEARBY:this.searchNearby(this._ud.params.wd,this._ud.center,this._ud.radius,this._ud);break;default:break}}else{this._setStatus(BMAP_STATUS_INVALID_REQUEST);this._triggerCbk(BaseSearch.CBK_SEARCH_COMPLETE)}}},enableFirstResultSelection:function(){this._opts.renderOptions.selectFirstResult=true},disableFirstResultSelection:function(){this._opts.renderOptions.selectFirstResult=false},setPageCapacity:function(cap){if(typeof cap=="number"&&!isNaN(cap)){this._opts.pageCapacity=cap<1?LocalSearch.DEFAULT_PAGE_CAPACITY:(cap>LocalSearch.MAX_PAGE_CAPACITY?LocalSearch.DEFAULT_PAGE_CAPACITY:cap)}else{this._opts.pageCapacity=LocalSearch.DEFAULT_PAGE_CAPACITY}},getPageCapacity:function(){if(!arguments[0]){return this._opts.pageCapacity}if(arguments[0]!=QUERY_TYPE_SEARCH_INBOUNDS){if(this._opts.pageCapacity<=LocalSearch.DEFAULT_PAGE_CAPACITY){return this._opts.pageCapacity}else{return LocalSearch.DEFAULT_PAGE_CAPACITY}}else{return this._opts.pageCapacity}},_getBestViewport:function(viewData){var map=this._opts.renderOptions.map;if(map){if(viewData.points){var pts=viewData.points;if(this._opts.coordType!=map.config.coordType){if(map.config.coordType==BMAP_COORD_MERCATOR){for(var i=0;i<pts.length;i++){pts[i]=BMap.Project.convertLL2MC(pts[i])}}else{if(map.config.coordType==BMAP_COORD_LNGLAT){for(var i=0;i<pts.length;i++){pts[i]=BMap.Project.convertMC2LL(pts[i])}}}}var preserve=!this._opts.renderOptions.autoViewport;if(this._opts.renderOptions.selectFirstResult){preserve=true}var ret=map.getBestMap(pts,30,false,preserve);if(this._opts.renderOptions.selectFirstResult&&this._opts.renderOptions.autoViewport){map.centerAndZoom(ret.center,ret.level)}ret.center=convertCoord(ret.center,map.config.coordType,this._opts.coordType);return ret}else{var pt=convertCoord(viewData.center,this._opts.coordType,map.config.coordType);viewData.level=getBestLevel(viewData.level,map);if(this._opts.renderOptions.autoViewport){map.centerAndZoom(pt,viewData.level)}return viewData}}},toString:function(){return"LocalSearch"}});function LocalResult(opts){this.keyword=opts.keyword||"";this._pageIndex=opts.pageIdx||0;this._currentNumPois=opts.count||0;this._numPois=opts.total||0;this._numPages=Math.ceil(opts.total/opts.pc);this.center=opts.center;this.radius=opts.radius;this.bounds=opts.bounds;this.city=opts.city;this.viewport=opts.viewport;var keyword=typeof this.center=="string"?(this.center+" "+this.keyword):this.keyword;var qt="s",extra="";if(typeof this.center=="object"){qt="nb";extra="&uid="+this.center.uid+"&r="+this.radius}this.moreResultsUrl=MAP_URL+"?s="+encodeURIComponent(qt+"&wd="+keyword+"&c="+opts.ccode+extra)+"&sr=1";this._pois=opts.pois&&opts.pois.slice(0)||[];this._cityList=opts.cityList&&opts.cityList.slice(0)}baidu.extend(LocalResult.prototype,{getPoi:function(i){if(this._pois[i]){return this._pois[i]}},getNumPois:function(){return this._numPois},getNumPages:function(){return this._numPages},getCurrentNumPois:function(){return this._currentNumPois},getPageIndex:function(){return this._pageIndex},getCityList:function(){return this._cityList},toString:function(){return"LocalResult"}});var BaseRoute=function(loc,opts){BaseSearch.call(this,loc,opts);opts=opts||{};this.setPolylinesSetCallback(opts.onPolylinesSet)};baidu.inherits(BaseRoute,BaseSearch,"BaseRoute");BaseRoute._genTitle=function(title,clickBhv,seFlag){var borderStyle="border-bottom:1px solid #ccc";var imgOffsetY="-21px";if(seFlag===0){borderStyle+=";border-top:1px solid #ccc";imgOffsetY="5px"}var res=["<div style='"+borderStyle+"'><div style='cursor:pointer;background:url("];res.push(API_URL+"img/trans_icons.png) no-repeat 5px "+imgOffsetY+";padding:8px 0 8px 33px;line-height:15px' ");res.push("onclick='"+clickBhv+"'><span style='white-space:nowrap'>");res.push(title);res.push("</span></div></div>");return res.join("")};baidu.extend(BaseRoute.prototype,{search:function(start,end){if(!start||!end){this.clearResults();this._setStatus(BMAP_STATUS_INVALID_REQUEST);this._triggerCbk(BaseSearch.CBK_SEARCH_COMPLETE);return false}this.clearResults();return true},clearResults:function(){delete this._results;delete this._ud;delete this._json;delete this._boundsPoints;this._setStatus();if(this._opts.renderOptions.panel){this._opts.renderOptions.panel.innerHTML=""}if(this._opts.renderOptions.map){this._opts.renderOptions.map.closeInfoWindow()}this._clearOverlays();this._curIndex=-1},_formatDestQuery:function(dest){var ret;if(typeof dest=="string"){ret=[2,"","",dest,"",""]}else{var pt=convertCoord(dest.point,this._opts.coordType,BMAP_COORD_MERCATOR);ret=[1,dest.uid,pt.lng+","+pt.lat,dest.title,"",""]}return ret.join("$$")},setPolylinesSetCallback:function(cbk){this._opts.onPolylinesSet=cbk||function(){}},toString:function(){return"BaseRoute"}});function Route(opts){this._steps=opts.steps&&opts.steps.slice(0)||[];this._distance=opts.distance||0;this._index=opts.index||0;this._points=opts.points.slice(0);this._planIndex=opts.planIndex||0;this._rt=opts.rt;if(this._distance===0&&this._points.length>2){this._points.length=2}}baidu.extend(Route.prototype,{getNumSteps:function(){return this._steps.length},getStep:function(i){if(this._steps[i]){return this._steps[i]}},getDistance:function(format){if(format===false){return this._distance}else{return formatDistance(this._distance)}},getIndex:function(){return this._index},getPolyline:function(){return this._polyline},getPoints:function(){return this._points},getRouteType:function(){return this._rt},getPlanIndex:function(){return this._planIndex}});function RoutePlan(opts){this._routes=opts.routes.slice(0);this._distance=opts.distance||0}baidu.extend(RoutePlan.prototype,{getRoute:function(i){if(this._routes[i]){return this._routes[i]}},getNumRoutes:function(){return this._routes.length},getDistance:function(format){if(format===false){return this._distance}else{return formatDistance(this._distance)}}});window.BMAP_TRANSIT_POLICY_LEAST_TIME=0;window.BMAP_TRANSIT_POLICY_LEAST_TRANSFER=2;window.BMAP_TRANSIT_POLICY_LEAST_WALKING=3;window.BMAP_LINE_TYPE_BUS=0;window.BMAP_LINE_TYPE_SUBWAY=1;window.BMAP_LINE_TYPE_FERRY=2;function TransitRoute(loc,opts){BaseRoute.call(this,loc,opts);opts=opts||{};this.setPolicy(opts.policy);this.setPageCapacity(opts.pageCapacity);this.QUERY_TYPE=QUERY_TYPE_TRANSIT;this.RETURN_TYPE=RETURN_TYPE_TRANSIT;this.ROUTE_TYPE=ROUTE_TYPE_TRANSIT;this._overlays=[];this._curIndex=-1}TransitRoute.MAX_PAGE_CAPACITY=5;TransitRoute.LINE_TYPE_MAPPING=[0,1,0,0,0,0,0,0,2,0,0,0,1,1,1];baidu.inherits(TransitRoute,BaseRoute);baidu.extend(TransitRoute.prototype,{setPolicy:function(policy){if(policy>=BMAP_TRANSIT_POLICY_LEAST_TIME&&policy<=BMAP_TRANSIT_POLICY_LEAST_WALKING){this._opts.policy=policy}else{this._opts.policy=BMAP_TRANSIT_POLICY_LEAST_TIME}},search:function(start,end){if(BaseRoute.prototype.search.call(this,start,end)==true){var me=this;this._getIdByLoc(this._loc,function(id){if(!id){this._setStatus(BMAP_STATUS_INVALID_REQUEST);this._triggerCbk(BaseSearch.CBK_SEARCH_COMPLETE)}var params={qt:me.QUERY_TYPE,c:id,sn:me._formatDestQuery(start),en:me._formatDestQuery(end),sy:me._opts.policy||0,brn:me._opts.pageCapacity};DataMgr.request(function(json,userData){me._rawDataCbk(json,userData)},params,{start:start,end:end})})}},_rawDataCbk:function(json,userData){this.clearResults();this._json=json;var r=json.result;this._ud=userData;if(r.error!=0||r.type!=this.RETURN_TYPE){this._results=new TransitRouteResult({city:json.current_city.name,plans:[],policy:r.sy});this._setStatus(BMAP_STATUS_UNKNOWN_ROUTE);this._triggerCbk(BaseSearch.CBK_SEARCH_COMPLETE,this._results);return}this._processRaw();this._renderList();this._selectPlan(0)},_processRaw:function(){var r=this._json.result;var c=this._json.content;var cc=this._json.current_city;var start={};var end={};if(typeof this._ud.start=="object"){baidu.extend(start,this._ud.start)}else{start.title=r.start.wd;start.uid=r.start.uid;start.url=BaseSearch._getPoiUrl(start.uid,cc.code);start.point=parseGeo(r.start.pt,true,this._opts.coordType).point;start.city=cc.name}if(typeof this._ud.end=="object"){baidu.extend(end,this._ud.end)}else{end.title=r.end.wd;end.uid=r.end.uid;end.url=BaseSearch._getPoiUrl(end.uid,cc.code);end.point=parseGeo(r.end.pt,true,this._opts.coordType).point;end.city=cc.name}var plans=[];this._boundsPoints=[];for(var i=0;i<c.length;i++){this._boundsPoints[i]=[];var stops=c[i].stops[0];var lines=c[i].lines[0];var resLines=[];var wRoutes=[];var dis=0;var desc="";for(var j=0;j<stops.length-1;j++){var on=stops[j].getOn;var onStop={title:on.name,uid:on.uid,url:BaseSearch._getPoiUrl(on.uid,cc.code),city:cc.name,point:parseGeo(on.geo,true,this._opts.coordType).point};var off=stops[j+1].getOff;var offStop={title:off.name,uid:off.uid,url:BaseSearch._getPoiUrl(off.uid,cc.code),city:cc.name,point:parseGeo(off.geo,true,this._opts.coordType).point};wRoutes.push(new Route({distance:stops[j].walk.distance,points:parseGeo(stops[j].walk.geo,true,this._opts.coordType).points,rt:BMAP_ROUTE_TYPE_WALKING,index:j,planIndex:i}));dis+=stops[j].walk.distance;if(j==stops.length-2){wRoutes.push(new Route({distance:stops[j+1].walk.distance,points:parseGeo(stops[j+1].walk.geo,true,this._opts.coordType).points,rt:BMAP_ROUTE_TYPE_WALKING,index:j+1,planIndex:i}));dis+=stops[j+1].walk.distance}var lineGeo=parseGeo(lines[j].geo,true,this._opts.coordType);resLines.push(new Line({title:lines[j].name,uid:lines[j].uid,distance:lines[j].distance,points:lineGeo.points,stops:[onStop,offStop],type:this._getLineType(lines[j].type),numViaStops:lines[j].station_num}));var bpts=getPointsByBounds(lineGeo.bounds,this._opts.coordType,this._opts.renderOptions.map?this._opts.renderOptions.map.config.coordType:this._opts.coordType);this._boundsPoints[i].push(bpts[0],bpts[1]);dis+=lines[j].distance;if(stops[j].walk.distance){desc+="<b>\u6b65\u884c</b>\u7ea6"+formatDistance(stops[j].walk.distance)+"\uff0c\u5230\u8fbe<b>"+onStop.title+"</b>\uff0c"}desc+="\u4e58\u5750<b>"+this._shortTitle(lines[j].name)+"</b>\uff0c\u7ecf\u8fc7"+lines[j].station_num+"\u7ad9\uff0c\u5230\u8fbe<b>"+offStop.title+"</b>";if(j<stops.length-2){desc+="\uff0c"}else{if(stops[j+1].walk.distance){desc+="\uff0c<b>\u6b65\u884c</b>\u7ea6"+formatDistance(stops[j+1].walk.distance)+"\uff0c\u5230\u8fbe<b>"+stops[j+1].getOn.name+"</b>"}}}plans.push(new TransitRoutePlan({routes:wRoutes,distance:dis,lines:resLines,description:desc}))}var url=MAP_URL+"?s="+encodeURIComponent(this.QUERY_TYPE+"&c="+cc.code+"&sy="+r.sy+"&sn="+this._formatDestQuery(this._ud.start)+"&en="+this._formatDestQuery(this._ud.end)+"&sq="+(this._ud.start.title?this._ud.start.title:this._ud.start)+"&eq="+(this._ud.end.title?this._ud.end.title:this._ud.end))+"&sr=1";this._results=new TransitRouteResult({city:cc.name,plans:plans,start:start,end:end,url:url,policy:r.sy});this._setStatus(BMAP_STATUS_SUCCESS);this._triggerCbk(BaseSearch.CBK_SEARCH_COMPLETE,this._results)},_shortTitle:function(title){return title.replace(/\(.*\)/,"")},_renderPlan:function(index){var map=this._opts.renderOptions.map;if(!map){return}var plan=this._results.getPlan(index);if(!plan){return}var startPoi=this._results.getStart();var endPoi=this._results.getEnd();var staMkr=addDestPoi(map,startPoi.point,startPoi.title,DEST_START,this._opts.coordType);startPoi.marker=staMkr;staMkr.addEventListener("click",function(){me._select(0)});this._overlays.push(staMkr);var endMkr=addDestPoi(map,endPoi.point,endPoi.title,DEST_END,this._opts.coordType);endPoi.marker=endMkr;this._overlays.push(endMkr);endMkr.addEventListener("click",function(){me._selectLast()});var startPt=convertCoord(startPoi.point,this._opts.coordType,map.config.coordType);var endPt=convertCoord(endPoi.point,this._opts.coordType,map.config.coordType);this._boundsPoints[index].push(startPt,endPt);var transPois=[];var me=this;for(var i=0,l=plan.getNumLines();i<l;i++){var line=plan.getLine(i);var polyline=addLine(map,line.getPoints(),this._opts.coordType);line._polyline=polyline;this._overlays.push(polyline);var on=line.getGetOnStop();transPois.push(on);var onMkr=addTransPoi(map,on.point,line.type,on.title,this._opts.coordType);on.marker=onMkr;this._overlays.push(onMkr);var off=line.getGetOffStop();transPois.push(off);var offMkr=addTransPoi(map,off.point,line.type,off.title,this._opts.coordType);off.marker=offMkr;(function(){var curIndex=i;onMkr.addEventListener("click",function(){me._select((curIndex+1)*2-1)});offMkr.addEventListener("click",function(){me._select((curIndex+1)*2)})})();this._overlays.push(offMkr);var route=plan.getRoute(i);if(route.getDistance(false)>0){polyline=addRoute(map,route.getPoints(),route.getRouteType(),this._opts.coordType);route._polyline=polyline;this._overlays.push(polyline)}}var route=plan.getRoute(i);polyline=addRoute(map,route.getPoints(),route.getRouteType(),this._opts.coordType);route._polyline=polyline;this._overlays.push(polyline);var me=this;if(this._opts.renderOptions.autoViewport){map.getBestMap(this._boundsPoints[index],30)}this._triggerCbk(BaseSearch.CBK_POLYLINES_SET,plan._lines,plan._routes);this._triggerCbk(BaseSearch.CBK_MARKERS_SET,[startPoi,endPoi],transPois)},_renderList:function(){if(this._opts.renderOptions.panel&&this._opts.renderOptions.panel.appendChild&&this._results&&this._results.getNumPlans()>0){var container=create("div",{style:"font-size:12px;font-family:arial,sans-serif;background:#fff"});var divSta=BaseRoute._genTitle(this._results.getStart().title,'Instance("'+this.guid+'")._select(0)',0);var tables=["<table style='font:12px arial,simsun,sans-serif;border-collapse:collapse' cellpadding='0' cellspacing='0' border='0'>"];for(var i=0,l=this._results.getNumPlans();i<l;i++){var plan=this._results.getPlan(i);var dis=plan.getDistance().replace(/(\d+(?:.\d+)?)/,"$1 ");var bg="";if(this._curIndex==i){bg=";background:#f0f0f0"}tables.push("<tr style='cursor:pointer"+bg+"' onclick='Instance(\""+this.guid+'")._selectPlan('+i+")'>");tables.push("<td style='border-bottom:1px solid #ccc;width:20px;vertical-align:top;text-align:right;padding:4px 3px' >"+(i+1)+".</td>");tables.push("<td style='border-bottom:1px solid #ccc;padding:2px;line-height:18px' >"+plan.getDescription()+"</td>");tables.push("<td style='border-bottom:1px solid #ccc;width:54px;vertical-align:top;text-align:right;padding:4px 3px' >"+dis+"</td></tr>");tables.push("</tr>")}tables.push("</table>");var divEnd=BaseRoute._genTitle(this._results.getEnd().title,'Instance("'+this.guid+'")._selectLast()',1);var control="<div style='border-bottom:1px solid #ccc;margin-bottom:10px;color:#7777cc;background:#e5ecf9;overflow:hidden;padding:2px;text-align:right'>";if(this._results.moreResultsUrl){control+="<a style='color:#7777cc' href='"+this._results.moreResultsUrl+"' target='_blank'>\u5230\u767e\u5ea6\u5730\u56fe\u67e5\u770b&#187;</a>"}control+="</div>";container.innerHTML=divSta+tables.join("")+divEnd+control;this._opts.renderOptions.panel.appendChild(container);this._triggerCbk(BaseSearch.CBK_RESULTS_HTML_SET,container)}},_select:function(index){var map=this._opts.renderOptions.map;if(map){var plan=this._results.getPlan(this._curIndex);if(!plan){return}var me=this;var total=plan.getNumLines()*2;if(index==0||index==total+1){var d=index===0?this._results.getStart():this._results.getEnd();var iw=createTransInfoWnd({content:"<b>"+d.title+"</b>",total:total,curIndex:index,nextTransCbk:function(i){me._select(i)},type:TRANS_INFO_WND_TRANSIT});iw.addEventListener("open",function(){me._triggerCbk(BaseSearch.CBK_INFO_HTML_SET,d,map.infoWindow.contentDiv.childNodes[0])});var oindex=index===0?0:1;this._overlays[oindex].openInfoWindow(iw)}else{var curLine=plan.getLine(Math.floor((index+1)/2)-1);var curStop;var desc;if(index%2===1){curStop=curLine.getGetOnStop();desc="<b>"+curStop.title+"\u7ad9\u4e0a\u8f66</b>"}else{curStop=curLine.getGetOffStop();desc="<b>"+curStop.title+"\u7ad9\u4e0b\u8f66</b>"}var iw=createTransInfoWnd({content:desc,total:total,curIndex:index,nextTransCbk:function(i){me._select(i)},type:TRANS_INFO_WND_TRANSIT});iw.addEventListener("open",function(){me._triggerCbk(BaseSearch.CBK_INFO_HTML_SET,curStop,map.infoWindow.contentDiv.childNodes[0])});curStop.marker.openInfoWindow(iw)}}},_selectLast:function(){if(this._results&&this._curIndex>-1){var plan=this._results.getPlan(this._curIndex);if(!plan){return}var total=plan.getNumLines()*2;this._select(total+1)}},_selectPlan:function(index){if(!this._results&&!this._result.getPlan(index)){return}var plan=this._results.getPlan(index);var map=this._opts.renderOptions.map;if(map){map.closeInfoWindow();this._clearOverlays();this._renderPlan(index)}if(this._opts.renderOptions.panel){var table=this._opts.renderOptions.panel.getElementsByTagName("table")[0];if(!table){return}var trs=table.getElementsByTagName("tr");if(this._curIndex>=0&&trs[this._curIndex]){trs[this._curIndex].style.background=""}if(index>=0&&trs[index]){trs[index].style.background="#f0f0f0"}}this._curIndex=index},_clearOverlays:function(){for(var i=0;i<this._overlays.length;i++){this._overlays[i].remove();if(this._overlays[i]._p){this._overlays[i]._p.remove()}this._overlays[i]=null}this._overlays.length=0},_getLineType:function(type){return TransitRoute.LINE_TYPE_MAPPING[type]},setPageCapacity:function(cp){if(typeof cp=="string"){cp=parseInt(cp);if(isNaN(cp)){this._opts.pageCapacity=TransitRoute.MAX_PAGE_CAPACITY;return}}if(typeof cp!="number"){this._opts.pageCapacity=TransitRoute.MAX_PAGE_CAPACITY;return}if(cp>=1&&cp<=TransitRoute.MAX_PAGE_CAPACITY){this._opts.pageCapacity=Math.round(cp)}else{this._opts.pageCapacity=TransitRoute.MAX_PAGE_CAPACITY}},toString:function(){return"TransitRoute"}});function TransitRoutePlan(opts){RoutePlan.call(this,opts);this._lines=opts.lines;this._description=opts.description}baidu.inherits(TransitRoutePlan,RoutePlan,"TransitRoutePlan");baidu.extend(TransitRoutePlan.prototype,{getNumLines:function(){return this._lines.length},getLine:function(i){if(this._lines[i]){return this._lines[i]}},getDescription:function(includeHtml){if(includeHtml===false){return this._description.replace(/<(\/)?b>/g,"")}else{return this._description}}});function Step(opts){this._point=opts.point;this._index=opts.index;this._description=opts.description;this._distance=opts.distance||0;this._routeIndex=opts.routeIndex||0;this._planIndex=opts.planIndex||0}baidu.extend(Step.prototype,{getPoint:function(){return this._point},getIndex:function(){return this._index},getDescription:function(includeHtml){if(includeHtml===false){return this._description.replace(/<\/?b>/g,"")}else{return this._description}},getDistance:function(format){if(format===false){return this._distance}else{return formatDistance(this._distance)}},getRouteIndex:function(){return this._routeIndex},getPlanIndex:function(){return this._planIndex}});var DWRoute=function(location,opts){BaseRoute.call(this,location,opts);this._overlays=[];this._curIndex=-1};DWRoute.ROAD_TYPE=["","\u73af\u5c9b","\u65e0\u5c5e\u6027\u9053\u8def","\u4e3b\u8def","\u9ad8\u901f\u8fde\u63a5\u8def","\u4ea4\u53c9\u70b9\u5185\u8def\u6bb5","\u8fde\u63a5\u9053\u8def","\u505c\u8f66\u573a\u5185\u90e8\u9053\u8def","\u670d\u52a1\u533a\u5185\u90e8\u9053\u8def","\u6865","\u6b65\u884c\u8857","\u8f85\u8def","\u531d\u9053","\u5168\u5c01\u95ed\u9053\u8def","\u672a\u5b9a\u4e49\u4ea4\u901a\u533a\u57df","POI\u8fde\u63a5\u8def","\u96a7\u9053","\u6b65\u884c\u9053","\u516c\u4ea4\u4e13\u7528\u9053","\u63d0\u524d\u53f3\u8f6c\u9053"];baidu.inherits(DWRoute,BaseRoute,"DWRoute");baidu.extend(DWRoute.prototype,{search:function(start,end){if(BaseRoute.prototype.search.call(this,start,end)==true){var me=this;this._getIdByLoc(this._loc,function(id){id=id||1;var params={qt:me.QUERY_TYPE,c:id,sc:id,ec:id,sn:me._formatDestQuery(start),en:me._formatDestQuery(end),sy:me._opts.policy||0};DataMgr.request(function(json,userData){me._rawDataCbk(json,userData)},params,{start:start,end:end})})}},_rawDataCbk:function(json,userData){this.clearResults();this._json=json;var r=json.result;this._ud=userData;if(r.error!=0||r.type!=this.RETURN_TYPE){this._results=this._createResults({city:json.current_city.name,plans:[],policy:r.sy});this._setStatus(BMAP_STATUS_UNKNOWN_ROUTE);this._triggerCbk(BaseSearch.CBK_SEARCH_COMPLETE,this._results);return}this._processRaw();this._renderMap();this._renderList()},_processRaw:function(){var r=this._json.result;var c=this._json.content;var cc=this._json.current_city;var kps=c.kps;var rss=c.rss;var start={};var end={};if(typeof this._ud.start=="object"){baidu.extend(start,this._ud.start)}else{start.title=r.start.wd;start.uid=r.start.uid;start.url=BaseSearch._getPoiUrl(start.uid,r.start_city.code);start.point=parseGeo(r.start.pt,true,this._opts.coordType).point;start.city=r.start_city.cname}if(typeof this._ud.end=="object"){baidu.extend(end,this._ud.end)}else{end.title=r.end[0].wd;end.uid=r.end[0].uid;end.url=BaseSearch._getPoiUrl(end.uid,r.end_city[0].code);end.point=parseGeo(r.end[0].pt,true,this._opts.coordType).point;end.city=r.end_city[0].cname}var steps=[];var polylinePoints=[];this._boundsPoints=[];for(var i=0,l=kps.length-1;i<l;i++){var curKps=kps[i];var curRss=rss[i];var nxtRss=rss[i+1];var pt=parseGeo(curKps.pt,true,this._opts.coordType).point;var dis=parseInt(curRss.d);var des=this._getDescription(curKps,curRss,nxtRss,i,l);steps.push(new Step({point:pt,index:i,description:des,distance:nxtRss.d}));var cur=parseGeo(curRss.g,true,this._opts.coordType);if(cur){for(var j=0,ll=cur.points.length;j<ll;j++){polylinePoints.push(cur.points[j])}var bpts=getPointsByBounds(cur.bounds,this._opts.coordType,this._opts.renderOptions.map?this._opts.renderOptions.map.config.coordType:this._opts.coordType);this._boundsPoints.push(bpts[0],bpts[1])}}var route=new Route({steps:steps,distance:c.dis,index:0,points:polylinePoints,rt:this.ROUTE_TYPE});var rp=new RoutePlan({routes:[route],distance:c.dis});var url=MAP_URL+"?s="+encodeURIComponent(this.QUERY_TYPE+"&c="+cc.code+"&sc="+r.start_city.code+"&ec="+r.end_city[0].code+"&sy="+r.sy+"&sn="+this._formatDestQuery(this._ud.start)+"&en="+this._formatDestQuery(this._ud.end)+"&sq="+(this._ud.start.title?this._ud.start.title:this._ud.start)+"&eq="+(this._ud.end.title?this._ud.end.title:this._ud.end))+"&sr=1";this._results=this._createResults({city:cc.name,plans:[rp],start:start,end:end,url:url,policy:r.sy});this._setStatus(BMAP_STATUS_SUCCESS);this._triggerCbk(BaseSearch.CBK_SEARCH_COMPLETE,this._results)},_getDescription:function(curKps,curRss,nxtRss,i,l){var des="";var dis=parseInt(curRss.d);var disstr=formatDistance(dis);var act=DWRoute.ROAD_TYPE[curRss.t]==""?"":"\u6cbf";var rnm=this._getRoadName(curRss.t,curRss.n);var nnm=this._getRoadName(curRss.t,nxtRss.n);var ret="\u8fdb\u5165";var roadType=nxtRss.t;if(roadType==9||roadType==12){ret="\u4e0a"}else{if(roadType==0){ret=""}}des=act+"<b>"+rnm+"</b>"+this._getRetType(curKps.rt)+disstr+"\uff0c";if(i==0){des="\u4ece<b>\u8d77\u70b9</b>\u5411"+this._getTurnType(curKps.tt)+"\u51fa\u53d1"}else{if(i>0&&i<l-1){des=des+"<b>"+this._getTurnType(curKps.tt)+"</b>"+ret+"<b>"+nnm+"</b>"}else{des=des+"\u5230\u8fbe<b>\u7ec8\u70b9</b>"}}return des},_renderMap:function(){var map=this._opts.renderOptions.map;if(map&&this._results){var plan=this._results.getPlan(0);var route=plan.getRoute(0);var startPoi=this._results.getStart();var endPoi=this._results.getEnd();var me=this;var polyline=addRoute(map,route.getPoints(),route.getRouteType(),this._opts.coordType);route._polyline=polyline;this._overlays.push(polyline);var staMkr=addDestPoi(map,startPoi.point,startPoi.title,DEST_START,this._opts.coordType);startPoi.marker=staMkr;staMkr.addEventListener("click",function(){me._select(0)});this._overlays.push(staMkr);var endMkr=addDestPoi(map,endPoi.point,endPoi.title,DEST_END,this._opts.coordType);endPoi.marker=endMkr;this._overlays.push(endMkr);endMkr.addEventListener("click",function(){me._select(route.getNumSteps()+1)});if(this._opts.renderOptions.autoViewport){map.getBestMap(this._boundsPoints,30)}this._triggerCbk(BaseSearch.CBK_POLYLINES_SET,plan._routes);this._triggerCbk(BaseSearch.CBK_MARKERS_SET,[startPoi,endPoi])}},_select:function(index){var preIndex=this._curIndex;if(this._opts.renderOptions.panel){var table=this._opts.renderOptions.panel.getElementsByTagName("table")[0];var trs=table.getElementsByTagName("tr");if(preIndex-1>=0&&trs[preIndex-1]){trs[preIndex-1].style.background=""}if(index-1>=0&&trs[index-1]){trs[index-1].style.background="#f0f0f0"}}var map=this._opts.renderOptions.map;if(map){var plan=this._results.getPlan(0);var route=plan.getRoute(0);var total=route.getNumSteps();var me=this;map.closeInfoWindow();if(index==0||index==total+1){var d=index===0?this._results.getStart():this._results.getEnd();var iw=createTransInfoWnd({content:"<b>"+d.title+"</b>",total:total,curIndex:index,nextTransCbk:function(i){me._select(i)},type:this.TRANS_INFO_WND_TYPE});iw.addEventListener("open",function(){me._triggerCbk(BaseSearch.CBK_INFO_HTML_SET,d,map.infoWindow.contentDiv.childNodes[0])});iw.addEventListener("close",function(){if(me._opts.renderOptions.panel){var table=me._opts.renderOptions.panel.getElementsByTagName("table")[0];var trs=table.getElementsByTagName("tr");if(me._curIndex-1>=0&&trs[me._curIndex-1]){trs[me._curIndex-1].style.background=""}}me._curIndex=-1});var oindex=index===0?1:2;this._overlays[oindex].openInfoWindow(iw)}else{var curStep=route.getStep(index-1);var iw=createTransInfoWnd({content:curStep.getDescription(),total:total,curIndex:index,nextTransCbk:function(i){me._select(i)},type:this.TRANS_INFO_WND_TYPE});iw.addEventListener("open",function(){me._triggerCbk(BaseSearch.CBK_INFO_HTML_SET,curStep,map.infoWindow.contentDiv.childNodes[0])});iw.addEventListener("close",function(){if(me._opts.renderOptions.panel){var table=me._opts.renderOptions.panel.getElementsByTagName("table")[0];var trs=table.getElementsByTagName("tr");if(me._curIndex-1>=0&&trs[me._curIndex-1]){trs[me._curIndex-1].style.background=""}}me._curIndex=-1});var pt=convertCoord(curStep.getPoint(),this._opts.coordType,map.config.coordType);map.openInfoWindow(iw,pt)}}this._curIndex=index},_clearOverlays:function(){for(var i=0,l=this._overlays.length;i<l;i++){this._overlays[i].remove();this._overlays[i]=null}this._overlays.length=0},_renderList:function(){if(this._opts.renderOptions.panel&&this._opts.renderOptions.panel.appendChild&&this._results&&this._results.getNumPlans()>0){var route=this._results.getPlan(0).getRoute(0);var container=create("div",{style:"font-size:12px;font-family:arial, sans-serif;background:#fff"});var divSta=BaseRoute._genTitle(this._results.getStart().title,'Instance("'+this.guid+'")._select(0)',0);var tables=["<table style='font:12px arial,simsun,sans-serif;border-collapse:collapse' cellpadding='0' cellspacing='0' border='0'>"];for(var i=0,l=route.getNumSteps();i<l;i++){var bg="";if(this._curIndex==i+1){bg=";background:#f0f0f0"}tables.push("<tr style='cursor:pointer"+bg+"' onclick='Instance(\""+this.guid+'")._select('+(i+1)+")'>");tables.push("<td style='border-bottom:1px solid #ccc;width:20px;vertical-align:top;text-align:right;padding:4px 3px' >"+(i+1)+".</td>");tables.push("<td style='border-bottom:1px solid #ccc;padding:2px;line-height:18px' >"+route.getStep(i).getDescription()+"</td>");tables.push("</tr>")}tables.push("</table>");var divEnd=BaseRoute._genTitle(this._results.getEnd().title,'Instance("'+this.guid+'")._select('+(route.getNumSteps()+1)+")",1);var control="<div style='border-bottom:1px solid #ccc;margin-bottom:10px;color:#7777cc;background:#e5ecf9;overflow:hidden;padding:2px;text-align:right'><span style='float:left;padding-left:6px'>\u5168\u7a0b\uff1a"+route.getDistance().replace(/(\d+(?:.\d+)?)/,"$1 ")+"</span>";if(this._results.moreResultsUrl){control+="<a style='color:#7777cc' href='"+this._results.moreResultsUrl+"' target='_blank'>\u5230\u767e\u5ea6\u5730\u56fe\u67e5\u770b&#187;</a>"}control+="&nbsp;</div>";container.innerHTML=divSta+tables.join("")+divEnd+control;this._opts.renderOptions.panel.appendChild(container);this._triggerCbk(BaseSearch.CBK_RESULTS_HTML_SET,container)}},_getRoadName:function(roadType,roadName){if(roadName==""||!roadName){if(roadType==9||roadType==12||roadType==1||roadType==16){roadName=DWRoute.ROAD_TYPE[roadType]}}return roadName},toString:function(){return"DWRoute"}});window.BMAP_DRIVING_POLICY_LEAST_TIME=0;window.BMAP_DRIVING_POLICY_LEAST_DISTANCE=1;window.BMAP_DRIVING_POLICY_AVOID_HIGHWAYS=2;function DrivingRoute(location,opts){DWRoute.call(this,location,opts);opts=opts||{};this.setPolicy(opts.policy);this.QUERY_TYPE=QUERY_TYPE_DRIVING;this.RETURN_TYPE=RETURN_TYPE_DRIVING;this.ROUTE_TYPE=BMAP_ROUTE_TYPE_DRIVING;this.TRANS_INFO_WND_TYPE=TRANS_INFO_WND_DRIVING}baidu.inherits(DrivingRoute,DWRoute,"DrivingRoute");DrivingRoute.TURN_TYPE=["","\u76f4\u884c","\u7a0d\u5411\u53f3\u8f6c","\u53f3\u524d\u65b9\u8f6c\u5f2f","\u53f3\u8f6c","\u7a0d\u5411\u53f3\u540e\u8f6c\u5f2f","\u53f3\u540e\u65b9\u8f6c\u5f2f","\u8c03\u5934","\u5de6\u540e\u65b9\u8f6c\u5f2f","\u7a0d\u5411\u5de6\u540e\u8f6c\u5f2f","\u5de6\u8f6c","\u5de6\u524d\u65b9\u8f6c\u5f2f","\u7a0d\u5411\u5de6\u8f6c","\u6b63\u5317\u65b9\u5411","\u4e1c\u5317\u65b9\u5411","\u6b63\u4e1c\u65b9\u5411","\u4e1c\u5357\u65b9\u5411","\u6b63\u5357\u65b9\u5411","\u897f\u5357\u65b9\u5411","\u6b63\u897f\u65b9\u5411","\u897f\u5317\u65b9\u5411"];DrivingRoute.RET_TYPE=["","\u4ece\u8d77\u70b9\u51fa\u53d1","\u5230\u8fbe\u76ee\u7684\u5730","\u9014\u7ecf\u70b9","\u884c\u9a76"];baidu.extend(DrivingRoute.prototype,{setPolicy:function(policy){if(policy>=BMAP_DRIVING_POLICY_LEAST_TIME&&policy<=BMAP_DRIVING_POLICY_AVOID_HIGHWAYS){this._opts.policy=policy}else{this._opts.policy=BMAP_DRIVING_POLICY_LEAST_TIME}},_createResults:function(opts){return new DrivingRouteResult(opts)},_getTurnType:function(tt){return DrivingRoute.TURN_TYPE[tt]},_getRetType:function(rt){return DrivingRoute.RET_TYPE[rt]},toString:function(){return"DrivingRoute"}});function WalkingRoute(location,opts){DWRoute.call(this,location,opts);this.QUERY_TYPE=QUERY_TYPE_WALKING;this.RETURN_TYPE=RETURN_TYPE_WALKING;this.ROUTE_TYPE=BMAP_ROUTE_TYPE_WALKING;this.TRANS_INFO_WND_TYPE=TRANS_INFO_WND_WALKING}baidu.inherits(WalkingRoute,DWRoute,"WalkingRoute");WalkingRoute.TURN_TYPE=["","\u76f4\u8d70","\u5411\u53f3\u524d\u65b9\u8f6c","\u53f3\u8f6c","\u5411\u53f3\u540e\u65b9\u8f6c","\u5411\u540e\u8f6c","\u5411\u5de6\u540e\u65b9\u8f6c","\u5de6\u8f6c","\u5411\u5de6\u524d\u65b9\u8f6c","\u5de6\u8f6c\u7a7f\u8fc7\u9a6c\u8def\u5e76\u7ee7\u7eed\u5411\u524d","\u53f3\u8f6c\u7a7f\u8fc7\u9a6c\u8def\u5e76\u7ee7\u7eed\u5411\u524d","\u5de6\u8f6c\u7a7f\u8fc7\u9a6c\u8def\u5e76\u5f80\u56de\u8d70","\u53f3\u8f6c\u7a7f\u8fc7\u9a6c\u8def\u5e76\u5f80\u56de\u8d70","\u6b63\u5317\u65b9\u5411","\u4e1c\u5317\u65b9\u5411","\u6b63\u4e1c\u65b9\u5411","\u4e1c\u5357\u65b9\u5411","\u6b63\u5357\u65b9\u5411","\u897f\u5357\u65b9\u5411","\u6b63\u897f\u65b9\u5411","\u897f\u5317\u65b9\u5411","","","",""];WalkingRoute.RET_TYPE=["","\u4ece\u8d77\u70b9\u51fa\u53d1","\u5230\u8fbe\u76ee\u7684\u5730","\u9014\u7ecf\u70b9","\u8d70"];baidu.extend(WalkingRoute.prototype,{_createResults:function(opts){delete opts.url;return new WalkingRouteResult(opts)},_getTurnType:function(tt){return WalkingRoute.TURN_TYPE[tt]},_getRetType:function(rt){return WalkingRoute.RET_TYPE[rt]},toString:function(){return"WalkingRoute"}});function Line(opts){this.title=opts.title;this.uid=opts.uid;this.type=opts.type;this._stops=opts.stops.slice(0);this._points=opts.points.slice(0);this._distance=opts.distance||0;this._numViaStops=opts.numViaStops||0}baidu.extend(Line.prototype,{getNumViaStops:function(){return this._numViaStops},getGetOnStop:function(){return this._stops[0]},getGetOffStop:function(){return this._stops[1]},getPoints:function(){return this._points},getPolyline:function(){return this._polyline},getDistance:function(format){if(format===false){return this._distance}else{return formatDistance(this._distance)}}});function Popup(opts){baidu.lang.Class.call(this);this.visible=false;this.config=opts;if(!this.config){return}this.config.addDom=this.config.addDom?baidu.G(this.config.addDom):document.body;if(opts.clickClose!=null&&opts.clickClose==false){this.config.clickClose=false}else{this.config.clickClose=true}this.connectDom=new Array()}baidu.extend(Popup.prototype,{render:function(){var config=this.config;this.main=create("div",{style:"position:absolute;z-index:20;width:390px;display:none;font-size:12px;font-family:arial,sans-serif"});this.popBox=create("div",{style:"border:1px solid #8ba4d8;z-index:2;position:absolute;width:100%;height:100%;background:#FFF;overflow:hidden"});this.main.appendChild(this.popBox);if(config.isTitle!=false){this.title=create("div",{style:"background:url("+API_URL+"img/popup_title.gif);height:24px;line-height:25px;font-size:12px;font-weight:bold;color:#6688cc;padding-left:7px"});this.popBox.appendChild(this.title)}this.content=create("div");this.popBox.appendChild(this.content);this.button=create("button",{style:"position:absolute;top:6px;right:4px;width:12px;height:12px;background:url("+API_URL+"img/popup_close.gif) no-repeat;border:0;cursor:pointer",id:"popup_close"});this.popBox.appendChild(this.button);this.shadow=create("div",{style:"width:100%; height:100%; background:#505050;border:1px solid #505050; position:absolute;left:2px; top:3px;z-index:1;opacity:0.4;filter:alpha(opacity=40)"});this.main.appendChild(this.shadow);this.config.addDom.appendChild(this.main);this.addConnectDom(this.main);this.initialize()},initialize:function(){var config=this.config;this.setTitle(config.title);this.setContent(config.content);this.setWidth(config.width);this.setHeight(config.height);this.show();var me=this;var popClose=function(e){var ee=e.srcElement||e.target;while(ee){var dom=me.connectDom;for(var i=0;i<dom.length;i++){if(ee==dom[i]){return}}if(ee==document.body){me.close();return}ee=ee.parentNode}};if(this.config.clickClose){baidu.on(document.body,"mousedown",popClose)}baidu.on(this.button,"click",function(e){if(me.config.clickClose){baidu.un(document.body,"mousedown",popClose)}me.main.parentNode.removeChild(me.main);me.visible=false;if(me.config.close&&typeof(me.config.close)=="function"){me.config.close()}if(this.resizeTimer){window.clearInterval(this.resizeTimer);this.resizeTimer=null}if(baidu.G("imgLogo")){baidu.G("imgLogo").style.display="";baidu.G("imgLogo").style.display="inline"}});if(config.open&&typeof(config.open)=="function"){config.open()}},setTitle:function(title){if(title&&this.title){this.title.innerHTML=title;this.config.title=title}},setContent:function(content){if(content){if(typeof(content)=="string"){this.content.innerHTML=content}else{this.content.innerHTML="";this.content.appendChild(content)}this.config.content=content}},setWidth:function(w){if(w){this.main.style.width=(w-8)+"px";this.config.width=w}},setHeight:function(h){if(this.resizeTimer){window.clearInterval(this.resizeTimer);this.resizeTimer=null}if(h){this.main.style.height=this.shadow.style.height=(h-9)+"px";this.config.height=h;if(this.config.isTitle==false){this.content.style.height=(h-2)+"px"}else{this.content.style.height=(h-24-9)+"px"}this.content.style.overflowY="auto"}else{this.content.style.height="auto";this.resize()}},hide:function(){this.main.style.display="none";this.visible=false},show:function(){this.main.style.display="block";this.popBox.scrollTop=0;this.visible=true},getDom:function(){return this.main},resize:function(){var me=this;var resizeHeight=function(){var h=me.content.offsetHeight+24;if(me.mainHeight){if(me.mainHeight!=h){me.mainHeight=h}}me.popBox.style.height=me.shadow.style.height=me.main.style.height=h+"px";me.popBox.scrollTop=0};if(this.resizeTimer){window.clearInterval(this.resizeTimer);this.resizeTimer=null}this.resizeTimer=window.setInterval(resizeHeight,50)},close:function(){this.button.click()},addConnectDom:function(dom){this.connectDom.push(dom)}});function RouteResult(opts){this.city=opts.city;this._start=opts.start;this._end=opts.end;this._plans=opts.plans;this.moreResultsUrl=opts.url}baidu.extend(RouteResult.prototype,{getStart:function(){return this._start},getEnd:function(){return this._end},getNumPlans:function(){return this._plans.length},getPlan:function(i){if(this._plans[i]){return this._plans[i]}}});function DrivingRouteResult(opts){RouteResult.call(this,opts);this.policy=opts.policy}baidu.inherits(DrivingRouteResult,RouteResult,"DrivingRouteResult");function WalkingRouteResult(opts){RouteResult.call(this,opts)}baidu.inherits(WalkingRouteResult,RouteResult,"WalkingRouteResult");function TransitRouteResult(opts){RouteResult.call(this,opts);this.policy=opts.policy}baidu.inherits(TransitRouteResult,RouteResult,"TransitRouteResult");var TrafficControl=function(opts){BMap.Control.call(this);BMap.MapType.B_LiveTraffic_MAP={tileUrls:["http://wp0.map.baidu.com/traffic/","http://wp1.map.baidu.com/traffic/","http://wp2.map.baidu.com/traffic/","http://wp3.map.baidu.com/traffic/"],tileSize:256,baseUnits:256,zoomLevelMin:1,zoomLevelMax:18,errorUrl:API_URL+"bmap/blank.gif",bounds:new BMap.Bounds(-21364736,-10616832,23855104,15859712),imgExtend:"png"};BMap.MapType.B_ForecastTraffic_MAP={tileUrls:["http://wp0.map.baidu.com/traffic/","http://wp1.map.baidu.com/traffic/","http://wp2.map.baidu.com/traffic/","http://wp3.map.baidu.com/traffic/"],tileSize:256,baseUnits:256,zoomLevelMin:1,zoomLevelMax:18,errorUrl:API_URL+"bmap/blank.gif",bounds:new BMap.Bounds(-21364736,-10616832,23855104,15859712),imgExtend:"png"};this.opened=false;this.anchorFixed=true;this.defaultAnchor=BMAP_ANCHOR_TOP_RIGHT;this.defaultOffset=new BMap.Size(10,10);this.type="default";this.now="";this.timer=null;this.weeks=["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"];this.week=0;this.hour=0;baidu.extend(this._opts,{offset:this.defaultOffset,panelOffset:new BMap.Size(this.defaultOffset.width+3,this.defaultOffset.height+22)});this.markers=[];this.city={beijing:{bound:new BMap.Bounds(13024002.48,4865927.36,12896002.48,4800007.36),point:new BMap.Point(12959415.04,4825643.77)},shanghai:{bound:new BMap.Bounds(13586486.26,3671676.37,13458486.26,3605756.37),point:new BMap.Point(13525431,3642155)},guangzhou:{bound:new BMap.Bounds(12673391.11,2664430.08,12545391.11,2598510.08),point:new BMap.Point(12612023,2630443)},shenzhen:{bound:new BMap.Bounds(12725451.44,2575402.35,12661451.44,2545962.35),point:new BMap.Point(12689847,2569003)}};baidu.extend(this._opts,opts||{});this.setOffset(this._opts.offset);this.setPanelOffset(this._opts.panelOffset)};TrafficControl.prototype=new BMap.Control();TrafficControl.time=3000*60;baidu.extend(TrafficControl.prototype,{initialize:function(map){this._map=map;var me=this;var div=document.createElement("div");baidu.extend(div.style,{background:"transparent url("+API_URL+"img/bgs.gif) no-repeat scroll -126px -309px",cursor:"pointer",height:"20px",top:"10px",width:"71px",zIndex:"800"});div.title="\u663e\u793a\u4ea4\u901a\u6d41\u91cf";map.getContainer().appendChild(div);this.bind(div);function showMarker(e){if(me._map){var mapBounds=me._map.getBounds();var cityName=null;var isquanguo=0;for(var key in me.city){if(mapBounds.containsBounds(me.city[key].bound)){isquanguo++}}for(var key in me.city){if(isquanguo<=1&&mapBounds.intersects(me.city[key].bound)!=null){cityName=key;break}}if(me._map.getZoom()>9){if(cityName==null){}if(e.type.indexOf("zoom")>0){if(me.ishide&&me.ishide==1){me.show();me.ishide=0}}me.removeMarker()}else{if(e.type.indexOf("zoom")>0){if(me.opened==1){me.ishide=1;me.addMarker()}}me.hide()}}}map.addEventListener("load",function(e){showMarker(e)});map.addEventListener("moveend",function(e){showMarker(e)});map.addEventListener("mapcontainerresize",function(e){showMarker(e)});map.addEventListener("dragend",function(e){showMarker(e)});map.addEventListener("zoomend",function(e){showMarker(e)});map.addEventListener("zoomstart",function(e){showMarker(e)});return div},bind:function(c){var me=this;c.onmouseover=function(){if(!me.opened){this.style.backgroundPosition="-126px -329px"}};c.onmouseout=function(){if(!me.opened){this.style.backgroundPosition="-126px -309px"}};c.onmousedown=function(){me.markers=[];this.style.backgroundPosition="-126px -349px"};c.onclick=function(){me._toggle()}},setWeek:function(obj){for(var i=0;i<7;i++){baidu.G("week_"+this.hashCode+"_"+i).className="";if(baidu.G("week_"+this.hashCode+"_"+i)==obj){this.week=i;obj.className="on";baidu.G("font_"+this.hashCode).innerHTML="\u661f\u671f"+obj.innerHTML+"&nbsp;";this.setForecast()}}},_genHtml:function(){var guid=this.hashCode;var weekName=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u65e5"];var htmls=['<div class="traffic_Panel" style="height:30px;padding:5px;-moz-user-select:none" onselectstart="return false">'];htmls.push('<div style="background:url('+API_URL+'img/tools_menu.gif) no-repeat 130px -85px;font-weight:bold" id="title_'+guid+'">\u5b9e\u65f6\u8def\u51b5</div>');htmls.push('<div style="margin-top:5px;height:20px"><span id="font_'+guid+'" style="float:left;color:#666">\u5f53\u524d\u65f6\u95f4\uff1a&nbsp;</span>');htmls.push('<span id="time_'+guid+'" style="float:left;color:#666"></span>');htmls.push('<span class="update" style="float:left;width:13px;height:14px;background:url('+API_URL+'img/tools_menu.gif) no-repeat -12px -18px;margin-left:5px;cursor:pointer" id="bt_'+guid+'" onclick="InstanceCore(\''+guid+'\').setPanel(this)" title="\u66f4\u65b0" ></span>');htmls.push('<a style="outline:none;float:right;color:#00f;text-decoration:none;line-height:15px;*line-height:18px" href="javascript:void(0)" onclick = "InstanceCore(\''+guid+"').switchInfo(this)\">\u67e5\u770b\u6d41\u91cf\u9884\u6d4b</a></div>");htmls.push('<table id="forecast_'+guid+'" width="233" style="font-size:12px;display:none;color:#6688ca; margin-top:5px"><tr>');htmls.push('<td style="width:35px">\u661f\u671f</td>');for(var i=0;i<7;i++){htmls.push('<td style="width:23px"><span style="padding:3px;cursor:pointer" id="week_'+guid+"_"+i+'" onclick = "InstanceCore(\''+guid+"').setWeek(this)\">"+weekName[i]+"</span></td>")}htmls.push("</tr><tr>");htmls.push('<td style="height:42px;width:35px"><div style="padding-top:16px;*padding-top:18px">\u65f6\u95f4</div></td>');htmls.push('<td colspan="7" style="188px">');htmls.push('<div style="background:url('+API_URL+'img/bar.gif) no-repeat 0 10px;width:193px;height:40px;overflow:hidden">');htmls.push('<div><div id="timeBox_'+guid+'" style="color:#6688cc;margin-left:74px;font-size:11px;overflow:hidden">12:00</div></div>');htmls.push('<div style="height:34px">');htmls.push('<div id="bar_prev_'+guid+'" style="overflow:hidden;width:9px;height:9px;cursor:pointer;float:left;margin-top:5px" onclick="InstanceCore(\''+guid+"').setBarBut('prev')\"></div>");htmls.push('<div id="bar_'+guid+'" style="width:9px;height:18px;background:url('+API_URL+'img/tools_menu.gif) no-repeat 0 -32px;float:left;margin-top:0;cursor:pointer;margin-left:74px;_margin-left:42px;margin-top:0px;"></div>');htmls.push('<div id="bar_next_'+guid+'" style="overflow:hidden;width:11px;*width:10px;height:9px;cursor:pointer;float:right;margin-top:5px" onclick="InstanceCore(\''+guid+"').setBarBut('next')\"></div>");htmls.push("</div></div></td></tr></table>");htmls.push('<div style="text-align:center;color:#9a9a9a;display:none" id="info_'+guid+'">\uff08\u57fa\u4e8e\u5386\u53f2\u6d41\u91cf\u7edf\u8ba1\u9884\u6d4b \u4ec5\u4f9b\u53c2\u8003\uff09</div></div>');return htmls.join("")},_launch:function(){var me=this;this._getTime();if(me.trafficTimer){clearInterval(me.trafficTimer)}me.trafficTimer=setInterval(function(){me._getTime()},TrafficControl.time);this.setBar();this.setBarTime(12)},_getTime:function(){if(this.type!="default"){return}var me=this;var aid=[{code:131,name:"beijing"},{code:289,name:"shanghai"},{code:257,name:"guangzhou"}];var k=true;var mType=BMap.MapType.B_LiveTraffic_MAP;this._getCityCode(function(code){for(var i=0;i<aid.length;i++){if(code==aid[i].code){scriptRequest(mType.tileUrls[0]+aid[i].name+".js?newmap=1",function(){me.updateTime(aid[i].name)},"traffic_js");return}}scriptRequest(mType.tileUrls[0]+"beijing.js?newmap=1",function(){me.updateTime("beijing")},"traffic_js")})},setPanel:function(obj){if(obj.className=="update"){this._getTime();return}else{if(obj.className=="update2"){obj.className="update1";baidu.G("forecast_"+this.hashCode).style.display=baidu.G("info_"+this.hashCode).style.display="none";this.pop.setHeight(53)}else{obj.className="update2";baidu.G("forecast_"+this.hashCode).style.display=baidu.G("info_"+this.hashCode).style.display="";this.pop.setHeight(150)}}},switchInfo:function(obj){var title=baidu.G("title_"+this.hashCode);var info=baidu.G("font_"+this.hashCode);var updeteBut=baidu.G("bt_"+this.hashCode);var font=["\u67e5\u770b\u6d41\u91cf\u9884\u6d4b","\u67e5\u770b\u5b9e\u65f6\u8def\u51b5"];if(obj.innerHTML==font[0]){this.type="forecast";obj.innerHTML=font[1];this.pop.setHeight(150);baidu.G("forecast_"+this.hashCode).style.display=baidu.G("info_"+this.hashCode).style.display="";title.innerHTML="\u6d41\u91cf\u9884\u6d4b";var week=new Date(this.now).getDay();info.innerHTML=this.weeks[week]+"&nbsp;";if(this.now){var t=new Date(this.now);baidu.G("time_"+this.hashCode).innerHTML=t.getHours()+":00";this.setWeek(baidu.G("week_"+this.hashCode+"_"+t.getDay()));this.week=t.getDay();this.hour=t.getHours()}this.setBarTime(this.hour);updeteBut.className="update2"}else{this.type="default";this._getTime();obj.innerHTML=font[0];baidu.G("time_"+this.hashCode).innerHTML="";this.pop.setHeight(53);baidu.G("forecast_"+this.hashCode).style.display=baidu.G("info_"+this.hashCode).style.display="none";title.innerHTML="\u5b9e\u65f6\u8def\u51b5";info.innerHTML="\u5f53\u524d\u65f6\u95f4\uff1a&nbsp;";updeteBut.className="update";this.addTrafficLay("B_LiveTraffic_MAP")}},addTrafficLay:function(type){if(this.currentTrafficLay){map.removeTileLayer(this.currentTrafficLay)}var bounds=new BMap.Bounds(-21364736,-10616832,23855104,15859712);var copyright=new BMap.Copyright(bounds,"",type);var tilelayer=new BMap.TileLayer({mapType:type,transparentPng:true});tilelayer.getTilesUrl=function(point,level){var mapType=BMap.MapType[this.mapType];if(typeof mapType!="object"){return null}var zoomUnits=mapType.baseUnits*Math.pow(2,(mapType.zoomLevelMax-level));var row=parseInt(point.lng/zoomUnits);var column=parseInt(point.lat/zoomUnits);var px=Math.floor(row/200);var py=Math.floor(column/200);var url="";var timekey=new Date().getTime();url=mapType.tileUrls[Math.abs(row+column)%mapType.tileUrls.length]+level+"/"+px+"/"+py+"/"+row+"_"+column+".png?t="+timekey;url=url.replace(/-(\d+)/gi,"M$1");return url};map.addTileLayer(tilelayer);this.currentTrafficLay=tilelayer},clearTrafficLay:function(){if(this.currentTrafficLay){map.removeTileLayer(this.currentTrafficLay)}},setMarker:function(){var me=this;var icon=new BMap.Icon(API_URL+"img/traffic.png",new BMap.Size(28,35),{offset:new BMap.Size(6,35)});for(var k in me.city){var point=me.city[k].point;if(me._map.config.coordType==BMAP_COORD_LNGLAT){point=BMap.Project.convertMC2LL(point)}if(!me.markers){me.markers=[]}var marker=new BMap.Marker(point,{icon:icon});me.markers.push(marker)}},addMarker:function(){var me=this;var mks=me.markers;for(var k in mks){if(mks[k].domElement==null){mks[k].addEventListener("click",function(){me._map.centerAndZoom(this.point,11);me.show()});me._map.addOverlay(mks[k]);mks[k].domElement.setAttribute("type","system");mks[k].siblingElement.setAttribute("type","system");mks[k].domElement.title="\u70b9\u51fb\u67e5\u770b\u4ea4\u901a\u6d41\u91cf"}mks[k].show()}},removeMarker:function(){var mks=this.markers;try{for(var k in mks){mks[k].hide()}}catch(e){}},updateTime:function(name){if(name==""||name==null||this.type!="default"){return}var newTime=window["_Lukuang_"+name];var t=new Date(newTime);baidu.G("time_"+this.hashCode).innerHTML=(t.getHours()<10?("0"+t.getHours()):t.getHours())+":"+(t.getMinutes()<10?("0"+t.getMinutes()):t.getMinutes());if(newTime&&newTime>this.now){this.now=newTime;this.updateTile()}},updateTile:function(){this.addTrafficLay("B_LiveTraffic_MAP")},_getCityCode:function(cbk){var pt=this._map.getCenter();var level=this._map.getZoom();if(this._map.config.coordType==BMAP_COORD_LNGLAT){pt=BMap.Project.convertLL2MC(pt)}DataMgr.request(function(json){if(json&&json.result&&json.result.type==RETURN_TYPE_CENTER){cbk&&cbk(json.content.uid)}},{qt:QUERY_TYPE_CENTER,b:pt.lng+","+pt.lat+";"+pt.lng+","+pt.lat,l:level})},setBar:function(){var me=this;var bt=baidu.G("bar_"+this.hashCode);function dragStart(){baidu.on(document,"onmousemove",dragIng);baidu.on(document,"onmouseup",dragEnd)}function dragIng(e){var x=e.clientX||e.x;var left=getPosition(baidu.G("bar_prev_"+me.hashCode)).left+9;var margin=x-left-4;if(margin<0){margin=0}if(margin>165){margin=165}if(FeBrowser.ie<=6&&FeBrowser.ie>0){bt.style.marginLeft=(margin*0.53)+"px"}else{bt.style.marginLeft=margin+"px"}baidu.G("timeBox_"+me.hashCode).style.marginLeft=(margin)+"px";me.setTimeBox()}function dragEnd(){baidu.un(document,"onmousemove",dragIng);baidu.un(document,"onmouseup",dragEnd);me.setForecast()}baidu.on(bt,"onmousedown",dragStart)},setBarTime:function(n){if(n<0){n=0}if(n>24){n=24}this.hour=n;var margin=n*(165/24);baidu.G("timeBox_"+this.hashCode).style.marginLeft=margin+"px";var bt=baidu.G("bar_"+this.hashCode);if(FeBrowser.ie<=6&&FeBrowser.ie>0){bt.style.marginLeft=(margin*0.53)+"px"}else{bt.style.marginLeft=margin+"px"}this.setTimeBox()},setTimeBox:function(){var box=baidu.G("timeBox_"+this.hashCode);var box2=baidu.G("time_"+this.hashCode);var margin=parseInt(box.style.marginLeft);var n=Math.ceil((margin-4)*24/165);this.hour=n;if(n<10){n="0"+n}box2.innerHTML=box.innerHTML=n+":00"},setBarBut:function(key){var box=baidu.G("timeBox_"+this.hashCode);var margin=parseInt(box.style.marginLeft);var n=Math.ceil((margin-4)*24/165);this.setBarTime(key=="next"?(n+1):(n-1));this.setForecast()},setForecast:function(){var hour=this.hour;if(hour==24){hour=0}var forecastUrl=[];var mForeType=BMap.MapType.B_ForecastTraffic_MAP;var mLiveType=BMap.MapType.B_LiveTraffic_MAP;for(var i=0;i<mLiveType.tileUrls.length;i++){mForeType.tileUrls[i]=mLiveType.tileUrls[i]+"history/"+this.week+"/"+hour+"/"}this.addTrafficLay("B_ForecastTraffic_MAP")},setPanelOffset:function(size){if(!size||size.toString()!="Size"){return}this._opts.panelOffset=new BMap.Size(size.width,size.height);if(this.pop&&this.pop.getDom()){this.pop.getDom().style.right=size.width+"px";this.pop.getDom().style.top=size.height+"px"}},show:function(){if(this.opened){return}var me=this;this.setMarker();this.opened=true;this._container.style.backgroundPosition="-126px -349px";this._container.title="\u9690\u85cf\u4ea4\u901a\u6d41\u91cf";var opts={height:53,width:251,addDom:me._map.getContainer(),clickClose:false,isTitle:false,close:function(){me.hide()}};var pop=me.pop=new Popup(opts);pop.render();pop.hide();pop.content.innerHTML=me._genHtml();pop.getDom().style.right=me._opts.panelOffset.width+"px";pop.getDom().style.top=me._opts.panelOffset.height+"px";pop.getDom()._anchor=me.defaultAnchor;pop.getDom()._offset=me._opts.panelOffset;pop.show();var popclose=baidu.G("popup_close");popclose.onmouseup=function(){if(me.markers){mks=me.markers;for(var k in mks){mks[k].remove()}}me.markers=null};me._launch()},hide:function(){if(!this.opened){return}this.opened=false;this.now="";this.type="default";this.pop.close();if(this._container){this._container.style.backgroundPosition="-126px -309px";this._container.title="\u663e\u793a\u4ea4\u901a\u6d41\u91cf"}if(this.trafficTimer){clearInterval(this.trafficTimer)}this.clearTrafficLay()},_toggle:function(){if(this.opened){this.hide()}else{this.show()}}});function scriptRequest(url,echo,id,charset){var isIe=/msie/i.test(window.navigator.userAgent);if(isIe&&baidu.G("_script_"+id)){var script=baidu.G("_script_"+id)}else{if(baidu.G("_script_"+id)){baidu.G("_script_"+id).parentNode.removeChild(baidu.G("_script_"+id))}var script=document.createElement("script");if(charset!=null){script.charset=charset}if(id!=null&&id!=""){script.setAttribute("id","_script_"+id)}script.setAttribute("type","text/javascript");document.body.appendChild(script)}var t=new Date();if(url.indexOf("?")>-1){url+="&t="+t.getTime()}else{url+="?t="+t.getTime()}var _complete=function(){if(!script.readyState||script.readyState=="loaded"||script.readyState=="complete"){if(typeof(echo)=="function"){echo()}else{eval(echo)}}};if(isIe){script.onreadystatechange=_complete}else{script.onload=_complete}script.setAttribute("src",url)}function getBPoints(bounds){if(!bounds||bounds.length==0){return}var points=[];for(var i=0;i<bounds.length;i++){if(bounds[i]){var pts=bounds[i].split(";");for(var j=0;j<pts.length;j++){var point=getPointByStr(pts[j]);points.push(point)}}}return points}function getPosition(obj){var pos={left:0,top:0};while(obj&&obj.offsetParent){pos.left+=obj.offsetLeft;pos.top+=obj.offsetTop;obj=obj.offsetParent}return pos}function TrafficMgr(){this.map=null;this.tiles=[];this.forecastTileUrl=null;this.errorUrl=API_URL+"bmap/blank.gif";this.tileID=0;this.isStart=true;this.city={beijing:{bound:new BMap.Bounds(13024002.48,4865927.36,12896002.48,4800007.36),point:new BMap.Point(12959136.03,4825197.38)},shanghai:{bound:new BMap.Bounds(13586486.26,3671676.37,13458486.26,3605756.37),point:new BMap.Point(13524118.26,3642780.37)},guangzhou:{bound:new BMap.Bounds(12673391.11,2664430.08,12545391.11,2598510.08),point:new BMap.Point(12610000.11,2630914.08)},shenzhen:{bound:new BMap.Bounds(12725451.44,2575402.35,12661451.44,2545962.35),point:new BMap.Point(12690011.44,2569042.35)}};this.markers=[];this.tileKey=""}TrafficMgr.prototype.initialize=function(map){this.map=map;var me=this;this.isStart=true;if(!map.temp.trafficDiv){map.temp.trafficDiv=create("font",{style:"position:absolute;top:0;left:0;width:0;height:0;z-index:5",type:"system"});map.platform.appendChild(map.temp.trafficDiv);map.addEventListener("load",function(e){me.setTrafficDiv(e)});map.addEventListener("moveend",function(e){me.setTrafficDiv(e)});map.addEventListener("mapcontainerresize",function(e){me.setTrafficDiv(e)});map.addEventListener("dragend",function(e){me.setTrafficDiv(e)});map.addEventListener("zoomend",function(e){me.setTrafficDiv(e);map.temp.trafficDiv.style.display=""});map.addEventListener("zoomstart",function(e){map.temp.trafficDiv.style.display="none"})}this.setMarker()};TrafficMgr.prototype.setTrafficDiv=function(){if(!this.isStart){return}var map=this.map;var tilesDiv=map.temp.tilesDiv;var trafficDiv=map.temp.trafficDiv;trafficDiv.style.left=tilesDiv.style.left;trafficDiv.style.top=tilesDiv.style.top;if(map.getZoom()>9){var mapBounds=map.getBounds();if(map.config.coordType==BMAP_COORD_LNGLAT){var pts=getPointsByBounds(mapBounds,map.config.coordType,BMAP_COORD_MERCATOR);mapBounds=new BMap.Bounds(pts[0].lng,pts[0].lat,pts[1].lng,pts[1].lat)}var cityName=null;for(var key in this.city){if(mapBounds.intersects(this.city[key].bound)!=null){this.getTilesUrl();cityName=key;break}}if(cityName==null){this.clear()}this.removeMarker()}else{this.clear();this.addMarker()}};TrafficMgr.prototype.getTilesUrl=function(){var map=this.map;var tileMgr=map.tileMgr;var tileOrder=tileMgr.tilesOrder;var zoomLevel=map.zoomLevel;var centerPoint=map.centerPoint;var zoomUnits=map.getZoomUnits(map.zoomLevel);var levelUnits=tileMgr.baseUnits*Math.pow(2,(tileMgr.maxZoomLevel-zoomLevel));var centerPixX=-Math.round(centerPoint.lng/zoomUnits);var centerPixY=Math.round(centerPoint.lat/zoomUnits);var centerPosition=[centerPixX,centerPixY];var tilesOld=this.tiles;var tilesNew=[];for(var i=0;i<tileOrder.length;i++){var tile={};tile.x=tileOrder[i][0];tile.y=tileOrder[i][1];tile.level=map.zoomLevel;if(this.tileKey==""){this.tileKey=new Date().getTime()}if(this.forecastTileUrl==null){tile.url=tileMgr.getTilesUrl(tile.x,tile.y,tile.level,[this.getTrUrl(this.tileUrl)])+"?t="+this.tileKey}else{tile.url=tileMgr.getTilesUrl(tile.x,tile.y,tile.level,[this.getTrUrl(this.forecastTileUrl)])+"?t="+this.tileKey}tile.left=(tile.x*tileMgr.tileSize)+Math.round(centerPosition[0]);tile.top=(-1-tile.y)*tileMgr.tileSize+Math.round(centerPosition[1]);var tileKey=tile.x+"_"+tile.y+"_"+tile.level;if(!this.tiles[tileKey]){if(FeBrowser.ie<=6&&FeBrowser.ie>0){var img=create("img",{type:"system",src:this.errorUrl,style:'position:absolute;_filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+tile.url+'");left:'+tile.left+"px;top:"+tile.top+"px;width:256px;height:256px"});map.temp.trafficDiv.appendChild(img)}else{var img=create("img",{type:"system",src:tile.url,onerror:"this.src="+this.errorUrl,style:"position:absolute;left:"+tile.left+"px;top:"+tile.top+"px;width:256px;height:256px;display:none"});map.temp.trafficDiv.appendChild(img);img.onload=function(){this.style.display=""}}this.tiles[tile.x+"_"+tile.y+"_"+tile.level]=img}else{var img=this.tiles[tileKey];img.style.left=tile.left+"px";img.style.top=tile.top+"px"}tilesNew[tileKey]=img}for(var k in tilesOld){var img=tilesOld[k];if(!tilesNew[k]){map.temp.trafficDiv.removeChild(img)}}this.tiles=tilesNew};TrafficMgr.prototype.end=function(){this.clear();this.isStart=false;this.removeMarker()};TrafficMgr.prototype.clear=function(){var map=this.map;map.temp.trafficDiv.innerHTML="";this.tiles=[]};TrafficMgr.prototype.setMarker=function(){var me=this;var icon=new BMap.Icon(API_URL+"img/traffic.png",{height:35,width:28});for(var k in this.city){var marker=new BMap.Marker(this.city[k].point,{icon:icon,offset:[7,-17]});this.markers.push(marker)}};TrafficMgr.prototype.addMarker=function(){var me=this;var mks=this.markers;for(var k in mks){if(mks[k].domElement==null){mks[k].addEventListener("click",function(){me.map.centerAndZoom(this.point,11)});this.map.addOverlay(mks[k]);mks[k].domElement.setAttribute("type","system");mks[k].siblingElement.setAttribute("type","system");mks[k].domElement.title="\u70b9\u51fb\u67e5\u770b\u4ea4\u901a\u6d41\u91cf"}mks[k].show()}};TrafficMgr.prototype.getTrUrl=function(tileUrl){var k=this.tileID;var len=tileUrl.length;if(k>=len||k<0){k=0}this.tileID=(k+1);return tileUrl[k]};TrafficMgr.prototype.removeMarker=function(){var mks=this.markers;try{for(var k in mks){mks[k].hide()}}catch(e){}};function LocalCity(opts){this._opts={coordType:BMAP_COORD_LNGLAT,renderOptions:{map:null}};baidu.extend(this._opts,opts)}baidu.inherits(LocalCity,baidu.lang.Class);baidu.extend(LocalCity.prototype,{get:function(callback){var me=this;DataMgr.request(function(json){if(json&&json.result&&json.result.type==RETURN_TYPE_CURRENT_CITY){var result=json.result,content=json.content;if(result){if(result.error==0){var map=me._opts.renderOptions.map;var level=content.level;var cname=content.cname;var code=content.code;var point=parseGeo(content.geo,true,me._opts.coordType).point;level=getBestLevel(level,map);if(map){map.centerAndZoom(point,level)}}}callback&&callback({center:point,level:level,name:cname,code:code})}},{qt:QUERY_TYPE_LOCALCITY})},toString:function(){return"LocalCity"}});function Geocoder(opts){this._opts={coordType:BMAP_COORD_LNGLAT};baidu.extend(this._opts,opts)}baidu.inherits(Geocoder,baidu.lang.Class);baidu.extend(Geocoder.prototype,{getPoint:function(address,callback,city){var me=this;city=city||"\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd";DataMgr.request(function(json){if(json&&json.result&&json.result.type==RETURN_TYPE_GEOCODER){var result=json.result,content=json.content,point=null;if(result){if(result.error==0){var x=content.coord.x,y=content.coord.y;point=new BMap.Point(x,y);if(me._opts.coordType==BMAP_COORD_LNGLAT){point=BMap.Project.convertMC2LL(point)}me.point=point;me.city=content.cn;me.citycode=content.sc;me.address=content.wd;me.precision=content.precision}}callback&&callback(point,{city:content.cn,address:content.wd,citycode:content.sc})}},{qt:QUERY_TYPE_GEOCODER,wd:address,cn:city})},toString:function(){return"Geocoder"}});function mg(name,value){if(!window.BMap){window.BMap={}}window.BMap[name]=value}function jsonToQuery(json,encode){var s=[];encode=encode||function(v){return v};for(var n in json){s.push(n+"="+encode(json[n]))}return s.join("&")}function create(tag,attr){var e=document.createElement(tag);attr=attr||{};for(var name in attr){name={"for":"htmlFor","class":"cssClass"}[name]||name;if(name=="style"){e.style.cssText=attr[name];continue}if(e.setAttribute){e.setAttribute(name,attr[name])}else{try{e[name]=attr[name]}catch(e){}}}return e}function unique(a){var found=false;var r=[],o={};for(var i=0,l=a.length;i<l;i++){if(!o[a[i]]){o[a[i]]=true;r.push(a[i])}}return r}function getBestLevel(level,map){if(map){var ratio=Math.min(map.width/1100,map.height/660);level=Math.round(level+(Math.log(ratio)/Math.log(2)))}if(level<1){level=1}if(level>18){level=18}return level}window.BMAP_STATUS_SUCCESS=0;window.BMAP_STATUS_CITY_LIST=1;window.BMAP_STATUS_UNKNOWN_LOCATION=2;window.BMAP_STATUS_UNKNOWN_ROUTE=3;window.BMAP_STATUS_INVALID_KEY=4;window.BMAP_STATUS_INVALID_REQUEST=5;window.BMAP_ROUTE_TYPE_WALKING=2;window.BMAP_ROUTE_TYPE_DRIVING=3;var QUERY_TYPE_CURRENT_CITY="cur";var QUERY_TYPE_CENTER="cen";var QUERY_TYPE_POI_SEARCH="s";var QUERY_TYPE_SEARCH_INBOUNDS="bd";var QUERY_TYPE_SEARCH_NEARBY="nb";var QUERY_TYPE_TRANSIT="bt";var QUERY_TYPE_DRIVING="nav";var QUERY_TYPE_WALKING="walk";var QUERY_TYPE_GEOCODER="gc";var QUERY_TYPE_LOCALCITY="dec";var RETURN_TYPE_CURRENT_CITY=2;var RETURN_TYPE_CENTER=4;var RETURN_TYPE_CITY_LIST=7;var RETURN_TYPE_POI_SEARCH=11;var RETURN_TYPE_SEARCH_NEARBY=12;var RETURN_TYPE_TRANSIT=14;var RETURN_TYPE_DRIVING=20;var RETURN_TYPE_SEARCH_INBOUNDS=21;var RETURN_TYPE_SPECIAL_REGION=26;var RETURN_TYPE_NODATA_REGION=28;var RETURN_TYPE_WALKING=31;var RETURN_TYPE_GEOCODER=35;var LOC_TYPE_UNKNOWN=-1;var LOC_TYPE_MAP=0;var LOC_TYPE_POINT=1;var LOC_TYPE_STRING=2;var GEO_TYPE_AREA=0;var GEO_TYPE_LINE=1;var GEO_TYPE_POINT=2;var MAP_URL="http://map.baidu.com/";var API_URL="http://api.map.baidu.com/";function parseGeo(geo,usePoint,coordType){if(typeof geo!="string"||!geo){return}var temp=geo.split("|");var r;var bdpt0;var bdpt1;if(temp.length==1){r=decode_geo_diff(geo)}else{r=decode_geo_diff(temp[2]);bdpt0=decode_geo_diff(temp[0]);bdpt1=decode_geo_diff(temp[1])}var ret={type:r.geoType};if(usePoint){switch(ret.type){case GEO_TYPE_POINT:ret.point=new BMap.Point(r.geo[0][0],r.geo[0][1]);ret.points=[ret.point];if(typeof coordType=="number"&&coordType==BMAP_COORD_LNGLAT){var npt=BMap.Project.convertMC2LL(ret.point);ret.point=npt;ret.points=[npt]}break;case GEO_TYPE_LINE:ret.points=[];var curGeo=r.geo[0];for(var i=0,l=curGeo.length-1;i<l;i+=2){var pt=new BMap.Point(curGeo[i],curGeo[i+1]);if(typeof coordType=="number"&&coordType==BMAP_COORD_LNGLAT){pt=BMap.Project.convertMC2LL(pt)}ret.points.push(pt)}bdpt0=new BMap.Point(bdpt0.geo[0][0],bdpt0.geo[0][1]);bdpt1=new BMap.Point(bdpt1.geo[0][0],bdpt1.geo[0][1]);if(typeof coordType=="number"&&coordType==BMAP_COORD_LNGLAT){bdpt0=BMap.Project.convertMC2LL(bdpt0);bdpt1=BMap.Project.convertMC2LL(bdpt1)}ret.bounds=new BMap.Bounds(bdpt0.lng,bdpt0.lat,bdpt1.lng,bdpt1.lat);break;default:break}}return ret}var _EXT_CHARS_=["=",".","-","*"];var _MAX_DELTA_=1<<23;function decode_geo_diff(coded){var geo_type=_decode_type(coded.charAt(0));var code=coded.substr(1);var pos=0;var code_len=code.length;var part_vec=[];var geo_vec=[];var ret=[];while(pos<code_len){if(code.charAt(pos)==_EXT_CHARS_[0]){if((code_len-pos)<13){return 0}ret=_decode_6byte_(code.substr(pos,13),part_vec);if(ret<0){return 0}pos+=13}else{if(code.charAt(pos)==";"){geo_vec.push(part_vec.slice(0));part_vec.length=0;++pos}else{if((code_len-pos)<8){return 0}ret=_decode_4byte_(code.substr(pos,8),part_vec);if(ret<0){return 0}pos+=8}}}for(var i=0,l=geo_vec.length;i<l;i++){for(var j=0,ll=geo_vec[i].length;j<ll;j++){geo_vec[i][j]/=100}}return{geoType:geo_type,geo:geo_vec}}function _decode_type(c){var r=-1;if(c==_EXT_CHARS_[1]){r=GEO_TYPE_POINT}else{if(c==_EXT_CHARS_[2]){r=GEO_TYPE_LINE}else{if(c==_EXT_CHARS_[3]){r=GEO_TYPE_AREA}}}return r}function _decode_6byte_(code,ret){var x=0;var y=0;var buff=0;for(var i=0;i<6;i++){buff=_char2num_(code.substr(1+i,1));if(buff<0){return -1-i}x+=buff<<(6*i);buff=_char2num_(code.substr(7+i,1));if(buff<0){return -7-i}y+=buff<<(6*i)}ret.push(x);ret.push(y);return 0}function _decode_4byte_(code,ret){var l=ret.length;if(l<2){return -1}var x=0;var y=0;var buff=0;for(var i=0;i<4;i++){buff=_char2num_(code.substr(i,1));if(buff<0){return -1-i}x+=buff<<(6*i);buff=_char2num_(code.substr(4+i,1));if(buff<0){return -5-i}y+=buff<<(6*i)}if(x>_MAX_DELTA_){x=_MAX_DELTA_-x}if(y>_MAX_DELTA_){y=_MAX_DELTA_-y}ret.push(ret[l-2]+x);ret.push(ret[l-1]+y);return 0}function _char2num_(c){var n=c.charCodeAt(0);if(c>="A"&&c<="Z"){return n-"A".charCodeAt(0)}else{if(c>="a"&&c<="z"){return(26+n-"a".charCodeAt(0))}else{if(c>="0"&&c<="9"){return(52+n-"0".charCodeAt(0))}else{if(c=="+"){return 62}else{if(c=="/"){return 63}}}}}return -1}function formatDistance(dis){if(typeof dis=="string"){dis=parseFloat(dis)}var ret;if(!dis||dis<0){ret="0\u7c73"}else{if(dis<=10){ret="10\u7c73"}else{ret=dis<1000?Math.round(dis/10)*10+"\u7c73":(dis/1000).toFixed(1)+"\u516c\u91cc"}}if(ret=="1000\u7c73"){ret="1.0\u516c\u91cc"}return ret}function convertCoord(point,fromCoord,toCoord){var ret=point;switch(fromCoord){case BMAP_COORD_MERCATOR:switch(toCoord){case BMAP_COORD_LNGLAT:ret=BMap.Project.convertMC2LL(point);break;default:break}break;case BMAP_COORD_LNGLAT:switch(toCoord){case BMAP_COORD_MERCATOR:ret=BMap.Project.convertLL2MC(point);break;default:break}break;default:break}return ret}function getPointsByBounds(bounds,fromCoordType,toCoordType){var pt0=new BMap.Point(bounds.minX,bounds.minY);var pt1=new BMap.Point(bounds.maxX,bounds.maxY);if(typeof fromCoordType!="undefined"&&typeof toCoordType!="undefined"){pt0=convertCoord(pt0,fromCoordType,toCoordType);pt1=convertCoord(pt1,fromCoordType,toCoordType)}return[pt0,pt1]}function parseGeoStr(str,coord){var pts=str.split(",");var pt=new BMap.Point(pts[0],pts[1]);return convertCoord(pt,BMAP_COORD_MERCATOR,coord)}window.Instance=baidu.lang.instance;function Page(container,callback,opts){baidu.lang.Class.call(this);if(!container){return}this.container=(typeof(container)=="object")?container:baidu.G(container);this.page=1;this.pageCount=100;this.argName="pg";this.pagecap=4;this.callback=callback;this.update=true;var _config={page:1,totalCount:100,pageCount:100,pagecap:4,argName:"pg",update:true};if(!opts){opts=_config}for(var p in opts){if(typeof(opts[p])!="undefined"){this[p]=opts[p]}}this.render()}baidu.extend(Page.prototype,{render:function(){this.initialize()},initialize:function(){this.checkPages();this.container.innerHTML=this.createHtml()},checkPages:function(){if(isNaN(parseInt(this.page))){this.page=1}if(isNaN(parseInt(this.pageCount))){this.pageCount=1}if(this.page<1){this.page=1}if(this.pageCount<1){this.pageCount=1}if(this.page>this.pageCount){this.page=this.pageCount}this.page=parseInt(this.page);this.pageCount=parseInt(this.pageCount)},getPage:function(){var args=location.search;var reg=new RegExp("[?&]?"+this.argName+"=([^&]*)[&$]?","gi");var chk=args.match(reg);this.page=RegExp.$1},createHtml:function(){var strHtml=[],prevPage=this.page-1,nextPage=this.page+1;strHtml.push('<p style="margin:0;padding:0;white-space:nowrap">');if(prevPage<1){}else{if(this.page>=this.pagecap){strHtml.push('<span style="margin-right:3px"><a style="color:#7777cc" href="javascript:void(0)" onclick="Instance(\''+this.guid+"').toPage(1);\">\u9996\u9875</a></span>")}strHtml.push('<span style="margin-right:3px"><a style="color:#7777cc" href="javascript:void(0)" onclick="Instance(\''+this.guid+"').toPage("+prevPage+');">\u4e0a\u4e00\u9875</a></span>')}if(this.page<this.pagecap){if(this.page%this.pagecap==0){var startPage=this.page-this.pagecap-1}else{var startPage=this.page-this.page%this.pagecap+1}var endPage=startPage+this.pagecap-1}else{var spt=Math.floor(this.pagecap/2);var mod=this.pagecap%2-1;if(this.pageCount>this.page+spt){var endPage=this.page+spt;var startPage=this.page-spt-mod}else{var endPage=this.pageCount;var startPage=this.page-spt-mod}}if(this.page>this.pageCount-this.pagecap&&this.page>=this.pagecap){var startPage=this.pageCount-this.pagecap+1;var endPage=this.pageCount}for(var i=startPage;i<=endPage;i++){if(i>0){if(i==this.page){strHtml.push('<span style="margin-right:3px">'+i+"</span>")}else{if(i>=1&&i<=this.pageCount){strHtml.push('<span><a style="color:#7777cc;margin-right:3px" href="javascript:void(0)" onclick="Instance(\''+this.guid+"').toPage("+i+');">['+i+"]</a></span>")}}}}if(nextPage>this.pageCount){}else{strHtml.push('<span><a style="color:#7777cc" href="javascript:void(0)" onclick="Instance(\''+this.guid+"').toPage("+nextPage+');">\u4e0b\u4e00\u9875</a></span>')}strHtml.push("</p>");return strHtml.join("")},toPage:function(page){var turnTo=page?page:1;if(typeof(this.callback)=="function"){this.callback(turnTo);this.page=turnTo}if(this.update){this.render()}}});mg("LocalSearch",LocalSearch);mg("TransitRoute",TransitRoute);mg("DrivingRoute",DrivingRoute);mg("WalkingRoute",WalkingRoute);mg("TrafficControl",TrafficControl);mg("Geocoder",Geocoder);mg("LocalCity",LocalCity);var STAT_APPJS_EXECUTE = 5100;window._addStat(STAT_APPJS_EXECUTE,{v:"1.0"});})();