转至繁体中文版     | 网站首页 | 图文教程 | 资源下载 | 站长博客 | 图片素材 | 武汉seo | 武汉网站优化 | 
最新公告:     敏韬网|教学资源学习资料永久免费分享站!  [mintao  2008年9月2日]        
您现在的位置: 学习笔记 >> 图文教程 >> 站长学院 >> Web开发 >> 正文
ArcIMS学习之 定制HTML VIEWER笔记         ★★★★

ArcIMS学习之 定制HTML VIEWER笔记

作者:闵涛 文章来源:闵涛的学习笔记 点击数:1467 更新时间:2009/4/23 11:25:57

  一、HTML VIEWER简介:

  1。默认的HTML VIEWER由一组HTML页和JS文件(JavaScript)组成,这些HTML页和JS文件由ArcIMS Designer定制生成。

  2。对于HTML Viewer,我们所做的功能扩展可以包括:

  * 改变框架布局
  * 修改工具条
  * 增加自己的功能
  * 改变图形外观
  * 插入自己的图标

  3。ArcIMS Designer定制的网站默认在Web容器的home目录的\default-web-app\Website 目录下

  二、HTML Viewer文件结构:

  1。由一组HTML文件,一个参数文件ArcIMSparam.js及两个目录--JavaScript和images组成。

站点目录
    |
    | HTML Pages
    | ArcIMSparam.js
    |
    |---- JavaScript目录//包含JavaScript函数库,定义了用户可操作的地图功能,包括了HTML Viewer的大部分操作 。
    |    //可以通过定制这些JavaScript程序为自己的工具按扭增加功能。如热连接等。
    |---- images 目录 //包含用于页面上按钮,图标及标记的显示。当新建站点时,可以用自己的标志代替这些原有的影像

  2。ArcIMSparam.js与HTML Pages

  HTML Viewer的一个重要的参数文件是位于站点目录下的ArcIMSparam.js文件。这个文件包含了一组影响站点外观和工作方式的JavaScript变量。对HTML Viewer大部分的定制都可以通过改变这些变量 的值来完成。ArcIMSparam.js包含的主要变量可以用来

 * 改变所用的地图服务和地图范围
 * 设置图例的初始化显示
 * 定义acetate层的指北针,版权文字
 * 定义属性字段的显示
 * 改变工具和工具条

 HTML Viewer默认入口是Default.htm。它的处理了四个任务
  1>创建页面标题,
  2>确定所用的浏览器类型,
  3>建立URL解析规则
  4>生成用于定义页面布局框架的viewer.htm文件。

  Viewer.htm定义了HTML Viewer的结构,而不是内容,他将浏览器划分为多个区域。每个区域通过HTML文件获得内容。其他的HTML文件则为框架添加内容。

  一般关系如下:

  先装入MapFrame.html于MapFrame中,再由MapFrame打开TocFrame其中装入toc.htm,所以在toc.htm用MapFrame的内容时,

 var t;
 if(opener){
 t=opener.parent.MapFrame;
 }else{
 t=parent.MapFrame;
 }

  因为,MapFrame.html包含了aimsCustom.js、aimsXML.js、ArcIMSparam.js,因而将添加的函数放入aimsCustom.js(包括构造发送XML的函数和处理XML的函数useCustomFunction)后在各自框架中调用MapFrame中新加的函数!

  以添加定位功能为例,一般是在aimsCustom.js中加入函数,如function addressLocation(x,y,name)其中先保存上一幅地图的范围,再调用sendMapXML()获得新地图发送request

saveLastExtent()

Arguments:
None

Returned Value:
None

Description:
Function that saves the last map extent.

Uses: eLeft, eRight, eTop, and eBottom.

Called by: displayAttributeData in aimsIDentify.js; fullExtent, startExtent, zoomToPoint,
zoomToEnvelope, zoomScale, zoomButton, and panButton in aimsMap.js;
ovMapClick, zoomin, zoomout, stopZoomBox, stopZoomOutBox, stopPan, and pan in
aimsNavigation.js; and showHighlight in aimsSelect.js.
Sets: lastLeft, lastRight, lastTop, and lastBottom.

File:
aimsMap.js
Syntax:


sendMapXML()
Arguments:
None
Returned Value:
None

Description:
Sends an ArcXML request to obtain a new map image to the MapServer.

  会用到的变量为: debugOn and imsURL.

Calls: beforeMapRefresh and showRetrieveMap in aimsMap.js and writeXML and sendToServer in
aimsXML.js.

Called by: bufferIt in aimsBuffer.js; clickFunction in aimsClick.js; processStartExtent in
aimsCommon.js; parseGeocodeResults in aimsGeocode; displayAttributeData in
aimsIDentify.js; fullExtent, startExtent, zoomBack, zoomToPoint, zoomToEnvelope,
zoomScale, zoomButton, and panButton in aimsMap.js; ovMapClick, zoomin, zoomout,
stopZoomBox, stopZoomOutBox, stopPan, and pan in aimsNavigation.js; showHighlight
in aimsSelect.js; and process XML in aimsXML.js.

  在aimsXML.js文件中的sendMapXML()函数内容为:

function sendMapXML() {

 beforeMapRefresh();
 showRetrieveMap();
 var theText = writeXML();
 if (debugOn==2) alert(msgList[12] + theText);
 
 sendToServer(imsURL,theText,1);

}

  其中:writeXML()写出对新地图的request XML,要修改就对writeXML()进行修改

writeXML()

Arguments:
None

Returned Value:
String ArcXML request string to be sent to the ImageServer.

Description:
Writes an ArcXML request for a new map image. This is the default request sent for a main map display image.

用到的变量为: eLeft, eRight, eTop, eBottom, iHeight, iWidth, aimsLayersPresent, toggleVisible, layerCount,
aimsClassRenderPresent, mapBackColor, aimsLegendPresent, legendVisible, aimsBufferPresent,
showBuffer, aimsSelectPresent, showGeocode, geocodeX, geocodeY, geocodePointColor,
geocodePointSize, geocodeLabel, aimsClickPresent, clickCount, selectColor, clickType,
clickMarkerColor, clickMarkerType, clickMarkerSize, aimsCustomPresent, drawCopyright,
CopyrightCoords, CopyrightText, CopyrightStyle, CopyrightSize, CopyrightFont, CopyrightColor,
CopyrightBackground, CopyrightBGColor, CopyrightGlow, CopyrightGlowColor, drawNorthArrow,
NorthArrowType, NorthArrowSize, NorthArrowCoords, NorthArrowAngle, drawScaleBar,
ScaleBarbackColor, ScaleBarFont, ScaleBarStyle, ScaleBarColor, MapUnits, scalebarFontColor,
ScaleBarUnits, ScaleBarPrecision, ScaleBarSize, ScaleBarWidth, drawModeOnMap, modeBlurb,
modeMapColor, and modeMapGlow and LayerVisible, LayerID, clickPointX, and clickPointY arrays.
Calls: addSpecialRenderToMap in aimsClassRender.js (custom sample); addBufferToMap in aimsBuffer.js;
addLegendToMap in aimsLegend.js; addCustomToMap1, addCustomToMap2, addCustomToMap3,
and addCustomToMap4 in aimsCustom.js; addSelectToMap in aimsSelect.js; and getScaleBarDistance
in aimsMap.js.

Called by: clickAddPoint, resetClick, and deleteClick in aimsClick.js; getLegend in
aimsLegend.js; getPrintMap in aimsPrint.js; clearSelection in aimsSelect.js; and
sendMapXML and justGetMap in aimsXML.js.

File:
aimsXML.js

  其中sendMapXML()函数最后调用:

sendToServer(URLString,XMLRequest,theType)

Arguments:
URLString -- String containing service URL for request.
XMLRequest -- String containing ArcXML request.
theType -- Numeric representing mode number to be passed to XMLMode. Used by processXML in passing ArcXML response to appropriate function for processing.

Returned Value:
None

Description:
Used to pass ArcXML requests on to the server(s). This function updates the form in the PostFrame page
(jsForm.htm) with the current request and processing function name.

Calls: showRetrieveMap, hideRetrieveMap, and hideRetrieveData in aimsMap.js.
Called by: functions sending ArcXML requests to the server(s).

File:
aimsXML.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(

[1] [2]  下一页


[Web开发]IIS下下伪静态html(URL Rewrite)设置方法  [网页制作]什么是XHTML、为什么要使用XHTML
[Web开发]XML与HTML在语法上的主要区别详解  [常用软件]网页版权保护专家 HTML Guard
[VB.NET程序]压缩 Html  [网页制作]浅淡PHP生成HTML的思路
[网页制作]HTML 标签是否匹配检测代码  [网页制作]将 html 转成 ubb代码的小脚本
[网页制作]WEB高手培训班之HTML篇  [网页制作]HTML Form issue
教程录入:mintao    责任编辑:mintao 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    同类栏目
    · Web开发  · 网页制作
    · 平面设计  · 网站运营
    · 网站推广  · 搜索优化
    · 建站心得  · 站长故事
    · 互联动态
    更多内容
    热门推荐 更多内容
  • 没有教程
  • 赞助链接
    更多内容
    闵涛博文 更多关于武汉SEO的内容
    500 - 内部服务器错误。

    500 - 内部服务器错误。

    您查找的资源存在问题,因而无法显示。

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved.
    闵涛 投放广告、内容合作请Q我! E_mail:admin@mintao.net(欢迎提供学习资源)

    站长:MinTao ICP备案号:鄂ICP备11006601号-18

    闵涛站盟:医药大全-武穴网A打造BCD……
    咸宁网络警察报警平台