Moxi Media Inc.
<layer-manager> Discussion Forum
IMF Developer's Guide » Site Configuration » <layer-manager>  

The <layer-manager> element is used to specify a different approach for an IMF site. When the layer manager is used, the site opens up with a blank map, and the layer list page displays an option to add or remove layers from the working map. Layers all appear in the same folder, and can be reordered by the user. This function was developed for the BC Government's iGOAT project but may be of interest to other organizations wishing to use IMF as more of a data browser.

This element is optional, and omitting it results in the standard IMF operation.

Frequency Parent Elements (the <layer-manager> element is valid within):
POS1 <site-config>
   

Frequency Description (in this context)
POS1 The <layer-manager> element may appear once in the <site-config> element in the specified sequence.
   

Attributes Description
add-layers-script Specifies the script used to interact with the end user when they are adding layers to the map. If the layer manager is enabled, and this value is not null, a link to the specified script will be shown on the layer list page. A URL is expected, relative paths are permitted.
add-visible Sets whether layers added to the map using the layer manager are turned on, or visible. Valid values are "true" or "false". The default is "false".
enable Sets whether the layer manager is enabled. Valid values are "true" or "false". The default is "false".
init-visible Sets whether the visible layers are automatically put in the main map when a layer manager enabled site is initialized. Valid values are "true" or "false". The default is "false".
maximum-layers Sets the maximum number of layers that can be added to the map from the layer manager. Numeric integer values expected. Optional. There is no limit if this attribute is not used.
remove-layers-script Specifies the script used to interact with the end user when they are removing layers from the map. If the layer manager is enabled, and this value is set, a link to the specified script will be shown on the layer list page. Note: If the remove-layers-script is not set, and the add-layers-script is set, the script defined for the add-layers-script is used for adding and removing layers, and a single link on the layer list page will be used to add and remove layers. A single link will also be used if both URLs are the same. Optional, a URL is expected, relative paths are permitted.
reorder-layers-script Specifies the script used to interact with the end user when they are re-ordering layers on the map. If the layer manager is enabled, and this value is set, a link to the specified script will be shown on the layer list page. Optional, a URL is expected, relative paths are permitted.
startup-script Specifies the name of a script file that is run when IMF is initialized to set up the layer manager in a custom way. For built-in IMF layer manager scripts, there are combinations that must be used. See examples below. Optional, a script name expected, relative to the main IMF directory. URLs are not permitted.
   

Example:

<!-- Use the standard (ArcView layer list type) layer manager. -->
<layer-manager 
    add-layers-script="$IMF/imfAddLayers.jsp"
    add-visible="true"
    enable="true"
    init-visible="true"
    reorder-layers-script="$IMF/imfReorderLayers.jsp?refresh-folders=true"
    startup-script="imfAddLayersStartup.jsp"/>

<!-- Use the folder layer list type of layer manager. -->
<layer-manager 
    add-layers-script="$IMF/imfAddLayersAndFolders.jsp"
    add-visible="true"
    enable="true"
    init-visible="true"
    reorder-layers-script="$IMF/imfReorderLayers.jsp?refresh-folders=false"
    startup-script="imfAddLayersAndFoldersStartup.jsp"/>

Valid HTML 4.01!