Moxi Media Inc.
Tool and Button Examples Discussion Forum

IMF Developer's Guide » Tool and Button Examples  

This document provides example configuration snippets for standard buttons and tools. This is by no means a complete listing of all button and tool capabilities of the IMF. You can easily add new buttons and tools using handlers that you write and use images from the Tool Image Gallery or images in your own application directory.

Space: Add spacing between your buttons and tools
A space can be added anywhere in the toolbar using the following:

<SPACE width="10" />

Button: BC Extent
This button can be added to your web site to perform an extent change to show the entire Province of BC. Note that this button could be changed to zoom to any extent.

<BUTTON name="BC Extent"
        url="$IMF/zoomToExtent.jsp?extent=199960,331657,1874985,1745737"
        target="hiddenFrame"
        hint="BC Extent"
        status="Zoom out so you can see the whole province of British Columbia."
        graphic="$IMF/tools/zoombc.gif"
        width="16" height="16" />

Button: Clear

This button displays a document to allow individual clearing of selected sets or user graphics.

<BUTTON name="Clear"
        url="$IMF/imfClear.jsp"
        target="dataFrame"
        hint="Clear Selection"
        status="Unselects features and clears user added graphics."
        help="$IMF/help/en/clear.txt"
        graphic="$IMF/tools/clearhighlight_1.gif"
        width="16" height="16" />

Button: Email
This script displays the form to send the map to someone by e-mail. The script has two optional arguments, subject and mailto to specify default values:

<BUTTON name="Email"
        url="$IMF/imfEmailButton.jsp"
        target="dataFrame"
        hint="Email"
        status="Send this map to someone by e-mail."
        help="$IMF/help/en/email.txt"
        graphic="$IMF/tools/mail_1.gif"
        width="16" height="16" />

Button: Full Extent
This tool zooms to the full extent of the map.

<BUTTON name="Full Extent"
      url="$IMF/imfZoomToFullExtent.jsp"
      target="hiddenFrame"
      hint="Full Extent"
      status="Zoom to the full extent of this map."
      help="$IMF/help/en/fullExtent.txt"
      graphic="$IMF/tools/fullextent_1.gif"
      width="16" height="16" />

Button: Index Map
This script displays the index map document. There are no arguments to this script.

<BUTTON tool name="Index Map"
        url="$IMF/imfIndexMap.jsp"
        target="dataFrame"
        hint="Index Map"
        status="Open an index map showing the position of the main map."
        help="$IMF/help/en/indexMap.txt"
        graphic="$IMF/tools/indexmap.gif"
        width="16" height="16" />

Button: Print Scaled Map
This script opens a document to create a printable map in PDF format. There are no arguments to this script.

<BUTTON name="Print"
      url="$IMF/imfPrintScaledMapForm.jsp"
      target="dataFrame"
      hint="Print"
      status="Prints a scaled map on your printer."
      help="$IMF/help/en/printMap.txt"
      graphic="$IMF/tools/print_1.gif"
      width="16" height="16" />

Button: Toolbox
This script is used to change the tools and associated help to a defined tool set.

<BUTTON name="Other Tools"
        url="$IMF/imfTools.jsp?toolset=mytools"
        target="toolFrame"
        hint="Other Tools"
        status="Shows another tool set."
        graphic="$IMF/tools/tools_close.gif"
        width="16" height="16" />

Button: Zoom Previous
This tool returns the map to the previous extent.

<BUTTON name="Zoom Previous"
        url="$IMF/imfZoomToPreviousExtent.jsp"
        target="hiddenFrame"
        hint="Zoom Previous"
        status="Zoom to the extent of this map before your last change."
        help="$IMF/help/en/zoomPrevious.txt"
        graphic="$IMF/tools/zoomlast.gif"
        width="16" height="16" />

Tool: Drill Down Identify
This tool calls a predefined routine, but can be set with <PROPERTY> elements in the site configuration XML file to specify that the routine should display feature data found in layers that are not visible or beyond the scale range for that layer. The default is to only show data from visible features. Note there are also settings in the <WMS-LAYER> and <FIELD> elements that affect the action of this routine.

<TOOL name="Drill Down Identify"
      hint="Identify visible"
      url="$IMF/imfDrillIdentify.jsp"
      shape="point"
      popup="false"
      status="Display information about the features where you click the map."
      help="$IMF/help/en/drillDownIdentify.txt"
      graphic="$IMF/tools/drill_1.gif"
      active-graphic="$IMF/tools/drill_2.gif" 
      width="16" height="16" />

Tool: Identify
This tool displays the identify report for the active identify layer. The report returned depends on the settings of the layer.

<IDENTIFY-TOOL
 name="Identify"
 popup="false"
 hint="Identify"
 status="Display information about the feature that you click on the map."
 help="$IMF/help/en/identify.txt"
 graphic="$IMF/tools/identify_1.gif"
 active-graphic="$IMF/tools/identify_2.gif"
 width="16"
 height="16" />

Tool: Measure
This tool displays the distance between points clicked by the user.

<TOOL name="Measure"
      shape="line"
      url="imfMeasure.jsp"
      popup="false"
      hint="Measure Distance"
      status="Measures the distance between points where you click."
      help="$IMF/help/en/measure.txt"
      graphic="$IMF/tools/measure_1.gif"
      active-graphic="$IMF/tools/measure_2.gif"
      width="16" height="16" />

Tool: Measure Area
This tool displays the distance and area of a polygon by the user.

<TOOL name="Measure Area"
      shape="line"
      url="imfMeasureArea.jsp"
      popup="false"
      hint="Measure Area"
      status="Measures the area of the polygon you draw."
      help="$IMF/help/en/measureArea.txt"
      graphic="$IMF/tools/measurearea_1.gif"
      active-graphic="$IMF/tools/measurearea_2.gif"
      width="16" height="16" />

Tool: Pan
This tool centers the map with a mouse click, or lets the user drag the map image to a new location.

<PAN-TOOL
 name="Pan"
 hint="Pan"
 status="Centre the map at the point you click or drag the map."
 help="$IMF/help/en/pan.txt"
 graphic="$IMF/tools/pan_1.gif"
 active-graphic="$IMF/tools/pan_2.gif"
 width="16"
 height="16" />

Tool: Pushpin
This tool responds to a user click on the map, and displays a form for the user to choose a graphic and enter some text to put on the map at the position clicked.

<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" />

Tool: Zoom In
This tool responds to a user mouse click or dragged envelope to zoom in.

<ZOOM-IN-TOOL
 name="Zoom In"
 hint="Zoom In"
 status="Zoom in to the point you click or the rectangle that you specify."
 help="$IMF/help/en/zoomIn.txt"
 graphic="$IMF/tools/zoomin_1.gif"
 active-graphic="$IMF/tools/zoomin_2.gif"
 width="16" height="16" />

Tool: Zoom Out
This tool responds to a user click on the map to zoom out centered on the location clicked.

<ZOOM-OUT-TOOL
 name="Zoom Out"
 hint="Zoom Out"
 status="Zoom out to the point you click or the zoom the window into an rectangle that you specify."
 help="$IMF/help/en/zoomOut.txt"
 graphic="$IMF/tools/zoomout_1.gif"
 active-graphic="$IMF/tools/zoomout_2.gif"
 width="16" height="16" />