[Mapserver-users] JBox with Mozilla 1.6, Load java applet faild

Richard Greenwood rich at greenwoodmap.com
Wed Mar 10 09:24:03 EST 2004


Shiming Li wrote:
> I tried to implement the zoom-box with the jBox, but it shows  grey 
> color in the image area. There is a message showed in the status bar: 
> Loading Java Applet failed.
> Following  http://mapserver.gis.umn.edu/doc40/jbox-howto.html.
> 1)  inserted
> <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>
> 2) change the line to <form method=GET action="[program]" name="mapserv">
> inserted the line <input type="hidden" name="imgbox" value="-1 -1 -1 -1">
> 3) replace output map image defination with the following
>   <td  align="center" colspan="2">
>           <applet
>                 
> codebase="/usr/local/apache2/htdocs/titasca/java/mapplet/lib"
>                 code="jBoxPNG.class"
>                 archive="jBoxPNG.jar,png.jar"
>                 width="600"
>                 height="600"
>                 name="jBoxPNG"
>                 MAYSCRIPT>
>             <param name="image" value="http://[host][img]">
>           </applet>
>     </td>     The directory of the lib and the jBox* files can be 
> accessable and executed by all persons.
> 
> I had installed the Java SDK 1.4.2,  other information Mozilla 1.6, SuSE 
> linux, MapServer 4.01.
> 
> Is there something wrong?
> 
> Regards,
> karl

Try another site e.g. www2.tetonwyo.org/mapserver to see if Java is 
working with your browser, or if there is a problem with your server 
side implementation. Or try a different browser and/or platform with 
your implementation.

I notice that your are using the PNG version. Do you have the sixlegs 
class library in place? And are you creating PNGs in your .map file? Are 
they being written in your tmp directory? On your system (with JRE 
1.4.x) sixlegs is not required to render PNG's, so try instead just 
using jBox rather than jBoxPNG.

There are problems with JRE 1.4.2 with Mozilla and Firefox (see 
http://plugindoc.mozdev.org/) and I would recommend 1.4.1. However, on 
the systems I have tested, the problem does not prevent an initial map 
from displaying. Nor does it cause an "unable to load applet" error message.

Regards,
-- 
Richard Greenwood
www.greenwoodmap.com



More information about the mapserver-users mailing list