jBox Java applet

Manjiri Andhare mandhare at STATE.PA.US
Thu Nov 18 08:29:16 EST 2004


Hi!
I was looking for the functionality to draw a rectangle for zooming in on
the map. I found jBox by Steve Lime on
http://mapserver.gis.umn.edu/contributed.html
I have Windows 2000 and I'm running mapserver 4.2 on IIS.
I follwed the steps from jBox HOWTO 4.2 to test it with the workshop demo.
But when i try to run the workshop demo with "Basic application" option, in
the status bar of Browser(I'm using IE 6.0) I get the message as;
Loading Java Applet Failed..
And I'm not getting the reason behind this..
Here is the changed portion of itasca_basic.html file:
***************************************

<html>
<head>
  <title>MapServer - Itasca Application</title>
   <script language="javascript">

   function setbox_handler(name,minx,miny,maxx,maxy)
     {
     document.mapserv.imgbox.value = minx + " " + miny
+ " " + maxx + " " + maxy;
     document.mapserv.imgxy.value = minx + " " + miny;
     //additional code can go here prior to the form
submit, below
     //for example, form validation code.
     document.mapserv.submit();
      }
   function seterror_handler(message)
   {
    alert(message);
   }
  </script>
</head>
<body bgcolor="#ffffff">

<center><h1>MapServer - Itasca Application</h1></center>
<hr>
<form method="GET" action="cgi-bin/mapserv.exe" name="mapserv" >

<center>
<table border="0" cellspacing="0" cellpadding="4">
<tr>
<td valign="top" align="center">
  <table width="390" border="0" cellspacing="0" cellpadding="4"
align="center" bgcolor="#666666">
    <tr>
      <td colspan="2">
  <applet
   codebase="java\jBox"
   archive="jBoxPNG.jar,png.jar"
   code="jBoxPNG.class"
   width="600"
   height="600"
   name="jBox"
   MAYSCRIPT>
   <param name="image" value="http:\\[host][img]">
  </applet>
 </td>
 </tr>
    <tr><td bgcolor="#666666">
      <img title="scalebar (mi)" alt="scalebar (mi)" src="[scalebar]">
    </td></tr>
  </table>
</td>
<td valign="top" bgcolor="#ffffff">
  <table cellpadding="5" cellspacing="0" border="0" bgcolor="#ffffff">
    <tr><td>
      <center><input type="submit" value="Refresh/Query"></center>
      <p>

      <input type="radio" name="mode" value="browse" checked> <b>Browse
map</b><br>
      <input type="radio" name="mode" value="query"> <b>Query
feature</b><br>
      <input type="radio" name="mode" value="nquery"> <b>Query multiple
features</b>

      <hr>

      <p>
      <b>Select Layers to Display: </b><br>
      <select multiple name="layer" size=3>
        <option value="airports" [airports_select]> Airports
        <option value="cities" [cities_select]> Cities
        <option value="lakespy2" [lakespy2_select]> Lakes & Rivers
        <option value="dlgstln2" [dlgstln2_select]> Streams
        <option value="roads" [roads_select]> Roads
        <option value="twprgpy3" [twprgpy3_select]> Townships
        <option value="drgs" [drgs_select]> USGS 1:250,000 Quads
      </select>

      <p>
      Zoom In <input type=radio name=zoomdir value=1 [zoomdir_1_check]>
      Pan <input type=radio name=zoomdir value=0 [zoomdir_0_check]>
      Zoom Out <input type=radio name=zoomdir value=-1 [zoomdir_-1_check]>
      <p>
      Zoom Size <input type=text name=zoomsize size=4 value=[zoomsize]>
      <p>

      <font size=+1><b>Legend</b></font><br><hr>
      <img src="[legend]"><hr>

      <p>
      <center>
  <input name="ref" type="image" src="[ref]"
border="0"></center>
    </td></tr></table>

  </td></tr>
</table>
</center>
<input type="hidden" name="imgbox" value="-1 -1 -1 -1">

***************************************************

I have placed the jBox as:
c:\Inetpub\wwwroot\MapServer\java\jBox
And I have placed the jar files, class files and java source files from
lib,classes and src folders respectively under
c:\Inetpub\wwwroot\MapServer\java\jBox

If somebody could point out what i'm missing,it'll be great!!
Thank you,
Manjiri Andhare
GIS Coordinator
PA Fish & Boat Commission
U.S.A.



More information about the mapserver-users mailing list