<br><font size=3 color=#4141ff face="sans-serif">I am trying to copy the
code for the DHTML rubber-band box from the Itasca Demo and cannot get
it to show my map.</font>
<br><font size=3 color=#4141ff face="sans-serif">I am wondering what other
code I must copy or change to make this work?</font>
<br><font size=3 color=#4141ff face="sans-serif">I am able to get the gist
of the Javascript code, but I am not familiar enough to write new code.</font>
<br>
<br><font size=3 color=#4141ff face="sans-serif">So far I have copied the
Javascript folder and most of the graphics from the Graphics folder into
my drive.</font>
<br><font size=3 color=#4141ff face="sans-serif">I have copied and inserted
the portion of code below from the (Itasca) index.html into my index.html
file.</font>
<br>
<br><font size=3 face="sans-serif"><!-- EDIT THE FORM ACTION --></font>
<br><font size=3 face="sans-serif"> <form name="watershed_main"
method="GET" action="/cgi-bin/mapserv.exe"></font>
<br>
<br><font size=3 face="sans-serif"> <input type="hidden"
name="layer" value="major_basins"></font>
<br><font size=3 face="sans-serif"> <input type="hidden"
name="layer" value="county"></font>
<br><font size=3 face="sans-serif"> <input type="hidden"
name="layer" value="MajRds"></font>
<br><font size=3 face="sans-serif"> <input type="hidden"
name="zoomsize" value=2></font>
<br>
<br><font size=3 face="sans-serif"> <!-- EDIT THESE
HIDDEN VARIABLES --></font>
<br><font size=3 face="sans-serif"> <input type="hidden"
name="map" value="d:/webData/watershed/major_basins.map"></font>
<br><font size=3 face="sans-serif"> <input type="hidden"
name="program" value="/cgi-bin/mapserv.exe"></font>
<br><font size=3 face="sans-serif"> <input type="hidden"
name="root" value="http://sr08dmnspl/watershed"></font>
<br><font size=3 face="sans-serif"> <input type="hidden"
name="map_web_imagepath" value="./tmp/"></font>
<br><font size=3 face="sans-serif"> <input type="hidden"
name="map_web_imageurl" value="http://sr08dmnspl/watershed/tmp/"></font>
<br><font size=3 face="sans-serif"> <input type="submit"
value="Start Application"></center></font>
<br>
<br>
<br><font size=3 color=#4141ff face="sans-serif">I have also copied the
code below from the itasca_adds_dhtml.html file and placed it into my file
called watershed_main.html</font>
<br>
<br><font size=3 color=#4141ff face="sans-serif">Here is my watershed_main.html
code</font>
<br>
<br><font size=3 face="sans-serif"><!-- watershed_main.html</font>
<br><font size=3 face="sans-serif"> This is the start of the
interactive major watershed map. --></font>
<br>
<br><font size=3 face="sans-serif"><html></font>
<br><font size=3 face="sans-serif"><head></font>
<br><font size=3 face="sans-serif"><title>Interactive Major (HUC
Level 4) Web Page</title></font>
<br>
<br>
<br>
<br><font size=3 face="sans-serif"><!-- the DHTML JavaScript library
includes --></font>
<br><font size=3 face="sans-serif"><script type="text/javascript"
src="../watershed/javascript/cbe/cbe_core.js"></script></font>
<br><font size=3 face="sans-serif"><script type="text/javascript"
src="../watershed/javascript/cbe/cbe_event.js"></script></font>
<br>
<br><font size=3 face="sans-serif"><!-- MapServer specific JavaScript
library includes --></font>
<br><font size=3 face="sans-serif"><script language="javascript"
src="../watershed/javascript/mapserv.js"></script></font>
<br><font size=3 face="sans-serif"><script language="JavaScript"
src="../watershed/javascript/dbox.js"></script></font>
<br>
<br><font size=3 face="sans-serif"><!-- utility library --></font>
<br><font size=3 face="sans-serif"><script language="JavaScript"
src="../watershed/javascript/utils.js"></script></font>
<br>
<br><font size=3 face="sans-serif"><!-- scripting specific to the application
--></font>
<br><font size=3 face="sans-serif"><script language="javascript"></font>
<br><font size=3 face="sans-serif"> // first, nab any arguments passed
to this page (so we don't have to edit the page)</font>
<br><font size=3 face="sans-serif"> var args = getargs();</font>
<br>
<br><font size=3 face="sans-serif"> // the DHTML main mapping window
(note the significance of the name "main" here and with the Mapserv
object)</font>
<br><font size=3 face="sans-serif"> var main = new dBox("main",600,
600, "#FF0000", 2);</font>
<br><font size=3 face="sans-serif"> // main.verbose = true;</font>
<br>
<br><font size=3 face="sans-serif"> // the DHTML reference map window</font>
<br><font size=3 face="sans-serif"> var reference = new dBox("reference",
120, 120, "#989898", 1);</font>
<br><font size=3 face="sans-serif"> reference.box = false;</font>
<br><font size=3 face="sans-serif"> reference.cursorsize = 0;</font>
<br>
<br><font size=3 face="sans-serif"> // mapserv.js global variables</font>
<br><font size=3 face="sans-serif"> var MapServer = args.program;</font>
<br><font size=3 face="sans-serif"> var QueryServer = MapServer;</font>
<br><font size=3 face="sans-serif"> var Interface = "dhtml";</font>
<br>
<br><font size=3 face="sans-serif"> // create the Mapserv object</font>
<br><font size=3 face="sans-serif"> var ms = new Mapserv("main",
args.map, 149599, 4782069, 767075, 5483304, 600, 600);</font>
<br><font size=3 face="sans-serif"> ms.minscale = 1000;</font>
<br><font size=3 face="sans-serif"> ms.maxscale = 1550000;</font>
<br>
<br><font size=3 face="sans-serif"> // layer definitions</font>
<br><font size=3 face="sans-serif"> ms.layers[ms.layes.length] =
new layer ('major_basins','Major Basins','layers',true, null, null)</font>
<br><font size=3 face="sans-serif"> ms.layers[ms.layers.length] =
new Layer('county', 'Counties', 'layers', false, null, null);</font>
<br><font size=3 face="sans-serif"> ms.layers[ms.layers.length] =
new Layer('MajRds', 'Major Roads', 'layers', false, null, null);</font>
<br><font size=3 face="sans-serif"> ms.buildlayers();</font>
<br>
<br><font size=3 face="sans-serif"> // add the reference map</font>
<br><font size=3 face="sans-serif"> ms.referencemap = new Mapserv("reference",
args.map, 393234.393701263, 5205405.16440722, 495769.579718949, 5307959.02579127,
120, 120);</font>
<br>
<br><font size=3 face="sans-serif"> //</font>
<br><font size=3 face="sans-serif"> // Extensions to Mapserv.draw():
this allows you to exend the capabilties of</font>
<br><font size=3 face="sans-serif"> // of the default draw method.
There are post and pre draw functions available.</font>
<br><font size=3 face="sans-serif"> //</font>
<br><font size=3 face="sans-serif"> function predraw() {</font>
<br><font size=3 face="sans-serif"> // clear any query results</font>
<br><font size=3 face="sans-serif"> top.query_frame.location.href='watershed_main.html';</font>
<br>
<br><font size=3 face="sans-serif"> // update the scalebars</font>
<br><font size=3 face="sans-serif"> document.scalebar_miles.src
= MapServer + "?map=" + ms.mapfile + "&mode=scalebar&mapext=0+0+"
+ (ms.extent[2] - ms.extent[0]) + "+" + (ms.extent[3] - ms.extent[1])
+ "&mapsize=" + ms.width + "+" + ms.height;</font>
<br><font size=3 face="sans-serif"> document.scalebar_kilometers.src
= MapServer + "?map=" + ms.mapfile + "&map_scalebar_units=kilometers&mode=scalebar&mapext=0+0+"
+ (ms.extent[2] - ms.extent[0]) + "+" + (ms.extent[3] - ms.extent[1])
+ "&mapsize=" + ms.width + "+" + ms.height;</font>
<br>
<br><font size=3 face="sans-serif"> // update the legend</font>
<br><font size=3 face="sans-serif"> document.legend.src =
MapServer + "?map=" + ms.mapfile + "&mode=legend&layers="
+ ms.layerlist;</font>
<br><font size=3 face="sans-serif"> reference.sync();</font>
<br><font size=3 face="sans-serif"> }</font>
<br>
<br><font size=3 face="sans-serif"> //</font>
<br><font size=3 face="sans-serif"> // Functions that are called
by the jBox applet or the dBox javascript code:</font>
<br><font size=3 face="sans-serif"> // basically these provide the
gateway from the applet/layers to the rest of</font>
<br><font size=3 face="sans-serif"> // the application. Note that
they are the same regardless of implementation.</font>
<br><font size=3 face="sans-serif"> //</font>
<br><font size=3 face="sans-serif"> // Bottom line: you may want
to swipe some of this code.</font>
<br><font size=3 face="sans-serif"> //</font>
<br><font size=3 face="sans-serif"> // jBox/dBox errors are passed
to the browser via this function</font>
<br><font size=3 face="sans-serif"> function seterror_handler(name,
message) { alert("Component " + name + " error: " +
message); }</font>
<br>
<br><font size=3 face="sans-serif"> // allows jBox/dBox to reset
without redrawing</font>
<br><font size=3 face="sans-serif"> function reset_handler(name,
minx, miny, maxx, maxy) { }</font>
<br>
<br><font size=3 face="sans-serif"> // called from jBox/dBox when
the user initiates change</font>
<br><font size=3 face="sans-serif"> function setbox_handler(name,
minx, miny, maxx, maxy) {</font>
<br><font size=3 face="sans-serif"> if(name == 'reference')
{</font>
<br><font size=3 face="sans-serif"> ms.applyreference(minx,
miny);</font>
<br><font size=3 face="sans-serif"> ms.draw();</font>
<br><font size=3 face="sans-serif"> } else {</font>
<br><font size=3 face="sans-serif"> if(ms.mode == 'map')
{</font>
<br><font size=3 face="sans-serif"> if(minx
!= maxx && miny != maxy)</font>
<br><font size=3 face="sans-serif"> ms.applybox(minx,
miny, maxx, maxy);</font>
<br><font size=3 face="sans-serif"> else</font>
<br><font size=3 face="sans-serif"> ms.applyzoom(minx,
miny);</font>
<br><font size=3 face="sans-serif"> ms.draw();</font>
<br><font size=3 face="sans-serif"> } else if(ms.mode
!= 'map') {</font>
<br><font size=3 face="sans-serif"> ms.applyquerybox(minx,
miny, maxx, maxy); // these just set members</font>
<br><font size=3 face="sans-serif"> ms.applyquerypoint(minx,
miny); </font>
<br><font size=3 face="sans-serif"> ms.query();
// builds query URL</font>
<br><font size=3 face="sans-serif"> top.query_frame.location.href
= ms.url;</font>
<br><font size=3 face="sans-serif"> }</font>
<br><font size=3 face="sans-serif"> }</font>
<br><font size=3 face="sans-serif"> }</font>
<br><font size=3 face="sans-serif">
</font>
<br><font size=3 face="sans-serif"> // various event handlers called
by jBox/dBox</font>
<br><font size=3 face="sans-serif"> function mousemove_handler(name,
x, y) {</font>
<br><font size=3 face="sans-serif"> window.status = "UTM
Coordinates: x=" + Math.round(Number(ms.extent[0] + x*ms.cellsize))
+ " and y=" + Math.round(Number(ms.extent[3] - y*ms.cellsize));</font>
<br><font size=3 face="sans-serif"> }</font>
<br><font size=3 face="sans-serif"> function mouseexit_handler(name)
{ window.status = ""; }</font>
<br><font size=3 face="sans-serif"> function mouseenter_handler(name)
{ window.status = ""; }</font>
<br>
<br><font size=3 face="sans-serif"> // page initialization function</font>
<br><font size=3 face="sans-serif"> function windowOnload() {</font>
<br><font size=3 face="sans-serif"> main.initialize();</font>
<br><font size=3 face="sans-serif"> reference.initialize();</font>
<br>
<br><font size=3 face="sans-serif"> ms.zoomdir=1;</font>
<br><font size=3 face="sans-serif"> ms.draw();</font>
<br><font size=3 face="sans-serif"> }</font>
<br><font size=3 face="sans-serif"></script></font>
<br>
<br>
<br><font size=3 face="sans-serif"><p align="center">Interactive
Major (HUC Level 4) Web Page</p></font>
<br><font size=3 face="sans-serif"></b></font></font>
<br><font size=3 face="sans-serif"><hr></font>
<br><font size=3 face="sans-serif"><table border=0 cellpadding=5></font>
<br><font size=3 face="sans-serif"><tr></font>
<br><font size=3 face="sans-serif"> <td align=center valign="top"></font>
<br><font size=3 face="sans-serif"> <table width="390"
border="0" cellspacing="0" cellpadding="0"
align="center" bgcolor="#666666"></font>
<br><font size=3 face="sans-serif"> <tr></font>
<br><font size=3 face="sans-serif"> <td align="right"
width="18"><a href="javascript:ms.pan('nw')"><img
src="../watershed/images/nw.gif" width="18" height="18"
border="0" alt="pan northwest"></a></td></font>
<br><font size=3 face="sans-serif"> <td align="center"><a
href="javascript:ms.pan('n')"><img src="../watershed/images/n.gif"
width="23" height="18" border="0" alt="pan
north"></a></td></font>
<br><font size=3 face="sans-serif"> <td align="left"
width="18"><a href="javascript:ms.pan('ne')"><img
src="../watershed/images/ne.gif" width="18" height="18"
border="0" alt="pan northeast"></a></td></font>
<br><font size=3 face="sans-serif"> </tr></font>
<br><font size=3 face="sans-serif"> <tr></font>
<br><font size=3 face="sans-serif"> <td align="right"
width="18"><a href="javascript:ms.pan('w')"><img
src="../watershed/images/w.gif" width="18" height="23"
border="0" alt="pan west"></a></td></font>
<br><font size=3 face="sans-serif"> <td align="center"
bgcolor="#cccccc"></font>
<br><font size=3 face="sans-serif"> <!--
this is the holding spot (the anchor) for the map --></font>
<br><font size=3 face="sans-serif"> <DIV
id="main_anchor" style="position:relative; visibility:visible;
width:100%; height:100%; left:0px; top:0px;"><IMG src="../watershed/images/red_pixel.gif"
height="600" width="600"></DIV></font>
<br><font size=3 face="sans-serif"> <!--
absolutely positioned layer to hold the map --></font>
<br><font size=3 face="sans-serif"> <DIV
id="main" style="position:absolute; visibility:visible;
width:100%; height:100%; clip:rect(100%,100%,100%,100%); background:transparent;"><IMG
name="main" src="../watershed/images/transparent_pixel.gif"
height="600" width="600"></DIV></font>
<br><font size=3 face="sans-serif"> </td></font>
<br><font size=3 face="sans-serif"> <td align="left"
width="18"><a href="javascript:ms.pan('e')"><img
src="../watershed/images/e.gif" width="18" height="23"
border="0" alt="pan east"></a></td></font>
<br><font size=3 face="sans-serif"> </tr></font>
<br><font size=3 face="sans-serif"> <tr></font>
<br><font size=3 face="sans-serif"> <td align="right"
width="18"><a href="javascript:ms.pan('sw')"><img
src="../watershed/images/sw.gif" width="18" height="18"
border="0" alt="pan southwest"></a></td></font>
<br><font size=3 face="sans-serif"> <td align="center"><a
href="javascript:ms.pan('s')"><img src="../watershed/images/s.gif"
width="23" height="18" border="0" alt="pan
south"></a></td></font>
<br><font size=3 face="sans-serif"> <td align="left"
width="18"><a href="javascript:ms.pan('se')"><img
src="../watershed/images/se.gif" width="18" height="18"
border="0" alt="pan southeast"></a></td></font>
<br><font size=3 face="sans-serif"> </tr></font>
<br><font size=3 face="sans-serif"> <tr><td bgcolor="#666666"
colspan="3"></font>
<br><font size=3 face="sans-serif"> <img name="scalebar_kilometers"
align="right" title="scalebar (km)" alt="scalebar
(km)" src="../watershed/images/white_pixel.gif"></font>
<br><font size=3 face="sans-serif"> <img name="scalebar_miles"
title="scalebar (mi)" alt="scalebar (mi)" src="../watershed/images/white_pixel.gif"></font>
<br><font size=3 face="sans-serif"> </td></tr></font>
<br>
<br><font size=3 face="sans-serif"></table></font>
<br><font size=3 face="sans-serif"> <td valign=top></font>
<br><font size=3 face="sans-serif"> <p align="left"></font>
<br><font size=3 face="sans-serif"> <font size=+2 face=arial,helvetica><b>MAP
CONTROLS</b></font></font>
<br><font size=3 face="sans-serif"> <hr></font>
<br><font size=3 face="sans-serif"> <br></font>
<br><font size=3 face="sans-serif"> <!-- Note that we don't
have a submit action for this form, we only need the form for some controls
--></font>
<br><font size=3 face="sans-serif"> <form name="mapserv"
action="javascript:void(0)"></font>
<br><font size=3 face="sans-serif"> <p><b>Choose
an Action: </b><br></font>
<br><font size=3 face="sans-serif"> <input
onClick="ms.mode='map'" type="radio" name="mode"
checked> Browse map<br></font>
<br><font size=3 face="sans-serif"> <input
onClick="ms.mode='query'" type="radio" name="mode">
Query feature<br></font>
<br><font size=3 face="sans-serif"> <input
onClick="ms.mode='nquery'" type="radio" name="mode">
Query multiple features</font>
<br><font size=3 face="sans-serif"> </font>
<br><font size=3 face="sans-serif"> <!--<font size=+1
face=arial,helvetica>Layers</font>--></font>
<br><font size=3 face="sans-serif"> <br></font>
<br><font size=3 face="sans-serif"> <p><b>Select
Layers to Display: </b><br></font>
<br><font size=3 face="sans-serif"> <select multiple name="layers"
size=3 onChange="ms.togglelayers(this)"></font>
<br><font size=3 face="sans-serif"> <option value="county">
Counties </font>
<br><font size=3 face="sans-serif"> <option value="MajRds">
Major Roads </font>
<br><font size=3 face="sans-serif"> </select></font>
<br><font size=3 face="sans-serif"> <br></font>
<br><font size=3 face="sans-serif"> </font>
<br><font size=3 face="sans-serif"> </font>
<br><font size=3 face="sans-serif"> <p><b>Zoom
Controls: </b><br></font>
<br><font size=3 face="sans-serif"> <input
onClick="ms.zoomdir=1" type=radio name=zoomdir checked>Zoom
In<br></font>
<br><font size=3 face="sans-serif"> <input
onClick="ms.zoomdir=0" type=radio name=zoomdir>Pan<br></font>
<br><font size=3 face="sans-serif"> <input
onClick="ms.zoomdir=-1" type=radio name=zoomdir>Zoom Out</font>
<br><font size=3 face="sans-serif"> <p></font>
<br><font size=3 face="sans-serif"> Zoom Size
<input type=text name=zoomsize size=4 value=2 onChange="ms.zoomsize=this.value"></font>
<br><font size=3 face="sans-serif"> </td></font>
<br><font size=3 face="sans-serif"></tr></table></font>
<br>