HOW TO
When using the buffer tool in the HTML Viewer, the extent of the resulting map will be the same as its previous extent. Instructions provided describe how to change the extent of the resulting map to the selected features.
Note:
The edited files are available for download in the Related Section below. Use these files in the Web site and skip the steps given below, if desired.
Code:
// buffer around selected features
function bufferIt() {
hideLayer("measureBox");
//alert("Function not yet enabled.");
showBuffer=true;
/* code changed to zoom to the buffer results
*
*/
// sendMapXML();
var buffString1 = writeGetBufferedData();
if (buffString1!="") {
sendToServer(imsQueryURL,buffString1,1001);
} else {
alert(msgList[15]);
}
//end new code
}
Code:
var theString = '<ARCXML version="1.1">\n<REQUEST>\n<GET_FEATURES globalenvelope="true"
outputmode="xml" envelope="false" geometry="false" checkesc ="true"';
Note:
The above changes must be made in three places in this file.
Code:
function processXML(theReplyIn) {
Code:
if (aimsBufferPresent) {
Code:
/* if (aimsBufferPresent) {
if (getBufferedData) {
var buffString = writeGetBufferedData();
if (buffString!="") {
sendToServer(imsQueryURL,buffString,11);
} else {
alert(msgList[15]);
}
getBufferedData=false;
}
} */
Code:
function useCustomFunction(theReply) {
if (XMLMode==1001) {
// insert code here
/* new code inserted here for zoom to buffer result
*
*/
if (getBufferedData) {
getBufferAttributeData(theReply);
}
var theXYs = getEnvelopeXYs(theReply, 0);
if (theXYs.length>0){
eLeft = theXYs[0];
eBottom = theXYs[1];
eRight = theXYs[2];
eTop = theXYs[3];
sendMapXML();
}
else alert("No features found");
//end of added code
} else if (XMLMode==1002) {
// insert code here
} else {
alert(msgList[55] + XMLMode + msgList[56]);
}
hideLayer("LoadData");
}
Article ID:000006339
Get help from ArcGIS experts
Download the Esri Support App