yishanmu
路人甲
路人甲
  • 注册日期2008-04-05
  • 发帖数7
  • QQ
  • 铜币142枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1251回复:0

急,新手请教在修改web map application时遇到的问题

楼主#
更多 发布于:2009-05-04 16:32
<P>在VS2008环境下,安装了arcgisserver9.3后,可以用web map application模板创建网站.想对其稍作修改,但是遇到了下面的问题。关于javascript的问题。 <BR>问题如下: <BR>问题1、下面程序中红色字体处是我添加的,单步调试的时候语句(1)this._addToResultsLink = ' <a href="javascript: AddToTaskResults(0);">Add to Results </a>';(原有的)和语句(2)this._addxingongnengLink = ' <a href="www.baidu.com/;">新增功能 </a>';(我自己添加的)都执行了,但是运行的结果只显示了我添加的内容,我想让两个一起都显示出来怎么办? <BR>问题2、我的连接只是想简单的连接一个网址,可以运行后连接的网址变为:请求的 URL: /Web Mapping Application1/www.baidu.com/;其中Web Mapping Application1是我建立的网站名称,怎样填写语句this._addxingongnengLink = ' <a href="www.baidu.com/;">新增功能 </a>'href的内容,使请求的URL直接为百度的网址呢? <BR>identifyLocation : function (mapID, pointX, pointY, pointAttributes) { <BR>this.identifyMapClientID = mapID; <BR>var newPt = new ESRI.ADF.Geometries.Point(pointX,pointY); <BR>var identifyMapPoint = newPt; <BR>this.identifyAttributes = pointAttributes; <BR>this.selectedIndex = 0; <BR>this.selectedValue = ""; <BR>this._addedToResults = new Array(); <BR>if (pointAttributes) { <BR>for (var a=0;a <pointAttributes.length;a++) { <BR>this._addedToResults.push(false); <BR>} <BR>} <BR>this.identifyComboBox = " <b>" + "There is no information available for this location." + " </b>"; <BR>this._dropDownList = ""; <BR>if (this.identifyAttributes.length==0) <BR>{ <BR>this.identifyComboBox = "No Features Found"; <BR>this._addToResultsLink = ""; <BR>///yujuncai <BR>this._addxingongnengLink = ""; <BR>this._layerInfo = ""; <BR>} <BR>else if (this.identifyAttributes.length == 1) {// One layer <BR>this.identifyComboBox = this._getTitle(0); <BR>this.selectedValue = this._getLayerName(0); <BR>this._addToResultsLink = ' <a href="javascript: AddToTaskResults(0);">Add to Results </a>'; <BR><FONT face=黑体 color=#ee3d11 size=3>/// 自己添加的 <BR>this._addxingongnengLink = ' <a href="www.baidu.com/;">新增功能 </a>'; </FONT></P>
<P><FONT color=#ee3d11><FONT face=黑体><FONT size=3> /// <BR></FONT></FONT></FONT>this._layerInfo = this._getLayerInfo(0); <BR>} else {// multiple layers <BR>var index = 0; <BR>for (var x = 0; x < this.identifyAttributes.length; x++) { // get layer names <BR>if (this._getLayerName(x)==this.selectedValue) { <BR>index = x; <BR>this.selectedIndex = x; <BR>} <BR>} <BR>this.identifyComboBoxPopulate(index); <BR>} <BR>if (this.identifyComboBox.length==0) this.identifyComboBox = " <b>" + "No Features found at this location." + " </b>"; <BR><BR>this.identifyMapTips = new ESRI.ADF.UI.IdentifyMapTips(this); <BR>this.identifyMapTips.set_animate(false); <BR>this.identifyMapTips.set_hoverTemplate(this.identifyComboBox); <BR>this.identifyMapTips.set_maxheight(250); <BR>this.identifyMapTips.set_width(275); <BR>this.identifyMapTips.initialize(); <BR>var imcallout = $find(mapID+'_identifyicon'); <BR>if (imcallout!=null) { <BR>this._map.removeGraphic(imcallout); <BR>imcallout.dispose(); <BR>imcallout = null; <BR>} <BR>this.identifyMapCallout = $create(ESRI.ADF.Graphics.GraphicFeature, <BR>{"id":mapID+'_identifyicon',"geometry":identifyMapPoint,"symbol":new ESRI.ADF.Graphics.MarkerSymbol(this._identifyIcon,12,24), <BR>"mapTips":this.identifyMapTips, <BR>"attributes":pointAttributes[0]}); <BR><BR>this.identifyMapCallout.get_symbol().set_imageFormat("png32"); <BR>if(this.waitIcon) { this._map.removeGraphic(this.waitIcon); }     <BR>this._map.addGraphic(this.identifyMapCallout); <BR>var callout = this.identifyMapTips.get_callout(); <BR>// populate, position, and show the inital display <BR>if(this._lastExpanded ;; this.identifyAttributes.length>0) { this.identifyMapTips.expand(); } <BR>else { this.identifyMapTips.collapse(); } <BR><BR>this.identifyMapTips._setContent(this.identifyMapCallout.get_attributes()); <BR>this.identifyMapTips._dropDownBox.innerHTML = this._dropDownList; <BR>this.identifyMapTips.setPosition(this.identifyMapCallout.get_geometry()); <BR>this.identifyMapTips.get_callout().show(); <BR><BR>if(!this.onMapZoom) { <BR>this._onMapZoom = Function.createDelegate(this, this.clearOutCallout ); <BR>this._map.add_zoomStart(this._onMapZoom); <BR>} <BR>this._processing = false; <BR>}, <BR>identifyComboBoxPopulate : function (index){ <BR>var layerName = this.identifyMapClientID; <BR>var layerNameSelected = this.identifyMapClientID; <BR>var titleString = ""; <BR>this._layerInfo = ""; <BR>this._addToResultsLink = ""; <BR>///yujuncai <BR>this._addxingongnengLink = ""; <BR>this._dropDownList = ""; <BR>if (index==null || index=="undefined") index = 0; <BR>if (this.identifyAttributes.length==0) { <BR>this.identifyComboBox = "No Features Found"; <BR>this._addToResultsLink = ""; <BR>///yujuncai <BR>this._addxingongnengLink = ""; <BR>} else if (this.identifyAttributes.length===1) { <BR>titleString = this._getTitle(0); <BR>this.identifyComboBox = titleString; <BR>if (!this._addedToResults[0]) <BR>    this._addToResultsLink = ' <a href="javascript: AddToTaskResults(0);">Add to Results </a>'; <BR>    this._addxingongnengLink = ' <a href="www.baidu.com/;">新增功能 </a>'; <BR>} else { <BR>titleString = this._getTitle(index); <BR>this.identifyComboBox = ' <div id="identifyTitleDiv" >'; <BR>var ie = (Sys.Browser.agent == Sys.Browser.InternetExplorer); <BR>this.identifyComboBox += ' <table id="identifyTitleText" style="border: solid 1px rgb(238, 238, 238);font-size: x-small; width: 225px;" onmouseover="showIdentifyDropdownButton()" cellspacing="0" cellpadding="0"> <tr> <td > <div id="identifyTitleTextHolder">;nbsp;' + titleString + ' </div> </td>'; <BR>            this.identifyComboBox += ' <td align="' + (document.documentElement.dir=="rtl"?"left":"right") + '"> <img id="identifyDropdownButton" src="images/dropdown-button.png" onmousedown="showIdentifyDropdown(\'' + this.get_id() + '\')" style="visibility: hidden" /> </td> </tr> </table>'; <BR>// populate identifyCombobox <BR>this._dropDownList = ' <table id="identifyTitleDropdown" style="background-color: White; color: black; width: 100%; font-size: x-small;" cellspacing="0">'; <BR>for (var x = 0; x < this.identifyAttributes.length; x++) { // get layer names <BR>layerName = this._getLayerName(x); <BR>titleString =  this._getTitle(x); <BR>// generate ComboBox selection list <BR>this._dropDownList += ' <tr> <td onclick="selectIdentifyDropdownItem(\'' + this.get_id() + '\', ' + x + ', \'' + layerName + '\');" onmouseover="this.style.backgroundColor=\'#DDDDDD\'" onmouseout="this.style.backgroundColor=\'White\'" style="cursor: default">' + titleString + ' </td> </tr>'; <BR>} <BR>this._dropDownList += ' </table>'; <BR>if (!this._addedToResults[index]) <BR>    this._addToResultsLink = ' <a href="javascript: AddToTaskResults(' + index + ');">Add to Results </a>'; <BR>this._addxingongnengLink = ' <a href="./www.baidu.com/;">新增功能 </a>'; <BR>} <BR>if (this.identifyComboBox.length==0) { <BR>this.identifyComboBox = "No Features found at this location."; <BR>this._layerInfo = ""; <BR>} else { <BR>this._layerInfo = this._getLayerInfo(index); <BR>} <BR>if (this.identifyMapCallout) this.identifyMapCallout.set_attributes(this.identifyAttributes[index]); <BR>}, <BR></P>
喜欢0 评分0
游客

返回顶部