English

How To: Hide layers in the HTML Viewer TOC

Summary

Data layers can be hidden in the Table of Contents (TOC) for the HTML Viewer by editing two files in the HTML Viewer web site.

Note: This document applies to ArcIMS 3.0 only. For versions released after 3.0, see the Customizing HTML Viewer pdf, included with the ArcIMS product.

Procedure

  1. Open the ArcIMSParams.js file in a text editor such as WordPad. This file is created by ArcIMS Designer and placed in the HTML directory of the Map web pages.
  2. Use JavaScript to create a new array object and add to it the layers you want to hide. An easy way to accomplish this is using the layer name. For example:

    Code:
    var hideArray = new Array();
    hideArray[0] = "STATES";
    hideArray[1] = "canada";

  3. Save and close the ArcIMSParams.js file.
  4. Open the toc.htm file in a text editor. This file is also created by ArcIMS Designer and placed in the HTML directory of the Map web pages. Look for line 186; it should have the following code, assuming the file has not been edited:

    Code:
    var theCount = t.layerCount;
    //alert(theCount);
    for (var i=0;i<theCount;i++) {
    if ((t.listAllLayers) || ((t.mapScaleFactor>=t.LayerMinScale[i]) && (t.mapScaleFactor<=t.LayerMaxScale[i])))

  5. Change the code to evaluate the array of hidden layers and remove them from the TOC. For example:

    Code:
    var theCount = t.layerCount;
    var hideStr = t.hideArray.join();
    for (var i=0;i<theCount;i++) {
    if ((t.listAllLayers) || ((t.mapScaleFactor>=t.LayerMinScale[i]) && (t.mapScaleFactor<=t.LayerMaxScale[i]) && (hideStr.search(t.LayerName[i]) == -1)))

  6. Save and close the toc.htm file.
  7. The HTML Viewer web site will need to be refreshed before the changes will take effect. In Internet Explorer, press Ctrl-F5. In Netscape, click the Reload button.