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().
* 调 用    sendMapXML(aimsXML.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()函数。全局变量XMLMode在aimsXML.js中定义(见Customizing ArcIMS: HTML Viewer第308<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

posted on 2010-08-17 09:11  基斯盐  阅读(228)  评论(0编辑  收藏  举报

导航