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

The <wms-layer> element is used to add layers from OGC-compliant WMS servers to an IMF application with ArcIMS layers.

Frequency Parent Elements (the <wms-layer> element is valid within):
PO+ <folder>
PO+ <group>
PO+ <layer-config>
   

Frequency Child Elements (the <wms-layer> element may contain):
O+ <layer-list-icon>
O+ <layer-list-legend>
O+ <property>
   

Frequency Description (in this context)
PO+ The <wms-layer> element may appear one or more times within the parent element in any order.
O+ The child element may appear one or more times within the <wmslayer> element in any order.
   

Attributes Description
authentication A user name and password to access secure WMS services using basic authentication. The format is "username:password". In cases where someone could read the setting from the XML file, use the authentication-id instead. Optional.
authentication-id The keyword for an authentication user name and password that is defined in the WEB-INF/imf.properties file. This is much better that exposing the connection information in the XML file. Optional.
can-set-visibility Sets whether a layer can be turned on and off by the user. Valid values are "true" or "false". The default is "true". Layers that have can-set-visibility set to "false" show up in the layers list with the visibility checkbox disabled (grayed out). Optional.
can-set-visibility-beyond-scale Sets whether a layer can be turned on and off by the user if it is outside of the visible scale range. Valid values are "true" or "false". The default is "false". Optional.
href The request URL of the WMS service. Required.
elevation The elevation element of the WMS layer if applicable. Optional, rarely used.
format The image type for the WMS service, usually PNG, image/png, GIF, or image/gif. Required.
forward A security mechanism used when the IMF server has access to the WMS but the user doesn't. If set to true, the images generated by the WMS server are forwarded to the user's browser by copying them first to the IMF server. Valid values are "true" or "false". Optional, defaulting to "false".
immediate-refresh Sets whether the map should immediately refresh when the user changes the visibility of the layer. Valid values are "true" or "false". The default is "false".
layer-list-legend-can-hide Sets whether the visibility of the layer list legend for this layer can be toggled by the user by clicking the mouse on a small icon beside the layer name. Note that this controls the visibility of individual layers, as opposed to the checkbox on the layer list that toggles the visibility of all layer list legends. Optional, default is false.
layer-list-legend-height The height of the graphic used in the layer list legend for this layer, in pixels. Optional, but required if a layer list legend is used.
layer-list-legend-url The URL of the graphic used in the layer list legend for this layer. The URL can start with the special variable $IMF to specify that the document is relative to the IMF installation directory. Absolute URLs may also be used. URLs that don't start with http: or $IMF are resolved relative to the location of the XML file. Optional, but required if a layer list legend is used.
layer-list-legend-visible Sets whether the layer list legend for this group is visible when the application starts. Since invisible legends need to be turned on by the user at some point, only set this to "false" if you activate the user toggle function e.g. layer-list-legend-can-hide="true". Valid values are "true" or "false". Optional, defaults to "true".
layer-list-legend-width The width of the graphic used in the layer list legend for this layer, in pixels. Optional, but required if a layer list legend is used.
layers A comma separated list of the layers in the WMS that make up this layer. Usually there will be only one, but note that a wms-layer can be a virtual layer made up of more than one layer in the WMS. Required.
max-scale Sets the maximum scale at which the layer will be displayed. Use numeric values, for example to set the scale to 1:10000, use 10000. Defaults to the maxscale setting in the map service, or 1.0E99 if no maximum scale is set for the layer in the map service.
metadata-handler A URL to a dynamic script that handles a metadata request. The metadata handler is called with the layer id, name, and the layer's object id. The URL can start with the special variable $IMF to specify that the document is relative to the IMF installation directory. Absolute URLs may also be used. URLs that don't start with http: or $IMF are resolved relative to the location of the XML file. By default, there is no metadata handler. Optional.
metadata-url Sets the URL for a metadata page that describes the layer. The URL can start with the special variable $IMF to specify that the document is relative to the IMF installation directory. Absolute URLs may also be used. URLs that don't start with http: or $IMF are resolved relative to the location of the XML file. By default, there is no metadata. Optional.
min-scale Sets the minimum scale at which the layer will be displayed. Use numeric values, for example to set the scale to 1:10000, use 10000. Defaults to the minscale setting in the map service, or 0 if no minimum scale is set for the layer in the map service.
name The name by which this layer will appear as in IMF. Required
position Sets the drawing order of the layer. Valid values are "top" or "bottom". Optional, default is "top".
srs The spatial reference system that the WMS uses to return the image in the same projection as the main map in the IMF viewer. An example is "EPSG:4269". Required.
styles The styles (if any) that correspond to the layers in the layers attribute. If there is more than one layer, there must be an equal amount of styles, even if they are empty. You can omit this attribute if there is only one layer and it has no style name, but if there are 2 layers without styles, use ",".
time The time element of the WMS layer if applicable. Optional, rarely used.
version The version of WMS that the server supports, example "1.1.1". Required.
visible Sets the initial visibility of the layer. Valid values are "true" or "false". Optional, default is "false".
   

Examples:

<wms-layer name="DataPix Alberta"
           position="bottom"
           href="http://www.pixxures.ca/wms/servlet/WMSServer?"
           authentication="user:secret"
           version="1.1.0"
           format="image/png"
           srs="EPSG:26912"
           layers="61012"
           visible="true"
           max-scale="200005"/>

Valid HTML 4.01!