- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
aimsDHTML.js
资源名称:arcims.rar [点击查看]
上传用户:gzuoyue
上传日期:2022-07-08
资源大小:177k
文件大小:7k
源码类别:
GIS编程
开发平台:
ASP/ASPX
- // aimsDHTML.js
- /*
- * JavaScript template file for ArcIMS HTML Viewer
- * dependent on aimsXML.js, ArcIMSparam.js, aimsCommon.js, aimsMap.js,
- * aimsLayers.js
- */
- aimsDHTMLPresent=true;
- /*
- ***************************************************************************************
- DHTML layer functions
- ***************************************************************************************
- */
- // Create a DHTML layer
- function createLayer(name, inleft, intop, width, height, visible, content) {
- var layer;
- document.writeln('<div id="' + name + '" style="position:absolute; overflow:hidden; left:' + inleft + 'px; top:' + intop + 'px; width:' + width + 'px; height:' + height + 'px;' + '; z-index:1; visibility:' + (visible ? 'visible;' : 'hidden;') + '">');
- document.writeln(content);
- document.writeln('</div>');
- }
- // get the layer object called "name"
- function getLayer(name) {
- var theObj = document.getElementById(name);
- if (theObj!=null) {
- return theObj.style
- } else {
- return(null);
- }
- }
- // get the layer object called "name" if in OverviewFrame
- function getOVLayer(name) {
- if (parent.OverviewFrame!=null) {
- var theObj = parent.OverviewFrame.document.getElementById(name);
- if (theObj!=null) {
- return theObj.style
- } else {
- return(null);
- }
- } else
- return getLayer(name);
- }
- function isVisible(name) {
- var layer = getLayer(name);
- if (isNav && layer.visibility == "show")
- return(true);
- if (isIE && layer.visibility == "visible")
- return(true);
- return(false);
- }
- // move layer to x,y
- function moveLayer(name, x, y) {
- var layer = getLayer(name);
- layer.left = x + "px";
- layer.top = y + "px";
- }
- // set layer background color
- function setLayerBackgroundColor(name, color) {
- var layer = getLayer(name);
- layer.backgroundColor = color;
- }
- // toggle layer to invisible
- function hideLayer(name) {
- var layer = getLayer(name);
- layer.visibility = "hidden";
- }
- // toggle layer to visible
- function showLayer(name) {
- var layer = getLayer(name);
- layer.visibility = "visible";
- }
- // toggle Overview layer to visible - if in OverviewFrame
- function showOVLayer(name) {
- var layer = getOVLayer(name);
- layer.visibility = "visible";
- }
- // toggle Overview layer to invisible - if in OverviewFrame
- function hideOVLayer(name) {
- var layer = getOVLayer(name);
- layer.visibility = "hidden";
- }
- // clip layer display to clipleft, cliptip, clipright, clipbottom
- // Not working with Mozilla Milestone 12 (Nav5)
- function clipLayer2(name, clipleft, cliptop, clipright, clipbottom) {
- var layer = getLayer(name);
- layer.clip = 'rect(' + cliptop + ' ' + clipright + ' ' + clipbottom + ' ' + clipleft +')';
- }
- function clipLayer(name, clipleft, cliptop, clipright, clipbottom) {
- var layer = getLayer(name);
- var newWidth = clipright - clipleft;
- var newHeight = clipbottom - cliptop;
- layer.height = newHeight;
- layer.width = newWidth;
- layer.top = cliptop + "px";
- layer.left = clipleft + "px";
- }
- // clip layer in OverviewFrame
- function clipOVLayer(name, clipleft, cliptop, clipright, clipbottom) {
- var layer = getLayer(name);
- if (parent.OverviewFrame!=null) layer = getOVLayer(name);
- if ((clipright.isNaN) || (clipleft.isNaN) || (cliptop.isNaN) || (clipbottom.isNaN)) {
- layer.visibility = "hidden";
- } else {
- var newWidth = clipright - clipleft;
- var newHeight = clipbottom - cliptop;
- if ((newWidth<=0) || (newHeight<=0)) {
- layer.visibility = "hidden";
- } else {
- layer.height = newHeight;
- layer.width = newWidth;
- layer.top = cliptop + "px";
- layer.left = clipleft + "px";
- layer.visibility = "visible";
- }
- }
- }
- // replace layer's content with new content
- // not working with Mozilla Milestone 12 (Nav5)
- function replaceLayerContent(name, content) {
- var theObj = document.getElementById(name);
- if (theObj!=null) {
- theObj.innerHTML = content;
- }
- }
- // toggle Overview Map display
- function toggleOVMap() {
- if (imsURL!="") {
- ovIsVisible = !ovIsVisible;
- if (ovIsVisible) {
- putExtentOnOVMap();
- showLayer("ovLayer");
- showLayer("ovShadow");
- } else {
- hideLayer("ovLayer");
- hideLayer("ovShadow");
- hideLayer("zoomOVBoxTop");
- hideLayer("zoomOVBoxLeft");
- hideLayer("zoomOVBoxRight");
- hideLayer("zoomOVBoxBottom");
- }
- var layer = getLayer("theTop");
- if (layer!=null) layer.cursor = theCursor;
- } else {
- alert(msgList[45]);
- }
- }
- // plot extent box on overview map - only for Overview if in OverviewFrame
- function putExtentOnOVMap() {
- var ovXincre = fullOVWidth / i2Width;
- var ovYincre = fullOVHeight / i2Height;
- var vleft = (eLeft - fullOVLeft) / ovXincre + ovBorderWidth;
- var vright = (eRight - fullOVLeft) / ovXincre + ovBorderWidth;
- var vtop = (fullOVTop - eTop) / ovYincre + ovBorderWidth;
- var vbottom = (fullOVTop - eBottom) / ovYincre + ovBorderWidth;
- if (vright>i2Width+ovBorderWidth) vright = i2Width;
- if (vbottom>i2Height+ovBorderWidth) vbottom = i2Height;
- //if (!isNav4) {
- vleft = vleft + ovHspc;
- vright = vright + ovHspc;
- vtop = vtop + ovVspc;
- vbottom = vbottom + ovVspc;
- //}
- if (eTop>fullOVBottom) {
- clipOVLayer("zoomOVBoxTop",vleft,vtop-ovExtentBoxSize,vright+1,vtop);
- showOVLayer("zoomOVBoxTop");
- } else {
- hideOVLayer("zoomOVBoxTop");
- }
- if (eLeft<fullOVRight) {
- clipOVLayer("zoomOVBoxLeft",vleft-ovExtentBoxSize,vtop-ovExtentBoxSize,vleft,vbottom);
- showOVLayer("zoomOVBoxLeft");
- } else {
- hideOVLayer("zoomOVBoxLeft");
- }
- if (eRight>fullOVLeft) {
- clipOVLayer("zoomOVBoxRight",vright,vtop-ovExtentBoxSize,vright+ovExtentBoxSize,vbottom);
- showOVLayer("zoomOVBoxRight");
- } else {
- hideOVLayer("zoomOVBoxRight");
- }
- if (eBottom<fullOVTop) {
- clipOVLayer("zoomOVBoxBottom",vleft,vbottom-ovExtentBoxSize,vright+1,vbottom);
- showOVLayer("zoomOVBoxBottom");
- } else {
- hideOVLayer("zoomOVBoxBottom");
- }
- }
- function boxIt(theLeft,theTop,theRight,theBottom) {
- //if (!isNav4) {
- theTop = theTop + vspc;
- theBottom = theBottom + vspc;
- theLeft = theLeft + hspc;
- theRight = theRight + hspc;
- //}
- clipLayer("zoomBoxTop",theLeft,theTop,theRight,theTop+ovBoxSize);
- clipLayer("zoomBoxLeft",theLeft,theTop,theLeft+ovBoxSize,theBottom);
- clipLayer("zoomBoxRight",theRight-ovBoxSize,theTop,theRight,theBottom);
- clipLayer("zoomBoxBottom",theLeft,theBottom-ovBoxSize,theRight,theBottom);
- showLayer("zoomBoxTop");
- showLayer("zoomBoxLeft");
- showLayer("zoomBoxRight");
- showLayer("zoomBoxBottom");
- }