var o__setValue={w:0,h:0,x:50000,y:40000,z:3,d:3,loadType:0,type:0,code:'utf-8',apiSrc:'mapapi_utf8.jsp',apiPath:'http://api.e6china.com/',domain:'gz',resourcePath:'/resource/',popStr:'',miniMapState:1,isLoadZoomBar:true,isLoadHotspot:true,isLoadInfo:true,isLoadAd:true}; var o__autoCreate=false; //var o__customValue={}; var o__mapStatus=false; if(typeof(o__customValue)=='undefined'||typeof(o__customValue)!='object')var o__customValue={}; if(typeof(o_x)!='undefined'&&typeof(o_x)=='number') o__customValue.x=o_x; if(typeof(o_y)!='undefined'&&typeof(o_y)=='number') o__customValue.y=o_y; if(typeof(o_z)!='undefined'&&typeof(o_z)=='number') o__customValue.z=o_z; if(typeof(o_mpx)!='undefined'&&typeof(o_mpx)=='number') o__customValue.mpx=o_mpx; if(typeof(o_mpy)!='undefined'&&typeof(o_mpy)=='number') o__customValue.mpy=o_mpy; if(typeof(o_msize)!='undefined'&&typeof(o_msize)=='number') o__customValue.msize=o_msize; if(typeof(o_resourcePath)!='undefined'&&typeof(o_resourcePath)=='string') o__customValue.resourcePath=o_resourcePath; if(typeof(o_resourcePage)!='undefined'&&typeof(o_resourcePage)=='string') o__customValue.resourcePage=o_resourcePage; if(typeof(o_mapPath)!='undefined'&&typeof(o_mapPath)=='string') o__customValue.mapPath=o_mapPath; if(typeof(o_domain)!='undefined'&&typeof(o_domain)=='string') o__customValue.host='http://'+o_domain+'.o.cn'; if(typeof(o_filePath)!='undefined'&&typeof(o_filePath)=='string') o__customValue.filePath=o_filePath; if(typeof(o_mapid)!='undefined'&&typeof(o_mapid)=='number') o__customValue.mapid=o_mapid; if(typeof(o_ruler)!='undefined'&&typeof(o_ruler)=='number') o__customValue.ruler=o_ruler; if(typeof(o_locale)!='undefined'&&typeof(o_locale)=='string') o__customValue.locale=o_locale; o__customValue.parent=this; if(navigator.userAgent.toLowerCase().indexOf('msie')>0) window.brw='ie'; else if(navigator.userAgent.toLowerCase().indexOf('firefox')>0) window.brw='ff'; else window.brw='other'; var o__Class = { create: function() { return function() { this.initialize.apply(this, arguments); } } } Object.extend = function(dest, source, replace) { for(prop in source) { if(replace == false && dest[prop] != null) continue; dest[prop] = source[prop]; } return dest; } var omap={} omap.cfg={}; omap.cfg.ApiConfig=function(){ this.cfg={}; this.events={}; this.scripts={}; this.styles={}; }; omap.cfg.ApiConfig.prototype={ setCenter:function(x,y){ this.cfg.x=x; this.cfg.y=y; }, setWidth:function(w){ this.cfg.w=w; }, setHeight:function(h){ this.cfg.h=h; }, setDomain:function(domain){ this.cfg.domain=domain; }, setMapId:function(mapId){ this.cfg.mapid=mapId; }, setApiType:function(type){ this.cfg.type=type; }, setMapType:function(type){ this.cfg.type=type; }, setResourcePath:function(path){ this.cfg.resourcePath=path; }, setFilePath:function(path){ this.cfg.filePath=path; }, setMapPath:function(path){ this.cfg.mapPath=path; }, setScreenOption:function(option){ this.cfg.screenOption=option;//{page:'',signs:{},params:[]} }, setMiniMapSize:function(msize){ this.cfg.msize=msize; }, setMiniMapState:function(num){ this.cfg.miniMapState=num; }, setIsLoadMiniMap:function(flag){ this.cfg.isLoadMiniMap=flag; }, setIsLoadZoomBar:function(flag){ this.cfg.isLoadZoomBar=flag; }, setIsLoadHotspot:function(flag){ this.cfg.isLoadHotspot=flag; }, setIsLoadInfo:function(flag){ this.cfg.isLoadInfo=flag; }, setIsLoadAd:function(flag){ this.cfg.isLoadAd=flag; }, setEvent:function(eventType,fun){ this.events[eventType]=fun; }, addScript:function(id,url){ this.scripts[id]=url; }, addStyle:function(id,url){ this.styles[id]=url; } }; omap.Api=function(){ this.initialize.apply(this,arguments); }; omap.Api.prototype={ initialize:function(id,config){ this.author='qhb'; this.email='vipbhq@gmail.com'; this.company='Guangzhou Yidong network co.,Ltd'; this.id=id; this.mapStatus=false; this.innerInstances=null; this.DocUtil=null; this.ElementUtil=null; this.mapStatusAction={}; if(!omap.apiInstance){ omap.apiInstance={}; window.omapApi=this; window.popomap=this; } if(omap.apiInstance[id]){ alert('id'); return; } omap.apiInstance[id]=this; if(!config) config={}; this.config=new omap.cfg.ApiConfig(); Object.extend(this.config.cfg,config); }, _setConfig:function(){ this.defValue={w:0,h:0,x:50100,y:38900,z:2,d:3,code:'utf-8',apiSrc:'mapapi_utf8.js',apiPath:'',locale:'zh_cn'}; Object.extend(this.defValue,o__setValue,true); Object.extend(this.defValue,o__customValue,true); Object.extend(this.defValue,this.config.cfg,true); this.mapName='omap__'+this.id; }, createMap:function(containerId){ this._setConfig(); var w,h; if(this.defValue.w==0) { w='100%'; } else{ w=this.defValue.w; } if(this.defValue.h==0){ h='100%'; } else{ h=this.defValue.h; } var ifrHtml=''; if(containerId){ var container=document.getElementById(containerId); if(container) container.innerHTML=ifrHtml; else{ alert('containerId is error'); return; } } else{ document.write(ifrHtml); } this.map=eval(this.mapName); with(this.map){ document.open(); document.charset=this.defValue.code; document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); //document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.close(); window.apiInstance=this; } this.appendScript('o_lang',this.defValue.apiPath+'/inc/lang/'+this.defValue.locale+'.js'); this.appendScript('o_mapjs',this.defValue.apiPath+this.defValue.apiSrc); this.appendStyle('o_css1',this.defValue.apiPath+'/inc/css.css'); this.appendStyle('o_css2',this.defValue.apiPath+'/inc/skin3/css.css'); this.appendStyle('o_css3',this.defValue.apiPath+'/inc/css_'+this.defValue.locale+'.css'); }, appendStyle:function(id,file){ var style=this.map.document.createElement('link'); style.href=file; style.rel='stylesheet'; style.type='text/css'; style.id='styleFile'+id; this.map.document.body.appendChild(style); }, appendScript:function(id,file){ var jselm=this.map.document.createElement('script'); jselm.language='javascript'; jselm.id='jsFile'+id; jselm.charset='utf-8'; jselm.src=file; this.map.document.body.appendChild(jselm); }, applyConfig:function(){ var events=this.config.events; var scripts=this.config.scripts; var styles=this.config.styles; for(var item in events){ this.setEvent(item,events[item]); } for(var item in scripts){ this.appendScript(item,scripts[item]); } for(var item in styles){ this.appendStyle(item,styles[item]); } }, getMap:function(){ return this.map; }, getMapStatus:function(){ return this.mapStatus; }, setMapStatus:function(status){ this.mapStatus=status; if(this.mapStatusAction[status]) this.mapStatusAction[status](); switch(status){ case 'ready': this.applyConfig(); break; default: break; } }, onMapStatus:function(status,fun){ if(typeof fun=='function')this.mapStatusAction[status]=fun; }, getCenterX:function(){ return this.getMap().mapApi.getCenterX(); }, getCenterY:function(){ return this.getMap().mapApi.getCenterY(); }, getCurX:function(evt){ return this.getMap().mapApi.getCurX(evt); }, getCurY:function(evt){ return this.getMap().mapApi.getCurY(evt); }, getMapWidth:function(){ return this.getMap().mapApi.mapWidth; }, getMapHeight:function(){ return this.getMap().mapApi.mapHeight; }, getZoom:function(){ return this.getMap().mapApi.Zoom; }, getAreaUnitInfo:function(){ return this.getMap().mapApi.AreaUnitInfo; }, getD:function(type){// return this.getMap().mapApi.getD(type); }, getValue:function(name){// return this.getMap().mapApi[name]; }, invokeFun:function(){// return this.getMap().mapApi.invokeFun(arguments); }, go2xy:function(x0,y0,onmove,onend){ return this.getMap().mapApi.go2xy(x0,y0,onmove,onend); }, go2xyS:function(x0,y0,onmove,onend){ return this.getMap().mapApi.go2xyS(x0,y0,onmove,onend); }, isMoved:function(num){ return this.getMap().mapApi.isMoved(num); }, setValue:function(option,value){ return this.getMap().mapApi.setOption(option,value); }, setEvent:function(eventType,fun){ return this.getMap().mapApi.setEvent(eventType,fun); }, setMapTip:function(htmlStr){ return this.getMap().mapApi.setMapTip(htmlStr); }, setMapCursor:function(c){ return this.getMap().mapApi.setMapCursor(c); }, selectMode:function(mode,option){ return this.getMap().mapApi.selectMode(mode,option); }, getMode:function(){ return this.getMap().mapApi.mode; }, init:function(x,y,l){ return this.getMap().mapApi.init(x,y,l); }, changeMapType:function(type){ return this.getMap().mapApi.changeMapType(type); }, addUserPop:function(arr,signType){ return this.getMap().mapApi.addUserPop(arr,signType); }, createPop:function(idStr,htmlStr,x0,y0,sx,sy,z){ return this.getMap().mapApi.createPop(idStr,htmlStr,x0,y0,sx,sy,z); }, createPopT:function(idStr,htmlStr,x0,y0,sx,sy,z){ return this.getMap().mapApi.createPopT(idStr,htmlStr,x0,y0,sx,sy,z); }, zoomto:function(z){ return this.getMap().mapApi.zoomto(z); }, removePop:function(id){ return this.getMap().mapApi.removePop(id); }, removeAllPop:function(){ return this.getMap().mapApi.removeAllPop(); }, setWidth:function(w){ document.getElementById(this.mapName).style.width=w; }, setHeight:function(h){ document.getElementById(this.mapName).style.height=h; }, getInnerInstances:function(){ return this.getMap().Instances; }, showMapInfo:function(id,type,params){ return this.getMap().Instances.infoWindow.showMapInfo(id,type,params); }, hiddenMapInfo:function(){ return this.getMap().Instances.infoWindow.hiddenOcInfo(); }, showOCInfo:function(x,y,id,cid,pager,noSlowF){ return this.getMap().Instances.infoWindow.showOCInfo(x,y,id,cid,pager,noSlowF); }, loadSign:function(type){ return this.getMap().Instances.dataLoader.loadSign(type); }, removeSign:function(type){ return this.getMap().Instances.dataLoader.removeSign(type); }, loadScreenSign:function(type,signParams){ return this.getMap().Instances.dataLoader.loadScreenSign(type,signParams); }, removeScreenSign:function(type){ return this.getMap().Instances.dataLoader.removeScreenSign(type); }, getSignHandler:function(type){ return this.getMap().Instances.dataLoader.getSignHandler(type); }, createSignExt:function(sign,e,params){ return this.getMap().Instances.dataLoader.createSignExt(sign,e,params); }, drawLine:function(o){// return this.getMap().mapApi.drawLine(o); }, editPolyline:function(o){// return this.getMap().mapApi.editPolyline(o); }, editPointPolyline:function(id,points,options){ return this.getMap().mapApi.editPointPolyline(id,points,options); }, mdBusLine:function(o,busLine){// return this.getMap().mapApi.mdBusLine(o,busLine); }, drawArea:function(o){// return this.getMap().mapApi.drawArea(o); }, drawAllArea:function(){// return this.getMap().mapApi.drawAllArea(); }, destroyAllG:function(){// return this.getMap().mapApi.destroyAllG(); }, destroyG:function(item){// return this.getMap().mapApi.destroyG(item); }, clrData:function(x,y){// return this.getMap().mapApi.clrData(x,y); } }; if(o__autoCreate){ (new omap.Api('map')).createMap(); }