<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2604" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=071363223-10112005><FONT face=Arial color=#0000ff size=2>Check
your webserver logs and look at the URL it's submitting...Copy that and in a
browse use it changing mode=browse to mode=map...If nothing displays then you
most likely have your projection or extents wrong. This is how I initially
figured out how to debug what was going on in the dhtml
example.</FONT></SPAN></DIV>
<DIV><SPAN class=071363223-10112005></SPAN> </DIV>
<DIV><SPAN class=071363223-10112005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=071363223-10112005><FONT face=Arial color=#0000ff
size=2>-e</FONT></SPAN></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> UMN MapServer
Users List [mailto:MAPSERVER-USERS@LISTS.UMN.EDU] <B>On Behalf Of </B>Jennifer
A Bennett<BR><B>Sent:</B> Thursday, November 10, 2005 2:57 PM<BR><B>To:</B>
MAPSERVER-USERS@LISTS.UMN.EDU<BR><B>Subject:</B> [UMN_MAPSERVER-USERS] DHTML
rubber-band box<BR><BR></FONT></DIV><BR><FONT face=sans-serif color=#4141ff
size=3>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 face=sans-serif
color=#4141ff size=3>I am wondering what other code I must copy or change to
make this work?</FONT> <BR><FONT face=sans-serif color=#4141ff size=3>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 face=sans-serif color=#4141ff size=3>So
far I have copied the Javascript folder and most of the graphics from the
Graphics folder into my drive.</FONT> <BR><FONT face=sans-serif color=#4141ff
size=3>I have copied and inserted the portion of code below from the (Itasca)
index.html into my index.html file.</FONT> <BR><BR><FONT face=sans-serif
size=3><!-- EDIT THE FORM ACTION --></FONT> <BR><FONT face=sans-serif
size=3> <form name="watershed_main" method="GET"
action="/cgi-bin/mapserv.exe"></FONT> <BR><BR><FONT face=sans-serif
size=3> <input type="hidden" name="layer"
value="major_basins"></FONT> <BR><FONT face=sans-serif size=3>
<input type="hidden" name="layer" value="county"></FONT>
<BR><FONT face=sans-serif size=3> <input type="hidden"
name="layer" value="MajRds"></FONT> <BR><FONT face=sans-serif size=3>
<input type="hidden" name="zoomsize" value=2></FONT>
<BR><BR><FONT face=sans-serif size=3> <!-- EDIT THESE
HIDDEN VARIABLES --></FONT> <BR><FONT face=sans-serif size=3>
<input type="hidden" name="map"
value="d:/webData/watershed/major_basins.map"></FONT> <BR><FONT
face=sans-serif size=3> <input type="hidden"
name="program" value="/cgi-bin/mapserv.exe"></FONT> <BR><FONT
face=sans-serif size=3> <input type="hidden"
name="root" value="http://sr08dmnspl/watershed"></FONT> <BR><FONT
face=sans-serif size=3> <input type="hidden"
name="map_web_imagepath" value="./tmp/"></FONT> <BR><FONT face=sans-serif
size=3> <input type="hidden" name="map_web_imageurl"
value="http://sr08dmnspl/watershed/tmp/"></FONT> <BR><FONT face=sans-serif
size=3> <input type="submit" value="Start
Application"></center></FONT> <BR><BR><BR><FONT face=sans-serif
color=#4141ff size=3>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 face=sans-serif color=#4141ff
size=3>Here is my watershed_main.html code</FONT> <BR><BR><FONT
face=sans-serif size=3><!-- watershed_main.html</FONT> <BR><FONT
face=sans-serif size=3> This is the start of the interactive major
watershed map. --></FONT> <BR><BR><FONT face=sans-serif
size=3><html></FONT> <BR><FONT face=sans-serif
size=3><head></FONT> <BR><FONT face=sans-serif
size=3><title>Interactive Major (HUC Level 4) Web
Page</title></FONT> <BR><BR><BR><BR><FONT face=sans-serif size=3><!--
the DHTML JavaScript library includes --></FONT> <BR><FONT face=sans-serif
size=3><script type="text/javascript"
src="../watershed/javascript/cbe/cbe_core.js"></script></FONT>
<BR><FONT face=sans-serif size=3><script type="text/javascript"
src="../watershed/javascript/cbe/cbe_event.js"></script></FONT>
<BR><BR><FONT face=sans-serif size=3><!-- MapServer specific JavaScript
library includes --></FONT> <BR><FONT face=sans-serif size=3><script
language="javascript"
src="../watershed/javascript/mapserv.js"></script></FONT> <BR><FONT
face=sans-serif size=3><script language="JavaScript"
src="../watershed/javascript/dbox.js"></script></FONT> <BR><BR><FONT
face=sans-serif size=3><!-- utility library --></FONT> <BR><FONT
face=sans-serif size=3><script language="JavaScript"
src="../watershed/javascript/utils.js"></script></FONT> <BR><BR><FONT
face=sans-serif size=3><!-- scripting specific to the application
--></FONT> <BR><FONT face=sans-serif size=3><script
language="javascript"></FONT> <BR><FONT face=sans-serif size=3> //
first, nab any arguments passed to this page (so we don't have to edit the
page)</FONT> <BR><FONT face=sans-serif size=3> var args =
getargs();</FONT> <BR><BR><FONT face=sans-serif size=3> // the DHTML
main mapping window (note the significance of the name "main" here and with
the Mapserv object)</FONT> <BR><FONT face=sans-serif size=3> var main =
new dBox("main",600, 600, "#FF0000", 2);</FONT> <BR><FONT face=sans-serif
size=3> // main.verbose = true;</FONT> <BR><BR><FONT face=sans-serif
size=3> // the DHTML reference map window</FONT> <BR><FONT
face=sans-serif size=3> var reference = new dBox("reference", 120, 120,
"#989898", 1);</FONT> <BR><FONT face=sans-serif size=3> reference.box =
false;</FONT> <BR><FONT face=sans-serif size=3> reference.cursorsize =
0;</FONT> <BR><BR><FONT face=sans-serif size=3> // mapserv.js global
variables</FONT> <BR><FONT face=sans-serif size=3> var MapServer =
args.program;</FONT> <BR><FONT face=sans-serif size=3> var QueryServer =
MapServer;</FONT> <BR><FONT face=sans-serif size=3> var Interface =
"dhtml";</FONT> <BR><BR><FONT face=sans-serif size=3> // create the
Mapserv object</FONT> <BR><FONT face=sans-serif size=3> var ms = new
Mapserv("main", args.map, 149599, 4782069, 767075, 5483304, 600, 600);</FONT>
<BR><FONT face=sans-serif size=3> ms.minscale = 1000;</FONT> <BR><FONT
face=sans-serif size=3> ms.maxscale = 1550000;</FONT> <BR><BR><FONT
face=sans-serif size=3> // layer definitions</FONT> <BR><FONT
face=sans-serif size=3> ms.layers[ms.layes.length] = new layer
('major_basins','Major Basins','layers',true, null, null)</FONT> <BR><FONT
face=sans-serif size=3> ms.layers[ms.layers.length] = new
Layer('county', 'Counties', 'layers', false, null, null);</FONT> <BR><FONT
face=sans-serif size=3> ms.layers[ms.layers.length] = new
Layer('MajRds', 'Major Roads', 'layers', false, null, null);</FONT> <BR><FONT
face=sans-serif size=3> ms.buildlayers();</FONT> <BR><BR><FONT
face=sans-serif size=3> // add the reference map</FONT> <BR><FONT
face=sans-serif size=3> ms.referencemap = new Mapserv("reference",
args.map, 393234.393701263, 5205405.16440722, 495769.579718949,
5307959.02579127, 120, 120);</FONT> <BR><BR><FONT face=sans-serif
size=3> //</FONT> <BR><FONT face=sans-serif size=3> // Extensions
to Mapserv.draw(): this allows you to exend the capabilties of</FONT>
<BR><FONT face=sans-serif size=3> // of the default draw method. There
are post and pre draw functions available.</FONT> <BR><FONT face=sans-serif
size=3> //</FONT> <BR><FONT face=sans-serif size=3> function
predraw() {</FONT> <BR><FONT face=sans-serif size=3> // clear any
query results</FONT> <BR><FONT face=sans-serif size=3>
top.query_frame.location.href='watershed_main.html';</FONT> <BR><BR><FONT
face=sans-serif size=3> // update the scalebars</FONT> <BR><FONT
face=sans-serif size=3> 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 face=sans-serif size=3>
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
face=sans-serif size=3> // update the legend</FONT> <BR><FONT
face=sans-serif size=3> document.legend.src = MapServer + "?map="
+ ms.mapfile + "&mode=legend&layers=" + ms.layerlist;</FONT> <BR><FONT
face=sans-serif size=3> reference.sync();</FONT> <BR><FONT
face=sans-serif size=3> }</FONT> <BR><BR><FONT face=sans-serif
size=3> //</FONT> <BR><FONT face=sans-serif size=3> // Functions
that are called by the jBox applet or the dBox javascript code:</FONT>
<BR><FONT face=sans-serif size=3> // basically these provide the gateway
from the applet/layers to the rest of</FONT> <BR><FONT face=sans-serif
size=3> // the application. Note that they are the same regardless of
implementation.</FONT> <BR><FONT face=sans-serif size=3> //</FONT>
<BR><FONT face=sans-serif size=3> // Bottom line: you may want to swipe
some of this code.</FONT> <BR><FONT face=sans-serif size=3> //</FONT>
<BR><FONT face=sans-serif size=3> // jBox/dBox errors are passed to the
browser via this function</FONT> <BR><FONT face=sans-serif size=3>
function seterror_handler(name, message) { alert("Component " + name + "
error: " + message); }</FONT> <BR><BR><FONT face=sans-serif size=3> //
allows jBox/dBox to reset without redrawing</FONT> <BR><FONT face=sans-serif
size=3> function reset_handler(name, minx, miny, maxx, maxy) { }</FONT>
<BR><BR><FONT face=sans-serif size=3> // called from jBox/dBox when the
user initiates change</FONT> <BR><FONT face=sans-serif size=3> function
setbox_handler(name, minx, miny, maxx, maxy) {</FONT> <BR><FONT
face=sans-serif size=3> if(name == 'reference') {</FONT>
<BR><FONT face=sans-serif size=3> ms.applyreference(minx,
miny);</FONT> <BR><FONT face=sans-serif size=3>
ms.draw();</FONT> <BR><FONT face=sans-serif size=3> } else
{</FONT> <BR><FONT face=sans-serif size=3> if(ms.mode ==
'map') {</FONT> <BR><FONT face=sans-serif size=3>
if(minx != maxx && miny != maxy)</FONT> <BR><FONT face=sans-serif
size=3> ms.applybox(minx, miny, maxx,
maxy);</FONT> <BR><FONT face=sans-serif size=3>
else</FONT> <BR><FONT face=sans-serif size=3>
ms.applyzoom(minx, miny);</FONT> <BR><FONT face=sans-serif
size=3> ms.draw();</FONT> <BR><FONT face=sans-serif
size=3> } else if(ms.mode != 'map') {</FONT> <BR><FONT
face=sans-serif size=3> ms.applyquerybox(minx,
miny, maxx, maxy); // these just set members</FONT> <BR><FONT face=sans-serif
size=3> ms.applyquerypoint(minx, miny);
</FONT> <BR><FONT face=sans-serif size=3>
ms.query(); // builds query URL</FONT> <BR><FONT
face=sans-serif size=3>
top.query_frame.location.href = ms.url;</FONT> <BR><FONT face=sans-serif
size=3> }</FONT> <BR><FONT face=sans-serif size=3>
}</FONT> <BR><FONT face=sans-serif size=3> }</FONT> <BR><FONT
face=sans-serif size=3>
</FONT><BR><FONT face=sans-serif size=3> // various event handlers
called by jBox/dBox</FONT> <BR><FONT face=sans-serif size=3> function
mousemove_handler(name, x, y) {</FONT> <BR><FONT face=sans-serif size=3>
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 face=sans-serif size=3> }</FONT>
<BR><FONT face=sans-serif size=3> function mouseexit_handler(name) {
window.status = ""; }</FONT> <BR><FONT face=sans-serif size=3> function
mouseenter_handler(name) { window.status = ""; }</FONT> <BR><BR><FONT
face=sans-serif size=3> // page initialization function</FONT> <BR><FONT
face=sans-serif size=3> function windowOnload() {</FONT> <BR><FONT
face=sans-serif size=3> main.initialize();</FONT> <BR><FONT
face=sans-serif size=3> reference.initialize();</FONT>
<BR><BR><FONT face=sans-serif size=3> ms.zoomdir=1;</FONT>
<BR><FONT face=sans-serif size=3> ms.draw();</FONT> <BR><FONT
face=sans-serif size=3> }</FONT> <BR><FONT face=sans-serif
size=3></script></FONT> <BR><BR><BR><FONT face=sans-serif size=3><p
align="center">Interactive Major (HUC Level 4) Web Page</p></FONT>
<BR><FONT face=sans-serif size=3></b></font></FONT> <BR><FONT
face=sans-serif size=3><hr></FONT> <BR><FONT face=sans-serif
size=3><table border=0 cellpadding=5></FONT> <BR><FONT face=sans-serif
size=3><tr></FONT> <BR><FONT face=sans-serif size=3> <td
align=center valign="top"></FONT> <BR><FONT face=sans-serif size=3>
<table width="390" border="0" cellspacing="0" cellpadding="0"
align="center" bgcolor="#666666"></FONT> <BR><FONT face=sans-serif
size=3> <tr></FONT> <BR><FONT face=sans-serif size=3>
<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 face=sans-serif
size=3> <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 face=sans-serif size=3>
<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 face=sans-serif
size=3> </tr></FONT> <BR><FONT face=sans-serif
size=3> <tr></FONT> <BR><FONT face=sans-serif size=3>
<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 face=sans-serif size=3>
<td align="center" bgcolor="#cccccc"></FONT> <BR><FONT
face=sans-serif size=3> <!-- this is the holding
spot (the anchor) for the map --></FONT> <BR><FONT face=sans-serif
size=3> <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 face=sans-serif
size=3> <!-- absolutely positioned layer to hold
the map --></FONT> <BR><FONT face=sans-serif size=3>
<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 face=sans-serif size=3>
</td></FONT> <BR><FONT face=sans-serif size=3>
<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 face=sans-serif size=3>
</tr></FONT> <BR><FONT face=sans-serif size=3>
<tr></FONT> <BR><FONT face=sans-serif size=3> <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 face=sans-serif
size=3> <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 face=sans-serif size=3>
<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 face=sans-serif
size=3> </tr></FONT> <BR><FONT face=sans-serif
size=3> <tr><td bgcolor="#666666" colspan="3"></FONT>
<BR><FONT face=sans-serif size=3> <img
name="scalebar_kilometers" align="right" title="scalebar (km)" alt="scalebar
(km)" src="../watershed/images/white_pixel.gif"></FONT> <BR><FONT
face=sans-serif size=3> <img name="scalebar_miles"
title="scalebar (mi)" alt="scalebar (mi)"
src="../watershed/images/white_pixel.gif"></FONT> <BR><FONT face=sans-serif
size=3> </td></tr></FONT> <BR><BR><FONT
face=sans-serif size=3></table></FONT> <BR><FONT face=sans-serif
size=3> <td valign=top></FONT> <BR><FONT face=sans-serif
size=3> <p align="left"></FONT> <BR><FONT face=sans-serif
size=3> <font size=+2 face=arial,helvetica><b>MAP
CONTROLS</b></font></FONT> <BR><FONT face=sans-serif size=3>
<hr></FONT> <BR><FONT face=sans-serif size=3>
<br></FONT> <BR><FONT face=sans-serif size=3> <!-- Note
that we don't have a submit action for this form, we only need the form for
some controls --></FONT> <BR><FONT face=sans-serif size=3>
<form name="mapserv" action="javascript:void(0)"></FONT>
<BR><FONT face=sans-serif size=3>
<p><b>Choose an Action: </b><br></FONT> <BR><FONT
face=sans-serif size=3> <input
onClick="ms.mode='map'" type="radio" name="mode" checked> Browse
map<br></FONT> <BR><FONT face=sans-serif size=3>
<input onClick="ms.mode='query'" type="radio" name="mode"> Query
feature<br></FONT> <BR><FONT face=sans-serif size=3>
<input onClick="ms.mode='nquery'" type="radio" name="mode"> Query
multiple features</FONT> <BR><FONT face=sans-serif size=3>
</FONT><BR><FONT face=sans-serif size=3> <!--<font
size=+1 face=arial,helvetica>Layers</font>--></FONT> <BR><FONT
face=sans-serif size=3> <br></FONT> <BR><FONT
face=sans-serif size=3> <p><b>Select Layers to
Display: </b><br></FONT> <BR><FONT face=sans-serif size=3>
<select multiple name="layers" size=3
onChange="ms.togglelayers(this)"></FONT> <BR><FONT face=sans-serif
size=3> <option value="county"> Counties </FONT><BR><FONT
face=sans-serif size=3> <option value="MajRds"> Major Roads
</FONT><BR><FONT face=sans-serif size=3> </select></FONT>
<BR><FONT face=sans-serif size=3> <br></FONT> <BR><FONT
face=sans-serif size=3> </FONT><BR><FONT face=sans-serif
size=3> </FONT> <BR><FONT face=sans-serif
size=3> <p><b>Zoom Controls:
</b><br></FONT> <BR><FONT face=sans-serif size=3>
<input onClick="ms.zoomdir=1" type=radio name=zoomdir
checked>Zoom In<br></FONT> <BR><FONT face=sans-serif size=3>
<input onClick="ms.zoomdir=0" type=radio
name=zoomdir>Pan<br></FONT> <BR><FONT face=sans-serif size=3>
<input onClick="ms.zoomdir=-1" type=radio
name=zoomdir>Zoom Out</FONT> <BR><FONT face=sans-serif size=3>
<p></FONT> <BR><FONT face=sans-serif size=3>
Zoom Size <input type=text name=zoomsize size=4 value=2
onChange="ms.zoomsize=this.value"></FONT> <BR><FONT face=sans-serif
size=3> </td></FONT> <BR><FONT face=sans-serif
size=3></tr></table></FONT> <BR></BLOCKQUOTE></BODY></HTML>