/************************************************* * 控件基类,全局文件 * code by lzz ver1.0 update at 07-09-26 *************************************************/ //控件基类参数对象 var MapContrlObj = {ID:null,Parent:null}; // 控件基类 var MapContrlBase = Class.create(); Object.extend(MapContrlBase.prototype, { //构造 initialize : function(obj){ try { if(obj) { if(obj.Parent) { this.Body = obj.Parent.$C('IFRAME'); } else { this.Body = $C('IFRAME'); } if(obj.ID) { this.Body.id = obj.ID; } else { this.Body.id = '_iframe'+$Rnd(); } } else { this.Body = $C('IFRAME'); this.Body.id = '_iframe'+$Rnd(); } this.Body.frameBorder = '0'; this.Body.scrolling = "no"; this.Body.style.overflow = 'hidden'; this.Body.allowTransparency = 'true'; this.Body.style.display = 'none'; this.Body.style.width = this.Width + 'px'; this.Body.style.height = this.Height + 'px'; this.Config = GlobalConfig; //附加全局Config对象 this._loadUI(); //绑定事件 if (GetBrowserInfo()[0]=='IE'){ this.Body.attachEvent("onload",this._loadComplete.bindAsEventListener(this)); } else { this.Body.onload = this._loadComplete.bindAsEventListener(this); } } catch (ex) { alert('脚本出错' + ex.message); _loadError(ex.message); } }, //公有方法 $: function(sID){ return this.Body.contentWindow.document.getElementById(sID); }, LoadUI: function(sControlName){ //载入UI this.Body.src = this.Config._ControlsUIPath + sControlName + '.aspx'; }, ResumeLayout: function(){ //重做布局,位置大小 // this.Body.style.top = this.Y + 'px'; // this.Body.style.left = this.X + 'px'; this.Body.style.width = this.Width + 'px'; this.Body.style.height = this.Height + 'px'; }, Show: function(){ //显示控件,控件创建完(new)不会显示,需调用Show方法后才会显示 // .. .. .. 此处可做一些数据加载的逻辑 .. .. .. this.Body.style.display = 'block'; }, Hide: function(){ //隐藏控件 this.Body.style.display = 'none'; }, Dispose: function(){ //销毁控件,释放所有占用的资源 this.parentNode.removeNode(this.Body); }, MoveTo: function(x, y){ //移动控件到指定位置 this.Body.style.position = 'absolute'; this.Body.style.top = y + 'px'; this.Body.style.left = x + 'px'; }, //对外提供的公共事件接口 onLoadComplete: function(source){ }, onLoadError: function(source, msg){ }, //共同属性 Body: null, //IFrame Config: null, X: 0, Y: 0, Width: 303, Height: 418, //私有接口,子类必须实现,可调用LoadUI方法,或则自己指定this.Body.src _loadUI: function(){ }, //私有事件 _loadComplete: function(){ // .. .. .. 此事可以托管该事件,执行一些附加操作,再将事件抛出 .. .. .. this.onLoadComplete(this); }, _loadError: function(msg){ // .. .. .. 此事可以托管该事件,执行一些附加操作,再将事件抛出 .. .. .. this.onLoadError(this, msg); } }); /* 搜索结果页卡和地图PoP的基类 */ var OptionCardContrlBase; if(!OptionCardContrlBase) OptionCardContrlBase= Class.create(); Object.extend(OptionCardContrlBase.prototype,MapContrlBase.prototype); /* 初始化选项卡和选项卡对应的Iframe的容器 iframebody:父级容器,ulId:选项卡容器,cardId:Iframe容器 */ OptionCardContrlBase.ItemsPanel=function(iframebody,ulId,cardId) { this.Piframe = iframebody; this.Pelement=iframebody.contentWindow.document.getElementById(ulId); if(!this.Pelement) { //alert(ulId+'不存在'); return; } this.elementlist = new Array(); this.register=new Array(); this.currentElement=null; this.PcardFrame=iframebody.contentWindow.document.getElementById(cardId); if(!this.PcardFrame) { //alert(cardId+'不存在'); return; } this.currentCardframe=null; } /* *增加一个选项卡和内容页 */ OptionCardContrlBase.ItemsPanel.prototype.addItem=function(item) { if(this.validateExist(item.url)) { return; } item.panel=this; this.Pelement.appendChild(item.element); this.PcardFrame.appendChild(item.cardFrame); this.visitedRegister(item,'add'); item.ExpendOut(); } /* *删除选项卡和内容页 */ OptionCardContrlBase.ItemsPanel.prototype.deleteItem=function(item) { this.visitedRegister(item,'delete'); if(this.register.length>0) { this.Pelement.removeChild(item.element); this.PcardFrame.removeChild(item.cardFrame); } } /* 清除所有选项卡和内容页 */ OptionCardContrlBase.ItemsPanel.prototype.clearItem=function() { this.visitedRegister(null,'clear'); } /* 选项卡更改后执行的页面布局的更改 */ OptionCardContrlBase.ItemsPanel.prototype.changeSubPage=function() { if(this.register.length==0) { for(var i=0;iparseInt(this.Pelement.parentNode.style.width.replace('px',''),10)) { var LWidth=0 var i = 0; var j = 0; for(i;i=0;j--) { LWidth+=this.elementlist[j].elementWidth } if(LWidth>parseInt(this.Pelement.parentNode.style.width.replace('px',''),10)) { this.Pelement.style.left=-(LWidth-parseInt(this.Pelement.parentNode.style.width.replace('px',''),10)) + 'px'; } else { this.Pelement.style.left='0px'; } break; } } if(this.Pelement.style.left=='0px') { this.Piframe.contentWindow.document.getElementById('Bar_L').style.display = 'none'; } else { this.Piframe.contentWindow.document.getElementById('Bar_L').style.display = 'block'; } if((parseInt(this.Pelement.style.width.replace('px',''),10)+parseInt(this.Pelement.style.left.replace('px',''),10))>parseInt(this.Pelement.parentNode.style.width.replace('px',''),10)+5) { this.Piframe.contentWindow.document.getElementById('Bar_R').style.display = 'block'; } else { this.Piframe.contentWindow.document.getElementById('Bar_R').style.display = 'none'; } } else { this.Pelement.style.left='0px'; this.Piframe.contentWindow.document.getElementById('Bar_L').style.display = 'none'; this.Piframe.contentWindow.document.getElementById('Bar_R').style.display = 'none'; } } } /*判断当前URL是否在搜索结果页中打开*/ OptionCardContrlBase.ItemsPanel.prototype.validateExist=function(url) { for(var i=0;i0) { this.currentElement=this.register[i-1].element; this.currentCardframe=this.register[i-1].cardFrame; this.register[i-1].activeItem(); } else this.currentElement=null; } this.changeSubPage(); } else if(type=='active') { /*选项卡激活时候的页面初始化方法*/ if(typeof item.cardFrame.contentWindow.fnInit=='function') { item.cardFrame.contentWindow.fnInit(); } if(this.currentElement==item.element) return; else { for(k=0;k]+?>/gi,'')+'">'+this.title+''; this.addEventListener(this.$ES(this.element,'nobr')[0],'click',function(){mirror.activeItem();}); this.addEventListener(this.$ES(this.element,'a')[0],'click',function(){mirror.destroyItem();}); } else { this.element.innerHTML=''+this.title+''; this.addEventListener(this.$ES(this.element,'nobr')[0],'click',function(){mirror.activeItem();}); } } /* *选项卡激活 */ OptionCardContrlBase.Item.prototype.activeItem=function() { if(this.cardFrame.src=='') { this.cardFrame.src = this.url; } if(typeof this.panel.visitedRegister =='function') { this.panel.visitedRegister(this,'active'); this.element.className='active'; this.cardFrame.className='iframevis'; } this.ExpendOut(); } /*选项卡添加和激活时,当搜索结果控件最小化时展开搜索结果控件*/ OptionCardContrlBase.Item.prototype.ExpendOut = function() { } /* *选项卡重置为初始状态 */ OptionCardContrlBase.Item.prototype.resetItem=function() { this.element.className='default'; this.cardFrame.className = 'iframehid'; } /* *选项卡自身销毁 */ OptionCardContrlBase.Item.prototype.destroyItem=function() { //this.panel.visitedRegister(this,'delete'); this.panel.deleteItem(this); } /* *选项卡添加事件 */ OptionCardContrlBase.Item.prototype.addEventListener=function(element,type,handler) { if(element.addEventListener) element.addEventListener(type,handler,true); else element.attachEvent('on'+type,handler,true); } /* *新建HTML元素 */ OptionCardContrlBase.Item.prototype.$C=function(iframebody,tag) { if(tag && typeof tag =='string') return iframebody.contentWindow.document.createElement(tag); else return iframebody.contentWindow.document.createElement('li'); } /* *根据TagName获取HTML元素 */ OptionCardContrlBase.Item.prototype.$ES=function(element,tag) { return element.getElementsByTagName(tag); } /************************************************* * 公交站控件 * code by lzz ver1.0 update at 07-10-29 *************************************************/ var BusStationControl = Class.create(); Object.extend(BusStationControl.prototype, MapContrlBase.prototype); BusStationControl.prototype._loadUI = function(){ this.LoadUI('BusStationControl'); }; //显示指定站点的公交信息,id:公交站点id BusStationControl.prototype.ShowBusStation = function(id){ this.$('divStationName').innerHTML = 'loading...'; this.$('divBusList').innerHTML = 'loading...'; var url = this.Config._DataCenterUrl + 'CommMap/bus.aspx?node='+this.Config._Node+'&l=' + this.Config._L + '&req=9&v=1.0&id=' + id; ENetwork.DownloadScript ( url,function() { if(typeof s =='undefined' || s == null) { this.$('divStationName').innerHTML = '无公交站点信息'; this.$('divBusList').innerHTML = '
  • 很抱歉,该站点公交数据正在完善中
  • '; this.Show(); } else { if(typeof busGroup =='undefined' || busGroup == null) { this.$('divStationName').innerHTML = s.StationName; this.$('divBusList').innerHTML = '
  • 很抱歉,该站点公交数据正在完善中
  • '; this.Show(); } else { this.$('divStationName').innerHTML = s.StationName; //append bus list var sHtml = ''; for (var k=0; k' + busGroup[k].BusName + ''; } this.$('divBusList').innerHTML = sHtml; busGroup = null; delete busGroup; this.Show(); } } }.bindAsEventListener(this) ); }; //重载控件加载完毕后的事件 BusStationControl.prototype._loadComplete= function(){ this.Body.contentWindow.BusStationControl = this; this.onLoadComplete(this); }; BusStationControl.prototype.onDataLoadComplete = function(){ }; //公交线路点击 , busid:公交线路ID, busname:公交线路名 BusStationControl.prototype.onBusClick = function(busid, busname){ }; /************************************************* * 城市列表控件 * code by lzz ver1.0 update at 07-10-10 *************************************************/ var CityListControl = Class.create(); Object.extend(CityListControl.prototype, MapContrlBase.prototype); CityListControl.prototype._loadUI = function(){ this.LoadUI('CityListControl'); }; //关闭城市列表事件 CityListControl.prototype.onClose = function(){ }; //重载控件加载完毕后的事件 CityListControl.prototype._loadComplete= function() { this.Body.contentWindow.CityListControl = this; this.onLoadComplete(this); }; /************************************************* * 推荐泡泡控件 * code by lzz ver1.0 update at 07-10-26 *************************************************/ var CommendPopControl = Class.create(); Object.extend(CommendPopControl.prototype, MapContrlBase.prototype); CommendPopControl.prototype._loadUI = function(){ this.LoadUI('CommendPopControl'); }; //显示推荐泡泡 CommendPopControl.prototype.ShowCommendPop = function(sTitle, sContent) { this.$('tjgg-1').innerHTML = unescape(sTitle); this.$('tjgg-4').innerHTML = unescape(sContent).replaceAll('/cityresource2/', this.Config._PicUrl);; this.Show(); }; //重载控件加载完毕后的事件 CommendPopControl.prototype._loadComplete= function(){ this.Body.contentWindow.CommendPopControl = this; this.onLoadComplete(this); }; /************************************************* * 纠错控件 * code by lzz ver1.0 update at 07-10-16 *************************************************/ var DebugControl = Class.create(); Object.extend(DebugControl.prototype, MapContrlBase.prototype); DebugControl.prototype.LoadUI = function(){ this.Body.src = this.Config._ControlsUIPath + 'DebugControl.aspx?ID=' + this.DebugID + '&Name=' + escape(this.DebugName) + '&Flag=' + this.DebugFlag; }; //纠错 id:纠错ID name:纠错名称 flag:纠错类型 DebugControl.prototype.Debug = function(id, name, flag){ this.DebugID = id; this.DebugName = name; this.DebugFlag = flag; this.LoadUI(); this.Show(); }; //重载控件加载完毕后的事件 DebugControl.prototype._loadComplete= function() { if (this.DebugName.length > 0){ this.$('txtContent').value = this.DebugName + '有错:'; } this.Body.contentWindow.DebugControl = this; this.onLoadComplete(this); }; DebugControl.prototype.DebugID = 0; //纠错ID DebugControl.prototype.DebugName = ''; //纠错名称 DebugControl.prototype.DebugFlag = 0; //纠错类型0-实体,1企业 /************************************************* * 实体泡泡控件 * code by xzx ver1.0 update at 07-09-26 *************************************************/ var EntityPopControl = Class.create(); Object.extend(EntityPopControl.prototype, OptionCardContrlBase.prototype); //继承基类 //重写基类载入模板方法 EntityPopControl.prototype._loadUI = function(){ this.LoadUI('EntityPopControl'); }; //重写控件加载完毕后的事件 EntityPopControl.prototype._loadComplete= function() { this.Body.contentWindow.window.PopControlForm = this; this.ItemsPanel = new OptionCardContrlBase.ItemsPanel(this.Body,'itemsPanel','cardContent'); this.onLoadComplete(this); }; EntityPopControl.prototype.ClearData = function(){ this.$('Entr_Title').innerHTML=_Lloading[this.Config._L].replace('images/','../images/'); this.$('Entro_yp').href = 'javascript:;'; this.$('Entro_yp').target = '_self'; this.$('Entr_Add').innerHTML=_Ladd[this.Config._L]+_Lloading[this.Config._L].replace('images/','../images/'); this.$('Entr_Tell').innerHTML=_Ltel[this.Config._L]+_Lloading[this.Config._L].replace('images/','../images/'); this.$('Entr_Edd').value='loading'; this.$('Entr_img').src='../images/nophoto.jpg'; this.$('Entr_img_a').href='javascript:;'; this.$('Entr_img_a').target = '_self'; //this.$('Entr_close').onclick = function(){}; this.$('Entro_mark').onclick = function(){}; this.$('Entro_error').onclick = function(){}; }; //显示实体泡泡方法,o实体对象。 EntityPopControl.prototype.ShowEntityPop = function(oid) { if(this.OID==oid) { this.Show(); return; } else { this.OID = oid; } this.ItemsPanel.clearItem(); this.ClearData(); this.Show(); var url=this.Config._DataCenterUrl + 'CommMap/CompanyInfo.aspx?node='+this.Config._Node+'&l='+this.Config._L+'&v=1.0&req=2&id='+oid; ENetwork.DownloadScript(url,this.LoadEntityPopData.bindAsEventListener(this)); }; EntityPopControl.prototype.LoadEntityPopData = function() { if (typeof o == 'undefined' || o == null) { this.Hide(); this.OID = ''; return; } if (this.OID != o.ID) { return; } this.$('Entr_Title').innerHTML=o.OwnerName; this.$('Entro_yp').href = 'http://' + this.Config._AppDomain + '/yp/OwnerDetail.aspx?ID='+o.ID; this.$('Entro_yp').target = '_blank'; this.$('Entr_Add').innerHTML=_Ladd[this.Config._L]+o.Oaddress; this.$('Entr_Tell').innerHTML=_Ltel[this.Config._L]+o.OPhone; this.$('Entr_Edd').value='http://'+o.OEddress+'.'+this.Config._AppDomain; if(o.OImage!=null&&o.OImage!='') { this.$('Entr_img').src=this.Config._UpImagesUrl+'/'+this.Config._UpImages+'/'+o.OImagePath+'/s'+o.OImage; this.$('Entr_img').onerror = this._LoadImgErr.bindAsEventListener(this.$('Entr_img'),'../images/nophoto.jpg'); this.$('Entr_img_a').href=this.Config._UpImagesUrl+'/'+this.Config._UpImages+'/'+o.OImagePath+'/'+o.OImage; this.$('Entr_img_a').target = '_blank'; } else { this.$('Entr_img_a').target ='_self'; } this.$('Entr_close').onclick = this.Close.bindAsEventListener(this); this.$('Entro_mark').onclick = this._sign.bindAsEventListener(this,o.CenterX,o.CenterY,o.OwnerName); this.$('Entro_error').onclick = this._cavil.bindAsEventListener(this,0,o.ID,o.OwnerName,o.CenterX,o.CenterY); //POP广告 if(window._isSourceUrl&&typeof SourceAd!='undefined'&&SourceAd!=null) { window._isSourceUrl = false; this.$('PopADLink').href = 'http://'+SourceAd.Link.replace('http://',''); this.$('PopADImageSrc').src = this.Config._PicUrl + SourceAd.ImagePath+'/'+SourceAd.ImageName; this.$('PopADImageSrc').style.display = 'block'; } else if(typeof POPAd!='undefined'&&POPAd!=null) { this.$('PopADLink').href = 'http://'+POPAd.Link.replace('http://',''); this.$('PopADImageSrc').src = this.Config._PicUrl + POPAd.ImagePath+'/'+POPAd.ImageName; this.$('PopADImageSrc').style.display = 'block'; } else { this.$('PopADImageSrc').style.display = 'none'; } var companylisturl = '../../../../../Fundation/CompanyList.aspx?oid=' + o.ID + '&oname=' + escape(o.OwnerName); this.CompanyListItem = new OptionCardContrlBase.Item(this.Body,'companylist','本建筑物内的企业',companylisturl,false,false,108); this.ItemsPanel.addItem(this.CompanyListItem); var bustransferurl = '../../../../../Fundation/BusTransfer.aspx?x='+o.CenterX +'&y='+o.CenterY; this.BusTransferItem = new OptionCardContrlBase.Item(this.Body,'bustransfer','公交换乘',bustransferurl,false,false,59); this.ItemsPanel.addItem(this.BusTransferItem); var nearbyurl = '../../../../../Fundation/NearBySearch.aspx?x='+o.CenterX +'&y='+o.CenterY; this.NearByItem = new OptionCardContrlBase.Item(this.Body,'nearby','查找周边',nearbyurl,false,false,59); this.ItemsPanel.addItem(this.NearByItem); var nearbusurl = '../../../../../Fundation/PeripheralBus.aspx?x='+o.CenterX +'&y='+o.CenterY; this.NearBusItem = new OptionCardContrlBase.Item(this.Body,'nearbus','周边公交',nearbusurl,false,false,59); this.NearBusItem.cardFrame.scrolling = 'auto'; this.NearBusItem.cardFrame.style.height = '130px'; this.ItemsPanel.addItem(this.NearBusItem); this.CompanyListItem.activeItem(); this.onHistorySaved(1, o); } //显示企业泡泡方法,c企业对象。 EntityPopControl.prototype.ShowComanyPop = function(cid) { if(this.CID==cid) { this.Show(); return; } else { this.CID = cid; } this.ItemsPanel.clearItem(); this.ClearData(); this.Show(); var url=this.Config._DataCenterUrl + 'CommMap/CompanyInfo.aspx?node='+this.Config._Node+'&l='+this.Config._L+'&v=1.0&req=1&id='+cid; ENetwork.DownloadScript(url,this.LoadComanyPopData.bindAsEventListener(this)); } EntityPopControl.prototype.LoadComanyPopData = function() { if (typeof c == 'undefined' || c == null) { this.Hide(); this.CID = ''; return; } if (this.CID != c.ComID) { return; } this.$('Entr_Title').innerHTML=c.CompanyName; this.$('Entro_yp').href = 'http://' + this.Config._AppDomain + '/yp/CompanyDetail.aspx?ID='+c.ComID; this.$('Entro_yp').target = '_blank'; this.$('Entr_Add').innerHTML='地址:' + c.ComAddress; this.$('Entr_Tell').innerHTML='电话:' + c.ComPhone; this.$('Entr_Edd').value='http://'+c.ComEaddress+'.'+this.Config._AppDomain; if(c.ComImage!=null&&c.ComImage!='') { this.$('Entr_img').src=this.Config._UpImagesUrl+'/'+this.Config._UpImages+'/'+c.ComImagePath+'/s'+c.ComImage; this.$('Entr_img_a').href=this.Config._UpImagesUrl+'/'+this.Config._UpImages+'/'+c.ComImagePath+'/'+c.ComImage; this.$('Entr_img').onerror = this._LoadImgErr.bindAsEventListener(this.$('Entr_img'),'../images/nophoto.jpg'); this.$('Entr_img_a').target = '_blank'; } else { this.$('Entr_img_a').target ='_self'; } this.$('Entr_close').onclick = this.Close.bindAsEventListener(this); this.$('Entro_mark').onclick = this._sign.bindAsEventListener(this,c.ComX,c.ComY,c.CompanyName); this.$('Entro_error').onclick = this._cavil.bindAsEventListener(this,1,c.ComID,c.CompanyName,c.ComX,c.ComY); if(window._isSourceUrl&&typeof SourceAd!='undefined'&&SourceAd!=null) { window._isSourceUrl = false; this.$('PopADLink').href = 'http://'+SourceAd.Link.replace('http://',''); this.$('PopADImageSrc').src = this.Config._PicUrl + SourceAd.ImagePath+'/'+SourceAd.ImageName; this.$('PopADImageSrc').style.display = 'block'; } else if(typeof POPAd!='undefined'&&POPAd!=null) { this.$('PopADLink').href = 'http://'+POPAd.Link.replace('http://',''); this.$('PopADImageSrc').src = this.Config._PicUrl + POPAd.ImagePath+'/'+POPAd.ImageName; this.$('PopADImageSrc').style.display = 'block'; } else { this.$('PopADImageSrc').style.display = 'none'; } var bustransferurl = '../../../../../Fundation/BusTransfer.aspx?x='+c.ComX +'&y='+c.ComY; this.BusTransferItem = new OptionCardContrlBase.Item(this.Body,'bustransfer','公交换乘',bustransferurl,false,false,59); this.ItemsPanel.addItem(this.BusTransferItem); var nearbyurl = '../../../../../Fundation/NearBySearch.aspx?x='+c.ComX +'&y='+c.ComY; this.NearByItem = new OptionCardContrlBase.Item(this.Body,'nearby','查找周边',nearbyurl,false,false,59); this.ItemsPanel.addItem(this.NearByItem); var nearbusurl = '../../../../../Fundation/PeripheralBus.aspx?x='+c.ComX +'&y='+c.ComY; this.NearBusItem = new OptionCardContrlBase.Item(this.Body,'nearbus','周边公交',nearbusurl,false,false,59); this.NearBusItem.cardFrame.scrolling = 'auto'; this.NearBusItem.cardFrame.style.height = '130px'; this.ItemsPanel.addItem(this.NearBusItem); this.BusTransferItem.activeItem(); this.onHistorySaved(2, c); } //内部事件 EntityPopControl.prototype.fnCopyCode = function (strUrl, msg) { var txt = this.$(strUrl).value; fnCopyToClipboard(txt,msg); } //图像加载三次仍然失败则移除 EntityPopControl.prototype._LoadImgErr = function(e,imgpath){ if(this.c=='undefined'||this.c==null){ this.c=0; } else{ this.c++; } if(this.c>3){ if (this.src == imgpath) { return; //默认图片加载失败则不再触发 , ie7光设置 this.onerror=null; 无效 } this.src=imgpath; this.onerror=null; this.parentNode.href = 'javascript:;'; this.parentNode.target = '_self'; } else{ this.src=this.src; } } EntityPopControl.prototype.Close=function(e) { this.Hide(); } //对内接口 //公交ID,Name搜索公交线路的事件 EntityPopControl.prototype._sign = function(e,x,y,sName) { this.onSign(x,y,sName) }; //纠错事件 EntityPopControl.prototype._cavil = function(e,type,nID,sName,x, y) { this.onCavil(type,nID,sName,x, y); }; EntityPopControl.prototype._busIdSearch = function(nID,sName) { this.onBusIDSearch(nID,sName); }; //从这里出发,如何到达这里公交搜索,action:1从怎么出发,2如何到达这里 EntityPopControl.prototype._busSEXYSearch = function(action,x,y,sKeyword) { this.onBusSEXYSearch(action,x,y,sKeyword); }; //周边搜索的事件 EntityPopControl.prototype._nearbySearch = function(sKeyword,x,y,len) { this.onLocalNearBySearch(sKeyword,x,y,len); }; //对外接口 //标记该位置的事件 EntityPopControl.prototype.onSign = function(x,y,sName) { alert('未实现标记方法'); }; //纠错事件 EntityPopControl.prototype.onCavil = function(type,nID,sName,x, y) { alert('未实现纠错方法'); }; //公交ID,Name搜索公交线路的事件 EntityPopControl.prototype.onBusIDSearch = function(nID,sName) { }; //从这里出发,如何到达这里公交搜索 EntityPopControl.prototype.onBusSEXYSearch = function(action,x,y,sKeyword) { }; //周边搜索的事件 EntityPopControl.prototype.onLocalNearBySearch = function(sKeyword,x,y,len) { }; //保存历史记录 EntityPopControl.prototype.onHistorySaved = function(type,spot){ }; /************************************************* * 从这里出发搜索控件 * code by lzz ver1.0 update at 07-10-17 *************************************************/ var FromSearchControl = Class.create(); Object.extend(FromSearchControl.prototype, MapContrlBase.prototype); FromSearchControl.prototype._loadUI = function(){ this.LoadUI('FromSearchControl'); }; FromSearchControl.prototype.ShowFromHereSearch = function(x, y){ this.$('btnSearch').onclick = function(){ this.onShowFromHereSearch(this.$('popbusnametxt1').value, x, y); }.bindAsEventListener(this); this.Show(); }; //重载控件加载完毕后的事件 FromSearchControl.prototype._loadComplete= function(){ this.Body.contentWindow.FromSearchControl = this; this.onLoadComplete(this); }; //从这里出发事件 , keyword:目的地 FromSearchControl.prototype.onShowFromHereSearch = function(keyword, x, y){ }; /************************************************* * 引导图控件 * code by lzz ver1.0 update at 07-10-10 *************************************************/ var NavigationControl = Class.create(); Object.extend(NavigationControl.prototype, MapContrlBase.prototype); NavigationControl.prototype._loadUI = function(){ this.Body.src = this.Config._RealCityUIPath + 'Controls/NavigationControl.aspx'; }; //关闭事件 NavigationControl.prototype.onClose = function(){ }; //热点点击事件,type: 0:实体 1:企业 NavigationControl.prototype.onNavClick = function(type, id, x, y){ }; //重载控件加载完毕后的事件 NavigationControl.prototype._loadComplete= function() { this.Body.contentWindow.NavigationControl = this; this.onLoadComplete(this); }; /************************************************* * 拉框搜索控件 * code by lzz ver1.0 update at 07-10-16 *************************************************/ var PaneSearchControl = Class.create(); Object.extend(PaneSearchControl.prototype, MapContrlBase.prototype); PaneSearchControl.prototype._loadUI = function(){ this.LoadUI('PaneSearchControl'); }; //显示拉框范围 PaneSearchControl.prototype.ShowPane = function(x1, y1, x2, y2){ //如果拉框结束点坐标小于起始点坐标,则互换两点 if (x1 > x2) { x1 = x1 + x2; x2 = x1 - x2; x1 = x1 - x2; } if (y1 > y2) { y1 = y1 + y2; y2 = y1 - y2; y1 = y1 - y2; } this.$('btnSearch').onclick = function(){ this.onPaneSearch(this.$('Paneltxt').value, x1, y1, x2, y2); }.bindAsEventListener(this); this.$('divHotKeyWords').innerHTML = ''; for(var i=0;i'+SearchHotKeyWords[i]+'  '; } this.Show(); }; //重载控件加载完毕后的事件 PaneSearchControl.prototype._loadComplete= function() { this.Body.contentWindow.PaneSearchControl = this; this.onLoadComplete(this); }; //重新拉框事件 PaneSearchControl.prototype.onRePane = function(){ }; //拉框结束事件 PaneSearchControl.prototype.onPaneClose = function(){ }; PaneSearchControl.prototype.onPaneSearch = function(keyword,x1,y1,x2,y2){ }; PaneSearchControl.prototype.HotKeywords = ''; /************************************************* * 周边公交搜索控件 * code by lzz ver1.0 update at 07-10-17 *************************************************/ var PeripheralBusControl = Class.create(); Object.extend(PeripheralBusControl.prototype, MapContrlBase.prototype); PeripheralBusControl.prototype._loadUI = function(){ this.LoadUI('PeripheralBusControl'); }; PeripheralBusControl.prototype.ShowPeripheralBus = function(x, y){ this.$('fraBus').src = '../../../../../Fundation/PeripheralBus.aspx?x=' + x + '&y=' + y; this.Show(); }; PeripheralBusControl.prototype._busIdSearch = function(busid, busname){ this.onBusClick(busid, busname); }; //重载控件加载完毕后的事件 PeripheralBusControl.prototype._loadComplete= function(){ this.Body.contentWindow.PopControlForm = this; //绑定事件 if (GetBrowserInfo()[0]=='IE'){ this.$('fraBus').attachEvent("onload",this._FraLoad.bindAsEventListener(this)); } else { this.$('fraBus').onload = this._FraLoad.bindAsEventListener(this); } this.onLoadComplete(this); }; PeripheralBusControl.prototype._FraLoad = function(){ this.$('fraBus').contentWindow.Config = this.Config; }; //公交线路点击 , busid:公交线路ID, busname:公交线路名 PeripheralBusControl.prototype.onBusClick = function(busid, busname){ }; /************************************************* * 查找周边控件 * code by lzz ver1.0 update at 07-10-17 *************************************************/ var PeripheralSearchControl = Class.create(); Object.extend(PeripheralSearchControl.prototype, MapContrlBase.prototype); PeripheralSearchControl.prototype._loadUI = function(){ this.LoadUI('PeripheralSearchControl'); }; //显示查找周边窗体 PeripheralSearchControl.prototype.ShowPeripheralSearch = function(x, y){ this.$('btnSearch').onclick = function(){ var area = 500; if (this.$('maxArea').checked) { area = 1000; } this.onPeripheralSearch(this.$('txtPlace').value, x, y, area); }.bindAsEventListener(this); this.$('divHotKeyWords').innerHTML = ''; if (typeof SearchHotKeyWords != 'undefined') { for(var i=0;i'+SearchHotKeyWords[i]+'  '; } } this.Show(); }; PeripheralSearchControl.prototype._onPeripheralSearch = function(keyword, x, y){ var area = 500; this.$('txtPlace').value = keyword; if (this.$('maxArea').checked) { area = 1000; } this.onPeripheralSearch(keyword, x, y, area); }; //重载控件加载完毕后的事件 PeripheralSearchControl.prototype._loadComplete= function(){ this.Body.contentWindow.PeripheralSearchControl = this; this.onLoadComplete(this); }; //周边查找事件 PeripheralSearchControl.prototype.onPeripheralSearch = function(keyword, x, y, area){ }; PeripheralSearchControl.prototype.HotKeywords = ''; /************************************************* * 视窗广告控件 * code by lzz ver1.0 update at 07-10-25 *************************************************/ var RotaryPictureControl = Class.create(); Object.extend(RotaryPictureControl.prototype, MapContrlBase.prototype); RotaryPictureControl.prototype._loadUI = function(){ this.LoadUI('RotaryPictureControl'); }; //重载控件加载完毕后的事件 RotaryPictureControl.prototype._loadComplete= function(){ this.Body.contentWindow.RotaryPictureControl = this; this.onLoadComplete(this); }; RotaryPictureControl.prototype.onDataLoadComplete = function(){ }; /************************************************* * 搜索控件 * code by xzx ver1.0 update at 07-09-27 *************************************************/ var SearchControl = Class.create(); Object.extend(SearchControl.prototype, MapContrlBase.prototype); SearchControl.prototype._loadUI = function(){ this.LoadUI('SearchControl'); }; SearchControl.prototype.Width = 600; SearchControl.prototype.Height = 600; //此事可以托管该事件,执行一些附加操作,再将事件抛出 SearchControl.prototype._loadComplete = function(){ // '本地搜索' 给'btnLocalSearch'帮定事件 this.$('btnLocalSearch').onclick = this._LocalSearch.bindAsEventListener(this); // '黄页搜索' 给'btnYellowSearch'帮定事件 this.$('btnYellowSearch').onclick = this._onYellowPageSearch.bindAsEventListener(this); //'工交搜索' 给'btnBusSearch'帮定事件 this.$('btnBusSearch').onclick = this._onBusSearch.bindAsEventListener(this); this.Body.contentWindow.SearchControl = this; this.onLoadComplete(this); }; /****************本地搜索*****************/ SearchControl.prototype._LocalSearch = function(){ var sKeyword = this.$('txtKeyword').value; sKeyword = sKeyword.replaceAll('\'', '').replaceAll('%', '').replaceAll(';', ''); if (sKeyword.length > 0 && sKeyword != '请输入关键字,例如:火车站') { this.onLocalSearch(sKeyword); } }; /****************黄页搜索*****************/ SearchControl.prototype._onYellowPageSearch = function(){ var YellowKeyword = this.$('txtYellowKeyword').value; if (YellowKeyword.length > 0 && YellowKeyword != '请输入关键字,例如:超市') { this.onYellowPageSearch(YellowKeyword); } } /****************公交搜索*****************/ SearchControl.prototype._onBusSearch = function(){ //线路搜索 if (this.$('line0').checked) { var Param1 = this.$('txtLineSearch').value; if (Param1.length > 0 && Param1 != '请输入要搜索的线路') { this.onBusSearch(0,Param1,''); } } //站点搜索 else if(this.$('line1').checked) { var Param1 = this.$('txtLineSearch').value; if (Param1.length > 0 && Param1 != '请输入站点名') { this.onBusSearch(1,Param1,''); } } //两点搜索 else if(this.$('line2').checked) { var Param1 = this.$("txtBusstart").value; var Param2 = this.$("txtBusend").value; if (Param1.length>0 && Param2.length>0) { this.onBusSearch(2,Param1,Param2); } } } //外部调用本地搜索事件 SearchControl.prototype.onLocalSearch = function(sKeyword){ }; //外部调用黄页搜索事件 SearchControl.prototype.onYellowPageSearch = function(YellowKeyword){ }; //外部调用公交搜索事件 SearchControl.prototype.onBusSearch = function(iType,Param1,Param2){ }; /* * Field Declare ^-^ */ var SearchResultControl; if(!SearchResultControl) SearchResultControl = Class.create(); Object.extend(SearchResultControl.prototype,OptionCardContrlBase.prototype); SearchResultControl.prototype._loadUI = function(){ this.LoadUI('SearchResultControl'); }; //重载控件加载完毕后的事件 SearchResultControl.prototype._loadComplete= function() { this.Body.contentWindow.window.ResultControlForm = this; this.ItemsPanel = new OptionCardContrlBase.ItemsPanel(this.Body,'itemsPanel','cardContent'); /*--begin MinMax*/ //window.MContents=this.$('DragWindow'); window.MContentsRoller=new Aladdincn.Web.Animation.Roller(this.Body,30); MContentsRoller.AccFunction=AccelerationFunctions.CrazyElevator; MContentsRoller.onafterrollin=function(tm){ MContentsRoller.LeaveAmount=30; tm.contentWindow.document.getElementById('m_h_m').className='m_h_max'; }; MContentsRoller.onafterrollout=function(um){ um.contentWindow.document.getElementById('m_h_m').className='m_h_m'; }; this.$('m_h_m').onclick = this.MinMax.bindAsEventListener(this); /*----end MinMax----*/ this.$('m_h_c').onclick = this.Close.bindAsEventListener(this); this.$('Bar_L').onclick = this.ToLeft.bindAsEventListener(this.ItemsPanel); this.$('Bar_R').onclick = this.ToRight.bindAsEventListener(this.ItemsPanel); this.onLoadComplete(this); } //本地搜索 SearchResultControl.prototype.LocalSearch= function(sKeyWord) { if(sKeyWord!='') { var url = '../../../../../Fundation/LocalSearch.aspx?key='+escape(sKeyWord); this.Item = new OptionCardContrlBase.Item(this.Body,'localsearch',sKeyWord,url,true,true); this.Item.ExpendOut = this.MinMax.bind(this,true); this.ItemsPanel.addItem(this.Item); this.Show(); } } //周边搜索 SearchResultControl.prototype.LocalNearBySearch= function(sKeyWord,x,y,len) { if(sKeyWord!='') { var url = '../../../../../Fundation/LocalSearch.aspx?action=1&key='+escape(sKeyWord)+'&x='+x+'&y='+y+'&len='+len; this.Item = new OptionCardContrlBase.Item(this.Body,'nearBysearch',sKeyWord,url,true,true); this.Item.ExpendOut = this.MinMax.bind(this,true); this.ItemsPanel.addItem(this.Item); this.Show(); } } //框选搜索 SearchResultControl.prototype.LocalXYSearch= function(sKeyWord,x1,y1,x2,y2) { if(sKeyWord!='') { var url = '../../../../../Fundation/LocalSearch.aspx?action=2&key='+escape(sKeyWord)+'&x1='+x1+'&y1='+y1+'&x2='+x2+'&y2='+y2; this.Item = new OptionCardContrlBase.Item(this.Body,'localsearch',sKeyWord,url,true,true); this.Item.ExpendOut = this.MinMax.bind(this,true); this.ItemsPanel.addItem(this.Item); this.Show(); } } //公交搜索 SearchResultControl.prototype.BusSearch= function(nType, sParam1, sParam2) { if(sParam1=='') { return; } if(nType=='2'&&sParam2=='') { return; } var url = ''; var title=''; switch(nType) { case 0: url = '../../../../../Fundation/BusNoSearch.aspx?key='+escape(sParam1); title=sParam1; break; case 1: url = '../../../../../Fundation/BusStationSearch.aspx?key='+escape(sParam1); title=sParam1; break; case 2: url = '../../../../../Fundation/BusSESearch.aspx?s='+escape(sParam1)+'&e='+escape(sParam2); title=sParam1+'--'+sParam2; break; default: break; } if(title!='') { this.Item = new OptionCardContrlBase.Item(this.Body,'bussearch',title,url,true,true); this.Item.ExpendOut = this.MinMax.bind(this,true); this.ItemsPanel.addItem(this.Item); this.Show(); } } //对BUSSearch的扩展,根据公交ID,Name查询公交线路 SearchResultControl.prototype.BusIDSearch= function(nID,sName) { if(nID!=''&&sName!='') { var url = '../../../../../Fundation/BusNoSearch.aspx?key='+nID+'&action=1'; this.Item = new OptionCardContrlBase.Item(this.Body,'busnosearch',sName,url,true,true); this.Item.ExpendOut = this.MinMax.bind(this,true); this.ItemsPanel.addItem(this.Item); this.Show(); } } // //对BUSSearch的扩展,这个方法用在从这么出发,如何到达这里 //action 1从这里出发,2如何到达这里 SearchResultControl.prototype.BusSEXYSearch= function(action,x,y,sName) { if(sName!=''&&sName!=null) { var url = '../../../../../Fundation/BusSESearch.aspx?key='+escape(sName)+'&action='+action+'&x='+x+'&y='+y; this.Item = new OptionCardContrlBase.Item(this.Body,'bussearch',sName,url,true,true); this.Item.ExpendOut = this.MinMax.bind(this,true); this.ItemsPanel.addItem(this.Item); this.Show(); } } //主题地图搜索 SearchResultControl.prototype.ClassSearch= function(nClassID,sClassName) { if(sClassName==''||sClassName==null) { sClassName = '主题栏目'; } var url = '../../../../../Fundation/ProMap.aspx?classid='+nClassID; this.Item = new OptionCardContrlBase.Item(this.Body,'classsearch',sClassName,url,true,true); this.Item.ExpendOut = this.MinMax.bind(this,true); this.ItemsPanel.addItem(this.Item); this.Show(); } //新闻显示 SearchResultControl.prototype.NewsSearch= function(nNewsID,sNewsTitle) { if(sNewsTitle==null||sNewsTitle=='') { sNewsTitle='系统公告'; } var url ='../../../../../Fundation/News.aspx?id='+nNewsID; this.Item = new OptionCardContrlBase.Item(this.Body,'new'+nNewsID,sNewsTitle,url,true,true); this.Item.ExpendOut = this.MinMax.bind(this,true); this.ItemsPanel.addItem(this.Item); this.Show(); } //自定义显示内容 SearchResultControl.prototype.EdushiAnnounce= function(nID,sTitle) { var url ='../../../../../Fundation/EdushiAnnounce.aspx?id='+nID; this.Item = new OptionCardContrlBase.Item(this.Body,'EdushiAnnounce'+nID,sTitle,url,true,true); this.Item.ExpendOut = this.MinMax.bind(this,true); this.ItemsPanel.addItem(this.Item); this.Show(); } /*--------------------------对外事件begin------------------*/ //加载完成公交 SearchResultControl.prototype.onBusDataLoad= function(arrBusData,isPandN) { //alert('还未加载公交事件'); } //加载完成本地搜索 SearchResultControl.prototype.onLocalDataLoad = function(arrLocalData,nBegin,nEnd) { //alert('还未加载本地搜索事件') } //加载完成主题地图搜索 SearchResultControl.prototype.onClassDataLoad = function(arrClassData,nBegin,nEnd) { //alert('还未加载主题地图事件') } //定位 SearchResultControl.prototype.onGoToXY= function(x,y) { //alert('还未加载定位事件'); } //推荐POP SearchResultControl.prototype.onVouchClick= function(title,content,x,y) { //alert('还未加载推荐POP事件'); } //点击实体或企业 SearchResultControl.prototype.onEntityClick= function(oid,cid,x,y) { //alert('还未加载实体或企业POP事件'); } //主题泡泡点击 SearchResultControl.prototype.onThemeClick= function(tid,x,y) { //alert('还未加载实体或企业POP事件'); } /*--------------------------对外事件end------------------*/ /*--------------------------私有事件begin-------------------*/ SearchResultControl.prototype._busDataLoad= function(arrBusData,isPandN) { this.onBusDataLoad(arrBusData,isPandN); } SearchResultControl.prototype._localDataLoad = function(arrLocalData,nBegin,nEnd) { this.onLocalDataLoad(arrLocalData,nBegin,nEnd); } SearchResultControl.prototype._classDataLoad = function(arrClassData,nBegin,nEnd) { this.onClassDataLoad(arrClassData,nBegin,nEnd); } SearchResultControl.prototype._gotoXY= function(x,y) { this.onGoToXY(x,y); } //推荐POP SearchResultControl.prototype._vouchClick= function(title,content,x,y) { this.onVouchClick(title,content,x,y); } //实体POP SearchResultControl.prototype._entityClick= function(oid,cid,x,y) { this.onEntityClick(oid,cid,x,y); } //主题POP SearchResultControl.prototype._themeClick= function(tid,x,y) { this.onThemeClick(tid,x,y); } /*--------------------------私有事件end-------------------*/ /*测试加载选项卡*/ SearchResultControl.prototype.addItem= function(id,title,url,flag) { this.Item = new OptionCardContrlBase.Item(this.Body,id,title,url,flag); this.ItemsPanel.addItem(this.Item); this.Show(); } /*------------------------内部绑定事件begin-------------------------*/ /*页卡左移*/ SearchResultControl.prototype.ToLeft = function(e) { for(var i=0;i 0) { this.$('Entro_yp').style.display = 'block'; this.$('Entro_yp').href = c.YPage; this.$('Entro_yp').target = '_blank'; } if(c.ComImage!=null&&c.ComImage!='') { this.$('Entr_img').src=this.Config._UpImagesUrl+'/'+this.Config._UpImages+'/'+c.ComImagePath+'/s'+c.ComImage; this.$('Entr_img_a').href=this.Config._UpImagesUrl+'/'+this.Config._UpImages+'/'+c.ComImagePath+'/'+c.ComImage; //this.$('Entr_img').onerror = this._LoadImgErr.bindAsEventListener(this.$('Entr_img'),'../images/nophoto.jpg'); this.$('Entr_img_a').target ='_blank'; } else { this.$('Entr_img_a').target ='_self'; } this.$('Entr_close').onclick = this.Close.bindAsEventListener(this); this.$('Entro_mark').onclick = this._sign.bindAsEventListener(this,c.ComX,c.ComY,c.CompanyName); this.$('Entro_error').onclick = this._cavil.bindAsEventListener(this,2,c.ID,c.CompanyName,c.ComX,c.ComY); var bustransferurl = '../../../../../Fundation/BusTransfer.aspx?x='+c.ComX +'&y='+c.ComY; this.BusTransferItem = new OptionCardContrlBase.Item(this.Body,'bustransfer','公交换乘',bustransferurl,false,false,59); this.ItemsPanel.addItem(this.BusTransferItem); var nearbyurl = '../../../../../Fundation/NearBySearch.aspx?x='+c.ComX +'&y='+c.ComY; this.NearByItem = new OptionCardContrlBase.Item(this.Body,'nearby','查找周边',nearbyurl,false,false,59); this.ItemsPanel.addItem(this.NearByItem); var nearbusurl = '../../../../../Fundation/PeripheralBus.aspx?x='+c.ComX +'&y='+c.ComY; this.NearBusItem = new OptionCardContrlBase.Item(this.Body,'nearbus','周边公交',nearbusurl,false,false,59); this.NearBusItem.cardFrame.scrolling = 'auto'; this.NearBusItem.cardFrame.style.height = '130px'; this.ItemsPanel.addItem(this.NearBusItem); this.BusTransferItem.activeItem(); this.onHistorySaved(3, c); } //内部事件 ThemePopControl.prototype.fnCopyCode = function (strUrl, msg){ var txt = this.$(strUrl).value; fnCopyToClipboard(txt,msg); } //图像加载三次仍然失败则移除 ThemePopControl.prototype._LoadImgErr = function(e,imgpath){ if(this.c=='undefined'||this.c==null){ this.c=0; } else{ this.c++; } if(this.c>3){ if (this.src == imgpath) { return; //默认图片加载失败则不再触发 , ie7光设置 this.onerror=null; 无效 } this.src=imgpath; this.onerror=null; this.parentNode.href = 'javascript:;'; this.parentNode.target = '_self'; } else{ this.src=this.src; } } ThemePopControl.prototype.Close=function(e) { this.Hide(); } //对内接口 //公交ID,Name搜索公交线路的事件 ThemePopControl.prototype._sign = function(e,x,y,sName) { this.onSign(x,y,sName) }; //纠错事件 ThemePopControl.prototype._cavil = function(e,type,nID,sName,x, y) { this.onCavil(type,nID,sName,x, y); }; ThemePopControl.prototype._busIdSearch = function(nID,sName) { this.onBusIDSearch(nID,sName); }; //从这里出发,如何到达这里公交搜索,action:1从怎么出发,2如何到达这里 ThemePopControl.prototype._busSEXYSearch = function(action,x,y,sKeyword) { this.onBusSEXYSearch(action,x,y,sKeyword); }; //周边搜索的事件 ThemePopControl.prototype._nearbySearch = function(sKeyword,x,y,len) { this.onLocalNearBySearch(sKeyword,x,y,len); }; //对外接口 //标记该位置的事件 ThemePopControl.prototype.onSign = function(x,y,sName) { alert('未实现标记方法'); }; //纠错事件 ThemePopControl.prototype.onCavil = function(type,nID,sName,x, y) { alert('未实现纠错方法'); }; //公交ID,Name搜索公交线路的事件 ThemePopControl.prototype.onBusIDSearch = function(nID,sName) { }; //从这里出发,如何到达这里公交搜索 ThemePopControl.prototype.onBusSEXYSearch = function(action,x,y,sKeyword) { }; //周边搜索的事件 ThemePopControl.prototype.onLocalNearBySearch = function(sKeyword,x,y,len) { }; ThemePopControl.prototype.onHistorySaved = function(type,spot){ }; /************************************************* * 到这里搜索控件 * code by lzz ver1.0 update at 07-10-17 *************************************************/ var ToSearchControl = Class.create(); Object.extend(ToSearchControl.prototype, MapContrlBase.prototype); ToSearchControl.prototype._loadUI = function(){ this.LoadUI('ToSearchControl'); }; ToSearchControl.prototype.ShowToHereSearch = function(x, y){ this.$('btnSearch').onclick = function(){ this.onShowToHereSearch(this.$('popbusnametxt1').value, x, y); }.bindAsEventListener(this); this.Show(); }; //重载控件加载完毕后的事件 ToSearchControl.prototype._loadComplete= function(){ this.Body.contentWindow.ToSearchControl = this; this.onLoadComplete(this); }; //到这里事件 , keyword:来源地 ToSearchControl.prototype.onShowToHereSearch = function(keyword, x, y){ };