(function(){
(function(){
})();
(function(){
window._YoudaoGlobalName_="youdao";
window[_YoudaoGlobalName_]={};
var _1="./";
var _2=function(){
var _3=arguments,_4=null,_5;
for(var i=0;i<_3.length;i=i+1){
_5=_3[i].split(".");
_4=window[_YoudaoGlobalName_];
for(var j=(window._YoudaoGlobalName_==_5[0])?1:0;j<_5.length;j=j+1){
if(_4[_5[j]]==undefined){
_4[_5[j]]={};
}
_4=_4[_5[j]];
}
}
};
var _8=function(_9,_a){
for(var _b in _a){
try{
_9[_b]=_a[_b];
}
catch(e){
}
}
return _9;
};
var _c=function(){
var r=Math.random().toString();
return (r.replace(/\./g,""));
};
var _e=function(_f){
if(_f==undefined||_f==null||typeof (_f)==undefined){
return false;
}
return true;
};
var _10=function(_11,obj,_13){
if(!_11||!obj){
return _11;
}
if(_11.func==_11&&_11.obj==obj&&_11.postFunc==_13){
return _11;
}
var _14=function(){
var _15=_11.apply(obj,arguments);
var _16=_13||null;
if(_16!=null&&typeof (_16)=="function"){
_16.apply(obj,arguments);
}
return _15;
};
_14.func=_11;
_14.obj=obj;
_14.postFunc=_13;
return _14;
};
var _17=function(_18){
if(_18&&_18.func){
return _18.func+_18.obj+_18.postFunc;
}else{
return _18;
}
};
var _19=function(_1a){
var _1b=new Date().getTime();
for(var i=0;i<10000000;i++){
if((new Date().getTime()-_1b)>_1a){
break;
}
}
};
var _1d=function(q){
var n=0,n2=0;
var _21=q;
var s;
while(n>=0){
n=q.indexOf("=",n);
n2=q.indexOf("&",n);
if(n>=0){
if(n2>n){
s=q.substring(n+1,n2);
}else{
s=q.substring(n+1);
}
if(!s.match(/^.*(%[A-z0-9]{2}){3}.*$/)){
var rs=encodeURIComponent(s);
if(rs!=s){
_21=_21.replace(s,rs);
}
}
}else{
break;
}
n=n2;
}
return _21;
};
var now=function(){
return (new Date()).getTime();
};
var _25=function(_26){
return _26.replace(/^\s*/,"").replace(/\s*$/,"");
};
var _27=function(str,_29,_2a){
return str.replace(new RegExp(_29,"gm"),_2a);
};
var _2b=function(_2c){
return _2c.replace(/-\D/g,function(_2d){
return _2d.charAt(1).toUpperCase();
});
};
var add=function(){
if(arguments.length<1){
return NaN;
}
vars=arguments;
sum=0;
for(var i=0;i<vars.length;i++){
sum=sum+parseFloat(vars[i]);
}
return sum;
};
var _30=function(obj,_32){
for(var i=0;i<_32.length;i++){
if(_32[i]==obj){
return i;
}
}
return -1;
};
var _34={ClassTypeError:"ClassTypeError",AbstractFunctionError:"AbstractFunctionError",BadParaError:"BadParaError"};
var Log={log:function(_36,_37){
if(!Log.enabled){
return;
}
var _38=Log.pattern;
if(_e(_38)){
if(!_e(_36.match)||!_36.match(_38)){
return;
}
}
if(_37==true||Log.printtime){
var _39=new Date();
_36="["+_39.toLocaleString()+" "+_39.getTime()/1000+"] "+_36;
}
if(_e(window.console)){
window.console.log(_36);
}else{
if(_e(window.opera)){
window.opera.postError(_36);
}else{
document.title=_36;
}
}
},printtime:false,pattern:null,enabled:false,setPattern:function(_3a){
this.pattern=_3a;
},printTimeOrNot:function(b){
if(b==true){
this.printtime=b;
}
if(b==false){
this.printtime=b;
}
}};
_2("maps.basis.utils");
var _Y=window[_YoudaoGlobalName_].maps.basis;
_Y.baseurl=_1;
var _YU=_Y.utils;
_YU.namespace=_2;
_YU.inject=_8;
_YU.getRandomId=_c;
_YU.check=_e;
_YU.bind=_10;
_YU.now=now;
_YU.getFunctionKey=_17;
_YU.trim=_25;
_YU.camelCase=_2b;
_YU.add=add;
_YU.indexOf=_30;
_YU.replaceAll=_27;
_YU.sleep=_19;
_YU.encodeUrlStr=_1d;
_Y.Errors=_34;
_2("Log");
_Y.Log=Log;
_Y.log=_Y.Log.log;
})();
(function(){
var _Y=window[_YoudaoGlobalName_].maps.basis;
var _YU=_Y.utils;
var _40={Engine:{name:"unknown",version:0},Platform:{name:(window.orientation!=undefined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.querySelector)},Engines:{presto:function(){
return (!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925));
},trident:function(){
return (!window.ActiveXObject)?false:((window.XMLHttpRequest)?5:4);
},webkit:function(){
return (navigator.taintEnabled)?false:((_40.Features.xpath)?((_40.Features.query)?525:420):419);
},gecko:function(){
return (document.getBoxObjectFor==undefined)?false:((document.getElementsByClassName)?19:18);
}},detect:function(){
for(var _41 in this.Engines){
var _42=this.Engines[_41]();
if(_42){
this.Engine={name:_41,version:_42};
this.Engine[_41]=this.Engine[_41+_42]=true;
break;
}
}
return {name:_41,version:_42};
},Request:function(){
var xhr=null;
if(!_40.Engine.trident){
xhr=new XMLHttpRequest();
}else{
xhr=new ActiveXObject("MSXML2.XMLHTTP");
}
return xhr;
}};
_40.Platform[_40.Platform.name]=true;
_40.detect();
_40.Features.xhr=!!(_40.Request());
_40.SVG=(!_40.Engine.trident);
_40.VML=_40.Engine.trident;
_Y.Browser=_40;
var _44=function(_45){
var _46=_45.initialize||function(){
};
_46=_YU.inject(_46,_44.PreDefine);
superClass=_45.Extends||Object;
_46.prototype=new superClass;
_46.prototype.parent=superClass;
_46.prototype.constructor=_46;
_46.prototype=_YU.inject(_46.prototype,_45);
return _46;
};
_44.PreDefine={clazz:"Class",extend:function(_47){
_47=_47||{};
this.prototype=_YU.inject(this.prototype,_47);
}};
_Y.Class=_44;
var _48=new _44({clazz:"Element",initialize:function(tag,_4a){
var el=tag;
if(typeof tag=="string"){
try{
el=document.createElement(tag);
}
catch(e){
el=document.getElementById(tag);
}
}
el=$(el);
el=_YU.inject(el,_4a);
return el;
}});
_48.extend({appendText:function(_4c){
var p=document.createTextNode(_4c);
this.adopt(p);
},adopt:function(_4e){
_4e=$(_4e);
if(_4e){
this.appendChild(_4e);
}
},dispose:function(){
return (this.parentNode)?this.parentNode.removeChild(this):this;
},destroy:function(){
this.empty();
this.dispose();
return null;
},empty:function(){
if(!this.childNodes){
return this;
}
for(var i=0;i<this.childNodes.length;i++){
var _50=$(this.childNodes[i]);
if(_50.destroy){
_50.destroy();
}
}
return this;
},setStyle:function(_51,_52){
if(!_51){
return;
}
if(typeof (_51)=="string"){
if(_51.indexOf("#")>=0){
var _53=_51.split("#");
var _51=_53[0];
var _54=_53[1].toLowerCase();
switch(_54){
case "ie":
if(!_40.Engine.trident){
return;
}
break;
case "ie6":
if(!_40.Engine.trident4){
return;
}
break;
case "ie7":
if(!_40.Engine.trident5){
return;
}
break;
case "ff":
if(!_40.Engine.gecko){
return;
}
break;
case "firefox":
if(!_40.Engine.gecko){
return;
}
break;
case "opera":
if(!_40.Engine.presto){
return;
}
break;
case "chrome":
if(!_40.Engine.webkit){
return;
}
break;
}
}
_51=_YU.camelCase(_51);
}
switch(_51){
case "opacity":
var _55=parseFloat(_52);
this.style["opacity"]=_55;
this.style["filter"]="alpha(opacity="+(_55*100).toFixed()+")";
return;
case "float":
_51=(_40.Engine.trident)?"styleFloat":"cssFloat";
}
if(_52==String(Number(_52))){
_52=Math.round(_52);
}
try{
this.style[_51]=_52;
}
catch(e){
}
return this;
},setStyles:function(_56){
for(var _57 in _56){
this.setStyle(_57,_56[_57]);
}
return this;
},addListener:function(_58,fn){
if(_58=="unload"){
var old=fn,_5b=this;
fn=function(){
_5b.removeListener("unload",fn);
old();
};
}
if(this.addEventListener){
this.addEventListener(_58,fn,false);
}else{
this.attachEvent("on"+_58,fn);
}
return this;
},removeListener:function(_5c,fn){
if(this.removeEventListener){
this.removeEventListener(_5c,fn,false);
}else{
this.detachEvent("on"+_5c,fn);
}
return this;
},addEvent:function(_5e,fn){
var key=_YU.getFunctionKey(fn);
var _61=this.Events||{};
_61[_5e]=_61[_5e]||{};
if(_61[_5e][key]){
return this;
}
_61[_5e][key]=fn;
var _62=_5e,_63=_48.Events[_5e],_64=fn,_65=this;
if(_63){
if(_63.onAdd){
_63.onAdd.call(this,fn);
}
if(_63.condition){
_64=function(_66){
_66=_63.condition.call(this,_66);
if(_66){
return fn.call(this,_66);
}
return true;
};
}
_62=_63.base||_62;
}
var _67=function(e){
e=e||window.event;
var _69=new _Y.Event(e);
return fn.call(_65,_69);
};
var _6a=_48.NativeEvents[_62];
if(_6a){
if(_6a==2){
_67=function(_6b){
_6b=_6b||window.event;
var _6b=new _Y.Event(_6b);
if(_64.call(_65,_6b)===false){
_6b.stop();
}
};
}
this.addListener(_62,_67);
_61[_5e][key].origin={"type":_62,"handler":_67};
}
this.Events=_61;
return this;
},removeEvent:function(_6c,fn){
var _6e=this.Events||{};
var key=_YU.getFunctionKey(fn);
if(!_6e||!_6e[_6c]){
return this;
}
var _70=_6e[_6c][key];
if(!_70){
return this;
}
var _71=_48.Events[_6c];
var _72=_6c;
var _73=_70;
if(_71){
if(_71.onRemove){
_71.onRemove.call(this,fn);
}
}
if(_70.origin){
_72=_70.origin.type;
_73=_70.origin.handler;
}
this.removeListener(_72,_73);
_6e[_6c][key]=null;
delete _6e[_6c][key];
return this;
},addEvents:function(_74){
for(var _75 in _74){
this.addEvent(_75,_74[_75]);
}
return this;
},fireEvent:function(_76,_77,_78){
var _79=this.Events;
var e=new _Y.Event(_77);
var _7b=this;
if(!_79||!_79[_76]){
return this;
}
var _7c=function(){
e=e||window.event;
for(var key in _79[_76]){
var _7e=_79[_76][key];
_7e(e);
}
};
if(_78){
setTimeout(_7c,_78);
}else{
_7c();
}
return this;
},getWindow:function(){
if(this.ownerDocument){
return $(this.ownerDocument.window);
}else{
return $(window);
}
},getDocument:function(){
return this.ownerDocument?$(this.ownerDocument):$(document);
},getPosition:function(){
var pos=_80(this);
return {x:pos[0],y:pos[1]};
}});
_48.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};
_48.Events={mousescroll:{base:(_40.Engine.gecko)?"DOMMouseScroll":"mousewheel"}};
$=function(el){
if(!el){
return el;
}
if(el&&el.clazz){
return el;
}
if(typeof el=="string"){
return $.string(el);
}else{
return $.element(el);
}
},$.string=function(id){
if(!id){
return id;
}
id=document.getElementById(id);
return (id)?$.element(id):null;
};
$.element=function(el){
if(!el){
return el;
}
if(!el.clazz&&!el.$uid&&!(/^object|embed$/i).test(el.tagName)){
el=_YU.inject(el,_48.prototype);
}
return el;
};
_Y.Element=_48;
var _84=new _44({clazz:"Event",initialize:function(e,_86){
var _87=e||window.event;
var _88=_87?true:false;
if(_86&&typeof (_86)=="string"){
_87=_YU.inject({},_87);
_87.type=_86;
}
_87=_YU.inject(_87,_84.prototype);
if(!_87.preventDefault){
_YU.inject(_87,_89);
}
if(_88){
_87.buttonkey=_87.buttonkey||_8a(e);
_87.client=_87.client||_8b(e);
_87.page=_87.page||_8b(e,true);
_87.key=_87.key||_8c(e);
_87.code=_87.which||_87.keyCode;
_87.shift=_87.shiftKey;
_87.control=_87.ctrlKey;
_87.alt=_87.altKey;
_87.wheel=(_87.wheelDelta)?(_87.wheelDelta/120):(-(_87.detail||0)/3);
_87.wheel=Math.round(_87.wheel);
if(!_87.target){
_87.target=_87.srcElement;
}
}
return _87;
}});
_84.extend({buttonkey:null,client:null,page:null,key:null,code:null,shift:null,control:null,alt:null,wheel:null,stop:function(){
return this.stopPropagation().preventDefault();
}});
var _89={stopPropagation:function(){
this.cancelBubble=true;
return this;
},preventDefault:function(){
try{
this.returnValue=false;
}
catch(e){
_Y.log("[Exception@event@preventDefault]"+e.name+":"+e.message);
}
return this;
}};
if(!_40.Engine.gecko){
_84.extend(_89);
}
_Y.Event=_84;
_YU.inject(_84,{MouseKey:{"none":-1,"left":1,"right":3,"middle":2},KeyCode:{13:"enter",38:"up",40:"down",37:"left",39:"right",27:"esc",32:"space",8:"backspace",9:"tab",46:"delete",187:"=",189:"-"}});
var _8c=function(e){
e=e||window.event;
var _8e=e.which||e.keyCode;
if(!_8e){
return "none";
}
var key=_84.KeyCode[_8e];
var _90=_8e-111;
if(_90>0&&_90<13){
key="f"+_90;
}
key=key||String.fromCharCode(_8e).toLowerCase();
return key;
};
var _8b=function(_91,_92){
_91=_91||window.event;
doc=document;
if(_92==true){
if(_84.Global.page&&_91.type!="mousemove"){
var _93=_84.Global.page;
}else{
var _93={x:_91.pageX||_91.clientX+doc.body.scrollLeft,y:_91.pageY||_91.clientY+doc.body.scrollTop};
}
return _93;
}else{
if(_84.Global.client&&_91.type!="mousemove"){
var _94=_84.Global.client;
}else{
var _94={x:(_91.pageX)?_91.pageX-window.pageXOffset:_91.clientX,y:(_91.pageY)?_91.pageY-window.pageYOffset:_91.clientY};
}
return _94;
}
};
var _8a=function(_95){
_95=_95||window.event;
var key=_95.which||_95.button;
if(_40.Engine.trident){
if(_95.button==1){
return _84.MouseKey.left;
}else{
if(_95.button==2){
return _84.MouseKey.right;
}else{
if(_95.button==4){
return _84.MouseKey.middle;
}
}
}
}else{
if(_95.which==1){
return _84.MouseKey.left;
}else{
if(_95.which==3){
return _84.MouseKey.right;
}else{
if(_95.which==2){
return _84.MouseKey.middle;
}
}
}
}
return _84.MouseKey.none;
};
_84.Global={};
var _97=function(_98){
_84.Global.client=_98.client;
_84.Global.page=_98.page;
};
$(document).addEvent("mousemove",_97);
var _99=new _44({initialize:function(x,y){
this.x=x;
this.y=y;
}});
var _9c={"SCREEN":"screen","GEO":"geo"};
var _9d=new _44({initialize:function(_9e,_9f,_a0){
this.type=_a0?_a0:_9c.SCREEN;
this.leftBottom=_9e;
this.rightup=_9f;
this.left=this.leftBottom.x;
this.bottom=this.leftBottom.y;
this.right=this.rightup.x;
this.up=this.rightup.y;
this.top=this.up;
}});
_9d.extend({type:_9c.SCREEN,leftBottom:null,rightup:null,left:null,bottom:null,right:null,top:null});
var _a1=new _44({initialize:function(w,h){
if(typeof w=="string"){
w.replace("px");
w=parseInt(w);
}
if(typeof h=="string"){
h.replace("px");
h=parseInt(h);
}
this.width=w||0;
this.height=h||0;
this.w=this.width;
this.h=this.height;
this.x=this.w;
this.y=this.h;
}});
_a1.extend({width:0,height:0});
var _a4=function(dom){
if(!dom){
return new _a1(0,0);
}
var _a6;
if(_a7(dom)){
if(_40.Engine.presto||_40.Engine.webkit){
_a6={x:win.innerWidth,y:win.innerHeight};
}else{
var doc=document;
body=(!doc.compatMode||doc.compatMode=="CSS1Compat")?doc.html:doc.body;
_a6={x:body.clientWidth,y:body.clientHeight};
}
}else{
_a6={x:dom.offsetWidth,y:dom.offsetHeight};
}
_a6.x=_a6.x||dom.style.width;
_a6.y=_a6.y||dom.style.height;
return new _a1(_a6.x,_a6.y);
};
var _a9=function(dom,_ab){
dom=$(dom);
dom.setStyles(_ab);
};
var _a7=function(_ac){
if(!_ac||_ac.tagName){
return false;
}
return (/^(?:body|html)$/i).test(_ac.tagName);
};
var _80=function(el){
if(document.documentElement.getBoundingClientRect){
var box=el.getBoundingClientRect();
var _af=el.ownerDocument;
return [box.left+_b0(_af),box.top+_b1(_af)];
}else{
var pos=[el.offsetLeft,el.offsetTop];
var _b3=el.offsetParent;
var _b4=(_40.Engine.webkit&&el.style["position"]=="absolute"&&el.offsetParent==el.ownerDocument.body);
if(_b3!=el){
while(_b3){
pos[0]+=_b3.offsetLeft;
pos[1]+=_b3.offsetTop;
if(!_b4&&_40.Engine.webkit&&_b3.style["position"]=="absolute"){
_b4=true;
}
_b3=_b3.offsetParent;
}
}
if(_b4){
pos[0]-=el.ownerDocument.body.offsetLeft;
pos[1]-=el.ownerDocument.body.offsetTop;
}
_b3=el.parentNode;
while(_b3.tagName&&!/^body|html$/i.test(_b3.tagName)){
if(_b3.style["display"].search(/^inline|table-row.*$/i)){
pos[0]-=_b3.scrollLeft;
pos[1]-=_b3.scrollTop;
}
_b3=_b3.parentNode;
}
return pos;
}
};
var _b0=function(doc){
doc=doc||document;
return Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);
};
var _b1=function(doc){
doc=doc||document;
return Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);
};
var _b7=new _44({dom:null,clazz:"DomObject",initialize:function(){
this.eventHandlerCookie={};
},addEvent:function(_b8,_b9){
if(!this.eventHandlerCookie[_b8]){
this.eventHandlerCookie[_b8]={};
}
this.eventHandlerCookie[_b8][_b9]=_YU.bind(_b9,this);
this.dom.addEvent(_b8,this.eventHandlerCookie[_b8][_b9]);
},removeEvent:function(_ba,_bb){
this.dom.removeEvent(_ba,this.eventHandlerCookie[_ba][_bb]);
this.eventHandlerCookie[_ba][_bb]=null;
},existDom:function(){
return _YU.check(this.dom);
},maskEvent:function(_bc){
for(handler in this.eventHandlerCookie[_bc]){
this.dom.removeEvent(_bc,this.eventHandlerCookie[_bc][handler]);
}
},unmaskEvent:function(_bd){
for(handler in this.eventHandlerCookie[_bd]){
if(this.eventHandlerCookie[_bd][handler]){
this.dom.addEvent(_bd,this.eventHandlerCookie[_bd][handler]);
}
}
},setStyles:function(_be){
_a9(this.dom,_be);
},destroy:function(){
if(!this.dom){
return;
}
this.dom.destroy();
this.dom=null;
}});
_YU.Coordinate=_99;
_YU.Range=_9d;
_YU.RangeType=_9c;
_YU.Size=_a1;
_YU.getSize=_a4;
_YU.setStyles=_a9;
_YU.DomObject=_b7;
})();
(function(){
var _Y=window[_YoudaoGlobalName_].maps.basis;
var _YU=_Y.utils;
var _c1=new _Y.Class({initialize:function(){
var _c2,_c3,div;
var _c5=false;
var _c6;
var _c7=new _Y.Event(null,"historyStateChange");
var _c8=this;
var _c9=[];
function init(){
if(_Y.Browser.Engine.trident){
if(!_c2){
_c2=document.createElement("iframe");
_c2.setAttribute("id","history"+_YU.getRandomId());
_c3=$(_c2);
_c3.setStyles({"position":"absolute","top":"0","left":"0","width":"1px","height":"1px","visibility":"hidden"});
_c2.setAttribute("location",top.location.href);
}
if(!document.body){
setTimeout(init,10);
return;
}
document.body.appendChild(_c2);
checkIFrame();
}else{
if(!document.body){
setTimeout(init,10);
return;
}
_c3=$(document);
checkAnchor();
}
_c5=true;
if(_c9){
for(var i=0;i<_c9.length;i++){
addStateHandler(toAddhandlers[i]);
}
toAddhandlers=[];
}
}
function getAnchor(){
var _cb=top.location.href,i=_cb.indexOf("#");
return i>=0?_cb.substr(i+1):null;
}
function updateAnchor(_cd){
if(_cd){
top.location.hash="#"+_cd;
}else{
}
_c6=_cd;
}
function save(_ce){
if(!_c5){
_Y.log("[Exception@History@save] History not ready!");
return;
}
update(_ce);
}
function checkAnchor(){
setInterval(function(){
var _cf=getAnchor()||"";
if(_cf!=_c6&&_c6!=undefined){
update(_cf);
_c7.anchor=_cf;
_c3.fireEvent("historyStateChange",_c7);
}
},100);
}
function update(_d0){
if(_d0==undefined||_d0==_c6){
return;
}
if(_Y.Browser.Engine.trident){
var _d1=encodeURIComponent(_d0);
var _d2=["<html><body><div id=\"state\">",_d1,"</div></body></html>"].join("");
try{
var doc=_c2.contentWindow.document;
doc.open();
doc.write(_d2);
doc.close();
}
catch(e){
_Y.log("[Exception@History@update]"+e.name+":"+e.message);
}
}
updateAnchor(_d0);
}
function checkIFrame(){
setInterval(function(){
var doc=_c2.contentWindow.document;
var _d5=doc.getElementById("state");
var _d6=_d5?_d5.innerText:"NULL";
_d6=decodeURIComponent(_d6);
if(_d6!=_c6&&_d6!="NULL"){
updateAnchor(_d6);
_c7.anchor=_d6;
_c3.fireEvent("historyStateChange",_c7);
}
},100);
}
function addStateHandler(fn,obj){
if(obj){
fn=_YU.bind(fn,obj);
}
if(_c5){
_c3.addEvent("historyStateChange",fn);
}else{
_c9.push(fn);
}
}
init();
this.save=save;
this.addStateHandler=addStateHandler;
}});
_YU.History=_c1;
})();
(function(){
var _Y=window[_YoudaoGlobalName_].maps.basis;
var _YU=_Y.utils;
_Y.Element.extend({disableSelection:function(){
if(window.ie){
this.onselectstart=function(){
return false;
};
this.addStyle("cursor","default");
}else{
if(window.gecko){
this.setStyle("-moz-user-select","none");
this.setStyle("cursor","default");
}else{
this.onmousedown=function(){
return false;
};
this.setStyle("cursor","default");
}
}
}});
var _db={"doubleClickTime":300};
_Y.Element.Events.drag={base:"mousemove",condition:function(e){
if(_Y.Global.Drag.on&&_Y.Global.Drag.mousePressing==_Y.Event.MouseKey.left){
if(!_Y.Global.Drag.started){
_Y.Global.Drag.source=this;
}
e=new _Y.Event(e);
_Y.Global.Drag.started=true;
var pos=e.page;
_Y.Global.Drag.delta={"x":(pos.x-_Y.Global.Drag.start.x),"y":(pos.y-_Y.Global.Drag.start.y)};
e.delta=_Y.Global.Drag.delta;
e.start=_Y.Global.Drag.start;
e.now=pos;
if(e.preventDefault){
e.preventDefault();
}
if(_Y.Global.Drag.source!=this){
_Y.Global.Drag.source.fireEvent("drag",new _Y.Event(e,"drag"));
return null;
}
return e;
}else{
_Y.Global.Drag.on=false;
_Y.Global.Drag.started=false;
return null;
}
},onAdd:function(fn){
_Y.Global.Drag.mousePressing=_Y.Event.MouseKey.none;
_Y.Global.Drag.start={"x":NaN,"y":NaN};
this.mouseStateChange=function(e){
e=new _Y.Event(e);
if(e.type=="mousedown"){
_Y.Global.Drag.mousePressing=e.buttonkey;
_Y.Global.Drag.start=e.page;
this.style.cursor="move";
_Y.Global.Drag.on=true;
e.preventDefault();
}else{
e.delta=_Y.Global.Drag.delta;
e.start=_Y.Global.Drag.start;
e.now=e.page;
e.preventDefault();
if(_Y.Global.Drag.on&&_Y.Global.Drag.started){
_Y.Global.Drag.source.fireEvent("dragend",new _Y.Event(e,"dragend"));
}
_Y.Global.Drag.mousePressing=_Y.Event.MouseKey.none;
_Y.Global.Drag.start={"x":NaN,"y":NaN};
_Y.Global.Drag.on=false;
_Y.Global.Drag.started=false;
_Y.Global.Drag.source=null;
this.style.cursor="default";
}
},this.addEvent("mousedown",this.mouseStateChange);
this.addEvent("mouseup",this.mouseStateChange);
$(document).addEvent("mouseup",_YU.bind(this.mouseStateChange,this));
}};
_Y.Element.Events.rclick={base:"mouseup",condition:function(e){
e=e||window.event;
e=new _Y.Event(e);
if(e.buttonkey!=_Y.Event.MouseKey.right){
return null;
}
e.now=e.page;
var _e1=this;
var _e2=new _Y.Event(e,"rclick");
var _e3=function(){
if(!_Y.Global.RightClick.Double){
this.fireEvent("rclick",_e2);
}
};
var _e4=_YU.bind(_e3,_e1);
_Y.Global.RightClick.Timer=setTimeout(_e4,_db.doubleClickTime);
return null;
}};
_Y.Element.Events.dbrclick={base:"mouseup",condition:function(e){
_Y.Global.RightClick.Double=false;
e=new _Y.Event(e);
if(e.buttonkey!=_Y.Event.MouseKey.right){
return null;
}
e.now=e.page;
var _e6=_YU.now();
var gap=1000;
if(_Y.Global.RightClick.lastClickTime){
gap=_e6-_Y.Global.RightClick.lastClickTime;
}
e.stopPropagation();
_Y.Global.RightClick.lastClickTime=_e6;
if(gap<_db.doubleClickTime){
_Y.Global.RightClick.Double=true;
clearTimeout(_Y.Global.RightClick.Timer);
return e;
}else{
return null;
}
}};
_YU.namespace("maps.basis.Global.Drag");
_YU.namespace("maps.basis.Global.RightClick");
})();
(function(){
var _Y=window[_YoudaoGlobalName_].maps.basis;
var _YU=_Y.utils;
var _ea={zIndex:{basic:1,tile:0,overlay:3,control:10,max:1000},VMLPrefix:"vml"};
var _eb=new _Y.Class({Extends:_YU.DomObject,clazz:_eb,scale:{0:100,1:200,2:500,3:1000,4:2000,5:4000,6:8000,7:12000,8:25000,9:50000,10:100000,11:250000,12:500000,13:1000000},initialize:function(){
this.dom=new _Y.Element("div");
this.dom.id="scalebar";
this.dom.setStyles({"bottom":"20px","font":"0px Arial","height":"20px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","width":"50px","left":"20px",zIndex:_ea.zIndex.control,"position":"absolute"});
this.textDiv=new _Y.Element("div");
this.textDiv.setStyles({"bottom":"5px","font-size":"12px","font-weight":"bold","height":"15px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","text-align":"center","width":"100%"});
this.textDiv.innerHTML="500m";
this.barDiv=new _Y.Element("div");
this.barDiv.setStyles({"background-color":"green","bottom":"3px","height":"3px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","width":"100%"});
this.lbarDiv=new _Y.Element("div");
this.lbarDiv.setStyles({"background-color":"green","bottom":"0px","height":"10px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","right":"-1px","width":"2px"});
this.rbarDiv=new _Y.Element("div");
this.rbarDiv.setStyles({"background-color":"green","bottom":"0px","height":"10px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","width":"2px"});
this.dom.adopt(this.textDiv);
this.dom.adopt(this.barDiv);
this.dom.adopt(this.lbarDiv);
this.dom.adopt(this.rbarDiv);
},setWidth:function(wd){
this.dom.setStyle("width",wd+"px");
},setText:function(txt){
this.textDiv.innerHTML=txt;
},setDistance:function(_ee,_ef){
if(!(_ee>0)){
return;
}
if(_ee<1000){
this.setText(_ee+"m");
}else{
var dkm=_ee/1000;
this.setText(dkm+"km");
}
var _f1=this.map.geoUtil.distanceMeter2Pixel(_ee,_ef);
_Y.log("zoom:"+_ef+" distance: "+_ee+" scalebar width: "+_f1);
this.setWidth(_f1);
},addToMap:function(map){
this.map=map;
map.dom.adopt(this.dom);
},updateView:function(){
if(this.map.lastZoom!=this.map.zoom){
this.setDistance(this.scale[this.map.zoom],this.map.zoom);
}
}});
var _f3=new _Y.Class({Extends:_YU.DomObject,clazz:_f3,initialize:function(){
this.dom=new _Y.Element("div");
this.dom.id="mini_controller";
this.dom.setStyles({"height":"70px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","width":"30px","left":"20px","top":"20px",zIndex:_ea.zIndex.control,"position":"relative"});
this.plusIcon=new _Y.Element("div");
this.plusIcon.setStyles({"background":"transparent url("+_Y.baseurl+"img/zoomin.gif"+") no-repeat","height":"16px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","width":"30px"});
this.minusIcon=new _Y.Element("div");
this.minusIcon.setStyles({"background":"transparent url("+_Y.baseurl+"img/zoomout.gif"+") no-repeat","height":"30px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","width":"30px","left":"10px"});
this.dom.adopt(this.plusIcon);
this.dom.adopt(this.minusIcon);
this.dom.addEvent("mouseover",function(){
this.setStyle("cursor","pointer");
});
this.dom.addEvent("mouseout",function(){
this.setStyle("cursor","none");
});
},addToMap:function(map){
this.map=map;
this.minusIcon.map=map;
this.plusIcon.map=map;
map.dom.adopt(this.dom);
this.minusIcon.addEvent("click",function(){
this.map.zoomOut();
});
this.plusIcon.addEvent("click",function(){
this.map.zoomIn();
});
},updateView:function(){
}});
var _f5=new _Y.Class({Extends:_YU.DomObject,clazz:_f3,initialize:function(){
this.dom=new _Y.Element("div");
this.dom.id="std_controller";
this.dom.setStyles({"height":"231px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","width":"30px","left":"5px","top":"10px",zIndex:_ea.zIndex.control,"position":"relative"});
this.naviDiv=new _Y.Element("div");
this.naviDiv.setStyles({"height":"57px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","width":"57px"});
this.naviDiv.addEvent("mouseover",function(){
_Y.log("mouseover navidiv");
this.setStyle("cursor","pointer");
});
this.zoomDiv=new _Y.Element("div");
this.zoomDiv.setStyles({"padding-left":"19px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"relative","width":"90px"});
this.zoomDiv.addEvent("mouseover",function(){
this.tagDiv.setStyle("display","");
this.setStyle("cursor","pointer");
});
this.zoomDiv.addEvent("mouseout",function(){
this.tagDiv.setStyle("display","none");
this.setStyle("cursor","none");
});
this.tagDiv=new _Y.Element("div");
this.zoomDiv.tagDiv=this.tagDiv;
this.tagDiv.setStyles({"display":"none","padding-left":"18px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"relative"});
this.upIcon=new _Y.Element("div");
this.upIcon.setStyles({"background":"transparent url("+_Y.baseurl+"img/gtb.gif"+") no-repeat","height":"19px","left":"19px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","width":"17px"});
this.rightIcon=new _Y.Element("div");
this.rightIcon.setStyles({"background":"transparent url("+_Y.baseurl+"img/gtb.gif"+") no-repeat -51px 0px","height":"19px","left":"38px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","top":"19px","width":"17px"});
this.downIcon=new _Y.Element("div");
this.downIcon.setStyles({"background":"transparent url("+_Y.baseurl+"img/gtb.gif"+") no-repeat -17px 0px","height":"19px","left":"19px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","top":"38px","width":"17px"});
this.leftIcon=new _Y.Element("div");
this.leftIcon.setStyles({"background":"transparent url("+_Y.baseurl+"img/gtb.gif"+") no-repeat -34px 0px","height":"19px","left":"0px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","top":"19px","width":"17px"});
this.cIcon=new _Y.Element("div");
this.cIcon.setStyles({"background":"transparent url("+_Y.baseurl+"img/gtb.gif"+") no-repeat -68px 0px","height":"19px","left":"19px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","top":"19px","width":"17px"});
this.plusIcon=new _Y.Element("div");
this.plusIcon.setStyles({"background":"transparent url("+_Y.baseurl+"img/gtb.gif"+") no-repeat -85px 0px","height":"17px","line-height":"17px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","width":"17px"});
this.barIcon=new _Y.Element("div");
this.barIcon.setStyles({"background":"transparent url("+_Y.baseurl+"img/gtb.gif"+") repeat-y -187px 0px","height":"140px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","margin":"0 0 0 3px","width":"14px"});
this.minusIcon=new _Y.Element("div");
this.minusIcon.setStyles({"background":"transparent url("+_Y.baseurl+"img/gtb.gif"+") no-repeat -102px 0px","height":"17px","line-height":"17px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","width":"17px","left":"10px"});
this.cursorIcon=new _Y.Element("div");
this.cursorIcon.setStyles({"background":"transparent url("+_Y.baseurl+"img/gtb.gif"+") no-repeat -120px 0px","height":"9px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","width":"17px","top":"19px"});
this.streetIcon=new _Y.Element("div");
this.streetIcon.zoom=0;
this.streetIcon.setStyles({"background":"transparent url("+_Y.baseurl+"img/ztip.gif"+") no-repeat","height":"15px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","width":"51px","font-size":"12px","padding-left":"15px","top":"14px"});
this.streetIcon.appendText("\u8857\u9053");
this.townIcon=new _Y.Element("div");
this.townIcon.zoom=3;
this.townIcon.setStyles({"background":"transparent url("+_Y.baseurl+"img/ztip.gif"+") no-repeat","height":"15px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","width":"51px","font-size":"12px","padding-left":"15px","top":this.townIcon.zoom*10+14+"px"});
this.townIcon.appendText("\u533a/\u53bf");
this.cityIcon=new _Y.Element("div");
this.cityIcon.zoom=6;
this.cityIcon.setStyles({"background":"transparent url("+_Y.baseurl+"img/ztip.gif"+") no-repeat","height":"15px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","width":"51px","font-size":"12px","padding-left":"15px","top":this.cityIcon.zoom*10+14+"px"});
this.cityIcon.appendText("\u57ce\u5e02");
this.provIcon=new _Y.Element("div");
this.provIcon.zoom=10;
this.provIcon.setStyles({"background":"transparent url("+_Y.baseurl+"img/ztip.gif"+") no-repeat","height":"15px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","width":"51px","font-size":"12px","padding-left":"15px","top":this.provIcon.zoom*10+14+"px"});
this.provIcon.appendText("\u7701");
this.dom.adopt(this.naviDiv);
this.dom.adopt(this.zoomDiv);
this.zoomDiv.adopt(this.tagDiv);
this.tagDiv.adopt(this.streetIcon);
this.tagDiv.adopt(this.townIcon);
this.tagDiv.adopt(this.cityIcon);
this.tagDiv.adopt(this.provIcon);
this.naviDiv.adopt(this.upIcon);
this.naviDiv.adopt(this.rightIcon);
this.naviDiv.adopt(this.downIcon);
this.naviDiv.adopt(this.leftIcon);
this.naviDiv.adopt(this.cIcon);
this.zoomDiv.adopt(this.plusIcon);
this.zoomDiv.adopt(this.barIcon);
this.zoomDiv.adopt(this.minusIcon);
this.zoomDiv.adopt(this.cursorIcon);
},addToMap:function(map){
this.map=map;
this.minusIcon.map=map;
this.plusIcon.map=map;
this.upIcon.map=map;
this.downIcon.map=map;
this.leftIcon.map=map;
this.rightIcon.map=map;
this.barIcon.map=map;
this.streetIcon.map=map;
this.townIcon.map=map;
this.cityIcon.map=map;
this.provIcon.map=map;
map.dom.adopt(this.dom);
this.streetIcon.addEvent("click",function(){
this.map.zoomTo(this.zoom);
});
this.townIcon.addEvent("click",function(){
this.map.zoomTo(this.zoom);
});
this.cityIcon.addEvent("click",function(){
this.map.zoomTo(this.zoom);
});
this.provIcon.addEvent("click",function(){
this.map.zoomTo(this.zoom);
});
this.minusIcon.addEvent("click",function(){
this.map.zoomOut();
});
this.plusIcon.addEvent("click",function(){
this.map.zoomIn();
});
this.upIcon.addEvent("click",function(){
var _f7={"x":0,"y":150};
this.map.move(_f7);
});
this.downIcon.addEvent("click",function(){
var _f8={"x":0,"y":-150};
this.map.move(_f8);
});
this.leftIcon.addEvent("click",function(){
var _f9={"x":150,"y":0};
this.map.move(_f9);
});
this.rightIcon.addEvent("click",function(){
var _fa={"x":-150,"y":0};
this.map.move(_fa);
});
this.barIcon.addEvent("click",function(e){
var _fc=this.getPosition();
var gap=e.page.y-_fc.y;
var _fe=Math.round(gap/10)-1;
this.map.zoomTo(_fe);
});
var _ff=this.cursorIcon;
var _100=this.barIcon;
var _101=function(_102){
var _103=_100.getPosition();
var gap=_102.start.y+_102.delta.y-_103.y;
gap=_105(gap);
_ff.setStyle("top",gap+10+"px");
_102.preventDefault();
_102.stopPropagation();
};
var _106=function(_107){
var _108=_100.getPosition();
var gap=_107.page.y-_108.y;
gap=_105(gap);
var zoom=Math.round(gap/10)-1;
_100.map.zoomTo(zoom);
};
var _105=function(gap){
var _10c=19-10;
if(gap<_10c){
gap=_10c;
}
var _10d=_100.map.maxZoom()*10+_10c;
if(gap>_10d){
gap=_10d;
}
return gap;
};
this.cursorIcon.addEvent("drag",_101);
this.cursorIcon.addEvent("dragend",_106);
},updateView:function(){
if(this.map.zoom!=this.map.lastZoom){
this.cursorIcon.setStyle("top",(this.map.zoom)*10+19+"px");
}
}});
var _10e=new _Y.Class({Extends:_YU.DomObject,clazz:"Overlay",map:null,position:null,id:null,offsetX:0,offsetY:0,baseline:"bottom",dom:null,visible:true,keepDom:false,initialize:function(_10f,_110){
if(_YU.check(_110)){
this.offsetX=_110.offsetX||this.offsetX;
this.offsetY=_110.offsetY||this.offsetY;
this.id=_110.id||this.id;
this.baseline=_110.baseline||this.baseline;
this.baseline=this.baseline.toLowerCase();
}
this.dom=new _Y.Element("div");
this.dom.setStyle("-moz-user-select","none");
this.setPosition(_10f);
this.enableMouseoverShow();
},dragHandler:function(_111){
this.moveBy(_111.delta);
_111.preventDefault();
_111.stopPropagation();
},dragEndHandler:function(_112){
this.movePosition(_112.delta);
},setPosition:function(_113){
this.position=_113;
this.updatePosition();
},updatePosition:function(){
if(!this.map||!this.map.refererGeoPoint){
return;
}
if(!this.position){
return;
}
if(!this.dom){
return;
}
var cx=this.map.activeMapLayer.geoUtil.distanceLongitude2Pixel(this.position.lo-this.map.refererGeoPoint.lo,this.map.zoom);
var cy=-this.map.activeMapLayer.geoUtil.distanceLatitude2Pixel(this.position.la-this.map.refererGeoPoint.la,this.map.zoom);
this.refererCoord=new _YU.Coordinate(cx,cy);
var _116=_YU.getSize(this.dom).height;
if(this.baseline=="top"){
_116=0;
}
this.dom.setStyles({"position":"absolute",left:(cx+this.offsetX),top:(cy+this.offsetY-_116),zIndex:this.zIndex||_ea.zIndex.overlay});
},moveToShow:function(){
this.updatePosition();
var size=_YU.getSize(this.dom);
var _118=(this.refererCoord.x+this.offsetX+this.map.refererCoord.x);
var _119=(this.map.refererCoord.y+this.refererCoord.y+this.offsetY-size.height);
if(this.baseline=="top"){
_119=_119+size.height;
}
var _11a=_118<0?-_118:(_118+size.width>this.map.viewSize.width?-(_118+size.width-this.map.viewSize.width):0);
var _11b=_119<0?-_119:(_119+size.height>this.map.viewSize.height?-(_119+size.height-this.map.viewSize.height):0);
this.map.move(new _YU.Coordinate(_11a,_11b));
},addToMap:function(map){
this.map=map;
map.addOverlay(this);
this.updatePosition();
},removeFromMap:function(){
if(this.map){
this.map.removeOverlay(this);
if(this.dom){
this.dom.dispose();
}
}
},moveBy:function(_11d){
var s={left:this.refererCoord.x+_11d.x,top:this.refererCoord.y+_11d.y,position:"absolute"};
this.dom.setStyles(s);
},movePosition:function(_11f){
this.position=this.map.activeMapLayer.geoUtil.geoMoveByPx(this.position,this.map.zoom,_11f);
this.refererCoord.x=(this.refererCoord.x+_11f.x);
this.refererCoord.y=(this.refererCoord.y+_11f.y);
},setDragable:function(bool){
if(bool){
this.addEvent("drag",this.dragHandler);
this.addEvent("dragend",this.dragEndHandler);
}else{
this.removeEvent("drag",this.dragHandler);
this.removeEvent("dragend",this.dragEndHandler);
}
},setVisible:function(bool){
this.visible=bool;
if(this.map){
this.addToMap(this.map);
}
if(bool){
this.dom.setStyle("display","");
}else{
this.dom.setStyle("display","none");
}
},enableMouseoverShow:function(){
this.dom.addEvent("mouseover",function(){
this.setStyle("z-index",_ea.zIndex.max);
});
this.dom.addEvent("mouseout",function(){
this.setStyle("z-index",this.zIndex||_ea.zIndex.overlay);
});
}});
var _122=new _Y.Class({Extends:_10e,clazz:_122,zIndex:_ea.zIndex.control,initialize:function(){
this.dom=new _Y.Element("div");
this.dom.id="zoomer";
this.dom.setStyles({"height":"1px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"relative","width":"1px","zIndex":this.zIndex,"font":"0px Arial","clear":"both","display":"block"});
this.inDiv=new _Y.Element("div");
this.inDiv.setStyles({"height":"40px","width":"40px","position":"absolute","bottom":"0px"});
this.ltIn=new _Y.Element("div");
this.ltIn.setStyles({"background":"transparent url("+_Y.baseurl+"img/zoomer.gif"+") no-repeat","height":"7px","left":"0px","top":"0px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","width":"7px","overflow":"hidden"});
this.lbIn=new _Y.Element("div");
this.lbIn.setStyles({"background":"transparent url("+_Y.baseurl+"img/zoomer.gif"+") no-repeat 0 -7px","height":"7px","left":"0px","bottom":"0px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","width":"7px","overflow":"hidden"});
this.rtIn=new _Y.Element("div");
this.rtIn.setStyles({"background":"transparent url("+_Y.baseurl+"img/zoomer.gif"+") no-repeat -7px 0","height":"7px","right":"0px","top":"0px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","width":"7px","overflow":"hidden"});
this.rbIn=new _Y.Element("div");
this.rbIn.setStyles({"background":"transparent url("+_Y.baseurl+"img/zoomer.gif"+") no-repeat -7px -7px","height":"7px","right":"0px","bottom":"0px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","width":"7px","overflow":"hidden"});
this.inDiv.adopt(this.ltIn);
this.inDiv.adopt(this.lbIn);
this.inDiv.adopt(this.rtIn);
this.inDiv.adopt(this.rbIn);
this.outDiv=new _Y.Element("div");
this.outDiv.setStyles({"height":"40px","width":"40px","position":"absolute","bottom":"0px"});
this.ltOut=new _Y.Element("div");
this.ltOut.setStyles({"background":"transparent url("+_Y.baseurl+"img/zoomer.gif"+") no-repeat -7px -7px","height":"7px","left":"0px","top":"0px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","width":"7px","overflow":"hidden"});
this.lbOut=new _Y.Element("div");
this.lbOut.setStyles({"background":"transparent url("+_Y.baseurl+"img/zoomer.gif"+") no-repeat -7px 0","height":"7px","left":"0px","bottom":"0px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","width":"7px","overflow":"hidden"});
this.rtOut=new _Y.Element("div");
this.rtOut.setStyles({"background":"transparent url("+_Y.baseurl+"img/zoomer.gif"+") no-repeat 0 -7px","height":"7px","right":"0px","top":"0px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","width":"7px","overflow":"hidden"});
this.rbOut=new _Y.Element("div");
this.rbOut.setStyles({"background":"transparent url("+_Y.baseurl+"img/zoomer.gif"+") no-repeat 0 0","height":"7px","right":"0px","bottom":"0px","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","position":"absolute","width":"7px","overflow":"hidden"});
this.outDiv.adopt(this.ltOut);
this.outDiv.adopt(this.lbOut);
this.outDiv.adopt(this.rtOut);
this.outDiv.adopt(this.rbOut);
this.dom.adopt(this.inDiv);
this.dom.adopt(this.outDiv);
this.setVisible(false);
},zoomIn:function(){
this.outDiv.setStyle("display","none");
this.inDiv.setStyle("display","");
this.innerDom=this.inDiv;
this.showMove(20,40,300);
},zoomOut:function(){
this.outDiv.setStyle("display","");
this.inDiv.setStyle("display","none");
this.innerDom=this.outDiv;
this.showMove(40,20,300);
},showMove:function(_123,_124,_125){
this.innerDom.setStyles({left:-_123+"px",top:-_123+"px",height:2*_123+"px",width:2*_123+"px"});
this.setVisible(true);
var dom=this;
var _127=function(){
dom.innerDom.setStyles({left:-_124+"px",top:-_124+"px",height:2*_124+"px",width:2*_124+"px"});
dom.setVisible(true);
};
var _128=(_123+_124)/2;
var _129=function(){
dom.innerDom.setStyles({left:-_128+"px",top:-_128+"px",height:2*_128+"px",width:2*_128+"px"});
dom.setVisible(true);
};
var _12a=function(){
dom.setVisible(false);
};
setTimeout(_127,_125);
setTimeout(_129,_125/2);
setTimeout(_12a,_125+100);
}});
var _12b=new _Y.Class({Extends:_10e,clazz:"PopMenu",id:"PopMenu"+_YU.getRandomId(),keepDom:true,zIndex:_ea.zIndex.control,initialize:function(_12c,_12d){
if(!_YU.check(_12d)||!_YU.check(_12d.menu)){
return;
}
this.parent(_12c,_12d);
this.baseline="top";
this.dom.className="out";
_YU.setStyles(this.dom,{"width":"186px","width#ie":"180px","position":"relative","background":"#959595","z-index":this.zIndex});
var _12e=new _Y.Element("div");
_12e.className="in";
_YU.setStyles(_12e,{"font-size":"14px","width":"180px","background":"#d0dff4","border":"1px solid #ECECEC","position":"relative","padding":"2px","top":"-3px","left":"-3px"});
this.dom.adopt(_12e);
var menu=_12d.menu;
var self=this;
for(var item in menu){
var _132=new _Y.Element("div");
_YU.setStyles(_132,{"color":"#000000","cursor":"pointer","line-height":"24px","padding-left":"9px"});
_132.id="m_"+item;
_132.innerHTML=item;
_12e.adopt(_132);
var hide=function(){
this.setVisible(false);
};
_132.addEvent("click",_YU.bind(menu[item],self,hide));
_132.addEvent("mouseover",function(){
this.setStyles({color:"#FFFFFF",backgroundColor:"#1957D4"});
});
_132.addEvent("mouseout",function(){
this.setStyles({color:"#000000",backgroundColor:"#D0DFF4"});
});
_132.addEvent("mouseup",function(){
this.setStyles({color:"#000000",backgroundColor:"#D0DFF4"});
});
}
}});
var _134=new _Y.Class({Extends:_10e,clazz:"InfoBox",zIndex:_ea.zIndex.overlay,id:"",title:"",ordinal:"",brief:"",detail:"",funclink:"",initialize:function(_135,_136){
this.parent(_135,_136);
_YU.setStyles(this.dom,{"overflow":"hidden","position":"absolute","width":"400px"});
var _137=new _Y.Element("div");
_YU.setStyles(_137,{"left":"3px","bottom":"0px","display":"block","overflow":"hidden","position":"absolute","width":"38px","height":"20px"});
var _138=new _Y.Element("div");
var _139=1057;
var _13a=12;
var _13b={"left":"-44px","bottom":"0px","display":"block","overflow":"hidden","position":"absolute","width":_139+"px","height":"600px","background":"transparent url("+_Y.baseurl+"img/sprite-poptip.png) no-repeat scroll left top","background#ie6":"none","filter#ie6":"progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\""+_Y.baseurl+"img/sprite-poptip.png\", sizingMethod=\"crop\")"};
_YU.setStyles(_138,_13b);
_137.adopt(_138);
this.dom.adopt(_137);
var tDom=new _Y.Element("div");
var _13d=new _Y.Element("div");
var _13e=new _Y.Element("div");
var _13f=new _Y.Element("div");
_YU.setStyles(tDom,{"height":"20px","overflow":"hidden","padding":"0pt 8px","position":"relative"});
_YU.setStyles(_13e,{"width":"8px","height":"20px","top":"0","left":"0","overflow":"hidden","position":"absolute"});
var _140=new _Y.Element("div");
_YU.setStyles(_140,_13b);
_YU.setStyles(_140,{"left":"0px","top":"0"});
_13e.adopt(_140);
_YU.setStyles(_13d,{"width":_13a+"px","height":"20px","top":"0px","left":"auto","right":"0px","overflow":"hidden","position":"absolute"});
var _141=new _Y.Element("div");
_YU.setStyles(_141,_13b);
_YU.setStyles(_141,{"left":(_13a-_139)+"px","top":"0"});
_13d.adopt(_141);
_YU.setStyles(_13f,{"height":"20px","overflow":"hidden","position":"relative"});
var _142=new _Y.Element("div");
_YU.setStyles(_142,_13b);
_YU.setStyles(_142,{"left":"-70px","top":"0"});
_13f.adopt(_142);
tDom.adopt(_13e);
tDom.adopt(_13f);
tDom.adopt(_13d);
this.dom.adopt(tDom);
var mDom=new _Y.Element("div");
var _144=new _Y.Element("div");
var _145=new _Y.Element("div");
var _146=new _Y.Element("div");
_YU.setStyles(mDom,{"height":"auto","padding":"0px 8px","overflow":"hidden","position":"relative","zoom":"1"});
_YU.setStyles(_144,{"width":"8px","height":"560px","left":"0px","top":"0px","overflow":"hidden","position":"absolute"});
var _147=new _Y.Element("div");
_YU.setStyles(_147,_13b);
_YU.setStyles(_147,{"top":"-20px","left":"0"});
_144.adopt(_147);
_YU.setStyles(_146,{"width":_13a+"px","height":"560px","top":"0px","left":"auto","right":"0px","overflow":"hidden","position":"absolute"});
var _148=new _Y.Element("div");
_YU.setStyles(_148,_13b);
_YU.setStyles(_148,{"left":(_13a-_139)+"px","top":"-20px"});
_146.adopt(_148);
_YU.setStyles(_145,{"background-color":"#FFF"});
mDom.adopt(_144);
mDom.adopt(_145);
mDom.adopt(_146);
this.dom.adopt(mDom);
var bDom=new _Y.Element("div");
var _14a=new _Y.Element("div");
var _14b=new _Y.Element("div");
var _14c=new _Y.Element("div");
_YU.setStyles(bDom,{"height":"20px","overflow":"hidden","padding":"0 12px 0 38px","position":"relative"});
_YU.setStyles(_14b,{"width":"8px","height":"15px","top":"0","left":"0px","overflow":"hidden","position":"absolute"});
var _14d=new _Y.Element("div");
_YU.setStyles(_14d,_13b);
_YU.setStyles(_14d,{"top":"-80px","left":"0"});
_14b.adopt(_14d);
_YU.setStyles(_14a,{"width":_13a+"px","height":"20px","top":"0px","left":"auto","right":"0px","overflow":"hidden","position":"absolute"});
var _14e=new _Y.Element("div");
_YU.setStyles(_14e,_13b);
_YU.setStyles(_14e,{"left":(_13a-_139)+"px","top":"-580px"});
_14a.adopt(_14e);
_YU.setStyles(_14c,{"height":"20px","overflow":"hidden","position":"relative"});
var _14f=new _Y.Element("div");
_YU.setStyles(_14f,_13b);
_YU.setStyles(_14f,{"left":"-70px","top":"-580px"});
_14c.adopt(_14f);
bDom.adopt(_14b);
bDom.adopt(_14c);
bDom.adopt(_14a);
this.dom.adopt(bDom);
this.titleDom=new _Y.Element("div");
_YU.setStyles(this.titleDom,{"background":"url("+_Y.baseurl+"img/sprite-poptip.png) repeat-x scroll left -604px","font-size":"13px","height":"23px","line-height":"23px","padding":"0px 25px 0 5px","position":"relative","vertical-align":"middle"});
this.contentDom=new _Y.Element("div");
_YU.setStyles(this.contentDom,{"background-color":"white","margin-top":"-3px","padding":"5px","text-align":"left"});
_145.adopt(this.titleDom);
_145.adopt(this.contentDom);
_YU.setStyles(_145,{"font-size":"12px"});
this.ordinalDom=new _Y.Element("div");
this.nameDom=new _Y.Element("div");
_YU.setStyles(this.nameDom,{"font-weight":"bold","height":"23px","overflow":"hidden","position":"relative","color":"#000","width":"100%"});
this.closeDom=new _Y.Element("div");
_YU.setStyles(this.ordinalDom,{"background":"url("+_Y.baseurl+"img/numbj.gif) no-repeat center","width":"19px","height":"19px","position":"relative","margin-left":"-5px","padding-top":"5px","float":"left","font-size":"13px","font-family":"Arial, Helvetica, sans-serif","font-weight":"bold","text-align":"center","color":"#FFFFFF","z-index":8000});
_YU.setStyles(this.closeDom,{"background":"#92b9ff url("+_Y.baseurl+"img/gtb.gif) no-repeat -202px 0px","height":"0px","width":"13px","top":"3px","top#ie":"1px","right":"7px","left":"auto","overflow":"hidden","padding-top":"13px","padding-top#ie":"0px","position":"absolute","display":"block","cursor":"pointer"});
this.closeDom.addEvent("mouseover",function(){
this.setStyle("background","#92b9ff url("+_Y.baseurl+"img/gtb.gif) no-repeat -216px 0px");
});
this.closeDom.addEvent("mouseout",function(){
this.setStyle("background","#92b9ff url("+_Y.baseurl+"img/gtb.gif) no-repeat -202px 0px");
});
this.closeDom.wrapper=this;
this.closeDom.addEvent("click",function(){
this.wrapper.setVisible(false);
});
this.titleDom.adopt(this.ordinalDom);
this.ordinalDom.setStyles({"display":"none"});
this.titleDom.adopt(this.nameDom);
this.titleDom.adopt(this.closeDom);
this.briefIntroDom=new _Y.Element("div");
this.funcDom=new _Y.Element("div");
this.detailIntroDom=new _Y.Element("div");
this.contentDom;
this.contentDom.adopt(this.briefIntroDom);
this.contentDom.adopt(this.funcDom);
this.contentDom.adopt(this.detailIntroDom);
this.setPosition(_135);
this.id="infobar"+_YU.getRandomId();
this.title="";
if(_YU.check(_136)){
this.title=_136.title||this.title;
this.ordinal=_136.ordinal||"";
this.id=_136.id||this.id;
this.breif=_136.brief||"";
this.detail=_136.detail||"";
this.funclink=_136.funclink||"";
this.setTitle(this.title);
this.setBrief(this.breif);
this.setFuncLink(this.funclink);
this.setDetail(this.detail);
}
},setTitle:function(_150){
this.nameDom.innerHTML=_150;
},setBrief:function(_151){
if(!_YU.check(_151)){
this.briefIntroDom.innerHTML="";
this.briefIntroDom.setStyle("display","none");
}else{
if(typeof (_151)=="string"){
this.briefIntroDom.innerHTML=_151;
}else{
this.briefIntroDom.adopt(_151);
}
this.briefIntroDom.setStyle("display","");
}
},setFuncLink:function(Func){
if(!_YU.check(Func)){
this.funcDom.innerHTML="";
this.funcDom.setStyle("display","none");
}else{
if(typeof (Func)=="string"){
this.funcDom.innerHTML=Func;
}else{
this.funcDom.adopt(Func);
}
this.funcDom.setStyle("display","");
}
},setDetail:function(_153){
if(!_YU.check(_153)){
this.detailIntroDom.innerHTML="";
this.detailIntroDom.setStyle("display","none");
}else{
if(typeof (_153)=="string"){
this.detailIntroDom.innerHTML=_153;
}else{
this.detailIntroDom.adopt(_153);
}
this.detailIntroDom.setStyle("display","");
}
},showContent:function(code){
this.briefIntroDom.setStyle("display","");
this.funcDom.setStyle("display","");
this.detailIntroDom.setStyle("display","");
switch(code){
case 1:
this.briefIntroDom.setStyle("display","none");
case 2:
this.funcDom.setStyle("display","none");
case 3:
this.detailIntroDom.setStyle("display","none");
}
}});
var Mark=new _Y.Class({Extends:_10e,clazz:"Mark",zIndex:_ea.zIndex.overlay,text:"",initialize:function(_156,_157){
this.parent(_156,_157);
var nobr=new _Y.Element("nobr");
this.dom.adopt(nobr);
if(_157){
this.text=_157.text||this.text;
}
nobr.appendText(this.text);
this.dom.id=this.id;
this.dom.setStyles({"-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","font-size":"12px","color":"#000"});
}});
var _159=new _Y.Class({Extends:_10e,clazz:"InfoBar",zIndex:_ea.zIndex.overlay,ordinal:null,text:null,initialize:function(_15a,_15b){
this.parent(_15a,_15b);
this.src=_Y.baseurl+"img/poibj.png";
this.setPosition(_15a);
this.id="infobar"+_YU.getRandomId();
if(_YU.check(_15b)){
this.text=_15b.text||this.text;
this.ordinal=_15b.ordinal||"";
this.id=_15b.id||this.id;
}
this.dom.id=this.id;
this.dom.setStyles({"cursor":"pointer"});
this.lDom=new _Y.Element("div");
var lbg=_Y.baseurl+"img/openbj01.png";
_YU.setStyles(this.lDom,{"background":"url("+lbg+") no-repeat left bottom","float":"left","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","height":"34px","width":"21px","padding":"6px 0 0 2px","height#ie7":"37px","width#ie7":"23px","padding#ie7":"6px 0 0 0","width#ie6":"23px","height#ie6":"33px","padding#ie6":"6px 0 0 0","text-align":"center","font-size":"14px","font-family":"Arial Helvetica sans-serif","font-weight":"bold","text-align":"center","color":"#FFFFFF","cursor":"pointer","background#ie6":"none","filter#ie6":"progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\""+lbg+"\",sizingMethod=\"scale\")","position":"relative"});
this.mDom=new _Y.Element("div");
var mbg=_Y.baseurl+"img/openbj03.png";
_YU.setStyles(this.mDom,{"background":"url("+mbg+") repeat-x right bottom","float":"left","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","height":"34px","padding":"6px 10px 0 5px","height#ie7":"37px","padding#ie7":"4px 10px 6px 5px","height#ie6":"33px","padding#ie6":"3px 0px 0 5px","font-size":"12px","font-weight":"bold","text-align":"left","color":"#333333","white-space":"nowrap","background#ie6":"none","filter#ie6":"progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\""+mbg+"\",sizingMethod=\"scale\")","position":"relative"});
this.rDom=new _Y.Element("div");
var rbg=_Y.baseurl+"img/openbj02.png";
_YU.setStyles(this.rDom,{"background":"url("+rbg+") no-repeat right bottom","float":"left","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","height":"40px","width":"26px","height#ie7":"37px","padding#ie7":"0px 10px 0 5px","height#ie6":"33px","background#ie6":"none","filter#ie6":"progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\""+rbg+"\",sizingMethod=\"scale\")","position":"relative"});
var _15f=new _Y.Element("div");
var _160=_Y.baseurl+"img/arr.png";
_YU.setStyles(_15f,{"background":"url("+_160+") no-repeat left center","float":"left","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","font-size#ie6":"1px","height":"10px","width":"11px","padding":"18px 1px 0 0","height#ie7":"5px","height#ie6":"10px","padding#ie7":"0px 2px 10px 0","padding#ie6":"0px 1px 0 0","margin#ie6":"8px 0 0 0","background#ie6":"none","filter#ie6":"progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\""+_160+"\",sizingMethod=\"scale\")","position":"relative"});
if(_YU.check(this.ordinal)){
this.lDom.innerHTML=this.ordinal;
}
if(_YU.check(this.text)){
this.mDom.innerHTML=this.text;
}
this.rDom.adopt(_15f);
this.dom.adopt(this.lDom);
this.dom.adopt(this.mDom);
this.dom.adopt(this.rDom);
}});
var Icon=new _Y.Class({Extends:_10e,clazz:"Icon",zIndex:_ea.zIndex.overlay,src:null,ordinal:null,initialize:function(_162,_163){
this.parent(_162,_163);
this.src=_Y.baseurl+"img/poibj.png";
this.setPosition(_162);
this.id="icon"+_YU.getRandomId();
if(_YU.check(_163)){
this.src=_163.img||this.src;
this.ordinal=_163.ordinal||null;
this.id=_163.id||this.id;
this.styles=_163.styles||{};
this.bgOffsetX=_163.bgOffsetX;
this.bgOffsetY=_163.bgOffsetY;
}
this.dom.id=this.id;
if(_YU.check(this.ordinal)){
this.dom.appendText(this.ordinal);
}
_YU.setStyles(this.dom,{"background":"url("+this.src+") no-repeat "+this.bgOffsetX+" "+this.bgOffsetY,"-moz-user-select":"none","-moz-background-clip":"-moz-initial","-moz-background-origin":"-moz-initial","-moz-background-inline-policy":"-moz-initial","height":"32px","width":"25px","font-family":"Arial Helvetica sans-serif","text-align":"center","color":"#000","cursor":"pointer","position":"relative"});
_YU.setStyles(this.dom,this.styles);
}});
var Tile=new _Y.Class({Extends:_YU.DomObject,inuse:false,dom:null,zIndex:_ea.zIndex.tile,initialize:function(_165,id){
this.src=_165;
this.id=id;
this.dom=new _Y.Element("img",{src:_165});
this.dom.disableSelection();
this.dom.setStyles({"z-Index":this.zIndex,"border":"none","margin":"0px","padding":"0px"});
},display:function(bool){
if(!_YU.check(this.dom)){
return;
}
if(bool==false){
this.dom.setStyles({display:"none"});
}else{
this.dom.setStyles({display:"block"});
}
}});
var _168=new _Y.Class({Extends:_YU.DomObject,geoUtil:null,tileList:null,updateView:function(_169,zoom,_16b){
throw AbstractFunctionError;
},initialize:function(id){
this.dom=new _Y.Element("div",{"style":{"postion":"absolute"}});
this.tileList=[];
}});
var _16d={CIRCLE:"circle",PATH:"path",RECTANGLE:"rectangle"};
var _16e={COULOR:"color",OPACITY:"opacity",WIDTH:"width",FILL:"fill",LINE_JOIN:"linejoin",FILL_OPACITY:"fillopacity",LINE_CAP:"linecap",DASH_ARRAY:"dasharray",Default:{"color":"red","opacity":0.4,"width":5,"fill":"none","linecap":"round","linejoin":"round","fillopacity":0.5},applyStroke:function(node,_170){
if(!_YU.check(node)){
return;
}
var _171={};
for(p in this.Default){
_171[p]=this.Default[p];
}
for(para in _170){
_171[para]=_170[para];
}
if(_Y.Browser.SVG){
if(_YU.check(_171[_16e.COULOR])){
node.setAttribute("stroke",_171[_16e.COULOR]);
}
if(_YU.check(_171[_16e.WIDTH])){
node.setAttribute("stroke-width",_171[_16e.WIDTH]);
}
if(_YU.check(_171[_16e.FILL])){
node.setAttribute("fill",_171[_16e.FILL]);
}
if(_YU.check(_171[_16e.OPACITY])){
node.setAttribute("stroke-opacity",_171[_16e.OPACITY]);
}
if(_YU.check(_171[_16e.FILL_OPACITY])){
node.setAttribute("fill-opacity",_171[_16e.FILL_OPACITY]);
}
if(_YU.check(_171[_16e.LINE_JOIN])){
node.setAttribute("stroke-linejoin",_171[_16e.LINE_JOIN]);
}
if(_YU.check(_171[_16e.LINE_CAP])){
node.setAttribute("stroke-linecap",_171[_16e.LINE_CAP]);
}
if(_YU.check(_171[_16e.DASH_ARRAY])){
node.setAttribute("stroke-dasharray",_171[_16e.DASH_ARRAY]);
}
}else{
if(_YU.check(_171[_16e.COULOR])){
node.setAttribute("stroked","true");
node.setAttribute("strokecolor",_171[_16e.COULOR]);
}
if(_YU.check(_171[_16e.WIDTH])){
node.setAttribute("strokeweight",_171[_16e.WIDTH]);
}
if(_YU.check(_171[_16e.FILL])){
if(_171[_16e.FILL]=="none"){
node.setAttribute("filled","false");
}else{
node.setAttribute("filled","true");
node.setAttribute("fillcolor",_171[_16e.FILL]);
}
}
if(_YU.check(_171[_16e.OPACITY])){
var _172=node.stroke;
if(!_YU.check(_172)){
var _172=document.createElement(_173(_ea.VMLPrefix,"stroke"));
node.appendChild(_172);
node.stroke=_172;
}
_172.setAttribute("opacity",_171[_16e.OPACITY]);
}
if(_YU.check(_171[_16e.FILL_OPACITY])){
}
if(_YU.check(_171[_16e.LINE_JOIN])){
if(!_YU.check(node.stroke)){
var _172=document.createElement(_173(_ea.VMLPrefix,"stroke"));
node.appendChild(_172);
}else{
var _172=node.stroke;
}
_172.setAttribute("joinstyle",_171[_16e.LINE_JOIN]);
}
if(_YU.check(_171[_16e.LINE_CAP])){
if(!_YU.check(node.stroke)){
var _172=document.createElement(_173(_ea.VMLPrefix,"stroke"));
node.appendChild(_172);
}else{
var _172=node.stroke;
}
_172.setAttribute("endcap",_171[_16e.LINE_CAP]);
}
if(_YU.check(_171[_16e.DASH_ARRAY])){
if(!_YU.check(node.stroke)){
var _172=document.createElement(_173(_ea.VMLPrefix,"stroke"));
node.appendChild(_172);
}else{
var _172=node.stroke;
}
_172.setAttribute("dashstyle",_171[_16e.DASH_ARRAY]);
}
}
}};
var _174=new _Y.Class({Extends:_YU.DomObject,initialize:function(type,_176){
this.type=type;
this.paras=_176;
this.dom=null;
this.id=this.key(type,_176);
},key:function(type,_178){
var c="_";
var k=type;
for(para in _178){
k=k+c+_178[para];
}
return k;
}});
var _17b=20;
var _173=function(ns,name){
return ns+":"+name;
};
var _17e=new _Y.Class({vmlNs:"urn:schemas-microsoft-com:vml",svgNs:"http://www.w3.org/2000/svg",namespace:null,canvas:null,left:0,top:0,size:null,lastMapzoom:NaN,refererGeoPoint:null,initialize:function(id){
this.namespace=_ea.VMLPrefix;
if(!_YU.check($(id))){
this.dom=new _Y.Element("div",{"id":id});
}else{
this.dom=$(id);
}
this.dom.setStyles({position:"relative",width:"100%",height:"100%",zIndex:_ea.zIndex.basic,overflow:"visible"});
document.body.appendChild(this.dom);
var _180=this.dom;
if(_Y.Browser.SVG){
var _181=document.createElementNS(this.svgNs,"svg");
_181.setAttribute("version","1.1");
_181.setAttribute("width",_180.clientWidth);
_181.setAttribute("height",_180.clientHeight);
_180.appendChild(_181);
}else{
document.namespaces.add(this.namespace,this.vmlNs);
var _181=this.dom;
var _182=document.createStyleSheet();
_182.addRule(this.namespace+"\\:*","behavior: url(#default#VML);");
}
this.canvas=$(_181);
},updateVectorRange:function(){
if(this.map.vectorManager.isNull()){
return;
}
if(!this.map.refererGeoPoint){
return;
}
var left=this.map.activeMapLayer.geoUtil.distanceLongitude2Pixel(this.map.vectorManager.minLoLa.lo-this.map.refererGeoPoint.lo,this.map.zoom);
var top=this.map.activeMapLayer.geoUtil.distanceLatitude2Pixel(this.map.refererGeoPoint.la-this.map.vectorManager.maxLoLa.la,this.map.zoom);
var _185=this.map.activeMapLayer.geoUtil.distanceLongitude2Pixel(this.map.vectorManager.maxLoLa.lo-this.map.vectorManager.minLoLa.lo,this.map.zoom);
var _186=this.map.activeMapLayer.geoUtil.distanceLatitude2Pixel(this.map.vectorManager.maxLoLa.la-this.map.vectorManager.minLoLa.la,this.map.zoom);
var x=left-this.left;
var y=top-this.top;
var dw=0;
if(this.size){
dw=_185-this.size.width;
}
var dh=0;
if(this.size){
dh=_186-this.size.height;
}
this.updateRange(new _YU.Coordinate(left,top),new _YU.Size(_185,_186));
if(x||y||dw||dh){
this.lastMapzoom=this.map.zoom;
this.refererGeoPoint=this.map.refererGeoPoint;
for(i=0;i<this.map.vectorManager.vectorList.length;i++){
var _18b=this.map.vectorManager.vectorList[i];
if(_18b.dom){
this.drawVector(_18b);
}
}
}
},drawVector:function(_18c){
if(_YU.check(_18c.dom)){
_18c.dom.dispose();
}
_18c.dom=this[_18c.type](_18c.paras);
return _18c;
},path:function(_18d){
var path=_18d.path;
if(!_YU.check(path)){
throw new _YU.Errors.BadParaError;
}else{
if(path.length<2){
throw new _YU.Errors.BadParaError;
}
}
if(!this.map.refererGeoPoint){
return;
}
this.updateVectorRange();
if(_Y.Browser.SVG){
var node=document.createElementNS(this.svgNs,"path");
var d="";
for(var i=0;i<path.length;i++){
var p=path[i];
var cx=this.map.activeMapLayer.geoUtil.distanceLongitude2Pixel(p.lo-this.map.refererGeoPoint.lo,this.map.zoom);
var cy=-this.map.activeMapLayer.geoUtil.distanceLatitude2Pixel(p.la-this.map.refererGeoPoint.la,this.map.zoom);
var x=parseInt(cx+_17b-this.left);
var y=parseInt(cy+_17b-this.top);
if(i==0){
d="M"+x+" "+y;
}else{
d=d+" L"+x+" "+y;
}
}
node.setAttribute("d",d);
}else{
var node=document.createElement(_173(this.namespace,"polyline"));
var _197=node.style;
_197.position="absolute";
var d="";
for(var i=0;i<path.length;i++){
var p=path[i];
var cx=this.map.activeMapLayer.geoUtil.distanceLongitude2Pixel(p.lo-this.map.refererGeoPoint.lo,this.map.zoom);
var cy=-this.map.activeMapLayer.geoUtil.distanceLatitude2Pixel(p.la-this.map.refererGeoPoint.la,this.map.zoom);
var x=parseInt(cx+_17b-this.left);
var y=parseInt(cy+_17b-this.top);
if(i==0){
d=x+","+y;
}else{
d=d+" "+x+","+y;
}
}
node.setAttribute("points",d);
}
_16e.applyStroke(node,_18d.stroke);
this.canvas.appendChild(node);
return $(node);
},circle:function(_198){
if(!this.map.refererGeoPoint){
return;
}
var r=this.map.activeMapLayer.geoUtil.distanceMeter2Pixel(_198.r,this.map.zoom);
var cx=this.map.activeMapLayer.geoUtil.distanceLongitude2Pixel(_198.lo-this.map.refererGeoPoint.lo,this.map.zoom);
var cy=-this.map.activeMapLayer.geoUtil.distanceLatitude2Pixel(_198.la-this.map.refererGeoPoint.la,this.map.zoom);
this.updateVectorRange();
if(_Y.Browser.SVG){
var node=document.createElementNS(this.svgNs,"circle");
node.setAttribute("cx",cx+_17b-this.left);
node.setAttribute("cy",cy+_17b-this.top);
node.setAttribute("r",r);
}else{
var node=document.createElement(_173(this.namespace,"oval"));
var _19d=node.style;
_19d.position="absolute";
_19d.width=2*r;
_19d.height=2*r;
_19d.top=(cy+_17b-this.top-r);
_19d.left=(cx+_17b-this.left-r);
}
_16e.applyStroke(node,_198.stroke);
this.canvas.appendChild(node);
return $(node);
},rectangle:function(_19e){
if(!this.map.refererGeoPoint){
return;
}
var w=this.map.activeMapLayer.geoUtil.distanceMeter2Pixel(_19e.width,this.map.zoom);
var h=this.map.activeMapLayer.geoUtil.distanceMeter2Pixel(_19e.height,this.map.zoom);
var cx=this.map.activeMapLayer.geoUtil.distanceLongitude2Pixel(_19e.lo-this.map.refererGeoPoint.lo,this.map.zoom);
var cy=-this.map.activeMapLayer.geoUtil.distanceLatitude2Pixel(_19e.la-this.map.refererGeoPoint.la,this.map.zoom);
this.updateVectorRange();
if(_Y.Browser.SVG){
var node=document.createElementNS(this.svgNs,"rect");
node.setAttribute("x",cx-w/2+_17b-this.left);
node.setAttribute("y",cy-h/2+_17b-this.top);
node.setAttribute("width",w);
node.setAttribute("height",h);
}else{
var node=document.createElement(_173(this.namespace,"rect"));
var _1a4=node.style;
_1a4.position="absolute";
_1a4.width=w;
_1a4.height=h;
_1a4.top=(cy+_17b-this.top-h/2);
_1a4.left=(cx+_17b-this.left-w/2);
}
_16e.applyStroke(node,_19e.stroke);
this.canvas.appendChild(node);
return $(node);
},updateRange:function(_1a5,size){
if(!_Y.Browser.Engine.trident){
this.canvas.setAttribute("width",(size.width+_17b*4));
this.canvas.setAttribute("height",(size.height+_17b*4));
}else{
this.canvas.style.setAttribute("width",(size.width+_17b*4));
this.canvas.style.setAttribute("height",(size.height+_17b*4));
}
this.canvas.setStyles({"position":"relative",left:_1a5.x-_17b,top:_1a5.y-_17b});
this.size=size;
this.left=_1a5.x;
this.top=_1a5.y;
}});
var _1a7=new _Y.Class({vectorList:null,initialize:function(map){
this.minLoLa=new _YM.GeoPoint(18000000,9000000);
this.maxLoLa=new _YM.GeoPoint(-18000000,-9000000);
this.map=map;
this.vectorList=[];
},isNull:function(){
return !(this.vectorList.length>0);
},addVector:function(_1aa){
this[_1aa.id]=_1aa;
this.vectorList.push(_1aa);
this.expandRange(_1aa);
},expandRange:function(_1ab){
if(_1ab.type==_16d.CIRCLE){
var _1ac=this.map.activeMapLayer.geoUtil.distanceMeter2Latitude(_1ab.paras["r"]);
var _1ad=Math.min(this.minLoLa.lo,_1ab.paras["lo"]-_1ac);
var _1ae=Math.min(this.minLoLa.la,_1ab.paras["la"]-_1ac);
var _1af=Math.max(this.maxLoLa.lo,_1ab.paras["lo"]+_1ac);
var _1b0=Math.max(this.maxLoLa.la,_1ab.paras["la"]+_1ac);
this.minLoLa.set(_1ad,_1ae);
this.maxLoLa.set(_1af,_1b0);
}else{
if(_1ab.type==_16d.PATH){
var path=_1ab.paras.path;
for(var i=0;i<path.length;i++){
var p=path[i];
this.minLoLa.lo=Math.min(this.minLoLa.lo,p.lo);
this.minLoLa.la=Math.min(this.minLoLa.la,p.la);
this.maxLoLa.lo=Math.max(this.maxLoLa.lo,p.lo);
this.maxLoLa.la=Math.max(this.maxLoLa.la,p.la);
}
}else{
if(_1ab.type==_16d.RECTANGLE){
var _1b4=this.map.activeMapLayer.geoUtil.distanceMeter2Latitude(_1ab.paras["width"]);
var _1b5=this.map.activeMapLayer.geoUtil.distanceMeter2Latitude(_1ab.paras["height"]);
var _1ad=Math.min(this.minLoLa.lo,_1ab.paras["lo"]-_1b4);
var _1ae=Math.min(this.minLoLa.la,_1ab.paras["la"]-_1b5);
var _1af=Math.max(this.maxLoLa.lo,_1ab.paras["lo"]+_1b4);
var _1b0=Math.max(this.maxLoLa.la,_1ab.paras["la"]+_1b5);
this.minLoLa.set(_1ad,_1ae);
this.maxLoLa.set(_1af,_1b0);
}
}
}
}});
var _1b6={EARTH_RADIUS:6378.137,LT_Ratio:100000,angle2Radius:function(arc){
return arc*Math.PI/180;
},calculateDistance:function(pt1,pt2){
var _1ba=this.LT_Ratio;
var lo1=pt1.lo,lo2=pt2.lo,la1=pt1.la,la2=pt2.la;
if(lo1>_1ba/100){
lo1=lo1/_1ba;
}
if(la1>_1ba/100){
la1=la1/_1ba;
}
if(lo2>_1ba/100){
lo2=lo2/_1ba;
}
if(la2>_1ba/100){
la2=la2/_1ba;
}
var _1bf=this.angle2Radius(la1);
var _1c0=this.angle2Radius(la2);
var a=_1bf-_1c0;
var b=this.angle2Radius(lo1)-this.angle2Radius(lo2);
var s=2*Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2)+Math.cos(_1bf)*Math.cos(_1c0)*Math.pow(Math.sin(b/2),2)));
s=s*this.EARTH_RADIUS;
return s;
}};
_YU.namespace("maps");
var _YM=window[_YoudaoGlobalName_].maps;
_YM.Default=_ea;
_YM.MapLayer=_168;
_YM.VectorManager=_1a7;
_YM.VectorRender=_17e;
_YM.VectorImage=_174;
_YM.VectorType=_16d;
_YM.StrokeStyle=_16e;
_YM.Tile=Tile;
_YM.Overlay=_10e;
_YM.Zoomer=_122;
_YM.PopMenu=_12b;
_YM.Icon=Icon;
_YM.Mark=Mark;
_YM.InfoBar=_159;
_YM.InfoBox=_134;
_YM.MiniController=_f3;
_YM.StdController=_f5;
_YM.ScaleBar=_eb;
_YU.namespace("maps.utils");
var _YMU=_YM.utils;
_YMU.GeoUtil=_1b6;
})();
(function(){
var _Y=window[_YoudaoGlobalName_].maps.basis;
var _YU=_Y.utils;
var _YM=window[_YoudaoGlobalName_].maps;
var _YMU=_YM.utils;
var _1c9={imageHosts:["http://m1.youdao.com/mpng/","http://m2.youdao.com/mpng/"],imageHostsPattern:"http://m$i.youdao.com/mpng/",imageHostsMinIndex:1,imageHostsMaxIndex:6,MaxZoom:13,MinZoom:0,TileSize:200,TileLaSpan:256,TileLoSpan:256,EarchRadius:6378137,LtGeoRatio:100000,TileBufferSize:300,TileDisplayDelay:300};
var _1ca=function(_1cb,_1cc,_1cd){
var _1ce=_1cd-_1cc+1;
if(_1ce==undefined||_1ce<0){
return;
}
_1c9.imageHosts=[];
for(var i=0;i<_1ce;i++){
var idx=i+_1cc;
_1c9.imageHosts[i]=_1cb.replace("$i",idx);
}
};
_1ca(_1c9.imageHostsPattern,_1c9.imageHostsMinIndex,_1c9.imageHostsMaxIndex);
var _1d1=function(xpos,ypos,_1d4){
var z=_1d4||0;
var c="_";
return "xy"+xpos+c+ypos+c+z;
};
var _1d7=new _Y.Class({distanceLatitude2Meter:function(_1d8){
return Math.abs((_1d8/_1c9.LtGeoRatio/180*(_1c9.EarchRadius*Math.PI)));
},distanceLongitude2Meter:function(_1d9){
return this.distanceLatitude2Meter(_1d9);
},distanceMeter2Latitude:function(_1da){
return Math.abs((_1da*180/(_1c9.EarchRadius*Math.PI)))*_1c9.LtGeoRatio;
},distanceMeter2Longitude:function(_1db){
return this.distanceMeter2Latitude(_1db);
},distanceMeter2Pixel:function(_1dc,zoom){
return this.distanceLatitude2Pixel(this.distanceMeter2Latitude(_1dc),zoom);
},distanceLatitude2Pixel:function(_1de,zoom){
return _1de/_1c9.TileLaSpan/Math.pow(2,zoom)*_1c9.TileSize;
},distanceLongitude2Pixel:function(_1e0,zoom){
return this.distanceLatitude2Pixel(_1e0,zoom);
},distancePixel2Latitude:function(dis,zoom){
return dis*_1c9.TileLaSpan*Math.pow(2,zoom)/_1c9.TileSize;
},distancePixel2Longitude:function(dis,zoom){
return this.distancePixel2Latitude(dis,zoom);
},getBestZoom:function(_1e6,_1e7){
var _1e8,_1e9;
if(_1e6.width/_1e7.width>_1e6.height/_1e7.height){
_1e8=_1e6.width;
_1e9=_1e7.width;
}else{
_1e8=_1e6.height;
_1e9=_1e7.height;
}
var _1ea=_1e9-20;
for(var i=_1c9.MinZoom;i<_1c9.MaxZoom;i++){
var _1ec=this.distanceLatitude2Pixel(_1e8,i);
if(_1ec<_1ea){
return i;
}
}
return _1c9.MaxZoom;
},getTileUrl:function(bx,by,_1ef){
var _1f0=8;
var zoom=_1ef+(8-_1f0);
var _1f2=Math.ceil((12-zoom)/4);
var _1f3=0,_1f4=0,_1f5=0;
var path="";
for(var i=0;i<_1f2;i++){
var _1f8=1<<(4*(_1f2-i));
var nRow=parseInt((bx-_1f3*_1f5)/_1f8);
var nCol=parseInt((by-_1f4*_1f5)/_1f8);
path+=((nRow>9)?nRow:"0"+nRow)+""+((nCol>9)?nCol:"0"+nCol)+"/";
_1f3=nRow;
_1f4=nCol;
_1f5=_1f8;
}
var id=(((bx)&((1<<20)-1))+(((by)&((1<<20)-1))*Math.pow(2,20))+(((zoom)&((1<<8)-1))*Math.pow(2,40)));
var _1fc=(bx+by+_1ef)%_1c9.imageHosts.length;
return _1c9.imageHosts[_1fc]+zoom+"/"+path+id+".png";
},geoMoveByPx:function(_1fd,zoom,_1ff,_200){
if(_200){
var plo=_1fd.lo-this.distancePixel2Longitude(_1ff.x,zoom);
var pla=_YU.add(_1fd.la,this.distancePixel2Latitude(_1ff.y,zoom));
}else{
var plo=_YU.add(_1fd.lo,this.distancePixel2Longitude(_1ff.x,zoom));
var pla=_1fd.la-this.distancePixel2Latitude(_1ff.y,zoom);
}
var p=new _YM.GeoPoint(plo,pla);
return p;
},initialize:function(){
_YU.inject(this,_YMU.GeoUtil);
}});
var _204=new _Y.Class({Extends:_YM.MapLayer,initialize:function(){
this.parent("LTML");
this.tileList=[];
this.geoUtil=new _1d7();
this.defaults=_1c9;
},tileList:null,map:null,updateView:function(_205){
this.loadTiles(_205);
},loadTiles:function(_206){
if(this.tileList.length>_1c9.TileBufferSize){
while(this.tileList.length>0){
var t=this.tileList.pop();
t.dom.dispose();
}
this.tileList=[];
}
for(var i=0;i<this.tileList.length;i++){
var t=this.tileList[i];
t.inuse=false;
}
if(!_YU.check(_206)){
_206=this.map.geoCenter;
}
var _209=Math.ceil(this.geoUtil.distanceLongitude2Pixel(_206.lo,this.map.zoom)/_1c9.TileSize);
var _20a=Math.ceil(this.geoUtil.distanceLatitude2Pixel(_206.la,this.map.zoom)/_1c9.TileSize);
var _20b=Math.ceil(this.map.viewSize.width/_1c9.TileSize)+1;
var _20c=Math.ceil(this.map.viewSize.height/_1c9.TileSize)+1;
var _20d=Math.ceil(this.geoUtil.distanceLongitude2Pixel(_206.lo,this.map.zoom));
var _20e=Math.ceil(this.geoUtil.distanceLongitude2Pixel(_206.la,this.map.zoom));
var hw=this.map.viewSize.width/2;
var hh=this.map.viewSize.height/2;
var left=(_20d-hw)/_1c9.TileSize;
var _212=(_20d+hw)/_1c9.TileSize;
var top=(_20e+hh)/_1c9.TileSize;
var _214=(_20e-hh)/_1c9.TileSize;
this.tileToLoad=0;
for(var i=0;i<(_20b+1)/2;i++){
for(var j=0;j<(_20c+1)/2;j++){
if(_20a-j-1>_214-1){
if(_209-i-1>left-1){
this.addTile(_209-i-1,_20a-j-1,this.map.zoom,this.map.refererGeoPoint,false);
this.tileToLoad++;
}
if(_209+i<_212){
this.addTile(_209+i,_20a-j-1,this.map.zoom,this.map.refererGeoPoint,false);
this.tileToLoad++;
}
}
if(_20a+j<top){
if(_209-i-1>left-1){
this.addTile(_209-i-1,_20a+j,this.map.zoom,this.map.refererGeoPoint,false);
this.tileToLoad++;
}
if(_209+i<_212){
this.addTile(_209+i,_20a+j,this.map.zoom,this.map.refererGeoPoint,false);
this.tileToLoad++;
}
}
}
}
var _216=this.tileList;
function showtile(){
for(var i=0;i<_216.length;i++){
var t=_216[i];
if(!t.inuse){
t.display(false);
}else{
t.display(true);
}
}
}
var _219=this.tileToLoad*30;
if(_219>_1c9.TileDisplayDelay){
_219=_1c9.TileDisplayDelay;
}
setTimeout(showtile,_219);
this.tileToLoad=0;
},addRefererMarker:function(){
if(!_YU.check(this.rMarker)&&_YU.check(this.map)){
this.rMarker=new _YM.Icon("http://cimg2.163.com/cnews/newimg/template/i2.gif","cMarker",this.map.refererGeoPoint);
this.rMarker.addToMap(this.map);
}
this.rMarker.setPosition(this.map.refererGeoPoint);
},addCenterMarker:function(){
if(!_YU.check(this.cMarker)&&_YU.check(this.map)){
this.cMarker=new _YM.Icon("http://ditu.youdao.com/js/pack110109M//img/maps/refresh.gif",this.map.refererGeoPoint,"cMarker");
this.cMarker.addToMap(this.map);
}
this.cMarker.setPosition(this.map.geoCenter);
},addTile:function(_21a,_21b,zoom,_21d,_21e){
var key=_1d1(_21a,_21b,zoom);
var tile=this.tileList[key];
if(!_YU.check(this.tileList[key])){
var _221=this.geoUtil.getTileUrl(_21a,_21b,zoom);
var tile=new _YM.Tile(_221,key);
this.tileList[key]=tile;
this.tileList.push(tile);
tile.dom.setStyles({zIndex:_YM.Default.zIndex.tile,"-moz-user-select":"none"});
var _222=function(){
this.dom.src=_Y.baseurl+"img/lterrorimg.png";
};
tile.addEvent("error",_YU.bind(_222,tile));
if(_21e==false){
tile.inuse=true;
tile.dom.setStyles({display:"none"});
}else{
tile.display(true);
}
this.dom.adopt(tile.dom);
}
tile.inuse=true;
var _223=Math.pow(2,zoom);
tile.dom.setStyles({"left":(_21a-_21d.lo/_1c9.TileLoSpan/_223)*_1c9.TileSize+"px","top":(_21d.la/_1c9.TileLaSpan/_223-_21b-1)*_1c9.TileSize+"px","position":"absolute"});
}});
_YU.namespace("maps.lingtu");
var _YML=_YM.lingtu;
_YML.Default=_1c9;
_YML.GeoUtil=_1d7;
_YML.MapLayer=_204;
})();
(function(){
var _Y=window[_YoudaoGlobalName_].maps.basis;
var _YU=_Y.utils;
var _YM=window[_YoudaoGlobalName_].maps;
var _YML=_YM.lingtu;
var _YMU=_YM.utils;
var _22a=new _Y.Class({initialize:function(name,_22c,_22d){
if(_22d){
this.map=_22d.map;
this.setup=_22d.setup;
this.teardown=_22d.teardown;
this.returns=_22d.returns||{};
this.description=_22d.description||"undefined";
}
this.mapActions=_22c||{};
this.name=name||"undefined";
},name:null,description:null,on:null,map:null,mapActions:null,setup:null,entry:function(){
if(!this.map){
return;
}
this.lastMode=this.map.mode;
this.map.mode=this;
this.enableModeEvents();
this.on=true;
if(this.setup){
this.setup();
}
},exit:function(){
if(this.teardown){
this.teardown();
}
this.on=false;
if(!this.map){
return;
}
this.disableModeEvents();
var _22e=new _Y.Event(null,"exitmapmode");
_22e.mode=this;
_22e.returns=this.returns;
this.map.setMode("NORMAL");
this.map.dom.fireEvent("exitmapmode",_22e);
},bindTo:function(map){
this.map=map;
this.map.mode=this;
},addEvent:function(_230,_231){
this.disableModeEvents();
this.mapActions[_230]=_231;
this.enableModeEvents();
},enableModeEvents:function(){
if(!this.map){
return;
}
for(var ev in this.mapActions){
this.map.maskEvent(ev);
}
for(var evt in this.mapActions){
if(!this.map){
return;
}
this.map.addEvent(evt,this.mapActions[evt]);
}
},disableModeEvents:function(){
if(!this.map){
return;
}
for(var evt in this.mapActions){
this.map.removeEvent(evt,this.mapActions[evt]);
}
for(var ev in this.mapActions){
this.map.unmaskEvent(ev);
}
}});
var _236=new _22a("NORMAL");
var _237=function(e){
if(!this.mode.points){
this.mode.points=[];
}
if(!this.mode.overlays){
this.mode.overlays=[];
}
var pt=this.getPixelGeoPosition(e.page.x,e.page.y);
this.mode.points.push(pt);
var _23a=0;
this.mode.totalDistance=this.mode.totalDistance||0;
if(this.mode.lastPoint){
_23a=this.geoUtil.calculateDistance(pt,this.mode.lastPoint);
}
this.mode.lastPoint=pt;
this.mode.totalDistance+=_23a;
var text="";
if(this.mode.totalDistance==0){
text="\u8d77\u70b9";
}else{
if(this.mode.totalDistance<1){
text=(this.mode.totalDistance*1000).toFixed(0)+"m";
}else{
text=this.mode.totalDistance.toFixed(2)+"km";
}
}
var mk=new youdao.maps.Mark(pt,{text:text,offsetX:4,offsetY:-4});
mk.id="m_km";
mk.dom.setStyles({"background-color":"#FFFFD7","border":"1px solid #ADAEAC","color":"#993300","font-size":"13px","opacity":"0.8","padding":"0 3px"});
this.mode.overlays.push(mk);
mk.addToMap(this);
var dot=new youdao.maps.Mark(pt,{text:"",offsetX:-4,offsetY:4});
dot.id="dot";
dot.dom.setStyles({"background-color":"red","font-size":"0px","opacity":"0.6","width":"8","height":"8"});
this.mode.overlays.push(dot);
dot.addToMap(this);
if(this.mode.points.length>1){
var path=this.addPath(this.mode.points,{"color":"red","width":2});
if(this.mode.vector){
this.mode.vector.destroy();
}
this.mode.vector=path;
}
if(this.mode.lineDrag){
this.mode.lineDrag.destroy();
this.mode.lineDrag=null;
}
};
var _23f=function(e){
if(!this.mode.tip){
this.mode.tip=new _Y.Element("div");
this.mode.tip.innerHTML="<b> \u6d4b\u8ddd\u72b6\u6001</b>\uff1a\u5de6\u952e\u6dfb\u52a0\u6d4b\u8ddd\u70b9\uff0c\u53f3\u952e\u9000\u51fa";
this.mode.tip.setStyles({"background-color":"#D2F0FF","border":"1px solid #ADAEAC","color":"#993300","font-size":"12px","opacity:":"0.6","position":"absolute","white-space":"nowrap"});
$(document.body).adopt(this.mode.tip);
}
this.mode.tip.setStyles({"display":"block","top":e.page.y+"px","left":e.page.x+12+"px"});
if(this.mode.lineDrag){
this.mode.lineDrag.destroy();
this.mode.lineDrag=null;
}
if(this.mode.points&&this.mode.points.length>0){
var _241=[];
var _242=this.mode.points[this.mode.points.length-1];
_241.push(_242);
var pt=this.getPixelGeoPosition(e.page.x,e.page.y);
_241.push(pt);
this.mode.lineDrag=this.addPath(_241,{"color":"red","width":2,"dasharray":"4,4"});
}
};
var _244=function(e){
if(this.mode.totalDistance>0){
var _246=new youdao.maps.Mark(this.mode.lastPoint,{text:"",offsetY:15,offsetX:8});
_246.id="XXXX  ";
_246.dom.setStyles({"background":"url("+_Y.baseurl+"img/gtb.gif) red no-repeat -204px -2px","color":"#993300","font-size":"0px","opacity:":"0.6","width":"10px","height":"10px"});
_246.addToMap(this);
_246.marks=[];
_246.marks.push(this.mode.vector);
for(var hint in this.mode.overlays){
_246.marks.push(this.mode.overlays[hint]);
}
var _248=function(e){
for(var mk in this.marks){
var o=this.marks[mk];
if(o.removeFromMap){
o.removeFromMap();
}
if(o.destroy){
o.destroy();
o=null;
}
}
this.marks=null;
this.removeFromMap();
this.destroy();
};
_246.addEvent("click",_248);
_246.addEvent("mouseover",function(){
this.dom.setStyles({"background":"url("+_Y.baseurl+"img/gtb.gif) red no-repeat -218px -2px","cursor":"pointer","opacity:":"0.9"});
});
_246.addEvent("mouseout",function(){
this.dom.setStyles({"background":"url("+_Y.baseurl+"img/gtb.gif) red no-repeat -204px -2px","cursor":"hand","opacity:":"0.6"});
});
}else{
for(var k in this.mode.overlays){
var o=this.mode.overlays[k];
if(o.removeFromMap){
o.removeFromMap();
}
if(o.destroy){
o.destroy();
o=null;
}
}
}
this.mode.exit();
};
var _24e={"click":_237,"rclick":_244,"mousemove":_23f};
var _24f=new _22a("MEASURE_DISTANCE",_24e,{setup:function(){
this.points=[];
this.overlays=[];
this.lastPoint=null;
this.totalDistance=0;
this.vector=null;
},teardown:function(){
if(this.tip){
this.tip.destroy();
this.tip=null;
}
if(this.lineDrag){
this.lineDrag.destroy();
this.lineDrag=null;
}
}});
var _250=function(e){
if(this.mode.lineDrag){
this.mode.lineDrag.destroy();
this.mode.lineDrag=null;
}
this.mode.centerPoint=this.getPixelGeoPosition(e.start.x,e.start.y);
if(this.mode.centerTag&&this.mode.centerTag.dom){
this.mode.centerTag.setPosition(this.mode.centerPoint);
}else{
var dot=new youdao.maps.Mark(this.mode.centerPoint,{text:"",offsetX:-3,offsetY:3});
dot.id="dot";
dot.dom.setStyles({"background-color":"red","font-size":"0px","opacity":"0.9","width":"6","height":"6"});
dot.addToMap(this);
this.mode.centerTag=dot;
}
this.mode.nowPoint=this.getPixelGeoPosition(e.now.x,e.now.y);
var _253=2*this.activeMapLayer.geoUtil.distanceLongitude2Meter(this.mode.nowPoint.lo-this.mode.centerPoint.lo);
var _254=2*this.activeMapLayer.geoUtil.distanceLatitude2Meter(this.mode.nowPoint.la-this.mode.centerPoint.la);
this.mode.lineDrag=this.addRect(this.mode.centerPoint.lo,this.mode.centerPoint.la,_253,_254,{"color":"red","width":2,"dasharray":"4,4"});
};
var _255=function(e){
if(this.mode.centerTag){
this.mode.centerTag.destroy();
this.mode.centerTag=null;
}
if(this.mode.lineDrag){
this.mode.lineDrag.destroy();
this.mode.lineDrag=null;
}
this.mode.centerPoint=this.getPixelGeoPosition(e.start.x,e.start.y);
this.mode.nowPoint=this.getPixelGeoPosition(e.now.x,e.now.y);
var _257=Math.abs(this.mode.nowPoint.lo-this.mode.centerPoint.lo);
var _258=Math.abs(this.mode.nowPoint.la-this.mode.centerPoint.la);
var _259=2*this.activeMapLayer.geoUtil.distanceLongitude2Meter(_257);
var _25a=2*this.activeMapLayer.geoUtil.distanceLatitude2Meter(_258);
this.mode.size=new _YU.Size(_259,_25a);
this.mode.vector=this.addRect(this.mode.centerPoint.lo,this.mode.centerPoint.la,_259,_25a,{"color":"red","width":2});
var _25b="";
if(_259>=1000){
_25b=(_259/1000).toFixed(2)+"km";
}else{
_25b=(_259).toFixed(0)+"m";
}
var _25c=new youdao.maps.Mark(new youdao.maps.GeoPoint(this.mode.centerPoint.lo,this.mode.centerPoint.la+_258),{text:_25b,offsetX:-14,offsetY:-4});
_25c.id="m_km";
_25c.dom.setStyles({"background-color":"#FFFFD7","border":"1px solid #ADAEAC","color":"#993300","font-size":"13px","opacity":"0.8","padding":"0 3px"});
_25c.addToMap(this);
if(_25a>=1000){
rtext=(_25a/1000).toFixed(2)+"km";
}else{
rtext=(_25a).toFixed(0)+"m";
}
var _25d=new youdao.maps.Mark(new youdao.maps.GeoPoint(this.mode.centerPoint.lo+_257,this.mode.centerPoint.la),{text:rtext,offsetX:4,offsetY:4});
_25d.id="m_km";
_25d.dom.setStyles({"background-color":"#FFFFD7","border":"1px solid #ADAEAC","color":"#993300","font-size":"13px","opacity":"0.8","padding":"0 3px"});
_25d.addToMap(this);
for(var i=-1;i<2;i=i+2){
for(var j=-1;j<2;j=j+2){
var pt=new youdao.maps.GeoPoint(this.mode.centerPoint.lo+i*_257,this.mode.centerPoint.la+j*_258);
var dot=new youdao.maps.Mark(pt,{text:"",offsetX:-4,offsetY:4});
dot.id="dot";
dot.dom.setStyles({"background-color":"red","font-size":"0px","opacity":"0.6","width":"8","height":"8"});
this.mode.overlays.push(dot);
dot.addToMap(this);
}
}
var cdot=new youdao.maps.Mark(this.mode.centerPoint,{text:"",offsetX:-3,offsetY:3});
cdot.id="dot";
cdot.dom.setStyles({"background-color":"red","font-size":"0px","opacity":"0.9","width":"6","height":"6"});
cdot.addToMap(this);
var tmk=new youdao.maps.Mark(this.mode.nowPoint,{text:"",offsetY:15,offsetX:8});
tmk.dom.setStyles({"background":"url("+_Y.baseurl+"img/gtb.gif) red no-repeat -204px -2px","color":"#993300","font-size":"0px","opacity:":"0.6","width":"10px","height":"10px"});
tmk.addToMap(this);
tmk.marks=[];
tmk.marks.push(this.mode.vector);
tmk.marks.push(cdot);
tmk.marks.push(_25c);
tmk.marks.push(_25d);
for(var hint in this.mode.overlays){
tmk.marks.push(this.mode.overlays[hint]);
}
var _265=function(e){
for(var mk in this.marks){
var o=this.marks[mk];
if(o.removeFromMap){
o.removeFromMap();
}
if(o.destroy){
o.destroy();
o=null;
}
}
this.marks=null;
this.removeFromMap();
this.destroy();
};
tmk.addEvent("click",_265);
tmk.addEvent("mouseover",function(){
this.dom.setStyles({"background":"url("+_Y.baseurl+"img/gtb.gif) red no-repeat -218px -2px","cursor":"pointer","opacity:":"0.9"});
});
tmk.addEvent("mouseout",function(){
this.dom.setStyles({"background":"url("+_Y.baseurl+"img/gtb.gif) red no-repeat -204px -2px","cursor":"hand","opacity:":"0.6"});
});
this.mode.closeMark=tmk;
this.mode.exit();
};
var _269=function(e){
if(!this.mode.tip){
this.mode.tip=new _Y.Element("div");
this.mode.tip.innerHTML="<b> \u77e9\u5f62\u6846\u72b6\u6001</b>\uff1a\u5728\u5730\u56fe\u4e0a\u62d6\u62fd\uff0c\u4ea7\u751f\u77e9\u5f62\u533a\u57df\u3002";
this.mode.tip.setStyles({"background-color":"#D2F0FF","border":"1px solid #ADAEAC","color":"#993300","font-size":"12px","opacity:":"0.6","position":"absolute","white-space":"nowrap"});
$(document.body).adopt(this.mode.tip);
}
this.mode.tip.setStyles({"display":"block","top":e.page.y+"px","left":e.page.x+12+"px"});
};
var _26b={"mousemove":_269,"dragend":_255,"drag":_250};
var _26c=new _22a("DRAG_RECT",_26b,{setup:function(){
this.vector=null;
this.size=null;
this.centerPoint=null;
this.overlays=[];
},teardown:function(){
if(this.tip&&this.tip.destroy){
this.tip.destroy();
this.tip=null;
}
this.returns={center:this.centerPoint,size:this.size,rect:this.vector,overlays:this.overlays,closeMark:this.closeMark};
}});
var _26d=_YM.Default;
_YU.inject(_26d,{"version":1.0090812,"MODE":{"NORMAL":_236,"MEASURE_DISTANCE":_24f,"DRAG_RECT":_26c}});
var _26e=new _Y.Class({Extends:_YU.Coordinate,initialize:function(lo,la){
this.set(lo,la);
},set:function(lo,la){
if(isNaN(lo)||isNaN(la)){
lo=parseFloat(lo);
la=parseFloat(la);
}
this.lo=lo;
this.la=la;
this.x=lo;
this.y=la;
}});
var Map=new _Y.Class({Extends:_YU.DomObject,id:null,dom:null,viewSize:null,lastViewSize:null,geoCenter:null,lastGeoCenter:null,refererGeoPoint:null,refererCoord:null,zoom:null,lastZoom:null,mapLayers:null,activeMapLayer:null,overlayList:null,mapcontent:null,vectorManager:null,vectorRender:null,controller:null,scaleBar:null,modeController:null,copyrightDiv:null,hasFocus:true,geoUtil:_YMU.GeoUtil,getContainerSize:function(){
var size=_YU.getSize(this.dom);
return size;
},getGeoRange:function(){
var _275=this.activeMapLayer.geoUtil.distancePixel2Latitude(this.viewSize.height,this.zoom);
var _276=this.activeMapLayer.geoUtil.distancePixel2Longitude(this.viewSize.width,this.zoom);
return new _YU.Range(new _26e((this.geoCenter.lo-_276/2),(this.geoCenter.la-_275/2)),new _26e((this.geoCenter.lo+_276/2),(this.geoCenter.la+_275/2)),_YU.RangeType.GEO);
},addMapLayer:function(_277){
this.mapLayers.push(_277);
this.mapcontent.adopt(_277.dom);
_277.map=this;
this.activeMapLayer=_277;
this.geoUtil=this.activeMapLayer.geoUtil;
},addVectorRender:function(){
if(this.vectorRender){
return;
}
this.vectorRender=new _YM.VectorRender("VectorRender"+_YU.getRandomId());
if(!_YU.check(this.viewSize)){
this.viewSize=this.getContainerSize();
}
this.mapcontent.adopt(this.vectorRender.dom);
this.vectorRender.map=this;
},addRect:function(clo,cla,_27a,_27b,_27c){
var rect=new _YM.VectorImage(_YM.VectorType.RECTANGLE,{lo:clo,la:cla,width:_27a,height:_27b,stroke:_27c});
this.vectorManager.addVector(rect);
this.vectorRender.drawVector(rect);
return rect;
},addCircle:function(clo,cla,mr,_281){
var _282=new _YM.VectorImage(_YM.VectorType.CIRCLE,{lo:clo,la:cla,r:mr,stroke:_281});
this.vectorManager.addVector(_282);
this.vectorRender.drawVector(_282);
return _282;
},addPath:function(_283,_284){
var path=new _YM.VectorImage(_YM.VectorType.PATH,{path:_283,stroke:_284});
this.vectorManager.addVector(path);
this.vectorRender.drawVector(path);
return path;
},updateViewSize:function(){
this.viewSize=this.getContainerSize();
},refreshView:function(){
this.updateViewSize();
if(this.lastViewSize==this.viewSize&&this.lastGeoCenter==this.geoCenter&&this.lastZoom==this.zoom){
_Y.log("skip refreshView()");
return;
}
this.refererGeoPoint=this.geoCenter;
this.refererCoord=new _YU.Coordinate(this.viewSize.width/2,this.viewSize.height/2);
this.mapcontent.setStyles({left:this.viewSize.width/2,top:this.viewSize.height/2,position:"absolute"});
if(this.controller){
this.controller.updateView();
}
if(this.scaleBar){
this.scaleBar.updateView();
}
this.updateView();
this.updateOverlayView();
this.vectorRender.updateVectorRange();
this.lastViewSize=this.viewSize;
this.lastGeoCenter=this.geoCenter;
this.lastZoom=this.zoom;
},updateOverlayView:function(){
for(var i=0;i<this.overlayList.length;i++){
var lay=this.overlayList[i];
lay.updatePosition();
}
},updateView:function(_288){
if(!_YU.check(_288)){
_288=this.geoCenter;
}
for(var i=0;i<this.mapLayers.length;i++){
var lay=this.mapLayers[i];
lay.updateView(_288);
}
},showCenter:function(){
if(!_YU.check(this.cMarker)){
this.cMarker=new _Y.Element("img",{"src":_Y.baseurl+"img/cross.png","id":"cMarker"});
}
this.dom.adopt(this.cMarker);
this.cMarker.setStyles({left:this.viewSize.width/2-6,top:this.viewSize.height/2-6,width:13,height:13,"position":"absolute","padding":"0"});
},addOverlay:function(_28b){
this.overlayList.push(_28b);
this.mapcontent.adopt(_28b.dom);
_28b.map=this;
_28b.updatePosition();
},removeOverlay:function(_28c){
if(!_28c){
return;
}
if(_28c.dom){
_28c.dom.dispose();
}
var idx=_YU.indexOf(_28c,this.overlayList);
if(idx>=0){
this.overlayList.splice(idx,1);
}
},removeAllMark:function(){
for(var i=0;i<this.overlayList.length;i++){
var lay=this.overlayList[i];
lay.dom.dispose();
}
this.overlayList=[];
for(i=0;i<this.vectorManager.vectorList.length;i++){
var _290=this.vectorManager.vectorList[i];
if(_290.dom){
_290.dom.dispose();
}
}
this.vectorManager.vectorList=[];
},move:function(_291){
this.moveMapViewOnly(_291);
this.moveGeoCenter(_291);
},moveMapViewOnly:function(_292,pos){
var _294=150;
var s={"left":this.refererCoord.x+_292.x,"top":this.refererCoord.y+_292.y,"position":"absolute"};
this.mapcontent.setStyles(s);
if(!_YU.check(this.lastPos)){
this.lastPos={x:NaN,y:NaN};
}
var _296=NaN;
var _297=NaN;
if(_YU.check(pos)){
_296=Math.abs(this.lastPos.x-pos.x);
_297=Math.abs(this.lastPos.y-pos.y);
}
if(isNaN(_296)||isNaN(_297)||_296>_294||_297>_294){
this.lastPos=pos;
var _298=this.activeMapLayer.geoUtil.geoMoveByPx(this.geoCenter,this.zoom,_292,true);
this.updateView(_298);
}
},moveGeoCenter:function(_299){
this.geoCenter=this.activeMapLayer.geoUtil.geoMoveByPx(this.geoCenter,this.zoom,_299,true);
this.refererCoord.x=_YU.add(this.refererCoord.x,_299.x);
this.refererCoord.y=_YU.add(this.refererCoord.y,_299.y);
},maxZoom:function(){
return this.activeMapLayer.defaults.MaxZoom;
},minZoom:function(){
return this.activeMapLayer.defaults.MinZoom;
},centerAndZoom:function(pt,zoom){
this.geoCenter=pt;
this.zoom=zoom;
if(this.zoom>this.activeMapLayer.defaults.MaxZoom){
this.zoom=this.activeMapLayer.defaults.MaxZoom;
}
if(this.zoom<this.activeMapLayer.defaults.MinZoom){
this.zoom=this.activeMapLayer.defaults.MinZoom;
}
this.refreshView();
},centerTo:function(_29c){
this.geoCenter=_29c;
this.centerAndZoom(this.geoCenter,this.zoom);
},zoomTo:function(zoom,_29e){
var _29f=this.zoom;
this.zoom=zoom;
if(this.zoom>this.activeMapLayer.defaults.MaxZoom){
this.zoom=this.activeMapLayer.defaults.MaxZoom;
}
if(this.zoom<this.activeMapLayer.defaults.MinZoom){
this.zoom=this.activeMapLayer.defaults.MinZoom;
}
if(_29e&&_29e.la){
newCenterLo=(this.geoCenter.lo-_29e.lo)/Math.pow(2,_29f)*Math.pow(2,this.zoom)+_29e.lo;
newCenterLa=(this.geoCenter.la-_29e.la)/Math.pow(2,_29f)*Math.pow(2,this.zoom)+_29e.la;
var _2a0=new _YM.GeoPoint(newCenterLo,newCenterLa);
this.geoCenter=_2a0;
}else{
_29e=this.geoCenter;
}
this.centerAndZoom(this.geoCenter,this.zoom);
if(this.zoomer){
this.zoomer.setPosition(_29e);
if(this.zoom>_29f){
this.zoomer.zoomOut();
}else{
if(this.zoom<_29f){
this.zoomer.zoomIn();
}
}
}
},zoomOut:function(_2a1){
this.zoomTo(this.zoom+1,_2a1);
},zoomIn:function(_2a2){
this.zoomTo(this.zoom-1,_2a2);
},setMode:function(mode){
if(typeof (mode)=="string"){
this.modeController.setMode(mode);
}else{
this.modeController.setMode(mode.name);
}
},getModeStateInfo:function(mode){
if(typeof (mode)=="string"){
this.modeController.getModeStateInfo(mode);
}else{
this.modeController.getModeStateInfo(mode.name);
}
},addController:function(type){
if(type==1){
this.controller=new _YM.MiniController();
this.controller.addToMap(this);
}else{
if(type>1){
return;
}else{
this.controller=new _YM.StdController();
this.controller.addToMap(this);
}
}
},getPixelGeoPosition:function(_2a6,_2a7,_2a8){
if(_2a8!=false){
var _2a9=this.dom.getPosition();
_2a6=_2a6-_2a9.x;
_2a7=_2a7-_2a9.y;
}
var _2aa=this.activeMapLayer.geoUtil.distancePixel2Longitude(_2a6-this.refererCoord.x,this.zoom);
var _2ab=-this.activeMapLayer.geoUtil.distancePixel2Latitude(_2a7-this.refererCoord.y,this.zoom);
var lo=_YU.add(this.refererGeoPoint.lo,_2aa);
var la=_YU.add(this.refererGeoPoint.la,_2ab);
return new _YM.GeoPoint(lo,la);
},getBestView:function(_2ae){
if(_2ae==undefined||!(_2ae.length>0)){
return;
}
this.updateViewSize();
var _2af=Number.MAX_VALUE;
var _2b0=Number.MAX_VALUE;
var _2b1=-Number.MAX_VALUE;
var _2b2=-Number.MAX_VALUE;
for(var i=0;i<_2ae.length;i++){
var p=_2ae[i];
var _2b0=Math.min(_2b0,p.lo);
var _2af=Math.min(_2af,p.la);
var _2b2=Math.max(_2b2,p.lo);
var _2b1=Math.max(_2b1,p.la);
}
var zoom=this.activeMapLayer.geoUtil.getBestZoom(new _YU.Size(_2b2-_2b0,_2b1-_2af),this.viewSize);
var _2b6=new _26e((_2b2+_2b0)/2,(_2b1+_2af)/2);
this.centerAndZoom(_2b6,zoom);
},initialize:function(_2b7,type,id){
this.id=id||"map-"+_YU.getRandomId();
this.dom=$(_2b7);
this.dom.setStyles({"-moz-user-select":"none","background-color":"#EBE6DC","position":"relative","overflow":"hidden","display":"block","border":"0px solid"});
this.mapLayers=[];
this.overlayList=[];
this.modeController=new _2ba(this);
this.mapcontent=new _Y.Element("div",{id:"map-content"+_YU.getRandomId()});
this.dom.adopt(this.mapcontent);
this.copyrightDiv=new _Y.Element("div",{id:"copyright"});
this.copyrightDiv.setStyles({"bottom":"0px","font-size":"12px","left":"3px","position":"absolute","display":"block",zIndex:_26d.zIndex.control});
this.dom.adopt(this.copyrightDiv);
this.copyrightDiv.innerHTML="\xa92009 \u7f51\u6613\u516c\u53f8 \xa9<a href=\"http://www.51ditu.com/\" target=\"_blank\" style=\"text-decoration:none\">51ditu.com</a> <a href=\"http://www.youdao.com/terms/map.html\" target=\"_blank\" style=\"color:rgb(98,98,98)\">\u670d\u52a1\u6761\u6b3e</a>";
this.vectorManager=new _YM.VectorManager(this);
this.addVectorRender();
this.addController(type);
if(type!=1){
this.scaleBar=new _YM.ScaleBar();
this.scaleBar.addToMap(this);
}
var _2bb=new _YML.MapLayer("map-layer"+_YU.getRandomId());
this.addMapLayer(_2bb);
var _2bc=new _26e(11639710.52,3990786.96);
this.geoCenter=_2bc;
this.zoom=5;
_2bd(this);
this.zoomer=new _YM.Zoomer();
this.zoomer.addToMap(this);
}});
var _2bd=function(map){
var _2bf=function(e){
this.refreshView();
};
$(window).addEvent("resize",_YU.bind(_2bf,map));
$(document).addEvent("domready",_YU.bind(_2bf,map));
var _2c1=function(_2c2){
this.moveMapViewOnly(_2c2.delta,_2c2.now);
_2c2.preventDefault();
};
var _2c3=function(_2c4){
this.moveGeoCenter(_2c4.delta);
this.updateView(this.geoCenter);
};
map.addEvent("drag",_2c1);
map.addEvent("dragend",_2c3);
var _2c5=function(e){
var _2c7=map.getPixelGeoPosition(e.page.x,e.page.y);
_2c7.set(Math.round(_2c7.lo),Math.round(_2c7.la));
this.zoomIn(_2c7);
};
map.addEvent("dblclick",_2c5);
var _2c8=function(e){
var _2ca=map.getPixelGeoPosition(e.page.x,e.page.y);
_2ca.set(Math.round(_2ca.lo),Math.round(_2ca.la));
this.zoomOut(_2ca);
};
map.addEvent("dbrclick",_2c8);
var _2cb=function(e){
var _2cd=map.getPixelGeoPosition(e.page.x,e.page.y);
_2cd.set(Math.round(_2cd.lo),Math.round(_2cd.la));
if(e.wheel<=-1){
this.zoomOut(_2cd);
}
if(e.wheel>=1){
this.zoomIn(_2cd);
}
};
map.addEvent("mousescroll",_2cb);
map.addEvent("contextmenu",function(e){
e.preventDefault();
});
var _2cf=function(e){
var _2d1=e.target||e.srcElement;
if(_2d1&&_2d1.type=="text"){
return;
}
if(this.hasFocus==false){
return;
}
var _2d2=150;
switch(e.key){
case "up":
var _2d3={"x":0,"y":_2d2};
this.move(_2d3);
break;
case "down":
var _2d3={"x":0,"y":-_2d2};
this.move(_2d3);
break;
case "left":
var _2d3={"x":_2d2,"y":0};
this.move(_2d3);
break;
case "right":
var _2d3={"x":-_2d2,"y":0};
this.move(_2d3);
break;
case "=":
this.zoomIn();
break;
case "-":
this.zoomOut();
break;
}
};
var _2d4=function(_2d5){
var _2d6=_2d5.target||_2d5.srcElement;
pos=this.dom.getPosition();
size=_YU.getSize(this.dom);
if(_2d5.page.x>pos.x&&_2d5.page.x<pos.x+size.w&&_2d5.page.y>pos.y&&_2d5.page.y<pos.y+size.h){
this.hasFocus=true;
}else{
this.hasFocus=false;
}
};
$(document).addEvent("keydown",_YU.bind(_2cf,map));
$(document).addEvent("click",_YU.bind(_2d4,map));
};
var _2ba=new _Y.Class({map:null,modeDefine:_26d.MODE,mode:null,initialize:function(map,_2d8){
this.map=map;
if(_2d8){
this.mode=_2d8["mode"]||this.mode;
}
this.setMode(this.mode);
},setMode:function(md){
if(this.mode&&this.modeDefine[this.mode]&&this.modeDefine[this.mode].on){
this.modeDefine[this.mode].exit();
}
if(!md){
this.mode=this.modeDefine.NORMAL.name;
}else{
if(typeof (md)=="string"){
this.mode=md.toUpperCase();
}else{
if(md.name){
this.mode=md.name.toUpperCase();
}
}
}
if(!this.modeDefine[this.mode]){
this.mode=this.modeDefine.NORMAL.name;
}
this.modeDefine[this.mode].bindTo(this.map);
this.modeDefine[this.mode].entry();
},getModeStateInfo:function(md){
if(this.modeDefine[md]){
return this.modeDefine[md].returns;
}else{
return null;
}
}});
_YM.Default=_26d;
_YM.Map=Map;
_YM.GeoPoint=_26e;
})();
})();

