PROBLEM

Unable to highlight the features selected in an ArcMap Service layer by passing the query parameters in an HTML Viewer's URL

Last Published: April 25, 2020

Description

It is possible to define query parameters in an HTML Viewer's URL to select and zoom to predefined features at the initialization of the HTML Viewer.

When setting up an image service using the cities shapefile located in the ArcIMS Tutorial Data directory, the following URL zooms to and highlights Paris.

Code:
http://zephyr/website/cities/viewer.htm?ActiveLayer=0&Query=CITY_NAME%3D%27Paris%27&QueryZoom=Yes

When such query parameters are defined for an ArcMap Service layer, HTML Viewer zooms to the selected features but does not highlight the features.
With an Image Service, HTML Viewer selects and highlights the features as expected.

Cause

By default, the HTML Viewer code highlights the features only for Image Service.

Note:
When highlighting is enabled, the scenario where this fails is when the shapefile contains several features that are selected and one of the features has been clicked on to 'zoom to feature'. In Image server that feature is highlighted in red, but this does not occur for ArcMap server.

Solution or Workaround

To test, set up an ArcMap service using the cities shapefile and create an HTML Web site.

Modify the aimsSelect.js file located at <DRIVE>/ArcIMS/website/<website_name>/Javascript folder.
  1. Open aimsSelect.js file in a text editor and locate:

    Code:

    if (!isArcMapService) {

  2. Comment out the opening 'if' statement and the closing 'curly bracket' as shown below:

    Code:
    //commenting out opening if statement

    //if (!isArcMapService) {
    if (highlightedOne!="") {
    // add Draw Highlighed Feature to Map XML request
    selString +='<LAYER type="featureclass" name="' + titleList[23] + '" visible="true">';
    //selString +='<DATASET fromlayer="' + ActiveLayer + '" />';
    selString +='<DATASET fromlayer="' + LayerID[ActiveLayerIndex] + '" />';
    selString +='<QUERY where="' + highlightedOne + '" />';
    selString +='<SIMPLERENDERER>';

    if (selectType=="point") {
    selString +='<SIMPLEMARKERSYMBOL color="' + highlightColor + '" type="Circle" width="10" />';
    } else if (selectType=="line") {
    selString +='<SIMPLELINESYMBOL type="SOLID" color="' + highlightColor + '" width="3" />';
    } else {
    //selString +='<SIMPLEPOLYGONSYMBOL FILLCOLOR="' + highlightColor + '" FILLTYPE="Gray" ';
    selString +='<SIMPLEPOLYGONSYMBOL fillcolor="' + highlightColor + '" filltype="solid" transparency="' + forceComma(transparentLevel) + '" boundarycolor="255,255,255" />';
    }
    selString +='</SIMPLERENDERER>';
    selString +='</LAYER>';
    //alert(selString);
    }

    //commenting out closing bracket

    //}
    }
    return selString;
    }

  3. Save the file.

    Open the Web site and test the URL. Paris is now highlighted.

Article ID:000007616

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