en-ca
1999-12-31
$id:$
Doc_Builder
DM Solutions Group Inc.
chameleon@lists.maptools.org
Christopher R. Thorne
DM Solutions Group Inc.
chameleon@lists.maptools.org
Paul Spencer
DM Solutions Group Inc.
chameleon@lists.maptools.org
CompassPoint
TBD
Navigation Widget
1.99
1999-12-31
TECHRELEASE
Paul Spencer
DM Solutions Group Inc.
chameleon@lists.maptools.org
The CompassPoint widget is used to pan the map by a fixed amount in one of eight directions. The widget is represented as a button in the user interface. The direction and the amount to pan are configurable.
A map widget (e.g., MapDHTML) must be present in the interface for the CompassPoint widget to function. This does not mean the button will not show up without a map widget, only that the button would not perform any visible action.
The CompassPoint widget tag has attributes from Button Attributes group. This means CompassPoint widget has access to the Style Shared Resources. To learn about this Shared Resource, please refer to the Button attribute group section for details.
The CompassPoint widget provides the capability to pan the map in the direction of a compass point. To use the CompassPoint widget, click one of the compass point icons around the map to pan the map in that direction.
Typically, the CompassPoint widget is included in an interface eight times, once for each cardinal direction.
<CWC2 TYPE="CompassPoint"
ENABLED="[TRUE|FALSE]"
FORMINDEX="[0 < integer]"
VISIBLE="[TRUE|FALSE]"
<!-- CompassPoint Attributes-->
DIRECTION ="[NORTHEAST | NORTH | NORTHWEST | WEST | SOUTHWEST | SOUTH | SOUTHEAST | EAST]"
PANPERCENT ="[0 < integer < 100]"
<!-- Navigation Attributes -->
CURSORTYPE="[string]"
DEFAULT="[TRUE|FALSE]"
MAPID="[string]"
WIDGETSTYLE="[string]"
<!-- Button Attribute Group-->
BACKGROUNDIMAGE="[path]"
DEFAULT="[TRUE|FALSE]"
IMAGE="[path]"
IMAGEHEIGHT="[integer]"
IMAGETIP="[string]"
IMAGEWIDTH="[integer]"
LABELALIGN="[LEFT|CENTER|RIGHT]"
LABELANTIALIAS="[TRUE|FALSE]"
LABELCOLOR="[#RRGGBB]"
LABELFONT="[string]"
LABELFONTSIZE="[0 < integer]"
ONCLICK="[string]"
STYLERESOURCE="[string]"
TEXTBUTTONBORDER="[path]"
TEXTBUTTONBORDER_BOTTOM_IMAGE="[path]"
TEXTBUTTONBORDER_BOTTOMLEFT_IMAGE="[path]"
TEXTBUTTONBORDER_BOTTOMRIGHT_IMAGE="[path]"
TEXTBUTTONBORDER_LEFT_IMAGE="[path]"
TEXTBUTTONBORDER_RIGHT_IMAGE="[path]"
TEXTBUTTONBORDER_TOP_IMAGE="[path]"
TEXTBUTTONBORDER_TOPLEFT_IMAGE="[path]"
TEXTBUTTONBORDER_TOPRIGHT_IMAGE="[path]"
TEXTBUTTONCOLOR="[#RRGGBB]"
TEXTBUTTONNUDGE="[integer]"
TEXTBUTTONPADDING="[0 < integer]"
TOOLSET="[string]"
USETEXTBUTTONCACHE="[TRUE|FALSE]">
<!-- Button Subtag Group -->
<IMAGE STATE="[NORMAL|SELECTED|HOVER|DISABLED]"
IMAGE="[path]"/>
</CWC2>
The following widget tag defines a compass point button as a radio button with an icon. The widget pans 80 percent of the current view in the map's northwest direction. Note: this northwest direction is not directly related to the true northwest direction due to differences in projections, rather the panning takes place diagonally up and to the left based on the current map dimensions.
<cwc2 type="CompassPoint"
Visible="true"
styleresource="PanArrows"
Direction="northwest"
image="icons/icon_pan_nw.png"
PanPercent="80"
imagetip="Pan NorthWest"/>
The widget tag above uses the following text button style resource, "PanArrows", to define the look of the CompassPoint button.
<cwc2 type="CompassPoint"
visible="true"
styleresource="PanArrows"
direction="northwest"
image="icons/icon_pan_nw.png"
PanPercent="80"
imagetip="Pan NorthWest">
<image state="normal"/>
<image state="hover"/>
<image state="selected"/>
</cwc2>
Hawaii Demo
www.mapsherpa.com/hawaii2/
The Hawaii Demo uses the latest 1.99 Chameleon version.
Base
Button
NavTool
DIRECTION
string
Required
northeast
north
northwest
west
southwest
south
southeast
east
The direction that the compass point pans the map when clicked. This direction is from the center to the midpoint (or corner) in the specified direction and may not be geographically correct (i.e., northwest pans towards the top left corner, regardless of which direction northwest is on the map).
PANPERCENT
integer
Widget Only
50
0
100
The amount to pan the map in the given direction as a percentage of the map width and/or height.
NAV_CMD
string
The last navigation command that was used to interact with the map. Clicking a CompassPoint widget sets this form variable to "COMPASS_POINT".
NAV_ALLOW_RECTANGLE
boolean
Tracks whether the current navigation tool uses a rubber-banding box or not. Always FALSE for the CompassPoint. widget.
NavSetActiveTool
Private
Set the active navigation tool for a particular group of tools.
oButton
object
true
This is the JavaScript button object that was clicked to cause this function to be called. May be null.
aVals
array
true
Array of parameters that define the navigation tool. The first element is the tool number. The second element is the tool name. The third element is a boolean indicating whether to allow rectangles or not. The fourth element indicates if the page should be automatically submitted when the widget is clicked. The fifth element is a string that defines the cursor type.
cwc_events.js
Widgets can create events for other widgets or user-applications to use by registering events with this event manager.