[Mapserver-users] Mapplet not working...

Kevin Ravno kevin at giscoe.com
Wed Aug 6 10:12:48 EDT 2003


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C35C24.D0C02FE0
Content-Type: text/plain;
	charset="iso-8859-1"



Hi

I have tried to implement the zoom-box facility of mapplet.
I have a virtual directory (IIS 5.0) set up to C:\MapServer\Project1  (on
Windows 2000)
I unzipped mapplet.zip to C:\MapServer\Project1\java\mapplet\
and followed all the steps of
1) inserted 
<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>
into the <HEAD></HEAD>

2) changing the form header to <form name="mapserv" method=GET
action="[program]">

3) putting in 
<input type="hidden" name="imgxy" value="299.5 299.5">
<input type="hidden" name="imgbox" value="-1 -1 -1 -1">

4) swopping <INPUT NAME="img" TYPE="image" SRC="[img]" width="600"
height="600" border=1>    for
   <applet codebase="/java/mapplet" code="mapplet.class" width="600"
height="600" name="mapplet" MAYSCRIPT>
              <param name="image" value="http://[host][img]">             
       </applet>


Unfortunately when I tried to open the page, the image was now just a grey
area covering 600x600 and no zoom box could be generated by dragging the
mouse.

I decided to wrap the applet code to
        <object width="600" height="600"
classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" 
 
codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i5
86.cab#Version=1,4,0,0" 
                   standby="Please wait">
       <applet codebase="/java/mapplet" code="mapplet.class" width="600"
height="600" name="mapplet" MAYSCRIPT>
              <param name="image" value="http://[host][img]">
       </applet>
       </object>
in order to install JRE1.4 but once it downloaded, it corrupted the browser
(IE6) and asked me to debug the browser.
I then took out the <OBJECT> wrapper, (and the browser worked again) but now
it puts a red 'X' in the map image and says "Loading Java Applet failed...."


Is there anything that I am doing wrong.

Regards
Kevin



------_=_NextPart_001_01C35C24.D0C02FE0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>Mapplet not working...</TITLE>
</HEAD>
<BODY>
<BR>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Arial">Hi</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">I have tried to implement the zoom-box =
facility of mapplet.</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">I have a virtual directory (IIS 5.0) =
set up to C:\MapServer\Project1&nbsp; (on Windows 2000)</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">I unzipped mapplet.zip to =
C:\MapServer\Project1\java\mapplet\</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">and followed all the steps of</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">1) inserted </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&lt;SCRIPT =
LANGUAGE=3D&quot;JavaScript&quot;&gt;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; function =
mapplet_apply(name, minx, miny, maxx, maxy, redraw) {</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
document.mapserv.imgbox.value =3D minx + &quot; &quot; + miny + &quot; =
&quot; + maxx + &quot; &quot; + maxy;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
document.mapserv.imgxy.value =3D minx + &quot; &quot; + miny;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; }</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; function =
mapplet_error(message) {</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
alert(message);</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; } </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&lt;/SCRIPT&gt;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">into the =
&lt;HEAD&gt;&lt;/HEAD&gt;</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">2) changing the form header to =
&lt;form name=3D&quot;mapserv&quot; method=3DGET =
action=3D&quot;[program]&quot;&gt;</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">3) putting in </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&lt;input type=3D&quot;hidden&quot; =
name=3D&quot;imgxy&quot; value=3D&quot;299.5 299.5&quot;&gt;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&lt;input type=3D&quot;hidden&quot; =
name=3D&quot;imgbox&quot; value=3D&quot;-1 -1 -1 -1&quot;&gt;</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">4) swopping &lt;INPUT =
NAME=3D&quot;img&quot; TYPE=3D&quot;image&quot; SRC=3D&quot;[img]&quot; =
width=3D&quot;600&quot; height=3D&quot;600&quot; =
border=3D1&gt;&nbsp;&nbsp;&nbsp; for</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; &lt;applet =
codebase=3D&quot;/java/mapplet&quot; code=3D&quot;mapplet.class&quot; =
width=3D&quot;600&quot; height=3D&quot;600&quot; =
name=3D&quot;mapplet&quot; MAYSCRIPT&gt;</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp; &lt;param name=3D&quot;image&quot; =
value=3D&quot;<A HREF=3D"http://" =
TARGET=3D"_blank">http://</A>[host][img]&quot;&gt;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;/applet&gt;</FONT>
</P>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Arial">Unfortunately when I tried to open the =
page, the image was now just a grey area covering 600x600 and no zoom =
box could be generated by dragging the mouse.</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">I decided to wrap the applet code =
to</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;object =
width=3D&quot;600&quot; height=3D&quot;600&quot; =
classid=3D&quot;clsid:8AD9C840-044E-11D1-B3E9-00805F499D93&quot; =
</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; codebase=3D&quot;<A =
HREF=3D"http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-=
i586.cab#Version=3D1,4,0,0" =
TARGET=3D"_blank">http://java.sun.com/products/plugin/autodl/jinstall-1_=
4-windows-i586.cab#Version=3D1,4,0,0</A>&quot; </FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
standby=3D&quot;Please wait&quot;&gt;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;applet codebase=3D&quot;/java/mapplet&quot; =
code=3D&quot;mapplet.class&quot; width=3D&quot;600&quot; =
height=3D&quot;600&quot; name=3D&quot;mapplet&quot; =
MAYSCRIPT&gt;</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp; &lt;param name=3D&quot;image&quot; =
value=3D&quot;<A HREF=3D"http://" =
TARGET=3D"_blank">http://</A>[host][img]&quot;&gt;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;/applet&gt;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;/object&gt;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">in order to install JRE1.4 but once =
it downloaded, it corrupted the browser (IE6) and asked me to debug the =
browser.</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">I then took out the &lt;OBJECT&gt; =
wrapper, (and the browser worked again) but now it puts a red 'X' in =
the map image and says &quot;Loading Java Applet =
failed....&quot;</FONT></P>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Arial">Is there anything that I am doing =
wrong.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Regards</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Kevin</FONT>
</P>
<BR>

</BODY>
</HTML>
------_=_NextPart_001_01C35C24.D0C02FE0--



More information about the mapserver-users mailing list