|
| <tool> | Discussion Forum |
| IMF Developer's Guide » Site Configuration » <tool> |
The <tool> element defines a tool in the toolbar above the map. A tool sets a mode that causes something to happen when the user clicks on the map, as opposed to a button that causes something to happen immediately when the user clicks the button. Tools, buttons, and spaces are displayed in the order that they appear within the <tools> element.
Note: At v4.0.6, buttons and spaces are defined with separate elements, not the <tool> element.
There are some special tool names that are known to the application, such as "Zoom In", "Identify", etc., with built-in handlers that perform the special action of the tool. IMF makes it easy to define new tools that interact with the map through the use of custom handlers that you develop. Any tool with a name that is not a special predefined tool is automatically a custom tool.
See also: tool examples and tool image gallery.
|
|
|
Examples:
<!-- A built-in IMF tool -->
<tool name="Measure"
shape="line"
options="units=feet"
hint="Measure Distance"
status="Measures the distance between points where you click."
help="$FRAMEWORK/help/measureTool.txt"
graphic="$FRAMEWORK/tools/measure_1.gif"
active-graphic="$FRAMEWORK/tools/measure_2.gif"
width="16" height="16"/>
<!-- A custom tool -->
<tool name="Line Markup"
shape="line"
handler="$FRAMEWORK/imfMarkupToolLine.jsp"
hint="Line Markup"
status="Adds user-defined lines to the map."
help="$FRAMEWORK/help/markupLineTool.txt"
graphic="$FRAMEWORK/tools/markup_line1.gif"
active-graphic="$FRAMEWORK/tools/markup_line2.gif"
width="18" height="18" />