English

How To: Prevent layer names from being displayed in an HTML Viewer's TOC

Summary

The HTML Viewer can be easily customized to not display certain layer names in the Table of Contents (TOC).

Note:
For information on how to achieve these results in an ArcIMS 3.1, 4.0, or 4.0.1 HTML Viewer, see the Customizing HTML Viewer documentation. A custom install must be done to load this PDF file.

Procedure

  1. Load the site's toc.htm file in a text editor.

  2. Find the following string:

    Code:
    for (var i=0;i<theCount;i++) {

    Note the lengthy if statement below this string.

  3. Type the following line below the if statement:

    Code:
    if (t.LayerName[i] != "<layer name>") {

    Where <layer name> is the layer you do not want displayed in the TOC.

    Note:
    This line determines whether the layer name gets written or not.

  4. Locate the following line of code below the code you just typed:

    Code:
    //alert(parent.MapFrame.LayerName[i]);

    Type a closing parenthesis to end the if statement you typed in Step 3.

  5. Save your edits.

  6. Clear your Web browser's cache.

  7. Reload the page to test.