dBox Zoom out

Richard Greenwood richard.greenwood at GMAIL.COM
Wed Mar 7 18:25:11 PST 2007


On 3/7/07, Lawrence Hartpence <hartpence_gis at co.jasper.ia.us> wrote:
> Hello,
>
> I am very new to using dBox, but almost have a mapping site that is ready to
> go.  The only problem I have at this point is that I can not get teh zoom out
> tool to work.  The code is pretty musch the same as the simple example Steve
> Lime gave me execpt I am trying to use a pulldown list instead of radio buttons.
>
> My site is at:
> http://216.203.113.94/JasperMaps/LandCorner/LandCorner.html
>
> Does anyone have any ideas what I am doing wrong?
>
> Thanks much!!
>
> Lawrence Hartpence
>

It looks like it partially works; clicking around recenters the map,
but doesn't change the scale. The two parameters that MapServer is
evaluating for a zoom-out are zoomdir and zoomsize. zoomdir needs to
be -1, 0 , 1 for zoom-out, pan, zoom-in, respectively.  zoomsize is
scale factor, typically 2. Soo look at those two parameters. I'm
betting that one is being set incorrectly.

I use a chuck of code to display client side info which I am pasting
below. I use it to quickly see what is being passed to MapServer. You
declare a var "showDebugInfo" and to turn it on or off, and you add a
<div> "debug"</div> at the bottom of your page to display the info.

Rich

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




      if (showDebugInfo) {
         e = document.getElementById("debug");
         if(e) {
            var msg="<B>Debug Info:<\/B><BR>";
            msg+="<B><EM>getLayers = <\/EM><\/B>" +ms.getLayers(", ")+"<br>";
            /*
            msg+="<BR><B><EM>Legend Object: <\/EM><\/B><br>"
            for (var x in legend.treeLegend) {
               msg+="<B><EM>"+x + " = <\/EM><\/B>" +
eval("legend.treeLegend."+x) + "<BR>";
            }
            */
            msg+="<BR><B><EM>Map Object: <\/EM><\/B><br>"
            for (var x in ms) {
               msg+="<B><EM>"+x + " = <\/EM><\/B>" + eval("ms."+x) + "<BR>";
            }
            e.innerHTML = msg; //  "<a target=new href='" + ms.url +
"'>open current image in a new window<\/a>";
         }
      }

      e = document.getElementById("printable");
       if(e)
        e.innerHTML = "<a href='"+ms.url+"' target='_blank'>printable map<\/a>";
   }



More information about the MapServer-users mailing list