var Class={create:function(){return function(){return this.initialize.apply(this,arguments);}}} Object.extend=function(destination,source){for(property in source){destination[property]=source[property];} return destination;} var sys=new GetBrowserInfo();Object.extend(navigator,{B:sys[0],V:sys[1]});var sys=null;function GetBrowserInfo(){var uA=navigator.userAgent;var BVer=0;var SVer=0;var sys=new Array();if(uA.indexOf('Netscape')!=-1){sys[0]='NS';BVer=parseFloat(uA.substring(uA.indexOf('Netscape')+9,uA.length));sys[1]=BVer;return sys;} else if(uA.indexOf('Opera')!=-1){sys[0]='OP';BVer=parseFloat(uA.substring(uA.indexOf('Opera')+6,uA.length));sys[1]=BVer;return sys;} else if(uA.indexOf('Firefox')!=-1){sys[0]='FF';BVer=parseFloat(uA.substring(uA.indexOf('Firefox')+8,uA.length));sys[1]=BVer;return sys;} else if(uA.indexOf('MSIE')!=-1){sys[0]='IE';BVer=parseFloat(uA.substring(uA.indexOf('MSIE')+4,uA.length));sys[1]=BVer;return sys;} else{sys[0]='UN';sys[1]=-1;alert(navigator.userAgent);return sys;} return false;} function $attachEventListener(obj,eventName,oListener){if(obj.attachEvent){obj.attachEvent(eventName,oListener);} else if(obj.addEventListener){obj.addEventListener(eventName,oListener,false);} else{return false;}} function $detachEventListener(obj,eventName,oListener){if(obj.detachEvent){obj.detachEvent(eventName,oListener);} else if(obj.removeEventListener){obj.removeEventListener(eventName,oListener,true);} else{return false;}} var $EventName=new function(){this.onload=navigator.B=='IE'?'onload':'load';this.mousemove=navigator.B=='IE'?'onmousemove':'mousemove';this.mouseover=navigator.B=='IE'?'onmouseover':'mouseover';this.mouseout=navigator.B=='IE'?'onmouseout':'mouseout';this.mouseup=navigator.B=='IE'?'onmouseup':'mouseup';this.mousedown=navigator.B=='IE'?'onmousedown':'mousedown';this.click=navigator.B=='IE'?'onclick':'click';this.dblclick=navigator.B=='IE'?'ondblclick':'dblclick';this.mousewheel=navigator.B=='IE'?'onmousewheel':'DOMMouseScroll';this.keydown=navigator.B=='IE'?'onkeydown':'keydown';this.keypress=navigator.B=='IE'?'onkeypress':'keypress';this.keyup=navigator.B=='IE'?'onkeyup':'keyup';this.focusin=navigator.B=='IE'?'onfocusin':'focusin';this.onfocusout=navigator.B=='IE'?'ononfocusout':'onfocusout';this.onfocus=navigator.B=='IE'?'ononfocus':'onfocus';this.contextmenu=navigator.B=='IE'?'oncontextmenu':'contextmenu';} function $() {var objElements=new Array();var i;for(i=0;i=0&&whitespace.indexOf(s.charAt(i))!=-1) {i--;} s=s.substring(0,i+1);} return s;},trim:function(){var s=new String(this);s=s.ltrim().rtrim();return s;},Int:function(){return parseInt(this);},Float:function(){return parseFloat(this);}});Function.prototype.bind=function(){var __method=this,args=$A(arguments),object=args.shift();return function(){return __method.apply(object,args.concat($A(arguments)));}} Function.prototype.bindAsEventListener=function(object){var __method=this,args=$A(arguments),object=args.shift();return function(event){return __method.apply(object,[(event||window.event)].concat(args).concat($A(arguments)));}} Object.extend(Number.prototype,{Round:function(){return Math.round(this);},Floor:function(){return Math.floor(this);},Abs:function(){return Math.abs(this);}});function isNumber(v) {if(!v)return false;if(isNaN(v)) {return false;} else {return true;}} function alaFlash(src,width,height){var flash;if(navigator.B=='IE'||navigator.B=='OP'){flash=document.createElement('object');flash.setAttribute('classid','clsid:D27CDB6E-AE6D-11CF-96B8-444553540000');if(width)flash.setAttribute('width',width);if(height)flash.setAttribute('height',height);flash.setAttribute('wmode','transparent');document.body.appendChild(flash);flash.setAttribute('movie',src);} else if(navigator.B=='FF'||navigator.B=='NS'){flash=document.createElement('embed');flash.setAttribute('src',src);flash.setAttribute('type','application/x-shockwave-flash');if(width)flash.setAttribute('width',width);if(height)flash.setAttribute('height',height);flash.setAttribute('wmode','transparent');} else{flash=null;} return flash;} function alaMemGarbage(){if(navigator.B=='IE')CollectGarbage();} var eCityMapMapLayerProperty=Class.create();eCityMapMapLayerProperty.prototype={initialize:function(){},body:null,id:'',zIndex:0,GetPicFileName:function(a,b,z){}} var eCityMapProperty=Class.create();eCityMapProperty.prototype={initialize:function(){this.MapID='eCityMap07'+$Rnd();this.ZoomPer=new Array(1,1/2,1/4,1/8);this.SignStyles=[];this.MapLayerPropertys=[];this.SignsVisible={};this.PlotsVisible={};this.PlotBasePaths={};this.ContextMenuItems=[];},GetSpotDataFileName:function(a,b,z){},appendMapLayer:function(layer){if(layer instanceof eCityMapMapLayerProperty) {this.MapLayerPropertys[this.MapLayerPropertys.length]=layer;return true;} else{return false;}},appendMenuItem:function(item){this.ContextMenuItems[this.ContextMenuItems.length]=item;return true;},MapID:'eCityMap'+$Rnd(),MapWidth:200,MapHeight:200,MapCellWidth:256,MapCellHeight:256,DataCellWidth:256,DataCellHeight:256,DragPrecision:10,CenterX:0,CenterY:0,MenuItemHeight:18,MenuWidth:150,flgContextMenu:false,flgLoadData:true,flgShowLabel:false,flgShowTip:true,flgShowHotArea:true,flgShowSpotShape:false,flgCanDrag:true,flgShowSign:true,flgShowPlot:true,PlotBasePaths:null,SignsVisible:null,PlotsVisible:null,Zoom:0,ZoomPer:null,WheelZoom:true,SpotImagePath:'system/map.gif',ErrImagePath:'system/map.gif',DiffSpotHeight:200,DiffSpotWidth:200,ScaleImage:'system/flag.gif|16|28|0|28',EditModeSelectShapeImage:'system/c0.gif|8|8|4|4',EditModeNewShapeImage:'system/c1.gif|8|8|4|4|system/c2.gif',GetCoordsTip:'左键取点,右键撤销,双击结束',GetCoordsLine:'#FF0000|2|',ScaleTip:'左键测量,双击结束测量。',ScaleLine:'#FFFF00|2',CosAlpha:0.707,SinAlpha:0.707,DistortionX:1,DistortionY:0.6,Scale:0.48828125,PanelTip:'鼠标左键在地图上拖动,松开左键结束拉框选择。',CurNormal:'default',CurDrag:'move',CurHover:navigator.B=='IE'&&navigator.V<6?'hand':'pointer',SignStyles:null,GoogleAPIKey:'ABQIAAAA8Fbg3M0nVuPYH6IB41ChjhQhXmCv517Cl7dY6T4l85zDsblkqBQV6pt04ibIv3Bxb8HHNJQ-JvXvwg',GoogleDatas:[],StyleSpotShape:'#FFFFFF|1|#FFFF00|0.5',CSSMenu:'.ItemActive{font-size:12px;background-color: #DBDBDB}.Menu{cursor:hand;border-style: ridge; border-width: 1px; padding-left: 4px; padding-right: 4px; padding-top: 4px; padding-bottom: 3px; background-color: #C0C0C0}.Item{font-size:12px;}',CSSTip:'font-size:12px;height:16px;white-space: nowrap; position: absolute; border: 1px solid #333333; padding: 2px; background-color: #ffffcc',CSSLabel:'font-size:12px;height:16px;white-space: nowrap; position: absolute; border: 1px solid #333333; padding: 2px; background-color: #008000',CSSPane:'font-size:1px;border: 3px dotted #FFFF00; ',CSSDialog:'font-size:14px;border-width: 1px;background-color:#FFFFFF',CSSScaleLabel:'font-size:12px;height:12px;white-space: nowrap; position: absolute; border: 1px solid #333333; padding: 1px; background-color: #ffffff;font-color:#FFFF00',SVGNameSpace:'http://www.w3.org/2000/svg',KernelPath:'JSLibrary/eCityMapKernel2.3b.js',EditMode:false};var eCityMapKernel=Class.create();eCityMapKernel.prototype={initialize:function(pro,pDiv){if(pro instanceof eCityMapProperty){this.Property=pro;} else{this.Property=new eCityMapProperty();} if(typeof(pDiv)!='undefined'){pDiv.innerHTML='';} else{window.document.write('');} this.Body=window.frames[this.Property.MapID];this.Body.document.open();this.Body.document.write('');this.Body.document.write('');this.Body.document.write('');this.Body.document.write('eCityMap 2.3');if(navigator.B=='IE'){this.Body.document.write('');} this.Body.document.write('');this.Body.document.write('');this.Body.document.write('');this.Body.document.write('
');if(this.Property.flgContextMenu){this.Body.document.write('');} this.Body.document.write('');this.Body.document.write('');this.Body.document.close();this.Body.window.eCityMap=this;this._s=this.Body.document.createElement('script');this._s.charset='utf-8';this._s.src=this.Property.KernelPath;this.Body.document.getElementsByTagName('head')[0].appendChild(this._s);this._s=null;delete this._s;return this;},MapState:function(v) {if(v!=undefined) {if(!this.Body.MapState.Loading) {this.Body.MapState.Map=v;switch(v) {case 0:this.Body.ViewSysMapLayer("Map3D",true);this.Body.ViewSysMapLayer("Map2D",false);this.Body.HiddenGoogleMap();break;case 1:case 2:this.Body.ViewSysMapLayer("Map3D",false);this.Body.ViewSysMapLayer("Map2D",false);this.Body.ShowGoogleMap();break;}}} return this.Body.MapState.Map;},MapLoading:function() {return this.Body.MapState.Loading;},Show:function(){return this.Body._Show();},MapWidth:function(v,flg){if(v!=undefined){this.Body.MapWidth=v;this.Body.frameElement.width=v;this.Body.frameElement.style.width=v+'px';this.Body.ChangeMapWidth(v,flg);} return this.Body.MapWidth;},MapHeight:function(v,flg){if(v!=undefined){this.Body.MapHeight=v;this.Body.frameElement.height=v;this.Body.frameElement.style.height=v+'px';this.Body.ChangeMapHeight(v,flg);} return this.Body.MapHeight;},PointerX:function(){return this.Body.PointerX;},PointerY:function(){return this.Body.PointerY;},CenterX:function(){return this.Body.CenterX;},CenterY:function(){return this.Body.CenterY;},Zoom:function(v){if(v!=undefined){this.Body.ChangeZoom(v);} return this.Body.Zoom;},FlatZoom:function(v){return this.Body.FlatZoom(v);},MoveTo:function(x,y,flg){if(flg){return this.Body.FlatMoveTo(x,y);} else{return this.Body.Center(x,y);}},LayerMoveTo:function(x,y){return this.Body.LayerMoveTo(x,y);},ViewEditMode:function(flg){return this.Body.ViewEditMode(flg);},ViewLabels:function(flg){return this.Body.ViewLabels(flg);},ViewSpotAreas:function(flg){return this.Body.ViewSpotAreas(flg);},ViewSigns:function(flg,sortkey){return this.Body.ViewSigns(flg,sortkey);},ViewPlots:function(flg,sortkey){return this.Body.ViewPlots(flg,sortkey);},ViewSysMapLayer:function(id,flg){return this.Body.ViewSysMapLayer(id,flg);},GetWinPos:function(v){return this.Body.GetWinPos(v);},GetMapPos:function(v){return this.Body.GetMapPos(v);},ChangeCoords:function(coords,per,flg){return this.Body.ChangeCoords(coords,per,flg);},NewMapLayer:function(id,z,pLayer){if(pLayer==undefined){return this.Body.NewMapLayer(id,z,this.Body.SysLayerTop);} else{if(pLayer==0){return this.Body.NewMapLayer(id,z,this.Body.SysLayerTop);} else{return this.Body.NewMapLayer(id,z,this.Body.SysLayerBottom);}}},StartPane:function(){return this.Body.StartPane();},StopPane:function(){return this.Body.StopPane();},StartScale:function(){return this.Body.StartScale();},StopScale:function(){return this.Body.StopScale();},StartGetCoords:function(){return this.Body.StartGetCoords();},StopGetCoords:function(){return this.Body.StopGetCoords();},GetSelectSpot:function(){return this.Body.GetSelectSpot();},AppendSpot:function(spot,zoom,flgLabel,flgShape){return this.Body.AppendSpot(spot,zoom,flgLabel,flgShape);},DeleteSpot:function(spot,zoom){if(zoom==undefined){for(var i=0;i', exX:10, exY:44 }; ecmPro.SignStyles[1]={ html:'{Title}', exX:10, exY:44 }; ecmPro.SignStyles[2]={ html:'{Title}', exX:10, exY:44 }; ecmPro.SignStyles[3]={ html:'{Title}', exX:10, exY:44 }; ecmPro.SignStyles[4]={ html:'
{Title}
', exX:0, exY:28 }; ecmPro.SignStyles[5]={ html:'
', exX:0, exY:28 }; ecmPro.GoogleAPIKey='ABQIAAAAmiZygADOFrX-n68Ug6DnEhRlAT_K7-AzhFKlBG4ugJtLeRt5VBRd9HL1ZNxvVBgZaDfkjRmhx5iz6A'; ecmPro.GoogleDatas[1]={ 'Lat':{ Intercept:40.0119444919586, Variable1:0.00000181389411841277, Variable2:-0.00000307600011891235 }, 'Lng':{ Intercept:116.275353655085, Variable1:0.00000401469317109316, Variable2:0.00000234801060933857 }, 'X':{ Intercept:-27191777.0016041, Variable1:141370.512090828, Variable2:185209.218083049 }, 'Y':{ Intercept:-3027255.43092645, Variable1:-241725.32967176, Variable2:109216.234629262 },Zoom:17 }; ecmPro.GoogleDatas[2]={ 'Lat':{ Intercept:40.0115265664532, Variable1:0.00000181244485853557, Variable2:-0.000003110666436852 }, 'Lng':{ Intercept:116.268485008111, Variable1:0.00000400090853811064, Variable2:0.00000237741098295387 }, 'X':{ Intercept:-27264104.8734294, Variable1:141896.525185061, Variable2:185661.731704255 }, 'Y':{ Intercept:-3022094.1926294, Variable1:-238732.247235147, Variable2:108147.509138098 },Zoom:17 }; ecmPro.PlotsVisible={'ad':true,'FLAG':true}; ecmPro.PlotBasePaths={'ad':'http://www.3vsy.com/cityresource2/cn/shangyu/zh-chs/mapdiv/2/','FLAG':''}; var MenuItem=Class.create(); MenuItem.prototype={ initialize : function(){}, Key : "", Caption : "", icon : "", visible : false, onClick : function(){}, ff:null }; var item0 = new MenuItem(); item0.key="spot"; item0.Caption = "当前选中"; item0.visible = false; ecmPro.appendMenuItem(item0); iteml8 = new MenuItem(); iteml8.key="line08"; iteml8.Caption = "-"; iteml8.visible = false; ecmPro.appendMenuItem(iteml8); item01 = new MenuItem(); item01.key='end'; item01.Caption='如何到达这里'; item01.visible=true; ecmPro.appendMenuItem(item01); item02=new MenuItem(); item02.key='start'; item02.Caption='从这里出发'; item02.visible=true; ecmPro.appendMenuItem(item02); item03=new MenuItem(); item03.key='cirsearch'; item03.Caption='查找周边'; item03.visible=true; ecmPro.appendMenuItem(item03); item04=new MenuItem(); item04.key='cirbus'; item04.Caption='周边公交'; item04.visible=true; ecmPro.appendMenuItem(item04); item2 = new MenuItem(); item2.key="center"; item2.Caption = '当前位置居中'; item2.visible = true; ecmPro.appendMenuItem(item2); iteml = new MenuItem(); iteml.key="line01"; iteml.Caption = "-"; iteml.visible = true; ecmPro.appendMenuItem(iteml); item05=new MenuItem(); item05.key='sign'; item05.Caption='标记该位'; item05.icon='http://api.eshangyu.com/api2/system/m1.gif', item05.visible=true; ecmPro.appendMenuItem(item05); item06=new MenuItem(); item06.key='errors'; item06.Caption='纠错'; item06.icon='http://api.eshangyu.com/api2/system/m2.gif', item06.visible=true; ecmPro.appendMenuItem(item06); item3 = new MenuItem(); item3.key="zoomin"; item3.Caption = "放大"; item3.icon='http://api.eshangyu.com/api2/system/m3.gif', item3.visible = true; ecmPro.appendMenuItem(item3); item4 = new MenuItem(); item4.key="zoomout"; item4.Caption = "缩小"; item4.icon='http://api.eshangyu.com/api2/system/m4.gif', item4.visible = true; ecmPro.appendMenuItem(item4); item5 = new MenuItem(); item5.key="line"; item5.Caption = "-"; item5.visible = true; ecmPro.appendMenuItem(item5); item6 = new MenuItem(); item6.key="about"; item6.Caption = "关于eCityMap..."; item6.visible = true; ecmPro.appendMenuItem(item6); vEdushiMap=new eCityMapKernel(ecmPro,$('EdushiMap')); veyeEdushiMap=new eCityMapKernel(eyePro,$('eyeEdushiMap')); oEyeApiMap = veyeEdushiMap; oApiMap = vEdushiMap; //2、菜单显示的时候控制各个项 oApiMap.onContextMenuShow = function(wx,wy,mx,my,spot,srcElm,srcEntity){ oApiMap.Body.MenuContextMenu.Items['zoomin'].style.display='block'; oApiMap.Body.MenuContextMenu.Items['zoomout'].style.display='block'; if(oApiMap.Zoom()==0){ oApiMap.Body.MenuContextMenu.Items['zoomin'].style.display='none'; } else if(oApiMap.Zoom()==3){ oApiMap.Body.MenuContextMenu.Items['zoomout'].style.display='none'; } if(spot){ oApiMap.Body.MenuContextMenu.Items['spot'].SetCaption(spot.Title); oApiMap.Body.MenuContextMenu.Items['spot'].style.display='block'; oApiMap.Body.MenuContextMenu.Items['line08'].style.display='block'; } else{ oApiMap.Body.MenuContextMenu.Items['spot'].style.display='none'; oApiMap.Body.MenuContextMenu.Items['line08'].style.display='none'; } } function IniMap(){ window.setTimeout(function(){ oEyeApiMap.onMapMoveEnd = function(x,y,flg){ if(flg==0){oApiMap.MoveTo(x,y,true);} } //地图移动 oApiMap.onMapMoveEnd = function(x,y,flg){ if(flg==0){oEyeApiMap.MoveTo(x,y,true);} } },500); } $attachEventListener(document.body,$EventName.onload,IniMap); function ShowLabels(){ oApiMap.Body.ViewLabels(!oApiMap.Body.flgShowLabel); return oApiMap.Body.flgShowLabel } //开关热 function ShowSpotArea(){ oApiMap.ViewSpotAreas(!oApiMap.Body.flgShowHotArea); return oApiMap.Body.flgShowHotArea; } //轮廓开 function ShowSpotShape(){ oApiMap.Body.flgShowSpotShape=!oApiMap.Body.flgShowSpotShape; return oApiMap.Body.flgShowSpotShape; } //Tip开 function ShowTip(){ oApiMap.Body.flgShowTip=!oApiMap.Body.flgShowTip; return oApiMap.Body.flgShowTip; } vEdushiMap.Switch23D=function(s) { _3D=!_3D; oApiMap.ViewSysMapLayer("Map3D",_3D==true ? true:false); oApiMap.ViewSysMapLayer("Map2D",_3D==false ? true:false); ShowSpotArea(); return _3D; } oApiMap.Body.document.body.style.background='url(http://api.eshangyu.com/api2/System/waterbg.gif)'; oEyeApiMap.Body.document.body.style.background='url(http://api.eshangyu.com/api2/System/waterbg.gif)'; PageLoaded = true;