[mapserver-users] mapplet form has no properties

lc christym at geoplan.ufl.edu
Thu Aug 16 14:09:53 EDT 2001


Hey, thanks for the reply, Chan.

I've attached the source code for my html template.  In it you can see the
recommended/necessary changes for implementing the mapplet:

1. named the FORM that is sent to the mapserver app.
This is the same name that's refered to in the mapplet_apply function.

2. added the mapplet_apply and mapplet_error functions

3. added the hidden variables: imgxy and imgbox

4. replaced the output map image (<img src= ...>) with the applet
definition (<applet codebase=......>)

Also, here's another link to my mapserver site:
http://geneva.geoplan.ufl.edu/download/mapserv/htmltemplates/doqq_init.html
I hope that this one will work for you.  Please let me know if it does or doesn't work.

Oh and just to reiterate, I'm getting the following error message when I try
to drag zoom on the applet map image:
    Applet mapplet document.mapserv has no properties

which of course is referring to my FORM, "mapserv".

Thanks a bunch,
Christine
-------------- next part --------------
<html>
<head>
<style type="text/css">
   td { font-size: 10pt; font-family: sans-serif; } 
   .theTitle { font-size: 20pt; font-weight: bold; font-family: Times; }
   .aSel { font-size: 10pt; font-weight: normal; font-family: sans-serif; }
   select { font-size: 8pt; font-weight: normal; font-family: sans-serif; }
   h5 { font-size: 13pt; font-weight: bold; font-family: Times; }
   a { color: black; }
   .indent { text-indent: 15px; }
   .colorMe { background-color: white; }
   .button { position: relative; left: 5px; }
</style>   

<script language="JavaScript">
   function mapplet_apply(name, minx, miny, maxx, maxy, redraw) {
      document.mapserv.imgbox.value = minx + " " + miny + " " + maxx + " " + maxy;
      document.mapserv.imgxy.value = minx + " " + miny;
   }

   function mapplet_error(message) {
      alert(message);
   }
</script>
</head>


<body bgcolor="white">

<div style="position: absolute; left: 30; top: 10">
<table bgcolor="white" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="theTitle" bgcolor="white" colspan="3" height="26" width="800" valign="center" align="left"> FGDL Data Download</td>
  </tr>
  <tr>
    <FORM NAME="form0">
    <td class="aSel" bgcolor="#e0e0e0" colspan="3" height="42" width="800" valign="center" align="center" NOWRAP>
    Category:<font size=-1>
       <SELECT NAME="sel_cat" size="1">
          <OPTION VALUE="0">State
	  <OPTION VALUE="1">Coast
	  <OPTION VALUE="2" selected>County
	  <OPTION VALUE="3">Tax Tables
       </SELECT></font>
       &nbsp;&nbsp;Select By:<font size=-1>
       <SELECT NAME="sel_by" size="1">
          <OPTION VALUE="0">County
	  <OPTION VALUE="1" selected>DOQQ Extents
	  <OPTION VALUE="2">7.5 Minute Quads
	  <OPTION VALUE="3">Aerial Photo Extents
       </SELECT></font>
       &nbsp;&nbsp;Available Layers:<font size=-1>
       <SELECT NAME="avail" size="1">
          <OPTION VALUE="0">Digital Ortho Quarter Quads
       </SELECT></font>
    </td>
    </form>
  </tr>
  <tr><td bgcolor="white" colspan="3" height="5">&nbsp;</td>
  </tr>

  <FORM name="mapserv" method="GET" action="../../../cgi-bin/mapserv">
  <input type="hidden" name="map" value="[map]">
  <input type="hidden" name="imgext" value="[mapext]">
  <input type="hidden" name="imgbox" value="-1 -1 -1 -1">
  <input type="hidden" name="imgxy" value="199.5 199.5">
  
  <tr>
    <td rowspan="4" height="400" width="400" align="left" valign="top" bgcolor="white">
       <applet codebase="../../mapserver/java/mapplet" code="mapplet.class" width="400" height="400" name="mapplet" MAYSCRIPT>
          <param name="image" value="[img]">
	  <param name="jitter" value="10">
	  <param name="thickness" value="2">
	  <param name="color" value="yellow">
       </applet>
    </td>   
    <td bgcolor="white" rowspan="5" width="30">&nbsp;</td>
  </tr>
  <tr>
    <td height="200" width="250" valign="top" align="left" bgcolor="white"><h5>reference layers</h5>

       <input type="checkbox" class="indent" name="layer" value="doqq_index" [doqq_index_check]> <img src="../download/mapserv/legend/doqq_leg.png"><a href="http://www.fgdl.org/fgdldocs/metadata/html/doqq_index.htm"> DOQQ Extents</a><br>
       <input type="checkbox" class="indent" name="layer" value="cntbnd" [cntbnd_check]> <img src="../download/mapserv/legend/county_leg.png"><a href="http://www.fgdl.org/fgdldocs/metadata/html/cntbnd.htm"> County Boundaries</a><br>
       <input type="checkbox" class="indent" name="layer" value="majrds" [majrds_check]> <img src="../download/mapserv/legend/majrds_leg.png"> <a href="http://www.fgdl.org/fgdldocs/metadata/html/majrds.htm">  Major Roads</a><br>
       <input type="checkbox" class="indent" name="layer" value="hydros" [hydros_check]> <img src="../download/mapserv/legend/hydros_leg.png"> <a href="http://www.fgdl.org/fgdldocs/metadata/html/hydros.htm">  Hydrography</a><br>
       <input type="checkbox" class="indent" name="layer" value="doqq" [doqq_check]> [ * ] <a
       href="http://www.fgdl.org/fgdldocs/metadata/html/doqq.htm">  DOQQs</a><br><br>
       <font size=-1><input type="submit" class="indent" value="Redraw Map"></font>

    </td>
  </tr>
  <tr>
    <td width="250" height="100" valign="top" align="left"><h5>map tools</h5>
    <img class="indent" src="../../download/mapserv/dragzoom/pan3.gif">&nbsp;&nbsp;
    <img src="../../download/mapserv/dragzoom/zoom2.gif">&nbsp;&nbsp;
    <img src="../../download/mapserv/dragzoom/prev_ext2.gif">&nbsp;&nbsp;
    <img src="../../download/mapserv/dragzoom/fullextent2.gif">&nbsp;&nbsp;
    <img src="../../download/mapserv/dragzoom/info2.gif"><br></td>
  </tr>  
  <tr>
    <td height="50" width="250" valign="top" align="left"><h5>selection</h5></td>
  </tr>
  <tr>
    <td width="400" height="100" valign="top" align="left"><h5>navigation and logo</h5></td>
    <td width="250" height="100" valign="top" align="left"><input type="submit" value="Submit Selections"></td>
    </form>
  </tr>
</table>  
</div>

</body>
</html>


More information about the mapserver-users mailing list