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
MapDHTML
TBD
Map Widgets
2.0
2005-01-10
TECHRELEASE
Paul Spencer
DM Solutions Group Inc.
chameleon@lists.maptools.org
The MapDHTML widget is used to display the visualization of the current map image and it also provides many of the mechanisms for other tools and widgets, primarily the navigation tools, to do their jobs.
The MapDHTML widget provides direct support for specifying point and rectangular regions on the map but does not use the results directly. If the current tool supports rectangular regions, then you can press the left mouse button over the map and drag in any direction to define your rectangular region. The rectangle that follows the mouse in this case is referred to as the "marquee".
The WaitImage Shared Resource is defined by the MapDHTML widget. The WaitImage Shared Resource is a placeholder for (potentially multilingual) images that are displayed when an application is in the middle of an extended process. Examples of this are when loading the map image in the MapDHTML widget and when the query widget is waiting for the server to process a query. The MapDHTML widget also has a WAITIMAGE attribute that can be used to specify an alternate wait image to be used for the map only. This attribute is not multilingual-capable.
This widget displays a map image representing the currently visible layers and selected extents. Interacts with the map image by first selecting a navigation tool, then clicking a point or dragging a region of interest on the map image. For example, the ZoomIn tool allows the user to click a point or define a rectangular region of interest to which the map image then zooms.
<CWC2 TYPE="MapDHTML"
ENABLED="[TRUE|FALSE]"
FORMINDEX="[0 < integer]"
VISIBLE="[TRUE|FALSE]"
<!-- MapDHTML Attributes -->
BORDERCOLOR ="[hexcolor]"
BORDERWIDTH ="[integer]"
HEIGHT="[0 < integer]"
WIDTH="[0 < integer]"
ALLOWRESIZE="[TRUE|FALSE]"
MARQUEECOLOR="[#RRGGBB]"
MARQUEEHORIZONTALIMAGE="[path]"
MARQUEEWIDTH="[0 < integer]"
MARQUEEVERTICALIMAGE="[path]"
MINSCALE="[0 < integer < INF]"
MAXSCALE="[0 < integer < INF]"
WAITIMAGE="[path]"
WAITIMAGEHEIGHT="[0 < integer]"
WAITIMAGEWIDTH="[0 < integer]"/>
<CWC2 TYPE="SharedResource"
ENABLED="[TRUE|FALSE]"
FORMINDEX="[0 < integer]"
VISIBLE="[TRUE|FALSE]"
<!-- Shared Resource Attributes-->
NAME="WaitImage"
ENABLEJS="[TRUE|FALSE]">
<!-- WaitImage Shared Resource SubTag -->
<WAITIMAGE LANGUAGE="[string]"
WAITIMAGE="[path]"
WAITIMAGEWIDTH="[0 < integer]"
WAITIMAGEHEIGHT="[0 < integer]"/>
</CWC2>
This following example is the most basic definition of MapDHTML. It displays the map as a 400 x 300 pixel image with all default values.
<cwc2 type="MapDHTML"
width="400"
height="300"/>
The following example shows MapDHTML using the WAITIMAGE attributes. This means that the widget does not use the WaitImage Shared Resource.
<cwc2 type="MapDHTML"
visible="true"
width="400"
height="300"
allowresize="true"
marqueecolor="FF3333"
marqueewidth="2"
minscale="1"
waitimage="http://www.somewhere.xx/images/spinner.gif"
waitimagewidth="216"
waitimageheight="50"/>
This following example shows a MapDHTML instance that could use the "WaitImage" Shared Resource, since the WAITIMAGE attributes have not been defined in the widget.
<cwc2 type="MapDHTML"
visible="true"
width="400"
height="300"
allowresize="true"
marqueecolor="FF3333"
marqueewidth="2"
minscale="1"/>
The example below represents the default named "WaitImage" Shared Resource. This Shared Resource holds a list of multilingual images that are displayed when an application is in the middle of an extended process. In this example, the Shared Resource contains English and French wait image attribute sets.
<!-- Default style for Wait Images -->
<cwc2 type="SharedResource" name="WaitImage">
<waitimage language="en-CA"
waitimage="images/spinner.gif"
waitimagewidth="216"
waitimageheight="50"/>
<waitimage language="fr-CA"
waitimage="images/spinner_f.gif"
waitimagewidth="216"
waitimageheight="50"/>
</cwc2>
Hawaii Demo
www.mapsherpa.com/hawaii2/
The Hawaii Demo uses the latest 1.99 Chameleon version.
Base
BORDERCOLOR
hexcolor
Widget Only
#000000
The color to draw a neatline border around the map in. Black by default
BORDERWIDTH
integer
Widget Only
1
0
2147483647
The width to draw the neatline border around the map.
ALLOWRESIZE
boolean
Widget Only
false
true
false
Control the resizability of the map widget. This allows the application to respect or ignore the Window tag in a context document. Note that if you set this to "false", then the map size defined in the map file or Context document, along with the MapSize widget, is ignored.
HEIGHT
integer
Required
0
2147483647
The initial height (in pixels) of the map image. If ALLOWRESIZE is set to "false", then this sets the fixed height of the map image regardless of any other setting.
MARQUEECOLOR
hexcolor
Widget Only
#FF0000
RED
The color to draw the marquee in.
MARQUEEHORIZONTALIMAGE
path
Widget Only
/chameleon/htdocs/skins/default/images/a_pixel.gif
The image to use for drawing the right and left sides of the marquee. The image is used as a background for the marquee and, as such, only the outermost left and right edges of the image are visible. Used creatively, in combination with the MARQUEEVERTICALIMAGE attribute, this image can create special line effects (e.g., dashed lines).
MARQUEEVERTICALIMAGE
path
Widget Only
/chameleon/htdocs/skins/default/images/a_pixel.gif
The image to use for drawing the top and bottom sides of the marquee. The image is used as a background for the marquee and, as such, only the outermost top and bottom edges of the image are visible. Used creatively, in combination with the MARQUEEHORIZONTALIMAGE attribute, this image can create special line effects (e.g., dashed lines).
MARQUEEWIDTH
integer
Widget Only
1
0
2147483647
When drawing the marquee, this is the width/height (in pixels) to make the edges of the marquee. Values of 1 or 2 are typical.
MAXSCALE
float
Widget Only
1
NULL
0
INF
The maximum scale to allow when drawing the map. Zooming out beyond this scale is prevented.
MINSCALE
float
Widget Only
-1
NULL
-0
INF
The minimum scale to allow when drawing the map. Zooming in beyond this scale is prevented.
WAITIMAGE
path
Widget Only
NULL
An image to be displayed while the map image is loading to indicate to the user that something is actually happening. This is equivalent to specifying a WaitImage Shared Resource, and takes precedence over the Shared Resource. Normally, this image is an animated GIF which gives the impression that something is happening.
WAITIMAGEHEIGHT
integer
Widget Only
0
NULL
0
2147483647
The height (in pixels) of the wait image defined in the WAITIMAGE attribute. This does not need to be specified if the WAITIMAGE attribute is not specified.
WAITIMAGEWIDTH
integer
Widget Only
0
NULL
0
2147483647
The width (in pixels) of the wait image defined in the WAITIMAGE attribute. This does not need to be specified if the WAITIMAGE attribute is not specified.
WIDTH
integer
Required
0
2147483647
The initial width (in pixels) of the map widget image. If ALLOWRESIZE is set to "false", then this sets the width of the map image regardless of other settings.
NAV_INPUT_TYPE
String
The type of the last navigation command, either POINT or RECTANGLE. This is set by other widgets to indicate whether the current tool accepts rectangular input or not.
NAV_INPUT_COORDINATES
String
The coordinates that the last command generated. May be a single point or two points representing a rectangle. The coordinates are contained in a single comma-separated string. This is set by the MapDHTML widget when the user releases the left mouse button over the map image.
NAV_INPUT_SUBMIT
Boolean
Set by navigation tools to indicate if the MapDHTML widget should submit the page as soon as navigation is complete. In some cases, the page is not submitted. For instance, the Query widget normally launches a popup window to display the query results, avoiding a redraw of the entire page.
MAP_EXTENTS_MINX
Float
The minimum X extents value of the map in geographic coordinates
MAP_EXTENTS_MINY
Float
The minimum Y extents value of the map in geographic coordinates
MAP_EXTENTS_MAXX
Float
The maximum X extents value of the map in geographic coordinates
MAP_EXTENTS_MAXY
Float
The maximum Y extents value of the map in geographic coordinates
MAP_WIDTH
Integer
The width (in pixels) of the map window.
MAP_HEIGHT
Integer
The height (in pixels) of the map window.
MAP_CURSOR_POS_X
Integer
The current X position of the cursor over the map. This is maintained by the MapDHTML widget and can be used by other widgets (e.g., CursorPos).
MAP_CURSOR_POS_Y
Integer
The current Y position of the cursor over the map. This is maintained by the MapDHTML widget and can be used by other widgets (e.g., CursorPos).
NAV_CMD
String
The last command that was used to interact with the map. This is not set or changed by the MapDHTML widget
MAP_ORIGINAL_EXTENTS
String
Original extents of the map in the map file, when the application was first loaded. The extent are in a comma-separated string.
MAP_ORIGINAL_PROJ
String
String representing the original projection of the map when it was first loaded.
CURSOR_TYPE
String
Type of the cursor to be used by the navigation tools. This is not set by the MapDHTML widget, but it is used by the MapDHTML widget to change the cursor when the mouse is moved over the map image.
gCWCJSAPI
float
Private
0
Indicates if the page is in CWCJSAPI mode.
gAPixel
string
Private
http://localhost/chameleon/htdocs//skins/default/images/a_pixel.gif
Many widgets, including MapDHTML, use a single pixel transparent image to provide spacing and layout control. This is the URL for this image.
gMapWiWidth
float
Private
The width of the map window (in pixels), equivalent to the MAP_WIDTH form variable.
gMapWiHeight
float
Private
the height of the map widget window (in pixels), equivalent to the MAP_HEIGHT form variable.
gMapDHTMLWaitImage
string
Private
http://localhost/chameleon/htdocs//skins/default/images/a_pixel.gif
Web path to the wait image. See the WAITIMAGE attribute.
gMapDHTMLWaitImageWidth
float
Private
1
The width of the wait image
gMapDHTMLWaitImageHeight
float
Private
1
The height of the wait image
gMapDHTMLVerticalMarquee
string
Private
http://localhost/chameleon/htdocs//skins/default/images/a_pixel.gif
Web path to the vertical marquee image. See the MARQUEEVERTICALIMAGE attribute.
gMapDHTMLHorizontalMarquee
string
Private
http://localhost/chameleon/htdocs//skins/default/images/a_pixel.gif
Web path to the horizontal marquee image. See the MARQUEEHORIZONTALIMAGE attribute.
gMapDHTMLMarqueeWidth
float
Private
1
Width of the marquee image. See the MARQUEEWIDTH attribute.
gMapDHTMLMarqueeColor
string
Private
RED
Color of the marquee image. See the MARQUEECOLOR attribute.
gMapDHTMLURL
string
Private
/chameleon/htdocs//common//wrapper/drawmap.php
Web path to the drawmap.php script that draws the actual map.
gMapDHTMLAllowResize
float
Private
1
Contains the value of the ALLOWRESIZE attribute.
cwc_dhtml.js
DHTML utilities for Chameleon widgets.
MapDHTML.js
MapDHTML widget-specific utilities. All JavaScript code of the MapDHTML widget has been moved to this file.