Moxi Media Inc.
<TOOL> Tree View | Discussion Forum
IMF Developer's Guide » Site Configuration » <TOOL>  

The <TOOL> element defines an interactive tool in the toolbar above the map. A tool sets a mode that causes something to happen when the user clicks on the map, while a button causes something to happen immediately when the icon is pressed.

A tool can be used to get a shape from the user to perform virtually any process you desire. It is easy to add new interactive tools to an IMF site. For more information about creating tools, see the Custom Tools Page.

See also: tool examples and tool image gallery.

Frequency Parent Elements (this element is valid within):
PO+ <TOOLSET>
   

Attributes Description
name The name of the tool. All buttons and tools in a toolset must have unique names. Required.
url The URL that will be executed when the tool is clicked. The URL can contain 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. Required.
shape The data collection shape type. Valid values are "point", "box", "line" and "polygon". The URL associated with the tool will be executed in the dataFrame each time the user clicks the map. Tip: Use $IMF/imfArgs.jsp for the URL during development to understand what arguments the script is being called with. Optional, defaults to "point".
popup An indicator of whether the handler script will be opened in a popup window. Valid values are "true" or "false". If false, the document will be opened in the data frame beside the map. Optional, defaults to "false".
hint The pop-up tip that will appear when the user moves the mouse over the tool. Required.
status The message that will appear in the browser's status area when the user moves the mouse over the tool. Required.
help The URL of the text file containing help text for automatically generated help. If this attribute is present and if the text can be read from the URL, the text in the URL will appear beside the icon in the help document. If this attribute is empty, the text in the status attribute will be used instead. The URL can contain 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.
visible Used to set the visibility of a tool to invisible for use in designing user interfaces with active tools set from outside the toolbar. Optional, the default is "true".
graphic The URL of the image for the tool. The URL can contain 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. Required.
active-graphic The URL of the image shown when the tool is active. In the IMF application, this is usually the same graphic with a red outline. The URL can contain 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. Required.
width The width of the tool image, in pixels. Required.
height The height of the tool image, in pixels. Required.
   

Frequency Description (in this context)
PO+ The <TOOL> element is optional, and may appear multiple times within the <TOOLSET> element.
   

Example:

<TOOL name="Pushpin"
      url="$IMF/imfPushpin.jsp"
      shape="point"
      popup="false"
      hint="Pushpin"
      status="Add a pushpin where click the map."
      help="$IMF/help/en/pushpin.txt"
      graphic="$IMF/tools/pushpin_1.gif"
      active-graphic="$IMF/tools/pushpin_2.gif"
      width="16" height="16" />

Valid HTML 4.01!