jBox zoom problem

Richard Greenwood richard.greenwood at GMAIL.COM
Fri Oct 15 14:09:42 PDT 2004


On Fri, 15 Oct 2004 14:50:19 -0500, Yannick Doiron
<yannick.doiron at cipanb.ca> wrote:
> Hi List,
> 
> This my first message to the forum. I've installed the jBox applet by
> following the jBox How-To found in the Mapserver documentation page. Now i
> am in the "Fine Tunning with Javascript" section like turning the Box
> dragging on and off. With my little knowledge in Javascript, i tried to
> figure it out but with no success. I am getting an error with Internet
> Explorer when i am using the code bellow "...Failure to evaluate
> reset_handler('jBox',-1.0,-1.0,-1.0,-1.0);".
> 
> Can someone help me complete or change what I have so fare to have jBox
> working correctly?
> 
> I am using mapserver 4.0 as CGI on winxp pro
> 
> Here's the codes I am using right now.
> 
> <script language="JavaScript">
> 
> //********the function i am trying to figure out********
> 
> if(document.zoomdir[1].checked){
>  document.jBox.dragoff();
>  document.jBox.boxon();
>       }
>       else{
>     document.jBox.boxoff();
>        }
> 
> //******jBox functions*********
> 
> function setbox_handler(name, minx, miny, maxx, maxy) {
>               document.mapserv.imgbox.value = minx + " " + miny + " " +
> maxx + " " + maxy;
>               document.mapserv.imgxy.value = minx + " " + miny;
>               document.mapserv.submit();
>             }
> 
> function seterror_handler(message) {
>               alert(message);
>          }
> 
> </script>
> 
> ....here's the jBox applet section...
> 
> <td colspan="2">
> 
>  <applet
>                codebase="/java/jBox"
>                archive="jBoxPNG.jar,png.jar"
>                code="jBoxPNG.class"
>                width="570"
>                height="570"
>                name="jBox"
>                MAYSCRIPT>
>                <param name="image" value="http://[host][img]">
>          </applet>
>  </td>
> 
> ...here's the radio buttons for the zooms...
> 
> <input type="radio" name="mode" value="query"> <b>Query </b>
> <input type="radio" name="mode" value="browse" checked><b>Browse</b><br><p>
> 
> <input type=radio name=zoomdir  value=0 onClick="document.jBox.dragon();"
> [zoomdir_0_check]> Pan <p>
> <input type=radio name=zoomdir  value=1 [zoomdir_1_check]> Zoom In <p>
> <input type=radio name=zoomdir  value=-1 onClick="document.jBox.boxoff();"
> [zoomdir_-1_check]> Zoom Out <p>
> <input type=text name=zoomsize  size=1 value=2> Zoom size
> 
> ...and here's the hidden input type option value....
> 
> <input type="hidden" name="imgxy" value="299.5 299.5">
> <input type="hidden" name="imgext" value="[mapext]">
> <input type="hidden" name="map" value="[map]">
> <input type="hidden" name="savequery" value="true">
> <input type="hidden" name="program" value="[program]">
> <input type="hidden" name="map_web_imagepath" value="[map_web_imagepath]">
> <input type="hidden" name="map_web_imageurl" value="[map_web_imageurl]">
> <input type="hidden" name="imgbox" value="-1 -1 -1 -1">
> 
> Any help will ben greatly appreciate, I am turning around with this for a
> while..
> 
> Yannick Doiron
> Technicien en géomatique
> CIPA inc.
> 1040, rue du Parc, pièce 1
> Paquetville (Nouveau-Brunswick)  E8R 1J7
> Téléphone: (506) 764-1030 Télécopieur: (506) 764-1039
> www.cipanb.ca
> 

Just add an empty reset handler function (below) to your page.

   function reset_handler(name, minx, miny, maxx, maxy) { }

Regards,
-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com



More information about the MapServer-users mailing list