PROBLEM

Group and annotation layers do not turn on and off correctly when using the HTML Viewer in ArcIMS 9.2

Last Published: April 25, 2020

Description

When using an ArcMap Image Service in the HTML Viewer in ArcIMS 9.2 that includes group layers, annotation layers, or a combination of the two, there are problems turning layers on and off in the TOC.

Note:
This is not an issue when using earlier versions of ArcIMS.

Cause

At ArcIMS 9.2, two new attributes were added to LAYERINFO in the SERVICEINFO response for ArcMap Image Services: arcmaptype and parentlayerid. The attribute descriptions are:

· arcmaptype: Returned for ArcMap Image Services when a layer is a group layer, annotation layer, or multipatch layer.

· parentlayerid: Returned for ArcMap Image Services for each layer that belongs to a group in LAYERINFO. This includes annotation layers. Group layers can be nested.

The purpose of these attributes is to allow custom applications to differentiate between regular data layers and annotation, group, and multipatch layers.

When the HTML Viewer is parsing the SERVICEINFO response, it looks for the layer 'id'. In the case where 'parentlayerid' is included in the response, the attribute value for 'parentlayerid' is used instead of 'id'. This leads to the incorrect behavior in the TOC.

Solution or Workaround



  1. Open the file aimsLayers.js in the HTML Viewer’s javascript directory.
  2. Find the following lines of code:

    Code:
    startpos = theReplyUC.indexOf("ID=",lpos);
    if ((startpos != -1) && (startpos<zpos)) {
    startpos = startpos + 4;

  3. Replace above code with the following:

    Code:
    startpos = theReplyUC.indexOf(" ID=",lpos);
    if ((startpos != -1) && (startpos<zpos)) {
    startpos = startpos + 5;


    Note:
    The code changes include a space before "ID=" to " ID=" and startpos incremented from 4 to 5

Article ID:000009276

Software:
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic