ArcIMS Custom.js定制函数的模版

来源:互联网 发布:网络胜利组漫画178 编辑:程序博客网 时间:2024/06/04 17:49
ArcIMS Custom.js定制函数的模版

////////////////////////////////////////////////////////////////////////
// aimsCustom.js
//
缺省生成的aimsCustom.js是添加用于定制函数的模版
////////////////////////////////////////////////////////////////////////
//***************************************
地址匹配函数******************************************
/*
 *   
函数名       addressLocation     
 *   
        在地图上显示地址匹配坐标点         
 *  
参数说明      x,y:地址匹配坐标点的地图坐标
 *                 name
:地址匹配点的地图标识   
 *  
返回结果          
 *  
使用的公共变量 limitRight limitLeft limitTop limitBottom selectPointMargin
 *  
 *   aimsMap.js
中的
 *   eLeft (Numeric/Dynamic) Current extent left (minimum x-coordinate).
 *      Formerly called left.
 *   eRight (Numeric/Dynamic) Current extent right (maximum x-coordinate).
 *      Formerly called right.
 *   eTop (Numeric/Dynamic) Current extent top (maximum y-coordinate).
 *      Formerly called top.
 *   eBottom (Numeric/Dynamic) Current extent bottom (minimum y-coordinate).
 *      Formerly called bottom.
 *   showGeocode (Boolean/Dynamic) If true, map request will include
 *      command to draw point at geocodeX, geocodeY
 *      with an optional label. Updated by viewer on
 *      response of address match request or
 *      zoomToPoint() function.
 *   geocodeX (Numeric/Dynamic) Geocode point x-coordinate. Updated by
 *      viewer on address match response or
 *      by zoomToPoint().
 *   geocodeY (Numeric/Dynamic) Geocode point y-coordinate. Updated by
 *      viewer on address match response or
 *      by zoomToPoint().
 *  
          sendMapXMLaimsXML.js     
 *  
被调用             
*/
function addressLocation(x,y,name){
 legendVisible=false;
 hasTOC=false;

 var mWMargin = 0;
 var mHMargin = 0;
 mWMargin = Math.abs(limitRight-limitLeft) * (selectPointMargin/10);
 mHMargin = Math.abs(limitTop-limitBottom) * (selectPointMargin/10);
 saveLastExtent();
 eLeft = parseFloat(x) - parseFloat(mWMargin);
 eRight = parseFloat(x) + parseFloat(mWMargin);
 eTop = parseFloat(y) + parseFloat(mHMargin);
 eBottom = parseFloat(y) - parseFloat(mHMargin);
 showGeocode=true;
 geocodeX=x;
 geocodeY=y;
 geocodeLabel=name;
 sendMapXML();
}
/*****************************************************************************
 * aimsXML.js
 * send the created xml request to map server
 */
function sendMapXML() {
 // ask for the Main map
 //window.onerror=clearError;
 beforeMapRefresh();
 //window.onerror=resetError;
 showRetrieveMap();

 var theText = writeXML();

 if (debugOn==2) alert(msgList[12] + theText);
 //alert(theText);
 //hasTOC=false;
 sendToServer(imsURL,theText,1);
}
/*****************************************************************************
 *function writeXML()


接收response


processXML(theReplyIn)

Arguments:
theReplyIn--String containing returned ArcXML response.

Returned Value:
None

Description:
Passes the ArcXML response to the appropriate function for processing. The key global is XMLMode,which determines which function to call
,即设定XMLMode就可以决定processXML(theReplyIn)调用哪个分析response XML的函数。

Calls: appropriate function to parse ArcXML response.

Called by: passXML in dynamic connector-created page in PostFrame on loading.

File:
aimsXML.js

 全局变量XMLMode的值<1000,由processXML(theReplyIn)调用其默认函数,>1000即用户自定义时,processXML(theReplyIn)调用useCustomFunction()函数。全局变量XMLModeaimsXML.js中定义(见Customizing ArcIMS: HTML Viewer308<315>页)。


useCustomFunction(theReply)

Arguments:
theReply String containing returned ArcXML response.

Returned Value:
None

Description:
Available for custom processing of returned ArcXML responses. The function processXML will call this function if the value of the global XMLMode is 1,000 or greater.

Uses: XMLMode.

Calls: hideLayer in aimsDHTML.js.

Called by: processXML in aimsXML.js.

File:
aimsCustom.js

 
原创粉丝点击