English

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

Question

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

Answer

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:

Code:
if (ActiveLayerIndex>=layerCount) ActiveLayerIndex = 0;

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

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


Note:
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.

Related Information