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 Cursorpos Base Package Label Widgets 2.0 1999-12-31 TECHRELEASE Paul Spencer DM Solutions Group Inc. chameleon@lists.maptools.org The Cursorpos widget is used to display the current cursor position, in the geographic coordinates of the map. To assist template developers, this widget can be configured to display one of the two axes of the cursor position. The cursor position must be displayed in an HTML element that can be updated, so an HTML INPUT box is used. CSS files can be used to modify the appearance of the INPUT box to make it look nicer in more modern browsers. A map widget must be present in the interface so this widget can display the coordinate position on the map. The Cursorpos widget displays current X or Y values as the cursor moves over the map. The location is displayed in the units of the current projection. Even though this widget uses an HTML input box to display its value, it is regarded as a label widget. The value of the location of the cursor is updated dynamically as the user moves the mouse over the map. This widget can be placed anywhere on the page, but is often placed near the MapUnits and ProjectionLabel widgets. Typically, this widget is included in an interface twice, once for each axis. <CWC2 TYPE="Cursorpos" ENABLED="[TRUE|FALSE]" FORMINDEX="[0 < integer]" VISIBLE="[TRUE|FALSE]" <!-- CursorPos Attributes--> AXIS="[X|Y]" TEXTFIELDSIZE="[0 < integer]" WIDGETCLASS="[string]" WIDGETSTYLE="[string]" <!-- Label Attribute Group--> LABEL="[string]" LABELPOSITION="[0 < integer < 8]" LABELHALIGN="[LEFT|CENTER|RIGHT]" LABELVALIGN="[TOP|MIDDLE|BOTTOM]" LABELCLASS="[string]" LABELSTYLE="[string]"/> This example tag outputs only the "X" coordinate cursor position value whenever the mouse is over the application map. <cwc2 type="CursorPos" axis="X"/> In the following example, the coordinate position "X" is labeled to the left of the value with "Longitude: ". This label widget has also been given a CSS style to make it look nicer than the default style. <cwc2 type="CursorPos" axis="X" label="Longitude: " labelposition="8" labelvalign="middle" labelclass="label" widgetclass="inputBox"/> Hawaii Demo http://www.mapsherpa.com/hawaii2/ The Hawaii Demo uses the latest 1.99 Chameleon version. Base Label AXIS string Required X Y Determines which of the X or Y values of the current cursor position is displayed. TEXTFIELDSIZE integer Widget Only 20 0 2147483647 The size (in characters) of the text box that displays the cursor position. WIDGETCLASS string Widget Only CWCCursorPositionWidgetClass The CSS class to control the style of the HTML INPUT box. WIDGETSTYLE string Widget Only NULL The CSS style to control the style of the HTML INPUT box. sid unknown CursorXMouseMoved Private Callback function for tracking mouse movement in the X direction. The same function exists for the Y direction (called CursorYMouseMoved). e object true WidgetPix2Geo Private Convert pixel position to geographic coordinates nPixPos integer true dfPixMin integer true dfPixMax integer true dfGeoMin float true dfGeoMax float true nInversePix integer true