⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aimsclick.js

📁 最基本的IMS功能可以调试
💻 JS
📖 第 1 页 / 共 2 页
字号:
		// interactive shape buffer - not implemented
		if (canQuery) {
			toolMode = 17;
			//toolMode = 16;
			shapeSelectBuffer = true;
			setCursor("theTop", "crosshair");
			hideLayer("measureBox");
			if (useTextFrame) {
				parent.TextFrame.document.location= appDir + "shapeBuffer.htm";
			} else {
				Win1 = open("shapeBuffer.htm","QueryWindow","width=575,height=150,scrollbars=yes,resizable=yes");
			}
			modeBlurb = modeList[11];
		} else {
			alert(msgList[46]);
		}
		//alert("Function Not Implemented");
		showGeocode=false;
		showBuffer=false;
		break;
		//*/
	// Geocode Function
	case "geocode":
		panning=false;
		zooming=false;
		selectBox=false;
		shapeSelectBuffer = false;
		// geocode mode - requires aimsGeocode.js
		hideLayer("measureBox");
		modeBlurb = modeList[14];
		geocodeAppMode = "locate";
		setupGeocode();
		//parent.TextFrame.document.location= appDir + "addmatch.htm";
		break;

	// Query - Search - Find functions
	//if ((toolName=="attributesel") || (toolName=="query")) {
	case "query":
		// query mode - requires aimsQuery.js
		panning=false;
		zooming=false;
		selectBox=false;
		shapeSelectBuffer = false;
		queryStartRecord=1;
		//toolMode=
		if (canQuery) {	
			LayerFields.length=1;
			LayerFieldType.length=1;
			LayerFieldCount=0;
			toolMode=8;
			modeBlurb=modeList[15];
			
			fieldIndex=0;
			setQueryString="";
			hideLayer("measureBox");
			queryForm();
		} else {
			alert(msgList[46]);
		}
		showGeocode=false;
		showBuffer=false;
		break;
		
	case "storedquery":
		// storedquery mode - requires aimsQuery.js
		panning=false;
		zooming=false;
		selectBox=false;
		shapeSelectBuffer = false;
		queryStartRecord=1;
		toolMode=51;
		modeBlurb="Search";
		if (canQuery) {	
			toolMode=51;
			modeBlurb=modeList[16];
			fieldIndex=0;
			setQueryString="";
			hideLayer("measureBox");
			getStoredQueries();
		} else {
			alert(msgList[46]);
		}
		showGeocode=false;
		showBuffer=false;
		break;
		
	case "find":
		//find
		toolMode=9;
		panning=false;
		zooming=false;
		selectBox=false;
		shapeSelectBuffer = false;
		queryStartRecord=1;
		if (canQuery) {	
			LayerFields.length=1;
			LayerFieldType.length=1;
			LayerFieldCount=0;
			
			fieldIndex=0;
			setQueryString="";
			hideLayer("measureBox");
			modeBlurb = modeList[17];
			findForm();
		} else {
			alert(msgList[46]);
		}
		showGeocode=false;
		showBuffer=false;
		break;
		
	case "clearsel":
		 clearSelection();
		 break;
		 
	// Buffer function
	case "buffer":
		//buffer - requires aimsBuffer.js
		if (useBuffer) {
			if (checkSelected()) {
				toolMode = 25;
				shapeSelectBuffer = false;
				modeBlurb = modeList[18];
				writeBufferForm();	
			} else {
				showBuffer=false;
				alert(msgList[48]);
			}
		} else {
			alert(msgList[49]);
		}
		break;
		
	case "options":
		writeOptionForm();
		break;
		
	// Print function	
	case "print":
		 printIt();
		 break;
		 
	// custom modes
	case "dbidentify":
		panning=false;
		zooming=false;
		selectBox=false;
		shapeSelectBuffer = false;
		// identify mode - requires custom db query - not in basic
		if (canQuery) {
			toolMode = 40;
			setCursor("theTop", "hand");

			modeBlurb = modeList[3];
		} else {
			alert(msgList[46]);
		}
		//alert("Function Not Implemented");
		
		showGeocode=false;
		if (useTextFrame) parent.TextFrame.document.location= appDir + "text.htm";
		hideLayer("measureBox");
		break;
		
		
	case "extract":
		 extractIt();
		 break;
		 
	case "legend":
		if (aimsLegendPresent) {
			if (imsURL!="") {
				if (hasTOC) {
					if (legendVisible) {
					
						legendVisible=false;
					//writeLayerList();
						parent.TOCFrame.document.location=appDir+"toc.htm";
					} else {
						legendVisible=true;
						getLegend();
					}
				} else {
					legendVisible=true;
					getLegend();
				}
			} else {
				alert(msgList[45]);
			}
		} else {
			alert(msgList[50]);
		}
		break;
		
	case "layerlist":
		// put LayerList in separate window
		writeLayerListForm();
		break;
		
	case "address":
		panning=false;
		zooming=false;
		selectBox=false;
		shapeSelectBuffer = false;
		// geocode mode - requires aimsGeocode.js
		hideLayer("measureBox");
		modeBlurb = modeList[21];
		geocodeAppMode = "address";
		setCursor("theTop", "hand");
		toolMode = 7;
		//parent.TextFrame.document.location= appDir + "addmatch.htm";
		break;
	case "route":
		// route requires aimsRoute.js and RouteServer extension
		panning=false;
		zooming=false;
		selectBox=false;
		shapeSelectBuffer = false;
		// geocode mode - requires aimsGeocode.js
		hideLayer("measureBox");
		modeBlurb = modeList[21];
		geocodeAppMode = "route";
		setCursor("theTop", "hand");
		toolMode = 6;
		setupGeocode();

		break;
		
	default:
		alert(msgList[51]);
	}
	modeName=modeBlurb;
	if (useModeFrame) {
		writeModeFrame(modeBlurb);
	} else if ((drawFloatingMode) && (modeLayerOn)) {
		writeModeLayers(modeBlurb);
	} else if ((modeRefreshMap) && (drawModeOnMap)) {
		//var theString = writeXML();
		sendMapXML();
	}
}

// check for mouseup
function chkMouseUp(e) { 
	if ((toolMode == 1) && (zooming)) {
			stopZoomBox(e);
		
	}
	if ((toolMode == 2) && (zooming)) {
			stopZoomOutBox(e);
	}
	if ((toolMode == 3) && (panning)) {
			stopPan(e);

	}
	if ((toolMode == 10) && (selectBox)) {
			stopSelectBox(e);
	}
		
	return false;
	
}

// perform appropriate action with mapTool
function mapTool (e) {
	var theButton= 0;
	// get the button pushed... if right, ignore... let browser do the popup... it will anyway
	if (isNav) {
		theButton = e.which;
	} else {
		theButton =window.event.button;
	}	
	if (theButton==leftButton) {
		getImageXY(e);
		if ((mouseX>=0) && (mouseX<iWidth) && (mouseY>=0) && (mouseY<iHeight)) {
			//if ((!isNav) || (!is5up)) {
			if ((hasOVMap) && (ovIsVisible) && (mouseX<i2Width+ovBoxSize) && (mouseY<i2Height) && (ovMapIsLayer)) {
					//alert(mouseX + ", " + mouseY);
					ovMapClick(mouseX,mouseY);
					
					window.status = "On OV Map Area";
				//}
			} else {
				//alert(mouseX + "," + mouseY);
				
				switch(toolMode) {
				case 1:
						startZoomBox(e);
						return false;
						break;
					
				case 2:
						startZoomOutBox(e);
						return false;
						break;
				case 3:
						startPan(e);
						return false;
						break;

				case 4:
					identify(e);
					break;
					
				case 5:
					// identify all
					identifyAll(e);
					break;
					
				// custom modes
				///*
				case 6:
					// route - requires custom route routine - not in default
						// requires aimsRoute.js, aimsGeocode.js
					//routeClick = routeClick + 1;
					//if (routeClick > 2) routeClick = 2;
					//setRouteXY()
					//writeRoutePage();
					address(e);
					break;
				//*/
				case 7:
					// address - requires custom reverseGeocode routine - not in default
						// requires aimsRoute.js, aimsGeocode.js
					address(e);
					break;
				//*/
				case 10:
					//select(e);
						startSelectBox(e);
						return false;
						break;
				case 11:
					//select point
					if (checkIfActiveLayerAvailable()) {
						select(e);
					}
					break;
				case 12:
					//select line
					if (checkIfActiveLayerAvailable()) {
						clickType=2;
						clickAddPoint();
						if (useTextFrame) {
							if (parent.TextFrame.document.title!==modeList[60]) {
								parent.TextFrame.document.location= appDir + "selectline.htm";
							}
						}
					}
					break;
				case 13:
					//select polygon
					if (checkIfActiveLayerAvailable()) {
						clickType=3;
						clickAddPoint();
						if (useTextFrame) {
							if (parent.TextFrame.document.title!==modeList[7]) {
								parent.TextFrame.document.location= appDir + "selectpoly.htm";
							}
						}
					}
					break;
				case 15:
					// hyperlink
					hyperLink(e);
					break;
				case 16:
					//select shape
					if (checkIfActiveLayerAvailable()) {
						clickType=2;
						clickAddPoint();
						if (useTextFrame) {
							if (parent.TextFrame.document.title!==modeList[8]) {
								parent.TextFrame.document.location= appDir + "select.htm";
							}
						}
					}
					break;
					///* 
				case 17:
					//buffer shape - 
					if (checkIfActiveLayerAvailable()) {
						clickType=2;
						clickAddPoint();
						if (useTextFrame) {
							if (parent.TextFrame.document.title!=modeList[11]) {
								parent.TextFrame.document.location= appDir + "shapeBuffer.htm";
							}
						}
					}
					break;
					//*/
				case 20:
					// measure
					clickType=1;
					clickAddPoint();
					break;
				case 21:
					// shape
					clickType=4;
					clickAddPoint();
					break;
				case 30:
					// hyperlink
					hyperLinkAny(e);
					break;
				case 40:
					// db identify - requires custom db query - not in default
					if (aimsDBPresent) {
						matchDBLinkLayer(dbLinkLayer);
						dbIdentify(e);
					}
					break;
				default:
					if (toolMode>=1000) {
						customMapTool(e);
					}
				}
			}
		}
	}
}

// update measureBox layer
function updateMeasureBox() {
	if (isNav4) {
		var theForm = document.layers["measureBox"].document.forms[0];
	} else {
		//var theForm = document.measureBox.forms[0];
		var theForm = document.forms[0];
	}
	var j = 1;
	for (var i=0;i<sUnitList.length;i++) {
		if (ScaleBarUnits==sUnitList[i]) j=i;
	}
		var u = Math.pow(10,numDecimals);
		var tMeas = 0;
		if (totalMeasure!=0) tMeas = parseInt(totalMeasure*u+0.5)/u;
	theForm.theMeasTotal.value = tMeas + " " + unitList[j];
	theForm.theMeasSegment.value = currentMeasure + " " + unitList[j];
	showLayer("measureBox");

}

// set the cursor of the specified layer
function setCursor(divLayer, cursor) {
	var dObj = getLayer(divLayer);
	if (dObj!=null) {
		dObj.cursor = cursor;
		theCursor = dObj.cursor;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -