HOW TO

Identify features from selected layers only, when using the IdentifyAll tool in HTML Viewer

Last Published: April 25, 2020

Summary

Instructions provided describe how to identify features from selected layers only, when using the IdentifyAll tool in HTML Viewer. The IdentifyAll or 'drill-down' tool returns the features from all visible layers in HTML Viewer. Instructions provided explain how the HTML Viewer code can be modified to identify features from the selected layers only.

Procedure

This article requires the change of the ArcIMSParam.js file located at <drive>/ArcIMS/Website/<Website_Name> folder and aimsIdentify.js file located at <drive>/ArcIMS/Website/<Website_Name>/Javascript folder.

  1. Open the Map Configuration file, also known as an AXL file, used to create the service used by the HTML Viewer. Note the ID values for those layers that need to be identified.
  2. Open the ArcIMSParam.js file in a text editor and make the following changes:
    A. Locate this line:

    Code:

    var useIdentify=true;

    Change it to:

    Code:

    var useIdentify=false;

    B. Locate this line:

    Code:

    var useIdentifyAll=false;

    Change it to:

    Code:

    var useIdentifyAll=true;

  3. Open the aimsIdentify.js file in a text editor and make the following changes:
    A. Locate this line:

    Code:

    aimsIdentifyPresent=true;

    Add the following new variable after this line. In this variable, specify the ids that were obtained in step 1 separated by comma.

    Code:

    var idLayers = "0,1";

    B. Locate the identifyAll function and change the following code:

    Code:

    for (var i=(LayerID.length-1);i>=0;i--) {
    replyArray[i]="";
    if ((mapScaleFactor>=LayerMinScale[i]) && (mapScaleFactor<=LayerMaxScale[i]) && (LayerVisible[i]) && (LayerIsFeature[i])) j = i;

    }

    to

    Code:

    for (var i=(LayerID.length-1);i>=0;i--) {
    replyArray[i]="";
    var idLayer = idLayers.split(",");
    var isLayerId = false;
    for (var xx = 0; xx<idLayer.length; xx++){
    if (LayerID[i]==idLayer[xx]) isLayerId = true;
    }
    if (isLayerId){
    if ((mapScaleFactor>=LayerMinScale[i]) && (mapScaleFactor<=LayerMaxScale[i]) && (LayerVisible[i]) && (LayerIsFeature[i])) j = i;
    }
    }

    C. Locate the doIdentifyAll function and change the following code:

    Code:

    if (fID < (LayerID.length)) {
    if ((mapScaleFactor>=LayerMinScale[fID]) && (mapScaleFactor<=LayerMaxScale[fID]) && (LayerVisible[fID]) && (LayerIsFeature[fID])) {
    theString = writeGetFeaturesDrill(idWest,idSouth,idEast,idNorth,fID);
    //alert(theString);
    sendToServer(imsQueryURL,theString,10);
    } else {
    doIdentifyAll("");
    }
    }

    to

    Code:

    if (fID < (LayerID.length)) {
    var idLayer = idLayers.split(",");
    var isLayerId = false;
    for (var xx = 0; xx<idLayer.length; xx++){
    if (LayerID[fID]==idLayer[xx] && LayerVisible[fID]) isLayerId = true;
    }
    if (isLayerId){
    if ((mapScaleFactor>=LayerMinScale[fID]) && (mapScaleFactor<=LayerMaxScale[fID]) && (LayerVisible[fID]) && (LayerIsFeature[fID])) {
    theString = writeGetFeaturesDrill(idWest,idSouth,idEast,idNorth,fID);
    //alert(theString);
    sendToServer(imsQueryURL,theString,10);

    }
    } else {
    doIdentifyAll("");
    }
    }

    For example, this Web site has three layers: highways, artgalleries and zipcode. The Web site is set to only identify the artgalleries and zipcode.
    [O-Image] Identify

Article ID:000006948

Software:
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic