English

How To: Zoom to a selected feature in the attribute table returned by the Buffer tool

Summary

In the HTML Viewer, attributes retrieved from a target layer as the result of a buffer operation are displayed in the TextFrame, below the Map. By default, the attributes are displayed in an HTML table as simple text.

Procedure

To enable the ability to zoom to a feature by selecting a row of data in the attribute table, do the following:

  1. In aimsBuffer.js file, within the writeEnvelopeBufferXML function:

    Change the following line from:

    Code:
    var theString = '<ARCXML version="1.1">\n<REQUEST>\n<GET_FEATURES outputmode="xml"
    envelope="false" geometry="false" checkesc ="true"';


    -to-

    Code:
    var theString = '<ARCXML version="1.1">\n<REQUEST>\n<GET_FEATURES outputmode="xml"
    envelope="true" geometry="false" checkesc ="true"';


    Changing the envelope attribute to true will enable the FEATURES response to contain the envelope of each feature in the target layer. This envelope will be used when zooming to the feature.
  2. In the aimsIdentify.js file, within the writeOutDataPage function:

    Change the following line from:

    Code:
    if ((toolMode!=4) && (toolMode!=25) && (toolMode!=5)) {


    -to-

    Code:
    if ((toolMode!=4) && (toolMode!=5)) {


    The toolMode for the buffer tool is 25. This "if" statement contains code which is necessary to store the envelope values for each feature returned from the target layer. To ensure that this code is available, we should remove the reference to the active tool.
  3. Also in the aimsIdentify.js file, within the writeOutDataPage function:

    Note:
    Some versions of the HTML Viewer may not contain the envExists variable. Check the aimsIdentify.js file for this variable before including it in the code below.


    Change the following lines from:

    Code:
    if ((toolMode!=4) && (toolMode!=5) && (toolMode!=25) && (envExists) ) dataString += '<a
    href="javascript:' + docName + '.showHighlight(' + selectCount + ')">';
    dataString += '' + (recNum);
    if ((toolMode!=4) && (toolMode!=5) && (toolMode!=25) && (envExists) ) dataString += '</a>';


    -to-

    Code:
    if ((toolMode!=4) && (toolMode!=5) && (envExists) ) dataString += '<a
    href="javascript:' + docName + '.showHighlight(' + selectCount + ')">';
    dataString += '' + (recNum);
    if ((toolMode!=4) && (toolMode!=5) && (envExists) ) dataString += '</a>';


    Again, removing the reference to a toolMode of 25 will enable the code to create the HTML hyperlink necessary to initiate the zoom process to the selected record.