Frequently asked question

How can I set a different active layer when the HTML Viewer is loaded?


By default, the topmost feature layer is set as the active layer when HTML Viewer is loaded. This initial active layer can be modified in two ways:

1. Editing the HTML Viewer code as follows:

A. Open aimsLayers.js file from ArcIMS/website/<website_name>/javascript folder in a text editor and locate the following line:

if (ActiveLayerIndex>=layerCount) ActiveLayerIndex = 0;

B. Set the desired ActiveLayer immediately before this line by adding the line shown below:

ActiveLayerIndex=<number of the preferred active layer>;
if (ActiveLayerIndex>=layerCount) ActiveLayerIndex = 0;

The ActiveLayerIndex starts with '0' for the topmost layer and its value increases in top to bottom order. So for the third layer to be active, insert the number 2.

2. Passing the ActiveLayer as an URL parameter. See the article in the Related Information section below for more information.

Article ID:000006803

  • 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