📄 aimsxml.js
字号:
/*
case 12:
// get proximity response
processProx(theReply);
break
case 13:
// get route response
processRoute(theReply);
break
*/
case 14:
// get find response
//alert(theReply);
displayAttributeData(theReply);
break
case 15:
// get hyperlink response
parseHyperLink(theReply);
break
case 16:
// get hyperlinkAny response
parseHyperLinkAny(theReply);
break
case 20:
// process startup query
parseStartQuery(theReply);
break
case 25:
// get geocoding layers
parseGeocodeLayers(theReply);
// get layers for display
var theString = '<ARCXML version="1.1">\n<REQUEST>\n<GET_SERVICE_INFO renderer="false" extensions="true" />\n';
theString += '</REQUEST>\n</ARCXML>';
sendToServer(imsURL,theString,4);
break
case 26:
// get geocoding layers
if (parseGeocodeParams(theReply,GCLayers[GCActiveLayer])) {
var theAddressForm = appDir + "addmatch.htm";
if ((useExternalWindow) || (!useTextFrame)) {
var Win1 = window.open(theAddressForm,"GeocodeWindow","width=575,height=150,scrollbars=yes,resizable=yes");
} else {
parent.TextFrame.document.location= theAddressForm;
}
} else {
if (debugOn>0) {
alert(msgList[17] + "\n" + theReply);
if (parent.TextFrame!=null) parent.TextFrame.document.location= appDir + "blank.htm";
} else {
alert(msgList[17]);
if (parent.TextFrame!=null) parent.TextFrame.document.location= appDir + "blank.htm";
}
}
break
case 27:
// get geocoding results
parseGeocodeResults(theReply);
break
case 40:
// get list of sample field values
parseFieldSamples(theReply);
writeQueryForm();
break
case 55:
// get layer storedqueries
//alert("55\n" + theReply);
parseStoredQueries(theReply);
break
case 70:
// get layer field for submission to external db
parseIDFieldData(theReply);
break
case 98:
// just put up a map with legend
var theURL = "";
theURL = getURL(theReply);
if (theURL != "") {
document.theImage.src = theURL;
}
//else {
// alert(theReply + "\nUnable to display Map image");
//}
if (legendVisible) {
showLegend();
drawLegendOnly=false;
}
hideRetrieveMap();
break
case 99:
// just put up a map
var theURL = "";
legendVisible=legendTemp;
theURL = getURL(theReply);
if (theURL != "") {
document.theImage.src = theURL;
}
else {
alert(msgList[14] + theReply);
}
hideRetrieveMap();
break
case 101:
// print - get Map image
printMapURL = getURL(theReply);
printLegURL = getLegendURL(theReply);
if (hasOVMap) {
getPrintOV();
} else {
//writePrintPage();
getPrintLegend();
}
break
case 102:
// print - get OV image
printOVURL = getURL(theReply);
legendImage = printLegURL
getPrintLegend();
break
case 103:
// print - get Legend image
hideRetrieveMap();
writePrintPage();
break
case 900:
// just make a map
var theURL = "";
theURL = getURL(theReply);
if (theURL != "") {
getXYs(theReply);
document.theImage.src = theURL;
}
break
case 902:
// just put up an overview map
var theURL = "";
theURL = getURL(theReply);
//alert(theURL);
if (theURL != "") {
document.ovImage2.src = theURL;
}
var tempLeft = fullLeft;
var tempRight = fullRight;
var tempTop = fullTop;
var tempBottom = fullBottom;
getOVXYs(theReply);
fullLeft = tempLeft;
fullRight = tempRight;
fullTop = tempTop;
fullBottom = tempBottom;
break
case 998:
// receive serviceinfo for overview map to check decimal delimiter
var tempLeft = limitLeft;
var tempRight = limitRight;
var tempTop = limitTop;
var tempBottom = limitBottom;
getOVXYs(theReply);
limitLeft = tempLeft;
limitRight = tempRight;
limitTop = tempTop;
limitBottom = tempBottom;
var theString = '<ARCXML version="1.1">\n<REQUEST>\n<GET_SERVICE_INFO renderer="false" extensions="false" fields="false" />\n';
theString = theString + '</REQUEST>\n</ARCXML>';
sendToServer(imsURL,theString,3);
break
case 999:
// get a blank map to get modified limit extents according image proportions
var tempLeft = eLeft;
var tempRight = eRight;
var tempTop = eTop;
var tempBottom = eBottom;
getXYs(theReply);
imageLimitLeft=eLeft;
imageLimitRight=eRight;
imageLimitTop=eTop
imageLimitBottom=eBottom;
eLeft = tempLeft;
eRight = tempRight;
eTop = tempTop;
eBottom = tempBottom;
if ((aimsQueryPresent) && (highlightedOne!="") && (queryZoom)) {
setStartQuery();
} else {
sendMapXML();
}
break
default:
// send any responses to custom requests off to the custom handler
// XMLMode >= 1000 are reserved for custom requests/responses
if (XMLMode >= 1000) {
useCustomFunction(theReply);
} else {
alert(theReply + msgList[19]);
}
}
//}
}
// write out a blank map. . . to get image extents from limit extents
function writeBlankMapXML() {
var theString = '<ARCXML version="1.1">\n<REQUEST>\n<GET_IMAGE>\n<PROPERTIES>\n<ENVELOPE minx="' + forceComma(limitLeft) + '" miny="' + forceComma(limitBottom) + '" maxx="' + forceComma(limitRight) + '" maxy="' + forceComma(limitTop) + '" />\n';
theString += '<IMAGESIZE height="' + iHeight + '" width="' + iWidth + '" />\n';
var visString = "";
// tell the server which layers are to be visible
if (aimsLayersPresent) {
theString += '<LAYERLIST >\n';
for (var i=0;i<layerCount;i++) {
theString += '<LAYERDEF name="' + LayerName[i] + '" visible="false" />\n';
}
theString += '</LAYERLIST>\n';
}
theString += '</PROPERTIES>\n';
theString += '</GET_IMAGE>\n</REQUEST>\n</ARCXML>';
//alert(theString);
sendToServer(imsURL,theString,999);
}
// prepare the request in xml format for Main Map
function writeXML() {
var theString = '<ARCXML version="1.1">\n<REQUEST>\n<GET_IMAGE>\n<PROPERTIES>\n<ENVELOPE minx="' + forceComma(eLeft) + '" miny="' + forceComma(eBottom) + '" maxx="' + forceComma(eRight) + '" maxy="' + forceComma(eTop) + '" />\n';
theString += '<IMAGESIZE height="' + iHeight + '" width="' + iWidth + '" />\n';
var visString = "";
if (aimsLayersPresent) {
// tell the server which layers are to be visible
if (toggleVisible) {
theString += '<LAYERLIST >\n';
for (var i=0;i<layerCount;i++) {
if (LayerVisible[i]==1) {
theString += '<LAYERDEF id="' + LayerID[i] + '" visible="true" ';
if (aimsClassRenderPresent) {
theString += addSpecialRenderToMap(i);
} else {
theString += '/>\n';
}
}
else {
theString += '<LAYERDEF id="' + LayerID[i] + '" visible="false" />\n';
}
}
theString += '</LAYERLIST>\n';
}
}
// map background color
if (mapTransparent) {
theString += '<BACKGROUND color="255,255,254" transcolor="255,255,254" />\n';
} else {
if (mapBackColor!="") {
theString += '<BACKGROUND color="' + mapBackColor + '" />\n\n';
}
}
if (aimsLegendPresent) {
// create a legend image
if (legendVisible) theString += addLegendToMap();
}
theString += '</PROPERTIES>\n';
// buffer
if (aimsBufferPresent) {
if (showBuffer) theString += addBufferToMap();
}
// select
if (aimsSelectPresent) {
theString += addSelectToMap();
}
// any custom stuff to fit here
if (aimsCustomPresent) theString += addCustomToMap1();
if (aimsClickPresent){
// clickpoints
if (clickCount>0) {
// draw click points and lines between them on map
var clickColor = selectColor;
if (clickType==1) clickColor = clickMarkerColor;
theString += '<LAYER type="acetate" name="allTheClicks">\n';
if (clickCount>1) {
theString += '<OBJECT units="database">\n<LINE coords="' + forceComma(clickPointX[0]) + coordsDelimiter + forceComma(clickPointY[0]);
for (var i=1;i<clickCount;i++) {
theString += pairsDelimiter + forceComma(clickPointX[i]) + coordsDelimiter + forceComma(clickPointY[i]);
}
theString += '" >\n';
theString += '<SIMPLELINESYMBOL type="solid" color="' + clickMarkerColor;
theString += '" width="3" />\n</LINE>\n</OBJECT>\n';
theString += '<OBJECT units="database">\n<LINE coords="' + forceComma(clickPointX[0]) + coordsDelimiter + forceComma(clickPointY[0]);
for (var i=1;i<clickCount;i++) {
theString += pairsDelimiter + forceComma(clickPointX[i]) + coordsDelimiter + forceComma(clickPointY[i]);
}
theString += '" >\n';
theString += '<SIMPLELINESYMBOL type="solid" color="255,255,255" width="1" />\n</LINE>\n</OBJECT>\n';
// MeasureArea
// Draw a dashed line showing the "snap shut" area feature.
theString += '<OBJECT units="database">\n<LINE coords="' + forceComma(clickPointX[0]) + coordsDelimiter + forceComma(clickPointY[0]);
var i = clickCount - 1;
theString += pairsDelimiter + forceComma(clickPointX[i]) + coordsDelimiter + forceComma(clickPointY[i]);
theString += '" >\n';
theString += '<SIMPLELINESYMBOL type="dash" color="' + clickMarkerColor + '" width="2" />\n</LINE>\n</OBJECT>\n';
// end MeasureArea
}
for (var i=0;i<clickCount;i++) {
theString += '<OBJECT units="acetate">\n<POINT coords="' + forceComma(clickPointX[i]) + coordsDelimiter + forceComma(clickPointY[i]) + '">\n';
theString += '<SIMPLEMARKERSYMBOL type="' + clickMarkerType + '"';
theString += ' color="' + clickMarkerColor + '" width="' + clickMarkerSize + '" />\n</POINT>\n</OBJECT>\n';
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -